Skip to content

Commit 26c82ec

Browse files
axboedinguyen702
authored andcommitted
io_uring: bump poll refs to full 31-bits
[ upstream commmit e2c0cb7 ] The previous commit: 1bc84c40088 ("io_uring: remove poll entry from list when canceling all") removed a potential overflow condition for the poll references. They are currently limited to 20-bits, even if we have 31-bits available. The upper bit is used to mark for cancelation. Bump the poll ref space to 31-bits, making that kind of situation much harder to trigger in general. We'll separately add overflow checking and handling. Fixes: aa43477 ("io_uring: poll rework") Signed-off-by: Jens Axboe <[email protected]> [pavel: backport] Signed-off-by: Pavel Begunkov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 698d307 commit 26c82ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5314,7 +5314,7 @@ struct io_poll_table {
53145314
};
53155315

53165316
#define IO_POLL_CANCEL_FLAG BIT(31)
5317-
#define IO_POLL_REF_MASK ((1u << 20)-1)
5317+
#define IO_POLL_REF_MASK GENMASK(30, 0)
53185318

53195319
/*
53205320
* If refs part of ->poll_refs (see IO_POLL_REF_MASK) is 0, it's free. We can

0 commit comments

Comments
 (0)