mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1712] Intel/AMD CPU security flaws #1157
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#1157
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nick75e on GitHub (Jan 4, 2018).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1712
Hi,
It's been recently found out that Intel and AMD CPUs are affected by security flaws: Meltdown and Spectre.
More information: Google's Projet Zero, Arstechnica and dedicated website.
It's planned to patch v4.15 of the kernel and backport it to v4.14.11. There's no information as to whether it'll be backported to earlier versions. So in the meantime, is there a way Firejail can mitigate (or fix) this problem with an option like a seccomp filter or anything ?
Happy New Year!
@topimiettinen commented on GitHub (Jan 4, 2018):
Seccomp works by blocking system calls and the CPU flaws are not using system call interface but more primitive memory access and branch operations. I don't see how seccomp could be used here directly. The other protections like blacklisting files, dropping capabilities, private network namespaces, firewalls and so forth are also way too high level. It's also not possible to protect kernel memory on behalf of kernel by a user process.
The attacks seem to rely on access to precision time like processor Time Stamp Counter (TSC). We could add an option to disable TSC by Firejail with
prctl(PR_SET_TSC, PR_TSC_SIGSEGV). I don't know if that would break something else. There are still less precise methods to get time likegettimeofday()system call. Blocking those with seccomp would be possible but it could break normal uses.@topimiettinen commented on GitHub (Jan 4, 2018):
I made a small program to test disabling TSC:
Before any main part of /bin/ls even starts, the dynamic loader crashes due to rdtsc instruction which uses TSC. So, disabling TSC does not look promising.
@SkewedZeppelin commented on GitHub (Jan 4, 2018):
To patch against Meltdown (Intel only), please update your kernel to 4.14.11. 4.14.11 is currently available in Arch and Fedora repos. Verify that PTI is enabled by checking if /proc/cpu contains "bugs: cpu_insecure".
To mitigate against Spectre (Basically all processors)
Edit: Please see the table here for details about mitigation
@SkewedZeppelin commented on GitHub (Jan 4, 2018):
@topimiettinen what about a LD_PRELOAD shim that fuzzes the result of calls to TSC?
@topimiettinen commented on GitHub (Jan 4, 2018):
@SpotComms do you have pointers on how these browser flags work?
The attacking program would probably hardcode the RDTSC machine instruction, so how could it be fuzzed?
@SkewedZeppelin commented on GitHub (Jan 4, 2018):
@topimiettinen I added links about that. But tl;dr Chrome puts each site in its own process so malicious JS on one page can't perform the attack and get access to another processes memory. And for Firefox disabling SharedArrayBuffers makes the attack much harder to perform.
@topimiettinen commented on GitHub (Jan 4, 2018):
@SpotComms thanks. I suppose SharedArrayBuffers is disabled so that worker threads can't be used as simple counters which would give access to good enough time, rather than memory protection (which can be bypassed by the CPU bug).
The example implementation in Spectre paper constructs large, executable memory areas for branch predictor mistraining. This could be stopped by memory-deny-write-execute. But maybe that's only an example and there are other ways. Especially browsers need JIT which does not work with memory-deny-write-execute enabled in any case.
@nick75e commented on GitHub (Jan 5, 2018):
Thanks for all the information guys.
Since I'm on Linux Mint 18.3 (based on Ubuntu 16.04), I can only hope that the fix is backported to earlier versions or that Ubuntu decides to make v4.15 or v4.14.11 available.
Fingers crossed.
Note: uBlock origin's developer @gorhill released uMatrix v1.2.0 which can enable and disable web workers on a per-site basis.
@SkewedZeppelin commented on GitHub (Jan 5, 2018):
@nick75e KPTI has been backported and is available in 4.14.11, 4.9.75, and 4.4.110 as well as 4.15 itself. But as detailed here, that only solves 1/3 of the problem.