Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1631904imm; Fri, 6 Jul 2018 03:47:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpffnEIlWqEdAjxhHe1rIm2YrXO4Z4rhKbn9g6bTnhKaji5Yc8R7cmMZ7anzAB4HMQPwf1D4 X-Received: by 2002:a65:614e:: with SMTP id o14-v6mr9111299pgv.308.1530874051551; Fri, 06 Jul 2018 03:47:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530874051; cv=none; d=google.com; s=arc-20160816; b=ImX9aDnnYta1IYQbBP8ZDWy69G2zYHdIriUckVYZVJlwbp9UumHM8NN6nv3dZAl7L/ h1UVDcXuYSFQSSnYyBOTqUlO5PDJfL6z7HzHQ2Obr3OQjgaAUba4qSOBWeSf/K4YQgXp exGU7pE0tVvrTTiH8I8NsPTXTX9d+2zEQZz8uEIjv9wwVW1WYzZZvkehP5oU4i6S//XD BNRcYPvYRIXTK25o1Z7R5SCsND2u24qBpVEMojoQcaNMyo0uzyxGhGtnE5DBR1TfhamZ 7uip5nN/S2J8chyAqrnzXkK6PD11wQ9wngW6buhXVc2l0CicV19wKgYPUyobLZPfoYtA nqLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:arc-authentication-results; bh=QFRF2PPKSSDeRW4ERZu5eHHtYtnzStkrs1nBoXlcqLM=; b=CBuGHhs65jQxzcesx2XNudmPJ/2ZBNNvoOyotqkJ1GErrYUTA+fOKPF26Gjg0SbysQ qwLVLRerbr9BWGSO5IA8+kXi7DKVjxFFs3FcHz9bTmgg797ssLt19exApbTW5Kr6igWm pfBSZlsR4a+kND3xzmVYPRwbVPvu1RYKpvYUwYWMtOplsyHhMoRY3/Hi54AMdLM7/01B R0CIZ8PpEN++JaRL1OY0fSgh9X7v6BIG1i5nEZWh1jJJfDPp71gbgb1zO5t8nGe29Eue xd2N0pnONMTwwHz0Rb5CD7XPf8zFa3RfXJ5VzyDUkERvQdgoZYSXdoLpyTPXYyr8Gi5B XNew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2-v6si7837921plr.393.2018.07.06.03.47.16; Fri, 06 Jul 2018 03:47:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754109AbeGFKq0 (ORCPT + 99 others); Fri, 6 Jul 2018 06:46:26 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:34658 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754038AbeGFKqW (ORCPT ); Fri, 6 Jul 2018 06:46:22 -0400 Received: from [192.168.0.117] (188.146.34.1.nat.umts.dynamic.t-mobile.pl [188.146.34.1]) by mail.holtmann.org (Postfix) with ESMTPSA id 0C9EECF2A7; Fri, 6 Jul 2018 12:53:10 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: [PATCH] 6lowpan: iphc: reset mac_header after decompress to fix panic From: Marcel Holtmann In-Reply-To: <20180619234406.8217-1-michael@opensourcefoundries.com> Date: Fri, 6 Jul 2018 12:46:20 +0200 Cc: Alexander Aring , Jukka Rissanen , "David S. Miller" , linux-bluetooth@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: <3AAE601A-9D04-4BC5-8D96-5570F4C53F3B@holtmann.org> References: <20180619234406.8217-1-michael@opensourcefoundries.com> To: Michael Scott X-Mailer: Apple Mail (2.3445.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michael, > After decompression of 6lowpan socket data, an IPv6 header is inserted > before the existing socket payload. After this, we reset the > network_header value of the skb to account for the difference in payload > size from prior to decompression + the addition of the IPv6 header. > > However, we fail to reset the mac_header value. > > Leaving the mac_header value untouched here, can cause a calculation > error in net/packet/af_packet.c packet_rcv() function when an > AF_PACKET socket is opened in SOCK_RAW mode for use on a 6lowpan > interface. > > On line 2088, the data pointer is moved backward by the value returned > from skb_mac_header(). If skb->data is adjusted so that it is before > the skb->head pointer (which can happen when an old value of mac_header > is left in place) the kernel generates a panic in net/core/skbuff.c > line 1717. > > This panic can be generated by BLE 6lowpan interfaces (such as bt0) and > 802.15.4 interfaces (such as lowpan0) as they both use the same 6lowpan > sources for compression and decompression. > > Signed-off-by: Michael Scott > --- > net/6lowpan/iphc.c | 1 + > 1 file changed, 1 insertion(+) patch has been applied to bluetooth-next tree. Regards Marcel