From mboxrd@z Thu Jan 1 00:00:00 1970 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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 24802C43331 for ; Fri, 27 Mar 2020 11:52:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D4C2620748 for ; Fri, 27 Mar 2020 11:52:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=coker.com.au header.i=@coker.com.au header.b="j0Jk+JzX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726640AbgC0Lw1 (ORCPT ); Fri, 27 Mar 2020 07:52:27 -0400 Received: from smtp.sws.net.au ([46.4.88.250]:43850 "EHLO smtp.sws.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726165AbgC0Lw1 (ORCPT ); Fri, 27 Mar 2020 07:52:27 -0400 Received: from xev.coker.com.au (localhost [127.0.0.1]) by smtp.sws.net.au (Postfix) with ESMTP id 07EBBF13E; Fri, 27 Mar 2020 22:52:25 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=coker.com.au; s=2008; t=1585309945; bh=rhTQdaalqggpIbp5SAVpOGTex7icCiMbin7q/LB1XBk=; l=1715; h=From:To:Reply-To:Cc:Subject:Date:In-Reply-To:References:From; b=j0Jk+JzXwZF6IW7DNxrhBQZP0lpl+khrJ5G/t0V/ttb5D8+D8oTAR+nLiLQ5Bdle3 HUw3qzTejsgPXrgOgjHtqfSiviQMxGhuztyADB0aChwEeHXkEyyM2m52V0GGYLZiA/ VG/zVau5IU8k560sXv2rc+RD36e33EVIYrm3BbXA= Received: by xev.coker.com.au (Postfix, from userid 1001) id B2898FD1784; Fri, 27 Mar 2020 22:52:20 +1100 (AEDT) From: Russell Coker To: Dominick Grift Reply-To: russell@coker.com.au Cc: "selinux-refpolicy@vger.kernel.org" Subject: Re: systemd reboot Date: Fri, 27 Mar 2020 22:52:20 +1100 Message-ID: <2479184.xkgEG3NQo7@xev> In-Reply-To: <20190714161619.GB29870@brutus.lan> References: <5834210.QDNlvuYVDn@liv> <20190714161619.GB29870@brutus.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On Monday, 15 July 2019 2:16:19 AM AEDT Dominick Grift wrote: > On Mon, Jul 15, 2019 at 01:10:48AM +1000, Russell Coker wrote: > > # cat /lib/systemd/system/reboot.target > > cat: /lib/systemd/system/reboot.target: Permission denied > > # systemctl reboot > > ... it reboots > > > > Should systemd be doing some sort of access check on reboot.target? > > I was wrong. It is doing an acccess check on reboot.target > > I tried it out here: > https://www.youtube.com/watch?v=YUATkv6R6Ys&feature=youtu.be Thanks for the pointer, I put in an auditallow rule and got the following when user_t runs "systemctl reboot". It's doing the permission check on systemd- logind. Do you have any idea of where I should look for the cause of this? type=USER_AVC msg=audit(1585309343.652:285): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc: granted { start } for auid=n/a uid=0 gid=0 path="/lib/systemd/system/reboot.target" cmdline="/ lib/systemd/systemd-logind" scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:object_r:power_unit_t:s0 tclass=service exe="/usr/lib/ systemd/systemd" sauid=0 hostname=? addr=? terminal=?' type=USER_AVC msg=audit(1585309343.660:287): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc: granted { start } for auid=n/a uid=0 gid=0 path="/lib/systemd/system/reboot.target" cmdline="/ lib/systemd/systemd-logind" scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:object_r:power_unit_t:s0 tclass=service exe="/usr/lib/ systemd/systemd" sauid=0 hostname=? addr=? terminal=?' -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/