Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1530401ybh; Thu, 16 Jul 2020 15:04:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+EENrUJjh1GcnsDX4kXVny1nhTI4fkLt1ei/pXYvD8nL5yz40fBMlU41plV0sx6Vit8cq X-Received: by 2002:aa7:df08:: with SMTP id c8mr6225911edy.372.1594937093100; Thu, 16 Jul 2020 15:04:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594937093; cv=none; d=google.com; s=arc-20160816; b=bgJrR7KJmDTtn9BIOt8NXaQVz33Ys2VFqTT8tZRQ8lKQ44B9Yz/B2I6/TiZvlBDqxI h/tVS0v6khgpyrYq5VsuVzkffgw4o3o2uPHZyVKc0vHOEvxoPamP7wFvoV0pEcLNs+a0 ulo2tvzXf3SNXbnbH+i5lCXp4qDNU//zTCpa4RgeQc5Sy6Tsalov5pkRMo1NNgL0feAA qqebfc4DfuuunV1hELxcAvhgRsz03foZe9hcXfy4V0T2PPMTEntIYtgY2+N2FUKQ/drG JIvTPP79lVGhkuZDb8j+zQUUUyDBl+qmzRZgryb6BDt5YOFvSMYiRV2GdWl9Nv55J292 RCNg== 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:cc:to:subject:dkim-signature:dkim-filter; bh=BO4avn92Gom5gc+t7EdSdrx5xcXiDN2axravan300r8=; b=qBalPla4SULfoVksGgRxTC8hWt0B0LvdaZwNyQI1w2jaxeWCmtlp3/Taq9eujbWUMG vZHB0b009r5AFVTlbIcpaz2G789Gr7k8pqtOUx3W/ek//1sRiNs5RyqMNg3agZJSp4aW 9kazwChyEPlSPqVLuI1+3UxNrviNkyTjNoRjpV3eq5z2RLQWAKiIUpNExZOJ+iImmwbU keCZ/Z54UoEiqXsP0cH9z7ndBb3cXb/HURef8vN289pXAG3HYSe39EPocXBdjmX59UbK 1A/gbCZnDAZHa2un0HkE8lVBxQN5EnCUO81NuNlpQ6cR4cMZkKtmrWcccCxYlzWjUTWV oipQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=alO1yY32; 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=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p26si4135006edy.181.2020.07.16.15.04.29; Thu, 16 Jul 2020 15:04:53 -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; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=alO1yY32; 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=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726579AbgGPWDe (ORCPT + 99 others); Thu, 16 Jul 2020 18:03:34 -0400 Received: from linux.microsoft.com ([13.77.154.182]:37492 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726002AbgGPWDe (ORCPT ); Thu, 16 Jul 2020 18:03:34 -0400 Received: from [192.168.0.104] (c-73-42-176-67.hsd1.wa.comcast.net [73.42.176.67]) by linux.microsoft.com (Postfix) with ESMTPSA id 41FA820B4909; Thu, 16 Jul 2020 15:03:33 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 41FA820B4909 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1594937013; bh=BO4avn92Gom5gc+t7EdSdrx5xcXiDN2axravan300r8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=alO1yY324W0XtvJF3jJ20uUtbfZIxvf5wdeVrVykT/x6h7DAdLUYXLhQmKKM1FSLm QrQ8rV0+7PDptRV66+ZZQExLfZNMxwrenrawEk4eIjI5uVEm2JZhZ7t/gi9fzXKtBb 4QLIkDA5LTA6svI/oegPWWMZ2q4ojUcWUeUrjHFg= Subject: Re: [PATCH v2 4/5] LSM: Define SELinux function to measure security state To: Stephen Smalley Cc: Mimi Zohar , Casey Schaufler , James Morris , linux-integrity@vger.kernel.org, SElinux list , LSM List , linux-kernel References: <20200716174351.20128-1-nramas@linux.microsoft.com> <20200716174351.20128-5-nramas@linux.microsoft.com> <9478ddca-8298-5170-836d-8cbc7a070df2@linux.microsoft.com> From: Lakshmi Ramasubramanian Message-ID: <37d3d380-f4e2-1bdc-88c8-7bb8ffbee612@linux.microsoft.com> Date: Thu, 16 Jul 2020 15:03:32 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/16/20 12:45 PM, Stephen Smalley wrote: > On Thu, Jul 16, 2020 at 3:13 PM Lakshmi Ramasubramanian > wrote: >> >> On 7/16/20 11:54 AM, Stephen Smalley wrote: >>> Not sure about this error handling approach (silent, proceeding as if >>> the length was zero and then later failing with ENOMEM on every >>> attempt?). I'd be more inclined to panic/BUG here but I know Linus >>> doesn't like that. >> I am not sure if failing (kernel panic/BUG) to "measure" LSM data under >> memory pressure conditions is the right thing. But I am open to treating >> this error as a fatal error. Please let me know. > > Let's at least log an error message since it otherwise silently > disables all measuring of security state. Agree - will log error messages as appropriate. > Also not sure why we bother returning errors from > selinux_measure_data() since nothing appears to check or use the > result. Maybe SELinux can log audit messages on failures, but I guess it may be better to do that closer to where the error occurs. Will change selinux_measure_data() to void function. > Don't know if integrity/IMA has any equivalent to the audit > subsystem's concept of audit_failure settings to control whether > errors that prevent auditing (measuring) are handled silently, with a > log message, or via a panic. If not, I guess that can be explored > separately. > Yes - integrity subsystem logs audit messages for errors\failures. -lakshmi