Commit aa01884e authored by Sumit Gupta's avatar Sumit Gupta Committed by sanglipeng
Browse files

PCI: tegra194: Fix possible array out of bounds access

stable inclusion
from stable-v5.10.192
commit dbe0f607f84c5e538ad7cf045773f56e8400dcb7
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I933RF

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



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

[ Upstream commit 205b3d02 ]

Add check to fix the possible array out of bounds violation by
making speed equal to GEN1_CORE_CLK_FREQ when its value is more
than the size of "pcie_gen_freq" array. This array has size of
four but possible speed (CLS) values are from "0 to 0xF". So,
"speed - 1" values are "-1 to 0xE".

Suggested-by: default avatarBjorn Helgaas <helgaas@kernel.org>
Signed-off-by: default avatarSumit Gupta <sumitg@nvidia.com>
Link: https://lore.kernel.org/lkml/72b9168b-d4d6-4312-32ea-69358df2f2d0@nvidia.com/


Acked-by: default avatarLorenzo Pieralisi <lpieralisi@kernel.org>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 01f328e5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment