Commit 00834971 authored by Harshit Mogalapalli's avatar Harshit Mogalapalli Committed by Sven Peter
Browse files

soc: apple: rtkit: Fix use-after-free in apple_rtkit_crashlog_rx()



This code calls kfree(bfr); and then passes "bfr" to rtk->ops->crashed()
which is a use after free.  The ->crashed function pointer is implemented
by apple_nvme_rtkit_crashed() and it doesn't use the "bfr" pointer so
this doesn't cause a problem.  But it still looks sketchy as can be.

Fix this by moving kfree() after the last usage of bfr.

Fixes: bf8b4e49 ("soc: apple: rtkit: Pass the crashlog to the crashed() callback")
Signed-off-by: default avatarHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: default avatarEric Curtin <ecurtin@redhat.com>
Link: https://lore.kernel.org/r/20250212085853.1357906-1-harshit.m.mogalapalli@oracle.com


Signed-off-by: default avatarSven Peter <sven@svenpeter.dev>
parent bf8b4e49
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment