From 272b8f8afc1613665d2fc73af69ee4c29841629c Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Fri, 6 May 2022 22:26:35 +0200 Subject: [PATCH] alfred: Merge bugfixes from 2022.1 * Ensure processed change_iface packet is 0-terminated Signed-off-by: Sven Eckelmann --- ...ocessed-change_iface-packet-is-0-ter.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 alfred/patches/0001-alfred-Ensure-processed-change_iface-packet-is-0-ter.patch diff --git a/alfred/patches/0001-alfred-Ensure-processed-change_iface-packet-is-0-ter.patch b/alfred/patches/0001-alfred-Ensure-processed-change_iface-packet-is-0-ter.patch new file mode 100644 index 0000000..ed1ab76 --- /dev/null +++ b/alfred/patches/0001-alfred-Ensure-processed-change_iface-packet-is-0-ter.patch @@ -0,0 +1,22 @@ +From: Sven Eckelmann +Date: Sat, 19 Feb 2022 08:51:28 +0100 +Subject: alfred: Ensure processed change_iface packet is 0-terminated + +A client sending a alfred_change_interface_v0 packet to the alfred server +might have forgotten to 0-terminate the string. In this case, strstr in +unix_sock_change_iface might read outside of the available buffer. + +Signed-off-by: Sven Eckelmann +Origin: upstream, https://git.open-mesh.org/alfred.git/commit/d2d27e4b9d697928d21dfa5c79908618ef8b56ac + +--- a/unix_sock.c ++++ b/unix_sock.c +@@ -329,6 +329,8 @@ unix_sock_change_iface(struct globals *g + if (len < (int)(sizeof(*change_iface) - sizeof(change_iface->header))) + goto err; + ++ change_iface->ifaces[sizeof(change_iface->ifaces) - 1] = '\0'; ++ + if (globals->opmode == OPMODE_SECONDARY) { + if (strstr(change_iface->ifaces, ",") != NULL) { + ret = -EINVAL; -- 2.30.2