ltp icon indicating copy to clipboard operation
ltp copied to clipboard

ioctl07 fails on powerpc

Open andree182 opened this issue 1 year ago • 1 comments

The test calls ioctl with invalid address (-1), however https://github.com/lattera/glibc/blob/master/sysdeps/unix/sysv/linux/tcgetattr.c called from the ioctl wrapper https://github.com/lattera/glibc/blob/master/sysdeps/unix/sysv/linux/powerpc/ioctl.c has no safeguards against bad address and causes some stack damage or whatever:

ioctl01
tst_test.c:1690: TINFO: LTP version: 20230929
tst_test.c:1574: TINFO: Timeout per run is 0h 00m 30s
ioctl01.c:62: TPASS: File descriptor is invalid (termio) : EBADF (9)
ioctl01.c:62: TPASS: File descriptor is invalid (termios) : EBADF (9)
ioctl01.c:62: TPASS: Termio address is invalid : EFAULT (14)
tst_test.c:1634: TBROK: Test killed by SIGSEGV!
[   10.736126] ioctl01[61]: segfault (11) at 3 nip 3c3718 lr 3c369c code 1 in libc.so.6[290000+217000]
[   10.736578] ioctl01[61]: code: 3920f000 7c034840 41c100b0 2c030000 40c2007c 80010014 81610018 80a1001c 
[   10.736627] ioctl01[61]: code: 80c10010 88e10033 80810024 81810038 <901f0004> 917f0008 80010034 81610020 

Perhaps the test should be disabled on powerpc?

andree182 avatar Sep 17 '24 09:09 andree182

What we usually do in these cases is to run the test in a child process and pass it if child segfaulted as well.

metan-ucw avatar Sep 17 '24 09:09 metan-ucw

You mention ioctl01 in the text, but title was about ioctl07, I suppose you meant ioctl01.

ioctl01 issue on ppc64le was fixed recently in ad651beeed393121ee541e3d07990e9a3d14c0c0, thus closing. Feel free to reopen if problem persists.

pevik avatar Nov 29 '24 06:11 pevik