On Fri, Oct 26, 2007 at 01:30:52PM +0200, Miklos Szeredi wrote: > On Thu, 2007-10-25 at 23:40 -0700, [email protected] wrote: > > plain text document attachment (file-handle-ops.diff) > > Struct iattr already contains ia_file since commit cc4e69de from > > Miklos (which is related to commit befc649c). Use this to pass > > struct file down the setattr hooks. This allows LSMs to distinguish > > operations on file descriptors from operations on paths. > > There's a slight problem (other than HCH not liking it) with this > approach of passing the open file in iattr: for special files, the > struct file pointer makes no sense to the filesystem, since it is always > opened by the generic functions. > true > This wasn't a problem with ftruncate(), because that one only works on > regular files, but fchmod/fchown/futimes will work on special files as > well, and the filesystem interpreting file->private_data could cause > nasty bugs. > > So I think the correct solution (which was suggested by Trond and > others) is to define an f_op->fsetattr() method, which interested > filesystems can define. > yeah that does sound like the way to go, thank Miklos regards john
Attachment:
pgpOjO1UZalqH.pgp
Description: PGP signature
- References:
- [AppArmor 00/45] AppArmor security module overview
- From: [email protected]
- [AppArmor 32/45] Enable LSM hooks to distinguish operations on file descriptors from operations on pathnames
- From: [email protected]
- Re: [AppArmor 32/45] Enable LSM hooks to distinguish operations on file descriptors from operations on pathnames
- From: Miklos Szeredi <[email protected]>
- [AppArmor 00/45] AppArmor security module overview
- Prev by Date: Re: [patch 2/2] cpusets: add interleave_over_allowed option
- Next by Date: Re: [PATCH] x86: Fix boot protocol KEEP_SEGMENTS check.
- Previous by thread: Re: [AppArmor 32/45] Enable LSM hooks to distinguish operations on file descriptors from operations on pathnames
- Next by thread: Re: [AppArmor 32/45] Enable LSM hooks to distinguish operations on file descriptors from operations on pathnames
- Index(es):