|
|
Message-ID: <20261203222819.1245969-1-jdbaptista@pm.me>
Date: Thu, 03 Dec 2026 22:29:15 +0000
From: Joel Baptista <jdbaptista@...me>
To: musl@...ts.openwall.com
Cc: dalias@...c.org
Subject: Re: Bug in ualarm(): reads uninitialized timer data after setitimer() fails
On Sun, Nov 29, 2026 at 02:30:33PM -0500, Rich Felker wrote:
> Does the attached look ok?
Yes. I applied it to master (7813e911), built a static libc, and
tested it on x86_64 with this program:
#define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
int main(void)
{
ualarm(2500000, 3200000);
printf("%u\n", ualarm(0, 0));
return 0;
}
Without the patch it prints 0, because the first call fails with
EINVAL and the timer is never armed. With the patch it prints
2499998.
I also checked with getitimer that the interval is set to 3.200000,
and that the values 999999, 1000000, 1000001 and 4294967295 all arm
the timer without error.
You mentioned a separate patch for the case where setitimer fails.
Let me know if you plan to write it; otherwise I can take care of it.
Joel
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.