[all-commits] [llvm/llvm-project] 292b30: [libc][bug] Fix out of bound write in memcpy w/ so...

Guillaume Chatelet via All-commits all-commits at lists.llvm.org
Tue May 14 04:55:46 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 292b300c5131e54b9977305bb4aca9a03e1b4fed
      https://github.com/llvm/llvm-project/commit/292b300c5131e54b9977305bb4aca9a03e1b4fed
  Author: Guillaume Chatelet <gchatelet at google.com>
  Date:   2024-05-14 (Tue, 14 May 2024)

  Changed paths:
    M libc/src/string/memory_utils/x86_64/inline_memcpy.h
    M libc/test/src/string/memcpy_test.cpp
    A libc/test/src/string/memory_utils/protected_pages.h
    M libc/test/src/string/memset_test.cpp

  Log Message:
  -----------
  [libc][bug] Fix out of bound write in memcpy w/ software prefetching (#90591)

This patch adds tests for `memcpy` and `memset` making sure that we
don't access buffers out of bounds. It relies on POSIX `mmap` /
`mprotect` and works only when FULL_BUILD_MODE is disabled.

The bug showed up while enabling software prefetching.
`loop_and_tail_offset` is always running at least one iteration but in
some configurations loop unrolled prefetching was actually needing only
the tail operation and no loop iterations at all.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list