kvm instrumentation: Fix kvm_mmio event NULL pointer dereference
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 4 Jul 2024 15:22:23 +0000 (11:22 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 4 Jul 2024 15:31:04 +0000 (11:31 -0400)
commita4e692df24f680ace02d8d7a0e98f5b8efcbbced
tree536d8a711bd9b00255ca36301c5fcabddd3da922
parent962fedb52d39b18406aad8551dc69f2c0c766af5
kvm instrumentation: Fix kvm_mmio event NULL pointer dereference

Upstream Linux commit e39d200fa5bf ("KVM: Fix stack-out-of-bounds read
in write_mmio") introduce a NULL pointer check within TP_fast_assign().

lttng-modules commit 33630522da97 ("Update kvm instrumentation for 4.15")
introduce use of:

  ctf_sequence_hex(unsigned char, val, val, u32, len)

without the required NULL pointer check, which can trigger NULL pointer
dereference in case of unsatisfied MMIO read.

Add the missing NULL pointer check. Record a sequence of length 0 in the
trace when the val pointer is NULL.

Reported-by: Fahad Arslan <fahad.arslan@siemens.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I51a171a56af96e2cf68dba73f7eb473dd6c0ba0e
include/instrumentation/events/kvm.h
This page took 0.02636 seconds and 4 git commands to generate.