From: Ingo Molnar <mingo@elte.hu>
To: Kees Cook <keescook@chromium.org>
Cc: linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Randy Dunlap <rdunlap@xenotime.net>,
Andrew Morton <akpm@linux-foundation.org>,
Borislav Petkov <bp@alien8.de>,
Vasiliy Kulikov <segoon@openwall.com>,
Dan Ballard <dan@mindstab.net>, Jiri Kosina <jkosina@suse.cz>,
Al Viro <viro@zeniv.linux.org.uk>,
Stephen Wilson <wilsons@start.ca>,
David Rientjes <rientjes@google.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Eric Paris <eparis@redhat.com>,
"Serge E. Hallyn" <serge.hallyn@canonical.com>,
linux-doc@vger.kernel.org
Subject: Re: [PATCH] sysctl: control functionality of /proc/pid/mem
Date: Sat, 21 Jan 2012 10:03:42 +0100 [thread overview]
Message-ID: <20120121090342.GD32134@elte.hu> (raw)
In-Reply-To: <20120121084317.GA30541@www.outflux.net>
* Kees Cook <keescook@chromium.org> wrote:
> @@ -702,6 +704,9 @@ static int mem_open(struct inode* inode, struct file* file)
> struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode);
> struct mm_struct *mm;
>
> + if (sysctl_proc_pid_mem < 1)
> + return -EACCES;
This looks like an unprivileged user-space triggerable memory
leak DoS. The task reference is already acquired at that point.
See how easy it is to introduce bugs with potential security
side-effects, even when the intention is to increase security?
:-)
( Btw., this is why i generally prefer 'invariant' local
variable definition blocks that have no serious side effects -
it makes the flow more obvious. Local variables slip off the
eye rather often and don't register as 'real' code.)
Thanks,
Ingo
next prev parent reply other threads:[~2012-01-21 9:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-21 8:43 [PATCH] sysctl: control functionality of /proc/pid/mem Kees Cook
2012-01-21 9:03 ` Ingo Molnar [this message]
2012-01-21 9:11 ` Kees Cook
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=20120121090342.GD32134@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=dan@mindstab.net \
--cc=eparis@redhat.com \
--cc=jkosina@suse.cz \
--cc=keescook@chromium.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@xenotime.net \
--cc=rientjes@google.com \
--cc=segoon@openwall.com \
--cc=serge.hallyn@canonical.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
--cc=wilsons@start.ca \
/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.