You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the make test, when running ioctl test with glibc, the test will fail with error message: **** stack smashing detected ***.
To reproduce
Steps to reproduce the behavior:
make
comment the SGX related tests in "ioctl" test case
TESTS=ioctl make test-glibc
Expected behavior
make test-glibc should succeed.
Environment
HW: [e.g. SGX1, SGX2] SGX2
OS: [e.g. Ubuntu18.04, CentOS8.1] ubuntu
Occlum version: [e.g. 0.17.0] NGO master
Additional context
After some digging, I found that it is related with isatty function which will call INTERNAL_SYSCALL macro in glibc and finally call ioctl syscall with TCGETS. However, I have inspected the implementation of TCGETS and didn't find anything abnormal.
There are actually two ways to workaround that I have tried:
(1) Directly use syscall to replace INTERNAL_SYSCALL macro
(2) Shrink the size of TCGETS related struct (from 32 to 30)
However, in CI environment, this error will not show. The reason is unclear.
Possible solution/Implementation
In my opinion, this could be related to syscall entry or the memory manipulation in ioctl implementation but I am not sure.
The text was updated successfully, but these errors were encountered:
Describe the bug
In the make test, when running
ioctl
test with glibc, the test will fail with error message: **** stack smashing detected ***.To reproduce
Steps to reproduce the behavior:
Expected behavior
make test-glibc
should succeed.Environment
Additional context
After some digging, I found that it is related with
isatty
function which will callINTERNAL_SYSCALL
macro in glibc and finally call ioctl syscall with TCGETS. However, I have inspected the implementation of TCGETS and didn't find anything abnormal.There are actually two ways to workaround that I have tried:
(1) Directly use
syscall
to replaceINTERNAL_SYSCALL
macro(2) Shrink the size of TCGETS related struct (from 32 to 30)
However, in CI environment, this error will not show. The reason is unclear.
Possible solution/Implementation
In my opinion, this could be related to syscall entry or the memory manipulation in ioctl implementation but I am not sure.
The text was updated successfully, but these errors were encountered: