Bug 250972 (CVE-2007-3848)

Summary: CVE-2007-3848 Privilege escalation via PR_SET_PDEATHSIG
Product: [Other] Security Response Reporter: Marcel Holtmann <holtmann>
Component: vulnerabilityAssignee: Peter Zijlstra <pzijlstr>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: dhoward, dzickus, kernel-mgr, kreilly, lwang
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-01 13:35:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 251115, 251116, 251117, 251118, 251119, 252306, 252307    
Bug Blocks:    

Description Marcel Holtmann 2007-08-06 09:06:01 UTC
Reported by Vulnerability Research Labs, COSEINC PTE Ltd.

An unprivileged user may send arbitrary signal to a child process even
if it is running with higher privileges.

When a parent process dies or exits its child processes may receive a
signal.  Each child process may choose and set its own "parent process
death signal" using PR_SET_PDEATHSIG function of the prctl() system
call. 

        PARENT          CHILD
        ----------------------------------------------------------------
        fork()
                        prctl(PR_SET_PDEATHSIG)
        exit()'ed or killed
                        child receives the signal

The parent process death signal is not reset over execve() system call
and is inherited by spawned process:

        PARENT          CHILD
        ----------------------------------------------------------------
        fork()
                        prctl(PR_SET_PDEATHSIG)
                        execve("./a.out")
        exit()'ed or killed
                        child receives the signal

The signal gets delivered only if parent process has sufficient
privileges to send signals to child processes. Typically any child
process running with higher privilege than its parent will receive no
signal. 

        PARENT          CHILD
        ----------------------------------------------------------------
        fork()
                        prctl(PR_SET_PDEATHSIG)
                        execve("/bin/setuid-binary")
        exit()'ed or killed
                        child receives NO signal this time

However, above restriction may be bypassed if parent process execute
setuid-root binary which dies afterwards.

        PARENT          CHILD
        ----------------------------------------------------------------
        fork()
                        prctl(PR_SET_PDEATHSIG)
                        execve("/bin/setuid-binary")
        execve("/bin/setuid-binary")
        exit()'ed or killed
                        privileged process receives the signal

Comment 6 Marcel Holtmann 2007-08-14 16:14:13 UTC
This went public today:

http://marc.info/?l=openwall-announce&m=118710356812637&w=2


Comment 8 Marcel Holtmann 2007-08-17 19:33:35 UTC
The post of their advisory can be found here:

http://marc.info/?l=bugtraq&m=118711306802632&w=2