HomeFreeBSD

linux: allow RTM_GETADDR without full ifaddrmsg argument

Description

linux: allow RTM_GETADDR without full ifaddrmsg argument

Even modern glibc uses truncated argument for RTM_GETADDR when it wants to
list all addresses in a system. See
sysdeps/unix/sysv/linux/ifaddrs.c:netlink_sendreq(). It sends a one
char payload. Linux kernel allows that as long as given socket is not
marked as a 'strict'. We have a similar flag in the general netlink code
and it is checked in
sys/netlink/netlink_message_parser.h:nl_parse_header(). If the flag is
not present, parser will allocate a temporary zeroed buffer to make the
message correct. The checks added in b977dd1ea5fb blocked such message
before the parser. My reading of glibc says that there are two types of
messages that are sent with
netlink_sendreq() - RTM_GETLINK and
RTM_GETADDR. The RTM_GETLINK is binary compatible between Linux and
FreeBSD and thus doesn't need any ABI handler.

PR: 279012
Fixes: b977dd1ea5fbc2df3f1279330be4d089322eb2cf

Details

Provenance
glebiusAuthored on May 28 2024, 8:13 PM
Parents
rG2b7c1402f96b: src.sys.obj.mk: Export OBJTOP
Branches
Unknown
Tags
Unknown