Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2277135imm; Thu, 7 Jun 2018 08:05:30 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJwRsFVwlILTydHAFYtIKgfWstRMMV9vPYGmK2LrgF0QgDC3YYpBzNPEYuXwpiOyiUjZmWL X-Received: by 2002:a17:902:708c:: with SMTP id z12-v6mr2385287plk.373.1528383930596; Thu, 07 Jun 2018 08:05:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528383930; cv=none; d=google.com; s=arc-20160816; b=T+Y8VO/1fbP0vwraJ2JptUBTKYpNJTaTTqY3YLzb/uabLYyOZ+/QPuOmueZFuZ3uXO FrvXVfKrvU/Kk7uZ2Y+dnDGo/9ZVZMfj5Kf1+ChghEhOyIXbcA7fjH69Q5adz6J9DiMN AfKB1Vih24osEybGJM0I4P920Jb+tViIGbo2EVOszWea/UtFGsZ9LKRzEG8neXY42BBw RgGMrJrCRQ47zOFlMGonSy+SZ+y9sSGNSEY6CDkjKo1qlneKvHxg5/wp0bIBpFqO35Hg XPyCsKU/1Mtwd2VqAjJE+WV7XQHTM3AIc/Dq4mDi9wvh0OMnBNCkZsr16/NXmC9ImPfN laIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=Ij3NSj6BOkj2NBluCJ+BZTrg/FE18S339r/AKj+L7Gs=; b=bVQ9dwRuA8OWOFTzYng9rOz6dAlO/C74ZFVIHrbPcnC8NwjHLNe6a1KH5D2HMZ2Wl4 f//CWboi7l8DnosyCeo2MEfi1Is5CeRzo/RLri0tCWOcOCgWrBvqyzAq8HKBolb1JcbT 7pLwyyo82rsdOSgp2XCSeypKORRpYz20Vgr4g7rOyhpgUvh7A1l+XXcc4FXlCyyWa6GY hinUqMIN6Ct/xhhhD6niyu0hwSP2cyD2u8iS7G8qX8MUj2V+V1VQfoE59St6ZiP8dGxP nbeEDedWBc08b+cbTtc6fB3bh6n6A5iITnacSm1YXCXqXg01QjlgeaLogFRX6v+AD2ZK ejZw== 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 32-v6si54215051plc.252.2018.06.07.08.05.15; Thu, 07 Jun 2018 08:05:30 -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 S965082AbeFGPEU (ORCPT + 99 others); Thu, 7 Jun 2018 11:04:20 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:41584 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936052AbeFGPEP (ORCPT ); Thu, 7 Jun 2018 11:04:15 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbP-0005hJ-Es; Thu, 07 Jun 2018 15:09:23 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvbD-0003GY-Ch; Thu, 07 Jun 2018 15:09:11 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Matthias Schiffer" , "Sven Eckelmann" , "Simon Wunderlich" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 370/410] batman-adv: fix header size check in batadv_dbg_arp() In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Matthias Schiffer commit 6f27d2c2a8c236d296201c19abb8533ec20d212b upstream. Checking for 0 is insufficient: when an SKB without a batadv header, but with a VLAN header is received, hdr_size will be 4, making the following code interpret the Ethernet header as a batadv header. Fixes: be1db4f6615b ("batman-adv: make the Distributed ARP Table vlan aware") Signed-off-by: Matthias Schiffer Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich Signed-off-by: Ben Hutchings --- net/batman-adv/distributed-arp-table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c @@ -343,7 +343,7 @@ static void batadv_dbg_arp(struct batadv batadv_arp_hw_src(skb, hdr_size), &ip_src, batadv_arp_hw_dst(skb, hdr_size), &ip_dst); - if (hdr_size == 0) + if (hdr_size < sizeof(struct batadv_unicast_packet)) return; unicast_4addr_packet = (struct batadv_unicast_4addr_packet *)skb->data;