Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] qemu: Fix padding in host_sigevent
@ 2021-09-09 21:17 ismaell
  2021-09-09 23:25 ` ismaell
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: ismaell @ 2021-09-09 21:17 UTC (permalink / raw)
  To: ml

[-- 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;
 +};

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
@ 2021-09-09 23:25 ` ismaell
  2021-09-09 23:25 ` [PR PATCH] [Closed]: " ismaell
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ismaell @ 2021-09-09 23:25 UTC (permalink / raw)
  To: ml

[-- 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.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PR PATCH] [Closed]: qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
  2021-09-09 23:25 ` ismaell
@ 2021-09-09 23:25 ` ismaell
  2021-09-09 23:36 ` ismaell
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ismaell @ 2021-09-09 23:25 UTC (permalink / raw)
  To: ml

[-- 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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
  2021-09-09 23:25 ` ismaell
  2021-09-09 23:25 ` [PR PATCH] [Closed]: " ismaell
@ 2021-09-09 23:36 ` ismaell
  2021-09-09 23:37 ` ismaell
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ismaell @ 2021-09-09 23:36 UTC (permalink / raw)
  To: ml

[-- 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.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
                   ` (2 preceding siblings ...)
  2021-09-09 23:36 ` ismaell
@ 2021-09-09 23:37 ` ismaell
  2021-09-10 14:25 ` ericonr
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ismaell @ 2021-09-09 23:37 UTC (permalink / raw)
  To: ml

[-- 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).

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
                   ` (3 preceding siblings ...)
  2021-09-09 23:37 ` ismaell
@ 2021-09-10 14:25 ` ericonr
  2021-09-11  0:43 ` ismaell
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ericonr @ 2021-09-10 14:25 UTC (permalink / raw)
  To: ml

[-- 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?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
                   ` (4 preceding siblings ...)
  2021-09-10 14:25 ` ericonr
@ 2021-09-11  0:43 ` ismaell
  2021-09-11 19:02 ` [PR PATCH] [Updated] " ismaell
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ismaell @ 2021-09-11  0:43 UTC (permalink / raw)
  To: ml

[-- 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.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PR PATCH] [Updated] qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
                   ` (5 preceding siblings ...)
  2021-09-11  0:43 ` ismaell
@ 2021-09-11 19:02 ` ismaell
  2021-09-11 19:03 ` ismaell
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ismaell @ 2021-09-11 19:02 UTC (permalink / raw)
  To: ml

[-- 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;
 +};

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
                   ` (6 preceding siblings ...)
  2021-09-11 19:02 ` [PR PATCH] [Updated] " ismaell
@ 2021-09-11 19:03 ` ismaell
  2021-09-11 22:45 ` ericonr
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ismaell @ 2021-09-11 19:03 UTC (permalink / raw)
  To: ml

[-- 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.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
                   ` (7 preceding siblings ...)
  2021-09-11 19:03 ` ismaell
@ 2021-09-11 22:45 ` ericonr
  2021-09-11 22:45 ` ericonr
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ericonr @ 2021-09-11 22:45 UTC (permalink / raw)
  To: ml

[-- 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;
```

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
                   ` (8 preceding siblings ...)
  2021-09-11 22:45 ` ericonr
@ 2021-09-11 22:45 ` ericonr
  2021-09-18 15:39 ` [PR PATCH] [Updated] " ismaell
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ericonr @ 2021-09-11 22:45 UTC (permalink / raw)
  To: ml

[-- 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.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PR PATCH] [Updated] qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
                   ` (9 preceding siblings ...)
  2021-09-11 22:45 ` ericonr
@ 2021-09-18 15:39 ` ismaell
  2021-09-18 15:40 ` ismaell
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ismaell @ 2021-09-18 15:39 UTC (permalink / raw)
  To: ml

[-- 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)) {

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
                   ` (10 preceding siblings ...)
  2021-09-18 15:39 ` [PR PATCH] [Updated] " ismaell
@ 2021-09-18 15:40 ` ismaell
  2021-09-18 15:41 ` [PR PATCH] [Updated] " ismaell
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ismaell @ 2021-09-18 15:40 UTC (permalink / raw)
  To: ml

[-- 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:.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PR PATCH] [Updated] qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
                   ` (11 preceding siblings ...)
  2021-09-18 15:40 ` ismaell
@ 2021-09-18 15:41 ` ismaell
  2021-09-19  3:08 ` ericonr
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ismaell @ 2021-09-18 15:41 UTC (permalink / raw)
  To: ml

[-- 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)) {

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
                   ` (12 preceding siblings ...)
  2021-09-18 15:41 ` [PR PATCH] [Updated] " ismaell
@ 2021-09-19  3:08 ` ericonr
  2021-09-19 14:39 ` [PR PATCH] [Updated] " ismaell
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ericonr @ 2021-09-19  3:08 UTC (permalink / raw)
  To: ml

[-- 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...


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PR PATCH] [Updated] qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
                   ` (13 preceding siblings ...)
  2021-09-19  3:08 ` ericonr
@ 2021-09-19 14:39 ` ismaell
  2021-09-19 14:40 ` ismaell
  2021-09-20  0:53 ` [PR PATCH] [Merged]: " ericonr
  16 siblings, 0 replies; 18+ messages in thread
From: ismaell @ 2021-09-19 14:39 UTC (permalink / raw)
  To: ml

[-- 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"

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
                   ` (14 preceding siblings ...)
  2021-09-19 14:39 ` [PR PATCH] [Updated] " ismaell
@ 2021-09-19 14:40 ` ismaell
  2021-09-20  0:53 ` [PR PATCH] [Merged]: " ericonr
  16 siblings, 0 replies; 18+ messages in thread
From: ismaell @ 2021-09-19 14:40 UTC (permalink / raw)
  To: ml

[-- 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.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PR PATCH] [Merged]: qemu: Fix padding in host_sigevent
  2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
                   ` (15 preceding siblings ...)
  2021-09-19 14:40 ` ismaell
@ 2021-09-20  0:53 ` ericonr
  16 siblings, 0 replies; 18+ messages in thread
From: ericonr @ 2021-09-20  0:53 UTC (permalink / raw)
  To: ml

[-- 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

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-09-20  0:53 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 21:17 [PR PATCH] qemu: Fix padding in host_sigevent ismaell
2021-09-09 23:25 ` ismaell
2021-09-09 23:25 ` [PR PATCH] [Closed]: " ismaell
2021-09-09 23:36 ` ismaell
2021-09-09 23:37 ` ismaell
2021-09-10 14:25 ` ericonr
2021-09-11  0:43 ` ismaell
2021-09-11 19:02 ` [PR PATCH] [Updated] " ismaell
2021-09-11 19:03 ` ismaell
2021-09-11 22:45 ` ericonr
2021-09-11 22:45 ` ericonr
2021-09-18 15:39 ` [PR PATCH] [Updated] " ismaell
2021-09-18 15:40 ` ismaell
2021-09-18 15:41 ` [PR PATCH] [Updated] " ismaell
2021-09-19  3:08 ` ericonr
2021-09-19 14:39 ` [PR PATCH] [Updated] " ismaell
2021-09-19 14:40 ` ismaell
2021-09-20  0:53 ` [PR PATCH] [Merged]: " ericonr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).