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] [thread-next>] [day] [month] [year] [list]
Message-ID: <e2i2tn3a7i4ehzoeglv4n52q657hn4l3vauial2xyaqyrjyvcm@vagxk3mquxfw>
Date: Wed, 15 Oct 2025 23:53:41 +0200
From: Alejandro Colomar <alx@...nel.org>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: linux-kernel@...r.kernel.org, linux-man@...r.kernel.org, 
	André Almeida <andrealmeid@...lia.com>, Darren Hart <dvhart@...radead.org>, 
	Davidlohr Bueso <dave@...olabs.net>, Ingo Molnar <mingo@...hat.com>, 
	Juri Lelli <juri.lelli@...hat.com>, Peter Zijlstra <peterz@...radead.org>, 
	Thomas Gleixner <tglx@...utronix.de>, Valentin Schneider <vschneid@...hat.com>, 
	Waiman Long <longman@...hat.com>
Subject: Re: [PATCH v2 5/5] man/man3/pthread_cond_init.3: Add a note
 regarding real-time usage

Hi Sebastian,

On Mon, Sep 15, 2025 at 04:13:05PM +0200, Sebastian Andrzej Siewior wrote:
> The "old" implementation led to priority inversion and was more or less
> easy to trigger. It seems that after the rewrite the issue disappeared
> especially since the old workaround does not apply anymore.
> 
> Add a note mentioning the old problem and why the issue is not gone
> since the rewrite in glibc 2.25 but harder to trigger.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>

Thanks!  I've applied the patch, with the following amendments:

	diff --git i/man/man3/pthread_cond_init.3 w/man/man3/pthread_cond_init.3
	index 779f6de6d..9c151dd8c 100644
	--- i/man/man3/pthread_cond_init.3
	+++ w/man/man3/pthread_cond_init.3
	@@ -115,7 +115,7 @@ .SH DESCRIPTION
	 this guarantees that the condition cannot be signaled (and thus ignored)
	 between the time a thread locks the mutex
	 and the time it waits on the condition variable.
	-See NOTES below.
	+See CAVEATS below.
	 .P
	 .BR pthread_cond_timedwait ()
	 atomically unlocks
	@@ -241,13 +241,14 @@ .SH "SEE ALSO"
	 .BR gettimeofday (2),
	 .BR nanosleep (2).
	 .
	-.SH NOTES
	+.SH CAVEATS
	 The implementation of the provided functions until
	 glibc 2.25 used an internal data lock.
	 This lock did not support priority-inheritance and
	 was subject to unbounded priority inversion,
	 visible on a real-time system.
	-After the rewrite of the implementation in 2.25
	+.P
	+After the rewrite of the implementation in glibc 2.25
	 the usage of internal lock changed.
	 The internal lock is always acquired by
	 the signaling functions
	@@ -256,10 +257,11 @@ .SH NOTES
	 .BR pthread_cond_broadcast ().
	 The waiting function acquires the lock
	 if the waiting process was interrupted.
	-The interruption can be caused for instance by a specified timeout
	+The interruption can be caused for instance by a specified timeout,
	 and denoted by the error value
	-.B ETIMEDOUT
	-or a received signal which is denoted by the error value
	+.BR ETIMEDOUTA ,
	+or by a received signal,
	+which is denoted by the error value
	 .BR EINTR .
	 .
	 .SH EXAMPLE


Cheers,
Alex

> ---
>  man/man3/pthread_cond_init.3 | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/man/man3/pthread_cond_init.3 b/man/man3/pthread_cond_init.3
> index 0045e7ecee075..779f6de6d064b 100644
> --- a/man/man3/pthread_cond_init.3
> +++ b/man/man3/pthread_cond_init.3
> @@ -115,6 +115,7 @@ if all threads always acquire the mutex before signaling the condition,
>  this guarantees that the condition cannot be signaled (and thus ignored)
>  between the time a thread locks the mutex
>  and the time it waits on the condition variable.
> +See NOTES below.
>  .P
>  .BR pthread_cond_timedwait ()
>  atomically unlocks
> @@ -240,6 +241,26 @@ Some threads are currently waiting on
>  .BR gettimeofday (2),
>  .BR nanosleep (2).
>  .
> +.SH NOTES
> +The implementation of the provided functions until
> +glibc 2.25 used an internal data lock.
> +This lock did not support priority-inheritance and
> +was subject to unbounded priority inversion,
> +visible on a real-time system.
> +After the rewrite of the implementation in 2.25
> +the usage of internal lock changed.
> +The internal lock is always acquired by
> +the signaling functions
> +.BR pthread_cond_signal ()
> +and
> +.BR pthread_cond_broadcast ().
> +The waiting function acquires the lock
> +if the waiting process was interrupted.
> +The interruption can be caused for instance by a specified timeout
> +and denoted by the error value
> +.B ETIMEDOUT
> +or a received signal which is denoted by the error value
> +.BR EINTR .
>  .
>  .SH EXAMPLE
>  Consider two shared variables
> -- 
> 2.51.0
> 

-- 
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ