[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161220003144.omoqyghgdfbxdyuu@codemonkey.org.uk>
Date: Mon, 19 Dec 2016 19:31:44 -0500
From: Dave Jones <davej@...emonkey.org.uk>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: Re: ipv6: handle -EFAULT from skb_copy_bits
On Mon, Dec 19, 2016 at 02:48:48PM -0500, David Miller wrote:
> One thing that's interesting is that if the user picks "IPPROTO_RAW"
> as the value of 'protocol' we set inet->hdrincl to 1.
>
> The user can also set inet->hdrincl to 1 or 0 via setsockopt().
>
> I think this is part of the problem. The test above means to check
> for "RAW socket with hdrincl set" and is trying to do this more simply.
> But because setsockopt() can set this arbitrarily, testing sk_protocol
> alone isn't enough.
>
> So changing:
>
> sk->sk_protocol == IPPROTO_RAW
>
> into something like:
>
> (sk->sk_socket->type == SOCK_RAW && inet_sk(sk)->hdrincl)
>
> should correct the test.
> ..
>
> You can test if the change I suggest above works.
Unfortunately, this made no difference. I spent some time today trying
to make a better reproducer, but failed. I'll revisit again tomorrow.
Maybe I need >1 process/thread to trigger this. That would explain why
I can trigger it with Trinity.
Dave
Powered by blists - more mailing lists