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
F85366694: D44392.id135900.diff
Wed, Jun 5, 12:50 AM
Unknown Object (File)
Tue, May 28, 9:21 PM
Unknown Object (File)
Thu, May 23, 10:37 AM
Unknown Object (File)
Thu, May 23, 6:51 AM
Unknown Object (File)
Sun, May 19, 12:26 AM
Unknown Object (File)
Thu, May 16, 2:25 PM
Unknown Object (File)
Sat, May 11, 9:07 PM
Unknown Object (File)
Tue, May 7, 9:05 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 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.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.