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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZyFDIP_1zeygVxa8@pavilion.home>
Date: Tue, 29 Oct 2024 21:18:40 +0100
From: Frederic Weisbecker <frederic@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
	Anna-Maria Behnsen <anna-maria@...utronix.de>,
	John Stultz <jstultz@...gle.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...nel.org>, Stephen Boyd <sboyd@...nel.org>,
	Eric Biederman <ebiederm@...ssion.com>,
	Oleg Nesterov <oleg@...hat.com>
Subject: Re: [patch V5 16/26] signal: Replace resched_timer logic

Le Tue, Oct 29, 2024 at 08:16:27PM +0100, Thomas Gleixner a écrit :
> On Tue, Oct 29 2024 at 18:55, Frederic Weisbecker wrote:
> > Le Tue, Oct 29, 2024 at 05:55:38PM +0100, Thomas Gleixner a écrit :
> >> It still happens because SIGQUEUE_PREALLOC is cleared in sigqueue_free()
> >> 
> >> __sigqueue_free() has
> >>        if (q->flags & PREALLOC)
> >>        	     return;
> >> 
> >> So the old code called __sigqueue_free() unconditionally which just
> >> returned. But now we have a condition to that effect already, so why
> >> call into __sigqueue_free() for nothing?
> >
> > 1) Signal is queued
> > 2) Timer is deleted, sigqueue() clears SIGQUEUE_PREALLOC but doesn't go
> >    further because the sigqueue is queued
> > 3) Signal is collected and delivered but it's not calling __sigqueue_free()
> >    so the sigqueue is not released.
> >
> > This is "fixed" on the subsequent patch which uses embedded sigqueue and
> > rcuref but this patch alone breaks.
> >
> > Or am I missing something that prevents it?
> 
> Again:
> 
> > 1) Signal is queued
> > 2) Timer is deleted, sigqueue() clears SIGQUEUE_PREALLOC but doesn't go
> >    further because the sigqueue is queued
> 
>   3)
>   
> void collect_signal(..)
> 
>      if (unlikely((first->flags & SIGQUEUE_PREALLOC) && (info->si_code == SI_TIMER)))
> 	*timer_sigq = first;    // Path NOT taken because SIGQUEUE_PREALLOC is not set
>      else
>      	__sigqueue_free(first); // Path taken and frees it
> 
> No?

Duh! Yes of course...

Thanks.

> 
> Thanks,
> 
>         tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ