Compare commits

...

No commits in common. "c8s" and "c9s" have entirely different histories.
c8s ... c9s

6 changed files with 112 additions and 15 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
SOURCES/libnfnetlink-1.0.1.tar.bz2
libnfnetlink-1.0.0.tar.bz2
/libnfnetlink-1.0.1.tar.bz2

View File

@ -0,0 +1,33 @@
From d910da3d3ada3df4059a622a3dd4dbfe71313bcb Mon Sep 17 00:00:00 2001
From: Phil Sutter <phil@nwl.cc>
Date: Fri, 25 Mar 2022 18:33:55 +0100
Subject: [PATCH] include: Silence gcc warning in linux_list.h
Compiler complained about empty prefetch() macro:
| ../include/linux_list.h:385:66: warning: right-hand operand of comma expression has no effect [-Wunused-value]
| 385 | for (pos = list_entry((head)->next, typeof(*pos), member), \
| | ^
Use nftables' variant instead which gcc seems to like more.
Fixes: 36d2ed3de20a3 ("major cleanup of index2name infrastructure: use linux list (and fix leak in the nlif_close path)")
Signed-off-by: Phil Sutter <phil@nwl.cc>
(cherry picked from commit 90ba6791824ef761f9f397c05b20a2f102dbe74a)
---
include/linux_list.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux_list.h b/include/linux_list.h
index de182a4764706..cf71837f18347 100644
--- a/include/linux_list.h
+++ b/include/linux_list.h
@@ -29,7 +29,7 @@
1; \
})
-#define prefetch(x) 1
+#define prefetch(x) ((void)0)
/* empty define to make this work in userspace -HW */
#ifndef smp_wmb

View File

@ -0,0 +1,40 @@
From cebc5fb8352a25acd973dddfc18c48ca2858ac77 Mon Sep 17 00:00:00 2001
From: Phil Sutter <phil@nwl.cc>
Date: Fri, 25 Mar 2022 18:33:55 +0100
Subject: [PATCH] libnfnetlink: Check getsockname() return code
The function may return -1 (and set errno). Assume it will leave
addr_len value unchanged, so checking is necessary to not hide the
error.
Fixes: 4248314d40187 ("nfnl: fix compilation warning with gcc-4.7")
Signed-off-by: Phil Sutter <phil@nwl.cc>
(cherry picked from commit 3cffa84fa74f40c57e9ef39ea5747d792d697367)
---
src/libnfnetlink.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/libnfnetlink.c b/src/libnfnetlink.c
index 4b2bcd015b0a6..14a311f2c448b 100644
--- a/src/libnfnetlink.c
+++ b/src/libnfnetlink.c
@@ -188,7 +188,8 @@ struct nfnl_handle *nfnl_open(void)
nfnlh->peer.nl_family = AF_NETLINK;
addr_len = sizeof(nfnlh->local);
- getsockname(nfnlh->fd, (struct sockaddr *)&nfnlh->local, &addr_len);
+ if (getsockname(nfnlh->fd, (struct sockaddr *)&nfnlh->local, &addr_len))
+ goto err_close;
if (addr_len != sizeof(nfnlh->local)) {
errno = EINVAL;
goto err_close;
@@ -209,7 +210,8 @@ struct nfnl_handle *nfnl_open(void)
/* use getsockname to get the netlink pid that the kernel assigned us */
addr_len = sizeof(nfnlh->local);
- getsockname(nfnlh->fd, (struct sockaddr *)&nfnlh->local, &addr_len);
+ if (getsockname(nfnlh->fd, (struct sockaddr *)&nfnlh->local, &addr_len))
+ goto err_close;
if (addr_len != sizeof(nfnlh->local)) {
errno = EINVAL;
goto err_close;

View File

@ -1,6 +1,6 @@
--- !Policy
product_versions:
- rhel-8
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1-gating.functional}

View File

@ -1,14 +1,16 @@
Name: libnfnetlink
Version: 1.0.1
Release: 13%{?dist}
Release: 22%{?dist}
Summary: Netfilter netlink userspace library
Group: System Environment/Libraries
License: GPLv2+
URL: http://netfilter.org
Source0: http://netfilter.org/projects/libnfnetlink/files/%{name}-%{version}.tar.bz2
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: kernel-headers
BuildRequires: automake autoconf libtool pkgconfig
BuildRequires: make
Patch1: 0001-include-Silence-gcc-warning-in-linux_list.h.patch
Patch2: 0002-libnfnetlink-Check-getsockname-return-code.patch
%description
libnfnetlink is a userspace library that provides some low-level
@ -18,7 +20,6 @@ and libnfnetlink_queue.
%package devel
Summary: Netfilter netlink userspace library
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: kernel-headers
@ -29,7 +30,7 @@ subsystem specific libraries such as libnfnetlink_conntrack, libnfnetlink_log
and libnfnetlink_queue.
%prep
%setup -q
%autosetup -p1
%build
%configure --disable-static
@ -40,14 +41,9 @@ rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%ldconfig_scriptlets
%files
%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license COPYING
%doc README
@ -55,13 +51,41 @@ rm -rf $RPM_BUILD_ROOT
%files devel
%defattr(-,root,root,-)
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%dir %{_includedir}/libnfnetlink
%{_includedir}/libnfnetlink/*.h
%changelog
* Wed May 08 2024 Phil Sutter <psutter@redhat.com> - 1.0.1-22
- libnfnetlink: Check getsockname() return code
- include: Silence gcc warning in linux_list.h
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.0.1-21
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.0.1-20
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.1-13
- Escape macros in %%changelog

View File

@ -1 +1 @@
SHA512 (libnfnetlink-1.0.1.tar.bz2) = 2ec2cd389c04e21c8a02fb3f6d6f326fc33ca9589577f1739c23d883fe2ee9feaa16e83b6ed09063ad886432e49565dc3256277d035260aca5aab17954b46104
98927583d2016a9fb1936fed992e2c5e libnfnetlink-1.0.1.tar.bz2