ngo icon indicating copy to clipboard operation
ngo copied to clipboard

[BUG] fstatat crashed with invalid path

Open qzheng527 opened this issue 2 years ago • 0 comments

Describe the bug

Once upgrading to Ubuntu 20.04 base, the Occlum LTP test may panic in the case statx03.

To reproduce

Steps to reproduce the behavior:

  1. Start a Occlum container with OS Ubuntu20.04
  2. Go to demos/linux-ltp, do the build.
  3. Go to ltp_instance, run occlum run /opt/ltp/run-ltp.sh -f syscalls -s statx03

Expected behavior

No panic.

Logs

If applicable, add logs to help explain your problem.

Environment

  • HW: [e.g. SGX1, SGX2]
  • OS: [Ubuntu20.04]
  • Occlum version: [0.27.0]

Additional context

NGO/Occlum doesn't support syscall statx (332), in glibc > 2.28, it eventually will call syscall fstatat. The panic happens when passing a dangling ponter as "pathname". Details could refer to the LTP source code. https://github.com/linux-test-project/ltp/blob/20210927/testcases/kernel/syscalls/statx/statx03.c#L58

Possible solution/Implementation

Not obligatory, but suggest a fix/reason for the bug.

qzheng527 avatar Mar 17 '22 03:03 qzheng527