Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp942719pxb; Fri, 22 Apr 2022 14:59:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMqdETDKjQBKi4YQVlthV0n1vwLwxBCOmpWM96BpE+0y64bnPIW43R1uInhBP9XjewDxWw X-Received: by 2002:a63:2a45:0:b0:3a9:f71e:a63d with SMTP id q66-20020a632a45000000b003a9f71ea63dmr5579805pgq.69.1650664748994; Fri, 22 Apr 2022 14:59:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650664748; cv=none; d=google.com; s=arc-20160816; b=XhCnhbGeA91v6akOafJP64Qd3UAiH1utgRqBzDVcWvZI8zoF/sUsxbzJUkTWTSZsuF aKhQf+QS7tVDyFx0tkmpRXuPRqKkk0zfqA5Pwru9lgsvrS2XA2kn5GUfozZY74r/K2vb FD6kL8nxJpzPXWlQ4NaHWHjPjUGQM9iOWA3jzOfyz+S73E8792fLng9gVDTl/dTy88i6 BacPb9KkqCe04GQkejRRRNDhqx4YB5dLsxouCrEcKqG9VC/n06ujG1Sbwjo+Ee3BXMPJ AvMkgHm/3FXN/lD03cu7SwtS2thEBcm8QloRqH0DUi5iNESiOkPZog0PGoGU8tTIGggQ gtYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=J8Pn8rUD1/67P2tIwIl9jn0IKf5NiUvBQMzixzEqf/Q=; b=Tlo1HZjUcSW7z/fpkYJTeM+n4kxVgDTAQcFhCpuiqv1Ac4knB/JwpLEhNbh64/UN69 num+vykmYAfOq043VZu5MX53tvZ2uen98ku9okpGrShhOiwahQgotLnErnkiXUQagU26 jvVk7oHSvIVx9rM813Nk8K5azFzDvelAOceUbvOuT73JupxiW9JNzvAc0/C0CcHRhM4Z bzvtGRHTiZfangf48G84Ospde4uKFnAvMtQkeJWN+F7I4kQzJRC3A6GZsuEq1CKQ6V7K v2vlguL0U5z52yhkk6fqUnwVjhxHgDjq0kRlwXxGfevsltqGbiQo8aYNP9w2M4IcDQLT jNyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@blackwall-org.20210112.gappssmtp.com header.s=20210112 header.b=B+CHHscw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s23-20020a632157000000b0039e5cf278absi9050528pgm.312.2022.04.22.14.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 14:59:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@blackwall-org.20210112.gappssmtp.com header.s=20210112 header.b=B+CHHscw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F1D3736C92E; Fri, 22 Apr 2022 13:07:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388326AbiDUKVn (ORCPT + 99 others); Thu, 21 Apr 2022 06:21:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1388294AbiDUKV0 (ORCPT ); Thu, 21 Apr 2022 06:21:26 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C59202F39E for ; Thu, 21 Apr 2022 03:17:55 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id p18so712191edr.7 for ; Thu, 21 Apr 2022 03:17:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=J8Pn8rUD1/67P2tIwIl9jn0IKf5NiUvBQMzixzEqf/Q=; b=B+CHHscwnn2+GacbCaiG+xNaVwl86dTG9X33TRd5Haj/UzFu/OV15iRoZllAENs/fn 5XstadFRJB3u1VfDeP+s3zylVwkFvGzVU3svaIoI/BMK831NIwb+J4/jvC2EnJgtYjuE u3RJnmV6ZgpYlM3CDwblSTZnb31nQSo+Zc4t1lb7/h+mWIHZaaY7ICn8yJRS2PuiGcG4 tBjaxKYkOyhllGC+0Do+fYZuG0jXcZxdQQUuRl6hQvVKeNdY0rVejVCNvpW1PFpyrvuX CNylqIrGqgLLsfAIdw4NI898sqFykbiuymAcEhsfEYtnf1AgsTVfSyQysnsa7tZhz4Bi 4T3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=J8Pn8rUD1/67P2tIwIl9jn0IKf5NiUvBQMzixzEqf/Q=; b=T2mBv+jRpPYjLFVM5ObNunwU0wY5Myge92C97+m8CauEMvmcwpEmo1IF+eJ7Q9XPHq xgFzpfylc6XIDTEK2IR7Tpjn5TRN64LMQw9BhebUlU/z2C8yVOIkQWg7p+MXwpwcTwaY mTTvPcUThdKxSmXU5bJSjRmVYmtPfgVsEx7Hx8U5pKO84KA4nsh/FNvFtO3XH3XBeR14 l6VcUJCV2TePUOJjuPYPr9ARhoNLae48vijIQi3QH5lh6GyISqhVlgygPjbepBNNqg9v 56tv2DlrruWhtwLBKcsKoUjIT+sUe5CNR+1fNPFzg5boYteNJYN3BsdQMGLY3/nGO4bZ jd9Q== X-Gm-Message-State: AOAM531VR8lOXxQFO0lXEDgGyIUHeVN0hSZkiySs0/MoWqJl0LhFQ0zh soZLg1GW620Xflskk2cwnOUO+A== X-Received: by 2002:a05:6402:26d1:b0:423:fc04:8e78 with SMTP id x17-20020a05640226d100b00423fc048e78mr14943798edd.133.1650536274027; Thu, 21 Apr 2022 03:17:54 -0700 (PDT) Received: from [192.168.0.111] (87-243-81-1.ip.btc-net.bg. [87.243.81.1]) by smtp.gmail.com with ESMTPSA id s1-20020a056402036100b004240a3fc6b4sm2805757edw.82.2022.04.21.03.17.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Apr 2022 03:17:53 -0700 (PDT) Message-ID: Date: Thu, 21 Apr 2022 13:17:51 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH net-next] net: bridge: switchdev: check br_vlan_group() return value Content-Language: en-US To: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= , Roopa Prabhu , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Tobias Waldekranz Cc: bridge@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220421101247.121896-1-clement.leger@bootlin.com> From: Nikolay Aleksandrov In-Reply-To: <20220421101247.121896-1-clement.leger@bootlin.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/04/2022 13:12, Clément Léger wrote: > br_vlan_group() can return NULL and thus return value must be checked > to avoid dereferencing a NULL pointer. > > Fixes: 6284c723d9b9 ("net: bridge: mst: Notify switchdev drivers of VLAN MSTI migrations") > Signed-off-by: Clément Léger > --- > net/bridge/br_switchdev.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c > index 81400e0b26ac..8f3d76c751dd 100644 > --- a/net/bridge/br_switchdev.c > +++ b/net/bridge/br_switchdev.c > @@ -354,6 +354,8 @@ static int br_switchdev_vlan_attr_replay(struct net_device *br_dev, > attr.orig_dev = br_dev; > > vg = br_vlan_group(br); > + if (!vg) > + return 0; > > list_for_each_entry(v, &vg->vlan_list, vlist) { > if (v->msti) { Good catch. Acked-by: Nikolay Aleksandrov