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
Unknown Object (File)
Sat, Feb 8, 2:40 AM
Unknown Object (File)
Sat, Feb 8, 2:39 AM
Unknown Object (File)
Mon, Jan 27, 4:41 PM
Unknown Object (File)
Sun, Jan 26, 5:57 PM
Unknown Object (File)
Fri, Jan 24, 6:02 PM
Unknown Object (File)
Fri, Jan 24, 5:44 PM
Unknown Object (File)
Tue, Jan 21, 11:41 AM
Unknown Object (File)
Jan 10 2025, 10:33 AM

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 Skipped
Unit
Tests Skipped
Build Status
Buildable 56645
Build 53533: arc lint + arc unit

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.Mar 29 2024, 8:28 PM

Apologizes for bumping this review. I've realized that this was most likely an inappropriate place to send my message, and have thusly switched over to the freebsd-emulation mailing list.