diff --git a/SOURCES/0167-print_ifindex-fix-IFNAME_QUOTED_SZ-definition.patch b/SOURCES/0167-print_ifindex-fix-IFNAME_QUOTED_SZ-definition.patch new file mode 100644 index 0000000..9f19614 --- /dev/null +++ b/SOURCES/0167-print_ifindex-fix-IFNAME_QUOTED_SZ-definition.patch @@ -0,0 +1,55 @@ +From e27b06773eaf5c0307bcc5637d7457be9be1e6ea Mon Sep 17 00:00:00 2001 +From: Eugene Syromyatnikov +Date: Wed, 1 Dec 2021 17:11:02 +0100 +Subject: [PATCH] print_ifindex: fix IFNAME_QUOTED_SZ definition + +sizeof(IFNAMSIZ) instead of IFNAMSIZ was mistakenly used +for IFNAME_QUOTED_SZ initial definition in commit v4.23~87 +"print_ifindex: respect xlat style settings". + +* src/print_ifindex.c (IFNAME_QUOTED_SZ): Use IFNAMSIZ +instead of sizeof(IFNAMSIZ). +* NEWS: Mention it. + +Reported-by: Paulo Andrade +Suggested-by: Paulo Andrade +Fixes: v4.23~87 "print_ifindex: respect xlat style settings" +References: https://bugzilla.redhat.com/show_bug.cgi?id=2028146 +--- + NEWS | 4 ++++ + src/print_ifindex.c | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/NEWS b/NEWS +index 9bab673..a3036b8 100644 +--- a/NEWS ++++ b/NEWS +@@ -16,6 +16,12 @@ Noteworthy changes in release ?.?? (????-??-??) + PTRACE_*, RTM_*, RTPROT_*, TRAP_*, UFFD_*, UFFDIO_*, and V4L2_* constants. + * Updated lists of ioctl commands from Linux 5.13. + ++ * Bug fixes ++ * Fixed insufficient buffer size used for network interface name printing, ++ that previously led to assertions on attempts of printing interface names ++ that require quoting, for example, names longer than 4 characters in -xx ++ mode (addresses RHBZ bug #2028146). ++ + * Portability + * On powerpc and powerpc64, linux kernel >= 2.6.23 is required. + Older versions without a decent PTRACE_GETREGS support will not work. +diff --git a/src/print_ifindex.c b/src/print_ifindex.c +index ec48093..dc9d592 100644 +--- a/src/print_ifindex.c ++++ b/src/print_ifindex.c +@@ -13,7 +13,7 @@ + + # define INI_PFX "if_nametoindex(\"" + # define INI_SFX "\")" +-# define IFNAME_QUOTED_SZ (sizeof(IFNAMSIZ) * 4 + 3) ++# define IFNAME_QUOTED_SZ (IFNAMSIZ * 4 + 3) + + const char * + get_ifname(const unsigned int ifindex) +-- +2.1.4 + diff --git a/SPECS/strace.spec b/SPECS/strace.spec index 9a5a2b4..21d9ffe 100644 --- a/SPECS/strace.spec +++ b/SPECS/strace.spec @@ -1,7 +1,7 @@ Summary: Tracks and displays system calls associated with a running process Name: strace Version: 5.13 -Release: 1%{?dist} +Release: 2%{?dist} # The test suite is GPLv2+, all the rest is LGPLv2.1+. License: LGPL-2.1+ and GPL-2.0+ Group: Development/Debuggers @@ -245,6 +245,9 @@ Patch165: 0165-trie-use-BIT-and-MASK-macros.patch # v5.13-65-g41b753e "tee: rewrite num_params access in tee_fetch_buf_data" Patch166: 0166-tee-rewrite-num_params-access-in-tee_fetch_buf_data.patch +# v5.15~1 "print_ifindex: fix IFNAME_QUOTED_SZ definition" +Patch167: 0167-print_ifindex-fix-IFNAME_QUOTED_SZ-definition.patch + ### Wire up rseq and kexec_file_load in order to avoid kexec_file_load ### test failure on aarch64. Addresses https://bugzilla.redhat.com/1676045 ### ("strace: FTBFS in Fedora rawhide/f30"). @@ -393,6 +396,7 @@ received by a process. %patch164 -p1 %patch165 -p1 %patch166 -p1 +%patch167 -p1 #%patch1000 -p1 #%patch1001 -p1 @@ -479,6 +483,9 @@ echo 'END OF TEST SUITE INFORMATION' %{_mandir}/man1/* %changelog +* Wed Jan 05 2022 Eugene Syromiatnikov - 5.13-2 +- Fix incorrect ifname printing buffer size (#2028158). + * Wed Oct 20 2021 Eugene Syromiatnikov - 5.13-1 - Rebase to v5.13; drop upstream patches on top of 5.7 (#2015917). - Address some issues reported by covscan.