[PATCH] slub: Fix possible format string bug.

From: Tetsuo Handa
Date: Sat Jan 04 2014 - 02:33:30 EST


I found an unapplied patch from https://lkml.org/lkml/2013/9/19/17 .
----------
>From 38f01b48ae371058845274f4d7def4d81dbac4ea Mon Sep 17 00:00:00 2001
From: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 4 Jan 2014 16:26:00 +0900
Subject: [PATCH] slub: Fix possible format string bug.

The "name" is determined at runtime and is parsed as format string.

Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
---
mm/slub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slub.c b/mm/slub.c
index 545a170..058381e 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -5163,7 +5163,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;
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/