diff options
Diffstat (limited to 'fs/xattr.c')
-rw-r--r-- | fs/xattr.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/xattr.c b/fs/xattr.c index 80eca7d3d69f..e416190f5e9c 100644 --- a/fs/xattr.c +++ b/fs/xattr.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/syscalls.h> | 17 | #include <linux/syscalls.h> |
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/fsnotify.h> | 19 | #include <linux/fsnotify.h> |
20 | #include <linux/audit.h> | ||
20 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
21 | 22 | ||
22 | 23 | ||
@@ -234,12 +235,15 @@ sys_fsetxattr(int fd, char __user *name, void __user *value, | |||
234 | size_t size, int flags) | 235 | size_t size, int flags) |
235 | { | 236 | { |
236 | struct file *f; | 237 | struct file *f; |
238 | struct dentry *dentry; | ||
237 | int error = -EBADF; | 239 | int error = -EBADF; |
238 | 240 | ||
239 | f = fget(fd); | 241 | f = fget(fd); |
240 | if (!f) | 242 | if (!f) |
241 | return error; | 243 | return error; |
242 | error = setxattr(f->f_dentry, name, value, size, flags); | 244 | dentry = f->f_dentry; |
245 | audit_inode(NULL, dentry->d_inode, 0); | ||
246 | error = setxattr(dentry, name, value, size, flags); | ||
243 | fput(f); | 247 | fput(f); |
244 | return error; | 248 | return error; |
245 | } | 249 | } |
@@ -458,12 +462,15 @@ asmlinkage long | |||
458 | sys_fremovexattr(int fd, char __user *name) | 462 | sys_fremovexattr(int fd, char __user *name) |
459 | { | 463 | { |
460 | struct file *f; | 464 | struct file *f; |
465 | struct dentry *dentry; | ||
461 | int error = -EBADF; | 466 | int error = -EBADF; |
462 | 467 | ||
463 | f = fget(fd); | 468 | f = fget(fd); |
464 | if (!f) | 469 | if (!f) |
465 | return error; | 470 | return error; |
466 | error = removexattr(f->f_dentry, name); | 471 | dentry = f->f_dentry; |
472 | audit_inode(NULL, dentry->d_inode, 0); | ||
473 | error = removexattr(dentry, name); | ||
467 | fput(f); | 474 | fput(f); |
468 | return error; | 475 | return error; |
469 | } | 476 | } |