Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4006605rwb; Mon, 16 Jan 2023 16:44:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXtUkyPeCwcjZL2r9NTabsI6+srOJlY2rRfOgdbrLQ/GoZgbPI8QPafkQaopR9o7gDXj/oYr X-Received: by 2002:a17:906:fb07:b0:86d:abca:3f3f with SMTP id lz7-20020a170906fb0700b0086dabca3f3fmr8954969ejb.33.1673916244217; Mon, 16 Jan 2023 16:44:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673916244; cv=none; d=google.com; s=arc-20160816; b=sp5r+YXiXOzN7L3U1YpiShucIp029ktFcdu3ncCZW8DxIN/QodwbTSH/yvL3NMo3w6 BI2vBWvpCtDOM80HL5DK9v+N2mzjnWBI35YhtWSYCtm5q6kyYqiYP0PjLXz2klhZ445x 09b4Rd5tHknuHv1YKaeusyFxhwV+CMfjzsNu6WcHfJKMQZgTigqavxuIUi1l91e60F0t GXCrCkTNXqcK4KucpJLA34gJfnxtYYuMV5BaMRDFWkJpZh9F7fFmAUy6wrHdPA9VNUnF oeEAIBGiMnbqmNh9BdtJWSQI/H0KV4a7P4Ji8OmvHBaFgSYjHH2Xeaeev5GekKYSd48r ab+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Vq93ogCrPOGg0HiQewh9SHWJXLDhF+axB/rCaxgDnc0=; b=Vnm/IQeYRZ6uMklYY9tv/Zg9sv0WQ2xlZgMz+Oei8bUs0Nt1eboLM2yO/28s/fNfgG +RgDH74EoeME85nXBubS1zYeETZkzPe+1Lh4mKVGBsGwKiyhOj746AkRC7ioC67xzTfv KrbMN25NRuXHA3muG1IE6xjzsv4ELFMa1E/aFBHgYX1a8VbQLzXK4GddwuwfojtQxCPK qvkxz9sldGM+cEOBb+ISJU+wXNR8JKW55246S6dVCtAj2BrU6t2qzLCY1VUfTcD2/MBf 4fQpf5WfYdzCC5SEuOniA8TKim2RPZnAXSU0TEWlGm9B7frHzxZiu15AnAoEEOT9OMN2 yB5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mk0bWkVI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht17-20020a170907609100b00871c59c032bsi2581795ejc.618.2023.01.16.16.43.52; Mon, 16 Jan 2023 16:44:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mk0bWkVI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233936AbjAQAeg (ORCPT + 49 others); Mon, 16 Jan 2023 19:34:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235045AbjAQAeb (ORCPT ); Mon, 16 Jan 2023 19:34:31 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5EB52A165; Mon, 16 Jan 2023 16:34:30 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id tz11so7286893ejc.0; Mon, 16 Jan 2023 16:34:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Vq93ogCrPOGg0HiQewh9SHWJXLDhF+axB/rCaxgDnc0=; b=mk0bWkVIwtDNQjJ1m8JmAs1cQvTDNp7m7zHGOU/RdKRLAFPO74DcIaMsyckIPCbPsi YRoc9uvDmg66mdgsHAmS1ibYPvSPdk0OhPo6gPg+EL9me/19mnoBDeZiJN2wU1kcXWTc jRoh9n60IHSXjtPAQXPAKWHwmV4EjrrWUvNDd0NNpC+YvnsODblPMAHMJh3upYIWe2sM s2NacqKxId08HILfa90GkAjw/LDNo461ktbkFinh/5Bn4eLcrVE0jpx5dwyC37GzPlZ7 HyboYBd99FiJMnJepqT7n0MzrLidIn/ppB2nVihafJvcM1lP1Lbz9iEh0HAT/+IoWPV6 kCPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Vq93ogCrPOGg0HiQewh9SHWJXLDhF+axB/rCaxgDnc0=; b=l/xVruc9B62yoo6IIa05wi3DwoUh66wj41zvo3W7ON7wKdtlumsTcrNYvxgiQXGMGO rDRPML3OAaMcexHzh1uEOaxztfQ+y26LTlqrwxHX+mj+r6EQ2yA3ZDTo3KPzgnSUo1vs MwwZADzjpauX25dQoW2NGUHMYEroNFSN03nx7Jh8aqX+QuKQQG0dCD+T3HR95j5dwteG 1SE9hsj/5B7mCca2IvulxQWvrqLh58xQukL0RWhJ/GC+GpV4dafSi+bI7kKSxdprg8H/ Qf9B4C9fKfU5x44cORCyp9eN/LxUUjDhtAc+2asll3c3Ovt8rzQz8+HD80BB1Q5PyCec vVwQ== X-Gm-Message-State: AFqh2kph0F1rdXDW0vqhQbKbxYWYQxgqgUaNURrFO4Ec+XoukaLTWe3l fcqcZe4WhS5u4YF9UU62jNY= X-Received: by 2002:a17:907:a609:b0:7c1:22a6:818f with SMTP id vt9-20020a170907a60900b007c122a6818fmr16709350ejc.25.1673915669328; Mon, 16 Jan 2023 16:34:29 -0800 (PST) Received: from skbuf ([188.27.185.68]) by smtp.gmail.com with ESMTPSA id j2-20020aa7de82000000b004972644b19fsm11818990edv.16.2023.01.16.16.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 16:34:28 -0800 (PST) Date: Tue, 17 Jan 2023 02:34:26 +0200 From: Vladimir Oltean To: Piergiorgio Beruto Cc: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Oleksij Rempel , mailhol.vincent@wanadoo.fr, sudheer.mogilappagari@intel.com, sbhatta@marvell.com, linux-doc@vger.kernel.org, wangjie125@huawei.com, corbet@lwn.net, lkp@intel.com, gal@nvidia.com, gustavoars@kernel.org, bagasdotme@gmail.com Subject: Re: [PATCH net-next 1/1] ethtool/plca: fix potential NULL pointer access Message-ID: <20230117003426.pzioywqybaxq4pzm@skbuf> References: <6bb97c2304d9ab499c2831855f6bf3f6ee2b8676.1673913385.git.piergiorgio.beruto@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6bb97c2304d9ab499c2831855f6bf3f6ee2b8676.1673913385.git.piergiorgio.beruto@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Tue, Jan 17, 2023 at 12:57:19AM +0100, Piergiorgio Beruto wrote: > Fix problem found by syzbot dereferencing a device pointer. > > Signed-off-by: Piergiorgio Beruto > Reported-by: syzbot+8cf35743af243e5f417e@syzkaller.appspotmail.com > Fixes: 8580e16c28f3 ("net/ethtool: add netlink interface for the PLCA RS") > --- > net/ethtool/plca.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/net/ethtool/plca.c b/net/ethtool/plca.c > index be7404dc9ef2..bc3d31f99998 100644 > --- a/net/ethtool/plca.c > +++ b/net/ethtool/plca.c > @@ -155,6 +155,8 @@ int ethnl_set_plca_cfg(struct sk_buff *skb, struct genl_info *info) > return ret; > > dev = req_info.dev; > + if(!dev) > + return -ENODEV; Shouldn't be necessary. The fact that you pass "true" to the "require_dev" argument of ethnl_parse_header_dev_get() takes care specifically of that. Looking at that syzbot report, it looks like you solved it with commit 28dbf774bc87 ("plca.c: fix obvious mistake in checking retval"). Or was that not the only issue? > > rtnl_lock(); > > -- > 2.37.4 >