<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/arm/mm/init.c, branch linux-4.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-02-14T21:33:26Z</updated>
<entry>
<title>ARM: 8949/1: mm: mark free_memmap as __init</title>
<updated>2020-02-14T21:33:26Z</updated>
<author>
<name>Olof Johansson</name>
</author>
<published>2019-12-18T00:18:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f1025b2f75a0e2ad037e1d875e43d996aed78dfb'/>
<id>urn:sha1:f1025b2f75a0e2ad037e1d875e43d996aed78dfb</id>
<content type='text'>
commit 31f3010e60522ede237fb145a63b4af5a41718c2 upstream.

As of commit ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING
forcibly"), free_memmap() might not always be inlined, and thus is
triggering a section warning:

WARNING: vmlinux.o(.text.unlikely+0x904): Section mismatch in reference from the function free_memmap() to the function .meminit.text:memblock_free()

Mark it as __init, since the faller (free_unused_memmap) already is.

Fixes: ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING forcibly")
Signed-off-by: Olof Johansson &lt;olof@lixom.net&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ARM: 8901/1: add a criteria for pfn_valid of arm</title>
<updated>2019-09-21T05:17:05Z</updated>
<author>
<name>zhaoyang</name>
</author>
<published>2019-08-26T03:07:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=080ca754f5dbc8cc65b69902a81c901708adaf53'/>
<id>urn:sha1:080ca754f5dbc8cc65b69902a81c901708adaf53</id>
<content type='text'>
[ Upstream commit 5b3efa4f1479c91cb8361acef55f9c6662feba57 ]

pfn_valid can be wrong when parsing a invalid pfn whose phys address
exceeds BITS_PER_LONG as the MSB will be trimed when shifted.

The issue originally arise from bellowing call stack, which corresponding to
an access of the /proc/kpageflags from userspace with a invalid pfn parameter
and leads to kernel panic.

[46886.723249] c7 [&lt;c031ff98&gt;] (stable_page_flags) from [&lt;c03203f8&gt;]
[46886.723264] c7 [&lt;c0320368&gt;] (kpageflags_read) from [&lt;c0312030&gt;]
[46886.723280] c7 [&lt;c0311fb0&gt;] (proc_reg_read) from [&lt;c02a6e6c&gt;]
[46886.723290] c7 [&lt;c02a6e24&gt;] (__vfs_read) from [&lt;c02a7018&gt;]
[46886.723301] c7 [&lt;c02a6f74&gt;] (vfs_read) from [&lt;c02a778c&gt;]
[46886.723315] c7 [&lt;c02a770c&gt;] (SyS_pread64) from [&lt;c0108620&gt;]
(ret_fast_syscall+0x0/0x28)

Signed-off-by: Zhaoyang Huang &lt;zhaoyang.huang@unisoc.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ARM: 8874/1: mm: only adjust sections of valid mm structures</title>
<updated>2019-09-21T05:16:58Z</updated>
<author>
<name>Doug Berger</name>
</author>
<published>2019-07-01T17:50:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5b8b662741830dadedf360a5151719770483f8df'/>
<id>urn:sha1:5b8b662741830dadedf360a5151719770483f8df</id>
<content type='text'>
[ Upstream commit c51bc12d06b3a5494fbfcbd788a8e307932a06e9 ]

A timing hazard exists when an early fork/exec thread begins
exiting and sets its mm pointer to NULL while a separate core
tries to update the section information.

This commit ensures that the mm pointer is not NULL before
setting its section parameters. The arguments provided by
commit 11ce4b33aedc ("ARM: 8672/1: mm: remove tasklist locking
from update_sections_early()") are equally valid for not
requiring grabbing the task_lock around this check.

Fixes: 08925c2f124f ("ARM: 8464/1: Update all mm structures with section adjustments")
Signed-off-by: Doug Berger &lt;opendmb@gmail.com&gt;
Acked-by: Laura Abbott &lt;labbott@redhat.com&gt;
Cc: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Cc: Rob Herring &lt;robh@kernel.org&gt;
Cc: "Steven Rostedt (VMware)" &lt;rostedt@goodmis.org&gt;
Cc: Peng Fan &lt;peng.fan@nxp.com&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ARM: 8780/1: ftrace: Only set kernel memory back to read-only after boot</title>
<updated>2018-07-11T21:57:57Z</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=b4c7e2bd2eb4764afe3af9409ff3b1b87116fa30'/>
<id>urn:sha1:b4c7e2bd2eb4764afe3af9409ff3b1b87116fa30</id>
<content type='text'>
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;
</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>
</feed>
