Skip to content

Commit

Permalink
ca8210: fix mac_len negative array access
Browse files Browse the repository at this point in the history
This patch fixes a buffer overflow access of skb->data if
ieee802154_hdr_peek_addrs() fails.

Reported-by: lianhui tang <bluetlh@gmail.com>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Link: https://lore.kernel.org/r/20230217042504.3303396-1-aahringo@redhat.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
  • Loading branch information
Alexander Aring authored and Stefan Schmidt committed Mar 2, 2023
1 parent 044c8bf commit 6c99377
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ieee802154/ca8210.c
Original file line number Diff line number Diff line change
Expand Up @@ -1913,6 +1913,8 @@ static int ca8210_skb_tx(
* packet
*/
mac_len = ieee802154_hdr_peek_addrs(skb, &header);
if (mac_len < 0)
return mac_len;

secspec.security_level = header.sec.level;
secspec.key_id_mode = header.sec.key_id_mode;
Expand Down

0 comments on commit 6c99377

Please sign in to comment.