statfs: bugfix statfs02 fstatfs02 failed in ltp-testsuite
commit7cfd2112acbc7a9dfcd9f8a23e550672934a2545
authorGuo Ren <ren_guo@c-sky.com>
Mon, 25 Sep 2017 13:20:42 +0000 (25 21:20 +0800)
committerWaldemar Brodkorb <wbx@uclibc-ng.org>
Sun, 1 Oct 2017 06:54:33 +0000 (1 08:54 +0200)
treef3283fd3a74991d3b332e9aba5ba5943ce851285
parent8b233f2491b286a2bd741b042719fdf5fde50eb2
statfs: bugfix statfs02 fstatfs02 failed in ltp-testsuite

In the test-case of statfs from ltp-testsuite, it pass -1 to 2th
argument. eg: fstatfs(fd , -1)

When uclibc-ng parse the buf32 to buf will cause illegal address
access, the kernel will signal the process with SIGSEGV.

If we pass the -1 directly to the syscall of statfs/fstatfs, kernel
use copy_to_user() to prevent the signal of SIGSEGV and just return
EINVAL.

This is the ltp-testsuite expect.

Signed-off-by: Guo Ren <ren_guo@c-sky.com>
libc/misc/statfs/fstatfs64.c
libc/misc/statfs/statfs64.c