]> dgit.raspbian.org Git - libaio.git/commit
[PATCH libaio 23/26] Fix io_pgetevents() syscall wrapper on 32-bit userland on 64...
authorGuillem Jover <guillem@hadrons.org>
Fri, 16 Aug 2019 00:33:46 +0000 (02:33 +0200)
committerGuillem Jover <guillem@debian.org>
Thu, 28 Mar 2024 00:01:37 +0000 (01:01 +0100)
commitc734d15bbbe66f043c7dfba3394a4a950d077e86
tree430d0f0c72601424b9f0891d21cabb0166ae1aad
parent3ed4c3c99d0504ca39b87629fd6f0fbc8b91291d
[PATCH libaio 23/26] Fix io_pgetevents() syscall wrapper on 32-bit userland on 64-bit kernels

The kernel compat syscall in the kernel got introduced with a broken
layout, which requires a pointer to the actual sigset_t variable but
with the size of the running kernel, not the size of the compat code.

This means that when the wrapper sends the expected compat (32-bit)
pointer, the kernel reads a 64-bit pointer, eating with it also the
sigset size member. And then proceeds to fail the comparison of the
sigset_t size and returns EINVAL.

This really needs to be fixed in the kernel, as there's no apparent
user of the broken compat layout (from codesearch.debian.org, nor a
quick github.com search). But we have to workaround it in libaio so
that we can use kernels that have not yet been fixed.

We do that, by trying the non-broken layout (that would be used with
a 32-bit userland on a 32-bit kernel), and if that fails with -EINVAL
we retry with a structure padded to what the kernel expects.

Origin: vendor
Forwarded: not-needed
Sent-Upstream: rejected
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Gbp-Pq: Name 0023-Fix-io_pgetevents-syscall-wrapper-on-32-bit-userland.patch
src/aio_pgetevents.c
src/libaio.h