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)
Mon, Dec 23, 6:26 AM
Unknown Object (File)
Nov 30 2024, 5:00 PM
Unknown Object (File)
Nov 29 2024, 10:10 PM
Unknown Object (File)
Nov 18 2024, 10:46 PM
Unknown Object (File)
Nov 13 2024, 7:33 AM
Unknown Object (File)
Oct 20 2024, 11:16 PM
Unknown Object (File)
Oct 6 2024, 7:04 PM
Unknown Object (File)
Sep 28 2024, 7:07 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