Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752863Ab1F1Tgu (ORCPT ); Tue, 28 Jun 2011 15:36:50 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:59974 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751060Ab1F1Tgn (ORCPT ); Tue, 28 Jun 2011 15:36:43 -0400 MIME-Version: 1.0 In-Reply-To: <20110627183829.GA16033@albatros> References: <20110623152137.GA2536@albatros> <20110626103915.GB11093@elte.hu> <20110626165409.GA2584@albatros> <20110626182628.GA20158@elte.hu> <20110626190622.GB4217@albatros> <20110626194618.GA21740@elte.hu> <20110626202518.GA4915@albatros> <20110626220126.GA24004@elte.hu> <20110627083633.GA5846@albatros> <20110627104058.45e93c41@pyx> <20110627183829.GA16033@albatros> From: Linus Torvalds Date: Tue, 28 Jun 2011 12:30:14 -0700 Message-ID: Subject: Re: [PATCH v2] kernel: escape non-ASCII and control characters in printk() To: Vasiliy Kulikov Cc: Alan Cox , Ingo Molnar , Andrew Morton , James Morris , Namhyung Kim , Greg Kroah-Hartman , kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1085 Lines: 27 On Mon, Jun 27, 2011 at 11:38 AM, Vasiliy Kulikov wrote: > > Sure, I don't propose it anymore (v2 goes without it). What point would you like to filter things at? I really think that user space should do its own filtering - nobody does a plain 'cat' on dmesg. Or if they do, they really have themselves to blame. And afaik, we don't do any escape sequence handling at the console level either, so you cannot mess up the console with control characters. And the most dangerous character seems to be one that you don't filter: the one we really do react to is '\n', and you could possibly make confusing log messages by embedding a newline in your string and then trying to make the rest look like something bad (say, an oops). So I'm not entirely convinced about this filtering at all. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/