Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 11 Mar 2012 11:05:23 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: Djalal Harouni <tixxdz@...ndz.org>
Cc: linux-kernel@...r.kernel.org, kernel-hardening@...ts.openwall.com,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Al Viro <viro@...iv.linux.org.uk>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Vasiliy Kulikov <segoon@...nwall.com>,
	Kees Cook <keescook@...omium.org>,
	Solar Designer <solar@...nwall.com>,
	WANG Cong <xiyou.wangcong@...il.com>,
	James Morris <james.l.morris@...cle.com>,
	Oleg Nesterov <oleg@...hat.com>,
	linux-security-module@...r.kernel.org,
	linux-fsdevel@...r.kernel.org, Alan Cox <alan@...rguk.ukuu.org.uk>,
	Greg KH <gregkh@...uxfoundation.org>, Ingo Molnar <mingo@...e.hu>,
	Stephen Wilson <wilsons@...rt.ca>,
	"Jason A. Donenfeld" <Jason@...c4.com>
Subject: Re: [PATCH 8/9] proc: protect /proc/<pid>/{environ,pagemap} across
 execve

On Sun, Mar 11, 2012 at 12:25:18AM +0100, Djalal Harouni wrote:
> The /proc/<pid>/{environ,pagemap} are sensitive files which must be
> protected across execve to avoid information leaks.
> 
> These files are protected by attaching them to their task at open time by
> saving the exec_id of the target task, this way in read we just compare
> the target task's exec_id and the previously saved exec_id of the
> proc_file_private struct, in other words we just bind these files to their
> appropriate process image at open time. We do this since we are able to do
> proper permission checks (ptrace) at each syscall, so we do not care about
> the reader.
> 
> Another important rule is to set the exec_id of the target task before the
> permission checks at open, this way we do not race against target task
> execve, and it will be more effective if the exec_id check at read/write
> times are delayed as much as possible to be sure that the target task do
> not change during execve.
> 
> This patch adds the open file_operation to the
> /proc/<pid>/{environ,pagemap} so we are able to set the exec_id of the
> target task and to do the appropriate permission checks. The exec_id check
> is done in the related read file_operation.

->open is duplicated.

> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> +static int environ_open(struct inode *inode, struct file *filp)

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.