From 9bebc9a00cee98fd3c430392c58f51ac1fd9e58e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 28 Apr 2020 05:37:27 -0400 Subject: [PATCH] import gcc-toolset-9-strace-5.1-6.el8 --- .gcc-toolset-9-strace.metadata | 1 + .gitignore | 1 + ...vector-decoding-on-non-successful-an.patch | 42 + ...y-size-calculation-in-decode_bitset_.patch | 57 ++ ...vdev-bitset-decoding-more-thoroughly.patch | 795 ++++++++++++++++++ ...fting-left-a-signed-number-by-31-bit.patch | 32 + ...id-infinite-loop-in-subcalls-parsing.patch | 55 ++ ...vcpu_info-assignment-in-vcpu_registe.patch | 36 + ...d-type-for-mount_flags-fallback-valu.patch | 365 ++++++++ ...-fix-initialization-of-libdwfl-cache.patch | 36 + ...apture-stack-trace-while-the-tracee-.patch | 42 + SOURCES/0041-tests-add-strace-k-p-test.patch | 761 +++++++++++++++++ ...y-decode-sockaddr_hci-addresses-with.patch | 225 +++++ ...x-expected-output-for-some-ipc-tests.patch | 90 ++ ...x-a-argument-in-ipc_msgbuf-Xraw-test.patch | 53 ++ ...01-limit-qual_fault-scope-on-aarch64.patch | 39 + SPECS/strace.spec | 718 ++++++++++++++++ 17 files changed, 3348 insertions(+) create mode 100644 .gcc-toolset-9-strace.metadata create mode 100644 .gitignore create mode 100644 SOURCES/0030-evdev-avoid-bit-vector-decoding-on-non-successful-an.patch create mode 100644 SOURCES/0031-evdev-fix-array-size-calculation-in-decode_bitset_.patch create mode 100644 SOURCES/0033-tests-test-evdev-bitset-decoding-more-thoroughly.patch create mode 100644 SOURCES/0035-v4l2-avoid-shifting-left-a-signed-number-by-31-bit.patch create mode 100644 SOURCES/0036-syscall.c-avoid-infinite-loop-in-subcalls-parsing.patch create mode 100644 SOURCES/0037-kvm-avoid-bogus-vcpu_info-assignment-in-vcpu_registe.patch create mode 100644 SOURCES/0038-xlat-use-unsgined-type-for-mount_flags-fallback-valu.patch create mode 100644 SOURCES/0039-unwind-libdw-fix-initialization-of-libdwfl-cache.patch create mode 100644 SOURCES/0040-syscall-do-not-capture-stack-trace-while-the-tracee-.patch create mode 100644 SOURCES/0041-tests-add-strace-k-p-test.patch create mode 100644 SOURCES/0042-sockaddr-properly-decode-sockaddr_hci-addresses-with.patch create mode 100644 SOURCES/0043-tests-fix-expected-output-for-some-ipc-tests.patch create mode 100644 SOURCES/0044-tests-fix-a-argument-in-ipc_msgbuf-Xraw-test.patch create mode 100644 SOURCES/0201-limit-qual_fault-scope-on-aarch64.patch create mode 100644 SPECS/strace.spec diff --git a/.gcc-toolset-9-strace.metadata b/.gcc-toolset-9-strace.metadata new file mode 100644 index 0000000..aa6c4b8 --- /dev/null +++ b/.gcc-toolset-9-strace.metadata @@ -0,0 +1 @@ +6474260dcc66aa1f591acee31ae6a1a457b34656 SOURCES/strace-5.1.tar.xz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c283e23 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/strace-5.1.tar.xz diff --git a/SOURCES/0030-evdev-avoid-bit-vector-decoding-on-non-successful-an.patch b/SOURCES/0030-evdev-avoid-bit-vector-decoding-on-non-successful-an.patch new file mode 100644 index 0000000..3d21fae --- /dev/null +++ b/SOURCES/0030-evdev-avoid-bit-vector-decoding-on-non-successful-an.patch @@ -0,0 +1,42 @@ +From 7ada13f3a40e2f58aea335cf910666378e7dd99a Mon Sep 17 00:00:00 2001 +From: Eugene Syromyatnikov +Date: Fri, 12 Jul 2019 14:38:33 +0200 +Subject: [PATCH 1/3] evdev: avoid bit vector decoding on non-successful and 0 + return codes + +Reported by Clang. + + strace/evdev.c:157:3: note: The value 0 is assigned to 'size' + # size = tcp->u_rval * 8; + # ^~~~~~~~~~~~~~~~~~~~~~ + strace/evdev.c:158:2: warning: Declared variable-length array (VLA) + has zero size + # char decoded_arg[size]; + # ^ + +* evdev.c (decode_bitset_): Bail out before decoded_arg VLA definition. +--- + evdev.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/evdev.c b/evdev.c +index e402d26e..4b811cf8 100644 +--- a/evdev.c ++++ b/evdev.c +@@ -155,6 +155,13 @@ decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg, + size = max_nr; + else + size = tcp->u_rval * 8; ++ ++ if (syserror(tcp) || !size) { ++ printaddr(arg); ++ ++ return RVAL_IOCTL_DECODED; ++ } ++ + char decoded_arg[size]; + + if (umove_or_printaddr(tcp, arg, &decoded_arg)) +-- +2.13.6 + diff --git a/SOURCES/0031-evdev-fix-array-size-calculation-in-decode_bitset_.patch b/SOURCES/0031-evdev-fix-array-size-calculation-in-decode_bitset_.patch new file mode 100644 index 0000000..18cf773 --- /dev/null +++ b/SOURCES/0031-evdev-fix-array-size-calculation-in-decode_bitset_.patch @@ -0,0 +1,57 @@ +From 96194ed74158f0b9976fae43a910ad14eaea141e Mon Sep 17 00:00:00 2001 +From: Eugene Syromyatnikov +Date: Fri, 12 Jul 2019 14:57:28 +0200 +Subject: [PATCH 2/3] evdev: fix array size calculation in decode_bitset_ + +max_nr is in bits (as it is a number of flags), result is in bytes, and +the array allocation has to be in personality words. + +There's still an open question, however, what to do on big-endian +architectures when a non-divisible-by-4 value is returned. + +* evdev.c (decode_bitset_): Declare size_bits, initialise it and use it +later instead of size; round up size by personality's word boundary. +--- + evdev.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/evdev.c b/evdev.c +index 4b811cf8..a3d9cb55 100644 +--- a/evdev.c ++++ b/evdev.c +@@ -151,10 +151,14 @@ decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg, + tprints(", "); + + unsigned int size; ++ unsigned int size_bits; ++ + if ((kernel_ulong_t) tcp->u_rval > max_nr / 8) +- size = max_nr; ++ size_bits = max_nr; + else +- size = tcp->u_rval * 8; ++ size_bits = tcp->u_rval * 8; ++ ++ size = ROUNDUP(ROUNDUP_DIV(size_bits, 8), current_wordsize); + + if (syserror(tcp) || !size) { + printaddr(arg); +@@ -170,13 +174,13 @@ decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg, + tprints("["); + + int bit_displayed = 0; +- int i = next_set_bit(decoded_arg, 0, size); ++ int i = next_set_bit(decoded_arg, 0, size_bits); + if (i < 0) { + tprints(" 0 "); + } else { + printxval_dispatch(decode_nr, decode_nr_size, i, dflt, xt); + +- while ((i = next_set_bit(decoded_arg, i + 1, size)) > 0) { ++ while ((i = next_set_bit(decoded_arg, i + 1, size_bits)) > 0) { + if (abbrev(tcp) && bit_displayed >= 3) { + tprints(", ..."); + break; +-- +2.13.6 + diff --git a/SOURCES/0033-tests-test-evdev-bitset-decoding-more-thoroughly.patch b/SOURCES/0033-tests-test-evdev-bitset-decoding-more-thoroughly.patch new file mode 100644 index 0000000..e2abf52 --- /dev/null +++ b/SOURCES/0033-tests-test-evdev-bitset-decoding-more-thoroughly.patch @@ -0,0 +1,795 @@ +From cdd8206af74fcb961f0179e21eacf5d55d23f0ac Mon Sep 17 00:00:00 2001 +From: Eugene Syromyatnikov +Date: Fri, 12 Jul 2019 14:31:44 +0200 +Subject: [PATCH 3/3] tests: test evdev bitset decoding more thoroughly + +* tests/ioctl_evdev-success-v.test: Inject various values. +* tests/ioctl_evdev-success.test: Likewise. +* tests/ioctl_evdev-success.c (NUM_WORDS): New macro. +(struct evdev_check): Constify arg_ptr and print_arg args. +(invoke_test_syscall, test_evdev, print_input_absinfo, print_input_id, +print_mtslots): Add const qualifiers. +(print_getbit): Add const qualifiers, rewrite to expect trailing NULL +in the string array instead of leading string count. +(main): Set size for ev_more, ev_less, ev_zero arrays; replace leading +count element in ev_more_str, ev_less_str, ev_zero_str with trailing +NULL; replace ev_more_str and ev_less_str with ev_more_str_2/ev_less_str_2 +and ev_more_str_3/ev_less_str_3 that differ by presence of flags that reside +beyond first two bytes; add static and const qualifiers where possible; +add key/key_sts_8/key_str_16 values; update a to provide either ev_more_str_2 +or ev_more_str_3 and either key_str_8 or key_str_16 depending on inject_retval +value. +--- + tests/ioctl_evdev-success-v.test | 15 +++--- + tests/ioctl_evdev-success.c | 100 ++++++++++++++++++++++++++------------- + tests/ioctl_evdev-success.test | 15 +++--- + 3 files changed, 84 insertions(+), 46 deletions(-) + +Index: strace-4.24/tests/ioctl_evdev-success-v.test +=================================================================== +--- strace-4.24.orig/tests/ioctl_evdev-success-v.test 2019-08-01 18:40:58.009521546 +0200 ++++ strace-4.24/tests/ioctl_evdev-success-v.test 2019-08-01 19:21:32.297062218 +0200 +@@ -3,11 +3,14 @@ + . "${srcdir=.}/scno_tampering.sh" + + : ${IOCTL_INJECT_START=256} +-: ${IOCTL_INJECT_RETVAL=8} + + run_prog +-run_strace -a16 -v -e trace=ioctl \ +- -e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \ +- ../ioctl_evdev-success-v "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}"> "$EXP" +-grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" +-match_diff "$OUT" "$EXP" ++ ++for ret in 0 2 8 15 16; do ++ run_strace -a16 -v -e trace=ioctl \ ++ -e inject=ioctl:retval="${ret}":when="${IOCTL_INJECT_START}+" \ ++ ../ioctl_evdev-success-v \ ++ "${IOCTL_INJECT_START}" "${ret}"> "$EXP.$ret" ++ grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT.$ret" ++ match_diff "$OUT.$ret" "$EXP.$ret" ++done +Index: strace-4.24/tests/ioctl_evdev-success.c +=================================================================== +--- strace-4.24.orig/tests/ioctl_evdev-success.c 2019-08-01 18:40:58.009521546 +0200 ++++ strace-4.24/tests/ioctl_evdev-success.c 2019-08-01 19:21:32.297062218 +0200 +@@ -2,6 +2,7 @@ + + #ifdef HAVE_LINUX_INPUT_H + ++# include + # include + # include + # include +@@ -9,17 +10,19 @@ + # include + # include "print_fields.h" + ++# define NUM_WORDS 4 ++ + static const char *errstr; + + struct evdev_check { + unsigned long cmd; + const char *cmd_str; +- void *arg_ptr; +- void (*print_arg)(long rc, void *ptr, void *arg); ++ const void *arg_ptr; ++ void (*print_arg)(long rc, const void *ptr, const void *arg); + }; + + static long +-invoke_test_syscall(unsigned long cmd, void *p) ++invoke_test_syscall(unsigned long cmd, const void *p) + { + long rc = ioctl(-1, cmd, p); + errstr = sprintrc(rc); +@@ -31,7 +34,7 @@ + } + + static void +-test_evdev(struct evdev_check *check, void *arg) ++test_evdev(struct evdev_check *check, const void *arg) + { + long rc = invoke_test_syscall(check->cmd, check->arg_ptr); + printf("ioctl(-1, %s, ", check->cmd_str); +@@ -43,9 +46,9 @@ + } + + static void +-print_input_absinfo(long rc, void *ptr, void *arg) ++print_input_absinfo(long rc, const void *ptr, const void *arg) + { +- struct input_absinfo *absinfo = ptr; ++ const struct input_absinfo *absinfo = ptr; + + if (rc < 0) { + printf("%p", absinfo); +@@ -67,9 +70,9 @@ + } + + static void +-print_input_id(long rc, void *ptr, void *arg) ++print_input_id(long rc, const void *ptr, const void *arg) + { +- struct input_id *id = ptr; ++ const struct input_id *id = ptr; + + if (rc < 0) { + printf("%p", id); +@@ -84,10 +87,10 @@ + + # ifdef EVIOCGMTSLOTS + static void +-print_mtslots(long rc, void *ptr, void *arg) ++print_mtslots(long rc, const void *ptr, const void *arg) + { +- int *buffer = ptr; +- const char **str = arg; ++ const int *buffer = ptr; ++ const char * const * str = arg; + int num = atoi(*(str + 1)); + + if (rc < 0) { +@@ -104,27 +107,26 @@ + # endif + + static void +-print_getbit(long rc, void *ptr, void *arg) ++print_getbit(long rc, const void *ptr, const void *arg) + { +- const char **str = arg; +- int num = atoi(*str); ++ const char * const *str = arg; + +- if (rc < 0) { ++ if (rc <= 0) { + printf("%p", ptr); + return; + } + + printf("["); +- printf("%s", *(str + 1)); +- for (unsigned int i = 2; i <= (unsigned) num; i++) { ++ for (unsigned long i = 0; str[i]; i++) { + # if ! VERBOSE +- if (i > 4) { ++ if (i >= 4) { + printf(", ..."); + break; + } + # endif +- printf(", "); +- printf("%s", *(str + i)); ++ if (i) ++ printf(", "); ++ printf("%s", str[i]); + } + printf("]"); + } +@@ -170,6 +172,7 @@ + TAIL_ALLOC_OBJECT_CONST_PTR(struct input_id, id); + TAIL_ALLOC_OBJECT_CONST_PTR(struct input_absinfo, absinfo); + TAIL_ALLOC_OBJECT_CONST_PTR(int, bad_addr_slot); ++ + # ifdef EVIOCGMTSLOTS + int mtslots[] = { ABS_MT_SLOT, 1, 3 }; + /* we use the second element to indicate the number of values */ +@@ -183,36 +186,65 @@ + const char *invalid_mtslot_str[] = { invalid_str, "1", "1" }; + # endif + ++ enum { ULONG_BIT = sizeof(unsigned long) * 8 }; ++ + /* set more than 4 bits */ +- unsigned long ev_more[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED | 1 << EV_SND | 1 << EV_PWR }; +- /* we use the first element to indicate the number of set bits */ +- /* ev_more_str[0] is "5" so the number of set bits is 5 */ +- const char *ev_more_str[] = { "5", "EV_ABS", "EV_MSC", "EV_LED", "EV_SND", "EV_PWR" }; ++ static const unsigned long ev_more[NUM_WORDS] = { ++ 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED | 1 << EV_SND ++ | 1 << EV_PWR }; ++ static const char * const ev_more_str_2[] = { ++ "EV_ABS", "EV_MSC", NULL }; ++ static const char * const ev_more_str_3[] = { ++ "EV_ABS", "EV_MSC", "EV_LED", "EV_SND", "EV_PWR", NULL }; + + /* set less than 4 bits */ +- unsigned long ev_less[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED }; +- const char *ev_less_str[] = { "3", "EV_ABS", "EV_MSC", "EV_LED" }; ++ static const unsigned long ev_less[NUM_WORDS] = { ++ 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED }; ++ static const char * const ev_less_str_2[] = { ++ "EV_ABS", "EV_MSC", NULL }; ++ static const char * const ev_less_str_3[] = { ++ "EV_ABS", "EV_MSC", "EV_LED", NULL }; + + /* set zero bit */ +- unsigned long ev_zero[] = { 0x0 }; +- const char *ev_zero_str[] = { "0", " 0 " }; ++ static const unsigned long ev_zero[NUM_WORDS] = { 0x0 }; ++ static const char * const ev_zero_str[] = { " 0 ", NULL }; + + /* KEY_MAX is 0x2ff which is greater than retval * 8 */ +- unsigned long key[] = { 1 << KEY_1 | 1 << KEY_2, 0 }; +- const char *key_str[] = { "2", "KEY_1", "KEY_2" }; ++ static const unsigned long key[NUM_WORDS] = { ++ 1 << KEY_1 | 1 << KEY_2, ++ [ KEY_F12 / ULONG_BIT ] = 1 << (KEY_F12 % ULONG_BIT) }; ++ ++ static const char * const key_str_8[] = { ++ "KEY_1", "KEY_2", NULL }; ++ static const char * const key_str_16[] = { ++ "KEY_1", "KEY_2", "KEY_F12", NULL }; ++ ++ assert(sizeof(ev_more) >= (unsigned long) inject_retval); ++ assert(sizeof(ev_less) >= (unsigned long) inject_retval); ++ assert(sizeof(ev_zero) >= (unsigned long) inject_retval); ++ assert(sizeof(key) >= (unsigned long) inject_retval); + + struct { + struct evdev_check check; +- void *ptr; ++ const void *ptr; + } a[] = { + { { ARG_STR(EVIOCGID), id, print_input_id }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_X)), absinfo, print_input_absinfo }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_Y)), absinfo, print_input_absinfo }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_Y)), absinfo, print_input_absinfo }, NULL }, +- { { ARG_STR(EVIOCGBIT(0, 0)), ev_more, print_getbit }, &ev_more_str }, +- { { ARG_STR(EVIOCGBIT(0, 0)), ev_less, print_getbit }, &ev_less_str }, ++ { { ARG_STR(EVIOCGBIT(0, 0)), ev_more, print_getbit }, ++ inject_retval * 8 <= EV_LED ++ ? (const void *) &ev_more_str_2 ++ : (const void *) &ev_more_str_3 }, ++ { { ARG_STR(EVIOCGBIT(0, 0)), ev_less, print_getbit }, ++ inject_retval * 8 <= EV_LED ++ ? (const void *) &ev_less_str_2 ++ : (const void *) &ev_less_str_3 }, + { { ARG_STR(EVIOCGBIT(0, 0)), ev_zero, print_getbit }, &ev_zero_str }, +- { { ARG_STR(EVIOCGBIT(EV_KEY, 0)), key, print_getbit }, &key_str}, ++ { { ARG_STR(EVIOCGBIT(EV_KEY, 0)), key, print_getbit }, ++ inject_retval * 8 <= KEY_F12 ++ ? (const void *) &key_str_8 ++ : (const void *) &key_str_16 }, + # ifdef EVIOCGMTSLOTS + { { ARG_STR(EVIOCGMTSLOTS(12)), mtslots, print_mtslots }, &mtslots_str }, + { { ARG_STR(EVIOCGMTSLOTS(8)), invalid_mtslot, print_mtslots }, &invalid_mtslot_str } +Index: strace-4.24/tests/ioctl_evdev-success.test +=================================================================== +--- strace-4.24.orig/tests/ioctl_evdev-success.test 2019-08-01 18:40:58.009521546 +0200 ++++ strace-4.24/tests/ioctl_evdev-success.test 2019-08-01 19:21:32.298062205 +0200 +@@ -3,11 +3,14 @@ + . "${srcdir=.}/scno_tampering.sh" + + : ${IOCTL_INJECT_START=256} +-: ${IOCTL_INJECT_RETVAL=8} + + run_prog +-run_strace -a16 -e trace=ioctl \ +- -e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \ +- ../ioctl_evdev-success "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}"> "$EXP" +-grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" +-match_diff "$OUT" "$EXP" ++ ++for ret in 0 2 8 15 16; do ++ run_strace -a16 -e trace=ioctl \ ++ -e inject=ioctl:retval="${ret}":when="${IOCTL_INJECT_START}+" \ ++ ../ioctl_evdev-success \ ++ "${IOCTL_INJECT_START}" "${ret}"> "$EXP.${ret}" ++ grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT.$ret" ++ match_diff "$OUT.$ret" "$EXP.$ret" ++done +Index: strace-4.24/tests-m32/ioctl_evdev-success-v.test +=================================================================== +--- strace-4.24.orig/tests-m32/ioctl_evdev-success-v.test 2019-08-01 18:40:58.009521546 +0200 ++++ strace-4.24/tests-m32/ioctl_evdev-success-v.test 2019-08-01 19:21:32.298062205 +0200 +@@ -3,11 +3,14 @@ + . "${srcdir=.}/scno_tampering.sh" + + : ${IOCTL_INJECT_START=256} +-: ${IOCTL_INJECT_RETVAL=8} + + run_prog +-run_strace -a16 -v -e trace=ioctl \ +- -e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \ +- ../ioctl_evdev-success-v "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}"> "$EXP" +-grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" +-match_diff "$OUT" "$EXP" ++ ++for ret in 0 2 8 15 16; do ++ run_strace -a16 -v -e trace=ioctl \ ++ -e inject=ioctl:retval="${ret}":when="${IOCTL_INJECT_START}+" \ ++ ../ioctl_evdev-success-v \ ++ "${IOCTL_INJECT_START}" "${ret}"> "$EXP.$ret" ++ grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT.$ret" ++ match_diff "$OUT.$ret" "$EXP.$ret" ++done +Index: strace-4.24/tests-m32/ioctl_evdev-success.test +=================================================================== +--- strace-4.24.orig/tests-m32/ioctl_evdev-success.test 2019-08-01 18:40:58.009521546 +0200 ++++ strace-4.24/tests-m32/ioctl_evdev-success.test 2019-08-01 19:21:32.298062205 +0200 +@@ -3,11 +3,14 @@ + . "${srcdir=.}/scno_tampering.sh" + + : ${IOCTL_INJECT_START=256} +-: ${IOCTL_INJECT_RETVAL=8} + + run_prog +-run_strace -a16 -e trace=ioctl \ +- -e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \ +- ../ioctl_evdev-success "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}"> "$EXP" +-grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" +-match_diff "$OUT" "$EXP" ++ ++for ret in 0 2 8 15 16; do ++ run_strace -a16 -e trace=ioctl \ ++ -e inject=ioctl:retval="${ret}":when="${IOCTL_INJECT_START}+" \ ++ ../ioctl_evdev-success \ ++ "${IOCTL_INJECT_START}" "${ret}"> "$EXP.${ret}" ++ grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT.$ret" ++ match_diff "$OUT.$ret" "$EXP.$ret" ++done +Index: strace-4.24/tests-mx32/ioctl_evdev-success-v.test +=================================================================== +--- strace-4.24.orig/tests-mx32/ioctl_evdev-success-v.test 2019-08-01 18:40:58.009521546 +0200 ++++ strace-4.24/tests-mx32/ioctl_evdev-success-v.test 2019-08-01 19:21:32.298062205 +0200 +@@ -3,11 +3,14 @@ + . "${srcdir=.}/scno_tampering.sh" + + : ${IOCTL_INJECT_START=256} +-: ${IOCTL_INJECT_RETVAL=8} + + run_prog +-run_strace -a16 -v -e trace=ioctl \ +- -e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \ +- ../ioctl_evdev-success-v "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}"> "$EXP" +-grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" +-match_diff "$OUT" "$EXP" ++ ++for ret in 0 2 8 15 16; do ++ run_strace -a16 -v -e trace=ioctl \ ++ -e inject=ioctl:retval="${ret}":when="${IOCTL_INJECT_START}+" \ ++ ../ioctl_evdev-success-v \ ++ "${IOCTL_INJECT_START}" "${ret}"> "$EXP.$ret" ++ grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT.$ret" ++ match_diff "$OUT.$ret" "$EXP.$ret" ++done +Index: strace-4.24/tests-mx32/ioctl_evdev-success.test +=================================================================== +--- strace-4.24.orig/tests-mx32/ioctl_evdev-success.test 2019-08-01 18:40:58.009521546 +0200 ++++ strace-4.24/tests-mx32/ioctl_evdev-success.test 2019-08-01 19:21:32.299062192 +0200 +@@ -3,11 +3,14 @@ + . "${srcdir=.}/scno_tampering.sh" + + : ${IOCTL_INJECT_START=256} +-: ${IOCTL_INJECT_RETVAL=8} + + run_prog +-run_strace -a16 -e trace=ioctl \ +- -e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \ +- ../ioctl_evdev-success "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}"> "$EXP" +-grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" +-match_diff "$OUT" "$EXP" ++ ++for ret in 0 2 8 15 16; do ++ run_strace -a16 -e trace=ioctl \ ++ -e inject=ioctl:retval="${ret}":when="${IOCTL_INJECT_START}+" \ ++ ../ioctl_evdev-success \ ++ "${IOCTL_INJECT_START}" "${ret}"> "$EXP.${ret}" ++ grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT.$ret" ++ match_diff "$OUT.$ret" "$EXP.$ret" ++done +Index: strace-4.24/tests-m32/ioctl_evdev-success.c +=================================================================== +--- strace-4.24.orig/tests-m32/ioctl_evdev-success.c 2019-08-01 18:40:58.009521546 +0200 ++++ strace-4.24/tests-m32/ioctl_evdev-success.c 2019-08-29 12:09:27.898700830 +0200 +@@ -2,6 +2,7 @@ + + #ifdef HAVE_LINUX_INPUT_H + ++# include + # include + # include + # include +@@ -9,17 +10,19 @@ + # include + # include "print_fields.h" + ++# define NUM_WORDS 4 ++ + static const char *errstr; + + struct evdev_check { + unsigned long cmd; + const char *cmd_str; +- void *arg_ptr; +- void (*print_arg)(long rc, void *ptr, void *arg); ++ const void *arg_ptr; ++ void (*print_arg)(long rc, const void *ptr, const void *arg); + }; + + static long +-invoke_test_syscall(unsigned long cmd, void *p) ++invoke_test_syscall(unsigned long cmd, const void *p) + { + long rc = ioctl(-1, cmd, p); + errstr = sprintrc(rc); +@@ -31,7 +34,7 @@ + } + + static void +-test_evdev(struct evdev_check *check, void *arg) ++test_evdev(struct evdev_check *check, const void *arg) + { + long rc = invoke_test_syscall(check->cmd, check->arg_ptr); + printf("ioctl(-1, %s, ", check->cmd_str); +@@ -43,9 +46,9 @@ + } + + static void +-print_input_absinfo(long rc, void *ptr, void *arg) ++print_input_absinfo(long rc, const void *ptr, const void *arg) + { +- struct input_absinfo *absinfo = ptr; ++ const struct input_absinfo *absinfo = ptr; + + if (rc < 0) { + printf("%p", absinfo); +@@ -67,9 +70,9 @@ + } + + static void +-print_input_id(long rc, void *ptr, void *arg) ++print_input_id(long rc, const void *ptr, const void *arg) + { +- struct input_id *id = ptr; ++ const struct input_id *id = ptr; + + if (rc < 0) { + printf("%p", id); +@@ -84,10 +87,10 @@ + + # ifdef EVIOCGMTSLOTS + static void +-print_mtslots(long rc, void *ptr, void *arg) ++print_mtslots(long rc, const void *ptr, const void *arg) + { +- int *buffer = ptr; +- const char **str = arg; ++ const int *buffer = ptr; ++ const char * const * str = arg; + int num = atoi(*(str + 1)); + + if (rc < 0) { +@@ -104,27 +107,26 @@ + # endif + + static void +-print_getbit(long rc, void *ptr, void *arg) ++print_getbit(long rc, const void *ptr, const void *arg) + { +- const char **str = arg; +- int num = atoi(*str); ++ const char * const *str = arg; + +- if (rc < 0) { ++ if (rc <= 0) { + printf("%p", ptr); + return; + } + + printf("["); +- printf("%s", *(str + 1)); +- for (unsigned int i = 2; i <= (unsigned) num; i++) { ++ for (unsigned long i = 0; str[i]; i++) { + # if ! VERBOSE +- if (i > 4) { ++ if (i >= 4) { + printf(", ..."); + break; + } + # endif +- printf(", "); +- printf("%s", *(str + i)); ++ if (i) ++ printf(", "); ++ printf("%s", str[i]); + } + printf("]"); + } +@@ -170,6 +172,7 @@ + TAIL_ALLOC_OBJECT_CONST_PTR(struct input_id, id); + TAIL_ALLOC_OBJECT_CONST_PTR(struct input_absinfo, absinfo); + TAIL_ALLOC_OBJECT_CONST_PTR(int, bad_addr_slot); ++ + # ifdef EVIOCGMTSLOTS + int mtslots[] = { ABS_MT_SLOT, 1, 3 }; + /* we use the second element to indicate the number of values */ +@@ -183,36 +186,65 @@ + const char *invalid_mtslot_str[] = { invalid_str, "1", "1" }; + # endif + ++ enum { ULONG_BIT = sizeof(unsigned long) * 8 }; ++ + /* set more than 4 bits */ +- unsigned long ev_more[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED | 1 << EV_SND | 1 << EV_PWR }; +- /* we use the first element to indicate the number of set bits */ +- /* ev_more_str[0] is "5" so the number of set bits is 5 */ +- const char *ev_more_str[] = { "5", "EV_ABS", "EV_MSC", "EV_LED", "EV_SND", "EV_PWR" }; ++ static const unsigned long ev_more[NUM_WORDS] = { ++ 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED | 1 << EV_SND ++ | 1 << EV_PWR }; ++ static const char * const ev_more_str_2[] = { ++ "EV_ABS", "EV_MSC", NULL }; ++ static const char * const ev_more_str_3[] = { ++ "EV_ABS", "EV_MSC", "EV_LED", "EV_SND", "EV_PWR", NULL }; + + /* set less than 4 bits */ +- unsigned long ev_less[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED }; +- const char *ev_less_str[] = { "3", "EV_ABS", "EV_MSC", "EV_LED" }; ++ static const unsigned long ev_less[NUM_WORDS] = { ++ 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED }; ++ static const char * const ev_less_str_2[] = { ++ "EV_ABS", "EV_MSC", NULL }; ++ static const char * const ev_less_str_3[] = { ++ "EV_ABS", "EV_MSC", "EV_LED", NULL }; + + /* set zero bit */ +- unsigned long ev_zero[] = { 0x0 }; +- const char *ev_zero_str[] = { "0", " 0 " }; ++ static const unsigned long ev_zero[NUM_WORDS] = { 0x0 }; ++ static const char * const ev_zero_str[] = { " 0 ", NULL }; + + /* KEY_MAX is 0x2ff which is greater than retval * 8 */ +- unsigned long key[] = { 1 << KEY_1 | 1 << KEY_2, 0 }; +- const char *key_str[] = { "2", "KEY_1", "KEY_2" }; ++ static const unsigned long key[NUM_WORDS] = { ++ 1 << KEY_1 | 1 << KEY_2, ++ [ KEY_F12 / ULONG_BIT ] = 1 << (KEY_F12 % ULONG_BIT) }; ++ ++ static const char * const key_str_8[] = { ++ "KEY_1", "KEY_2", NULL }; ++ static const char * const key_str_16[] = { ++ "KEY_1", "KEY_2", "KEY_F12", NULL }; ++ ++ assert(sizeof(ev_more) >= (unsigned long) inject_retval); ++ assert(sizeof(ev_less) >= (unsigned long) inject_retval); ++ assert(sizeof(ev_zero) >= (unsigned long) inject_retval); ++ assert(sizeof(key) >= (unsigned long) inject_retval); + + struct { + struct evdev_check check; +- void *ptr; ++ const void *ptr; + } a[] = { + { { ARG_STR(EVIOCGID), id, print_input_id }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_X)), absinfo, print_input_absinfo }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_Y)), absinfo, print_input_absinfo }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_Y)), absinfo, print_input_absinfo }, NULL }, +- { { ARG_STR(EVIOCGBIT(0, 0)), ev_more, print_getbit }, &ev_more_str }, +- { { ARG_STR(EVIOCGBIT(0, 0)), ev_less, print_getbit }, &ev_less_str }, ++ { { ARG_STR(EVIOCGBIT(0, 0)), ev_more, print_getbit }, ++ inject_retval * 8 <= EV_LED ++ ? (const void *) &ev_more_str_2 ++ : (const void *) &ev_more_str_3 }, ++ { { ARG_STR(EVIOCGBIT(0, 0)), ev_less, print_getbit }, ++ inject_retval * 8 <= EV_LED ++ ? (const void *) &ev_less_str_2 ++ : (const void *) &ev_less_str_3 }, + { { ARG_STR(EVIOCGBIT(0, 0)), ev_zero, print_getbit }, &ev_zero_str }, +- { { ARG_STR(EVIOCGBIT(EV_KEY, 0)), key, print_getbit }, &key_str}, ++ { { ARG_STR(EVIOCGBIT(EV_KEY, 0)), key, print_getbit }, ++ inject_retval * 8 <= KEY_F12 ++ ? (const void *) &key_str_8 ++ : (const void *) &key_str_16 }, + # ifdef EVIOCGMTSLOTS + { { ARG_STR(EVIOCGMTSLOTS(12)), mtslots, print_mtslots }, &mtslots_str }, + { { ARG_STR(EVIOCGMTSLOTS(8)), invalid_mtslot, print_mtslots }, &invalid_mtslot_str } +Index: strace-4.24/tests-mx32/ioctl_evdev-success.c +=================================================================== +--- strace-4.24.orig/tests-mx32/ioctl_evdev-success.c 2019-08-01 18:40:58.009521546 +0200 ++++ strace-4.24/tests-mx32/ioctl_evdev-success.c 2019-08-29 12:09:30.350669261 +0200 +@@ -2,6 +2,7 @@ + + #ifdef HAVE_LINUX_INPUT_H + ++# include + # include + # include + # include +@@ -9,17 +10,19 @@ + # include + # include "print_fields.h" + ++# define NUM_WORDS 4 ++ + static const char *errstr; + + struct evdev_check { + unsigned long cmd; + const char *cmd_str; +- void *arg_ptr; +- void (*print_arg)(long rc, void *ptr, void *arg); ++ const void *arg_ptr; ++ void (*print_arg)(long rc, const void *ptr, const void *arg); + }; + + static long +-invoke_test_syscall(unsigned long cmd, void *p) ++invoke_test_syscall(unsigned long cmd, const void *p) + { + long rc = ioctl(-1, cmd, p); + errstr = sprintrc(rc); +@@ -31,7 +34,7 @@ + } + + static void +-test_evdev(struct evdev_check *check, void *arg) ++test_evdev(struct evdev_check *check, const void *arg) + { + long rc = invoke_test_syscall(check->cmd, check->arg_ptr); + printf("ioctl(-1, %s, ", check->cmd_str); +@@ -43,9 +46,9 @@ + } + + static void +-print_input_absinfo(long rc, void *ptr, void *arg) ++print_input_absinfo(long rc, const void *ptr, const void *arg) + { +- struct input_absinfo *absinfo = ptr; ++ const struct input_absinfo *absinfo = ptr; + + if (rc < 0) { + printf("%p", absinfo); +@@ -67,9 +70,9 @@ + } + + static void +-print_input_id(long rc, void *ptr, void *arg) ++print_input_id(long rc, const void *ptr, const void *arg) + { +- struct input_id *id = ptr; ++ const struct input_id *id = ptr; + + if (rc < 0) { + printf("%p", id); +@@ -84,10 +87,10 @@ + + # ifdef EVIOCGMTSLOTS + static void +-print_mtslots(long rc, void *ptr, void *arg) ++print_mtslots(long rc, const void *ptr, const void *arg) + { +- int *buffer = ptr; +- const char **str = arg; ++ const int *buffer = ptr; ++ const char * const * str = arg; + int num = atoi(*(str + 1)); + + if (rc < 0) { +@@ -104,27 +107,26 @@ + # endif + + static void +-print_getbit(long rc, void *ptr, void *arg) ++print_getbit(long rc, const void *ptr, const void *arg) + { +- const char **str = arg; +- int num = atoi(*str); ++ const char * const *str = arg; + +- if (rc < 0) { ++ if (rc <= 0) { + printf("%p", ptr); + return; + } + + printf("["); +- printf("%s", *(str + 1)); +- for (unsigned int i = 2; i <= (unsigned) num; i++) { ++ for (unsigned long i = 0; str[i]; i++) { + # if ! VERBOSE +- if (i > 4) { ++ if (i >= 4) { + printf(", ..."); + break; + } + # endif +- printf(", "); +- printf("%s", *(str + i)); ++ if (i) ++ printf(", "); ++ printf("%s", str[i]); + } + printf("]"); + } +@@ -170,6 +172,7 @@ + TAIL_ALLOC_OBJECT_CONST_PTR(struct input_id, id); + TAIL_ALLOC_OBJECT_CONST_PTR(struct input_absinfo, absinfo); + TAIL_ALLOC_OBJECT_CONST_PTR(int, bad_addr_slot); ++ + # ifdef EVIOCGMTSLOTS + int mtslots[] = { ABS_MT_SLOT, 1, 3 }; + /* we use the second element to indicate the number of values */ +@@ -183,36 +186,65 @@ + const char *invalid_mtslot_str[] = { invalid_str, "1", "1" }; + # endif + ++ enum { ULONG_BIT = sizeof(unsigned long) * 8 }; ++ + /* set more than 4 bits */ +- unsigned long ev_more[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED | 1 << EV_SND | 1 << EV_PWR }; +- /* we use the first element to indicate the number of set bits */ +- /* ev_more_str[0] is "5" so the number of set bits is 5 */ +- const char *ev_more_str[] = { "5", "EV_ABS", "EV_MSC", "EV_LED", "EV_SND", "EV_PWR" }; ++ static const unsigned long ev_more[NUM_WORDS] = { ++ 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED | 1 << EV_SND ++ | 1 << EV_PWR }; ++ static const char * const ev_more_str_2[] = { ++ "EV_ABS", "EV_MSC", NULL }; ++ static const char * const ev_more_str_3[] = { ++ "EV_ABS", "EV_MSC", "EV_LED", "EV_SND", "EV_PWR", NULL }; + + /* set less than 4 bits */ +- unsigned long ev_less[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED }; +- const char *ev_less_str[] = { "3", "EV_ABS", "EV_MSC", "EV_LED" }; ++ static const unsigned long ev_less[NUM_WORDS] = { ++ 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED }; ++ static const char * const ev_less_str_2[] = { ++ "EV_ABS", "EV_MSC", NULL }; ++ static const char * const ev_less_str_3[] = { ++ "EV_ABS", "EV_MSC", "EV_LED", NULL }; + + /* set zero bit */ +- unsigned long ev_zero[] = { 0x0 }; +- const char *ev_zero_str[] = { "0", " 0 " }; ++ static const unsigned long ev_zero[NUM_WORDS] = { 0x0 }; ++ static const char * const ev_zero_str[] = { " 0 ", NULL }; + + /* KEY_MAX is 0x2ff which is greater than retval * 8 */ +- unsigned long key[] = { 1 << KEY_1 | 1 << KEY_2, 0 }; +- const char *key_str[] = { "2", "KEY_1", "KEY_2" }; ++ static const unsigned long key[NUM_WORDS] = { ++ 1 << KEY_1 | 1 << KEY_2, ++ [ KEY_F12 / ULONG_BIT ] = 1 << (KEY_F12 % ULONG_BIT) }; ++ ++ static const char * const key_str_8[] = { ++ "KEY_1", "KEY_2", NULL }; ++ static const char * const key_str_16[] = { ++ "KEY_1", "KEY_2", "KEY_F12", NULL }; ++ ++ assert(sizeof(ev_more) >= (unsigned long) inject_retval); ++ assert(sizeof(ev_less) >= (unsigned long) inject_retval); ++ assert(sizeof(ev_zero) >= (unsigned long) inject_retval); ++ assert(sizeof(key) >= (unsigned long) inject_retval); + + struct { + struct evdev_check check; +- void *ptr; ++ const void *ptr; + } a[] = { + { { ARG_STR(EVIOCGID), id, print_input_id }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_X)), absinfo, print_input_absinfo }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_Y)), absinfo, print_input_absinfo }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_Y)), absinfo, print_input_absinfo }, NULL }, +- { { ARG_STR(EVIOCGBIT(0, 0)), ev_more, print_getbit }, &ev_more_str }, +- { { ARG_STR(EVIOCGBIT(0, 0)), ev_less, print_getbit }, &ev_less_str }, ++ { { ARG_STR(EVIOCGBIT(0, 0)), ev_more, print_getbit }, ++ inject_retval * 8 <= EV_LED ++ ? (const void *) &ev_more_str_2 ++ : (const void *) &ev_more_str_3 }, ++ { { ARG_STR(EVIOCGBIT(0, 0)), ev_less, print_getbit }, ++ inject_retval * 8 <= EV_LED ++ ? (const void *) &ev_less_str_2 ++ : (const void *) &ev_less_str_3 }, + { { ARG_STR(EVIOCGBIT(0, 0)), ev_zero, print_getbit }, &ev_zero_str }, +- { { ARG_STR(EVIOCGBIT(EV_KEY, 0)), key, print_getbit }, &key_str}, ++ { { ARG_STR(EVIOCGBIT(EV_KEY, 0)), key, print_getbit }, ++ inject_retval * 8 <= KEY_F12 ++ ? (const void *) &key_str_8 ++ : (const void *) &key_str_16 }, + # ifdef EVIOCGMTSLOTS + { { ARG_STR(EVIOCGMTSLOTS(12)), mtslots, print_mtslots }, &mtslots_str }, + { { ARG_STR(EVIOCGMTSLOTS(8)), invalid_mtslot, print_mtslots }, &invalid_mtslot_str } diff --git a/SOURCES/0035-v4l2-avoid-shifting-left-a-signed-number-by-31-bit.patch b/SOURCES/0035-v4l2-avoid-shifting-left-a-signed-number-by-31-bit.patch new file mode 100644 index 0000000..a2c85f9 --- /dev/null +++ b/SOURCES/0035-v4l2-avoid-shifting-left-a-signed-number-by-31-bit.patch @@ -0,0 +1,32 @@ +From 91281fec7823f1cd3df3374fbcbd14af52a3fa1b Mon Sep 17 00:00:00 2001 +From: Eugene Syromyatnikov +Date: Wed, 14 Aug 2019 17:15:47 +0200 +Subject: [PATCH] v4l2: avoid shifting left a signed number by 31 bit + +cppcheck warns about it with the following diagnostics: + + error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is + undefined behaviour + +* v4l2.c [!v4l2_fourcc_be] (v4l2_fourcc_be): Shift left 1U and not 1 in +order to get 0x80000000. +--- + v4l2.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/v4l2.c b/v4l2.c +index 5da457c..505e7b8 100644 +--- a/v4l2.c ++++ b/v4l2.c +@@ -47,7 +47,7 @@ typedef struct v4l2_standard struct_v4l2_standard; + + /* v4l2_fourcc_be was added by Linux commit v3.18-rc1~101^2^2~127 */ + #ifndef v4l2_fourcc_be +-# define v4l2_fourcc_be(a, b, c, d) (v4l2_fourcc(a, b, c, d) | (1 << 31)) ++# define v4l2_fourcc_be(a, b, c, d) (v4l2_fourcc(a, b, c, d) | (1U << 31)) + #endif + + #define FMT_FRACT "%u/%u" +-- +2.1.4 + diff --git a/SOURCES/0036-syscall.c-avoid-infinite-loop-in-subcalls-parsing.patch b/SOURCES/0036-syscall.c-avoid-infinite-loop-in-subcalls-parsing.patch new file mode 100644 index 0000000..9144dc1 --- /dev/null +++ b/SOURCES/0036-syscall.c-avoid-infinite-loop-in-subcalls-parsing.patch @@ -0,0 +1,55 @@ +From 522ad3a0e73148dadd2480cd9cec84d9112b2e57 Mon Sep 17 00:00:00 2001 +From: Eugene Syromyatnikov +Date: Tue, 4 Sep 2018 14:48:13 +0200 +Subject: [PATCH] syscall.c: avoid infinite loop in subcalls parsing + +clang complains about it, so it might be a good reason to refactor it +into something more linear. + +* syscall.c (syscall_entering_decode): Put syscall subcall decoding +before ipc/socket subcall decoding, remove the loop. +--- + syscall.c | 19 ++++++------------- + 1 file changed, 6 insertions(+), 13 deletions(-) + +diff --git a/syscall.c b/syscall.c +index bae7343..a67d744 100644 +--- a/syscall.c ++++ b/syscall.c +@@ -579,11 +579,13 @@ syscall_entering_decode(struct tcb *tcp) + return res; + } + ++# ifdef SYS_syscall_subcall ++ if (tcp_sysent(tcp)->sen == SEN_syscall) ++ decode_syscall_subcall(tcp); ++# endif + #if defined SYS_ipc_subcall \ +- || defined SYS_socket_subcall \ +- || defined SYS_syscall_subcall +- for (;;) { +- switch (tcp_sysent(tcp)->sen) { ++ || defined SYS_socket_subcall ++ switch (tcp_sysent(tcp)->sen) { + # ifdef SYS_ipc_subcall + case SEN_ipc: + decode_ipc_subcall(tcp); +@@ -594,15 +596,6 @@ syscall_entering_decode(struct tcb *tcp) + decode_socket_subcall(tcp); + break; + # endif +-# ifdef SYS_syscall_subcall +- case SEN_syscall: +- decode_syscall_subcall(tcp); +- if (tcp_sysent(tcp)->sen != SEN_syscall) +- continue; +- break; +-# endif +- } +- break; + } + #endif + +-- +2.1.4 + diff --git a/SOURCES/0037-kvm-avoid-bogus-vcpu_info-assignment-in-vcpu_registe.patch b/SOURCES/0037-kvm-avoid-bogus-vcpu_info-assignment-in-vcpu_registe.patch new file mode 100644 index 0000000..7531868 --- /dev/null +++ b/SOURCES/0037-kvm-avoid-bogus-vcpu_info-assignment-in-vcpu_registe.patch @@ -0,0 +1,36 @@ +From 9446038e9face3313373ca5f7539476789fd4660 Mon Sep 17 00:00:00 2001 +From: Eugene Syromyatnikov +Date: Tue, 18 Dec 2018 05:37:30 +0100 +Subject: [PATCH] kvm: avoid bogus vcpu_info assignment in vcpu_register + +Also reformat code a bit to make nesting a bit clearer. + +Reported by Clang. + +* kvm.c (vcpu_register): Do not assign vcpu_alloc result to vcpu_info +as this value is not used afterwards in the function. +--- + kvm.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/kvm.c b/kvm.c +index 984a75e..8bdf1cc 100644 +--- a/kvm.c ++++ b/kvm.c +@@ -76,10 +76,9 @@ vcpu_register(struct tcb *const tcp, int fd, int cpuid) + + struct vcpu_info *vcpu_info = vcpu_find(tcp, fd); + +- if (!vcpu_info) +- vcpu_info = vcpu_alloc(tcp, fd, cpuid); +- else if (vcpu_info->cpuid != cpuid) +- { ++ if (!vcpu_info) { ++ vcpu_alloc(tcp, fd, cpuid); ++ } else if (vcpu_info->cpuid != cpuid) { + vcpu_info->cpuid = cpuid; + vcpu_info->resolved = false; + } +-- +2.1.4 + diff --git a/SOURCES/0038-xlat-use-unsgined-type-for-mount_flags-fallback-valu.patch b/SOURCES/0038-xlat-use-unsgined-type-for-mount_flags-fallback-valu.patch new file mode 100644 index 0000000..5bc3768 --- /dev/null +++ b/SOURCES/0038-xlat-use-unsgined-type-for-mount_flags-fallback-valu.patch @@ -0,0 +1,365 @@ +From c26541c73c3b4be2977e719d77287255eb346cdf Mon Sep 17 00:00:00 2001 +From: Eugene Syromyatnikov +Date: Thu, 17 Oct 2019 13:13:45 +0200 +Subject: [PATCH] xlat: use unsgined type for mount_flags fallback values + +Reported by cppcheck: + + strace/xlat/mount_flags.h:256: error[shiftTooManyBitsSigned]: + Shifting signed 32-bit value by 31 bits is undefined behaviour + # 254| XLAT(MS_BORN), + # 255| XLAT(MS_ACTIVE), + # 256|-> XLAT(MS_NOUSER), + # 257| XLAT_END + # 258| }; + +* xlat/mount_flags.in: Use 1U instead of 1 as a bit shifting operand. + +References: https://bugzilla.redhat.com/show_bug.cgi?id=1747524 +--- + xlat/mount_flags.in | 60 ++++++++++++++++++++++++++--------------------------- + 1 file changed, 30 insertions(+), 30 deletions(-) + +Index: strace-4.24/xlat/mount_flags.in +=================================================================== +--- strace-4.24.orig/xlat/mount_flags.in 2018-04-24 02:35:27.000000000 +0200 ++++ strace-4.24/xlat/mount_flags.in 2019-12-02 18:37:39.403710911 +0100 +@@ -1,30 +1,30 @@ +-MS_RDONLY 1 +-MS_NOSUID 2 +-MS_NODEV 4 +-MS_NOEXEC 8 +-MS_SYNCHRONOUS 16 +-MS_REMOUNT 32 +-MS_MANDLOCK 64 +-MS_DIRSYNC 128 +-MS_NOATIME 1024 +-MS_NODIRATIME 2048 +-MS_BIND 4096 +-MS_MOVE 8192 +-MS_REC 16384 +-MS_SILENT 32768 +-MS_POSIXACL (1<<16) +-MS_UNBINDABLE (1<<17) +-MS_PRIVATE (1<<18) +-MS_SLAVE (1<<19) +-MS_SHARED (1<<20) +-MS_RELATIME (1<<21) +-MS_KERNMOUNT (1<<22) +-MS_I_VERSION (1<<23) +-MS_STRICTATIME (1<<24) +-MS_LAZYTIME (1<<25) +-MS_SUBMOUNT (1<<26) +-MS_NOREMOTELOCK (1<<27) +-MS_NOSEC (1<<28) +-MS_BORN (1<<29) +-MS_ACTIVE (1<<30) +-MS_NOUSER (1<<31) ++MS_RDONLY (1U<<0) ++MS_NOSUID (1U<<1) ++MS_NODEV (1U<<2) ++MS_NOEXEC (1U<<3) ++MS_SYNCHRONOUS (1U<<4) ++MS_REMOUNT (1U<<5) ++MS_MANDLOCK (1U<<6) ++MS_DIRSYNC (1U<<7) ++MS_NOATIME (1U<<10) ++MS_NODIRATIME (1U<<11) ++MS_BIND (1U<<12) ++MS_MOVE (1U<<13) ++MS_REC (1U<<14) ++MS_SILENT (1U<<15) ++MS_POSIXACL (1U<<16) ++MS_UNBINDABLE (1U<<17) ++MS_PRIVATE (1U<<18) ++MS_SLAVE (1U<<19) ++MS_SHARED (1U<<20) ++MS_RELATIME (1U<<21) ++MS_KERNMOUNT (1U<<22) ++MS_I_VERSION (1U<<23) ++MS_STRICTATIME (1U<<24) ++MS_LAZYTIME (1U<<25) ++MS_SUBMOUNT (1U<<26) ++MS_NOREMOTELOCK (1U<<27) ++MS_NOSEC (1U<<28) ++MS_BORN (1U<<29) ++MS_ACTIVE (1U<<30) ++MS_NOUSER (1U<<31) +Index: strace-4.24/xlat/mount_flags.h +=================================================================== +--- strace-4.24.orig/xlat/mount_flags.h 2018-08-14 02:44:19.000000000 +0200 ++++ strace-4.24/xlat/mount_flags.h 2019-12-02 18:38:36.102900164 +0100 +@@ -5,213 +5,213 @@ + + #if defined(MS_RDONLY) || (defined(HAVE_DECL_MS_RDONLY) && HAVE_DECL_MS_RDONLY) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_RDONLY) == (1), "MS_RDONLY != 1"); ++static_assert((MS_RDONLY) == ((1U<<0)), "MS_RDONLY != (1U<<0)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_RDONLY 1 ++# define MS_RDONLY (1U<<0) + #endif + #if defined(MS_NOSUID) || (defined(HAVE_DECL_MS_NOSUID) && HAVE_DECL_MS_NOSUID) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_NOSUID) == (2), "MS_NOSUID != 2"); ++static_assert((MS_NOSUID) == ((1U<<1)), "MS_NOSUID != (1U<<1)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_NOSUID 2 ++# define MS_NOSUID (1U<<1) + #endif + #if defined(MS_NODEV) || (defined(HAVE_DECL_MS_NODEV) && HAVE_DECL_MS_NODEV) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_NODEV) == (4), "MS_NODEV != 4"); ++static_assert((MS_NODEV) == ((1U<<2)), "MS_NODEV != (1U<<2)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_NODEV 4 ++# define MS_NODEV (1U<<2) + #endif + #if defined(MS_NOEXEC) || (defined(HAVE_DECL_MS_NOEXEC) && HAVE_DECL_MS_NOEXEC) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_NOEXEC) == (8), "MS_NOEXEC != 8"); ++static_assert((MS_NOEXEC) == ((1U<<3)), "MS_NOEXEC != (1U<<3)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_NOEXEC 8 ++# define MS_NOEXEC (1U<<3) + #endif + #if defined(MS_SYNCHRONOUS) || (defined(HAVE_DECL_MS_SYNCHRONOUS) && HAVE_DECL_MS_SYNCHRONOUS) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_SYNCHRONOUS) == (16), "MS_SYNCHRONOUS != 16"); ++static_assert((MS_SYNCHRONOUS) == ((1U<<4)), "MS_SYNCHRONOUS != (1U<<4)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_SYNCHRONOUS 16 ++# define MS_SYNCHRONOUS (1U<<4) + #endif + #if defined(MS_REMOUNT) || (defined(HAVE_DECL_MS_REMOUNT) && HAVE_DECL_MS_REMOUNT) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_REMOUNT) == (32), "MS_REMOUNT != 32"); ++static_assert((MS_REMOUNT) == ((1U<<5)), "MS_REMOUNT != (1U<<5)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_REMOUNT 32 ++# define MS_REMOUNT (1U<<5) + #endif + #if defined(MS_MANDLOCK) || (defined(HAVE_DECL_MS_MANDLOCK) && HAVE_DECL_MS_MANDLOCK) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_MANDLOCK) == (64), "MS_MANDLOCK != 64"); ++static_assert((MS_MANDLOCK) == ((1U<<6)), "MS_MANDLOCK != (1U<<6)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_MANDLOCK 64 ++# define MS_MANDLOCK (1U<<6) + #endif + #if defined(MS_DIRSYNC) || (defined(HAVE_DECL_MS_DIRSYNC) && HAVE_DECL_MS_DIRSYNC) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_DIRSYNC) == (128), "MS_DIRSYNC != 128"); ++static_assert((MS_DIRSYNC) == ((1U<<7)), "MS_DIRSYNC != (1U<<7)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_DIRSYNC 128 ++# define MS_DIRSYNC (1U<<7) + #endif + #if defined(MS_NOATIME) || (defined(HAVE_DECL_MS_NOATIME) && HAVE_DECL_MS_NOATIME) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_NOATIME) == (1024), "MS_NOATIME != 1024"); ++static_assert((MS_NOATIME) == ((1U<<10)), "MS_NOATIME != (1U<<10)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_NOATIME 1024 ++# define MS_NOATIME (1U<<10) + #endif + #if defined(MS_NODIRATIME) || (defined(HAVE_DECL_MS_NODIRATIME) && HAVE_DECL_MS_NODIRATIME) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_NODIRATIME) == (2048), "MS_NODIRATIME != 2048"); ++static_assert((MS_NODIRATIME) == ((1U<<11)), "MS_NODIRATIME != (1U<<11)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_NODIRATIME 2048 ++# define MS_NODIRATIME (1U<<11) + #endif + #if defined(MS_BIND) || (defined(HAVE_DECL_MS_BIND) && HAVE_DECL_MS_BIND) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_BIND) == (4096), "MS_BIND != 4096"); ++static_assert((MS_BIND) == ((1U<<12)), "MS_BIND != (1U<<12)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_BIND 4096 ++# define MS_BIND (1U<<12) + #endif + #if defined(MS_MOVE) || (defined(HAVE_DECL_MS_MOVE) && HAVE_DECL_MS_MOVE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_MOVE) == (8192), "MS_MOVE != 8192"); ++static_assert((MS_MOVE) == ((1U<<13)), "MS_MOVE != (1U<<13)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_MOVE 8192 ++# define MS_MOVE (1U<<13) + #endif + #if defined(MS_REC) || (defined(HAVE_DECL_MS_REC) && HAVE_DECL_MS_REC) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_REC) == (16384), "MS_REC != 16384"); ++static_assert((MS_REC) == ((1U<<14)), "MS_REC != (1U<<14)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_REC 16384 ++# define MS_REC (1U<<14) + #endif + #if defined(MS_SILENT) || (defined(HAVE_DECL_MS_SILENT) && HAVE_DECL_MS_SILENT) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_SILENT) == (32768), "MS_SILENT != 32768"); ++static_assert((MS_SILENT) == ((1U<<15)), "MS_SILENT != (1U<<15)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_SILENT 32768 ++# define MS_SILENT (1U<<15) + #endif + #if defined(MS_POSIXACL) || (defined(HAVE_DECL_MS_POSIXACL) && HAVE_DECL_MS_POSIXACL) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_POSIXACL) == ((1<<16)), "MS_POSIXACL != (1<<16)"); ++static_assert((MS_POSIXACL) == ((1U<<16)), "MS_POSIXACL != (1U<<16)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_POSIXACL (1<<16) ++# define MS_POSIXACL (1U<<16) + #endif + #if defined(MS_UNBINDABLE) || (defined(HAVE_DECL_MS_UNBINDABLE) && HAVE_DECL_MS_UNBINDABLE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_UNBINDABLE) == ((1<<17)), "MS_UNBINDABLE != (1<<17)"); ++static_assert((MS_UNBINDABLE) == ((1U<<17)), "MS_UNBINDABLE != (1U<<17)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_UNBINDABLE (1<<17) ++# define MS_UNBINDABLE (1U<<17) + #endif + #if defined(MS_PRIVATE) || (defined(HAVE_DECL_MS_PRIVATE) && HAVE_DECL_MS_PRIVATE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_PRIVATE) == ((1<<18)), "MS_PRIVATE != (1<<18)"); ++static_assert((MS_PRIVATE) == ((1U<<18)), "MS_PRIVATE != (1U<<18)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_PRIVATE (1<<18) ++# define MS_PRIVATE (1U<<18) + #endif + #if defined(MS_SLAVE) || (defined(HAVE_DECL_MS_SLAVE) && HAVE_DECL_MS_SLAVE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_SLAVE) == ((1<<19)), "MS_SLAVE != (1<<19)"); ++static_assert((MS_SLAVE) == ((1U<<19)), "MS_SLAVE != (1U<<19)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_SLAVE (1<<19) ++# define MS_SLAVE (1U<<19) + #endif + #if defined(MS_SHARED) || (defined(HAVE_DECL_MS_SHARED) && HAVE_DECL_MS_SHARED) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_SHARED) == ((1<<20)), "MS_SHARED != (1<<20)"); ++static_assert((MS_SHARED) == ((1U<<20)), "MS_SHARED != (1U<<20)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_SHARED (1<<20) ++# define MS_SHARED (1U<<20) + #endif + #if defined(MS_RELATIME) || (defined(HAVE_DECL_MS_RELATIME) && HAVE_DECL_MS_RELATIME) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_RELATIME) == ((1<<21)), "MS_RELATIME != (1<<21)"); ++static_assert((MS_RELATIME) == ((1U<<21)), "MS_RELATIME != (1U<<21)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_RELATIME (1<<21) ++# define MS_RELATIME (1U<<21) + #endif + #if defined(MS_KERNMOUNT) || (defined(HAVE_DECL_MS_KERNMOUNT) && HAVE_DECL_MS_KERNMOUNT) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_KERNMOUNT) == ((1<<22)), "MS_KERNMOUNT != (1<<22)"); ++static_assert((MS_KERNMOUNT) == ((1U<<22)), "MS_KERNMOUNT != (1U<<22)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_KERNMOUNT (1<<22) ++# define MS_KERNMOUNT (1U<<22) + #endif + #if defined(MS_I_VERSION) || (defined(HAVE_DECL_MS_I_VERSION) && HAVE_DECL_MS_I_VERSION) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_I_VERSION) == ((1<<23)), "MS_I_VERSION != (1<<23)"); ++static_assert((MS_I_VERSION) == ((1U<<23)), "MS_I_VERSION != (1U<<23)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_I_VERSION (1<<23) ++# define MS_I_VERSION (1U<<23) + #endif + #if defined(MS_STRICTATIME) || (defined(HAVE_DECL_MS_STRICTATIME) && HAVE_DECL_MS_STRICTATIME) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_STRICTATIME) == ((1<<24)), "MS_STRICTATIME != (1<<24)"); ++static_assert((MS_STRICTATIME) == ((1U<<24)), "MS_STRICTATIME != (1U<<24)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_STRICTATIME (1<<24) ++# define MS_STRICTATIME (1U<<24) + #endif + #if defined(MS_LAZYTIME) || (defined(HAVE_DECL_MS_LAZYTIME) && HAVE_DECL_MS_LAZYTIME) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_LAZYTIME) == ((1<<25)), "MS_LAZYTIME != (1<<25)"); ++static_assert((MS_LAZYTIME) == ((1U<<25)), "MS_LAZYTIME != (1U<<25)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_LAZYTIME (1<<25) ++# define MS_LAZYTIME (1U<<25) + #endif + #if defined(MS_SUBMOUNT) || (defined(HAVE_DECL_MS_SUBMOUNT) && HAVE_DECL_MS_SUBMOUNT) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_SUBMOUNT) == ((1<<26)), "MS_SUBMOUNT != (1<<26)"); ++static_assert((MS_SUBMOUNT) == ((1U<<26)), "MS_SUBMOUNT != (1U<<26)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_SUBMOUNT (1<<26) ++# define MS_SUBMOUNT (1U<<26) + #endif + #if defined(MS_NOREMOTELOCK) || (defined(HAVE_DECL_MS_NOREMOTELOCK) && HAVE_DECL_MS_NOREMOTELOCK) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_NOREMOTELOCK) == ((1<<27)), "MS_NOREMOTELOCK != (1<<27)"); ++static_assert((MS_NOREMOTELOCK) == ((1U<<27)), "MS_NOREMOTELOCK != (1U<<27)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_NOREMOTELOCK (1<<27) ++# define MS_NOREMOTELOCK (1U<<27) + #endif + #if defined(MS_NOSEC) || (defined(HAVE_DECL_MS_NOSEC) && HAVE_DECL_MS_NOSEC) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_NOSEC) == ((1<<28)), "MS_NOSEC != (1<<28)"); ++static_assert((MS_NOSEC) == ((1U<<28)), "MS_NOSEC != (1U<<28)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_NOSEC (1<<28) ++# define MS_NOSEC (1U<<28) + #endif + #if defined(MS_BORN) || (defined(HAVE_DECL_MS_BORN) && HAVE_DECL_MS_BORN) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_BORN) == ((1<<29)), "MS_BORN != (1<<29)"); ++static_assert((MS_BORN) == ((1U<<29)), "MS_BORN != (1U<<29)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_BORN (1<<29) ++# define MS_BORN (1U<<29) + #endif + #if defined(MS_ACTIVE) || (defined(HAVE_DECL_MS_ACTIVE) && HAVE_DECL_MS_ACTIVE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_ACTIVE) == ((1<<30)), "MS_ACTIVE != (1<<30)"); ++static_assert((MS_ACTIVE) == ((1U<<30)), "MS_ACTIVE != (1U<<30)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_ACTIVE (1<<30) ++# define MS_ACTIVE (1U<<30) + #endif + #if defined(MS_NOUSER) || (defined(HAVE_DECL_MS_NOUSER) && HAVE_DECL_MS_NOUSER) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((MS_NOUSER) == ((1<<31)), "MS_NOUSER != (1<<31)"); ++static_assert((MS_NOUSER) == ((1U<<31)), "MS_NOUSER != (1U<<31)"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define MS_NOUSER (1<<31) ++# define MS_NOUSER (1U<<31) + #endif + + #ifndef XLAT_MACROS_ONLY diff --git a/SOURCES/0039-unwind-libdw-fix-initialization-of-libdwfl-cache.patch b/SOURCES/0039-unwind-libdw-fix-initialization-of-libdwfl-cache.patch new file mode 100644 index 0000000..17fd6cc --- /dev/null +++ b/SOURCES/0039-unwind-libdw-fix-initialization-of-libdwfl-cache.patch @@ -0,0 +1,36 @@ +From 69b2c33a77fa687feb41fafdbe187013aa812384 Mon Sep 17 00:00:00 2001 +From: "Dmitry V. Levin" +Date: Tue, 7 Jan 2020 18:54:55 +0000 +Subject: [PATCH] unwind-libdw: fix initialization of libdwfl cache + +This fixes stack trace printing for early syscalls that precede +the first syscall from memory mapping or execve families. + +* unwind-libdw.c (tcb_init): Set struct ctx.last_proc_updating +to a value different from mapping_generation so that libdwfl cache +is properly initialized before the first use. +* NEWS: Mention this fix. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1788636 +--- +Backport changes: + - NEWS hunk has been dropped. + +--- + NEWS | 2 ++ + unwind-libdw.c | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + +Index: strace-4.24/unwind-libdw.c +=================================================================== +--- strace-4.24.orig/unwind-libdw.c 2020-01-23 12:55:01.922338273 +0100 ++++ strace-4.24/unwind-libdw.c 2020-01-23 12:55:06.131299136 +0100 +@@ -69,7 +69,7 @@ + + struct ctx *ctx = xmalloc(sizeof(*ctx)); + ctx->dwfl = dwfl; +- ctx->last_proc_updating = 0; ++ ctx->last_proc_updating = mapping_generation - 1; + return ctx; + } + diff --git a/SOURCES/0040-syscall-do-not-capture-stack-trace-while-the-tracee-.patch b/SOURCES/0040-syscall-do-not-capture-stack-trace-while-the-tracee-.patch new file mode 100644 index 0000000..a9add6e --- /dev/null +++ b/SOURCES/0040-syscall-do-not-capture-stack-trace-while-the-tracee-.patch @@ -0,0 +1,42 @@ +From 35e080ae319d25c1df82855cda3a1bb014e90ba6 Mon Sep 17 00:00:00 2001 +From: "Dmitry V. Levin" +Date: Wed, 8 Jan 2020 00:41:58 +0000 +Subject: [PATCH] syscall: do not capture stack trace while the tracee executes + strace code + +* syscall.c (syscall_entering_trace) [ENABLE_STACKTRACE]: Do not capture +stack trace when TCB_CHECK_EXEC_SYSCALL flag is set. +--- + syscall.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/syscall.c b/syscall.c +index fadd3b5..a8fb4f1 100644 +--- a/syscall.c ++++ b/syscall.c +@@ -620,7 +620,7 @@ syscall_entering_trace(struct tcb *tcp, unsigned int *sig) + if (hide_log(tcp)) { + /* + * Restrain from fault injection +- * while the trace executes strace code. ++ * while the tracee executes strace code. + */ + tcp->qual_flg &= ~QUAL_INJECT; + +@@ -655,9 +655,10 @@ syscall_entering_trace(struct tcb *tcp, unsigned int *sig) + } + + #ifdef ENABLE_STACKTRACE +- if (stack_trace_enabled) { +- if (tcp_sysent(tcp)->sys_flags & STACKTRACE_CAPTURE_ON_ENTER) +- unwind_tcb_capture(tcp); ++ if (stack_trace_enabled && ++ !check_exec_syscall(tcp) && ++ tcp_sysent(tcp)->sys_flags & STACKTRACE_CAPTURE_ON_ENTER) { ++ unwind_tcb_capture(tcp); + } + #endif + +-- +2.1.4 + diff --git a/SOURCES/0041-tests-add-strace-k-p-test.patch b/SOURCES/0041-tests-add-strace-k-p-test.patch new file mode 100644 index 0000000..3f56199 --- /dev/null +++ b/SOURCES/0041-tests-add-strace-k-p-test.patch @@ -0,0 +1,761 @@ +From 8e515c744935fe67e6a1b941f4c5414472c163b7 Mon Sep 17 00:00:00 2001 +From: Eugene Syromyatnikov +Date: Mon, 20 Jan 2020 16:19:40 +0100 +Subject: [PATCH] tests: add strace-k-p test + +Add a check of the stack unwinding for attached processes. + +* tests/stack-fcall-attach.c: New file. +* tests/strace-k-p.expected: Likewise. +* tests/strace-k-p.test: New test. +* tests/Makefile.am (EXTRA_DIST): Add strace-k-p.expected and strace-k-p.test. +(STACKTRACE_TESTS): Add strace-k-p.test +(check_PROGRAMS): Add stack-fcall-attach. +(stack_fcall_attach_SOURCES): New variable. +* tests/stack-fcall.c: Include "tests.h" and . +[!ATTACH_MODE] (ATTACH_MODE): Define to 0. +(main) [ATTACH_MODE]: Wait a bit. +* tests/strace-k.test: Add attach mode. + +Complements: v5.4-18-g69b2c33 "unwind-libdw: fix initialization of libdwfl cache" +--- +Backport changes: + * "SIGURG" line has been removed from tests/strace-k-p.expected, as it requires + v4.25~22 "Print stack traces on signals" and v4.25~21 "tests: check stack + unwinding for signals". + * "chdir" usage in tests/strace-k-p.expected has been replaced with "getpid", + as it is the syscall that was used in the stack-fcall.c at the time. + * Added the respective changes to tests/Makefile.in file. + * The changes to tests/stack-fcall-attach.c, tests/strace-k-p.expected, + tests/strace-k-p.test, tests/Makefile.am, tests/stack-fcall.c, + and tests/strace-k.test have been copied over to tests-m32 and tests-mx32 + directories. + +--- + tests/Makefile.am | 8 +++++++- + tests/stack-fcall-attach.c | 2 ++ + tests/stack-fcall.c | 11 +++++++++++ + tests/strace-k-p.expected | 2 ++ + tests/strace-k-p.test | 13 +++++++++++++ + tests/strace-k.test | 17 ++++++++++++++++- + 6 files changed, 51 insertions(+), 2 deletions(-) + create mode 100644 tests/stack-fcall-attach.c + create mode 100644 tests/strace-k-p.expected + create mode 100755 tests/strace-k-p.test + +Index: strace-5.1/tests/Makefile.am +=================================================================== +--- strace-5.1.orig/tests/Makefile.am 2020-01-23 16:56:22.081268798 +0100 ++++ strace-5.1/tests/Makefile.am 2020-01-23 17:03:50.786051167 +0100 +@@ -156,6 +156,7 @@ + signal_receive \ + sleep \ + stack-fcall \ ++ stack-fcall-attach \ + stack-fcall-mangled \ + threads-execve \ + unblock_reset_raise \ +@@ -198,6 +199,9 @@ + stack_fcall_SOURCES = stack-fcall.c \ + stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c + ++stack_fcall_attach_SOURCES = stack-fcall-attach.c \ ++ stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c ++ + stack_fcall_mangled_SOURCES = stack-fcall-mangled.c \ + stack-fcall-mangled-0.c stack-fcall-mangled-1.c \ + stack-fcall-mangled-2.c stack-fcall-mangled-3.c +@@ -205,7 +209,7 @@ + include gen_tests.am + + if ENABLE_STACKTRACE +-STACKTRACE_TESTS = strace-k.test ++STACKTRACE_TESTS = strace-k.test strace-k-p.test + if USE_DEMANGLE + STACKTRACE_TESTS += strace-k-demangle.test + endif +@@ -428,6 +432,8 @@ + strace-ff.expected \ + strace-k-demangle.expected \ + strace-k-demangle.test \ ++ strace-k-p.expected \ ++ strace-k-p.test \ + strace-k.expected \ + strace-k.test \ + strace-r.expected \ +Index: strace-5.1/tests/stack-fcall-attach.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ strace-5.1/tests/stack-fcall-attach.c 2020-01-23 17:03:50.786051167 +0100 +@@ -0,0 +1,2 @@ ++#define ATTACH_MODE 1 ++#include "stack-fcall.c" +Index: strace-5.1/tests/stack-fcall.c +=================================================================== +--- strace-5.1.orig/tests/stack-fcall.c 2020-01-23 17:03:50.787051163 +0100 ++++ strace-5.1/tests/stack-fcall.c 2020-01-23 17:04:34.525868669 +0100 +@@ -5,10 +5,21 @@ + * SPDX-License-Identifier: GPL-2.0-or-later + */ + ++#include "tests.h" ++#include + #include "stack-fcall.h" + ++#ifndef ATTACH_MODE ++# define ATTACH_MODE 0 ++#endif ++ + int main(void) + { ++#if ATTACH_MODE ++ /* sleep a bit to let the tracer time to catch up */ ++ sleep(1); ++#endif ++ + f0(0); + f0(1); + return 0; +Index: strace-5.1/tests/strace-k-p.expected +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ strace-5.1/tests/strace-k-p.expected 2020-01-23 17:14:13.570831178 +0100 +@@ -0,0 +1,2 @@ ++^chdir .*(__kernel_vsyscaln )?(__)?chdir f3 f2 f1 f0 main ++^SIGURG .*(__kernel_vsyscaln )?(__)?kill f3 f2 f1 f0 main +Index: strace-5.1/tests/strace-k-p.test +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ strace-5.1/tests/strace-k-p.test 2020-01-23 17:03:50.787051163 +0100 +@@ -0,0 +1,13 @@ ++#!/bin/sh ++# ++# Check strace -k for attached tracees. ++# ++# Copyright (c) 2020 The strace developers. ++# All rights reserved. ++# ++# SPDX-License-Identifier: GPL-2.0-or-later ++ ++ATTACH_MODE=1 ++test_prog=../stack-fcall-attach ++ ++. "${srcdir=.}"/strace-k.test +Index: strace-5.1/tests/strace-k.test +=================================================================== +--- strace-5.1.orig/tests/strace-k.test 2020-01-23 16:56:22.081268798 +0100 ++++ strace-5.1/tests/strace-k.test 2020-01-23 17:05:26.569651525 +0100 +@@ -11,6 +11,8 @@ + + . "${srcdir=.}/init.sh" + ++: "${ATTACH_MODE=0}" ++ + # strace -k is implemented using /proc/$pid/maps + [ -f /proc/self/maps ] || + framework_skip_ '/proc/self/maps is not available' +@@ -20,7 +22,19 @@ + check_prog tr + + run_prog "${test_prog=../stack-fcall}" +-run_strace -e chdir -k $args ++if [ "x${ATTACH_MODE}" = "x1" ]; then ++ ../set_ptracer_any "${test_prog}" >> "$EXP" & ++ tracee_pid=$! ++ ++ while ! [ -s "$EXP" ]; do ++ kill -0 "$tracee_pid" 2> /dev/null || ++ fail_ 'set_ptracer_any failed' ++ done ++ ++ run_strace -e chdir -k -p "$tracee_pid" ++else ++ run_strace -e chdir -k $args ++fi + + expected="$srcdir/$NAME.expected" + awk ' +Index: strace-5.1/tests/Makefile.in +=================================================================== +--- strace-5.1.orig/tests/Makefile.in 2020-01-23 16:56:22.086268802 +0100 ++++ strace-5.1/tests/Makefile.in 2020-01-23 17:07:45.456135366 +0100 +@@ -144,9 +144,9 @@ + seccomp-strict$(EXEEXT) select-P$(EXEEXT) \ + set_ptracer_any$(EXEEXT) set_sigblock$(EXEEXT) \ + set_sigign$(EXEEXT) signal_receive$(EXEEXT) sleep$(EXEEXT) \ +- stack-fcall$(EXEEXT) stack-fcall-mangled$(EXEEXT) \ +- threads-execve$(EXEEXT) unblock_reset_raise$(EXEEXT) \ +- unix-pair-send-recv$(EXEEXT) \ ++ stack-fcall$(EXEEXT) stack-fcall-attach$(EXEEXT) \ ++ stack-fcall-mangled$(EXEEXT) threads-execve$(EXEEXT) \ ++ unblock_reset_raise$(EXEEXT) unix-pair-send-recv$(EXEEXT) \ + unix-pair-sendto-recvfrom$(EXEEXT) vfork-f$(EXEEXT) \ + wait4-v$(EXEEXT) waitid-v$(EXEEXT) zeroargc$(EXEEXT) + @ENABLE_STACKTRACE_TRUE@@USE_DEMANGLE_TRUE@am__append_1 = strace-k-demangle.test +@@ -2604,6 +2604,12 @@ + stack_fcall_OBJECTS = $(am_stack_fcall_OBJECTS) + stack_fcall_LDADD = $(LDADD) + stack_fcall_DEPENDENCIES = libtests.a ++am_stack_fcall_attach_OBJECTS = stack-fcall-attach.$(OBJEXT) \ ++ stack-fcall-0.$(OBJEXT) stack-fcall-1.$(OBJEXT) \ ++ stack-fcall-2.$(OBJEXT) stack-fcall-3.$(OBJEXT) ++stack_fcall_attach_OBJECTS = $(am_stack_fcall_attach_OBJECTS) ++stack_fcall_attach_LDADD = $(LDADD) ++stack_fcall_attach_DEPENDENCIES = libtests.a + am_stack_fcall_mangled_OBJECTS = stack-fcall-mangled.$(OBJEXT) \ + stack-fcall-mangled-0.$(OBJEXT) \ + stack-fcall-mangled-1.$(OBJEXT) \ +@@ -3453,7 +3459,7 @@ + sock_filter-v-Xverbose.c sockaddr_xlat-Xabbrev.c \ + sockaddr_xlat-Xraw.c sockaddr_xlat-Xverbose.c socketcall.c \ + sockopt-sol_netlink.c sockopt-timestamp.c splice.c \ +- $(stack_fcall_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ ++ $(stack_fcall_SOURCES) $(stack_fcall_attach_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ + stat64.c statfs.c statfs64.c statx.c swap.c sxetmask.c \ + symlink.c symlinkat.c sync.c sync_file_range.c \ + sync_file_range2.c sysinfo.c syslog.c tee.c threads-execve.c \ +@@ -3620,7 +3626,7 @@ + sock_filter-v-Xverbose.c sockaddr_xlat-Xabbrev.c \ + sockaddr_xlat-Xraw.c sockaddr_xlat-Xverbose.c socketcall.c \ + sockopt-sol_netlink.c sockopt-timestamp.c splice.c \ +- $(stack_fcall_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ ++ $(stack_fcall_SOURCES) $(stack_fcall_attach_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ + stat64.c statfs.c statfs64.c statx.c swap.c sxetmask.c \ + symlink.c symlinkat.c sync.c sync_file_range.c \ + sync_file_range2.c sysinfo.c syslog.c tee.c threads-execve.c \ +@@ -3848,7 +3854,8 @@ + bases=`echo $$bases` + RECHECK_LOGS = $(TEST_LOGS) + AM_RECURSIVE_TARGETS = check recheck +-@ENABLE_STACKTRACE_TRUE@am__EXEEXT_2 = strace-k.test $(am__append_1) ++@ENABLE_STACKTRACE_TRUE@am__EXEEXT_2 = strace-k.test strace-k-p.test \ ++@ENABLE_STACKTRACE_TRUE@ $(am__append_1) + TEST_SUITE_LOG = test-suite.log + TEST_EXTENSIONS = @EXEEXT@ .test + am__test_logs1 = $(TESTS:=.log) +@@ -4634,6 +4641,9 @@ + stack_fcall_SOURCES = stack-fcall.c \ + stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c + ++stack_fcall_attach_SOURCES = stack-fcall-attach.c \ ++ stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c ++ + stack_fcall_mangled_SOURCES = stack-fcall-mangled.c \ + stack-fcall-mangled-0.c stack-fcall-mangled-1.c \ + stack-fcall-mangled-2.c stack-fcall-mangled-3.c +@@ -4863,7 +4873,7 @@ + xettimeofday.gen.test + @ENABLE_STACKTRACE_FALSE@STACKTRACE_TESTS = + @ENABLE_STACKTRACE_TRUE@STACKTRACE_TESTS = strace-k.test \ +-@ENABLE_STACKTRACE_TRUE@ $(am__append_1) ++@ENABLE_STACKTRACE_TRUE@ strace-k-p.test $(am__append_1) + DECODER_TESTS = \ + bpf-success-v.test \ + bpf-success.test \ +@@ -5074,6 +5084,8 @@ + strace-ff.expected \ + strace-k-demangle.expected \ + strace-k-demangle.test \ ++ strace-k-p.expected \ ++ strace-k-p.test \ + strace-k.expected \ + strace-k.test \ + strace-r.expected \ +@@ -7345,6 +7357,10 @@ + @rm -f stack-fcall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stack_fcall_OBJECTS) $(stack_fcall_LDADD) $(LIBS) + ++stack-fcall-attach$(EXEEXT): $(stack_fcall_attach_OBJECTS) $(stack_fcall_attach_DEPENDENCIES) $(EXTRA_stack_fcall_attach_DEPENDENCIES) ++ @rm -f stack-fcall-attach$(EXEEXT) ++ $(AM_V_CCLD)$(LINK) $(stack_fcall_attach_OBJECTS) $(stack_fcall_attach_LDADD) $(LIBS) ++ + stack-fcall-mangled$(EXEEXT): $(stack_fcall_mangled_OBJECTS) $(stack_fcall_mangled_DEPENDENCIES) $(EXTRA_stack_fcall_mangled_DEPENDENCIES) + @rm -f stack-fcall-mangled$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stack_fcall_mangled_OBJECTS) $(stack_fcall_mangled_LDADD) $(LIBS) +@@ -8193,6 +8209,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-1.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-2.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-3.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-attach.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-0.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-1.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-2.Po@am__quote@ # am--include-marker +Index: strace-5.1/tests-m32/Makefile.am +=================================================================== +--- strace-5.1.orig/tests-m32/Makefile.am 2020-01-23 16:56:22.087268803 +0100 ++++ strace-5.1/tests-m32/Makefile.am 2020-01-23 17:03:50.790051150 +0100 +@@ -156,6 +156,7 @@ + signal_receive \ + sleep \ + stack-fcall \ ++ stack-fcall-attach \ + stack-fcall-mangled \ + threads-execve \ + unblock_reset_raise \ +@@ -198,6 +199,9 @@ + stack_fcall_SOURCES = stack-fcall.c \ + stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c + ++stack_fcall_attach_SOURCES = stack-fcall-attach.c \ ++ stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c ++ + stack_fcall_mangled_SOURCES = stack-fcall-mangled.c \ + stack-fcall-mangled-0.c stack-fcall-mangled-1.c \ + stack-fcall-mangled-2.c stack-fcall-mangled-3.c +@@ -205,7 +209,7 @@ + include gen_tests.am + + if ENABLE_STACKTRACE +-STACKTRACE_TESTS = strace-k.test ++STACKTRACE_TESTS = strace-k.test strace-k-p.test + if USE_DEMANGLE + STACKTRACE_TESTS += strace-k-demangle.test + endif +@@ -428,6 +432,8 @@ + strace-ff.expected \ + strace-k-demangle.expected \ + strace-k-demangle.test \ ++ strace-k-p.expected \ ++ strace-k-p.test \ + strace-k.expected \ + strace-k.test \ + strace-r.expected \ +Index: strace-5.1/tests-m32/Makefile.in +=================================================================== +--- strace-5.1.orig/tests-m32/Makefile.in 2020-01-23 16:56:22.089268805 +0100 ++++ strace-5.1/tests-m32/Makefile.in 2020-01-23 18:24:15.534972421 +0100 +@@ -144,9 +144,9 @@ + seccomp-strict$(EXEEXT) select-P$(EXEEXT) \ + set_ptracer_any$(EXEEXT) set_sigblock$(EXEEXT) \ + set_sigign$(EXEEXT) signal_receive$(EXEEXT) sleep$(EXEEXT) \ +- stack-fcall$(EXEEXT) stack-fcall-mangled$(EXEEXT) \ +- threads-execve$(EXEEXT) unblock_reset_raise$(EXEEXT) \ +- unix-pair-send-recv$(EXEEXT) \ ++ stack-fcall$(EXEEXT) stack-fcall-attach$(EXEEXT) \ ++ stack-fcall-mangled$(EXEEXT) threads-execve$(EXEEXT) \ ++ unblock_reset_raise$(EXEEXT) unix-pair-send-recv$(EXEEXT) \ + unix-pair-sendto-recvfrom$(EXEEXT) vfork-f$(EXEEXT) \ + wait4-v$(EXEEXT) waitid-v$(EXEEXT) zeroargc$(EXEEXT) + @ENABLE_STACKTRACE_TRUE@@USE_DEMANGLE_TRUE@am__append_1 = strace-k-demangle.test +@@ -2604,6 +2604,12 @@ + stack_fcall_OBJECTS = $(am_stack_fcall_OBJECTS) + stack_fcall_LDADD = $(LDADD) + stack_fcall_DEPENDENCIES = libtests.a ++am_stack_fcall_attach_OBJECTS = stack-fcall-attach.$(OBJEXT) \ ++ stack-fcall-0.$(OBJEXT) stack-fcall-1.$(OBJEXT) \ ++ stack-fcall-2.$(OBJEXT) stack-fcall-3.$(OBJEXT) ++stack_fcall_attach_OBJECTS = $(am_stack_fcall_attach_OBJECTS) ++stack_fcall_attach_LDADD = $(LDADD) ++stack_fcall_attach_DEPENDENCIES = libtests.a + am_stack_fcall_mangled_OBJECTS = stack-fcall-mangled.$(OBJEXT) \ + stack-fcall-mangled-0.$(OBJEXT) \ + stack-fcall-mangled-1.$(OBJEXT) \ +@@ -3453,7 +3459,7 @@ + sock_filter-v-Xverbose.c sockaddr_xlat-Xabbrev.c \ + sockaddr_xlat-Xraw.c sockaddr_xlat-Xverbose.c socketcall.c \ + sockopt-sol_netlink.c sockopt-timestamp.c splice.c \ +- $(stack_fcall_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ ++ $(stack_fcall_SOURCES) $(stack_fcall_attach_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ + stat64.c statfs.c statfs64.c statx.c swap.c sxetmask.c \ + symlink.c symlinkat.c sync.c sync_file_range.c \ + sync_file_range2.c sysinfo.c syslog.c tee.c threads-execve.c \ +@@ -3620,7 +3626,7 @@ + sock_filter-v-Xverbose.c sockaddr_xlat-Xabbrev.c \ + sockaddr_xlat-Xraw.c sockaddr_xlat-Xverbose.c socketcall.c \ + sockopt-sol_netlink.c sockopt-timestamp.c splice.c \ +- $(stack_fcall_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ ++ $(stack_fcall_SOURCES) $(stack_fcall_attach_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ + stat64.c statfs.c statfs64.c statx.c swap.c sxetmask.c \ + symlink.c symlinkat.c sync.c sync_file_range.c \ + sync_file_range2.c sysinfo.c syslog.c tee.c threads-execve.c \ +@@ -3848,7 +3854,8 @@ + bases=`echo $$bases` + RECHECK_LOGS = $(TEST_LOGS) + AM_RECURSIVE_TARGETS = check recheck +-@ENABLE_STACKTRACE_TRUE@am__EXEEXT_2 = strace-k.test $(am__append_1) ++@ENABLE_STACKTRACE_TRUE@am__EXEEXT_2 = strace-k.test strace-k-p.test \ ++@ENABLE_STACKTRACE_TRUE@ $(am__append_1) + TEST_SUITE_LOG = test-suite.log + TEST_EXTENSIONS = @EXEEXT@ .test + am__test_logs1 = $(TESTS:=.log) +@@ -4634,6 +4641,9 @@ + stack_fcall_SOURCES = stack-fcall.c \ + stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c + ++stack_fcall_attach_SOURCES = stack-fcall-attach.c \ ++ stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c ++ + stack_fcall_mangled_SOURCES = stack-fcall-mangled.c \ + stack-fcall-mangled-0.c stack-fcall-mangled-1.c \ + stack-fcall-mangled-2.c stack-fcall-mangled-3.c +@@ -4863,7 +4873,7 @@ + xettimeofday.gen.test + @ENABLE_STACKTRACE_FALSE@STACKTRACE_TESTS = + @ENABLE_STACKTRACE_TRUE@STACKTRACE_TESTS = strace-k.test \ +-@ENABLE_STACKTRACE_TRUE@ $(am__append_1) ++@ENABLE_STACKTRACE_TRUE@ strace-k-p.test $(am__append_1) + DECODER_TESTS = \ + bpf-success-v.test \ + bpf-success.test \ +@@ -5074,6 +5084,8 @@ + strace-ff.expected \ + strace-k-demangle.expected \ + strace-k-demangle.test \ ++ strace-k-p.expected \ ++ strace-k-p.test \ + strace-k.expected \ + strace-k.test \ + strace-r.expected \ +@@ -7345,6 +7357,10 @@ + @rm -f stack-fcall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stack_fcall_OBJECTS) $(stack_fcall_LDADD) $(LIBS) + ++stack-fcall-attach$(EXEEXT): $(stack_fcall_attach_OBJECTS) $(stack_fcall_attach_DEPENDENCIES) $(EXTRA_stack_fcall_attach_DEPENDENCIES) ++ @rm -f stack-fcall-attach$(EXEEXT) ++ $(AM_V_CCLD)$(LINK) $(stack_fcall_attach_OBJECTS) $(stack_fcall_attach_LDADD) $(LIBS) ++ + stack-fcall-mangled$(EXEEXT): $(stack_fcall_mangled_OBJECTS) $(stack_fcall_mangled_DEPENDENCIES) $(EXTRA_stack_fcall_mangled_DEPENDENCIES) + @rm -f stack-fcall-mangled$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stack_fcall_mangled_OBJECTS) $(stack_fcall_mangled_LDADD) $(LIBS) +@@ -8193,6 +8209,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-1.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-2.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-3.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-attach.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-0.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-1.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-2.Po@am__quote@ # am--include-marker +@@ -9777,6 +9794,7 @@ + -rm -f ./$(DEPDIR)/stack-fcall-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-2.Po + -rm -f ./$(DEPDIR)/stack-fcall-3.Po ++ -rm -f ./$(DEPDIR)/stack-fcall-attach.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-0.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-2.Po +@@ -10468,6 +10486,7 @@ + -rm -f ./$(DEPDIR)/stack-fcall-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-2.Po + -rm -f ./$(DEPDIR)/stack-fcall-3.Po ++ -rm -f ./$(DEPDIR)/stack-fcall-attach.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-0.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-2.Po +Index: strace-5.1/tests-mx32/Makefile.am +=================================================================== +--- strace-5.1.orig/tests-mx32/Makefile.am 2020-01-23 16:56:22.090268805 +0100 ++++ strace-5.1/tests-mx32/Makefile.am 2020-01-23 17:03:50.793051138 +0100 +@@ -156,6 +156,7 @@ + signal_receive \ + sleep \ + stack-fcall \ ++ stack-fcall-attach \ + stack-fcall-mangled \ + threads-execve \ + unblock_reset_raise \ +@@ -198,6 +199,9 @@ + stack_fcall_SOURCES = stack-fcall.c \ + stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c + ++stack_fcall_attach_SOURCES = stack-fcall-attach.c \ ++ stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c ++ + stack_fcall_mangled_SOURCES = stack-fcall-mangled.c \ + stack-fcall-mangled-0.c stack-fcall-mangled-1.c \ + stack-fcall-mangled-2.c stack-fcall-mangled-3.c +@@ -205,7 +209,7 @@ + include gen_tests.am + + if ENABLE_STACKTRACE +-STACKTRACE_TESTS = strace-k.test ++STACKTRACE_TESTS = strace-k.test strace-k-p.test + if USE_DEMANGLE + STACKTRACE_TESTS += strace-k-demangle.test + endif +@@ -428,6 +432,8 @@ + strace-ff.expected \ + strace-k-demangle.expected \ + strace-k-demangle.test \ ++ strace-k-p.expected \ ++ strace-k-p.test \ + strace-k.expected \ + strace-k.test \ + strace-r.expected \ +Index: strace-5.1/tests-mx32/Makefile.in +=================================================================== +--- strace-5.1.orig/tests-mx32/Makefile.in 2020-01-23 16:56:22.092268807 +0100 ++++ strace-5.1/tests-mx32/Makefile.in 2020-01-23 17:13:00.583709367 +0100 +@@ -144,9 +144,9 @@ + seccomp-strict$(EXEEXT) select-P$(EXEEXT) \ + set_ptracer_any$(EXEEXT) set_sigblock$(EXEEXT) \ + set_sigign$(EXEEXT) signal_receive$(EXEEXT) sleep$(EXEEXT) \ +- stack-fcall$(EXEEXT) stack-fcall-mangled$(EXEEXT) \ +- threads-execve$(EXEEXT) unblock_reset_raise$(EXEEXT) \ +- unix-pair-send-recv$(EXEEXT) \ ++ stack-fcall$(EXEEXT) stack-fcall-attach$(EXEEXT) \ ++ stack-fcall-mangled$(EXEEXT) threads-execve$(EXEEXT) \ ++ unblock_reset_raise$(EXEEXT) unix-pair-send-recv$(EXEEXT) \ + unix-pair-sendto-recvfrom$(EXEEXT) vfork-f$(EXEEXT) \ + wait4-v$(EXEEXT) waitid-v$(EXEEXT) zeroargc$(EXEEXT) + @ENABLE_STACKTRACE_TRUE@@USE_DEMANGLE_TRUE@am__append_1 = strace-k-demangle.test +@@ -2604,6 +2604,12 @@ + stack_fcall_OBJECTS = $(am_stack_fcall_OBJECTS) + stack_fcall_LDADD = $(LDADD) + stack_fcall_DEPENDENCIES = libtests.a ++am_stack_fcall_attach_OBJECTS = stack-fcall-attach.$(OBJEXT) \ ++ stack-fcall-0.$(OBJEXT) stack-fcall-1.$(OBJEXT) \ ++ stack-fcall-2.$(OBJEXT) stack-fcall-3.$(OBJEXT) ++stack_fcall_attach_OBJECTS = $(am_stack_fcall_attach_OBJECTS) ++stack_fcall_attach_LDADD = $(LDADD) ++stack_fcall_attach_DEPENDENCIES = libtests.a + am_stack_fcall_mangled_OBJECTS = stack-fcall-mangled.$(OBJEXT) \ + stack-fcall-mangled-0.$(OBJEXT) \ + stack-fcall-mangled-1.$(OBJEXT) \ +@@ -3453,7 +3459,7 @@ + sock_filter-v-Xverbose.c sockaddr_xlat-Xabbrev.c \ + sockaddr_xlat-Xraw.c sockaddr_xlat-Xverbose.c socketcall.c \ + sockopt-sol_netlink.c sockopt-timestamp.c splice.c \ +- $(stack_fcall_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ ++ $(stack_fcall_SOURCES) $(stack_fcall_attach_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ + stat64.c statfs.c statfs64.c statx.c swap.c sxetmask.c \ + symlink.c symlinkat.c sync.c sync_file_range.c \ + sync_file_range2.c sysinfo.c syslog.c tee.c threads-execve.c \ +@@ -3620,7 +3626,7 @@ + sock_filter-v-Xverbose.c sockaddr_xlat-Xabbrev.c \ + sockaddr_xlat-Xraw.c sockaddr_xlat-Xverbose.c socketcall.c \ + sockopt-sol_netlink.c sockopt-timestamp.c splice.c \ +- $(stack_fcall_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ ++ $(stack_fcall_SOURCES) $(stack_fcall_attach_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ + stat64.c statfs.c statfs64.c statx.c swap.c sxetmask.c \ + symlink.c symlinkat.c sync.c sync_file_range.c \ + sync_file_range2.c sysinfo.c syslog.c tee.c threads-execve.c \ +@@ -4634,6 +4640,10 @@ + stack_fcall_SOURCES = stack-fcall.c \ + stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c + ++stack_fcall_attach_SOURCES = stack-fcall-attach.c \ ++ stack-fcall-0.c stack-fcall-1.c \ ++ stack-fcall-2.c stack-fcall-3.c ++ + stack_fcall_mangled_SOURCES = stack-fcall-mangled.c \ + stack-fcall-mangled-0.c stack-fcall-mangled-1.c \ + stack-fcall-mangled-2.c stack-fcall-mangled-3.c +@@ -7345,6 +7355,10 @@ + @rm -f stack-fcall$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stack_fcall_OBJECTS) $(stack_fcall_LDADD) $(LIBS) + ++stack-fcall-attach$(EXEEXT): $(stack_fcall_attach_OBJECTS) $(stack_fcall_attach_DEPENDENCIES) $(EXTRA_stack_fcall_attach_DEPENDENCIES) ++ @rm -f stack-fcall$(EXEEXT) ++ $(AM_V_CCLD)$(LINK) $(stack_fcall_attach_OBJECTS) $(stack_fcall_attach_LDADD) $(LIBS) ++ + stack-fcall-mangled$(EXEEXT): $(stack_fcall_mangled_OBJECTS) $(stack_fcall_mangled_DEPENDENCIES) $(EXTRA_stack_fcall_mangled_DEPENDENCIES) + @rm -f stack-fcall-mangled$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stack_fcall_mangled_OBJECTS) $(stack_fcall_mangled_LDADD) $(LIBS) +@@ -8193,6 +8207,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-1.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-2.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-3.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-attach.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-0.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-1.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-2.Po@am__quote@ # am--include-marker +@@ -9777,6 +9792,7 @@ + -rm -f ./$(DEPDIR)/stack-fcall-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-2.Po + -rm -f ./$(DEPDIR)/stack-fcall-3.Po ++ -rm -f ./$(DEPDIR)/stack-fcall-attach.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-0.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-2.Po +@@ -10468,6 +10484,7 @@ + -rm -f ./$(DEPDIR)/stack-fcall-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-2.Po + -rm -f ./$(DEPDIR)/stack-fcall-3.Po ++ -rm -f ./$(DEPDIR)/stack-fcall-attach.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-0.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-2.Po +Index: strace-5.1/tests-m32/stack-fcall-attach.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ strace-5.1/tests-m32/stack-fcall-attach.c 2020-01-23 17:03:50.796051125 +0100 +@@ -0,0 +1,2 @@ ++#define ATTACH_MODE 1 ++#include "stack-fcall.c" +Index: strace-5.1/tests-m32/stack-fcall.c +=================================================================== +--- strace-5.1.orig/tests-m32/stack-fcall.c 2020-01-23 17:03:50.796051125 +0100 ++++ strace-5.1/tests-m32/stack-fcall.c 2020-01-23 17:08:04.027080020 +0100 +@@ -5,10 +5,21 @@ + * SPDX-License-Identifier: GPL-2.0-or-later + */ + ++#include "tests.h" ++#include + #include "stack-fcall.h" + ++#ifndef ATTACH_MODE ++# define ATTACH_MODE 0 ++#endif ++ + int main(void) + { ++#if ATTACH_MODE ++ /* sleep a bit to let the tracer time to catch up */ ++ sleep(1); ++#endif ++ + f0(0); + f0(1); + return 0; +Index: strace-5.1/tests-m32/strace-k-p.expected +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ strace-5.1/tests-m32/strace-k-p.expected 2020-01-23 17:14:16.083835372 +0100 +@@ -0,0 +1,2 @@ ++^chdir .*(__kernel_vsyscaln )?(__)?chdir f3 f2 f1 f0 main ++^SIGURG .*(__kernel_vsyscaln )?(__)?kill f3 f2 f1 f0 main +Index: strace-5.1/tests-m32/strace-k-p.test +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ strace-5.1/tests-m32/strace-k-p.test 2020-01-23 17:03:50.796051125 +0100 +@@ -0,0 +1,13 @@ ++#!/bin/sh ++# ++# Check strace -k for attached tracees. ++# ++# Copyright (c) 2020 The strace developers. ++# All rights reserved. ++# ++# SPDX-License-Identifier: GPL-2.0-or-later ++ ++ATTACH_MODE=1 ++test_prog=../stack-fcall-attach ++ ++. "${srcdir=.}"/strace-k.test +Index: strace-5.1/tests-m32/strace-k.test +=================================================================== +--- strace-5.1.orig/tests-m32/strace-k.test 2020-01-23 17:03:50.797051121 +0100 ++++ strace-5.1/tests-m32/strace-k.test 2020-01-23 17:13:44.509782677 +0100 +@@ -11,6 +11,8 @@ + + . "${srcdir=.}/init.sh" + ++: "${ATTACH_MODE=0}" ++ + # strace -k is implemented using /proc/$pid/maps + [ -f /proc/self/maps ] || + framework_skip_ '/proc/self/maps is not available' +@@ -20,7 +22,19 @@ + check_prog tr + + run_prog "${test_prog=../stack-fcall}" +-run_strace -e chdir -k $args ++if [ "x${ATTACH_MODE}" = "x1" ]; then ++ ../set_ptracer_any "${test_prog}" >> "$EXP" & ++ tracee_pid=$! ++ ++ while ! [ -s "$EXP" ]; do ++ kill -0 "$tracee_pid" 2> /dev/null || ++ fail_ 'set_ptracer_any failed' ++ done ++ ++ run_strace -e chdir -k -p "$tracee_pid" ++else ++ run_strace -e chdir -k $args ++fi + + expected="$srcdir/$NAME.expected" + awk ' +Index: strace-5.1/tests-mx32/stack-fcall-attach.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ strace-5.1/tests-mx32/stack-fcall-attach.c 2020-01-23 17:03:50.797051121 +0100 +@@ -0,0 +1,2 @@ ++#define ATTACH_MODE 1 ++#include "stack-fcall.c" +Index: strace-5.1/tests-mx32/stack-fcall.c +=================================================================== +--- strace-5.1.orig/tests-mx32/stack-fcall.c 2020-01-23 17:03:50.797051121 +0100 ++++ strace-5.1/tests-mx32/stack-fcall.c 2020-01-23 17:08:06.451072796 +0100 +@@ -5,10 +5,21 @@ + * SPDX-License-Identifier: GPL-2.0-or-later + */ + ++#include "tests.h" ++#include + #include "stack-fcall.h" + ++#ifndef ATTACH_MODE ++# define ATTACH_MODE 0 ++#endif ++ + int main(void) + { ++#if ATTACH_MODE ++ /* sleep a bit to let the tracer time to catch up */ ++ sleep(1); ++#endif ++ + f0(0); + f0(1); + return 0; +Index: strace-5.1/tests-mx32/strace-k-p.expected +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ strace-5.1/tests-mx32/strace-k-p.expected 2020-01-23 17:14:17.786838214 +0100 +@@ -0,0 +1,2 @@ ++^chdir .*(__kernel_vsyscaln )?(__)?chdir f3 f2 f1 f0 main ++^SIGURG .*(__kernel_vsyscaln )?(__)?kill f3 f2 f1 f0 main +Index: strace-5.1/tests-mx32/strace-k-p.test +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ strace-5.1/tests-mx32/strace-k-p.test 2020-01-23 17:03:50.797051121 +0100 +@@ -0,0 +1,13 @@ ++#!/bin/sh ++# ++# Check strace -k for attached tracees. ++# ++# Copyright (c) 2020 The strace developers. ++# All rights reserved. ++# ++# SPDX-License-Identifier: GPL-2.0-or-later ++ ++ATTACH_MODE=1 ++test_prog=../stack-fcall-attach ++ ++. "${srcdir=.}"/strace-k.test +Index: strace-5.1/tests-mx32/strace-k.test +=================================================================== +--- strace-5.1.orig/tests-mx32/strace-k.test 2020-01-23 17:03:50.797051121 +0100 ++++ strace-5.1/tests-mx32/strace-k.test 2020-01-23 17:13:41.793778144 +0100 +@@ -11,6 +11,8 @@ + + . "${srcdir=.}/init.sh" + ++: "${ATTACH_MODE=0}" ++ + # strace -k is implemented using /proc/$pid/maps + [ -f /proc/self/maps ] || + framework_skip_ '/proc/self/maps is not available' +@@ -20,7 +22,19 @@ + check_prog tr + + run_prog "${test_prog=../stack-fcall}" +-run_strace -e chdir -k $args ++if [ "x${ATTACH_MODE}" = "x1" ]; then ++ ../set_ptracer_any "${test_prog}" >> "$EXP" & ++ tracee_pid=$! ++ ++ while ! [ -s "$EXP" ]; do ++ kill -0 "$tracee_pid" 2> /dev/null || ++ fail_ 'set_ptracer_any failed' ++ done ++ ++ run_strace -e chdir -k -p "$tracee_pid" ++else ++ run_strace -e chdir -k $args ++fi + + expected="$srcdir/$NAME.expected" + awk ' diff --git a/SOURCES/0042-sockaddr-properly-decode-sockaddr_hci-addresses-with.patch b/SOURCES/0042-sockaddr-properly-decode-sockaddr_hci-addresses-with.patch new file mode 100644 index 0000000..f802107 --- /dev/null +++ b/SOURCES/0042-sockaddr-properly-decode-sockaddr_hci-addresses-with.patch @@ -0,0 +1,225 @@ +From 5a9b0f1ef83300f853e77ada03515c8542c1cfe0 Mon Sep 17 00:00:00 2001 +From: Eugene Syromyatnikov +Date: Thu, 29 Aug 2019 19:03:51 +0200 +Subject: [PATCH] sockaddr: properly decode sockaddr_hci addresses without + hci_channel + +Before Linux commit v2.6.38-rc1~476^2~14^2~3^2~43^2~9, +struct sockaddr_hci did not contain hci_channel field. + +* configure.ac (AC_CHECK_HEADERS([bluetooth/bluetooth.h])): Add check +for struct sockaddr_hci.hci_channel. +* sockaddr.c (print_sockaddr_data_bt): Decode struct sockaddr_hci +without hci_channel field. +* tests/net-sockaddr.c (check_hci): Add check for struct sockaddr_hci +decoding without hci_channel field; guard hci_channel with #ifdef +HAVE_STRUCT_SOCKADDR_HCI_HCI_CHANNEL. +(check_raw): Remove "len++", as 4-byte AF_BLUETOOTH socket addresses are +interpreted as struct sockaddr_hci without hci_channel field. +--- + configure.ac | 3 +++ + sockaddr.c | 16 +++++++++++++--- + tests/net-sockaddr.c | 18 ++++++++++++++---- + 3 files changed, 30 insertions(+), 7 deletions(-) + +Index: strace-5.1/configure.ac +=================================================================== +--- strace-5.1.orig/configure.ac 2019-08-29 19:10:22.380362280 +0200 ++++ strace-5.1/configure.ac 2019-08-29 19:11:11.240744864 +0200 +@@ -465,6 +465,9 @@ + ]) + + AC_CHECK_HEADERS([bluetooth/bluetooth.h], [ ++ AC_CHECK_MEMBERS([struct sockaddr_hci.hci_channel],,, ++ [#include ++ #include ]) + AC_CHECK_MEMBERS([struct sockaddr_l2.l2_bdaddr_type],,, + [#include + #include ]) +Index: strace-5.1/sockaddr.c +=================================================================== +--- strace-5.1.orig/sockaddr.c 2019-08-29 19:11:11.240744864 +0200 ++++ strace-5.1/sockaddr.c 2019-08-29 19:13:01.275354429 +0200 +@@ -599,12 +599,21 @@ + }; + + switch (addrlen) { ++ case offsetofend(struct sockaddr_hci, hci_dev): + case sizeof(struct sockaddr_hci): { + const struct sockaddr_hci *const hci = buf; +- tprintf("hci_dev=htobs(%hu), hci_channel=", +- btohs(hci->hci_dev)); +- printxval_index(hci_channels, hci->hci_channel, +- "HCI_CHANNEL_???"); ++ tprintf("hci_dev=htobs(%hu)", btohs(hci->hci_dev)); ++ ++ /* ++ * hci_channel field has been introduced ++ * Linux commit in v2.6.38-rc1~476^2~14^2~3^2~43^2~9. ++ */ ++ if (addrlen == sizeof(struct sockaddr_hci)) { ++ tprints(", hci_channel="); ++ printxval_index(hci_channels, hci->hci_channel, ++ "HCI_CHANNEL_???"); ++ } ++ + break; + } + case sizeof(struct sockaddr_sco): { +Index: strace-5.1/tests/net-sockaddr.c +=================================================================== +--- strace-5.1.orig/tests/net-sockaddr.c 2019-08-29 19:10:22.380362280 +0200 ++++ strace-5.1/tests/net-sockaddr.c 2019-08-29 19:11:11.240744864 +0200 +@@ -543,11 +543,22 @@ + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_hci, hci); + hci->hci_family = AF_BLUETOOTH; + hci->hci_dev = htobs(h_port); ++# ifdef HAVE_STRUCT_SOCKADDR_HCI_HCI_CHANNEL + hci->hci_channel = HCI_CHANNEL_RAW; ++# endif + unsigned int len = sizeof(*hci); +- int ret = connect(-1, (void *) hci, len); ++ ++ int ret = connect(-1, (void *) hci, 4); ++ printf("connect(-1, {sa_family=AF_BLUETOOTH, hci_dev=htobs(%hu)" ++ "}, 4) = %d EBADF (%m)\n", ++ h_port, ret); ++ ++ ret = connect(-1, (void *) hci, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH, hci_dev=htobs(%hu)" +- ", hci_channel=HCI_CHANNEL_RAW}, %u) = %d EBADF (%m)\n", ++# ifdef HAVE_STRUCT_SOCKADDR_HCI_HCI_CHANNEL ++ ", hci_channel=HCI_CHANNEL_RAW" ++# endif ++ "}, %u) = %d EBADF (%m)\n", + h_port, len, ret); + } + +@@ -700,9 +711,8 @@ + " = %d EBADF (%m)\n", len, ret); + + u.sa->sa_family = AF_BLUETOOTH; +- ++len; + ret = connect(-1, (void *) u.st, len); +- printf("connect(-1, {sa_family=AF_BLUETOOTH, sa_data=\"00\"}, %u)" ++ printf("connect(-1, {sa_family=AF_BLUETOOTH, sa_data=\"0\"}, %u)" + " = %d EBADF (%m)\n", len, ret); + } + +Index: strace-5.1/tests-m32/net-sockaddr.c +=================================================================== +--- strace-5.1.orig/tests-m32/net-sockaddr.c 2019-03-18 03:40:16.000000000 +0100 ++++ strace-5.1/tests-m32/net-sockaddr.c 2019-08-29 19:16:28.327738043 +0200 +@@ -543,11 +543,22 @@ + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_hci, hci); + hci->hci_family = AF_BLUETOOTH; + hci->hci_dev = htobs(h_port); ++# ifdef HAVE_STRUCT_SOCKADDR_HCI_HCI_CHANNEL + hci->hci_channel = HCI_CHANNEL_RAW; ++# endif + unsigned int len = sizeof(*hci); +- int ret = connect(-1, (void *) hci, len); ++ ++ int ret = connect(-1, (void *) hci, 4); ++ printf("connect(-1, {sa_family=AF_BLUETOOTH, hci_dev=htobs(%hu)" ++ "}, 4) = %d EBADF (%m)\n", ++ h_port, ret); ++ ++ ret = connect(-1, (void *) hci, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH, hci_dev=htobs(%hu)" +- ", hci_channel=HCI_CHANNEL_RAW}, %u) = %d EBADF (%m)\n", ++# ifdef HAVE_STRUCT_SOCKADDR_HCI_HCI_CHANNEL ++ ", hci_channel=HCI_CHANNEL_RAW" ++# endif ++ "}, %u) = %d EBADF (%m)\n", + h_port, len, ret); + } + +@@ -700,9 +711,8 @@ + " = %d EBADF (%m)\n", len, ret); + + u.sa->sa_family = AF_BLUETOOTH; +- ++len; + ret = connect(-1, (void *) u.st, len); +- printf("connect(-1, {sa_family=AF_BLUETOOTH, sa_data=\"00\"}, %u)" ++ printf("connect(-1, {sa_family=AF_BLUETOOTH, sa_data=\"0\"}, %u)" + " = %d EBADF (%m)\n", len, ret); + } + +Index: strace-5.1/tests-mx32/net-sockaddr.c +=================================================================== +--- strace-5.1.orig/tests-mx32/net-sockaddr.c 2019-03-18 03:40:16.000000000 +0100 ++++ strace-5.1/tests-mx32/net-sockaddr.c 2019-08-29 19:16:30.805706731 +0200 +@@ -543,11 +543,22 @@ + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_hci, hci); + hci->hci_family = AF_BLUETOOTH; + hci->hci_dev = htobs(h_port); ++# ifdef HAVE_STRUCT_SOCKADDR_HCI_HCI_CHANNEL + hci->hci_channel = HCI_CHANNEL_RAW; ++# endif + unsigned int len = sizeof(*hci); +- int ret = connect(-1, (void *) hci, len); ++ ++ int ret = connect(-1, (void *) hci, 4); ++ printf("connect(-1, {sa_family=AF_BLUETOOTH, hci_dev=htobs(%hu)" ++ "}, 4) = %d EBADF (%m)\n", ++ h_port, ret); ++ ++ ret = connect(-1, (void *) hci, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH, hci_dev=htobs(%hu)" +- ", hci_channel=HCI_CHANNEL_RAW}, %u) = %d EBADF (%m)\n", ++# ifdef HAVE_STRUCT_SOCKADDR_HCI_HCI_CHANNEL ++ ", hci_channel=HCI_CHANNEL_RAW" ++# endif ++ "}, %u) = %d EBADF (%m)\n", + h_port, len, ret); + } + +@@ -700,9 +711,8 @@ + " = %d EBADF (%m)\n", len, ret); + + u.sa->sa_family = AF_BLUETOOTH; +- ++len; + ret = connect(-1, (void *) u.st, len); +- printf("connect(-1, {sa_family=AF_BLUETOOTH, sa_data=\"00\"}, %u)" ++ printf("connect(-1, {sa_family=AF_BLUETOOTH, sa_data=\"0\"}, %u)" + " = %d EBADF (%m)\n", len, ret); + } + +Index: strace-5.1/configure +=================================================================== +--- strace-5.1.orig/configure 2019-08-30 17:41:22.748513960 +0200 ++++ strace-5.1/configure 2019-08-30 17:41:43.118251704 +0200 +@@ -12037,6 +12037,18 @@ + #define HAVE_BLUETOOTH_BLUETOOTH_H 1 + _ACEOF + ++ ac_fn_c_check_member "$LINENO" "struct sockaddr_hci" "hci_channel" "ac_cv_member_struct_sockaddr_hci_hci_channel" "#include ++ #include ++" ++if test "x$ac_cv_member_struct_sockaddr_hci_hci_channel" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_SOCKADDR_HCI_HCI_CHANNEL 1 ++_ACEOF ++ ++ ++fi ++ + ac_fn_c_check_member "$LINENO" "struct sockaddr_l2" "l2_bdaddr_type" "ac_cv_member_struct_sockaddr_l2_l2_bdaddr_type" "#include + #include + " +Index: strace-5.1/config.h.in +=================================================================== +--- strace-5.1.orig/config.h.in 2019-05-22 15:08:39.000000000 +0200 ++++ strace-5.1/config.h.in 2019-08-30 18:32:25.431500194 +0200 +@@ -1391,6 +1391,9 @@ + /* Define to 1 if the system has the type `struct sigcontext'. */ + #undef HAVE_STRUCT_SIGCONTEXT + ++/* Define to 1 if `hci_channel' is a member of `struct sockaddr_hci'. */ ++#undef HAVE_STRUCT_SOCKADDR_HCI_HCI_CHANNEL ++ + /* Define to 1 if `l2_bdaddr_type' is a member of `struct sockaddr_l2'. */ + #undef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + diff --git a/SOURCES/0043-tests-fix-expected-output-for-some-ipc-tests.patch b/SOURCES/0043-tests-fix-expected-output-for-some-ipc-tests.patch new file mode 100644 index 0000000..a05241d --- /dev/null +++ b/SOURCES/0043-tests-fix-expected-output-for-some-ipc-tests.patch @@ -0,0 +1,90 @@ +From 4377e3a1535a0ec3a42da8a1366ad6943f4efa0e Mon Sep 17 00:00:00 2001 +From: "Dmitry V. Levin" +Date: Sun, 4 Aug 2019 08:47:00 +0000 +Subject: [PATCH] tests: fix expected output for some ipc tests + +* tests/gen_tests.in (ipc_msgbuf-Xraw, ipc_shm, ipc_shm-Xabbrev, +ipc_shm-Xverbose): Adjust -a argument. +--- +Backport changes: + * tests/gen_tests.in change is copied over to tests-m32/gen_tests.in + and tests-m32/gen_tests.in +--- + tests/gen_tests.in | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +Index: strace-4.24/tests/gen_tests.in +=================================================================== +--- strace-4.24.orig/tests/gen_tests.in 2020-01-27 18:21:22.896068950 +0100 ++++ strace-4.24/tests/gen_tests.in 2020-01-27 18:21:42.169892032 +0100 +@@ -147,16 +147,16 @@ + ipc_msg-Xraw +ipc.sh -Xraw -a16 + ipc_msg-Xverbose +ipc.sh -Xverbose -a34 + ipc_msgbuf-Xabbrev +ipc_msgbuf.test -Xabbrev +-ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a22 ++ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a20 + ipc_msgbuf-Xverbose +ipc_msgbuf.test -Xverbose + ipc_sem +ipc.sh -a29 + ipc_sem-Xabbrev +ipc.sh -Xabbrev -a29 + ipc_sem-Xraw +ipc.sh -Xraw -a19 + ipc_sem-Xverbose +ipc.sh -Xverbose -a36 +-ipc_shm +ipc.sh -a29 +-ipc_shm-Xabbrev +ipc.sh -Xabbrev -a29 ++ipc_shm +ipc.sh -a26 ++ipc_shm-Xabbrev +ipc.sh -Xabbrev -a26 + ipc_shm-Xraw +ipc.sh -Xraw -a19 +-ipc_shm-Xverbose +ipc.sh -Xverbose -a36 ++ipc_shm-Xverbose +ipc.sh -Xverbose -a34 + kcmp -a22 + kcmp-y -a22 -y -e trace=kcmp + kern_features -a16 +Index: strace-4.24/tests-m32/gen_tests.in +=================================================================== +--- strace-4.24.orig/tests-m32/gen_tests.in 2020-01-27 18:21:36.149947290 +0100 ++++ strace-4.24/tests-m32/gen_tests.in 2020-01-27 18:38:00.954898561 +0100 +@@ -147,16 +147,16 @@ + ipc_msg-Xraw +ipc.sh -Xraw -a16 + ipc_msg-Xverbose +ipc.sh -Xverbose -a34 + ipc_msgbuf-Xabbrev +ipc_msgbuf.test -Xabbrev +-ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a22 ++ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a20 + ipc_msgbuf-Xverbose +ipc_msgbuf.test -Xverbose + ipc_sem +ipc.sh -a29 + ipc_sem-Xabbrev +ipc.sh -Xabbrev -a29 + ipc_sem-Xraw +ipc.sh -Xraw -a19 + ipc_sem-Xverbose +ipc.sh -Xverbose -a36 +-ipc_shm +ipc.sh -a29 +-ipc_shm-Xabbrev +ipc.sh -Xabbrev -a29 ++ipc_shm +ipc.sh -a26 ++ipc_shm-Xabbrev +ipc.sh -Xabbrev -a26 + ipc_shm-Xraw +ipc.sh -Xraw -a19 +-ipc_shm-Xverbose +ipc.sh -Xverbose -a36 ++ipc_shm-Xverbose +ipc.sh -Xverbose -a34 + kcmp -a22 + kcmp-y -a22 -y -e trace=kcmp + kern_features -a16 +Index: strace-4.24/tests-mx32/gen_tests.in +=================================================================== +--- strace-4.24.orig/tests-mx32/gen_tests.in 2020-01-27 18:21:37.445935394 +0100 ++++ strace-4.24/tests-mx32/gen_tests.in 2020-01-27 18:37:59.481911731 +0100 +@@ -147,16 +147,16 @@ + ipc_msg-Xraw +ipc.sh -Xraw -a16 + ipc_msg-Xverbose +ipc.sh -Xverbose -a34 + ipc_msgbuf-Xabbrev +ipc_msgbuf.test -Xabbrev +-ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a22 ++ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a20 + ipc_msgbuf-Xverbose +ipc_msgbuf.test -Xverbose + ipc_sem +ipc.sh -a29 + ipc_sem-Xabbrev +ipc.sh -Xabbrev -a29 + ipc_sem-Xraw +ipc.sh -Xraw -a19 + ipc_sem-Xverbose +ipc.sh -Xverbose -a36 +-ipc_shm +ipc.sh -a29 +-ipc_shm-Xabbrev +ipc.sh -Xabbrev -a29 ++ipc_shm +ipc.sh -a26 ++ipc_shm-Xabbrev +ipc.sh -Xabbrev -a26 + ipc_shm-Xraw +ipc.sh -Xraw -a19 +-ipc_shm-Xverbose +ipc.sh -Xverbose -a36 ++ipc_shm-Xverbose +ipc.sh -Xverbose -a34 + kcmp -a22 + kcmp-y -a22 -y -e trace=kcmp + kern_features -a16 diff --git a/SOURCES/0044-tests-fix-a-argument-in-ipc_msgbuf-Xraw-test.patch b/SOURCES/0044-tests-fix-a-argument-in-ipc_msgbuf-Xraw-test.patch new file mode 100644 index 0000000..3ce20d2 --- /dev/null +++ b/SOURCES/0044-tests-fix-a-argument-in-ipc_msgbuf-Xraw-test.patch @@ -0,0 +1,53 @@ +From a75c7c4bcb6b48680275de3e99e17e0ebec811ec Mon Sep 17 00:00:00 2001 +From: "Dmitry V. Levin" +Date: Thu, 7 Nov 2019 19:58:36 +0000 +Subject: [PATCH] tests: fix -a argument in ipc_msgbuf-Xraw test + +* tests/gen_tests.in (ipc_msgbuf-Xraw): Change -a argument from 20 to 19. +--- +Backport change: + * tests/gen_tests.in change has been copied over to tests-m32/gen_tests.in + and tests-mx32/gen_tests.in. +--- + tests/gen_tests.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: strace-4.24/tests/gen_tests.in +=================================================================== +--- strace-4.24.orig/tests/gen_tests.in 2020-01-27 18:21:42.169892032 +0100 ++++ strace-4.24/tests/gen_tests.in 2020-01-27 18:38:14.935773561 +0100 +@@ -147,7 +147,7 @@ + ipc_msg-Xraw +ipc.sh -Xraw -a16 + ipc_msg-Xverbose +ipc.sh -Xverbose -a34 + ipc_msgbuf-Xabbrev +ipc_msgbuf.test -Xabbrev +-ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a20 ++ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a19 + ipc_msgbuf-Xverbose +ipc_msgbuf.test -Xverbose + ipc_sem +ipc.sh -a29 + ipc_sem-Xabbrev +ipc.sh -Xabbrev -a29 +Index: strace-4.24/tests-m32/gen_tests.in +=================================================================== +--- strace-4.24.orig/tests-m32/gen_tests.in 2020-01-27 18:38:00.954898561 +0100 ++++ strace-4.24/tests-m32/gen_tests.in 2020-01-27 18:38:23.407697816 +0100 +@@ -147,7 +147,7 @@ + ipc_msg-Xraw +ipc.sh -Xraw -a16 + ipc_msg-Xverbose +ipc.sh -Xverbose -a34 + ipc_msgbuf-Xabbrev +ipc_msgbuf.test -Xabbrev +-ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a20 ++ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a19 + ipc_msgbuf-Xverbose +ipc_msgbuf.test -Xverbose + ipc_sem +ipc.sh -a29 + ipc_sem-Xabbrev +ipc.sh -Xabbrev -a29 +Index: strace-4.24/tests-mx32/gen_tests.in +=================================================================== +--- strace-4.24.orig/tests-mx32/gen_tests.in 2020-01-27 18:37:59.481911731 +0100 ++++ strace-4.24/tests-mx32/gen_tests.in 2020-01-27 18:38:24.645686747 +0100 +@@ -147,7 +147,7 @@ + ipc_msg-Xraw +ipc.sh -Xraw -a16 + ipc_msg-Xverbose +ipc.sh -Xverbose -a34 + ipc_msgbuf-Xabbrev +ipc_msgbuf.test -Xabbrev +-ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a20 ++ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a19 + ipc_msgbuf-Xverbose +ipc_msgbuf.test -Xverbose + ipc_sem +ipc.sh -a29 + ipc_sem-Xabbrev +ipc.sh -Xabbrev -a29 diff --git a/SOURCES/0201-limit-qual_fault-scope-on-aarch64.patch b/SOURCES/0201-limit-qual_fault-scope-on-aarch64.patch new file mode 100644 index 0000000..30df75a --- /dev/null +++ b/SOURCES/0201-limit-qual_fault-scope-on-aarch64.patch @@ -0,0 +1,39 @@ +Index: strace-5.1/tests/qual_fault.test +=================================================================== +--- strace-5.1.orig/tests/qual_fault.test 2018-12-10 01:00:00.000000000 +0100 ++++ strace-5.1/tests/qual_fault.test 2019-06-13 16:59:58.498626547 +0200 +@@ -75,18 +75,31 @@ + done + } + +-for err in '' ENOSYS 22 einval; do ++case "$STRACE_ARCH" in ++ aarch64) ++ ERRS='EnoSys 22' ++ NUMBERS1='2' ++ NUMBERS2='3' ++ ;; ++ *) ++ ERRS='ENOSYS 22 einval' ++ NUMBERS1='1 2 3 5 7 11' ++ NUMBERS2='1 2 3 5 7 11' ++ ;; ++esac ++ ++for err in '' $(echo $ERRS); do + for fault in writev desc,51; do + check_fault_injection \ + writev $fault "$err" '' '' 1 -efault=chdir + check_fault_injection \ + writev $fault "$err" '' '' 1 -efault=chdir -efault=none +- for F in 1 2 3 5 7 11; do ++ for F in $(echo $NUMBERS1); do + check_fault_injection \ + writev $fault "$err" $F '' 1 + check_fault_injection \ + writev $fault "$err" $F + 1 +- for S in 1 2 3 5 7 11; do ++ for S in $(echo $NUMBERS2); do + check_fault_injection \ + writev $fault "$err" $F $S 1 + check_fault_injection \ diff --git a/SPECS/strace.spec b/SPECS/strace.spec new file mode 100644 index 0000000..f443491 --- /dev/null +++ b/SPECS/strace.spec @@ -0,0 +1,718 @@ +%define __python /opt/rh/gcc-toolset-9/root/usr/bin/python3 +%{?scl:%{?scl_package:%scl_package strace}} + +Summary: Tracks and displays system calls associated with a running process +Name: %{?scl_prefix}strace +Version: 5.1 +Release: 6%{?dist} +# The test suite is GPLv2+, all the rest is LGPLv2.1+. +License: LGPL-2.1+ and GPL-2.0+ +Group: Development/Debuggers +URL: https://strace.io +Source: https://strace.io/files/%{version}/strace-%{version}.tar.xz + +%define alternatives_cmd %{!?scl:%{_sbindir}}%{?scl:%{_root_sbindir}}/alternatives +%define alternatives_cmdline %{alternatives_cmd}%{?scl: --altdir %{_sysconfdir}/alternatives --admindir %{_scl_root}/var/lib/alternatives} + +BuildRequires: libacl-devel, time +%{?scl:Requires:%scl_runtime} + +BuildRequires: gcc gzip + +# Install Bluetooth headers for AF_BLUETOOTH sockets decoding. +%if 0%{?fedora} >= 18 || 0%{?centos} >= 8 || 0%{?rhel} >= 8 || 0%{?suse_version} >= 1200 +BuildRequires: pkgconfig(bluez) +%endif + +BuildRequires: %{?scl_prefix}elfutils-devel, %{?scl_prefix}binutils-devel +%{?!buildroot:BuildRoot: %_tmppath/buildroot-%name-%version-%release} + +# OBS compatibility +%{?!buildroot:BuildRoot: %_tmppath/buildroot-%name-%version-%release} +%define maybe_use_defattr %{?suse_version:%%defattr(-,root,root)} + +## Reported by covscan +# v5.2-3-g7ada13f "evdev: avoid bit vector decoding on non-successful and 0 return codes" +Patch30: 0030-evdev-avoid-bit-vector-decoding-on-non-successful-an.patch +# v5.2-4-g96194ed "evdev: fix array size calculation in decode_bitset_" +Patch31: 0031-evdev-fix-array-size-calculation-in-decode_bitset_.patch + +## Test for patches "evdev: avoid bit vector decoding on non-successful and 0 +## return codes" and "evdev: fix array size calculation in decode_bitset_" +# v5.2-5-gcdd8206 "tests: test evdev bitset decoding more thoroughly" +Patch33: 0033-tests-test-evdev-bitset-decoding-more-thoroughly.patch + +## Reported by covscan (https://bugzilla.redhat.com/1747524 +## https://bugzilla.redhat.com/1747526 https://bugzilla.redhat.com/1747530) +# v5.2-84-g91281fec "v4l2: avoid shifting left a signed number by 31 bit" +Patch35: 0035-v4l2-avoid-shifting-left-a-signed-number-by-31-bit.patch +# v5.2~21 "syscall.c: avoid infinite loop in subcalls parsing" +Patch36: 0036-syscall.c-avoid-infinite-loop-in-subcalls-parsing.patch +# v5.2~19 "kvm: avoid bogus vcpu_info assignment in vcpu_register" +Patch37: 0037-kvm-avoid-bogus-vcpu_info-assignment-in-vcpu_registe.patch +# v5.4~97 "xlat: use unsgined type for mount_flags fallback values" +Patch38: 0038-xlat-use-unsgined-type-for-mount_flags-fallback-valu.patch + +## Missing stack traces on attach (https://bugzilla.redhat.com/1788636) +## RHEL 7: https://bugzilla.redhat.com/1790052 +## RHEL 8: https://bugzilla.redhat.com/1790053 +## RHEL 6 DTS: https://bugzilla.redhat.com/1790058 +## RHEL 7 DTS: https://bugzilla.redhat.com/1790057 +## RHEL 8 DTS: https://bugzilla.redhat.com/1790054 +# v5.4-18-g69b2c33 "unwind-libdw: fix initialization of libdwfl cache" +Patch39: 0039-unwind-libdw-fix-initialization-of-libdwfl-cache.patch +# v5.4-27-g35e080a "syscall: do not capture stack trace while the tracee executes strace code" +Patch40: 0040-syscall-do-not-capture-stack-trace-while-the-tracee-.patch +# v5.4-63-g8e515c7 "tests: add strace-k-p test" +Patch41: 0041-tests-add-strace-k-p-test.patch + +## https://bugzilla.redhat.com/1746885 +# v5.2-92-gc108f0b "sockaddr: properly decode sockaddr_hci addresses without hci_channel" +Patch42: 0042-sockaddr-properly-decode-sockaddr_hci-addresses-with.patch + +## Some ipc tests from strace internal testsuite occasionally fail +## https://bugzilla.redhat.com/1795251 https://bugzilla.redhat.com/1795261 +## https://bugzilla.redhat.com/1794490 https://bugzilla.redhat.com/1795273 +# v5.3~102 "tests: fix expected output for some ipc tests" +Patch43: 0043-tests-fix-expected-output-for-some-ipc-tests.patch +# v5.4~49 "tests: fix -a argument in ipc_msgbuf-Xraw test" +Patch44: 0044-tests-fix-a-argument-in-ipc_msgbuf-Xraw-test.patch + +## RHEL-only: aarch64 brew builders are extremely slow on qual_fault.test +Patch201: 0201-limit-qual_fault-scope-on-aarch64.patch + + +%description +The strace program intercepts and records the system calls called and +received by a running process. Strace can print a record of each +system call, its arguments and its return value. Strace is useful for +diagnosing problems and debugging, as well as for instructional +purposes. + +Install strace if you need a tool to track the system calls made and +received by a process. + +%prep +%setup -q -n strace-%{version} + +%patch30 -p1 +%patch31 -p1 +%patch33 -p1 +%patch35 -p1 +%patch36 -p1 +%patch37 -p1 +%patch38 -p1 +%patch39 -p1 +%patch40 -p1 +%patch41 -p1 +%patch42 -p1 +%patch43 -p1 +%patch44 -p1 + +%patch201 -p1 + +chmod a+x tests/*.test + +echo -n %version-%release > .tarball-version +echo -n 2019 > .year +echo -n 2019-06-13 > .strace.1.in.date + +%build +echo 'BEGIN OF BUILD ENVIRONMENT INFORMATION' +uname -a |head -1 +libc="$(ldd /bin/sh |sed -n 's|^[^/]*\(/[^ ]*/libc\.so[^ ]*\).*|\1|p' |head -1)" +$libc |head -1 +file -L /bin/sh +gcc --version |head -1 +ld --version |head -1 +kver="$(printf '%%s\n%%s\n' '#include ' 'LINUX_VERSION_CODE' | gcc -E -P -)" +printf 'kernel-headers %%s.%%s.%%s\n' $(($kver/65536)) $(($kver/256%%256)) $(($kver%%256)) +echo 'END OF BUILD ENVIRONMENT INFORMATION' + +LDFLAGS="$RPM_LD_FLAGS -L%{_libdir} -L%{_libdir}/elfutils" +export LDLFAGS + +# -DHAVE_S390_COMPAT_REGS is needed due to lack of v3.10-rc1~201^2~11 +CFLAGS="$RPM_OPT_FLAGS $LDFLAGS" +# Removing explicit -m64 as it breaks mpers +[ "x${CFLAGS#*-m64}" = "x${CFLAGS}" ] || CFLAGS=$(echo "$CFLAGS" | sed 's/-m64//g') +export CFLAGS + +CPPFLAGS="-I%{_includedir} %{optflags}" +# Removing explicit -m64 as it breaks mpers +[ "x${CPPFLAGS#*-m64}" = "x${CPPFLAGS}" ] || CPPFLAGS=$(echo "$CPPFLAGS" | sed 's/-m64//g') +export CPPFLAGS + +CFLAGS_FOR_BUILD="$RPM_OPT_FLAGS"; export CFLAGS_FOR_BUILD +%configure --enable-mpers=check --with-libdw +make %{?_smp_mflags} + +%install +make DESTDIR=%{buildroot} install + +# remove unpackaged files from the buildroot +rm -f %{buildroot}%{_bindir}/strace-graph + +# some say uncompressed changelog files are too big +for f in ChangeLog ChangeLog-CVS; do + gzip -9n < "$f" > "$f".gz & +done +wait + +%check +%{buildroot}%{_bindir}/strace -V + +make -j2 -k check VERBOSE=1 TIMEOUT_DURATION=5400 +echo 'BEGIN OF TEST SUITE INFORMATION' +tail -n 99999 -- tests*/test-suite.log tests*/ksysent.log +find tests* -type f -name '*.log' -print0 | + xargs -r0 grep -H '^KERNEL BUG:' -- ||: +echo 'END OF TEST SUITE INFORMATION' + +%files +%maybe_use_defattr +%doc CREDITS ChangeLog.gz ChangeLog-CVS.gz COPYING LGPL-2.1-or-later NEWS README +%{_bindir}/strace +%{_bindir}/strace-log-merge +%{_mandir}/man1/* + +%changelog +* Mon Jan 27 2020 Eugene Syromiatnikov - 5.1-6 +- Fix expected alignment for IPC tests (#1794490): + 4377e3a1 "tests: fix expected output for some ipc tests", and + a75c7c4b "tests: fix -a argument in ipc_msgbuf-Xraw test". + +* Thu Jan 23 2020 Eugene Syromiatnikov - 5.1-5 +- Fix printing stack traces for early syscalls on process attach (#1790054): + 69b2c33a "unwind-libdw: fix initialization of libdwfl cache", + 35e080ae "syscall: do not capture stack trace while the tracee executes + strace code", and + 8e515c74 "tests: add strace-k-p test". +- Properly decode struct sockaddr_hci without hci_channel field. + +* Fri Jan 03 2020 Eugene Syromiatnikov - 5.1-4 +- Pull upstream fix for ioctl evdev bitset decoding, fix the tests (#1747213). +- Include upstream patches that fix issues reported by covscan (#1747530): + 91281fec "v4l2: avoid shifting left a signed number by 31 bit", + 522ad3a0 "syscall.c: avoid infinite loop in subcalls parsing", + 9446038e "kvm: avoid bogus vcpu_info assignment in vcpu_register", and + 2b64854e "xlat: use unsgined type for mount_flags fallback values". + +* Fri Jun 14 2019 Eugene Syromiatnikov - 5.1-3 +- Use SPDX abbreviations for licenses. +- Add library directories to existing LDFLAGS and not override them. + +* Thu Jun 13 2019 Eugene Syromiatnikov - 5.1-2 +- Add SCL macros (#1685491). + +* Wed May 22 2019 Dmitry V. Levin - 5.1-1 +- v5.0 -> v5.1. + +* Tue Mar 19 2019 Dmitry V. Levin - 5.0-1 +- v4.26 -> v5.0 (resolves: #478419, #526740, #851457, #1609318, + #1610774, #1662936, #1676045). + +* Wed Dec 26 2018 Dmitry V. Levin - 4.26-1 +- v4.25 -> v4.26. + +* Tue Oct 30 2018 Dmitry V. Levin - 4.25-1 +- v4.24 -> v4.25. + +* Tue Aug 14 2018 Dmitry V. Levin - 4.24-1 +- v4.23 -> v4.24. + +* Thu Jun 14 2018 Dmitry V. Levin - 4.23-1 +- v4.22 -> v4.23. +- Enabled libdw backend for -k option (#1568647). + +* Thu Apr 05 2018 Dmitry V. Levin - 4.22-1 +- v4.21 -> v4.22. + +* Tue Feb 13 2018 Dmitry V. Levin - 4.21-1 +- v4.20 -> v4.21. + +* Mon Nov 13 2017 Dmitry V. Levin - 4.20-1 +- v4.19 -> v4.20. + +* Tue Sep 05 2017 Dmitry V. Levin - 4.19-1 +- v4.18 -> v4.19. + +* Wed Jul 05 2017 Dmitry V. Levin - 4.18-1 +- v4.17 -> v4.18. + +* Wed May 24 2017 Dmitry V. Levin - 4.17-1 +- v4.16 -> v4.17. + +* Tue Feb 14 2017 Dmitry V. Levin - 4.16-1 +- v4.15 -> v4.16. + +* Wed Dec 14 2016 Dmitry V. Levin - 4.15-1 +- v4.14-100-g622af42 -> v4.15. + +* Wed Nov 16 2016 Dmitry V. Levin - 4.14.0.100.622a-1 +- v4.14 -> v4.14-100-g622af42: + + implemented syscall fault injection. + +* Tue Oct 04 2016 Dmitry V. Levin - 4.14-1 +- v4.13 -> v4.14: + + added printing of the mode argument of open and openat syscalls + when O_TMPFILE flag is set (#1377846). + +* Tue Jul 26 2016 Dmitry V. Levin - 4.13-1 +- v4.12 -> v4.13. + +* Tue May 31 2016 Dmitry V. Levin - 4.12-1 +- v4.11-163-g972018f -> v4.12. + +* Fri Feb 05 2016 Fedora Release Engineering - 4.11.0.163.9720-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Jan 15 2016 Dmitry V. Levin - 4.11.0.163.9720-1 +- New upstream snapshot v4.11-163-g972018f: + + fixed decoding of syscalls unknown to the kernel on s390/s390x (#1298294). + +* Wed Dec 23 2015 Dmitry V. Levin - 4.11-2 +- Enabled experimental -k option on x86_64 (#1170296). + +* Mon Dec 21 2015 Dmitry V. Levin - 4.11-1 +- New upstream release: + + print nanoseconds along with seconds in stat family syscalls (#1251176). + +* Fri Jun 19 2015 Fedora Release Engineering - 4.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Mon May 11 2015 Marcin Juszkiewicz - 4.10-2 +- Backport set of upstream patches to get it buildable on AArch64 + +* Fri Mar 06 2015 Dmitry V. Levin - 4.10-1 +- New upstream release: + + enhanced ioctl decoding (#902788). + +* Mon Nov 03 2014 Lubomir Rintel - 4.9-3 +- Regenerate ioctl entries with proper kernel headers + +* Mon Aug 18 2014 Fedora Release Engineering - 4.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Aug 15 2014 Dmitry V. Levin - 4.9-1 +- New upstream release: + + fixed build when and conflict (#993384); + + updated CLOCK_* constants (#1088455); + + enabled ppc64le support (#1122323); + + fixed attach to a process on ppc64le (#1129569). + +* Fri Jul 25 2014 Dan HorĂ¡k - 4.8-5 +- update for ppc64 + +* Sun Jun 08 2014 Fedora Release Engineering - 4.8-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Fri Dec 6 2013 Peter Robinson 4.8-3 +- Fix FTBFS + +* Sun Aug 04 2013 Fedora Release Engineering - 4.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Jun 03 2013 Dmitry V. Levin - 4.8-1 +- New upstream release: + + fixed ERESTARTNOINTR leaking to userspace on ancient kernels (#659382); + + fixed decoding of *xattr syscalls (#885233); + + fixed handling of files with 64-bit inode numbers by 32-bit strace (#912790); + + added aarch64 support (#969858). + +* Fri Feb 15 2013 Fedora Release Engineering - 4.7-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sat Jul 21 2012 Fedora Release Engineering - 4.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed May 02 2012 Dmitry V. Levin 4.7-1 +- New upstream release. + + implemented proper handling of real SIGTRAPs (#162774). + +* Sat Jan 14 2012 Fedora Release Engineering - 4.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Mar 14 2011 Dmitry V. Levin - 4.6-1 +- New upstream release. + + fixed a corner case in waitpid handling (#663547). + +* Wed Feb 09 2011 Fedora Release Engineering - 4.5.20-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Apr 13 2010 Roland McGrath - 4.5.20-1 +- New upstream release, work mostly by Andreas Schwab and Dmitry V. Levin. + + fixed potential stack buffer overflow in select decoder (#556678); + + fixed FTBFS (#539044). + +* Wed Oct 21 2009 Roland McGrath - 4.5.19-1 +- New upstream release, work mostly by Dmitry V. Levin + + exit/kill strace with traced process exitcode/signal (#105371); + + fixed build on ARM EABI (#507576); + + fixed display of 32-bit argv array on 64-bit architectures (#519480); + + fixed display of 32-bit fcntl(F_SETLK) on 64-bit architectures (#471169); + + fixed several bugs in strings decoder, including potential heap + memory corruption (#470529, #478324, #511035). + +* Thu Aug 28 2008 Roland McGrath - 4.5.18-1 +- build fix for newer kernel headers (#457291) +- fix CLONE_VFORK handling (#455078) +- Support new Linux/PPC system call subpage_prot and PROT_SAO flag. +- In sigaction system call, display sa_flags value along with SIG_DFL/SIG_IGN. + +* Mon Jul 21 2008 Roland McGrath - 4.5.17-1 +- handle O_CLOEXEC, MSG_CMSG_CLOEXEC (#365781) +- fix biarch stat64 decoding (#222275) +- fix spurious "..." in printing of environment strings (#358241) +- improve prctl decoding (#364401) +- fix hang wait on exited child with exited child (#354261) +- fix biarch fork/vfork (-f) tracing (#447475) +- fix biarch printing of negative argument kill (#430585) +- fix biarch decoding of error return values (#447587) +- fix -f tracing of CLONE_VFORK (#455078) +- fix ia64 register clobberation in -f tracing (#453438) +- print SO_NODEFER, SA_RESETHAND instead of SA_NOMASK, SA_ONESHOT (#455821) +- fix futex argument decoding (#448628, #448629) + +* Fri Aug 3 2007 Roland McGrath - 4.5.16-1 +- fix multithread issues (#240962, #240961, #247907) +- fix spurious SIGSTOP on early interrupt (#240986) +- fix utime for biarch (#247185) +- fix -u error message (#247170) +- better futex syscall printing (##241467) +- fix argv/envp printing with small -s settings, and for biarch +- new syscalls: getcpu, eventfd, timerfd, signalfd, epoll_pwait, + move_pages, utimensat + +* Tue Jan 16 2007 Roland McGrath - 4.5.15-1 +- biarch fixes (#179740, #192193, #171626, #173050, #218433, #218043) +- fix -ff -o behavior (#204950, #218435, #193808, #219423) +- better quotactl printing (#118696) +- *at, inotify*, pselect6, ppoll and unshare syscalls (#178633, #191275) +- glibc-2.5 build fixes (#209856) +- memory corruption fixes (#200621 +- fix race in child setup under -f (#180293) +- show ipc key values in hex (#198179, #192182) +- disallow -c with -ff (#187847) +- Resolves: RHBZ #179740, RHBZ #192193, RHBZ #204950, RHBZ #218435 +- Resolves: RHBZ #193808, RHBZ #219423, RHBZ #171626, RHBZ #173050 +- Resolves: RHBZ #218433, RHBZ #218043, RHBZ #118696, RHBZ #178633 +- Resolves: RHBZ #191275, RHBZ #209856, RHBZ #200621, RHBZ #180293 +- Resolves: RHBZ #198179, RHBZ #198182, RHBZ #187847 + +* Mon Nov 20 2006 Jakub Jelinek - 4.5.14-4 +- Fix ia64 syscall decoding (#206768) +- Fix build with glibc-2.4.90-33 and up on all arches but ia64 +- Fix build against 2.6.18+ headers + +* Tue Aug 22 2006 Roland McGrath - 4.5.14-3 +- Fix bogus decoding of syscalls >= 300 (#201462, #202620). + +* Fri Jul 14 2006 Jesse Keating - 4.5.14-2 +- rebuild + +* Fri Feb 10 2006 Jesse Keating - 4.5.14-1.2 +- bump again for long double bug on ppc{,64} + +* Tue Feb 07 2006 Jesse Keating - 4.5.14-1.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Mon Jan 16 2006 Roland McGrath - 4.5.14-1 +- Fix biarch decoding of socket syscalls (#174354). +- Fix biarch -e support (#173986). +- Accept numeric syscalls in -e (#174798). +- Fix ipc syscall decoding (#164755). +- Improve msgrcv printing (#164757). +- Man page updates (#165375). +- Improve mount syscall printing (#165377). +- Correct printing of restarting syscalls (#165469). + +* Wed Aug 3 2005 Roland McGrath - 4.5.13-1 +- Fix setsockopt decoding on 64-bit (#162449). +- Fix typos in socket option name strings (#161578). +- Display more IPV6 socket options by name (#162450). +- Don't display inappropriate syscalls for -e trace=file (#159340). +- New selector type -e trace=desc for file-descriptor using calls (#159400). +- Fix 32-bit old_mmap syscall decoding on x86-64 (#162467, #164215). +- Fix errors detaching from multithreaded process on interrupt (#161919). +- Note 4.5.12 fix for crash handling bad signal numbers (#162739). + +* Wed Jun 8 2005 Roland McGrath - 4.5.12-1 +- Fix known syscall recognition for IA32 processes on x86-64 (#158934). +- Fix bad output for ptrace on x86-64 (#159787). +- Fix potential buffer overruns (#151570, #159196). +- Make some diagnostics more consistent (#159308). +- Update PowerPC system calls. +- Better printing for Linux aio system calls. +- Don't truncate statfs64 fields to 32 bits in output (#158243). +- Cosmetic code cleanups (#159688). + +* Tue Mar 22 2005 Roland McGrath - 4.5.11-1 +- Build tweaks. +- Note 4.5.10 select fix (#151570). + +* Mon Mar 14 2005 Roland McGrath - 4.5.10-1 +- Fix select handling on nonstandard fd_set sizes. +- Don't print errors for null file name pointers. +- Fix initial execve output with -i (#143365). + +* Fri Feb 4 2005 Roland McGrath - 4.5.9-2 +- update ia64 syscall list (#146245) +- fix x86_64 syscall argument extraction for 32-bit processes (#146093) +- fix -e signal=NAME parsing (#143362) +- fix x86_64 exit_group syscall handling +- improve socket ioctl printing (#138223) +- code cleanups (#143369, #143370) +- improve mount flags printing (#141932) +- support symbolic printing of x86_64 arch_prctl parameters (#142667) +- fix potential crash in getxattr printing + +* Tue Oct 19 2004 Roland McGrath - 4.5.8-1 +- fix multithreaded exit handling (#132150, #135254) +- fix ioctl name matching (#129808) +- print RTC_* ioctl structure contents (#58606) +- grok epoll_* syscalls (#134463) +- grok new RLIMIT_* values (#133594) +- print struct cmsghdr contents for sendmsg (#131689) +- fix clock_* and timer_* argument output (#131420) + +* Tue Aug 31 2004 Roland McGrath - 4.5.7-2 +- new upstream version, misc fixes and updates (#128091, #129166, #128391, #129378, #130965, #131177) + +* Mon Jul 12 2004 Roland McGrath 4.5.6-1 +- new upstream version, updates ioctl lists (#127398), fixes quotactl (#127393), more ioctl decoding (#126917) + +* Sun Jun 27 2004 Roland McGrath 4.5.5-1 +- new upstream version, fixes x86-64 biarch support (#126547) + +* Tue Jun 15 2004 Elliot Lee 4.5.4-2 +- rebuilt + +* Thu Jun 3 2004 Roland McGrath 4.5.4-0.FC1 +- rebuilt for FC1 update + +* Thu Jun 3 2004 Roland McGrath 4.5.4-1 +- new upstream version, more ioctls (#122257), minor fixes + +* Fri Apr 16 2004 Roland McGrath 4.5.3-1 +- new upstream version, mq_* calls (#120701), -p vs NPTL (#120462), more fixes (#118694, #120541, #118685) + +* Tue Mar 02 2004 Elliot Lee 4.5.2-1.1 +- rebuilt + +* Mon Mar 1 2004 Roland McGrath 4.5.2-1 +- new upstream version, sched_* calls (#116990), show core flag (#112117) + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Thu Nov 13 2003 Roland McGrath 4.5.1-1 +- new upstream version, more fixes (#108012, #105366, #105359, #105358) + +* Tue Sep 30 2003 Roland McGrath 4.5-3 +- revert bogus s390 fix + +* Thu Sep 25 2003 Roland McGrath 4.5-1.2.1AS +- rebuilt for 2.1AS erratum + +* Wed Sep 24 2003 Roland McGrath 4.5-2 +- rebuilt + +* Wed Sep 24 2003 Roland McGrath 4.5-1 +- new upstream version, more fixes (#101499, #104365) + +* Thu Jul 17 2003 Roland McGrath 4.4.99-2 +- rebuilt + +* Thu Jul 17 2003 Roland McGrath 4.4.99-1 +- new upstream version, groks more new system calls, PF_INET6 sockets + +* Tue Jun 10 2003 Roland McGrath 4.4.98-1 +- new upstream version, more fixes (#90754, #91085) + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Sun Mar 30 2003 Roland McGrath 4.4.96-1 +- new upstream version, handles yet more 2.5 syscalls, x86_64 & ia64 fixes + +* Mon Feb 24 2003 Elliot Lee 4.4.95-2 +- rebuilt + +* Mon Feb 24 2003 Roland McGrath 4.4.95-1 +- new upstream version, fixed getresuid/getresgid (#84959) + +* Wed Feb 19 2003 Roland McGrath 4.4.94-1 +- new upstream version, new option -E to set environment variables (#82392) + +* Wed Jan 22 2003 Tim Powers 4.4.93-2 +- rebuilt + +* Tue Jan 21 2003 Roland McGrath 4.4.93-1 +- new upstream version, fixes ppc and s390 bugs, adds missing ptrace requests + +* Fri Jan 10 2003 Roland McGrath 4.4.91-1 +- new upstream version, fixes -f on x86-64 + +* Fri Jan 10 2003 Roland McGrath 4.4.90-1 +- new upstream version, fixes all known bugs modulo ia64 and s390 issues + +* Fri Jan 03 2003 Florian La Roche 4.4-11 +- add further s390 patch from IBM + +* Wed Nov 27 2002 Tim Powers 4.4-10 +- remove unpackaged files from the buildroot + +* Mon Oct 07 2002 Phil Knirsch 4.4-9.1 +- Added latest s390(x) patch. + +* Fri Sep 06 2002 Karsten Hopp 4.4-9 +- preliminary x86_64 support with an ugly patch to help + debugging. Needs cleanup! + +* Mon Sep 2 2002 Jakub Jelinek 4.4-8 +- newer version of the clone fixing patch (Roland McGrath) +- aio syscalls for i386/ia64/ppc (Ben LaHaise) + +* Wed Aug 28 2002 Jakub Jelinek 4.4-7 +- fix strace -f (Roland McGrath, #68994) +- handle ?et_thread_area, SA_RESTORER (Ulrich Drepper) + +* Fri Jun 21 2002 Jakub Jelinek 4.4-6 +- handle futexes, *xattr, sendfile64, etc. (Ulrich Drepper) +- handle modify_ldt (#66894) + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Tue Apr 16 2002 Jakub Jelinek 4.4-4 +- fix for the last patch by Jeff Law (#62591) + +* Mon Mar 4 2002 Preston Brown 4.4-3 +- integrate patch from Jeff Law to eliminate hang tracing threads + +* Sat Feb 23 2002 Florian La Roche +- minor update from debian tar-ball + +* Wed Jan 02 2002 Florian La Roche +- update to 4.4 + +* Sun Jul 22 2001 Florian La Roche +- disable s390 patches, they are already included + +* Wed Jul 18 2001 Preston Brown 4.3-1 +- new upstream version. Seems to have integrated most new syscalls +- tracing threaded programs is now functional. + +* Mon Jun 11 2001 Than Ngo +- port s390 patches from IBM + +* Wed May 16 2001 Nalin Dahyabhai +- modify new syscall patch to allocate enough heap space in setgroups32() + +* Wed Feb 14 2001 Jakub Jelinek +- #include in addition to + +* Fri Jan 26 2001 Karsten Hopp +- clean up conflicting patches. This happened only + when building on S390 + +* Fri Jan 19 2001 Bill Nottingham +- update to CVS, reintegrate ia64 support + +* Fri Dec 8 2000 Bernhard Rosenkraenzer +- Get S/390 support into the normal package + +* Sat Nov 18 2000 Florian La Roche +- added S/390 patch from IBM, adapting it to not conflict with + IA64 patch + +* Sat Aug 19 2000 Jakub Jelinek +- doh, actually apply the 2.4 syscalls patch +- make it compile with 2.4.0-test7-pre4+ headers, add + getdents64 and fcntl64 + +* Thu Aug 3 2000 Jakub Jelinek +- add a bunch of new 2.4 syscalls (#14036) + +* Wed Jul 12 2000 Prospector +- automatic rebuild +- excludearch ia64 + +* Fri Jun 2 2000 Matt Wilson +- use buildinstall for FHS + +* Wed May 24 2000 Jakub Jelinek +- make things compile on sparc +- fix sigreturn on sparc + +* Fri Mar 31 2000 Bill Nottingham +- fix stat64 misdef (#10485) + +* Tue Mar 21 2000 Michael K. Johnson +- added ia64 patch + +* Thu Feb 03 2000 Cristian Gafton +- man pages are compressed +- version 4.2 (why are we keeping all these patches around?) + +* Sat Nov 27 1999 Jeff Johnson +- update to 4.1 (with sparc socketcall patch). + +* Fri Nov 12 1999 Jakub Jelinek +- fix socketcall on sparc. + +* Thu Sep 02 1999 Cristian Gafton +- fix KERN_SECURELVL compile problem + +* Tue Aug 31 1999 Cristian Gafton +- added alpha patch from HJLu to fix the osf_sigprocmask interpretation + +* Sat Jun 12 1999 Jeff Johnson +- update to 3.99.1. + +* Wed Jun 2 1999 Jeff Johnson +- add (the other :-) jj's sparc patch. + +* Wed May 26 1999 Jeff Johnson +- upgrade to 3.99 in order to +- add new 2.2.x open flags (#2955). +- add new 2.2.x syscalls (#2866). +- strace 3.1 patches carried along for now. + +* Sun May 16 1999 Jeff Johnson +- don't rely on (broken!) rpm %%patch (#2735) + +* Tue Apr 06 1999 Preston Brown +- strip binary + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 16) + +* Tue Feb 9 1999 Jeff Johnson +- vfork est arrive! + +* Tue Feb 9 1999 Christopher Blizzard +- Add patch to follow clone() syscalls, too. + +* Sun Jan 17 1999 Jeff Johnson +- patch to build alpha/sparc with glibc 2.1. + +* Thu Dec 03 1998 Cristian Gafton +- patch to build on ARM + +* Wed Sep 30 1998 Jeff Johnson +- fix typo (printf, not tprintf). + +* Sat Sep 19 1998 Jeff Johnson +- fix compile problem on sparc. + +* Tue Aug 18 1998 Cristian Gafton +- buildroot + +* Mon Jul 20 1998 Cristian Gafton +- added the umoven patch from James Youngman +- fixed build problems on newer glibc releases + +* Mon Jun 08 1998 Prospector System +- translations modified for de, fr, tr