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
Unknown Object (File)
Sun, Oct 12, 3:35 PM
Unknown Object (File)
Sun, Oct 12, 4:23 AM
Unknown Object (File)
Sun, Oct 12, 4:22 AM
Unknown Object (File)
Sun, Oct 12, 4:22 AM
Unknown Object (File)
Sat, Oct 11, 6:21 PM
Unknown Object (File)
Aug 14 2025, 10:58 PM
Unknown Object (File)
Jul 28 2025, 5:47 PM
Unknown Object (File)
Jul 28 2025, 5:36 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 Not Applicable
Unit
Tests Not Applicable