]> www.infradead.org Git - users/dwmw2/linux.git/commit
gcc-plugins/stackleak: Exactly match strings instead of prefixes
authorKees Cook <keescook@chromium.org>
Sun, 6 Feb 2022 17:08:20 +0000 (09:08 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:40:30 +0000 (14:40 +0200)
commit9d1d8e5e42941d3a51f7cde3bee93c2b47838aaa
treefde93f1c7a9f18a7c5680e3e7818837f58b8c4d9
parentb0f2f89d741ab1f2e0fcd14b5a5252fbbdeebb70
gcc-plugins/stackleak: Exactly match strings instead of prefixes

[ 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>
scripts/gcc-plugins/stackleak_plugin.c