]> git.proxmox.com Git - mirror_ubuntu-kernels.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)
commit4daf7fa07ee3c31d5b03b87f96dbf3d8151ef654
tree7059a7a8b897cf6fded61c06b01c4acaf51b3070
parenta25d4261582cf00dad884c194d21084836663d3d
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: db1312dd9548 ("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