Commit 373b45c
committed
Fix dangling secure_renegotiation pointer after TLSX_FreeAll
ssl->secure_renegotiation caches a pointer into extension data owned by
the ssl->extensions list. Three call sites free that list via TLSX_FreeAll
without NULLing the cached pointer, leaving it dangling:
- wolfSSL_clear()
- FreeHandshakeResources() (TLSX_FreeAll branch)
- wolfSSL_ResourceFree()
After wolfSSL_clear(), calling wolfSSL_SSL_get_secure_renegotiation_support()
reads the freed SecureRenegotiation struct. Confirmed heap-use-after-free
under ASan with nginx, haproxy, and openssl-compat build profiles.
NULL the pointer at all three sites. Add regression test covering the
wolfSSL_clear path.1 parent c36beba commit 373b45c
3 files changed
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8952 | 8952 | | |
8953 | 8953 | | |
8954 | 8954 | | |
| 8955 | + | |
| 8956 | + | |
| 8957 | + | |
| 8958 | + | |
| 8959 | + | |
8955 | 8960 | | |
8956 | 8961 | | |
8957 | 8962 | | |
| |||
9315 | 9320 | | |
9316 | 9321 | | |
9317 | 9322 | | |
| 9323 | + | |
| 9324 | + | |
| 9325 | + | |
| 9326 | + | |
9318 | 9327 | | |
9319 | 9328 | | |
9320 | 9329 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10051 | 10051 | | |
10052 | 10052 | | |
10053 | 10053 | | |
| 10054 | + | |
| 10055 | + | |
| 10056 | + | |
| 10057 | + | |
10054 | 10058 | | |
10055 | 10059 | | |
10056 | 10060 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10203 | 10203 | | |
10204 | 10204 | | |
10205 | 10205 | | |
| 10206 | + | |
| 10207 | + | |
| 10208 | + | |
| 10209 | + | |
| 10210 | + | |
| 10211 | + | |
| 10212 | + | |
| 10213 | + | |
| 10214 | + | |
| 10215 | + | |
| 10216 | + | |
| 10217 | + | |
| 10218 | + | |
| 10219 | + | |
| 10220 | + | |
| 10221 | + | |
| 10222 | + | |
| 10223 | + | |
| 10224 | + | |
| 10225 | + | |
| 10226 | + | |
| 10227 | + | |
| 10228 | + | |
| 10229 | + | |
| 10230 | + | |
| 10231 | + | |
| 10232 | + | |
| 10233 | + | |
| 10234 | + | |
| 10235 | + | |
| 10236 | + | |
| 10237 | + | |
10206 | 10238 | | |
10207 | 10239 | | |
10208 | 10240 | | |
| |||
35770 | 35802 | | |
35771 | 35803 | | |
35772 | 35804 | | |
| 35805 | + | |
35773 | 35806 | | |
35774 | 35807 | | |
35775 | 35808 | | |
| |||
0 commit comments