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 X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABE9FC2BA17 for ; Mon, 6 Apr 2020 02:38:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 84DC92068E for ; Mon, 6 Apr 2020 02:38:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="i3oCFYfK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726535AbgDFCi5 (ORCPT ); Sun, 5 Apr 2020 22:38:57 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:36762 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726475AbgDFCi5 (ORCPT ); Sun, 5 Apr 2020 22:38:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586140736; 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=wwTsvDmSdQ5Meft4xmbxc1SwPG3Ag9b3jECvcp2g35g=; b=i3oCFYfKSRWwsdsCTThXj2MDDuyX/DOjHQ8WzGHCrUxuSkXNN8a2MGtG2901+5ZOdGNfd8 yVH3MNruhfJANZPTMEpLaczImcA+XyNFMZfV31wmH9q4VjhG5CiQkG6hckEILI8mje8XQ3 1ocqKWoNVGmtIBAVNml0+VyR/RRXANE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-40-VIhQvFMwMsy-aY0rC9p_Zg-1; Sun, 05 Apr 2020 22:38:52 -0400 X-MC-Unique: VIhQvFMwMsy-aY0rC9p_Zg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BF3B885EE7A; Mon, 6 Apr 2020 02:38:43 +0000 (UTC) Received: from llong.remote.csb (ovpn-112-57.rdu2.redhat.com [10.10.112.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4AC99A260; Mon, 6 Apr 2020 02:38:42 +0000 (UTC) Subject: Re: [GIT PULL] keys: Fix key->sem vs mmap_sem issue when reading key To: Linus Torvalds , David Howells Cc: Johannes Weiner , Herbert Xu , Jarkko Sakkinen , keyrings@vger.kernel.org, LSM List , Linux Kernel Mailing List References: <1437197.1585570598@warthog.procyon.org.uk> <78ff6e5d-9643-8798-09cb-65b1415140be@redhat.com> <3567369.1586077430@warthog.procyon.org.uk> From: Waiman Long Organization: Red Hat Message-ID: <7c868f6a-593d-b9aa-9c0b-a2cd9b763f83@redhat.com> Date: Sun, 5 Apr 2020 22:38:42 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/5/20 1:31 PM, Linus Torvalds wrote: > On Sun, Apr 5, 2020 at 2:04 AM David Howells wrote: >> Should this be moved into core code, rather than being squirrelled away in >> security/keys/? > Yes. I do think that that __kvzfree() function makes sense in general > (the same way that kzfree does). > > I just happen to despise the name, and think that the implementation > isn't great. > > It also probably makes no sense to make it an inline function. It's > not like that function is done for performance reasons, and it might > only get worse if we then end up making it cause barriers or something > for CPU data leakage issues or whatever. > > Linus > I have just posted a patch that modify the API as suggested. Please let me know if further change is needed. Cheers, Longman