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=-6.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_PASS,URIBL_BLOCKED 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 33D30C43387 for ; Thu, 10 Jan 2019 23:08:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 04482208E3 for ; Thu, 10 Jan 2019 23:08:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726560AbfAJXIi (ORCPT ); Thu, 10 Jan 2019 18:08:38 -0500 Received: from mx1.polytechnique.org ([129.104.30.34]:38307 "EHLO mx1.polytechnique.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbfAJXIi (ORCPT ); Thu, 10 Jan 2019 18:08:38 -0500 Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTPSA id DAFB55647B6 for ; Fri, 11 Jan 2019 00:08:34 +0100 (CET) Received: by mail-oi1-f178.google.com with SMTP id m6so10705564oig.11 for ; Thu, 10 Jan 2019 15:08:34 -0800 (PST) X-Gm-Message-State: AJcUukeYUwXdinmHkUPjeVCyXd1HU7Hjtpow5AVq5nd9VATxATcs9KGy wJVFJ/FewyLywyvclGP5ZNpYixS0zOs/JqoJy44= X-Google-Smtp-Source: ALg8bN5XS08sY1IkDuPzdDo8GTkXRZ4SZIl5VU9lIj4nKHHp7rBRQO99c5KpTHibr+9y8o3YyriAFvuMsrrxZJskKto= X-Received: by 2002:aca:4b48:: with SMTP id y69mr8079826oia.200.1547161713830; Thu, 10 Jan 2019 15:08:33 -0800 (PST) MIME-Version: 1.0 References: <20190108114151.GA416@xev> <60dbf2ed-45e9-a94a-f37a-925a7c410aee@ieee.org> In-Reply-To: <60dbf2ed-45e9-a94a-f37a-925a7c410aee@ieee.org> From: Nicolas Iooss Date: Fri, 11 Jan 2019 00:08:22 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] /run/systemd/units/ links To: Chris PeBenito Cc: Russell Coker , selinux-refpolicy@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-AV-Checked: ClamAV using ClamSMTP at svoboda.polytechnique.org (Fri Jan 11 00:08:35 2019 +0100 (CET)) X-Org-Mail: nicolas.iooss.2010@polytechnique.org Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On Thu, Jan 10, 2019 at 1:37 AM Chris PeBenito wrote: > > On 1/8/19 6:41 AM, Russell Coker wrote: > > This allows systemd-journald to read /run/systemd/units/ link files. > > > > Index: refpolicy-2.20180701/policy/modules/system/logging.te > > =================================================================== > > --- refpolicy-2.20180701.orig/policy/modules/system/logging.te > > +++ refpolicy-2.20180701/policy/modules/system/logging.te > > @@ -547,6 +547,7 @@ ifdef(`init_systemd',` > > init_create_pid_dirs(syslogd_t) > > init_daemon_pid_file(syslogd_var_run_t, dir, "syslogd") > > init_getattr(syslogd_t) > > + init_read_run_links(syslogd_t) > > init_rename_pid_files(syslogd_t) > > init_delete_pid_files(syslogd_t) > > init_dgram_send(syslogd_t) > > Index: refpolicy-2.20180701/policy/modules/system/init.if > > =================================================================== > > --- refpolicy-2.20180701.orig/policy/modules/system/init.if > > +++ refpolicy-2.20180701/policy/modules/system/init.if > > @@ -894,6 +894,26 @@ interface(`init_dgram_send',` > > > > ######################################## > > ## > > +## read init /run link files > > +## > > +## > > +## > > +## Domain allowed access. > > +## > > +## > > +## > > +# > > +interface(`init_read_run_links',` > > I guess this is a race between patches. Should be named > init_read_pid_symlinks. Same feedback as GitHub PR > https://github.com/SELinuxProject/refpolicy/pull/17 I like "init_read_runtime_symlinks" more than "init_read_pid_symlinks" so I have uploaded my Pull Request. If your prefer the second name, I can change it again. Compared to this patch, my PR does not use files_search_pids() but directly read_lnk_files_pattern() like some other interfaces. I have no strong preferences regarding this. Thanks, Nicolas