Commit a9a50701 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge tag 'ieee802154-for-davem-2021-08-12' of...

Merge tag 'ieee802154-for-davem-2021-08-12' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan

Stefan Schmidt says:

====================
ieee802154 for net 2021-08-12

Mostly fixes coming from bot reports. Dongliang Mu tackled some syzkaller
reports in hwsim again and Takeshi Misawa a memory leak  in  ieee802154 raw.

* tag 'ieee802154-for-davem-2021-08-12' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan:
  net: Fix memory leak in ieee802154_raw_deliver
  ieee802154: hwsim: fix GPF in hwsim_new_edge_nl
  ieee802154: hwsim: fix GPF in hwsim_set_edge_lqi
====================

Link: https://lore.kernel.org/r/20210812183912.1663996-1-stefan@datenfreihafen.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 49b0b6ff 1090340f
...@@ -418,7 +418,7 @@ static int hwsim_new_edge_nl(struct sk_buff *msg, struct genl_info *info) ...@@ -418,7 +418,7 @@ static int hwsim_new_edge_nl(struct sk_buff *msg, struct genl_info *info)
struct hwsim_edge *e; struct hwsim_edge *e;
u32 v0, v1; u32 v0, v1;
if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] && if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] ||
!info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE]) !info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE])
return -EINVAL; return -EINVAL;
...@@ -528,14 +528,14 @@ static int hwsim_set_edge_lqi(struct sk_buff *msg, struct genl_info *info) ...@@ -528,14 +528,14 @@ static int hwsim_set_edge_lqi(struct sk_buff *msg, struct genl_info *info)
u32 v0, v1; u32 v0, v1;
u8 lqi; u8 lqi;
if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] && if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] ||
!info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE]) !info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE])
return -EINVAL; return -EINVAL;
if (nla_parse_nested_deprecated(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX, info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE], hwsim_edge_policy, NULL)) if (nla_parse_nested_deprecated(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX, info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE], hwsim_edge_policy, NULL))
return -EINVAL; return -EINVAL;
if (!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID] && if (!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID] ||
!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_LQI]) !edge_attrs[MAC802154_HWSIM_EDGE_ATTR_LQI])
return -EINVAL; return -EINVAL;
......
...@@ -984,6 +984,11 @@ static const struct proto_ops ieee802154_dgram_ops = { ...@@ -984,6 +984,11 @@ static const struct proto_ops ieee802154_dgram_ops = {
.sendpage = sock_no_sendpage, .sendpage = sock_no_sendpage,
}; };
static void ieee802154_sock_destruct(struct sock *sk)
{
skb_queue_purge(&sk->sk_receive_queue);
}
/* Create a socket. Initialise the socket, blank the addresses /* Create a socket. Initialise the socket, blank the addresses
* set the state. * set the state.
*/ */
...@@ -1024,7 +1029,7 @@ static int ieee802154_create(struct net *net, struct socket *sock, ...@@ -1024,7 +1029,7 @@ static int ieee802154_create(struct net *net, struct socket *sock,
sock->ops = ops; sock->ops = ops;
sock_init_data(sock, sk); sock_init_data(sock, sk);
/* FIXME: sk->sk_destruct */ sk->sk_destruct = ieee802154_sock_destruct;
sk->sk_family = PF_IEEE802154; sk->sk_family = PF_IEEE802154;
/* Checksums on by default */ /* Checksums on by default */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment