Page MenuHomeFreeBSD

Fix leak of memory and file refs with sendmsg(2) over unix domain sockets.
ClosedPublic

Authored by kib on Jul 19 2019, 7:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 10 2024, 9:03 AM
Unknown Object (File)
Jan 30 2024, 2:21 PM
Unknown Object (File)
Dec 28 2023, 3:00 AM
Unknown Object (File)
Dec 19 2023, 11:25 AM
Unknown Object (File)
Dec 9 2023, 8:04 PM
Unknown Object (File)
Nov 22 2023, 11:40 PM
Unknown Object (File)
Aug 24 2023, 7:53 PM
Unknown Object (File)
Aug 8 2023, 12:06 PM
Subscribers

Details

Summary

When sendmsg(2) sucessfully internalized one SCM_RIGHTS control message, but failed to process some other control message later, both file references and filedescent memory needs to be freed. This was not done, only mbuf chain was freed.

Noted by: markj

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj added inline comments.
sys/kern/uipc_usrreq.c
2124 ↗(On Diff #59940)

td seems to be unused.

2163 ↗(On Diff #59940)

Could you move the initialization of control here? I think that would make it a bit easier to see what's going on.

2165 ↗(On Diff #59940)

I don't understand where the name icontrolp comes from.

This revision is now accepted and ready to land.Jul 19 2019, 7:56 PM
kib marked 2 inline comments as done.Jul 19 2019, 8:15 PM
kib added inline comments.
sys/kern/uipc_usrreq.c
2165 ↗(On Diff #59940)

Do you mean that you do not see what the contraction means ? I renamed the var to initial_controlp.

Remove unused arg.
Move initializations around.
Rename the var.

This revision now requires review to proceed.Jul 19 2019, 8:16 PM
markj added inline comments.
sys/kern/uipc_usrreq.c
2165 ↗(On Diff #59940)

Ah, I assumed it meant "input controlp".

This revision is now accepted and ready to land.Jul 19 2019, 8:19 PM