[Bug 279012] Linuxulator: Glibc getaddrinfo(3) Breakage

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 15 May 2024 17:38:02 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279012

            Bug ID: 279012
           Summary: Linuxulator: Glibc getaddrinfo(3) Breakage
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: gnats@duck.com

In commit
https://cgit.freebsd.org/src/commit?id=b977dd1ea5fbc2df3f1279330be4d089322eb2cf
, the check

if (hdr->nlmsg_len < sizeof(struct nlmsghdr) + sizeof(struct ifaddrmsg))
    return (EBADMSG);

in `sys/compat/linux/linux_netlink.c:97` was added and caused glibc's 
getaddrinfo(3) to break. This, as one might think, causes quite a few 
programs in the linuxulator to stop working. After looking into it, glibc 
is indeed not sending what we're expecting. Not only are they not 
including the space of the header, but they're also using the seemingly 
depreciated (i.e no documentation [i could find] speaking of it) 
`rtgenmsg` format. [1] While indeed we also have this in our source tree 
`sys/netlink/route/route.h:363`, it's used nowhere except in 
`crypto/heimdal/lib/roken/getifaddrs.c:275`; however, even in that code, 
they make sure to include the space of the header with the 
`NLMSG_LENGTH` macro. Obliviously, please take this with a large grain 
of salt as I'm quite inexperienced. That being said, I believe our best 
bet would be to contact upstream, and in the meantime, implement this 
functionality. On the latter half, I would be more than happy to do said 
implementing, all I would need are some pointers to relevant 
documentation.

Cheers!

[1]
https://elixir.bootlin.com/glibc/latest/source/sysdeps/unix/sysv/linux/check_pf.c#L92

-- 
You are receiving this mail because:
You are the assignee for the bug.