linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Ivan Delalande <colona@arista.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Borislav Petkov <bp@suse.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH AUTOSEL 4.14 38/39] scripts/decodecode: fix trapping instruction formatting
Date: Thu, 14 May 2020 14:54:55 -0400	[thread overview]
Message-ID: <20200514185456.21060-38-sashal@kernel.org> (raw)
In-Reply-To: <20200514185456.21060-1-sashal@kernel.org>

From: Ivan Delalande <colona@arista.com>

[ Upstream commit e08df079b23e2e982df15aa340bfbaf50f297504 ]

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: Sasha Levin <sashal@kernel.org>
---
 scripts/decodecode | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/decodecode b/scripts/decodecode
index 438120da13610..1ab4ef613cb07 100755
--- a/scripts/decodecode
+++ b/scripts/decodecode
@@ -99,7 +99,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
-- 
2.20.1


  parent reply	other threads:[~2020-05-14 19:00 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 18:54 [PATCH AUTOSEL 4.14 01/39] Makefile: disallow data races on gcc-10 as well Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 02/39] gcc-common.h: Update for GCC 10 Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 03/39] HID: multitouch: add eGalaxTouch P80H84 support Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 04/39] batman-adv: fix batadv_nc_random_weight_tq Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 05/39] batman-adv: Fix refcnt leak in batadv_show_throughput_override Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 06/39] batman-adv: Fix refcnt leak in batadv_store_throughput_override Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 07/39] batman-adv: Fix refcnt leak in batadv_v_ogm_process Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 08/39] phy: tegra: Select USB_COMMON for usb_get_maximum_speed() Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 09/39] scsi: qla2xxx: Fix hang when issuing nvme disconnect-all in NPIV Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 10/39] objtool: Fix stack offset tracking for indirect CFAs Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 11/39] x86/entry/64: Fix unwind hints in register clearing code Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 12/39] x86/entry/64: Fix unwind hints in kernel exit path Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 13/39] x86/entry/64: Fix unwind hints in rewind_stack_do_exit() Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 14/39] x86/unwind/orc: Don't skip the first frame for inactive tasks Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 15/39] x86/unwind/orc: Fix error path for bad ORC entry type Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 16/39] configfs: fix config_item refcnt leak in configfs_rmdir() Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 17/39] vhost/vsock: fix packet delivery order to monitoring devices Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 18/39] bnxt_en: Fix VLAN acceleration handling in bnxt_fix_features() Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 19/39] net/sonic: Fix a resource leak in an error handling path in 'jazz_sonic_probe()' Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 20/39] component: Silence bind error on -EPROBE_DEFER Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 21/39] scsi: ibmvscsi: Fix WARN_ON during event pool release Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 22/39] net/mlx5: Fix forced completion access non initialized command entry Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 23/39] net/mlx5: Fix command entry leak in Internal Error State Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 24/39] dp83640: reverse arguments to list_add_tail Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 25/39] soc: qcom: ipa: IPA endpoints Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 26/39] net: ipa: fix a bug in ipa_endpoint_stop() Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 27/39] net: macsec: preserve ingress frame ordering Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 28/39] net: moxa: Fix a potential double 'free_irq()' Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 29/39] x86/apic: Move TSC deadline timer debug printk Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 30/39] gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp() Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 31/39] virtio-blk: handle block_device_operations callbacks after hot unplug Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 32/39] net: usb: qmi_wwan: add support for DW5816e Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 33/39] ceph: fix double unlock in handle_cap_export() Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 34/39] net/mlx4_core: Fix use of ENOSPC around mlx4_counter_alloc() Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 35/39] USB: core: Fix misleading driver bug report Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 36/39] platform/x86: asus-nb-wmi: Do not load on Asus T100TA and T200TA Sasha Levin
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 37/39] ARM: futex: Address build warning Sasha Levin
2020-05-14 18:54 ` Sasha Levin [this message]
2020-05-14 18:54 ` [PATCH AUTOSEL 4.14 39/39] crypto: xts - simplify error handling in ->create() Sasha Levin
2020-05-14 19:08   ` Eric Biggers
2020-05-15  0:55     ` Sasha Levin
2020-05-16  1:35       ` Eric Biggers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200514185456.21060-38-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bp@suse.de \
    --cc=colona@arista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).