All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch added to 3.12-stable] ftrace/x86: Set ftrace_stub to weak to prevent gcc from using short jumps to it
@ 2017-01-21  7:39 Jiri Slaby
  2017-01-21  7:39 ` [patch added to 3.12-stable] usb: xhci: apply XHCI_PME_STUCK_QUIRK to Intel Broxton-M platforms Jiri Slaby
                   ` (63 more replies)
  0 siblings, 64 replies; 65+ messages in thread
From: Jiri Slaby @ 2017-01-21  7:39 UTC (permalink / raw)
  To: stable; +Cc: Steven Rostedt, Jiri Slaby

From: Steven Rostedt <rostedt@goodmis.org>

This patch has been added to the 3.12 stable tree. If you have any
objections, please let us know.

===============

commit 8329e818f14926a6040df86b2668568bde342ebf upstream.

Matt Fleming reported seeing crashes when enabling and disabling
function profiling which uses function graph tracer. Later Namhyung Kim
hit a similar issue and he found that the issue was due to the jmp to
ftrace_stub in ftrace_graph_call was only two bytes, and when it was
changed to jump to the tracing code, it overwrote the ftrace_stub that
was after it.

Masami Hiramatsu bisected this down to a binutils change:

8dcea93252a9ea7dff57e85220a719e2a5e8ab41 is the first bad commit
commit 8dcea93252a9ea7dff57e85220a719e2a5e8ab41
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri May 15 03:17:31 2015 -0700

    Add -mshared option to x86 ELF assembler

    This patch adds -mshared option to x86 ELF assembler.  By default,
    assembler will optimize out non-PLT relocations against defined non-weak
    global branch targets with default visibility.  The -mshared option tells
    the assembler to generate code which may go into a shared library
    where all non-weak global branch targets with default visibility can
    be preempted.  The resulting code is slightly bigger.  This option
    only affects the handling of branch instructions.

Declaring ftrace_stub as a weak call prevents gas from using two byte
jumps to it, which would be converted to a jump to the function graph
code.

Link: http://lkml.kernel.org/r/20160516230035.1dbae571@gandalf.local.home

Reported-by: Matt Fleming <matt@codeblueprint.co.uk>
Reported-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Matt Fleming <matt@codeblueprint.co.uk>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/kernel/entry_64.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index ead3e7c9672e..ceb8d113938b 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -122,7 +122,8 @@ GLOBAL(ftrace_graph_call)
 	jmp ftrace_stub
 #endif
 
-GLOBAL(ftrace_stub)
+/* This is weak to keep gas from relaxing the jumps */
+WEAK(ftrace_stub)
 	retq
 END(ftrace_caller)
 
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 65+ messages in thread

end of thread, other threads:[~2017-01-21  7:42 UTC | newest]

Thread overview: 65+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-21  7:39 [patch added to 3.12-stable] ftrace/x86: Set ftrace_stub to weak to prevent gcc from using short jumps to it Jiri Slaby
2017-01-21  7:39 ` [patch added to 3.12-stable] usb: xhci: apply XHCI_PME_STUCK_QUIRK to Intel Broxton-M platforms Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: xhci: applying XHCI_PME_STUCK_QUIRK to Intel BXT B0 host Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: dwc3: pci: Add PCI ID for Intel Braswell Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: dwc3: pci: add support for Intel Sunrise Point PCH Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: dwc3: pci: add support for Intel Broxton SOC Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: dwc3: pci: add ID for one more Intel Broxton platform Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: dwc3: pci: add Intel Kabylake PCI ID Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] ALSA: hda - Fix up GPIO for ASUS ROG Ranger Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] ALSA: hda - Apply asus-mode8 fixup to ASUS X71SL Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] ARM: davinci: da850: don't add emac clock to lookup table twice Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: storage: unusual_uas: Add JMicron JMS56x to unusual device Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: gadgetfs: restrict upper bound on device configuration size Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: gadgetfs: fix unbounded memory allocation bug Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: gadgetfs: fix use-after-free bug Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: gadgetfs: fix checks of wTotalLength in config descriptors Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: fix problems with duplicate endpoint addresses Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: dummy-hcd: fix bug in stop_activity (handle ep0) Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: gadget: composite: Test get_alt() presence instead of set_alt() Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] xhci: workaround for hosts missing CAS bit Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: xhci: apply XHCI_PME_STUCK_QUIRK to Intel Apollo Lake Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] xhci: free xhci virtual devices with leaf nodes first Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: omninet: fix NULL-derefs at open and disconnect Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: quatech2: fix sleep-while-atomic in close Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: pl2303: fix NULL-deref at open Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: keyspan_pda: verify endpoints at probe Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: spcp8x5: fix NULL-deref at open Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: io_ti: " Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: io_ti: fix another " Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: iuu_phoenix: fix " Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: garmin_gps: fix memory leak on failed URB submit Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: ti_usb_3410_5052: fix NULL-deref at open Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: io_edgeport: " Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: oti6858: " Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: cyberjack: " Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: kobil_sct: fix NULL-deref in write Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: mos7840: fix NULL-deref at open Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: mos7720: " Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: mos7720: fix use-after-free on probe errors Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: mos7720: fix parport " Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: mos7720: fix parallel probe Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: xhci-mem: use passed in GFP flags instead of GFP_KERNEL Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: dwc3: pci: add Intel Gemini Lake PCI ID Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: musb: Fix trying to free already-free IRQ 4 Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: hub: Move hub_port_disable() to fix warning if PM is disabled Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] ALSA: usb-audio: Fix bogus error return in snd_usb_create_stream() Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: kl5kusb105: abort on open exception path Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: phy: am335x-control: fix device and of_node leaks Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] USB: serial: io_ti: bind to interface after fw download Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] staging: iio: ad7606: fix improper setting of oversampling pins Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] usb: dwc3: gadget: always unmap EP0 requests Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] cris: Only build flash rescue image if CONFIG_ETRAX_AXISFLASHMAP is selected Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] hwmon: (ds620) Fix overflows seen when writing temperature limits Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] hwmon: (g762) Fix overflows and crash seen when writing limit attributes Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] clk: clk-wm831x: fix a logic error Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] iommu/amd: Fix the left value check of cmd buffer Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] scsi: mvsas: fix command_active typo Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] target/iscsi: Fix double free in lio_target_tiqn_addtpg() Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] mmc: mmc_test: Uninitialized return value Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] md: MD_RECOVERY_NEEDED is set for mddev->recovery Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] powerpc/pci/rpadlpar: Fix device reference leaks Jiri Slaby
2017-01-21  7:40 ` [patch added to 3.12-stable] cred/userns: define current_user_ns() as a function Jiri Slaby
2017-01-21  7:41 ` [patch added to 3.12-stable] net: ti: cpmac: Fix compiler warning due to type confusion Jiri Slaby
2017-01-21  7:41 ` [patch added to 3.12-stable] tick/broadcast: Prevent NULL pointer dereference Jiri Slaby
2017-01-21  7:41 ` [patch added to 3.12-stable] usb: gadget: composite: always set ep->mult to a sensible value Jiri Slaby

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.