Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3968958pxb; Mon, 1 Feb 2021 09:07:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3F3iptZln9vmdGeceun4VWfIuJcDSYg//V41pJ30yUTH0PrELoQdIU3EyJnlI9Fux2JkS X-Received: by 2002:a17:906:9619:: with SMTP id s25mr18911664ejx.345.1612199223499; Mon, 01 Feb 2021 09:07:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612199223; cv=none; d=google.com; s=arc-20160816; b=X5lZ3MPjc94bDLo5kl1tdxEiK4lkNlnR7szDbI31Tcsi5UfkcGL5Ls7dVlGVLv5elr RZYsenD9HKIoYZFQvTNIXl9YHvzekkoZS1ymsXZa/TDnsbGo3MOU6QWwm/hNo66mQHWu SQ8AMS2bX0RsPFcYcRLYFAUNAPiPAqY3hHioNCrr5LjSOkmyiZ68PNMxIa58mUY8XBZ5 angIWPZdiligx6eft37hbkyAHdO01XyQ2Wdjh7wiLE84hniMhU5cBgrWbDsVgwxjrB2r Olf47NV9y5Eh5U1LQk5RriXv4W8BjXxjcjVq7JrguHPt5NVSBEM0hCl9gpPuMHETelTB 1ilw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-transfer-encoding :mime-version:subject:cc:to:references:in-reply-to:from:organization :dkim-signature; bh=rH9wytnzyB+U91tV+Pg1sRMVmzeBVEAmUAO/MwEXhFQ=; b=GWBwLe58xM1uiX99myb96c3NM7fW4hUFCOIXQ8nAtD721PkKxinpArj3szF84I21DD gL2grsw9qk1s6dOhjWm5quNAabjq1YTolReZLb5pAJlZ54ZpbN88f3in6QhkRWYoJh9I TpAiFxf+48w09vuO+zSd6lsyJ11b4XzaBnORXT8qLtnelxGETn3nAsRuNvesHDeli6ON vtfeOMLT/Rdtk292QGycW7FRROFCYE911fB+TnvcjvJLjPqdbGKQgD5q4eEpfG3ah0yc EWTglmtXBvDOB5rr2ykz0nXXYDHSnMDL5BYfr0fTZtOMQPxJjLfXmEDfEKV/j3xxXAb7 h5tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CHyT4Kcu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j5si596765ejv.429.2021.02.01.09.06.34; Mon, 01 Feb 2021 09:07:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CHyT4Kcu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231217AbhBARF6 (ORCPT + 99 others); Mon, 1 Feb 2021 12:05:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58613 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230298AbhBARF5 (ORCPT ); Mon, 1 Feb 2021 12:05:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612199071; 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=rH9wytnzyB+U91tV+Pg1sRMVmzeBVEAmUAO/MwEXhFQ=; b=CHyT4KcuzqbrTEwR4o10jD3OUznvFUpBH7o9O+CgxMxScDo9xXkf6bdrB9cQxZBohIMKmg VGOg+qUGCfsAXw4Gnkst2TkrRGMzJAM744sdcMjkwUwDXBxOG8Tv+pjmXbK4SPZ7Ezh/oj w4qnCGv0BDiWSDMDKGhTAZT3/Vo5W3Q= 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-277-g-a_wvW3N6WhlKwRHXdFGg-1; Mon, 01 Feb 2021 12:04:27 -0500 X-MC-Unique: g-a_wvW3N6WhlKwRHXdFGg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2CCAF10054FF; Mon, 1 Feb 2021 17:04:25 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-115-23.rdu2.redhat.com [10.10.115.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E0855C1A1; Mon, 1 Feb 2021 17:04:23 +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: <6b362abd95b116e26c65809a3a1525c7951ed0bd.camel@pengutronix.de> References: <6b362abd95b116e26c65809a3a1525c7951ed0bd.camel@pengutronix.de> <8b9477e150d7c939dc0def3ebb4443efcc83cd85.camel@pengutronix.de> <74830d4f-5a76-8ba8-aad0-0d79f7c01af9@pengutronix.de> <6dc99fd9ffbc5f405c5f64d0802d1399fc6428e4.camel@kernel.org> <4153718.1612179361@warthog.procyon.org.uk> To: Jan =?us-ascii?Q?=3D=3FISO-8859-1=3FQ=3FL=3DFCbbe=3F=3D?= Cc: dhowells@redhat.com, Mimi Zohar , Jarkko Sakkinen , Ahmad Fatoum , James Bottomley , keyrings@vger.kernel.org, Sumit Garg , linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, kernel@pengutronix.de Subject: Re: Migration to trusted keys: sealing user-provided key? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 01 Feb 2021 17:04:22 +0000 Message-ID: <35960.1612199062@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jan L=C3=BCbbe wrote: > > > ... But at this point, you can still do 'keyctl read' on that key, ex= posing > > > the key material to user space. > >=20 > > I wonder if it would help to provide a keyctl function to mark a key as= being > > permanently unreadable - so that it overrides the READ permission bit. > >=20 > > Alternatively, you can disable READ and SETATTR permission - but that t= hen > > prevents you from removing other perms if you want to :-/ >=20 > That would mean using user type keys, right? Then we'd still have the core > problem how a master key can be protected against simply reading it from > flash/disk, as it would be unencrypted in this scenario. It would apply to any type of key or keyring on which it was set. It would cause keyctl_read() on a flagged key to return EPERM. David