summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2020-10-02 10:46:04 +0300
committerDavid S. Miller <davem@davemloft.net>2020-10-02 23:00:38 +0300
commita95bc734e60449e7b073ff7ff70c35083b290ae9 (patch)
treeb07e2f039e791ab243a7f65f7c4758b339ee80b2 /include
parentef9da46ddef071e1bbb943afbbe9b38771855554 (diff)
downloadlinux-a95bc734e60449e7b073ff7ff70c35083b290ae9.tar.xz
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>
Diffstat (limited to 'include')
-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 8e0eb2c9c528..271620f6bc7f 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -1934,7 +1934,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