Bug 166830 - CAN-2005-2492 sendmsg DoS
Summary: CAN-2005-2492 sendmsg DoS
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.0
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
: ---
Assignee: Alexander Viro
QA Contact: Brian Brock
URL:
Whiteboard: reported=20050821,impact=important,pu...
Depends On:
Blocks: 156322
TreeView+ depends on / blocked
 
Reported: 2005-08-26 10:04 UTC by Mark J. Cox
Modified: 2019-01-22 12:23 UTC (History)
2 users (show)

Fixed In Version: RHSA-2005-514
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-10-05 13:53:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch (631 bytes, patch)
2005-08-26 10:04 UTC, Mark J. Cox
no flags Details | Diff
fuse-mount-log (11.37 KB, application/octet-stream)
2019-01-22 12:23 UTC, SATHEESARAN
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2005:514 0 qe-ready SHIPPED_LIVE Important: Updated kernel packages available for Red Hat Enterprise Linux 4 Update 2 2005-10-05 04:00:00 UTC

Description Mark J. Cox 2005-08-26 10:04:10 UTC
Al Viro discovered in net/ipv[46]/raw.c raw_sendmsg() we have
                if (!inet->hdrincl)
                        raw_probe_proto_opt(&fl, msg);
                err = ip_route_output_flow(&rt, &fl, sk, !(msg-.....

So call sendmsg with sk->sk_protocol == IPPROTO_ICMP, msg->msg_iovlen = 1 and
msg->msg_iov[0].iov_base pointing to kernel space (.iov_len > 1).  Then in
raw_probe_proto_opt() we have type == msg->msg_iov[0].iov_base code ==
msg->msg_iov[0].iov_base + 1 when we hit 
         get_user(fl->fl_icmp_type, type);
         __get_user(fl->fl_icmp_code, code);

Note that failure of the first call is ignored and we happily do the second
call, an unchecked __get_user() which generates a memory read on the arbitrary
user-supplied address.

sendmsg() will fail if iovec points to kernel memory, but it may be possible to
trick ip_route_output_flow() into returning an error depending on the value of
 fl->fl_icmp_code.  Iff we can do that, the attacker can obtain information
about the value read from arbitrary kernel address by looking at the error
returned by sendmsg(2).

On some architectures (including x86) a 16 bit read at a user-supplied address
could access iomem (no separate mmu context) and therefore mess with hardware
state leading to a DoS.

"A local unprivileged user may be able to use this flaw to leak information
about the contents of kernel memory, or on some architectures cause a denial of
service by manipulating hardware state"

Comment 1 Mark J. Cox 2005-08-26 10:04:10 UTC
Created attachment 118139 [details]
Proposed patch

Comment 3 Mark J. Cox 2005-08-31 09:53:19 UTC
Notified security, vendor-sec. 
Embargo set for one week, 20050907:12

Comment 4 Mark J. Cox 2005-09-09 07:47:24 UTC
Public as at 20050909 by commit to git; removing embargo

Comment 6 Red Hat Bugzilla 2005-10-05 13:53:30 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2005-514.html


Comment 7 SATHEESARAN 2019-01-22 12:23:46 UTC
Created attachment 1522388 [details]
fuse-mount-log


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