mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sasha Levin <Alexander.Levin@microsoft.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
	Borislav Petkov <bp@alien8.de>, Brian Gerst <brgerst@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Denys Vlasenko <dvlasenk@redhat.com>,
	"H . Peter Anvin" <hpa@zytor.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ye Xiaolong <xiaolong.ye@intel.com>,
	Ingo Molnar <mingo@kernel.org>,
	Sasha Levin <Alexander.Levin@microsoft.com>
Subject: [PATCH AUTOSEL for 3.18 44/63] kprobes/x86: Fix kprobe-booster not to boost far call instructions
Date: Sat, 3 Mar 2018 22:33:37 +0000	[thread overview]
Message-ID: <20180303223228.27323-44-alexander.levin@microsoft.com> (raw)
In-Reply-To: <20180303223228.27323-1-alexander.levin@microsoft.com>

From: Masami Hiramatsu <mhiramat@kernel.org>

[ Upstream commit bd0b90676c30fe640e7ead919b3e38846ac88ab7 ]

Fix the kprobe-booster not to boost far call instruction,
because a call may store the address in the single-step
execution buffer to the stack, which should be modified
after single stepping.

Currently, this instruction will be filtered as not
boostable in resume_execution(), so this is not a
critical issue.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: David S . Miller <davem@davemloft.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ye Xiaolong <xiaolong.ye@intel.com>
Link: http://lkml.kernel.org/r/149076340615.22469.14066273186134229909.stgit@devbox
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 arch/x86/kernel/kprobes/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index b6547a441bad..422b76ab0374 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -196,6 +196,8 @@ retry:
 		return (opcode != 0x62 && opcode != 0x67);
 	case 0x70:
 		return 0; /* can't boost conditional jump */
+	case 0x90:
+		return opcode != 0x9a;	/* can't boost call far */
 	case 0xc0:
 		/* can't boost software-interruptions */
 		return (0xc1 < opcode && opcode < 0xcc) || opcode == 0xcf;
-- 
2.14.1

  parent reply	other threads:[~2018-03-03 22:47 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-03 22:33 [PATCH AUTOSEL for 3.18 01/63] Input: tsc2007 - check for presence and power down tsc2007 during probe Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 02/63] kretprobes: Ensure probe location is at function entry Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 03/63] HID: reject input outside logical range only if null state is set Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 04/63] net: mvpp2: set dma mask and coherent dma mask on PPv2.2 Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 05/63] PCI/MSI: Stop disabling MSI/MSI-X in pci_device_shutdown() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 06/63] selinux: check for address length in selinux_socket_bind() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 07/63] perf tools: Make perf_event__synthesize_mmap_events() scale Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 08/63] drivers: net: xgene: Fix hardware checksum setting Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 09/63] drm: Defer disabling the vblank IRQ until the next interrupt (for instant-off) Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 10/63] ath10k: disallow DFS simulation if DFS channel is not enabled Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 11/63] HID: clamp input to logical range if no null state Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 12/63] ARM: dts: Adjust moxart IRQ controller and flags Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 13/63] batman-adv: handle race condition for claims between gateways Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 14/63] of: fix of_device_get_modalias returned length when truncating buffers Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 15/63] scsi: ipr: Fix missed EH wakeup Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 16/63] [media] media: i2c/soc_camera: fix ov6650 sensor getting wrong clock Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 18/63] sched: act_csum: don't mangle TCP and UDP GSO packets Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 17/63] timers, sched_clock: Update timeout for clock wrap Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 19/63] spi: omap2-mcspi: poll OMAP2_MCSPI_CHSTAT_RXS for PIO transfer Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 20/63] tcp: sysctl: Fix a race to avoid unexpected 0 window from space Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 22/63] mm: Fix false-positive VM_BUG_ON() in page_cache_{get,add}_speculative() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 21/63] powerpc/xmon: Fix an unexpected xmon on/off state change Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 23/63] blk-throttle: make sure expire time isn't too big Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 25/63] braille-console: Fix value returned by _braille_console_setup Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 24/63] ARM: DRA7: hwmod_data: Prevent wait_target_disable error for usb_otg_ss Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 26/63] ARM: dts: r8a7790: Correct parent of SSI[0-9] clocks Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 28/63] powerpc: Avoid taking a data miss on every userspace instruction miss Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 27/63] ARM: dts: r8a7791: Correct parent of SSI[0-9] clocks Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 29/63] net/faraday: Add missing include of of.h Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 30/63] reiserfs: Make cancel_old_flush() reliable Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 31/63] fm10k: correctly check if interface is removed Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 33/63] iommu/iova: Fix underflow bug in __alloc_and_insert_iova_range Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 32/63] apparmor: Make path_max parameter readonly Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 34/63] ARM: dts: rockchip: disable arm-global-timer for rk3188 Sasha Levin
2018-03-04 23:20   ` Alexander Kochetkov
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 35/63] video: ARM CLCD: fix dma allocation size Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 36/63] drm/radeon: Fail fb creation from imported dma-bufs Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 37/63] MIPS: BPF: Quit clobbering callee saved registers in JIT code Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 38/63] regulator: isl9305: fix array size Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 39/63] usb: gadget: dummy_hcd: Fix wrong power status bit clear/reset in dummy_hub_control() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 40/63] perf inject: Copy events when reordering events in pipe mode Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 41/63] perf session: Don't rely on evlist " Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 42/63] scsi: sg: check for valid direction before starting the request Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 43/63] scsi: sg: close race condition in sg_remove_sfp_usercontext() Sasha Levin
2018-03-03 22:33 ` Sasha Levin [this message]
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 46/63] wil6210: fix memory access violation in wil_memcpy_from/toio_32 Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 45/63] kprobes/x86: Set kprobes pages read-only Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 48/63] sched: Stop resched_cpu() from sending IPIs to offline CPUs Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 47/63] HID: elo: clear BTN_LEFT mapping Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 50/63] mtd: nand: fix interpretation of NAND_CMD_NONE in nand_command[_lp]() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 49/63] net: xfrm: allow clearing socket xfrm policies Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 51/63] ARM: dts: am335x-pepper: Fix the audio CODEC's reset pin Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 52/63] ARM: dts: omap3-n900: " Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 54/63] ASoC: tlv320aic31xx: Handle inverted BCLK in non-DSP modes Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 53/63] mtd: nand: ifc: update bufnum mask for ver >= 2.0.0 Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 55/63] tools/usbip: fixes build with musl libc toolchain Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 57/63] scsi: devinfo: apply to HP XP the same flags as Hitachi VSP Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 56/63] spi: sun6i: disable/unprepare clocks on remove Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 58/63] media: cpia2: Fix a couple off by one bugs Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 59/63] veth: set peer GSO values Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 60/63] mac80211: remove BUG() when interface type is invalid Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 62/63] rcutorture/configinit: Fix build directory error message Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 61/63] ASoC: nuc900: Fix a loop timeout test Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 63/63] ima: relax requiring a file signature for new files with zero length Sasha Levin

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=20180303223228.27323-44-alexander.levin@microsoft.com \
    --to=alexander.levin@microsoft.com \
    --cc=ananth@linux.vnet.ibm.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dvlasenk@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=xiaolong.ye@intel.com \
    /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

all inboxes | Powered by JetHome®