diff options
author | Alexander Aring <aahringo@redhat.com> | 2023-02-16 23:25:04 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-04-05 11:15:36 +0200 |
commit | 5da4469a7aa011de614c3e2ae383c35a353a382e (patch) | |
tree | 0fd3fc69b24130079973dfab4d0af12c9448c785 /drivers | |
parent | fea400350d182744d35979870819b97864e1c8ca (diff) | |
download | linux-stable-5da4469a7aa011de614c3e2ae383c35a353a382e.tar.gz linux-stable-5da4469a7aa011de614c3e2ae383c35a353a382e.tar.bz2 linux-stable-5da4469a7aa011de614c3e2ae383c35a353a382e.zip |
ca8210: fix mac_len negative array access
[ Upstream commit 6c993779ea1d0cccdb3a5d7d45446dd229e610a3 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ieee802154/ca8210.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index 917edb3d04b7..2d4471b77fa7 100644 --- a/drivers/net/ieee802154/ca8210.c +++ b/drivers/net/ieee802154/ca8210.c @@ -1954,6 +1954,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; |