For general information regarding FreeBSD Security Advisories,
including descriptions of the fields above, security branches, and the
following sections, please visit <URL:http://security.FreeBSD.org/>.

The FreeBSD virtual memory system allows files to be memory-mapped.
All or parts of a file can be made available to a process via its
address space. The process can then access the file using memory
operations rather than filesystem I/O calls.

The ptrace(2) system call provides tracing and debugging facilities by
allowing one process (the tracing process) to watch and control
another (the traced process).

II. Problem Description

Due to insufficient permission checks in the virtual memory system, a
tracing process (such as a debugger) may be able to modify portions of
the traced process's address space to which the traced process itself
does not have write access.

III. Impact

This error can be exploited to allow unauthorized modification of an
arbitrary file to which the attacker has read access, but not write
access. Depending on the file and the nature of the modifications,
this can result in privilege escalation.

To exploit this vulnerability, an attacker must be able to run
arbitrary code with user privileges on the target system.

IV. Workaround

Systems that do not allow unprivileged users to use the ptrace(2)
system call are not vulnerable, this can be accomplished by setting
the sysctl variable security.bsd.unprivileged_proc_debug to zero.
Please note that this will also prevent debugging tools, for instance
gdb, truss, procstat, as well as some built-in debugging facilities in
certain scripting language like PHP, etc., from working for unprivileged
users.

The following command will set the sysctl accordingly and works until the
next reboot of the system:

sysctl security.bsd.unprivileged_proc_debug=0

To make this change persistent across reboot, the system administrator
should also add the setting into /etc/sysctl.conf: