diff options
Diffstat (limited to 'meta/recipes-devtools/strace/strace/3bbfb541b258baec9eba674b5d8dc30007a61542.patch')
-rw-r--r-- | meta/recipes-devtools/strace/strace/3bbfb541b258baec9eba674b5d8dc30007a61542.patch | 50 |
1 files changed, 50 insertions, 0 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 @@ | |||
1 | From 3bbfb541b258baec9eba674b5d8dc30007a61542 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Dmitry V. Levin" <ldv@strace.io> | ||
3 | Date: Wed, 21 Jun 2023 08:00:00 +0000 | ||
4 | Subject: [PATCH] net: enhance getsockopt decoding | ||
5 | |||
6 | When getsockopt syscall fails the kernel sometimes updates the optlen | ||
7 | argument, for example, NETLINK_LIST_MEMBERSHIPS updates it even if | ||
8 | optval is not writable. | ||
9 | |||
10 | * src/net.c (SYS_FUNC(getsockopt)): Try to fetch and print optlen | ||
11 | argument on exiting syscall regardless of getsockopt exit status. | ||
12 | |||
13 | Upstream-Status: Backport | ||
14 | --- | ||
15 | src/net.c | 15 ++++++++++++++- | ||
16 | 1 file changed, 14 insertions(+), 1 deletion(-) | ||
17 | |||
18 | diff --git a/src/net.c b/src/net.c | ||
19 | index 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], | ||