* [Buildroot] [PATCH] package/ebtables: remove KERNEL_64_USERSPACE_32 workaround
@ 2024-09-27 8:24 Baruch Siach via buildroot
2024-10-29 22:21 ` Thomas Petazzoni via buildroot
2024-11-20 20:52 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Baruch Siach via buildroot @ 2024-09-27 8:24 UTC (permalink / raw)
To: buildroot; +Cc: Thomas De Schampheleire
This workaround breaks build with gcc 14.
Upstream developers acknowledged[1] the 32/64 compatibility issue more
than 3 years ago, but no proper fix has been applied. Specifically, for
aarch64 we don't even enable BR2_KERNEL_64_USERLAND_32, so this
workaround is not effective there.
The least we can do is make ebtables depend on
!BR2_KERNEL_64_USERLAND_32.
[1] https://lore.kernel.org/all/20210518181730.13436-1-patrickdepinguin@gmail.com/
Fixes:
http://autobuild.buildroot.net/results/680674c2b61209b505efa022a8fd9751ddc5fd47/
http://autobuild.buildroot.net/results/60f8f5f087111ec3f300dc7979363de5a9f64f08/
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
.checkpackageignore | 2 -
...estore-KERNEL_64_USERSPACE_32-checks.patch | 105 ------------------
...-option-enable-kernel-64-userland-32.patch | 51 ---------
package/ebtables/Config.in | 2 +
package/ebtables/ebtables.mk | 6 -
5 files changed, 2 insertions(+), 164 deletions(-)
delete mode 100644 package/ebtables/0002-ebtables.h-restore-KERNEL_64_USERSPACE_32-checks.patch
delete mode 100644 package/ebtables/0003-configure.ac-add-option-enable-kernel-64-userland-32.patch
diff --git a/.checkpackageignore b/.checkpackageignore
index 0cc742bf0960..aa4418a03019 100644
--- a/.checkpackageignore
+++ b/.checkpackageignore
@@ -451,8 +451,6 @@ package/dvdrw-tools/0002-Include-sysmacros.h-to-compile-with-newer-gcc.patch lib
package/earlyoom/0001-main.c-fix-build-with-kernel-4.3.patch lib_patch.Upstream
package/earlyoom/S02earlyoom Shellcheck lib_sysv.Indent
package/ebtables/0001-replace-ebtables-save-perl-script-with-bash.patch lib_patch.Upstream
-package/ebtables/0002-ebtables.h-restore-KERNEL_64_USERSPACE_32-checks.patch lib_patch.Upstream
-package/ebtables/0003-configure.ac-add-option-enable-kernel-64-userland-32.patch lib_patch.Upstream
package/ecryptfs-utils/0001-musl.patch lib_patch.Upstream
package/ecryptfs-utils/0002-openssl110.patch lib_patch.Upstream
package/ecryptfs-utils/0003-fix-parallel-build-issue.patch lib_patch.Upstream
diff --git a/package/ebtables/0002-ebtables.h-restore-KERNEL_64_USERSPACE_32-checks.patch b/package/ebtables/0002-ebtables.h-restore-KERNEL_64_USERSPACE_32-checks.patch
deleted file mode 100644
index 84b4d0f392db..000000000000
--- a/package/ebtables/0002-ebtables.h-restore-KERNEL_64_USERSPACE_32-checks.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-From 7297a8ef3cab3b0faf1426622ee902a2144e2e89 Mon Sep 17 00:00:00 2001
-From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
-Date: Wed, 24 Mar 2021 11:27:14 +0100
-Subject: [PATCH] ebtables.h: restore KERNEL_64_USERSPACE_32 checks
-
-Commit e6359eedfbf497e52d52451072aea4713ed80a88 replaced the file ebtables.h
-but removed the usage of KERNEL_64_USERSPACE_32. This breaks boards where
-such flag is relevant, with following messages:
-
-[ 6364.971346] kernel msg: ebtables bug: please report to author: Standard target size too big
-
-Unable to update the kernel. Two possible causes:
-1. Multiple ebtables programs were executing simultaneously. The ebtables
- userspace tool doesn't by default support multiple ebtables programs running
- concurrently. The ebtables option --concurrent or a tool like flock can be
- used to support concurrent scripts that update the ebtables kernel tables.
-2. The kernel doesn't support a certain ebtables extension, consider
- recompiling your kernel or insmod the extension.
-
-Analysis shows that the structure 'ebt_replace' passed from userspace
-ebtables to the kernel, is too small, i.e 80 bytes instead of 120 in case of
-64-bit kernel.
-
-Note that the ebtables build system seems to assume that 'sparc64' is the
-only case where KERNEL_64_USERSPACE_32 is relevant, but this is not true.
-This situation can happen on many architectures, especially in embedded
-systems. For example, an Aarch64 processor with kernel in 64-bit but
-userland build for 32-bit Arm. Or a 64-bit MIPS Octeon III processor, with
-userland running in the 'n32' ABI.
-
-Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
-Upstream-Status: http://patchwork.ozlabs.org/project/netfilter-devel/patch/20210518181730.13436-1-patrickdepinguin@gmail.com/
----
- include/linux/netfilter_bridge/ebtables.h | 21 +++++++++++++++++++++
- 1 file changed, 21 insertions(+)
-
-diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h
-index 5be75f2..3c2b61e 100644
---- a/include/linux/netfilter_bridge/ebtables.h
-+++ b/include/linux/netfilter_bridge/ebtables.h
-@@ -49,12 +49,21 @@ struct ebt_replace {
- /* total size of the entries */
- unsigned int entries_size;
- /* start of the chains */
-+#ifdef KERNEL_64_USERSPACE_32
-+ uint64_t hook_entry[NF_BR_NUMHOOKS];
-+#else
- struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
-+#endif
- /* nr of counters userspace expects back */
- unsigned int num_counters;
- /* where the kernel will put the old counters */
-+#ifdef KERNEL_64_USERSPACE_32
-+ uint64_t counters;
-+ uint64_t entries;
-+#else
- struct ebt_counter *counters;
- char *entries;
-+#endif
- };
-
- struct ebt_replace_kernel {
-@@ -129,6 +138,9 @@ struct ebt_entry_match {
- } u;
- /* size of data */
- unsigned int match_size;
-+#ifdef KERNEL_64_USERSPACE_32
-+ unsigned int pad;
-+#endif
- unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
- };
-
-@@ -142,6 +154,9 @@ struct ebt_entry_watcher {
- } u;
- /* size of data */
- unsigned int watcher_size;
-+#ifdef KERNEL_64_USERSPACE_32
-+ unsigned int pad;
-+#endif
- unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
- };
-
-@@ -155,6 +170,9 @@ struct ebt_entry_target {
- } u;
- /* size of data */
- unsigned int target_size;
-+#ifdef KERNEL_64_USERSPACE_32
-+ unsigned int pad;
-+#endif
- unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
- };
-
-@@ -162,6 +180,9 @@ struct ebt_entry_target {
- struct ebt_standard_target {
- struct ebt_entry_target target;
- int verdict;
-+#ifdef KERNEL_64_USERSPACE_32
-+ unsigned int pad;
-+#endif
- };
-
- /* one entry */
---
-2.26.2
-
diff --git a/package/ebtables/0003-configure.ac-add-option-enable-kernel-64-userland-32.patch b/package/ebtables/0003-configure.ac-add-option-enable-kernel-64-userland-32.patch
deleted file mode 100644
index cb57b395690a..000000000000
--- a/package/ebtables/0003-configure.ac-add-option-enable-kernel-64-userland-32.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From ebf0236270b977a62c522bc32810bc9f8edc72d1 Mon Sep 17 00:00:00 2001
-From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
-Date: Wed, 24 Mar 2021 13:40:14 +0100
-Subject: [PATCH] configure.ac: add option --enable-kernel-64-userland-32
-
-The ebtables build system seems to assume that 'sparc64' is the
-only case where KERNEL_64_USERSPACE_32 is relevant, but this is not true.
-This situation can happen on many architectures, especially in embedded
-systems. For example, an Aarch64 processor with kernel in 64-bit but
-userland build for 32-bit Arm. Or a 64-bit MIPS Octeon III processor, with
-userland running in the 'n32' ABI.
-
-While it is possible to set CFLAGS in the environment when calling the
-configure script, the caller would need to know to not only specify
-KERNEL_64_USERSPACE_32 but also the EBT_MIN_ALIGN value.
-
-Instead, add a configure option. All internal details can then be handled by
-the configure script.
-
-Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
-Upstream-Status: http://patchwork.ozlabs.org/project/netfilter-devel/patch/20210518181730.13436-2-patrickdepinguin@gmail.com/
----
- configure.ac | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/configure.ac b/configure.ac
-index c24ede3..3e89c0c 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -15,10 +15,17 @@ AS_IF([test "x$LOCKFILE" = x], [LOCKFILE="/var/lib/ebtables/lock"])
-
- regular_CFLAGS="-Wall -Wunused"
- regular_CPPFLAGS=""
-+
- case "$host" in
- sparc64-*)
-- regular_CPPFLAGS="$regular_CPPFLAGS -DEBT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32";;
-+ enable_kernel_64_userland_32=yes ;;
- esac
-+AC_ARG_ENABLE([kernel-64-userland-32],
-+ AC_HELP_STRING([--enable-kernel-64-userland-32], [indicate that ebtables will be built as a 32-bit application but run under a 64-bit kernel])
-+)
-+AS_IF([test "x$enable_kernel_64_userland_32" = xyes],
-+ [regular_CPPFLAGS="$regular_CPPFLAGS -DEBT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32"]
-+)
-
- AC_SUBST([regular_CFLAGS])
- AC_SUBST([regular_CPPFLAGS])
---
-2.26.2
-
diff --git a/package/ebtables/Config.in b/package/ebtables/Config.in
index 703e55a3c3c8..ce5f67bc61f9 100644
--- a/package/ebtables/Config.in
+++ b/package/ebtables/Config.in
@@ -1,6 +1,8 @@
config BR2_PACKAGE_EBTABLES
bool "ebtables"
depends on BR2_USE_MMU # fork()
+ # https://lore.kernel.org/all/20210518181730.13436-1-patrickdepinguin@gmail.com/
+ depends on !BR2_KERNEL_64_USERLAND_32
help
Ethernet bridge frame table administration
diff --git a/package/ebtables/ebtables.mk b/package/ebtables/ebtables.mk
index 46c22dde9baf..09a9f4ba7dbb 100644
--- a/package/ebtables/ebtables.mk
+++ b/package/ebtables/ebtables.mk
@@ -11,12 +11,6 @@ EBTABLES_LICENSE_FILES = COPYING
EBTABLES_CPE_ID_VENDOR = netfilter
EBTABLES_SELINUX_MODULES = iptables
-# for 0003-configure.ac-add-option-enable-kernel-64-userland-32.patch
-EBTABLES_AUTORECONF = YES
-ifeq ($(BR2_KERNEL_64_USERLAND_32),y)
-EBTABLES_CONF_OPTS += --enable-kernel-64-userland-32
-endif
-
ifeq ($(BR2_PACKAGE_EBTABLES_UTILS_SAVE),y)
define EBTABLES_INSTALL_TARGET_UTILS_SAVE
$(INSTALL) -m 0755 -D $(@D)/ebtables-save.sh $(TARGET_DIR)/usr/sbin/ebtables-legacy-save
--
2.45.2
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [Buildroot] [PATCH] package/ebtables: remove KERNEL_64_USERSPACE_32 workaround
2024-09-27 8:24 [Buildroot] [PATCH] package/ebtables: remove KERNEL_64_USERSPACE_32 workaround Baruch Siach via buildroot
@ 2024-10-29 22:21 ` Thomas Petazzoni via buildroot
2024-11-20 20:52 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-10-29 22:21 UTC (permalink / raw)
To: Baruch Siach via buildroot; +Cc: Thomas De Schampheleire
On Fri, 27 Sep 2024 11:24:10 +0300
Baruch Siach via buildroot <buildroot@buildroot.org> wrote:
> This workaround breaks build with gcc 14.
>
> Upstream developers acknowledged[1] the 32/64 compatibility issue more
> than 3 years ago, but no proper fix has been applied. Specifically, for
> aarch64 we don't even enable BR2_KERNEL_64_USERLAND_32, so this
> workaround is not effective there.
>
> The least we can do is make ebtables depend on
> !BR2_KERNEL_64_USERLAND_32.
>
> [1] https://lore.kernel.org/all/20210518181730.13436-1-patrickdepinguin@gmail.com/
>
> Fixes:
> http://autobuild.buildroot.net/results/680674c2b61209b505efa022a8fd9751ddc5fd47/
> http://autobuild.buildroot.net/results/60f8f5f087111ec3f300dc7979363de5a9f64f08/
>
> Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
> .checkpackageignore | 2 -
> ...estore-KERNEL_64_USERSPACE_32-checks.patch | 105 ------------------
> ...-option-enable-kernel-64-userland-32.patch | 51 ---------
> package/ebtables/Config.in | 2 +
> package/ebtables/ebtables.mk | 6 -
> 5 files changed, 2 insertions(+), 164 deletions(-)
> delete mode 100644 package/ebtables/0002-ebtables.h-restore-KERNEL_64_USERSPACE_32-checks.patch
> delete mode 100644 package/ebtables/0003-configure.ac-add-option-enable-kernel-64-userland-32.patch
Applied to master, after propagating the dependency to
BR2_PACKAGE_LIBVIRT_DAEMON, which selects ebtables.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH] package/ebtables: remove KERNEL_64_USERSPACE_32 workaround
2024-09-27 8:24 [Buildroot] [PATCH] package/ebtables: remove KERNEL_64_USERSPACE_32 workaround Baruch Siach via buildroot
2024-10-29 22:21 ` Thomas Petazzoni via buildroot
@ 2024-11-20 20:52 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2024-11-20 20:52 UTC (permalink / raw)
To: Baruch Siach via buildroot; +Cc: Thomas De Schampheleire
>>>>> "Baruch" == Baruch Siach via buildroot <buildroot@buildroot.org> writes:
> This workaround breaks build with gcc 14.
> Upstream developers acknowledged[1] the 32/64 compatibility issue more
> than 3 years ago, but no proper fix has been applied. Specifically, for
> aarch64 we don't even enable BR2_KERNEL_64_USERLAND_32, so this
> workaround is not effective there.
> The least we can do is make ebtables depend on
> !BR2_KERNEL_64_USERLAND_32.
> [1] https://lore.kernel.org/all/20210518181730.13436-1-patrickdepinguin@gmail.com/
> Fixes:
> http://autobuild.buildroot.net/results/680674c2b61209b505efa022a8fd9751ddc5fd47/
> http://autobuild.buildroot.net/results/60f8f5f087111ec3f300dc7979363de5a9f64f08/
> Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Committed to 2024.02.x and 2024.08.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-20 20:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-27 8:24 [Buildroot] [PATCH] package/ebtables: remove KERNEL_64_USERSPACE_32 workaround Baruch Siach via buildroot
2024-10-29 22:21 ` Thomas Petazzoni via buildroot
2024-11-20 20:52 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox