Commit c772be52319de9756fd82f36d37a6d3e003441e3

Authored by Rusty Russell
1 parent 574732c73d

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 <ying.huang@intel.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Showing 1 changed file with 1 additions and 0 deletions Side-by-side Diff

... ... @@ -642,6 +642,7 @@
642 642 mk->mp->grp.attrs = new_attrs;
643 643  
644 644 /* Tack new one on the end. */
  645 + memset(&mk->mp->attrs[mk->mp->num], 0, sizeof(mk->mp->attrs[0]));
645 646 sysfs_attr_init(&mk->mp->attrs[mk->mp->num].mattr.attr);
646 647 mk->mp->attrs[mk->mp->num].param = kp;
647 648 mk->mp->attrs[mk->mp->num].mattr.show = param_attr_show;