Skip to content

Commit 83340d9

Browse files
kawasakikeithbusch
authored andcommitted
nvme: null terminate nvme_tls_attrs
Commit 1e48b34 ("nvme: split off TLS sysfs attributes into a separate group") introduced the struct attribute array nvme_tls_attrs. However, the array was not null terminated and caused BUG KASAN global- out-of-bounds. To avoid the BUG, null terminate the array. Reported-by: Yi Zhang <yi.zhang@redhat.com> Closes: https://lore.kernel.org/linux-nvme/jhllwfxcedrcxcnbajwl4x2l2ujcqowqcd4ps574zrafrqhjna@f4icvecutekm/ Fixes: 1e48b34 ("nvme: split off TLS sysfs attributes into a separate group") Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Tested-by: Yi Zhang <yi.zhang@redhat.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 3b97f5a commit 83340d9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/nvme/host/sysfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,7 @@ static struct attribute *nvme_tls_attrs[] = {
767767
&dev_attr_tls_key.attr,
768768
&dev_attr_tls_configured_key.attr,
769769
&dev_attr_tls_keyring.attr,
770+
NULL,
770771
};
771772

772773
static umode_t nvme_tls_attrs_are_visible(struct kobject *kobj,

0 commit comments

Comments
 (0)