lnstat: fix buffer overflow in lnstat command
Conflicts: iproute.spec (cherry picked from commit 631f07785e14a71847f92ef911f8f1dd1abb7fd8)
This commit is contained in:
parent
eaec4ff08e
commit
d821b4bf3a
32
huawei-lnstat-fix-buffer-overflow-in-lnstat-command.patch
Normal file
32
huawei-lnstat-fix-buffer-overflow-in-lnstat-command.patch
Normal file
@ -0,0 +1,32 @@
|
||||
From d95b3d070009dc557d60ead60ab6d820fe8e7e7f Mon Sep 17 00:00:00 2001
|
||||
From: rpm-build <rpm-build>
|
||||
Date: Tue, 16 Nov 2021 14:32:46 +0800
|
||||
Subject: [PATCH] lnstat: fix buffer overflow in lnstat command
|
||||
|
||||
segfults when called the following command:
|
||||
[root@localhost ~]lnstat -w 1
|
||||
Segmentation fault (core dumped)
|
||||
|
||||
The maximum value of th.num_lines is HDR_LINES(10),
|
||||
h should not be equal to th.num_lines, array th.hdr may
|
||||
be out of bounds.
|
||||
---
|
||||
misc/lnstat.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/misc/lnstat.c b/misc/lnstat.c
|
||||
index e3c8421..7bfb8e6 100644
|
||||
--- a/misc/lnstat.c
|
||||
+++ b/misc/lnstat.c
|
||||
@@ -210,7 +210,7 @@ static struct table_hdr *build_hdr_string(struct lnstat_file *lnstat_files,
|
||||
ofs += width+1;
|
||||
}
|
||||
/* fill in spaces */
|
||||
- for (h = 1; h <= th.num_lines; h++) {
|
||||
+ for (h = 1; h < th.num_lines; h++) {
|
||||
for (i = 0; i < ofs; i++) {
|
||||
if (th.hdr[h][i] == '\0')
|
||||
th.hdr[h][i] = ' ';
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
13
iproute.spec
13
iproute.spec
@ -1,6 +1,6 @@
|
||||
Name: iproute
|
||||
Version: 5.5.0
|
||||
Release: 8
|
||||
Release: 9
|
||||
Summary: Linux network configuration utilities
|
||||
License: GPLv2+ and Public Domain
|
||||
URL: https://kernel.org/pub/linux/utils/net/iproute2/
|
||||
@ -16,13 +16,14 @@ Patch7: backport-ip-drop-2-char-command-assumption.patch
|
||||
Patch8: backport-ip-netns-fix-missing-netns-close-on-some-error-paths.patch
|
||||
Patch9: backport-lib-bpf_legacy-fix-missing-socket-close-when-connect.patch
|
||||
Patch10: backport-tc-e_bpf-fix-memory-leak-in-parse_bpf.patch
|
||||
Patch11: backport-bugfix-iproute2-lib-bpf-fix-bpffs-mount-when-sys-fs-bpf-exist.patch
|
||||
Patch12: backport-bugfix-iproute2-tc-f_flower-fix-port-range-parsing.patch
|
||||
|
||||
Patch9002: feature-iproute-limit-operation-ip-netns-del.patch
|
||||
Patch9003: feature-iproute-add-support-for-ipvlan-l2e-mode.patch
|
||||
Patch9004: feature-peer_notify_delay-renamed-to-peer_notif_delay.patch
|
||||
Patch9005: bugfix-iproute-support-assume-default-route.patch
|
||||
Patch11: backport-bugfix-iproute2-lib-bpf-fix-bpffs-mount-when-sys-fs-bpf-exist.patch
|
||||
Patch12: backport-bugfix-iproute2-tc-f_flower-fix-port-range-parsing.patch
|
||||
Patch9006: huawei-lnstat-fix-buffer-overflow-in-lnstat-command.patch
|
||||
|
||||
BuildRequires: gcc bison elfutils-libelf-devel flex iptables-devel libcap-devel
|
||||
BuildRequires: libmnl-devel libselinux-devel pkgconfig git
|
||||
@ -91,6 +92,12 @@ install -m 0644 lib/libnetlink.a %{buildroot}%{_libdir}/libnetlink.a
|
||||
%{_mandir}/*
|
||||
|
||||
%changelog
|
||||
* Tue Nov 16 2021 jiangheng <jiangheng12@huawei.com> - 5.5.0-9
|
||||
- Type:bugfix
|
||||
- Id:NA
|
||||
- SUG:NA
|
||||
- DESC:fix buffer overflow in lnstat command
|
||||
|
||||
* Tue Nov 02 2021 jiangheng <jiangheng12@huawei.com> - 5.5.0-8
|
||||
- Type:bugfix
|
||||
- Id:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user