mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Dave McCracken <dmccr@us.ibm.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2.5.30+] Second attempt at a shared credentials patch
Date: Thu, 8 Aug 2002 18:54:30 +0200	[thread overview]
Message-ID: <15698.41542.250846.334946@charged.uio.no> (raw)
In-Reply-To: <44050000.1028823650@baldur.austin.ibm.com>

>>>>> " " == Dave McCracken <dmccr@us.ibm.com> writes:

    >> Instead of doing this as one big unreadable monolithic patch
    >> and risking getting things wrong like in the above case, it
    >> would be nice if you could go via a set of wrapper functions:
    >>
    >> # define get_current_uid() (current->uid) define
    >> # set_current_uid(a) current->uid = a

     > I don't see this as a win.  I *could* do a big monolithic patch
     > to change all references to current->*id to macros, then change
     > the macros in a separate patch.  But then we'd be stuck with
     > macros for all those references forever, and they're not likely
     > to change again any time soon.  I don't think we'd really want
     > to have macros for all our structure references on the off
     > chance that someone might change it in the future.

Why? Macros (and inlined functions) have the advantage that they
enforce good policy. Doing 'task->cred->uid = a' on tasks other than
'current' is in general not a very safe thing to do. This sort of
issue w.r.t. safe policies should in particular be worrying you when
you start adding CRED_CLONE...
There are good precedents for this sort of argument: see
'set_current_state()' & friends.

In addition, those macros would allow you to set up compatibility with
2.4.x and simplify patch backports.


As for changing the structure: As I said previously I'd like to unify
all those { fsuid, fsgid, group } things into a proper ucred, so that
we can share these objects around the VFS, and cache them...
Your 'struct cred' as it stands will not suffice to do all that since
it does not provide the necessary Copy On Write protection. (For
instance if some thread temporarily raises my process privileges, I
will *not* want all my already opened 'struct file's to suddenly gain
root access).

Cheers,
  Trond

  reply	other threads:[~2002-08-08 16:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-08 14:58 Dave McCracken
2002-08-08 15:32 ` Trond Myklebust
2002-08-08 16:20   ` Dave McCracken
2002-08-08 16:54     ` Trond Myklebust [this message]
2002-08-08 18:05       ` Dave McCracken
2002-08-08 19:56         ` Trond Myklebust
2002-08-08 20:11           ` Dave McCracken
2002-08-08 21:55             ` Trond Myklebust
2002-08-09 19:24               ` [PATCH 2.5.30+] Fourth " Dave McCracken
2002-08-09 19:51                 ` Trond Myklebust
2002-08-09 20:51                   ` Dave McCracken
2002-08-12 20:08                     ` Trond Myklebust
2002-08-09 21:15                 ` Linus Torvalds
2002-08-08 20:11         ` [PATCH 2.5.30+] Second " Trond Myklebust

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=15698.41542.250846.334946@charged.uio.no \
    --to=trond.myklebust@fys.uio.no \
    --cc=dmccr@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®