netlink: fix policy dump leak
If userspace doesn't complete the policy dump, we leak the
allocated state. Fix this.
Fixes: d07dcf9aad ("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>
This commit is contained in:
committed by
David S. Miller
parent
ef9da46dde
commit
a95bc734e6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user