<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/arc/mm/fault.c, branch linux-5.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.2.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.2.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-06-19T15:09:55Z</updated>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500</title>
<updated>2019-06-19T15:09:55Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2019-06-04T08:11:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d2912cb15bdda8ba4a5dd73396ad62641af2f520'/>
<id>urn:sha1:d2912cb15bdda8ba4a5dd73396ad62641af2f520</id>
<content type='text'>
Based on 2 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Enrico Weigelt &lt;info@metux.net&gt;
Reviewed-by: Kate Stewart &lt;kstewart@linuxfoundation.org&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ARC: mm: SIGSEGV userspace trying to access kernel virtual memory</title>
<updated>2019-05-20T17:09:10Z</updated>
<author>
<name>Eugeniy Paltsev</name>
</author>
<published>2019-05-13T17:28:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a8c715b4dd73c26a81a9cc8dc792aa715d8b4bb2'/>
<id>urn:sha1:a8c715b4dd73c26a81a9cc8dc792aa715d8b4bb2</id>
<content type='text'>
As of today if userspace process tries to access a kernel virtual addres
(0x7000_0000 to 0x7ffff_ffff) such that a legit kernel mapping already
exists, that process hangs instead of being killed with SIGSEGV

Fix that by ensuring that do_page_fault() handles kenrel vaddr only if
in kernel mode.

And given this, we can also simplify the code a bit. Now a vmalloc fault
implies kernel mode so its failure (for some reason) can reuse the
@no_context label and we can remove @bad_area_nosemaphore.

Reproduce user test for original problem:

------------------------&gt;8-----------------
 #include &lt;stdlib.h&gt;
 #include &lt;stdint.h&gt;

 int main(int argc, char *argv[])
 {
 	volatile uint32_t temp;

 	temp = *(uint32_t *)(0x70000000);
 }
------------------------&gt;8-----------------

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Eugeniy Paltsev &lt;Eugeniy.Paltsev@synopsys.com&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: mm: do_page_fault fixes #1: relinquish mmap_sem if signal arrives while handle_mm_fault</title>
<updated>2019-01-18T00:24:39Z</updated>
<author>
<name>Vineet Gupta</name>
</author>
<published>2018-12-11T00:56:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4d447455e73b47c43dd35fcc38ed823d3182a474'/>
<id>urn:sha1:4d447455e73b47c43dd35fcc38ed823d3182a474</id>
<content type='text'>
do_page_fault() forgot to relinquish mmap_sem if a signal came while
handling handle_mm_fault() - due to say a ctl+c or oom etc.
This would later cause a deadlock by acquiring it twice.

This came to light when running libc testsuite tst-tls3-malloc test but
is likely also the cause for prior seen LTP failures. Using lockdep
clearly showed what the issue was.

| # while true; do ./tst-tls3-malloc ; done
| Didn't expect signal from child: got `Segmentation fault'
| ^C
| ============================================
| WARNING: possible recursive locking detected
| 4.17.0+ #25 Not tainted
| --------------------------------------------
| tst-tls3-malloc/510 is trying to acquire lock:
| 606c7728 (&amp;mm-&gt;mmap_sem){++++}, at: __might_fault+0x28/0x5c
|
|but task is already holding lock:
|606c7728 (&amp;mm-&gt;mmap_sem){++++}, at: do_page_fault+0x9c/0x2a0
|
| other info that might help us debug this:
|  Possible unsafe locking scenario:
|
|       CPU0
|       ----
|  lock(&amp;mm-&gt;mmap_sem);
|  lock(&amp;mm-&gt;mmap_sem);
|
| *** DEADLOCK ***
|

------------------------------------------------------------
What the change does is not obvious (note to myself)

prior code was

| do_page_fault
|
|   down_read()		&lt;-- lock taken
|   handle_mm_fault	&lt;-- signal pending as this runs
|   if fatal_signal_pending
|       if VM_FAULT_ERROR
|           up_read
|       if user_mode
|          return	&lt;-- lock still held, this was the BUG

New code

| do_page_fault
|
|   down_read()		&lt;-- lock taken
|   handle_mm_fault	&lt;-- signal pending as this runs
|   if fatal_signal_pending
|       if VM_FAULT_RETRY
|          return       &lt;-- not same case as above, but still OK since
|                           core mm already relinq lock for FAULT_RETRY
|    ...
|
|   &lt; Now falls through for bug case above &gt;
|
|   up_read()		&lt;-- lock relinquished

Cc: stable@vger.kernel.org
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>arch/arc/mm/fault.c: remove caller signal_pending_branch predictions</title>
<updated>2019-01-04T21:13:48Z</updated>
<author>
<name>Davidlohr Bueso</name>
</author>
<published>2019-01-03T23:28:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d8d7d842e8286a98fb56df9caf5d19b46e01ba4b'/>
<id>urn:sha1:d8d7d842e8286a98fb56df9caf5d19b46e01ba4b</id>
<content type='text'>
This is already done for us internally by the signal machinery.

Link: http://lkml.kernel.org/r/20181116002713.8474-4-dave@stgolabs.net
Signed-off-by: Davidlohr Bueso &lt;dave@stgolabs.net&gt;
Reviewed-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Vineet Gupta &lt;vgupta@synopsys.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>ARC: mm: fix uninitialised signal code in do_page_fault</title>
<updated>2018-11-12T18:38:27Z</updated>
<author>
<name>Eugeniy Paltsev</name>
</author>
<published>2018-11-07T12:12:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=121e38e5acdc8e1e4cdb750fcdcc72f94e420968'/>
<id>urn:sha1:121e38e5acdc8e1e4cdb750fcdcc72f94e420968</id>
<content type='text'>
Commit 15773ae938d8 ("signal/arc: Use force_sig_fault where
appropriate") introduced undefined behaviour by leaving si_code
unitiailized and leaking random kernel values to user space.

Fixes: 15773ae938d8 ("signal/arc: Use force_sig_fault where appropriate")
Signed-off-by: Eugeniy Paltsev &lt;Eugeniy.Paltsev@synopsys.com&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>signal/arc: Use force_sig_fault where appropriate</title>
<updated>2018-09-27T19:59:35Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2017-08-01T18:41:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=15773ae938d8d93d982461990bebad6e1d7a1830'/>
<id>urn:sha1:15773ae938d8d93d982461990bebad6e1d7a1830</id>
<content type='text'>
Acked-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>mm: convert return type of handle_mm_fault() caller to vm_fault_t</title>
<updated>2018-08-17T23:20:28Z</updated>
<author>
<name>Souptick Joarder</name>
</author>
<published>2018-08-17T22:44:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=50a7ca3c6fc86955f99fc432fc8a186b968b365b'/>
<id>urn:sha1:50a7ca3c6fc86955f99fc432fc8a186b968b365b</id>
<content type='text'>
Use new return type vm_fault_t for fault handler.  For now, this is just
documenting that the function returns a VM_FAULT value rather than an
errno.  Once all instances are converted, vm_fault_t will become a
distinct type.

Ref-&gt; commit 1c8f422059ae ("mm: change return type to vm_fault_t")

In this patch all the caller of handle_mm_fault() are changed to return
vm_fault_t type.

Link: http://lkml.kernel.org/r/20180617084810.GA6730@jordon-HP-15-Notebook-PC
Signed-off-by: Souptick Joarder &lt;jrdr.linux@gmail.com&gt;
Cc: Matthew Wilcox &lt;willy@infradead.org&gt;
Cc: Richard Henderson &lt;rth@twiddle.net&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Matt Turner &lt;mattst88@gmail.com&gt;
Cc: Vineet Gupta &lt;vgupta@synopsys.com&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: Richard Kuo &lt;rkuo@codeaurora.org&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: Michal Simek &lt;monstr@monstr.eu&gt;
Cc: James Hogan &lt;jhogan@kernel.org&gt;
Cc: Ley Foon Tan &lt;lftan@altera.com&gt;
Cc: Jonas Bonn &lt;jonas@southpole.se&gt;
Cc: James E.J. Bottomley &lt;jejb@parisc-linux.org&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Palmer Dabbelt &lt;palmer@sifive.com&gt;
Cc: Yoshinori Sato &lt;ysato@users.sourceforge.jp&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Richard Weinberger &lt;richard@nod.at&gt;
Cc: Guan Xuetao &lt;gxt@pku.edu.cn&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: "Levin, Alexander (Sasha Levin)" &lt;alexander.levin@verizon.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>signal: Ensure every siginfo we send has all bits initialized</title>
<updated>2018-04-25T15:40:51Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2018-04-17T20:26:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3eb0f5193b497083391aa05d35210d5645211eef'/>
<id>urn:sha1:3eb0f5193b497083391aa05d35210d5645211eef</id>
<content type='text'>
Call clear_siginfo to ensure every stack allocated siginfo is properly
initialized before being passed to the signal sending functions.

Note: It is not safe to depend on C initializers to initialize struct
siginfo on the stack because C is allowed to skip holes when
initializing a structure.

The initialization of struct siginfo in tracehook_report_syscall_exit
was moved from the helper user_single_step_siginfo into
tracehook_report_syscall_exit itself, to make it clear that the local
variable siginfo gets fully initialized.

In a few cases the scope of struct siginfo has been reduced to make it
clear that siginfo siginfo is not used on other paths in the function
in which it is declared.

Instances of using memset to initialize siginfo have been replaced
with calls clear_siginfo for clarity.

Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>ARC: typo fix in mm/fault.c</title>
<updated>2017-08-28T22:17:36Z</updated>
<author>
<name>Liav Rehana</name>
</author>
<published>2017-05-28T06:52:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ddf720f86efe38cb3ef88b2eaad9ea8ad7c6f798'/>
<id>urn:sha1:ddf720f86efe38cb3ef88b2eaad9ea8ad7c6f798</id>
<content type='text'>
Signed-off-by: Liav Rehana &lt;liavr@mellanox.com&gt;
Signed-off-by: Noam Camus &lt;noamca@mellanox.com&gt;
Reviewed-by: Alexey Brodkin &lt;abrodkin@synopsys.com&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&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>
</feed>
