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
F132262362: D13652.id37091.diff
Wed, Oct 15, 7:22 AM
F132262361: D13652.id37841.diff
Wed, Oct 15, 7:22 AM
F132262358: D13652.id.diff
Wed, Oct 15, 7:22 AM
Unknown Object (File)
Tue, Oct 14, 9:13 PM
Unknown Object (File)
Aug 11 2025, 2:21 PM
Unknown Object (File)
Jul 29 2025, 7:58 AM
Unknown Object (File)
Jul 26 2025, 8:28 PM
Unknown Object (File)
Jun 30 2025, 8:40 PM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 13868

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.