Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4000468rwb; Mon, 16 Jan 2023 16:36:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXsxY3+/xbSArdfVMxWp7KhYeQxic0zE7moZqz3n6BWZkLU4maxJK+T2UfCT4+MRNuASGBA9 X-Received: by 2002:a05:6402:1f13:b0:49b:cf25:152d with SMTP id b19-20020a0564021f1300b0049bcf25152dmr410772edb.24.1673915814922; Mon, 16 Jan 2023 16:36:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673915814; cv=none; d=google.com; s=arc-20160816; b=bIZUesM3aihuduyqmrLOq2GSyu0myFcH3iORgSlLLEM4kxJl99e2q0gDdBzqB1p3Wy NFcfmTiLTSbWTXz5uFPvu5xdHxl3HGgs+S24mrUgiNS0xfz0zu2w+EcgnNGhJDcxmvJT ztfM2x45n1txJ5ZVlAt6R4AhiuZuHodmP9/cYsgSLlFvdFi1QbAn8fCU+1DjR88TJSm0 jGSWOcVLYoiyY9kfKbk9OHt2cwoCaktWSq7X/gweD43Dn8BNppkt0xuM4nVh5dUPB/C5 Ygqogi1ZrOSO27/G7ppuEUp2Xh/+jUxGehHqMXUfWMflMdsingWh3E+c9+LpZijOSPPO JQTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=mn+TZUXea4ISuZCwWMz5SSZVUJSxpv6JVqPqn/L6G5M=; b=gJNZDEdB12++U8Mg53SbR+vHXLejJUuC+qbaOyZ5HhnPWkcTNHuUogfnBVRvfxEe3v avNwc+gUcCjcphoF6sOAkUAyph/giiqUDPd+d0Dx0fBoFZ1qmMa7ny+JDH8t1Ti5sShu EvdpYIOlm2ptQ26FISn/2rtQJV780sHrD3LV6+pyEOUjOeFXVaL2g1E3sE32nychXUQm IGSlhsmP0C+zgmziOeSQGhw2DLWcnCSCBh9B6f6BBiuSDdI7DPq3E/vjIQDQIZ2ZFrGS lZz/nOueHccbbg+MKeLgoxsXMtAcGdQjxE/hBjbmaKXAvRi5tkLY0CP0PC5td/butoUd bIjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=U97bLxJT; 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 dk10-20020a0564021d8a00b0049e0440d49esi1491189edb.29.2023.01.16.16.36.42; Mon, 16 Jan 2023 16:36:54 -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=U97bLxJT; 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 S235409AbjAPX72 (ORCPT + 49 others); Mon, 16 Jan 2023 18:59:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235729AbjAPX65 (ORCPT ); Mon, 16 Jan 2023 18:58:57 -0500 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C05732C671; Mon, 16 Jan 2023 15:57:19 -0800 (PST) Received: by mail-ej1-x630.google.com with SMTP id az20so52440504ejc.1; Mon, 16 Jan 2023 15:57:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=mn+TZUXea4ISuZCwWMz5SSZVUJSxpv6JVqPqn/L6G5M=; b=U97bLxJThXvIz9tGZ+qMWg8UXddRRY1eBK0/0IWmL0sXDyDEjS5p6dr0kCSg/gKySQ x4JZnqgHpZStIp/H8TOg5Mae2JHIp5gCyTh0J0jIZOGcm2inJOL7Qc/+VH9WG95l5lGH L0eKkporSCTYBabLopH2cgnG13pmjhCCOwerlF53q1FwrpDwrw63KWv3qi+6xZcLYSle 10COldlck6Kean6mHn6Nrxo2nsQ3o0aoqW+hzxUc+G91Jf+3aOG604ncC5OVA59glMhB esx7b5WSymKRdgIzhqwbR+d9xf1up7kvIELcN0RKq+mPhAH8aVVkXkrhBnsMwZRJFbds RqkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mn+TZUXea4ISuZCwWMz5SSZVUJSxpv6JVqPqn/L6G5M=; b=pNLLai2ngzUOXPws/GzbdHWVWWcswhFtEDXs8MCtKGRRExzOpYaIEwcJwbEPQ95Lf+ gPpyUKpPujR4LmrWrLLFuImqDNB/yQ1OzWyzBgTzfaN5a7OGYL62Fhso9lERjZA8l2rS 4hIT2d6EgfDxeRsQMfJgPwxdvp1WdvRZeN8b7RTHwGkyYwisM/+pzEEUYLO+GfSwuEgV /z5Tmofm+Jxe0tRHLJtTCPoaoPCUsypyqXdYdV5nI8ZLldq5DLh5KG+Y5uHJZzLRbafw Risvk1f71KYSoCLiofHSzjUApL5p/ZVyTKeireN9hoD3EEW+uvTAj6nSbHcMKheWVqU4 aACQ== X-Gm-Message-State: AFqh2kpSbJSM5HFp5IaRKUI5J4kF2IHK5ZNVjdWzxsVfpcfhZTKcpETr dUP/SVw5XE2EkPtxS0V2qoE= X-Received: by 2002:a17:906:2403:b0:84d:3e5b:7c02 with SMTP id z3-20020a170906240300b0084d3e5b7c02mr13239483eja.22.1673913438279; Mon, 16 Jan 2023 15:57:18 -0800 (PST) Received: from gvm01 (net-5-89-66-224.cust.vodafonedsl.it. [5.89.66.224]) by smtp.gmail.com with ESMTPSA id lb21-20020a170907785500b0084c4657120fsm12455873ejc.55.2023.01.16.15.57.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 15:57:17 -0800 (PST) Date: Tue, 17 Jan 2023 00:57:19 +0100 From: Piergiorgio Beruto To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: 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: [PATCH net-next 1/1] ethtool/plca: fix potential NULL pointer access Message-ID: <6bb97c2304d9ab499c2831855f6bf3f6ee2b8676.1673913385.git.piergiorgio.beruto@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 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; rtnl_lock(); -- 2.37.4