Page MenuHomeFreeBSD

Check the return value of the dom_externalize.
Needs ReviewPublic

Authored by oshogbo on Jul 24 2019, 3:20 AM.

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 OK
Unit
No Unit Test Coverage
Build Status
Buildable 25482
Build 24101: arc lint + arc unit

Event Timeline

oshogbo created this revision.Jul 24 2019, 3:20 AM
kib added inline comments.Jul 24 2019, 9:36 AM
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.

oshogbo added inline comments.Jul 24 2019, 10:05 AM
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.

markj added inline comments.Jul 29 2019, 3:33 PM
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.