qemu: Fix padding in host_sigevent

The struct should be padded to 64 bytes but instead it was padded to
(sizeof(int) * (64 - 2 * sizeof(int) + sizeof(union sigval))).

Assuming both int and pointer types are 64 bits, that leads to a padding
of 448 bytes.
This commit is contained in:
Ismael Luceno 2021-09-09 23:15:02 +02:00 committed by Érico Nogueira Rolim
parent 4e4bff7545
commit dbe9b644ba
2 changed files with 8 additions and 6 deletions

View file

@ -1,16 +1,18 @@
--- a/linux-user/syscall.c.orig 2015-04-10 07:10:06.305662505 +0000
+++ b/linux-user/syscall.c 2015-04-10 07:36:53.801871968 +0000
Note: Remove this patch with musl 1.2.2
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5020,9 +5020,20 @@
return 0;
}
-static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
+struct host_sigevent {
+ union sigval sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+ union {
+ int _pad[64-sizeof(int) * 2 + sizeof(union sigval)];
+ char _pad[64 - sizeof(int) * 2 - sizeof(union sigval)];
+ int _tid;
+ } _sigev_un;
+};
@ -20,5 +22,5 @@
{
+ struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
struct target_sigevent *target_sevp;
if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {

View file

@ -2,7 +2,7 @@
# This package should be updated together with qemu-user-static
pkgname=qemu
version=6.1.0
revision=2
revision=3
build_style=configure
hostmakedepends="gettext pkg-config perl python3 automake libtool flex
python3-Sphinx python3-sphinx_rtd_theme texinfo ninja"