aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
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/sh/kernel
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/sh/kernel')
-rw-r--r--arch/sh/kernel/process_32.c4
-rw-r--r--arch/sh/kernel/process_64.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c
index 59521e8a164d..ba7345f37bc9 100644
--- a/arch/sh/kernel/process_32.c
+++ b/arch/sh/kernel/process_32.c
@@ -298,14 +298,14 @@ asmlinkage int sys_execve(const char __user *ufilename,
298{ 298{
299 struct pt_regs *regs = RELOC_HIDE(&__regs, 0); 299 struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
300 int error; 300 int error;
301 char *filename; 301 struct filename *filename;
302 302
303 filename = getname(ufilename); 303 filename = getname(ufilename);
304 error = PTR_ERR(filename); 304 error = PTR_ERR(filename);
305 if (IS_ERR(filename)) 305 if (IS_ERR(filename))
306 goto out; 306 goto out;
307 307
308 error = do_execve(filename, uargv, uenvp, regs); 308 error = do_execve(filename->name, uargv, uenvp, regs);
309 putname(filename); 309 putname(filename);
310out: 310out:
311 return error; 311 return error;
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c
index 602545b12a86..98a709f0c3c4 100644
--- a/arch/sh/kernel/process_64.c
+++ b/arch/sh/kernel/process_64.c
@@ -491,14 +491,14 @@ asmlinkage int sys_execve(const char *ufilename, char **uargv,
491 struct pt_regs *pregs) 491 struct pt_regs *pregs)
492{ 492{
493 int error; 493 int error;
494 char *filename; 494 struct filename *filename;
495 495
496 filename = getname((char __user *)ufilename); 496 filename = getname((char __user *)ufilename);
497 error = PTR_ERR(filename); 497 error = PTR_ERR(filename);
498 if (IS_ERR(filename)) 498 if (IS_ERR(filename))
499 goto out; 499 goto out;
500 500
501 error = do_execve(filename, 501 error = do_execve(filename->name,
502 (const char __user *const __user *)uargv, 502 (const char __user *const __user *)uargv,
503 (const char __user *const __user *)uenvp, 503 (const char __user *const __user *)uenvp,
504 pregs); 504 pregs);