public inbox for kernel-hardening@lists.openwall.com
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Vasiliy Kulikov <segoon@openwall.com>,
	Balbir Singh <bsingharora@gmail.com>,
	Shailabh Nagar <nagar@us.ibm.com>,
	linux-kernel@vger.kernel.org, security@kernel.org,
	Eric Paris <eparis@redhat.com>, Stephen Wilson <wilsons@start.ca>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	David Rientjes <rientjes@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	kernel-hardening@lists.openwall.com
Subject: [kernel-hardening] Re: [Security] [PATCH 2/2] taskstats: restrict access to user
Date: Mon, 19 Sep 2011 20:35:10 -0700	[thread overview]
Message-ID: <m1obyfopht.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <CA+55aFzedLJfK2h2hY_a73Tn9F8Qu=LyjPhq2gVi5S=CYsCnDA@mail.gmail.com> (Linus Torvalds's message of "Mon, 19 Sep 2011 10:45:20 -0700")

Linus Torvalds <torvalds@linux-foundation.org> writes:

> On Mon, Sep 19, 2011 at 10:39 AM, Vasiliy Kulikov <segoon@openwall.com> wrote:
>>
>> Shouldn't it simply protect taskstats_user_cmd()?  You may still poll
>> the counters with TASKSTATS_CMD_ATTR_PID/TASKSTATS_CMD_ATTR_TGID.
>
> Yeah, I wondered where I'd really want to hook it in, that was the
> other option.
>
> However, one thing that I'm currently independently asking some
> networking people is whether that patch guarantees anything at all: is
> the netlink command even guaranteed to be run in the same context as
> the person sending it?

I don't know where that conversation is happening but since I have been
involved rather heavily in netlink syncrhonously processing messages I
will answer.

> After all, it comes in as a packet of data.  How synchronous is the
> genetlink thing guaranteed to be in the first place?

Yes.  The netlink skb is guaranteed to be processed synchronously
and in the senders process.  So accessing current is guaranteed
to be valid.

I just confirmed my memory by reading the cod in 3.1-rc1

> IOW, are *any* of those "check current capabilities/euid" approaches
> really guaranteed to be valid? Are they valid today, will they
> necessarily be valid in a year?

They are valid until such time as someone as someone rearchitects
netlink message processing.

Several years ago it was decided that processing netlink messages
syncrhonously so we could access current made for much simpler easier to
understand kernel code, and most if not all of the netlink permissions
checks now depend upon the fact that we process netlink messages
synchronously.

Eric

  reply	other threads:[~2011-09-20  3:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1308917362-4795-1-git-send-email-segoon@openwall.com>
     [not found] ` <BANLkTimm7KDEU7WD7jVV=5vAGt2GbjgwGg@mail.gmail.com>
2011-06-30  7:57   ` [kernel-hardening] Re: [Security] [PATCH 2/2] taskstats: restrict access to user Vasiliy Kulikov
2011-06-30 10:59     ` Balbir Singh
2011-06-30 12:08       ` Vasiliy Kulikov
2011-06-30 16:40       ` Linus Torvalds
2011-07-01  3:02         ` Balbir Singh
2011-09-19 16:40           ` Linus Torvalds
2011-09-19 17:20             ` Balbir Singh
2011-09-19 17:39             ` Vasiliy Kulikov
2011-09-19 17:45               ` Linus Torvalds
2011-09-20  3:35                 ` Eric W. Biederman [this message]
2011-09-20  5:47                 ` Alexey Dobriyan
2011-09-19 17:47               ` Balbir Singh
2011-09-19 18:29             ` Andi Kleen
2011-09-19 18:32               ` Linus Torvalds
     [not found] ` <BANLkTi=dTHGK1QVs+g2tA6WocQ64SPPF3g@mail.gmail.com>
     [not found]   ` <20110629201718.GA11071@albatros>
2011-07-02  7:36     ` [kernel-hardening] " Vasiliy Kulikov
2011-07-04  2:57       ` Balbir Singh
2011-07-04 17:45         ` Vasiliy Kulikov
2011-07-07  8:55           ` Vasiliy Kulikov
2011-07-07 11:53             ` Balbir Singh
2011-07-07 16:23               ` Vasiliy Kulikov
2011-07-09 15:36                 ` Balbir Singh
2011-07-11 14:07                   ` Vasiliy Kulikov

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=m1obyfopht.fsf@fess.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=bsingharora@gmail.com \
    --cc=eparis@redhat.com \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nagar@us.ibm.com \
    --cc=rientjes@google.com \
    --cc=security@kernel.org \
    --cc=segoon@openwall.com \
    --cc=torvalds@linux-foundation.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox