From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C435C433EF for ; Mon, 4 Apr 2022 15:01:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378380AbiDDPDq (ORCPT ); Mon, 4 Apr 2022 11:03:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378352AbiDDPDm (ORCPT ); Mon, 4 Apr 2022 11:03:42 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4763F2FE48 for ; Mon, 4 Apr 2022 08:01:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649084497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zWvwmcsl5+f8+r48vPP7cYhAhBsyCC2Mt4f/vFQlCB8=; b=LtVfGg6Is5Svgt3Ux3B1U3ydAUyLWDhlin3HVsBDi5/jUyWUGQFMFHFPqND9aG18/IRGDy YLyUNmuz2tGmddE3+0urZwevwAidyuhwXDhOa38yNqMLvkPj9r4yavS4Bu16X96aftAX1S HfUWHC7C1sToJt2XOJSi7qBMrboi4uQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-298-N1elNDxvOb2xD_1ALqUWIw-1; Mon, 04 Apr 2022 11:01:32 -0400 X-MC-Unique: N1elNDxvOb2xD_1ALqUWIw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7689A811E84; Mon, 4 Apr 2022 15:01:31 +0000 (UTC) Received: from ceranb (unknown [10.40.193.122]) by smtp.corp.redhat.com (Postfix) with ESMTP id 78B3B1111C8F; Mon, 4 Apr 2022 15:01:29 +0000 (UTC) Date: Mon, 4 Apr 2022 17:01:28 +0200 From: Ivan Vecera To: Alexander Lobakin Cc: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Jesse Brandeburg , Tony Nguyen , Madhu Chittim , Jeff Kirsher , Brett Creeley , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] ice: arfs: fix use-after-free when freeing @rx_cpu_rmap Message-ID: <20220404170128.1f8d198a@ceranb> In-Reply-To: <20220404132832.1936529-1-alexandr.lobakin@intel.com> References: <20220404132832.1936529-1-alexandr.lobakin@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, 4 Apr 2022 15:28:32 +0200 Alexander Lobakin wrote: > The CI testing bots triggered the following splat: > > ... > This is due to that free_irq_cpu_rmap() is always being called > *after* (devm_)free_irq() and thus it tries to work with IRQ descs > already freed. For example, on device reset the driver frees the > rmap right before allocating a new one (the splat above). > Make rmap creation and freeing function symmetrical with > {request,free}_irq() calls i.e. do that on ifup/ifdown instead > of device probe/remove/resume. These operations can be performed > independently from the actual device aRFS configuration. > Also, make sure ice_vsi_free_irq() clears IRQ affinity notifiers > only when aRFS is disabled -- otherwise, CPU rmap sets and clears > its own and they must not be touched manually. > > Fixes: 28bf26724fdb0 ("ice: Implement aRFS") > Co-developed-by: Ivan Vecera > Signed-off-by: Ivan Vecera > Signed-off-by: Alexander Lobakin > --- > Netdev folks, some more urgent stuff, would like to have this in > -net directly. > > Ivan, I probably should've waited for your response regarding > signatures, hope you'll approve this one :p Feel free to review > and/or test. That's ok, Alex. You did it the way I prefer :-P. Will test. Ivan