Page MenuHomeFreeBSD

linux: make linux_netlink_p->msg_from_linux be able to fail
ClosedPublic

Authored by glebius on Mar 16 2024, 4:20 PM.
Tags
None
Referenced Files
F82394893: D44392.id135900.diff
Sun, Apr 28, 2:54 AM
F82275472: D44392.id.diff
Sat, Apr 27, 5:24 AM
Unknown Object (File)
Sat, Apr 27, 12:48 AM
Unknown Object (File)
Fri, Apr 26, 11:38 PM
Unknown Object (File)
Fri, Apr 26, 9:28 PM
Unknown Object (File)
Fri, Apr 26, 4:17 AM
Unknown Object (File)
Sat, Apr 6, 7:04 PM
Unknown Object (File)
Fri, Mar 29, 9:38 PM
Subscribers

Details

Summary

The KPI for this function was misleading. From the NetLink perspective it
looked like a function that: a) allocates new hdr, b) can fail. Neither
was true. Let the function return a error code instead of returning the
same hdr it was passed to. In case if future Linux NetLink compatibility
support calls for reallocating hdr, we can change KPI to pass struct nlmsg
hdr **.

With KPI that returns a error, propagate domain conversion errors all the
way up to NetLink module. This fixes panic when unknown domain is
converted to 0xff and this invalid value is passed into NetLink
processing.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Add family check to rtnl_route_from_linux(). The strange manipulation with
rt_table blinded me and I didn't notice rt_family going unchecked.

Pass hdr as pointer to pointer.

This revision is now accepted and ready to land.Fri, Mar 29, 8:28 PM