[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jLm1RNp4mB2KfeRumTqeWgcAsZ4CpQQQGA67WukERefXQ@mail.gmail.com>
Date: Tue, 10 Sep 2013 22:19:17 -0700
From: Kees Cook <keescook@...omium.org>
To: Joe Perches <joe@...ches.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Lidza Louina <lidza.louina@...il.com>,
Tushar Behera <tushar.behera@...aro.org>,
devel@...verdev.osuosl.org
Subject: Re: [PATCH] staging: dgnc: fix potential format string flaw
On Tue, Sep 10, 2013 at 10:00 PM, Joe Perches <joe@...ches.com> wrote:
> On Tue, 2013-09-10 at 21:41 -0700, Kees Cook wrote:
>> Make sure that format strings cannot leak into printk() calls from the
>> msgbuf string.
>
> printf(string);
> vs
> printf("%s", string);
>
> How does this help?
In the former case, format characters will get processed by the
sprintf logic. In the latter, they are printed as-is. In this specific
case, if there was a way to inject strings like "ohai %n" into the
msgbuf string, the former would actually attempt to resolve the %n. In
the simple case, this could lead to Oopses, and in the unlucky case,
it could allow arbitrary memory writing and execution control.
http://en.wikipedia.org/wiki/Uncontrolled_format_string
-Kees
--
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