Skip to content

loop: three small cleanups - #1238

Closed
ghost wants to merge 13 commits into
for-next_basefrom
series/1151520=>for-next
Closed

ghost wants to merge 13 commits into
for-next_basefrom
series/1151520=>for-next

Conversation

@ghost

@ghost ghost commented Sep 7, 2026

Copy link
Copy Markdown

Pull request for series with
subject: loop: three small cleanups
version: 1
url: https://patchwork.kernel.org/series/1154388/

@ghost

ghost commented Sep 7, 2026

Copy link
Copy Markdown
Author

Upstream branch: ba285ed
series: https://patchwork.kernel.org/series/1154388/
version: 1

Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/series/1154388/
error message:

Cmd('git') failed due to: exit code(128)
  cmdline: git am --3way
  stdout: 'Patch is empty.
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To record the empty patch as an empty commit, run "git am --allow-empty".
To restore the original branch and stop patching, run "git am --abort".'

conflict:


@ghost

ghost commented Sep 8, 2026

Copy link
Copy Markdown
Author

@ghost ghost removed the merge-conflict label Sep 8, 2026
@ghost
ghost force-pushed the series/1151520=>for-next branch from 45050f3 to 11d803e Compare September 8, 2026 15:51
@ghost
ghost force-pushed the for-next_base branch from a7792e9 to d7f8d66 Compare September 9, 2026 07:40
@ghost

ghost commented Sep 9, 2026

Copy link
Copy Markdown
Author

@ghost
ghost force-pushed the series/1151520=>for-next branch from 11d803e to aa5df9e Compare September 9, 2026 08:11
@ghost
ghost force-pushed the for-next_base branch from d7f8d66 to 60818a6 Compare September 10, 2026 15:29
@ghost

ghost commented Sep 10, 2026

Copy link
Copy Markdown
Author

@ghost
ghost force-pushed the series/1151520=>for-next branch from aa5df9e to 977bf06 Compare September 10, 2026 16:01
A cqe32 entry spans two CQ array slots, so the last CQ array slot can't
contain a cqe32 entry. If the CQ tail points at the last CQ array slot
and the kernel wants to write a cqe32 entry, it uses io_fill_nop_cqe()
to pad the last CQ array slot with a dummy entry and make the tail wrap
around.

However, malicious userspace can directly set IORING_CQE_F_32 on the
last CQ array slot, causing __io_uring_show_fdinfo() to read the second
cqe32 half from beyond the CQ array. Change __io_uring_show_fdinfo() to
explicitly ignore the IORING_CQE_F_32 flag in this case.

This is not a real bugfix, just tightening the code a bit, because:

1. the number of CQE slots is always a power of 2, see
   io_uring_fill_params
2. the ring_region region consists of:
    - a 64-byte header
    - pow(2, N) CQE slots (each 0x10 bytes)
    - optionally, the SQ array
3. the ring_region size must be page-aligned because it is shared memory

Together, these properties imply that the last CQE slot can't be close
before the end of a page, so the "out-of-bounds" data is in memory that
is anyway accessible to userspace.

Reported-by: Dominik Maier <[email protected]>
Fixes: 82ceb7f ("io_uring/fdinfo: handle mixed sized CQEs")
Cc: [email protected] # no impact due to memory layout
Reviewed-by: Gabriel Krisman Bertazi <[email protected]>
Signed-off-by: Jann Horn <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
@ghost
ghost force-pushed the for-next_base branch from 60818a6 to ddf8681 Compare September 12, 2026 02:26
@ghost

ghost commented Sep 12, 2026

Copy link
Copy Markdown
Author

@ghost
ghost force-pushed the series/1151520=>for-next branch from 977bf06 to 030c5d2 Compare September 12, 2026 02:58
@ghost
ghost force-pushed the for-next_base branch from ddf8681 to 1ec6755 Compare September 13, 2026 22:56
@ghost

ghost commented Sep 13, 2026

Copy link
Copy Markdown
Author

@ghost
ghost force-pushed the series/1151520=>for-next branch from 030c5d2 to f2bd7ab Compare September 13, 2026 23:27
* io_uring-7.3:
  io_uring/fdinfo: ignore IORING_CQE_F_32 in last CQ array slot
* block-7.3:
  blk-cgroup: save IRQ state in blkg_tryget_closest()
* for-7.4/io_uring:
  nvme/ioctl: call io_uring_cmd_set_res32() in ->end_io()
  io_uring/cmd: split io_uring_cmd_set_res() from io_uring_cmd_done()
  io_uring: move req_set_*() to public header
* for-7.4/block:
  block: only use REQ_FUA for direct writes if the device supports it
  block: skip redundant flush for O_DSYNC direct writes
  block: improve aligning down bios in bio_iov_iter_bounce_write
  block: cap atomic write size by PI buffer size constraints
  block: avoid integer overflows in max_integrity_io_size
  block: store GPT attributes as a raw value
* for-7.4/lazy-bounce-buffering:
  block,iomap: remove the old read side bounce buffering support
  xfs: log a message at mount time when using integrity protection
  xfs: add error injection for lazy bounce buffering
  xfs: add support for lazy direct read bounce buffering
  iomap,xfs: move integrity verification to the file system
  xfs: use BIO_COMPLETE_IN_TASK for bounce buffered read I/Os
  iomap: better read bounce buffering support
  block,iomap: fix protection information verification with initial bvec offset
  xfs: move PI generation into xfs_submit_zoned_bio
  iomap,xfs: move T10 PI handling for direct I/O into ->submit_io
  iomap: add a IOMAP_IOEND_INTEGRITY flag
  iomap: add a iomap_ioend_flags helper
  iomap: respect maximum I/O size in iomap_dio_bio_iter_one
  block: warn on too larger integrity allocations
  block: pass a maxlen argument to bio_iov_iter_get_pages
  block: add a bio_prepare_reissue helper
  block: export fs_bio_integrity_{alloc,free}
  block: split bio_iov_iter_bounce_write
* io_uring-exit-cancel.7:
  io_uring: wait for in-flight requests on ring release
  io_uring: drop registered files and buffers at release time
  io_uring: run cancelations synchronously on ring release
  io_uring/cancel: cancel and wait for all requests on process exit
  io_uring/notif: count pending zerocopy notifications per ring
  io_uring/uring_cmd: only cancel requests of the given task
  io_uring: put request files before posting the completions
  io_uring/rw: don't reap io-wq IOPOLL completions while io-wq has a reference
  io_uring: post io-wq completions from the last request reference
  io_uring/io-wq: put the request file before posting a completion
@ghost
ghost force-pushed the for-next_base branch from 1ec6755 to e2fca12 Compare September 15, 2026 09:28
@ghost

ghost commented Sep 15, 2026

Copy link
Copy Markdown
Author

@ghost
ghost force-pushed the series/1151520=>for-next branch from f2bd7ab to 92d7aad Compare September 15, 2026 10:19
* for-7.4/block:
  block: simplify disk_zone_set_cond()
  block: allow read-only and offline conventional zones
  block: fail zone management operations to read-only and offline zones
  block: always treat offline and read-only zones as dead
  block: propagate readonly and offline conditions to zone write plugs
  block: retry zone revalidation on capacity change
  block: drop all zone write plugs on capacity changes
  block: serialize zone revalidation
  block: introduce disk_for_all_zone_wplugs()
  block: improve blkdev_get_zone_info()
  block: refactor bdev_zone_is_seq()
  block: remember a zone type regardless of its condition
  block: refactor disk_update_zone_resources()
  block: refactor disk_revalidate_zone_resources()
  block: improve capacity handling during zone revalidation
  block: remove disk_free_zone_resources()
  block: cap atomic write size by PI buffer size constraints
  block: Fix the thaw_bdev reference in bdev_freeze() kernel-doc
@ghost
ghost force-pushed the for-next_base branch from e2fca12 to 5196e4c Compare September 17, 2026 19:27
@ghost

ghost commented Sep 17, 2026

Copy link
Copy Markdown
Author

@ghost
ghost force-pushed the series/1151520=>for-next branch from 92d7aad to 9224c9b Compare September 17, 2026 20:07
@ghost ghost added the V1-ci-fail label Sep 18, 2026
* block-7.3:
  selftests: ublk: fix unused_result error
@ghost
ghost force-pushed the for-next_base branch from 5196e4c to f96be02 Compare September 22, 2026 14:10
@ghost

ghost commented Sep 22, 2026

Copy link
Copy Markdown
Author

@ghost
ghost force-pushed the series/1151520=>for-next branch from 9224c9b to 9fa1416 Compare September 22, 2026 14:56
@ghost ghost added V1-ci-pass and removed V1-ci-fail labels Sep 23, 2026
@ghost
ghost force-pushed the for-next_base branch from f96be02 to 4afe92f Compare September 24, 2026 07:23
Tao Cui added 3 commits September 24, 2026 08:18
The kerneldoc of loop_set_size() points readers at loop_validate_size(),
which does not exist in the tree.  Drop the reference.

Signed-off-by: Tao Cui <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
simple_strtol() is deprecated and swallows errors.  Use kstrtoint()
in the max_loop setup code; an invalid option keeps the default and
now says so.

Only mark max_loop_specified when the option was parsed successfully.
With simple_strtol() a garbage string yields max_loop = 0, and
loop_probe()'s "max_loop_specified && max_loop" check short-circuits
on 0, so legacy autoloading is not capped.  Keeping max_loop at its
default while still setting max_loop_specified would instead turn the
default into a hard upper bound for dynamic device creation.  This
mirrors what max_loop_param_set_int() already does for the module
parameter.

Signed-off-by: Tao Cui <[email protected]>
lo_req_flush() never uses its request argument.  Drop it.

Signed-off-by: Tao Cui <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
@ghost

ghost commented Sep 24, 2026

Copy link
Copy Markdown
Author

@ghost
ghost force-pushed the series/1151520=>for-next branch from 9fa1416 to b5e2dc9 Compare September 24, 2026 08:18
@ghost
ghost force-pushed the for-next_base branch from 4afe92f to e8cd04d Compare September 24, 2026 14:23
@ghost

ghost commented Sep 24, 2026

Copy link
Copy Markdown
Author

1 similar comment
@ghost

ghost commented Sep 24, 2026

Copy link
Copy Markdown
Author

@ghost

ghost commented Sep 24, 2026

Copy link
Copy Markdown
Author

Github failed to update this PR after force push. Close it.

@ghost ghost closed this Sep 24, 2026
@ghost
ghost deleted the series/1151520=>for-next branch September 26, 2026 16:14
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants