aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-10-10 15:25:28 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-10-12 20:14:55 -0400
commit91a27b2a756784714e924e5e854b919273082d26 (patch)
tree3913246b7d6e62703ec915f481e3a7159393f0f0 /arch/mips
parent8e377d15078a501c4da98471f56396343c407d92 (diff)
vfs: define struct filename and have getname() return it
getname() is intended to copy pathname strings from userspace into a kernel buffer. The result is just a string in kernel space. It would however be quite helpful to be able to attach some ancillary info to the string. For instance, we could attach some audit-related info to reduce the amount of audit-related processing needed. When auditing is enabled, we could also call getname() on the string more than once and not need to recopy it from userspace. This patchset converts the getname()/putname() interfaces to return a struct instead of a string. For now, the struct just tracks the string in kernel space and the original userland pointer for it. Later, we'll add other information to the struct as it becomes convenient. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/kernel/linux32.c4
-rw-r--r--arch/mips/kernel/syscall.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 922a554cd10..3a21acedf88 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -83,13 +83,13 @@ out:
83asmlinkage int sys32_execve(nabi_no_regargs struct pt_regs regs) 83asmlinkage int sys32_execve(nabi_no_regargs struct pt_regs regs)
84{ 84{
85 int error; 85 int error;
86 char * filename; 86 struct filename *filename;
87 87
88 filename = getname(compat_ptr(regs.regs[4])); 88 filename = getname(compat_ptr(regs.regs[4]));
89 error = PTR_ERR(filename); 89 error = PTR_ERR(filename);
90 if (IS_ERR(filename)) 90 if (IS_ERR(filename))
91 goto out; 91 goto out;
92 error = compat_do_execve(filename, compat_ptr(regs.regs[5]), 92 error = compat_do_execve(filename->name, compat_ptr(regs.regs[5]),
93 compat_ptr(regs.regs[6]), &regs); 93 compat_ptr(regs.regs[6]), &regs);
94 putname(filename); 94 putname(filename);
95 95
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index b08220c8211..2bd561bc05a 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -133,13 +133,13 @@ _sys_clone(nabi_no_regargs struct pt_regs regs)
133asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs) 133asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs)
134{ 134{
135 int error; 135 int error;
136 char * filename; 136 struct filename *filename;
137 137
138 filename = getname((const char __user *) (long)regs.regs[4]); 138 filename = getname((const char __user *) (long)regs.regs[4]);
139 error = PTR_ERR(filename); 139 error = PTR_ERR(filename);
140 if (IS_ERR(filename)) 140 if (IS_ERR(filename))
141 goto out; 141 goto out;
142 error = do_execve(filename, 142 error = do_execve(filename->name,
143 (const char __user *const __user *) (long)regs.regs[5], 143 (const char __user *const __user *) (long)regs.regs[5],
144 (const char __user *const __user *) (long)regs.regs[6], 144 (const char __user *const __user *) (long)regs.regs[6],
145 &regs); 145 &regs);