diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cc1e2d598..0aee5f006a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +**Fixes**: + +- Linux: handle `ENOSYS` in `read_safely` to fix empty module list in seccomp-restricted environments. ([#1655](https://github.com/getsentry/sentry-native/pull/1655)) + ## 0.13.7 **Features**: diff --git a/src/modulefinder/sentry_modulefinder_linux.c b/src/modulefinder/sentry_modulefinder_linux.c index a826bb7bf3..2d65107583 100644 --- a/src/modulefinder/sentry_modulefinder_linux.c +++ b/src/modulefinder/sentry_modulefinder_linux.c @@ -141,9 +141,12 @@ read_safely(void *dst, void *src, size_t size) // See https://github.com/getsentry/sentry-native/issues/578). // Also, the syscall is only available in Linux 3.2, meaning Android 17. // In that case we get an `EINVAL`. + // Additionally, in some seccomp-restricted environments, + // `process_vm_readv` may be unavailable and fail with `ENOSYS` (see + // https://github.com/getsentry/sentry-native/issues/1653). // - // In either of these cases, just fall back to an unsafe `memcpy`. - if (!rv && (errno == EPERM || errno == EINVAL)) { + // In any of these cases, just fall back to an unsafe `memcpy`. + if (!rv && (errno == EPERM || errno == EINVAL || errno == ENOSYS)) { memcpy(dst, src, size); rv = true; }