Commit 6c993779 authored by Alexander Aring's avatar Alexander Aring Committed by Stefan Schmidt

ca8210: fix mac_len negative array access

This patch fixes a buffer overflow access of skb->data if
ieee802154_hdr_peek_addrs() fails.
Reported-by: default avatarlianhui tang <bluetlh@gmail.com>
Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
Link: https://lore.kernel.org/r/20230217042504.3303396-1-aahringo@redhat.comSigned-off-by: default avatarStefan Schmidt <stefan@datenfreihafen.org>
parent 044c8bf7
......@@ -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;
......
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