Linux command
personality 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Disable ASLR for debugging (via setarch)
setarch $(uname -m) -R [command]
Run 32-bit binary on 64-bit system
linux32 [command]
Run 64-bit binary
linux64 [command]
Set legacy memory layout
setarch $(uname -m) -L [command]
说明
personality(2) is a Linux system call that sets the process execution domain, telling the kernel to emulate behavior of other UNIX flavors or to toggle compatibility flags. It is primarily invoked indirectly through wrapper commands such as setarch, linux32, and linux64. Common use cases include disabling ASLR to produce reproducible memory addresses during debugging, running legacy 32-bit binaries under a 64-bit kernel, and emulating older UNIX memory layouts for compatibility.
参数
- PER_LINUX
- Standard Linux execution domain.
- PER_LINUX32
- 32-bit execution mode on 64-bit kernels.
- ADDR_NO_RANDOMIZE
- Disable Address Space Layout Randomization (ASLR).
- MMAP_PAGE_ZERO
- Map the zero page (for SVr4 binaries).
- ADDR_COMPAT_LAYOUT
- Use legacy virtual memory layout.
- READ_IMPLIES_EXEC
- Readable mappings become executable (PROT_READ implies PROT_EXEC).
- ADDR_LIMIT_32BIT
- Limit address space to 32 bits.
- STICKY_TIMEOUTS
- Use SVr4-style timeout handling in select(2).
FAQ
What is the personality command used for?
personality(2) is a Linux system call that sets the process execution domain, telling the kernel to emulate behavior of other UNIX flavors or to toggle compatibility flags. It is primarily invoked indirectly through wrapper commands such as setarch, linux32, and linux64. Common use cases include disabling ASLR to produce reproducible memory addresses during debugging, running legacy 32-bit binaries under a 64-bit kernel, and emulating older UNIX memory layouts for compatibility.
How do I run a basic personality example?
Run `setarch $(uname -m) -R [command]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does PER_LINUX do in personality?
Standard Linux execution domain.