Bug 697822 (CVE-2011-1593) - CVE-2011-1593 kernel: proc: signedness issue in next_pidmap()
Summary: CVE-2011-1593 kernel: proc: signedness issue in next_pidmap()
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2011-1593
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard: public=20110413,reported=20110413,sou...
Depends On: 697824 697825 697826 697827 697828 697838
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-19 11:42 UTC by Petr Matousek
Modified: 2019-06-08 18:48 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-29 12:39:47 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0927 normal SHIPPED_LIVE Important: kernel security and bug fix update 2011-07-15 06:07:56 UTC
Red Hat Product Errata RHSA-2011:1189 normal SHIPPED_LIVE Important: kernel security, bug fix, and enhancement update 2011-08-23 14:41:43 UTC
Red Hat Product Errata RHSA-2011:1253 normal SHIPPED_LIVE Important: kernel-rt security and bug fix update 2011-09-12 19:43:48 UTC

Description Petr Matousek 2011-04-19 11:42:20 UTC
A signedness issue has been found in next_pidmap() function when the "last"
parameter is negative as next_pidmap() just quietly accepted whatever
"last" pid that was passed in, which is not all that safe when one of the
users is /proc.

Setting f_pos to negative value when accessing /proc via readdir()/getdents()
resulted in sign extension of this value when map pointer was being
constructed.

This later lead to #GP becasue the final pointer was not cannonical (x86_64).

map = &pid_ns->pidmap[(last + 1)/BITS_PER_PAGE];
 ffffffff810ac3b4:       48 63 f6                movslq %esi,%rsi      <- sign extension (f_pos+-)
 ffffffff810ac3b7:       81 e2 ff 7f 00 00       and    $0x7fff,%edx 
 ffffffff810ac3bd:       48 c1 ee 0f             shr    $0xf,%rsi
 ffffffff810ac3c1:       48 c1 e6 04             shl    $0x4,%rsi
 ffffffff810ac3c5:       48 8d 5c 37 08          lea    0x8(%rdi,%rsi,1),%rbx 
  ...
if (unlikely(!map->page)) 
 ffffffff810ac3cc:       48 8b 7b 08             mov    0x8(%rbx),%rdi <- #GP

Only x86_64 architecture seems to be vulnerable to this particular issue
(tested ppc64, s390x, ia64).

Reference:
http://groups.google.com/group/fa.linux.kernel/browse_thread/thread/93c1088451fd3522/4a28ecb7f755a88d?#4a28ecb7f755a88d

Upstream commit:
http://git.kernel.org/linus/c78193e9
http://git.kernel.org/linus/d8bdc59f

Acknowledgements:

Red Hat would like to thank Robert Swiecki for reporting this issue.

Comment 5 Petr Matousek 2011-05-02 09:58:00 UTC
Statement:

This issue affects the versions of Linux kernel as shipped with Red Hat
Enterprise Linux 4, 5, 6, and Red Hat Enterprise MRG. This has been addressed in Red Hat Enterprise Linux 5, 6 and Red Hat Enterprise MRG via https://rhn.redhat.com/errata/RHSA-2011-0927.html, https://rhn.redhat.com/errata/RHSA-2011-1189.html, and https://rhn.redhat.com/errata/RHSA-2011-1253.html. Red Hat Enterprise Linux 4 is now in Production 3 of the maintenance life-cycle, https://access.redhat.com/support/policy/updates/errata/, therefore the fix for this issue is not currently planned to be included in the future updates.

Comment 6 errata-xmlrpc 2011-07-15 06:09:03 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2011:0927 https://rhn.redhat.com/errata/RHSA-2011-0927.html

Comment 7 errata-xmlrpc 2011-08-23 14:42:20 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 6

Via RHSA-2011:1189 https://rhn.redhat.com/errata/RHSA-2011-1189.html

Comment 8 errata-xmlrpc 2011-09-12 19:45:15 UTC
This issue has been addressed in following products:

  MRG for RHEL-6 v.2

Via RHSA-2011:1253 https://rhn.redhat.com/errata/RHSA-2011-1253.html


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