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)
Fri, May 10, 10:06 AM
Unknown Object (File)
Wed, May 1, 4:13 PM
Unknown Object (File)
Tue, Apr 30, 2:14 PM
Unknown Object (File)
Tue, Apr 30, 2:14 PM
Unknown Object (File)
Tue, Apr 30, 2:06 PM
Unknown Object (File)
Tue, Apr 30, 7:54 AM
Unknown Object (File)
Mon, Apr 22, 4:34 PM
Unknown Object (File)
Mon, Apr 22, 4:34 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