Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp813551pxb; Thu, 17 Feb 2022 15:35:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJykaFDlAtDnzLMJ16ebafJ9wyh/1P7/59Zls+lkZDwjigGQTksLSG2CF3Lq3DhuS++qFoD6 X-Received: by 2002:a63:ff54:0:b0:373:520f:a01d with SMTP id s20-20020a63ff54000000b00373520fa01dmr4172360pgk.394.1645140939290; Thu, 17 Feb 2022 15:35:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645140939; cv=none; d=google.com; s=arc-20160816; b=OusaQc3rsQ4sGWZQVF7uKCJy4CAn/Pbmh9vUREglDsHd7VU2lQxaUzuSxRBvuxH//5 gmZm9g5PbUROjrC5f9aR0HWYDp1GcdhYVwvvo4rqYIVILaV7aeY3E9k8YaX0KiGmhMr2 XKiUN+FlBZFYfBQ2KXXWvVuqXeO4EVOQy7bdBntt0h2M28xIDXsoa7swLPfYFLJOl3+1 cYqfgNaAlFHfJ/QYotDLVOd8wJM5Lg9m0yJlQxFP74DTBlRdcJe5HjrAKR6jAgclWcVC iJEIHN8uLH9n5WQxrLW6jz5zydZRy/B891jOH59ZFpy24nL1zVg+55o+wKXcAWMv+a1d o9rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=ggaZF4UIUd4XcNY0xhhma3NvdMEBGgIihwV+iEvRwe4=; b=qyt470hB0twl6Fb9KPzufJ/fRWrUNcfQAgV3FurPwNHy3RT2mqyWhJThwRAOY7wCms hmD5AW9/p8SJapHhWXLNINPEriNqQ2BZXyToXjs7uBO12SGcysjunwQqyR0HJ3xCncDo jCk9+aJ9zkcU+I46Pt9VKZOgdVOHOUFx+m/hQXxLwg76AtjIMoDpr4daxS0eq1kE95u1 XxqybjINUXL1r2IXc6T14pBKx0K9pLQBS9zoxNMhslAifsPUpBFI318/zLCjj6wOjxW2 I040JvTEL4E4mVIlz3spIf/Mcnjqb3sZZ/ctAkSJO06WCPPqnX9uqBlD5TD92oUw84Qo GntA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=JDB+xhPY; spf=softfail (google.com: domain of transitioning selinux-refpolicy-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ieee.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id l7si20055413plg.617.2022.02.17.15.35.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 15:35:39 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning selinux-refpolicy-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=JDB+xhPY; spf=softfail (google.com: domain of transitioning selinux-refpolicy-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ieee.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7E6CC2E719F; Thu, 17 Feb 2022 15:16:13 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232878AbiBQOBu (ORCPT + 22 others); Thu, 17 Feb 2022 09:01:50 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241675AbiBQOBu (ORCPT ); Thu, 17 Feb 2022 09:01:50 -0500 Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA5E4DFCB for ; Thu, 17 Feb 2022 06:01:35 -0800 (PST) Received: by mail-qv1-xf2c.google.com with SMTP id v10so8334999qvk.7 for ; Thu, 17 Feb 2022 06:01:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=ggaZF4UIUd4XcNY0xhhma3NvdMEBGgIihwV+iEvRwe4=; b=JDB+xhPYR/vPmJbA4MSO1i6WbhISMJjT8vxR6jvW+mN0cD9Ah6t3jXE2/qFEOJoZ7Y VM3mihjGVnDWoHOLfQYN4sZ7pk0sHbGiSuFU0cVWJM2hyh1m4tXxkBKAtgZK+F6D48gV 8WurJ1FFzmmenLwyx6x3cU8i8edMQ7PqlBJDw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=ggaZF4UIUd4XcNY0xhhma3NvdMEBGgIihwV+iEvRwe4=; b=4uTtHctuGTbVhzYwgvlsTknBoUE2TmwGoFlFzoQBySXF/21fkpdWo2ibuiEuuRdZt8 g9DzvSrcPBHDGwPf4WAUo4jh4r+tNwNV5zHaH5a5JTcr699Hi4aG0tDntPbNt3KO71qc rtwUvJGN+KW8d/hiBtSGCaDLJs9OWFxfNQ2XIVPBvnu92EMp8briadAlSqmJhF1eStBq 9BugdNZMUPeYfZMo2Gm892s1jVROs+L1lgdvZjYeO7dd0FKRy7OWJLNsyrR+APP/hzsG cDacmSL49mYpgZcs40WkOorbSV8RoCzVH5UEZEgOzojQP89h2OXvOqd8e/0fTsbYA/Uu S0Aw== X-Gm-Message-State: AOAM533EGfpK21GlcFYwYh7QJ1gD49IaJBI7+J26GllS2q2U2cz2ULLq bxesiCBoYsJQJ1AOJXVHv5Qn5L7xKVEj5A== X-Received: by 2002:a05:622a:1898:b0:2cb:96a0:9b30 with SMTP id v24-20020a05622a189800b002cb96a09b30mr2467864qtc.669.1645106494626; Thu, 17 Feb 2022 06:01:34 -0800 (PST) Received: from [192.168.1.126] ([72.85.44.115]) by smtp.gmail.com with ESMTPSA id k13sm22178547qko.45.2022.02.17.06.01.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 06:01:34 -0800 (PST) Message-ID: <7ad21737-b9fe-bccd-5701-3b73e0e6611a@ieee.org> Date: Thu, 17 Feb 2022 09:01:33 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] rasdaemon policy Content-Language: en-US To: Russell Coker , selinux-refpolicy@vger.kernel.org References: From: Chris PeBenito In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On 2/16/22 21:50, Russell Coker wrote: > This is the policy for the Reliability, Availability, and Servicability > daemon. It's designed to extract and log information on hardware events > on server hardware. > > Signed-off-by: Russell Coker > > Index: refpolicy-2.20220217/policy/modules/kernel/filesystem.if > =================================================================== > --- refpolicy-2.20220217.orig/policy/modules/kernel/filesystem.if > +++ refpolicy-2.20220217/policy/modules/kernel/filesystem.if > @@ -5485,6 +5485,43 @@ interface(`fs_getattr_tracefs_files',` > > ######################################## > ## > +## Read/write trace filesystem files > +## > +## > +## > +## Domain allowed access. > +## > +## > +# > +interface(`fs_write_tracefs_files',` > + gen_require(` > + type tracefs_t; > + ') > + > + allow $1 tracefs_t:dir list_dir_perms; > + allow $1 tracefs_t:file rw_file_perms; > +') > + > +######################################## > +## > +## create trace filesystem directories > +## > +## > +## > +## Domain allowed access. > +## > +## > +# > +interface(`fs_create_tracefs_dirs',` > + gen_require(` > + type tracefs_t; > + ') > + > + allow $1 tracefs_t:dir { create rw_dir_perms }; > +') > + > +######################################## > +## > ## Mount a XENFS filesystem. > ## > ## > Index: refpolicy-2.20220217/policy/modules/services/rasdaemon.fc > =================================================================== > --- /dev/null > +++ refpolicy-2.20220217/policy/modules/services/rasdaemon.fc > @@ -0,0 +1,3 @@ > +/usr/sbin/rasdaemon -- gen_context(system_u:object_r:rasdaemon_exec_t,s0) > +/var/lib/rasdaemon(/.*)? gen_context(system_u:object_r:rasdaemon_var_t,s0) > + > Index: refpolicy-2.20220217/policy/modules/services/rasdaemon.if > =================================================================== > --- /dev/null > +++ refpolicy-2.20220217/policy/modules/services/rasdaemon.if > @@ -0,0 +1 @@ > +## A summary is needed. > Index: refpolicy-2.20220217/policy/modules/services/rasdaemon.te > =================================================================== > --- /dev/null > +++ refpolicy-2.20220217/policy/modules/services/rasdaemon.te > @@ -0,0 +1,50 @@ > +policy_module(rasdaemon, 1.0.0) > + > +# rasdaemon is a RAS (Reliability, Availability and Serviceability) logging > +# tool. It currently records memory errors, using the EDAC tracing events. > +# EDAC are drivers in the Linux kernel that handle detection of ECC errors > +# from memory controllers for most chipsets on x86 and ARM architectures. > +# > +# https://git.infradead.org/users/mchehab/rasdaemon.git > + > +######################################## > +# > +# Declarations > +# > + > +type rasdaemon_t; > +type rasdaemon_exec_t; > +init_daemon_domain(rasdaemon_t, rasdaemon_exec_t) > + > +type rasdaemon_var_t; > +files_type(rasdaemon_var_t) > + > +######################################## > +# > +# Local policy > +# > + > +allow rasdaemon_t self:unix_dgram_socket create_socket_perms; > + > +# confidentiality for tracefs and integrity for debugfs > +allow rasdaemon_t self:lockdown { confidentiality integrity }; Lockdown is already allowed for all domains in domain.te. > +allow rasdaemon_t rasdaemon_var_t:dir manage_dir_perms; > +allow rasdaemon_t rasdaemon_var_t:file manage_file_perms; > + > +kernel_read_debugfs(rasdaemon_t) > +kernel_read_system_state(rasdaemon_t) > +kernel_read_vm_overcommit_sysctl(rasdaemon_t) > +kernel_search_fs_sysctls(rasdaemon_t) > + > +dev_list_sysfs(rasdaemon_t) > +dev_read_urand(rasdaemon_t) > + > +files_read_etc_symlinks(rasdaemon_t) > +files_search_var_lib(rasdaemon_t) > +fs_write_tracefs_files(rasdaemon_t) > +fs_create_tracefs_dirs(rasdaemon_t) > + > +logging_send_syslog_msg(rasdaemon_t) > +miscfiles_read_localization(rasdaemon_t) > + -- Chris PeBenito