Commit 20dbf512 authored by Pedro Tammela's avatar Pedro Tammela Committed by sanglipeng
Browse files

net/netlink: fix NETLINK_LIST_MEMBERSHIPS length report

stable inclusion
from stable-v5.10.183
commit 57e6c54034274ebdcf617bf3eb67fc4a617c09f2
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8IRR2

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



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

[ Upstream commit f4e45348 ]

The current code for the length calculation wrongly truncates the reported
length of the groups array, causing an under report of the subscribed
groups. To fix this, use 'BITS_TO_BYTES()' which rounds up the
division by 8.

Fixes: b42be38b ("netlink: add API to retrieve all group memberships")
Signed-off-by: default avatarPedro Tammela <pctammela@mojatatu.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230529153335.389815-1-pctammela@mojatatu.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 83330d81
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment