[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20091208144004.B5AB.A69D9226@jp.fujitsu.com>
Date: Tue, 8 Dec 2009 14:56:40 +0900 (JST)
From: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To: Ingo Molnar <mingo@...e.hu>
Cc: kosaki.motohiro@...fujitsu.com, Bryan Donlan <bdonlan@...il.com>,
Ulrich Drepper <drepper@...hat.com>,
Timo Sirainen <tss@....fi>,
WANG Cong <xiyou.wangcong@...il.com>,
Oleg Nesterov <oleg@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v6] Added PR_SET_PROCTITLE_AREA option for prctl()
>
> * KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com> wrote:
>
> > > The feature looks useful, but the choice of a prctl as an API is strange
> > > - it limits us to the current task only - while the ability to set
> > > arguments for another task looks a more generic (and potentially more
> > > useful) solution.
> >
> > No. It's impossible.
> > /proc/{pid}/cmdline read user process's memory. iow, this prctl() don't
> > receive string, it receive virtual address itself. [...]
>
> it's not 'impossible' at all, you yourself mention ptrace:
Ah yes, 'impossible' was wrong word. but it doesn't works intentionally.
1. setproctitle() unaware application continue to see argv[0] directly.
it makes some inconsistent behavior.
2. proc title (i.e. string) injection need to map new page as process title area.
implicit mapping increasing makes new trouble
- mihgt cause to exceed max_map_count awhile after.
- might cause leak proc title area (who know when it should be freed?)
I think reasonable way is 1. send signal (or use another inter process
communication way) to target process 2. target process change own proc title
themself.
Plus, I haven't seen the use-case of changin another task. iow I doubt
it's worth to change lots code.
> > [...] I don't want any task allow to change another task's memory
> > except ptrace.
>
> And i did not mean to allow 'any' task to be allowed to do this -
> security checks apply, obviously.
Agreed. My 'any' didn't intent bypass security check ;-)
--
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