Page MenuHomeFreeBSD

Set vnet when calling pru_sockaddr and pru_peeraddr
ClosedPublic

Authored by tuexen on Dec 27 2017, 2:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 2 2024, 6:24 PM
Unknown Object (File)
Oct 2 2024, 8:46 AM
Unknown Object (File)
Oct 1 2024, 11:18 PM
Unknown Object (File)
Oct 1 2024, 6:12 AM
Unknown Object (File)
Sep 23 2024, 9:28 AM
Unknown Object (File)
Sep 23 2024, 9:28 AM
Unknown Object (File)
Sep 23 2024, 9:28 AM
Unknown Object (File)
Sep 23 2024, 9:18 AM
Subscribers

Details

Summary

When pru_sockaddr is called from kern_getsockname(), the vnet is set. This is also true when pru_peeraddr is called via kern_getpeername(). However, the vnet is not net when these functions are called from soo_fill_kinfo(). This patch ensures that the vnet is also set in this case.

The corresponding SCTP functions assume the vnet to be set correctly. Right now, when a program with an wildcard bound SCTP socket crashes, the machines panics when trying to write the core file.

Diff Detail

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

Event Timeline

Seems this came in in r271976 with D775 after VIMAGE was in the tree.
You don't need to set the CURVNET() that early (only after the switch) it seems but it shouldn't matter.
Looks OK to me.

This revision is now accepted and ready to land.Jan 11 2018, 6:06 PM
This revision was automatically updated to reflect the committed changes.