Bug 258420 - stge: fix null pointer dereference
Summary: stge: fix null pointer dereference
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-11 07:20 UTC by Tong Zhang
Modified: 2021-09-15 05:59 UTC (History)
0 users

See Also:


Attachments
patch (1.04 KB, patch)
2021-09-11 07:20 UTC, Tong Zhang
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tong Zhang 2021-09-11 07:20:21 UTC
Created attachment 227824 [details]
patch

stge_attach() could fail at line 464, sc->sc_spec remains NULL when
calling stge_detach(), thus bus_release_resources() at line 704 will
trigger null pointer dereference. We need to check the nulliness before
calling bus_release_resources().