From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1432667AbdDYSKe (ORCPT ); Tue, 25 Apr 2017 14:10:34 -0400 Received: from mail-yw0-f182.google.com ([209.85.161.182]:35221 "EHLO mail-yw0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752988AbdDYSKY (ORCPT ); Tue, 25 Apr 2017 14:10:24 -0400 MIME-Version: 1.0 In-Reply-To: <20170425.135543.1706004185593424024.davem@davemloft.net> References: <20170425131827.66498-1-glider@google.com> <20170425.135543.1706004185593424024.davem@davemloft.net> From: Eric Dumazet Date: Tue, 25 Apr 2017 11:10:22 -0700 Message-ID: Subject: Re: [PATCH] ipv6: ensure message length for raw socket is at least sizeof(ipv6hdr) To: David Miller Cc: Alexander Potapenko , Dmitry Vyukov , Kostya Serebryany , Alexey Kuznetsov , LKML , netdev Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 25, 2017 at 10:55 AM, David Miller wrote: > From: Alexander Potapenko > Date: Tue, 25 Apr 2017 15:18:27 +0200 > >> rawv6_send_hdrinc() expects that the buffer copied from the userspace >> contains the IPv6 header, so if too few bytes are copied parts of the >> header may remain uninitialized. >> >> This bug has been detected with KMSAN. >> >> Signed-off-by: Alexander Potapenko > > Hmmm, ipv4 seems to lack this check as well. > > I think we need to be careful here and fully understand why KMSAN doesn't > seem to be triggering in the ipv4 case but for ipv6 it is before I apply > this. This could be a bug in nf_ct_frag6_gather() missing one pskb_may_pull()