]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-auth: fix off by one checks
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 18 Jul 2022 11:09:32 +0000 (14:09 +0300)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Aug 2022 23:22:48 +0000 (17:22 -0600)
commit5e6df765863a8cdafb2bef274c66a9da5abc5447
tree7059a7a8b897cf6fded61c06b01c4acaf51b3070
parentede894a493fdc6be45331b0ff56920b2588b6b5d
nvme-auth: fix off by one checks

The > ARRAY_SIZE() checks need to be >= ARRAY_SIZE() to prevent reading
one element beyond the end of the arrays.

Fixes: ae0f7c067e31 ("nvmet: implement basic In-Band Authentication")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/common/auth.c