Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4592753iob; Sun, 8 May 2022 18:32:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaUyfw51OjzSe3K6n9alHNy2WXxjUkTkPhJRNGRLxlDvd6Sj3gWxERMJh+r+Uotn4p7xQ1 X-Received: by 2002:a65:6217:0:b0:3c6:1571:b971 with SMTP id d23-20020a656217000000b003c61571b971mr11416653pgv.124.1652059940099; Sun, 08 May 2022 18:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652059940; cv=none; d=google.com; s=arc-20160816; b=IuZIuWGZw32TG3xEsfbt/8wetHN78CQsaLKNfrdqVOBl/m/eaHKB5usbVMWIjbqlFK pykaKVtWosE/UtlWxCFQPe7+Mk/0aWdrr68Po2wKw9fJahN2TbW7so5h86hJPzUmAUgL 9SDKxjrFW5t+HATmgZ4zNGu8r/uA/KTeRU0GflyQci9VI6biDYp6qAJw5WFKsTqmquDa tbwiXBYOpIbufIXOZp+pycYvlLGoii9vswYg5m7WoBa+ElaTOfBJxTTAAqCqLvKMwgOf 6urS4hypO13lXD9LfEDt5dnCS1yo98W7dpdTTdvnS0eE0PaySKMyuUU4faLKOEdQsmcw d+2A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Dk2ut15ucpHoDDJBPZq+5XcpmKL/gkxNDg5PQ4cXwcc=; b=qGM2M15TMDT/ZtvIjxRDgyDEvqO5vojvoUcsv6sTaA6/61/izLR87jLqrccSdk5IYh V8vG2aNoDYjypnOcHPdix+Nb/H/n1Jzv3+kcSCATpwRLVsMedawRATSpE/7crQrZX2Gq gjYbIGSOn7byTuucbaV2xpJEvbm53lo2m17nM4r5WmcuIDbAPCkY7T/ZML5elcHI6FUh SUnsWX/E1p00s8F5uiLzrl6z5g3By72quJyP+OambDt7af6R+k8nZpEeWfAeZpzQ307i VqDTFHSVoX2jP4LVHgaxSM/8f4UVJ7m4cklwb6aF5JK2fyp9gNtNM/YHOyThQX44xLmy sUcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.de header.s=2017 header.b=mgxwNJ57; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id n1-20020a170902d2c100b0015871e5fcefsi11866013plc.164.2022.05.08.18.32.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 18:32:19 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@posteo.de header.s=2017 header.b=mgxwNJ57; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9A9BE1E3E3; Sun, 8 May 2022 18:31:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349588AbiEEVpP (ORCPT + 99 others); Thu, 5 May 2022 17:45:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386039AbiEEVpM (ORCPT ); Thu, 5 May 2022 17:45:12 -0400 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 729F552B13 for ; Thu, 5 May 2022 14:41:31 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 12F39240029 for ; Thu, 5 May 2022 23:41:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1651786889; bh=bPb1kqwTN0xfUWA9/0wHbJECuxh+OsfFhhPsmRIveHU=; h=From:To:Cc:Subject:Date:From; b=mgxwNJ57cOkMTtZQ8Ij0d2a9HKiG/02Ow6ajM4qlk4M4vPF8soQh0ubJanHUwZl04 jRn2LXVZHd6m7HjlbQO9/6Uk4xUCZs7ezNZyVAarqXQPsH6CFqCgLZe+yhUrCJtm6h kTw9UFFpyFyLa7PTpdm4q2kE60SSWo/xAagQ8kl+HfbHHxtx3a+alRaRGtQvpYSOh6 bnYL0RvSFz0xy8WaatlgXzPwedU1A5eTWZiEDvvSuB67wMU3Ix04Trtvw2v/BG7iu9 kW6OlyP8KnGg7Fhk6gzP5xj4nH0rL7ln/YbmqARRvaNScHdZCSC9z5Qrv/SK6a0NjJ /6Y+clGza1tDA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KvRwQ6d7Jz6tpp; Thu, 5 May 2022 23:41:26 +0200 (CEST) From: Manuel Ullmann To: Igor Russkikh Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, regressions@lists.linux.dev, davem@davemloft.net, ndanilov@marvell.com, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, Jordan Leppert , Holger =?utf-8?Q?Hoffst=C3=A4tte?= , koo5 Subject: [PATCH v2] net: atlantic: always deep reset on pm op, fixing null deref regression Date: Thu, 05 May 2022 21:41:41 +0000 Message-ID: <877d6zirmy.fsf@posteo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From 86ba48e4c5e1b34cea471b8f5a64b085763e0c57 Mon Sep 17 00:00:00 2001 From: Manuel Ullmann Date: Wed, 4 May 2022 21:30:44 +0200 The impact of this regression is the same for resume that I saw on thaw: the kernel hangs and nothing except SysRq rebooting can be done. The null deref occurs at the same position as on thaw. BUG: kernel NULL pointer dereference RIP: aq_ring_rx_fill+0xcf/0x210 [atlantic] Fixes regression in cbe6c3a8f8f4 ("net: atlantic: invert deep par in pm functions, preventing null derefs"), where I disabled deep pm resets in suspend and resume, trying to make sense of the atl_resume_common deep parameter in the first place. It turns out, that atlantic always has to deep reset on pm operations and the parameter is useless. Even though I expected that and tested resume, I screwed up by kexec-rebooting into an unpatched kernel, thus missing the breakage. This fixup obsoletes the deep parameter of atl_resume_common, but I leave the cleanup for the maintainers to post to mainline. PS: I'm very sorry for this regression. Changes in v2: Patch formatting fixes - Fix Fixes tag =E2=80=93 Simplify stable Cc tag =E2=80=93 Fix Signed-off-by tag Fixes: cbe6c3a8f8f4 ("net: atlantic: invert deep par in pm functions, preve= nting null derefs") Link: https://lore.kernel.org/regressions/9-Ehc_xXSwdXcvZqKD5aSqsqeNj5Izco4= MYEwnx5cySXVEc9-x_WC4C3kAoCqNTi-H38frroUK17iobNVnkLtW36V6VWGSQEOHXhmVMm5iQ= =3D@protonmail.com/ Reported-by: Jordan Leppert Reported-by: Holger Hoffst=C3=A4tte Cc: # 5.10+ Signed-off-by: Manuel Ullmann --- drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c b/drivers= /net/ethernet/aquantia/atlantic/aq_pci_func.c index 3a529ee8c834..831833911a52 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c @@ -449,7 +449,7 @@ static int aq_pm_freeze(struct device *dev) =20 static int aq_pm_suspend_poweroff(struct device *dev) { - return aq_suspend_common(dev, false); + return aq_suspend_common(dev, true); } =20 static int aq_pm_thaw(struct device *dev) @@ -459,7 +459,7 @@ static int aq_pm_thaw(struct device *dev) =20 static int aq_pm_resume_restore(struct device *dev) { - return atl_resume_common(dev, false); + return atl_resume_common(dev, true); } =20 static const struct dev_pm_ops aq_pm_ops =3D { base-commit: 672c0c5173427e6b3e2a9bbb7be51ceeec78093a --=20 2.35.1