--- zzzz-none-000/linux-2.6.19.2/fs/jfs/xattr.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/fs/jfs/xattr.c 2007-01-11 07:38:19.000000000 +0000 @@ -756,11 +756,6 @@ return -EOPNOTSUPP; } -/* - * Most of the permission checking is done by xattr_permission in the vfs. - * The local file system is responsible for handling the system.* namespace. - * We also need to verify that this is a namespace that we recognize. - */ static int can_set_xattr(struct inode *inode, const char *name, const void *value, size_t value_len) { @@ -776,6 +771,10 @@ strncmp(name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN)) return -EOPNOTSUPP; + if (!S_ISREG(inode->i_mode) && + (!S_ISDIR(inode->i_mode) || inode->i_mode &S_ISVTX)) + return -EPERM; + return 0; }