Skip to content

Compatibility issue with noexecstack on Linux x64, arm64? #113767

Open
@datalogics-josepha

Description

@datalogics-josepha

Description

So we recently needed to update our native C/C++ library on Linux x64/arm64 due to the breaking change in the GNU C Library:

dlopen and dlmopen no longer make the stack executable if a shared
library requires it, either implicitly because of a missing GNU_STACK
ELF header (and default ABI permission having the executable bit set)
or explicitly because of the executable bit in GNU_STACK, and the
stack is not already executable. Instead, loading such objects will
fail.

We started linking with noexecstack, it didn't seem to cause issues.

We also have a .NET library that Platform Invokes the above mentioned, native library which started failing recently. Root causing it revealed that if we remove the recent noexecstack change everything works as it did previously.

Trying to run our program with dotnet v6.0.428, just crashes with an Internal CLR Error.

Does the dotnet runtime does set noexecstack? It looks like it should here.

We can temporarily remove our usage of noexecstack to workaround this but it's already unsafe enough in today's environment to tell our customers we won't be doing this.

Reproduction Steps

I'm sorry for not having a reproducible sample but the basic steps we're doing are:

  • Building our native library with noexecstack
  • Building our .NET library which platform invokes the native library
  • Building our .NET customer facing sample, using our .Net library

Expected behavior

I'm sorry for not having a reproducible sample but the basic steps we're doing are:

  • Building our native library with noexecstack
  • Building our .NET library which platform invokes the native library
  • Building our .NET customer facing sample, using our .NET Library, succeeds

Actual behavior

I'm sorry for not having a reproducible sample but the basic steps we're doing are:

  • Building our native library with noexecstack
  • Building our .NET library which platform invokes the native library
  • Building our .NET customer facing sample, using our .Net library, crashes with an Internal CLR Error

Regression?

No response

Known Workarounds

not link with noexecstack in our native library

Configuration

Specific to Linux x64, arm64

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-VM-coreclruntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions