public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Vitezslav Crhonek <vcrhonek@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/openslp] rawhide: Fix reply size truncation in SrvRply, AttrRply and SrvTypeRply
Date: Mon, 09 Nov 2026 09:21:19 GMT [thread overview]
Message-ID: <179421607954.1.8858378745634727206.rpms-openslp-e2e0f684f7f6@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/openslp
Branch : rawhide
Commit : e2e0f684f7f6696d69baa198348b4a3f765c265f
Author : Vitezslav Crhonek <vcrhonek@redhat.com>
Date : 2026-11-09T10:21:00+01:00
Stats : +78/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/openslp/c/e2e0f684f7f6696d69baa198348b4a3f765c265f?branch=rawhide
Log:
Fix reply size truncation in SrvRply, AttrRply and SrvTypeRply
---
diff --git a/openslp-2.0.0-reply-size-truncation.patch b/openslp-2.0.0-reply-size-truncation.patch
new file mode 100644
index 0000000..4dfe966
--- /dev/null
+++ b/openslp-2.0.0-reply-size-truncation.patch
@@ -0,0 +1,72 @@
+diff -up openslp-2.0.0/slpd/slpd_process.c.reply-size-truncation openslp-2.0.0/slpd/slpd_process.c
+--- openslp-2.0.0/slpd/slpd_process.c.reply-size-truncation
++++ openslp-2.0.0/slpd/slpd_process.c
+@@ -65,6 +65,35 @@
+ # include "slp_auth.h"
+ #endif
+
++/** The largest message describable by the SLPv2 header length field. */
++#define SLP_MAX_WIRE_LENGTH 0xFFFFFF
++
++/** Verify that a reply can be described by the SLPv2 header length field.
++ *
++ * The length field in the SLPv2 header is only 24 bits wide (RFC 2608
++ * section 8). A larger reply cannot be represented on the wire: PutUINT24()
++ * would silently truncate the value, and the datagram send path - which
++ * re-reads that length from the header to find packet boundaries - would
++ * then misframe the buffer. Such replies are dropped instead.
++ *
++ * @param[in] size - The computed size of the reply, in bytes.
++ * @param[in] msgtype - The name of the reply, used for logging.
++ *
++ * @return Zero if the reply fits, or SLP_ERROR_INTERNAL_ERROR if it does not.
++ *
++ * @internal
++ */
++static int CheckReplySize(size_t size, const char * msgtype)
++{
++ if (size > SLP_MAX_WIRE_LENGTH)
++ {
++ SLPDLog("%s of %lu bytes exceeds the maximum SLPv2 message length, "
++ "dropping reply\n", msgtype, (unsigned long)size);
++ return SLP_ERROR_INTERNAL_ERROR;
++ }
++ return 0;
++}
++
+ /** Process an SA SrvRequest message.
+ *
+ * @param[in] message - The message to process.
+@@ -586,6 +615,10 @@ RESPOND:
+ }
+ }
+
++ errorcode = CheckReplySize(size, "SrvRply");
++ if (errorcode != 0)
++ goto FINISHED;
++
+ /* reallocate the result buffer */
+ result = SLPBufferRealloc(result, size);
+ if (result == 0)
+@@ -1104,6 +1137,10 @@ RESPOND:
+
+ }
+
++ errorcode = CheckReplySize(size, "AttrRply");
++ if (errorcode != 0)
++ goto FINISHED;
++
+ /* alloc the buffer */
+ result = SLPBufferRealloc(result, size);
+ if (result == 0)
+@@ -1305,6 +1342,10 @@ RESPOND:
+ if (errorcode == 0)
+ size += db->srvtypelistlen;
+
++ errorcode = CheckReplySize(size, "SrvTypeRply");
++ if (errorcode != 0)
++ goto FINISHED;
++
+ /* Reallocate the result buffer */
+ result = SLPBufferRealloc(result, size);
+ if (result == 0)
diff --git a/openslp.spec b/openslp.spec
index 93a11ac..8113b4b 100644
--- a/openslp.spec
+++ b/openslp.spec
@@ -44,6 +44,9 @@ Patch9: openslp-2.0.0-cwe-843-knownda-type-confusion.patch
# Patch10: fixes heap buffer overflow in ProcessDASrvRqst when copying
# initial DAAdvert into fixed 4096-byte buffer
Patch10: openslp-2.0.0-processDASrvRqst-buffer-overflow.patch
+# Patch11: fixes reply size truncation from size_t to the 24-bit header
+# length field in SrvRply, AttrRply and SrvTypeRply
+Patch11: openslp-2.0.0-reply-size-truncation.patch
BuildRequires: make
BuildRequires: automake libtool
@@ -88,6 +91,7 @@ OpenSLP server daemon to dynamically register services.
%patch -P8 -p1 -b .dhcp-integer-overflow
%patch -P9 -p1 -b .cwe-843-knownda-type-confusion
%patch -P10 -p1 -b .processDASrvRqst-buffer-overflow
+%patch -P11 -p1 -b .reply-size-truncation
# tarball goof (?), it wants to re-automake anyway, so let's do it right.
#libtoolize --force
@@ -188,6 +192,8 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.la
* Mon Nov 09 2026 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.0-45
- Fix heap buffer overflow in ProcessDASrvRqst when copying initial
DAAdvert into fixed 4096-byte buffer
+- Fix reply size truncation from size_t to the 24-bit header length field
+ in SrvRply, AttrRply and SrvTypeRply
* Wed Sep 30 2026 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.0-45
- Fix type confusion in KnownDABadDA call, so that failed directory agents
reply other threads:[~2026-11-09 9:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179421607954.1.8858378745634727206.rpms-openslp-e2e0f684f7f6@fedoraproject.org \
--to=vcrhonek@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox