mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-05-09 00:14:23 +02:00
fixes: https://gitlab.alpinelinux.org/alpine/aports/-/issues/16846 upstream: https://lists.busybox.net/pipermail/busybox/2025-January/091065.html
38 lines
1.4 KiB
Diff
38 lines
1.4 KiB
Diff
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
|
|
|