]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
io_uring/fdinfo: annotate racy sq/cq head/tail reads
authorJens Axboe <axboe@kernel.dk>
Wed, 30 Apr 2025 13:17:17 +0000 (07:17 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:40:18 +0000 (14:40 +0200)
commit7c0394dbbd58998872fae303efcfa943ff1fa96e
tree028c6b986768ab2be21c798976d277a83edb0ed7
parentc240375587ddcc80e1022f52ee32b946bbc3a639
io_uring/fdinfo: annotate racy sq/cq head/tail reads

[ Upstream commit f024d3a8ded0d8d2129ae123d7a5305c29ca44ce ]

syzbot complains about the cached sq head read, and it's totally right.
But we don't need to care, it's just reading fdinfo, and reading the
CQ or SQ tail/head entries are known racy in that they are just a view
into that very instant and may of course be outdated by the time they
are reported.

Annotate both the SQ head and CQ tail read with data_race() to avoid
this syzbot complaint.

Link: https://lore.kernel.org/io-uring/6811f6dc.050a0220.39e3a1.0d0e.GAE@google.com/
Reported-by: syzbot+3e77fd302e99f5af9394@syzkaller.appspotmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
io_uring/fdinfo.c