1. 23 Oct, 2019 6 commits
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.4-rc3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · fa8a74de
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
       "Two minor fixes:
      
         - A race in perf trace initialization (missing mutexes)
      
         - Minor fix to represent gfp_t in synthetic events as properly
           signed"
      
      * tag 'trace-v5.4-rc3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Fix race in perf_trace_buf initialization
        tracing: Fix "gfp_t" format for synthetic events
      fa8a74de
    • Linus Torvalds's avatar
      Merge tag 'vfio-v5.4-rc5' of git://github.com/awilliam/linux-vfio · 64131618
      Linus Torvalds authored
      Pull VFIO fixlet from Alex Williamson:
       "Fix (false) uninitialized variable warning (Joerg Roedel)"
      
      * tag 'vfio-v5.4-rc5' of git://github.com/awilliam/linux-vfio:
        vfio/type1: Initialize resv_msi_base
      64131618
    • Linus Torvalds's avatar
      Merge tag 'regulator-fix-v5.4-rc4' of... · deed1d44
      Linus Torvalds authored
      Merge tag 'regulator-fix-v5.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
      
      Pull regulator fixes from Mark Brown:
       "There are a few core fixes here around error handling and handling if
        suspend mode configuration and some driver specific fixes here but the
        most important change is the fix to the fixed-regulator DT schema
        conversion introduced during the last merge window.
      
        That fixes one of the last two errors preventing successful execution
        of "make dt_binding_check" which will be enormously helpful for DT
        schema development"
      
      * tag 'regulator-fix-v5.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
        regulator: qcom-rpmh: Fix PMIC5 BoB min voltage
        regulator: pfuze100-regulator: Variable "val" in pfuze100_regulator_probe() could be uninitialized
        regulator: lochnagar: Add on_off_delay for VDDCORE
        regulator: ti-abb: Fix timeout in ti_abb_wait_txdone/ti_abb_clear_all_txdone
        regulator: da9062: fix suspend_enable/disable preparation
        dt-bindings: fixed-regulator: fix compatible enum
        regulator: fixed: Prevent NULL pointer dereference when !CONFIG_OF
        regulator: core: make regulator_register() EPROBE_DEFER aware
        regulator: of: fix suspend-min/max-voltage parsing
      deed1d44
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm · 13b86bc4
      Linus Torvalds authored
      :Pull ARM fixes from Russell King:
      
       - fix for alignment faults under high memory pressure
      
       - use u32 for ARM instructions in fault handler
      
       - mark functions that must always be inlined with __always_inline
      
       - fix for nommu XIP
      
       - fix ARMv7M switch to handler mode in reboot path
      
       - fix the recently introduced AMBA reset control error paths
      
      * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
        ARM: 8926/1: v7m: remove register save to stack before svc
        ARM: 8914/1: NOMMU: Fix exc_ret for XIP
        ARM: 8908/1: add __always_inline to functions called from __get_user_check()
        ARM: mm: alignment: use "u32" for 32-bit instructions
        ARM: mm: fix alignment handler faults under memory pressure
        drivers/amba: fix reset control error handling
      13b86bc4
    • Linus Torvalds's avatar
      Merge tag 'edac_urgent_for_5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras · e969c860
      Linus Torvalds authored
      Pull EDAC fix from Borislav Petkov:
       "Fix ghes_edac UAF case triggered by KASAN and DEBUG_TEST_DRIVER_REMOVE.
      
        Future pending rework of the ghes_edac instances registration will do
        away with the single memory controller per system model and that ugly
        hackery there.
      
        This is a minimal fix for stable@, courtesy of James Morse"
      
      * tag 'edac_urgent_for_5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
        EDAC/ghes: Fix Use after free in ghes_edac remove path
      e969c860
    • Linus Torvalds's avatar
      Merge tag 'for-5.4-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 54955e3b
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
      
       - fixes of error handling cleanup of metadata accounting with qgroups
         enabled
      
       - fix swapped values for qgroup tracepoints
      
       - fix race when handling full sync flag
      
       - don't start unused worker thread, functionality removed already
      
      * tag 'for-5.4-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        Btrfs: check for the full sync flag while holding the inode lock during fsync
        Btrfs: fix qgroup double free after failure to reserve metadata for delalloc
        btrfs: tracepoints: Fix bad entry members of qgroup events
        btrfs: tracepoints: Fix wrong parameter order for qgroup events
        btrfs: qgroup: Always free PREALLOC META reserve in btrfs_delalloc_release_extents()
        btrfs: don't needlessly create extent-refs kernel thread
        btrfs: block-group: Fix a memory leak due to missing btrfs_put_block_group()
        Btrfs: add missing extents release on file extent cluster relocation error
      54955e3b
  2. 22 Oct, 2019 2 commits
    • Russell King's avatar
      Merge branch 'misc' into fixes · 39f4d441
      Russell King authored
      39f4d441
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v5.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 3b7c59a1
      Linus Torvalds authored
      Pull pin control fixes from Linus Walleij:
       "Here is a bunch of pin control fixes. I was lagging behind on this
        one, some fixes should have come in earlier, sorry about that.
      
        Anyways here it is, pretty straight-forward fixes, the Strago fix
        stand out as something serious affecting a lot of machines.
      
        Summary:
         - Handle multiple instances of Intel chips without complaining.
         - Restore the Intel Strago DMI workaround
         - Make the Armada 37xx handle pins over 32
         - Fix the polarity of the LED group on Armada 37xx
         - Fix an off-by-one bug in the NS2 driver
         - Fix error path for iproc's platform_get_irq()
         - Fix error path on the STMFX driver
         - Fix a typo in the Berlin AS370 driver
         - Fix up misc errors in the Aspeed 2600 BMC support
         - Fix a stray SPDX tag"
      
      * tag 'pinctrl-v5.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: aspeed-g6: Rename SD3 to EMMC and rework pin groups
        pinctrl: aspeed-g6: Fix UART13 group pinmux
        pinctrl: aspeed-g6: Make SIG_DESC_CLEAR() behave intuitively
        pinctrl: aspeed-g6: Fix I3C3/I3C4 pinmux configuration
        pinctrl: aspeed-g6: Fix I2C14 SDA description
        pinctrl: aspeed-g6: Sort pins for sanity
        dt-bindings: pinctrl: aspeed-g6: Rework SD3 function and groups
        pinctrl: berlin: as370: fix a typo s/spififib/spdifib
        pinctrl: armada-37xx: swap polarity on LED group
        pinctrl: stmfx: fix null pointer on remove
        pinctrl: iproc: allow for error from platform_get_irq()
        pinctrl: ns2: Fix off by one bugs in ns2_pinmux_enable()
        pinctrl: bcm-iproc: Use SPDX header
        pinctrl: armada-37xx: fix control of pins 32 and up
        pinctrl: cherryview: restore Strago DMI workaround for all versions
        pinctrl: intel: Allocate IRQ chip dynamic
      3b7c59a1
  3. 21 Oct, 2019 2 commits
    • Prateek Sood's avatar
      tracing: Fix race in perf_trace_buf initialization · 6b1340cc
      Prateek Sood authored
      A race condition exists while initialiazing perf_trace_buf from
      perf_trace_init() and perf_kprobe_init().
      
            CPU0                                        CPU1
      perf_trace_init()
        mutex_lock(&event_mutex)
          perf_trace_event_init()
            perf_trace_event_reg()
              total_ref_count == 0
      	buf = alloc_percpu()
              perf_trace_buf[i] = buf
              tp_event->class->reg() //fails       perf_kprobe_init()
      	goto fail                              perf_trace_event_init()
                                                       perf_trace_event_reg()
              fail:
      	  total_ref_count == 0
      
                                                         total_ref_count == 0
                                                         buf = alloc_percpu()
                                                         perf_trace_buf[i] = buf
                                                         tp_event->class->reg()
                                                         total_ref_count++
      
                free_percpu(perf_trace_buf[i])
                perf_trace_buf[i] = NULL
      
      Any subsequent call to perf_trace_event_reg() will observe total_ref_count > 0,
      causing the perf_trace_buf to be always NULL. This can result in perf_trace_buf
      getting accessed from perf_trace_buf_alloc() without being initialized. Acquiring
      event_mutex in perf_kprobe_init() before calling perf_trace_event_init() should
      fix this race.
      
      The race caused the following bug:
      
       Unable to handle kernel paging request at virtual address 0000003106f2003c
       Mem abort info:
         ESR = 0x96000045
         Exception class = DABT (current EL), IL = 32 bits
         SET = 0, FnV = 0
         EA = 0, S1PTW = 0
       Data abort info:
         ISV = 0, ISS = 0x00000045
         CM = 0, WnR = 1
       user pgtable: 4k pages, 39-bit VAs, pgdp = ffffffc034b9b000
       [0000003106f2003c] pgd=0000000000000000, pud=0000000000000000
       Internal error: Oops: 96000045 [#1] PREEMPT SMP
       Process syz-executor (pid: 18393, stack limit = 0xffffffc093190000)
       pstate: 80400005 (Nzcv daif +PAN -UAO)
       pc : __memset+0x20/0x1ac
       lr : memset+0x3c/0x50
       sp : ffffffc09319fc50
      
        __memset+0x20/0x1ac
        perf_trace_buf_alloc+0x140/0x1a0
        perf_trace_sys_enter+0x158/0x310
        syscall_trace_enter+0x348/0x7c0
        el0_svc_common+0x11c/0x368
        el0_svc_handler+0x12c/0x198
        el0_svc+0x8/0xc
      
      Ramdumps showed the following:
        total_ref_count = 3
        perf_trace_buf = (
            0x0 -> NULL,
            0x0 -> NULL,
            0x0 -> NULL,
            0x0 -> NULL)
      
      Link: http://lkml.kernel.org/r/1571120245-4186-1-git-send-email-prsood@codeaurora.org
      
      Cc: stable@vger.kernel.org
      Fixes: e12f03d7 ("perf/core: Implement the 'perf_kprobe' PMU")
      Acked-by: default avatarSong Liu <songliubraving@fb.com>
      Signed-off-by: default avatarPrateek Sood <prsood@codeaurora.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      6b1340cc
    • afzal mohammed's avatar
      ARM: 8926/1: v7m: remove register save to stack before svc · 2ecb2879
      afzal mohammed authored
      r0-r3 & r12 registers are saved & restored, before & after svc
      respectively. Intention was to preserve those registers across thread to
      handler mode switch.
      
      On v7-M, hardware saves the register context upon exception in AAPCS
      complaint way. Restoring r0-r3 & r12 is done from stack location where
      hardware saves it, not from the location on stack where these registers
      were saved.
      
      To clarify, on stm32f429 discovery board:
      
      1. before svc, sp - 0x90009ff8
      2. r0-r3,r12 saved to 0x90009ff8 - 0x9000a00b
      3. upon svc, h/w decrements sp by 32 & pushes registers onto stack
      4. after svc,  sp - 0x90009fd8
      5. r0-r3,r12 restored from 0x90009fd8 - 0x90009feb
      
      Above means r0-r3,r12 is not restored from the location where they are
      saved, but since hardware pushes the registers onto stack, the registers
      are restored correctly.
      
      Note that during register saving to stack (step 2), it goes past
      0x9000a000. And it seems, based on objdump, there are global symbols
      residing there, and it perhaps can cause issues on a non-XIP Kernel
      (on XIP, data section is setup later).
      
      Based on the analysis above, manually saving registers onto stack is at
      best no-op and at worst can cause data section corruption. Hence remove
      storing of registers onto stack before svc.
      
      Fixes: b70cd406 ("ARM: 8671/1: V7M: Preserve registers across switch from Thread to Handler mode")
      Signed-off-by: default avatarafzal mohammed <afzal.mohd.ma@gmail.com>
      Acked-by: default avatarVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      2ecb2879
  4. 20 Oct, 2019 6 commits
  5. 19 Oct, 2019 24 commits