summaryrefslogtreecommitdiffstats
path: root/drivers/hv
diff options
context:
space:
mode:
authorHongbo Li <lihongbo22@huawei.com>2024-09-04 09:15:53 +0800
committerWei Liu <wei.liu@kernel.org>2024-09-05 15:04:49 +0000
commit895384881ec960aa4c602397a69f0a44a8169405 (patch)
treeda21d237b5559d4b1f0329a4bdb78e754004e7e6 /drivers/hv
parent5e5cc1eb65256e6017e3deec04f9806f2f317853 (diff)
downloadlinux-895384881ec960aa4c602397a69f0a44a8169405.tar.gz
linux-895384881ec960aa4c602397a69f0a44a8169405.tar.bz2
linux-895384881ec960aa4c602397a69f0a44a8169405.zip
hv: vmbus: Constify struct kobj_type and struct attribute_group
vmbus_chan_group and vmbus_chan_type are not modified. They are only used in the helpers which take a const type parameter. Constifying these structures and moving them to a read-only section can increase over all security. ``` [Before] text data bss dec hex filename 20568 4699 48 25315 62e3 drivers/hv/vmbus_drv.o [After] text data bss dec hex filename 20696 4571 48 25315 62e3 drivers/hv/vmbus_drv.o ``` Signed-off-by: Hongbo Li <lihongbo22@huawei.com> Reviewed-by: Naman Jain <namjain@linux.microsoft.com> Link: https://lore.kernel.org/r/20240904011553.2010203-1-lihongbo22@huawei.com Signed-off-by: Wei Liu <wei.liu@kernel.org> Message-ID: <20240904011553.2010203-1-lihongbo22@huawei.com>
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/vmbus_drv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 12a707ab73f8..7b1b20fa18f6 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1803,12 +1803,12 @@ static umode_t vmbus_chan_attr_is_visible(struct kobject *kobj,
return attr->mode;
}
-static struct attribute_group vmbus_chan_group = {
+static const struct attribute_group vmbus_chan_group = {
.attrs = vmbus_chan_attrs,
.is_visible = vmbus_chan_attr_is_visible
};
-static struct kobj_type vmbus_chan_ktype = {
+static const struct kobj_type vmbus_chan_ktype = {
.sysfs_ops = &vmbus_chan_sysfs_ops,
.release = vmbus_chan_release,
};