Page MenuHomeFreeBSD

scmi: Avoid a use-after-free
ClosedPublic

Authored by andrew on Jun 9 2025, 3:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 24, 9:59 PM
Unknown Object (File)
Thu, Nov 20, 9:39 AM
Unknown Object (File)
Mon, Nov 3, 9:48 PM
Unknown Object (File)
Oct 27 2025, 2:56 AM
Unknown Object (File)
Oct 22 2025, 1:54 AM
Unknown Object (File)
Oct 22 2025, 1:54 AM
Unknown Object (File)
Oct 21 2025, 2:23 AM
Unknown Object (File)
Oct 21 2025, 2:22 AM
Subscribers

Details

Summary

Use LIST_FOREACH_SAFE to avoid a use-after-free in scmi_reqs_pool_free.
The next pointer will be invalid after the call to free meaning
LIST_FOREACH will dereference a freed struct to move to the next item.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 64746
Build 61630: arc lint + arc unit

Event Timeline

andrew requested review of this revision.Jun 9 2025, 3:47 PM

LGTM with two little notes:

Commit message cut off

The next pointer will be invalid when

Also it seems we generally have unique names for the field and tvar (I spotted one existing duplicate case, in uath_txfrag_setup)

This revision is now accepted and ready to land.Jun 10 2025, 4:48 PM
This revision was automatically updated to reflect the committed changes.