1. 09 May, 2018 25 commits
    • Danit Goldberg's avatar
      IB/mlx5: Use unlimited rate when static rate is not supported · b5ebbbc7
      Danit Goldberg authored
      commit 4f32ac2e upstream.
      
      Before the change, if the user passed a static rate value different
      than zero and the FW doesn't support static rate,
      it would end up configuring rate of 2.5 GBps.
      
      Fix this by using rate 0; unlimited, in cases where FW
      doesn't support static rate configuration.
      
      Cc: <stable@vger.kernel.org> # 3.10
      Fixes: e126ba97 ("mlx5: Add driver for Mellanox Connect-IB adapters")
      Reviewed-by: default avatarMajd Dibbiny <majd@mellanox.com>
      Signed-off-by: default avatarDanit Goldberg <danitg@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b5ebbbc7
    • SZ Lin (林上智)'s avatar
      NET: usb: qmi_wwan: add support for ublox R410M PID 0x90b2 · a27293f2
      SZ Lin (林上智) authored
      commit 9306b38e upstream.
      
      This patch adds support for PID 0x90b2 of ublox R410M.
      
      qmicli -d /dev/cdc-wdm0 --dms-get-manufacturer
      [/dev/cdc-wdm0] Device manufacturer retrieved:
              Manufacturer: 'u-blox'
      
      qmicli -d /dev/cdc-wdm0 --dms-get-model
      [/dev/cdc-wdm0] Device model retrieved:
              Model: 'SARA-R410M-02B'
      Signed-off-by: default avatarSZ Lin (林上智) <sz.lin@moxa.com>
      Cc: stable <stable@vger.kernel.org>
      Acked-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a27293f2
    • Leon Romanovsky's avatar
      RDMA/mlx5: Protect from shift operand overflow · 14ad5155
      Leon Romanovsky authored
      commit 002bf228 upstream.
      
      Ensure that user didn't supply values too large that can cause overflow.
      
      UBSAN: Undefined behaviour in drivers/infiniband/hw/mlx5/qp.c:263:23
      shift exponent -2147483648 is negative
      CPU: 0 PID: 292 Comm: syzkaller612609 Not tainted 4.16.0-rc1+ #131
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.0-0-g63451fca13-prebuilt.qemu-project.org 04/01/2014 Call
      Trace:
      dump_stack+0xde/0x164
      ubsan_epilogue+0xe/0x81
      set_rq_size+0x7c2/0xa90
      create_qp_common+0xc18/0x43c0
      mlx5_ib_create_qp+0x379/0x1ca0
      create_qp.isra.5+0xc94/0x2260
      ib_uverbs_create_qp+0x21b/0x2a0
      ib_uverbs_write+0xc2c/0x1010
      vfs_write+0x1b0/0x550
      SyS_write+0xc7/0x1a0
      do_syscall_64+0x1aa/0x740
      entry_SYSCALL_64_after_hwframe+0x26/0x9b
      RIP: 0033:0x433569
      RSP: 002b:00007ffc6e62f448 EFLAGS: 00000217 ORIG_RAX: 0000000000000001
      RAX: ffffffffffffffda RBX: 00000000004002f8 RCX: 0000000000433569
      RDX: 0000000000000070 RSI: 00000000200042c0 RDI: 0000000000000003
      RBP: 00000000006d5018 R08: 00000000004002f8 R09: 00000000004002f8
      R10: 00000000004002f8 R11: 0000000000000217 R12: 0000000000000000
      R13: 000000000040c9f0 R14: 000000000040ca80 R15: 0000000000000006
      
      Cc: <stable@vger.kernel.org> # 3.10
      Fixes: e126ba97 ("mlx5: Add driver for Mellanox Connect-IB adapters")
      Cc: syzkaller <syzkaller@googlegroups.com>
      Reported-by: default avatarNoa Osherovich <noaos@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      14ad5155
    • Leon Romanovsky's avatar
      RDMA/mlx5: Fix multiple NULL-ptr deref errors in rereg_mr flow · be855252
      Leon Romanovsky authored
      commit b4bd701a upstream.
      
      Failure in rereg MR releases UMEM but leaves the MR to be destroyed
      by the user. As a result the following scenario may happen:
      "create MR -> rereg MR with failure -> call to rereg MR again" and
      hit "NULL-ptr deref or user memory access" errors.
      
      Ensure that rereg MR is only performed on a non-dead MR.
      
      Cc: syzkaller <syzkaller@googlegroups.com>
      Cc: <stable@vger.kernel.org> # 4.5
      Fixes: 395a8e4c ("IB/mlx5: Refactoring register MR code")
      Reported-by: default avatarNoa Osherovich <noaos@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      be855252
    • Roland Dreier's avatar
      RDMA/ucma: Allow resolving address w/o specifying source address · 3ae1bf36
      Roland Dreier authored
      commit 09abfe7b upstream.
      
      The RDMA CM will select a source device and address by consulting
      the routing table if no source address is passed into
      rdma_resolve_address().  Userspace will ask for this by passing an
      all-zero source address in the RESOLVE_IP command.  Unfortunately
      the new check for non-zero address size rejects this with EINVAL,
      which breaks valid userspace applications.
      
      Fix this by explicitly allowing a zero address family for the source.
      
      Fixes: 2975d5de ("RDMA/ucma: Check AF family prior resolving address")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3ae1bf36
    • Raju Rangoju's avatar
      RDMA/cxgb4: release hw resources on device removal · 38a65e75
      Raju Rangoju authored
      commit 26bff1bd upstream.
      
      The c4iw_rdev_close() logic was not releasing all the hw
      resources (PBL and RQT memory) during the device removal
      event (driver unload / system reboot). This can cause panic
      in gen_pool_destroy().
      
      The module remove function will wait for all the hw
      resources to be released during the device removal event.
      
      Fixes c12a67fe(iw_cxgb4: free EQ queue memory on last deref)
      Signed-off-by: default avatarRaju Rangoju <rajur@chelsio.com>
      Reviewed-by: default avatarSteve Wise <swise@opengridcomputing.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      38a65e75
    • Darrick J. Wong's avatar
      xfs: prevent creating negative-sized file via INSERT_RANGE · bd9ca962
      Darrick J. Wong authored
      commit 7d83fb14 upstream.
      
      During the "insert range" fallocate operation, i_size grows by the
      specified 'len' bytes.  XFS verifies that i_size + len < s_maxbytes, as
      it should.  But this comparison is done using the signed 'loff_t', and
      'i_size + len' can wrap around to a negative value, causing the check to
      incorrectly pass, resulting in an inode with "negative" i_size.  This is
      possible on 64-bit platforms, where XFS sets s_maxbytes = LLONG_MAX.
      ext4 and f2fs don't run into this because they set a smaller s_maxbytes.
      
      Fix it by using subtraction instead.
      
      Reproducer:
          xfs_io -f file -c "truncate $(((1<<63)-1))" -c "finsert 0 4096"
      
      Fixes: a904b1ca ("xfs: Add support FALLOC_FL_INSERT_RANGE for fallocate")
      Cc: <stable@vger.kernel.org> # v4.1+
      Originally-From: Eric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      [darrick: fix signed integer addition overflow too]
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bd9ca962
    • Ping-Ke Shih's avatar
      rtlwifi: cleanup 8723be ant_sel definition · b68c7af0
      Ping-Ke Shih authored
      commit af8a41cc upstream.
      
      Some HP laptops have only a single wifi antenna. This would not be a
      problem except that they were shipped with an incorrectly encoded
      EFUSE. It should have been possible to open the computer and transfer
      the antenna connection to the other terminal except that such action
      might void the warranty, and moving the antenna broke the Windows
      driver. The fix was to add a module option that would override the
      EFUSE encoding. That was done with commit c18d8f50 ("rtlwifi:
      rtl8723be: Add antenna select module parameter"). There was still a
      problem with Bluetooth coexistence, which was addressed with commit
      baa17022 ("rtlwifi: btcoexist: Implement antenna selection").
      There were still problems, thus there were commit 0ff78ade
      ("rtlwifi: rtl8723be: fix ant_sel code") and commit 6d622692
      ("rtlwifi: btcoexist: Fix antenna selection code"). Despite all these
      attempts at fixing the problem, the code is not yet right. A proper
      fix is important as there are now instances of laptops having
      RTL8723DE chips with the same problem.
      
      The module parameter ant_sel is used to control antenna number and path.
      At present enum ANT_{X2,X1} is used to define the antenna number, but
      this choice is not intuitive, thus change to a new enum ANT_{MAIN,AUX}
      to make it more readable. This change showed examples where incorrect
      values were used. It was also possible to remove a workaround in
      halbtcoutsrc.c.
      
      The experimental results with single antenna connected to specific path
      are now as follows:
        ant_sel  ANT_MAIN(#1)  ANT_AUX(#2)
           0        -8            -62
           1        -62           -10
           2        -6            -60
      Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
      Fixes: c18d8f50 ("rtlwifi: rtl8723be: Add antenna select module parameter")
      Fixes: baa17022 ("rtlwifi: btcoexist: Implement antenna selection")
      Fixes: 0ff78ade ("rtlwifi: rtl8723be: fix ant_sel code")
      Fixes: 6d622692 ("rtlwifi: btcoexist: Fix antenna selection code")
      Cc: Stable <stable@vger.kernel.org> # 4.7+
      Reviewed-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b68c7af0
    • Ping-Ke Shih's avatar
      rtlwifi: btcoex: Add power_on_setting routine · fcd835be
      Ping-Ke Shih authored
      commit a44709bb upstream.
      
      After mac power-on sequence, wifi will start to work so notify btcoex the
      event to configure registers especially related to antenna. This will not
      only help to assign antenna but also to yield better user experience.
      Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fcd835be
    • Vittorio Gambaletta (VittGam)'s avatar
      Input: atmel_mxt_ts - add touchpad button mapping for Samsung Chromebook Pro · 10579ed3
      Vittorio Gambaletta (VittGam) authored
      commit f372b811 upstream.
      
      This patch adds the correct platform data information for the Caroline
      Chromebook, so that the mouse button does not get stuck in pressed state
      after the first click.
      
      The Samus button keymap and platform data definition are the correct
      ones for Caroline, so they have been reused here.
      Signed-off-by: default avatarVittorio Gambaletta <linuxbugs@vittgam.net>
      Signed-off-by: default avatarSalvatore Bellizzi <lkml@seppia.net>
      Tested-by: default avatarGuenter Roeck <groeck@chromium.org>
      Cc: stable@vger.kernel.org
      [dtor: adjusted vendor spelling to match shipping firmware]
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      10579ed3
    • Dmitry Torokhov's avatar
      Input: leds - fix out of bound access · 89493702
      Dmitry Torokhov authored
      commit 6bd6ae63 upstream.
      
      UI_SET_LEDBIT ioctl() causes the following KASAN splat when used with
      led > LED_CHARGING:
      
      [ 1274.663418] BUG: KASAN: slab-out-of-bounds in input_leds_connect+0x611/0x730 [input_leds]
      [ 1274.663426] Write of size 8 at addr ffff88003377b2c0 by task ckb-next-daemon/5128
      
      This happens because we were writing to the led structure before making
      sure that it exists.
      Reported-by: default avatarTasos Sahanidis <tasos@tasossah.com>
      Tested-by: default avatarTasos Sahanidis <tasos@tasossah.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      89493702
    • Bryant G Ly's avatar
      scsi: target: Fix fortify_panic kernel exception · 2c698f7b
      Bryant G Ly authored
      commit f5957dad upstream.
      
      memcmp() requires the two buffers passed as arguments to be at least
      'size' bytes long, otherwise a fortify_panic will trigger.
      
      Use memchr_inv() instead of memcmp() to determine whether the received
      payload is zeroed or not.
      
      The bug was found by running a block backstore via LIO.
      
      [  496.212958] Call Trace:
      [  496.212960] [c0000007e58e3800] [c000000000cbbefc] fortify_panic+0x24/0x38 (unreliable)
      [  496.212965] [c0000007e58e3860] [d00000000f150c28] iblock_execute_write_same+0x3b8/0x3c0 [target_core_iblock]
      [  496.212976] [c0000007e58e3910] [d000000006c737d4] __target_execute_cmd+0x54/0x150 [target_core_mod]
      [  496.212982] [c0000007e58e3940] [d000000006d32ce4] ibmvscsis_write_pending+0x74/0xe0 [ibmvscsis]
      [  496.212991] [c0000007e58e39b0] [d000000006c74fc8] transport_generic_new_cmd+0x318/0x370 [target_core_mod]
      [  496.213001] [c0000007e58e3a30] [d000000006c75084] transport_handle_cdb_direct+0x64/0xd0 [target_core_mod]
      [  496.213011] [c0000007e58e3aa0] [d000000006c75298] target_submit_cmd_map_sgls+0x1a8/0x320 [target_core_mod]
      [  496.213021] [c0000007e58e3b30] [d000000006c75458] target_submit_cmd+0x48/0x60 [target_core_mod]
      [  496.213026] [c0000007e58e3bd0] [d000000006d34c20] ibmvscsis_scheduler+0x370/0x600 [ibmvscsis]
      [  496.213031] [c0000007e58e3c90] [c00000000013135c] process_one_work+0x1ec/0x580
      [  496.213035] [c0000007e58e3d20] [c000000000131798] worker_thread+0xa8/0x600
      [  496.213039] [c0000007e58e3dc0] [c00000000013a468] kthread+0x168/0x1b0
      [  496.213044] [c0000007e58e3e30] [c00000000000b528] ret_from_kernel_thread+0x5c/0xb4
      
      [mkp: tweaked commit message]
      
      Fixes: 2237498f ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
      Signed-off-by: default avatarBryant G. Ly <bryantly@linux.vnet.ibm.com>
      Reviewed-by: default avatarSteven Royer <seroyer@linux.vnet.ibm.com>
      Tested-by: default avatarTaylor Jakobson <tjakobs@us.ibm.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Nicholas Bellinger <nab@linux-iscsi.org>
      Cc: <stable@vger.kernel.org> # v4.13+
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2c698f7b
    • Mathieu Desnoyers's avatar
      tracepoint: Do not warn on ENOMEM · f4438b15
      Mathieu Desnoyers authored
      commit d66a270b upstream.
      
      Tracepoint should only warn when a kernel API user does not respect the
      required preconditions (e.g. same tracepoint enabled twice, or called
      to remove a tracepoint that does not exist).
      
      Silence warning in out-of-memory conditions, given that the error is
      returned to the caller.
      
      This ensures that out-of-memory error-injection testing does not trigger
      warnings in tracepoint.c, which were seen by syzbot.
      
      Link: https://lkml.kernel.org/r/001a114465e241a8720567419a72@google.com
      Link: https://lkml.kernel.org/r/001a1140e0de15fc910567464190@google.com
      Link: http://lkml.kernel.org/r/20180315124424.32319-1-mathieu.desnoyers@efficios.com
      
      CC: Peter Zijlstra <peterz@infradead.org>
      CC: Jiri Olsa <jolsa@redhat.com>
      CC: Arnaldo Carvalho de Melo <acme@kernel.org>
      CC: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      CC: Namhyung Kim <namhyung@kernel.org>
      CC: stable@vger.kernel.org
      Fixes: de7b2973 ("tracepoint: Use struct pointer instead of name hash for reg/unreg tracepoints")
      Reported-by: syzbot+9c0d616860575a73166a@syzkaller.appspotmail.com
      Reported-by: syzbot+4e9ae7fa46233396f64d@syzkaller.appspotmail.com
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f4438b15
    • Takashi Iwai's avatar
      ALSA: aloop: Add missing cable lock to ctl API callbacks · bd0e2aec
      Takashi Iwai authored
      commit 76b3421b upstream.
      
      Some control API callbacks in aloop driver are too lazy to take the
      loopback->cable_lock and it results in possible races of cable access
      while it's being freed.  It eventually lead to a UAF, as reported by
      fuzzer recently.
      
      This patch covers such control API callbacks and add the proper mutex
      locks.
      Reported-by: default avatarDaeRyong Jeong <threeearcat@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bd0e2aec
    • Robert Rosengren's avatar
      ALSA: aloop: Mark paused device as inactive · 4e3460ae
      Robert Rosengren authored
      commit 306a4f3c upstream.
      
      Show paused ALSA aloop device as inactive, i.e. the control
      "PCM Slave Active" set as false. Notification sent upon state change.
      
      This makes it possible for client capturing from aloop device to know if
      data is expected. Without it the client expects data even if playback
      is paused.
      Signed-off-by: default avatarRobert Rosengren <robert.rosengren@axis.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4e3460ae
    • Takashi Sakamoto's avatar
      ALSA: dice: fix kernel NULL pointer dereference due to invalid calculation for array index · 9581fff3
      Takashi Sakamoto authored
      commit 52759c09 upstream.
      
      At a commit f91c9d76 ('ALSA: firewire-lib: cache maximum length of
      payload to reduce function calls'), maximum size of payload for tx
      isochronous packet is cached to reduce the number of function calls.
      
      This cache was programmed to updated at a first callback of ohci1394 IR
      context. However, the maximum size is required to queueing packets before
      starting the isochronous context.
      
      As a result, the cached value is reused to queue packets in next time to
      starting the isochronous context. Then the cache is updated in a first
      callback of the isochronous context. This can cause kernel NULL pointer
      dereference in a below call graph:
      
      (sound/firewire/amdtp-stream.c)
      amdtp_stream_start()
      ->queue_in_packet()
        ->queue_packet()
          (drivers/firewire/core-iso.c)
          ->fw_iso_context_queue()
            ->struct fw_card_driver.queue_iso()
            (drivers/firewire/ohci.c)
            = ohci_queue_iso()
              ->queue_iso_packet_per_buffer()
                buffer->pages[page]
      
      The issued dereference occurs in a case that:
       - target unit supports different stream formats for sampling transmission
         frequency.
       - maximum length of payload for tx stream in a first trial is bigger
         than the length in a second trial.
      
      In this case, correct number of pages are allocated for DMA and the 'pages'
      array has enough elements, while index of the element is wrongly calculated
      according to the old value of length of payload in a call of
      'queue_in_packet()'. Then it causes the issue.
      
      This commit fixes the critical bug. This affects all of drivers in ALSA
      firewire stack in Linux kernel v4.12 or later.
      
      [12665.302360] BUG: unable to handle kernel NULL pointer dereference at 0000000000000030
      [12665.302415] IP: ohci_queue_iso+0x47c/0x800 [firewire_ohci]
      [12665.302439] PGD 0
      [12665.302440] P4D 0
      [12665.302450]
      [12665.302470] Oops: 0000 [#1] SMP PTI
      [12665.302487] Modules linked in: ...
      [12665.303096] CPU: 1 PID: 12760 Comm: jackd Tainted: P           OE   4.13.0-38-generic #43-Ubuntu
      [12665.303154] Hardware name:                  /DH77DF, BIOS KCH7710H.86A.0069.2012.0224.1825 02/24/2012
      [12665.303215] task: ffff9ce87da2ae80 task.stack: ffffb5b8823d0000
      [12665.303258] RIP: 0010:ohci_queue_iso+0x47c/0x800 [firewire_ohci]
      [12665.303301] RSP: 0018:ffffb5b8823d3ab8 EFLAGS: 00010086
      [12665.303337] RAX: ffff9ce4f4876930 RBX: 0000000000000008 RCX: ffff9ce88a3955e0
      [12665.303384] RDX: 0000000000000000 RSI: 0000000034877f00 RDI: 0000000000000000
      [12665.303427] RBP: ffffb5b8823d3b68 R08: ffff9ce8ccb390a0 R09: ffff9ce877639ab0
      [12665.303475] R10: 0000000000000108 R11: 0000000000000000 R12: 0000000000000003
      [12665.303513] R13: 0000000000000000 R14: ffff9ce4f4876950 R15: 0000000000000000
      [12665.303554] FS:  00007f2ec467f8c0(0000) GS:ffff9ce8df280000(0000) knlGS:0000000000000000
      [12665.303600] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [12665.303633] CR2: 0000000000000030 CR3: 00000002dcf90004 CR4: 00000000000606e0
      [12665.303674] Call Trace:
      [12665.303698]  fw_iso_context_queue+0x18/0x20 [firewire_core]
      [12665.303735]  queue_packet+0x88/0xe0 [snd_firewire_lib]
      [12665.303770]  amdtp_stream_start+0x19b/0x270 [snd_firewire_lib]
      [12665.303811]  start_streams+0x276/0x3c0 [snd_dice]
      [12665.303840]  snd_dice_stream_start_duplex+0x1bf/0x480 [snd_dice]
      [12665.303882]  ? vma_gap_callbacks_rotate+0x1e/0x30
      [12665.303914]  ? __rb_insert_augmented+0xab/0x240
      [12665.303936]  capture_prepare+0x3c/0x70 [snd_dice]
      [12665.303961]  snd_pcm_do_prepare+0x1d/0x30 [snd_pcm]
      [12665.303985]  snd_pcm_action_single+0x3b/0x90 [snd_pcm]
      [12665.304009]  snd_pcm_action_nonatomic+0x68/0x70 [snd_pcm]
      [12665.304035]  snd_pcm_prepare+0x68/0x90 [snd_pcm]
      [12665.304058]  snd_pcm_common_ioctl1+0x4c0/0x940 [snd_pcm]
      [12665.304083]  snd_pcm_capture_ioctl1+0x19b/0x250 [snd_pcm]
      [12665.304108]  snd_pcm_capture_ioctl+0x27/0x40 [snd_pcm]
      [12665.304131]  do_vfs_ioctl+0xa8/0x630
      [12665.304148]  ? entry_SYSCALL_64_after_hwframe+0xe9/0x139
      [12665.304172]  ? entry_SYSCALL_64_after_hwframe+0xe2/0x139
      [12665.304195]  ? entry_SYSCALL_64_after_hwframe+0xdb/0x139
      [12665.304218]  ? entry_SYSCALL_64_after_hwframe+0xd4/0x139
      [12665.304242]  ? entry_SYSCALL_64_after_hwframe+0xcd/0x139
      [12665.304265]  ? entry_SYSCALL_64_after_hwframe+0xc6/0x139
      [12665.304288]  ? entry_SYSCALL_64_after_hwframe+0xbf/0x139
      [12665.304312]  ? entry_SYSCALL_64_after_hwframe+0xb8/0x139
      [12665.304335]  ? entry_SYSCALL_64_after_hwframe+0xb1/0x139
      [12665.304358]  SyS_ioctl+0x79/0x90
      [12665.304374]  ? entry_SYSCALL_64_after_hwframe+0x72/0x139
      [12665.304397]  entry_SYSCALL_64_fastpath+0x24/0xab
      [12665.304417] RIP: 0033:0x7f2ec3750ef7
      [12665.304433] RSP: 002b:00007fff99e31388 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      [12665.304465] RAX: ffffffffffffffda RBX: 00007fff99e312f0 RCX: 00007f2ec3750ef7
      [12665.304494] RDX: 0000000000000000 RSI: 0000000000004140 RDI: 0000000000000007
      [12665.304522] RBP: 0000556ebc63fd60 R08: 0000556ebc640560 R09: 0000000000000000
      [12665.304553] R10: 0000000000000001 R11: 0000000000000246 R12: 0000556ebc63fcf0
      [12665.304584] R13: 0000000000000000 R14: 0000000000000007 R15: 0000000000000000
      [12665.304612] Code: 01 00 00 44 89 eb 45 31 ed 45 31 db 66 41 89 1e 66 41 89 5e 0c 66 45 89 5e 0e 49 8b 49 08 49 63 d4 4d 85 c0 49 63 ff 48 8b 14 d1 <48> 8b 72 30 41 8d 14 37 41 89 56 04 48 63 d3 0f 84 ce 00 00 00
      [12665.304713] RIP: ohci_queue_iso+0x47c/0x800 [firewire_ohci] RSP: ffffb5b8823d3ab8
      [12665.304743] CR2: 0000000000000030
      [12665.317701] ---[ end trace 9d55b056dd52a19f ]---
      
      Fixes: f91c9d76 ('ALSA: firewire-lib: cache maximum length of payload to reduce function calls')
      Cc: <stable@vger.kernel.org> # v4.12+
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9581fff3
    • Takashi Iwai's avatar
      ALSA: seq: Fix races at MIDI encoding in snd_virmidi_output_trigger() · dfe7f043
      Takashi Iwai authored
      commit 8f22e525 upstream.
      
      The sequencer virmidi code has an open race at its output trigger
      callback: namely, virmidi keeps only one event packet for processing
      while it doesn't protect for concurrent output trigger calls.
      
      snd_virmidi_output_trigger() tries to process the previously
      unfinished event before starting encoding the given MIDI stream, but
      this is done without any lock.  Meanwhile, if another rawmidi stream
      starts the output trigger, this proceeds further, and overwrites the
      event package that is being processed in another thread.  This
      eventually corrupts and may lead to the invalid memory access if the
      event type is like SYSEX.
      
      The fix is just to move the spinlock to cover both the pending event
      and the new stream.
      
      The bug was spotted by a new fuzzer, RaceFuzzer.
      
      BugLink: http://lkml.kernel.org/r/20180426045223.GA15307@dragonet.kaist.ac.krReported-by: default avatarDaeRyong Jeong <threeearcat@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dfe7f043
    • Takashi Iwai's avatar
      ALSA: pcm: Check PCM state at xfern compat ioctl · e5e9a770
      Takashi Iwai authored
      commit f13876e2 upstream.
      
      Since snd_pcm_ioctl_xfern_compat() has no PCM state check, it may go
      further and hit the sanity check pcm_sanity_check() when the ioctl is
      called right after open.  It may eventually spew a kernel warning, as
      triggered by syzbot, depending on kconfig.
      
      The lack of PCM state check there was just an oversight.  Although
      it's no real crash, the spurious kernel warning is annoying, so let's
      add the proper check.
      
      Reported-by: syzbot+1dac3a4f6bc9c1c675d4@syzkaller.appspotmail.com
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e5e9a770
    • Takashi Iwai's avatar
      ALSA: hda - Fix incorrect usage of IS_REACHABLE() · 5f6e6d06
      Takashi Iwai authored
      commit 6a30abaa upstream.
      
      The commit c469652b ("ALSA: hda - Use IS_REACHABLE() for
      dependency on input") simplified the dependencies with IS_REACHABLE()
      macro, but it broke due to its incorrect usage: it should have been
      IS_REACHABLE(CONFIG_INPUT) instead of IS_REACHABLE(INPUT).
      
      Fixes: c469652b ("ALSA: hda - Use IS_REACHABLE() for dependency on input")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5f6e6d06
    • Kristian Evensen's avatar
      USB: serial: option: Add support for Quectel EP06 · c1e76c30
      Kristian Evensen authored
      commit 71a0483d upstream.
      
      The Quectel EP06 is a Cat. 6 LTE modem, and the interface mapping is as
      follows:
      
      0: Diag
      1: NMEA
      2: AT
      3: Modem
      
      Interface 4 is QMI and interface 5 is ADB, so they are blacklisted.
      
      This patch should also be considered for -stable. The QMI-patch for this
      modem is already in the -stable-queue.
      
      v1->v2:
      * Updated commit prefix (thanks Johan Hovold)
      * Updated commit message slightly.
      Signed-off-by: default avatarKristian Evensen <kristian.evensen@gmail.com>
      Acked-by: default avatarJohan Hovold <johan@kernel.org>
      Cc: Bjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c1e76c30
    • Ard Biesheuvel's avatar
      ACPI / button: make module loadable when booted in non-ACPI mode · c8a622ed
      Ard Biesheuvel authored
      commit ac1e55b1 upstream.
      
      Modules such as nouveau.ko and i915.ko have a link time dependency on
      acpi_lid_open(), and due to its use of acpi_bus_register_driver(),
      the button.ko module that provides it is only loadable when booted in
      ACPI mode. However, the ACPI button driver can be built into the core
      kernel as well, in which case the dependency can always be satisfied,
      and the dependent modules can be loaded regardless of whether the
      system was booted in ACPI mode or not.
      
      So let's fix this asymmetry by making the ACPI button driver loadable
      as a module even if not booted in ACPI mode, so it can provide the
      acpi_lid_open() symbol in the same way as when built into the kernel.
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      [ rjw: Minor adjustments of comments, whitespace and names. ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c8a622ed
    • LEROY Christophe's avatar
      crypto: talitos - fix IPsec cipher in length · 63d9df9e
      LEROY Christophe authored
      commit 2b122730 upstream.
      
      For SEC 2.x+, cipher in length must contain only the ciphertext length.
      In case of using hardware ICV checking, the ICV length is provided via
      the "extent" field of the descriptor pointer.
      
      Cc: <stable@vger.kernel.org> # 4.8+
      Fixes: 549bd8bc ("crypto: talitos - Implement AEAD for SEC1 using HMAC_SNOOP_NO_AFEU")
      Reported-by: default avatarHoria Geantă <horia.geanta@nxp.com>
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      Tested-by: default avatarHoria Geantă <horia.geanta@nxp.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      [backported to 4.9.y, 4.14.y]
      Signed-off-by: default avatarHoria Geantă <horia.geanta@nxp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      63d9df9e
    • Tejun Heo's avatar
      percpu: include linux/sched.h for cond_resched() · e9caf1e1
      Tejun Heo authored
      commit 71546d10 upstream.
      
      microblaze build broke due to missing declaration of the
      cond_resched() invocation added recently.  Let's include linux/sched.h
      explicitly.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e9caf1e1
    • Nicolas Dichtel's avatar
      net: don't call update_pmtu unconditionally · 6a3c946b
      Nicolas Dichtel authored
      commit f15ca723 upstream.
      
      Some dst_ops (e.g. md_dst_ops)) doesn't set this handler. It may result to:
      "BUG: unable to handle kernel NULL pointer dereference at           (null)"
      
      Let's add a helper to check if update_pmtu is available before calling it.
      
      Fixes: 52a589d5 ("geneve: update skb dst pmtu on tx path")
      Fixes: a93bf0ff ("vxlan: update skb dst pmtu on tx path")
      CC: Roman Kapl <code@rkapl.cz>
      CC: Xin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Cc: Thomas Deutschmann <whissi@gentoo.org>
      Cc: Eddie Chapman <eddie@ehuk.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6a3c946b
    • Xin Long's avatar
      geneve: update skb dst pmtu on tx path · 3a928a26
      Xin Long authored
      commit 52a589d5 upstream.
      
      Commit a93bf0ff ("vxlan: update skb dst pmtu on tx path") has fixed
      a performance issue caused by the change of lower dev's mtu for vxlan.
      
      The same thing needs to be done for geneve as well.
      
      Note that geneve cannot adjust it's mtu according to lower dev's mtu
      when creating it. The performance is very low later when netperfing
      over it without fixing the mtu manually. This patch could also avoid
      this issue.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Cc: Thomas Deutschmann <whissi@gentoo.org>
      Cc: Eddie Chapman <eddie@ehuk.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3a928a26
  2. 01 May, 2018 15 commits