1. 11 Jun, 2014 18 commits
  2. 10 Jun, 2014 22 commits
    • Johan Hedberg's avatar
      Bluetooth: Fix triggering BR/EDR L2CAP Connect too early · b7dac9c0
      Johan Hedberg authored
      commit 9eb1fbfa upstream.
      
      Commit 1c2e0041 introduced an event handler for the encryption key
      refresh complete event with the intent of fixing some LE/SMP cases.
      However, this event is shared with BR/EDR and there we actually want to
      act only on the auth_complete event (which comes after the key refresh).
      
      If we do not do this we may trigger an L2CAP Connect Request too early
      and cause the remote side to return a security block error.
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      b7dac9c0
    • Sheng-Liang Song's avatar
      Input: atkbd - fix keyboard not working on some LG laptops · 20571e38
      Sheng-Liang Song authored
      commit 3d725caa upstream.
      
      After issuing ATKBD_CMD_RESET_DIS, keyboard on some LG laptops stops
      working. The workaround is to stop issuing ATKBD_CMD_RESET_DIS commands.
      
      In order to keep changes in atkbd driver to the minimum we check DMI
      signature and only skip ATKBD_CMD_RESET_DIS if we are running on LG
      LW25-B7HV or P1-J273B.
      Signed-off-by: default avatarSheng-Liang Song <ssl@chromium.org>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      20571e38
    • Hans de Goede's avatar
    • Colin Ian King's avatar
      rtlwifi: rtl8188ee: initialize packet_beacon · 5661977a
      Colin Ian King authored
      commit 328e203f upstream.
      
      static code analysis from cppcheck reports:
      
      [drivers/net/wireless/rtlwifi/rtl8188ee/trx.c:322]:
        (error) Uninitialized variable: packet_beacon
      
      packet_beacon is not initialized and hence packet_beacon
      contains garbage from the stack, so set it to false.
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      5661977a
    • Stanislaw Gruszka's avatar
      rt2x00: fix beaconing on USB · aeaf0d4b
      Stanislaw Gruszka authored
      commit 8834d360 upstream.
      
      When disable beaconing we clear register with beacon and newer set it
      back, what make we stop send beacons infinitely.
      Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      aeaf0d4b
    • Andrew Lutomirski's avatar
      net: Fix ns_capable check in sock_diag_put_filterinfo · c28a7d22
      Andrew Lutomirski authored
      commit 78541c1d upstream.
      
      The caller needs capabilities on the namespace being queried, not on
      their own namespace.  This is a security bug, although it likely has
      only a minor impact.
      Signed-off-by: default avatarAndy Lutomirski <luto@amacapital.net>
      Acked-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      c28a7d22
    • Al Viro's avatar
      fix races between __d_instantiate() and checks of dentry flags · f718c537
      Al Viro authored
      commit 22213318 upstream.
      
      in non-lazy walk we need to be careful about dentry switching from
      negative to positive - both ->d_flags and ->d_inode are updated,
      and in some places we might see only one store.  The cases where
      dentry has been obtained by dcache lookup with ->i_mutex held on
      parent are safe - ->d_lock and ->i_mutex provide all the barriers
      we need.  However, there are several places where we run into
      trouble:
      	* do_last() fetches ->d_inode, then checks ->d_flags and
      assumes that inode won't be NULL unless d_is_negative() is true.
      Race with e.g. creat() - we might have fetched the old value of
      ->d_inode (still NULL) and new value of ->d_flags (already not
      DCACHE_MISS_TYPE).  Lin Ming has observed and reported the resulting
      oops.
      	* a bunch of places checks ->d_inode for being non-NULL,
      then checks ->d_flags for "is it a symlink".  Race with symlink(2)
      in case if our CPU sees ->d_inode update first - we see non-NULL
      there, but ->d_flags still contains DCACHE_MISS_TYPE instead of
      DCACHE_SYMLINK_TYPE.  Result: false negative on "should we follow
      link here?", with subsequent unpleasantness.
      Reported-and-tested-by: default avatarLin Ming <minggr@gmail.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      f718c537
    • Mike Snitzer's avatar
      dm cache: fix writethrough mode quiescing in cache_map · cecc1070
      Mike Snitzer authored
      commit 131cd131 upstream.
      
      Commit 2ee57d58 ("dm cache: add passthrough mode") inadvertently
      removed the deferred set reference that was taken in cache_map()'s
      writethrough mode support.  Restore taking this reference.
      
      This issue was found with code inspection.
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Acked-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      cecc1070
    • Leon Yu's avatar
      aio: fix potential leak in aio_run_iocb(). · c5e8d7d0
      Leon Yu authored
      commit 754320d6 upstream.
      
      iovec should be reclaimed whenever caller of rw_copy_check_uvector() returns,
      but it doesn't hold when failure happens right after aio_setup_vectored_rw().
      
      Fix that in a such way to avoid hairy goto.
      Signed-off-by: default avatarLeon Yu <chianglungyu@gmail.com>
      Signed-off-by: default avatarBenjamin LaHaise <bcrl@kvack.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      c5e8d7d0
    • Vineet Gupta's avatar
      ARC: !PREEMPT: Ensure Return to kernel mode is IRQ safe · 7072773c
      Vineet Gupta authored
      commit 8aa9e85a upstream.
      
      There was a very small race window where resume to kernel mode from a
      Exception Path (or pure kernel mode which is true for most of ARC
      exceptions anyways), was not disabling interrupts in restore_regs,
      clobbering the exception regs
      
      Anton found the culprit call flow (after many sleepless nights)
      
      | 1. we got a Trap from user land
      | 2. started to service it.
      | 3. While doing some stuff on user-land memory (I think it is padzero()),
      |     we got a DataTlbMiss
      | 4. On return from it we are taking "resume_kernel_mode" path
      | 5. NEED_RESHED is not set, so we go to "return from exception" path in
      |     restore regs.
      | 6. there seems to be IRQ happening
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      Cc: Anton Kolesov <Anton.Kolesov@synopsys.com>
      Cc: Francois Bedard <Francois.Bedard@synopsys.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      7072773c
    • Jiri Bohac's avatar
      timer: Prevent overflow in apply_slack · e3565e1a
      Jiri Bohac authored
      commit 98a01e77 upstream.
      
      On architectures with sizeof(int) < sizeof (long), the
      computation of mask inside apply_slack() can be undefined if the
      computed bit is > 32.
      
      E.g. with: expires = 0xffffe6f5 and slack = 25, we get:
      
      expires_limit = 0x20000000e
      bit = 33
      mask = (1 << 33) - 1  /* undefined */
      
      On x86, mask becomes 1 and and the slack is not applied properly.
      On s390, mask is -1, expires is set to 0 and the timer fires immediately.
      
      Use 1UL << bit to solve that issue.
      Suggested-by: default avatarDeborah Townsend <dstownse@us.ibm.com>
      Signed-off-by: default avatarJiri Bohac <jbohac@suse.cz>
      Link: http://lkml.kernel.org/r/20140418152310.GA13654@midget.suse.czSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      e3565e1a
    • Leon Ma's avatar
      hrtimer: Prevent remote enqueue of leftmost timers · 716b4369
      Leon Ma authored
      commit 012a45e3 upstream.
      
      If a cpu is idle and starts an hrtimer which is not pinned on that
      same cpu, the nohz code might target the timer to a different cpu.
      
      In the case that we switch the cpu base of the timer we already have a
      sanity check in place, which determines whether the timer is earlier
      than the current leftmost timer on the target cpu. In that case we
      enqueue the timer on the current cpu because we cannot reprogram the
      clock event device on the target.
      
      If the timers base is already the target CPU we do not have this
      sanity check in place so we enqueue the timer as the leftmost timer in
      the target cpus rb tree, but we cannot reprogram the clock event
      device on the target cpu. So the timer expires late and subsequently
      prevents the reprogramming of the target cpu clock event device until
      the previously programmed event fires or a timer with an earlier
      expiry time gets enqueued on the target cpu itself.
      
      Add the same target check as we have for the switch base case and
      start the timer on the current cpu if it would become the leftmost
      timer on the target.
      
      [ tglx: Rewrote subject and changelog ]
      Signed-off-by: default avatarLeon Ma <xindong.ma@intel.com>
      Link: http://lkml.kernel.org/r/1398847391-5994-1-git-send-email-xindong.ma@intel.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      716b4369
    • Stuart Hayes's avatar
      hrtimer: Prevent all reprogramming if hang detected · 694c6cae
      Stuart Hayes authored
      commit 6c6c0d5a upstream.
      
      If the last hrtimer interrupt detected a hang it sets hang_detected=1
      and programs the clock event device with a delay to let the system
      make progress.
      
      If hang_detected == 1, we prevent reprogramming of the clock event
      device in hrtimer_reprogram() but not in hrtimer_force_reprogram().
      
      This can lead to the following situation:
      
      hrtimer_interrupt()
         hang_detected = 1;
         program ce device to Xms from now (hang delay)
      
      We have two timers pending:
         T1 expires 50ms from now
         T2 expires 5s from now
      
      Now T1 gets canceled, which causes hrtimer_force_reprogram() to be
      invoked, which in turn programs the clock event device to T2 (5
      seconds from now).
      
      Any hrtimer_start after that will not reprogram the hardware due to
      hang_detected still being set. So we effectivly block all timers until
      the T2 event fires and cleans up the hang situation.
      
      Add a check for hang_detected to hrtimer_force_reprogram() which
      prevents the reprogramming of the hang delay in the hardware
      timer. The subsequent hrtimer_interrupt will resolve all outstanding
      issues.
      
      [ tglx: Rewrote subject and changelog and fixed up the comment in
        	hrtimer_force_reprogram() ]
      Signed-off-by: default avatarStuart Hayes <stuart.w.hayes@gmail.com>
      Link: http://lkml.kernel.org/r/53602DC6.2060101@gmail.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      694c6cae
    • Grant Likely's avatar
      drivercore: deferral race condition fix · e2ac7590
      Grant Likely authored
      commit 58b116bc upstream.
      
      When the kernel is built with CONFIG_PREEMPT it is possible to reach a state
      when all modules loaded but some driver still stuck in the deferred list
      and there is a need for external event to kick the deferred queue to probe
      these drivers.
      
      The issue has been observed on embedded systems with CONFIG_PREEMPT enabled,
      audio support built as modules and using nfsroot for root filesystem.
      
      The following log fragment shows such sequence when all audio modules
      were loaded but the sound card is not present since the machine driver has
      failed to probe due to missing dependency during it's probe.
      The board is am335x-evmsk (McASP<->tlv320aic3106 codec) with davinci-evm
      machine driver:
      
      ...
      [   12.615118] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: ENTER
      [   12.719969] davinci_evm sound.3: davinci_evm_probe: ENTER
      [   12.725753] davinci_evm sound.3: davinci_evm_probe: snd_soc_register_card
      [   12.753846] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: snd_soc_register_component
      [   12.922051] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: snd_soc_register_component DONE
      [   12.950839] davinci_evm sound.3: ASoC: platform (null) not registered
      [   12.957898] davinci_evm sound.3: davinci_evm_probe: snd_soc_register_card DONE (-517)
      [   13.099026] davinci-mcasp 4803c000.mcasp: Kicking the deferred list
      [   13.177838] davinci-mcasp 4803c000.mcasp: really_probe: probe_count = 2
      [   13.194130] davinci_evm sound.3: snd_soc_register_card failed (-517)
      [   13.346755] davinci_mcasp_driver_init: LEAVE
      [   13.377446] platform sound.3: Driver davinci_evm requests probe deferral
      [   13.592527] platform sound.3: really_probe: probe_count = 0
      
      In the log the machine driver enters it's probe at 12.719969 (this point it
      has been removed from the deferred lists). McASP driver already executing
      it's probing (since 12.615118).
      The machine driver tries to construct the sound card (12.950839) but did
      not found one of the components so it fails. After this McASP driver
      registers all the ASoC components (the machine driver still in it's probe
      function after it failed to construct the card) and the deferred work is
      prepared at 13.099026 (note that this time the machine driver is not in the
      lists so it is not going to be handled when the work is executing).
      Lastly the machine driver exit from it's probe and the core places it to
      the deferred list but there will be no other driver going to load and the
      deferred queue is not going to be kicked again - till we have external event
      like connecting USB stick, etc.
      
      The proposed solution is to try the deferred queue once more when the last
      driver is asking for deferring and we had drivers loaded while this last
      driver was probing.
      
      This way we can avoid drivers stuck in the deferred queue.
      Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
      Reviewed-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
      Tested-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mark Brown <broonie@kernel.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      e2ac7590
    • Fam Zheng's avatar
      [SCSI] virtio-scsi: Skip setting affinity on uninitialized vq · 02131716
      Fam Zheng authored
      commit 0c8482ac upstream.
      
      virtscsi_init calls virtscsi_remove_vqs on err, even before initializing
      the vqs. The latter calls virtscsi_set_affinity, so let's check the
      pointer there before setting affinity on it.
      
      This fixes a panic when setting device's num_queues=2 on RHEL 6.5:
      
      qemu-system-x86_64 ... \
      -device virtio-scsi-pci,id=scsi0,addr=0x13,...,num_queues=2 \
      -drive file=/stor/vm/dummy.raw,id=drive-scsi-disk,... \
      -device scsi-hd,drive=drive-scsi-disk,...
      
      [    0.354734] scsi0 : Virtio SCSI HBA
      [    0.379504] BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
      [    0.380141] IP: [<ffffffff814741ef>] __virtscsi_set_affinity+0x4f/0x120
      [    0.380141] PGD 0
      [    0.380141] Oops: 0000 [#1] SMP
      [    0.380141] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.14.0+ #5
      [    0.380141] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2007
      [    0.380141] task: ffff88003c9f0000 ti: ffff88003c9f8000 task.ti: ffff88003c9f8000
      [    0.380141] RIP: 0010:[<ffffffff814741ef>]  [<ffffffff814741ef>] __virtscsi_set_affinity+0x4f/0x120
      [    0.380141] RSP: 0000:ffff88003c9f9c08  EFLAGS: 00010256
      [    0.380141] RAX: 0000000000000000 RBX: ffff88003c3a9d40 RCX: 0000000000001070
      [    0.380141] RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000000000000000
      [    0.380141] RBP: ffff88003c9f9c28 R08: 00000000000136c0 R09: ffff88003c801c00
      [    0.380141] R10: ffffffff81475229 R11: 0000000000000008 R12: 0000000000000000
      [    0.380141] R13: ffffffff81cc7ca8 R14: ffff88003cac3d40 R15: ffff88003cac37a0
      [    0.380141] FS:  0000000000000000(0000) GS:ffff88003e400000(0000) knlGS:0000000000000000
      [    0.380141] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      [    0.380141] CR2: 0000000000000020 CR3: 0000000001c0e000 CR4: 00000000000006f0
      [    0.380141] Stack:
      [    0.380141]  ffff88003c3a9d40 0000000000000000 ffff88003cac3d80 ffff88003cac3d40
      [    0.380141]  ffff88003c9f9c48 ffffffff814742e8 ffff88003c26d000 ffff88003c26d000
      [    0.380141]  ffff88003c9f9c68 ffffffff81474321 ffff88003c26d000 ffff88003c3a9d40
      [    0.380141] Call Trace:
      [    0.380141]  [<ffffffff814742e8>] virtscsi_set_affinity+0x28/0x40
      [    0.380141]  [<ffffffff81474321>] virtscsi_remove_vqs+0x21/0x50
      [    0.380141]  [<ffffffff81475231>] virtscsi_init+0x91/0x240
      [    0.380141]  [<ffffffff81365290>] ? vp_get+0x50/0x70
      [    0.380141]  [<ffffffff81475544>] virtscsi_probe+0xf4/0x280
      [    0.380141]  [<ffffffff81363ea5>] virtio_dev_probe+0xe5/0x140
      [    0.380141]  [<ffffffff8144c669>] driver_probe_device+0x89/0x230
      [    0.380141]  [<ffffffff8144c8ab>] __driver_attach+0x9b/0xa0
      [    0.380141]  [<ffffffff8144c810>] ? driver_probe_device+0x230/0x230
      [    0.380141]  [<ffffffff8144c810>] ? driver_probe_device+0x230/0x230
      [    0.380141]  [<ffffffff8144ac1c>] bus_for_each_dev+0x8c/0xb0
      [    0.380141]  [<ffffffff8144c499>] driver_attach+0x19/0x20
      [    0.380141]  [<ffffffff8144bf28>] bus_add_driver+0x198/0x220
      [    0.380141]  [<ffffffff8144ce9f>] driver_register+0x5f/0xf0
      [    0.380141]  [<ffffffff81d27c91>] ? spi_transport_init+0x79/0x79
      [    0.380141]  [<ffffffff8136403b>] register_virtio_driver+0x1b/0x30
      [    0.380141]  [<ffffffff81d27d19>] init+0x88/0xd6
      [    0.380141]  [<ffffffff81d27c18>] ? scsi_init_procfs+0x5b/0x5b
      [    0.380141]  [<ffffffff81ce88a7>] do_one_initcall+0x7f/0x10a
      [    0.380141]  [<ffffffff81ce8aa7>] kernel_init_freeable+0x14a/0x1de
      [    0.380141]  [<ffffffff81ce8b3b>] ? kernel_init_freeable+0x1de/0x1de
      [    0.380141]  [<ffffffff817dec20>] ? rest_init+0x80/0x80
      [    0.380141]  [<ffffffff817dec29>] kernel_init+0x9/0xf0
      [    0.380141]  [<ffffffff817e68fc>] ret_from_fork+0x7c/0xb0
      [    0.380141]  [<ffffffff817dec20>] ? rest_init+0x80/0x80
      [    0.380141] RIP  [<ffffffff814741ef>] __virtscsi_set_affinity+0x4f/0x120
      [    0.380141]  RSP <ffff88003c9f9c08>
      [    0.380141] CR2: 0000000000000020
      [    0.380141] ---[ end trace 8074b70c3d5e1d73 ]---
      [    0.475018] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009
      [    0.475018]
      [    0.475068] Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffff9fffffff)
      [    0.475068] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009
      
      [jejb: checkpatch fixes]
      Signed-off-by: default avatarFam Zheng <famz@redhat.com>
      Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      02131716
    • Tyler Stachecki's avatar
      [SCSI] mpt2sas: Don't disable device twice at suspend. · 303a82a4
      Tyler Stachecki authored
      commit af61e27c upstream.
      
      On suspend, _scsih_suspend calls mpt2sas_base_free_resources, which
      in turn calls pci_disable_device if the device is enabled prior to
      suspending. However, _scsih_suspend also calls pci_disable_device
      itself.
      
      Thus, in the event that the device is enabled prior to suspending,
      pci_disable_device will be called twice. This patch removes the
      duplicate call to pci_disable_device in _scsi_suspend as it is both
      unnecessary and results in a kernel oops.
      Signed-off-by: default avatarTyler Stachecki <tstache1@binghamton.edu>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      303a82a4
    • Steven Rostedt (Red Hat)'s avatar
      ftrace/module: Hardcode ftrace_module_init() call into load_module() · d23e6c3a
      Steven Rostedt (Red Hat) authored
      commit a949ae56 upstream.
      
      A race exists between module loading and enabling of function tracer.
      
      	CPU 1				CPU 2
      	-----				-----
        load_module()
         module->state = MODULE_STATE_COMING
      
      				register_ftrace_function()
      				 mutex_lock(&ftrace_lock);
      				 ftrace_startup()
      				  update_ftrace_function();
      				   ftrace_arch_code_modify_prepare()
      				    set_all_module_text_rw();
      				   <enables-ftrace>
      				    ftrace_arch_code_modify_post_process()
      				     set_all_module_text_ro();
      
      				[ here all module text is set to RO,
      				  including the module that is
      				  loading!! ]
      
         blocking_notifier_call_chain(MODULE_STATE_COMING);
          ftrace_init_module()
      
           [ tries to modify code, but it's RO, and fails!
             ftrace_bug() is called]
      
      When this race happens, ftrace_bug() will produces a nasty warning and
      all of the function tracing features will be disabled until reboot.
      
      The simple solution is to treate module load the same way the core
      kernel is treated at boot. To hardcode the ftrace function modification
      of converting calls to mcount into nops. This is done in init/main.c
      there's no reason it could not be done in load_module(). This gives
      a better control of the changes and doesn't tie the state of the
      module to its notifiers as much. Ftrace is special, it needs to be
      treated as such.
      
      The reason this would work, is that the ftrace_module_init() would be
      called while the module is in MODULE_STATE_UNFORMED, which is ignored
      by the set_all_module_text_ro() call.
      
      Link: http://lkml.kernel.org/r/1395637826-3312-1-git-send-email-indou.takao@jp.fujitsu.comReported-by: default avatarTakao Indoh <indou.takao@jp.fujitsu.com>
      Acked-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      d23e6c3a
    • Oleg Nesterov's avatar
      KVM: async_pf: mm->mm_users can not pin apf->mm · 0eaea59a
      Oleg Nesterov authored
      commit 41c22f62 upstream.
      
      get_user_pages(mm) is simply wrong if mm->mm_users == 0 and exit_mmap/etc
      was already called (or is in progress), mm->mm_count can only pin mm->pgd
      and mm_struct itself.
      
      Change kvm_setup_async_pf/async_pf_execute to inc/dec mm->mm_users.
      
      kvm_create_vm/kvm_destroy_vm play with ->mm_count too but this case looks
      fine at first glance, it seems that this ->mm is only used to verify that
      current->mm == kvm->mm.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      0eaea59a
    • Haibin Wang's avatar
      KVM: ARM: vgic: Fix sgi dispatch problem · fb54c0fa
      Haibin Wang authored
      commit 91021a6c upstream.
      
      When dispatch SGI(mode == 0), that is the vcpu of VM should send
      sgi to the cpu which the target_cpus list.
      So, there must add the "break" to branch of case 0.
      Signed-off-by: default avatarHaibin Wang <wanghaibin.wang@huawei.com>
      Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      fb54c0fa
    • Mark Salter's avatar
      arm: KVM: fix possible misalignment of PGDs and bounce page · 7ec7f848
      Mark Salter authored
      commit 5d4e08c4 upstream.
      
      The kvm/mmu code shared by arm and arm64 uses kalloc() to allocate
      a bounce page (if hypervisor init code crosses page boundary) and
      hypervisor PGDs. The problem is that kalloc() does not guarantee
      the proper alignment. In the case of the bounce page, the page sized
      buffer allocated may also cross a page boundary negating the purpose
      and leading to a hang during kvm initialization. Likewise the PGDs
      allocated may not meet the minimum alignment requirements of the
      underlying MMU. This patch uses __get_free_page() to guarantee the
      worst case alignment needs of the bounce page and PGDs on both arm
      and arm64.
      Signed-off-by: default avatarMark Salter <msalter@redhat.com>
      Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      7ec7f848
    • Hui Wang's avatar
      ALSA: hda - add headset mic detect quirk for a Dell laptop · 882aa882
      Hui Wang authored
      commit e32dfbed upstream.
      
      When we plug a 3-ring headset on the Dell machine (VID: 0x10ec0255,
      SID: 0x10280674), the headset mic can't be detected, after apply this
      patch, the headset mic can work well.
      
      BugLink: https://bugs.launchpad.net/bugs/1297581
      Cc: David Henningsson <david.henningsson@canonical.com>
      Signed-off-by: default avatarHui Wang <hui.wang@canonical.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      882aa882
    • Rusty Russell's avatar
      module: remove warning about waiting module removal. · 9cdc1114
      Rusty Russell authored
      commit 79465d2f upstream.
      
      We remove the waiting module removal in commit 3f2b9c9c (September
      2013), but it turns out that modprobe in kmod (< version 16) was
      asking for waiting module removal.  No one noticed since modprobe would
      check for 0 usage immediately before trying to remove the module, and
      the race is unlikely.
      
      However, it means that anyone running old (but not ancient) kmod
      versions is hitting the printk designed to see if anyone was running
      "rmmod -w".  All reports so far have been false positives, so remove
      the warning.
      
      Fixes: 3f2b9c9cReported-by: default avatarValerio Vanni <valerio.vanni@inwind.it>
      Cc: Elliott, Robert (Server Storage) <Elliott@hp.com>
      Acked-by: default avatarLucas De Marchi <lucas.de.marchi@gmail.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      [ kamal: backport to 3.13: context ]
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      9cdc1114