|
|
Message-ID: <20261129193033.GF5716@brightrain.aerifal.cx>
Date: Sun, 29 Nov 2026 14:30:33 -0500
From: Rich Felker <dalias@...c.org>
To: Markus Wichmann <nullplan@....net>
Cc: musl@...ts.openwall.com,
吴尚哲 <wushangzhe26@....pku.edu.cn>
Subject: Re: Bug in ualarm(): reads uninitialized timer data after
setitimer() fails
On Sun, Nov 29, 2026 at 01:50:17PM -0500, Rich Felker wrote:
> On Sun, Nov 29, 2026 at 07:11:37PM +0100, Markus Wichmann wrote:
> > Am Sun, Nov 29, 2026 at 10:04:05AM -0500 schrieb Rich Felker:
> > > Unfortunately ualarm has no specified contract for returning an error.
> > > I'm not sure what the best way to handle it is. Maybe we can normalize
> > > the time?
> > >
> > > Rich
> >
> > glibc will return -1 on setitimer() failure.
>
> The obsolete POSIX spec for ualarm from issue 6:
>
> https://pubs.opengroup.org/onlinepubs/007904875/functions/ualarm.html
>
> specified "No errors are defined".
>
> And indeed our current code is just wrong due to how setitimer handles
> denormalized timevals. We need to be normalizing it.
Does the attached look ok?
We should potentially also do something about the possibility of the
syscall failing (should only be possible under seccomp restrictions)
but that should be a separate patch from the actual bug fix.
Rich
View attachment "0001-ualarm-fix-failure-indeterminate-result-with-argumen.patch" of type "text/plain" (1296 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.