netlink: fix policy dump leak
authorJohannes Berg <johannes.berg@intel.com>
Fri, 2 Oct 2020 07:46:04 +0000 (09:46 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Oct 2020 20:00:38 +0000 (13:00 -0700)
commita95bc734e60449e7b073ff7ff70c35083b290ae9
treeb07e2f039e791ab243a7f65f7c4758b339ee80b2
parentef9da46ddef071e1bbb943afbbe9b38771855554
netlink: fix policy dump leak

If userspace doesn't complete the policy dump, we leak the
allocated state. Fix this.

Fixes: d07dcf9aadd6 ("netlink: add infrastructure to expose policies to userspace")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/netlink.h
net/netlink/genetlink.c
net/netlink/policy.c