Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2658144pxj; Mon, 31 May 2021 07:35:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4IDvgYPCPMNSr1AkuQhFZZNbZ273WIOvAynXyfoDaD+wgKUCFpPnPBW66Ib7aIyjwksk9 X-Received: by 2002:a02:7354:: with SMTP id a20mr20874997jae.94.1622471711354; Mon, 31 May 2021 07:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622471711; cv=none; d=google.com; s=arc-20160816; b=YW9yGeaw5K8csJngC8h9SLu9vBRHepCBcFov5QFbo/ZizbzR3/MwQq5Cn4mt1LN7/h mG/vJPXPorI2uhuA4dVpiIC+7k/F/WGkiOXM97ngNT+dlhnW38LB6ncyXkBQm+0r5hMf jwHKSK50nSTuWAKXqaHNYVm2OqjIsKwafHZSPHwao2fQL52PJRRDUqIqYXI7kjSt6Pip LsjRyyUvSYKa/zlm5GcWdkUEhfv6Dtp/s2z279EA4GmDUv6p/Z2MjjuzTQqu0tngKLZY cXYTEyMFFJcWOGc1ZVi0FH3o39eQB5fGngXXKLSLn+IxUIwBqkWcgmM53C/yblDQCJci /MnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Mv3g0HjUMl/m4Ou7QMogNqDxVusnFJVk/NAyiILLpQ8=; b=t1mU2hyMX60mFoUoaREm/+YhbB4BgUFJLsBWoyPNm9opURov4pHjWmAJ1S5W6946kR xxlDLgs4Vmaor/SYQaW59nE5OW1qQu2FR+adxYilPLG8RjYmGyveAn4Ao/2UWYPbiEdE W0kW0z31ZFnVQPyZGDQUEHJoNocHPi0ABTqCSRnRWvY6tQiXiAt09qYRuwK59pgQD7cK s4kSs8C9lYau4aqu8dLMOjJUwCTe8OWXPVOXjyB7ycPp2R0mY6mSD/OGozlnAJX9U8az EH7x9niuKDfEvfvPVWgKFOvWz+IObBQ1/ONN6oLizWk0Ril8VxV113Ur8cSbqJsF1TjM cNIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MEZtSnNF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si15194455iow.22.2021.05.31.07.34.58; Mon, 31 May 2021 07:35:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MEZtSnNF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230412AbhEaOgG (ORCPT + 99 others); Mon, 31 May 2021 10:36:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:60392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232458AbhEaNzw (ORCPT ); Mon, 31 May 2021 09:55:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 51CC56191E; Mon, 31 May 2021 13:34:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468064; bh=x1pPOSprWzG+lSx5h3f4jjsqv/cvvuQH/fxPSt6chCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MEZtSnNFOBbuhS8ZycmCRSNR3aX/DIH9PrpOJfZ5b8e8zKuuc4Y6UW0ECJSZCm+zJ i6SLsGge8Wv/6vrt/54H68qAzGYFPwBLlijAGFjBhba3FXyFqUk4s8S0pKCvTiQ9tS G11cgPgPxK53P9SKMWooSWTmpGg7ai6zmTLJgDac= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Roi Dayan , Maor Dickman , Saeed Mahameed Subject: [PATCH 5.10 103/252] net/mlx5e: Fix null deref accessing lag dev Date: Mon, 31 May 2021 15:12:48 +0200 Message-Id: <20210531130701.496636325@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Roi Dayan commit 83026d83186bc48bb41ee4872f339b83f31dfc55 upstream. It could be the lag dev is null so stop processing the event. In bond_enslave() the active/backup slave being set before setting the upper dev so first event is without an upper dev. After setting the upper dev with bond_master_upper_dev_link() there is a second event and in that event we have an upper dev. Fixes: 7e51891a237f ("net/mlx5e: Use netdev events to set/del egress acl forward-to-vport rule") Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c @@ -223,6 +223,8 @@ static void mlx5e_rep_changelowerstate_e rpriv = priv->ppriv; fwd_vport_num = rpriv->rep->vport; lag_dev = netdev_master_upper_dev_get(netdev); + if (!lag_dev) + return; netdev_dbg(netdev, "lag_dev(%s)'s slave vport(%d) is txable(%d)\n", lag_dev->name, fwd_vport_num, net_lag_port_dev_txable(netdev));