Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91BCFC10F0E for ; Mon, 8 Apr 2019 00:53:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48237206B7 for ; Mon, 8 Apr 2019 00:53:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="GsnG3Imy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726387AbfDHAxC (ORCPT ); Sun, 7 Apr 2019 20:53:02 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:36631 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726349AbfDHAxC (ORCPT ); Sun, 7 Apr 2019 20:53:02 -0400 Received: by mail-qk1-f194.google.com with SMTP id k130so7001181qke.3 for ; Sun, 07 Apr 2019 17:53:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=abRRUIFnDklo+vMk00Eg15btnzSLEZO8xhSF8pi3ZOs=; b=GsnG3Imy0UUJYAUJkLfGijB0zRNZP+H1cLeS1EqLhMJIGSMPnIAJ2yBWLKhHsbnIDP DJyZgUzcBxMLE9mZL0Mj9wGaC6w6vaL+jq1Lrce9Vjf+mdJDZkTE2phflQAgrnyXJgof hJDmOQarn9fQNxSUo0DmHl8+aUqpP53h+61HI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=abRRUIFnDklo+vMk00Eg15btnzSLEZO8xhSF8pi3ZOs=; b=nXGwirDcpj4hG7tL+Qe4BxYkzUBSbSGGIQKQqSWRLnnS2lKpJOF2TEqe7bBvaZ1bu0 Lqf6yqRIoMmnPLMWsFdCSgr5lbz/zQycdeWvW6r7PFtQbVPNdfIIjWSiWqtfEEdBDydL pMtIFokEwTIHmOJa1lP/H0ceo4P64NyQf265ZDa1rkoAcWKr+zBdaa68SzgIEetnWU1o n+RLiDSLbN9AFAxc+YFQutXYzTnBLqFGPcC+LJlgbcZAQIRij101FJYz1J+g4BC0Ku4J svcniVbXIzaEjqM3Pcc8JBDg1B767LMhACyEW2doUut2WkrzpT0LcHFbKATQM6qnTXI+ N3KA== X-Gm-Message-State: APjAAAVRSJlibKKQKB+oFUN6+fY7eTywHd7Guz4y8dKLTiGcUVK76MOP 1gQg3tRBp2LcYpdGOKYXC0bJgr1D7BU= X-Google-Smtp-Source: APXvYqzx0vBkuzA8ooyzZP5hlQVW6GdCTnkZwxOoaU7/RNm+OTU/H0lR/nOqT2gFKVlO6YOs7sdrlQ== X-Received: by 2002:a37:4757:: with SMTP id u84mr13168140qka.275.1554684781299; Sun, 07 Apr 2019 17:53:01 -0700 (PDT) Received: from [192.168.1.190] (pool-108-15-23-247.bltmmd.fios.verizon.net. [108.15.23.247]) by smtp.gmail.com with ESMTPSA id n201sm15368862qka.10.2019.04.07.17.53.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Apr 2019 17:53:00 -0700 (PDT) Subject: Re: [PATCH] Resolve some denials related to sending journal messages To: "Sugar, David" , "selinux-refpolicy@vger.kernel.org" References: <20190404122900.8945-1-dsugar@tresys.com> <20190404122900.8945-2-dsugar@tresys.com> From: Chris PeBenito Message-ID: <48f4a705-36e6-aca7-15e4-1c100785aaf8@ieee.org> Date: Sun, 7 Apr 2019 20:52:50 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20190404122900.8945-2-dsugar@tresys.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On 4/4/19 8:29 AM, Sugar, David wrote: > type=AVC msg=audit(1554324562.840:159): avc: denied { sendto } for pid=7277 comm="systemd-backlig" path="/run/systemd/journal/socket" scontext=system_u:system_r:systemd_backlight_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=unix_dgram_socket permissive=1 > type=AVC msg=audit(1554324271.863:245): avc: denied { sendto } for pid=7421 comm="systemd-user-se" path="/run/systemd/journal/socket" scontext=system_u:system_r:systemd_sessions_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=unix_dgram_socket permissive=0 > type=AVC msg=audit(1554324635.844:313): avc: denied { sendto } for pid=7744 comm="systemd-cryptse" path="/run/systemd/journal/socket" scontext=system_u:system_r:lvm_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=unix_dgram_socket permissive=1 I think we've reached the limit of the explicit kernel_dgram_send() and it's time to reevaluate putting this in logging_send_syslog_msg(). > Signed-off-by: Dave Sugar > --- > policy/modules/system/lvm.te | 1 + > policy/modules/system/systemd.te | 4 ++++ > 2 files changed, 5 insertions(+) > > diff --git a/policy/modules/system/lvm.te b/policy/modules/system/lvm.te > index ec3b4a18..aea199d4 100644 > --- a/policy/modules/system/lvm.te > +++ b/policy/modules/system/lvm.te > @@ -222,6 +222,7 @@ filetrans_pattern(lvm_t, lvm_etc_t, lvm_metadata_t, file) > files_etc_filetrans(lvm_t, lvm_metadata_t, file) > files_search_mnt(lvm_t) > > +kernel_dgram_send(lvm_t) > kernel_request_load_module(lvm_t) > kernel_get_sysvipc_info(lvm_t) > kernel_read_system_state(lvm_t) > diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te > index f6455f6f..541117a9 100644 > --- a/policy/modules/system/systemd.te > +++ b/policy/modules/system/systemd.te > @@ -228,6 +228,8 @@ dev_rw_sysfs(systemd_backlight_t) > # for udev.conf > files_read_etc_files(systemd_backlight_t) > > +kernel_dgram_send(systemd_backlight_t) > + > # for /run/udev/data/+backlight* > udev_read_pid_files(systemd_backlight_t) > > @@ -981,6 +983,8 @@ allow systemd_sessions_t self:process setfscreate; > allow systemd_sessions_t systemd_sessions_var_run_t:file manage_file_perms; > files_pid_filetrans(systemd_sessions_t, systemd_sessions_var_run_t, file) > > +kernel_dgram_send(systemd_sessions_t) > + > selinux_get_enforce_mode(systemd_sessions_t) > selinux_get_fs_mount(systemd_sessions_t) > > -- Chris PeBenito