]> git.ipfire.org Git - thirdparty/linux.git/commit
firmware: arm_ffa: Snapshot notifier callbacks under lock
authorSudeep Holla <sudeep.holla@kernel.org>
Tue, 28 Apr 2026 18:33:34 +0000 (19:33 +0100)
committerSudeep Holla <sudeep.holla@kernel.org>
Tue, 5 May 2026 15:42:49 +0000 (16:42 +0100)
commit38290b180a4d5746baed796d49f88d56d2f336cd
tree65aab1cf0cf6de93141b9128a9ef13a7a41d006f
parent0399e3f872ca3d78044bb715a73ea645806d2c7b
firmware: arm_ffa: Snapshot notifier callbacks under lock

Both notification handlers currently look up a notifier callback under
notify_lock, drop the lock, and then dereference the returned
notifier entry. A concurrent unregister can delete and free that
entry in the gap, leaving the handler to dereference stale memory.

Copy the callback pointer and callback data while notify_lock is
still held and invoke the callback only after the lock is dropped.
This keeps the existing callback execution model while removing the
use-after-free window in both the framework and non-framework
notification paths.

Fixes: 285a5ea0f542 ("firmware: arm_ffa: Add support for handling framework notifications")
Link: https://patch.msgid.link/20260428-ffa_fixes-v2-10-8595ae450034@kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
drivers/firmware/arm_ffa/driver.c