Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 922517 - sec-policy/selinux-zfs: missing allow rule on zfs compatibility file
Summary: sec-policy/selinux-zfs: missing allow rule on zfs compatibility file
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: SELinux (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: SE Linux Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-20 01:39 UTC by Marc Schiffbauer
Modified: 2024-01-20 16:22 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Schiffbauer gentoo-dev 2024-01-20 01:39:34 UTC
If you have set a compatibility property on a zfs pool, it needs read access to the configured compatibilty file like:

# ls -lZ /usr/share/zfs/compatibility.d/openzfs-2.2-linux /usr/share/zfs/compatibility.d/openzfs-2.2
-rw-r--r--. 1 root root system_u:object_r:usr_t 584 Jan 11 03:05 /usr/share/zfs/compatibility.d/openzfs-2.2
lrwxrwxrwx. 1 root root system_u:object_r:usr_t  11 Jan 11 03:05 /usr/share/zfs/compatibility.d/openzfs-2.2-linux -> openzfs-2.2

This fixed it for me (requires reading symlinks and mmapping regular files):

gen_require(`
        type zfs_t;
        type usr_t;
')

# for reading compatibility file
read_lnk_files_pattern(zfs_t,usr_t,usr_t)
mmap_read_files_pattern(zfs_t,usr_t,usr_t)