[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#45716: gnu: qemu: Fix ioclt(…, SIOCGIFCONF, …) for emulated 64 bit
From: |
Stefan |
Subject: |
bug#45716: gnu: qemu: Fix ioclt(…, SIOCGIFCONF, …) for emulated 64 bit architectures. |
Date: |
Sat, 9 Jan 2021 19:01:39 +0100 |
* gnu/packages/virtualization.scm (qemu): Add a snippet to fix a bug in the
do_ioctl_ifconf() function of qemu to make ioclt(…, SIOCGIFCONF, …) work for
emulated 64 bit architectures.
The sizeof(struct ifreq) is 40 for 64 bit and 32 for 32 bit architectures.
This structure contains a union of other structures, of which struct ifmap
is the biggest for 64 bit architectures. Calling ioclt(…, SIOCGIFCONF, …)
fills a struct sockaddr of that union, and do_ioctl_ifconf() only considered
that struct sockaddr for the size of the union, which has the same size as
struct ifmap on 32 bit architectures. So do_ioctl_ifconf() assumed a wrong
size of 32 for struct ifreq instead of the correct size of 40 on 64 bit
architectures.
The fix makes do_ioctl_ifconf() handle struct ifmap as the biggest part of
the union, treating struct ifreq with the correct size.
This fixes (@ (guix build syscalls) network-interface-names) when used in
emulated 64 bit architectures.
---
gnu/packages/virtualization.scm | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 10eae8ea7d..f82a19ecf3 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -140,7 +140,17 @@
(sha256
(base32
"1rd41wwlvp0vpialjp2czs6i3lsc338xc72l3zkbb7ixjfslw5y9"))
- (patches (search-patches "qemu-build-info-manual.patch"))))
+ (patches (search-patches "qemu-build-info-manual.patch"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ (substitute* '("linux-user/syscall.c")
+ (("^([[:blank:]]*)const argtype ifreq_arg_type.*$" line
indent)
+ (string-append line indent
+ "const argtype ifreq_max_type[] = {
MK_STRUCT(STRUCT_ifmap_ifreq) };\n"))
+ (("^([[:blank:]]*)target_ifreq_size[[:blank:]]=.*$" _
indent)
+ (string-append indent "target_ifreq_size =
thunk_type_size(ifreq_max_type, 0);")))
+ #t))))
(outputs '("out" "doc")) ;4.7 MiB of HTML docs
(build-system gnu-build-system)
(arguments
--
2.29.2
- bug#45716: Bug in ‘network-interface-names’ when building guix for aarch64 on x86_64., Stefan, 2021/01/07
- bug#45716: Bug in ‘network-interface-names’ when building guix for aarch64 on x86_64., Stefan, 2021/01/07
- bug#45716: Bug in ‘network-interface-names’ when building guix for aarch64 on x86_64., Danny Milosavljevic, 2021/01/07
- bug#45716: Bug in ‘network-interface-names’ when building guix for aarch64 on x86_64., Stefan, 2021/01/08
- bug#45716: Bug in ‘network-interface-names’ when building guix for aarch64 on x86_64., Stefan, 2021/01/08
- bug#45716: Bug in ‘network-interface-names’ when building guix for aarch64 on x86_64., Stefan, 2021/01/08
- bug#45716: gnu: qemu: Fix ioclt(…, SIOCGIFCONF, …) for emulated 64 bit architectures.,
Stefan <=
- bug#45716: gnu: qemu: Fix ioclt(…, SIOCGIFCONF, …) for emulated 64 bit architectures., Ludovic Courtès, 2021/01/11
- bug#45716: [PATCH 1/1] gnu: qemu: Fix ioclt(…, SIOCGIFCONF, …) for emulated 64 bit architectures., Stefan, 2021/01/11
- bug#45716: [PATCH 1/1] gnu: qemu: Fix ioclt(…, SIOCGIFCONF, …) for emulated 64 bit architectures., Ludovic Courtès, 2021/01/14
- bug#45716: Bug in ‘network-interface-names’ when building guix for aarch64 on x86_64., Stefan, 2021/01/23
- bug#45716: Bug in ‘network-interface-names’ when building guix for aarch64 on x86_64., Leo Famulari, 2021/01/23
- bug#45716: Bug in ‘network-interface-names’ when building guix for aarch64 on x86_64., Ludovic Courtès, 2021/01/11