public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: Re: [PATCH] in-core AFS multiplexor and PAG support
@ 2003-05-13 19:00 Neulinger, Nathan
  2003-05-13 19:19 ` Douglas E. Engert
  0 siblings, 1 reply; 12+ messages in thread
From: Neulinger, Nathan @ 2003-05-13 19:00 UTC (permalink / raw)
  To: David Howells, Jan Harkes
  Cc: David Howells, Linus Torvalds, linux-kernel, linux-fsdevel,
	openafs-devel

> > >  (2) gettok(const char *fs, const char *key, size_t size, 
> void *buffer)
> > > 
> > >      Get a copy of an authentication token.
> > 
> > Not sure what the use of this is for userspace. I can see how your
> > kernel module would use it.
> 
> OpenAFS has it, but I'm not sure what uses it.

Any afs user space tool that needs to talk to file servers - such as all
the administration utilities - vos, bos, pts, etc. Eventually they could
use kerberos cred caches directly, but not until they are converted to
kerberos. Right now, they fetch the current auth data from the kernel
and use it to authenticate to whatever non-kernel service they are
talking to.

-- Nathan

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [PATCH] in-core AFS multiplexor and PAG support
@ 2003-05-13 18:53 David Howells
  2003-05-13 20:19 ` Derrick J Brashear
  0 siblings, 1 reply; 12+ messages in thread
From: David Howells @ 2003-05-13 18:53 UTC (permalink / raw)
  To: Jan Harkes
  Cc: David Howells, Linus Torvalds, linux-kernel, linux-fsdevel,
	openafs-devel


> On Tue, May 13, 2003 at 06:42:49PM +0100, David Howells wrote:
> > I have a further suggestion for some new system calls specifically for
> > managing tokens. I'd like to add the following:
> > 
> >  (1) settok(const char *fs, const char *key, size_t size, const void *data)
> > 
> >      Present data to the named filesystem as being the authentication
> >      token for the specified key (eg: an AFS cell). If accepted, this
> >      token should be stored in the PAG to which the calling process
> >      belongs.
> 
> Tokens are very filesystem specific, with Coda the kernel really doesn't
> know in which 'realm' any object is located. So it will always just pass
> the PAG to the cache manager which will associate the right token to
> access the file.

OTOH, since settok wouldn't modify the PAG ring directly, but would rather
jump through a vector in the file_system_type object, it could deside to
confer with userspace and possibly not add a token at all.

Of course then the other calls would also have to vector through the
file_system_type object rather than affecting the PAG directly, but I'm happy
to do that.

> A minimal kernel implementation really only has a single newpag()
> systemcall and internal 'getpag()' that can be used by filesystems. All
> the token handling can be done by a (possibly filesystem specific)
> userspace daemon that is given a (pag,realm/key) tuple and returns a
> token.
>
> But ofcourse Coda is a 99% userspace implementation, so I'm already
> assuming that there are one or more userspace daemons.

This would just be a "standardised" way of communicating authentication info
to a filesystem. What the filesystem then did with it would be up to that
filesystem. Storing a token in a PAG or attached to a struct file would then
just be one option.
 
> >  (2) gettok(const char *fs, const char *key, size_t size, void *buffer)
> > 
> >      Get a copy of an authentication token.
> 
> Not sure what the use of this is for userspace. I can see how your
> kernel module would use it.

OpenAFS has it, but I'm not sure what uses it.

> btw. is the 'size_t size' the size of the key, or the size of the buffer?

Actually the buffer size. I was assuming the key would be a NUL terminated
string, but it's probably best not to assume that, and I should add an extra
argument for the key size.

Filesystem name can remain a NUL terminated string as I'd have to search the
file_system_type structures.

> >  (4) cleartoks(const char *fs)
> 
> Isn't this simply deltok(fs, NULL)?

Probably.

David

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: Re: [PATCH] in-core AFS multiplexor and PAG support
@ 2003-05-13 18:25 Neulinger, Nathan
  0 siblings, 0 replies; 12+ messages in thread
From: Neulinger, Nathan @ 2003-05-13 18:25 UTC (permalink / raw)
  To: David Howells, Jan Harkes, Linus Torvalds, David Howells,
	linux-kernel, linux-fsdevel, openafs-devel

> > If someone obtains my user id on in any way (i.e. weak password/
> > bufferoverflow/ root exploit), he should not be allowed to 
> use or access
> > my tokens as he hasn't proven his identity. In this case he 
> would either
> > still be in his original process authentication group, or a new and
> > empty PAG. But definitely not in any of my authentication groups.
> > 
> > Which is also why joining a PAG should never be allowed.
> 
> Someone asked for it, but I suspect if allowed at all it may 
> be best that this
> ability is governed by its own capability bit and also that 
> the security
> interface should be consulted.

Definately. This is only allowed for root in any case. (Or the cap as
you describe.)

-- Nathan

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: Re: [PATCH] in-core AFS multiplexor and PAG support
@ 2003-05-13 18:23 Neulinger, Nathan
  0 siblings, 0 replies; 12+ messages in thread
From: Neulinger, Nathan @ 2003-05-13 18:23 UTC (permalink / raw)
  To: Alan Cox, Linus Torvalds
  Cc: David Howells, Linux Kernel Mailing List, linux-fsdevel,
	openafs-devel

Yes, handles it fine and used quite frequently, just have to set a new
pag (done automatically if it's really a new login and not just a new
xterm, or can start a command with 'pagsh' command to start it in a new
pag).

-- Nathan

------------------------------------------------------------
Nathan Neulinger                       EMail:  nneul@umr.edu
University of Missouri - Rolla         Phone: (573) 341-4841
Computing Services                       Fax: (573) 341-4216


> -----Original Message-----
> From: Alan Cox [mailto:alan@lxorguk.ukuu.org.uk] 
> Sent: Tuesday, May 13, 2003 10:44 AM
> To: Linus Torvalds
> Cc: David Howells; Linux Kernel Mailing List; 
> linux-fsdevel@vger.kernel.org; openafs-devel@openafs.org
> Subject: [OpenAFS-devel] Re: [PATCH] in-core AFS multiplexor 
> and PAG support
> 
> 
> On Maw, 2003-05-13 at 16:52, Linus Torvalds wrote:
> > I think the code looks pretty horrible, but I think we'll 
> need something
> > like this to keep track of keys. However, I'm not sure we 
> should make this
> > a new structure - I think we should make the current 
> "tsk->user" thing
> > _be_ the "PAG". 
> 
> With something like SELinux a PAG may belong to a role not to a user
> even though other limits like processes probably belong to 
> the user as a
> whole. 
> 
> How does AFS currently handle this, can two logins of the 
> same user have
> seperate PAGs ?
> 
> _______________________________________________
> OpenAFS-devel mailing list
> OpenAFS-devel@openafs.org
> https://lists.openafs.org/mailman/listinfo/openafs-devel
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: Re: [PATCH] in-core AFS multiplexor and PAG support
@ 2003-05-13 17:48 Neulinger, Nathan
  0 siblings, 0 replies; 12+ messages in thread
From: Neulinger, Nathan @ 2003-05-13 17:48 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: David Howells, linux-kernel, linux-fsdevel, openafs-devel

> > > Also, using a separate PAG structure means that you can 
> lend your keys to
> > > an SUID program and conversely it means a SUID program 
> can't so easily
> > > gain access to keys it didn't inherit from its caller.
> > 
> > "task->user" always follows uid ("real uid"), and as such 
> you can always
> > switch back and forth by just changing uid.
> 
> So anyone who has the ability to get root on a box can 
> immediately use other
> peoples keys with su... OTOH, the ability to get root would 
> normally permit
> someone sufficiently motivated to get this anyway.

This isn't any good since it implies that a given uid can only have a
single set of tokens. Users can freely authenticate to afs and get
tokens for other afs ids at any time. As long as they are in different
pags, they can freely coexist. Now, if you're talking about pag-less
only, then the above is reasonable and expected. 

-- Nathan

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [PATCH] in-core AFS multiplexor and PAG support
  2003-05-13 15:52 Linus Torvalds
@ 2003-05-13 16:05 David Howells
  2003-05-13 16:24 ` Douglas E. Engert
  2003-05-13 16:47 ` Linus Torvalds
  0 siblings, 2 replies; 12+ messages in thread
From: David Howells @ 2003-05-13 16:05 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: David Howells, linux-kernel, linux-fsdevel, openafs-devel


Linus Torvalds wrote:
> On Tue, 13 May 2003, David Howells wrote:
> > 
> >  (1) PAG (Process Authentication Group) support. A PAG is ID'd by a unique
> >      number, and is represented in memory as a structure that has a ring of
> >      associated authentication tokens.
> > 
> >      Each process can either be part of a PAG, or it can PAG-less - in
> >      which case it has no authentication tokens.
> > 
> >      Two new syscalls are added: setpag and getpag.
> 
> I think the code looks pretty horrible,

Any particular bits?

> but I think we'll need something like this to keep track of keys. However,
> I'm not sure we should make this a new structure - I think we should make
> the current "tsk->user" thing _be_ the "PAG".

Maybe... There are arguments either way, but if the token ring is kept in
struct user, a task can't detach from it and pass a token-less set of keys
onto another process it wants to run.

Also, using a separate PAG structure means that you can lend your keys to an
SUID program and conversely it means a SUID program can't so easily gain
access to keys it didn't inherit from its caller.

I'm not sure that the ability to arbitrarily join a PAG should be permitted,
but it was requested.

David

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [PATCH] in-core AFS multiplexor and PAG support
@ 2003-05-13 15:52 Linus Torvalds
  2003-05-13 15:44 ` Alan Cox
  0 siblings, 1 reply; 12+ messages in thread
From: Linus Torvalds @ 2003-05-13 15:52 UTC (permalink / raw)
  To: David Howells; +Cc: linux-kernel, linux-fsdevel, openafs-devel


On Tue, 13 May 2003, David Howells wrote:
> 
>  (1) PAG (Process Authentication Group) support. A PAG is ID'd by a unique
>      number, and is represented in memory as a structure that has a ring of
>      associated authentication tokens.
> 
>      Each process can either be part of a PAG, or it can PAG-less - in which
>      case it has no authentication tokens.
> 
>      Two new syscalls are added: setpag and getpag.

I think the code looks pretty horrible, but I think we'll need something
like this to keep track of keys. However, I'm not sure we should make this
a new structure - I think we should make the current "tsk->user" thing
_be_ the "PAG". 

		Linus

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2003-05-18 14:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-13 19:00 Re: [PATCH] in-core AFS multiplexor and PAG support Neulinger, Nathan
2003-05-13 19:19 ` Douglas E. Engert
  -- strict thread matches above, loose matches on Subject: below --
2003-05-13 18:53 David Howells
2003-05-13 20:19 ` Derrick J Brashear
2003-05-13 22:51   ` Booker Bense
2003-05-13 18:25 Neulinger, Nathan
2003-05-13 18:23 Neulinger, Nathan
2003-05-13 17:48 Neulinger, Nathan
2003-05-13 16:05 David Howells
2003-05-13 16:24 ` Douglas E. Engert
2003-05-13 16:47 ` Linus Torvalds
2003-05-13 17:20   ` Jan Harkes
2003-05-13 18:51     ` Douglas E. Engert
2003-05-13 20:33       ` [OpenAFS-devel] " Jan Harkes
2003-05-13 21:26         ` Douglas E. Engert
2003-05-17 12:30     ` Pavel Machek
2003-05-18 14:22       ` Nathan Neulinger
2003-05-13 15:52 Linus Torvalds
2003-05-13 15:44 ` Alan Cox
2003-05-13 21:46   ` Russ Allbery

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox