Skip to content
  1. Sep 04, 2020
  2. Sep 03, 2020
  3. Aug 28, 2020
    • James Morse's avatar
      KVM: arm64: Add kvm_extable for vaxorcism code · e9ee186b
      James Morse authored
      
      
      KVM has a one instruction window where it will allow an SError exception
      to be consumed by the hypervisor without treating it as a hypervisor bug.
      This is used to consume asynchronous external abort that were caused by
      the guest.
      
      As we are about to add another location that survives unexpected exceptions,
      generalise this code to make it behave like the host's extable.
      
      KVM's version has to be mapped to EL2 to be accessible on nVHE systems.
      
      The SError vaxorcism code is a one instruction window, so has two entries
      in the extable. Because the KVM code is copied for VHE and nVHE, we end up
      with four entries, half of which correspond with code that isn't mapped.
      
      Signed-off-by: default avatarJames Morse <james.morse@arm.com>
      Reviewed-by: default avatarMarc Zyngier <maz@kernel.org>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      e9ee186b
  4. Aug 27, 2020
  5. Aug 26, 2020
  6. Aug 23, 2020
  7. Aug 21, 2020
  8. Aug 12, 2020
  9. Aug 08, 2020
  10. Aug 07, 2020
    • Andrey Konovalov's avatar
      kasan, arm64: don't instrument functions that enable kasan · f9409d58
      Andrey Konovalov authored
      This patch prepares Software Tag-Based KASAN for stack tagging support.
      
      With stack tagging enabled, KASAN tags stack variable in each function in
      its prologue.  In start_kernel() stack variables get tagged before KASAN
      is enabled via setup_arch()->kasan_init().  As the result the tags for
      start_kernel()'s stack variables end up in the temporary shadow memory.
      Later when KASAN gets enabled, switched to normal shadow, and starts
      checking tags, this leads to false-positive reports, as proper tags are
      missing in normal shadow.
      
      Disable KASAN instrumentation for start_kernel().  Also disable it for
      arm64's setup_arch() as a precaution (it doesn't have any stack variables
      right now).
      
      [andreyknvl@google.com: reorder attributes for start_kernel()]
        Link: http://lkml.kernel.org/r/26fb6165a17abcf61222eda5184c030fb6b133d1.1596544734.git.andreyknvl@google.com
      
      
      
      Signed-off-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: Catalin Marinas <catalin.marinas@arm.com>	[arm64]
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Elena Petrova <lenaptr@google.com>
      Cc: Marco Elver <elver@google.com>
      Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
      Cc: Walter Wu <walter-zh.wu@mediatek.com>
      Cc: Ard Biesheuvel <ardb@kernel.org>
      Link: http://lkml.kernel.org/r/55d432671a92e931ab8234b03dc36b14d4c21bfb.1596199677.git.andreyknvl@google.com
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f9409d58
    • Mike Rapoport's avatar
      mm: remove unneeded includes of <asm/pgalloc.h> · ca15ca40
      Mike Rapoport authored
      
      
      Patch series "mm: cleanup usage of <asm/pgalloc.h>"
      
      Most architectures have very similar versions of pXd_alloc_one() and
      pXd_free_one() for intermediate levels of page table.  These patches add
      generic versions of these functions in <asm-generic/pgalloc.h> and enable
      use of the generic functions where appropriate.
      
      In addition, functions declared and defined in <asm/pgalloc.h> headers are
      used mostly by core mm and early mm initialization in arch and there is no
      actual reason to have the <asm/pgalloc.h> included all over the place.
      The first patch in this series removes unneeded includes of
      <asm/pgalloc.h>
      
      In the end it didn't work out as neatly as I hoped and moving
      pXd_alloc_track() definitions to <asm-generic/pgalloc.h> would require
      unnecessary changes to arches that have custom page table allocations, so
      I've decided to move lib/ioremap.c to mm/ and make pgalloc-track.h local
      to mm/.
      
      This patch (of 8):
      
      In most cases <asm/pgalloc.h> header is required only for allocations of
      page table memory.  Most of the .c files that include that header do not
      use symbols declared in <asm/pgalloc.h> and do not require that header.
      
      As for the other header files that used to include <asm/pgalloc.h>, it is
      possible to move that include into the .c file that actually uses symbols
      from <asm/pgalloc.h> and drop the include from the header file.
      
      The process was somewhat automated using
      
      	sed -i -E '/[<"]asm\/pgalloc\.h/d' \
                      $(grep -L -w -f /tmp/xx \
                              $(git grep -E -l '[<"]asm/pgalloc\.h'))
      
      where /tmp/xx contains all the symbols defined in
      arch/*/include/asm/pgalloc.h.
      
      [rppt@linux.ibm.com: fix powerpc warning]
      
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarPekka Enberg <penberg@kernel.org>
      Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>	[m68k]
      Cc: Abdul Haleem <abdhalee@linux.vnet.ibm.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: Matthew Wilcox <willy@infradead.org>
      Link: http://lkml.kernel.org/r/20200627143453.31835-1-rppt@kernel.org
      Link: http://lkml.kernel.org/r/20200627143453.31835-2-rppt@kernel.org
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ca15ca40
    • Guenter Roeck's avatar
      arm64: kaslr: Use standard early random function · 9bceb80b
      Guenter Roeck authored
      
      
      Commit 58552408 ("random: random.h should include archrandom.h, not
      the other way around") tries to fix a problem with recursive inclusion
      of linux/random.h and arch/archrandom.h for arm64.  Unfortunately, this
      results in the following compile error if ARCH_RANDOM is disabled.
      
        arch/arm64/kernel/kaslr.c: In function 'kaslr_early_init':
        arch/arm64/kernel/kaslr.c:128:6: error: implicit declaration of function '__early_cpu_has_rndr'; did you mean '__early_pfn_to_nid'? [-Werror=implicit-function-declaration]
          if (__early_cpu_has_rndr()) {
              ^~~~~~~~~~~~~~~~~~~~
              __early_pfn_to_nid
        arch/arm64/kernel/kaslr.c:131:7: error: implicit declaration of function '__arm64_rndr' [-Werror=implicit-function-declaration]
           if (__arm64_rndr(&raw))
               ^~~~~~~~~~~~
      
      The problem is that arch/archrandom.h is only included from
      linux/random.h if ARCH_RANDOM is enabled.  If not, __arm64_rndr() and
      __early_cpu_has_rndr() are undeclared, causing the problem.
      
      Use arch_get_random_seed_long_early() instead of arm64 specific
      functions to solve the problem.
      
      Reported-by: default avatarQian Cai <cai@lca.pw>
      Fixes: 58552408 ("random: random.h should include archrandom.h, not the other way around")
      Cc: Qian Cai <cai@lca.pw>
      Cc: Mark Brown <broonie@kernel.org>
      Reviewed-by: default avatarMark Rutland <mark.rutland@arm.com>
      Reviewed-by: default avatarMark Brown <broonie@kernel.org>
      Tested-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9bceb80b
  11. Aug 05, 2020
  12. Jul 31, 2020
  13. Jul 28, 2020
  14. Jul 27, 2020
  15. Jul 24, 2020
  16. Jul 23, 2020
  17. Jul 21, 2020
  18. Jul 20, 2020
  19. Jul 16, 2020
    • Will Deacon's avatar
      arm64: Use test_tsk_thread_flag() for checking TIF_SINGLESTEP · 5afc7855
      Will Deacon authored
      
      
      Rather than open-code test_tsk_thread_flag() at each callsite, simply
      replace the couple of offenders with calls to test_tsk_thread_flag()
      directly.
      
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      5afc7855
    • Will Deacon's avatar
      arm64: ptrace: Use NO_SYSCALL instead of -1 in syscall_trace_enter() · d83ee6e3
      Will Deacon authored
      
      
      Setting a system call number of -1 is special, as it indicates that the
      current system call should be skipped.
      
      Use NO_SYSCALL instead of -1 when checking for this scenario, which is
      different from the -1 returned due to a seccomp failure.
      
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Keno Fischer <keno@juliacomputing.com>
      Cc: Luis Machado <luis.machado@linaro.org>
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      d83ee6e3
    • Will Deacon's avatar
      arm64: syscall: Expand the comment about ptrace and syscall(-1) · 139dbe5d
      Will Deacon authored
      
      
      If a task executes syscall(-1), we intercept this early and force x0 to
      be -ENOSYS so that we don't need to distinguish this scenario from one
      where the scno is -1 because a tracer wants to skip the system call
      using ptrace. With the return value set, the return path is the same as
      the skip case.
      
      Although there is a one-line comment noting this in el0_svc_common(), it
      misses out most of the detail. Expand the comment to describe a bit more
      about what is going on.
      
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Keno Fischer <keno@juliacomputing.com>
      Cc: Luis Machado <luis.machado@linaro.org>
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      139dbe5d
Loading