]> git.ipfire.org Git - thirdparty/linux.git/commit
ipv4: validate IPV4_DEVCONF attributes properly
authorFernando Fernandez Mancera <fmancera@suse.de>
Thu, 12 Mar 2026 14:26:37 +0000 (15:26 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 14 Mar 2026 16:52:30 +0000 (09:52 -0700)
commitfa8fca88714c3a4a74f972ed37328e2f0bbef9fa
tree7e7c094179be106de13768ecc4a74d1058df1373
parentf807b5b9b89eb9220d034115c272c312251cbcac
ipv4: validate IPV4_DEVCONF attributes properly

As the IPV4_DEVCONF netlink attributes are not being validated, it is
possible to use netlink to set read-only values like mc_forwarding. In
addition, valid ranges are not being validated neither but that is less
relevant as they aren't in sysctl.

To avoid similar situations in the future, define a NLA policy for
IPV4_DEVCONF attributes which are nested in IFLA_INET_CONF.

Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Link: https://patch.msgid.link/20260312142637.5704-1-fmancera@suse.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/devinet.c