All of lore.kernel.org
 help / color / mirror / Atom feed
From: nicolas.iooss@m4x.org (Nicolas Iooss)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [PATCH] another first systemd patch
Date: Sun, 19 Feb 2017 22:38:33 +0100	[thread overview]
Message-ID: <CAJfZ7==cmWTypA5+9wRX5N4mHB-YAVTttm-H3pg6Ch4JDpOkiQ@mail.gmail.com> (raw)
In-Reply-To: <20170219114926.ji3zbisfqbhy7lk5@athena.coker.com.au>

On Sun, Feb 19, 2017 at 12:49 PM, Russell Coker via refpolicy <
refpolicy@oss.tresys.com> wrote:

> Here's another first patch for systemd support.  I split out the misc patch
> and parts of what became the dpkg patch as well as a heap of other stuff
> that
> will be in a later patch.
>
> This patch has all the interfaces needed to build and no excess interfaces.
>
> It starts with allowing a dynamic transition from kernel_t which is
> something
> that systemd likes to do.  It has lots of changes for init_t which are
> needed
> by systemd which does a lot more than the old SysV init.
>
> It probably also has some init_t and initrc_t changes that aren't specific
> to
> systemd.  As I only use systemd I don't know exactly what is required
> without
> it nowadays.
>
> The file contexts have a few non-systemd changes that were in the same
> patch,
> while I'm aiming to just have systemd stuff sometimes it seems easier to
> put
> a few little things in than to split them out.
>
> There are significant changes to syslogd_t because we have systemd-journald
> running in that domain and it does a lot more.
>
> There are some changes to userdomain policy to interact with systemd.  The
> way systemd manages logins requires a lot more interaction with various
> daemons.
>
> There's a minor change to the lvm related policy due to having a systemd
> process using that domain.  lvm_t isn't an ideal name any more, but that's
> an
> issue to discuss later.
>
> For the main systemd policy I only added some extra type definitions and
> the
> policy for systemd_backlight_t.  I added policy for systemd_backlight_t
> instead of any of the other systemd domains because I have the policy
> file in alphabetical order and I didn't want to make a huge patch.  There
> is more to come in future patches.  ;)
>
> [...]

> @@ -140,29 +176,33 @@ dontaudit systemd_log_parse_env_type sel
>  kernel_read_system_state(systemd_log_parse_env_type)
>
>  dev_write_kmsg(systemd_log_parse_env_type)
> -
> -term_use_console(systemd_log_parse_env_type)
> -
>  init_read_state(systemd_log_parse_env_type)
> -
>  logging_send_syslog_msg(systemd_log_parse_env_type)
> +term_use_console(systemd_log_parse_env_type)
>
>  ######################################
>  #
>  # Backlight local policy
>  #
>
> +allow systemd_backlight_t self:unix_dgram_socket { connect
> connected_socket_perms };
> +
>  allow systemd_backlight_t systemd_backlight_var_lib_t:dir
> manage_dir_perms;
> -init_var_lib_filetrans(systemd_backlight_t, systemd_backlight_var_lib_t,
> dir)
>  manage_files_pattern(systemd_backlight_t, systemd_backlight_var_lib_t,
> systemd_backlight_var_lib_t)
> -
>  systemd_log_parse_environment(systemd_backlight_t)
>
> +kernel_read_system_state(systemd_backlight_t)
> +
>  # Allow systemd-backlight to write to /sys/class/backlight/*/brightness
>  dev_rw_sysfs(systemd_backlight_t)
> -
> +dev_write_kmsg(systemd_backlight_t)
> +# for udev.conf
>  files_read_etc_files(systemd_backlight_t)
>
> +init_read_state(systemd_backlight_t)
> +init_var_lib_filetrans(systemd_backlight_t, systemd_backlight_var_lib_t,
> dir)
> +logging_send_syslog_msg(systemd_backlight_t)
> +# for /run/udev/data/+backlight*
>  udev_read_pid_files(systemd_backlight_t)
>

Why are init_read_state(systemd_backlight_t),
logging_send_syslog_msg(systemd_backlight_t)...
needed with systemd_log_parse_environment(systemd_backlight_t)? The
accesses these calls provide should already be handled by attribute
systemd_log_parse_env_type, right above in systemd.te.

Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.tresys.com/pipermail/refpolicy/attachments/20170219/e1421379/attachment-0001.html 

  reply	other threads:[~2017-02-19 21:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-19 11:49 [refpolicy] [PATCH] another first systemd patch Russell Coker
2017-02-19 21:38 ` Nicolas Iooss [this message]
2017-02-20  5:21   ` Russell Coker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJfZ7==cmWTypA5+9wRX5N4mHB-YAVTttm-H3pg6Ch4JDpOkiQ@mail.gmail.com' \
    --to=nicolas.iooss@m4x.org \
    --cc=refpolicy@oss.tresys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.