Bug 1500094 (CVE-2017-5123)

Summary: CVE-2017-5123 kernel: Missing access_ok() checks in waitid()
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: agordeev, airlied, ajax, aquini, bhu, blc, bskeggs, dhoward, eparis, esammons, esandeen, fhrbata, hdegoede, hkrzesin, hwkernel-mgr, iboverma, ichavero, itamar, jarodwilson, jforbes, jglisse, jkacur, jonathan, josef, jross, jwboyer, kernel-maint, kernel-mgr, labbott, lgoncalv, linville, lwang, matt, mchehab, mcressma, mguzik, mjg59, mlangsdo, nhorman, nmurray, plougher, quintela, rt-maint, rvrbovsk, security-response-team, steved, williams, wmealing
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
The waitid implementation in upstream kernels did not restrict the target destination to copy information results. This can allow local users to write to otherwise protected kernel memory, which can lead to privilege escalation.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-10-13 15:30:18 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: 1501762    
Bug Blocks: 1500095    
Attachments:
Description Flags
Proposed patch none

Description Adam Mariš 2017-10-09 20:53:50 UTC
A flaw was found in the upstream version of the kernels implementation of waitid systemcall.   This flaw was the removal of validation of the target location where the kernel would copy the results.   Previously it would implement a check to restrict the results to be copied to a valid userspace address, a new patch had inadvertently allowed copying to kernel addresses.

An attacker could use this flaw to corrupt memory, panic the machine or possibly allow for arbitary memory writes.

Comment 1 Adam Mariš 2017-10-09 20:53:53 UTC
Acknowledgments:

Name: Chris Salls

Comment 2 Adam Mariš 2017-10-09 20:55:18 UTC
Created attachment 1336563 [details]
Proposed patch

Comment 4 Andrej Nemec 2017-10-13 07:12:44 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1501762]

Comment 5 Andrej Nemec 2017-10-13 07:13:48 UTC
References:

http://seclists.org/oss-sec/2017/q4/78

Comment 6 Andrej Nemec 2017-10-13 15:09:00 UTC
Statement:

This issue did not affect the versions of the Linux kernel as shipped with Red Hat Enterprise Linux as they did not include the upstream commit https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4c48abe91be03d191d0c20cc755877da2cb35622 that introduced this issue.

Comment 8 Fedora Update System 2017-10-24 05:29:22 UTC
kernel-4.13.8-300.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2017-10-25 21:21:28 UTC
kernel-4.13.8-100.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2017-10-25 23:14:18 UTC
kernel-4.13.8-200.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.