Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2341312ybc; Wed, 13 Nov 2019 12:53:59 -0800 (PST) X-Google-Smtp-Source: APXvYqzW3ktvSl978LLSkcqH9Jmh3ai8uzyJ6w63Dg9xIg611+iMi53V6R7Fy6D8tL27u9xdhTR+ X-Received: by 2002:a05:6402:602:: with SMTP id n2mr6088252edv.23.1573678439750; Wed, 13 Nov 2019 12:53:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573678439; cv=none; d=google.com; s=arc-20160816; b=MX6286bn8/URHhZoRaPu8a2LDY3SBAd0FHn2IahO3dXJKxx7bjQAwK4Xe1eff3mlnY m4l5g4iomOwESAZReM8lsChGFeQTs/cxStNahRDNmLWPQHIIgWYtWdMqZZR/CuTQpiEA W7zqriW/F1k3QvlDjcC5IDiYu9rj7KtPb6yD7peoRilQSesgAEcBu34WVm24q1lFi+SW hK9q77VS5hjR6qTcQglJwZEM4AQdII/+MinA2kSbxKncLLBy0I9VRCI4+sFfBBelWs7s 8/qD3Hvzg9CO1s4EBk5skK83rAXkVc9uXlQIatv6Z2iPK9CxjwpU2ce9q6LgL8brUC/R MiKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature:dkim-filter; bh=fgQhQUz164u1Ek8QLM0DOcyCkmeH/6O7UhOsdVDDB+I=; b=WL8YHEP4CVvJfQx9c6d1Vk0Os8LRquhA8/HxX3EXMW4UEeuly1NocS6XcN/T5Vd9y6 pSTtaDecmrR7xb6PhY0MoCvXqsvjDbIeUVyog6kCzMGEaD6AI5LmLvA41weZioiZSeU7 RyY9ZtG0ww9WzIyDd+wXlxtBM6bweVR/XAeKdPD4WS/lLH7UyJ7iuSkIe3G0MwchYG67 QQiqNQaoYHywXD7l0+iCRR3DrAJp5dN2YtoV+maKKnmINq2JNUPHEdV3oZNmzUXWteqU ir5+0xfK00avDvvgfM75KryiXf0RQnElvXz2LlEc120RqqHoo4P6IeNouUaPwhG9IE6T FgIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=kDVOZLq3; 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=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gr10si2004293ejb.414.2019.11.13.12.53.34; Wed, 13 Nov 2019 12:53:59 -0800 (PST) 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=@linux.microsoft.com header.s=default header.b=kDVOZLq3; 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=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726543AbfKMUww (ORCPT + 99 others); Wed, 13 Nov 2019 15:52:52 -0500 Received: from linux.microsoft.com ([13.77.154.182]:59488 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726162AbfKMUwv (ORCPT ); Wed, 13 Nov 2019 15:52:51 -0500 Received: from [10.137.112.108] (unknown [131.107.174.108]) by linux.microsoft.com (Postfix) with ESMTPSA id CC9B520B4901; Wed, 13 Nov 2019 12:52:50 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com CC9B520B4901 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1573678370; bh=fgQhQUz164u1Ek8QLM0DOcyCkmeH/6O7UhOsdVDDB+I=; h=Subject:To:References:From:Date:In-Reply-To:From; b=kDVOZLq3aB9m+A9OGzmuvC75nfcZhD/sjDjmXVT/MCU6x0biY6SEaTrpEujP6xAwB aYUHatP8kZVdB3hXXZeUhsqNKD5UunWJIDrPEQJJgQfuQW+xr4eG1ir0dlWIsMuWM9 4oVdLgWug+n41qHO++J6sNXAptLa43mYGILzmBIw= Subject: Re: [PATCH v6 2/3] IMA: Define an IMA hook to measure keys To: Mimi Zohar , dhowells@redhat.com, matthewgarrett@google.com, sashal@kernel.org, jamorris@linux.microsoft.com, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, keyrings@vger.kernel.org, linux-kernel@vger.kernel.org References: <20191113184658.2862-1-nramas@linux.microsoft.com> <20191113184658.2862-3-nramas@linux.microsoft.com> <1573675761.4843.13.camel@linux.ibm.com> From: Lakshmi Ramasubramanian Message-ID: <8eba665e-637c-d341-c77d-4f2645d3b246@linux.microsoft.com> Date: Wed, 13 Nov 2019 12:52:46 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <1573675761.4843.13.camel@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/13/19 12:09 PM, Mimi Zohar wrote: > > All that is is needed is the key and public_key structures, which are > defined in include/linux/keys.h and include/crypto/public_key.h.  If > the keys subsystem is disabled, then the new IMA hook won't be called. >  There's no need for a new Kconfig option or a new file. > > Please move the hook to just after ima_kexec_cmdline(). > > Mimi Yes - IMA hook won't be called when KEYS subsystem is disabled. But, build dependency is breaking since "struct key" is not defined without CONFIG_KEYS. Sasha was able to craft a .config that enabled IMA without enabling KEYS and found the build break. Please see the build output he'd shared. *********************************************************************** In file included from security/integrity/ima/ima.h:25, from security/integrity/ima/ima_fs.c:26: ./include/keys/asymmetric-type.h: In function ‘asymmetric_key_ids’: ./include/keys/asymmetric-type.h:72:12: error: dereferencing pointer to incomplete type ‘const struct key’ return key->payload.data[asym_key_ids]; ^~ make[3]: *** [scripts/Makefile.build:266: security/integrity/ima/ima_fs.o] Error 1 make[3]: *** Waiting for unfinished jobs.... In file included from security/integrity/ima/ima.h:25, from security/integrity/ima/ima_queue.c:22: ./include/keys/asymmetric-type.h: In function ‘asymmetric_key_ids’: ./include/keys/asymmetric-type.h:72:12: error: dereferencing pointer to incomplete type ‘const struct key’ return key->payload.data[asym_key_ids]; *********************************************************************** thanks, -lakshmi