syscalls/fstat05: Fix failures
PATCH 1/1 syscalls/fstat05: Fix failures
Quoting Wei Li:
"
On my machine running linux-4.19.23, the fstat05 test case went failed:
[root@localhost ltp_20180926_src]# ./testcases/kernel/syscalls/fstat/fstat05
fstat05 1 TFAIL : fstat05.c:168: fstat() returned 0 but we wanted -1
Finally i found that, the end of head was expanded after invoking setup(), more than 4 * getpagesize(), then ptr_str is not a point outside user's accessible address space any more.
"
This fixes the test by using the tst_get_bad_addr() instead of sbrk() + delta.
Reported-by Wei Li <[email protected]>
CC Wei Li <[email protected]>
Signed-off-by Cyril Hrubis <[email protected]>
--- testcases/kernel/syscalls/fstat/fstat05.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
testcases/kernel/syscalls/fstat/fstat05.c +1 -6
@@ -129,16 +129,11 @@ int SIG_SEEN = sizeof(siglist) / sizeof(int);int main (int ac,char **av) { -struct stat stat_buf;/* stat structure buffer */ -struct stat *ptr_str; +struct stat *ptr_str =tst_get_bad_addr (NULL );int lc;tst_parse_opts (ac, av,NULL ,NULL ); -/* Buffer points outside user's accessible address space. */ - ptr_str = &stat_buf;/* if it was for conformance testing */ - ptr_str = (void *)sbrk (0 ) + (4 *getpagesize ()); -/* * Invoke setup function */
Signature · 1 line
2.19.2