Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 3 Oct 2013 08:22:56 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Djalal Harouni <tixxdz@...ndz.org>
Cc: Andy Lutomirski <luto@...capital.net>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Kees Cook <keescook@...omium.org>,
	Al Viro <viro@...iv.linux.org.uk>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	"Serge E. Hallyn" <serge.hallyn@...ntu.com>,
	Cyrill Gorcunov <gorcunov@...nvz.org>,
	David Rientjes <rientjes@...gle.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Linux FS Devel <linux-fsdevel@...r.kernel.org>,
	kernel-hardening@...ts.openwall.com,
	Djalal Harouni <tixxdz@...il.com>
Subject: Re: [PATCH v2 0/9] procfs: protect /proc/<pid>/* files with
 file->f_cred


* Djalal Harouni <tixxdz@...ndz.org> wrote:

>  * You can't do it for /proc/*/stat otherwise you will break userspace
>   "ps"..., ps must access /proc/1/stat etc... so the proposed solution
>   will work without any side effect.

The thing is, returning -EINVAL is not the only way to reject access to 
privileged information!

In the /proc/1/stat case a compatibility quirk can solve the problem: 
create a special 'dummy' process inode for invalid accesses and give it to 
ps, with all fields present but zero.

>   And for /proc/*/maps you will perhaps break glibc under certain
>   situations... so just hold it for the moment and test it
>   later. There have been reports in the past about it.

Same deal: just create a dummy compat-quirk maps inode with constant, zero 
information contents to placate old user-space:

 00000000-00000000 ---p 00000000 00:00 0

[ Or whatever line is needed to minimally not break old userspace. ]

But don't leak privileged information!

( Maybe add a CONFIG_PROC_FS_COMPAT_QUIRKS Kconfig option, default-y for 
  now, that new/sane userspace can turn off. )

Thanks,

	Ingo

Powered by blists - more mailing lists

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