From: Andrew Morton <akpm@linux-foundation.org>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Kyle McMartin <kyle@infradead.org>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Christoph Bartelmus <lirc@bartelmus.de>,
linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Andy Whitcroft <apw@shadowen.org>
Subject: Re: [PATCH] export get_task_comm()
Date: Tue, 27 Jan 2009 01:00:35 -0800 [thread overview]
Message-ID: <20090127010035.18521a3b.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090127084956.GA8416@x200.localdomain>
On Tue, 27 Jan 2009 11:49:56 +0300 Alexey Dobriyan <adobriyan@gmail.com> wrote:
> 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@linux-foundation.org> wrote:
> >
> > > On Tue, 27 Jan 2009 00:19:19 -0500 Kyle McMartin <kyle@infradead.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)!
That's a good point.
> I'd say nothing should be done and, heavens forbid, adding this to checkpatch.pl.
hm, yeah, OK, I'll drop it.
next prev parent reply other threads:[~2009-01-27 9:01 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-16 19:32 get_task_comm() not exported? Christoph Bartelmus
2009-01-18 22:36 ` KOSAKI Motohiro
2009-01-20 21:24 ` Christoph Bartelmus
2009-01-27 5:09 ` [PATCH] export get_task_comm() KOSAKI Motohiro
2009-01-27 5:16 ` Andrew Morton
2009-01-27 5:19 ` Kyle McMartin
2009-01-27 5:26 ` Andrew Morton
2009-01-27 5:29 ` Andrew Morton
2009-01-27 5:39 ` [PATCH] make checkpatch warn about access to current->comm Kyle McMartin
2009-01-27 5:50 ` KOSAKI Motohiro
2009-01-27 5:52 ` Kyle McMartin
2009-01-27 5:58 ` KOSAKI Motohiro
2009-01-27 6:09 ` Kyle McMartin
2009-01-27 15:45 ` Linus Torvalds
2009-01-27 15:57 ` Kyle McMartin
2009-01-27 18:15 ` Christoph Bartelmus
2009-01-27 8:49 ` [PATCH] export get_task_comm() Alexey Dobriyan
2009-01-27 9:00 ` Andrew Morton [this message]
2009-01-27 10:15 ` KOSAKI Motohiro
2009-01-27 15:41 ` Linus Torvalds
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=20090127010035.18521a3b.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=adobriyan@gmail.com \
--cc=apw@shadowen.org \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=kyle@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lirc@bartelmus.de \
--cc=torvalds@linux-foundation.org \
/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.