diff options
| author | Thorsten Blum <thorsten.blum@linux.dev> | 2026-03-03 22:31:01 +0100 |
|---|---|---|
| committer | Keith Busch <kbusch@kernel.org> | 2026-03-10 08:20:29 -0700 |
| commit | fa655a9ca73f7df32b8ca4d14ce11742f9578288 (patch) | |
| tree | c41a10b87d1870a2d82bb2490c82cf20953ed132 /include/linux | |
| parent | 0375c81eb2256366cd9602441d48b8b937e79635 (diff) | |
nvme: Annotate struct nvme_dhchap_key with __counted_by
Add the __counted_by() compiler attribute to the flexible array member
'key' to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/nvme-auth.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/nvme-auth.h b/include/linux/nvme-auth.h index 60e069a6757f..e75c29c51464 100644 --- a/include/linux/nvme-auth.h +++ b/include/linux/nvme-auth.h @@ -11,7 +11,7 @@ struct nvme_dhchap_key { size_t len; u8 hash; - u8 key[]; + u8 key[] __counted_by(len); }; u32 nvme_auth_get_seqnum(void); |
