summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorIvan Delalande <colona@arista.com>2020-05-07 18:35:53 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-14 07:57:23 +0200
commit3a3da00667cc450ece9ea4a368f171bc730e3c4e (patch)
tree429bfde16c467b36c0cfaff39f4b4c05fbca6fab /scripts
parent9fbfc77d0f5e04a7434fa6d32112036e2a41bc6e (diff)
downloadlinux-stable-3a3da00667cc450ece9ea4a368f171bc730e3c4e.tar.gz
linux-stable-3a3da00667cc450ece9ea4a368f171bc730e3c4e.tar.bz2
linux-stable-3a3da00667cc450ece9ea4a368f171bc730e3c4e.zip
scripts/decodecode: fix trapping instruction formatting
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 <colona@arista.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Borislav Petkov <bp@suse.de> Link: http://lkml.kernel.org/r/20200419223653.GA31248@visor Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/decodecode2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/decodecode b/scripts/decodecode
index 9cef558528aa..eeaa435d1bd2 100755
--- a/scripts/decodecode
+++ b/scripts/decodecode
@@ -119,7 +119,7 @@ faultlinenum=$(( $(wc -l $T.oo | cut -d" " -f1) - \
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