Commit 35af17a8 authored by Harshit Mogalapalli's avatar Harshit Mogalapalli Committed by sanglipeng
Browse files

ca8210: Fix unsigned mac_len comparison with zero in ca8210_skb_tx()

stable inclusion
from stable-v5.10.177
commit ac63f78d9aca3cd10802b2d9e6c12a3f03b262c7
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I88YNP

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ac63f78d9aca3cd10802b2d9e6c12a3f03b262c7



--------------------------------

[ Upstream commit 748b2f5e ]

mac_len is of type unsigned, which can never be less than zero.

	mac_len = ieee802154_hdr_peek_addrs(skb, &header);
	if (mac_len < 0)
		return mac_len;

Change this to type int as ieee802154_hdr_peek_addrs() can return negative
integers, this is found by static analysis with smatch.

Fixes: 6c993779 ("ca8210: fix mac_len negative array access")
Signed-off-by: default avatarHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Acked-by: default avatarAlexander Aring <aahringo@redhat.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230306191824.4115839-1-harshit.m.mogalapalli@oracle.com


Signed-off-by: default avatarStefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 4bcfde3c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment