Skip to content

Corrupting the stack at startup in OpenSSL's provider_conf_init #434

Closed
@kvark

Description

I'm porting Zed to Linux - zed-industries/zed#7343
It's currently crashing on startup even before main is entered.
Call stacks are corrupted until I build with "safestack" sanitizer, in which case it produces the following stack:
openssl-crash2-stack.txt

Strace shows the configuration file read as the last thing:

openat(AT_FDCWD, "/nix/store/l0rxwrg41k3lsdiybf8q0rf3nk430zr8-openssl-3.0.12/etc/ssl/openssl.cnf", O_RDONLY) = 3
newfstatat(3, "", {st_mode=S_IFREG|0444, st_size=12324, ...}, AT_EMPTY_PATH) = 0
read(3, "#\n# OpenSSL example configuratio"..., 4096) = 4096
read(3, "d attributes must be the same, a"..., 4096) = 4096
read(3, "coding of an extension: beware e"..., 4096) = 4096
read(3, " = $insta::certout # insta.cert."..., 4096) = 36
read(3, "", 4096)                       = 0
close(3)                                = 0
futex(0x7f14c78795d8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f14c787961c, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f14c7879d7c, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f14c7879d74, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f14c78795b8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=NULL} ---

I believe the callstack is coming from curl, which is coming to Zed through this dependency:

isahc = { version = "1.7.2", default-features = false, features = ["static-curl", "text-decoding"] }

Note: was first submitted to sfackler/rust-openssl#2160

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions