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)
Tue, Nov 11, 5:02 AM
Unknown Object (File)
Tue, Nov 11, 3:26 AM
Unknown Object (File)
Thu, Nov 6, 5:47 AM
Unknown Object (File)
Thu, Nov 6, 3:49 AM
Unknown Object (File)
Fri, Oct 17, 8:05 AM
Unknown Object (File)
Thu, Oct 16, 8:11 PM
Unknown Object (File)
Thu, Oct 16, 8:11 PM
Unknown Object (File)
Thu, Oct 16, 10:30 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 25429

Event Timeline

markj added inline comments.
sys/kern/uipc_usrreq.c
2124

td seems to be unused.

2164–2166

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

2168

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
2168

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
2168

Ah, I assumed it meant "input controlp".

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