Commit Graph

2 Commits

Author SHA1 Message Date
fdb2a1867e tests: adjust rt_sigpending to older kernels
With linux kernels older than v3.9-rc1, compat rt_sigpending syscall
could fail with EFAULT in cases where on later kernels it succeeds.
Adjust the test to handle both cases properly.

* tests/rt_sigpending.c (iterate): Stop iterations if rt_sigpending
failed with EFAULT.
2016-04-20 01:08:13 +00:00
11656206ff Fix corner cases of rt_sigpending syscall decoder
* signal (print_sigset_addr_len_limit): New function, cloned from
print_sigset_addr_len with added minimal length argument.
Treat length less than minimal length or greater than NSIG/8 as invalid.
Do not align length to 4-byte boundary.  Align destination buffer
to 4-byte boundary and initialize it with zeroes so that subsequent
call to sprintsigmask_n will not access uninitialized data.
(print_sigset_addr_len): Turn into a wrapper around
print_sigset_addr_len_limit with current_wordsize
as a minimal length argument.
(SYS_FUNC(rt_sigpending)): Call print_sigset_addr_len_limit
instead of print_sigset_addr_len with 1 as a minimal length argument.
* tests/rt_sigpending.c: New file.
* tests/rt_sigpending.test: New test.
* tests/.gitignore: Add rt_sigpending.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(TESTS): Add rt_sigpending.test.
2016-02-19 01:44:33 +00:00