Page MenuHomeFreeBSD

Check the return value of the dom_externalize.
Needs ReviewPublic

Authored by oshogbo on Jul 24 2019, 3:20 AM.
Tags
None
Referenced Files
F82056283: D21049.diff
Thu, Apr 25, 2:15 AM
Unknown Object (File)
Dec 20 2023, 3:21 AM
Unknown Object (File)
Dec 7 2023, 8:59 PM
Unknown Object (File)
Oct 26 2023, 12:12 PM
Unknown Object (File)
Sep 18 2023, 4:54 PM
Unknown Object (File)
Sep 17 2023, 8:18 AM
Unknown Object (File)
Sep 2 2023, 6:40 AM
Unknown Object (File)
Jul 12 2023, 8:33 PM
Subscribers
None

Details

Reviewers
markj
kib
Summary

The error value of the dom_externalize is fetched but never used
in those two cases.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25482
Build 24101: arc lint + arc unit

Event Timeline

sys/kern/uipc_socket.c
1896

Don't we leak cm ?

May be not, at least not in unix domain socket case, but is it guaranteed by the dom_externalize() interface ?

2523

Same question.

sys/kern/uipc_socket.c
1896

In case of the unix domain socket it would be a double free on error, and we don't have really method to check or return info if the cm was freed or not that with this interface.
TBH I don't see any other consumer of dom_externalize, I guess we should document somewhere (in struct comment?) that the cm *must be* consumed.

sys/kern/uipc_socket.c
1896

Note that we set cm->m_next = NULL above. This means that the rest of the control mbuf chain is not being freed in case of an error.