Commit d75fc315 authored by Lin Ma's avatar Lin Ma Committed by sanglipeng
Browse files

net: tipc: resize nlattr array to correct size

stable inclusion
from stable-v5.10.185
commit 08899e8d5a99d94ae2353f12fca090e80bca2d2d
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8L5XP

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



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

[ Upstream commit 44194cb1 ]

According to nla_parse_nested_deprecated(), the tb[] is supposed to the
destination array with maxtype+1 elements. In current
tipc_nl_media_get() and __tipc_nl_media_set(), a larger array is used
which is unnecessary. This patch resize them to a proper size.

Fixes: 1e55417d ("tipc: add media set to new netlink api")
Fixes: 46f15c67 ("tipc: add media get/dump to new netlink api")
Signed-off-by: default avatarLin Ma <linma@zju.edu.cn>
Reviewed-by: default avatarFlorian Westphal <fw@strlen.de>
Reviewed-by: default avatarTung Nguyen <tung.q.nguyen@dektech.com.au>
Link: https://lore.kernel.org/r/20230614120604.1196377-1-linma@zju.edu.cn


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 858fa8d2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment