public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	John Stultz <john.stultz@linaro.org>
Subject: Re: [PATCH 1/1] coredump: use task comm instead of (unknown)
Date: Fri, 6 May 2011 12:33:28 -0700	[thread overview]
Message-ID: <20110506123328.d0a707b7.akpm@linux-foundation.org> (raw)
In-Reply-To: <201105062126.DIE34311.OJHtFMFFSQLVOO@I-love.SAKURA.ne.jp>

(Cc John)

On Fri, 6 May 2011 21:26:39 +0900
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> wrote:

> Andrew Morton wrote:
> > Direct access to current->comm is racy since we added
> > prctl(PR_SET_NAME).
> 
> A passer-by's question. Did we change below one
> 
> char *get_task_comm(char *buf, struct task_struct *tsk)
> {
> 	/* buf must be at least sizeof(tsk->comm) in size */
> 	task_lock(tsk);
> 	strncpy(buf, tsk->comm, sizeof(tsk->comm));
> 	task_unlock(tsk);
> 	return buf;
> }
> 
> since some archs may do like
> 
> char *strncpy(char *dest, const char *src, size_t n)
> {
> 	size_t len = __strnend(src, n) - src;
> 	__builtin_memset(dest + len, 0, n - len);
> 	__builtin_memcpy(dest, src, len);
> 	return dest;
> }
> 
> ( arch/s390/lib/string.c ) after adding prctl(PR_SET_NAME)?

I don't understand what you're asking, sorry.

  reply	other threads:[~2011-05-06 19:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4DC0FFAB.1000805@gmail.com>
2011-05-04  7:32 ` [PATCH 1/1] coredump: use task comm instead of (unknown) Jiri Slaby
2011-05-05 22:06   ` Andrew Morton
2011-05-06  6:01     ` Jiri Slaby
2011-05-06 12:26     ` Tetsuo Handa
2011-05-06 19:33       ` Andrew Morton [this message]
2011-05-07  2:14         ` Tetsuo Handa
2011-05-07  3:28           ` Andrew Morton
2011-05-07 15:37             ` Tetsuo Handa

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=20110506123328.d0a707b7.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=john.stultz@linaro.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox