1. 15 Sep, 2012 11 commits
    • Oleg Nesterov's avatar
      uprobes/x86: Fix arch_uprobe_disable_step() && UTASK_SSTEP_TRAPPED interaction · d6a00b35
      Oleg Nesterov authored
      arch_uprobe_disable_step() should also take UTASK_SSTEP_TRAPPED into
      account. In this case the probed insn was not executed, we need to
      clear X86_EFLAGS_TF if it was set by us and that is all.
      
      Again, this code will look more clean when we move it into
      arch_uprobe_post_xol() and arch_uprobe_abort_xol().
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      d6a00b35
    • Oleg Nesterov's avatar
      uprobes/x86: Xol should send SIGTRAP if X86_EFLAGS_TF was set · 3a4664aa
      Oleg Nesterov authored
      arch_uprobe_disable_step() correctly preserves X86_EFLAGS_TF and
      returns to user-mode. But this means the application gets SIGTRAP
      only after the next insn.
      
      This means that UPROBE_CLEAR_TF logic is not really right. _enable
      should only record the state of X86_EFLAGS_TF, and _disable should
      check it separately from UPROBE_FIX_SETF.
      
      Remove arch_uprobe_task->restore_flags, add ->saved_tf instead, and
      change enable/disable accordingly. This assumes that the probed insn
      was not trapped, see the next patch.
      
      arch_uprobe_skip_sstep() logic has the same problem, change it to
      check X86_EFLAGS_TF and send SIGTRAP as well. We will cleanup this
      all after we fold enable/disable_step into pre/post_hol hooks.
      
      Note: send_sig(SIGTRAP) is not actually right, we need send_sigtrap().
      But this needs more changes, handle_swbp() does the same and this is
      equally wrong.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      3a4664aa
    • Oleg Nesterov's avatar
      uprobes/x86: Do not (ab)use TIF_SINGLESTEP/user_*_single_step() for single-stepping · 9bd1190a
      Oleg Nesterov authored
      user_enable/disable_single_step() was designed for ptrace, it assumes
      a single user and does unnecessary and wrong things for uprobes. For
      example:
      
      	- arch_uprobe_enable_step() can't trust TIF_SINGLESTEP, an
      	  application itself can set X86_EFLAGS_TF which must be
      	  preserved after arch_uprobe_disable_step().
      
      	- we do not want to set TIF_SINGLESTEP/TIF_FORCED_TF in
      	  arch_uprobe_enable_step(), this only makes sense for ptrace.
      
      	- otoh we leak TIF_SINGLESTEP if arch_uprobe_disable_step()
      	  doesn't do user_disable_single_step(), the application will
      	  be killed after the next syscall.
      
      	- arch_uprobe_enable_step() does access_process_vm() we do
      	  not need/want.
      
      Change arch_uprobe_enable/disable_step() to set/clear X86_EFLAGS_TF
      directly, this is much simpler and more correct. However, we need to
      clear TIF_BLOCKSTEP/DEBUGCTLMSR_BTF before executing the probed insn,
      add set_task_blockstep(false).
      
      Note: with or without this patch, there is another (hopefully minor)
      problem. A probed "pushf" insn can see the wrong X86_EFLAGS_TF set by
      uprobes. Perhaps we should change _disable to update the stack, or
      teach arch_uprobe_skip_sstep() to emulate this insn.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      9bd1190a
    • Oleg Nesterov's avatar
      ptrace/x86: Partly fix set_task_blockstep()->update_debugctlmsr() logic · 95cf00fa
      Oleg Nesterov authored
      Afaics the usage of update_debugctlmsr() and TIF_BLOCKSTEP in
      step.c was always very wrong.
      
      1. update_debugctlmsr() was simply unneeded. The child sleeps
         TASK_TRACED, __switch_to_xtra(next_p => child) should notice
         TIF_BLOCKSTEP and set/clear DEBUGCTLMSR_BTF after resume if
         needed.
      
      2. It is wrong. The state of DEBUGCTLMSR_BTF bit in CPU register
         should always match the state of current's TIF_BLOCKSTEP bit.
      
      3. Even get_debugctlmsr() + update_debugctlmsr() itself does not
         look right. Irq can change other bits in MSR_IA32_DEBUGCTLMSR
         register or the caller can be preempted in between.
      
      4. It is not safe to play with TIF_BLOCKSTEP if task != current.
         DEBUGCTLMSR_BTF and TIF_BLOCKSTEP should always match each
         other if the task is running. The tracee is stopped but it
         can be SIGKILL'ed right before set/clear_tsk_thread_flag().
      
      However, now that uprobes uses user_enable_single_step(current)
      we can't simply remove update_debugctlmsr(). So this patch adds
      the additional "task == current" check and disables irqs to avoid
      the race with interrupts/preemption.
      
      Unfortunately this patch doesn't solve the last problem, we need
      another fix. Probably we should teach ptrace_stop() to set/clear
      single/block stepping after resume.
      
      And afaics there is yet another problem: perf can play with
      MSR_IA32_DEBUGCTLMSR from nmi, this obviously means that even
      __switch_to_xtra() has problems.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      95cf00fa
    • Oleg Nesterov's avatar
      ptrace/x86: Introduce set_task_blockstep() helper · 848e8f5f
      Oleg Nesterov authored
      No functional changes, preparation for the next fix and for uprobes
      single-step fixes.
      
      Move the code playing with TIF_BLOCKSTEP/DEBUGCTLMSR_BTF into the
      new helper, set_task_blockstep().
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      848e8f5f
    • Sebastian Andrzej Siewior's avatar
      uprobes/x86: Implement x86 specific arch_uprobe_*_step · bdc1e472
      Sebastian Andrzej Siewior authored
      The arch specific implementation behaves like user_enable_single_step()
      except that it does not disable single stepping if it was already
      enabled by ptrace. This allows the debugger to single step over an
      uprobe. The state of block stepping is not restored. It makes only sense
      together with TF and if that was enabled then the debugger is notified.
      
      Note: this is still not correct. For example, TIF_SINGLESTEP check
      is not right, the application itself can set X86_EFLAGS_TF. And otoh
      we leak TIF_SINGLESTEP (set by enable) if the probed insn is "popf".
      See the next patches, we need the changes in arch/x86/kernel/step.c
      first.
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      bdc1e472
    • Sebastian Andrzej Siewior's avatar
      uprobes: Introduce arch_uprobe_enable/disable_step() · 9d778782
      Sebastian Andrzej Siewior authored
      As Oleg pointed out in [0] uprobe should not use the ptrace interface
      for enabling/disabling single stepping.
      
      [0] http://lkml.kernel.org/r/20120730141638.GA5306@redhat.com
      
      Add the new "__weak arch" helpers which simply call user_*_single_step()
      as a preparation. This is only needed to not break the powerpc port, we
      will fold this logic into arch_uprobe_pre/post_xol() hooks later.
      
      We should also change handle_singlestep(), _disable_step(&uprobe->arch)
      should be called before put_uprobe().
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      9d778782
    • Oleg Nesterov's avatar
      uprobes: Teach find_active_uprobe() to clear MMF_HAS_UPROBES · 499a4f3e
      Oleg Nesterov authored
      The wrong MMF_HAS_UPROBES doesn't really hurt, just it triggers
      the "slow" and unnecessary handle_swbp() path if the task hits
      the non-uprobe breakpoint.
      
      So this patch changes find_active_uprobe() to check every valid
      vma and clear MMF_HAS_UPROBES if no uprobes were found. This is
      adds the slow O(n) path, but it is only called in unlikely case
      when the task hits the normal breakpoint first time after
      uprobe_unregister().
      
      Note the "not strictly accurate" comment in mmf_recalc_uprobes().
      We can fix this, we only need to teach vma_has_uprobes() to return
      a bit more more info, but I am not sure this worth the trouble.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      499a4f3e
    • Oleg Nesterov's avatar
      uprobes: Introduce MMF_RECALC_UPROBES · 9f68f672
      Oleg Nesterov authored
      Add the new MMF_RECALC_UPROBES flag, it means that MMF_HAS_UPROBES
      can be false positive after remove_breakpoint() or uprobe_munmap().
      It is also set by uprobe_dup_mmap(), this is not optimal but simple.
      We could add the new hook, uprobe_dup_vma(), to set MMF_HAS_UPROBES
      only if the new mm actually has uprobes, but I don't think this
      makes sense.
      
      The next patch will use this flag to clear MMF_HAS_UPROBES.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      9f68f672
    • Oleg Nesterov's avatar
      uprobes: uprobes_treelock should not disable irqs · 6f47caa0
      Oleg Nesterov authored
      Nobody plays with uprobes_tree/uprobes_treelock in interrupt context,
      no need to disable irqs.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      6f47caa0
    • Sebastian Andrzej Siewior's avatar
      uprobes: Don't put NULL pointer in uprobe_register() · 6d1d8dfa
      Sebastian Andrzej Siewior authored
      alloc_uprobe() might return a NULL pointer, put_uprobe() can't deal with
      this.
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      6d1d8dfa
  2. 28 Aug, 2012 10 commits
  3. 27 Aug, 2012 1 commit
  4. 26 Aug, 2012 4 commits
    • Linus Torvalds's avatar
      Merge tag 'fixes-3.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 9acb1725
      Linus Torvalds authored
      Pull arm-soc fixes from Arnd Bergmann:
       "Bug fixes for various ARM platforms.  About half of these are for OMAP
        and submitted before but did not make it into v3.6-rc2."
      
      * tag 'fixes-3.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (39 commits)
        ARM: ux500: don't select LEDS_GPIO for snowball
        ARM: imx: build i.MX6 functions only when needed
        ARM: imx: select CPU_FREQ_TABLE when needed
        ARM: imx: fix ksz9021rn_phy_fixup
        ARM: imx: build pm-imx5 code only when PM is enabled
        ARM: omap: allow building omap44xx without SMP
        ARM: dts: imx51-babbage: fix esdhc cd/wp properties
        ARM: imx6: spin the cpu until hardware takes it down
        ARM: ux500: Ensure probing of Audio devices when Device Tree is enabled
        ARM: ux500: Fix merge error, no matching driver name for 'snd_soc_u8500'
        ARM i.MX6q: Add virtual 1/3.5 dividers in the LDB clock path
        ARM: Kirkwood: fix Makefile.boot
        ARM: Kirkwood: Fix iconnect leds
        ARM: Orion: Set eth packet size csum offload limit
        ARM: mv78xx0: fix win_cfg_base prototype
        ARM: OMAP: dmtimers: Fix locking issue in omap_dm_timer_request*()
        ARM: mmp: fix potential NULL dereference
        ARM: OMAP4: Register the OPP table only for 4430 device
        cpufreq: OMAP: Handle missing frequency table on SMP systems
        ARM: OMAP4: sleep: Save the complete used register stack frame
        ...
      9acb1725
    • Linus Torvalds's avatar
      Merge tag 'stable/for-linus-3.6-rc3-tag' of... · 26756087
      Linus Torvalds authored
      Merge tag 'stable/for-linus-3.6-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
      
      Pull three xen bug-fixes from Konrad Rzeszutek Wilk:
       - Revert the kexec fix which caused on non-kexec shutdowns a race.
       - Reuse existing P2M leafs - instead of requiring to allocate a large
         area of bootup virtual address estate.
       - Fix a one-off error when adding PFNs for balloon pages.
      
      * tag 'stable/for-linus-3.6-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
        xen/setup: Fix one-off error when adding for-balloon PFNs to the P2M.
        xen/p2m: Reuse existing P2M leafs if they are filled with 1:1 PFNs or INVALID.
        Revert "xen PVonHVM: move shared_info to MMIO before kexec"
      26756087
    • Linus Torvalds's avatar
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · 4ae46147
      Linus Torvalds authored
      Pull powerpc fixes from Benjamin Herrenschmidt:
       "I meant to sent that earlier but got swamped with other things, so
        here are some powerpc fixes for 3.6.  A few regression fixes and some
        bug fixes that I deemed should still make it.
      
        There's a FSL update from Kumar with a bunch of defconfig updates
        along with a few embedded fixes.
      
        I also reverted my g5_defconfig update that I merged earlier as it was
        completely busted, not too sure what happened there, I'll do a new one
        later."
      
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
        Revert "powerpc: Update g5_defconfig"
        powerpc/perf: Use pmc_overflow() to detect rolled back events
        powerpc: Fix VMX in interrupt check in POWER7 copy loops
        powerpc: POWER7 copy_to_user/copy_from_user patch applied twice
        powerpc: Fix personality handling in ppc64_personality()
        powerpc/dma-iommu: Fix IOMMU window check
        powerpc: Remove unnecessary ifdefs
        powerpc/kgdb: Restore current_thread_info properly
        powerpc/kgdb: Bail out of KGDB when we've been triggered
        powerpc/kgdb: Do not set kgdb_single_step on ppc
        powerpc/mpic_msgr: Add missing includes
        powerpc: Fix null pointer deref in perf hardware breakpoints
        powerpc: Fixup whitespace in xmon
        powerpc: Fix xmon dl command for new printk implementation
        powerpc/fsl: fix "Failed to mount /dev: No such device" errors
        powerpc/fsl: update defconfigs
        booke/wdt: some ioctls do not return values properly
        powerpc/p4080ds: dts - add usb controller version info and port0
        powerpc/85xx: mpc85xx_defconfig - add VIA PATA support for MPC85xxCDS
        powerpc/fsl-pci: Only scan PCI bus if configured as a host
      4ae46147
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/virt/kvm/kvm · 6ec9776c
      Linus Torvalds authored
      Pull kvm fixes from Marcelo Tosatti.
      
      * git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: x86 emulator: use stack size attribute to mask rsp in stack ops
        KVM: MMU: Fix mmu_shrink() so that it can free mmu pages as intended
        ppc: e500_tlb memset clears nothing
        KVM: PPC: Add cache flush on page map
        KVM: PPC: Book3S HV: Fix incorrect branch in H_CEDE code
        KVM: x86: update KVM_SAVE_MSRS_BEGIN to correct value
      6ec9776c
  5. 25 Aug, 2012 6 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus-v3.6-rc4' of git://oss.sgi.com/xfs/xfs · e1d33a5c
      Linus Torvalds authored
      Pull xfs bugfixes from Ben Myers:
       - fix uninitialised variable in xfs_rtbuf_get()
       - unlock the AGI buffer when looping in xfs_dialloc
       - check for possible overflow in xfs_ioc_trim
      
      * tag 'for-linus-v3.6-rc4' of git://oss.sgi.com/xfs/xfs:
        xfs: check for possible overflow in xfs_ioc_trim
        xfs: unlock the AGI buffer when looping in xfs_dialloc
        xfs: fix uninitialised variable in xfs_rtbuf_get()
      e1d33a5c
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 2432cbe4
      Linus Torvalds authored
      Pull MIPS fixes from Ralf Baechle:
       "Random fixes across the MIPS tree.  The two hotspots are several bugs
        in the module loader and the ath79 SOC support; also noteworthy is the
        restructuring of the code to synchronize CPU timers across CPUs on
        startup; the old code recently ceased to work due to unrelated
        changes.
      
        All except one of these patches have sat for a significant time in
        linux-next for testing."
      
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
        MIPS: pci-ar724x: avoid data bus error due to a missing PCIe module
        MIPS: Malta: Delete duplicate PCI fixup.
        MIPS: ath79: don't hardcode the unavailability of the DSP ASE
        MIPS: Synchronize MIPS count one CPU at a time
        MIPS: BCM63xx: Fix SPI message control register handling for BCM6338/6348.
        MIPS: Module: Deal with malformed HI16/LO16 relocation sequences.
        MIPS: Fix race condition in module relocation code.
        MIPS: Fix memory leak in error path of HI16/LO16 relocation handling.
        MIPS: MTX-1: Add udelay to mtx1_pci_idsel
        MIPS: ath79: select HAVE_CLK
        MIPS: ath79: Use correct IRQ number for the OHCI controller on AR7240
        MIPS: ath79: Fix number of GPIO lines for AR724[12]
        MIPS: Octeon: Fix broken interrupt controller code.
      2432cbe4
    • Linus Torvalds's avatar
      Merge branch 'for-3.6' of git://linux-nfs.org/~bfields/linux · 8497ae61
      Linus Torvalds authored
      Pull nfsd bugfixes from J. Bruce Fields:
       "Particular thanks to Michael Tokarev, Malahal Naineni, and Jamie
        Heilman for their testing and debugging help."
      
      * 'for-3.6' of git://linux-nfs.org/~bfields/linux:
        svcrpc: fix svc_xprt_enqueue/svc_recv busy-looping
        svcrpc: sends on closed socket should stop immediately
        svcrpc: fix BUG() in svc_tcp_clear_pages
        nfsd4: fix security flavor of NFSv4.0 callback
      8497ae61
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · a7e546f1
      Linus Torvalds authored
      Pull block-related fixes from Jens Axboe:
      
       - Improvements to the buffered and direct write IO plugging from
         Fengguang.
      
       - Abstract out the mapping of a bio in a request, and use that to
         provide a blk_bio_map_sg() helper.  Useful for mapping just a bio
         instead of a full request.
      
       - Regression fix from Hugh, fixing up a patch that went into the
         previous release cycle (and marked stable, too) attempting to prevent
         a loop in __getblk_slow().
      
       - Updates to discard requests, fixing up the sizing and how we align
         them.  Also a change to disallow merging of discard requests, since
         that doesn't really work properly yet.
      
       - A few drbd fixes.
      
       - Documentation updates.
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        block: replace __getblk_slow misfix by grow_dev_page fix
        drbd: Write all pages of the bitmap after an online resize
        drbd: Finish requests that completed while IO was frozen
        drbd: fix drbd wire compatibility for empty flushes
        Documentation: update tunable options in block/cfq-iosched.txt
        Documentation: update tunable options in block/cfq-iosched.txt
        Documentation: update missing index files in block/00-INDEX
        block: move down direct IO plugging
        block: remove plugging at buffered write time
        block: disable discard request merge temporarily
        bio: Fix potential memory leak in bio_find_or_create_slab()
        block: Don't use static to define "void *p" in show_partition_start()
        block: Add blk_bio_map_sg() helper
        block: Introduce __blk_segment_map_sg() helper
        fs/block-dev.c:fix performance regression in O_DIRECT writes to md block devices
        block: split discard into aligned requests
        block: reorganize rounding of max_discard_sectors
      a7e546f1
    • Linus Torvalds's avatar
      Merge tag 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev · da31ce72
      Linus Torvalds authored
      Pull libata fixes from Jeff Garzik:
       - libata-acpi regression fix
       - additional or corrected drive quirks for ata_blacklist
       - Kconfig text tweaking
       - new PCI IDs
       - pata_atiixp: quirk for MSI motherboard
       - export ahci_dev_classify for an ahci_platform driver
      
      * tag 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
        libata: Add a space to " 2GB ATA Flash Disk" DMA blacklist entry
        [libata] new quirk, lift bridge limits for Buffalo DriveStation Quattro
        [libata] Kconfig: Elaborate that SFF is meant for legacy and PATA stuff
        [libata] acpi: call ata_acpi_gtm during ata port init time
        ata_piix: Add Device IDs for Intel Lynx Point-LP PCH
        ahci: Add Device IDs for Intel Lynx Point-LP PCH
        pata_atiixp: override cable detection on MSI E350DM-E33
        ahci: un-staticize ahci_dev_classify
      da31ce72
    • Prarit Bhargava's avatar
      libata: Add a space to " 2GB ATA Flash Disk" DMA blacklist entry · d17d794c
      Prarit Bhargava authored
      commit d70e551c, Add " 2GB ATA Flash
      Disk"/"ADMA428M" to DMA blacklist, should have added a space before 2GB.
      Signed-off-by: default avatarPrarit Bhargava <prarit@redhat.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      d17d794c
  6. 24 Aug, 2012 8 commits