gpiolib: Fix line event handling in syscall compatible mode
A message that is not in the archive (sent off-list or not yet received): [email protected]
Kent Gibson
Tested-byQuoted 8 lines · Andy Shevchenko
The introduced line event handling ABI in the commit
61f922db7221("gpio: userspace ABI for reading GPIO line events")missed the fact that 64-bit kernel may serve for 32-bit applications. In such case the very first check in the
lineevent_read()will fail due to alignment differences.
Quoted 7 lines
To workaround this introduce
lineevent_get_size()helper which returns actual size of the structure in user space.Fixes 61f922db7221 ("gpio: userspace ABI for reading GPIO line events")Suggested-by Arnd Bergmann <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>Acked-by Arnd Bergmann <[email protected]>
Quoted 13 lines · Kent Gibson
Quoted 11 lines · Andy Shevchenko
The introduced line event handling ABI in the commit
61f922db7221("gpio: userspace ABI for reading GPIO line events")missed the fact that 64-bit kernel may serve for 32-bit applications. In such case the very first check in the
lineevent_read()will fail due to alignment differences.To workaround this introduce
lineevent_get_size()helper which returns actual size of the structure in user space.
Quoted 7 lines
Quoted 4 lines
Fixes 61f922db7221 ("gpio: userspace ABI for reading GPIO line events")Suggested-by Arnd Bergmann <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>Acked-by Arnd Bergmann <[email protected]>Tested-by Kent Gibson <[email protected]>
Patch applied, thanks everyone for the patch and QA!
Bartosz
Quoted 13 lines · Bartosz Golaszewski
Quoted 12 lines · Kent Gibson
Quoted 11 lines · Andy Shevchenko
The introduced line event handling ABI in the commit
61f922db7221("gpio: userspace ABI for reading GPIO line events")missed the fact that 64-bit kernel may serve for 32-bit applications. In such case the very first check in the
lineevent_read()will fail due to alignment differences.To workaround this introduce
lineevent_get_size()helper which returns actual size of the structure in user space.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Fixes 61f922db7221 ("gpio: userspace ABI for reading GPIO line events")Suggested-by Arnd Bergmann <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>Acked-by Arnd Bergmann <[email protected]>Tested-by Kent Gibson <[email protected]>Patch applied, thanks everyone for the patch and QA!
I'm also very happy for this fixup even though I didn't even comment a single time, thanks so much folks! This is community at its best.
Yours,
Linus Walleij