Bug 509627

Summary: kernel: fd leak if pipe() is called with an invalid address [rhel-4.9]
Product: Red Hat Enterprise Linux 4 Reporter: Eugene Teo (Security Response) <eteo>
Component: kernelAssignee: Cong Wang <amwang>
Status: CLOSED ERRATA QA Contact: Petr Beňas <pbenas>
Severity: high Docs Contact:
Priority: high    
Version: 4.9CC: amwang, aviro, jcm, jskrabal, lwang, pbenas, pstehlik, riek, rkhan, syeghiay, vgoyal
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 509625 Environment:
Last Closed: 2011-02-16 15:48:14 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: 509625    
Bug Blocks:    

Description Eugene Teo (Security Response) 2009-07-04 08:03:45 UTC
+++ This bug was initially created as a clone of Bug #509625 +++

Description of problem:
fd leak if pipe() is called with an invalid address.

Though -EFAULT is returned, the file descriptors opened by pipe() call are left open.

Reference:
http://patchwork.kernel.org/patch/33640/

Comment 2 Eugene Teo (Security Response) 2009-07-04 08:20:53 UTC
http://www.chineselinuxuniversity.net/patches/43722.shtml

Comment 4 Alexander Viro 2009-07-20 20:43:13 UTC
This is not a security issue by any stretch of imagination and the author of original patch has overinflated the significance of the bug quite badly.  Which has resulted in a NAK from Linus.  However, it _is_ a correctness issue - we want the 32bit task on amd64 to act as it would on i386, and error handling in pipe(2) would differ for those two cases.  Patch does fix that, but it's not the right fix; the obviously right one is to lose sys32_pipe() and xtensa_pipe() completely and use sys_pipe() instead.  That'll give the reduction of code duplication and give a guaranteed consistency in error handling.  That, in turn, will deal with the so-called "leak" in the same manner as done by the proposed patch.

I'll push such patch via VFS tree.

Comment 6 RHEL Program Management 2010-10-12 12:50:00 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 7 Vivek Goyal 2010-10-18 13:49:11 UTC
Committed in 89.45.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/

Comment 11 Petr Beňas 2010-11-18 12:40:02 UTC
Reproduced in 89.44.EL on i386, x86_64, ppc64 and s390x. Verified in 89.45.EL on i386, x86_64, ppc64, ia64 and s390x. Not reproduced in ia64.

Comment 13 errata-xmlrpc 2011-02-16 15:48:14 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0263.html