Bug 1354731 - Quietly fail mknod of character devices in content sandbox. r?gcp
MozReview-Commit-ID: 2aehI5V7tQp
--- a/security/sandbox/linux/SandboxFilter.cpp
+++ b/security/sandbox/linux/SandboxFilter.cpp
@@ -650,18 +650,25 @@ public:
// using them, if they need to be, and what we intend to about it.
case __NR_getcwd:
CASES_FOR_statfs:
CASES_FOR_fstatfs:
case __NR_quotactl:
CASES_FOR_fchown:
case __NR_fchmod:
case __NR_flock:
+ return Allow();
+
+ // Bug 1354731: proprietary GL drivers try to mknod() their devices
+ case __NR_mknod: {
+ Arg<mode_t> mode(1);
+ return If((mode & S_IFMT) == S_IFCHR, Error(EPERM))
+ .Else(InvalidSyscall());
+ }
#endif
- return Allow();
case __NR_readlinkat:
#ifdef DESKTOP
// Bug 1290896
return Allow();
#else
// Workaround for bug 964455:
return Error(EINVAL);