Skip to content

Commit

Permalink
slub: Fix possible format string bug.
Browse files Browse the repository at this point in the history
The "name" is determined at runtime and is parsed as format string.

Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
  • Loading branch information
Tetsuo Handa authored and Pekka Enberg committed Jan 13, 2014
1 parent c65c187 commit 26e4f20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -5169,7 +5169,7 @@ static int sysfs_slab_add(struct kmem_cache *s)
}

s->kobj.kset = slab_kset;
err = kobject_init_and_add(&s->kobj, &slab_ktype, NULL, name);
err = kobject_init_and_add(&s->kobj, &slab_ktype, NULL, "%s", name);
if (err) {
kobject_put(&s->kobj);
return err;
Expand Down

0 comments on commit 26e4f20

Please sign in to comment.