lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 12 Aug 2022 18:38:57 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Elijah Stone <elronnd-linux@...onnd.net>,
        linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>
Subject: Re: Futex wait is not interrupted by signals if no timeout is
 provided

[add tglx and mingo]

On 8/12/22 18:14, Elijah Stone wrote:
> I've observed a strange behaviour of futexes that I believe to be a bug.  If a signal is delivered while a futex wait is in progress, the wait will be interrupted, but only if that wait had a timeout.  I expect it to be interrupted regardless of whether a timeout is provided.  The following runnable snippet demonstrates this:
> 
> void handler(int) { printf("SIGINT\n"); }
> int main() {
>     signal(SIGINT,handler);
>     int i=2;
>     printf("1\n");
>     syscall(SYS_futex, &i, FUTEX_WAIT, 2, &(struct timespec){.tv_sec=1000});
>     printf("2\n");
>     syscall(SYS_futex, &i, FUTEX_WAIT, 2, NULL);
>     printf("3\n");
> }
> 
> Pressing ^C once causes the first wait to terminate, and '2' to be printed. But repeatedly pressing it after that does not allow the program to make progress.

-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ