mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-23 09:56:00 +00:00
of: avoid format string parsing in kobject names
This makes sure a format string cannot leak into the kobject name that is constructed. (And splits the >80 character line.) Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Rob Herring <robh@kernel.org>
This commit is contained in:
parent
e1319ea5db
commit
28d3ee40ef
@ -227,7 +227,8 @@ static int __of_node_add(struct device_node *np)
|
||||
np->kobj.kset = of_kset;
|
||||
if (!np->parent) {
|
||||
/* Nodes without parents are new top level trees */
|
||||
rc = kobject_add(&np->kobj, NULL, safe_name(&of_kset->kobj, "base"));
|
||||
rc = kobject_add(&np->kobj, NULL, "%s",
|
||||
safe_name(&of_kset->kobj, "base"));
|
||||
} else {
|
||||
name = safe_name(&np->parent->kobj, kbasename(np->full_name));
|
||||
if (!name || !name[0])
|
||||
|
Loading…
Reference in New Issue
Block a user