Jens Axboe
a6bded921e
io_uring/filetable: clamp alloc_hint to the configured alloc range
...
Explicit fixed file install/remove operations on slots outside the
configured alloc range can corrupt alloc_hint via io_file_bitmap_set()
and io_file_bitmap_clear(), which unconditionally update alloc_hint to
the bit position. This causes subsequent auto-allocations to fall
outside the configured range.
For example, if the alloc range is [10, 20) and a file is removed at
slot 2, alloc_hint gets set to 2. The next auto-alloc then starts
searching from slot 2, potentially returning a slot below the range.
Fix this by clamping alloc_hint to [file_alloc_start, file_alloc_end)
at the top of io_file_bitmap_get() before starting the search.
Cc: stable@vger.kernel.org
Fixes: 6e73dffbb9 ("io_uring: let to set a range for file slot allocation")
Signed-off-by: Jens Axboe <axboe@kernel.dk >
2026-02-11 15:20:44 -07:00
..
2025-05-21 08:41:16 -06:00
2022-07-24 18:39:11 -06:00
2025-01-28 15:10:40 -07:00
2026-02-04 07:23:45 -07:00
2026-02-06 07:29:19 -07:00
2026-02-06 07:29:19 -07:00
2026-02-09 17:22:00 -08:00
2025-11-04 09:32:09 -07:00
2026-02-04 07:23:45 -07:00
2025-05-21 08:41:16 -06:00
2025-02-20 07:59:56 -07:00
2025-04-24 08:33:54 -06:00
2026-02-04 07:23:45 -07:00
2026-02-03 10:58:32 -07:00
2022-07-24 18:39:12 -06:00
2026-02-11 15:20:44 -07:00
2026-01-05 17:08:20 -07:00
2026-01-16 12:51:50 -05:00
2022-07-24 18:39:11 -06:00
2026-01-25 10:07:09 -07:00
2024-11-06 13:55:38 -07:00
2026-02-09 20:12:36 -07:00
2026-02-09 17:31:17 -08:00
2026-02-09 17:22:00 -08:00
2026-02-04 07:23:45 -07:00
2026-02-05 11:13:16 -07:00
2025-11-20 13:23:05 -07:00
2026-01-27 11:09:57 -07:00
2026-01-27 11:09:57 -07:00
2026-02-09 17:22:00 -08:00
2026-02-04 07:23:45 -07:00
2026-02-04 07:23:45 -07:00
2026-01-12 11:21:38 -07:00
2024-12-27 10:08:21 -07:00
2025-02-17 16:43:04 -08:00
2024-11-06 13:55:38 -07:00
2026-02-09 17:31:17 -08:00
2026-01-27 11:10:46 -07:00
2025-08-27 11:24:15 -06:00
2022-07-24 18:39:11 -06:00
2026-02-04 07:23:45 -07:00
2024-04-22 19:31:18 -06:00
2025-10-22 07:34:57 -06:00
2025-10-22 07:34:57 -06:00
2026-02-09 17:31:17 -08:00
2026-01-27 11:10:46 -07:00
2025-12-05 10:23:28 -07:00
2025-11-03 08:31:26 -07:00
2025-11-26 09:37:10 -07:00
2025-11-26 09:37:10 -07:00
2026-02-04 07:23:45 -07:00
2026-02-09 17:31:17 -08:00
2024-11-15 09:58:34 -07:00
2026-02-10 05:26:15 -07:00
2026-02-10 05:26:15 -07:00
2026-02-10 05:26:15 -07:00
2025-11-03 08:31:26 -07:00
2026-02-04 07:23:45 -07:00
2025-09-08 13:20:46 -06:00
2024-10-29 13:43:28 -06:00
2025-12-28 15:54:45 -07:00
2025-10-22 10:51:20 -06:00
2026-01-13 15:18:07 -05:00
2022-07-24 18:39:11 -06:00
2026-01-21 11:50:59 -07:00
2022-07-24 18:39:11 -06:00
2026-02-09 20:12:46 -07:00
2022-10-07 12:25:30 -06:00
2026-01-20 09:54:17 -07:00
2025-05-06 10:11:23 -06:00
2025-05-21 08:41:16 -06:00
2024-02-09 09:04:39 -07:00
2026-01-22 09:21:16 -07:00
2026-01-22 09:21:16 -07:00
2026-01-14 22:04:11 -07:00
2025-07-18 12:34:56 -06:00
2026-01-22 09:21:16 -07:00
2026-01-22 09:21:16 -07:00
2026-01-19 19:55:30 -07:00
2024-11-06 13:55:38 -07:00
2026-01-16 12:52:03 -05:00
2022-07-24 18:39:11 -06:00
2026-02-10 05:26:12 -07:00
2025-11-13 11:19:37 -07:00