Bug 1296253 (CVE-2016-0723) - CVE-2016-0723 kernel: Kernel memory disclosure and crash in tty layer
Summary: CVE-2016-0723 kernel: Kernel memory disclosure and crash in tty layer
Status: NEW
Alias: CVE-2016-0723
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
(Show other bugs)
Version: unspecified
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard: impact=moderate,public=20151127,repor...
Keywords: Security
Depends On: 1300224
Blocks: 1296261
TreeView+ depends on / blocked
 
Reported: 2016-01-06 17:51 UTC by Adam Mariš
Modified: 2018-08-28 22:01 UTC (History)
29 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
A use-after-free flaw was discovered in the Linux kernel's tty subsystem, which allows for the disclosure of uncontrolled memory location and possible kernel panic. The information leak is caused by a race condition when attempting to set and read the tty line discipline. A local attacker could use the TIOCSETD (via tty_set_ldisc ) to switch to a new line discipline; a concurrent call to a TIOCGETD ioctl performing a read on a given tty could then access previously allocated memory. Up to 4 bytes could be leaked when querying the line discipline or the kernel could panic with a NULL-pointer dereference.
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Proposed patch (1.01 KB, patch)
2016-01-06 17:54 UTC, Adam Mariš
no flags Details | Diff

Description Adam Mariš 2016-01-06 17:51:46 UTC
A flaw was discovered in the linux kernel tty subsystem which allows for disclosure of uncontrolled memory location and possible kernel panic. The information leak is caused by a race condition when attempting to set and read the tty line discipline.  An attacker can use the TIOCSETD (via tty_set_ldisc ) to switch to a new line discipline, a concurrent call to with a TIOCGETD ioctl performs a read on a given tty may be able to access memory previously  allocated.  Up to 4 bytes may leaked when querying the line discipline.


The problematic code:

case TIOCGETD:
  return put_user(tty->ldisc->ops->num, (int __user *)p);

The flaw is triggered when ldisc's address is loaded before the new address is set and the access is performed after the old is freed, which results to crash due to the kernel accessing an invalid address. If an attacker prepares the kernel slab by setting up the ldisc struct at the correct offset they can effectively read 4 bytes from any kernel memory.

Invalid data at the ldisc address may also panic the machine if it is not pointing to valid mappable memory.

Upstream fix:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=5c17c861a357e9458001f021a7afa7aab9937439

Original proposed fix:
https://bugzilla.redhat.com/attachment.cgi?id=1112221&action=diff

Comment 1 Adam Mariš 2016-01-06 17:54 UTC
Created attachment 1112221 [details]
Proposed patch

Comment 3 Adam Mariš 2016-01-06 18:12:26 UTC
Acknowledgments:

This issue was discovered by Milos Vyletel of Red Hat.

Comment 4 Andrej Nemec 2016-01-20 10:06:29 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1300224]

Comment 5 Andrej Nemec 2016-01-20 10:08:00 UTC
This issue went public via this correspondence:

http://lkml.iu.edu/hypermail/linux/kernel/1511.3/03045.html

Comment 6 Fedora Update System 2016-02-01 02:21:29 UTC
kernel-4.3.4-300.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2016-02-01 06:22:12 UTC
kernel-4.3.4-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 8 Wade Mealing 2016-02-16 04:46:19 UTC
Statement: 

This issue affects kernels in Red Hat Enterprise Linux 5, 6 and 7. This has been rated as having Moderate 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/.


Note You need to log in before you can comment on or make changes to this bug.