Skip to content

Commit

Permalink
mac802154: Fix possible double free upon parsing error
Browse files Browse the repository at this point in the history
Commit 4d1c7d8 ("mac802154: Move an skb free within the rx path")
tried to simplify error handling within the receive path by moving the
kfree_skb() call at the very end of the top-level function but missed
one kfree_skb() called upon frame parsing error. Prevent this possible
double free from happening.

Fixes: 4d1c7d8 ("mac802154: Move an skb free within the rx path")
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20221216235742.646134-1-miquel.raynal@bootlin.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
  • Loading branch information
miquelraynal authored and Stefan-Schmidt committed Dec 19, 2022
1 parent 9cd3fd2 commit 71a06f1
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion net/mac802154/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ __ieee802154_rx_handle_packet(struct ieee802154_local *local,
ret = ieee802154_parse_frame_start(skb, &hdr);
if (ret) {
pr_debug("got invalid frame\n");
kfree_skb(skb);
return;
}

Expand Down

0 comments on commit 71a06f1

Please sign in to comment.