Read and Safely Test /proc/sys/abi/vsyscall32
A 32-bit compatibility bug sends you looking at /proc/sys/abi/vsyscall32, so here is how to check it, read it, and test it with a way back. This uses the installed Linux man-pages 6.7 documentation on an Ubuntu 6.8.0-139-generic kernel. Allow about ten minutes: the inspection steps are unprivileged, changing the setting needs elevated privileges.
The route
Jump straight to the step you need, or tick off Done means at the end.
1. Check whether the ABI directory exists
proc_sys_abi(5) documents /proc/sys/abi/ as a directory that may contain application binary information. It is not guaranteed to exist on every system, so check before naming a file:
$ test -d /proc/sys/abi && printf '%s\n' 'ABI sysctl directory is present' || printf '%s\n' 'ABI sysctl directory is absent'
If it is present, list the files without changing anything:
$ find /proc/sys/abi -maxdepth 1 -type f -printf '%f\n' | sort
vsyscall32
Your list may be empty or may hold different entries. Do not assume a setting mentioned in an online example exists on this kernel.
Checkpoint
Continue only if the directory and the particular file you need both exist.
2. Read the setting directly
Read the file as an ordinary user. The kernel supplies the value followed by a newline:
$ cat /proc/sys/abi/vsyscall32
1
1enables the vDSO page mapped into 32-bit processes.0disables that mapping.- Default is enabled when the kernel has
CONFIG_COMPAT_VDSO, otherwise disabled.
This is a 32-bit compatibility setting, not a general switch for 64-bit vDSO support. For scripts, the procps sysctl command gives the same value under a name that is easier to fold into status output:
$ sysctl abi.vsyscall32
abi.vsyscall32 = 1
$ sysctl -n abi.vsyscall32
1
Both of those are read-only. The -n form prints only the value, handy for a comparison:
value=$(sysctl -n abi.vsyscall32) || exit 1
case "$value" in
0|1) printf 'vsyscall32=%s\n' "$value" ;;
*) printf 'unexpected vsyscall32 value: %s\n' "$value" >&2; exit 2 ;;
esac
3. Relate the file to the kernel boot option
Here is the surprising bit: the upstream ABI documentation says this setting controls the same behaviour as the x86 vdso32 kernel boot parameter. That is why a value can reflect an early boot decision rather than a local application config file. It does not mean writing the sysctl edits the boot loader or changes the next boot.
Check the running kernel and its command line as read-only diagnostics:
$ uname -r
6.8.0-139-generic
$ tr ' ' '\n' < /proc/cmdline | grep '^vdso32$' || printf '%s\n' 'vdso32 is not present on the command line'
An absent boot parameter is not proof of the effective default, because kernel configuration matters too. Treat /proc/sys/abi/vsyscall32 as the value currently in force.
4. Record the old value before testing
Warning
Writing this setting changes kernel behaviour for 32-bit processes on the running host. It can break compatibility assumptions and may affect services without restarting them. Only do this with a clear test purpose, a maintenance window, and a recovery path; never just to see what happens on a production host.
Capture the current value in a shell variable, and refuse to continue if it is not the documented binary form:
old_value=$(cat /proc/sys/abi/vsyscall32) || exit 1
case "$old_value" in
0|1) printf 'recorded old value: %s\n' "$old_value" ;;
*) printf 'unexpected old value: %s\n' "$old_value" >&2; exit 2 ;;
esac
Now, and only if the test is authorised, write the alternate value with sysctl:
$ sudo sysctl -w abi.vsyscall32=0
abi.vsyscall32 = 0
This is the first command in the guide that normally needs sudo. It writes the live sysctl; it does not create a persistent configuration file. Verify immediately:
$ sysctl -n abi.vsyscall32
0
If the write is rejected, keep the error and investigate the host's permissions and kernel support rather than retrying with different values.
5. Restore the recorded value
Restore the exact value captured before the test. If you opened a new shell, replace OLD_VALUE with the value you recorded, not a guessed default:
$ sudo sysctl -w abi.vsyscall32=OLD_VALUE
abi.vsyscall32 = OLD_VALUE
$ sysctl -n abi.vsyscall32
OLD_VALUE
Recovery
For a same-shell test, the safer form uses the saved variable:
sudo sysctl -w "abi.vsyscall32=$old_value"
test "$(sysctl -n abi.vsyscall32)" = "$old_value"
There is no service restart or file deletion to undo here: the recovery action is the explicit write back to the recorded value. A reboot may also reapply the kernel's boot-time choice, but do not reboot a shared host as a substitute for restoring and verifying the setting.
Common traps
- Treating it as storage.
/proc/sys/abi/is a kernel interface, not a directory of application binaries or a place to store configuration files. - Papering over an absence. A missing directory or file is a supported observation; it does not justify creating one with
mkdiror placing a similarly named file elsewhere. - Over-reading a success.
vsyscall32=1describes the mapping setting. It does not prove a 32-bit application starts successfully, that a process uses the page, or that other compatibility interfaces work. - Assuming a fixed file list. The man page gives the directory's purpose and points to kernel documentation; it does not promise a fixed list of files. Follow the running kernel's exposed interface.
- Confusing runtime and boot. If the setting must survive a reboot, set up the distribution's supported boot or sysctl configuration separately and test its precedence before changing it.
Done means
- Checked existence of
/proc/sys/abi/before naming a path beneath it. - Listed the files and read the actual value of
vsyscall32on the running kernel. - Understood the values:
1enables,0disables, the 32-bit vDSO mapping when this setting is exposed. - Tested safely, if at all: recorded the old value, used elevated privileges deliberately, restored and verified it.