Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3513066pxb; Mon, 4 Apr 2022 19:25:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSPXiGVUz758a8v87435YHGfjfPrW+PYo4WrrlsiACVlVbclYvgQA0DHhdRxHxEbOCEThL X-Received: by 2002:a63:368f:0:b0:398:1bfe:bdab with SMTP id d137-20020a63368f000000b003981bfebdabmr968145pga.29.1649125532450; Mon, 04 Apr 2022 19:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649125532; cv=none; d=google.com; s=arc-20160816; b=0DvONfCB6SSIqqmXmnZiyiNbzN8hBHjVj/YtoCGabluWmF2ag2Y+v3Oj2lE30QEkK8 bE9AcEzZ04qfVuZuGbLydma3kOW1Jj+Acv3x5quiZE3F+WTDA8rORUv8G2xE+JgaZ7Qy 8N8m3ZBzSX1eaI9MGz2G+CKBBlApfJdVOtmFZMjaJ4Zkov3oBuN5x9rL56VFJF/fp8MQ ETABMo9a3Wu3Po9jmpjsgyCcxEKhA+8TMBSTuT4EwDmQV9rqF04lIUvWJB9l39ckdoeF U8dzkhxFxbw889ClOVXvG8Qjs/pnclq8dF2MbE3gNnGfQA/RTO6F5Y2cMtGWujxad/ME yjNA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=zWvwmcsl5+f8+r48vPP7cYhAhBsyCC2Mt4f/vFQlCB8=; b=DmDwak3tA35Yx6U86ny7oEPfNhv4y8tB9YdKzHT81JM2zr+j2inpj1Q9qBTaRjO9Yd DMnykq700UTBAP/OL7qKlUE9f0XfL0Ogk1BypIsoIf0QPgpzifXgCR0rqPZBl4qc5/9B PPRuSpGq8mBgPPzhIZCV+35aVKu3rNqItPdUpIatmPG6gUfVA5zTfuoXBUPWiScru6a/ 8thFKX1vom2nFHE33bW/vrsPvEiXHkr+QJ6UMuVWgf24e5FkLeYdxcV6fLehzaeMtAKB ZEmOugbvb5kVdJg6/JWOfURRWxa8Xb/gQAksHH969GvvZrHgTjhT66YVIAbG7I/JJDuf VdGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="c1tU7ju/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o7-20020a637307000000b0038226cca535si11405641pgc.793.2022.04.04.19.25.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 19:25:32 -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=@redhat.com header.s=mimecast20190719 header.b="c1tU7ju/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 373192D706D; Mon, 4 Apr 2022 17:47:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378318AbiDDPDq (ORCPT + 99 others); Mon, 4 Apr 2022 11:03:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378374AbiDDPDm (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 4F06F2FE53 for ; Mon, 4 Apr 2022 08:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649084498; 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=c1tU7ju/7KYqqh0bfxAUUs6cMZBG3hS3y5qnNsIhB0uazlbIKnHA/33sxAKa+gY2yFeJik o2vAuMRVQfFoQureqEex3i6nYqtehCd4lSiL1y6wqQAcNCYqMDBQzO+3K1qlM4x/HR+BqA cwmiNTMWkzbIkoLVexu8L8xt7i3Mt7Y= 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 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 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