<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/cache.h, branch v4.9.147</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.147</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.147'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2016-02-22T07:51:38Z</updated>
<entry>
<title>arch: Introduce post-init read-only memory</title>
<updated>2016-02-22T07:51:38Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2016-02-17T22:41:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c74ba8b3480da6ddaea17df2263ec09b869ac496'/>
<id>urn:sha1:c74ba8b3480da6ddaea17df2263ec09b869ac496</id>
<content type='text'>
One of the easiest ways to protect the kernel from attack is to reduce
the internal attack surface exposed when a "write" flaw is available. By
making as much of the kernel read-only as possible, we reduce the
attack surface.

Many things are written to only during __init, and never changed
again. These cannot be made "const" since the compiler will do the wrong
thing (we do actually need to write to them). Instead, move these items
into a memory region that will be made read-only during mark_rodata_ro()
which happens after all kernel __init code has finished.

This introduces __ro_after_init as a way to mark such memory, and adds
some documentation about the existing __read_mostly marking.

This improves the security of the Linux kernel by marking formerly
read-write memory regions as read-only on a fully booted up system.

Based on work by PaX Team and Brad Spengler.

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brad Spengler &lt;spender@grsecurity.net&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: David Brown &lt;david.brown@linaro.org&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: Emese Revfy &lt;re.emese@gmail.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Mathias Krause &lt;minipli@googlemail.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: PaX Team &lt;pageexec@freemail.hu&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: kernel-hardening@lists.openwall.com
Cc: linux-arch &lt;linux-arch@vger.kernel.org&gt;
Link: http://lkml.kernel.org/r/1455748879-21872-5-git-send-email-keescook@chromium.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>printk/cache: mark printk_once test variable __read_mostly</title>
<updated>2014-01-24T00:36:56Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2014-01-23T23:54:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c28aa1f0a847c36daa4280b611e2b54bad75c576'/>
<id>urn:sha1:c28aa1f0a847c36daa4280b611e2b54bad75c576</id>
<content type='text'>
Add #include &lt;linux/cache.h&gt; to define __read_mostly.

Convert cache.h to use uapi/linux/kernel.h instead
of linux/kernel.h to avoid recursive #includes.

Convert the ALIGN macro to __ALIGN_KERNEL.

printk_once only sets the bool variable tested
once so mark it __read_mostly.

Neaten the alignment so it matches the rest of the
pr_&lt;level&gt;_once #defines too.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Reviewed-by: James Hogan &lt;james.hogan@imgtec.com&gt;
Cc: Wu Fengguang &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Rename .data.cacheline_aligned to .data..cacheline_aligned.</title>
<updated>2010-03-03T10:25:58Z</updated>
<author>
<name>Tim Abbott</name>
<email>tabbott@ksplice.com</email>
</author>
<published>2010-02-20T00:03:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4af57b787b4be09419a2bb48aa705fa87ef41cca'/>
<id>urn:sha1:4af57b787b4be09419a2bb48aa705fa87ef41cca</id>
<content type='text'>
Signed-off-by: Tim Abbott &lt;tabbott@ksplice.com&gt;
Cc: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>mm: move cache_line_size() to &lt;linux/cache.h&gt;</title>
<updated>2008-04-28T15:58:19Z</updated>
<author>
<name>Pekka Enberg</name>
<email>penberg@cs.helsinki.fi</email>
</author>
<published>2008-04-28T09:12:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1b27d05b6e21249d2338be26dfcbe8f8d8ff8a5b'/>
<id>urn:sha1:1b27d05b6e21249d2338be26dfcbe8f8d8ff8a5b</id>
<content type='text'>
Not all architectures define cache_line_size() so as suggested by Andrew move
the private implementations in mm/slab.c and mm/slob.c to &lt;linux/cache.h&gt;.

Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Reviewed-by: Christoph Lameter &lt;clameter@sgi.com&gt;
Signed-off-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Don't include linux/config.h from anywhere else in include/</title>
<updated>2006-04-26T11:56:16Z</updated>
<author>
<name>David Woodhouse</name>
<email>dwmw2@infradead.org</email>
</author>
<published>2006-04-26T11:56:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=62c4f0a2d5a188f73a94f2cb8ea0dba3e7cf0a7f'/>
<id>urn:sha1:62c4f0a2d5a188f73a94f2cb8ea0dba3e7cf0a7f</id>
<content type='text'>
Signed-off-by: David Woodhouse &lt;dwmw2@infradead.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Move read_mostly definition to asm/cache.h</title>
<updated>2006-03-23T15:38:10Z</updated>
<author>
<name>Kyle McMartin</name>
<email>kyle@parisc-linux.org</email>
</author>
<published>2006-03-23T11:00:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=804f1594cc3deb161e531a43d90c501f0db2635a'/>
<id>urn:sha1:804f1594cc3deb161e531a43d90c501f0db2635a</id>
<content type='text'>
Seems like needless clutter having a bunch of #if defined(CONFIG_$ARCH) in
include/linux/cache.h.  Move the per architecture section definition to
asm/cache.h, and keep the if-not-defined dummy case in linux/cache.h to
catch architectures which don't implement the section.

Verified that symbols still go in .data.read_mostly on parisc,
and the compile doesn't break.

Signed-off-by: Kyle McMartin &lt;kyle@parisc-linux.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PARISC] Add __read_mostly section for parisc</title>
<updated>2006-01-11T01:35:03Z</updated>
<author>
<name>Helge Deller</name>
<email>deller@parisc-linux.org</email>
</author>
<published>2006-01-11T01:35:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8039de10aae3cd4cf0ef0ccebd58aff0e8810df2'/>
<id>urn:sha1:8039de10aae3cd4cf0ef0ccebd58aff0e8810df2</id>
<content type='text'>
Flag a whole bunch of things as __read_mostly on parisc. Also flag a few
branches as unlikely() and cleanup a bit of code.

Signed-off-by: Helge Deller &lt;deller@parisc-linux.org&gt;
Signed-off-by: Kyle McMartin &lt;kyle@parisc-linux.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Change maxaligned_in_smp alignemnt macros to internodealigned_in_smp macros</title>
<updated>2006-01-09T04:13:38Z</updated>
<author>
<name>Ravikiran G Thirumalai</name>
<email>kiran@scalex86.org</email>
</author>
<published>2006-01-08T09:01:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=22fc6eccbf4ce4eb6265e6ada7b50a7b9cc57d05'/>
<id>urn:sha1:22fc6eccbf4ce4eb6265e6ada7b50a7b9cc57d05</id>
<content type='text'>
____cacheline_maxaligned_in_smp is currently used to align critical structures
and avoid false sharing.  It uses per-arch L1_CACHE_SHIFT_MAX and people find
L1_CACHE_SHIFT_MAX useless.

However, we have been using ____cacheline_maxaligned_in_smp to align
structures on the internode cacheline size.  As per Andi's suggestion,
following patch kills ____cacheline_maxaligned_in_smp and introduces
INTERNODE_CACHE_SHIFT, which defaults to L1_CACHE_SHIFT for all arches.
Arches needing L3/Internode cacheline alignment can define
INTERNODE_CACHE_SHIFT in the arch asm/cache.h.  Patch replaces
____cacheline_maxaligned_in_smp with ____cacheline_internodealigned_in_smp

With this patch, L1_CACHE_SHIFT_MAX can be killed

Signed-off-by: Ravikiran Thirumalai &lt;kiran@scalex86.org&gt;
Signed-off-by: Shai Fultheim &lt;shai@scalex86.org&gt;
Signed-off-by: Andi Kleen &lt;ak@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[IA64] Add __read_mostly support for IA64</title>
<updated>2005-12-16T18:52:46Z</updated>
<author>
<name>Christoph Lameter</name>
<email>clameter@engr.sgi.com</email>
</author>
<published>2005-12-12T17:34:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=dc86e88c2bb8a7603ee175fbb6a9e92cf3293dd8'/>
<id>urn:sha1:dc86e88c2bb8a7603ee175fbb6a9e92cf3293dd8</id>
<content type='text'>
sparc64, i386 and x86_64 have support for a special data section dedicated
to rarely updated data that is frequently read. The section was created to
avoid false sharing of those rarely read data with frequently written kernel
data.

This patch creates such a data section for ia64 and will group rarely written
data into this section.

Signed-off-by: Christoph Lameter &lt;clameter@sgi.com&gt;
Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
</content>
</entry>
<entry>
<title>[SPARC64]: Add __read_mostly support.</title>
<updated>2005-07-10T22:45:11Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2005-07-10T22:45:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d369ddd2fc00fc3f46e9052d1017cbf407e3cdf7'/>
<id>urn:sha1:d369ddd2fc00fc3f46e9052d1017cbf407e3cdf7</id>
<content type='text'>
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
