Skip to content

Commit

Permalink
syscalls: add selftest for execveat(2)
Browse files Browse the repository at this point in the history
Signed-off-by: David Drysdale <[email protected]>
Cc: Meredydd Luff <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Rich Felker <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Michael Kerrisk <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
daviddrysdale authored and torvalds committed Dec 13, 2014
1 parent 27d6ec7 commit c9b26b8
Show file tree
Hide file tree
Showing 4 changed files with 432 additions and 0 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ TARGETS += user
TARGETS += sysctl
TARGETS += firmware
TARGETS += ftrace
TARGETS += exec

TARGETS_HOTPLUG = cpu-hotplug
TARGETS_HOTPLUG += memory-hotplug
Expand Down
9 changes: 9 additions & 0 deletions tools/testing/selftests/exec/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
subdir*
script*
execveat
execveat.symlink
execveat.moved
execveat.path.ephemeral
execveat.ephemeral
execveat.denatured
xxxxxxxx*
25 changes: 25 additions & 0 deletions tools/testing/selftests/exec/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
CC = $(CROSS_COMPILE)gcc
CFLAGS = -Wall
BINARIES = execveat
DEPS = execveat.symlink execveat.denatured script subdir
all: $(BINARIES) $(DEPS)

subdir:
mkdir -p $@
script:
echo '#!/bin/sh' > $@
echo 'exit $$*' >> $@
chmod +x $@
execveat.symlink: execveat
ln -s -f $< $@
execveat.denatured: execveat
cp $< $@
chmod -x $@
%: %.c
$(CC) $(CFLAGS) -o $@ $^

run_tests: all
./execveat

clean:
rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx*
Loading

0 comments on commit c9b26b8

Please sign in to comment.