<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/s390/lib, branch linux-5.7.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.7.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.7.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-08-21T11:07:41Z</updated>
<entry>
<title>s390/test_unwind: fix possible memleak in test_unwind()</title>
<updated>2020-08-21T11:07:41Z</updated>
<author>
<name>Wang Hai</name>
</author>
<published>2020-07-30T06:36:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=07a4dc1435820ef9fcbb9767a0239336d24ca9bf'/>
<id>urn:sha1:07a4dc1435820ef9fcbb9767a0239336d24ca9bf</id>
<content type='text'>
[ Upstream commit 75d3e7f4769d276a056efa1cc7f08de571fc9b4b ]

test_unwind() misses to call kfree(bt) in an error path.
Add the missed function call to fix it.

Fixes: 0610154650f1 ("s390/test_unwind: print verbose unwinding results")
Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Wang Hai &lt;wanghai38@huawei.com&gt;
Acked-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>s390/mm: fix page table upgrade vs 2ndary address mode accesses</title>
<updated>2020-04-21T13:16:43Z</updated>
<author>
<name>Christian Borntraeger</name>
</author>
<published>2020-04-15T13:21:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=316ec154810960052d4586b634156c54d0778f74'/>
<id>urn:sha1:316ec154810960052d4586b634156c54d0778f74</id>
<content type='text'>
A page table upgrade in a kernel section that uses secondary address
mode will mess up the kernel instructions as follows:

Consider the following scenario: two threads are sharing memory.
On CPU1 thread 1 does e.g. strnlen_user().  That gets to
        old_fs = enable_sacf_uaccess();
        len = strnlen_user_srst(src, size);
and
                "   la    %2,0(%1)\n"
                "   la    %3,0(%0,%1)\n"
                "   slgr  %0,%0\n"
                "   sacf  256\n"
                "0: srst  %3,%2\n"
in strnlen_user_srst().  At that point we are in secondary space mode,
control register 1 points to kernel page table and instruction fetching
happens via c1, rather than usual c13.  Interrupts are not disabled, for
obvious reasons.

On CPU2 thread 2 does MAP_FIXED mmap(), forcing the upgrade of page table
from 3-level to e.g. 4-level one.  We'd allocated new top-level table,
set it up and now we hit this:
                notify = 1;
                spin_unlock_bh(&amp;mm-&gt;page_table_lock);
        }
        if (notify)
                on_each_cpu(__crst_table_upgrade, mm, 0);
OK, we need to actually change over to use of new page table and we
need that to happen in all threads that are currently running.  Which
happens to include the thread 1.  IPI is delivered and we have
static void __crst_table_upgrade(void *arg)
{
        struct mm_struct *mm = arg;

        if (current-&gt;active_mm == mm)
                set_user_asce(mm);
        __tlb_flush_local();
}
run on CPU1.  That does
static inline void set_user_asce(struct mm_struct *mm)
{
        S390_lowcore.user_asce = mm-&gt;context.asce;
OK, user page table address updated...
        __ctl_load(S390_lowcore.user_asce, 1, 1);
... and control register 1 set to it.
        clear_cpu_flag(CIF_ASCE_PRIMARY);
}

IPI is run in home space mode, so it's fine - insns are fetched
using c13, which always points to kernel page table.  But as soon
as we return from the interrupt, previous PSW is restored, putting
CPU1 back into secondary space mode, at which point we no longer
get the kernel instructions from the kernel mapping.

The fix is to only fixup the control registers that are currently in use
for user processes during the page table update.  We must also disable
interrupts in enable_sacf_uaccess to synchronize the cr and
thread.mm_segment updates against the on_each-cpu.

Fixes: 0aaba41b58bc ("s390: remove all code using the access register mode")
Cc: stable@vger.kernel.org # 4.15+
Reported-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Reviewed-by: Gerald Schaefer &lt;gerald.schaefer@de.ibm.com&gt;
References: CVE-2020-11884
Signed-off-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/test_unwind: fix spelling mistake "reqister" -&gt; "register"</title>
<updated>2019-12-11T18:53:23Z</updated>
<author>
<name>Colin Ian King</name>
</author>
<published>2019-12-02T09:02:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7e914fd17e9a750d8896e5645c84e75e52d77a4b'/>
<id>urn:sha1:7e914fd17e9a750d8896e5645c84e75e52d77a4b</id>
<content type='text'>
There is a spelling mistake in a pr_info message. Fix it.

Link: https://lkml.kernel.org/r/20191202090215.28766-1-colin.king@canonical.com
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/spinlock: remove confusing comment in arch_spin_lock_wait</title>
<updated>2019-12-11T18:53:23Z</updated>
<author>
<name>Vasily Gorbik</name>
</author>
<published>2019-12-03T16:52:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b62b6cf170237677ae96001940c54d5c09d0015a'/>
<id>urn:sha1:b62b6cf170237677ae96001940c54d5c09d0015a</id>
<content type='text'>
arch_spin_lock_wait does not take steal time into consideration.

Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/test_unwind: add program check context tests</title>
<updated>2019-11-30T09:52:48Z</updated>
<author>
<name>Vasily Gorbik</name>
</author>
<published>2019-11-25T13:07:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=de6921ccbd0fb2882a1f615a6d3cdfbdcd64532c'/>
<id>urn:sha1:de6921ccbd0fb2882a1f615a6d3cdfbdcd64532c</id>
<content type='text'>
Add unwinding from program check handler tests. Unwinder should be able
to unwind through pt_regs stored by program check handler on task stack.

Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/test_unwind: add irq context tests</title>
<updated>2019-11-30T09:52:48Z</updated>
<author>
<name>Vasily Gorbik</name>
</author>
<published>2019-11-22T18:18:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e7409367abe54ad04868552b9d9fe4a56acc753d'/>
<id>urn:sha1:e7409367abe54ad04868552b9d9fe4a56acc753d</id>
<content type='text'>
Add unwinding from irq context tests. Unwinder should be able to unwind
through irq stack to task stack up to task pt_regs.

Reviewed-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/test_unwind: print verbose unwinding results</title>
<updated>2019-11-30T09:52:48Z</updated>
<author>
<name>Vasily Gorbik</name>
</author>
<published>2019-11-22T17:52:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0610154650f161d56a0bef0d9678ae1de7360019'/>
<id>urn:sha1:0610154650f161d56a0bef0d9678ae1de7360019</id>
<content type='text'>
Add stack name, sp and reliable information into test unwinding
results. Also consider ip outside of kernel text as failure if the
state is reported reliable.

Acked-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/test_unwind: add CALL_ON_STACK tests</title>
<updated>2019-11-30T09:52:47Z</updated>
<author>
<name>Vasily Gorbik</name>
</author>
<published>2019-11-22T17:22:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7868249fbbc8125b82b83d99d33b23897ae7d9ab'/>
<id>urn:sha1:7868249fbbc8125b82b83d99d33b23897ae7d9ab</id>
<content type='text'>
Add CALL_ON_STACK helper testing. Tests make sure that we can unwind from
switched stack to original one up to task pt_regs (nodat -&gt; task stack).

UWM_SWITCH_STACK could not be used together with UWM_THREAD because
get_stack_info explicitly restricts unwinding to task stack if
task != current.

Reviewed-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/test_unwind: require that unwinding ended successfully</title>
<updated>2019-11-30T09:52:46Z</updated>
<author>
<name>Vasily Gorbik</name>
</author>
<published>2019-11-22T16:37:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f44fa79b104b56d53d33ae43e69bab98b63d4783'/>
<id>urn:sha1:f44fa79b104b56d53d33ae43e69bab98b63d4783</id>
<content type='text'>
Currently unwinder test passes if unwinding results contain unwindme_func2
and unwindme_func1 functions.
Now that unwinder reports success upon reaching task pt_regs, check
that unwinding ended successfully in every test.

Acked-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/unwind: add a test for the internal API</title>
<updated>2019-11-30T09:52:46Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2019-10-17T13:09:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=badbf39790798283f2424828e7b7bec3962f1e02'/>
<id>urn:sha1:badbf39790798283f2424828e7b7bec3962f1e02</id>
<content type='text'>
unwind_for_each_frame can take at least 8 different sets of parameters.
Add a test to make sure they all are handled in a sane way.

Reviewed-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Co-developed-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
</content>
</entry>
</feed>
