Skip to content

Commit 5c09cfa

Browse files
Hongbo Ligregkh
authored andcommitted
cxl: Constify struct kobj_type
This 'struct kobj_type' is not modified. It is only used in kobject_init_and_add() which takes a 'const struct kobj_type *ktype' parameter. Constifying this structure and moving it to a read-only section, and can increase over all security. Signed-off-by: Hongbo Li <lihongbo22@huawei.com> Link: https://lore.kernel.org/r/20240904011951.2010646-1-lihongbo22@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e9e46ed commit 5c09cfa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/misc/cxl/sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ static void release_afu_config_record(struct kobject *kobj)
579579
kfree(cr);
580580
}
581581

582-
static struct kobj_type afu_config_record_type = {
582+
static const struct kobj_type afu_config_record_type = {
583583
.sysfs_ops = &kobj_sysfs_ops,
584584
.release = release_afu_config_record,
585585
.default_groups = afu_cr_groups,

0 commit comments

Comments
 (0)