Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1780589ybt; Mon, 15 Jun 2020 09:13:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3X/T1GiBAvfqgU+J0Uv8Ljx2GgOkxM3+xm5euj2CYC+j1IyC2twMKXAEI9jSH9q+quyS4 X-Received: by 2002:a17:906:ae85:: with SMTP id md5mr13568280ejb.213.1592237583146; Mon, 15 Jun 2020 09:13:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592237583; cv=none; d=google.com; s=arc-20160816; b=e5Y6LZE8D9X3fJTPW75DuoDjaoT51VH3jW6kxf5BCuqan4Zp2lpGo3DcBwfGzv59O8 jx2R5+Br3HTRt1NnKy+Degororq9ZzBmDllGp1IkKGbyVSWNpu3GiPWnA64RyEIoA2pc Lxjcecwzn73M+V7/ZGKkaiGAEl3JDl+rWmQZraTG8bLrcu1CfAjx5Iov739OKEBhyouX 0wo1PMwFJhdBzqzMz7WzTgCZmSEEyugdidOF5Fojwr86FPj+rTA9jucURFqY45CO4Hl7 m8mh0lUPd3WKaJ5om8FG5F+rtfUXKGCy5biGD3gjXFIv5+aYkH3AxWw58PQhW2BxM0rl sEvw== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=qoiOhIWkkWqbz6zkwujep5FGJB6NY/t2JbMqJgjqep0=; b=IQxPEJb08dgb6laPEqt43fZcCLhQwviuw8KKmJeI8JL19nF8r7GgtrmpOPZ3ikgxq6 Z7fgA8tL1vuTS6t+G0/WWD6l7qDDj5F1Z9OFGTpR/lhK+5aNMFXaeMCesGEVvTx/U1+a WJXnnY1RcJRY1PpFCKqfaue0bcssI+/P7KH2D19WTnQ6X/+J3YOYblCwmp2+PbE9QX1Q vqPMHNQYj20ZZamGMUQgC6KnVZyHVwyVnhn7EL9BUj8SrT/8EiB7vHIWqqTWqV7R26S5 G74/0si+PjfduCnGRkrWx3yMN9nMGQ5okVnv2wWqW5SZmQo6lv61ZvDvg/3B0+hcsAFI +nAA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d20si8747953edp.298.2020.06.15.09.12.40; Mon, 15 Jun 2020 09:13:03 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730565AbgFOQKe (ORCPT + 99 others); Mon, 15 Jun 2020 12:10:34 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40832 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728585AbgFOQKd (ORCPT ); Mon, 15 Jun 2020 12:10:33 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05FG3jdq097237; Mon, 15 Jun 2020 12:10:28 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 31mtxf3krh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Jun 2020 12:10:28 -0400 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 05FG45MO099034; Mon, 15 Jun 2020 12:10:27 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 31mtxf3kpf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Jun 2020 12:10:27 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 05FG14Ek001730; Mon, 15 Jun 2020 16:10:24 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma04fra.de.ibm.com with ESMTP id 31mpe81jcr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Jun 2020 16:10:24 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 05FGAMPT3080502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Jun 2020 16:10:22 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6687311C054; Mon, 15 Jun 2020 16:10:22 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 54C5311C069; Mon, 15 Jun 2020 16:10:21 +0000 (GMT) Received: from localhost.localdomain (unknown [9.85.184.11]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 15 Jun 2020 16:10:21 +0000 (GMT) Message-ID: <1592237420.11061.144.camel@linux.ibm.com> Subject: Re: [PATCH 5/5] LSM: Define workqueue for measuring security module state From: Mimi Zohar To: Stephen Smalley Cc: Lakshmi Ramasubramanian , Stephen Smalley , Casey Schaufler , James Morris , linux-integrity@vger.kernel.org, LSM List , linux-kernel Date: Mon, 15 Jun 2020 12:10:20 -0400 In-Reply-To: References: <20200613024130.3356-1-nramas@linux.microsoft.com> <20200613024130.3356-6-nramas@linux.microsoft.com> <1592233145.11061.129.camel@linux.ibm.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-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.687 definitions=2020-06-15_03:2020-06-15,2020-06-15 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 suspectscore=0 phishscore=0 lowpriorityscore=0 mlxscore=0 cotscore=-2147483648 bulkscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006150111 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-06-15 at 11:47 -0400, Stephen Smalley wrote: > On Mon, Jun 15, 2020 at 10:59 AM Mimi Zohar wrote: > > > > On Mon, 2020-06-15 at 09:33 -0400, Stephen Smalley wrote: > > > On Fri, Jun 12, 2020 at 10:42 PM Lakshmi Ramasubramanian > > > wrote: > > > > > > > > The data maintained by the security modules could be tampered with by > > > > malware. The LSM needs to periodically query the state of > > > > the security modules and measure the data when the state is changed. > > > > > > > > Define a workqueue for handling this periodic query and measurement. > > > > > > Won't this make it difficult/impossible to predict the IMA PCR value? > > > Unless I missed it, you are going to end up measuring every N minutes > > > even if there was no change and therefore constantly be extending the > > > PCR. That will break attestation or sealing against the IMA PCR. > > > > Even if it attempts to add the same measurement to the list multiple > > times, unless something changed, there should only be one measurement > > in the list. > > Is the PCR only extended once? Yes, otherwise you wouldn't be able to verify a quote.  ima_lookup_digest_entry() first verifies the hash isn't in the cache, before adding it to the measurement list and then extending the TPM. Mimi