public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roger Luethi <rl@hellgate.ch>
To: William Lee Irwin III <wli@holomorphy.com>
Cc: Albert Cahalan <albert@users.sf.net>,
	Stephen Smalley <sds@epoch.ncsc.mil>,
	Andrew Morton OSDL <akpm@osdl.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Albert Cahalan <albert@users.sourceforge.net>,
	Paul Jackson <pj@sgi.com>, James Morris <jmorris@redhat.com>,
	Chris Wright <chrisw@osdl.org>
Subject: Re: [1/1][PATCH] nproc v2: netlink access to /proc information
Date: Tue, 14 Sep 2004 18:01:50 +0200	[thread overview]
Message-ID: <20040914160150.GB13978@k3.hellgate.ch> (raw)
In-Reply-To: <20040914153758.GO9106@holomorphy.com>

On Tue, 14 Sep 2004 08:37:58 -0700, William Lee Irwin III wrote:
> On Tue, 14 Sep 2004 01:01:32 -0700, William Lee Irwin III wrote:
> >> That expectation can't be entirely relied upon, as the restrictions may
> >> not be predictable.
> 
> On Tue, Sep 14, 2004 at 11:27:48AM +0200, Roger Luethi wrote:
> > They should be. For the simple design I described the access restrictions
> > are part of the field ID, so a tool can deduce the exact type of access
> > restrictions even if it doesn't know the field. There's plenty of space
> > left for additional access control flags in the field ID.
> 
> No, in general races of the form "permissions were altered after I
> checked them" can happen.

Can you make an example? Some scenario where this would be important?

> On Tue, Sep 14, 2004 at 11:27:48AM +0200, Roger Luethi wrote:
> > If it gets much more complex, the application (let alone the kernel)
> > has to have some knowledge of the security model anyway, so we could have
> > simple operations that allow a tool to discover how access restrictions
> > apply to the supported fields.
> 
> Checking that system calls succeeded is a minimum requirement at all
> times. Misinterpreting error returns is the app's fault.

It's async. You can't rely on return values. They'd have to be in
netlink messages.

> On Tue, Sep 14, 2004 at 11:27:48AM +0200, Roger Luethi wrote:
> > It cannot easily, and I don't think it wants to. The reason it's hard to
> > just reply with a subset is that the kernel does not send any description
> > of the reply content other than the serial number of the request --
> > it's up to the tool to know what it asked for. So if you remove a field,
> > you'd have to let user-space know which field you removed. Sending only
> > the allowed subset makes handling on both sides more complicated --
> > the kernel needs to build different kinds of messages in answer to one
> > request, and user-space tool need to be able to parse that.
> 
> Irritating. That must mean you can't ask for specific fields.

How so? For process fields, the request block is one u32 indicating the
number of field IDs to follow, then a bunch of u32 containing field IDs.
Any subset of field IDs, in any order of the tool's choosing.

The kernel replies with one message per process, each message containing
all the fields the tool requested, in the same order.

> On Tue, Sep 14, 2004 at 11:27:48AM +0200, Roger Luethi wrote:
> >   We could also send an error message ("some tasks omitted") or send a
> >   complete reply with the restricted fields zeroed and a special flag set
> >   ("some fields in this reply zeroed due to access control").
> > I'm really afraid of over-engineering something here, though. The fields
> > requested by tools like ps and top by default are all world readable
> > in /proc. I showed that solutions fit right in should we ever need
> > access control for real-world applications. For now, I'd rather not
> > extend the interface significantly unless the current semantics are
> > clearly insufficient.
> 
> Well, "return this set of fields" means there's only one type of
> request necessary, and userspace merely iterates through the subsets
> obtained by striking out fields to which accesses caused errors until
> either the set is empty or the call succeeds. One field at a time at
> all times also means there's only one type of request necessary. So I

One field at a time at all times is unnecessarily slow.

Roger

  reply	other threads:[~2004-09-14 16:13 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-08 18:40 [0/1][ANNOUNCE] nproc v2: netlink access to /proc information Roger Luethi
2004-09-08 18:41 ` [1/1][PATCH] " Roger Luethi
2004-09-09  0:35   ` William Lee Irwin III
2004-09-09  0:43     ` William Lee Irwin III
2004-09-09  1:15       ` William Lee Irwin III
2004-09-09  1:17         ` [1/2] rediff nproc v2 vs. 2.6.9-rc1-mm4 William Lee Irwin III
2004-09-09  1:21           ` [2/2] handle CONFIG_MMU=n and use new vm stats for CONFIG_MMU=y William Lee Irwin III
2004-09-09  1:22             ` William Lee Irwin III
2004-09-09  1:26             ` [3/2] round up text memory to the nearest page in fs/proc/task_mmu.c William Lee Irwin III
2004-09-09 18:43     ` [1/1][PATCH] nproc v2: netlink access to /proc information Roger Luethi
2004-09-09 18:49       ` William Lee Irwin III
2004-09-09 19:00         ` William Lee Irwin III
2004-09-09 19:02           ` [4/2] consolidate __task_mem() and __task_mem_cheap() William Lee Irwin III
2004-09-09 19:07             ` Roger Luethi
2004-09-09 19:15               ` [5/2] fix nommu VSZ reporting in consolidated task_mem() William Lee Irwin III
2004-09-09 19:11         ` [1/1][PATCH] nproc v2: netlink access to /proc information Roger Luethi
2004-09-09 19:23           ` William Lee Irwin III
2004-09-09 21:19             ` Roger Luethi
2004-09-10 15:30             ` Roger Luethi
2004-09-11 22:25           ` Albert Cahalan
2004-09-12  4:58             ` William Lee Irwin III
2004-09-14  5:59             ` Roger Luethi
2004-09-14  6:18               ` William Lee Irwin III
2004-09-14  6:23                 ` William Lee Irwin III
2004-09-14  7:47                   ` Greg Ungerer
2004-09-14  8:27                     ` Roger Luethi
2004-09-09 11:53   ` Stephen Smalley
2004-09-09 17:22     ` William Lee Irwin III
2004-09-09 17:53       ` Roger Luethi
2004-09-09 20:01         ` Stephen Smalley
2004-09-09 20:48           ` Chris Wright
2004-09-10 12:11             ` Stephen Smalley
2004-09-09 20:55           ` Roger Luethi
2004-09-09 21:05             ` Chris Wright
2004-09-09 21:25             ` Roger Luethi
2004-09-11 22:36               ` Albert Cahalan
2004-09-12  5:00                 ` William Lee Irwin III
2004-09-14  6:44                 ` Roger Luethi
2004-09-14  7:10                   ` William Lee Irwin III
2004-09-14  7:55                     ` Roger Luethi
2004-09-14  8:01                       ` William Lee Irwin III
2004-09-14  9:27                         ` Roger Luethi
2004-09-14 15:37                           ` William Lee Irwin III
2004-09-14 16:01                             ` Roger Luethi [this message]
2004-09-14 16:37                               ` William Lee Irwin III
2004-09-14 17:15                                 ` Roger Luethi
2004-09-14 17:43                                   ` William Lee Irwin III
2004-09-14 18:45                                     ` Roger Luethi
2004-09-14 19:07                                       ` William Lee Irwin III
2004-09-14 19:31                                         ` Roger Luethi
2004-09-14 19:36                                           ` William Lee Irwin III
2004-09-14 19:50                                             ` Roger Luethi
2004-09-15 11:44                                         ` Roger Luethi
2004-09-15 20:02                                           ` Roger Luethi
2004-09-15 20:20                                             ` William Lee Irwin III
2004-09-15 20:33                                               ` Roger Luethi
2004-09-15 20:44                                               ` Roger Luethi
2004-09-14 18:37                                 ` Chris Wright
2004-09-14 18:55                                   ` Roger Luethi
2004-09-14 19:05                                     ` Chris Wright
2004-09-14 21:12                                       ` Roger Luethi
2004-09-09 20:44         ` Chris Wright
2004-09-16 21:43 ` nproc: So? Roger Luethi

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=20040914160150.GB13978@k3.hellgate.ch \
    --to=rl@hellgate.ch \
    --cc=akpm@osdl.org \
    --cc=albert@users.sf.net \
    --cc=albert@users.sourceforge.net \
    --cc=chrisw@osdl.org \
    --cc=jmorris@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pj@sgi.com \
    --cc=sds@epoch.ncsc.mil \
    --cc=wli@holomorphy.com \
    /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