Commit 83340d9c authored by Shin'ichiro Kawasaki's avatar Shin'ichiro Kawasaki Committed by Keith Busch

nvme: null terminate nvme_tls_attrs

Commit 1e48b34c ("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: default avatarYi Zhang <yi.zhang@redhat.com>
Closes: https://lore.kernel.org/linux-nvme/jhllwfxcedrcxcnbajwl4x2l2ujcqowqcd4ps574zrafrqhjna@f4icvecutekm/
Fixes: 1e48b34c ("nvme: split off TLS sysfs attributes into a separate group")
Signed-off-by: default avatarShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: default avatarYi Zhang <yi.zhang@redhat.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent 3b97f5a0
...@@ -767,6 +767,7 @@ static struct attribute *nvme_tls_attrs[] = { ...@@ -767,6 +767,7 @@ static struct attribute *nvme_tls_attrs[] = {
&dev_attr_tls_key.attr, &dev_attr_tls_key.attr,
&dev_attr_tls_configured_key.attr, &dev_attr_tls_configured_key.attr,
&dev_attr_tls_keyring.attr, &dev_attr_tls_keyring.attr,
NULL,
}; };
static umode_t nvme_tls_attrs_are_visible(struct kobject *kobj, static umode_t nvme_tls_attrs_are_visible(struct kobject *kobj,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment