2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/scsi
Christoph Hellwig 4937e604ca scsi: core: Enforce unlimited max_segment_size when virt_boundary_mask is set
The virt_boundary_mask limit requires an unlimited max_segment_size for
bio splitting to not corrupt data.  Historically, the block layer tried
to validate this, although the check was half-hearted until the addition
of the atomic queue limits API.  The full blown check then triggered
issues with stacked devices incorrectly inheriting limits such as the
virt boundary and got disabled in commit b561ea56a2 ("block: allow
device to have both virt_boundary_mask and max segment size") instead of
fixing the issue properly.

Ensure that the SCSI mid layer doesn't set the default low
max_segment_size limit for this case, and check for invalid
max_segment_size values in the host template, similar to the original
block layer check given that SCSI devices can't be stacked.

This fixes reported data corruption on storvsc, although as far as I can
tell storvsc always failed to properly set the max_segment_size limit as
the SCSI APIs historically applied that when setting up the host, while
storvsc only set the virt_boundary_mask when configuring the scsi_device.

Fixes: 81988a0e6b ("storvsc: get rid of bounce buffer")
Fixes: b561ea56a2 ("block: allow device to have both virt_boundary_mask and max segment size")
Reported-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20250624125233.219635-3-hch@lst.de
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-06-24 21:20:58 -04:00
..
aacraid scsi: aacraid: Remove useless code 2025-05-27 22:03:29 -04:00
aic7xxx treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
aic94xx treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
arcmsr treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
arm treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
be2iscsi treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
bfa treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
bnx2fc treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
bnx2i treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
csiostor treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
cxgbi treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
device_handler move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
elx scsi: elx: efct: Fix memory leak in efct_hw_parse_filter() 2025-06-16 17:52:05 -04:00
esas2r treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
fcoe treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
fnic scsi: fnic: Fix missing DMA mapping error in fnic_send_frame() 2025-06-19 23:07:57 -04:00
hisi_sas treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
ibmvscsi treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
ibmvscsi_tgt scsi: Switch to use hrtimer_setup() 2025-02-18 11:19:03 +01:00
isci treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
libfc treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
libsas treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
lpfc treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
megaraid scsi: megaraid_sas: Fix invalid node index 2025-06-19 22:47:46 -04:00
mpi3mr scsi: mpi3mr: Event processing debug improvement 2025-04-28 21:54:03 -04:00
mpt3sas scsi: mpt3sas: Fix _ctl_get_mpt_mctp_passthru_adapter() to return IOC pointer 2025-05-20 22:03:15 -04:00
mvsas Merge branch '6.16/scsi-queue' into 6.16/scsi-fixes 2025-06-09 15:34:06 -04:00
pcmcia scsi: Add missing MODULE_DESCRIPTION() macros 2024-06-11 21:33:58 -04:00
pm8001 Merge branch '6.15/scsi-fixes' into 6.16/scsi-staging 2025-04-28 20:56:57 -04:00
qedf scsi: qedf: Use designated initializer for struct qed_fcoe_cb_ops 2025-05-08 09:42:06 -07:00
qedi scsi: qedi: Remove unused qedi_get_proto_itt() 2025-04-21 21:51:09 -04:00
qla2xxx scsi: qla2xxx: Fix DMA mapping test in qla24xx_get_port_database() 2025-06-23 13:21:59 -04:00
qla4xxx scsi: qla4xxx: Fix missing DMA mapping error in qla4xxx_alloc_pdu() 2025-06-23 13:23:45 -04:00
smartpqi treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
snic scsi: Constify struct pci_device_id 2024-12-09 21:59:52 -05:00
sym53c8xx_2 treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
.gitignore
3w-9xxx.c scsi: Constify struct pci_device_id 2024-12-09 21:59:52 -05:00
3w-9xxx.h
3w-sas.c Merge patch series "scsi: Constify 'struct bin_attribute'" 2025-01-02 15:08:42 -05:00
3w-sas.h scsi: 3w-sas: Replace 1-element arrays with flexible array members 2023-01-12 00:09:52 -05:00
3w-xxxx.c scsi: Constify struct pci_device_id 2024-12-09 21:59:52 -05:00
3w-xxxx.h
53c700_d.h_shipped
53c700.c scsi: Convert SCSI drivers to .sdev_configure() 2024-12-04 15:34:28 -05:00
53c700.h
53c700.scr
a100u2w.c scsi: Constify struct pci_device_id 2024-12-09 21:59:52 -05:00
a100u2w.h
a2091.c scsi: a2091: Declare SCSI host template const 2023-03-24 19:19:20 -04:00
a2091.h
a3000.c scsi: Switch back to struct platform_driver::remove() 2024-11-06 20:45:25 -05:00
a3000.h
a4000t.c scsi: Switch back to struct platform_driver::remove() 2024-11-06 20:45:25 -05:00
advansys.c scsi: Constify struct pci_device_id 2024-12-09 21:59:52 -05:00
aha152x.c scsi: make aha152x depend on !HIGHMEM 2025-05-05 13:22:39 -06:00
aha152x.h
aha1542.c scsi: Add missing MODULE_DESCRIPTION() macros 2024-06-11 21:33:58 -04:00
aha1542.h
aha1740.c scsi: Add missing MODULE_DESCRIPTION() macros 2024-06-11 21:33:58 -04:00
aha1740.h
am53c974.c scsi: Constify struct pci_device_id 2024-12-09 21:59:52 -05:00
atari_scsi.c scsi: Switch back to struct platform_driver::remove() 2024-11-06 20:45:25 -05:00
atp870u.c scsi: Constify struct pci_device_id 2024-12-09 21:59:52 -05:00
atp870u.h
BusLogic.c scsi: Constify struct pci_device_id 2024-12-09 21:59:52 -05:00
BusLogic.h scsi: Convert SCSI drivers to .sdev_configure() 2024-12-04 15:34:28 -05:00
bvme6000_scsi.c scsi: Switch back to struct platform_driver::remove() 2024-11-06 20:45:25 -05:00
ch.c scsi: ch: Make ch_sysfs_class constant 2024-03-10 18:15:48 -04:00
constants.c
dc395x.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
dc395x.h
dmx3191d.c scsi: Constify struct pci_device_id 2024-12-09 21:59:52 -05:00
esp_scsi.c scsi: Convert SCSI drivers to .sdev_configure() 2024-12-04 15:34:28 -05:00
esp_scsi.h scsi: esp: Fix variable typo 2025-01-02 13:42:35 -05:00
fdomain_isa.c
fdomain_pci.c scsi: Constify struct pci_device_id 2024-12-09 21:59:52 -05:00
fdomain.c scsi: fdomain: Declare SCSI host template const 2023-03-24 19:19:22 -04:00
fdomain.h
FlashPoint.c scsi: FlashPoint: Remove redundant assignment to pointer currTar_Info 2024-04-08 22:01:19 -04:00
g_NCR5380.c scsi: Add missing MODULE_DESCRIPTION() macros 2024-06-11 21:33:58 -04:00
gvp11.c scsi: gvp11: Remove unused gvp11_setup() function 2023-08-21 16:37:11 -04:00
gvp11.h
hosts.c scsi: core: Enforce unlimited max_segment_size when virt_boundary_mask is set 2025-06-24 21:20:58 -04:00
hpsa_cmd.h
hpsa.c scsi: hpsa: Replace deprecated strncpy() with strscpy_pad() 2025-02-18 21:34:08 -05:00
hpsa.h
hptiop.c scsi: Constify struct pci_device_id 2024-12-09 21:59:52 -05:00
hptiop.h
imm.c scsi: make imm depend on !HIGHMEM 2025-05-05 13:22:39 -06:00
imm.h scsi: imm: Add a module parameter for the transfer mode 2023-09-13 21:11:55 -04:00
initio.c scsi: Constify struct pci_device_id 2024-12-09 21:59:52 -05:00
initio.h
ipr.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
ipr.h move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
ips.c scsi: usb: Rename the RESERVE and RELEASE constants 2025-02-12 22:20:55 -05:00
ips.h scsi: Convert SCSI drivers to .sdev_configure() 2024-12-04 15:34:28 -05:00
iscsi_boot_sysfs.c
iscsi_tcp.c scsi: iscsi_tcp: Switch to using the crc32c library 2025-02-12 22:05:10 -05:00
iscsi_tcp.h scsi: iscsi_tcp: Switch to using the crc32c library 2025-02-12 22:05:10 -05:00
jazz_esp.c scsi: Switch back to struct platform_driver::remove() 2024-11-06 20:45:25 -05:00
Kconfig scsi: make ppa depend on !HIGHMEM 2025-05-05 13:22:39 -06:00
lasi700.c
libiscsi_tcp.c scsi: iscsi_tcp: Switch to using the crc32c library 2025-02-12 22:05:10 -05:00
libiscsi.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
mac53c94.c powerpc/macio: Make remove callback of macio driver void returned 2024-03-07 23:06:19 +11:00
mac53c94.h
mac_esp.c scsi: Switch back to struct platform_driver::remove() 2024-11-06 20:45:25 -05:00
mac_scsi.c scsi: Switch back to struct platform_driver::remove() 2024-11-06 20:45:25 -05:00
Makefile scsi: cxlflash: Remove driver 2025-02-03 18:04:55 -05:00
megaraid.c scsi: usb: Rename the RESERVE and RELEASE constants 2025-02-12 22:20:55 -05:00
megaraid.h
mesh.c powerpc updates for 6.9 2024-03-15 17:53:48 -07:00
mesh.h
mvme16x_scsi.c scsi: Switch back to struct platform_driver::remove() 2024-11-06 20:45:25 -05:00
mvme147.c scsi: mvme147: Declare SCSI host template const 2023-03-24 19:19:57 -04:00
mvme147.h
mvumi.c scsi: Convert SCSI drivers to .sdev_configure() 2024-12-04 15:34:28 -05:00
mvumi.h scsi: mvumi: Replace 1-element arrays with flexible array members 2023-01-12 00:11:11 -05:00
myrb.c scsi: myrb: Fix spelling mistake "statux" -> "status" 2025-04-28 21:14:28 -04:00
myrb.h scsi: myrb: Simplify an alloc_ordered_workqueue() invocation 2024-08-22 21:28:56 -04:00
myrs.c scsi: Convert SCSI drivers to .sdev_configure() 2024-12-04 15:34:28 -05:00
myrs.h scsi: myrs: Simplify an alloc_ordered_workqueue() invocation 2024-08-22 21:28:56 -04:00
ncr53c8xx.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
ncr53c8xx.h
NCR5380.c scsi: NCR5380: Clean up indentation 2024-08-12 22:05:50 -04:00
NCR5380.h scsi: NCR5380: Clean up indentation 2024-08-12 22:05:50 -04:00
nsp32_debug.c
nsp32_io.h
nsp32.c scsi: Constify struct pci_device_id 2024-12-09 21:59:52 -05:00
nsp32.h
pmcraid.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
pmcraid.h
ppa.c scsi: make ppa depend on !HIGHMEM 2025-05-05 13:22:39 -06:00
ppa.h scsi: ppa: Add a module parameter for the transfer mode 2023-08-21 16:32:40 -04:00
ps3rom.c scsi: Convert SCSI drivers to .sdev_configure() 2024-12-04 15:34:28 -05:00
qla1280.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
qla1280.h scsi: qla1280: Fix hw revision numbering for ISP1020/1040 2024-11-20 21:32:48 -05:00
qlogicfas408.c
qlogicfas408.h
qlogicfas.c
qlogicpti.c scsi: Convert SCSI drivers to .sdev_configure() 2024-12-04 15:34:28 -05:00
qlogicpti.h
raid_class.c scsi: core: raid_class: Remove raid_component_add() 2023-08-24 21:34:28 -04:00
script_asm.pl
scsi_bsg.c scsi: replace the fmode_t argument to ->sg_io_fn with a simple bool 2023-06-12 08:04:04 -06:00
scsi_common.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
scsi_debug.c scsi: scsi_debug: Reduce DEF_ATOMIC_WR_MAX_LENGTH 2025-05-05 22:08:35 -04:00
scsi_debugfs.c scsi: core: Improve the code for showing commands in debugfs 2024-04-08 22:12:33 -04:00
scsi_debugfs.h
scsi_devinfo.c scsi: core: devinfo: Fix typo in comment 2025-05-27 21:59:33 -04:00
scsi_dh.c
scsi_error.c scsi: error: alua: I/O errors for ALUA state transitions 2025-06-09 22:02:13 -04:00
scsi_ioctl.c block: remove the q argument from blk_rq_map_kern 2025-05-07 07:31:07 -06:00
scsi_lib_dma.c
scsi_lib_test.c scsi: core: Add passthrough tests for success and no failure definitions 2025-01-21 12:16:17 -05:00
scsi_lib.c for-6.16/block-20250523 2025-05-26 11:39:36 -07:00
scsi_logging.c
scsi_logging.h
scsi_netlink.c
scsi_pm.c
scsi_priv.h scsi: core: Remove unused scsi_dev_info_list_del_keyed() 2025-05-12 22:11:55 -04:00
scsi_proc.c scsi: core: Fix legacy /proc parsing buffer overflow 2023-07-31 15:39:39 -04:00
scsi_proto_test.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
scsi_sas_internal.h
scsi_scan.c scsi: core: Fix missing lock protection 2025-03-02 21:06:02 -05:00
scsi_sysctl.c scsi: logging: Fix scsi_logging_level bounds 2025-03-03 22:11:48 -05:00
scsi_sysfs.c Merge patch series "scsi: Constify 'struct bin_attribute'" 2025-01-02 15:08:42 -05:00
scsi_trace.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
scsi_transport_api.h
scsi_transport_fc.c scsi: scsi_transport_fc: Rename del_timer() in comment 2025-04-21 20:54:22 -04:00
scsi_transport_iscsi.c scsi: iscsi: Fix incorrect error path labels for flashnode operations 2025-06-09 15:18:49 -04:00
scsi_transport_sas.c scsi: transport: sas: spi: Fix kernel-doc for exported functions 2025-01-10 15:15:20 -05:00
scsi_transport_spi.c scsi: transport: sas: spi: Fix kernel-doc for exported functions 2025-01-10 15:15:20 -05:00
scsi_transport_srp.c scsi: scsi_transport_srp: Replace min/max nesting with clamp() 2025-04-03 10:54:31 -04:00
scsi.c scsi: Improve CDL control 2025-04-22 16:06:08 +09:00
scsicam.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
sd_dif.c block: move integrity information into queue_limits 2024-06-14 10:20:07 -06:00
sd_trace.h
sd_zbc.c scsi: sd_zbc: block: Respect bio vector limits for REPORT ZONES buffer 2025-05-12 22:35:48 -04:00
sd.c scsi: sd: Fix VPD page 0xb7 length check 2025-06-24 21:05:42 -04:00
sd.h scsi: sd: Atomic write support 2024-06-20 15:19:17 -06:00
sense_codes.h
ses.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
sg.c scsi: sg: Remove unnecessary NULL check before unregister_sysctl_table() 2025-05-20 21:59:44 -04:00
sgiwd93.c scsi: Switch back to struct platform_driver::remove() 2024-11-06 20:45:25 -05:00
sim710.c
sni_53c710.c scsi: Switch back to struct platform_driver::remove() 2024-11-06 20:45:25 -05:00
sr_ioctl.c minmax: scsi: fix mis-use of 'clamp()' in sr.c 2024-07-28 17:06:20 -07:00
sr_vendor.c
sr.c block: add a queue_limits_commit_update_frozen helper 2025-01-10 07:29:23 -07:00
sr.h scsi: sr: Fix unintentional arithmetic wraparound 2024-05-15 10:05:24 -04:00
st_options.h
st.c scsi: st: Tighten the page format heuristics with MODE SELECT 2025-03-17 22:04:22 -04:00
st.h scsi: st: Modify st.c to use the new scsi_error counters 2025-02-03 17:43:31 -05:00
stex.c scsi: Constify struct pci_device_id 2024-12-09 21:59:52 -05:00
storvsc_drv.c scsi: storvsc: Increase the timeouts to storvsc_timeout 2025-06-09 21:50:26 -04:00
sun3_scsi_vme.c
sun3_scsi.c scsi: sun3: Mark driver struct with __refdata to prevent section mismatch 2024-11-06 21:06:44 -05:00
sun3x_esp.c scsi: Switch back to struct platform_driver::remove() 2024-11-06 20:45:25 -05:00
sun_esp.c scsi: Switch back to struct platform_driver::remove() 2024-11-06 20:45:25 -05:00
virtio_scsi.c SCSI misc on 20250126 2025-01-26 16:12:44 -08:00
vmw_pvscsi.c scsi: Expand all create*_workqueue() invocations 2024-08-22 21:28:55 -04:00
vmw_pvscsi.h
wd33c93.c scsi: wd33c93: Don't use stale scsi_pointer value 2024-10-03 21:48:08 -04:00
wd33c93.h
wd719x.c scsi: wd719x: Declare SCSI host template const 2023-03-24 19:19:59 -04:00
wd719x.h
xen-scsifront.c scsi: Convert SCSI drivers to .sdev_configure() 2024-12-04 15:34:28 -05:00
zalon.c scsi: zalon: Remove trailing space after \n newline 2024-09-12 20:25:43 -04:00
zorro7xx.c
zorro_esp.c scsi: esp_scsi: Declare SCSI host template const 2023-03-24 19:19:22 -04:00