gcc-plugins/stackleak: Exactly match strings instead of prefixes
BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit
27e9faf415dbf94af19b9c827842435edbc1fbbc ]
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: Kees Cook <keescook@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit
999ee266531bb38497a1ddef03f482961f3ae0e4)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>