Skip to content

Commit b8826e5

Browse files
author
Al Viro
committed
selftest for default_file_splice_read() infoleak
bug fixed in commit b9dc6f6 ("fix a fencepost error in pipe_advance()") Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 7880b43 commit b8826e5

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

tools/testing/selftests/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ TARGETS += ptrace
2424
TARGETS += seccomp
2525
TARGETS += sigaltstack
2626
TARGETS += size
27+
TARGETS += splice
2728
TARGETS += static_keys
2829
TARGETS += sync
2930
TARGETS += sysctl
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
TEST_PROGS := default_file_splice_read.sh
2+
EXTRA := default_file_splice_read
3+
all: $(TEST_PROGS) $(EXTRA)
4+
5+
include ../lib.mk
6+
7+
clean:
8+
rm -fr $(TEST_PROGS) $(EXTRA)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#define _GNU_SOURCE
2+
#include <fcntl.h>
3+
4+
int main(int argc, char **argv)
5+
{
6+
splice(0, 0, 1, 0, 1<<30, 0);
7+
return 0;
8+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
n=`./default_file_splice_read </dev/null | wc -c`
3+
4+
test "$n" = 0 && exit 0
5+
6+
echo "default_file_splice_read broken: leaked $n"
7+
exit 1

0 commit comments

Comments
 (0)