Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2878890ybb; Sun, 5 Apr 2020 19:39:28 -0700 (PDT) X-Google-Smtp-Source: APiQypKQvTXKsh+Al1+fTnTDsuWh+bskdhzqL0X7oTtmkLmFGKLDiEhZJiBkDJw8pbgHsr1OUhZC X-Received: by 2002:aca:efd4:: with SMTP id n203mr11595096oih.159.1586140768171; Sun, 05 Apr 2020 19:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586140768; cv=none; d=google.com; s=arc-20160816; b=YVI3PnI4ifdzrM3fa66348zUHp8PoD0f4eXQYWGa1UNivhfh8ygaQB7DP0fnnMn7ow UOpd8i4R6bxLwZvKKMLzqWzrranAxCgcx0N8Yw2QN8BokR2dwEUXf46BJSVf9WOFKPkT 8XZkXmUOd+N6E2w99EPq/18dbJ3cvvbImC32qKOcJcVoddvfE1Gc8RwsEm7JBZI+Pn8y 7GqAXEzprM6SruDKnw2l2uAOqlhTHRImom/hoiLEFhh61ACFMtf5ojU1e4SkKT2bAaU/ 64XB4nnoADNIaANrt5H5gZQ2M0ro6EvON8dVTyMWrwRCZJRdPxVocB6VS4JFmf0LiAe7 gVnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=wwTsvDmSdQ5Meft4xmbxc1SwPG3Ag9b3jECvcp2g35g=; b=wukonv4yd6cTqvzqVpUCuMRAQHIcqZL877bcr+l/Fn9nRzMpApUb9ts7yg707mvFIv KyjuXnskhbjQWqNq5457ckZeGNlN0C/8DDt2A5mpGPohhPc0WwhEZIrUxIq7Ows3lDsB jlPV2G/ixKDPpqtSDk5z0ir0q3ecN//DJrpklHeLFOnKsV7fo07DDVcam3uERA4lStk9 lp5i/18XWXqT3gBdrCOYJA3xlqzp/42TGtankOmy0S6kMxkeQjlqEgsslMwcML63ZgEC 4KUa1q3SZfWOx13QUTlR3g1DxeU7J2ttwQ1MNSKnv29rs4oQnwruwOzch9kd0P7IC/XV Ls2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i3oCFYfK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e18si5806576oth.79.2020.04.05.19.39.16; Sun, 05 Apr 2020 19:39:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i3oCFYfK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726528AbgDFCi5 (ORCPT + 99 others); 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