From: Peter Zijlstra <peterz@infradead.org>
To: Andrei Vagin <avagin@google.com>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
Boqun Feng <boqun@kernel.org>, Waiman Long <longman@redhat.com>,
linux-kernel@vger.kernel.org,
syzbot+3d2ff92c67127d337463@syzkaller.appspotmail.com
Subject: Re: [PATCH] locking/rwsem: Fix logic error in rwsem_del_waiter()
Date: Mon, 16 Mar 2026 12:51:55 +0100 [thread overview]
Message-ID: <20260316115155.GA3738010@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20260314182607.3343346-1-avagin@google.com>
On Sat, Mar 14, 2026 at 06:26:07PM +0000, Andrei Vagin wrote:
> Commit 1ea4b473504b ("locking/rwsem: Remove the list_head from struct
> rw_semaphore") introduced a logic error in rwsem_del_waiter().
>
> The root cause of this issue is an inconsistency in the return values of
> __rwsem_del_waiter() and rwsem_del_waiter(). Specifically,
> __rwsem_del_waiter() returns true when the wait list becomes empty,
> whereas rwsem_del_waiter() is supposed to return true if the wait list
> is NOT empty.
>
> This caused a null pointer dereference in rwsem_mark_wake() because it
> was being called when sem->first_waiter was NULL.
>
> Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
> Reported-by: syzbot+3d2ff92c67127d337463@syzkaller.appspotmail.com
> Tested-by: syzbot+3d2ff92c67127d337463@syzkaller.appspotmail.com
> Fixes: 1ea4b473504b ("locking/rwsem: Remove the list_head from struct rw_semaphore")
> Signed-off-by: Andrei Vagin <avagin@google.com>
Bah, indeed. Thanks!
next prev parent reply other threads:[~2026-03-16 11:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-14 18:26 [PATCH] locking/rwsem: Fix logic error in rwsem_del_waiter() Andrei Vagin
2026-03-16 11:51 ` Peter Zijlstra [this message]
[not found] ` <025cdbad-99e1-4342-9f37-2564c555a8d1@redhat.com>
2026-03-16 17:49 ` Waiman Long
2026-03-16 19:04 ` Waiman Long
2026-03-17 21:23 ` Andrei Vagin
2026-03-17 23:39 ` Waiman Long
2026-03-18 8:02 ` [tip: locking/core] " tip-bot2 for Andrei Vagin
2026-03-18 16:49 ` Andrei Vagin
2026-03-18 17:15 ` Waiman Long
2026-03-18 20:31 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260316115155.GA3738010@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=avagin@google.com \
--cc=boqun@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=syzbot+3d2ff92c67127d337463@syzkaller.appspotmail.com \
--cc=will@kernel.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox