Commit 423d33d0 authored by Dan Carpenter's avatar Dan Carpenter Committed by sanglipeng
Browse files

net: mvneta: Prevent out of bounds read in mvneta_config_rss()

stable inclusion
from stable-v5.10.159
commit 146ebee8fcdb349d7ec0e49915e6cdafb92544ae
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7NTXH

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



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

[ Upstream commit e8b4fc13 ]

The pp->indir[0] value comes from the user.  It is passed to:

	if (cpu_online(pp->rxq_def))

inside the mvneta_percpu_elect() function.  It needs bounds checkeding
to ensure that it is not beyond the end of the cpu bitmap.

Fixes: cad5d847 ("net: mvneta: Fix the CPU choice in mvneta_percpu_elect")
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent be29fb36
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment