1. 03 Dec, 2020 2 commits
    • Athira Rajeev's avatar
      powerpc/perf: Fix crash with is_sier_available when pmu is not set · f75e7d73
      Athira Rajeev authored
      On systems without any specific PMU driver support registered, running
      'perf record' with —intr-regs  will crash ( perf record -I <workload> ).
      
      The relevant portion from crash logs and Call Trace:
      
      Unable to handle kernel paging request for data at address 0x00000068
      Faulting instruction address: 0xc00000000013eb18
      Oops: Kernel access of bad area, sig: 11 [#1]
      CPU: 2 PID: 13435 Comm: kill Kdump: loaded Not tainted 4.18.0-193.el8.ppc64le #1
      NIP:  c00000000013eb18 LR: c000000000139f2c CTR: c000000000393d80
      REGS: c0000004a07ab4f0 TRAP: 0300   Not tainted  (4.18.0-193.el8.ppc64le)
      NIP [c00000000013eb18] is_sier_available+0x18/0x30
      LR [c000000000139f2c] perf_reg_value+0x6c/0xb0
      Call Trace:
      [c0000004a07ab770] [c0000004a07ab7c8] 0xc0000004a07ab7c8 (unreliable)
      [c0000004a07ab7a0] [c0000000003aa77c] perf_output_sample+0x60c/0xac0
      [c0000004a07ab840] [c0000000003ab3f0] perf_event_output_forward+0x70/0xb0
      [c0000004a07ab8c0] [c00000000039e208] __perf_event_overflow+0x88/0x1a0
      [c0000004a07ab910] [c00000000039e42c] perf_swevent_hrtimer+0x10c/0x1d0
      [c0000004a07abc50] [c000000000228b9c] __hrtimer_run_queues+0x17c/0x480
      [c0000004a07abcf0] [c00000000022aaf4] hrtimer_interrupt+0x144/0x520
      [c0000004a07abdd0] [c00000000002a864] timer_interrupt+0x104/0x2f0
      [c0000004a07abe30] [c0000000000091c4] decrementer_common+0x114/0x120
      
      When perf record session is started with "-I" option, capturing registers
      on each sample calls is_sier_available() to check for the
      SIER (Sample Instruction Event Register) availability in the platform.
      This function in core-book3s accesses 'ppmu->flags'. If a platform specific
      PMU driver is not registered, ppmu is set to NULL and accessing its
      members results in a crash. Fix the crash by returning false in
      is_sier_available() if ppmu is not set.
      
      Fixes: 333804dc ("powerpc/perf: Update perf_regs structure to include SIER")
      Reported-by: default avatarSachin Sant <sachinp@linux.vnet.ibm.com>
      Signed-off-by: default avatarAthira Rajeev <atrajeev@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/1606185640-1720-1-git-send-email-atrajeev@linux.vnet.ibm.com
      f75e7d73
    • Alan Modra's avatar
      powerpc/boot: Make use of REL16 relocs in powerpc/boot/util.S · 3d635aba
      Alan Modra authored
      Use bcl 20,31,0f rather than plain bl to avoid unbalancing the link
      stack.
      
      Update the code to use REL16 relocs, available for ppc64 in 2009 (and
      ppc32 in 2005).
      Signed-off-by: default avatarAlan Modra <amodra@gmail.com>
      [mpe: Incorporate more detail into the change log]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      3d635aba
  2. 26 Nov, 2020 7 commits
  3. 25 Nov, 2020 1 commit
  4. 23 Nov, 2020 2 commits
    • Stephen Rothwell's avatar
      powerpc/64s: Fix allnoconfig build since uaccess flush · b6b79dd5
      Stephen Rothwell authored
      Using DECLARE_STATIC_KEY_FALSE needs linux/jump_table.h.
      
      Otherwise the build fails with eg:
      
        arch/powerpc/include/asm/book3s/64/kup-radix.h:66:1: warning: data definition has no type or storage class
           66 | DECLARE_STATIC_KEY_FALSE(uaccess_flush_key);
      
      Fixes: 9a32a7e7 ("powerpc/64s: flush L1D after user accesses")
      Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      [mpe: Massage change log]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20201123184016.693fe464@canb.auug.org.au
      b6b79dd5
    • Michael Ellerman's avatar
      Merge tag 'powerpc-cve-2020-4788' into fixes · 962f8e64
      Michael Ellerman authored
      From Daniel's cover letter:
      
      IBM Power9 processors can speculatively operate on data in the L1 cache
      before it has been completely validated, via a way-prediction mechanism. It
      is not possible for an attacker to determine the contents of impermissible
      memory using this method, since these systems implement a combination of
      hardware and software security measures to prevent scenarios where
      protected data could be leaked.
      
      However these measures don't address the scenario where an attacker induces
      the operating system to speculatively execute instructions using data that
      the attacker controls. This can be used for example to speculatively bypass
      "kernel user access prevention" techniques, as discovered by Anthony
      Steinhauser of Google's Safeside Project. This is not an attack by itself,
      but there is a possibility it could be used in conjunction with
      side-channels or other weaknesses in the privileged code to construct an
      attack.
      
      This issue can be mitigated by flushing the L1 cache between privilege
      boundaries of concern.
      
      This patch series flushes the L1 cache on kernel entry (patch 2) and after the
      kernel performs any user accesses (patch 3). It also adds a self-test and
      performs some related cleanups.
      962f8e64
  5. 19 Nov, 2020 28 commits