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]
Date: Sat, 22 Jun 2024 16:35:32 +0200
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 V3 11/51] posix-cpu-timers: Handle SIGEV_NONE timers
 correctly in timer_set()

Le Mon, Jun 10, 2024 at 06:42:18PM +0200, Thomas Gleixner a écrit :
> Expired SIGEV_NONE oneshot timers must return 0 nsec for the expiry time in
> timer_get(), but the posix CPU timer implementation returns 1 nsec.
> 
> Add the missing conditional.
> 
> This will be cleaned up in a follow up patch.
> 
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
> V2: Split out into new patch to make review simpler - Frederic
> ---
>  kernel/time/posix-cpu-timers.c |   11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> --- a/kernel/time/posix-cpu-timers.c
> +++ b/kernel/time/posix-cpu-timers.c
> @@ -706,7 +706,16 @@ static int posix_cpu_timer_set(struct k_
>  				old_expires = exp - val;
>  				old->it_value = ns_to_timespec64(old_expires);
>  			} else {
> -				old->it_value.tv_nsec = 1;
> +				/*
> +				 * A single shot SIGEV_NONE timer must return 0, when it is
> +				 * expired! Timers which have a real signal delivery mode
> +				 * must return a remaining time greater than 0 because the
> +				 * signal has not yet been delivered.
> +				 */
> +				if (sigev_none)

Does this patch build? The sigev_none variable doesn't seem to exist.

Thanks.

> +					old->it_value.tv_nsec = 0;
> +				else
> +					old->it_value.tv_nsec = 1;
>  				old->it_value.tv_sec = 0;
>  			}
>  		}
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ