aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-21 11:54:32 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-21 11:54:32 -0400
commit2fb59d623ad85dfdb8ce03a660051743f7361896 (patch)
tree3991ab2b88cc369444c136089d9c1570c26c6072 /include
parentefdc31319d43050a5742fb690b1a4beb68092a94 (diff)
parent74c3cbe33bc077ac1159cadfea608b501e100344 (diff)
Merge branch 'audit.b43' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current
* 'audit.b43' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current: [PATCH] audit: watching subtrees [PATCH] new helper - inotify_evict_watch() [PATCH] new helper - inotify_clone_watch() [PATCH] new helpers - collect_mounts() and release_collected_mounts() [PATCH] pass dentry to audit_inode()/audit_inode_child()
Diffstat (limited to 'include')
-rw-r--r--include/linux/audit.h19
-rw-r--r--include/linux/dcache.h1
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/fsnotify.h9
-rw-r--r--include/linux/inotify.h2
5 files changed, 21 insertions, 12 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 9ae740936a65..c68781692838 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -63,6 +63,8 @@
63#define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */ 63#define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */
64#define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */ 64#define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */
65#define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */ 65#define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */
66#define AUDIT_TRIM 1014 /* Trim junk from watched tree */
67#define AUDIT_MAKE_EQUIV 1015 /* Append to watched tree */
66#define AUDIT_TTY_GET 1016 /* Get TTY auditing status */ 68#define AUDIT_TTY_GET 1016 /* Get TTY auditing status */
67#define AUDIT_TTY_SET 1017 /* Set TTY auditing status */ 69#define AUDIT_TTY_SET 1017 /* Set TTY auditing status */
68 70
@@ -203,6 +205,7 @@
203#define AUDIT_SUCCESS 104 /* exit >= 0; value ignored */ 205#define AUDIT_SUCCESS 104 /* exit >= 0; value ignored */
204#define AUDIT_WATCH 105 206#define AUDIT_WATCH 105
205#define AUDIT_PERM 106 207#define AUDIT_PERM 106
208#define AUDIT_DIR 107
206 209
207#define AUDIT_ARG0 200 210#define AUDIT_ARG0 200
208#define AUDIT_ARG1 (AUDIT_ARG0+1) 211#define AUDIT_ARG1 (AUDIT_ARG0+1)
@@ -366,8 +369,8 @@ extern void audit_syscall_entry(int arch,
366extern void audit_syscall_exit(int failed, long return_code); 369extern void audit_syscall_exit(int failed, long return_code);
367extern void __audit_getname(const char *name); 370extern void __audit_getname(const char *name);
368extern void audit_putname(const char *name); 371extern void audit_putname(const char *name);
369extern void __audit_inode(const char *name, const struct inode *inode); 372extern void __audit_inode(const char *name, const struct dentry *dentry);
370extern void __audit_inode_child(const char *dname, const struct inode *inode, 373extern void __audit_inode_child(const char *dname, const struct dentry *dentry,
371 const struct inode *parent); 374 const struct inode *parent);
372extern void __audit_ptrace(struct task_struct *t); 375extern void __audit_ptrace(struct task_struct *t);
373 376
@@ -381,15 +384,15 @@ static inline void audit_getname(const char *name)
381 if (unlikely(!audit_dummy_context())) 384 if (unlikely(!audit_dummy_context()))
382 __audit_getname(name); 385 __audit_getname(name);
383} 386}
384static inline void audit_inode(const char *name, const struct inode *inode) { 387static inline void audit_inode(const char *name, const struct dentry *dentry) {
385 if (unlikely(!audit_dummy_context())) 388 if (unlikely(!audit_dummy_context()))
386 __audit_inode(name, inode); 389 __audit_inode(name, dentry);
387} 390}
388static inline void audit_inode_child(const char *dname, 391static inline void audit_inode_child(const char *dname,
389 const struct inode *inode, 392 const struct dentry *dentry,
390 const struct inode *parent) { 393 const struct inode *parent) {
391 if (unlikely(!audit_dummy_context())) 394 if (unlikely(!audit_dummy_context()))
392 __audit_inode_child(dname, inode, parent); 395 __audit_inode_child(dname, dentry, parent);
393} 396}
394void audit_core_dumps(long signr); 397void audit_core_dumps(long signr);
395 398
@@ -477,9 +480,9 @@ extern int audit_signals;
477#define audit_dummy_context() 1 480#define audit_dummy_context() 1
478#define audit_getname(n) do { ; } while (0) 481#define audit_getname(n) do { ; } while (0)
479#define audit_putname(n) do { ; } while (0) 482#define audit_putname(n) do { ; } while (0)
480#define __audit_inode(n,i) do { ; } while (0) 483#define __audit_inode(n,d) do { ; } while (0)
481#define __audit_inode_child(d,i,p) do { ; } while (0) 484#define __audit_inode_child(d,i,p) do { ; } while (0)
482#define audit_inode(n,i) do { ; } while (0) 485#define audit_inode(n,d) do { ; } while (0)
483#define audit_inode_child(d,i,p) do { ; } while (0) 486#define audit_inode_child(d,i,p) do { ; } while (0)
484#define audit_core_dumps(i) do { ; } while (0) 487#define audit_core_dumps(i) do { ; } while (0)
485#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) 488#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0)
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index aab53df4fafa..c2c153f97e8f 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -178,6 +178,7 @@ d_iput: no no no yes
178#define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 /* Parent inode is watched */ 178#define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 /* Parent inode is watched */
179 179
180extern spinlock_t dcache_lock; 180extern spinlock_t dcache_lock;
181extern seqlock_t rename_lock;
181 182
182/** 183/**
183 * d_drop - drop a dentry 184 * d_drop - drop a dentry
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 1bcce660cf03..50078bb30a1c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1470,6 +1470,8 @@ extern long do_mount(char *, char *, char *, unsigned long, void *);
1470extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int); 1470extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int);
1471extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, 1471extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
1472 struct vfsmount *); 1472 struct vfsmount *);
1473extern struct vfsmount *collect_mounts(struct vfsmount *, struct dentry *);
1474extern void drop_collected_mounts(struct vfsmount *);
1473 1475
1474extern int vfs_statfs(struct dentry *, struct kstatfs *); 1476extern int vfs_statfs(struct dentry *, struct kstatfs *);
1475 1477
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index dfc4e4f68da4..2bd31fa623b6 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -41,8 +41,9 @@ static inline void fsnotify_d_move(struct dentry *entry)
41 */ 41 */
42static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, 42static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
43 const char *old_name, const char *new_name, 43 const char *old_name, const char *new_name,
44 int isdir, struct inode *target, struct inode *source) 44 int isdir, struct inode *target, struct dentry *moved)
45{ 45{
46 struct inode *source = moved->d_inode;
46 u32 cookie = inotify_get_cookie(); 47 u32 cookie = inotify_get_cookie();
47 48
48 if (old_dir == new_dir) 49 if (old_dir == new_dir)
@@ -67,7 +68,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
67 if (source) { 68 if (source) {
68 inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL); 69 inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL);
69 } 70 }
70 audit_inode_child(new_name, source, new_dir); 71 audit_inode_child(new_name, moved, new_dir);
71} 72}
72 73
73/* 74/*
@@ -98,7 +99,7 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
98 inode_dir_notify(inode, DN_CREATE); 99 inode_dir_notify(inode, DN_CREATE);
99 inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name, 100 inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name,
100 dentry->d_inode); 101 dentry->d_inode);
101 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode); 102 audit_inode_child(dentry->d_name.name, dentry, inode);
102} 103}
103 104
104/* 105/*
@@ -109,7 +110,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
109 inode_dir_notify(inode, DN_CREATE); 110 inode_dir_notify(inode, DN_CREATE);
110 inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, 111 inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0,
111 dentry->d_name.name, dentry->d_inode); 112 dentry->d_name.name, dentry->d_inode);
112 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode); 113 audit_inode_child(dentry->d_name.name, dentry, inode);
113} 114}
114 115
115/* 116/*
diff --git a/include/linux/inotify.h b/include/linux/inotify.h
index d4f48c6402e6..742b917e7d1b 100644
--- a/include/linux/inotify.h
+++ b/include/linux/inotify.h
@@ -120,6 +120,8 @@ extern __s32 inotify_find_update_watch(struct inotify_handle *, struct inode *,
120 u32); 120 u32);
121extern __s32 inotify_add_watch(struct inotify_handle *, struct inotify_watch *, 121extern __s32 inotify_add_watch(struct inotify_handle *, struct inotify_watch *,
122 struct inode *, __u32); 122 struct inode *, __u32);
123extern __s32 inotify_clone_watch(struct inotify_watch *, struct inotify_watch *);
124extern void inotify_evict_watch(struct inotify_watch *);
123extern int inotify_rm_watch(struct inotify_handle *, struct inotify_watch *); 125extern int inotify_rm_watch(struct inotify_handle *, struct inotify_watch *);
124extern int inotify_rm_wd(struct inotify_handle *, __u32); 126extern int inotify_rm_wd(struct inotify_handle *, __u32);
125extern void inotify_remove_watch_locked(struct inotify_handle *, 127extern void inotify_remove_watch_locked(struct inotify_handle *,