Bug 1296253 - (CVE-2016-0723) CVE-2016-0723 kernel: Kernel memory disclosure and crash in tty layer
CVE-2016-0723 kernel: Kernel memory disclosure and crash in tty layer
Status: NEW
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
impact=moderate,public=20151127,repor...
: Security
Depends On: 1300224
Blocks: 1296261
  Show dependency treegraph
 
Reported: 2016-01-06 12:51 EST by Adam Mariš
Modified: 2017-04-12 08:35 EDT (History)
32 users (show)

See Also:
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 12:54 EST, Adam Mariš
no flags Details | Diff

  None (edit)
Description Adam Mariš 2016-01-06 12:51:46 EST
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 12:54 EST
Created attachment 1112221 [details]
Proposed patch
Comment 3 Adam Mariš 2016-01-06 13:12:26 EST
Acknowledgments:

This issue was discovered by Milos Vyletel of Red Hat.
Comment 4 Andrej Nemec 2016-01-20 05:06:29 EST
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1300224]
Comment 5 Andrej Nemec 2016-01-20 05:08:00 EST
This issue went public via this correspondence:

http://lkml.iu.edu/hypermail/linux/kernel/1511.3/03045.html
Comment 6 Fedora Update System 2016-01-31 21:21:29 EST
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 01:22:12 EST
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-15 23:46:19 EST
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.