netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [Bugme-new] [Bug 10423] New: af_rose sendmsg length check
       [not found] <bug-10423-10286@http.bugzilla.kernel.org/>
@ 2008-04-08 17:39 ` Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2008-04-08 17:39 UTC (permalink / raw)
  To: thomas.pollet; +Cc: bugme-daemon, netdev


(switched to email.  Please respond via emailed reply-to-all, not via the
bugzilla web interface).

On Tue,  8 Apr 2008 06:48:27 -0700 (PDT) bugme-daemon@bugzilla.kernel.org wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=10423
> 
>            Summary: af_rose sendmsg length check
>            Product: Networking
>            Version: 2.5
>      KernelVersion: 2.6.24.4
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: Other
>         AssignedTo: acme@ghostprotocols.net
>         ReportedBy: thomas.pollet@gmail.com
> 
> 
> Hi,
> 
> the code from rose_sendmsg in sys/net/af_rose.c doesn't check the value of len. 
> suppose len is very big (0xfffffff8 for example) then "size" would overflow.
> 
>         size = len + AX25_BPQ_HEADER_LEN + AX25_MAX_HEADER_LEN + ROSE_MIN_LEN;
> 
> resulting in a buffer that's too small.
> 
> if ((skb = sock_alloc_send_skb(sk, size, msg->msg_flags & MSG_DONTWAIT, &err))
> == NULL)
>                 return err;
> 
> the buffer is filled here:
> 
> 1115         skb_put(skb, len);
> 1116 
> 1117         err = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov,
> len);
> 
> 

It might be that it doesn't need to check.  We check that the total length
didn't overflow negative in sys_sendmsg()'s call to verify_iovec().

Of course, the addition which you identify might make a very large length
overflow 0x7fffffff, and subsequent code might handle that incorrectly.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-08 17:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <bug-10423-10286@http.bugzilla.kernel.org/>
2008-04-08 17:39 ` [Bugme-new] [Bug 10423] New: af_rose sendmsg length check Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).