ChanServ changed the topic of #armlinux to: ARM kernel talk [Upstream kernel, find your vendor forums for questions about their kernels] | https://libera.irclog.whitequark.org/armlinux
System_Error has quit [Remote host closed the connection]
System_Error has joined #armlinux
apritzel_ has quit [Ping timeout: 268 seconds]
mraynal has quit [Remote host closed the connection]
mraynal has joined #armlinux
iivanov has joined #armlinux
iivanov has quit [Ping timeout: 264 seconds]
System_Error has quit [Remote host closed the connection]
System_Error has joined #armlinux
lain6141 has quit [Read error: Connection reset by peer]
lain6141 has joined #armlinux
lain6141 has quit [Changing host]
lain6141 has joined #armlinux
iivanov has joined #armlinux
iivanov has quit [Ping timeout: 252 seconds]
iivanov has joined #armlinux
iivanov has quit [Remote host closed the connection]
iivanov has quit [Remote host closed the connection]
iivanov has joined #armlinux
gclement has joined #armlinux
gclement has quit [Ping timeout: 256 seconds]
apritzel_ has quit [Ping timeout: 255 seconds]
matthias_bgg has quit [Ping timeout: 264 seconds]
gclement has joined #armlinux
frieder has joined #armlinux
matthias_bgg has joined #armlinux
sszy has joined #armlinux
prabhakalad has joined #armlinux
headless has joined #armlinux
gclement1 has joined #armlinux
gclement1 has quit [Client Quit]
<arnd>
I'm 107 patches deep into a rework of the syscalls and just noticed that s390 and x86 are the only ones that sign-extend 'long' syscall arguments in SYSCALL_DEFINEx() for compat syscalls. I was working with the assumptions that everything that has asm/syscall_wrapper.h does this the same.
<arnd>
mrutland: I see you added the wrappers in commit 4378a7d4be30 ("arm64: implement syscall wrappers"), do you remember if this was an intentional simplification because it's not needed for some reason, or if this was a mistake?
<arnd>
I still need to come up with a list of syscalls that might be affected
matthias_bgg has quit [Ping timeout: 264 seconds]
apritzel has joined #armlinux
<mrutland>
arnd: AFAICT the arm64 version was written before either s390 or x86 started explictly sign-extending (2018 for that arm64 commit, 2019 for s390 in aa0d6e70d3b34e71, 2024 for x86 in 56062d60f117dccf)
<arnd>
ok, makes sense
<mrutland>
So I missed that in the same way as x86, but folk never poked us later
<mrutland>
hmm...
<mrutland>
is the __SC_LONG mapping not doing that implicitly?
<arnd>
so far, I've managed to come up with this list of syscalls that take a signed 'long' argument and would be affected by adding this: https://www.irccloud.com/pastebin/dedlXJdw/
<mrutland>
The x86 commit mentions the LTP io_pgetevents02 test, so it should be possible to spin that up somewhere
<arnd>
actually I think roxell already has that data in his ltp test results, he has lists of all the results for LTP tests on native32, compat32 and native64
<mrutland>
ah, where's that?
<arnd>
I don't think it's published anywhere yet, but I've worked with him on that list last month, trying to identify calls that have different behavior between the the three environments . We haven't made it all the way through, but I think I remember some AIO syscalls on that list
matthias_bgg has joined #armlinux
<arnd>
ah, found a bug (on all architectures): compat_sys_fruncate() should take a compat_off_t but instead takes a compat_ulong_t. so passing a negative 32-bit offset from a compat task succeeds with a large size instead of failing
<mrutland>
fun
<arnd>
interestingly, compat_sys_truncate() did it right
<arnd>
the other bugs I found so far were all on minor architectures (parisc, sh, csky, hexagon) and related to 64-bit argument passing
<arnd>
the ftruncate one is fairly harmless since it only affects an error case, the other ones ended up either swapping the arguments around, or using random kernel stack memory instead of user arguments
iivanov has quit [Remote host closed the connection]
<arnd>
mrutland: the only ones that I think actually have a change in behavior from the x86 and s390 wrappers are io_getevents and io_pgetevents, everything else already goes through COMPAT_SYSCALL_DEFINEx(), so I'll just fix those first, along with ftruncate
iivanov has joined #armlinux
headless has quit [Quit: Konversation terminated!]
macromorgan has quit [Ping timeout: 268 seconds]
macromorgan_ has joined #armlinux
<arnd>
actually sys_io_getevents() is fine because that is only used for native mode, whiel sys_io_getevents_time32() is used in compat mode and correctly uses '__s32' arguments in place of 'long'.
<arnd>
so I just need to port 6431e92fc827 ("parisc: io_pgetevents_time64() needs compat syscall in 32-bit compat mode") to all other compat architectures
iivanov has quit [Ping timeout: 264 seconds]
<mrutland>
Looks like arm64 already uses the compat version there, so is there any extant issue on arm64?