* [PATCH] powerpc: Wire up sys_execveat() syscall
@ 2014-12-20 16:47 Pranith Kumar
2014-12-21 9:56 ` Stephen Rothwell
0 siblings, 1 reply; 3+ messages in thread
From: Pranith Kumar @ 2014-12-20 16:47 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
Anton Blanchard, David Herrmann, Andrew Morton, Fabian Frederick,
open list:LINUX FOR POWERPC..., open list
Wire up sys_execveat(). This passes the selftests for the system call.
Check success of execveat(3, '../execveat', 0)... [OK]
Check success of execveat(5, 'execveat', 0)... [OK]
Check success of execveat(6, 'execveat', 0)... [OK]
Check success of execveat(-100, '/home/pranith/linux/...ftests/exec/execveat', 0)... [OK]
Check success of execveat(99, '/home/pranith/linux/...ftests/exec/execveat', 0)... [OK]
Check success of execveat(8, '', 4096)... [OK]
Check success of execveat(17, '', 4096)... [OK]
Check success of execveat(9, '', 4096)... [OK]
Check success of execveat(14, '', 4096)... [OK]
Check success of execveat(14, '', 4096)... [OK]
Check success of execveat(15, '', 4096)... [OK]
Check failure of execveat(8, '', 0) with ENOENT... [OK]
Check failure of execveat(8, '(null)', 4096) with EFAULT... [OK]
Check success of execveat(5, 'execveat.symlink', 0)... [OK]
Check success of execveat(6, 'execveat.symlink', 0)... [OK]
Check success of execveat(-100, '/home/pranith/linux/...xec/execveat.symlink', 0)... [OK]
Check success of execveat(10, '', 4096)... [OK]
Check success of execveat(10, '', 4352)... [OK]
Check failure of execveat(5, 'execveat.symlink', 256) with ELOOP... [OK]
Check failure of execveat(6, 'execveat.symlink', 256) with ELOOP... [OK]
Check failure of execveat(-100, '/home/pranith/linux/tools/testing/selftests/exec/execveat.symlink', 256) with ELOOP... [OK]
Check success of execveat(3, '../script', 0)... [OK]
Check success of execveat(5, 'script', 0)... [OK]
Check success of execveat(6, 'script', 0)... [OK]
Check success of execveat(-100, '/home/pranith/linux/...elftests/exec/script', 0)... [OK]
Check success of execveat(13, '', 4096)... [OK]
Check success of execveat(13, '', 4352)... [OK]
Check failure of execveat(18, '', 4096) with ENOENT... [OK]
Check failure of execveat(7, 'script', 0) with ENOENT... [OK]
Check success of execveat(16, '', 4096)... [OK]
Check success of execveat(16, '', 4096)... [OK]
Check success of execveat(4, '../script', 0)... [OK]
Check success of execveat(4, 'script', 0)... [OK]
Check success of execveat(4, '../script', 0)... [OK]
Check failure of execveat(4, 'script', 0) with ENOENT... [OK]
Check failure of execveat(5, 'execveat', 65535) with EINVAL... [OK]
Check failure of execveat(5, 'no-such-file', 0) with ENOENT... [OK]
Check failure of execveat(6, 'no-such-file', 0) with ENOENT... [OK]
Check failure of execveat(-100, 'no-such-file', 0) with ENOENT... [OK]
Check failure of execveat(5, '', 4096) with EACCES... [OK]
Check failure of execveat(5, 'Makefile', 0) with EACCES... [OK]
Check failure of execveat(11, '', 4096) with EACCES... [OK]
Check failure of execveat(12, '', 4096) with EACCES... [OK]
Check failure of execveat(99, '', 4096) with EBADF... [OK]
Check failure of execveat(99, 'execveat', 0) with EBADF... [OK]
Check failure of execveat(8, 'execveat', 0) with ENOTDIR... [OK]
Invoke copy of 'execveat' via filename of length 4093:
Check success of execveat(19, '', 4096)... [OK]
Check success of execveat(5, 'xxxxxxxxxxxxxxxxxxxx...yyyyyyyyyyyyyyyyyyyy', 0)... [OK]
Invoke copy of 'script' via filename of length 4093:
Check success of execveat(20, '', 4096)... [OK]
/bin/sh: 0: Can't open /dev/fd/5/xxxxxxx(... a long line of x's and y's, 0)... [OK]
Check success of execveat(5, 'xxxxxxxxxxxxxxxxxxxx...yyyyyyyyyyyyyyyyyyyy', 0)... [OK]
Tested on a 32-bit powerpc system.
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
arch/powerpc/include/asm/systbl.h | 1 +
arch/powerpc/include/asm/unistd.h | 2 +-
arch/powerpc/include/uapi/asm/unistd.h | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h
index ce9577d..778844a 100644
--- a/arch/powerpc/include/asm/systbl.h
+++ b/arch/powerpc/include/asm/systbl.h
@@ -366,3 +366,4 @@ SYSCALL_SPU(seccomp)
SYSCALL_SPU(getrandom)
SYSCALL_SPU(memfd_create)
SYSCALL_SPU(bpf)
+SYSCALL_SPU(execveat)
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h
index e0da021..36b79c3 100644
--- a/arch/powerpc/include/asm/unistd.h
+++ b/arch/powerpc/include/asm/unistd.h
@@ -12,7 +12,7 @@
#include <uapi/asm/unistd.h>
-#define __NR_syscalls 362
+#define __NR_syscalls 363
#define __NR__exit __NR_exit
#define NR_syscalls __NR_syscalls
diff --git a/arch/powerpc/include/uapi/asm/unistd.h b/arch/powerpc/include/uapi/asm/unistd.h
index f55351f..ef5b5b1 100644
--- a/arch/powerpc/include/uapi/asm/unistd.h
+++ b/arch/powerpc/include/uapi/asm/unistd.h
@@ -384,5 +384,6 @@
#define __NR_getrandom 359
#define __NR_memfd_create 360
#define __NR_bpf 361
+#define __NR_execveat 362
#endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
--
2.1.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc: Wire up sys_execveat() syscall
2014-12-20 16:47 [PATCH] powerpc: Wire up sys_execveat() syscall Pranith Kumar
@ 2014-12-21 9:56 ` Stephen Rothwell
2014-12-21 13:57 ` Pranith Kumar
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2014-12-21 9:56 UTC (permalink / raw)
To: Pranith Kumar
Cc: linux-kernel, Fabian Frederick, Paul Mackerras, Anton Blanchard,
David Herrmann, Andrew Morton, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 760 bytes --]
Hi Pranith,
On Sat, 20 Dec 2014 11:47:18 -0500 Pranith Kumar <bobby.prani@gmail.com> wrote:
>
> Wire up sys_execveat(). This passes the selftests for the system call.
Thanks for this, but ...
> diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h
> index ce9577d..778844a 100644
> --- a/arch/powerpc/include/asm/systbl.h
> +++ b/arch/powerpc/include/asm/systbl.h
> @@ -366,3 +366,4 @@ SYSCALL_SPU(seccomp)
> SYSCALL_SPU(getrandom)
> SYSCALL_SPU(memfd_create)
> SYSCALL_SPU(bpf)
> +SYSCALL_SPU(execveat)
Given that it passes pointers into the kernel and looking at the execve
system call, I assume that it should be COMPAT_SYS().
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc: Wire up sys_execveat() syscall
2014-12-21 9:56 ` Stephen Rothwell
@ 2014-12-21 13:57 ` Pranith Kumar
0 siblings, 0 replies; 3+ messages in thread
From: Pranith Kumar @ 2014-12-21 13:57 UTC (permalink / raw)
To: Stephen Rothwell
Cc: LKML, Fabian Frederick, Paul Mackerras, Anton Blanchard,
David Herrmann, Andrew Morton, open list:LINUX FOR POWERPC...
On Sun, Dec 21, 2014 at 4:56 AM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi Pranith,
>
> On Sat, 20 Dec 2014 11:47:18 -0500 Pranith Kumar <bobby.prani@gmail.com> wrote:
>>
>> Wire up sys_execveat(). This passes the selftests for the system call.
>
> Thanks for this, but ...
>
>> diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h
>> index ce9577d..778844a 100644
>> --- a/arch/powerpc/include/asm/systbl.h
>> +++ b/arch/powerpc/include/asm/systbl.h
>> @@ -366,3 +366,4 @@ SYSCALL_SPU(seccomp)
>> SYSCALL_SPU(getrandom)
>> SYSCALL_SPU(memfd_create)
>> SYSCALL_SPU(bpf)
>> +SYSCALL_SPU(execveat)
>
> Given that it passes pointers into the kernel and looking at the execve
> system call, I assume that it should be COMPAT_SYS().
>
Yes, you are right. I will send in an updated patch. Thanks!
--
Pranith
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-12-21 13:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-20 16:47 [PATCH] powerpc: Wire up sys_execveat() syscall Pranith Kumar
2014-12-21 9:56 ` Stephen Rothwell
2014-12-21 13:57 ` Pranith Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox