Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2182072ybg; Thu, 24 Oct 2019 06:07:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcHpXuvcGey5lJgzf0gv5J6lxVPs94bheYMtESRP2QeEBGcwIjX5+amUsrr8f624R21EjH X-Received: by 2002:a50:8d8a:: with SMTP id r10mr43687867edh.302.1571922474763; Thu, 24 Oct 2019 06:07:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571922474; cv=none; d=google.com; s=arc-20160816; b=oMKaeMUhaG9u9KHPCfvw1e6G0C++vlAd2jXIXEBve+k8JcR7usc7Agg1n0idKhIzhD TyZJs/eYFm7jOtD2I29JqubNs1tOm4Faije0nJpGqiPI/GrPs3JMzeQdM8B72UOU1i2E 4TWXp9lilK40UAA7JmENgbp2D4TJoCXn2eQ6VDBMMfMZdddF8UprAHVUv3h2WtejtmNd UFh11Q7hWjgL99OfOC6bURrhKbTWQuJiBLaEMtCltFeCcwASnXPTj/kRd6DtleVXbuW5 NpLguu4aFiO/Q3OeRwb6YNJZUHLle0PPenaeIgRr8+i9g9HIGXg8SyTj1tUTDczAYloV 41tg== 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=8gY/E9V5RbxjqmpNIkC7qE3LqeahNDTJ5CvbsKw2ink=; b=sPlf7/kVnd9dirOTawhfdgMSd41MMmgw5ZfyPQjmli6LUX/4yZHeTb+64HuWHFd+Zi LBJCTIYgwKyQlEVcgRkPAaZIff71FcNd/vJ5n6fBeMTsKyqIRTqoKMdAODB8J7Q6sqpC 6BMj3GIn4QfwI0hdp9giuZhIRmeZ6FNTZVsECeRIQUEjhRPkns3F9mNCjF2TJOqq89kP 0I6KO3OmftKdtKedsifAyaNznPRBYgL012A3meQlNiSgFXSgDZFDjwil2PTnHB0oso9j jF5rgrM7vGRAHl87PT+Q465Vs0cpfRFnzDqjvQHcTzpJSYAxjOjvcWZYiV7xwmNe9sUW ztxQ== ARC-Authentication-Results: i=1; mx.google.com; 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=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 w7si421278eju.65.2019.10.24.06.07.09; Thu, 24 Oct 2019 06:07:54 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388381AbfJWSJ0 (ORCPT + 99 others); Wed, 23 Oct 2019 14:09:26 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:27976 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388259AbfJWSJZ (ORCPT ); Wed, 23 Oct 2019 14:09:25 -0400 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x9NHr5tN126474 for ; Wed, 23 Oct 2019 14:09:24 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2vt3kj276g-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 23 Oct 2019 14:09:24 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 23 Oct 2019 19:09:22 +0100 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 23 Oct 2019 19:09:18 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x9NI8jC941681354 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Oct 2019 18:08:45 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C0DE842047; Wed, 23 Oct 2019 18:09:17 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7B0B74203F; Wed, 23 Oct 2019 18:09:16 +0000 (GMT) Received: from localhost.localdomain (unknown [9.85.184.174]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 23 Oct 2019 18:09:16 +0000 (GMT) Subject: Re: [PATCH v1 6/6] KEYS: measure keys when they are created or updated From: Mimi Zohar To: Lakshmi Ramasubramanian , dhowells@redhat.com, casey@schaufler-ca.com, sashal@kernel.org, jamorris@linux.microsoft.com, linux-security-module@vger.kernel.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, keyrings@vger.kernel.org Date: Wed, 23 Oct 2019 14:09:15 -0400 In-Reply-To: <20191023001818.3684-7-nramas@linux.microsoft.com> References: <20191023001818.3684-1-nramas@linux.microsoft.com> <20191023001818.3684-7-nramas@linux.microsoft.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: 19102318-0028-0000-0000-000003AE3EC8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19102318-0029-0000-0000-000024706E31 Message-Id: <1571854155.5104.157.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-10-23_04:,, 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=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910230169 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2019-10-22 at 17:18 -0700, Lakshmi Ramasubramanian wrote: > diff --git a/security/security.c b/security/security.c > index 250ee2d76406..707a9e7fa94d 100644 > --- a/security/security.c > +++ b/security/security.c > @@ -2303,6 +2303,16 @@ int security_key_getsecurity(struct key *key, char **_buffer) > return call_int_hook(key_getsecurity, 0, key, _buffer); > } > > +int security_key_create_or_update(struct key *keyring, > + struct key *key, > + const struct cred *cred, > + unsigned long flags, > + bool create) > +{ > + return ima_post_key_create_or_update(keyring, key, cred, > + flags, create); > +} > + > #endif /* CONFIG_KEYS */ Either the new hook is an LSM and IMA hook, or it is just an IMA hook.  We don't define a security_ function, if it is just an IMA hook. Mimi