linux/include/trace/events
Steven Rostedt (VMware) 83b62687a0 workqueue/tracing: Copy workqueue name to buffer in trace event
The trace event "workqueue_queue_work" references an unsafe string in
dereferencing the name of the workqueue. As the name is allocated, it
could later be freed, and the pointer to that string could stay on the
tracing buffer. If the trace buffer is read after the string is freed, it
will reference an unsafe pointer.

I added a new verifier to make sure that all strings referenced in the
output of the trace buffer is safe to read and this triggered on the
workqueue_queue_work trace event:

workqueue_queue_work: work struct=00000000b2b235c7 function=gc_worker workqueue=(0xffff888100051160:events_power_efficient)[UNSAFE-MEMORY] req_cpu=256 cpu=1
workqueue_queue_work: work struct=00000000c344caec function=flush_to_ldisc workqueue=(0xffff888100054d60:events_unbound)[UNSAFE-MEMORY] req_cpu=256 cpu=4294967295
workqueue_queue_work: work struct=00000000b2b235c7 function=gc_worker workqueue=(0xffff888100051160:events_power_efficient)[UNSAFE-MEMORY] req_cpu=256 cpu=1
workqueue_queue_work: work struct=000000000b238b3f function=vmstat_update workqueue=(0xffff8881000c3760:mm_percpu_wq)[UNSAFE-MEMORY] req_cpu=1 cpu=1

Also, if this event is read via a user space application like perf or
trace-cmd, the name would only be an address and useless information:

workqueue_queue_work: work struct=0xffff953f80b4b918 function=disk_events_workfn workqueue=ffff953f8005d378 req_cpu=8192 cpu=5

Cc: Zqiang <qiang.zhang@windriver.com>
Cc: Tejun Heo <tj@kernel.org>
Fixes: 7bf9c4a88e ("workqueue: tracing the name of the workqueue instead of it's address")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-03-18 12:57:37 -04:00
..
9p.h
afs.h afs: Fix directory entry size calculation 2021-01-04 12:25:19 +00:00
alarmtimer.h
asoc.h ASoC: soc-core: tidyup jack.h 2020-11-30 12:54:01 +00:00
avc.h selinux: add basic filtering for audit trace events 2020-08-21 17:07:29 -04:00
bcache.h block: remove superfluous param in blk_fill_rwbs() 2021-02-22 06:37:41 -07:00
block.h blktrace: fix blk_rq_merge documentation 2021-02-22 06:37:41 -07:00
bpf_test_run.h selftests: bpf: test writable buffers in raw tps 2019-04-26 19:04:19 -07:00
bridge.h net: bridge: fdb: br_fdb_update can take flags directly 2019-11-01 10:32:43 -07:00
btrfs.h btrfs: add a trace class for dumping the current ENOSPC state 2021-02-08 22:58:59 +01:00
cachefiles.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
cgroup.h cgroup: use cgrp->kn->id as the cgroup ID 2019-11-12 08:18:04 -08:00
clk.h clk: Trace clk_set_rate() "range" functions 2020-12-17 01:54:31 -08:00
cma.h
compaction.h mm/page_alloc: integrate classzone_idx and high_zoneidx 2020-06-03 20:09:44 -07:00
context_tracking.h
cpuhp.h treewide: Switch printk users from %pf and %pF to %ps and %pS, respectively 2019-04-09 14:19:06 +02:00
devfreq.h PM / devfreq: Add tracepoint for frequency changes 2020-10-26 10:52:37 +09:00
devlink.h devlink: Add a tracepoint for trap reports 2020-09-30 18:01:26 -07:00
dma_fence.h tracing: Fix header include guards in trace event headers 2019-07-30 21:49:06 -04:00
erofs.h erofs: convert uncompressed files from readpages to readahead 2020-06-02 10:59:07 -07:00
error_report.h tracing: add error_report_end trace point 2021-02-26 09:41:02 -08:00
ext4.h ext4: disable fast commit with data journalling 2020-11-06 23:01:05 -05:00
f2fs.h f2fs: move ioctl interface definitions to separated file 2020-11-02 08:33:02 -08:00
fib.h net: Replace nhc_has_gw with nhc_gw_family 2019-04-08 15:22:40 -07:00
fib6.h ipv6: Add fib6_type and fib6_flags to fib6_result 2019-04-17 23:11:30 -07:00
filelock.h locks: Remove extra "0x" in tracepoint format specifier 2020-09-01 18:09:34 -04:00
filemap.h ftrace: Rework event_create_dir() 2019-11-27 07:44:25 +01:00
fs_dax.h
fscache.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
fsi_master_aspeed.h fsi: aspeed: Add trace points 2019-11-08 11:28:20 +01:00
fsi_master_ast_cf.h fsi: master-ast-cf: Add new FSI master using Aspeed ColdFire 2018-07-23 15:22:52 +10:00
fsi_master_gpio.h fsi: master-gpio: Add more tracepoints 2018-07-12 12:02:31 +10:00
fsi.h trace: fsi: Print transfer size unsigned 2019-11-08 11:23:37 +01:00
gpio.h tracing: stop making gpio tracing configurable 2019-04-08 15:11:48 +02:00
gpu_mem.h gpu/trace: Minor comment updates for gpu_mem_total tracepoint 2020-05-07 13:32:57 -04:00
host1x.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 1 2019-05-21 11:28:39 +02:00
huge_memory.h khugepaged: introduce 'max_ptes_shared' tunable 2020-06-03 20:09:46 -07:00
hwmon.h hwmon: (core) Add trace events to _attr_show/store functions 2018-10-11 20:07:35 -07:00
i2c.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
ib_mad.h IB/MAD: Add SMP details to MAD tracing 2019-03-27 15:52:01 -03:00
ib_umad.h IB/UMAD: Add umad trace points 2019-03-27 15:52:01 -03:00
initcall.h
intel_iommu.h iommu/vt-d: Fix compile error [-Werror=implicit-function-declaration] 2021-02-02 14:43:56 +01:00
intel_ish.h
intel-sst.h
io_uring.h io_uring: use poll driven retry for files that support it 2020-03-02 14:06:38 -07:00
iocost.h blk-iocost: Add iocg idle state tracepoint 2020-12-17 07:55:44 -07:00
iommu.h
ipi.h
irq_matrix.h
irq.h
iscsi.h scsi: iscsi: Capture iscsi debug messages using tracepoints 2018-12-20 20:03:55 -05:00
jbd2.h jbd2: Provide trace event for handle restarts 2019-11-05 16:00:49 -05:00
kmem.h mm, tracing: Fix kmem_cache_free trace event to not print stale pointers 2021-02-25 12:49:58 -05:00
kvm.h KVM: X86: Implement ring-based dirty memory tracking 2020-11-15 09:49:15 -05:00
kyber.h kyber: fix wrong strlcpy() size in trace_kyber_latency() 2018-11-12 08:28:37 -07:00
libata.h
lock.h
mce.h
mdio.h
migrate.h mm/vmstat: add events for THP migration without split 2020-08-12 10:57:57 -07:00
mlxsw.h mlxsw: spectrum_acl: Rename rehash_dis trace 2019-03-31 11:01:23 -07:00
mmap_lock.h mm: mmap_lock: add tracepoints around lock acquisition 2020-12-15 12:13:41 -08:00
mmap.h mm: mmap: add trace point of vm_unmapped_area 2020-04-02 09:35:30 -07:00
mmc.h
mmflags.h mm: Add PG_arch_2 page flag 2020-09-04 12:46:06 +01:00
module.h
napi.h tracing: Fix header include guards in trace event headers 2019-07-30 21:49:06 -04:00
nbd.h nbd: add tracepoints for send/receive timing 2019-04-26 19:04:19 -07:00
neigh.h neighbor: Add tracepoint to __neigh_create 2019-05-22 17:50:24 -07:00
net_probe_common.h
net.h net: add a generic tracepoint for TX queue timeout 2019-05-04 00:41:41 -04:00
netlink.h netlink: add tracepoint at NL_SET_ERR_MSG 2021-02-04 18:05:59 -08:00
nilfs2.h
nmi.h
objagg.h lib: introduce initial implementation of object aggregation manager 2018-11-15 14:43:43 -08:00
oom.h
page_isolation.h
page_pool.h page_pool: Add API to update numa node 2019-11-20 11:47:36 -08:00
page_ref.h
pagemap.h mm/swap.c: don't pass "enum lru_list" to trace_mm_lru_insertion() 2021-02-24 13:38:33 -08:00
percpu.h
power_cpu_migrate.h
power.h PM: QoS: Simplify definitions of CPU latency QoS trace events 2020-02-13 11:26:39 +01:00
preemptirq.h tracing: Change offset type to s32 in preempt/irq tracepoints 2020-01-03 11:34:37 -05:00
printk.h
pwc.h media: usb: pwc: Introduce TRACE_EVENTs for pwc_isoc_handler() 2019-01-16 11:15:11 -05:00
pwm.h pwm: Implement tracing for .get_state() and .apply_state() 2020-01-20 12:28:37 +01:00
qdisc.h net_sched: add a tracepoint for qdisc creation 2020-05-27 15:05:49 -07:00
qla.h scsi: qla2xxx: Suppress two recently introduced compiler warnings 2020-05-19 21:43:01 -04:00
qrtr.h net: qrtr: Add tracepoint support 2020-04-22 12:55:54 -07:00
random.h random32: add a tracepoint for prandom_u32() 2020-08-13 15:11:14 -07:00
rcu.h rcu/trace: Add tracing for how segcb list changes 2021-01-06 16:24:19 -08:00
rdma_core.h RDMA/core: Add trace points to follow MR allocation 2020-01-07 16:10:53 -04:00
rdma.h RDMA/core: Move the rdma_show_ib_cm_event() macro 2020-08-24 16:01:47 -03:00
regulator.h regulator: core: Add regulator bypass trace points 2020-05-29 17:17:02 +01:00
rpcgss.h SUNRPC: Augment server-side rpcgss tracepoints 2020-07-13 17:28:24 -04:00
rpcrdma.h rpcrdma: Capture bytes received in Receive completion tracepoints 2021-02-05 11:16:56 -05:00
rpm.h PM-runtime: add tracepoints for usage_count changes 2020-01-13 12:28:29 +01:00
rseq.h rseq: Introduce restartable sequences system call 2018-06-06 11:58:31 +02:00
rtc.h
rxrpc.h rxrpc: Fix a missing NULL-pointer check in a trace 2020-09-14 16:18:59 +01:00
sched.h kthread: remove comments about old _do_fork() helper 2021-01-11 15:11:56 +01:00
scmi.h firmware: arm_scmi: Use signed integer to report transfer status 2020-06-30 14:07:08 +01:00
scsi.h
sctp.h sctp: move trace_sctp_probe_path into sctp_outq_sack 2019-12-26 13:06:45 -08:00
signal.h signal: Distinguish between kernel_siginfo and siginfo 2018-10-03 16:47:43 +02:00
siox.h
skb.h
smbus.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
sock.h tcp: Define IPPROTO_MPTCP 2020-01-09 18:41:41 -08:00
spi.h spi/trace: Cap buffer contents at 64 bytes 2019-05-02 10:37:52 +09:00
spmi.h
sunrpc.h SUNRPC: Display RPC procedure names instead of proc numbers 2021-01-25 09:36:23 -05:00
sunvnet.h
swiotlb.h
syscalls.h syscalls: Remove start and number from syscall_get_arguments() args 2019-04-05 09:26:43 -04:00
target.h scsi: target: core: Add CONTROL field for trace events 2020-10-02 18:36:19 -04:00
task.h
tcp.h net: tracepoint: exposing sk_family in all tcp:tracepoints 2021-02-04 09:25:36 -08:00
tegra_apb_dma.h tracing: Fix header include guards in trace event headers 2019-07-30 21:49:06 -04:00
thermal_power_allocator.h
thermal.h thermal: devfreq_cooling: change tracing function and arguments 2020-12-11 14:10:44 +01:00
thp.h
timer.h y2038: syscall implementation cleanups 2019-12-01 14:00:59 -08:00
tlb.h
udp.h
ufs.h scsi: ufs: Make UPIU trace easier differentiate among CDB, OSF, and TM 2021-01-07 22:29:10 -05:00
v4l2.h media: v4l2: abstract timeval handling in v4l2_buffer 2020-01-03 15:43:35 +01:00
vb2.h
vmscan.h mm/page_alloc: integrate classzone_idx and high_zoneidx 2020-06-03 20:09:44 -07:00
vsock_virtio_transport_common.h
wbt.h bdi: use bdi_dev_name() to get device name 2020-05-09 16:07:39 -06:00
workqueue.h workqueue/tracing: Copy workqueue name to buffer in trace event 2021-03-18 12:57:37 -04:00
writeback.h Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2020-12-04 07:48:12 -08:00
xdp.h bpf: Remove trailing semicolon in macro definition 2020-12-04 20:37:36 +01:00
xen.h x86/paravirt: Remove set_pte_at() pv-op 2020-08-15 13:52:12 +02:00