diff options
Diffstat (limited to 'kernel/auditsc.c')
| -rw-r--r-- | kernel/auditsc.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 3828ad5fb8f1..1b31c130d034 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
| @@ -65,7 +65,6 @@ | |||
| 65 | #include <linux/binfmts.h> | 65 | #include <linux/binfmts.h> |
| 66 | #include <linux/highmem.h> | 66 | #include <linux/highmem.h> |
| 67 | #include <linux/syscalls.h> | 67 | #include <linux/syscalls.h> |
| 68 | #include <linux/inotify.h> | ||
| 69 | #include <linux/capability.h> | 68 | #include <linux/capability.h> |
| 70 | #include <linux/fs_struct.h> | 69 | #include <linux/fs_struct.h> |
| 71 | 70 | ||
| @@ -549,9 +548,8 @@ static int audit_filter_rules(struct task_struct *tsk, | |||
| 549 | } | 548 | } |
| 550 | break; | 549 | break; |
| 551 | case AUDIT_WATCH: | 550 | case AUDIT_WATCH: |
| 552 | if (name && audit_watch_inode(rule->watch) != (unsigned long)-1) | 551 | if (name) |
| 553 | result = (name->dev == audit_watch_dev(rule->watch) && | 552 | result = audit_watch_compare(rule->watch, name->ino, name->dev); |
| 554 | name->ino == audit_watch_inode(rule->watch)); | ||
| 555 | break; | 553 | break; |
| 556 | case AUDIT_DIR: | 554 | case AUDIT_DIR: |
| 557 | if (ctx) | 555 | if (ctx) |
| @@ -1726,7 +1724,7 @@ static inline void handle_one(const struct inode *inode) | |||
| 1726 | struct audit_tree_refs *p; | 1724 | struct audit_tree_refs *p; |
| 1727 | struct audit_chunk *chunk; | 1725 | struct audit_chunk *chunk; |
| 1728 | int count; | 1726 | int count; |
| 1729 | if (likely(list_empty(&inode->inotify_watches))) | 1727 | if (likely(hlist_empty(&inode->i_fsnotify_marks))) |
| 1730 | return; | 1728 | return; |
| 1731 | context = current->audit_context; | 1729 | context = current->audit_context; |
| 1732 | p = context->trees; | 1730 | p = context->trees; |
| @@ -1769,7 +1767,7 @@ retry: | |||
| 1769 | seq = read_seqbegin(&rename_lock); | 1767 | seq = read_seqbegin(&rename_lock); |
| 1770 | for(;;) { | 1768 | for(;;) { |
| 1771 | struct inode *inode = d->d_inode; | 1769 | struct inode *inode = d->d_inode; |
| 1772 | if (inode && unlikely(!list_empty(&inode->inotify_watches))) { | 1770 | if (inode && unlikely(!hlist_empty(&inode->i_fsnotify_marks))) { |
| 1773 | struct audit_chunk *chunk; | 1771 | struct audit_chunk *chunk; |
| 1774 | chunk = audit_tree_lookup(inode); | 1772 | chunk = audit_tree_lookup(inode); |
| 1775 | if (chunk) { | 1773 | if (chunk) { |
| @@ -1837,13 +1835,8 @@ void __audit_getname(const char *name) | |||
| 1837 | context->names[context->name_count].ino = (unsigned long)-1; | 1835 | context->names[context->name_count].ino = (unsigned long)-1; |
| 1838 | context->names[context->name_count].osid = 0; | 1836 | context->names[context->name_count].osid = 0; |
| 1839 | ++context->name_count; | 1837 | ++context->name_count; |
| 1840 | if (!context->pwd.dentry) { | 1838 | if (!context->pwd.dentry) |
| 1841 | read_lock(¤t->fs->lock); | 1839 | get_fs_pwd(current->fs, &context->pwd); |
| 1842 | context->pwd = current->fs->pwd; | ||
| 1843 | path_get(¤t->fs->pwd); | ||
| 1844 | read_unlock(¤t->fs->lock); | ||
| 1845 | } | ||
| 1846 | |||
| 1847 | } | 1840 | } |
| 1848 | 1841 | ||
| 1849 | /* audit_putname - intercept a putname request | 1842 | /* audit_putname - intercept a putname request |
