linux/drivers/scsi
Stefan Hajnoczi ab4fb1d8f6 scsi: sd: reject invalid pr_read_keys() num_keys values
The pr_read_keys() interface has a u32 num_keys parameter. The SCSI
PERSISTENT RESERVE IN command has a maximum READ KEYS service action
size of 65536 bytes. Reject num_keys values that are too large to fit
into the SCSI command.

This will become important when pr_read_keys() is exposed to untrusted
userspace via an <linux/pr.h> ioctl.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-12-04 07:19:26 -07:00
..
aacraid scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
aic7xxx scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
aic94xx scsi: aic94xx: Remove redundant code 2025-08-25 11:58:46 -04:00
arcmsr scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
arm
be2iscsi
bfa scsi: bfa: Remove self-assignment code 2025-09-09 22:57:37 -04:00
bnx2fc
bnx2i
csiostor scsi: csiostor: Fix some spelling errors 2025-08-30 21:47:03 -04:00
cxgbi
device_handler
elx SCSI misc on 20250730 2025-07-31 12:13:53 -07:00
esas2r
fcoe
fnic scsi: fnic: Switch to use %ptSp 2025-11-19 12:28:03 +01:00
hisi_sas scsi: hisi_sas: Use dev_parent_is_expander() helper 2025-08-18 22:08:30 -04:00
ibmvscsi
ibmvscsi_tgt
isci scsi: isci: Use dev_parent_is_expander() helper 2025-08-18 22:08:30 -04:00
libfc scsi: libfc: Prevent integer overflow in fc_fcp_recv_data() 2025-10-06 22:27:28 -04:00
libsas SCSI misc on 20251002 2025-10-03 19:17:48 -07:00
lpfc pci-v6.18-changes 2025-10-06 10:41:03 -07:00
megaraid scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
mpi3mr SCSI misc on 20251002 2025-10-03 19:17:48 -07:00
mpt3sas SCSI misc on 20251002 2025-10-03 19:17:48 -07:00
mvsas scsi: mvsas: Fix use-after-free bugs in mvs_work_queue 2025-09-29 17:26:20 -04:00
pcmcia scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
pm8001 scsi: pm80xx: Avoid -Wflex-array-member-not-at-end warnings 2025-09-09 22:40:32 -04:00
qedf
qedi
qla2xxx SCSI misc on 20251011 2025-10-11 11:49:00 -07:00
qla4xxx Merge branch '6.18/scsi-queue' into 6.18/scsi-fixes 2025-10-13 15:54:13 -04:00
smartpqi scsi: smartpqi: Replace kmalloc() + copy_from_user() with memdup_user() 2025-09-24 21:41:24 -04:00
snic scsi: snic: Switch to use %ptSp 2025-11-19 12:30:11 +01:00
sym53c8xx_2
.gitignore
3w-9xxx.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
3w-9xxx.h
3w-sas.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
3w-sas.h
3w-xxxx.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
3w-xxxx.h
53c700.c
53c700.h
53c700.scr
53c700_d.h_shipped
BusLogic.c for-6.18/block-20250929 2025-10-02 10:16:56 -07:00
BusLogic.h scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
FlashPoint.c
Kconfig Drivers: hv: Add CONFIG_HYPERV_VMBUS option 2025-10-01 00:00:42 +00:00
Makefile
NCR5380.c
NCR5380.h
a100u2w.c
a100u2w.h
a2091.c
a2091.h
a3000.c
a3000.h
a4000t.c
advansys.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
aha152x.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
aha152x.h
aha1542.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
aha1542.h
aha1740.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
aha1740.h
am53c974.c
atari_scsi.c
atp870u.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
atp870u.h
bvme6000_scsi.c
ch.c
constants.c
dc395x.c
dc395x.h
dmx3191d.c
esp_scsi.c
esp_scsi.h
fdomain.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
fdomain.h
fdomain_isa.c
fdomain_pci.c
g_NCR5380.c
gvp11.c
gvp11.h
hosts.c scsi: core: Fix a regression triggered by scsi_host_busy() 2025-10-20 11:57:52 -04:00
hpsa.c scsi: hpsa: Replace kmalloc() + copy_from_user() with memdup_user() 2025-09-24 21:41:24 -04:00
hpsa.h
hpsa_cmd.h
hptiop.c
hptiop.h
imm.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
imm.h
initio.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
initio.h
ipr.c SCSI misc on 20251002 2025-10-03 19:17:48 -07:00
ipr.h
ips.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
ips.h scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
iscsi_boot_sysfs.c
iscsi_tcp.c
iscsi_tcp.h
jazz_esp.c
lasi700.c
libiscsi.c
libiscsi_tcp.c
mac53c94.c
mac53c94.h
mac_esp.c
mac_scsi.c
megaraid.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
megaraid.h scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
mesh.c scsi: Add PM_EVENT_POWEROFF into suspend callbacks 2025-11-14 17:05:53 +01:00
mesh.h
mvme16x_scsi.c
mvme147.c
mvme147.h
mvumi.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
mvumi.h
myrb.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
myrb.h
myrs.c scsi: myrs: Fix dma_alloc_coherent() error check 2025-08-19 22:30:57 -04:00
myrs.h
ncr53c8xx.c
ncr53c8xx.h
nsp32.c
nsp32.h
nsp32_debug.c
nsp32_io.h
pmcraid.c
pmcraid.h
ppa.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
ppa.h
ps3rom.c
qla1280.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
qla1280.h
qlogicfas.c
qlogicfas408.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
qlogicfas408.h scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
qlogicpti.c
qlogicpti.h
raid_class.c
script_asm.pl
scsi.c
scsi_bsg.c
scsi_common.c
scsi_debug.c SCSI misc on 20251002 2025-10-03 19:17:48 -07:00
scsi_debugfs.c
scsi_debugfs.h
scsi_devinfo.c
scsi_dh.c
scsi_error.c scsi: core: Fix the unit attention counter implementation 2025-10-21 21:09:36 -04:00
scsi_ioctl.c
scsi_lib.c scsi: scsi_lib: drop nth_page() usage within SG entry 2025-09-21 14:22:08 -07:00
scsi_lib_dma.c
scsi_lib_test.c
scsi_logging.c
scsi_logging.h
scsi_netlink.c
scsi_pm.c
scsi_priv.h
scsi_proc.c
scsi_proto_test.c
scsi_sas_internal.h
scsi_scan.c
scsi_sysctl.c
scsi_sysfs.c Merge branch '6.17/scsi-queue' into 6.17/scsi-fixes 2025-08-12 21:36:18 -04:00
scsi_trace.c
scsi_transport_api.h
scsi_transport_fc.c
scsi_transport_iscsi.c SCSI misc on 20250806 2025-08-06 15:44:25 +03:00
scsi_transport_sas.c
scsi_transport_spi.c
scsi_transport_srp.c
scsicam.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
sd.c scsi: sd: reject invalid pr_read_keys() num_keys values 2025-12-04 07:19:26 -07:00
sd.h block: introduce disk_report_zone() 2025-11-05 08:07:21 -07:00
sd_dif.c
sd_trace.h
sd_zbc.c block: introduce disk_report_zone() 2025-11-05 08:07:21 -07:00
sense_codes.h
ses.c
sg.c scsi: sg: Do not sleep in atomic context 2025-11-19 22:46:36 -05:00
sgiwd93.c
sim710.c
sni_53c710.c
sr.c scsi: sr: Reinstate rotational media flag 2025-08-30 21:46:21 -04:00
sr.h
sr_ioctl.c
sr_vendor.c
st.c
st.h
st_options.h
stex.c scsi: Add PM_EVENT_POWEROFF into suspend callbacks 2025-11-14 17:05:53 +01:00
storvsc_drv.c Merge branch '6.18/scsi-queue' into 6.18/scsi-fixes 2025-10-13 15:54:13 -04:00
sun3_scsi.c
sun3_scsi_vme.c
sun3x_esp.c
sun_esp.c
virtio_scsi.c
vmw_pvscsi.c
vmw_pvscsi.h
wd33c93.c
wd33c93.h
wd719x.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
wd719x.h
xen-scsifront.c
zalon.c
zorro7xx.c
zorro_esp.c