Unversioned libc imports can split allocator bindings under interposition
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- c
- Ambito
- build-system, cryptography, security
Direzione di ricerca
Inizia individuando il modulo condiviso POSIX generico e la relativa configurazione di linking con -nostdlib/-nodefaultlibs/-nostartfiles. Riproduci il comportamento del loader con il comando LD_PRELOAD fornito, quindi esamina DT_NEEDED e i binding dei simboli ed esegui la suite di test SymCrypt. Il lavoro è completato quando i binding dell’allocator non possono essere separati tramite interposizione, il controllo guestfs-tools ha esito positivo e viene identificata la revisione di certificazione FIPS richiesta.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
On Azure Linux 3 with SymCrypt 103.8.0, glibc malloc-debug instrumentation causes consumers loading the SymCrypt OpenSSL provider to abort with free(): invalid pointer.
The POSIX shared module is linked with -nostdlib -nodefaultlibs -nostartfiles. Consequently, libsymcrypt.so has no DT_NEEDED entry for libc and its libc imports are unversioned:
aligned_alloc Base
free Base
malloc Base
When glibc's checked allocator is preloaded, the dynamic loader can bind aligned_alloc to libc.so.6 while binding free to libc_malloc_debug.so.0. SymCrypt then allocates and frees through different allocator implementations.
Reproducer
LD_PRELOAD=libc_malloc_debug.so.0 \
GLIBC_TUNABLES=glibc.malloc.check=1 \
python3 -c 'import ctypes; ctypes.CDLL("/path/to/libsymcrypt.so")'
The failure was observed on the released Azure Linux 3 system with SymCrypt 103.8.0 and reproduced in controlled testing with SymCrypt 103.12.1. LD_DEBUG=bindings confirms the split binding.
The same issue breaks the Azure Linux 4 guestfs-tools build when OpenSSL loads the SymCrypt provider. Its current packaging workaround disables malloc checking: microsoft/azurelinux#18715.
Validated fixes
Two independent changes prevent the failure:
- Use
posix_memaligninstead ofaligned_alloc:tobiasb-ms/fix-posix-allocator-interposition - Explicitly link the generic POSIX module against libc, recording
DT_NEEDED: libc.so.6and versioned imports:tobiasb-ms/fix-version-libc-imports
Both pass the SymCrypt test suite and an end-to-end Azure Linux guestfs-tools build and %check (124 tests, 0 failures/errors). Explicit libc linkage is the more structurally reliable fix, but its glibc requirements depend on the build sysroot.
Both changes modify content inside the module's FIPS integrity boundary and therefore require certification review.
- Lingua principale
- C
- Stelle
- 890
- Fork
- 91
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/SymCrypt
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
Tutte le issue di microsoft/SymCrypt
Issue simili
-
task
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
vsanthanam/JBird#429 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
bug documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
es-ude/OnDeviceTraining#459 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
bilelmoussaoui/gobject-linter#199 · 1 commento ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
bradcypert/plum#53 ·