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/tog-pegasus] rawhide: Fix buffer overflow and add make require to -devel
Date: Mon, 23 Nov 2026 09:54:30 GMT	[thread overview]
Message-ID: <179542767010.1.2004965258385262286.rpms-tog-pegasus-b99da9f7ffcd@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/tog-pegasus
Branch : rawhide
Commit : b99da9f7ffcd5916abff82112fde1a0463d9e39c
Author : Vitezslav Crhonek <vcrhonek@redhat.com>
Date   : 2026-11-23T10:53:20+01:00
Stats  : +50/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/tog-pegasus/c/b99da9f7ffcd5916abff82112fde1a0463d9e39c?branch=rawhide

Log:
Fix buffer overflow and add make require to -devel

---
diff --git a/pegasus-2.14.1-fix-destination-hostname-overflow.patch b/pegasus-2.14.1-fix-destination-hostname-overflow.patch
new file mode 100644
index 0000000..0b6090e
--- /dev/null
+++ b/pegasus-2.14.1-fix-destination-hostname-overflow.patch
@@ -0,0 +1,39 @@
+--- pegasus/src/Pegasus/Common/HostAddress.cpp.orig	2012-07-03 13:53:22.000000000 +0200
++++ pegasus/src/Pegasus/Common/HostAddress.cpp	2026-11-20 09:18:36.379943593 +0100
+@@ -347,7 +347,11 @@ HostAddress::~HostAddress()
+ Boolean HostAddress::setHostAddress(const String &addrStr)
+ {
+ 
+-    if (addrStr.size() != 0)
++    // Reject an address that would not fit, together with its terminating
++    // NUL, in the PEGASUS_MAXHOSTNAMELEN sized buffers that callers copy
++    // getHost() into.  No valid host name reaches this length: RFC 1035
++    // limits a domain name to 253 characters in presentation form.
++    if (addrStr.size() != 0 && addrStr.size() < PEGASUS_MAXHOSTNAMELEN)
+     {
+ 
+         if (isValidIPV4Address(addrStr))
+--- pegasus/src/Pegasus/Handler/CIMxmlIndicationHandler/CIMxmlIndicationHandler.cpp.orig	2013-04-09 07:53:17.000000000 +0200
++++ pegasus/src/Pegasus/Handler/CIMxmlIndicationHandler/CIMxmlIndicationHandler.cpp	2026-11-20 09:18:41.486921540 +0100
+@@ -357,7 +357,8 @@ public:
+ 
+             HostLocator addr(destStr.subString(0, destStr.find("/")));
+             char hostName[PEGASUS_MAXHOSTNAMELEN];
+-            if (addr.isValid())
++            if (addr.isValid() &&
++                addr.getHost().size() < PEGASUS_MAXHOSTNAMELEN)
+             {
+                 strcpy(hostName, addr.getHost().getCString());
+                 if (addr.isPortSpecified())
+--- pegasus/src/Pegasus/Handler/wsmanIndicationHandler/wsmanIndicationHandler.cpp.orig	2013-06-13 15:19:56.000000000 +0200
++++ pegasus/src/Pegasus/Handler/wsmanIndicationHandler/wsmanIndicationHandler.cpp	2026-11-20 09:18:46.312899235 +0100
+@@ -399,7 +399,8 @@ private:
+         }   
+ 
+         HostLocator addr(destStr.subString(0, destStr.find("/")));
+-        if (addr.isValid())
++        if (addr.isValid() &&
++            addr.getHost().size() < PEGASUS_MAXHOSTNAMELEN)
+         {
+             strcpy(hostName, addr.getHost().getCString());
+             if (addr.isPortSpecified())

diff --git a/tog-pegasus.spec b/tog-pegasus.spec
index 154e2c7..7b4cce6 100644
--- a/tog-pegasus.spec
+++ b/tog-pegasus.spec
@@ -6,7 +6,7 @@
 
 Name:           tog-pegasus
 Version:        %{major_ver}.4
-Release:        3%{?dist}
+Release:        4%{?dist}
 Epoch:          2
 Summary:        OpenPegasus WBEM Services for Linux
 
@@ -115,6 +115,9 @@ Patch32:        pegasus-2.14.1-post-quantum.patch
 Patch33:        pegasus-2.14.1-openssl-4.0-fix.patch
 # fix buffer overflows in sample CMPI providers (CWE-120)
 Patch34:        pegasus-2.14.4-sample-provider-buffer-overflows.patch
+# 35: bound listener destination host name, it was copied into a fixed size
+#  stack buffer with strcpy and no length check
+Patch35:        pegasus-2.14.1-fix-destination-hostname-overflow.patch
 
 BuildRequires:  libstdc++, pam-devel
 BuildRequires:  openssl, openssl-devel
@@ -142,6 +145,7 @@ sources.
 %package devel
 Summary:        The OpenPegasus Software Development Kit
 Requires:       tog-pegasus >= %{epoch}:%{version}-%{release}
+Requires:       make
 
 %description devel
 The OpenPegasus WBEM Services for Linux SDK is the developer's kit for the
@@ -278,6 +282,7 @@ yes | pegasus/mak/CreateDmtfSchema 238 %{_builddir}/cim_schema_2.38.0-MOFs.zip c
 %patch -P32 -p0 -b .post-quantum
 %patch -P33 -p0 -b .openssl-4.0-fix
 %patch -P34 -p0 -b .sample-provider-buffer-overflows
+%patch -P35 -p0 -b .fix-destination-hostname-overflow
 
 
 %build
@@ -578,6 +583,11 @@ fi
 
 
 %changelog
+* Mon Nov 23 2026 Vitezslav Crhonek <vcrhonek@redhat.com> - 2:2.14.4-4
+- Fix stack buffer overflow on listener destination host name
+- Make tog-pegasus-devel require make, it ships the samples Makefile and
+  runs make in %%preun
+
 * Mon Oct 26 2026 Vitezslav Crhonek <vcrhonek@redhat.com> - 2:2.14.4-3
 - Don't ship debug files in tog-pegasus-libs
   Resolves: #2537159

                 reply	other threads:[~2026-11-23  9:54 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=179542767010.1.2004965258385262286.rpms-tog-pegasus-b99da9f7ffcd@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