[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090127084956.GA8416@x200.localdomain>
Date: Tue, 27 Jan 2009 11:49:56 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Kyle McMartin <kyle@...radead.org>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Christoph Bartelmus <lirc@...telmus.de>,
linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andy Whitcroft <apw@...dowen.org>
Subject: Re: [PATCH] export get_task_comm()
On Mon, Jan 26, 2009 at 09:29:18PM -0800, Andrew Morton wrote:
> On Mon, 26 Jan 2009 21:26:15 -0800 Andrew Morton <akpm@...ux-foundation.org> wrote:
>
> > On Tue, 27 Jan 2009 00:19:19 -0500 Kyle McMartin <kyle@...radead.org> wrote:
> >
> > > On Mon, Jan 26, 2009 at 09:16:55PM -0800, Andrew Morton wrote:
> > > > Ho hum, I suppose so. I redid the changelog a bit:
> > > >
> > > > task_struct.comm[] is useful for debugging and driver developers
> > > > want to use this information easily. Direct access to
> > > > task_struct.comm[] is a bit racy, so export the official accessor.
> > > >
> > >
> > > Maybe lirc should be submitted to staging/ before we go exporting
> > > symbols for out of tree things... ;-)
> >
> > y:/usr/src/linux-2.6.29-rc2> grep -r 'current->comm' drivers | wc -l
> > 77
> >
> > :(
>
> It's worth a checkpatch rule, I guess: "direct access to
> task_struct.comm is racy - use get_task_comm()".
And majority of usages is some debugging printk where nobody cares if ->comm
corrupted.
Changelog says is useful for debugging. That's right, tsk->comm is useful
for debugging, not allocating temporary buffer + get_task_comm().
Some ->comm usages are for kernel threads which never change it, for starters.
current->comm is always safe, because, current is not executing prctl(2)!
I'd say nothing should be done and, heavens forbid, adding this to checkpatch.pl.
--
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