Commit Graph

4617 Commits

Author SHA1 Message Date
Chris PeBenito b333a7a1f8 filesystem: Rename fs_relabel_cgroup_lnk_files. 2017-12-02 16:19:07 -05:00
Krzysztof Nowicki 9b8c2d5393 Allow systemd to relabel cgroupfs legacy symlinks
The cgroup directory under /sys/fs/cgroup contains a number of
pseudo-filesystems for each cgroup as well as two symbolic links for the
cpu and cpuacct groups, which were legacy symbolic links to the
cpu,cpuacct group.

These rules allow systemd to relabel these symbolic links from tmpfs_t
to their proper context, or otherwise denials will be printed for nearly
all systemd operation involving cgroups.

This change only grants systemd the possibility to relabel the
files. The actual relabelling needs to be done by systemd. The
accompanying change (commit 8739f23) will be released with systemd v236.
2017-12-01 18:48:26 -05:00
Chris PeBenito 0553569445 networkmanager: Grant access to unlabeled PKeys 2017-11-28 20:46:26 -05:00
Chris PeBenito 1c503e140c loadable_module.spt: Add debugging comments for tunable_policy blocks. 2017-11-28 20:22:59 -05:00
Chris PeBenito f522bc0b75 dmesg, locallogin, modutils: Module version bump. 2017-11-18 07:32:37 -05:00
Luis Ressel d5d8590e51 modutils: Dontaudit CAP_SYS_ADMIN checks for modprobe
The ttm module, a dependency of radeon/amdgpu, does some
capable(CAP_SYS_ADMIN) checks. Changes in 4.13 have caused some of these
checks to be executed during module initialization, in the context of
modprobe, which fills the audit logs with a lot of denials.

Since failing these capable() checks is not an issue (they merely
control the access to emergency memory reserves, which shouldn't be an
issue during boot), I'm dontauditing them.

One potential issue with this is that if a module that actually needs
CAP_SYS_ADMIN during initialization comes along later, the dontaudit is
going to make the debugging a bit more annoying. Is anyone concerned
about this?
2017-11-18 05:53:50 -05:00
Luis Ressel 96c917b41a dmesg: Grant read access to /usr/share/terminfo
To determine whether the $TERM supports colored output, dmesg checks the
terminfo database, which can be either in /etc or /usr/share.
2017-11-18 05:53:50 -05:00
Luis Ressel ec9999a499 locallogin: Grant local_login_t the dac_read_search capability
It already has dac_override, and depending on the pam modules being
used, this may actually be neccessary. Due to the 4.13 changes, I'm now
getting dac_read_search denials.
2017-11-18 05:53:50 -05:00
Chris PeBenito 3f6d37aec9 Module version bumps. 2017-11-14 18:33:06 -05:00
Luis Ressel 87b7360837 xserver: Allow xdm_t to map usr_t files
This is required for gtk-based login managers to access gtk's icon
cache. IIRC, past discussion on the ML came to the conclusion that
adding a new domain for this would be overkill.
2017-11-14 18:32:46 -05:00
Luis Ressel d23a97ff9c libraries: Add fc entry for musl's ld.so config 2017-11-14 18:32:46 -05:00
Chris PeBenito 523dbe2845 Several module version bumps. 2017-11-09 20:36:54 -05:00
Guido Trentalancia cc91fed88d base: create a type for SSL private keys
Reserve the tls_privkey_t file label for SSL/TLS private keys (e.g.
files in /etc/pki/*/private/).

Create and use appropriate interfaces for such new scenario (so
that SSL/TLS private keys are protected).

This part (1/2) refers to the base policy changes.

Signed-off-by: Guido Trentalancia <guido@trentalancia.com>
2017-11-09 17:28:26 -05:00
Chris PeBenito 2037c8f294 kernel, mls, sysadm, ssh, xserver, authlogin, locallogin, userdomain: Module version bumps. 2017-11-04 14:16:20 -04:00
Jason Zaman 9adc6c5ddb gssproxy: Allow others to stream connect
kernel AVC:
 * Starting gssproxy ...
Failed to write to /proc/net/rpc/use-gss-proxy: 13 (Permission denied)
 * start-stop-daemon: failed to start `gssproxy'

type=AVC msg=audit(1490858215.578:386110): avc:  denied  { connectto } for  pid=25447 comm="gssproxy" path="/run/gssproxy.sock" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:gssproxy_t:s0 tclass=unix_stream_socket permissive=0
2017-11-04 14:00:56 -04:00
Jason Zaman 6efe498a9b Add key interfaces and perms
Mostly taken from the fedora rawhide policy
2017-11-04 14:00:56 -04:00
Jason Zaman 09ae441706 mls mcs: Add constraints for key class
Taken from fedoras policy
https://github.com/fedora-selinux/selinux-policy/blob/rawhide-base/policy/mls
https://github.com/fedora-selinux/selinux-policy/blob/rawhide-base/policy/mcs
2017-11-04 14:00:56 -04:00
Chris PeBenito 5a73eaf64e files, userdomain: Module version bump. 2017-11-01 19:03:30 -04:00
Jason Zaman 7d8ee436d7 files: fcontext for /etc/zfs/zpool.cache 2017-11-01 18:59:17 -04:00
Jason Zaman d5f6a58a77 userdomain: allow admin to rw tape storage 2017-11-01 18:59:17 -04:00
Chris PeBenito 289be9e0b4 Update contrib. 2017-10-30 21:39:46 -04:00
Chris PeBenito 52b53077cd miscfiles: Module version bump. 2017-10-30 21:39:39 -04:00
Russell Coker d97a1cd3c8 refpolicy and certs
The following patch allows mon_t to set limits for it's children and removes
cert_t labelling from CA public keys (that aren't secret) so that processes
which only need to verify keys (EG https clients) don't need cert_t access.
2017-10-30 21:38:27 -04:00
Chris PeBenito d2e201495a files, netutils: Module version bump. 2017-10-25 17:21:31 -04:00
Luis Ressel via refpolicy 68690d8e62 netutils: Grant netutils_t map perms for the packet_socket class
This is required for the PACKET_RX_RING feature used by tcpdump.
2017-10-25 17:16:06 -04:00
Luis Ressel via refpolicy 75a5ebca75 kernel/files.if: files_list_kernel_modules should grant read perms for symlinks
files_search_kernel_modules also grant this; there's a couple of
symlinks in /lib/modules/.
2017-10-25 17:16:06 -04:00
Chris PeBenito 0bdd993c1c Update contrib. 2017-10-22 14:26:43 -04:00
Chris PeBenito 9f790ef731 Merge pull request #128 from williamcroberts/fc-sort-fixups
fc_sort: use calloc instead of malloc
2017-10-19 06:28:03 -04:00
William Roberts 65620e0f94 fc_sort: use calloc instead of malloc
Rather than using malloc to allocated nodes and setting all the fields,
just use calloc.

Signed-off-by: William Roberts <william.c.roberts@intel.com>
2017-10-18 19:26:36 -07:00
Chris PeBenito 1b405f4a90 files, init, sysnetwork, systemd: Module version bumps. 2017-10-12 18:48:29 -04:00
Chris PeBenito 6128c262bb Merge branch 'systemd-networkd'
# Conflicts:
#	policy/modules/system/init.te
2017-10-12 18:40:15 -04:00
David Sugar 4a54f9c1f0 policy for systemd-networkd
Policy needed for systemd-networkd to function.  This is based on a patch from krzysztof.a.nowicki at gmail.com that was submitted back in May (I talked to him via email a while ago about me picking up the patch).  He was too busy to update and I needed to get it working.

I am pretty sure I updated everything mentioned in previous feedback, please comment if something is still off and I will revise.

Signed-off-by: Dave Sugar <dsugar@tresys.com>
2017-10-12 18:38:54 -04:00
Chris PeBenito 2ec1c9b85c files: Whitespace fix. 2017-10-12 18:00:12 -04:00
David Sugar e7b4159ec5 Denial relabeling /run/systemd/private
I am seeing the following denial (in dmesg) during system startup:
[    4.623332] type=1400 audit(1507767947.042:3): avc:  denied  { relabelto } for  pid=1 comm="systemd" name="private" dev="tmpfs" ino=5865 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:init_var_run_t:s0 tclass=sock_file

It appears that systemd is attempting to relablel the socket file /run/systemd/private to init_var_run_t but doesn't have permission.

Updated to create new interface for relabeling of sock_files rather than adding to existing interface

Signed-off-by: Dave Sugar <dsugar@tresys.com>
2017-10-12 18:00:12 -04:00
Chris PeBenito 2fca8c8d95 init: Clean up line placement in init_systemd blocks.
No rule changes.
2017-10-12 17:42:23 -04:00
Chris PeBenito a89570282e Merge branch 'master' of git://github.com/aduskett/refpolicy 2017-10-11 18:50:58 -04:00
Chris PeBenito 3001c50364 ipsec: Module version bump. 2017-10-11 18:45:29 -04:00
Chris PeBenito 9456ab758a Merge branch 'master' of git://github.com/davidgraz/refpolicy 2017-10-11 18:44:39 -04:00
David Graziano 99aebc2af5 system/ipsec: Add signull access for strongSwan
Allows ipsec_supervisor_t domain to signull other
strongSwan domains.

Signed-off-by: David Graziano <david.graziano@rockwellcollins.com>
2017-10-11 08:17:51 -05:00
Chris PeBenito 2ae2b38e6d Module version bumps. 2017-10-10 20:32:43 -04:00
David Sugar 967ef00181 Fix problem labeling /run/log/journal/*
Fix the following denials I was seeing in dmesg from init_t (systemd) when attempting to relabel /run/log/journal/*

[    4.758398] type=1400 audit(1507601754.187:3): avc:  denied  { relabelto } for  pid=1 comm="systemd" name="log" dev="tmpfs" ino=1365 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=dir
[    4.758541] systemd[1]: Unable to fix SELinux security context of /run/log: Permission denied
[    4.758736] type=1400 audit(1507601754.187:4): avc:  denied  { relabelto } for  pid=1 comm="systemd" name="journal" dev="tmpfs" ino=7004 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:systemd_journal_t:s0 tclass=dir
[    4.758773] systemd[1]: Unable to fix SELinux security context of /run/log/journal: Permission denied
[    4.758928] type=1400 audit(1507601754.187:5): avc:  denied  { relabelto } for  pid=1 comm="systemd" name="791393fb4b8f4a59af4266b634b218e2" dev="tmpfs" ino=7005 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:systemd_journal_t:s0 tclass=dir
[    4.758960] systemd[1]: Unable to fix SELinux security context of /run/log/journal/791393fb4b8f4a59af4266b634b218e2: Permission denied
[    4.759144] type=1400 audit(1507601754.187:6): avc:  denied  { relabelto } for  pid=1 comm="systemd" name="system.journal" dev="tmpfs" ino=7006 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:systemd_journal_t:s0 tclass=file
[    4.759196] systemd[1]: Unable to fix SELinux security context of /run/log/journal/791393fb4b8f4a59af4266b634b218e2/system.journal: Permission denied

Signed-off-by: Dave Sugar <dsugar@tresys.com>
2017-10-10 20:24:18 -04:00
Adam Duskett 6c9cc47e6c fix regex escape sequence error.
python3.6 will error out with the message "invalid escape sequence"
in genhomedircon.py.  This patch fixes these errors by turning the string
in the into a raw string.
2017-10-10 18:00:30 -04:00
Chris PeBenito 570bfa8cbd devices: Module version bump. 2017-10-09 14:51:56 -04:00
Konrad Rzeszutek Wilk b5c8b1d77d kernel/xen: Add map permission to the dev_rw_xen
type=AVC msg=audit(1504637347.487:280): avc:  denied  { map } for  pid=857 comm="xenconsoled" path="/dev/xen/privcmd" dev="devtmpfs" ino=16289 scontext=system_u:system_r:xenconsoled_t:s0

Without this we can't use xenconsole (client) to
talk to xenconsoled (server).

Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
2017-10-09 13:57:47 -04:00
Konrad Rzeszutek Wilk c7d48c3bc2 kernel/xen: Update for Xen 4.6
libxenstored since git commit 9c89dc95201ffed5fead17b35754bf9440fdbdc0
prefers to use "/dev/xen/xenbus" over the "/proc/xen/xenbus".

Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
2017-10-09 13:57:47 -04:00
Guido Trentalancia 5490639ac9 fc_sort: memory leakages
Avoid memory leakages in the fc_sort executable (now passes
all valgrind AND Clang static analyzer tests fine).

Some NULL pointer checks with or without associated error
reporting.

Some white space and comment formatting fixes.

Optimization: avoid unnecessary operations (unnecessary
memory allocation/deallocation and list copying).

Reverts 7821eb6f37 as such
trick is no longer needed, given that all memory leakages
have now been fixed.

This is the sixth version of this patch. Please do not use
the first version as it introduces a serious bug.

For reference, the original issue reported by the Cland
static analyzer is as follows:

support/fc_sort.c:494:6: warning: Potential leak of memory
pointed to by 'head'
            malloc(sizeof(file_context_bucket_t));

Signed-off-by: Guido Trentalancia <guido@trentalancia.com>
Acked-by: William Roberts <william.c.roberts@intel.com>
2017-10-04 19:29:47 -04:00
Chris PeBenito 7821eb6f37 Merge pull request #125 from lalozano/master
Avoid memory leak warning.
2017-09-28 18:32:58 -04:00
Chris PeBenito f47c35d20c init: Module version bump. 2017-09-27 19:45:01 -04:00
David Sugar c1eac683fa remove interface init_inherit_rlimit
Update patch to remove init_inherit_rlimit interface and always grant this access for init_t domain (systemd or otherwise).  I hope ordering of the new rules is correct.

Signed-off-by: Dave Sugar <dsugar@tresys.com>
2017-09-27 19:37:19 -04:00
Chris PeBenito de13b68208 corecommands: Module version bump. 2017-09-23 14:36:56 -04:00