lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqKJq-u7GGDfNONAT7tjAK-2AKQi64X8Au0N8gzPpEoNug@mail.gmail.com>
Date:	Fri, 13 Jun 2014 09:55:04 -0500
From:	Rob Herring <robherring2@...il.com>
To:	Kees Cook <keescook@...omium.org>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Grant Likely <grant.likely@...aro.org>,
	Rob Herring <robh+dt@...nel.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: Re: [PATCH] of: avoid format string parsing in kobject names

On Tue, Jun 10, 2014 at 11:57 AM, Kees Cook <keescook@...omium.org> wrote:
> 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@...omium.org>

Applied.

This seems like a non-obvious thing to do, but I guess most people
aren't dealing directly with kobjects.

Rob

> ---
>  drivers/of/base.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 8368d96ae7b4..f27d922eaece 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -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])
> --
> 1.7.9.5
>
>
> --
> Kees Cook
> Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ