Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp714320imj; Wed, 13 Feb 2019 16:20:50 -0800 (PST) X-Google-Smtp-Source: AHgI3IZyNuUbhkxxCO+dk6fkuatM4Ux7z0Z6IzYJgommxcrt2oEQpABym5bZXLY0U/IZ+DxnYwix X-Received: by 2002:a63:c40a:: with SMTP id h10mr903908pgd.131.1550103650514; Wed, 13 Feb 2019 16:20:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550103650; cv=none; d=google.com; s=arc-20160816; b=Tk6joiGbnhkN6HmbcKyrNxeyEz9KFLxVlvZwpHfqT02ugt9AoSlKKXJsa51Fjai2Nd IMPIxo0d7dwghE7odAzYZJACXVBImpTyOF8HWOi8fAJ+mYlMw5NOot/Pv8dAvbOjPyuf HlCcrordZ4wJJKrd8Q9qD5aYC8Ch3M8D8YHZlMVxFTWoP8RSdN0t/Kv+AzGmNQKovCbT qDt6jQt4LDc6Rs3AjGIMi6tKsPZ09FvHdOcKphQQ18r0xSiMm6BZIJhjXmZLpzfnqgo9 Ie8bbMivU+U71uqp4ok3MXJn3r1heUJ6bYR9cbIGWYXZx7KJUFtZhvxgfCTKBTNCrbsz CLgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JUyxCKAWdRb119bu3d49QfMAcjwAYjXdgufFYsmXUh0=; b=m5muHMgbXCPk8eX9x3v85W3K8tEbOesFWzAHYTvMqTeSJohsi3SNqiPy3ViL5M2Htc 02cUb/xGpnjo0flNeQV4jurPd3QEKBWk+5kLmmAVsIx0Y13QyCKKJBbmTM0ct+nGTkf1 +VndIWmBuC3MzvTTaN06tDfNgEh3MVSJZjGd/UQ19ggSoWo9l5jOryiNKbax1ocrqkIA shfGWI9m2g6wPEm1MTRzGciKPsiAI6SVth93O6cC8oh85ZUUS4qAFBikutjVhStZncyA 0ZuzEYL+Wm5PuiWjdeNLLN4awYlsSFjF55Umy6biNZQmUq5j1LNRfywUNtB0AX7TTrYZ V4Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zDUqbPtL; 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 e12si861291pln.21.2019.02.13.16.20.34; Wed, 13 Feb 2019 16:20:50 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=zDUqbPtL; 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 S2406535AbfBMSq5 (ORCPT + 99 others); Wed, 13 Feb 2019 13:46:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:45458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389765AbfBMSqy (ORCPT ); Wed, 13 Feb 2019 13:46:54 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 72F3020835; Wed, 13 Feb 2019 18:46:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550083614; bh=0vV8SkjlVGikjtuJR9BQnGMJqvfC+g6EJjWvqmE1+jA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zDUqbPtLPyUHmLrmeC0dSGVQZozpNg+TDvzvp7rIhiZzEQsqcgRyyo9HCKzj9lvGk IlLd/gWhn72YpwjUMCFp+uHqN+Msg6xk5vltvzNMbXv0EgieHYc7wZ6BnlgFiYSXhy 7lxM6h/Dg4pXYy0ZsmeRxy5VFmQu0xVVKVno7XA4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+9d7405c7faa390e60b4e@syzkaller.appspotmail.com, syzbot+7d20bc3f1ddddc0f9079@syzkaller.appspotmail.com, Sven Eckelmann , Simon Wunderlich Subject: [PATCH 4.20 50/50] batman-adv: Force mac header to start of data on xmit Date: Wed, 13 Feb 2019 19:38:55 +0100 Message-Id: <20190213183659.596955407@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190213183655.747168774@linuxfoundation.org> References: <20190213183655.747168774@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sven Eckelmann commit 9114daa825fc3f335f9bea3313ce667090187280 upstream. The caller of ndo_start_xmit may not already have called skb_reset_mac_header. The returned value of skb_mac_header/eth_hdr therefore can be in the wrong position and even outside the current skbuff. This for example happens when the user binds to the device using a PF_PACKET-SOCK_RAW with enabled qdisc-bypass: int opt = 4; setsockopt(sock, SOL_PACKET, PACKET_QDISC_BYPASS, &opt, sizeof(opt)); Since eth_hdr is used all over the codebase, the batadv_interface_tx function must always take care of resetting it. Fixes: c6c8fea29769 ("net: Add batman-adv meshing protocol") Reported-by: syzbot+9d7405c7faa390e60b4e@syzkaller.appspotmail.com Reported-by: syzbot+7d20bc3f1ddddc0f9079@syzkaller.appspotmail.com Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich Signed-off-by: Greg Kroah-Hartman --- net/batman-adv/soft-interface.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@ -221,6 +221,8 @@ static netdev_tx_t batadv_interface_tx(s netif_trans_update(soft_iface); vid = batadv_get_vid(skb, 0); + + skb_reset_mac_header(skb); ethhdr = eth_hdr(skb); switch (ntohs(ethhdr->h_proto)) {