[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFx6ShKkDjt=xdLPY1iVr4u06DMs41g-6HEqsPO8NhZAjA@mail.gmail.com>
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
--
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