Bug 1337528 (CVE-2016-4913)

Summary: CVE-2016-4913 kernel: Information leak when handling NM entries containing NUL
Product: [Other] Security Response Reporter: Andrej Nemec <anemec>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: aquini, arm-mgr, bhu, dhoward, fhrbata, gansalmon, iboverma, itamar, jforbes, jkacur, joelsmith, jonathan, jross, jwboyer, kernel-maint, kernel-mgr, kstutsma, lgoncalv, madhu.chinakonda, matt, mchehab, mcressma, nmurray, plougher, rt-maint, rvrbovsk, slawomir, vdronov, williams
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: impact=low,public=20160505,reported=20160518,source=oss-security,cvss2=2.1/AV:L/AC:L/Au:N/C:P/I:N/A:N,cwe=CWE-200,rhel-5/kernel=wontfix,rhel-6/kernel=wontfix,rhel-7/kernel=affected,rhel-7/kernel-rt=affected,mrg-2/realtime-kernel=wontfix,rhelsa-7/arm-kernel=affected,fedora-all/kernel=affected
Fixed In Version: Doc Type: Bug Fix
Doc Text:
A vulnerability was found in the Linux kernel. Payloads of NM entries are not supposed to contain NUL. When such entry is processed, only the part prior to the first NUL goes into the concatenation (i.e. the directory entry name being encoded by a bunch of NM entries). The process stops when the amount collected so far + the claimed amount in the current NM entry exceed 254. However, the value returned as the total length is the sum of *claimed* sizes, not the actual amount collected. And that's what will be passed to readdir() callback as the name length - 8Kb __copy_to_user() from a buffer allocated by __get_free_page().
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-08 02:52:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 1337529, 1340778, 1340779, 1340780, 1340781    
Bug Blocks: 1337530    

Description Andrej Nemec 2016-05-19 11:52:21 UTC
A vulnerability was found in the Linux kernel. Payloads of NM entries are not supposed to contain NUL. When such entry is processed, only the part prior to the first NUL goes into the concatenation (i.e. the directory entry name being encoded by a bunch of NM entries).  The process stops when the amount collected so far + the claimed amount in the current NM entry exceed 254.

However, the value returned as the total length is the sum of *claimed* sizes, not the actual amount collected.  And that can grow pretty large - not unlimited, since you'd need to put CE entries in between to be able to get more than the maximum that could be contained in one isofs directory entry / continuation chunk and the process stops once it had encountered 32 CEs, but you can get about 8Kb easily.  And that's what will be passed to readdir callback as the name length.  8Kb __copy_to_user() from a buffer allocated by __get_free_page()

References, CVE-ID request and response:

http://seclists.org/oss-sec/2016/q2/363

http://seclists.org/oss-sec/2016/q2/365

Upstream fix:

https://git.kernel.org/linus/99d825822eade8d827a1817357cbf3f889a552d6

Comment 1 Andrej Nemec 2016-05-19 11:53:48 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1337529]

Comment 2 Fedora Update System 2016-05-24 18:03:15 UTC
kernel-4.5.5-300.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 4 Vladis Dronov 2016-05-30 09:29:18 UTC
Statement:

This issue affects the Linux kernel packages as shipped with Red Hat Enterprise Linux 5, 6 and MRG-2. This has been rated as having Low security impact and is not currently planned to be addressed in future updates. For additional information, refer to the Red Hat Enterprise Linux Life Cycle: https://access.redhat.com/support/policy/updates/errata/.

This issue affects the Linux kernel packages as shipped with Red Hat Enterprise Linux 7. Future Linux kernel updates for the respective releases might address this issue.

Comment 9 Fedora Update System 2016-06-01 20:23:26 UTC
kernel-4.4.11-200.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2016-06-02 14:58:01 UTC
kernel-4.5.5-201.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 errata-xmlrpc 2018-10-30 07:30:31 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2018:3083 https://access.redhat.com/errata/RHSA-2018:3083

Comment 12 errata-xmlrpc 2018-10-30 07:36:43 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2018:3096 https://access.redhat.com/errata/RHSA-2018:3096