Re: [PATCH 1/1] coredump: use task comm instead of (unknown)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(Cc John)

On Fri, 6 May 2011 21:26:39 +0900
Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux