summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2020-10-02 09:46:04 +0200
committerDavid S. Miller <davem@davemloft.net>2020-10-02 13:07:42 -0700
commit949ca6b82e43b342dba153a9fd643fb1b5e9f034 (patch)
tree2c6e4b48a50f0cbed8cc9600fa40c4146e9b52c3 /include/net
parent360f89874635b08057757376b8cc4faa221862e2 (diff)
netlink: fix policy dump leak
[ Upstream commit a95bc734e60449e7b073ff7ff70c35083b290ae9 ] 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>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/netlink.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h
index b2cf34f53e55..9e7eca961a98 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -1938,7 +1938,8 @@ void nla_get_range_signed(const struct nla_policy *pt,
int netlink_policy_dump_start(const struct nla_policy *policy,
unsigned int maxtype,
unsigned long *state);
-bool netlink_policy_dump_loop(unsigned long *state);
+bool netlink_policy_dump_loop(unsigned long state);
int netlink_policy_dump_write(struct sk_buff *skb, unsigned long state);
+void netlink_policy_dump_free(unsigned long state);
#endif