]> git.ipfire.org Git - thirdparty/systemd.git/commit
networkd: fix for networkd crash when client sends Option 82 via SendOption=
authorNandakumar Raghavan <naraghavan@microsoft.com>
Tue, 10 Mar 2026 06:54:33 +0000 (06:54 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 10 Mar 2026 17:29:59 +0000 (18:29 +0100)
commit6d7cb9a6b8361d2b327222bc12872a3676358bc3
tree741a8b493a25972d33a030efdd3e80565f5fcfe7
parent5647a19a583b120c26962d9fef9beb18baf63428
networkd: fix for networkd crash when client sends Option 82 via SendOption=

When a DHCP client uses SendOption=82:string:..., option_append() calls
the SD_DHCP_OPTION_RELAY_AGENT_INFORMATION case which was written for
the server relay path. It casts optval to sd_dhcp_server* and calls
strlen() on its members, but optval is actually raw binary data from
the client, causing SIGSEGV. The same is applicable when option 43 and
option 77 are passed to SendOption.

Fix by checking optlen > 0 and appending the option as a plain TLV,
skipping the server-specific relay agent logic.
src/libsystemd-network/dhcp-option.c