mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Bryan Donlan <bdonlan@gmail.com>
Cc: kosaki.motohiro@jp.fujitsu.com,
	KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
	Timo Sirainen <tss@iki.fi>,
	linux-kernel@vger.kernel.org, Ulrich Drepper <drepper@redhat.com>
Subject: Re: [PATCH] Added PR_SET_PROCTITLE_AREA option for prctl()
Date: Mon,  5 Oct 2009 10:59:02 +0900 (JST)	[thread overview]
Message-ID: <20091005105617.5F86.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <3e8340490910041844w63720cfq7981c8f5364229de@mail.gmail.com>

> On Sun, Oct 4, 2009 at 9:38 PM, KOSAKI Motohiro
> <kosaki.motohiro@jp.fujitsu.com> wrote:
> >> The improvement idea is here.
> >>
> >> Changelog
> >>   - Added task_lock() to prctl(PR_SET_PROCTITLE_AREA)
> >>  -  Added small input sanity check to prctl(PR_SET_PROCTITLE_AREA)
> >
> > Doh, task_lock() is obviously wrong. please forget this.
> 
> As another note, in general I think we'd need to hold a lock over the
> entire operation. After all, if userspace changes its PROCTITLE_AREA,
> and then reuses the memory for something else, we have an information
> leak.

if reusing occur, it's obviously userland fault. I don't think we need to care this.
because current kernel also can be information leak by strcpy(argv[0], mypassword).

I think they are userland bug both.

 
> Perhaps a simpler approach would simply be to add a generation
> counter. Read it once at the start, barrier, then grab the title. Then
> at the end, read the generation counter again. If the value changed,
> we need to start over. Also, in this case, an error when reading the
> target process' memory should be ignored and retried, as we may have
> hit a race in which the target process unmapped the proctitle area
> after changing it.




  reply	other threads:[~2009-10-05  1:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-02 21:23 Timo Sirainen
2009-10-03  2:01 ` Bryan Donlan
2009-10-03  2:47   ` Timo Sirainen
2009-10-03  2:59     ` Bryan Donlan
2009-10-03  3:21       ` Timo Sirainen
2009-10-04 14:44       ` KOSAKI Motohiro
2009-10-04 18:05         ` Bryan Donlan
2009-10-05  0:55           ` KOSAKI Motohiro
2009-10-05  1:38             ` KOSAKI Motohiro
2009-10-05  1:44               ` Bryan Donlan
2009-10-05  1:59                 ` KOSAKI Motohiro [this message]
2009-10-05  2:21                   ` Bryan Donlan
2009-10-05  2:24                     ` KOSAKI Motohiro
2009-10-05  2:48                       ` KOSAKI Motohiro
2009-10-05  3:22                         ` Bryan Donlan
2009-10-05  3:29                           ` KOSAKI Motohiro
2009-10-05  3:39                             ` Bryan Donlan
2009-10-05  7:18                               ` KOSAKI Motohiro
2009-10-05 22:56                         ` Timo Sirainen
2009-10-03 11:18 ` matthieu castet
2009-10-04 15:10   ` KOSAKI Motohiro

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=20091005105617.5F86.A69D9226@jp.fujitsu.com \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=bdonlan@gmail.com \
    --cc=drepper@redhat.com \
    --cc=kosaki.motohiro@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tss@iki.fi \
    /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

all inboxes | Powered by JetHome®