Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 2 Jul 2011 13:34:33 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Alan Cox <alan@...rguk.ukuu.org.uk>
Cc: Solar Designer <solar@...nwall.com>, kernel-hardening@...ts.openwall.com,
        Vasiliy Kulikov <segoon@...nwall.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        James Morris <jmorris@...ei.org>, Namhyung Kim <namhyung@...il.com>,
        Greg Kroah-Hartman <gregkh@...e.de>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] kernel: escape non-ASCII and control characters in printk()

On Sat, Jul 2, 2011 at 12:33 PM, Alan Cox <alan@...rguk.ukuu.org.uk> wrote:
>
> No but you could make "dmesg" do filtering.

So I really hate doing the filtering at the level that the original
patch did, but I would _not_ mind doing the filtering at "vsnprintf()"
time.

Even without some magic "safe" flag, in fact.

So I would not even be opposed to "%s" just doing filtering (including
considering "\n" to be a control character) by default. So "\n" would
be ok in the format string (where it is pretty common), but not for
%s.

For kernel uses that really want raw strings, we could have a %p
sequence, the way we handle other special formats.

However, that would be a patch that would need a lot more testing,
since we'd have to find the users that really do want control
characters.

                              Linus

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.