{"id":1018,"date":"2017-05-02T14:17:25","date_gmt":"2017-05-02T21:17:25","guid":{"rendered":"https:\/\/outflux.net\/blog\/?p=1018"},"modified":"2017-07-10T01:25:32","modified_gmt":"2017-07-10T08:25:32","slug":"security-things-in-linux-v4-11","status":"publish","type":"post","link":"https:\/\/outflux.net\/blog\/archives\/2017\/05\/02\/security-things-in-linux-v4-11\/","title":{"rendered":"security things in Linux v4.11"},"content":{"rendered":"<p>Previously: <a href=\"\/blog\/archives\/2017\/02\/27\/security-things-in-linux-v4-10\/\">v4.10<\/a>.<\/p>\n<p>Here\u2019s a quick summary of some of the interesting security things in this week\u2019s v4.11 release of the Linux kernel:<\/p>\n<p><strong>refcount_t infrastructure<\/strong><\/p>\n<p>Building on the <a href=\"http:\/\/www.openwall.com\/lists\/kernel-hardening\/2017\/01\/18\/4\">efforts<\/a> of Elena Reshetova, Hans Liljestrand, and David Windsor to port <a href=\"https:\/\/forums.grsecurity.net\/viewtopic.php?f=7&#038;t=4173\">PaX&#8217;s PAX_REFCOUNT protection<\/a>, Peter Zijlstra implemented a new <a href=\"https:\/\/git.kernel.org\/linus\/f405df5de3170c00e5c54f8b7cf4766044a032ba\">kernel API for reference counting<\/a> with the addition of the <code>refcount_t<\/code> type. Until now, all reference counters were implemented in the kernel using the <code>atomic_t<\/code> type, but it has a wide and general-purpose API that offers no reasonable way to provide protection against reference counter overflow vulnerabilities. With a dedicated type, a specialized API can be designed so that reference counting can be sanity-checked and provide a way to block overflows. With 2016 alone seeing at least a couple public exploitable reference counting vulnerabilities (e.g. <a href=\"http:\/\/perception-point.io\/2016\/01\/14\/analysis-and-exploitation-of-a-linux-kernel-vulnerability-cve-2016-0728\/\">CVE-2016-0728<\/a>, <a href=\"https:\/\/bugs.chromium.org\/p\/project-zero\/issues\/detail?id=809\">CVE-2016-4558<\/a>), this is going to be a welcome addition to the kernel. The arduous task of converting all the <code>atomic_t<\/code> reference counters to <code>refcount_t<\/code> will continue for a while to come.<\/p>\n<p><strong>CONFIG_DEBUG_RODATA renamed to CONFIG_STRICT_KERNEL_RWX<\/strong><\/p>\n<p>Laura Abbott landed changes to <a href=\"https:\/\/git.kernel.org\/linus\/0f5bf6d0afe4be6e1391908ff2d6dc9730e91550\">rename the kernel memory protection feature<\/a>. The protection hadn&#8217;t been &#8220;debug&#8221; for over a decade, and it covers all kernel memory sections, not just &#8220;rodata&#8221;. Getting it consolidated under the top-level arch Kconfig file also brings some sanity to what was a per-architecture config, and signals that this is a fundamental kernel protection needed to be enabled on all architectures.<\/p>\n<p><strong>read-only usermodehelper<\/strong><\/p>\n<p>A common way attackers use to escape confinement is by rewriting the user-mode helper sysctls (e.g. <code>\/proc\/sys\/kernel\/modprobe<\/code>) to run something of their choosing in the init namespace. To reduce attack surface within the kernel, Greg KH <a href=\"https:\/\/git.kernel.org\/linus\/64e90a8acb8590c2468c919f803652f081e3a4bf\">introduced CONFIG_STATIC_USERMODEHELPER<\/a>, which switches all user-mode helper binaries to a single read-only path (which defaults to <code>\/sbin\/usermode-helper<\/code>). Userspace will need to support this with a new helper tool that can demultiplex the kernel request to a set of known binaries.<\/p>\n<p><strong>seccomp coredumps<\/strong><\/p>\n<p>Mike Frysinger noticed that it wasn&#8217;t possible to get coredumps out of processes killed by seccomp, which could make debugging frustrating, especially for automated crash dump analysis tools. In keeping with the <a href=\"http:\/\/man7.org\/linux\/man-pages\/man7\/signal.7.html\">existing documentation for SIGSYS<\/a>, which says a coredump should be generated, he added <a href=\"https:\/\/git.kernel.org\/linus\/b25e67161c295c98acda92123b2dd1e7d8642901\">support to dump core on seccomp SECCOMP_RET_KILL<\/a> results.<\/p>\n<p><strong>structleak plugin<\/strong><\/p>\n<p>Ported from PaX, I landed the <a href=\"https:\/\/git.kernel.org\/linus\/c61f13eaa1ee17728c41370100d2d45c254ce76f\">structleak plugin<\/a> which enforces that any structure containing a <code>__user<\/code> annotation is fully initialized to 0 so that stack content exposures of these kinds of structures are entirely eliminated from the kernel. This was originally designed to stop a <a href=\"https:\/\/git.kernel.org\/linus\/b9e146d8eb3b9ecae5086d373b50fa0c1f3e7f0f\">specific vulnerability<\/a>, and will now continue to block similar exposures.<\/p>\n<p><strong>ASLR entropy sysctl on MIPS<\/strong><br \/>\nMatt Redfearn implemented the <a href=\"https:\/\/git.kernel.org\/linus\/109c32ffd89d64dd99a775f2f50443bee38b63e9\">ASLR entropy sysctl for MIPS<\/a>, letting userspace choose to crank up the entropy used for memory layouts.<\/p>\n<p><strong>NX brk on powerpc<\/strong><\/p>\n<p>Denys Vlasenko <a href=\"https:\/\/git.kernel.org\/linus\/16e72e9b30986ee15f17fbb68189ca842c32af58\">fixed a long standing bug<\/a> where the kernel made assumptions about ELF memory layouts and defaulted the the brk section on powerpc to be executable. Now it&#8217;s not, and that&#8217;ll keep process heap from being abused.<\/p>\n<p>That&#8217;s it for now; please let me know if I missed anything. The <a href=\"\/blog\/archives\/2017\/07\/10\/security-things-in-linux-v4-12\/\">v4.12<\/a> merge window is open!<\/p>\n<p style='text-align:left'>&copy; 2017, <a href=\"https:\/\/outflux.net\/blog\/\">Kees Cook<\/a>. This work is licensed under a <a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\">Creative Commons Attribution-ShareAlike 4.0 License<\/a>.<br \/><a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\"><img decoding=\"async\" alt=\"CC BY-SA 4.0\" style=\"border-width:0\" src=\"https:\/\/i.creativecommons.org\/l\/by-sa\/4.0\/88x31.png\" \/><\/a> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Previously: v4.10. Here\u2019s a quick summary of some of the interesting security things in this week\u2019s v4.11 release of the Linux kernel: refcount_t infrastructure Building on the efforts of Elena Reshetova, Hans Liljestrand, and David Windsor to port PaX&#8217;s PAX_REFCOUNT protection, Peter Zijlstra implemented a new kernel API for reference counting with the addition of [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,18,21,6,14,19],"tags":[],"_links":{"self":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts\/1018"}],"collection":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/comments?post=1018"}],"version-history":[{"count":8,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts\/1018\/revisions"}],"predecessor-version":[{"id":1036,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts\/1018\/revisions\/1036"}],"wp:attachment":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/media?parent=1018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/categories?post=1018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/tags?post=1018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}