Skip to content

[BUG] fstatat crashed with invalid path  #232

@qzheng527

Description

@qzheng527

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions