Skip to content

proc: Add /proc/sys/kernel/randomize_va_space#12814

Merged
copybara-service[bot] merged 1 commit intogoogle:masterfrom
tanyifeng:proc-randomize-va-space
Apr 3, 2026
Merged

proc: Add /proc/sys/kernel/randomize_va_space#12814
copybara-service[bot] merged 1 commit intogoogle:masterfrom
tanyifeng:proc-randomize-va-space

Conversation

@tanyifeng
Copy link
Copy Markdown
Contributor

Expose randomize_va_space in procfs with a static value of 2 (full randomization), matching gVisor's actual ASLR behavior.

gVisor always applies full ASLR for user memory mappings, so we report the value 2 to match the actual behavior.

This fixes programs(e.g. https://github.com/psf/pyperf) that read this file to collect ASLR metadata and fail with ENOENT when the file is missing.

@tanyifeng tanyifeng force-pushed the proc-randomize-va-space branch from 1fade4c to 45f086f Compare March 29, 2026 06:25
Comment thread test/syscalls/linux/proc.cc Outdated
Expose randomize_va_space in procfs with a static value of 2
(full randomization), matching gVisor's actual ASLR behavior.

gVisor always applies full ASLR for user memory mappings, so we
report the value 2 to match the actual behavior.

This fixes programs(e.g. https://github.com/psf/pyperf) that
read this file to collect ASLR metadata and fail with ENOENT
when the file is missing.

Signed-off-by: Tan Yifeng <yiftan@tencent.com>
@tanyifeng tanyifeng force-pushed the proc-randomize-va-space branch from 45f086f to d29516d Compare April 3, 2026 02:43
copybara-service Bot pushed a commit that referenced this pull request Apr 3, 2026
Expose randomize_va_space in procfs with a static value of 2 (full randomization), matching gVisor's actual ASLR behavior.

gVisor always applies full ASLR for user memory mappings, so we report the value 2 to match the actual behavior.

This fixes programs(e.g. https://github.com/psf/pyperf) that read this file to collect ASLR metadata and fail with ENOENT when the file is missing.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12814 from tanyifeng:proc-randomize-va-space d29516d
PiperOrigin-RevId: 893842262
copybara-service Bot pushed a commit that referenced this pull request Apr 3, 2026
Expose randomize_va_space in procfs with a static value of 2 (full randomization), matching gVisor's actual ASLR behavior.

gVisor always applies full ASLR for user memory mappings, so we report the value 2 to match the actual behavior.

This fixes programs(e.g. https://github.com/psf/pyperf) that read this file to collect ASLR metadata and fail with ENOENT when the file is missing.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12814 from tanyifeng:proc-randomize-va-space d29516d
PiperOrigin-RevId: 893842262
@copybara-service copybara-service Bot merged commit dd4e8d9 into google:master Apr 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants