summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/audit.h12
-rw-r--r--include/linux/fs.h14
2 files changed, 18 insertions, 8 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 3df643d1ac5b..94d29164803f 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -460,6 +460,8 @@ extern int audit_classify_arch(int arch);
#define AUDIT_TYPE_CHILD_DELETE 3 /* a child being deleted */
#define AUDIT_TYPE_CHILD_CREATE 4 /* a child being created */
+struct filename;
+
#ifdef CONFIG_AUDITSYSCALL
/* These are defined in auditsc.c */
/* Public API */
@@ -469,8 +471,8 @@ extern void __audit_syscall_entry(int arch,
int major, unsigned long a0, unsigned long a1,
unsigned long a2, unsigned long a3);
extern void __audit_syscall_exit(int ret_success, long ret_value);
-extern void __audit_getname(const char *name);
-extern void audit_putname(const char *name);
+extern void __audit_getname(struct filename *name);
+extern void audit_putname(struct filename *name);
extern void __audit_inode(const char *name, const struct dentry *dentry,
unsigned int parent);
extern void __audit_inode_child(const struct inode *parent,
@@ -505,7 +507,7 @@ static inline void audit_syscall_exit(void *pt_regs)
__audit_syscall_exit(success, return_code);
}
}
-static inline void audit_getname(const char *name)
+static inline void audit_getname(struct filename *name)
{
if (unlikely(!audit_dummy_context()))
__audit_getname(name);
@@ -663,9 +665,9 @@ static inline int audit_dummy_context(void)
{
return 1;
}
-static inline void audit_getname(const char *name)
+static inline void audit_getname(struct filename *name)
{ }
-static inline void audit_putname(const char *name)
+static inline void audit_putname(struct filename *name)
{ }
static inline void __audit_inode(const char *name, const struct dentry *dentry,
unsigned int parent)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b44b4ca82164..6c93b46f46dc 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2196,6 +2196,10 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
#endif /* CONFIG_FILE_LOCKING */
/* fs/open.c */
+struct filename {
+ const char *name; /* pointer to actual string */
+ const __user char *uptr; /* original userland pointer */
+};
extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
struct file *filp);
@@ -2208,7 +2212,9 @@ extern struct file *file_open_root(struct dentry *, struct vfsmount *,
const char *, int);
extern struct file * dentry_open(const struct path *, int, const struct cred *);
extern int filp_close(struct file *, fl_owner_t id);
-extern char * getname(const char __user *);
+
+extern struct filename *getname(const char __user *);
+
enum {
FILE_CREATED = 1,
FILE_OPENED = 2
@@ -2228,12 +2234,14 @@ extern void __init vfs_caches_init(unsigned long);
extern struct kmem_cache *names_cachep;
+extern void final_putname(struct filename *name);
+
#define __getname() kmem_cache_alloc(names_cachep, GFP_KERNEL)
#define __putname(name) kmem_cache_free(names_cachep, (void *)(name))
#ifndef CONFIG_AUDITSYSCALL
-#define putname(name) __putname(name)
+#define putname(name) final_putname(name)
#else
-extern void putname(const char *name);
+extern void putname(struct filename *name);
#endif
#ifdef CONFIG_BLOCK