<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/arm/mm/init.c, branch linux-4.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-08-24T11:07:07Z</updated>
<entry>
<title>ARM: 8780/1: ftrace: Only set kernel memory back to read-only after boot</title>
<updated>2018-08-24T11:07:07Z</updated>
<author>
<name>Steven Rostedt (VMware)</name>
</author>
<published>2018-07-10T07:22:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e6ab069a0e67e4284dee6e67640492fc64d4a32a'/>
<id>urn:sha1:e6ab069a0e67e4284dee6e67640492fc64d4a32a</id>
<content type='text'>
[ Upstream commit b4c7e2bd2eb4764afe3af9409ff3b1b87116fa30 ]

Dynamic ftrace requires modifying the code segments that are usually
set to read-only. To do this, a per arch function is called both before
and after the ftrace modifications are performed. The "before" function
will set kernel code text to read-write to allow for ftrace to make the
modifications, and the "after" function will set the kernel code text
back to "read-only" to keep the kernel code text protected.

The issue happens when dynamic ftrace is tested at boot up. The test is
done before the kernel code text has been set to read-only. But the
"before" and "after" calls are still performed. The "after" call will
change the kernel code text to read-only prematurely, and other boot
code that expects this code to be read-write will fail.

The solution is to add a variable that is set when the kernel code text
is expected to be converted to read-only, and make the ftrace "before"
and "after" calls do nothing if that variable is not yet set. This is
similar to the x86 solution from commit 162396309745 ("ftrace, x86:
make kernel text writable only for conversions").

Link: http://lkml.kernel.org/r/20180620212906.24b7b66e@vmware.local.home

Reported-by: Stefan Agner &lt;stefan@agner.ch&gt;
Tested-by: Stefan Agner &lt;stefan@agner.ch&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ARM: simplify and fix linker script for TCM</title>
<updated>2018-03-10T01:20:43Z</updated>
<author>
<name>Nicolas Pitre</name>
</author>
<published>2018-03-09T02:12:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b54290e51accea4f696f5dacef8e609d0ccbe54a'/>
<id>urn:sha1:b54290e51accea4f696f5dacef8e609d0ccbe54a</id>
<content type='text'>
Let's put the TCM stuff in the __init section directly. No need for
a separately freed memory area.

Remove redundant linker sections, as well as comments that were more
confusing than no comments at all. Finally make it XIP compatible by
using LOAD_OFFSET in the section LMA specification.

Signed-off-by: Nicolas Pitre &lt;nico@linaro.org&gt;
Tested-by: Chris Brandt &lt;Chris.Brandt@renesas.com&gt;
</content>
</entry>
<entry>
<title>ARM: 8737/1: mm: dump: add checking for writable and executable</title>
<updated>2018-01-21T15:32:20Z</updated>
<author>
<name>Jinbum Park</name>
</author>
<published>2017-12-12T00:43:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a8e53c151fe7ac52a1c13a6ace0c9e8e0f61260c'/>
<id>urn:sha1:a8e53c151fe7ac52a1c13a6ace0c9e8e0f61260c</id>
<content type='text'>
Page mappings with full RWX permissions are a security risk.
x86, arm64 has an option to walk the page tables
and dump any bad pages.

(1404d6f13e47
("arm64: dump: Add checking for writable and exectuable pages"))
Add a similar implementation for arm.

Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Tested-by: Laura Abbott &lt;labbott@redhat.com&gt;
Reviewed-by: Laura Abbott &lt;labbott@redhat.com&gt;
Signed-off-by: Jinbum Park &lt;jinb.park7@gmail.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
</content>
</entry>
<entry>
<title>Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm</title>
<updated>2017-11-26T23:03:49Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2017-11-26T23:03:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bbecb1cfcca55f98cfcb62fa36a32d79975d8816'/>
<id>urn:sha1:bbecb1cfcca55f98cfcb62fa36a32d79975d8816</id>
<content type='text'>
Pull ARM fixes from Russell King:

 - LPAE fixes for kernel-readonly regions

 - Fix for get_user_pages_fast on LPAE systems

 - avoid tying decompressor to a particular platform if DEBUG_LL is
   enabled

 - BUG if we attempt to return to userspace but the to-be-restored PSR
   value keeps us in privileged mode (defeating an issue that ftracetest
   found)

* 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
  ARM: BUG if jumping to usermode address in kernel mode
  ARM: 8722/1: mm: make STRICT_KERNEL_RWX effective for LPAE
  ARM: 8721/1: mm: dump: check hardware RO bit for LPAE
  ARM: make decompressor debug output user selectable
  ARM: fix get_user_pages_fast
</content>
</entry>
<entry>
<title>ARM: 8722/1: mm: make STRICT_KERNEL_RWX effective for LPAE</title>
<updated>2017-11-21T15:10:07Z</updated>
<author>
<name>Philip Derrin</name>
</author>
<published>2017-11-13T23:55:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=400eeffaffc7232c0ae1134fe04e14ae4fb48d8c'/>
<id>urn:sha1:400eeffaffc7232c0ae1134fe04e14ae4fb48d8c</id>
<content type='text'>
Currently, for ARM kernels with CONFIG_ARM_LPAE and
CONFIG_STRICT_KERNEL_RWX enabled, the 2MiB pages mapping the
kernel code and rodata are writable. They are marked read-only in
a software bit (L_PMD_SECT_RDONLY) but the hardware read-only bit
is not set (PMD_SECT_AP2).

For user mappings, the logic that propagates the software bit
to the hardware bit is in set_pmd_at(); but for the kernel,
section_update() writes the PMDs directly, skipping this logic.

The fix is to set PMD_SECT_AP2 for read-only sections in
section_update(), at the same time as L_PMD_SECT_RDONLY.

Fixes: 1e3479225acb ("ARM: 8275/1: mm: fix PMD_SECT_RDONLY undeclared compile error")
Signed-off-by: Philip Derrin &lt;philip@cog.systems&gt;
Reported-by: Neil Dick &lt;neil@cog.systems&gt;
Tested-by: Neil Dick &lt;neil@cog.systems&gt;
Tested-by: Laura Abbott &lt;labbott@redhat.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 8696/1: mm: Remove dead code in mem_init()</title>
<updated>2017-09-28T10:13:04Z</updated>
<author>
<name>Vladimir Murzin</name>
</author>
<published>2017-09-04T08:17:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0d9ac1625ac1041742c72c3b680198f0304539b2'/>
<id>urn:sha1:0d9ac1625ac1041742c72c3b680198f0304539b2</id>
<content type='text'>
The code in question checks memory constrains to set default policy for
overcommit; however we support page size of 4K only thus condition is
always evaluated to false. Remove that dead code.

Signed-off-by: Vladimir Murzin &lt;vladimir.murzin@arm.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 8672/1: mm: remove tasklist locking from update_sections_early()</title>
<updated>2017-04-26T09:59:36Z</updated>
<author>
<name>Grygorii Strashko</name>
</author>
<published>2017-04-25T20:20:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=11ce4b33aedc65198d7bc9669344ebca5ee36a41'/>
<id>urn:sha1:11ce4b33aedc65198d7bc9669344ebca5ee36a41</id>
<content type='text'>
The below backtrace can be observed on -rt kernel with
CONFIG_DEBUG_MODULE_RONX (4.9 kernel CONFIG_DEBUG_RODATA) option enabled:

 BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:993
 in_atomic(): 1, irqs_disabled(): 128, pid: 14, name: migration/0
 1 lock held by migration/0/14:
  #0:  (tasklist_lock){+.+...}, at: [&lt;c01183e8&gt;] update_sections_early+0x24/0xdc
 irq event stamp: 38
 hardirqs last  enabled at (37): [&lt;c08f6f7c&gt;] _raw_spin_unlock_irq+0x24/0x68
 hardirqs last disabled at (38): [&lt;c01fdfe8&gt;] multi_cpu_stop+0xd8/0x138
 softirqs last  enabled at (0): [&lt;c01303ec&gt;] copy_process.part.5+0x238/0x1b64
 softirqs last disabled at (0): [&lt;  (null)&gt;]   (null)
 Preemption disabled at: [&lt;c01fe244&gt;] cpu_stopper_thread+0x80/0x10c
 CPU: 0 PID: 14 Comm: migration/0 Not tainted 4.9.21-rt16-02220-g49e319c #15
 Hardware name: Generic DRA74X (Flattened Device Tree)
 [&lt;c0112014&gt;] (unwind_backtrace) from [&lt;c010d370&gt;] (show_stack+0x10/0x14)
 [&lt;c010d370&gt;] (show_stack) from [&lt;c049beb8&gt;] (dump_stack+0xa8/0xd4)
 [&lt;c049beb8&gt;] (dump_stack) from [&lt;c01631a0&gt;] (___might_sleep+0x1bc/0x2ac)
 [&lt;c01631a0&gt;] (___might_sleep) from [&lt;c08f7244&gt;] (__rt_spin_lock+0x1c/0x30)
 [&lt;c08f7244&gt;] (__rt_spin_lock) from [&lt;c08f77a4&gt;] (rt_read_lock+0x54/0x68)
 [&lt;c08f77a4&gt;] (rt_read_lock) from [&lt;c01183e8&gt;] (update_sections_early+0x24/0xdc)
 [&lt;c01183e8&gt;] (update_sections_early) from [&lt;c01184b0&gt;] (__fix_kernmem_perms+0x10/0x1c)
 [&lt;c01184b0&gt;] (__fix_kernmem_perms) from [&lt;c01fe010&gt;] (multi_cpu_stop+0x100/0x138)
 [&lt;c01fe010&gt;] (multi_cpu_stop) from [&lt;c01fe24c&gt;] (cpu_stopper_thread+0x88/0x10c)
 [&lt;c01fe24c&gt;] (cpu_stopper_thread) from [&lt;c015edc4&gt;] (smpboot_thread_fn+0x174/0x31c)
 [&lt;c015edc4&gt;] (smpboot_thread_fn) from [&lt;c015a988&gt;] (kthread+0xf0/0x108)
 [&lt;c015a988&gt;] (kthread) from [&lt;c0108818&gt;] (ret_from_fork+0x14/0x3c)
 Freeing unused kernel memory: 1024K (c0d00000 - c0e00000)

The stop_machine() is called with cpus = NULL from fix_kernmem_perms() and
mark_rodata_ro() which means only one CPU will execute
update_sections_early() while all other CPUs will spin and wait. Hence,
it's safe to remove tasklist locking from update_sections_early(). As part
of this change also mark functions which are local to this module as
static.

Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Acked-by: Laura Abbott &lt;labbott@redhat.com&gt;
Acked-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
</content>
</entry>
<entry>
<title>sched/headers: Prepare for new header dependencies before moving code to &lt;linux/sched/task.h&gt;</title>
<updated>2017-03-02T07:42:35Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2017-02-08T17:51:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=299300258d1bc4e997b7db340a2e06636757fe2e'/>
<id>urn:sha1:299300258d1bc4e997b7db340a2e06636757fe2e</id>
<content type='text'>
We are going to split &lt;linux/sched/task.h&gt; out of &lt;linux/sched.h&gt;, which
will have to be picked up from other headers and a couple of .c files.

Create a trivial placeholder &lt;linux/sched/task.h&gt; file that just
maps to &lt;linux/sched.h&gt; to make this patch obviously correct and
bisectable.

Include the new header in the files that are going to need it.

Acked-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>sched/headers: Prepare for new header dependencies before moving code to &lt;linux/sched/signal.h&gt;</title>
<updated>2017-03-02T07:42:29Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2017-02-08T17:51:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3f07c0144132e4f59d88055ac8ff3e691a5fa2b8'/>
<id>urn:sha1:3f07c0144132e4f59d88055ac8ff3e691a5fa2b8</id>
<content type='text'>
We are going to split &lt;linux/sched/signal.h&gt; out of &lt;linux/sched.h&gt;, which
will have to be picked up from other headers and a couple of .c files.

Create a trivial placeholder &lt;linux/sched/signal.h&gt; file that just
maps to &lt;linux/sched.h&gt; to make this patch obviously correct and
bisectable.

Include the new header in the files that are going to need it.

Acked-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm</title>
<updated>2017-02-28T19:50:53Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2017-02-28T19:50:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d4f4cf77b37eaea58ef863a4cbc95dad3880b524'/>
<id>urn:sha1:d4f4cf77b37eaea58ef863a4cbc95dad3880b524</id>
<content type='text'>
Pull ARM updates from Russell King:

 - nommu updates from Afzal Mohammed cleaning up the vectors support

 - allow DMA memory "mapping" for nommu Benjamin Gaignard

 - fixing a correctness issue with R_ARM_PREL31 relocations in the
   module linker

 - add strlen() prototype for the decompressor

 - support for DEBUG_VIRTUAL from Florian Fainelli

 - adjusting memory bounds after memory reservations have been
   registered

 - unipher cache handling updates from Masahiro Yamada

 - initrd and Thumb Kconfig cleanups

* 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: (23 commits)
  ARM: mm: round the initrd reservation to page boundaries
  ARM: mm: clean up initrd initialisation
  ARM: mm: move initrd init code out of arm_memblock_init()
  ARM: 8655/1: improve NOMMU definition of pgprot_*()
  ARM: 8654/1: decompressor: add strlen prototype
  ARM: 8652/1: cache-uniphier: clean up active way setup code
  ARM: 8651/1: cache-uniphier: include &lt;linux/errno.h&gt; instead of &lt;linux/types.h&gt;
  ARM: 8650/1: module: handle negative R_ARM_PREL31 addends correctly
  ARM: 8649/2: nommu: remove Hivecs configuration is asm
  ARM: 8648/2: nommu: display vectors base
  ARM: 8647/2: nommu: dynamic exception base address setting
  ARM: 8646/1: mmu: decouple VECTORS_BASE from Kconfig
  ARM: 8644/1: Reduce "CPU: shutdown" message to debug level
  ARM: 8641/1: treewide: Replace uses of virt_to_phys with __pa_symbol
  ARM: 8640/1: Add support for CONFIG_DEBUG_VIRTUAL
  ARM: 8639/1: Define KERNEL_START and KERNEL_END
  ARM: 8638/1: mtd: lart: Rename partition defines to be prefixed with PART_
  ARM: 8637/1: Adjust memory boundaries after reservations
  ARM: 8636/1: Cleanup sanity_check_meminfo
  ARM: add CPU_THUMB_CAPABLE to indicate possible Thumb support
  ...
</content>
</entry>
</feed>
