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>
Thu, 18 Mar 2021 05:17:51 +0000 (06:17 +0100)
commit23a0c86a05d78d6b978caba8ed9c6a12bca0e8ea
treecc0c30fe6d95c719bec2fb29aa175bc658739614
parent7739770a67b47b3101971911c64f376c2f1e0a23
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