Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2227778ybb; Sun, 5 Apr 2020 02:07:50 -0700 (PDT) X-Google-Smtp-Source: APiQypJTwykXFxF+X4YfKi0xjeHXNpCRQFxO8IgcCoAjlwS4obFb2VbY48bS0/H4bWwKwu/LkLk5 X-Received: by 2002:aca:7213:: with SMTP id p19mr9219039oic.159.1586077670803; Sun, 05 Apr 2020 02:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586077670; cv=none; d=google.com; s=arc-20160816; b=sgsSBNn2VKwXIvHS7E/3GXjCQXaC2h4tRbLPLB5M45o9hNL62C3QQtHK77DSQNgDJ9 YxB5/9iEya3bSDso8S2eia0ZrGNTuX8Cl/P7VhfzOry1qL+D+c6KlvdLuNKtp6KyGkKQ Z7+nfhmmJII31/+Gq5HtUW8ttuw6aR+9Q2naUnnA7yngQTd5OwLmoA8ZVUrCHb2VyBDR S5DuZprF4TqQOtkwSg0S3mehUwIeD5dbFGeskaVZcrFfp3XAHHkWhqjs8L729ukfjcE5 imIGzqM+vnzTjIMX1JZABR11Puz3+3qI2C9mSrHoATTa3sfQxndfM00A6cl+MMRgq5DB F+5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-id:mime-version :subject:cc:to:references:in-reply-to:from:organization :dkim-signature; bh=GRL0Uyd6AdEG1TYouQC+LIcNPbvfldHHxdImooUbNU8=; b=Q5ngrAgcWP49XyBeXmH1W8hyikxtZZ8VTilSFBDz1DCKW5dBoNsSWGabYXvLNWbCzC TTpDiOXj5Ro2yvG8ZdK5ehjiMsoX8Q8Hty1xhe4/tqPiUvxarqlbXtllOTtFSNESbn8e h2n+ilcf7YFjhcXc7DU+WYWbJD2AAfzzEk5+lq6O8G4T++z/g86JCQdowoB5mQH3uB11 HIv5/A1EgFkGzx2y/Gv9z8XJDMKLr4vVKL/yi9neJB2u9G2DHTxYIC1Oobzb4WXYBnSW fEohaJBhT6Rvf6AjXv096uBL6CrIaLte1vFkiLNT4G0bq243RAnx524GamqzUA4Uru+E UHrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Cq+S/cRo"; 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 l13si6899597otb.102.2020.04.05.02.07.37; Sun, 05 Apr 2020 02:07:50 -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="Cq+S/cRo"; 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 S1726495AbgDEJED (ORCPT + 99 others); Sun, 5 Apr 2020 05:04:03 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:28850 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726308AbgDEJEC (ORCPT ); Sun, 5 Apr 2020 05:04:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586077442; 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: in-reply-to:in-reply-to:references:references; bh=GRL0Uyd6AdEG1TYouQC+LIcNPbvfldHHxdImooUbNU8=; b=Cq+S/cRoBgGo6ZLKE/LqaadPNebO1ww7L9FQMEyo9RneYPy9hk26Ps0GQXx9SWzAIzLudP hI5tUxVYgFZjlhHKuidBNuPo5b2+vrsxsUJVN5136T/7bOPQwZ6+nF4ErSrK3oKirOq8/q BV6QEzbuRI3BPXmkSQ1UFW7pYVVUT90= 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-455-mpbKV-gPP1i9TVJFj_N8oA-1; Sun, 05 Apr 2020 05:03:57 -0400 X-MC-Unique: mpbKV-gPP1i9TVJFj_N8oA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9BEE2477; Sun, 5 Apr 2020 09:03:55 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-114-243.ams2.redhat.com [10.36.114.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD19B118F39; Sun, 5 Apr 2020 09:03:51 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <78ff6e5d-9643-8798-09cb-65b1415140be@redhat.com> References: <78ff6e5d-9643-8798-09cb-65b1415140be@redhat.com> <1437197.1585570598@warthog.procyon.org.uk> To: Waiman Long , Linus Torvalds Cc: dhowells@redhat.com, Johannes Weiner , Herbert Xu , Jarkko Sakkinen , keyrings@vger.kernel.org, LSM List , Linux Kernel Mailing List Subject: Re: [GIT PULL] keys: Fix key->sem vs mmap_sem issue when reading key MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3567368.1586077430.1@warthog.procyon.org.uk> Date: Sun, 05 Apr 2020 10:03:50 +0100 Message-ID: <3567369.1586077430@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Waiman Long wrote: > > And yes, kzfree() isn't a good name either, and had that same > > memset(), but at least it doesn't do the dual-underscore mistake. > > > > Including some kzfree()/crypto people explicitly - I hope we can get > > away from this incorrect and actively wrong pattern of thinking that > > "sensitive data should be memset(), and then we should add a random > > 'z' in the name somewhere to 'document' that". > > > > Linus > > > Thanks for the suggestion, I will post a patch to rename the function to > kvzfree_explicit() and use memzero_explicit() for clearing memory. Should this be moved into core code, rather than being squirrelled away in security/keys/? David