diff --git a/huawei-fix-network-tcp-test.patch b/huawei-fix-network-tcp-test.patch new file mode 100644 index 0000000000000000000000000000000000000000..48843d57ff8f38ef02cb862c1f2675fee880d0b3 --- /dev/null +++ b/huawei-fix-network-tcp-test.patch @@ -0,0 +1,42 @@ +--- a/tapset/linux/ipmib.stp ++++ b/tapset/linux/ipmib.stp +@@ -271,7 +271,7 @@ + * IPSTATS_MIB_INUNKNOWNPROTOS) + */ + /* icmp_send() is called by ip_local_deliver_finish() */ +-probe ipmib.InUnknownProtos=kernel.function("icmp_send") ++probe ipmib.InUnknownProtos=kernel.function("__icmp_send") + { + skb = $skb_in; + op = 1; +@@ -360,7 +360,7 @@ + * counted in the global @ReasmTimeout (equivalent to SNMP's MIB + * IPSTATS_MIB_REASMTIMEOUT) + */ +-probe ipmib.ReasmTimeout=kernel.function("icmp_send") ++probe ipmib.ReasmTimeout=kernel.function("__icmp_send") + { + skb = $skb_in; + op = 0; +--- a/tapset/linux/linuxmib.stp ++++ b/tapset/linux/linuxmib.stp +@@ -30,7 +30,7 @@ + + probe _linuxmib.DelayedACKs.A = kernel.function("tcp_send_ack") + { +- sk=$sk ++ sk=pointer_arg(1) + if ( !indelack_timer[sk] ) next + op=1 + key = linuxmib_filter_key(sk,op); +--- a/testsuite/systemtap.examples/network/tcp_trace.stp ++++ b/testsuite/systemtap.examples/network/tcp_trace.stp +@@ -192,7 +192,7 @@ + } + } + +-probe kernel.function("tcp_transmit_skb") ++probe kernel.function("__tcp_transmit_skb") + { + sk = $sk + key = filter_key(sk) diff --git a/huawei-fix-py3example-script-run-fail-2.patch b/huawei-fix-py3example-script-run-fail-2.patch new file mode 100644 index 0000000000000000000000000000000000000000..d212f5e9d1f31c4093e156bfe5c62538f32fa385 --- /dev/null +++ b/huawei-fix-py3example-script-run-fail-2.patch @@ -0,0 +1,29 @@ +--- a/testsuite/systemtap.examples/general/tapset/python3_local.stp ++++ b/testsuite/systemtap.examples/general/tapset/python3_local.stp +@@ -182,7 +182,7 @@ + n = @cast (dict, "PyDictObject", @PYTHON3_LIBRARY)->ma_used; + if (i > n || entries == 0) + return 0 +- return @cast (entries, "PyDictKeysObject", @PYTHON3_LIBRARY)->dk_entries[i]->me_hash ++ return @cast (@DK_ENTRIES(entries), "PyDictKeyEntry", @PYTHON3_LIBRARY)[i]->me_hash + } + + # FUNCTION P3_GET_DICT_KEY +@@ -195,7 +195,7 @@ + n = @cast (dict, "PyDictObject", @PYTHON3_LIBRARY)->ma_used; + if (i > n || entries == 0) + return 0 +- return @cast (entries, "PyDictKeysObject", @PYTHON3_LIBRARY)->dk_entries[i]->me_key ++ return @cast (@DK_ENTRIES(entries), "PyDictKeyEntry", @PYTHON3_LIBRARY)[i]->me_key + } + + # FUNCTION P3_GET_DICT_VALUE +@@ -214,7 +214,7 @@ + n = @cast (dict, "PyDictObject", @PYTHON3_LIBRARY)->ma_used; + if (i > n || entries == 0) + return 0 +- return @cast (entries, "PyDictKeysObject", @PYTHON3_LIBRARY)->dk_entries[i]->me_value ++ return @cast (@DK_ENTRIES(entries), "PyDictKeyEntry", @PYTHON3_LIBRARY)[i]->me_value + } + } + diff --git a/huawei-fix-py3example-script-run-fail.patch b/huawei-fix-py3example-script-run-fail.patch new file mode 100644 index 0000000000000000000000000000000000000000..bf0207101a70497e81417c43148b216669d69e0c --- /dev/null +++ b/huawei-fix-py3example-script-run-fail.patch @@ -0,0 +1,44 @@ +diff --git a/testsuite/systemtap.examples/general/tapset/python_local.stpm b/testsuite/systemtap.examples/general/tapset/python_local.stpm +--- a/testsuite/systemtap.examples/general/tapset/python_local.stpm ++++ b/testsuite/systemtap.examples/general/tapset/python_local.stpm +@@ -8,4 +8,39 @@ + @define PYTHON3_LIBRARY + %( +- "/usr/lib64/libpython3.4m.so.1.0" ++ "/usr/lib64/libpython3.7m.so.1.0" + %) ++ ++@define Py3DictKeysObject(object) %( ++ @cast(@object, "PyDictKeysObject", @PYTHON3_LIBRARY) ++ %) ++@define Py3DictKeyEntry(object) %( ++ @cast(@object, "PyDictKeyEntry", @PYTHON3_LIBRARY) ++ %) ++ ++@define DK_SIZE(dk) %( ++ @Py3DictKeysObject(@dk)->dk_size ++%) ++@define DK_IXSIZE(dk) %( ++ %( CONFIG_64BIT == "y" %? ++ %( CONFIG_COMPAT == "y" %? ++ (@__compat_task ++ ? (@DK_SIZE(@dk) <= 0xff ? 1 : (@DK_SIZE(@dk) <= 0xffff ? 2 ++: 4)) ++ : (@DK_SIZE(@dk) <= 0xff ? ++ 1 : (@DK_SIZE(@dk) <= 0xffff ? ++ 2 : (@DK_SIZE(@dk) <= 0xffffffff ? 4 : 8)))) ++ %: ++ (@DK_SIZE(@dk) <= 0xff ? ++ 1 : (@DK_SIZE(@dk) <= 0xffff ? ++ 2 : (@DK_SIZE(@dk) <= 0xffffffff ? 4 : 8))) ++ %) ++ %: ++ (@DK_SIZE(@dk) <= 0xff ? 1 : (@DK_SIZE(@dk) <= 0xffff ? 2 : 4)) ++ %) ++%) ++ ++@define DK_ENTRIES(dk) %( ++ (@choose_defined(@Py3DictKeysObject(@dk)->dk_entries, ++(&@Py3DictKeyEntry(&@Py3DictKeysObject(@dk)->dk_indices[@DK_SIZE(@dk) * ++@DK_IXSIZE(@dk)])))) ++%) diff --git a/huawei-local-is-only-valid-in-functions-for-shellcheck-sc2168.patch b/huawei-local-is-only-valid-in-functions-for-shellcheck-sc2168.patch new file mode 100644 index 0000000000000000000000000000000000000000..7ebeae53c74bf6f0445039e8d083cf16f8bab505 --- /dev/null +++ b/huawei-local-is-only-valid-in-functions-for-shellcheck-sc2168.patch @@ -0,0 +1,26 @@ +From b4711fdd81c6725a3d67140cea2a93715af47ef2 Mon Sep 17 00:00:00 2001 +From: root +Date: Fri, 5 Jun 2020 21:24:01 +0800 +Subject: [PATCH] make 'local' only used in functions to avoid shellcheck error + +Signed-off-by: tianwei +--- + doc/Tapset_Reference_Guide/publicanize.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/doc/Tapset_Reference_Guide/publicanize.sh b/doc/Tapset_Reference_Guide/publicanize.sh +index 330409e..97254fe 100755 +--- a/doc/Tapset_Reference_Guide/publicanize.sh ++++ b/doc/Tapset_Reference_Guide/publicanize.sh +@@ -22,7 +22,7 @@ do + val=`printf %s $1 | awk -F= '{print $2}'` + shift + if test -z "$val"; then +- local possibleval=$1 ++ possibleval=$1 + printf %s $1 "$possibleval" | grep ^- >/dev/null 2>&1 + if test "$?" != "0"; then + val=$possibleval +-- +2.23.0 + diff --git a/systemtap.spec b/systemtap.spec index 90a9b744f6cb119822068939a4ff2e17417238ec..03b972aac4e7d148a608c4d6d2743666779d9e6c 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -31,6 +31,11 @@ Source: https://sourceware.org/systemtap/ftp/releases/%{name}-%{version}.tar.gz Patch1: 0001-Add-init-type-cast-to-resolve-gcc-issue.patch Patch2: 0001-PR29094-Include-rpm-rpmcrypto.h-when-required.patch +Patch9000: huawei-fix-py3example-script-run-fail.patch +Patch9001: huawei-fix-py3example-script-run-fail-2.patch +Patch9002: huawei-fix-network-tcp-test.patch +Patch9003: huawei-local-is-only-valid-in-functions-for-shellcheck-sc2168.patch + BuildRequires: gcc-c++ emacs systemd python3-setuptools BuildRequires: gettext-devel rpm-devel readline-devel BuildRequires: pkgconfig(nss) pkgconfig(avahi-client) @@ -457,6 +462,12 @@ exit 0 %{_mandir}/man[1378]/* %changelog +* Mon Jul 3 2023 langfei - 4.5-6 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:Fix some test cases fail to be executed, Resolve the sc2168 warning detected by the shellcheck tool. + * Mon Feb 6 2023 langfei - 4.5-5 - Type:bugfix - CVE:NA