Commit 496f007c authored by Kees Cook's avatar Kees Cook Committed by Zheng Zengkai
Browse files

gcc-plugins/stackleak: Exactly match strings instead of prefixes

stable inclusion
from stable-v5.10.110
commit 9d1d8e5e42941d3a51f7cde3bee93c2b47838aaa
bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL

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



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

[ Upstream commit 27e9faf4 ]

Since STRING_CST may not be NUL terminated, strncmp() was used for check
for equality. However, this may lead to mismatches for longer section
names where the start matches the tested-for string. Test for exact
equality by checking for the presences of NUL termination.

Cc: Alexander Popov <alex.popov@linux.com>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYu Liao <liaoyu15@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 6bd13bb1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment