public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/libcap-ng] rawhide: New upstream bugfix release
Date: Tue, 01 Dec 2026 17:19:17 GMT [thread overview]
Message-ID: <179614555792.1.10129007113783147288.rpms-libcap-ng-2e8a8f9c394d@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/libcap-ng
Branch : rawhide
Commit : 2e8a8f9c394d6befbceaceb0d0dfc2e32bc9660c
Author : Steve Grubb <sgrubb@redhat.com>
Date : 2026-12-01T12:19:06-05:00
Stats : +72/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/libcap-ng/c/2e8a8f9c394d6befbceaceb0d0dfc2e32bc9660c?branch=rawhide
Log:
New upstream bugfix release
---
diff --git a/libcap-ng.spec b/libcap-ng.spec
index da71eef..29fe193 100644
--- a/libcap-ng.spec
+++ b/libcap-ng.spec
@@ -6,6 +6,8 @@ Release: 1%{?dist}
License: LGPL-2.0-or-later
URL: https://github.com/stevegrubb/libcap-ng
Source0: %{name}-%{version}.tar.gz
+# Fix 32 bit builds
+Patch1: vsock.patch
BuildRequires: gcc make
BuildRequires: autoconf automake libtool
BuildRequires: kernel-headers >= 2.6.11
@@ -60,6 +62,7 @@ to determine the necessary capabilities for a program.
%prep
%setup -q
touch -d @${SOURCE_DATE_EPOCH:?} NEWS
+%patch -P1 -p1
%build
# Locate suitable vmlinux.h. In normal builds under mock,
diff --git a/vsock.patch b/vsock.patch
new file mode 100644
index 0000000..4ecba44
--- /dev/null
+++ b/vsock.patch
@@ -0,0 +1,69 @@
+commit 3446542391d28e687ece9246a8fdae2b87227c8e
+Author: Steve Grubb <ausearch.1@gmail.com>
+Date: Tue Dec 1 12:12:39 2026 -0500
+
+ netcap: reject VSOCK numeric overflow on 32-bit systems
+
+ The VSOCK numeric parser checked strtoul's result against UINT_MAX but
+ ignored ERANGE. On i686, unsigned long is also 32 bits, so an overflowing
+ token saturates at UINT_MAX and passes the range check. This accepted
+ invalid CIDs and ports and caused netcap_advanced_test to fail.
+
+ Clear errno before conversion and reject ERANGE as well as values larger
+ than UINT_MAX. This preserves valid maximum values and prevents an earlier
+ conversion error from rejecting a subsequent valid token.
+
+ Extend the VSOCK parser tests to cover zero, decimal and hexadecimal
+ UINT_MAX, overflow beyond both 32-bit and 64-bit limits, and parsing a valid
+ maximum with ERANGE left over from a previous conversion. Reproduced the
+ original failure on i686 and passed make -j32 check on i686 and x86_64 with
+ --without-python (15 tests each).
+
+diff --git a/utils/netcap-advanced.c b/utils/netcap-advanced.c
+index 9cf3eab..6694d99 100644
+--- a/utils/netcap-advanced.c
++++ b/utils/netcap-advanced.c
+@@ -2045,14 +2045,17 @@ static int parse_u32_hex_or_dec(const char *s, unsigned int *out)
+ base = 16;
+ if (base == 10 && strlen(s) > 3 && s[0] == '0')
+ base = 16;
++ errno = 0;
+ v = strtoul(s, &end, base);
+ if (end == s || *end)
+ return -1;
+ /*
+ * The caller stores CIDs, ports, and similar procfs fields in u32s.
+ * Reject oversized text values so they cannot wrap into a false match.
++ * On 32-bit systems strtoul saturates at UINT_MAX on overflow, so
++ * the value alone cannot distinguish overflow from a valid maximum.
+ */
+- if (v > UINT_MAX)
++ if (errno == ERANGE || v > UINT_MAX)
+ return -1;
+ *out = (unsigned int)v;
+ return 0;
+diff --git a/utils/test/netcap_advanced_test.c b/utils/test/netcap_advanced_test.c
+index 8a51dff..e5a2fc2 100644
+--- a/utils/test/netcap_advanced_test.c
++++ b/utils/test/netcap_advanced_test.c
+@@ -690,9 +690,19 @@ static void test_vsock_table(void)
+ if (parse_u32_hex_or_dec("1024", &v) || v != 1024 ||
+ parse_u32_hex_or_dec("0x1F", &v) || v != 31 ||
+ parse_u32_hex_or_dec("0A", &v) || v != 10 ||
++ parse_u32_hex_or_dec("0", &v) || v != 0 ||
++ parse_u32_hex_or_dec("4294967295", &v) || v != UINT_MAX ||
++ parse_u32_hex_or_dec("0xFFFFFFFF", &v) || v != UINT_MAX ||
+ !parse_u32_hex_or_dec("", &v) || !parse_u32_hex_or_dec("12z", &v) ||
+- !parse_u32_hex_or_dec("0x100000000", &v))
++ !parse_u32_hex_or_dec("0x100000000", &v) ||
++ !parse_u32_hex_or_dec("4294967296", &v) ||
++ !parse_u32_hex_or_dec("18446744073709551616", &v) ||
++ !parse_u32_hex_or_dec("0x10000000000000000", &v))
+ fail("VSOCK numeric tokens were misparsed");
++ /* An earlier overflow must not cause a valid maximum value to fail. */
++ errno = ERANGE;
++ if (parse_u32_hex_or_dec("4294967295", &v) || v != UINT_MAX)
++ fail("VSOCK numeric parsing did not recover after overflow");
+
+ write_fixture(path, "Num Local Remote Type St Inode\n"
+ "0 3:1024 0:0 1 0A 6001\n"
next reply other threads:[~2026-12-01 17:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 17:19 Steve Grubb [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-12-01 16:57 [rpms/libcap-ng] rawhide: New upstream bugfix release Steve Grubb
2026-12-01 16:50 Steve Grubb
2026-09-09 13:06 Steve Grubb
2026-09-09 13:03 Steve Grubb
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=179614555792.1.10129007113783147288.rpms-libcap-ng-2e8a8f9c394d@fedoraproject.org \
--to=sgrubb@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