Skip to content

Commit c772be5

Browse files
committed
param: fix uninitialized read with CONFIG_DEBUG_LOCK_ALLOC
ignore_lockdep is uninitialized, and sysfs_attr_init() doesn't initialize it, so memset to 0. Reported-by: Huang Ying <[email protected]> Cc: Eric W. Biederman <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
1 parent 574732c commit c772be5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/params.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ static __modinit int add_sysfs_param(struct module_kobject *mk,
642642
mk->mp->grp.attrs = new_attrs;
643643

644644
/* Tack new one on the end. */
645+
memset(&mk->mp->attrs[mk->mp->num], 0, sizeof(mk->mp->attrs[0]));
645646
sysfs_attr_init(&mk->mp->attrs[mk->mp->num].mattr.attr);
646647
mk->mp->attrs[mk->mp->num].param = kp;
647648
mk->mp->attrs[mk->mp->num].mattr.show = param_attr_show;

0 commit comments

Comments
 (0)