selinux-refpolicy/policy/modules/system
Nicolas Iooss b3119f1d17
modutils: allow depmod to read /boot/System.map
On a Debian system, when installing a package which provides a kernel
module with DKMS, the module is compiled and depmod is executed with a
command line that looks like:

    depmod -a 4.19.0-5-amd64 -F /boot/System.map-4.19.0-5-amd64

This obviously requires depmod to read System.map. Otherwise, the
following events are logged to audit.log:

    type=AVC msg=audit(1567802614.408:138551): avc:  denied  { search }
    for  pid=12090 comm="depmod" name="boot" dev="vda1" ino=262145
    scontext=sysadm_u:sysadm_r:kmod_t tcontext=system_u:object_r:boot_t
    tclass=dir permissive=0

    type=AVC msg=audit(1567802670.132:138555): avc:  denied  { read }
    for  pid=14210 comm="depmod" name="System.map-4.19.0-5-amd64"
    dev="vda1" ino=262148 scontext=sysadm_u:sysadm_r:kmod_t
    tcontext=system_u:object_r:system_map_t tclass=file permissive=1

    type=AVC msg=audit(1567802670.132:138555): avc:  denied  { open }
    for  pid=14210 comm="depmod" path="/boot/System.map-4.19.0-5-amd64"
    dev="vda1" ino=262148 scontext=sysadm_u:sysadm_r:kmod_t
    tcontext=system_u:object_r:system_map_t tclass=file permissive=1

    type=AVC msg=audit(1567802670.136:138556): avc:  denied  { getattr }
    for  pid=14210 comm="depmod" path="/boot/System.map-4.19.0-5-amd64"
    dev="vda1" ino=262148 scontext=sysadm_u:sysadm_r:kmod_t
    tcontext=system_u:object_r:system_map_t tclass=file permissive=1

and depmod fails, which makes apt fails with:

    wireguard.ko:
    Running module version sanity check.
     - Original module
       - No original module exists within this kernel
     - Installation
       - Installing to /lib/modules/4.19.0-5-amd64/updates/dkms/

    depmod...(bad exit status: 1)

    [...]

    Error! Problems with depmod detected.  Automatically uninstalling
    this module.
    DKMS: Install Failed (depmod problems).  Module rolled back to built
    state.
    dpkg: error processing package wireguard-dkms (--configure):
     installed wireguard-dkms package post-installation script
    subprocess returned error exit status 6

    [...]

    Errors were encountered while processing:
     wireguard-dkms
    E: Sub-process /usr/bin/dpkg returned an error code (1)

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2019-09-06 23:03:19 +02:00
..
application.fc
application.if
application.te
authlogin.fc Allow Debian to generate a dynamic motd when users log in 2019-09-01 13:44:28 +02:00
authlogin.if Allow Debian to generate a dynamic motd when users log in 2019-09-01 13:44:28 +02:00
authlogin.te various: Module version bump. 2019-09-03 19:47:12 -04:00
clock.fc
clock.if
clock.te
daemontools.fc
daemontools.if
daemontools.te
fstools.fc
fstools.if
fstools.te Bump module versions for release. 2019-02-01 15:03:42 -05:00
getty.fc
getty.if
getty.te
hostname.fc
hostname.if
hostname.te
hotplug.fc
hotplug.if
hotplug.te
init.fc Allow Debian to generate a dynamic motd when users log in 2019-09-01 13:44:28 +02:00
init.if init: Add systemd block to init_script_domain(). 2019-05-31 08:57:17 -04:00
init.te various: Module version bump. 2019-09-03 19:47:12 -04:00
ipsec.fc Merge pull request #70 from fishilico/typo-dot-star-question-fc 2019-08-31 06:26:00 -04:00
ipsec.if
ipsec.te Various: Module version bump. 2019-08-31 06:55:57 -04:00
iptables.fc
iptables.if Add interface to start/stop iptables service 2019-01-12 14:32:00 -05:00
iptables.te Bump module versions for release. 2019-02-01 15:03:42 -05:00
iscsi.fc
iscsi.if
iscsi.te Bump module versions for release. 2019-02-01 15:03:42 -05:00
libraries.fc libraries: fix some misspellings in patterns 2019-09-01 15:47:57 +02:00
libraries.if
libraries.te various: Module version bump. 2019-09-03 19:47:12 -04:00
locallogin.fc
locallogin.if
locallogin.te various: Module version bump. 2019-09-03 19:47:12 -04:00
logging.fc Remove unescaped single dot from the policy 2019-08-27 23:38:09 +02:00
logging.if Add kernel_dgram_send() into logging_send_syslog_msg() 2019-04-16 20:51:55 -04:00
logging.te Various: Module version bump. 2019-08-31 06:55:57 -04:00
lvm.fc
lvm.if
lvm.te Bump module versions for release. 2019-06-09 14:05:19 -04:00
metadata.xml
miscfiles.fc Remove unescaped single dot from the policy 2019-08-27 23:38:09 +02:00
miscfiles.if New interface to dontaudit access to cert_t 2019-02-20 19:28:45 -08:00
miscfiles.te Various: Module version bump. 2019-08-31 06:55:57 -04:00
modutils.fc Remove unescaped single dot from the policy 2019-08-27 23:38:09 +02:00
modutils.if
modutils.te modutils: allow depmod to read /boot/System.map 2019-09-06 23:03:19 +02:00
mount.fc
mount.if systemd: Add initial policy for systemd --user. 2019-04-25 11:18:58 -04:00
mount.te Bump module versions for release. 2019-06-09 14:05:19 -04:00
netlabel.fc
netlabel.if
netlabel.te
pcmcia.fc
pcmcia.if
pcmcia.te
raid.fc
raid.if misc interfaces 2019-01-05 13:36:20 -05:00
raid.te Bump module versions for release. 2019-02-01 15:03:42 -05:00
selinuxutil.fc
selinuxutil.if
selinuxutil.te Bump module versions for release. 2019-06-09 14:05:19 -04:00
setrans.fc
setrans.if
setrans.te Bump module versions for release. 2019-02-01 15:03:42 -05:00
sysnetwork.fc Modify type for /etc/hostname 2019-01-16 18:13:41 -05:00
sysnetwork.if sysnetwork: Move optional block in sysnet_dns_name_resolve(). 2019-01-05 13:42:11 -05:00
sysnetwork.te Bump module versions for release. 2019-02-01 15:03:42 -05:00
systemd.fc Update systemd-update-done policy 2019-02-24 11:08:20 +01:00
systemd.if systemd: introduce an interface for services using PrivateDevices=yes 2019-08-29 20:05:29 +02:00
systemd.te various: Module version bump. 2019-09-03 19:47:12 -04:00
udev.fc Remove unescaped single dot from the policy 2019-08-27 23:38:09 +02:00
udev.if Separate out udevadm into a new domain 2019-03-17 16:15:21 -04:00
udev.te Various: Module version bump. 2019-08-31 06:55:57 -04:00
unconfined.fc
unconfined.if systemd: Add initial policy for systemd --user. 2019-04-25 11:18:58 -04:00
unconfined.te Bump module versions for release. 2019-06-09 14:05:19 -04:00
userdomain.fc
userdomain.if systemd: Add initial policy for systemd --user. 2019-04-25 11:18:58 -04:00
userdomain.te Bump module versions for release. 2019-06-09 14:05:19 -04:00
xdg.fc
xdg.if
xdg.te
xen.fc
xen.if
xen.te