From patchwork Mon Oct 12 13:27:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 270354 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 076CCC433DF for ; Mon, 12 Oct 2020 13:40:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A654422251 for ; Mon, 12 Oct 2020 13:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510034; bh=rS/DKVSXYHaqG/sx+63VH2DsCVYVXiUBflgXOxQzpvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KzVnzhhUPyqTGaexX8VVm3DJUjBsp+Nf0PjG2i8ejU/UGlEmS4a46xqnUKxAcKYCk Jz+NLUeYQ6Eg2LBW5eKUUS6JEVZOLWFYLcG1PDI/O2pwbXOYXEeu+WOZJn+/ZuzOgq bfgwsEHSPaqsIYYyuO/hyHpgL4jnjjgEDIQGYvsw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388855AbgJLNkd (ORCPT ); Mon, 12 Oct 2020 09:40:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:42852 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731331AbgJLNjI (ORCPT ); Mon, 12 Oct 2020 09:39:08 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 908992076E; Mon, 12 Oct 2020 13:39:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602509948; bh=rS/DKVSXYHaqG/sx+63VH2DsCVYVXiUBflgXOxQzpvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g/e9+24fHkT7VIZgDrhRVilohcFWN4jgsWriGu+qtp/ixx12LZAbBxSKxUR2JMcOO +8cD1PCDCMnbFXlc2z+fe/tKv8K8hmntjvA6Aw7hiqn6Ae4LT6zh+X+TA1s1+0kzNc AUXTriGvrBOfGwYL18Z+yjVJXVlKnk5tdOhJPe/0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , "David S. Miller" Subject: [PATCH 4.19 26/49] team: set dev->needed_headroom in team_setup_by_port() Date: Mon, 12 Oct 2020 15:27:12 +0200 Message-Id: <20201012132630.666443258@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012132629.469542486@linuxfoundation.org> References: <20201012132629.469542486@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Eric Dumazet commit 89d01748b2354e210b5d4ea47bc25a42a1b42c82 upstream. Some devices set needed_headroom. If we ignore it, we might end up crashing in various skb_push() for example in ipgre_header() since some layers assume enough headroom has been reserved. Fixes: 1d76efe1577b ("team: add support for non-ethernet devices") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/team/team.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c @@ -2086,6 +2086,7 @@ static void team_setup_by_port(struct ne dev->header_ops = port_dev->header_ops; dev->type = port_dev->type; dev->hard_header_len = port_dev->hard_header_len; + dev->needed_headroom = port_dev->needed_headroom; dev->addr_len = port_dev->addr_len; dev->mtu = port_dev->mtu; memcpy(dev->broadcast, port_dev->broadcast, port_dev->addr_len);