Skip to content

Commit a9a5070

Browse files
committed
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/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 49b0b6f + 1090340 commit a9a5070

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

drivers/net/ieee802154/mac802154_hwsim.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ static int hwsim_new_edge_nl(struct sk_buff *msg, struct genl_info *info)
418418
struct hwsim_edge *e;
419419
u32 v0, v1;
420420

421-
if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] &&
421+
if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] ||
422422
!info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE])
423423
return -EINVAL;
424424

@@ -528,14 +528,14 @@ static int hwsim_set_edge_lqi(struct sk_buff *msg, struct genl_info *info)
528528
u32 v0, v1;
529529
u8 lqi;
530530

531-
if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] &&
531+
if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] ||
532532
!info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE])
533533
return -EINVAL;
534534

535535
if (nla_parse_nested_deprecated(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX, info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE], hwsim_edge_policy, NULL))
536536
return -EINVAL;
537537

538-
if (!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID] &&
538+
if (!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID] ||
539539
!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_LQI])
540540
return -EINVAL;
541541

net/ieee802154/socket.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,11 @@ static const struct proto_ops ieee802154_dgram_ops = {
984984
.sendpage = sock_no_sendpage,
985985
};
986986

987+
static void ieee802154_sock_destruct(struct sock *sk)
988+
{
989+
skb_queue_purge(&sk->sk_receive_queue);
990+
}
991+
987992
/* Create a socket. Initialise the socket, blank the addresses
988993
* set the state.
989994
*/
@@ -1024,7 +1029,7 @@ static int ieee802154_create(struct net *net, struct socket *sock,
10241029
sock->ops = ops;
10251030

10261031
sock_init_data(sock, sk);
1027-
/* FIXME: sk->sk_destruct */
1032+
sk->sk_destruct = ieee802154_sock_destruct;
10281033
sk->sk_family = PF_IEEE802154;
10291034

10301035
/* Checksums on by default */

0 commit comments

Comments
 (0)