summaryrefslogtreecommitdiffstats
path: root/kernel/params.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2015-01-20 09:07:04 +1030
committerRusty Russell <rusty@rustcorp.com.au>2015-01-20 11:38:31 +1030
commitc772be52319de9756fd82f36d37a6d3e003441e3 (patch)
treeea48a4ea309a0f9c69dbf0949b52a8a763585156 /kernel/params.c
parent574732c73d155320f9358d9ee5d84beb0f4ecee2 (diff)
downloadop-kernel-dev-c772be52319de9756fd82f36d37a6d3e003441e3.zip
op-kernel-dev-c772be52319de9756fd82f36d37a6d3e003441e3.tar.gz
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>
Diffstat (limited to 'kernel/params.c')
-rw-r--r--kernel/params.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/params.c b/kernel/params.c
index bd65d136..728e05b 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -642,6 +642,7 @@ static __modinit int add_sysfs_param(struct module_kobject *mk,
mk->mp->grp.attrs = new_attrs;
/* Tack new one on the end. */
+ memset(&mk->mp->attrs[mk->mp->num], 0, sizeof(mk->mp->attrs[0]));
sysfs_attr_init(&mk->mp->attrs[mk->mp->num].mattr.attr);
mk->mp->attrs[mk->mp->num].param = kp;
mk->mp->attrs[mk->mp->num].mattr.show = param_attr_show;
OpenPOWER on IntegriCloud