linux/drivers/nvme/target
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
..
admin-cmd.c nvmet: set right status on error in id-ns handler 2021-01-18 18:58:19 +01:00
configfs.c
core.c
discovery.c
fabrics-cmd.c
fc.c
fcloop.c nvme-fcloop: Fix sscanf type and list_first_entry_or_null warnings 2021-01-06 10:30:36 +01:00
io-cmd-bdev.c
io-cmd-file.c
Kconfig
loop.c
Makefile
nvmet.h
passthru.c
rdma.c nvmet-rdma: Fix NULL deref when setting pi_enable and traddr INADDR_ANY 2021-01-14 20:27:34 +01:00
tcp.c nvmet-tcp: fix out-of-bounds access when receiving multiple h2cdata PDUs 2021-02-03 16:57:36 +01:00
trace.c
trace.h