Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] reiserfs: Check if attrs are enabled for attr ioctls

ReiserFS currently will allow the user to set/get attrs for files
regardless if they are enabled. The patch checks to see if they are
enabled, and returns -NOTTY if they are not.

ext[23] doesn't need this check because attrs are always enabled.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Jeff Mahoney and committed by
Linus Torvalds
869eb76e 0b35ff23

+6
+6
fs/reiserfs/ioctl.c
··· 36 36 /* following two cases are taken from fs/ext2/ioctl.c by Remy 37 37 Card (card@masi.ibp.fr) */ 38 38 case REISERFS_IOC_GETFLAGS: 39 + if (!reiserfs_attrs (inode->i_sb)) 40 + return -ENOTTY; 41 + 39 42 flags = REISERFS_I(inode) -> i_attrs; 40 43 i_attrs_to_sd_attrs( inode, ( __u16 * ) &flags ); 41 44 return put_user(flags, (int __user *) arg); 42 45 case REISERFS_IOC_SETFLAGS: { 46 + if (!reiserfs_attrs (inode->i_sb)) 47 + return -ENOTTY; 48 + 43 49 if (IS_RDONLY(inode)) 44 50 return -EROFS; 45 51