Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 9 Oct 2013 11:54:02 +0100
From: Djalal Harouni <>
To: Andy Lutomirski <>
Cc: "Eric W. Biederman" <>,
	Kees Cook <>,
	Al Viro <>,
	Andrew Morton <>,
	Linus Torvalds <>,
	Ingo Molnar <>,
	"Serge E. Hallyn" <>,
	Cyrill Gorcunov <>,
	David Rientjes <>,
	LKML <>,
	Linux FS Devel <>,
	"" <>,
	Djalal Harouni <>
Subject: Re: [PATCH v2 2/9] procfs: add proc_allow_access() to check if
 file's opener may access task

On Mon, Oct 07, 2013 at 02:41:33PM -0700, Andy Lutomirski wrote:
> On Sat, Oct 5, 2013 at 6:23 AM, Djalal Harouni <> wrote:
> > On Fri, Oct 04, 2013 at 03:17:08PM -0700, Andy Lutomirski wrote:
> >>
> >> Exactly.  Hence the NAK.
> > But Having two LSM Hooks there is really not practical!
> It'd doable *if* it turns out that it's the right solution.
> But revoke seems much more likely to be simple, comprehensible, and
> obviously correct to me.
Yes Andy, I agree, revoke is much better!

But it will not handle or fix all the situations, as I've said what if
revoke is not invloved here? there is no an execve from the target task!

/proc/*/{stat,maps} and perhaps others have 0444 and don't have ptrace
checks during ->open() to not break some userspace... especially
/proc/*/stat file

So you will have an fd on these privileged files!

Current will execve a privileged process, and pass ptrace_may_access()
checks during ->read()...

Here revoke is not involved at all! so it will not fix these files and
they will continue to be vulnerable.

IMO to fix them, we must have the correct ptrace_may_access() check and
this involves: current doing an execve + current's cred

BTW, Andy we already return 0 (end of file) for /proc/*/mem
        if (!atomic_inc_not_zero(&mm->mm_users))
		return 0

So can this be considered some sort of simple revoke?

Djalal Harouni

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.