Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1490885imi; Sat, 23 Jul 2022 07:17:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sRppIPS4jazVRzcZJ1f8574KkbjGqUpZ1dxnknwoXIS52QtmuZIYznaTMG/Ht7tW+3nFUH X-Received: by 2002:a17:902:8693:b0:16c:db86:1c86 with SMTP id g19-20020a170902869300b0016cdb861c86mr4337698plo.9.1658585825756; Sat, 23 Jul 2022 07:17:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658585825; cv=none; d=google.com; s=arc-20160816; b=Lh54P3Lnq5x4EpkXJnT7UDLLCNU7X5zMSOd11a1wx9cNOptfdCmycxXBOY+WgVCvrp 5Sb8gceWCy7qW1Y4pFncwKDVCTTarQnYOE9Gly5fqBWCbVDrciBKUSri0S+dxIz6e9TM O6JAeOZ0ghZk6Hz9KBFBAstrwfz37Xb+Feex0u0L2e/CFNtlVN1Fzjrf593z6DvEsY1o /B5VKIqnR2uWYv41idbjWE1iRTgF15TAKSYc0jby3qFIGRT7vJ+wvISocCG1u3tSqBLY lO7i/iFeO6mFsNdjHK7wESImqOljxtbVtGxo5FivCfp4T7rUxvH9Ld8rMrJdSaBn8vCk shPg== 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=B48OW5T5bz0AkRy4XKcNzxxJOMOLvMlteLb4SodR7N0=; b=sTV5TO5AmRcXINYE9jDLszE1V9vOIAgxsgi3yHBiIgaZ96Gb/8rst2KEF2OkWvQQ2k 6uTnsHdw/G7k9u1sQGr4+UtFKLc/+7dPtrCox7SnwLBBIMRPnlRzHq8rx2UOQd+90kC9 rDMjE1nfdG12Ksy4K00qqgpqxqgk8GpZS+W0Oh/45mwuTuceeVhqk7TNhJeSrkN2+oeI LcGngkqkWyQ3MdUXyOVWM5GOupgvSV8R36bWbGtKOnprzP0fwQ6HZK8LPN13cXilB2hr OGgB1ceh32iUJrLFnFjJdEucfU7gooRbbddbs4NJ9/XGIzAM1bBgGi3J7NE/9MUlMLmJ RHAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d3v6kDUy; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020a170902d58d00b0016d4c2c3b95si2855634plh.90.2022.07.23.07.16.50; Sat, 23 Jul 2022 07:17:05 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=d3v6kDUy; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233293AbiGWOFX (ORCPT + 99 others); Sat, 23 Jul 2022 10:05:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237328AbiGWOFV (ORCPT ); Sat, 23 Jul 2022 10:05:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE8EB1056E; Sat, 23 Jul 2022 07:05:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8951B614B5; Sat, 23 Jul 2022 14:05:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6AB10C341C0; Sat, 23 Jul 2022 14:05:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658585119; bh=2g5s13C+IFBQd9xKYRDH27YjqkKmXT8LzRfCOLtta2w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d3v6kDUyyoOc2RLrQEdcJh8KRxU32gs+RlKKkJNJwfOPCw15HDLg7JGAjZEBwurps b8J9KVbEGG17e9nIMXn8ePxKwEV4ltEUozC2FWRSXaaij1DESR8mv0o9sWx6ab0Gnu zM+H7htPngHmRGV50lkndYupXy/GGXV4nilXaVnI= Date: Sat, 23 Jul 2022 16:05:16 +0200 From: Greg KH To: Siddh Raman Pant Cc: David Howells , Jarkko Sakkinen , James Morris , "Serge E. Hallyn" , linux-security-modules , keyrings , linux-kernel-mentees , linux-kernel Subject: Re: [PATCH] keys/keyctl: Use kfree_rcu instead of kfree Message-ID: References: <20220723135035.199188-1-code@siddh.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220723135035.199188-1-code@siddh.me> X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Sat, Jul 23, 2022 at 07:20:35PM +0530, Siddh Raman Pant via Linux-kernel-mentees wrote: > In keyctl_watch_key, use kfree_rcu() for freeing watch and wlist > as they support RCU and have an rcu_head in the struct definition. That does not explain why this change is needed. What problem does this solve? Why use RCU if you don't have to? What functionality did you just change in this commit and why? And how was this tested? thanks, greg k-h