]> git.baikalelectronics.ru Git - kernel.git/commit
net: limit altnames to 64k total
authorJakub Kicinski <kuba@kernel.org>
Wed, 9 Mar 2022 18:29:14 +0000 (10:29 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 11 Mar 2022 04:15:23 +0000 (20:15 -0800)
commitf1c8dcf86197c7ab1416afc14efa31d1d90c6e63
treef2284583cd179aa85c97b4f0439c6af6d4414387
parent2b9497a0c93c1dac86fd186563fa5b1d9de69207
net: limit altnames to 64k total

Property list (altname is a link "property") is wrapped
in a nlattr. nlattrs length is 16bit so practically
speaking the list of properties can't be longer than
that, otherwise user space would have to interpret
broken netlink messages.

Prevent the problem from occurring by checking the length
of the property list before adding new entries.

Reported-by: George Shuklin <george.shuklin@gmail.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/rtnetlink.c