Skip to content

Commit 6f9f595

Browse files
authored
Avahi: Fix CVE-2023-1981, add %check section (#10881)
1 parent dc348a8 commit 6f9f595

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

SPECS/avahi/CVE-2023-1981.patch

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
From a2696da2f2c50ac43b6c4903f72290d5c3fa9f6f Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <[email protected]>
3+
Date: Thu, 17 Nov 2022 01:51:53 +0100
4+
Subject: [PATCH] Emit error if requested service is not found
5+
6+
It currently just crashes instead of replying with error. Check return
7+
value and emit error instead of passing NULL pointer to reply.
8+
9+
Fixes #375
10+
---
11+
avahi-daemon/dbus-protocol.c | 20 ++++++++++++++------
12+
1 file changed, 14 insertions(+), 6 deletions(-)
13+
14+
diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c
15+
index 70d7687b..406d0b44 100644
16+
--- a/avahi-daemon/dbus-protocol.c
17+
+++ b/avahi-daemon/dbus-protocol.c
18+
@@ -375,10 +375,14 @@ static DBusHandlerResult dbus_get_alternative_host_name(DBusConnection *c, DBusM
19+
}
20+
21+
t = avahi_alternative_host_name(n);
22+
- avahi_dbus_respond_string(c, m, t);
23+
- avahi_free(t);
24+
+ if (t) {
25+
+ avahi_dbus_respond_string(c, m, t);
26+
+ avahi_free(t);
27+
28+
- return DBUS_HANDLER_RESULT_HANDLED;
29+
+ return DBUS_HANDLER_RESULT_HANDLED;
30+
+ } else {
31+
+ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Hostname not found");
32+
+ }
33+
}
34+
35+
static DBusHandlerResult dbus_get_alternative_service_name(DBusConnection *c, DBusMessage *m, DBusError *error) {
36+
@@ -389,10 +393,14 @@ static DBusHandlerResult dbus_get_alternative_service_name(DBusConnection *c, DB
37+
}
38+
39+
t = avahi_alternative_service_name(n);
40+
- avahi_dbus_respond_string(c, m, t);
41+
- avahi_free(t);
42+
+ if (t) {
43+
+ avahi_dbus_respond_string(c, m, t);
44+
+ avahi_free(t);
45+
46+
- return DBUS_HANDLER_RESULT_HANDLED;
47+
+ return DBUS_HANDLER_RESULT_HANDLED;
48+
+ } else {
49+
+ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Service not found");
50+
+ }
51+
}
52+
53+
static DBusHandlerResult dbus_create_new_entry_group(DBusConnection *c, DBusMessage *m, DBusError *error) {

SPECS/avahi/avahi.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Summary: Local network service discovery
44
Name: avahi
55
Version: 0.8
6-
Release: 1%{?dist}
6+
Release: 2%{?dist}
77
License: LGPLv2+
88
Vendor: Microsoft Corporation
99
Distribution: Mariner
@@ -12,6 +12,7 @@ Source0: https://github.com/lathiat/avahi/releases/download/v%{version}/%
1212
Patch0: %{name}-libevent-pc-fix.patch
1313
Patch1: CVE-2021-3468.patch
1414
Patch2: CVE-2021-3502.patch
15+
Patch3: CVE-2023-1981.patch
1516
BuildRequires: automake
1617
BuildRequires: dbus-devel >= 0.90
1718
BuildRequires: dbus-glib-devel >= 0.70
@@ -405,6 +406,9 @@ exit 0
405406
%endif
406407

407408
%changelog
409+
* Tue Oct 29 2024 Daniel McIlvaney <[email protected]> - 0.8-2
410+
- Fix CVE-2023-1981 with an upstream patch
411+
408412
* Wed Apr 20 2022 Olivia Crain <[email protected]> - 0.8-1
409413
- Upgrade to latest upstream version to fix CVE-2017-6519
410414
- Add upstream patch to fix CVE-2021-3502

0 commit comments

Comments
 (0)