linux-kselftest-4.4-rc3

This update consists of one minor documentation fix and a fix
 to an existing test.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWU1euAAoJEAsCRMQNDUMcC78P/3mIOPtVMRMHR0YwGA/MCavO
 +JhVbEJCsrVtg5aPRod1Psz3QU3ubqr37yAeDe7vCniJK1zDx0QBGXATv91dVGLz
 Fqjm6DZ1zJXrsSgoFhWZXtjicEI2khdMlzDsRD0vXNSDJATpWHRVa9eLMeeZnIVA
 DXMH/RRlo7b4lK8/Kf2YV190mqemMsJRF2PfUAiZ1ZqBd8hCnqsk0hYdkJNaIDfJ
 PydtUCDLbXuvjg3AfGaBndifudzRFzb/lYyQ9K3KPHj2cE5TMHCPn2jTZwJ5V3cZ
 IX+LtYtxEZu+gCz/3l9kN9QDzy0EVeozvPGgg8gY/YLmKinQVENBuVXV4+vR696y
 h/LtJm7NdVyy4fopI6YBTEvaq7TKeNQWKjnQ7p5clqMCchY1/9aSgbAVIMgw5OFb
 DPNnclcfWmVEMpzbmeyMTmfAbcqmttmQXAaklXH6WrcQ/C9KEWfMzexvY4ho/eur
 daIl7A3MyB83Z5bjUsryhVeNunPecklshE1wMwrmutnDIH8Wj+eJM6yHBJf/cgbO
 AnhKRcsqzkti0QXdlzEMRWfDWAfkzCXSbdjcORnRFV4Dw2X7RgizFXtfI6xccVxS
 AO4dtkNKbXUOt184XZlwrES+IXhtnlqBTO1HX/clQ2F7FVeT6Sq1eYuAlVugDH8H
 65mZzXyxAAfcjctk4U/r
 =8sYr
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2015-11-23 13:19:27 -08:00
commit a2931547ee
2 changed files with 8 additions and 5 deletions

View File

@ -27,7 +27,7 @@ o The build system shall remain as simple as possible, avoiding any archive or
o Where possible, any helper functions or other package-wide code shall be o Where possible, any helper functions or other package-wide code shall be
implemented in header files, avoiding the need to compile intermediate object implemented in header files, avoiding the need to compile intermediate object
files. files.
o External dependendencies shall remain as minimal as possible. Currently gcc o External dependencies shall remain as minimal as possible. Currently gcc
and glibc are the only dependencies. and glibc are the only dependencies.
o Tests return 0 for success and < 0 for failure. o Tests return 0 for success and < 0 for failure.

View File

@ -492,6 +492,9 @@ TEST_SIGNAL(KILL_one_arg_six, SIGSYS)
pid_t parent = getppid(); pid_t parent = getppid();
int fd; int fd;
void *map1, *map2; void *map1, *map2;
int page_size = sysconf(_SC_PAGESIZE);
ASSERT_LT(0, page_size);
ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
ASSERT_EQ(0, ret); ASSERT_EQ(0, ret);
@ -504,16 +507,16 @@ TEST_SIGNAL(KILL_one_arg_six, SIGSYS)
EXPECT_EQ(parent, syscall(__NR_getppid)); EXPECT_EQ(parent, syscall(__NR_getppid));
map1 = (void *)syscall(sysno, map1 = (void *)syscall(sysno,
NULL, PAGE_SIZE, PROT_READ, MAP_PRIVATE, fd, PAGE_SIZE); NULL, page_size, PROT_READ, MAP_PRIVATE, fd, page_size);
EXPECT_NE(MAP_FAILED, map1); EXPECT_NE(MAP_FAILED, map1);
/* mmap2() should never return. */ /* mmap2() should never return. */
map2 = (void *)syscall(sysno, map2 = (void *)syscall(sysno,
NULL, PAGE_SIZE, PROT_READ, MAP_PRIVATE, fd, 0x0C0FFEE); NULL, page_size, PROT_READ, MAP_PRIVATE, fd, 0x0C0FFEE);
EXPECT_EQ(MAP_FAILED, map2); EXPECT_EQ(MAP_FAILED, map2);
/* The test failed, so clean up the resources. */ /* The test failed, so clean up the resources. */
munmap(map1, PAGE_SIZE); munmap(map1, page_size);
munmap(map2, PAGE_SIZE); munmap(map2, page_size);
close(fd); close(fd);
} }