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: <20250306093021.GA19868@redhat.com>
Date: Thu, 6 Mar 2025 10:30:21 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Hillf Danton <hdanton@...a.com>
Cc: K Prateek Nayak <kprateek.nayak@....com>,
	Mateusz Guzik <mjguzik@...il.com>,
	"Sapkal, Swapnil" <swapnil.sapkal@....com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] pipe_read: don't wake up the writer if the pipe is still
 full

On 03/06, Hillf Danton wrote:
>
> On Wed, 5 Mar 2025 12:44:34 +0100 Oleg Nesterov <oleg@...hat.com>
> > On 03/05, Hillf Danton wrote:
> > > See the loop in  ___wait_event(),
> > >
> > > 	for (;;) {
> > > 		prepare_to_wait_event();
> > >
> > > 		// flip
> > > 		if (condition)
> > > 			break;
> > >
> > > 		schedule();
> > > 	}
> > >
> > > After wakeup, waiter will sleep again if condition flips false on the waker
> > > side before waiter checks condition, even if condition is atomic, no?
> >
> > Yes, but in this case pipe_full() == true is correct, this writer can
> > safely sleep.
> >
> No, because no reader is woken up before sleep to make pipe not full.

Why the reader should be woken before this writer sleeps? Why the reader
should be woken at all in this case (when pipe is full again) ?

We certainly can't understand each other.

Could your picture the exact scenario/sequence which can hang?

Oleg.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ