1. 04 7月, 2017 4 次提交
    • L
      Merge branch 'core-objtool-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e94693f7
      Linus Torvalds 提交于
      Pull objtool updates from Ingo Molnar:
       "This is an extensive rewrite of the objdump tool to track all stack
        pointer modifications through the machine instructions of disassembled
        functions found in kernel .o files.
      
        This re-design removes the prior dependency on CONFIG_FRAME_POINTERS,
        with the goal to prepare the tool to generate kernel debuginfo data in
        the future. There's also an increase in checking/tracking robustness
        as a side effect as well.
      
        No (intended) changes to existing functionality"
      
      * 'core-objtool-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        objtool: Silence warnings for functions which use IRET
        objtool: Implement stack validation 2.0
        objtool, x86: Add several functions and files to the objtool whitelist
        objtool: Move checking code to check.c
      e94693f7
    • L
      Merge tag 'edac_for_4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp · 26d3a77d
      Linus Torvalds 提交于
      Pull EDAC updates from Borislav Petkov:
       "Nothing earth-shattering - just the normal development flow of
        cleanups, improvements, fixes and such.
      
        Summary:
      
         - i31200_edac: Add Kabylake support (Jason Baron)
      
         - sb_edac: resolve memory controller detection issues on asymmetric
           setups with not all DIMM slots being populated (Tony Luck and Qiuxu
           Zhuo)
      
         - misc cleanups and fixlets all over"
      
      * tag 'edac_for_4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: (22 commits)
        EDAC, pnd2: Fix Apollo Lake DIMM detection
        EDAC, i5000, i5400: Fix definition of NRECMEMB register
        EDAC, pnd2: Make function sbi_send() static
        EDAC, pnd2: Return proper error value from apl_rd_reg()
        EDAC, altera: Simplify calculation of total memory
        EDAC, sb_edac: Avoid creating SOCK memory controller
        EDAC, mce_amd: Fix typo in SMCA error description
        EDAC, mv64x60: Sanity check edac_op_state before registering
        EDAC, thunderx: Fix a warning during l2c debugfs node creation
        EDAC, mv64x60: Check driver registration success
        EDAC, ie31200: Add Intel Kaby Lake CPU support
        EDAC, mv64x60: Replace in_le32()/out_le32() with readl()/writel()
        EDAC, mv64x60: Fix pdata->name
        EDAC, sb_edac: Bump driver version and do some cleanups
        EDAC, sb_edac: Check if ECC enabled when at least one DIMM is present
        EDAC, sb_edac: Drop NUM_CHANNELS from 8 back to 4
        EDAC, sb_edac: Carve out dimm-populating loop
        EDAC, sb_edac: Fix mod_name
        EDAC, sb_edac: Assign EDAC memory controller per h/w controller
        EDAC, sb_edac: Don't use "Socket#" in the memory controller name
        ...
      26d3a77d
    • L
      Merge branch 'for-4.13/block' of git://git.kernel.dk/linux-block · c6b1e36c
      Linus Torvalds 提交于
      Pull core block/IO updates from Jens Axboe:
       "This is the main pull request for the block layer for 4.13. Not a huge
        round in terms of features, but there's a lot of churn related to some
        core cleanups.
      
        Note this depends on the UUID tree pull request, that Christoph
        already sent out.
      
        This pull request contains:
      
         - A series from Christoph, unifying the error/stats codes in the
           block layer. We now use blk_status_t everywhere, instead of using
           different schemes for different places.
      
         - Also from Christoph, some cleanups around request allocation and IO
           scheduler interactions in blk-mq.
      
         - And yet another series from Christoph, cleaning up how we handle
           and do bounce buffering in the block layer.
      
         - A blk-mq debugfs series from Bart, further improving on the support
           we have for exporting internal information to aid debugging IO
           hangs or stalls.
      
         - Also from Bart, a series that cleans up the request initialization
           differences across types of devices.
      
         - A series from Goldwyn Rodrigues, allowing the block layer to return
           failure if we will block and the user asked for non-blocking.
      
         - Patch from Hannes for supporting setting loop devices block size to
           that of the underlying device.
      
         - Two series of patches from Javier, fixing various issues with
           lightnvm, particular around pblk.
      
         - A series from me, adding support for write hints. This comes with
           NVMe support as well, so applications can help guide data placement
           on flash to improve performance, latencies, and write
           amplification.
      
         - A series from Ming, improving and hardening blk-mq support for
           stopping/starting and quiescing hardware queues.
      
         - Two pull requests for NVMe updates. Nothing major on the feature
           side, but lots of cleanups and bug fixes. From the usual crew.
      
         - A series from Neil Brown, greatly improving the bio rescue set
           support. Most notably, this kills the bio rescue work queues, if we
           don't really need them.
      
         - Lots of other little bug fixes that are all over the place"
      
      * 'for-4.13/block' of git://git.kernel.dk/linux-block: (217 commits)
        lightnvm: pblk: set line bitmap check under debug
        lightnvm: pblk: verify that cache read is still valid
        lightnvm: pblk: add initialization check
        lightnvm: pblk: remove target using async. I/Os
        lightnvm: pblk: use vmalloc for GC data buffer
        lightnvm: pblk: use right metadata buffer for recovery
        lightnvm: pblk: schedule if data is not ready
        lightnvm: pblk: remove unused return variable
        lightnvm: pblk: fix double-free on pblk init
        lightnvm: pblk: fix bad le64 assignations
        nvme: Makefile: remove dead build rule
        blk-mq: map all HWQ also in hyperthreaded system
        nvmet-rdma: register ib_client to not deadlock in device removal
        nvme_fc: fix error recovery on link down.
        nvmet_fc: fix crashes on bad opcodes
        nvme_fc: Fix crash when nvme controller connection fails.
        nvme_fc: replace ioabort msleep loop with completion
        nvme_fc: fix double calls to nvme_cleanup_cmd()
        nvme-fabrics: verify that a controller returns the correct NQN
        nvme: simplify nvme_dev_attrs_are_visible
        ...
      c6b1e36c
    • L
      Merge tag 'uuid-for-4.13' of git://git.infradead.org/users/hch/uuid · 81e3e044
      Linus Torvalds 提交于
      Pull uuid subsystem from Christoph Hellwig:
       "This is the new uuid subsystem, in which Amir, Andy and I have started
        consolidating our uuid/guid helpers and improving the types used for
        them. Note that various other subsystems have pulled in this tree, so
        I'd like it to go in early.
      
        UUID/GUID summary:
      
         - introduce the new uuid_t/guid_t types that are going to replace the
           somewhat confusing uuid_be/uuid_le types and make the terminology
           fit the various specs, as well as the userspace libuuid library.
           (me, based on a previous version from Amir)
      
         - consolidated generic uuid/guid helper functions lifted from XFS and
           libnvdimm (Amir and me)
      
         - conversions to the new types and helpers (Amir, Andy and me)"
      
      * tag 'uuid-for-4.13' of git://git.infradead.org/users/hch/uuid: (34 commits)
        ACPI: hns_dsaf_acpi_dsm_guid can be static
        mmc: sdhci-pci: make guid intel_dsm_guid static
        uuid: Take const on input of uuid_is_null() and guid_is_null()
        thermal: int340x_thermal: fix compile after the UUID API switch
        thermal: int340x_thermal: Switch to use new generic UUID API
        acpi: always include uuid.h
        ACPI: Switch to use generic guid_t in acpi_evaluate_dsm()
        ACPI / extlog: Switch to use new generic UUID API
        ACPI / bus: Switch to use new generic UUID API
        ACPI / APEI: Switch to use new generic UUID API
        acpi, nfit: Switch to use new generic UUID API
        MAINTAINERS: add uuid entry
        tmpfs: generate random sb->s_uuid
        scsi_debug: switch to uuid_t
        nvme: switch to uuid_t
        sysctl: switch to use uuid_t
        partitions/ldm: switch to use uuid_t
        overlayfs: use uuid_t instead of uuid_be
        fs: switch ->s_uuid to uuid_t
        ima/policy: switch to use uuid_t
        ...
      81e3e044
  2. 03 7月, 2017 4 次提交
  3. 02 7月, 2017 1 次提交
    • L
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e18aca02
      Linus Torvalds 提交于
      Pull x86 fixes from Thomas Gleixner:
       "Fixlets for x86:
      
         - Prevent kexec crash when KASLR is enabled, which was caused by an
           address calculation bug
      
         - Restore the freeing of PUDs on memory hot remove
      
         - Correct a negated pointer check in the intel uncore performance
           monitoring driver
      
         - Plug a memory leak in an error exit path in the RDT code"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/intel_rdt: Fix memory leak on mount failure
        x86/boot/KASLR: Fix kexec crash due to 'virt_addr' calculation bug
        x86/boot/KASLR: Add checking for the offset of kernel virtual address randomization
        perf/x86/intel/uncore: Fix wrong box pointer check
        x86/mm/hotplug: Fix BUG_ON() after hot-remove by not freeing PUD
      e18aca02
  4. 01 7月, 2017 22 次提交
  5. 30 6月, 2017 9 次提交
    • J
      objtool: Implement stack validation 2.0 · baa41469
      Josh Poimboeuf 提交于
      This is a major rewrite of objtool.  Instead of only tracking frame
      pointer changes, it now tracks all stack-related operations, including
      all register saves/restores.
      
      In addition to making stack validation more robust, this also paves the
      way for undwarf generation.
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: live-patching@vger.kernel.org
      Link: http://lkml.kernel.org/r/678bd94c0566c6129bcc376cddb259c4c5633004.1498659915.git.jpoimboe@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      baa41469
    • J
      objtool, x86: Add several functions and files to the objtool whitelist · c207aee4
      Josh Poimboeuf 提交于
      In preparation for an objtool rewrite which will have broader checks,
      whitelist functions and files which cause problems because they do
      unusual things with the stack.
      
      These whitelists serve as a TODO list for which functions and files
      don't yet have undwarf unwinder coverage.  Eventually most of the
      whitelists can be removed in favor of manual CFI hint annotations or
      objtool improvements.
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: live-patching@vger.kernel.org
      Link: http://lkml.kernel.org/r/7f934a5d707a574bda33ea282e9478e627fb1829.1498659915.git.jpoimboe@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      c207aee4
    • J
      objtool: Move checking code to check.c · dcc914f4
      Josh Poimboeuf 提交于
      In preparation for the new 'objtool undwarf generate' command, which
      will rely on 'objtool check', move the checking code from
      builtin-check.c to check.c where it can be used by other commands.
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Reviewed-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: live-patching@vger.kernel.org
      Link: http://lkml.kernel.org/r/294c5c695fd73c1a5000bbe5960a7c9bec4ee6b4.1498659915.git.jpoimboe@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      dcc914f4
    • B
      x86/boot/KASLR: Fix kexec crash due to 'virt_addr' calculation bug · 8eabf42a
      Baoquan He 提交于
      Kernel text KASLR is separated into physical address and virtual
      address randomization. And for virtual address randomization, we
      only randomiza to get an offset between 16M and KERNEL_IMAGE_SIZE.
      So the initial value of 'virt_addr' should be LOAD_PHYSICAL_ADDR,
      but not the original kernel loading address 'output'.
      
      The bug will cause kernel boot failure if kernel is loaded at a different
      position than the address, 16M, which is decided at compiled time.
      Kexec/kdump is such practical case.
      
      To fix it, just assign LOAD_PHYSICAL_ADDR to virt_addr as initial
      value.
      Tested-by: NDave Young <dyoung@redhat.com>
      Signed-off-by: NBaoquan He <bhe@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Fixes: 8391c73c ("x86/KASLR: Randomize virtual address separately")
      Link: http://lkml.kernel.org/r/1498567146-11990-3-git-send-email-bhe@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      8eabf42a
    • B
      x86/boot/KASLR: Add checking for the offset of kernel virtual address randomization · b892cb87
      Baoquan He 提交于
      For kernel text KASLR, the virtual address is confined to area of 1G,
      [0xffffffff80000000, 0xffffffffc0000000). For the implemenataion of
      virtual address randomization, we only randomize to get an offset
      between 16M and 1G, then add this offset to the starting address,
      0xffffffff80000000. Here 16M is the offset which is decided at linking
      stage. So the amount of the local variable 'virt_addr' which respresents
      the offset plus the kernel output size can not exceed KERNEL_IMAGE_SIZE.
      
      Add a debug check for the offset. If out of bounds, print error
      message and hang there.
      Suggested-by: NIngo Molnar <mingo@kernel.org>
      Signed-off-by: NBaoquan He <bhe@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/1498567146-11990-2-git-send-email-bhe@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      b892cb87
    • S
      tracing/kprobes: Allow to create probe with a module name starting with a digit · 9e52b325
      Sabrina Dubroca 提交于
      Always try to parse an address, since kstrtoul() will safely fail when
      given a symbol as input. If that fails (which will be the case for a
      symbol), try to parse a symbol instead.
      
      This allows creating a probe such as:
      
          p:probe/vlan_gro_receive 8021q:vlan_gro_receive+0
      
      Which is necessary for this command to work:
      
          perf probe -m 8021q -a vlan_gro_receive
      
      Link: http://lkml.kernel.org/r/fd72d666f45b114e2c5b9cf7e27b91de1ec966f1.1498122881.git.sd@queasysnail.net
      
      Cc: stable@vger.kernel.org
      Fixes: 413d37d1 ("tracing: Add kprobe-based event tracer")
      Acked-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: NSabrina Dubroca <sd@queasysnail.net>
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      9e52b325
    • J
      MIPS: Avoid accidental raw backtrace · 85423636
      James Hogan 提交于
      Since commit 81a76d71 ("MIPS: Avoid using unwind_stack() with
      usermode") show_backtrace() invokes the raw backtracer when
      cp0_status & ST0_KSU indicates user mode to fix issues on EVA kernels
      where user and kernel address spaces overlap.
      
      However this is used by show_stack() which creates its own pt_regs on
      the stack and leaves cp0_status uninitialised in most of the code paths.
      This results in the non deterministic use of the raw back tracer
      depending on the previous stack content.
      
      show_stack() deals exclusively with kernel mode stacks anyway, so
      explicitly initialise regs.cp0_status to KSU_KERNEL (i.e. 0) to ensure
      we get a useful backtrace.
      
      Fixes: 81a76d71 ("MIPS: Avoid using unwind_stack() with usermode")
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: <stable@vger.kernel.org> # 3.15+
      Patchwork: https://patchwork.linux-mips.org/patch/16656/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      85423636
    • P
      MIPS: Perform post-DMA cache flushes on systems with MAARs · cad482c1
      Paul Burton 提交于
      Recent CPUs from Imagination Technologies such as the I6400 or P6600 are
      able to speculatively fetch data from memory into caches. This means
      that if used in a system with non-coherent DMA they require that caches
      be invalidated after a device performs DMA, and before the CPU reads the
      DMA'd data, in order to ensure that stale values weren't speculatively
      prefetched.
      
      Such CPUs also introduced Memory Accessibility Attribute Registers
      (MAARs) in order to control the regions in which they are allowed to
      speculate. Thus we can use the presence of MAARs as a good indication
      that the CPU requires the above cache maintenance. Use the presence of
      MAARs to determine the result of cpu_needs_post_dma_flush() in the
      default case, in order to handle these recent CPUs correctly.
      
      Note that the return type of cpu_needs_post_dma_flush() is changed to
      bool, such that it's clearer what's happening when cpu_has_maar is cast
      to bool for the return value. If this patch were backported to a
      pre-v4.7 kernel then MIPS_CPU_MAAR was 1ull<<34, so when cast to an int
      we would incorrectly return 0. It so happens that MIPS_CPU_MAAR is
      currently 1ull<<30, so when truncated to an int gives a non-zero value
      anyway, but even so the implicit conversion from long long int to bool
      makes it clearer to understand what will happen than the implicit
      conversion from long long int to int would. The bool return type also
      fits this usage better semantically, so seems like an all-round win.
      
      Thanks to Ed for spotting the issue for pre-v4.7 kernels & suggesting
      the return type change.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Reviewed-by: NBryan O'Donoghue <pure.logic@nexus-software.ie>
      Tested-by: NBryan O'Donoghue <pure.logic@nexus-software.ie>
      Cc: Ed Blake <ed.blake@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16363/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      cad482c1
    • P
      MIPS: Fix IRQ tracing & lockdep when rescheduling · d8550860
      Paul Burton 提交于
      When the scheduler sets TIF_NEED_RESCHED & we call into the scheduler
      from arch/mips/kernel/entry.S we disable interrupts. This is true
      regardless of whether we reach work_resched from syscall_exit_work,
      resume_userspace or by looping after calling schedule(). Although we
      disable interrupts in these paths we don't call trace_hardirqs_off()
      before calling into C code which may acquire locks, and we therefore
      leave lockdep with an inconsistent view of whether interrupts are
      disabled or not when CONFIG_PROVE_LOCKING & CONFIG_DEBUG_LOCKDEP are
      both enabled.
      
      Without tracing this interrupt state lockdep will print warnings such
      as the following once a task returns from a syscall via
      syscall_exit_partial with TIF_NEED_RESCHED set:
      
      [   49.927678] ------------[ cut here ]------------
      [   49.934445] WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:3687 check_flags.part.41+0x1dc/0x1e8
      [   49.946031] DEBUG_LOCKS_WARN_ON(current->hardirqs_enabled)
      [   49.946355] CPU: 0 PID: 1 Comm: init Not tainted 4.10.0-00439-gc9fd5d362289-dirty #197
      [   49.963505] Stack : 0000000000000000 ffffffff81bb5d6a 0000000000000006 ffffffff801ce9c4
      [   49.974431]         0000000000000000 0000000000000000 0000000000000000 000000000000004a
      [   49.985300]         ffffffff80b7e487 ffffffff80a24498 a8000000ff160000 ffffffff80ede8b8
      [   49.996194]         0000000000000001 0000000000000000 0000000000000000 0000000077c8030c
      [   50.007063]         000000007fd8a510 ffffffff801cd45c 0000000000000000 a8000000ff127c88
      [   50.017945]         0000000000000000 ffffffff801cf928 0000000000000001 ffffffff80a24498
      [   50.028827]         0000000000000000 0000000000000001 0000000000000000 0000000000000000
      [   50.039688]         0000000000000000 a8000000ff127bd0 0000000000000000 ffffffff805509bc
      [   50.050575]         00000000140084e0 0000000000000000 0000000000000000 0000000000040a00
      [   50.061448]         0000000000000000 ffffffff8010e1b0 0000000000000000 ffffffff805509bc
      [   50.072327]         ...
      [   50.076087] Call Trace:
      [   50.079869] [<ffffffff8010e1b0>] show_stack+0x80/0xa8
      [   50.086577] [<ffffffff805509bc>] dump_stack+0x10c/0x190
      [   50.093498] [<ffffffff8015dde0>] __warn+0xf0/0x108
      [   50.099889] [<ffffffff8015de34>] warn_slowpath_fmt+0x3c/0x48
      [   50.107241] [<ffffffff801c15b4>] check_flags.part.41+0x1dc/0x1e8
      [   50.114961] [<ffffffff801c239c>] lock_is_held_type+0x8c/0xb0
      [   50.122291] [<ffffffff809461b8>] __schedule+0x8c0/0x10f8
      [   50.129221] [<ffffffff80946a60>] schedule+0x30/0x98
      [   50.135659] [<ffffffff80106278>] work_resched+0x8/0x34
      [   50.142397] ---[ end trace 0cb4f6ef5b99fe21 ]---
      [   50.148405] possible reason: unannotated irqs-off.
      [   50.154600] irq event stamp: 400463
      [   50.159566] hardirqs last  enabled at (400463): [<ffffffff8094edc8>] _raw_spin_unlock_irqrestore+0x40/0xa8
      [   50.171981] hardirqs last disabled at (400462): [<ffffffff8094eb98>] _raw_spin_lock_irqsave+0x30/0xb0
      [   50.183897] softirqs last  enabled at (400450): [<ffffffff8016580c>] __do_softirq+0x4ac/0x6a8
      [   50.195015] softirqs last disabled at (400425): [<ffffffff80165e78>] irq_exit+0x110/0x128
      
      Fix this by using the TRACE_IRQS_OFF macro to call trace_hardirqs_off()
      when CONFIG_TRACE_IRQFLAGS is enabled. This is done before invoking
      schedule() following the work_resched label because:
      
       1) Interrupts are disabled regardless of the path we take to reach
          work_resched() & schedule().
      
       2) Performing the tracing here avoids the need to do it in paths which
          disable interrupts but don't call out to C code before hitting a
          path which uses the RESTORE_SOME macro that will call
          trace_hardirqs_on() or trace_hardirqs_off() as appropriate.
      
      We call trace_hardirqs_on() using the TRACE_IRQS_ON macro before calling
      syscall_trace_leave() for similar reasons, ensuring that lockdep has a
      consistent view of state after we re-enable interrupts.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Cc: linux-mips@linux-mips.org
      Cc: stable <stable@vger.kernel.org>
      Patchwork: https://patchwork.linux-mips.org/patch/15385/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      d8550860