]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: fix crash when tracepoint arguments are freed by wq callbacks
authorDavid Sterba <dsterba@suse.com>
Fri, 6 Jan 2017 13:12:51 +0000 (14:12 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Jan 2017 10:24:50 +0000 (11:24 +0100)
commit8134fc3c3d477a5da31233773629c0aa8a9dfcc0
treeec90457b5fe8979eeb3f3d63cc6131ed53b1f735
parentc2b20db9d2e919853e5a00f8927fa815e39a6fda
btrfs: fix crash when tracepoint arguments are freed by wq callbacks

Enabling btrfs tracepoints leads to instant crash, as reported. The wq
callbacks could free the memory and the tracepoints started to
dereference the members to get to fs_info.

The proposed fix https://marc.info/?l=linux-btrfs&m=148172436722606&w=2
removed the tracepoints but we could preserve them by passing only the
required data in a safe way.

Fixes: 0f9331d92898 ("btrfs: prefix fsid to all trace events")
CC: stable@vger.kernel.org # 4.8+
Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/async-thread.c
include/trace/events/btrfs.h