Page MenuHomeFreeBSD

mrsas: Don't leak a stack pointer value in the softc.
ClosedPublic

Authored by jhb on Dec 7 2022, 8:36 PM.
Tags
None
Referenced Files
F114976333: D37628.id114382.diff
Sat, Apr 19, 5:40 AM
Unknown Object (File)
Fri, Apr 18, 1:52 AM
Unknown Object (File)
Fri, Apr 18, 1:01 AM
Unknown Object (File)
Fri, Apr 18, 12:55 AM
Unknown Object (File)
Fri, Apr 18, 12:54 AM
Unknown Object (File)
Fri, Apr 18, 12:49 AM
Unknown Object (File)
Thu, Apr 17, 11:47 PM
Unknown Object (File)
Thu, Apr 17, 10:37 PM
Subscribers
None

Details

Summary

mrsas_issue_blocked_cmd stores a pointer to an on-stack variable
in its softc so that the driver can call wakeup() on the correct
pointer. Once the loop around tsleep() has finished however, the
pointer is no longer needed and any further use would be invalid.
Clear sc->chan to NULL after the loop.

Reported by: GCC -Wdangling-pointer

Diff Detail

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