-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
selftests: add memfd_create() + sealing tests
Some basic tests to verify sealing on memfds works as expected and guarantees the advertised semantics. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Acked-by: Hugh Dickins <hughd@google.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Ryan Lortie <desrt@desrt.ca> Cc: Lennart Poettering <lennart@poettering.net> Cc: Daniel Mack <zonque@gmail.com> Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
- Loading branch information
David Herrmann
authored and
Linus Torvalds
committed
Aug 8, 2014
1 parent
9183df2
commit 4f5ce5e
Showing
4 changed files
with
945 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
memfd_test | ||
memfd-test-file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
uname_M := $(shell uname -m 2>/dev/null || echo not) | ||
ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/) | ||
ifeq ($(ARCH),i386) | ||
ARCH := X86 | ||
endif | ||
ifeq ($(ARCH),x86_64) | ||
ARCH := X86 | ||
endif | ||
|
||
CFLAGS += -I../../../../arch/x86/include/generated/uapi/ | ||
CFLAGS += -I../../../../arch/x86/include/uapi/ | ||
CFLAGS += -I../../../../include/uapi/ | ||
CFLAGS += -I../../../../include/ | ||
|
||
all: | ||
ifeq ($(ARCH),X86) | ||
gcc $(CFLAGS) memfd_test.c -o memfd_test | ||
else | ||
echo "Not an x86 target, can't build memfd selftest" | ||
endif | ||
|
||
run_tests: all | ||
ifeq ($(ARCH),X86) | ||
gcc $(CFLAGS) memfd_test.c -o memfd_test | ||
endif | ||
@./memfd_test || echo "memfd_test: [FAIL]" | ||
|
||
clean: | ||
$(RM) memfd_test |
Oops, something went wrong.