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, Nov 24, 3:38 PM
Unknown Object (File)
Sat, Nov 16, 12:46 AM
Unknown Object (File)
Sat, Nov 16, 12:29 AM
Unknown Object (File)
Fri, Nov 15, 9:28 PM
Unknown Object (File)
Sep 18 2024, 6:41 PM
Unknown Object (File)
Sep 18 2024, 5:37 AM
Unknown Object (File)
Sep 18 2024, 2:57 AM
Unknown Object (File)
Sep 17 2024, 7: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 Not Applicable
Unit
Tests Not Applicable