nvme: Fix discard buffer overrun
authorKeith Busch <keith.busch@intel.com>
Thu, 1 Feb 2018 00:01:58 +0000 (17:01 -0700)
committerSagi Grimberg <sagi@grimberg.me>
Thu, 8 Feb 2018 16:35:55 +0000 (18:35 +0200)
commit8cb6af7b3a6d47f95ecb461a3f8d39cf6a64e4ae
tree41bb9867524fea4fff139d1c8a40f9d5825066eb
parent3096a739d2ccbfd6a626e388228a16558f76d79d
nvme: Fix discard buffer overrun

This patch checks the discard range array bounds before setting it in
case the driver gets a badly formed request.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/host/core.c