Re: [patch 06/15] sysfs: dont call notify_change

From: Greg KH
Date: Tue May 06 2008 - 02:49:24 EST


On Tue, May 06, 2008 at 08:28:39AM +0200, Miklos Szeredi wrote:
> > > sysfs_chmod_file() calls notify_change() to change the permission bits
> > > on a sysfs file. Replace with explicit call to sysfs_setattr() and
> > > fsnotify_change().
> > >
> > > This is equivalent, except that security_inode_setattr() is not
> > > called. This function is called by drivers, so the security checks do
> > > not make any sense.
> >
> > Are you sure? As a user, you can chmod the sysfs file and it will
> > stick,
>
> Right, but that's not sysfs_chmod_file() but sys_chmod(), which calls
> notify_change(), which calls security_inode_setattr().
>
> sysfs_chmod_file() is just called by a couple of drivers to change the
> file mode during operation, it's never called by user action directly.

Ah, sorry, you are correct, no objection from me for this patch:
Acked-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/