Skip to content

Commit 8953848

Browse files
Hongbo Liliuw
authored andcommitted
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 <[email protected]> Reviewed-by: Naman Jain <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wei Liu <[email protected]> Message-ID: <[email protected]>
1 parent 5e5cc1e commit 8953848

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hv/vmbus_drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,12 +1803,12 @@ static umode_t vmbus_chan_attr_is_visible(struct kobject *kobj,
18031803
return attr->mode;
18041804
}
18051805

1806-
static struct attribute_group vmbus_chan_group = {
1806+
static const struct attribute_group vmbus_chan_group = {
18071807
.attrs = vmbus_chan_attrs,
18081808
.is_visible = vmbus_chan_attr_is_visible
18091809
};
18101810

1811-
static struct kobj_type vmbus_chan_ktype = {
1811+
static const struct kobj_type vmbus_chan_ktype = {
18121812
.sysfs_ops = &vmbus_chan_sysfs_ops,
18131813
.release = vmbus_chan_release,
18141814
};

0 commit comments

Comments
 (0)