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)
commit48b4c010c85bbd319fbcae79b2d602857a2e9345
treeae315b9b172357e5665c8184a145a11be6129195
parentde5878048e11f1ec44164ebb8994de132074367a
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