From: Vasiliy Kulikov <segoon@openwall.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: linux-kernel@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Nikanth Karthikesan <knikanth@suse.de>,
David Rientjes <rientjes@google.com>,
Greg Kroah-Hartman <gregkh@suse.de>,
Al Viro <viro@zeniv.linux.org.uk>,
Eric Dumazet <eric.dumazet@gmail.com>,
netdev@vger.kernel.org, kernel-hardening@lists.openwall.com
Subject: Re: [RFC] procfs: add hidepid and hidenet modes
Date: Sun, 12 Jun 2011 16:43:25 +0400 [thread overview]
Message-ID: <20110612124324.GA3476@albatros> (raw)
In-Reply-To: <20110612111222.GA23467@p183.telecom.by>
On Sun, Jun 12, 2011 at 14:12 +0300, Alexey Dobriyan wrote:
> On Sun, Jun 12, 2011 at 11:51:01AM +0400, Vasiliy Kulikov wrote:
> > hidenet means /proc/PID/net will be accessible to processes with
> > CAP_NET_ADMIN capability or to members of a special group.
> >
> > gid=XXX defines a group that will be able to gather all processes' info
> > and network connections info.
> >
> > Similar features are implemented for old kernels in -ow patches (for
> > Linux 2.2 and 2.4) and for Linux 2.6 in -grsecurity (but both of them
> > are implemented as configure options, not cofigurable in runtime).
> >
> >
> > In current version hidenet works for CONFIG_NET_NS=y via creating a
> > "fake" net namespace and slipping it to nonauthorized users, resulting
> > in users observing blank net files (like nobody use the network). If
> > CONFIG_NET_NS=n I don't see anything better than just fully denying
> > access to /proc/<pid>/net. More elegant ideas are welcome.
>
> This fake netns concept is ugly.
> If you wan't deny something, why don't you return -E?
Sorry, I should have mentioned it. It's a workaround. The thing is
that /proc/net/* is so core and existed for a long time that some
programs might be confused if these files are missing or if open()
returns -EXXX. netstat handles this and outputs smth like "Networking
was disabled in your kernel", which is a bit confusing. Also I saw some
programs didn't handle missing files at all, I recall brctl sigfaulted
when he couldn't access some sysfs file.
As fake_net doesn't break something, but instead keeps some
compatibility with old programs, why don't use it?
BTW, there is no fake_net in -ow or -grsecurity. I thought it might be
helpful for upstream in sense of compatibility.
> Regardless, these should be separate patch from PID stuff.
No problem.
Thanks,
--
Vasiliy Kulikov
http://www.openwall.com - bringing security into open computing environments
prev parent reply other threads:[~2011-06-12 12:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-12 7:51 [RFC] procfs: add hidepid and hidenet modes Vasiliy Kulikov
2011-06-12 11:12 ` Alexey Dobriyan
2011-06-12 12:43 ` Vasiliy Kulikov [this message]
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=20110612124324.GA3476@albatros \
--to=segoon@openwall.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=gregkh@suse.de \
--cc=kernel-hardening@lists.openwall.com \
--cc=knikanth@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rientjes@google.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).