]> git.baikalelectronics.ru Git - kernel.git/commit
netlink: limit recursion depth in policy validation
authorJohannes Berg <johannes.berg@intel.com>
Thu, 30 Apr 2020 20:13:06 +0000 (22:13 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 May 2020 00:51:41 +0000 (17:51 -0700)
commitfaf2a3d6c0dfa2b4443404122a75c392490a665c
treeb033fd6f80a1eb1972935660663321c1168c7f59
parent8bcf49fcc5810f8b0f4f807860b90672ddc1f77d
netlink: limit recursion depth in policy validation

Now that we have nested policies, we can theoretically
recurse forever parsing attributes if a (sub-)policy
refers back to a higher level one. This is a situation
that has happened in nl80211, and we've avoided it there
by not linking it.

Add some code to netlink parsing to limit recursion depth.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/nlattr.c