If you're using -static that's already overriding -pie, so you wouldn't need to pass -no-pie only -fno-PIE but I doubt it makes a difference. The cost would all be from SSP.
Sure, both SSP and PIE can be disabled. Only the defaults changed.
The only way I found to turn off pie was to copy the gcc -v output and rerun it manually without "-pie".
I doubt this has anything to do with PIE so you're wasting your time with that. SSP has a significant performance cost, PIE doesn't. Dynamic libraries already pay the entire cost of PIE for full PIC anyway. It only impacts executables and since x86_64 has hardware PIC support it doesn't make a substantial difference.
The Arch Linux makepkg CFLAGS added -fno-plt as a performance optimization to take advantage of -Wl,-z,now as a runtime performance optimization too and if you're just relying on toolchain defaults you're missing those changes.
SSP wasn't enabled by default before in GCC directly, only via CFLAGS / CXXFLAGS by makepkg, so that's probably it. I doubt it has anything to do with PIE.
The focus needs to be on adding features to linux-hardened. There aren't enough resources to have LTS versions. Contributors are needed simply to continue without an LTS.
SSP has a significant performance cost (i.e. 2-5%), but it was already enabled via CFLAGS.
PIE doesn't have a significant cost on x86_64 which has good position independent code support. It has no cost in dynamic libraries since they're already full blown position independent code and in executables the cost is much closer to 0% than 1%.
Note that -fstack-protector-strong was already enabled in the standard makepkg CFLAGS. Changing the default at the compiler level ends up using it even with build systems ignoring CFLAGS.
Auto-importing means you intrinsically trust any key
No, trust is separate from whether a key is in the keyring. Auto-importing a key doesn't give it any trust and neither does importing it manually. Importing every key that you need to work with is expected, regardless of whether you want to end up marking them as trusted. For makepkg, it doesn't use the trust level but rather relies on the validpgpkeys array.
I don't think it makes sense to run a hardened kernel without security updates... the replaces is there for a reason. If someone has access to the commercial patches, they can make their own package with a different name, but I seriously doubt that anyone is going to be using them on Arch Linux. PaX integration, etc. is also gone. The linux-hardened approach to those features isn't going to be compatible.
My understanding is that chrome/chromium doesn't doesn't actually support hardware acceleration in linux. It will lie and say it is enabled, but it will never actually use the hardware.
The code has support for it and it's used on ChromeOS but they don't include it in standard Linux builds. There's a process to enable it for Linux since it's available for testing / development, so it's possible to make a build with it.
Keys aren't trusted simply by importing them. You would need to set the trust as a separate step if you wanted to do that. Importing a bunch of keys is fine. For makepkg, Arch uses validpgpkeys to verify that the signature is from one of the expected keys. It's useful even if you aren't doing verification beyond what makepkg already does.
It will include a subset of grsecurity if the community takes over maintenance and takes it seriously. That means the people maintaining it need to stick to the subset that they understand so changes will need to be split out bit by bit. Porting the patches in their entirely to 4.10 is not an option, and I won't package such a thing because I know that no one is capable of taking over maintenance of the whole thing like that even if they manage to get a port to a few new kernel versions working. It would need to be done alongside the Kernel Self Protection Project, essentially carrying the changes that are rejected upstream or infeasible to land there in the near future.
It barely does anything right now. It's a placeholder for the linux-hardened package that I described. For now, it simply changes some of the configuration. If competent people end up taking over maintenance of a subset of grsecurity, it can apply those patches. For now, there's nothing to apply. I could do that myself if I had more time available but there's no way that I can take on more work.
No, it's not (yet) a replacement. It has 2% of the hardening that was available in grsecurity. It's a placeholder enabling more hardening options than core/linux and will adopt a PaX / grsecurity fork (or an alternative extracting certain portions) if a viable well-maintained project by people that know what they're doing appears. Until then, it's not going to do much. It's there so that there's a package ready for new patches to be applied.
I contribute in the sense that I try to participate in constructive discussion and try to steer things in the right direction. I don't intend to submit stuff upstream right now, but if I'll try to get them to take anything useful we make downstream. I got banned from the #grsecurity channel on irc.oftc.net for mentioning a few grsecurity features (in the public patches for anyone to read...) that are not explicitly documented like the slub free list XOR mangling which we've ported and expanded in CopperheadOS and the USERCOPY useroffset/usersize feature.
I submitted a proposal to use perf_event_paranoid=3 to AOSP which was merged but then when Google tried to get that into the mainline kernel it was rejected. It's required for all Android devices now regardless. It's a tiny feature though, so I'm not sure it counts. Similarly, I got them to disable AIO by default in the recommended Android kernel configuration, but that's just a 1 line standard Android configuration change.
It would be nice if our _FORTIFY_SOURCE=1 equivalent for the kernel's string.h was upstream and I can see that happening. I can't see any of the slub allocator tweaks landing since the upstream slab/slub maintainer hates that kind of stuff. The attempt to get proper slab sanitization upstream by others failed for that reason, but we just carry that downstream and it really doesn't matter since it's only a few lines of code.
The end of a full PaX port in CopperheadOS was the migration from arm to arm64. It does have PaX and grsecurity features via backports of KSPP work and code that we extracted / expanded from them ourselves. There's also the recent start of our own kernel hardening changes which is not much yet but it will expand over time. There's PAN emulation (UDEREF), HARDENED_USERCOPY and __ro_after_init from KSPP. There's our own minimal full slab / page sanitization (like PaX) and verification (beyond PaX, since our performance needs aren't as strict). There's also our marginally useful kernel implementation of _FORTIFY_SOURCE=1 for both buffer reads/writes, improvements to kmem_cache_free sanity checks (improving upon what PaX does) and there are random heap canaries (starting with a 0 byte) for the slub allocator which also provide basic double-free detection.
There are major PaX features that are still needed like RAP and SIZE_OVERFLOW, but since PaX doesn't offer support for arm64 anyway, we aren't directly losing anything from the patches becoming private. The loss will be lack of access to their future innovations and research along with potentially future support for arm64. It's bad news, but nothing surprising and there's zero short-term impact. Lots of long-term impact, but we were expecting this and it's far from a crisis.
This has no direct impact on CopperheadOS since PaX and grsecurity were never ported to arm64. Android also uses device-specific LTS kernels derived from the SoC platform kernels for the relevant SoC generation rather than following mainline.
Here's the set of commits CopperheadOS currently adds to the April 5th Pixel / Pixel kernel:
Anyway I disagree with your assertion that MAC is not particularly useful if the kernel isn't significantly hardened. MAC doesn't stop kernel level exploits, that's true, but it stops exploits in user space programs. It is like saying all this security is not particularly useful unless you have home security because someone can just break in and steal your computer. Just because one feature doesn't protect against every attack vector doesn't mean it's not useful.
MAC primarily contains userspace programs after they're exploited. A kernel exploit bypasses that containment. Local privilege escalations vulnerabilities in the kernel are quite common.
Remote code execution vulnerabilities are the most common on clients rather than issues like path traversal where MAC can potentially contain a vulnerability without relying on kernel security.
There are also ways to do containment/sandboxing than MAC. It's unlikely that Arch is ever going to have great full system MAC policies reducing privileges further and further over time with no uncontained processes like Android. Android has a well-defined base system and devices provide policy extensions to cover what their drivers and other hardware-specific needs require. It's so much harder to do a good job when the base system is not well-defined, i.e. the user is the system administrator and assembles it from arbitrary packages and configuration. It's only realistic to have targeted MAC policy like Fedora but it's not even going to be able to cover as much as it does there. It's also not possible to contain GUI programs solely with kernel MAC, which is the main use case on a desktop/laptop where Arch is most commonly used. The reality is that we don't have people doing substantial work on this stuff, so it's not happening even to a small extent.
grsecurity provides a LOT more than a MAC implementation. It primarily provides kernel self-protection. Any access control can be bypassed by a single kernel exploit, so an LSM without grsecurity isn't a strong protection.
If you're using
-staticthat's already overriding-pie, so you wouldn't need to pass-no-pieonly-fno-PIEbut I doubt it makes a difference. The cost would all be from SSP.Sure, both SSP and PIE can be disabled. Only the defaults changed.
I doubt this has anything to do with PIE so you're wasting your time with that. SSP has a significant performance cost, PIE doesn't. Dynamic libraries already pay the entire cost of PIE for full PIC anyway. It only impacts executables and since x86_64 has hardware PIC support it doesn't make a substantial difference.
The Arch Linux makepkg CFLAGS added
-fno-pltas a performance optimization to take advantage of-Wl,-z,nowas a runtime performance optimization too and if you're just relying on toolchain defaults you're missing those changes.SSP wasn't enabled by default before in GCC directly, only via CFLAGS / CXXFLAGS by makepkg, so that's probably it. I doubt it has anything to do with PIE.
On x86_64 or i686? i686 is certainly going to be a lot slower but it's being dropped.
It uses the Chromium Embedded Framework which is close enough. The steam Store, Community, etc. all run in the embedded Chromium.
The focus needs to be on adding features to linux-hardened. There aren't enough resources to have LTS versions. Contributors are needed simply to continue without an LTS.
The post has both as links to the Gentoo wiki documentation on them.
SSP has a significant performance cost (i.e. 2-5%), but it was already enabled via CFLAGS.
PIE doesn't have a significant cost on x86_64 which has good position independent code support. It has no cost in dynamic libraries since they're already full blown position independent code and in executables the cost is much closer to 0% than 1%.
Ubuntu 16.10 is 10 years ago? https://wiki.ubuntu.com/SecurityTeam/PIE
Arch already had SSP enabled by default for packages before this. I think you're misunderstanding the change.
Out of all the Mandatory Access Control choices, why would Arch adopt AppArmor?
Note that -fstack-protector-strong was already enabled in the standard makepkg CFLAGS. Changing the default at the compiler level ends up using it even with build systems ignoring CFLAGS.
No, trust is separate from whether a key is in the keyring. Auto-importing a key doesn't give it any trust and neither does importing it manually. Importing every key that you need to work with is expected, regardless of whether you want to end up marking them as trusted. For makepkg, it doesn't use the trust level but rather relies on the
validpgpkeysarray.No one needs to figure out a way of breaking out of it, there's no boundary provided. It's possible to just make a Linux system call from it.
Nope, there are only private commercial patches so there wasn't any way to continue a linux-grsec package for Arch.
I don't think it makes sense to run a hardened kernel without security updates... the
replacesis there for a reason. If someone has access to the commercial patches, they can make their own package with a different name, but I seriously doubt that anyone is going to be using them on Arch Linux. PaX integration, etc. is also gone. The linux-hardened approach to those features isn't going to be compatible.The code has support for it and it's used on ChromeOS but they don't include it in standard Linux builds. There's a process to enable it for Linux since it's available for testing / development, so it's possible to make a build with it.
No, you would need to build it with the incompatible options disabled (CONFIG_SLAB_SANITIZE_VERIFY, CONFIG_SANITIZE_PAGE_VERIFY).
Keys aren't trusted simply by importing them. You would need to set the trust as a separate step if you wanted to do that. Importing a bunch of keys is fine. For makepkg, Arch uses
validpgpkeysto verify that the signature is from one of the expected keys. It's useful even if you aren't doing verification beyond what makepkg already does.It will include a subset of grsecurity if the community takes over maintenance and takes it seriously. That means the people maintaining it need to stick to the subset that they understand so changes will need to be split out bit by bit. Porting the patches in their entirely to 4.10 is not an option, and I won't package such a thing because I know that no one is capable of taking over maintenance of the whole thing like that even if they manage to get a port to a few new kernel versions working. It would need to be done alongside the Kernel Self Protection Project, essentially carrying the changes that are rejected upstream or infeasible to land there in the near future.
It barely does anything right now. It's a placeholder for the linux-hardened package that I described. For now, it simply changes some of the configuration. If competent people end up taking over maintenance of a subset of grsecurity, it can apply those patches. For now, there's nothing to apply. I could do that myself if I had more time available but there's no way that I can take on more work.
No, it's not (yet) a replacement. It has 2% of the hardening that was available in grsecurity. It's a placeholder enabling more hardening options than core/linux and will adopt a PaX / grsecurity fork (or an alternative extracting certain portions) if a viable well-maintained project by people that know what they're doing appears. Until then, it's not going to do much. It's there so that there's a package ready for new patches to be applied.
-- Daniel Micay
I contribute in the sense that I try to participate in constructive discussion and try to steer things in the right direction. I don't intend to submit stuff upstream right now, but if I'll try to get them to take anything useful we make downstream. I got banned from the #grsecurity channel on irc.oftc.net for mentioning a few grsecurity features (in the public patches for anyone to read...) that are not explicitly documented like the slub free list XOR mangling which we've ported and expanded in CopperheadOS and the USERCOPY useroffset/usersize feature.
I submitted a proposal to use perf_event_paranoid=3 to AOSP which was merged but then when Google tried to get that into the mainline kernel it was rejected. It's required for all Android devices now regardless. It's a tiny feature though, so I'm not sure it counts. Similarly, I got them to disable AIO by default in the recommended Android kernel configuration, but that's just a 1 line standard Android configuration change.
It would be nice if our
_FORTIFY_SOURCE=1equivalent for the kernel's string.h was upstream and I can see that happening. I can't see any of the slub allocator tweaks landing since the upstream slab/slub maintainer hates that kind of stuff. The attempt to get proper slab sanitization upstream by others failed for that reason, but we just carry that downstream and it really doesn't matter since it's only a few lines of code.The end of a full PaX port in CopperheadOS was the migration from arm to arm64. It does have PaX and grsecurity features via backports of KSPP work and code that we extracted / expanded from them ourselves. There's also the recent start of our own kernel hardening changes which is not much yet but it will expand over time. There's PAN emulation (UDEREF), HARDENED_USERCOPY and __ro_after_init from KSPP. There's our own minimal full slab / page sanitization (like PaX) and verification (beyond PaX, since our performance needs aren't as strict). There's also our marginally useful kernel implementation of
_FORTIFY_SOURCE=1for both buffer reads/writes, improvements tokmem_cache_freesanity checks (improving upon what PaX does) and there are random heap canaries (starting with a 0 byte) for the slub allocator which also provide basic double-free detection.There are major PaX features that are still needed like RAP and SIZE_OVERFLOW, but since PaX doesn't offer support for arm64 anyway, we aren't directly losing anything from the patches becoming private. The loss will be lack of access to their future innovations and research along with potentially future support for arm64. It's bad news, but nothing surprising and there's zero short-term impact. Lots of long-term impact, but we were expecting this and it's far from a crisis.
This has no direct impact on CopperheadOS since PaX and grsecurity were never ported to arm64. Android also uses device-specific LTS kernels derived from the SoC platform kernels for the relevant SoC generation rather than following mainline.
Here's the set of commits CopperheadOS currently adds to the April 5th Pixel / Pixel kernel:
https://gist.githubusercontent.com/thestinger/566238d5bfaea30fc7358d2224058dd7/raw/93a73e649b00dfb00b5115c2289844aeb4629730/gistfile1.txt
MAC primarily contains userspace programs after they're exploited. A kernel exploit bypasses that containment. Local privilege escalations vulnerabilities in the kernel are quite common.
Remote code execution vulnerabilities are the most common on clients rather than issues like path traversal where MAC can potentially contain a vulnerability without relying on kernel security.
There are also ways to do containment/sandboxing than MAC. It's unlikely that Arch is ever going to have great full system MAC policies reducing privileges further and further over time with no uncontained processes like Android. Android has a well-defined base system and devices provide policy extensions to cover what their drivers and other hardware-specific needs require. It's so much harder to do a good job when the base system is not well-defined, i.e. the user is the system administrator and assembles it from arbitrary packages and configuration. It's only realistic to have targeted MAC policy like Fedora but it's not even going to be able to cover as much as it does there. It's also not possible to contain GUI programs solely with kernel MAC, which is the main use case on a desktop/laptop where Arch is most commonly used. The reality is that we don't have people doing substantial work on this stuff, so it's not happening even to a small extent.
grsecurity provides a LOT more than a MAC implementation. It primarily provides kernel self-protection. Any access control can be bypassed by a single kernel exploit, so an LSM without grsecurity isn't a strong protection.