1. 21 Feb, 2019 1 commit
  2. 20 Feb, 2019 18 commits
  3. 15 Feb, 2019 2 commits
    • Elena Reshetova's avatar
      uprobes: convert uprobe.ref to refcount_t · ce59b8e9
      Elena Reshetova authored
      atomic_t variables are currently used to implement reference
      counters with the following properties:
       - counter is initialized to 1 using atomic_set()
       - a resource is freed upon counter reaching zero
       - once counter reaches zero, its further
         increments aren't allowed
       - counter schema uses basic atomic operations
         (set, inc, inc_not_zero, dec_and_test, etc.)
      
      Such atomic variables should be converted to a newly provided
      refcount_t type and API that prevents accidental counter overflows
      and underflows. This is important since overflows and underflows
      can lead to use-after-free situation and be exploitable.
      
      The variable uprobe.ref is used as pure reference counter.
      Convert it to refcount_t and fix up the operations.
      
      **Important note for maintainers:
      
      Some functions from refcount_t API defined in lib/refcount.c
      have different memory ordering guarantees than their atomic
      counterparts.
      The full comparison can be seen in
      https://lkml.org/lkml/2017/11/15/57 and it is hopefully soon
      in state to be merged to the documentation tree.
      Normally the differences should not matter since refcount_t provides
      enough guarantees to satisfy the refcounting use cases, but in
      some rare cases it might matter.
      Please double check that you don't have some undocumented
      memory guarantees for this variable usage.
      
      For the uprobe.ref it might make a difference
      in following places:
       - put_uprobe(): decrement in refcount_dec_and_test() only
         provides RELEASE ordering and control dependency on success
         vs. fully ordered atomic counterpart
      
      Link: http://lkml.kernel.org/r/1547637627-29526-1-git-send-email-elena.reshetova@intel.comSuggested-by: default avatarKees Cook <keescook@chromium.org>
      Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
      Reviewed-by: default avatarDavid Windsor <dwindsor@gmail.com>
      Reviewed-by: default avatarHans Liljestrand <ishkamiel@gmail.com>
      Reviewed-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      Signed-off-by: default avatarElena Reshetova <elena.reshetova@intel.com>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      ce59b8e9
    • Steven Rostedt (VMware)'s avatar
      ftrace: Allow enabling of filters via index of available_filter_functions · f79b3f33
      Steven Rostedt (VMware) authored
      Enabling of large number of functions by echoing in a large subset of the
      functions in available_filter_functions can take a very long time. The
      process requires testing all functions registered by the function tracer
      (which is in the 10s of thousands), and doing a kallsyms lookup to convert
      the ip address into a name, then comparing that name with the string passed
      in.
      
      When a function causes the function tracer to crash the system, a binary
      bisect of the available_filter_functions can be done to find the culprit.
      But this requires passing in half of the functions in
      available_filter_functions over and over again, which makes it basically a
      O(n^2) operation. With 40,000 functions, that ends up bing 1,600,000,000
      opertions! And enabling this can take over 20 minutes.
      
      As a quick speed up, if a number is passed into one of the filter files,
      instead of doing a search, it just enables the function at the corresponding
      line of the available_filter_functions file. That is:
      
       # echo 50 > set_ftrace_filter
       # cat set_ftrace_filter
       x86_pmu_commit_txn
      
       # head -50 available_filter_functions | tail -1
       x86_pmu_commit_txn
      
      This allows setting of half the available_filter_functions to take place in
      less than a second!
      
       # time seq 20000 > set_ftrace_filter
       real    0m0.042s
       user    0m0.005s
       sys     0m0.015s
      
       # wc -l set_ftrace_filter
       20000 set_ftrace_filter
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      f79b3f33
  4. 11 Feb, 2019 1 commit
    • Changbin Du's avatar
      tracing: Change the function format to display function names by perf · 85acbb21
      Changbin Du authored
      Here is an example for this change.
      
      $ sudo perf record -e 'ftrace:function' --filter='ip==schedule'
      $ sudo perf report
      
      The output of perf before this patch:
      
      \# Samples: 100  of event 'ftrace:function'
      \# Event count (approx.): 100
      \#
      \# Overhead  Trace output
      \# ........  ......................................
      \#
          51.00%   ffffffff81f6aaa0 <-- ffffffff81158e8d
          29.00%   ffffffff81f6aaa0 <-- ffffffff8116ccb2
           8.00%   ffffffff81f6aaa0 <-- ffffffff81f6f2ed
           4.00%   ffffffff81f6aaa0 <-- ffffffff811628db
           4.00%   ffffffff81f6aaa0 <-- ffffffff81f6ec5b
           2.00%   ffffffff81f6aaa0 <-- ffffffff81f6f21a
           1.00%   ffffffff81f6aaa0 <-- ffffffff811b04af
           1.00%   ffffffff81f6aaa0 <-- ffffffff8143ce17
      
      After this patch:
      
      \# Samples: 36  of event 'ftrace:function'
      \# Event count (approx.): 36
      \#
      \# Overhead  Trace output
      \# ........  ............................................
      \#
          38.89%   schedule <-- schedule_hrtimeout_range_clock
          27.78%   schedule <-- worker_thread
          13.89%   schedule <-- schedule_timeout
          11.11%   schedule <-- smpboot_thread_fn
           5.56%   schedule <-- rcu_gp_kthread
           2.78%   schedule <-- exit_to_usermode_loop
      
      Link: http://lkml.kernel.org/r/20190209161919.32350-1-changbin.du@gmail.comSigned-off-by: default avatarChangbin Du <changbin.du@gmail.com>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      85acbb21
  5. 06 Feb, 2019 9 commits
  6. 03 Feb, 2019 6 commits
    • Linus Torvalds's avatar
      Linux 5.0-rc5 · 8834f560
      Linus Torvalds authored
      8834f560
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 24b888d8
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A few updates for x86:
      
         - Fix an unintended sign extension issue in the fault handling code
      
         - Rename the new resource control config switch so it's less
           confusing
      
         - Avoid setting up EFI info in kexec when the EFI runtime is
           disabled.
      
         - Fix the microcode version check in the AMD microcode loader so it
           only loads higher version numbers and never downgrades
      
         - Set EFER.LME in the 32bit trampoline before returning to long mode
           to handle older AMD/KVM behaviour properly.
      
         - Add Darren and Andy as x86/platform reviewers"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/resctrl: Avoid confusion over the new X86_RESCTRL config
        x86/kexec: Don't setup EFI info if EFI runtime is not enabled
        x86/microcode/amd: Don't falsely trick the late loading mechanism
        MAINTAINERS: Add Andy and Darren as arch/x86/platform/ reviewers
        x86/fault: Fix sign-extend unintended sign extension
        x86/boot/compressed/64: Set EFER.LME=1 in 32-bit trampoline before returning to long mode
        x86/cpu: Add Atom Tremont (Jacobsville)
      24b888d8
    • Linus Torvalds's avatar
      Merge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · cc6810e3
      Linus Torvalds authored
      Pull cpu hotplug fixes from Thomas Gleixner:
       "Two fixes for the cpu hotplug machinery:
      
         - Replace the overly clever 'SMT disabled by BIOS' detection logic as
           it breaks KVM scenarios and prevents speculation control updates
           when the Hyperthreads are brought online late after boot.
      
         - Remove a redundant invocation of the speculation control update
           function"
      
      * 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        cpu/hotplug: Fix "SMT disabled by BIOS" detection for KVM
        x86/speculation: Remove redundant arch_smt_update() invocation
      cc6810e3
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 58f6d428
      Linus Torvalds authored
      Pull perf fixes from Thomas Gleixner:
       "A pile of perf updates:
      
         - Fix broken sanity check in the /proc/sys/kernel/perf_cpu_time_max_percent
           write handler
      
         - Cure a perf script crash which caused by an unitinialized data
           structure
      
         - Highlight the hottest instruction in perf top and not a random one
      
         - Cure yet another clang issue when building perf python
      
         - Handle topology entries with no CPU correctly in the tools
      
         - Handle perf data which contains both tracepoints and performance
           counter entries correctly.
      
         - Add a missing NULL pointer check in perf ordered_events_free()"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf script: Fix crash when processing recorded stat data
        perf top: Fix wrong hottest instruction highlighted
        perf tools: Handle TOPOLOGY headers with no CPU
        perf python: Remove -fstack-clash-protection when building with some clang versions
        perf core: Fix perf_proc_update_handler() bug
        perf script: Fix crash with printing mixed trace point and other events
        perf ordered_events: Fix crash in ordered_events__free
      58f6d428
    • Linus Torvalds's avatar
      Merge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 89401be6
      Linus Torvalds authored
      Pull EFI fix from Thomas Gleixner:
       "The dump info for the efi page table debugging lacks a terminator
        which causes the kernel to crash when the debugfile is read"
      
      * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        efi/arm64: Fix debugfs crash by adding a terminator for ptdump marker
      89401be6
    • Linus Torvalds's avatar
      Merge tag 'for-5.0-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 312b3a93
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
      
       - regression fix: transaction commit can run away due to delayed ref
         waiting heuristic, this is not necessary now because of the proper
         reservation mechanism introduced in 5.0
      
       - regression fix: potential crash due to use-before-check of an ERR_PTR
         return value
      
       - fix for transaction abort during transaction commit that needs to
         properly clean up pending block groups
      
       - fix deadlock during b-tree node/leaf splitting, when this happens on
         some of the fundamental trees, we must prevent new tree block
         allocation to re-enter indirectly via the block group flushing path
      
       - potential memory leak after errors during mount
      
      * tag 'for-5.0-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: On error always free subvol_name in btrfs_mount
        btrfs: clean up pending block groups when transaction commit aborts
        btrfs: fix potential oops in device_list_add
        btrfs: don't end the transaction for delayed refs in throttle
        Btrfs: fix deadlock when allocating tree block during leaf/node split
      312b3a93
  7. 02 Feb, 2019 3 commits
    • Linus Torvalds's avatar
      Merge tag 'devicetree-fixes-for-5.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · 12491ed3
      Linus Torvalds authored
      Pull Devicetree fix from Rob Herring:
       "A single fix for building DT bindings in-tree"
      
      * tag 'devicetree-fixes-for-5.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        dt-bindings: Fix dt_binding_check target for in tree builds
      12491ed3
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.0-rc5' of... · 74b13e7e
      Linus Torvalds authored
      Merge tag 'riscv-for-linus-5.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux
      
      Pull RISC-V fixes from Palmer Dabbelt:
       "This contains a handful of mostly-independent patches:
      
         - make our port respect TIF_NEED_RESCHED, which fixes
           CONFIG_PREEMPT=y kernels
      
         - fix double-put of OF nodes
      
         - fix a misspelling of target in our Kconfig
      
         - generic PCIe is enabled in our defconfig
      
         - fix our SBI early console to properly handle line
           endings
      
         - fix max_low_pfn being counted in PFNs
      
         - a change to TASK_UNMAPPED_BASE to match what other
           arches do
      
        This has passed my standard 'boot Fedora' flow"
      
      * tag 'riscv-for-linus-5.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux:
        riscv: Adjust mmap base address at a third of task size
        riscv: fixup max_low_pfn with PFN_DOWN.
        tty/serial: use uart_console_write in the RISC-V SBL early console
        RISC-V: defconfig: Add CRYPTO_DEV_VIRTIO=y
        RISC-V: defconfig: Enable Generic PCIE by default
        RISC-V: defconfig: Move CONFIG_PCI{,E_XILINX}
        RISC-V: Kconfig: fix spelling mistake "traget" -> "target"
        RISC-V: asm/page.h: fix spelling mistake "CONFIG_64BITS" -> "CONFIG_64BIT"
        RISC-V: fix bad use of of_node_put
        RISC-V: Add _TIF_NEED_RESCHED check for kernel thread when CONFIG_PREEMPT=y
      74b13e7e
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20190202' of git://git.kernel.dk/linux-block · c8864cb7
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "A few fixes that should go into this release. This contains:
      
         - MD pull request from Song, fixing a recovery OOM issue (Alexei)
      
         - Fix for a sync related stall (Jianchao)
      
         - Dummy callback for timeouts (Tetsuo)
      
         - IDE atapi sense ordering fix (me)"
      
      * tag 'for-linus-20190202' of git://git.kernel.dk/linux-block:
        ide: ensure atapi sense request aren't preempted
        blk-mq: fix a hung issue when fsync
        block: pass no-op callback to INIT_WORK().
        md/raid5: fix 'out of memory' during raid cache recovery
      c8864cb7