[all-commits] [llvm/llvm-project] b85e18: [libc++][hardening] Add back the safe mode.

Konstantin Varlamov via All-commits all-commits at lists.llvm.org
Tue Sep 12 12:02:12 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b85e1862c119e96b405e0fdd81a1b2120ec947df
      https://github.com/llvm/llvm-project/commit/b85e1862c119e96b405e0fdd81a1b2120ec947df
  Author: Konstantin Varlamov <varconsteq at gmail.com>
  Date:   2023-09-12 (Tue, 12 Sep 2023)

  Changed paths:
    M libcxx/CMakeLists.txt
    A libcxx/cmake/caches/Generic-safe-mode.cmake
    M libcxx/docs/Hardening.rst
    M libcxx/docs/ReleaseNotes/17.rst
    M libcxx/docs/ReleaseNotes/18.rst
    M libcxx/docs/UsingLibcxx.rst
    M libcxx/include/__config
    M libcxx/include/__config_site.in
    M libcxx/test/libcxx/algorithms/alg.sorting/assert.min.max.pass.cpp
    M libcxx/test/libcxx/assertions/modes/debug.pass.cpp
    M libcxx/test/libcxx/assertions/modes/debug_mode_disabled_in_tu.pass.cpp
    M libcxx/test/libcxx/assertions/modes/debug_mode_enabled_in_tu.pass.cpp
    M libcxx/test/libcxx/assertions/modes/debug_mode_not_1_or_0.verify.cpp
    R libcxx/test/libcxx/assertions/modes/enabling_assertions_enables_hardened_mode.pass.cpp
    A libcxx/test/libcxx/assertions/modes/enabling_assertions_enables_safe_mode.pass.cpp
    M libcxx/test/libcxx/assertions/modes/hardened_and_debug_mutually_exclusive.verify.cpp
    A libcxx/test/libcxx/assertions/modes/hardened_and_safe_mutually_exclusive.verify.cpp
    M libcxx/test/libcxx/assertions/modes/hardened_mode_disabled_in_tu.pass.cpp
    M libcxx/test/libcxx/assertions/modes/hardened_mode_enabled_in_tu.pass.cpp
    M libcxx/test/libcxx/assertions/modes/hardened_mode_not_1_or_0.verify.cpp
    A libcxx/test/libcxx/assertions/modes/safe.pass.cpp
    A libcxx/test/libcxx/assertions/modes/safe_and_debug_mutually_exclusive.verify.cpp
    A libcxx/test/libcxx/assertions/modes/safe_mode_disabled_in_tu.pass.cpp
    A libcxx/test/libcxx/assertions/modes/safe_mode_enabled_in_tu.pass.cpp
    A libcxx/test/libcxx/assertions/modes/safe_mode_not_1_or_0.verify.cpp
    M libcxx/test/libcxx/assertions/modes/unchecked.pass.cpp
    M libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp
    M libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp
    M libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp
    M libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp
    M libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp
    M libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp
    M libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp
    M libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp
    M libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp
    M libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp
    M libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp
    M libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp
    M libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp
    M libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp
    M libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp
    M libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp
    M libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp
    M libcxx/test/libcxx/iterators/assert.advance.pass.cpp
    M libcxx/test/libcxx/iterators/assert.next.pass.cpp
    M libcxx/test/libcxx/iterators/assert.prev.pass.cpp
    M libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp
    M libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/assert.equal.pass.cpp
    M libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/assert.equal.pass.cpp
    M libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.piecewise.pass.cpp
    M libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.value.bound.pass.cpp
    M libcxx/test/libcxx/strings/string.view/assert.ctor.length.pass.cpp
    M libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp
    M libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp
    M libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp
    M libcxx/test/libcxx/thread/thread.barrier/assert.arrive.pass.cpp
    M libcxx/test/libcxx/thread/thread.barrier/assert.ctor.pass.cpp
    M libcxx/test/libcxx/thread/thread.latch/assert.arrive_and_wait.pass.cpp
    M libcxx/test/libcxx/thread/thread.latch/assert.count_down.pass.cpp
    M libcxx/test/libcxx/thread/thread.latch/assert.ctor.pass.cpp
    M libcxx/test/libcxx/thread/thread.semaphore/assert.ctor.pass.cpp
    M libcxx/test/libcxx/thread/thread.semaphore/assert.release.pass.cpp
    M libcxx/test/libcxx/utilities/assert.exception_guard.no_exceptions.pass.cpp
    M libcxx/test/std/algorithms/alg.sorting/alg.clamp/assert.ranges_clamp.pass.cpp
    M libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.pop_heap.pass.cpp
    M libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.ranges_pop_heap.pass.cpp
    M libcxx/test/std/utilities/utility/utility.unreachable/assert.unreachable.pass.cpp
    M libcxx/utils/ci/buildkite-pipeline.yml
    M libcxx/utils/ci/run-buildbot
    M libcxx/utils/libcxx/test/params.py

  Log Message:
  -----------
  [libc++][hardening] Add back the safe mode.

The safe mode is in-between the hardened and the debug modes, extending
the checks contained in the hardened mode with certain checks that are
relatively cheap and prevent common sources of errors but aren't
security-critical. Thus, the safe mode trades off some performance for
a wider set of checks, but unlike the debug mode, it can still be used
in production.

Differential Revision: https://reviews.llvm.org/D158823




More information about the All-commits mailing list