login
Header Space

 
 

Re: r-o bind in nfsd

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <miklos@...>, <viro@...>
Cc: <haveblue@...>, <linux-fsdevel@...>, <linux-kernel@...>, <neilb@...>, <akpm@...>, <hch@...>, <linux-security-module@...>, <jmorris@...>
Date: Friday, March 21, 2008 - 10:20 pm

Hello.

TOMOYO is one of AppArmor's friends, and I am the guy who proposed to pass
a reference to vfsmount via task_struct as if that reference is passed via stack memory.

I'm not asking to pass the vfsmount parameter to individual filesystem's "vfs functions".
I'm asking to pass the vfsmount parameter to the "vfs *helper* functions".
So, filesytem will not care where it is mounted
even if the vfsmount is passed to "vfs *helper* functions".
The vfs helper functions are designed to aggregate common checks (permission checks,
inode_operations->foo existence checks etc.) to avoid scattering same code everywhere
in the kernel, didn't they?

At least, calls to vfs helper functions from userland code
_do_ have the vfsmount available because they are called immediately after the name resolution.

Calls to vfs helper functions from kernel code does not always have the vfsmount available,
but that's beyond what the LSM can do.
We must trust kernel code, because kernel code can bypass the LSM check
if the kernel code is malicious enough to directly call "vfs functions" instead of
calling "vfs helper functions".
(Or, more simply, kernel code can rewrite the call to the LSM check to no-op
like funny workaround for vmsplice's vulnerability).

I think attempt to receive the vfsmount from kernel code won't help guaranteeing that
LSM's security checks are always performed.
Routes to access "vfs functions" from kernel code is undeterminable.
In other words, LSM can't guarantee that LSM's security checks are always performed
against the kernel code regardless of the security model.

But, at least, LSM can guarantee that LSM's security checks are always performed
against the userland code regardless of the security model.
Routes to access "vfs functions" from userland code is determinable.

So, making the vfsmount available to LSM make sense.
I don't care if the vfsmount is unavailable when the vfs helper function call was
issued from kernel code.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
r-o bind in nfsd, Miklos Szeredi, (Fri Mar 21, 10:59 am)
Re: r-o bind in nfsd, Al Viro, (Fri Mar 21, 11:54 am)
Re: r-o bind in nfsd, Miklos Szeredi, (Fri Mar 21, 12:24 pm)
Re: r-o bind in nfsd, Al Viro, (Fri Mar 21, 12:35 pm)
Re: r-o bind in nfsd, Miklos Szeredi, (Fri Mar 21, 12:54 pm)
Re: r-o bind in nfsd, Miklos Szeredi, (Fri Mar 21, 1:08 pm)
Re: r-o bind in nfsd, Al Viro, (Fri Mar 21, 2:11 pm)
Re: r-o bind in nfsd, Miklos Szeredi, (Fri Mar 21, 2:52 pm)
Re: r-o bind in nfsd, Dave Hansen, (Fri Mar 21, 5:08 pm)
Re: r-o bind in nfsd, Miklos Szeredi, (Fri Mar 21, 5:17 pm)
Re: r-o bind in nfsd, Al Viro, (Fri Mar 21, 3:49 pm)
Re: r-o bind in nfsd, Miklos Szeredi, (Fri Mar 21, 4:23 pm)
Re: r-o bind in nfsd, Tetsuo Handa, (Fri Mar 21, 10:20 pm)
speck-geostationary