From efb8951617826082d43ec87d8a48508b707de56c Mon Sep 17 00:00:00 2001 From: Ismael Luceno Date: Thu, 9 Sep 2021 23:15:02 +0200 Subject: [PATCH] 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. --- .../patches/musl-fix-sigevent-and-sigval_t.patch | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch index c51fca6cf432..8bed0c8d7ee9 100644 --- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch +++ b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch @@ -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)) {