Skip to content

Commit a293154

Browse files
committed
Merge tag 'linux-kselftest-4.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull kselftest fixes from Shuah Khan: "This update consists of one minor documentation fix and a fix to an existing test" * tag 'linux-kselftest-4.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/seccomp: Get page size from sysconf tools:testing/selftests: fix typo in futex/README
2 parents 1ec2183 + 2ce47b4 commit a293154

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

tools/testing/selftests/futex/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ o The build system shall remain as simple as possible, avoiding any archive or
2727
o Where possible, any helper functions or other package-wide code shall be
2828
implemented in header files, avoiding the need to compile intermediate object
2929
files.
30-
o External dependendencies shall remain as minimal as possible. Currently gcc
30+
o External dependencies shall remain as minimal as possible. Currently gcc
3131
and glibc are the only dependencies.
3232
o Tests return 0 for success and < 0 for failure.
3333

tools/testing/selftests/seccomp/seccomp_bpf.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,9 @@ TEST_SIGNAL(KILL_one_arg_six, SIGSYS)
492492
pid_t parent = getppid();
493493
int fd;
494494
void *map1, *map2;
495+
int page_size = sysconf(_SC_PAGESIZE);
496+
497+
ASSERT_LT(0, page_size);
495498

496499
ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
497500
ASSERT_EQ(0, ret);
@@ -504,16 +507,16 @@ TEST_SIGNAL(KILL_one_arg_six, SIGSYS)
504507

505508
EXPECT_EQ(parent, syscall(__NR_getppid));
506509
map1 = (void *)syscall(sysno,
507-
NULL, PAGE_SIZE, PROT_READ, MAP_PRIVATE, fd, PAGE_SIZE);
510+
NULL, page_size, PROT_READ, MAP_PRIVATE, fd, page_size);
508511
EXPECT_NE(MAP_FAILED, map1);
509512
/* mmap2() should never return. */
510513
map2 = (void *)syscall(sysno,
511-
NULL, PAGE_SIZE, PROT_READ, MAP_PRIVATE, fd, 0x0C0FFEE);
514+
NULL, page_size, PROT_READ, MAP_PRIVATE, fd, 0x0C0FFEE);
512515
EXPECT_EQ(MAP_FAILED, map2);
513516

514517
/* The test failed, so clean up the resources. */
515-
munmap(map1, PAGE_SIZE);
516-
munmap(map2, PAGE_SIZE);
518+
munmap(map1, page_size);
519+
munmap(map2, page_size);
517520
close(fd);
518521
}
519522

0 commit comments

Comments
 (0)