Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1334049

[PATCH 4.4 016/117] tracing: Fix stacktrace skip depth in trace_buffer_unlock_commit_regs()

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.4 016/117] tracing: Fix stacktrace skip depth in trace_buffer_unlock_commit_regs()
Date 2016-02-15 01:50 +0100
Message-ID <r2fwu-1Sa-3@gated-at.bofh.it> (permalink)
References <r2dl0-tX-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Steven Rostedt (Red Hat) <rostedt@goodmis.org>

commit 7717c6be699975f6733d278b13b7c4295d73caf6 upstream.

While cleaning the stacktrace code I unintentially changed the skip depth of
trace_buffer_unlock_commit_regs() from 0 to 6. kprobes uses this function,
and with skipping 6 call backs, it can easily produce no stack.

Here's how I tested it:

 # echo 'p:ext4_sync_fs ext4_sync_fs ' > /sys/kernel/debug/tracing/kprobe_events
 # echo 1 > /sys/kernel/debug/tracing/events/kprobes/enable
 # cat /sys/kernel/debug/trace
            sync-2394  [005]   502.457060: ext4_sync_fs: (ffffffff81317650)
            sync-2394  [005]   502.457063: kernel_stack:         <stack trace>
            sync-2394  [005]   502.457086: ext4_sync_fs: (ffffffff81317650)
            sync-2394  [005]   502.457087: kernel_stack:         <stack trace>
            sync-2394  [005]   502.457091: ext4_sync_fs: (ffffffff81317650)

After putting back the skip stack to zero, we have:

            sync-2270  [000]   748.052693: ext4_sync_fs: (ffffffff81317650)
            sync-2270  [000]   748.052695: kernel_stack:         <stack trace>
 => iterate_supers (ffffffff8126412e)
 => sys_sync (ffffffff8129c4b6)
 => entry_SYSCALL_64_fastpath (ffffffff8181f0b2)
            sync-2270  [000]   748.053017: ext4_sync_fs: (ffffffff81317650)
            sync-2270  [000]   748.053019: kernel_stack:         <stack trace>
 => iterate_supers (ffffffff8126412e)
 => sys_sync (ffffffff8129c4b6)
 => entry_SYSCALL_64_fastpath (ffffffff8181f0b2)
            sync-2270  [000]   748.053381: ext4_sync_fs: (ffffffff81317650)
            sync-2270  [000]   748.053383: kernel_stack:         <stack trace>
 => iterate_supers (ffffffff8126412e)
 => sys_sync (ffffffff8129c4b6)
 => entry_SYSCALL_64_fastpath (ffffffff8181f0b2)

Fixes: 73dddbb57bb0 "tracing: Only create stacktrace option when STACKTRACE is configured"
Reported-by: Brendan Gregg <brendan.d.gregg@gmail.com>
Tested-by: Brendan Gregg <brendan.d.gregg@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/trace/trace.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1751,7 +1751,7 @@ void trace_buffer_unlock_commit_regs(str
 {
 	__buffer_unlock_commit(buffer, event);
 
-	ftrace_trace_stack(tr, buffer, flags, 6, pc, regs);
+	ftrace_trace_stack(tr, buffer, flags, 0, pc, regs);
 	ftrace_trace_userstack(buffer, flags, pc);
 }
 EXPORT_SYMBOL_GPL(trace_buffer_unlock_commit_regs);

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.4 000/117] 4.4.2-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 042/117] ALSA: pcm: Fix potential deadlock in OSS emulation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 077/117] iommu/io-pgtable-arm: Ensure we free the final level on teardown Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 074/117] tty: Wait interruptibly for tty lock on reopen Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 004/117] ocfs2: NFS hangs in __ocfs2_cluster_lock due to race with ocfs2_unblock_lock Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 046/117] ALSA: seq: Fix lockdep warnings due to double mutex locks Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 069/117] usb: cdc-acm: send zero packet for intel 7260 modem Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 005/117] HID: usbhid: fix recursive deadlock Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 065/117] USB: cp210x: add ID for IAI USB to RS485 adaptor Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 040/117] ALSA: hda/realtek - Support headset mode for ALC225 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 070/117] usb: phy: msm: fix error handling in probe. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 041/117] ALSA: hda/realtek - Support Dell headset mode for ALC225 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 007/117] block: fix bio splitting on max sectors Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 056/117] ALSA: hda - Fix speaker output from VAIO AiO machines Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 009/117] ocfs2/dlm: ignore cleaning the migration mle that is inuse Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 072/117] usb: xhci: apply XHCI_PME_STUCK_QUIRK to Intel Broxton-M platforms Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 057/117] ALSA: hda - Fix bad dereference of jack object Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 044/117] ALSA: seq: Fix yet another races among ALSA timer accesses Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
  [PATCH 4.4 019/117] parisc: Protect huge page pte changes with spinlocks Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 016/117] tracing: Fix stacktrace skip depth in trace_buffer_unlock_commit_regs() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 002/117] NFSv4.1/pnfs: Fixup an lo->plh_block_lgets imbalance in layoutreturn Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 037/117] ALSA: rawmidi: Remove kernel WARNING for NULL user-space buffer check Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 031/117] ALSA: hda - disable dynamic clock gating on Broxton before reset Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 020/117] parisc: Fix __ARCH_SI_PREAMBLE_SIZE Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 022/117] md/raid: only permit hot-add of compatible integrity profiles Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 023/117] hrtimer: Handle remaining time proper for TIME_LOW_RES Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 030/117] ALSA: Add missing dependency on CONFIG_SND_TIMER Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 038/117] ALSA: rawmidi: Fix race at copying & updating the position Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 021/117] [media] media: i2c: Dont export ir-kbd-i2c module alias Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 017/117] tracing/stacktrace: Show entire trace if passed in function not found Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 033/117] ALSA: dummy: Disable switching timer backend via sysfs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 034/117] ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 035/117] ALSA: seq: Degrade the error message for too many opens Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 006/117] base/platform: Fix platform drivers with no probe callback Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 018/117] printk: do cond_resched() between lines while outputting to consoles Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 036/117] ALSA: rawmidi: Make snd_rawmidi_transmit() race-free Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 028/117] ALSA: usb-audio: avoid freeing umidi object twice Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 026/117] ALSA: usb-audio: Fix OPPO HA-1 vendor ID Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 003/117] block: split bios to max possible length Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 039/117] ALSA: hda/realtek - New codec support of ALC225 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 027/117] ALSA: usb-audio: Add native DSD support for PS Audio NuWave DAC Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 015/117] PCI: Fix minimum allocation address overwrite Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 010/117] ocfs2/dlm: clear refmap bit of recovery lock while doing local recovery cleanup Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 032/117] ALSA: compress: Disable GET_CODEC_CAPS ioctl for some architectures Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 025/117] ALSA: usb-audio: Add quirk for Microsoft LifeCam HD-6000 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  [PATCH 4.4 013/117] mtd: nand: assign reasonable default name for NAND drivers Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:50 +0100
  Re: [PATCH 4.4 000/117] 4.4.2-stable review Guenter Roeck <linux@roeck-us.net> - 2016-02-15 17:00 +0100
  Re: [PATCH 4.4 000/117] 4.4.2-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2016-02-15 18:10 +0100

csiph-web