lkml.org 
[lkml]   [2019]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] vsprintf: Do not break early boot with probing addresses
    On Thu,  9 May 2019 14:19:23 +0200
    Petr Mladek <pmladek@suse.com> wrote:

    > The commit 3e5903eb9cff70730 ("vsprintf: Prevent crash when dereferencing
    > invalid pointers") broke boot on several architectures. The common
    > pattern is that probe_kernel_read() is not working during early
    > boot because userspace access framework is not ready.
    >
    > The check is only the best effort. Let's not rush with it during
    > the early boot.
    >
    > Details:
    >
    > 1. Report on Power:
    >
    > Kernel crashes very early during boot with with CONFIG_PPC_KUAP and
    > CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG
    >
    > The problem is the combination of some new code called via printk(),
    > check_pointer() which calls probe_kernel_read(). That then calls
    > allow_user_access() (PPC_KUAP) and that uses mmu_has_feature() too early
    > (before we've patched features).

    There is early_mmu_has_feature for this case. mmu_has_feature does not
    work before patching so parts of kernel that can run before patching
    must use the early_ variant which actually runs code reading the
    feature bitmap to determine the answer.

    Thanks

    Michal

    \
     
     \ /
      Last update: 2019-05-09 15:39    [W:4.617 / U:0.292 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site