linux-stable/drivers
Sagi Grimberg cb8563f5c7 nvmet-tcp: fix out-of-bounds access when receiving multiple h2cdata PDUs
When the host sends multiple h2cdata PDUs, we keep track on
the receive progress and calculate the scatterlist index and
offsets.

The issue is that sg_offset should only be kept for the first
iov entry we map in the iovec as this is the difference between
our cursor and the sg entry offset itself.

In addition, the sg index was calculated wrong because we should
not round up when dividing the command byte offset with PAG_SIZE.

Fixes: 872d26a391 ("nvmet-tcp: add NVMe over TCP target driver")
Reported-by: Narayan Ayalasomayajula <Narayan.Ayalasomayajula@wdc.com>
Tested-by: Narayan Ayalasomayajula <Narayan.Ayalasomayajula@wdc.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2021-02-03 16:57:36 +01:00
..
accessibility
acpi libnvdimm for 5.11 2020-12-24 12:18:11 -08:00
amba
android
ata
atm
auxdisplay
base
bcma
block null_blk: cleanup zoned mode initialization 2021-01-29 07:49:22 -07:00
bluetooth
bus ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
cdrom
char UAPI Changes: 2020-12-18 12:38:28 -08:00
clk The core framework got some nice improvements this time around. We gained the 2020-12-21 10:39:37 -08:00
clocksource
connector net/connector: Add const qualifier to cb_id 2020-12-16 11:06:49 -08:00
counter
cpufreq Merge branch 'pm-cpufreq' 2020-12-22 17:59:11 +01:00
cpuidle ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2020-12-27 09:14:32 -08:00
dax libnvdimm for 5.11 2020-12-24 12:18:11 -08:00
dca
devfreq
dio
dma dmaengine updates for v5.11-rc1 2020-12-17 12:52:23 -08:00
dma-buf drm fixes for 5.11-rc1 2020-12-24 12:14:29 -08:00
edac
eisa
extcon
firewire
firmware EFI updates collected by Ard Biesheuvel: 2020-12-24 12:40:07 -08:00
fpga
fsi
gnss
gpio This is the bulk of the GPIO changes for the v5.11 kernel cycle: 2020-12-17 18:07:20 -08:00
gpu drm/amd/display: avoid uninitialized variable warning 2020-12-25 15:41:13 -08:00
greybus
hid Merge branch 'for-5.11/wacom' into for-linus 2020-12-16 11:44:38 +01:00
hsi
hv hyperv-next for 5.11 2020-12-16 11:49:46 -08:00
hwmon hwmon: (k10temp) Remove support for displaying voltage and current on Zen CPUs 2020-12-22 08:18:36 -08:00
hwspinlock
hwtracing
i2c
i3c i3c/master/mipi-i3c-hci: quiet maybe-unused variable warning 2020-12-17 10:31:30 +01:00
ide for-5.11/block-2020-12-14 2020-12-16 12:57:51 -08:00
idle
iio
infiniband block/rnbd-clt: Does not request pdu to rtrs-clt 2020-12-16 14:56:09 -07:00
input
interconnect ARM: device tree updates for 5.11 2020-12-16 16:27:35 -08:00
iommu IOMMU updates for 5.11 2020-12-16 13:58:47 -08:00
ipack
irqchip ARM: 2020-12-20 10:44:05 -08:00
isdn
leds
lightnvm lightnvm: fix memory leak when submit fails 2021-01-21 05:45:51 -07:00
macintosh
mailbox
mcb
md bcache: only check feature sets when sb->version >= BCACHE_SB_VERSION_CDEV_WITH_FEATURES 2021-01-28 07:35:07 -07:00
media ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
memory
memstick
message SCSI misc on 20201216 2020-12-16 13:34:31 -08:00
mfd mfd: ab8500-debugfs: Remove extraneous seq_putc 2020-12-26 09:19:49 -08:00
misc powerpc updates for 5.11 2020-12-17 13:34:25 -08:00
mmc
most
mtd This pull request contains changes for JFFS2, UBI and UBIFS: 2020-12-17 17:46:34 -08:00
mux
net A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy 2020-12-24 13:50:23 -08:00
nfc nfc: s3fwrn5: Remove unused NCI prop commands 2020-12-16 13:09:35 -08:00
ntb Big fix for IDT NTB and Intel NTB LTR management support 2020-12-27 09:22:55 -08:00
nubus
nvdimm libnvdimm/label: Return -ENXIO for no slot in __blk_label_update 2020-12-16 16:53:00 -08:00
nvme nvmet-tcp: fix out-of-bounds access when receiving multiple h2cdata PDUs 2021-02-03 16:57:36 +01:00
nvmem
of
opp
oprofile
parisc
parport
pci pci-v5.11-fixes-1 2020-12-25 20:17:40 -08:00
pcmcia Merge branch 'pcmcia-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux 2020-12-19 12:50:10 -08:00
perf
phy
pinctrl A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy 2020-12-24 13:50:23 -08:00
platform chrome platform changes for 5.11 2020-12-23 15:06:22 -08:00
pnp
power
powercap
pps
ps3
ptp
pwm pwm: Changes for v5.11-rc1 2020-12-19 11:51:32 -08:00
rapidio
ras
regulator
remoteproc ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
reset ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
rpmsg
rtc RTC for 5.11 2020-12-20 10:12:06 -08:00
s390 s390/dasd: Fix inconsistent kobject removal 2021-01-25 09:22:16 -07:00
sbus
scsi powerpc updates for 5.11 2020-12-17 13:34:25 -08:00
sfi
sh
siox
slimbus
soc OpenRISC updates for 5.11 2020-12-17 13:41:27 -08:00
soundwire
spi
spmi
ssb
staging UAPI Changes: 2020-12-18 12:38:28 -08:00
target SCSI misc on 20201216 2020-12-16 13:34:31 -08:00
tc
tee ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
thermal - Add Alder Lake support ACPI ids (Srinivas Pandruvada) 2020-12-18 12:19:37 -08:00
thunderbolt
tty OpenRISC updates for 5.11 2020-12-17 13:41:27 -08:00
uio
usb powerpc updates for 5.11 2020-12-17 13:34:25 -08:00
vdpa virtio,vdpa: features, cleanups, fixes 2020-12-24 12:06:46 -08:00
vfio ARM: 2020-12-20 10:44:05 -08:00
vhost virtio,vdpa: features, cleanups, fixes 2020-12-24 12:06:46 -08:00
video UAPI Changes: 2020-12-18 12:38:28 -08:00
virt
virtio virtio,vdpa: features, cleanups, fixes 2020-12-24 12:06:46 -08:00
visorbus
vlynq
vme
w1
watchdog linux-watchdog 5.11-rc1 tag 2020-12-23 15:01:49 -08:00
xen A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy 2020-12-24 13:50:23 -08:00
zorro
Kconfig
Makefile