diff options
author | Thomas Haller <thaller@redhat.com> | 2023-11-21 11:40:13 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2023-11-22 13:27:24 +0100 |
commit | 9f1d4b650c46e99eb8ad4d36788595d26d3840e0 (patch) | |
tree | 61aac9cd72d75bf083ae60be67339ee7e5509364 | |
parent | a6e085b3e8a86a446c68853db4b0a9aa88efe890 (diff) |
valgrind: add valgrind suppression for memmove() overlap
This valgrind error is raised by Ubuntu 23:10, with valgrind 1:3.21.0-0ubuntu1 and
glibc 2.38-1ubuntu6:
==141967== Source and destination overlap in memcpy_chk(0x1ffefffe98, 0x1ffefffe92, 8)
==141967== at 0x4851042: __memcpy_chk (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==141967== by 0x502A9CC: memmove (string_fortified.h:36)
==141967== by 0x502A9CC: inet_pton6 (inet_pton.c:226)
==141967== by 0x502A9CC: __inet_pton_length (inet_pton.c:56)
==141967== by 0x502A9CC: inet_pton (inet_pton.c:69)
==141967== by 0x114FA3: nmtst_inet6_from_string_p (nm-test-utils.h:1764)
==141967== by 0x114FA3: _nmtst_assert_ip6_address (nm-test-utils.h:1856)
==141967== by 0x114FA3: test_stable_privacy (test-utils.c:26)
==141967== by 0x4DEC85D: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7800.0)
==141967== by 0x4DEC78A: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7800.0)
==141967== by 0x4DECD2A: g_test_run_suite (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7800.0)
==141967== by 0x4DECE07: g_test_run (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7800.0)
==141967== by 0x4F070CF: (below main) (libc_start_call_main.h:58)
==141967==
{
<insert_a_suppression_name_here>
Memcheck:Overlap
fun:__memcpy_chk
fun:memmove
fun:inet_pton6
fun:__inet_pton_length
fun:inet_pton
fun:nmtst_inet6_from_string_p
fun:_nmtst_assert_ip6_address
fun:test_stable_privacy
obj:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7800.0
obj:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7800.0
fun:g_test_run_suite
fun:g_test_run
fun:(below main)
}
This is because memmove() can call __memcpy_chk(), which triggers the
false positive in valgrind.
It probably affects other places too, but for us it's sufficient to
restrict the valgrind suppression to calls from inet_pton(). This
suppression will probably break with LTO enabled.
See-also: https://bugs.kde.org/show_bug.cgi?id=402833
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1802
-rw-r--r-- | valgrind.suppressions | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/valgrind.suppressions b/valgrind.suppressions index 3109671ae6..0552625192 100644 --- a/valgrind.suppressions +++ b/valgrind.suppressions @@ -499,3 +499,13 @@ fun:btrfs_reflink_with_progress ... } +{ + _memmove_overlap + Memcheck:Overlap + fun:__memcpy_chk + fun:memmove + fun:inet_pton6 + fun:__inet_pton_length + fun:inet_pton + ... +} |