Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2396466ybb; Fri, 27 Mar 2020 04:52:35 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsY05SaJwyZ+oejpmKLdEFYUsqxlc3rWjz37t9WpqDiEPsOmzTKZ/tLyoo7h+J2l0PHX0b5 X-Received: by 2002:aca:cc81:: with SMTP id c123mr3480484oig.74.1585309955646; Fri, 27 Mar 2020 04:52:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585309955; cv=none; d=google.com; s=arc-20160816; b=s/ns7dMS+L5djtXLoXPweryzerMa86qvxQZRDQ3tAX0omcaxCMtiALzD9gTyEJSfdA hFG4IABk+okM0Pjlk/6rxBB14LUwL0A+D+nsXYCTk16sQ+eRzPqvtbhvJgjTBiKY5ghe Z9Oc9RTR485+ozzEYrFqoCk1fa6lxqGHPjuOqvbkibz0WMhZLFXmSDAuyTJy8z0cVvIU 0qRU1ncSybhHPHEIE2ZH+hnqPzdG2S/rj1htD6OCle8Ui4yF0gnv0zF84D3YO3EpikI+ ZImTL0oDb6bThO4MWvORkURtwuzXj+P2OXJPJDPsuP5RhjfTl5XUUQd6Mjvj9OX2QEoB Bpfw== 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:message-id:date:subject:cc:reply-to:to:from :dkim-signature; bh=rhTQdaalqggpIbp5SAVpOGTex7icCiMbin7q/LB1XBk=; b=oaYwC72LwKJiVe1P9J2x0a16E1w1s97o+iFka5B5KCsqZzJLamanZt7MaI210NE56R 4/Zoveif70uPciUb8jqizdlv6v2LwPxsizv4ayd3BnhS93QeLY4CY8UqLQSU0a6M6dYr z+1C2doimpvJrzaWoF13t6PoxUTf1zIS/lTUNAwVsSKXB3QLSFlsPl5DaCR9c5rHJqpX Fq1oBW/fgXlO3dOxKmtBIGe7XQUldgqKs7b/cgZh5CpxEdllf0PDRXjXKnPP85jvKlRM 1V/ICYlQzCVs1oWmmakqTZKl66Z7hx1HDJpNADaky9ydWYOrNe3DhzziknKs4RMZ/hJ1 pOQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@coker.com.au header.s=2008 header.b=j0Jk+JzX; spf=pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=coker.com.au Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9si2504874otc.162.2020.03.27.04.52.30; Fri, 27 Mar 2020 04:52:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@coker.com.au header.s=2008 header.b=j0Jk+JzX; spf=pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=coker.com.au Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726640AbgC0Lw1 (ORCPT + 13 others); 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/