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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jan 2017 19:18:02 +0000 (20:18 +0100)
commit28dad9aa9b367b81f99a36a06d16e89e649133ce
treebd7f2e951fd7cabc7d8989dbc639daf829b8473e
parent4d0f302bf56a03b8023f06a27b811c1a4625c20d
btrfs: fix crash when tracepoint arguments are freed by wq callbacks

commit ac0c7cf8be00f269f82964cf7b144ca3edc5dbc4 upstream.

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: bc074524e123 ("btrfs: prefix fsid to all trace events")
Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/async-thread.c
include/trace/events/btrfs.h