--- linux-2.6.13-vs2.0.1/fs/xattr.c 2005-08-29 22:25:33 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/fs/xattr.c 2005-09-14 03:39:57 +0200 @@ -24,7 +24,7 @@ */ static long setxattr(struct dentry *d, char __user *name, void __user *value, - size_t size, int flags) + size_t size, int flags, struct vfsmount *mnt) { int error; void *kvalue = NULL; --- linux-2.6.13-vs2.0.1/fs/xattr.c 2005-08-29 22:25:33 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/fs/xattr.c 2005-09-14 03:39:57 +0200 @@ -57,6 +57,9 @@ setxattr(struct dentry *d, char __user * error = security_inode_setxattr(d, kname, kvalue, size, flags); if (error) goto out; + error = -EROFS; + if (MNT_IS_RDONLY(mnt)) + goto out; error = d->d_inode->i_op->setxattr(d, kname, kvalue, size, flags); if (!error) { fsnotify_xattr(d); --- linux-2.6.13-vs2.0.1/fs/xattr.c 2005-08-29 22:25:33 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/fs/xattr.c 2005-09-14 03:39:57 +0200 @@ -80,7 +83,7 @@ sys_setxattr(char __user *path, char __u error = user_path_walk(path, &nd); if (error) return error; - error = setxattr(nd.dentry, name, value, size, flags); + error = setxattr(nd.dentry, name, value, size, flags, nd.mnt); path_release(&nd); return error; } --- linux-2.6.13-vs2.0.1/fs/xattr.c 2005-08-29 22:25:33 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/fs/xattr.c 2005-09-14 03:39:57 +0200 @@ -95,7 +98,7 @@ sys_lsetxattr(char __user *path, char __ error = user_path_walk_link(path, &nd); if (error) return error; - error = setxattr(nd.dentry, name, value, size, flags); + error = setxattr(nd.dentry, name, value, size, flags, nd.mnt); path_release(&nd); return error; } --- linux-2.6.13-vs2.0.1/fs/xattr.c 2005-08-29 22:25:33 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/fs/xattr.c 2005-09-14 03:39:57 +0200 @@ -110,7 +113,7 @@ sys_fsetxattr(int fd, char __user *name, f = fget(fd); if (!f) return error; - error = setxattr(f->f_dentry, name, value, size, flags); + error = setxattr(f->f_dentry, name, value, size, flags, f->f_vfsmnt); fput(f); return error; } --- linux-2.6.13-vs2.0.1/fs/xattr.c 2005-08-29 22:25:33 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/fs/xattr.c 2005-09-14 03:39:57 +0200 @@ -288,7 +291,7 @@ sys_flistxattr(int fd, char __user *list * Extended attribute REMOVE operations */ static long -removexattr(struct dentry *d, char __user *name) +removexattr(struct dentry *d, char __user *name, struct vfsmount *mnt) { int error; char kname[XATTR_NAME_MAX + 1]; --- linux-2.6.13-vs2.0.1/fs/xattr.c 2005-08-29 22:25:33 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/fs/xattr.c 2005-09-14 03:39:57 +0200 @@ -304,6 +307,9 @@ removexattr(struct dentry *d, char __use error = security_inode_removexattr(d, kname); if (error) goto out; + error = -EROFS; + if (MNT_IS_RDONLY(mnt)) + goto out; down(&d->d_inode->i_sem); error = d->d_inode->i_op->removexattr(d, kname); up(&d->d_inode->i_sem); --- linux-2.6.13-vs2.0.1/fs/xattr.c 2005-08-29 22:25:33 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/fs/xattr.c 2005-09-14 03:39:57 +0200 @@ -321,7 +327,7 @@ sys_removexattr(char __user *path, char error = user_path_walk(path, &nd); if (error) return error; - error = removexattr(nd.dentry, name); + error = removexattr(nd.dentry, name, nd.mnt); path_release(&nd); return error; } --- linux-2.6.13-vs2.0.1/fs/xattr.c 2005-08-29 22:25:33 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/fs/xattr.c 2005-09-14 03:39:57 +0200 @@ -335,7 +341,7 @@ sys_lremovexattr(char __user *path, char error = user_path_walk_link(path, &nd); if (error) return error; - error = removexattr(nd.dentry, name); + error = removexattr(nd.dentry, name, nd.mnt); path_release(&nd); return error; } --- linux-2.6.13-vs2.0.1/fs/xattr.c 2005-08-29 22:25:33 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/fs/xattr.c 2005-09-14 03:39:57 +0200 @@ -349,7 +355,7 @@ sys_fremovexattr(int fd, char __user *na f = fget(fd); if (!f) return error; - error = removexattr(f->f_dentry, name); + error = removexattr(f->f_dentry, name, f->f_vfsmnt); fput(f); return error; }