Repository navigation
Conversation
The OpenHarmony seccomp policy traps close_range() with SIGSYS, which kills the process before a fallback can run. Skip the libc function and the raw-syscall paths on TARGET_OPENHARMONY, and set FD_CLOEXEC on the open descriptors by reading /proc/self/fd; the bounded rlimit scan remains as a fallback when the listing cannot be read.
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-diagnostics-process |
This was referenced Oct 20, 2026
Contributor
Author
|
Superseded by #136194, which consolidates the remaining native-libs fixes and includes device validation (hello world, child process start, network interfaces, RSA/TLS through the OpenSSL shim). Note This comment was drafted with AI assistance (agent tooling) under the author's direction. |
springmin
added a commit
to springmin/runtime-ohos
that referenced
this pull request
Oct 21, 2026
dotnet#136194 carries N3/N4/N7/N8/D with device validation. Closed dotnet#135839, dotnet#135840, dotnet#135866 and dotnet#136187 in its favor and replied to am11 on dotnet#136132. Runtime in flight: dotnet#136185, dotnet#136186, dotnet#136194; SDK: dotnet#56732, dotnet#56733.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
OpenHarmony's seccomp policy traps
close_range()with SIGSYS, soProcess.Startwith handle-inheritance restrictions dies before a fallback canrun. Skip the libc function and the raw-syscall paths on
TARGET_OPENHARMONYand set
FD_CLOEXECon the open descriptors by listing/proc/self/fd.Changes
src/native/libs/System.Native/pal_process.c: add!defined(TARGET_OPENHARMONY)to both
close_rangebranches ofRestrictHandleInheritance; on OpenHarmonythe function calls
SetCloexecForAllFdsFallback()instead./proc/self/fdwithgetdents64into a stack buffer (itruns in the forked child, where malloc is not safe) and sets
FD_CLOEXEConthe descriptors it finds. The already-existing bounded
RLIMIT_NOFILEscanremains the fallback for when the listing cannot be read completely.
Impact
close_rangepathsand upstream's
ENOTSUPresult when neitherclose_rangenorfdwalkisavailable.
fdwalkcallback and the/proc/self/fdwalk use the same per-descriptor routine; behavior on Illumos/Solaris is
unchanged.
Validation
pal_process.ccompiles foropenharmony-arm64with the OHOS NDK clang(
--target=aarch64-linux-ohos,-Weverything), no warnings.Test
openharmony-arm64(this definesTARGET_OPENHARMONY).ProcessStartInfo.InheritedHandlesconfigured; the child should exec, the inherited handles should survive, and
the other descriptors should be close-on-exec.
Note
This PR was authored with AI assistance (agent tooling) under the author's direction.