mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/6] scsi: make SG_IO user copyback failure-safe
@ 2026-10-18 15:41 Wang Yingjie
  2026-10-18 15:41 ` [PATCH 1/6] scsi: core: release SG_IO request before copying to userspace Wang Yingjie
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Wang Yingjie @ 2026-10-18 15:41 UTC (permalink / raw)
  To: James.Bottomley, mkp
  Cc: yangxiuwei, axboe, bvanassche, linux-scsi, io-uring,
	linux-kernel, Wang Yingjie

Several SCSI passthrough completion paths touch userspace while their
completed request still owns a queue tag.  Sense or READ-bounce copyback
can fault on a mapping backed by the same one-tag device, leaving the
nested I/O unable to obtain the retained tag.  The synchronous and
io_uring BSG paths additionally discard data-copyback failures.

Snapshot request-backed completion state, free each request before
userspace access, and preserve the existing error precedence while
reporting copyback failures.  This covers block-device SG_IO, CDDA,
and both synchronous and io_uring BSG completion.

Same-device one-tag tests previously left SG_IO, CDDA, and BSG tasks in
D state in blk_rq_unmap_user() -> filemap_fault.  The fixed paths
completed without a stuck task or hung-task report.  BSG tests with an
unaligned PROT_NONE destination returned false success in 20/20 runs
before the error-propagation changes and -EFAULT in 20/20 runs after
them, while writable controls continued to succeed.

The series passed scripts/checkpatch.pl --strict, focused W=1 builds,
the full bzImage build used for the wider audit, and QEMU differential
tests on the affected paths.

Yingjie Wang (6):
  scsi: core: release SG_IO request before copying to userspace
  scsi: sr: release CDDA request before copying to userspace
  scsi: bsg: release synchronous request before user copyback
  scsi: bsg: report synchronous data copyback failures
  scsi: bsg: release io_uring request before user copyback
  scsi: bsg: report io_uring data copyback failures

 drivers/scsi/scsi_bsg.c   | 60 ++++++++++++++++++++++++++-------------
 drivers/scsi/scsi_ioctl.c | 45 ++++++++++++++++++-----------
 drivers/scsi/sr.c         |  3 ++
 3 files changed, 72 insertions(+), 36 deletions(-)


base-commit: 0fcb05b72344f40806cbe810de8872f1698bf053
-- 
2.43.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-10-19  6:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-18 15:41 [PATCH 0/6] scsi: make SG_IO user copyback failure-safe Wang Yingjie
2026-10-18 15:41 ` [PATCH 1/6] scsi: core: release SG_IO request before copying to userspace Wang Yingjie
2026-10-18 15:41 ` [PATCH 2/6] scsi: sr: release CDDA " Wang Yingjie
2026-10-18 15:41 ` [PATCH 3/6] scsi: bsg: release synchronous request before user copyback Wang Yingjie
2026-10-18 15:41 ` [PATCH 4/6] scsi: bsg: report synchronous data copyback failures Wang Yingjie
2026-10-18 15:41 ` [PATCH 5/6] scsi: bsg: release io_uring request before user copyback Wang Yingjie
2026-10-18 15:41 ` [PATCH 6/6] scsi: bsg: report io_uring data copyback failures Wang Yingjie
2026-10-18 16:41 ` [PATCH 0/6] scsi: make SG_IO user copyback failure-safe Bart Van Assche
2026-10-19  6:32   ` Wang Yingjie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®