]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
selftests: x86: fix [-Wstringop-overread] warn in test_process_vm_readv()
authorShuah Khan <skhan@linuxfoundation.org>
Thu, 21 Oct 2021 21:33:33 +0000 (15:33 -0600)
committerAndrea Righi <andrea.righi@canonical.com>
Fri, 21 Jan 2022 14:49:23 +0000 (15:49 +0100)
commitcf00a80c6160f248d4104607b0f561a9f4286439
tree25e70f018a1bc3195686c8e889b457eb16092889
parenta17e8f6f60c66bf24b87b5f440c16885d389a0e7
selftests: x86: fix [-Wstringop-overread] warn in test_process_vm_readv()

BugLink: https://bugs.launchpad.net/bugs/1957882
commit dd40f44eabe1e122c6852fabb298aac05b083fce upstream.

Fix the following [-Wstringop-overread] by passing in the variable
instead of the value.

test_vsyscall.c: In function ‘test_process_vm_readv’:
test_vsyscall.c:500:22: warning: ‘__builtin_memcmp_eq’ specified bound 4096 exceeds source size 0 [-Wstringop-overread]
  500 |                 if (!memcmp(buf, (const void *)0xffffffffff600000, 4096)) {
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Cc: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <p.pisati@gmail.com>
tools/testing/selftests/x86/test_vsyscall.c