Skip to content

Commit 201a011

Browse files
rostedtgregkh
authored andcommitted
tracing: Fix mmiotrace possible NULL dereferencing of hiter->dev
commit 144f29e upstream. If the mmio_pipe_open() fails to find a PCI device, the hiter->dev will be assigned to NULL. The mmiotrace read() function dereferences the hiter->dev if hiter exists. Change the test of the read to not only check hiter being NULL, but also the hiter->dev before dereferencing it. Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260721211143.36dbd559@gandalf.local.home Fixes: f984b51 ("ftrace: add mmiotrace plugin") Reported-by: Sashiko <sashiko-bot@kernel.org> Link: https://sashiko.dev/#/patchset/20260715143604.14481-1-gaikwad.dcg%40gmail.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1996639 commit 201a011

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/trace/trace_mmiotrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static ssize_t mmio_read(struct trace_iterator *iter, struct file *filp,
146146
goto print_out;
147147
}
148148

149-
if (!hiter)
149+
if (!hiter || !hiter->dev)
150150
return 0;
151151

152152
mmio_print_pcidev(s, hiter->dev);

0 commit comments

Comments
 (0)