[-- Attachment #1: Type: text/plain, Size: 794 bytes --] There is a new pull request by ismaell against master on the void-packages repository https://github.com/ismaell/void-packages patch-1 https://github.com/void-linux/void-packages/pull/32897 qemu: Fix padding in host_sigevent <!-- Mark items with [x] where applicable --> #### General - [x] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements) #### Have the results of the proposed changes been tested? - [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me - [ ] I generally don't use the affected packages but briefly tested this PR A patch file from https://github.com/void-linux/void-packages/pull/32897.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-patch-1-32897.patch --] [-- Type: text/x-diff, Size: 885 bytes --] From fc526ffd53a5cba536efdbfa68182873d72e2175 Mon Sep 17 00:00:00 2001 From: Ismael Luceno <ismael@iodev.co.uk> Date: Thu, 9 Sep 2021 23:15:02 +0200 Subject: [PATCH] qemu: Fix padding in host_sigevent --- srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..3b0754b478bf 100644 --- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch +++ b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch @@ -10,7 +10,7 @@ + int sigev_signo; + int sigev_notify; + union { -+ int _pad[64-sizeof(int) * 2 + sizeof(union sigval)]; ++ int _pad[(64 - (sizeof(int) * 2 + sizeof(union sigval))) / sizeof(int)]; + int _tid; + } _sigev_un; +};
[-- Attachment #1: Type: text/plain, Size: 175 bytes --] New comment by ismaell on void-packages repository https://github.com/void-linux/void-packages/pull/32897#issuecomment-916507633 Comment: Patch may not be relevant anymore.
[-- Attachment #1: Type: text/plain, Size: 643 bytes --] There's a closed pull request on the void-packages repository qemu: Fix padding in host_sigevent https://github.com/void-linux/void-packages/pull/32897 Description: <!-- Mark items with [x] where applicable --> #### General - [x] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements) #### Have the results of the proposed changes been tested? - [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me - [ ] I generally don't use the affected packages but briefly tested this PR
[-- Attachment #1: Type: text/plain, Size: 174 bytes --] New comment by ismaell on void-packages repository https://github.com/void-linux/void-packages/pull/32897#issuecomment-916511561 Comment: The patch breaks with musl 1.2.2.
[-- Attachment #1: Type: text/plain, Size: 203 bytes --] New comment by ismaell on void-packages repository https://github.com/void-linux/void-packages/pull/32897#issuecomment-916511561 Comment: The patch breaks with musl 1.2.2 (which adds the missing API).
[-- Attachment #1: Type: text/plain, Size: 349 bytes --] New comment by ericonr on void-packages repository https://github.com/void-linux/void-packages/pull/32897#issuecomment-916945431 Comment: Please include more context in the commit message. Was the original patch wrong and we failed to detect it with our version of musl, but it appears in musl 1.2.2? What did you use for reference for the patch?
[-- Attachment #1: Type: text/plain, Size: 374 bytes --] New comment by ismaell on void-packages repository https://github.com/void-linux/void-packages/pull/32897#issuecomment-917306002 Comment: @ericonr yes, the patch is wrong in that it makes the struct much larger than necessary, it should be 64 bytes. OTOH, it won't build with musl 1.2.2, because introduces the missing API using different names for the struct fields.
[-- Attachment #1: Type: text/plain, Size: 799 bytes --] There is an updated pull request by ismaell against master on the void-packages repository https://github.com/ismaell/void-packages patch-1 https://github.com/void-linux/void-packages/pull/32897 qemu: Fix padding in host_sigevent <!-- Mark items with [x] where applicable --> #### General - [x] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements) #### Have the results of the proposed changes been tested? - [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me - [ ] I generally don't use the affected packages but briefly tested this PR A patch file from https://github.com/void-linux/void-packages/pull/32897.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-patch-1-32897.patch --] [-- Type: text/x-diff, Size: 1105 bytes --] From 4e0ab7d2eb5491ac6aef3bc7f35ce2d5ee0f1f0a Mon Sep 17 00:00:00 2001 From: Ismael Luceno <ismael@iodev.co.uk> 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. --- srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..3b0754b478bf 100644 --- a/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch +++ b/srcpkgs/qemu/patches/musl-fix-sigevent-and-sigval_t.patch @@ -10,7 +10,7 @@ + int sigev_signo; + int sigev_notify; + union { -+ int _pad[64-sizeof(int) * 2 + sizeof(union sigval)]; ++ int _pad[(64 - (sizeof(int) * 2 + sizeof(union sigval))) / sizeof(int)]; + int _tid; + } _sigev_un; +};
[-- Attachment #1: Type: text/plain, Size: 213 bytes --] New comment by ismaell on void-packages repository https://github.com/void-linux/void-packages/pull/32897#issuecomment-917457949 Comment: @ericonr I've added some description of the issue to the commit message.
[-- Attachment #1: Type: text/plain, Size: 503 bytes --] New comment by ericonr on void-packages repository https://github.com/void-linux/void-packages/pull/32897#issuecomment-917496567 Comment: Can we use musl's stuff instead, but renamed appropriately? I think it's clearer and has known provenance. ``` union { char __pad[64 - 2*sizeof(int) - sizeof(union sigval)]; pid_t sigev_notify_thread_id; struct { void (*sigev_notify_function)(union sigval); pthread_attr_t *sigev_notify_attributes; } __sev_thread; } __sev_fields; ```
[-- Attachment #1: Type: text/plain, Size: 359 bytes --] New comment by ericonr on void-packages repository https://github.com/void-linux/void-packages/pull/32897#issuecomment-917496664 Comment: > OTOH, it won't build with musl 1.2.2, because introduces the missing API using different names for the struct fields. feel free to add a comment to the patch that mentions it should be removed when we update musl.
[-- Attachment #1: Type: text/plain, Size: 799 bytes --] There is an updated pull request by ismaell against master on the void-packages repository https://github.com/ismaell/void-packages patch-1 https://github.com/void-linux/void-packages/pull/32897 qemu: Fix padding in host_sigevent <!-- Mark items with [x] where applicable --> #### General - [x] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements) #### Have the results of the proposed changes been tested? - [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me - [ ] I generally don't use the affected packages but briefly tested this PR A patch file from https://github.com/void-linux/void-packages/pull/32897.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-patch-1-32897.patch --] [-- Type: text/x-diff, Size: 1728 bytes --] From efb8951617826082d43ec87d8a48508b707de56c Mon Sep 17 00:00:00 2001 From: Ismael Luceno <ismael@iodev.co.uk> 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)) {
[-- Attachment #1: Type: text/plain, Size: 154 bytes --] New comment by ismaell on void-packages repository https://github.com/void-linux/void-packages/pull/32897#issuecomment-922329919 Comment: Done :smile:.
[-- Attachment #1: Type: text/plain, Size: 799 bytes --] There is an updated pull request by ismaell against master on the void-packages repository https://github.com/ismaell/void-packages patch-1 https://github.com/void-linux/void-packages/pull/32897 qemu: Fix padding in host_sigevent <!-- Mark items with [x] where applicable --> #### General - [x] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements) #### Have the results of the proposed changes been tested? - [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me - [ ] I generally don't use the affected packages but briefly tested this PR A patch file from https://github.com/void-linux/void-packages/pull/32897.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-patch-1-32897.patch --] [-- Type: text/x-diff, Size: 1728 bytes --] From 46f59ff29ac1a07f3da4cae4e8b42435e839d709 Mon Sep 17 00:00:00 2001 From: Ismael Luceno <ismael@iodev.co.uk> 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)) {
[-- Attachment #1: Type: text/plain, Size: 242 bytes --] New comment by ericonr on void-packages repository https://github.com/void-linux/void-packages/pull/32897#issuecomment-922407978 Comment: I think you still forgot to revbump the template? Otherwise it won't be rebuilt with this change...
[-- Attachment #1: Type: text/plain, Size: 799 bytes --] There is an updated pull request by ismaell against master on the void-packages repository https://github.com/ismaell/void-packages patch-1 https://github.com/void-linux/void-packages/pull/32897 qemu: Fix padding in host_sigevent <!-- Mark items with [x] where applicable --> #### General - [x] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements) #### Have the results of the proposed changes been tested? - [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me - [ ] I generally don't use the affected packages but briefly tested this PR A patch file from https://github.com/void-linux/void-packages/pull/32897.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-patch-1-32897.patch --] [-- Type: text/x-diff, Size: 2232 bytes --] From eed91170c607fee478d3c5bf093e4a75c3e4a628 Mon Sep 17 00:00:00 2001 From: Ismael Luceno <ismael@iodev.co.uk> 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 +++++++----- srcpkgs/qemu/template | 2 +- 2 files changed, 8 insertions(+), 6 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)) { diff --git a/srcpkgs/qemu/template b/srcpkgs/qemu/template index 186609607a74..cbb6bd8b89d2 100644 --- a/srcpkgs/qemu/template +++ b/srcpkgs/qemu/template @@ -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"
[-- Attachment #1: Type: text/plain, Size: 310 bytes --] New comment by ismaell on void-packages repository https://github.com/void-linux/void-packages/pull/32897#issuecomment-922484512 Comment: On 18/Sep/2021 20:08, Érico Nogueira Rolim wrote: > I think you still forgot to revbump the template? Otherwise it won't be rebuilt with this change... Fixed. Thanks.
[-- Attachment #1: Type: text/plain, Size: 643 bytes --] There's a merged pull request on the void-packages repository qemu: Fix padding in host_sigevent https://github.com/void-linux/void-packages/pull/32897 Description: <!-- Mark items with [x] where applicable --> #### General - [x] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements) #### Have the results of the proposed changes been tested? - [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me - [ ] I generally don't use the affected packages but briefly tested this PR