All of lore.kernel.org
 help / color / mirror / Atom feed
From: Djalal Harouni <tixxdz@opendz.org>
To: kernel-hardening@lists.openwall.com
Cc: Kees Cook <keescook@chromium.org>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>,
	Solar Designer <solar@openwall.com>
Subject: Re: [kernel-hardening] procfs: infoleaks and DAC permissions
Date: Tue, 21 Feb 2012 17:34:12 +0100	[thread overview]
Message-ID: <20120221163412.GB12919@dztty> (raw)
In-Reply-To: <20120210143616.GA6100@albatros>

On Fri, Feb 10, 2012 at 06:36:17PM +0400, Vasiliy Kulikov wrote:
> On Fri, Feb 10, 2012 at 03:06 +0100, Djalal Harouni wrote:
> > A partial fix for this (2):
> > Procfs 'hidepid=' mount option which can be used to restrict access to
> > arbitrary /proc/<pid>/ files, Vasiliy commit [3], congrats.
> > But if the procfs 'gid=' mount option is used then it can give permissions
> > back to read these files if the user is part of the 'gid' group. IOW this
> > will just restore the previous vulnerable situation.
> 
> It is even weaker - you could trick setuid $SPID to open /proc/$PID/maps,
> do exec(setuid_app) as $PID and read setuid_app's maps as $SPID.
Just want to say that I got your point:

I was refering to (2), but your response about 'hidepid' and how to play
with it is more related to (1) setuid self-read and keeping fd opened. The
(ugly) patch I sent will block it.

Spender's patch will do the job.

Note: that trick can give an extra lseek() to the attacker on
/proc/$PID/maps... that will be reflected on the executed setuid_app.


-- 
tixxdz
http://opendz.org

  parent reply	other threads:[~2012-02-21 16:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10  2:06 [kernel-hardening] procfs: infoleaks and DAC permissions Djalal Harouni
2012-02-10 14:36 ` Vasiliy Kulikov
2012-02-11  9:20   ` Solar Designer
2012-02-11 10:21     ` Vasiliy Kulikov
2012-02-11 13:31       ` Solar Designer
2012-02-12  0:19   ` Djalal Harouni
2012-02-21 14:56   ` Solar Designer
2012-02-21 16:25     ` Djalal Harouni
2012-02-21 17:42       ` Solar Designer
2012-02-24  0:56     ` Solar Designer
2012-02-25  3:56       ` Solar Designer
2012-03-03  0:35         ` Djalal Harouni
2012-02-21 16:34   ` Djalal Harouni [this message]
2012-02-11 10:07 ` Solar Designer
2012-02-12 15:36   ` Djalal Harouni
2012-02-13 15:50     ` Djalal Harouni

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=20120221163412.GB12919@dztty \
    --to=tixxdz@opendz.org \
    --cc=Jason@zx2c4.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=solar@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.