]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet: do not allow model_number exceed 40 bytes
authorNoam Gottlieb <ngottlieb@nvidia.com>
Mon, 15 Mar 2021 14:56:11 +0000 (14:56 +0000)
committerChristoph Hellwig <hch@lst.de>
Fri, 2 Apr 2021 16:48:27 +0000 (18:48 +0200)
commita1616856e7ba87623e9426e7e3e4a2d1c88f0e8f
treeae315b9b172357e5665c8184a145a11be6129195
parenteced66e24ffb739ce7c5ed1db741231e9071ede8
nvmet: do not allow model_number exceed 40 bytes

According to the NVM specifications, the model number size should be
40 bytes (bytes 63:24 of the Identify Controller data structure).
Therefore, any attempt to store a value into model_number which
exceeds 40 bytes should return an error.

Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Signed-off-by: Noam Gottlieb <ngottlieb@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/configfs.c
drivers/nvme/target/nvmet.h