Page MenuHomeFreeBSD

scmi: Avoid a use-after-free
ClosedPublic

Authored by andrew on Mon, Jun 9, 3:47 PM.
Tags
None
Referenced Files
F120341621: D50753.id156827.diff
Tue, Jun 17, 5:05 AM
F120320064: D50753.id156787.diff
Tue, Jun 17, 1:14 AM
Unknown Object (File)
Sun, Jun 15, 8:44 AM
Unknown Object (File)
Thu, Jun 12, 8:16 AM
Unknown Object (File)
Wed, Jun 11, 9:35 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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

andrew requested review of this revision.Mon, Jun 9, 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.Tue, Jun 10, 4:48 PM
This revision was automatically updated to reflect the committed changes.