nvmet-tcp: add bounds check on Transfer Tag
authorVarun Prakash <varun@chelsio.com>
Tue, 20 Sep 2022 18:36:49 +0000 (00:06 +0530)
committerChristoph Hellwig <hch@lst.de>
Tue, 27 Sep 2022 07:22:08 +0000 (09:22 +0200)
commitb6a545ffa2c192b1e6da4a7924edac5ba9f4ea2b
tree446e00e2bd252c66f8a0191b4d4eea5c9fe6b0cf
parentf614b937d850193588f161ff854a4e19940a5e43
nvmet-tcp: add bounds check on Transfer Tag

ttag is used as an index to get cmd in nvmet_tcp_handle_h2c_data_pdu(),
add a bounds check to avoid out-of-bounds access.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/tcp.c