18 Oct, 2018

7 commits

  • Commit 8c8484a1c18e3231648f5ba7cc5ffb7fd70b3ca4 upstream.

    __get_user_error() is used as a fast accessor to make copying structure
    members as efficient as possible. However, with software PAN and the
    recent Spectre variant 1, the efficiency is reduced as these are no
    longer fast accessors.

    In the case of software PAN, it has to switch the domain register around
    each access, and with Spectre variant 1, it would have to repeat the
    access_ok() check for each access.

    Rather than using __get_user_error() to copy each semops element member,
    copy each semops element in full using __copy_from_user().

    Acked-by: Mark Rutland
    Signed-off-by: Russell King
    Signed-off-by: David A. Long
    Signed-off-by: Greg Kroah-Hartman

    Russell King
     
  • Commit 42019fc50dfadb219f9e6ddf4c354f3837057d80 upstream.

    __get_user_error() is used as a fast accessor to make copying structure
    members in the signal handling path as efficient as possible. However,
    with software PAN and the recent Spectre variant 1, the efficiency is
    reduced as these are no longer fast accessors.

    In the case of software PAN, it has to switch the domain register around
    each access, and with Spectre variant 1, it would have to repeat the
    access_ok() check for each access.

    Use __copy_from_user() rather than __get_user_err() for individual
    members when restoring VFP state.

    Acked-by: Mark Rutland
    Signed-off-by: Russell King
    Signed-off-by: David A. Long
    Signed-off-by: Greg Kroah-Hartman

    Russell King
     
  • Commit c32cd419d6650e42b9cdebb83c672ec945e6bd7e upstream.

    __get_user_error() is used as a fast accessor to make copying structure
    members in the signal handling path as efficient as possible. However,
    with software PAN and the recent Spectre variant 1, the efficiency is
    reduced as these are no longer fast accessors.

    In the case of software PAN, it has to switch the domain register around
    each access, and with Spectre variant 1, it would have to repeat the
    access_ok() check for each access.

    It becomes much more efficient to use __copy_from_user() instead, so
    let's use this for the ARM integer registers.

    Acked-by: Mark Rutland
    Signed-off-by: Russell King
    Signed-off-by: David A. Long
    Signed-off-by: Greg Kroah-Hartman

    Russell King
     
  • Commit 10573ae547c85b2c61417ff1a106cffbfceada35 upstream.

    Prevent speculation at the syscall table decoding by clamping the index
    used to zero on invalid system call numbers, and using the csdb
    speculative barrier.

    Signed-off-by: Russell King
    Acked-by: Mark Rutland
    Boot-tested-by: Tony Lindgren
    Reviewed-by: Tony Lindgren
    Signed-off-by: David A. Long
    Signed-off-by: Greg Kroah-Hartman

    Russell King
     
  • Commit 9d3a04925deeabb97c8e26d940b501a2873e8af3 upstream.

    Add support for per-processor bug checking - each processor function
    descriptor gains a function pointer for this check, which must not be
    an __init function. If non-NULL, this will be called whenever a CPU
    enters the kernel via which ever path (boot CPU, secondary CPU startup,
    CPU resuming, etc.)

    This allows processor specific bug checks to validate that workaround
    bits are properly enabled by firmware via all entry paths to the kernel.

    Signed-off-by: Russell King
    Reviewed-by: Florian Fainelli
    Boot-tested-by: Tony Lindgren
    Reviewed-by: Tony Lindgren
    Acked-by: Marc Zyngier
    Signed-off-by: David A. Long
    Signed-off-by: Greg Kroah-Hartman

    Russell King
     
  • Commit 26602161b5ba795928a5a719fe1d5d9f2ab5c3ef upstream.

    Check for CPU bugs when secondary processors are being brought online,
    and also when CPUs are resuming from a low power mode. This gives an
    opportunity to check that processor specific bug workarounds are
    correctly enabled for all paths that a CPU re-enters the kernel.

    Signed-off-by: Russell King
    Reviewed-by: Florian Fainelli
    Boot-tested-by: Tony Lindgren
    Reviewed-by: Tony Lindgren
    Acked-by: Marc Zyngier
    Signed-off-by: David A. Long
    Signed-off-by: Greg Kroah-Hartman

    Russell King
     
  • Commit a5b9177f69329314721aa7022b7e69dab23fa1f0 upstream.

    Prepare the processor bug infrastructure so that it can be expanded to
    check for per-processor bugs.

    Signed-off-by: Russell King
    Reviewed-by: Florian Fainelli
    Boot-tested-by: Tony Lindgren
    Reviewed-by: Tony Lindgren
    Acked-by: Marc Zyngier
    Signed-off-by: David A. Long
    Signed-off-by: Greg Kroah-Hartman

    Russell King
     

21 Jun, 2018

1 commit

  • [ Upstream commit 2d7b3c64431245c95b05a441669c074da10db943 ]

    When a panic() occurs, the kexec code uses smp_send_stop() to stop
    the other CPUs, but this results in the CPU register state not being
    saved, and gdb is unable to inspect the state of other CPUs.

    Commit 0ee59413c967 ("x86/panic: replace smp_send_stop() with kdump
    friendly version in panic path") addressed the issue on x86, but
    ignored other architectures. Address the issue on ARM by splitting
    out the crash stop implementation to crash_smp_send_stop() and
    adding the necessary protection.

    Signed-off-by: Russell King
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Russell King
     

30 May, 2018

1 commit

  • [ Upstream commit 73b9160d0dfe44dfdaffd6465dc1224c38a4a73c ]

    Define vdso_start, vdso_end as array to avoid compile-time analysis error
    for the case of built with CONFIG_FORTIFY_SOURCE.

    and, since vdso_start, vdso_end are used in vdso.c only,
    move extern-declaration from vdso.h to vdso.c.

    If kernel is built with CONFIG_FORTIFY_SOURCE,
    compile-time error happens at this code.
    - if (memcmp(&vdso_start, "177ELF", 4))

    The size of "&vdso_start" is recognized as 1 byte, but n is 4,
    So that compile-time error is reported.

    Acked-by: Kees Cook
    Signed-off-by: Jinbum Park
    Signed-off-by: Russell King
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Jinbum Park
     

23 May, 2018

1 commit

  • commit eb0146daefdde65665b7f076fbff7b49dade95b9 upstream.

    Prohibit kprobes on do_undefinstr because kprobes on
    arm is implemented by undefined instruction. This means
    if we probe do_undefinstr(), it can cause infinit
    recursive exception.

    Fixes: 24ba613c9d6c ("ARM kprobes: core code")
    Signed-off-by: Masami Hiramatsu
    Cc: stable@vger.kernel.org
    Signed-off-by: Russell King
    Signed-off-by: Greg Kroah-Hartman

    Masami Hiramatsu
     

13 Feb, 2018

1 commit

  • commit dc8635b78cd8669c37e230058d18c33af7451ab1 upstream.

    gcc -fisolate-erroneous-paths-dereference can generate calls to abort()
    from modular code too.

    [arnd@arndb.de: drop duplicate exports of abort()]
    Link: http://lkml.kernel.org/r/20180102103311.706364-1-arnd@arndb.de
    Reported-by: Vineet Gupta
    Cc: Sudip Mukherjee
    Cc: Arnd Bergmann
    Cc: Alexey Brodkin
    Cc: Russell King
    Cc: Jose Abreu
    Signed-off-by: Andrew Morton
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Linus Torvalds
    Cc: Evgeniy Didin
    Signed-off-by: Greg Kroah-Hartman

    Andrew Morton
     

14 Dec, 2017

2 commits

  • commit 3aaf33bebda8d4ffcc0fc8ef39e6c1ac68823b11 upstream.

    When qemu starts a kernel in a bare environment, the default SCR has
    the AW and FW bits clear, which means that the kernel can't modify
    the PSR A or PSR F bits, and means that FIQs and imprecise aborts are
    always masked.

    When running uboot under qemu, the AW and FW SCR bits are set, and the
    kernel functions normally - and this is how real hardware behaves.

    Fix this for qemu by ignoring the FIQ bit.

    Fixes: 8bafae202c82 ("ARM: BUG if jumping to usermode address in kernel mode")
    Signed-off-by: Russell King
    Cc: Alex Shi
    Signed-off-by: Greg Kroah-Hartman

    Russell King
     
  • commit 8bafae202c82dc257f649ea3c275a0f35ee15113 upstream.

    Detect if we are returning to usermode via the normal kernel exit paths
    but the saved PSR value indicates that we are in kernel mode. This
    could occur due to corrupted stack state, which has been observed with
    "ftracetest".

    This ensures that we catch the problem case before we get to user code.

    Signed-off-by: Russell King
    Cc: Alex Shi
    Signed-off-by: Greg Kroah-Hartman

    Russell King
     

10 Nov, 2017

1 commit


06 Nov, 2017

1 commit

  • When CONFIG_DEBUG_USER is enabled, it's possible for a user to
    deliberately trigger dump_instr() with a chosen kernel address.

    Let's avoid problems resulting from this by using get_user() rather than
    __get_user(), ensuring that we don't erroneously access kernel memory.

    So that we can use the same code to dump user instructions and kernel
    instructions, the common dumping code is factored out to __dump_instr(),
    with the fs manipulated appropriately in dump_instr() around calls to
    this.

    Signed-off-by: Mark Rutland
    Cc: stable@vger.kernel.org
    Signed-off-by: Russell King

    Mark Rutland
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

21 Oct, 2017

1 commit

  • Pull ARM fixes from Russell King:
    "Three fixes this time around:

    - ensure sparse realises that we're building for a 32-bit arch on
    64-bit hosts.

    - use the correct instruction for semihosting on v7m (nommu) CPUs.

    - reserve address 0 to prevent the first page of memory being used on
    nommu systems"

    * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
    ARM: 8704/1: semihosting: use proper instruction on v7m processors
    ARM: 8701/1: fix sparse flags for build on 64bit machines
    ARM: 8700/1: nommu: always reserve address 0 away

    Linus Torvalds
     

12 Oct, 2017

1 commit


18 Sep, 2017

2 commits

  • Disable the generic address limit check in favor of an architecture
    specific optimized implementation. The generic implementation using
    pending work flags did not work well with ARM and alignment faults.

    The address limit is checked on each syscall return path to user-mode
    path as well as the irq user-mode return function. If the address limit
    was changed, a function is called to report data corruption (stopping
    the kernel or process based on configuration).

    The address limit check has to be done before any pending work because
    they can reset the address limit and the process is killed using a
    SIGKILL signal. For example the lkdtm address limit check does not work
    because the signal to kill the process will reset the user-mode address
    limit.

    Signed-off-by: Thomas Garnier
    Signed-off-by: Kees Cook
    Tested-by: Kees Cook
    Tested-by: Leonard Crestez
    Reviewed-by: Kees Cook
    Signed-off-by: Thomas Gleixner
    Cc: Pratyush Anand
    Cc: Dave Martin
    Cc: Will Drewry
    Cc: Arnd Bergmann
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Russell King
    Cc: Andy Lutomirski
    Cc: David Howells
    Cc: Dave Hansen
    Cc: Al Viro
    Cc: linux-api@vger.kernel.org
    Cc: Yonghong Song
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lkml.kernel.org/r/1504798247-48833-4-git-send-email-keescook@chromium.org

    Thomas Garnier
     
  • This reverts commit 73ac5d6a2b6ac3ae8d1e1818f3e9946f97489bc9.

    The work pending loop can call set_fs after addr_limit_user_check
    removed the _TIF_FSCHECK flag. This may happen at anytime based on how
    ARM handles alignment exceptions. It leads to an infinite loop condition.

    After discussion, it has been agreed that the generic approach is not
    tailored to the ARM architecture and any fix might not be complete. This
    patch will be replaced by an architecture specific implementation. The
    work flag approach will be kept for other architectures.

    Reported-by: Leonard Crestez
    Signed-off-by: Thomas Garnier
    Signed-off-by: Kees Cook
    Signed-off-by: Thomas Gleixner
    Cc: Pratyush Anand
    Cc: Dave Martin
    Cc: Will Drewry
    Cc: Arnd Bergmann
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Russell King
    Cc: Andy Lutomirski
    Cc: David Howells
    Cc: Dave Hansen
    Cc: Al Viro
    Cc: linux-api@vger.kernel.org
    Cc: Yonghong Song
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lkml.kernel.org/r/1504798247-48833-3-git-send-email-keescook@chromium.org

    Thomas Garnier
     

12 Sep, 2017

1 commit

  • Pull ARM updates from Russell King:
    "Low priority fixes and updates for ARM:

    - add some missing includes

    - efficiency improvements in system call entry code when tracing is
    enabled

    - ensure ARMv6+ is always built as EABI

    - export save_stack_trace_tsk()

    - fix fatal signal handling during mm fault

    - build translation table base address register from scratch

    - appropriately align the .data section to a word boundary where we
    rely on that data being word aligned"

    * 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
    ARM: 8691/1: Export save_stack_trace_tsk()
    ARM: 8692/1: mm: abort uaccess retries upon fatal signal
    ARM: 8690/1: lpae: build TTB control register value from scratch in v7_ttb_setup
    ARM: align .data section
    ARM: always enable AEABI for ARMv6+
    ARM: avoid saving and restoring registers unnecessarily
    ARM: move PC value into r9
    ARM: obtain thread info structure later
    ARM: use aliases for registers in entry-common
    ARM: 8689/1: scu: add missing errno include
    ARM: 8688/1: pm: add missing types include

    Linus Torvalds
     

11 Sep, 2017

1 commit

  • Pull ARM/arm64 SoC platform updates from Olof Johansson: "This branch
    contains platform updates for 32- and 64-bit ARM, including defconfig
    updates to enable new options, drivers and platforms. There are also a
    few fixes and cleanups for some existing vendors.

    Some of the things worth highlighting here are:

    - Enabling new crypt drivers on arm64 defconfig

    - QCOM IPQ8074 clocks and pinctrl drivers on arm64 defconfig

    - Debug support enabled for Renesas r8a7743

    - Various config updates for Renesas platforms (sound, USB, other
    drivers)

    - Platform support (including SMP) for TI dra762

    - OMAP cleanups: Move to use generic 8250 debug_ll, removal of stale
    DMA code"

    * tag 'armsoc-platforms' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (109 commits)
    ARM: multi_v7_defconfig: make eSDHC driver built-in
    arm64: defconfig: enable rockchip graphics
    MAINTAINERS: Update Cavium ThunderX2 entry
    ARM: config: aspeed: Add I2C, VUART, LPC Snoop
    ARM: configs: aspeed: Update Aspeed G4 with VMSPLIT_2G
    ARM: s3c24xx: Fix NAND ECC mode for mini2440 board
    ARM: davinci_all_defconfig: enable tinydrm and ST7586
    arm64: defconfig: Enable QCOM IPQ8074 clock and pinctrl
    ARM: defconfig: tegra: Enable ChipIdea UDC driver
    ARM: configs: Add Tegra I2S interfaces to multi_v7_defconfig
    ARM: tegra: Add Tegra I2S interfaces to defconfig
    ARM: tegra: Update default configuration for v4.13-rc1
    MAINTAINERS: update ARM/ZTE entry
    soc: versatile: remove unnecessary static in realview_soc_probe()
    ARM: Convert to using %pOF instead of full_name
    ARM: hisi: Fix typo in comment
    ARM: multi_v7_defconfig: add CONFIG_BRCMSTB_THERMAL
    arm64: defconfig: add CONFIG_BRCMSTB_THERMAL
    arm64: defconfig: add recently added crypto drivers as modules
    arm64: defconfig: enable CONFIG_UNIPHIER_WATCHDOG
    ...

    Linus Torvalds
     

09 Sep, 2017

3 commits

  • Russell King
     
  • The kernel watchdog is a great debugging tool for finding tasks that
    consume a disproportionate amount of CPU time in contiguous chunks. One
    can imagine building a similar watchdog for arbitrary driver threads
    using save_stack_trace_tsk() and print_stack_trace(). However, this is
    not viable for dynamically loaded driver modules on ARM platforms
    because save_stack_trace_tsk() is not exported for those architectures.
    Export save_stack_trace_tsk() for the ARM architecture to align with
    x86 and support various debugging use cases such as arbitrary driver
    thread watchdog timers.

    Signed-off-by: Dustin Brown
    Signed-off-by: Russell King

    Dustin Brown
     
  • Reuse the existing optimised memset implementation to implement an
    optimised memset32 and memset64.

    Link: http://lkml.kernel.org/r/20170720184539.31609-5-willy@infradead.org
    Signed-off-by: Matthew Wilcox
    Reviewed-by: Russell King
    Cc: "H. Peter Anvin"
    Cc: "James E.J. Bottomley"
    Cc: "Martin K. Petersen"
    Cc: David Miller
    Cc: Ingo Molnar
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Minchan Kim
    Cc: Ralf Baechle
    Cc: Richard Henderson
    Cc: Sam Ravnborg
    Cc: Sergey Senozhatsky
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthew Wilcox
     

05 Sep, 2017

1 commit

  • Pull syscall updates from Ingo Molnar:
    "Improve the security of set_fs(): we now check the address limit on a
    number of key platforms (x86, arm, arm64) before returning to
    user-space - without adding overhead to the typical system call fast
    path"

    * 'x86-syscall-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    arm64/syscalls: Check address limit on user-mode return
    arm/syscalls: Check address limit on user-mode return
    x86/syscalls: Check address limit on user-mode return

    Linus Torvalds
     

17 Aug, 2017

1 commit

  • Now that we have a custom printf format specifier, convert users of
    full_name to use %pOF instead. This is preparation to remove storing
    of the full path string for each node.

    Signed-off-by: Rob Herring
    Acked-by: Krzysztof Kozlowski
    Acked-by: Heiko Stuebner
    Reviewed-by: Geert Uytterhoeven
    Acked-by: Gregory CLEMENT
    Acked-by: Shawn Guo
    Acked-by: Simon Horman
    Cc: Russell King
    Cc: Kukjin Kim
    Cc: Javier Martinez Canillas
    Cc: Fabio Estevam
    Cc: Jason Cooper
    Cc: Andrew Lunn
    Cc: Sebastian Hesselbarth
    Cc: Tony Lindgren
    Cc: "Benoît Cousson"
    Cc: Paul Walmsley
    Cc: Magnus Damm
    Signed-off-by: Arnd Bergmann

    Rob Herring
     

14 Aug, 2017

1 commit

  • Robert Jarzmik reports that his PXA25x system fails to boot with 4.12,
    failing at __flush_whole_cache in arch/arm/mm/proc-xscale.S:215:

    0xc0019e20 : ldr r1, [pc, #788]
    0xc0019e24 : ldr r0, [r1]
    Tested-by: Robert Jarzmik
    Signed-off-by: Russell King

    Russell King
     

02 Aug, 2017

4 commits


28 Jul, 2017

1 commit

  • Pull ARM fixes from Russell King:
    "Two areas addressed by these fixes:

    - Fixes from Dave Martin for the signal frames that were broken with
    certain configurations. No one noticed until recently.

    - More kexec fixes to ensure that the crashkernel region is correctly
    allocated, and a fix for the location of the device tree when
    several kexec kernels are loaded"

    * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
    ARM: 8687/1: signal: Fix unparseable iwmmxt_sigframe in uc_regspace[]
    ARM: 8686/1: iwmmxt: Add missing __user annotations to sigframe accessors
    ARM: kexec: fix failure to boot crash kernel
    ARM: kexec: avoid allocating crashkernel region outside lowmem

    Linus Torvalds
     

24 Jul, 2017

2 commits

  • In kernels with CONFIG_IWMMXT=y running on non-iWMMXt hardware, the
    signal frame can be left partially uninitialised in such a way
    that userspace cannot parse uc_regspace[] safely. In particular,
    this means that the VFP registers cannot be located reliably in the
    signal frame when a multi_v7_defconfig kernel is run on the
    majority of platforms.

    The cause is that the uc_regspace[] is laid out statically based on
    the kernel config, but the decision of whether to save/restore the
    iWMMXt registers must be a runtime decision.

    To minimise breakage of software that may assume a fixed layout,
    this patch emits a dummy block of the same size as iwmmxt_sigframe,
    for non-iWMMXt threads. However, the magic and size of this block
    are now filled in to help parsers skip over it. A new DUMMY_MAGIC
    is defined for this purpose.

    It is probably legitimate (if non-portable) for userspace to
    manufacture its own sigframe for sigreturn, and there is no obvious
    reason why userspace should be required to insert a DUMMY_MAGIC
    block when running on non-iWMMXt hardware, when omitting it has
    worked just fine forever in other configurations. So in this case,
    sigreturn does not require this block to be present.

    Reported-by: Edmund Grimley-Evans
    Signed-off-by: Dave Martin
    Signed-off-by: Russell King

    Dave Martin
     
  • preserve_iwmmxt_context() and restore_iwmmxt_context() lack __user
    accessors on their arguments pointing to the user signal frame.

    There does not be appear to be a bug here, but this omission is
    inconsistent with the crunch and vfp sigframe access functions.

    This patch adds the annotations, for consistency.

    Signed-off-by: Dave Martin
    Signed-off-by: Russell King

    Dave Martin
     

20 Jul, 2017

2 commits

  • When kexec was converted to DTB, the dtb address was passed between
    machine_kexec_prepare() and machine_kexec() using a static variable.
    This is bad news if you load a crash kernel followed by a normal
    kernel or vice versa - the last loaded kernel overwrites the dtb
    address.

    This can result in kexec failures, as (eg) we try to boot the crash
    kernel with the last loaded dtb. For example, with:

    the crash kernel fails to find the dtb.

    Avoid this by defining a kimage architecture structure, and store
    the address to be passed in r2 there, which will either be the ATAGs
    or the dtb blob.

    Fixes: 4cabd1d9625c ("ARM: 7539/1: kexec: scan for dtb magic in segments")
    Fixes: 42d720d1731a ("ARM: kexec: Make .text R/W in machine_kexec")
    Reported-by: Keerthy
    Tested-by: Keerthy
    Signed-off-by: Russell King

    Russell King
     
  • Allocating the crashkernel region outside lowmem causes the kernel to
    oops while trying to kexec into the new kernel:

    Loading crashdump kernel...
    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    pgd = edd70000
    [00000000] *pgd=de19e835
    Internal error: Oops: 817 [#2] SMP ARM
    Modules linked in: ...
    CPU: 0 PID: 689 Comm: sh Not tainted 4.12.0-rc3-next-20170601-04015-gc3a5a20
    Hardware name: Generic DRA74X (Flattened Device Tree)
    task: edb32f00 task.stack: edf18000
    PC is at memcpy+0x50/0x330
    LR is at 0xe3c34001
    pc : [] lr : [] psr: 800c0193
    sp : edf19c2c ip : 0a000001 fp : c0553170
    r10: c055316e r9 : 00000001 r8 : e3130001
    r7 : e4903004 r6 : 0a000014 r5 : e3500000 r4 : e59f106c
    r3 : e59f0074 r2 : ffffffe8 r1 : c010fb88 r0 : 00000000
    Flags: Nzcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none
    Control: 10c5387d Table: add7006a DAC: 00000051
    Process sh (pid: 689, stack limit = 0xedf18218)
    Stack: (0xedf19c2c to 0xedf1a000)
    ...
    [] (memcpy) from [] (machine_kexec+0xa8/0x12c)
    [] (machine_kexec) from [] (__crash_kexec+0x5c/0x98)
    [] (__crash_kexec) from [] (crash_kexec+0x5c/0x68)
    [] (crash_kexec) from [] (die+0x228/0x490)
    [] (die) from [] (__do_kernel_fault.part.0+0x54/0x1e4)
    [] (__do_kernel_fault.part.0) from [] (do_page_fault+0x1e8/0x400)
    [] (do_page_fault) from [] (do_DataAbort+0x38/0xb8)
    [] (do_DataAbort) from [] (__dabt_svc+0x64/0xa0)

    This is caused by image->control_code_page being a highmem page, so
    page_address(image->control_code_page) returns NULL. In any case, we
    don't want the control page to be a highmem page.

    We already limit the crash kernel region to the top of 32-bit physical
    memory space. Also limit it to the top of lowmem in physical space.

    Reported-by: Keerthy
    Tested-by: Keerthy
    Signed-off-by: Russell King

    Russell King
     

15 Jul, 2017

1 commit


11 Jul, 2017

1 commit

  • The global variable 'rd_size' is declared as 'int' in source file
    arch/arm/kernel/atags_parse.c and as 'unsigned long' in
    drivers/block/brd.c. Fix this inconsistency.

    Additionally, remove the declarations of rd_image_start, rd_prompt and
    rd_doload from parse_tag_ramdisk() since these duplicate existing
    declarations in .

    Link: http://lkml.kernel.org/r/20170627065024.12347-1-bart.vanassche@wdc.com
    Signed-off-by: Bart Van Assche
    Acked-by: Russell King
    Cc: Jens Axboe
    Cc: Jan Kara
    Cc: Jason Yan
    Cc: Zhaohongjiang
    Cc: Miao Xie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bart Van Assche
     

10 Jul, 2017

1 commit

  • Since commit 97ad2bdcbe85 ("ARM/PCI: Convert PCI scan API to
    pci_scan_root_bus_bridge()") the space for struct pci_sys_data is allocated
    by pci_alloc_host_bridge() as part of the struct pci_host_bridge.

    Therefore, failure paths must deallocate the entire pci_host_bridge by
    using pci_free_host_bridge().

    Fixes: 97ad2bdcbe85 ("ARM/PCI: Convert PCI scan API to pci_scan_root_bus_bridge()")
    Signed-off-by: Lorenzo Pieralisi
    [bhelgaas: changelog]
    Signed-off-by: Bjorn Helgaas
    Cc: Jason Cooper
    Cc: Russell King
    Cc: Andrew Lunn

    Lorenzo Pieralisi