From b8826e506ee58873725ec3a25a2a27fefd762574 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 18 Feb 2017 22:07:24 -0500 Subject: [PATCH] selftest for default_file_splice_read() infoleak bug fixed in commit b9dc6f65bc5e ("fix a fencepost error in pipe_advance()") Signed-off-by: Al Viro --- tools/testing/selftests/Makefile | 1 + tools/testing/selftests/splice/Makefile | 8 ++++++++ tools/testing/selftests/splice/default_file_splice_read.c | 8 ++++++++ tools/testing/selftests/splice/default_file_splice_read.sh | 7 +++++++ 4 files changed, 24 insertions(+) create mode 100644 tools/testing/selftests/splice/Makefile create mode 100644 tools/testing/selftests/splice/default_file_splice_read.c create mode 100755 tools/testing/selftests/splice/default_file_splice_read.sh diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index 71b0589..0e72f1d 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -24,6 +24,7 @@ TARGETS += ptrace TARGETS += seccomp TARGETS += sigaltstack TARGETS += size +TARGETS += splice TARGETS += static_keys TARGETS += sync TARGETS += sysctl diff --git a/tools/testing/selftests/splice/Makefile b/tools/testing/selftests/splice/Makefile new file mode 100644 index 0000000..de51f43 --- /dev/null +++ b/tools/testing/selftests/splice/Makefile @@ -0,0 +1,8 @@ +TEST_PROGS := default_file_splice_read.sh +EXTRA := default_file_splice_read +all: $(TEST_PROGS) $(EXTRA) + +include ../lib.mk + +clean: + rm -fr $(TEST_PROGS) $(EXTRA) diff --git a/tools/testing/selftests/splice/default_file_splice_read.c b/tools/testing/selftests/splice/default_file_splice_read.c new file mode 100644 index 0000000..01dd609 --- /dev/null +++ b/tools/testing/selftests/splice/default_file_splice_read.c @@ -0,0 +1,8 @@ +#define _GNU_SOURCE +#include + +int main(int argc, char **argv) +{ + splice(0, 0, 1, 0, 1<<30, 0); + return 0; +} diff --git a/tools/testing/selftests/splice/default_file_splice_read.sh b/tools/testing/selftests/splice/default_file_splice_read.sh new file mode 100755 index 0000000..1ea2ade --- /dev/null +++ b/tools/testing/selftests/splice/default_file_splice_read.sh @@ -0,0 +1,7 @@ +#!/bin/sh +n=`./default_file_splice_read