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, Jul 14, 12:45 AM
Unknown Object (File)
Fri, Jul 11, 4:28 PM
Unknown Object (File)
Mon, Jul 7, 6:15 AM
Unknown Object (File)
Sun, Jul 6, 12:47 PM
Unknown Object (File)
Fri, Jul 4, 5:38 PM
Unknown Object (File)
Wed, Jul 2, 2:41 PM
Unknown Object (File)
Tue, Jul 1, 2:21 AM
Unknown Object (File)
Mon, Jun 30, 1:15 PM
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 64721
Build 61605: 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.