From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Bryan Donlan <bdonlan@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Americo Wang <xiyou.wangcong@gmail.com>,
Timo Sirainen <tss@iki.fi>, Ulrich Drepper <drepper@redhat.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-api@vger.kernel.org
Subject: Re: [PATCH v5] Added PR_SET_PROCTITLE_AREA option for prctl()
Date: Tue, 10 Nov 2009 20:06:31 +0900 [thread overview]
Message-ID: <2f11576a0911100306k7e2a64b9r35e13454be858140@mail.gmail.com> (raw)
In-Reply-To: <3e8340490911091600v3a0e9b67r279349ac852d604a@mail.gmail.com>
2009/11/10 Bryan Donlan <bdonlan@gmail.com>:
> On Mon, Nov 9, 2009 at 5:47 PM, Andrew Morton <akpm@linux-foundation.org> wrote:
>
>> What happens if userspace unmaps the memory after telling the kernel to
>> use it?
>>
>> Will processes which try to read the command line get an error reading
>> /proc? If so, do all the commandline-reading programs in the world
>> handle this in an appropriate fashion?
>
> This case can already occur in the current code; the userspace process
> would have to munmap() the top of its stack, but it certainly can do
> so if it tries. In any case, access_process_vm() then returns 0
> because of the fault, and thus /proc/pid/cmdline is seen to have zero
> length. Since a zero-length /proc/pid/cmdline occurs with kernel
> threads as well, we know this isn't a problem.
Plus, ps can read under exiting process. In this case, task->mm is NULL and
proc_pid_cmdline return 0.
procps tools are already NUL safe since long time ago.
prev parent reply other threads:[~2009-11-10 11:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20091101211321.F3FC.A69D9226@jp.fujitsu.com>
[not found] ` <20091101211321.F3FC.A69D9226-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2009-11-03 9:47 ` [PATCH v4] Added PR_SET_PROCTITLE_AREA option for prctl() Américo Wang
[not found] ` <20091103094703.GB11134-lyUE10xJyvyny3qCrzbmXA@public.gmane.org>
2009-11-03 14:07 ` KOSAKI Motohiro
[not found] ` <20091103230548.0B45.A69D9226-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2009-11-03 15:26 ` [PATCH v5] " KOSAKI Motohiro
[not found] ` <20091104002544.0B4A.A69D9226-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2009-11-03 16:12 ` Américo Wang
2009-11-09 22:47 ` Andrew Morton
[not found] ` <20091109144717.0cd17421.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2009-11-10 0:00 ` Bryan Donlan
2009-11-10 11:06 ` KOSAKI Motohiro [this message]
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=2f11576a0911100306k7e2a64b9r35e13454be858140@mail.gmail.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=bdonlan@gmail.com \
--cc=drepper@redhat.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tss@iki.fi \
--cc=xiyou.wangcong@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).