Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modif: keep /sys/module/nvidia* if prop driver and no no3d #6387

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions etc/profile-m-z/noprofile.profile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

noblacklist /sys/fs
noblacklist /sys/module
nowhitelist /sys/module/nvidia*
ignore read-only /sys/module/nvidia*

allow-debuggers
allusers
Expand Down
14 changes: 12 additions & 2 deletions src/firejail/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,10 +743,20 @@ void fs_proc_sys_dev_boot(void) {

disable_file(BLACKLIST_FILE, "/sys/firmware");
disable_file(BLACKLIST_FILE, "/sys/hypervisor");
{ // allow user access to some directories in /sys/ by specifying 'noblacklist' option
profile_add("blacklist /sys/fs");

// Soft-block some paths in /sys/ (can be undone in profiles).
profile_add("blacklist /sys/fs");

// Hardware acceleration with the nvidia proprietary driver may fail
// without access to these paths (see #6372).
if (access("/dev/nvidiactl", R_OK) == 0 && arg_no3d == 0) {
profile_add("whitelist /sys/module/nvidia*");
profile_add("read-only /sys/module/nvidia*");
}
else {
profile_add("blacklist /sys/module");
}

disable_file(BLACKLIST_FILE, "/sys/power");
disable_file(BLACKLIST_FILE, "/sys/kernel/debug");
disable_file(BLACKLIST_FILE, "/sys/kernel/vmcoreinfo");
Expand Down