diff --git a/main/busybox/0001-tunctl-fix-segfault-on-ioctl-failure.patch b/main/busybox/0001-tunctl-fix-segfault-on-ioctl-failure.patch new file mode 100644 index 0000000000000000000000000000000000000000..d2b9e307eacdbc7a7a92e33c73d06e3d8e6ffc07 --- /dev/null +++ b/main/busybox/0001-tunctl-fix-segfault-on-ioctl-failure.patch @@ -0,0 +1,38 @@ +From bbef1106a9d8ce9c01240e3609c348084aae70ee Mon Sep 17 00:00:00 2001 +From: Dominique Martinet <dominique.martinet@atmark-techno.com> +Date: Thu, 16 Jan 2025 21:53:08 +0900 +Subject: [PATCH] tunctl: fix segfault on ioctl failure + +libbb now takes "" instead of NULL as format string for nomsg functions, +but this caller had not been updated making busybox segfault on tunctl +commands when ioctl fails. +This can be reproduced by running `tunctl -t tun0` in gdb and blocking +with the tun open after being created, and running `tunctl -d tun0` in +another shell: the later will fail with EBUSY after fixing: +> tunctl: Device or resource busy + +function old new delta +tunctl_main 393 409 +16 + +Fixes: 4bd70463c7e7 ("libbb: pass "" rather than NULL as format string in _nomsg functions") +Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com> +--- + networking/tunctl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/networking/tunctl.c b/networking/tunctl.c +index c17302eac..cdb7eb659 100644 +--- a/networking/tunctl.c ++++ b/networking/tunctl.c +@@ -54,7 +54,7 @@ + #define TUNSETGROUP _IOW('T', 206, int) + #endif + +-#define IOCTL(a, b, c) ioctl_or_perror_and_die(a, b, c, NULL) ++#define IOCTL(a, b, c) ioctl_or_perror_and_die(a, b, c, "") + + #if 1 + +-- +2.48.1 + diff --git a/main/busybox/APKBUILD b/main/busybox/APKBUILD index 652423e5ed0f1a0f125fadde1a048c7bf5050990..2656c6609ac65cdf9c456051fd57d8db5eba308b 100644 --- a/main/busybox/APKBUILD +++ b/main/busybox/APKBUILD @@ -5,7 +5,7 @@ # Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net> pkgname=busybox pkgver=1.37.0 -pkgrel=11 +pkgrel=12 pkgdesc="Size optimized toolbox of many common UNIX utilities" url="https://busybox.net/" arch="all" @@ -84,6 +84,7 @@ source="https://busybox.net/downloads/busybox-$pkgver.tar.bz2 0001-hexdump-fix-regression-with-n4-e-u.patch 0001-awk-fix-handling-of-literal-backslashes-in-replaceme.patch + 0001-tunctl-fix-segfault-on-ioctl-failure.patch acpid.logrotate busyboxconfig @@ -400,6 +401,7 @@ ac56a170a31f4329d00155a2a7d3950c4fe365e69e2e6b773a28fe3faa214a1330f0dd910bf07124 04ed80099092bf6cafa293d13039184307197d5b71e2052a7b5650eed4364845cca3910e701e01c67a23dff7c9552506b682d553d6bdd7dfcbc7724e98595c4d 0034-adduser-remove-preconfigured-GECOS-full-name-field.patch ac026f8b289d1431c46d51a8c512eb0184aa81de1c41971a87c99bcdc5c63c2d9abed412cad20d3032b480d87a52ee2602411149eb5f271fa9d051165a7b8188 0001-hexdump-fix-regression-with-n4-e-u.patch 7165661f3972f1800faf8d263126e3f238bb26bb7891230dbaad2d085e49e2ababc555294ecefed9d8ff00d93c8c3963e786db796cf3d03d68bf9e0492305d0c 0001-awk-fix-handling-of-literal-backslashes-in-replaceme.patch +9548603cbadf690ab31354642ab3f7bef1b9f696df6b661ea644548fb831b2f78a47a9b09b5489aa43da7061dcc6808864d130d053906f44090983f5cb3dc169 0001-tunctl-fix-segfault-on-ioctl-failure.patch aa93095e20de88730f526c6f463cef711b290b9582cdbd8c1ba2bd290019150cbeaa7007c2e15f0362d5b9315dd63f60511878f0ea05e893f4fdfb4a54af3fb1 acpid.logrotate ebe2261a67b94202b3e4b83951eede9e46ba395d0f3406f2088cfadbc018de6f2d5fde03e6fc7f920de877716a14207023e1b6996bde87e516020fde7325eeaf busyboxconfig 9b399cf4bb9dc438c238d7294aef8a7452d9a2b74ff4c09a1349e74e457523329b32042ce86e7dedb99906011022dfd631074a836c897082cbe88c9ae19fe1d4 busyboxconfig-extras