-
由 Kees Cook 提交于
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: NKees Cook <keescook@chromium.org> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NYu Liao <liaoyu15@huawei.com> Reviewed-by: NWei Li <liwei391@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
413c0dd1