All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>,
	Kees Cook <kees.cook@canonical.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Neil Horman <nhorman@tuxdriver.com>,
	Roland McGrath <roland@redhat.com>, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] sanitize task->comm to avoid leaking escape codes
Date: Mon, 28 Jun 2010 13:00:28 -0700	[thread overview]
Message-ID: <20100628130028.73757a46.akpm@linux-foundation.org> (raw)
In-Reply-To: <20100623202335.GA4424@x200>

On Wed, 23 Jun 2010 23:23:35 +0300
Alexey Dobriyan <adobriyan@gmail.com> wrote:

> On Wed, Jun 23, 2010 at 09:41:45PM +0200, Oleg Nesterov wrote:
> > On 06/23, Kees Cook wrote:
>  
> > > -extern char *get_task_comm(char *to, struct task_struct *tsk);
> > > +#define get_task_comm(buf, task) get_task_comm_size(buf, sizeof(buf), task)
> > > +extern char *get_task_comm_size(char *to, size_t len, struct task_struct *tsk);
> > 
> > Oh, but this means that get_task_comm(ptr, task) doesn't work?
> 
> The number of users is so small, and everyone uses TASK_COMM_LEN,
> so maybe nothing should be done or "char buf[TASK_COMM_LEN]"?

Yup, it would take an act of wilful daftness to pass anything other
than a TASK_COMM_LEN array into get_task_comm().

I can't say I like the patch much - going in and altering a task's
comm[] behind its back seems fraught with all sorts of problems which I
can't immediately think of.  Do we corrupt (err, "fix")
/proc/pid/cmdline as well?

Surely it would be better to fix the tools which display this info
rather than making the kernel tell fibs.

  parent reply	other threads:[~2010-06-28 20:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-23 18:11 [PATCH] sanitize task->comm to avoid leaking escape codes Kees Cook
2010-06-23 19:41 ` Oleg Nesterov
2010-06-23 20:23   ` Alexey Dobriyan
2010-06-23 21:28     ` Kees Cook
2010-06-28 20:00     ` Andrew Morton [this message]
2010-06-28 21:03       ` Kees Cook
2010-06-29  8:45         ` Alexey Dobriyan
2010-06-29 15:09           ` Kees Cook
2010-06-29 18:59             ` Andrew Morton
2010-06-29 19:13               ` Kees Cook
2010-06-29  4:58   ` Artem Bityutskiy
2010-06-29  4:58     ` Artem Bityutskiy
2010-06-29 13:31     ` Oleg Nesterov
2010-06-29 16:23       ` Paul E. McKenney
2010-06-29 17:18         ` Oleg Nesterov
2010-06-29 17:33           ` Paul E. McKenney
2010-06-29 22:32     ` john stultz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100628130028.73757a46.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=adobriyan@gmail.com \
    --cc=kees.cook@canonical.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nhorman@tuxdriver.com \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=roland@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.