History log of /llvm-project/compiler-rt/lib/dfsan/dfsan_allocator.cpp (Results 1 – 15 of 15)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3
# 80eea015 10-Aug-2024 Fangrui Song <i@maskray.me>

[dfsan] Use namespace qualifier and internalize accidentally exported functions. NFC


# 4cad17de 06-Aug-2024 Florian Mayer <fmayer@google.com>

[DFSan] [compiler-rt] leave BufferedStackTrace uninit

Otherwise we have to memset 2040 bytes (255 * 8) for each call

Pull Request: https://github.com/llvm/llvm-project/pull/102252


Revision tags: llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7
# 511077df 22-May-2024 Wu Yingcong <yingcong.wu@intel.com>

[sanitizers] Bump malloc limit to 1TB for MSAN, LSAN & DFSAN (#89728)

We already have `const uptr kMaxAllowedMallocSize = 1ULL << 40;` set for
ASAN, HWASAN, memprof, TSAN. This patch bumps the mall

[sanitizers] Bump malloc limit to 1TB for MSAN, LSAN & DFSAN (#89728)

We already have `const uptr kMaxAllowedMallocSize = 1ULL << 40;` set for
ASAN, HWASAN, memprof, TSAN. This patch bumps the malloc limit for MSAN,
LSAN and DFSAN to 1TB as well. 8GB is simply not enough nowadays.

show more ...


Revision tags: llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3
# 62ed009c 20-Mar-2024 Thurston Dang <thurston@google.com>

[dfsan] Re-exec with no ASLR if memory layout is incompatible on Linux (#85674)

DFSan's shadow mappings are incompatible with 32 bits of ASLR entropy
('sudo sysctl vm.mmap_rnd_bits=32; ninja check-

[dfsan] Re-exec with no ASLR if memory layout is incompatible on Linux (#85674)

DFSan's shadow mappings are incompatible with 32 bits of ASLR entropy
('sudo sysctl vm.mmap_rnd_bits=32; ninja check-dfsan') and it is
difficult to fix this via increasing the size of the shadow mappings,
due to the overhead of shadow memory. This patch works around the issue
by detecting if the memory layout is incompatible, and if so,
re-exec'ing without ASLR.

DFSan and MSan share copy-pasted shadow memory code, hence this
workaround is ported from MSan:
- "[msan] Re-exec with no ASLR if memory layout is incompatible on
Linux"
(https://github.com/llvm/llvm-project/commit/58f7251820b14c93168726a24816d8a094599be5)
- "[msan] Add 'MappingDesc::ALLOCATOR' type and check it is available"
(https://github.com/llvm/llvm-project/commit/af2bf86a372cacf5f536bae06e2f2d3886eefb7b)
(which in turn are inspired by TSan: "Re-exec TSan with no ASLR if
memory layout is incompatible on Linux"
(https://github.com/llvm/llvm-project/commit/0784b1eefa36d4acbb0dacd2d18796e26313b6c5
))

aeubanks had remarked in
https://github.com/llvm/llvm-project/pull/85142#issuecomment-2004442883
that this issue occurs in Chromium:
https://ci.chromium.org/ui/p/chromium/builders/try/linux_upload_clang/5066/overview

show more ...


Revision tags: llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init
# 96928abb 21-Jun-2023 Vitaly Buka <vitalybuka@google.com>

[NFC][sanitizer] Pass user region into OnMapSecondary


# 38dfcf96 21-Jun-2023 Vitaly Buka <vitalybuka@google.com>

[NFC][sanitizer] Add OnMapSecondary callback

Now it implemented as OnMap everywhere, but in follow up patches
we can optimize Asan handler.


Revision tags: llvmorg-16.0.6, llvmorg-16.0.5
# 7639265a 24-May-2023 Jin Xin Ng <njx@google.com>

[sanitizer] Implement __sanitizer_get_allocated_size_fast

The primary motivation for this change is to allow FreeHooks to obtain
the allocated size of the pointer being freed in a fast, efficient ma

[sanitizer] Implement __sanitizer_get_allocated_size_fast

The primary motivation for this change is to allow FreeHooks to obtain
the allocated size of the pointer being freed in a fast, efficient manner.

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

show more ...


Revision tags: llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2
# 8c63dc6f 13-Apr-2023 Fangrui Song <i@maskray.me>

Internalize AllocationBegin functions after D147005

Reviewed By: thurston

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


Revision tags: llvmorg-16.0.1
# d644ab02 04-Apr-2023 Thurston Dang <thurston@google.com>

Update __sanitizer_get_allocated_begin to return const void*

D147005 introduced __sanitizer_get_allocated_begin, with a return
value of void*. This involved a few naughty casts that dropped the
cons

Update __sanitizer_get_allocated_begin to return const void*

D147005 introduced __sanitizer_get_allocated_begin, with a return
value of void*. This involved a few naughty casts that dropped the
const. This patch adds back the const qualifier.

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

show more ...


# c81a3224 03-Apr-2023 Jie Fu <jiefu@tencent.com>

[compiler-rt] Fix -Wcast-qual after D147005 (NFC)

/home/jiefu/llvm-project/compiler-rt/lib/lsan/lsan_allocator.cpp:161:18: error: cast from 'const void *' to 'void *' drops const qualifier [-Werror,

[compiler-rt] Fix -Wcast-qual after D147005 (NFC)

/home/jiefu/llvm-project/compiler-rt/lib/lsan/lsan_allocator.cpp:161:18: error: cast from 'const void *' to 'void *' drops const qualifier [-Werror,-Wcast-qual]
return (void *)beg;
^
1 error generated.

show more ...


# 415b1cfd 03-Apr-2023 Thurston Dang <thurston@google.com>

Add __sanitizer_get_allocated_begin API and implementations

This function will return the start of the allocation, if given a pointer that lies within an allocation. Otherwise, it returns NULL.

It

Add __sanitizer_get_allocated_begin API and implementations

This function will return the start of the allocation, if given a pointer that lies within an allocation. Otherwise, it returns NULL.

It will be useful for detecting dynamic TLS allocations in glibc >=2.25, which
uses malloc (see https://github.com/google/sanitizers/issues/1409#issuecomment-1214244142).

Reviewed By: vitalybuka

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

show more ...


Revision tags: llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7
# de5416cb 03-Jan-2023 Fangrui Song <i@maskray.me>

[dfsan] Support Linux AArch64

compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake:ALL_DFSAN_SUPPORTED_ARCH
allows AArch64 but currently the instrumentation will crash.

Port Linux AArch64 memory ma

[dfsan] Support Linux AArch64

compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake:ALL_DFSAN_SUPPORTED_ARCH
allows AArch64 but currently the instrumentation will crash.

Port Linux AArch64 memory mappings from msan but use
SizeClassAllocator64 for a slightly more efficient allocator (used by
asan/lsan). Change dfsan/lit.cfg.py to allow Linux aarch64. All tests
should pass.

* dfsan/origin_invalid.c uses x86_64 assembly. Just make it x86_64 specific.
* dfsan/interceptors.c our mallinfo interceptor takes an argument
instead of returning a struct. This does not work on AArch64 which
uses different registers for the two function types. Disable AArch64
as msan/Linux/mallinfo.cpp does.

Reviewed By: #sanitizers, vitalybuka

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

show more ...


Revision tags: llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2
# 63180012 02-Dec-2021 Vitaly Buka <vitalybuka@google.com>

[sanitizer] Support IsRssLimitExceeded in all sanitizers

Reviewed By: kstoimenov

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


Revision tags: llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3
# 45f6d552 25-Jun-2021 Andrew Browne <browneee@google.com>

[DFSan] Change shadow and origin memory layouts to match MSan.

Previously on x86_64:

+--------------------+ 0x800000000000 (top of memory)
| application memory |
+--------------------+ 0x7000

[DFSan] Change shadow and origin memory layouts to match MSan.

Previously on x86_64:

+--------------------+ 0x800000000000 (top of memory)
| application memory |
+--------------------+ 0x700000008000 (kAppAddr)
| |
| unused |
| |
+--------------------+ 0x300000000000 (kUnusedAddr)
| origin |
+--------------------+ 0x200000008000 (kOriginAddr)
| unused |
+--------------------+ 0x200000000000
| shadow memory |
+--------------------+ 0x100000008000 (kShadowAddr)
| unused |
+--------------------+ 0x000000010000
| reserved by kernel |
+--------------------+ 0x000000000000

MEM_TO_SHADOW(mem) = mem & ~0x600000000000
SHADOW_TO_ORIGIN(shadow) = kOriginAddr - kShadowAddr + shadow

Now for x86_64:

+--------------------+ 0x800000000000 (top of memory)
| application 3 |
+--------------------+ 0x700000000000
| invalid |
+--------------------+ 0x610000000000
| origin 1 |
+--------------------+ 0x600000000000
| application 2 |
+--------------------+ 0x510000000000
| shadow 1 |
+--------------------+ 0x500000000000
| invalid |
+--------------------+ 0x400000000000
| origin 3 |
+--------------------+ 0x300000000000
| shadow 3 |
+--------------------+ 0x200000000000
| origin 2 |
+--------------------+ 0x110000000000
| invalid |
+--------------------+ 0x100000000000
| shadow 2 |
+--------------------+ 0x010000000000
| application 1 |
+--------------------+ 0x000000000000

MEM_TO_SHADOW(mem) = mem ^ 0x500000000000
SHADOW_TO_ORIGIN(shadow) = shadow + 0x100000000000

Reviewed By: stephan.yichao.zhao, gbalats

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

show more ...


Revision tags: llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1
# 1fb612d0 30-Apr-2021 Jianzhou Zhao <jianzhouzh@google.com>

[dfsan] Add a DFSan allocator

This is a part of https://reviews.llvm.org/D101204

Reviewed By: morehouse

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