summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-06-27 10:10:26 +0100
committerSteve Sakoman <steve@sakoman.com>2023-07-07 04:30:25 -1000
commite1e65f69c8ea2597f89eb498f25693069d90b646 (patch)
treef053772d87d96ef953de0b5d96ee196937ef7794
parent242dff550ed405ebc7d63909d76a38f21aee4ebb (diff)
downloadpoky-e1e65f69c8ea2597f89eb498f25693069d90b646.tar.gz
strace: Update patches/tests with upstream fixes
Replace the sockopt disable patch with a fix from upstream (From OE-Core rev: c1beb73526e3ade75bd6dae5f9310107c50f1226) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ac921989991c319ecad01bec37c4ccaa15a7b58f) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-devtools/strace/strace/3bbfb541b258baec9eba674b5d8dc30007a61542.patch50
-rw-r--r--meta/recipes-devtools/strace/strace/f31c2f4494779e5c5f170ad10539bfc2dfafe967.patch50
-rw-r--r--meta/recipes-devtools/strace/strace/skip-sockopt-test.patch37
-rw-r--r--meta/recipes-devtools/strace/strace_6.2.bb3
4 files changed, 102 insertions, 38 deletions
diff --git a/meta/recipes-devtools/strace/strace/3bbfb541b258baec9eba674b5d8dc30007a61542.patch b/meta/recipes-devtools/strace/strace/3bbfb541b258baec9eba674b5d8dc30007a61542.patch
new file mode 100644
index 0000000000..b4c6ff99de
--- /dev/null
+++ b/meta/recipes-devtools/strace/strace/3bbfb541b258baec9eba674b5d8dc30007a61542.patch
@@ -0,0 +1,50 @@
1From 3bbfb541b258baec9eba674b5d8dc30007a61542 Mon Sep 17 00:00:00 2001
2From: "Dmitry V. Levin" <ldv@strace.io>
3Date: Wed, 21 Jun 2023 08:00:00 +0000
4Subject: [PATCH] net: enhance getsockopt decoding
5
6When getsockopt syscall fails the kernel sometimes updates the optlen
7argument, for example, NETLINK_LIST_MEMBERSHIPS updates it even if
8optval is not writable.
9
10* src/net.c (SYS_FUNC(getsockopt)): Try to fetch and print optlen
11argument on exiting syscall regardless of getsockopt exit status.
12
13Upstream-Status: Backport
14---
15 src/net.c | 15 ++++++++++++++-
16 1 file changed, 14 insertions(+), 1 deletion(-)
17
18diff --git a/src/net.c b/src/net.c
19index f68ccb947..7244b5e57 100644
20--- a/src/net.c
21+++ b/src/net.c
22@@ -1038,7 +1038,7 @@ SYS_FUNC(getsockopt)
23 } else {
24 ulen = get_tcb_priv_ulong(tcp);
25
26- if (syserror(tcp) || umove(tcp, tcp->u_arg[4], &rlen) < 0) {
27+ if (umove(tcp, tcp->u_arg[4], &rlen) < 0) {
28 /* optval */
29 printaddr(tcp->u_arg[3]);
30 tprint_arg_next();
31@@ -1047,6 +1047,19 @@ SYS_FUNC(getsockopt)
32 tprint_indirect_begin();
33 PRINT_VAL_D(ulen);
34 tprint_indirect_end();
35+ } else if (syserror(tcp)) {
36+ /* optval */
37+ printaddr(tcp->u_arg[3]);
38+ tprint_arg_next();
39+
40+ /* optlen */
41+ tprint_indirect_begin();
42+ if (ulen != rlen) {
43+ PRINT_VAL_D(ulen);
44+ tprint_value_changed();
45+ }
46+ PRINT_VAL_D(rlen);
47+ tprint_indirect_end();
48 } else {
49 /* optval */
50 print_getsockopt(tcp, tcp->u_arg[1], tcp->u_arg[2],
diff --git a/meta/recipes-devtools/strace/strace/f31c2f4494779e5c5f170ad10539bfc2dfafe967.patch b/meta/recipes-devtools/strace/strace/f31c2f4494779e5c5f170ad10539bfc2dfafe967.patch
new file mode 100644
index 0000000000..a0843836c2
--- /dev/null
+++ b/meta/recipes-devtools/strace/strace/f31c2f4494779e5c5f170ad10539bfc2dfafe967.patch
@@ -0,0 +1,50 @@
1From f31c2f4494779e5c5f170ad10539bfc2dfafe967 Mon Sep 17 00:00:00 2001
2From: "Dmitry V. Levin" <ldv@strace.io>
3Date: Sat, 24 Jun 2023 08:00:00 +0000
4Subject: [PATCH] tests: update sockopt-sol_netlink test
5
6Update sockopt-sol_netlink test that started to fail, likely
7due to recent linux kernel commit f4e4534850a9 ("net/netlink: fix
8NETLINK_LIST_MEMBERSHIPS length report").
9
10* tests/sockopt-sol_netlink.c (main): Always print changing optlen value
11on exiting syscall.
12
13Reported-by: Alexander Gordeev <agordeev@linux.ibm.com>
14---
15 tests/sockopt-sol_netlink.c | 13 ++++++++++---
16 1 file changed, 10 insertions(+), 3 deletions(-)
17
18Upstream-Status: Backport
19
20diff --git a/tests/sockopt-sol_netlink.c b/tests/sockopt-sol_netlink.c
21index 82b98adc23..1c33219ac5 100644
22--- a/tests/sockopt-sol_netlink.c
23+++ b/tests/sockopt-sol_netlink.c
24@@ -94,7 +94,10 @@ main(void)
25 printf("%p", val);
26 else
27 printf("[%d]", *val);
28- printf(", [%d]) = %s\n", *len, errstr);
29+ printf(", [%d", (int) sizeof(*val));
30+ if ((int) sizeof(*val) != *len)
31+ printf(" => %d", *len);
32+ printf("]) = %s\n", errstr);
33
34 /* optlen larger than necessary - shortened */
35 *len = sizeof(*val) + 1;
36@@ -150,8 +153,12 @@ main(void)
37 /* optval EFAULT - print address */
38 *len = sizeof(*val);
39 get_sockopt(fd, names[i].val, efault, len);
40- printf("getsockopt(%d, SOL_NETLINK, %s, %p, [%d]) = %s\n",
41- fd, names[i].str, efault, *len, errstr);
42+ printf("getsockopt(%d, SOL_NETLINK, %s, %p",
43+ fd, names[i].str, efault);
44+ printf(", [%d", (int) sizeof(*val));
45+ if ((int) sizeof(*val) != *len)
46+ printf(" => %d", *len);
47+ printf("]) = %s\n", errstr);
48
49 /* optlen EFAULT - print address */
50 get_sockopt(fd, names[i].val, val, len + 1);
diff --git a/meta/recipes-devtools/strace/strace/skip-sockopt-test.patch b/meta/recipes-devtools/strace/strace/skip-sockopt-test.patch
deleted file mode 100644
index 5741bf8672..0000000000
--- a/meta/recipes-devtools/strace/strace/skip-sockopt-test.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1Upstream-Status: Inappropriate [avoid this test until fixed by upstream]
2
3Reported at https://github.com/strace/strace/issues/257
4
5root@qemux86-64:/usr/lib/strace/ptest/tests# make sockopt-sol_netlink.gen.log
6FAIL: sockopt-sol_netlink.gen.test
7
8#root@qemux86-64:/usr/lib/strace/ptest/tests# diff sockopt-sol_netlink.dir/exp sockopt-sol_netlink.dir/out
9#--- sockopt-sol_netlink.dir/exp
10#+++ sockopt-sol_netlink.dir/out
11#@@ -86,11 +86,11 @@
12 setsockopt(3, SOL_NETLINK, NETLINK_LISTEN_ALL_NSID, 0x7fa18a802ffc, -1) = -1 EINVAL (Invalid argument)
13 setsockopt(3, SOL_NETLINK, NETLINK_LISTEN_ALL_NSID, 0x7fa18a802ffc, 3) = 0
14 setsockopt(3, SOL_NETLINK, NETLINK_LISTEN_ALL_NSID, 0x7fa18a803000, 4) = -1 EFAULT (Bad address)
15-getsockopt(3, SOL_NETLINK, NETLINK_LIST_MEMBERSHIPS, [0], [8]) = 0
16+getsockopt(3, SOL_NETLINK, NETLINK_LIST_MEMBERSHIPS, [0], [4 => 8]) = 0
17 getsockopt(3, SOL_NETLINK, NETLINK_LIST_MEMBERSHIPS, [0], [5 => 8]) = 0
18 getsockopt(3, SOL_NETLINK, NETLINK_LIST_MEMBERSHIPS, NULL, [0 => 8]) = 0
19 getsockopt(3, SOL_NETLINK, NETLINK_LIST_MEMBERSHIPS, [], [3 => 8]) = 0
20-getsockopt(3, SOL_NETLINK, NETLINK_LIST_MEMBERSHIPS, 0x7fa18a803000, [8]) = -1 EFAULT (Bad address)
21+getsockopt(3, SOL_NETLINK, NETLINK_LIST_MEMBERSHIPS, 0x7fa18a803000, [4]) = -1 EFAULT (Bad address)
22 getsockopt(3, SOL_NETLINK, NETLINK_LIST_MEMBERSHIPS, 0x7fa18a802ffc, 0x7fa18a7fd000) = -1 EFAULT (Bad address)
23 setsockopt(3, SOL_NETLINK, NETLINK_LIST_MEMBERSHIPS, [233811181], 4) = -1 ENOPROTOOPT (Protocol not available)
24 setsockopt(3, SOL_NETLINK, NETLINK_LIST_MEMBERSHIPS, [233811181], 5) = -1 ENOPROTOOPT (Protocol not available)
25
26
27
28Index: strace-6.3/tests/sockopt-sol_netlink.gen.test
29===================================================================
30--- strace-6.3.orig/tests/sockopt-sol_netlink.gen.test
31+++ strace-6.3/tests/sockopt-sol_netlink.gen.test
32@@ -1,4 +1,5 @@
33 #!/bin/sh -efu
34 # Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sockopt-sol_netlink -e trace=getsockopt,setsockopt); do not edit.
35 . "${srcdir=.}/init.sh"
36+skip_ "Test failing after system upgrades, wait for upstream fixes"
37 run_strace_match_diff -e trace=getsockopt,setsockopt
diff --git a/meta/recipes-devtools/strace/strace_6.2.bb b/meta/recipes-devtools/strace/strace_6.2.bb
index c7f5b741b2..e7a34bbf66 100644
--- a/meta/recipes-devtools/strace/strace_6.2.bb
+++ b/meta/recipes-devtools/strace/strace_6.2.bb
@@ -14,7 +14,8 @@ SRC_URI = "https://strace.io/files/${PV}/strace-${PV}.tar.xz \
14 file://skip-load.patch \ 14 file://skip-load.patch \
15 file://0001-configure-Use-autoconf-macro-to-detect-largefile-sup.patch \ 15 file://0001-configure-Use-autoconf-macro-to-detect-largefile-sup.patch \
16 file://0002-tests-Replace-off64_t-with-off_t.patch \ 16 file://0002-tests-Replace-off64_t-with-off_t.patch \
17 file://skip-sockopt-test.patch \ 17 file://f31c2f4494779e5c5f170ad10539bfc2dfafe967.patch \
18 file://3bbfb541b258baec9eba674b5d8dc30007a61542.patch \
18 " 19 "
19SRC_URI[sha256sum] = "0c7d38a449416268d3004029a220a15a77c2206a03cc88120f37f46e949177e8" 20SRC_URI[sha256sum] = "0c7d38a449416268d3004029a220a15a77c2206a03cc88120f37f46e949177e8"
20 21