From aa1beb937739399c1b926b94ed5ed1d6f01abf8d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 12 May 2020 15:27:03 +0200 Subject: [PATCH] 4.4-stable patches added patches: scripts-decodecode-fix-trapping-instruction-formatting.patch --- ...-fix-trapping-instruction-formatting.patch | 46 +++++++++++++++++++ queue-4.4/series | 1 + 2 files changed, 47 insertions(+) create mode 100644 queue-4.4/scripts-decodecode-fix-trapping-instruction-formatting.patch diff --git a/queue-4.4/scripts-decodecode-fix-trapping-instruction-formatting.patch b/queue-4.4/scripts-decodecode-fix-trapping-instruction-formatting.patch new file mode 100644 index 00000000000..86762484969 --- /dev/null +++ b/queue-4.4/scripts-decodecode-fix-trapping-instruction-formatting.patch @@ -0,0 +1,46 @@ +From e08df079b23e2e982df15aa340bfbaf50f297504 Mon Sep 17 00:00:00 2001 +From: Ivan Delalande +Date: Thu, 7 May 2020 18:35:53 -0700 +Subject: scripts/decodecode: fix trapping instruction formatting + +From: Ivan Delalande + +commit e08df079b23e2e982df15aa340bfbaf50f297504 upstream. + +If the trapping instruction contains a ':', for a memory access through +segment registers for example, the sed substitution will insert the '*' +marker in the middle of the instruction instead of the line address: + + 2b: 65 48 0f c7 0f cmpxchg16b %gs:*(%rdi) <-- trapping instruction + +I started to think I had forgotten some quirk of the assembly syntax +before noticing that it was actually coming from the script. Fix it to +add the address marker at the right place for these instructions: + + 28: 49 8b 06 mov (%r14),%rax + 2b:* 65 48 0f c7 0f cmpxchg16b %gs:(%rdi) <-- trapping instruction + 30: 0f 94 c0 sete %al + +Fixes: 18ff44b189e2 ("scripts/decodecode: make faulting insn ptr more robust") +Signed-off-by: Ivan Delalande +Signed-off-by: Andrew Morton +Reviewed-by: Borislav Petkov +Link: http://lkml.kernel.org/r/20200419223653.GA31248@visor +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + scripts/decodecode | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/scripts/decodecode ++++ b/scripts/decodecode +@@ -98,7 +98,7 @@ faultlinenum=$(( $(wc -l $T.oo | cut -d + faultline=`cat $T.dis | head -1 | cut -d":" -f2-` + faultline=`echo "$faultline" | sed -e 's/\[/\\\[/g; s/\]/\\\]/g'` + +-cat $T.oo | sed -e "${faultlinenum}s/^\(.*:\)\(.*\)/\1\*\2\t\t<-- trapping instruction/" ++cat $T.oo | sed -e "${faultlinenum}s/^\([^:]*:\)\(.*\)/\1\*\2\t\t<-- trapping instruction/" + echo + cat $T.aa + cleanup diff --git a/queue-4.4/series b/queue-4.4/series index 3f2e5dece22..425c38f424d 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -13,3 +13,4 @@ revert-ib-ipoib-update-broadcast-object-if-pkey-value-was-changed-in-index-0.pat usb-uas-add-quirk-for-lacie-2big-quadra.patch usb-serial-garmin_gps-add-sanity-checking-for-data-length.patch batman-adv-fix-batadv_nc_random_weight_tq.patch +scripts-decodecode-fix-trapping-instruction-formatting.patch -- 2.47.3