Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9928964ybi; Wed, 10 Jul 2019 20:08:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqLVAjRDJOC1PXuPiPrs8I8OFKA3vkw9tkklL9hoCuNH5vmBlLliMwAvqZI0ynvFdCxpfR X-Received: by 2002:a17:902:b688:: with SMTP id c8mr1859047pls.243.1562814483139; Wed, 10 Jul 2019 20:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562814483; cv=none; d=google.com; s=arc-20160816; b=FgH4rt8+HdHN2W7Mll/ulUNpToXzM1OBBCAEtQE0+oPPDjImqnCmUZTNA6iNDRPcCo w+OWkmaEf8sO87w/EAWyU276oAVNBD3fL9JjT+yQLJmRK2eT/jQse1JuLl/wI2asfwEh 4rmzy3/jSQhl6lzt4lPUavj6aLO8Vgd1BcCyZhH8CaaxN00XXq6czoSPo912hxH4PFFM 4slV9BjvTvM0zVxDC/tvdYCXa+fShlblOFW672Wnu/5e+RLEXUI4iJ+I0H4H++Df0MyC nrS7bonulkXuEvxGKb+3NkHq482ReCS517Z7vR3W2n5/7pTAUZZOdJsSs0BWfhifqNrY XxIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:to:from:subject; bh=ZtOwePTqYYFYAd8LYy+zw76K/Vx+1mQwFg+Cpf4LVYQ=; b=WJzOXe/rU+E0aj6y3k36JmXRLp3845J0qMxEi41O5cRqnyQp4C7tslR2PoEMMVEKMS i2lcI7Lr1SrJh006ltLxckfXctDU5+e27XNXQXbnXdv4AIOGIQR7Ga7O4zECjR7qBMKV pznx8KgwNeNy2YYscaU1xNkmfPiZbT84ti9v452J3TTaJ+pnHbPLU2nJg6ggRBwKsuKa vJ5oAw6DE+UvgH7TJKj2EhJM5yvryrjcWcyQrWAQtnehlvZNmHg1Pcv8kd93QeiC8EYP dq++jxgsS2mxNJ9eCqw9bpIHwjVvXA/KbR5/hzPGMGKp/5yxmVHw5ufVD+Bak0BpmpDf ALVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k73si3869749pge.353.2019.07.10.20.07.38; Wed, 10 Jul 2019 20:08:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727620AbfGKDHf (ORCPT + 99 others); Wed, 10 Jul 2019 23:07:35 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:35706 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726353AbfGKDHf (ORCPT ); Wed, 10 Jul 2019 23:07:35 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x6B37Wkm049098 for ; Wed, 10 Jul 2019 23:07:34 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tnu35bcvr-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 10 Jul 2019 23:07:33 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 11 Jul 2019 04:07:31 +0100 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 11 Jul 2019 04:07:28 +0100 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x6B37F0p35652076 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Jul 2019 03:07:15 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E5429A405B; Thu, 11 Jul 2019 03:07:27 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 735A7A4054; Thu, 11 Jul 2019 03:07:26 +0000 (GMT) Received: from localhost.localdomain (unknown [9.80.110.74]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 11 Jul 2019 03:07:26 +0000 (GMT) Subject: Re: [GIT PULL] Keys: Set 4 - Key ACLs for 5.3 From: Mimi Zohar To: Linus Torvalds , David Howells , James Morris , keyrings@vger.kernel.org, Netdev , linux-nfs@vger.kernel.org, CIFS , linux-afs@lists.infradead.org, linux-fsdevel , linux-integrity@vger.kernel.org, LSM List , Linux List Kernel Mailing Date: Wed, 10 Jul 2019 23:07:15 -0400 In-Reply-To: References: <28477.1562362239@warthog.procyon.org.uk> <20190710194620.GA83443@gmail.com> <20190710201552.GB83443@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19071103-4275-0000-0000-0000034BBC6E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19071103-4276-0000-0000-0000385BC1F1 Message-Id: <1562814435.4014.11.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-07-10_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907110035 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi Linus, On Wed, 2019-07-10 at 18:59 -0700, Linus Torvalds wrote: > Anyway, since it does seem like David is offline, I've just reverted > this from my tree, and will be continuing my normal merge window pull > requests (the other issues I have seen have fixes in their respective > trees). Sorry for the delay.  An exception is needed for loading builtin keys "KEY_ALLOC_BUILT_IN" onto a keyring that is not writable by userspace.  The following works, but probably is not how David would handle the exception. diff --git a/security/keys/key.c b/security/keys/key.c index 519211a996e7..a99332c1e014 100644 --- a/security/keys/key.c +++ b/security/keys/key.c @@ -896,7 +896,7 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref, /* if we're going to allocate a new key, we're going to have * to modify the keyring */ ret = key_permission(keyring_ref, KEY_NEED_WRITE); - if (ret < 0) { + if (ret < 0 && !(flags & KEY_ALLOC_BUILT_IN)) { key_ref = ERR_PTR(ret); goto error_link_end; } Mimi