Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions SPECS/avahi/CVE-2023-1981.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
From a2696da2f2c50ac43b6c4903f72290d5c3fa9f6f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
Date: Thu, 17 Nov 2022 01:51:53 +0100
Subject: [PATCH] Emit error if requested service is not found

It currently just crashes instead of replying with error. Check return
value and emit error instead of passing NULL pointer to reply.

Fixes #375
---
avahi-daemon/dbus-protocol.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c
index 70d7687b..406d0b44 100644
--- a/avahi-daemon/dbus-protocol.c
+++ b/avahi-daemon/dbus-protocol.c
@@ -375,10 +375,14 @@ static DBusHandlerResult dbus_get_alternative_host_name(DBusConnection *c, DBusM
}

t = avahi_alternative_host_name(n);
- avahi_dbus_respond_string(c, m, t);
- avahi_free(t);
+ if (t) {
+ avahi_dbus_respond_string(c, m, t);
+ avahi_free(t);

- return DBUS_HANDLER_RESULT_HANDLED;
+ return DBUS_HANDLER_RESULT_HANDLED;
+ } else {
+ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Hostname not found");
+ }
}

static DBusHandlerResult dbus_get_alternative_service_name(DBusConnection *c, DBusMessage *m, DBusError *error) {
@@ -389,10 +393,14 @@ static DBusHandlerResult dbus_get_alternative_service_name(DBusConnection *c, DB
}

t = avahi_alternative_service_name(n);
- avahi_dbus_respond_string(c, m, t);
- avahi_free(t);
+ if (t) {
+ avahi_dbus_respond_string(c, m, t);
+ avahi_free(t);

- return DBUS_HANDLER_RESULT_HANDLED;
+ return DBUS_HANDLER_RESULT_HANDLED;
+ } else {
+ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Service not found");
+ }
}

static DBusHandlerResult dbus_create_new_entry_group(DBusConnection *c, DBusMessage *m, DBusError *error) {
10 changes: 9 additions & 1 deletion SPECS/avahi/avahi.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Summary: Local network service discovery
Name: avahi
Version: 0.8
Release: 2%{?dist}
Release: 3%{?dist}
License: LGPLv2+
Vendor: Microsoft Corporation
Distribution: Azure Linux
Expand All @@ -12,6 +12,7 @@ Source0: https://github.com/lathiat/avahi/releases/download/v%{version}/%
Patch0: %{name}-libevent-pc-fix.patch
Patch1: CVE-2021-3468.patch
Patch2: CVE-2021-3502.patch
Patch3: CVE-2023-1981.patch
BuildRequires: automake
BuildRequires: dbus-devel >= 0.90
BuildRequires: dbus-glib-devel >= 0.70
Expand Down Expand Up @@ -214,6 +215,9 @@ NOCONFIGURE=1 ./autogen.sh
--disable-gtk \
--disable-gtk3 \
--disable-mono \
%if 0%{?with_check}
--enable-tests \
%endif
;

# workaround parallel build issues (aarch64 only so far, bug #1564553)
Expand Down Expand Up @@ -258,6 +262,7 @@ rm -fv %{buildroot}%{_datadir}/avahi/interfaces/avahi-discover.ui


%check
%make_build -k V=1 check || make check V=1

%pre
getent group avahi >/dev/null || groupadd -f -g 70 -r avahi
Expand Down Expand Up @@ -415,6 +420,9 @@ exit 0
%endif

%changelog
* Tue Oct 29 2024 Daniel McIlvaney <damcilva@microsoft.com> - 0.8-3
- Fix CVE-2023-1981 with an upstream patch, enable basic check section

* Wed Aug 14 2024 Chris Co <chrco@microsoft.com> - 0.8-2
- Remove libssp from build environment to fix avahi-daemon hang

Expand Down