On Mon, Jun 28, 2021 at 10:28:00PM -0000, Dan Streetman wrote:
> systemd doesn't use iproute2 tooling to set the altnames, it sets them
> directly with netlink.
You're right. The problem is that it does so w/ possibly uninitialized
memory. I added the following patch to demonstrate:
--- systemd-245.4.orig/src/udev/net/link-config.c
+++ systemd-245.4/src/udev/net/link-config.c
@@ -530,6 +530,7 @@ int link_config_apply(link_config_ctx *c assert_not_reached("invalid policy"); } if (!isempty(n)) {
+ log_debug("DANNF: adding altname %s", n); r = strv_extend(&altnames, n); if (r < 0) return log_oom();
Which logs the following:
DANNF: adding altname ��
DANNF: adding altname ��'���
DANNF: adding altname ��'���
DANNF: adding altname enp7s0v0
Which is because we never enter the preceding switch statement.
> what's the output from udevadm info for one of the affected interfaces?
> e.g.
>
> $ udevadm info /sys/class/net/eno1v0
Here's the output from the interface with which I'm reproducing:
On Mon, Jun 28, 2021 at 10:28:00PM -0000, Dan Streetman wrote:
> systemd doesn't use iproute2 tooling to set the altnames, it sets them
> directly with netlink.
You're right. The problem is that it does so w/ possibly uninitialized
memory. I added the following patch to demonstrate:
--- systemd- 245.4.orig/ src/udev/ net/link- config. c 245.4/src/ udev/net/ link-config. c apply(link_ config_ ctx *c
assert_ not_reached( "invalid policy");
}
if (!isempty(n)) {
r = strv_extend( &altnames, n);
if (r < 0)
return log_oom();
+++ systemd-
@@ -530,6 +530,7 @@ int link_config_
+ log_debug("DANNF: adding altname %s", n);
Which logs the following:
DANNF: adding altname ��
DANNF: adding altname ��'���
DANNF: adding altname ��'���
DANNF: adding altname enp7s0v0
Which is because we never enter the preceding switch statement.
> what's the output from udevadm info for one of the affected interfaces? net/eno1v0
> e.g.
>
> $ udevadm info /sys/class/
Here's the output from the interface with which I'm reproducing:
$ sudo udevadm info /sys/class/ net/enp7s0v0 pci0000: 00/0000: 00:0c.0/ 0000:04: 00.0/0000: 05:01.0/ 0000:07: 00.1/net/ enp7s0v0 /devices/ pci0000: 00/0000: 00:0c.0/ 0000:04: 00.0/0000: 05:01.0/ 0000:07: 00.1/net/ enp7s0v0 D=59449992522 NAMING_ SCHEME= v245 NAME_PATH= enp7s0v0 CLASS_FROM_ DATABASE= Network controller SUBCLASS_ FROM_DATABASE= Ethernet controller FROM_DATABASE= Huawei Technologies Co., Ltd. FROM_DATABASE= Hi1822 Family Virtual Function pci-0000: 07:00.1 TAG=pci- 0000_07_ 00_1 LINK_FILE= /usr/lib/ systemd/ network/ 99-default. link NAME=enp7s0v0 ALIAS=/ sys/subsystem/ net/devices/ enp7s0v0 /sys/subsystem/ net/devices/ enp7s0v0
P: /devices/
L: 0
E: DEVPATH=
E: INTERFACE=enp7s0v0
E: IFINDEX=19
E: SUBSYSTEM=net
E: USEC_INITIALIZE
E: ID_MM_CANDIDATE=1
E: ID_NET_
E: ID_NET_
E: ID_BUS=pci
E: ID_VENDOR_ID=0x19e5
E: ID_MODEL_ID=0x375e
E: ID_PCI_
E: ID_PCI_
E: ID_VENDOR_
E: ID_MODEL_
E: ID_PATH=
E: ID_PATH_
E: ID_NET_DRIVER=hinic
E: ID_NET_
E: ID_NET_
E: SYSTEMD_
E: TAGS=:systemd: