lkml.org 
[lkml]   [2014]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: net: llc: NULL ptr deref in llc_ui_sendmsg
On 06/06/2014 11:42 AM, Dave Jones wrote:
> On Fri, Jun 06, 2014 at 11:08:33AM -0400, Sasha Levin wrote:
> > Hi all,
> >
> > While fuzzing with trinity inside a KVM tools guest running the latest -next
> > kernel I've stumbled on the following spew:
> >
> > [ 269.531162] BUG: unable to handle kernel NULL pointer dereference at 000000000000021e
> > [ 269.531217] IP: llc_ui_sendmsg (net/llc/af_llc.c:912)
>
> 905 /* must bind connection to sap if user hasn't done it. */
> 906 if (sock_flag(sk, SOCK_ZAPPED)) {
> 907 /* bind to sap with null dev, exclusive. */
> 908 rc = llc_ui_autobind(sock, addr);
> 909 if (rc)
> 910 goto release;
> 911 }
> 912 hdrlen = llc->dev->hard_header_len + llc_ui_header_len(sk, addr);
>
> looks like llc->dev was null, (understandable, given Trinity doesn't really know
> how to set up llc beyond random socket()/setsockopt() calls).
>
> llc_ui_autobind returns -ENODEV in that case, so it looks like the SOCK_ZAPPED test
> was false. Something like the patch below maybe ? It feels ugly to be duplicating that
> test there, but if this is agreed upon I'll resubmit this properly.

I figured it's something more complicated than that since trinity stumbled on it only
now and I don't see any code changes in that area. I'll test it with the patch.


Thanks,
Sasha


\
 
 \ /
  Last update: 2014-06-06 20:21    [W:0.036 / U:0.808 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site