From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kees Cook Subject: Re: [PATCH] sanitize task->comm to avoid leaking escape codes Date: Mon, 28 Jun 2010 14:03:42 -0700 Message-ID: <20100628210342.GW4175@outflux.net> References: <20100623181129.GM5876@outflux.net> <20100623194145.GA19628@redhat.com> <20100623202335.GA4424@x200> <20100628130028.73757a46.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alexey Dobriyan , Oleg Nesterov , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Alexander Viro , KOSAKI Motohiro , Neil Horman , Roland McGrath , Ingo Molnar , Peter Zijlstra , Thomas Gleixner To: Andrew Morton Return-path: Content-Disposition: inline In-Reply-To: <20100628130028.73757a46.akpm@linux-foundation.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hi, On Mon, Jun 28, 2010 at 01:00:28PM -0700, Andrew Morton wrote: > Surely it would be better to fix the tools which display this info > rather than making the kernel tell fibs. The strncpy in get_task_comm() is totally wrong -- it's testing the length of task->comm. Why should get_task_comm not take a destination buffer length argument? At least consider v2 of the patch -- it just fixes the get_task_comm definition and callers. But, if not, then patches to the kernel that include printk(..., get_task_comm(...) ...) shouldn't be considered flawed[1]. -Kees [1] http://lkml.org/lkml/2010/6/23/132 -- Kees Cook Ubuntu Security Team