Stack overflow in ecryptfs with /proc/pid/environ could lead to root (CVE-2016-1583)
This document (7017678) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server 12 Service Pack 1 (SLES 12 SP1)
SUSE Linux Enterprise Server 11 Service Pack 4 (SLES 11 SP4)
SUSE Linux Enterprise Server 11 Service Pack 3 LTSS (SLES 11 SP3 LTSS)
Expanded Support 5 (RES5)
Expanded Support 6 (RES6)
Situation
s->s_stack_depth = path.dentry->d_sb->s_stack_depth + 1;
rc = -EINVAL;The files /proc/$pid/{mem,environ,cmdline}, when read, access the userspace memory of the target process, involving, if necessary, normal pagefault handling. If it was possible to mmap() them, an attacker could create a chain of e.g. /proc/$pid/environ mappings where process 1 has /proc/2/environ mapped into its environment area, process 2 has /proc/3/environ mapped into its environment area and so on. A read from /proc/1/environ would invoke the pagefault handler for process 1, which would invoke the pagefault handler for process 2 and so on. This would, again, lead to kernel stack overflow.
if (s->s_stack_depth > FILESYSTEM_MAX_STACK_DEPTH)
{pr_err("eCryptfs: maximum fs stacking depth exceeded\n");}
goto out_free;
Resolution
SLES 12More patches (e.g. SLES 12 SP1 / SLES 11 SP4) are currently being reviewed by SUSE QA and will be released within the next days.
- kernel 3.12.55-52.45.1 has been released 16th of June 2016
The following workaround is also available:
- deinstall ecryptfs-utils (if not used)
- Remove the setuid bit from /sbin/mount.ecryptfs_private by either a direct
- chmod 755 /sbin/mount.ecryptfs_private
- or to avoid the permissions framework undoing the change, temporary appending the line:
/sbin/mount.ecryptfs_private root:root 0755
to /etc/permissions.local and then running "chkstat --system"
Cause
Additional Information
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:7017678
- Creation Date: 07-Jun-2016
- Modified Date:03-Mar-2020
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com