Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 601854 - >linux-4.8: kmod requires CAP_SYS_ADMIN for loading graphics drivers
Summary: >linux-4.8: kmod requires CAP_SYS_ADMIN for loading graphics drivers
Status: RESOLVED UPSTREAM
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: 2016-12-06 20:31 UTC by Mira Ressel
Modified: 2017-01-14 12:20 UTC (History)
0 users

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 Mira Ressel 2016-12-06 20:31:18 UTC
Since I've upgraded to linux-4.8, kmod requires 'allow kmod_t self:capability sys_admin;' to load graphics drivers. I've reproduced this issue with the i915 and radeon modules; it occurs with hardened-sources-4.8.10 as well as with vanilla-sources-4.8.11 (so it's _not_ grsec-related, contrary to earlier assumptions).

Without this permission, the module is loaded, but the screen stays in VGA mode and dmesg reports

    [drm:ffffffff81497d70] *ERROR* Cannot mount pseudo fs: -1
    [drm:ffffffff81497d92] *ERROR* Cannot allocate anonymous inode: -1

and some additional driver-specific errors. Apparently, these errors are caused by the drm_fs_inode_new() call in drm_dev_init() (in drivers/gpu/drm/drm_drv.c) returning -EPERM. I've followed the call chain a few levels down, but so far, I haven't found the source of the -EPERM.

By the way, I don't get why this module initialisation code seems to be running in the kmod_t domain. Might this perhaps be the real source of the bug?

Interestingly, both Guido Trentalancia and Nicolas Iooss have been unable to reproduce this problem.
Comment 1 Mira Ressel 2017-01-14 12:20:43 UTC
As I've explained on the refpolicy mailing list, this is a kernel bug. A patch can be found at [1]; it will be included in one of the next kernel releases. Since I seem to be the only affected gentoo user, I'll just close this bug.

[1] http://www.spinics.net/lists/linux-fsdevel/msg105940.html