aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-17 18:27:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-17 18:27:47 -0500
commit05016b0f0a9d900e976db7f50a7761c0aefe5a1c (patch)
tree20b2f04fee785dc9ef81596cb2f7deec6d8016e0 /include/linux
parentc6b1de1b646fe232206d4065df4d14040cebd613 (diff)
parent55422d0bd292f5ad143cc32cb8bb8505257274c4 (diff)
Merge branch 'getname2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull getname/putname updates from Al Viro: "Rework of getname/getname_kernel/etc., mostly from Paul Moore. Gets rid of quite a pile of kludges between namei and audit..." * 'getname2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: audit: replace getname()/putname() hacks with reference counters audit: fix filename matching in __audit_inode() and __audit_inode_child() audit: enable filename recording via getname_kernel() simpler calling conventions for filename_mountpoint() fs: create proper filename objects using getname_kernel() fs: rework getname_kernel to handle up to PATH_MAX sized filenames cut down the number of do_path_lookup() callers
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/audit.h3
-rw-r--r--include/linux/fs.h9
2 files changed, 2 insertions, 10 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 599f3bd2d6c5..c2e7e3a83965 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -127,7 +127,6 @@ extern void __audit_syscall_entry(int major, unsigned long a0, unsigned long a1,
127extern void __audit_syscall_exit(int ret_success, long ret_value); 127extern void __audit_syscall_exit(int ret_success, long ret_value);
128extern struct filename *__audit_reusename(const __user char *uptr); 128extern struct filename *__audit_reusename(const __user char *uptr);
129extern void __audit_getname(struct filename *name); 129extern void __audit_getname(struct filename *name);
130extern void audit_putname(struct filename *name);
131 130
132#define AUDIT_INODE_PARENT 1 /* dentry represents the parent */ 131#define AUDIT_INODE_PARENT 1 /* dentry represents the parent */
133#define AUDIT_INODE_HIDDEN 2 /* audit record should be hidden */ 132#define AUDIT_INODE_HIDDEN 2 /* audit record should be hidden */
@@ -352,8 +351,6 @@ static inline struct filename *audit_reusename(const __user char *name)
352} 351}
353static inline void audit_getname(struct filename *name) 352static inline void audit_getname(struct filename *name)
354{ } 353{ }
355static inline void audit_putname(struct filename *name)
356{ }
357static inline void __audit_inode(struct filename *name, 354static inline void __audit_inode(struct filename *name,
358 const struct dentry *dentry, 355 const struct dentry *dentry,
359 unsigned int flags) 356 unsigned int flags)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index ed5a0900b94d..a9250b2a11ba 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2141,6 +2141,7 @@ struct filename {
2141 const char *name; /* pointer to actual string */ 2141 const char *name; /* pointer to actual string */
2142 const __user char *uptr; /* original userland pointer */ 2142 const __user char *uptr; /* original userland pointer */
2143 struct audit_names *aname; 2143 struct audit_names *aname;
2144 int refcnt;
2144 bool separate; /* should "name" be freed? */ 2145 bool separate; /* should "name" be freed? */
2145}; 2146};
2146 2147
@@ -2162,6 +2163,7 @@ extern int filp_close(struct file *, fl_owner_t id);
2162extern struct filename *getname_flags(const char __user *, int, int *); 2163extern struct filename *getname_flags(const char __user *, int, int *);
2163extern struct filename *getname(const char __user *); 2164extern struct filename *getname(const char __user *);
2164extern struct filename *getname_kernel(const char *); 2165extern struct filename *getname_kernel(const char *);
2166extern void putname(struct filename *name);
2165 2167
2166enum { 2168enum {
2167 FILE_CREATED = 1, 2169 FILE_CREATED = 1,
@@ -2182,15 +2184,8 @@ extern void __init vfs_caches_init(unsigned long);
2182 2184
2183extern struct kmem_cache *names_cachep; 2185extern struct kmem_cache *names_cachep;
2184 2186
2185extern void final_putname(struct filename *name);
2186
2187#define __getname() kmem_cache_alloc(names_cachep, GFP_KERNEL) 2187#define __getname() kmem_cache_alloc(names_cachep, GFP_KERNEL)
2188#define __putname(name) kmem_cache_free(names_cachep, (void *)(name)) 2188#define __putname(name) kmem_cache_free(names_cachep, (void *)(name))
2189#ifndef CONFIG_AUDITSYSCALL
2190#define putname(name) final_putname(name)
2191#else
2192extern void putname(struct filename *name);
2193#endif
2194 2189
2195#ifdef CONFIG_BLOCK 2190#ifdef CONFIG_BLOCK
2196extern int register_blkdev(unsigned int, const char *); 2191extern int register_blkdev(unsigned int, const char *);