From: Jake Edge <jake@lwn.net>
To: ebiederm@xmission.com (Eric W. Biederman)
Cc: James Morris <jmorris@namei.org>,
linux-security-module@vger.kernel.org,
Arjan van de Ven <arjan@infradead.org>,
Eric Paris <eparis@redhat.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Roland McGrath <roland@redhat.com>,
mingo@redhat.com, Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] proc: avoid leaking eip, esp, or wchan to non-privileged processes (fwd)
Date: Mon, 4 May 2009 07:22:37 -0600 [thread overview]
Message-ID: <20090504072237.4045721f@chukar> (raw)
In-Reply-To: <m1r5z5jt63.fsf@fess.ebiederm.org>
On Sun, 03 May 2009 23:09:24 -0700 Eric W. Biederman wrote:
> James Morris <jmorris@namei.org> writes:
>
> > diff --git a/fs/proc/base.c b/fs/proc/base.c
> > index aa763ab..cd3c0d7 100644
> > --- a/fs/proc/base.c
> > +++ b/fs/proc/base.c
> > @@ -319,6 +319,9 @@ static int proc_pid_wchan(struct task_struct
> > *task, char *buffer)
> > unsigned long wchan;
> > char symname[KSYM_NAME_LEN];
> >
> > + if (!ptrace_may_access(task, PTRACE_MODE_READ))
> > + return 0;
> > +
> > wchan = get_wchan(task);
> >
> > if (lookup_symbol_name(wchan, symname) < 0)
>
> If the symbol is in the kernel it should be safe to return it's
> name, all that is an information leak of a different sort.
> Overall I expect we should return -EPERM here and not simply
> an empty file.
Ah, so if lookup_symbol_name() fails, it should return nothing or an
error?
This was "modeled" after the maps and smaps behavior, in that
they return an empty file if there is insufficient permission rather
than EPERM ...
> Have you tested these patches against ps top and similar common
> tools?
both ps and top seem to operate just fine ... any of the default values
coming out of stat should be OK as they can be returned under other
circumstances ... the wchan file is a bit different, but it is not
clear to me what uses that rather than the wchan value in the stat file
thanks,
jake
--
Jake Edge - LWN - jake@lwn.net - http://lwn.net
prev parent reply other threads:[~2009-05-04 13:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-03 23:27 [PATCH] proc: avoid leaking eip, esp, or wchan to non-privileged processes (fwd) James Morris
2009-05-03 23:58 ` Arjan van de Ven
2009-05-04 1:11 ` Jake Edge
2009-05-04 14:38 ` Greg KH
2009-05-04 6:09 ` Eric W. Biederman
2009-05-04 13:22 ` Jake Edge [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=20090504072237.4045721f@chukar \
--to=jake@lwn.net \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arjan@infradead.org \
--cc=ebiederm@xmission.com \
--cc=eparis@redhat.com \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=roland@redhat.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