public inbox for kernel-hardening@lists.openwall.com
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Vasiliy Kulikov <segoon@openwall.com>
Cc: James Morris <jmorris@namei.org>,
	kernel-hardening@lists.openwall.com,
	linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org
Subject: [kernel-hardening] Re: [RFC 2/5 v4] procfs: add hidepid= and gid= mount options
Date: Mon, 20 Jun 2011 12:41:32 -0700	[thread overview]
Message-ID: <m1liww5lzn.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <20110620170600.GA25601@albatros> (Vasiliy Kulikov's message of "Mon, 20 Jun 2011 21:06:01 +0400")

Vasiliy Kulikov <segoon@openwall.com> writes:

> (cc'ed Eric)
>
> On Mon, Jun 20, 2011 at 20:43 +1000, James Morris wrote:
>> > > > hidepid=1 means users may not access any /proc/<pid>/ directories, but their
>> > > > own.  Sensitive files like cmdline, io, sched*, status, wchan are now
>> > > > protected against other users.  As permission checking done in
>> > > > proc_pid_permission() and files' permissions are left untouched,
>> > > > programs expecting specific files' permissions are not confused.
>> > > 
>> > > IMHO such programs are beyond broken and have voided their kernel 
>> > > warranty.
>> > 
>> > Policykit, Debian's start-stop-daemon, util-linux use /proc/PID's uid.
>> > procps use both /proc/PID's uid and gid.  Are all of them totally broken?
>> 
>> If they depend on specific permissions, yes.
>
> Could you please then clarify why does this patch changes
> pid_revalidate() behaviour:
>
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=99f895518368252ba862cc15ce4eb98ebbe1bec6
>
> It changes files permissions to allow userspace apps to quickly stat
> files, not looking into /proc/PID/status.  So, uid and gid are explicit
> ABI.  Breaking procfs uid/gid attributes would break these apps.
>
> Or am I missing something?

No, you are not missing something.  The uid and gid of proc files are
part of the userspace ABI.  The files are owned by the uid and gid
of the respective process.  The commit in question did not change
the ABI it documented it because I found out the hardware way that
a small change there breaks userspace.

Eric

  reply	other threads:[~2011-06-20 19:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.LRH.2.00.1106192154220.7503@taiga.selinuxproject.org>
2011-06-20  5:07 ` [kernel-hardening] Re: [RFC 2/5 v4] procfs: add hidepid= and gid= mount options James Morris
2011-06-20 10:39   ` Vasiliy Kulikov
2011-06-20 10:43     ` James Morris
2011-06-20 11:23       ` KOSAKI Motohiro
2011-06-20 17:06       ` Vasiliy Kulikov
2011-06-20 19:41         ` Eric W. Biederman [this message]
2011-06-20 23:19         ` James Morris
2011-06-21 18:28       ` Vasiliy Kulikov
2011-06-20 13:58     ` Alexey Dobriyan
2011-06-20 14:11       ` [kernel-hardening] " Solar Designer
2011-06-20 14:19         ` Vasiliy Kulikov
2011-06-20 14:25           ` Solar Designer
2011-06-20 14:35             ` Vasiliy Kulikov
2011-06-20 14:47               ` Solar Designer
2011-06-20 15:00                 ` Vasiliy Kulikov
2011-06-20 13:31   ` [kernel-hardening] " Solar Designer
2011-06-15 18:51 [kernel-hardening] " Vasiliy Kulikov
2011-06-16  2:24 ` [kernel-hardening] " KOSAKI Motohiro
2011-06-16  8:47   ` Vasiliy Kulikov

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=m1liww5lzn.fsf@fess.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=jmorris@namei.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=segoon@openwall.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