-
Notifications
You must be signed in to change notification settings - Fork 700
fix(guestfs-tools): disable legacy malloc checking #18715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Tobias Brick (tobiasb-ms)
wants to merge
1
commit into
microsoft:4.0
Choose a base branch
from
tobiasb-ms:tobiasb-ms/bug-23502-guestfs-tools
base: 4.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+97
−2
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
base/comps/guestfs-tools/0002-tests-disable-glibc-malloc-check.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| From: Tobias Brick <tobiasb@microsoft.com> | ||
| Date: Fri, 4 Sep 2026 15:36:00 +0000 | ||
| Subject: [PATCH] tests: disable glibc malloc check | ||
|
|
||
| The legacy glibc malloc checker interposes allocation APIs through | ||
| libc_malloc_debug.so.0. SymCrypt has unversioned allocator references that | ||
| can bind aligned_alloc to libc while binding free to the debug allocator, | ||
| causing OpenSSL consumers to abort during provider initialization. | ||
|
|
||
| Keep malloc perturbation enabled to retain detection of uninitialized and | ||
| use-after-free behavior without enabling the incompatible checked allocator. | ||
| --- | ||
| run.in | 8 +++----- | ||
| 1 file changed, 3 insertions(+), 5 deletions(-) | ||
|
|
||
| diff --git a/run.in b/run.in | ||
| index 4053fd2..be5cf48 100755 | ||
| --- a/run.in | ||
| +++ b/run.in | ||
| @@ -100,14 +100,12 @@ if [ -z "$VIRT_BUILDER_DIRS" ]; then | ||
| export VIRT_BUILDER_DIRS | ||
| fi | ||
|
|
||
| -# This is a cheap way to find some use-after-free and uninitialized | ||
| -# read problems when using glibc. But if we are valgrinding then | ||
| -# don't use this because it can stop valgrind from working. | ||
| +# Perturb allocated and freed memory to find some use-after-free and | ||
| +# uninitialized read problems. Disable it when running under valgrind. | ||
| if [ -z "$VG" ]; then | ||
| random_val="$(@AWK@ 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)" | ||
| - LD_PRELOAD="${LD_PRELOAD:+"$LD_PRELOAD:"}libc_malloc_debug.so.0" | ||
| - GLIBC_TUNABLES=glibc.malloc.check=1:glibc.malloc.perturb=$random_val | ||
| - export LD_PRELOAD GLIBC_TUNABLES | ||
| + GLIBC_TUNABLES=glibc.malloc.perturb=$random_val | ||
| + export GLIBC_TUNABLES | ||
| fi | ||
|
|
||
| # Do we have libtool? If we have it then we can use it to make | ||
| -- | ||
| 2.55.0 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
specs/g/guestfs-tools/0002-tests-disable-glibc-malloc-check.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| From: Tobias Brick <tobiasb@microsoft.com> | ||
| Date: Fri, 4 Sep 2026 15:36:00 +0000 | ||
| Subject: [PATCH] tests: disable glibc malloc check | ||
|
|
||
| The legacy glibc malloc checker interposes allocation APIs through | ||
| libc_malloc_debug.so.0. SymCrypt has unversioned allocator references that | ||
| can bind aligned_alloc to libc while binding free to the debug allocator, | ||
| causing OpenSSL consumers to abort during provider initialization. | ||
|
|
||
| Keep malloc perturbation enabled to retain detection of uninitialized and | ||
| use-after-free behavior without enabling the incompatible checked allocator. | ||
| --- | ||
| run.in | 8 +++----- | ||
| 1 file changed, 3 insertions(+), 5 deletions(-) | ||
|
|
||
| diff --git a/run.in b/run.in | ||
| index 4053fd2..be5cf48 100755 | ||
| --- a/run.in | ||
| +++ b/run.in | ||
| @@ -100,14 +100,12 @@ if [ -z "$VIRT_BUILDER_DIRS" ]; then | ||
| export VIRT_BUILDER_DIRS | ||
| fi | ||
|
|
||
| -# This is a cheap way to find some use-after-free and uninitialized | ||
| -# read problems when using glibc. But if we are valgrinding then | ||
| -# don't use this because it can stop valgrind from working. | ||
| +# Perturb allocated and freed memory to find some use-after-free and | ||
| +# uninitialized read problems. Disable it when running under valgrind. | ||
| if [ -z "$VG" ]; then | ||
| random_val="$(@AWK@ 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)" | ||
| - LD_PRELOAD="${LD_PRELOAD:+"$LD_PRELOAD:"}libc_malloc_debug.so.0" | ||
| - GLIBC_TUNABLES=glibc.malloc.check=1:glibc.malloc.perturb=$random_val | ||
| - export LD_PRELOAD GLIBC_TUNABLES | ||
| + GLIBC_TUNABLES=glibc.malloc.perturb=$random_val | ||
| + export GLIBC_TUNABLES | ||
| fi | ||
|
|
||
| # Do we have libtool? If we have it then we can use it to make | ||
| -- | ||
| 2.55.0 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.