Re: [AppArmor 32/45] Enable LSM hooks to distinguish operations on file descriptors from operations on pathnames

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <jjohansen@...>
Cc: <akpm@...>, <linux-kernel@...>, <linux-security-module@...>, Andreas Gruenbacher <agruen@...>
Date: Friday, October 26, 2007 - 7:30 am

On Thu, 2007-10-25 at 23:40 -0700, jjohansen@suse.de wrote:

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.

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.

Miklos


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [AppArmor 32/45] Enable LSM hooks to distinguish operati..., Miklos Szeredi, (Fri Oct 26, 7:30 am)
Re: [AppArmor 32/45] Enable LSM hooks to distinguish operati..., Andreas Gruenbacher, (Fri Oct 26, 4:24 pm)
Re: [AppArmor 32/45] Enable LSM hooks to distinguish operati..., Andreas Gruenbacher, (Fri Oct 26, 5:56 pm)