1. 05 Oct, 2019 39 commits
    • Chris Wilson's avatar
      ALSA: hda: Flush interrupts on disabling · 4a22542a
      Chris Wilson authored
      [ Upstream commit caa8422d ]
      
      I was looking at
      
      <4> [241.835158] general protection fault: 0000 [#1] PREEMPT SMP PTI
      <4> [241.835181] CPU: 1 PID: 214 Comm: kworker/1:3 Tainted: G     U            5.2.0-CI-CI_DRM_6509+ #1
      <4> [241.835199] Hardware name: Dell Inc.                 OptiPlex 745                 /0GW726, BIOS 2.3.1  05/21/2007
      <4> [241.835234] Workqueue: events snd_hdac_bus_process_unsol_events [snd_hda_core]
      <4> [241.835256] RIP: 0010:input_handle_event+0x16d/0x5e0
      <4> [241.835270] Code: 48 8b 93 58 01 00 00 8b 52 08 89 50 04 8b 83 f8 06 00 00 48 8b 93 00 07 00 00 8d 70 01 48 8d 04 c2 83 e1 08 89 b3 f8 06 00 00 <66> 89 28 66 44 89 60 02 44 89 68 04 8b 93 f8 06 00 00 0f 84 fd fe
      <4> [241.835304] RSP: 0018:ffffc9000019fda0 EFLAGS: 00010046
      <4> [241.835317] RAX: 6b6b6b6ec6c6c6c3 RBX: ffff8880290fefc8 RCX: 0000000000000000
      <4> [241.835332] RDX: 000000006b6b6b6b RSI: 000000006b6b6b6c RDI: 0000000000000046
      <4> [241.835347] RBP: 0000000000000005 R08: 0000000000000000 R09: 0000000000000001
      <4> [241.835362] R10: ffffc9000019faa0 R11: 0000000000000000 R12: 0000000000000004
      <4> [241.835377] R13: 0000000000000000 R14: ffff8880290ff1d0 R15: 0000000000000293
      <4> [241.835392] FS:  0000000000000000(0000) GS:ffff88803de80000(0000) knlGS:0000000000000000
      <4> [241.835409] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      <4> [241.835422] CR2: 00007ffe9a99e9b7 CR3: 000000002f588000 CR4: 00000000000006e0
      <4> [241.835436] Call Trace:
      <4> [241.835449]  input_event+0x45/0x70
      <4> [241.835464]  snd_jack_report+0xdc/0x100
      <4> [241.835490]  snd_hda_jack_report_sync+0x83/0xc0 [snd_hda_codec]
      <4> [241.835512]  snd_hdac_bus_process_unsol_events+0x5a/0x70 [snd_hda_core]
      <4> [241.835530]  process_one_work+0x245/0x610
      
      which has the hallmarks of a worker queued from interrupt after it was
      supposedly cancelled (note the POISON_FREE), and I could not see where
      the interrupt would be flushed on shutdown so added the likely suspects.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111174Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      4a22542a
    • Ori Nimron's avatar
      nfc: enforce CAP_NET_RAW for raw sockets · 45a9e9bc
      Ori Nimron authored
      [ Upstream commit 3a359798 ]
      
      When creating a raw AF_NFC socket, CAP_NET_RAW needs to be checked
      first.
      Signed-off-by: default avatarOri Nimron <orinimron123@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      45a9e9bc
    • Ori Nimron's avatar
      ieee802154: enforce CAP_NET_RAW for raw sockets · ddca1f39
      Ori Nimron authored
      [ Upstream commit e69dbd46 ]
      
      When creating a raw AF_IEEE802154 socket, CAP_NET_RAW needs to be
      checked first.
      Signed-off-by: default avatarOri Nimron <orinimron123@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: default avatarStefan Schmidt <stefan@datenfreihafen.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ddca1f39
    • Ori Nimron's avatar
      ax25: enforce CAP_NET_RAW for raw sockets · 73b8d26c
      Ori Nimron authored
      [ Upstream commit 0614e2b7 ]
      
      When creating a raw AF_AX25 socket, CAP_NET_RAW needs to be checked
      first.
      Signed-off-by: default avatarOri Nimron <orinimron123@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      73b8d26c
    • Ori Nimron's avatar
      appletalk: enforce CAP_NET_RAW for raw sockets · 08d2af93
      Ori Nimron authored
      [ Upstream commit 6cc03e8a ]
      
      When creating a raw AF_APPLETALK socket, CAP_NET_RAW needs to be checked
      first.
      Signed-off-by: default avatarOri Nimron <orinimron123@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      08d2af93
    • Ori Nimron's avatar
      mISDN: enforce CAP_NET_RAW for raw sockets · bb439ee2
      Ori Nimron authored
      [ Upstream commit b91ee4aa ]
      
      When creating a raw AF_ISDN socket, CAP_NET_RAW needs to be checked
      first.
      Signed-off-by: default avatarOri Nimron <orinimron123@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bb439ee2
    • Oliver Neukum's avatar
      usbnet: sanity checking of packet sizes and device mtu · 55416208
      Oliver Neukum authored
      [ Upstream commit 280ceaed ]
      
      After a reset packet sizes and device mtu can change and need
      to be reevaluated to calculate queue sizes.
      Malicious devices can set this to zero and we divide by it.
      Introduce sanity checking.
      
      Reported-and-tested-by:  syzbot+6102c120be558c885f04@syzkaller.appspotmail.com
      Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      55416208
    • Bjørn Mork's avatar
      usbnet: ignore endpoints with invalid wMaxPacketSize · 96f23cb8
      Bjørn Mork authored
      [ Upstream commit 8d3d7c20 ]
      
      Endpoints with zero wMaxPacketSize are not usable for transferring
      data. Ignore such endpoints when looking for valid in, out and
      status pipes, to make the drivers more robust against invalid and
      meaningless descriptors.
      
      The wMaxPacketSize of these endpoints are used for memory allocations
      and as divisors in many usbnet minidrivers. Avoiding zero is therefore
      critical.
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      96f23cb8
    • Stephen Hemminger's avatar
      skge: fix checksum byte order · 0022f009
      Stephen Hemminger authored
      [ Upstream commit 5aafeb74 ]
      
      Running old skge driver on PowerPC causes checksum errors
      because hardware reported 1's complement checksum is in little-endian
      byte order.
      Reported-by: default avatarBenoit <benoit.sansoni@gmail.com>
      Signed-off-by: default avatarStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0022f009
    • Eric Dumazet's avatar
      sch_netem: fix a divide by zero in tabledist() · 9850f930
      Eric Dumazet authored
      [ Upstream commit b41d936b ]
      
      syzbot managed to crash the kernel in tabledist() loading
      an empty distribution table.
      
      	t = dist->table[rnd % dist->size];
      
      Simply return an error when such load is attempted.
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9850f930
    • Takeshi Misawa's avatar
      ppp: Fix memory leak in ppp_write · ac7ac130
      Takeshi Misawa authored
      [ Upstream commit 4c247de5 ]
      
      When ppp is closing, __ppp_xmit_process() failed to enqueue skb
      and skb allocated in ppp_write() is leaked.
      
      syzbot reported :
      BUG: memory leak
      unreferenced object 0xffff88812a17bc00 (size 224):
        comm "syz-executor673", pid 6952, jiffies 4294942888 (age 13.040s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<00000000d110fff9>] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline]
          [<00000000d110fff9>] slab_post_alloc_hook mm/slab.h:522 [inline]
          [<00000000d110fff9>] slab_alloc_node mm/slab.c:3262 [inline]
          [<00000000d110fff9>] kmem_cache_alloc_node+0x163/0x2f0 mm/slab.c:3574
          [<000000002d616113>] __alloc_skb+0x6e/0x210 net/core/skbuff.c:197
          [<000000000167fc45>] alloc_skb include/linux/skbuff.h:1055 [inline]
          [<000000000167fc45>] ppp_write+0x48/0x120 drivers/net/ppp/ppp_generic.c:502
          [<000000009ab42c0b>] __vfs_write+0x43/0xa0 fs/read_write.c:494
          [<00000000086b2e22>] vfs_write fs/read_write.c:558 [inline]
          [<00000000086b2e22>] vfs_write+0xee/0x210 fs/read_write.c:542
          [<00000000a2b70ef9>] ksys_write+0x7c/0x130 fs/read_write.c:611
          [<00000000ce5e0fdd>] __do_sys_write fs/read_write.c:623 [inline]
          [<00000000ce5e0fdd>] __se_sys_write fs/read_write.c:620 [inline]
          [<00000000ce5e0fdd>] __x64_sys_write+0x1e/0x30 fs/read_write.c:620
          [<00000000d9d7b370>] do_syscall_64+0x76/0x1a0 arch/x86/entry/common.c:296
          [<0000000006e6d506>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Fix this by freeing skb, if ppp is closing.
      
      Fixes: 6d066734 ("ppp: avoid loop in xmit recursion detection code")
      Reported-and-tested-by: syzbot+d9c8bf24e56416d7ce2c@syzkaller.appspotmail.com
      Signed-off-by: default avatarTakeshi Misawa <jeliantsurux@gmail.com>
      Reviewed-by: default avatarGuillaume Nault <gnault@redhat.com>
      Tested-by: default avatarGuillaume Nault <gnault@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ac7ac130
    • Li RongQing's avatar
      openvswitch: change type of UPCALL_PID attribute to NLA_UNSPEC · a0b5e917
      Li RongQing authored
      [ Upstream commit ea8564c8 ]
      
      userspace openvswitch patch "(dpif-linux: Implement the API
      functions to allow multiple handler threads read upcall)"
      changes its type from U32 to UNSPEC, but leave the kernel
      unchanged
      
      and after kernel 6e237d09 "(netlink: Relax attr validation
      for fixed length types)", this bug is exposed by the below
      warning
      
      	[   57.215841] netlink: 'ovs-vswitchd': attribute type 5 has an invalid length.
      
      Fixes: 5cd667b0 ("openvswitch: Allow each vport to have an array of 'port_id's")
      Signed-off-by: default avatarLi RongQing <lirongqing@baidu.com>
      Acked-by: default avatarPravin B Shelar <pshelar@ovn.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a0b5e917
    • Bjorn Andersson's avatar
      net: qrtr: Stop rx_worker before freeing node · 68b042d3
      Bjorn Andersson authored
      [ Upstream commit 73f0c11d ]
      
      As the endpoint is unregistered there might still be work pending to
      handle incoming messages, which will result in a use after free
      scenario. The plan is to remove the rx_worker, but until then (and for
      stable@) ensure that the work is stopped before the node is freed.
      
      Fixes: bdabad3e ("net: Add Qualcomm IPC router")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      68b042d3
    • Peter Mamonov's avatar
      net/phy: fix DP83865 10 Mbps HDX loopback disable function · 9d8ea820
      Peter Mamonov authored
      [ Upstream commit e47488b2 ]
      
      According to the DP83865 datasheet "the 10 Mbps HDX loopback can be
      disabled in the expanded memory register 0x1C0.1". The driver erroneously
      used bit 0 instead of bit 1.
      
      Fixes: 4621bf12 ("phy: Add file missed in previous commit.")
      Signed-off-by: default avatarPeter Mamonov <pmamonov@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9d8ea820
    • Xin Long's avatar
      macsec: drop skb sk before calling gro_cells_receive · 2ddbe6e0
      Xin Long authored
      [ Upstream commit ba56d8ce ]
      
      Fei Liu reported a crash when doing netperf on a topo of macsec
      dev over veth:
      
        [  448.919128] refcount_t: underflow; use-after-free.
        [  449.090460] Call trace:
        [  449.092895]  refcount_sub_and_test+0xb4/0xc0
        [  449.097155]  tcp_wfree+0x2c/0x150
        [  449.100460]  ip_rcv+0x1d4/0x3a8
        [  449.103591]  __netif_receive_skb_core+0x554/0xae0
        [  449.108282]  __netif_receive_skb+0x28/0x78
        [  449.112366]  netif_receive_skb_internal+0x54/0x100
        [  449.117144]  napi_gro_complete+0x70/0xc0
        [  449.121054]  napi_gro_flush+0x6c/0x90
        [  449.124703]  napi_complete_done+0x50/0x130
        [  449.128788]  gro_cell_poll+0x8c/0xa8
        [  449.132351]  net_rx_action+0x16c/0x3f8
        [  449.136088]  __do_softirq+0x128/0x320
      
      The issue was caused by skb's true_size changed without its sk's
      sk_wmem_alloc increased in tcp/skb_gro_receive(). Later when the
      skb is being freed and the skb's truesize is subtracted from its
      sk's sk_wmem_alloc in tcp_wfree(), underflow occurs.
      
      macsec is calling gro_cells_receive() to receive a packet, which
      actually requires skb->sk to be NULL. However when macsec dev is
      over veth, it's possible the skb->sk is still set if the skb was
      not unshared or expanded from the peer veth.
      
      ip_rcv() is calling skb_orphan() to drop the skb's sk for tproxy,
      but it is too late for macsec's calling gro_cells_receive(). So
      fix it by dropping the skb's sk earlier on rx path of macsec.
      
      Fixes: 5491e7c6 ("macsec: enable GRO and RPS on macsec devices")
      Reported-by: default avatarXiumei Mu <xmu@redhat.com>
      Reported-by: default avatarFei Liu <feliu@redhat.com>
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2ddbe6e0
    • Bjørn Mork's avatar
      cdc_ncm: fix divide-by-zero caused by invalid wMaxPacketSize · 941b5eef
      Bjørn Mork authored
      [ Upstream commit 3fe4b335 ]
      
      Endpoints with zero wMaxPacketSize are not usable for transferring
      data. Ignore such endpoints when looking for valid in, out and
      status pipes, to make the driver more robust against invalid and
      meaningless descriptors.
      
      The wMaxPacketSize of the out pipe is used as divisor. So this change
      fixes a divide-by-zero bug.
      
      Reported-by: syzbot+ce366e2b8296e25d84f5@syzkaller.appspotmail.com
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      941b5eef
    • Uwe Kleine-König's avatar
      arcnet: provide a buffer big enough to actually receive packets · 337da470
      Uwe Kleine-König authored
      [ Upstream commit 108639aac35eb57f1d0e8333f5fc8c7ff68df938 ]
      
      struct archdr is only big enough to hold the header of various types of
      arcnet packets. So to provide enough space to hold the data read from
      hardware provide a buffer large enough to hold a packet with maximal
      size.
      
      The problem was noticed by the stack protector which makes the kernel
      oops.
      Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Acked-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      337da470
    • Jian-Hong Pan's avatar
      Bluetooth: btrtl: Additional Realtek 8822CE Bluetooth devices · d272e49d
      Jian-Hong Pan authored
      [ Upstream commit 6d0762b1 ]
      
      The ASUS X412FA laptop contains a Realtek RTL8822CE device with an
      associated BT chip using a USB ID of 04ca:4005. This ID is added to the
      driver.
      
      The /sys/kernel/debug/usb/devices portion for this device is:
      
      T:  Bus=01 Lev=01 Prnt=01 Port=09 Cnt=04 Dev#=  4 Spd=12   MxCh= 0
      D:  Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=04ca ProdID=4005 Rev= 0.00
      S:  Manufacturer=Realtek
      S:  Product=Bluetooth Radio
      S:  SerialNumber=00e04c000001
      C:* #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=500mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      
      Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=204707Signed-off-by: default avatarJian-Hong Pan <jian-hong@endlessm.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      d272e49d
    • Darrick J. Wong's avatar
      xfs: don't crash on null attr fork xfs_bmapi_read · 0a72d776
      Darrick J. Wong authored
      [ Upstream commit 8612de3f ]
      
      Zorro Lang reported a crash in generic/475 if we try to inactivate a
      corrupt inode with a NULL attr fork (stack trace shortened somewhat):
      
      RIP: 0010:xfs_bmapi_read+0x311/0xb00 [xfs]
      RSP: 0018:ffff888047f9ed68 EFLAGS: 00010202
      RAX: dffffc0000000000 RBX: ffff888047f9f038 RCX: 1ffffffff5f99f51
      RDX: 0000000000000002 RSI: 0000000000000008 RDI: 0000000000000012
      RBP: ffff888002a41f00 R08: ffffed10005483f0 R09: ffffed10005483ef
      R10: ffffed10005483ef R11: ffff888002a41f7f R12: 0000000000000004
      R13: ffffe8fff53b5768 R14: 0000000000000005 R15: 0000000000000001
      FS:  00007f11d44b5b80(0000) GS:ffff888114200000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000ef6000 CR3: 000000002e176003 CR4: 00000000001606e0
      Call Trace:
       xfs_dabuf_map.constprop.18+0x696/0xe50 [xfs]
       xfs_da_read_buf+0xf5/0x2c0 [xfs]
       xfs_da3_node_read+0x1d/0x230 [xfs]
       xfs_attr_inactive+0x3cc/0x5e0 [xfs]
       xfs_inactive+0x4c8/0x5b0 [xfs]
       xfs_fs_destroy_inode+0x31b/0x8e0 [xfs]
       destroy_inode+0xbc/0x190
       xfs_bulkstat_one_int+0xa8c/0x1200 [xfs]
       xfs_bulkstat_one+0x16/0x20 [xfs]
       xfs_bulkstat+0x6fa/0xf20 [xfs]
       xfs_ioc_bulkstat+0x182/0x2b0 [xfs]
       xfs_file_ioctl+0xee0/0x12a0 [xfs]
       do_vfs_ioctl+0x193/0x1000
       ksys_ioctl+0x60/0x90
       __x64_sys_ioctl+0x6f/0xb0
       do_syscall_64+0x9f/0x4d0
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      RIP: 0033:0x7f11d39a3e5b
      
      The "obvious" cause is that the attr ifork is null despite the inode
      claiming an attr fork having at least one extent, but it's not so
      obvious why we ended up with an inode in that state.
      Reported-by: default avatarZorro Lang <zlang@redhat.com>
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204031Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: default avatarBill O'Donnell <billodo@redhat.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      0a72d776
    • Chris Wilson's avatar
      drm: Flush output polling on shutdown · e71b7592
      Chris Wilson authored
      [ Upstream commit 3b295cb1 ]
      
      We need to mark the output polling as disabled to prevent concurrent
      irqs from queuing new work as shutdown the probe -- causing that work to
      execute after we have freed the structs:
      
      <4> [341.846490] DEBUG_LOCKS_WARN_ON(mutex_is_locked(lock))
      <4> [341.846497] WARNING: CPU: 3 PID: 3300 at kernel/locking/mutex-debug.c:103 mutex_destroy+0x49/0x50
      <4> [341.846508] Modules linked in: i915(-) vgem thunderbolt snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic mei_hdcp x86_pkg_temp_thermal coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm mcs7830 btusb usbnet btrtl mii btbcm btintel bluetooth ecdh_generic ecc mei_me mei prime_numbers i2c_hid pinctrl_sunrisepoint pinctrl_intel [last unloaded: i915]
      <4> [341.846546] CPU: 3 PID: 3300 Comm: i915_module_loa Tainted: G     U            5.2.0-rc2-CI-CI_DRM_6175+ #1
      <4> [341.846553] Hardware name: Dell Inc. XPS 13 9360/0823VW, BIOS 2.9.0 07/09/2018
      <4> [341.846560] RIP: 0010:mutex_destroy+0x49/0x50
      <4> [341.846565] Code: 00 00 5b c3 e8 a8 9f 3b 00 85 c0 74 ed 8b 05 3e 55 23 01 85 c0 75 e3 48 c7 c6 00 d0 08 82 48 c7 c7 a8 aa 07 82 e8 e7 08 fa ff <0f> 0b eb cc 0f 1f 00 48 b8 11 11 11 11 11 11 11 11 48 89 76 20 48
      <4> [341.846578] RSP: 0018:ffffc900006cfdb0 EFLAGS: 00010286
      <4> [341.846583] RAX: 0000000000000000 RBX: ffff88826759a168 RCX: 0000000000000000
      <4> [341.846589] RDX: 0000000000000002 RSI: 0000000000000000 RDI: ffffffff8112844c
      <4> [341.846595] RBP: ffff8882708fa548 R08: 0000000000000000 R09: 0000000000039600
      <4> [341.846601] R10: 0000000000000000 R11: 0000000000000ce4 R12: ffffffffa07de1e0
      <4> [341.846607] R13: 0000000000000000 R14: 0000000000000000 R15: ffffffffa07de2d0
      <4> [341.846613] FS:  00007f62b5ae0e40(0000) GS:ffff888276380000(0000) knlGS:0000000000000000
      <4> [341.846620] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      <4> [341.846626] CR2: 000055a4e064f4a0 CR3: 0000000266b16006 CR4: 00000000003606e0
      <4> [341.846632] Call Trace:
      <4> [341.846639]  drm_fb_helper_fini.part.17+0xb3/0x100
      <4> [341.846682]  intel_fbdev_fini+0x20/0x80 [i915]
      <4> [341.846722]  intel_modeset_cleanup+0x9a/0x140 [i915]
      <4> [341.846750]  i915_driver_unload+0xa3/0x100 [i915]
      <4> [341.846778]  i915_pci_remove+0x19/0x30 [i915]
      <4> [341.846784]  pci_device_remove+0x36/0xb0
      <4> [341.846790]  device_release_driver_internal+0xd3/0x1b0
      <4> [341.846795]  driver_detach+0x3f/0x80
      <4> [341.846800]  bus_remove_driver+0x53/0xd0
      <4> [341.846805]  pci_unregister_driver+0x25/0xa0
      <4> [341.846843]  i915_exit+0x16/0x1c [i915]
      <4> [341.846849]  __se_sys_delete_module+0x162/0x210
      <4> [341.846855]  ? trace_hardirqs_off_thunk+0x1a/0x1c
      <4> [341.846859]  ? do_syscall_64+0xd/0x1c0
      <4> [341.846864]  do_syscall_64+0x55/0x1c0
      <4> [341.846869]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
      <4> [341.846875] RIP: 0033:0x7f62b51871b7
      <4> [341.846881] Code: 73 01 c3 48 8b 0d d1 8c 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a1 8c 2c 00 f7 d8 64 89 01 48
      <4> [341.846897] RSP: 002b:00007ffe7a227138 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
      <4> [341.846904] RAX: ffffffffffffffda RBX: 00007ffe7a2272b0 RCX: 00007f62b51871b7
      <4> [341.846910] RDX: 0000000000000001 RSI: 0000000000000800 RDI: 0000557cd6b55948
      <4> [341.846916] RBP: 0000557cd6b558e0 R08: 0000557cd6b5594c R09: 00007ffe7a227160
      <4> [341.846922] R10: 00007ffe7a226134 R11: 0000000000000206 R12: 0000000000000000
      <4> [341.846927] R13: 00007ffe7a227820 R14: 0000000000000000 R15: 0000000000000000
      <4> [341.846936] irq event stamp: 3547847
      <4> [341.846940] hardirqs last  enabled at (3547847): [<ffffffff819aad2c>] _raw_spin_unlock_irqrestore+0x4c/0x60
      <4> [341.846949] hardirqs last disabled at (3547846): [<ffffffff819aab9d>] _raw_spin_lock_irqsave+0xd/0x50
      <4> [341.846957] softirqs last  enabled at (3547376): [<ffffffff81c0033a>] __do_softirq+0x33a/0x4b9
      <4> [341.846966] softirqs last disabled at (3547367): [<ffffffff810b6379>] irq_exit+0xa9/0xc0
      <4> [341.846973] WARNING: CPU: 3 PID: 3300 at kernel/locking/mutex-debug.c:103 mutex_destroy+0x49/0x50
      <4> [341.846980] ---[ end trace ba94ca8952ba970e ]---
      <7> [341.866547] [drm:intel_dp_detect [i915]] MST support? port A: no, sink: no, modparam: yes
      <7> [341.890480] [drm:drm_add_display_info] non_desktop set to 0
      <7> [341.890530] [drm:drm_add_edid_modes] ELD: no CEA Extension found
      <7> [341.890537] [drm:drm_add_display_info] non_desktop set to 0
      <7> [341.890578] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:86:eDP-1] probed modes :
      <7> [341.890589] [drm:drm_mode_debug_printmodeline] Modeline "3200x1800": 60 373250 3200 3248 3280 3360 1800 1803 1808 1852 0x48 0xa
      <7> [341.890602] [drm:drm_mode_debug_printmodeline] Modeline "3200x1800": 48 298600 3200 3248 3280 3360 1800 1803 1808 1852 0x40 0xa
      <4> [341.890628] general protection fault: 0000 [#1] PREEMPT SMP PTI
      <4> [341.890636] CPU: 0 PID: 508 Comm: kworker/0:4 Tainted: G     U  W         5.2.0-rc2-CI-CI_DRM_6175+ #1
      <4> [341.890646] Hardware name: Dell Inc. XPS 13 9360/0823VW, BIOS 2.9.0 07/09/2018
      <4> [341.890655] Workqueue: events output_poll_execute
      <4> [341.890663] RIP: 0010:drm_setup_crtcs+0x13e/0xbe0
      <4> [341.890669] Code: 00 41 8b 44 24 58 85 c0 0f 8e f9 01 00 00 44 8b 6c 24 20 44 8b 74 24 28 31 db 31 ed 49 8b 44 24 60 48 63 d5 44 89 ee 83 c5 01 <48> 8b 04 d0 44 89 f2 48 8b 38 48 8b 87 88 01 00 00 48 8b 40 20 e8
      <4> [341.890686] RSP: 0018:ffffc9000033fd40 EFLAGS: 00010202
      <4> [341.890692] RAX: 6b6b6b6b6b6b6b6b RBX: 0000000000000002 RCX: 0000000000000000
      <4> [341.890700] RDX: 0000000000000001 RSI: 0000000000000c80 RDI: 00000000ffffffff
      <4> [341.890707] RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000
      <4> [341.890715] R10: 0000000000000c80 R11: 0000000000000000 R12: ffff888267599fe8
      <4> [341.890722] R13: 0000000000000c80 R14: 0000000000000708 R15: 0000000000000007
      <4> [341.890730] FS:  0000000000000000(0000) GS:ffff888276200000(0000) knlGS:0000000000000000
      <4> [341.890739] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      <4> [341.890745] CR2: 000055a4e064f4a0 CR3: 000000026d234003 CR4: 00000000003606f0
      <4> [341.890752] Call Trace:
      <4> [341.890760]  drm_fb_helper_hotplug_event.part.24+0x89/0xb0
      <4> [341.890768]  drm_kms_helper_hotplug_event+0x21/0x30
      <4> [341.890774]  output_poll_execute+0x9d/0x1a0
      <4> [341.890782]  process_one_work+0x245/0x610
      <4> [341.890790]  worker_thread+0x37/0x380
      <4> [341.890796]  ? process_one_work+0x610/0x610
      <4> [341.890802]  kthread+0x119/0x130
      <4> [341.890808]  ? kthread_park+0x80/0x80
      <4> [341.890815]  ret_from_fork+0x3a/0x50
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109964Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190603135910.15979-2-chris@chris-wilson.co.ukSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
      e71b7592
    • Chao Yu's avatar
      f2fs: fix to do sanity check on segment bitmap of LFS curseg · f3537bd1
      Chao Yu authored
      [ Upstream commit c854f4d6 ]
      
      As Jungyeon Reported in bugzilla:
      
      https://bugzilla.kernel.org/show_bug.cgi?id=203233
      
      - Reproduces
      gcc poc_13.c
      ./run.sh f2fs
      
      - Kernel messages
       F2FS-fs (sdb): Bitmap was wrongly set, blk:4608
       kernel BUG at fs/f2fs/segment.c:2133!
       RIP: 0010:update_sit_entry+0x35d/0x3e0
       Call Trace:
        f2fs_allocate_data_block+0x16c/0x5a0
        do_write_page+0x57/0x100
        f2fs_do_write_node_page+0x33/0xa0
        __write_node_page+0x270/0x4e0
        f2fs_sync_node_pages+0x5df/0x670
        f2fs_write_checkpoint+0x364/0x13a0
        f2fs_sync_fs+0xa3/0x130
        f2fs_do_sync_file+0x1a6/0x810
        do_fsync+0x33/0x60
        __x64_sys_fsync+0xb/0x10
        do_syscall_64+0x43/0x110
        entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      The testcase fails because that, in fuzzed image, current segment was
      allocated with LFS type, its .next_blkoff should point to an unused
      block address, but actually, its bitmap shows it's not. So during
      allocation, f2fs crash when setting bitmap.
      
      Introducing sanity_check_curseg() to check such inconsistence of
      current in-used segment.
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      f3537bd1
    • Chao Yu's avatar
      Revert "f2fs: avoid out-of-range memory access" · 06c417b2
      Chao Yu authored
      [ Upstream commit a37d0862 ]
      
      As Pavel Machek reported:
      
      "We normally use -EUCLEAN to signal filesystem corruption. Plus, it is
      good idea to report it to the syslog and mark filesystem as "needing
      fsck" if filesystem can do that."
      
      Still we need improve the original patch with:
      - use unlikely keyword
      - add message print
      - return EUCLEAN
      
      However, after rethink this patch, I don't think we should add such
      condition check here as below reasons:
      - We have already checked the field in f2fs_sanity_check_ckpt(),
      - If there is fs corrupt or security vulnerability, there is nothing
      to guarantee the field is integrated after the check, unless we do
      the check before each of its use, however no filesystem does that.
      - We only have similar check for bitmap, which was added due to there
      is bitmap corruption happened on f2fs' runtime in product.
      - There are so many key fields in SB/CP/NAT did have such check
      after f2fs_sanity_check_{sb,cp,..}.
      
      So I propose to revert this unneeded check.
      
      This reverts commit 56f3ce67.
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      06c417b2
    • Surbhi Palande's avatar
      f2fs: check all the data segments against all node ones · 002d2680
      Surbhi Palande authored
      [ Upstream commit 1166c1f2 ]
      
      As a part of the sanity checking while mounting, distinct segment number
      assignment to data and node segments is verified. Fixing a small bug in
      this verification between node and data segments. We need to check all
      the data segments with all the node segments.
      
      Fixes: 042be0f8 ("f2fs: fix to do sanity check with current segment number")
      Signed-off-by: default avatarSurbhi Palande <csurbhi@gmail.com>
      Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      002d2680
    • Marc Zyngier's avatar
      irqchip/gic-v3-its: Fix LPI release for Multi-MSI devices · 9f4f1df8
      Marc Zyngier authored
      [ Upstream commit c9c96e30 ]
      
      When allocating a range of LPIs for a Multi-MSI capable device,
      this allocation extended to the closest power of 2.
      
      But on the release path, the interrupts are released one by
      one. This results in not releasing the "extra" range, leaking
      the its_device. Trying to reprobe the device will then fail.
      
      Fix it by releasing the LPIs the same way we allocate them.
      
      Fixes: 8208d170 ("irqchip/gic-v3-its: Align PCI Multi-MSI allocation on their size")
      Reported-by: default avatarJiaxing Luo <luojiaxing@huawei.com>
      Tested-by: default avatarJohn Garry <john.garry@huawei.com>
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      Link: https://lore.kernel.org/r/f5e948aa-e32f-3f74-ae30-31fee06c2a74@huawei.comSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
      9f4f1df8
    • Waiman Long's avatar
      locking/lockdep: Add debug_locks check in __lock_downgrade() · 59da7942
      Waiman Long authored
      [ Upstream commit 513e1073 ]
      
      Tetsuo Handa had reported he saw an incorrect "downgrading a read lock"
      warning right after a previous lockdep warning. It is likely that the
      previous warning turned off lock debugging causing the lockdep to have
      inconsistency states leading to the lock downgrade warning.
      
      Fix that by add a check for debug_locks at the beginning of
      __lock_downgrade().
      Reported-by: default avatarTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Reported-by: syzbot+53383ae265fb161ef488@syzkaller.appspotmail.com
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Link: https://lkml.kernel.org/r/1547093005-26085-1-git-send-email-longman@redhat.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      59da7942
    • David Lechner's avatar
      power: supply: sysfs: ratelimit property read error message · 9ad66b78
      David Lechner authored
      [ Upstream commit 87a2b65f ]
      
      This adds rate limiting to the message that is printed when reading a
      power supply property via sysfs returns an error. This will prevent
      userspace applications from unintentionally dDOSing the system by
      continuously reading a property that returns an error.
      Signed-off-by: default avatarDavid Lechner <david@lechnology.com>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      9ad66b78
    • Yu Wang's avatar
      mac80211: handle deauthentication/disassociation from TDLS peer · 7b1f4ffa
      Yu Wang authored
      [ Upstream commit 79c92ca4 ]
      
      When receiving a deauthentication/disassociation frame from a TDLS
      peer, a station should not disconnect the current AP, but only
      disable the current TDLS link if it's enabled.
      
      Without this change, a TDLS issue can be reproduced by following the
      steps as below:
      
      1. STA-1 and STA-2 are connected to AP, bidirection traffic is running
         between STA-1 and STA-2.
      2. Set up TDLS link between STA-1 and STA-2, stay for a while, then
         teardown TDLS link.
      3. Repeat step #2 and monitor the connection between STA and AP.
      
      During the test, one STA may send a deauthentication/disassociation
      frame to another, after TDLS teardown, with reason code 6/7, which
      means: Class 2/3 frame received from nonassociated STA.
      
      On receive this frame, the receiver STA will disconnect the current
      AP and then reconnect. It's not a expected behavior, purpose of this
      frame should be disabling the TDLS link, not the link with AP.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarYu Wang <yyuwang@codeaurora.org>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      7b1f4ffa
    • Arkadiusz Miskiewicz's avatar
      mac80211: Print text for disassociation reason · 2b81ffa8
      Arkadiusz Miskiewicz authored
      [ Upstream commit 68506e9a ]
      
      When disassociation happens only numeric reason is printed
      in ieee80211_rx_mgmt_disassoc(). Add text variant, too.
      Signed-off-by: default avatarArkadiusz Miśkiewicz <arekm@maven.pl>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      2b81ffa8
    • Josh Poimboeuf's avatar
      objtool: Clobber user CFLAGS variable · cb40b5b9
      Josh Poimboeuf authored
      commit f73b3cc3 upstream.
      
      If the build user has the CFLAGS variable set in their environment,
      objtool blindly appends to it, which can cause unexpected behavior.
      
      Clobber CFLAGS to ensure consistent objtool compilation behavior.
      Reported-by: default avatarValdis Kletnieks <valdis.kletnieks@vt.edu>
      Tested-by: default avatarValdis Kletnieks <valdis.kletnieks@vt.edu>
      Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: https://lkml.kernel.org/r/83a276df209962e6058fcb6c615eef9d401c21bc.1567121311.git.jpoimboe@redhat.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      CC: Nathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cb40b5b9
    • Shih-Yuan Lee (FourDollars)'s avatar
      ALSA: hda - Add laptop imic fixup for ASUS M9V laptop · 1972355d
      Shih-Yuan Lee (FourDollars) authored
      commit 7b485d17 upstream.
      
      The same fixup to enable laptop imic is needed for ASUS M9V with AD1986A
      codec like another HP machine.
      Signed-off-by: default avatarShih-Yuan Lee (FourDollars) <fourdollars@debian.org>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20190920134052.GA8035@localhostSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1972355d
    • Takashi Iwai's avatar
      ASoC: fsl: Fix of-node refcount unbalance in fsl_ssi_probe_from_dt() · 0b73caee
      Takashi Iwai authored
      commit 2757970f upstream.
      
      The node obtained from of_find_node_by_path() has to be unreferenced
      after the use, but we forgot it for the root node.
      
      Fixes: f0fba2ad ("ASoC: multi-component - ASoC Multi-Component Support")
      Cc: Timur Tabi <timur@kernel.org>
      Cc: Nicolin Chen <nicoleotsuka@gmail.com>
      Cc: Xiubo Li <Xiubo.Lee@gmail.com>
      Cc: Fabio Estevam <festevam@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Acked-by: default avatarNicolin Chen <nicoleotsuka@gmail.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0b73caee
    • Marco Felsch's avatar
      media: tvp5150: fix switch exit in set control handler · b0ff6664
      Marco Felsch authored
      commit 2d29bcc8 upstream.
      
      The function only consists of a single switch case block without a
      default case. Unsupported control requests are indicated by the -EINVAL
      return code trough the last return statement at the end of the function. So
      exiting just the switch case block returns the -EINVAL error code but the
      hue control is supported and a zero should be returned instead.
      
      Replace the break by a 'return 0' to fix this behaviour.
      
      Fixes: d183e4ef ("[media] v4l: tvp5150: Add missing break in set
      control handler")
      Signed-off-by: default avatarMarco Felsch <m.felsch@pengutronix.de>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b0ff6664
    • Gustavo A. R. Silva's avatar
      crypto: talitos - fix missing break in switch statement · c58ff323
      Gustavo A. R. Silva authored
      commit 5fc194ea upstream.
      
      Add missing break statement in order to prevent the code from falling
      through to case CRYPTO_ALG_TYPE_AHASH.
      
      Fixes: aeb4c132 ("crypto: talitos - Convert to new AEAD interface")
      Cc: stable@vger.kernel.org
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c58ff323
    • Tokunori Ikegami's avatar
      mtd: cfi_cmdset_0002: Use chip_good() to retry in do_write_oneword() · 55f2d8d5
      Tokunori Ikegami authored
      commit 37c673ad upstream.
      
      As reported by the OpenWRT team, write requests sometimes fail on some
      platforms.
      Currently to check the state chip_ready() is used correctly as described by
      the flash memory S29GL256P11TFI01 datasheet.
      Also chip_good() is used to check if the write is succeeded and it was
      implemented by the commit fb4a90bf ("[MTD] CFI-0002 - Improve error
      checking").
      But actually the write failure is caused on some platforms and also it can
      be fixed by using chip_good() to check the state and retry instead.
      Also it seems that it is caused after repeated about 1,000 times to retry
      the write one word with the reset command.
      By using chip_good() to check the state to be done it can be reduced the
      retry with reset.
      It is depended on the actual flash chip behavior so the root cause is
      unknown.
      
      Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
      Cc: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
      Cc: linux-mtd@lists.infradead.org
      Cc: stable@vger.kernel.org
      Reported-by: default avatarFabio Bettoni <fbettoni@gmail.com>
      Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
      Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Signed-off-by: default avatarTokunori Ikegami <ikegami.t@gmail.com>
      [vigneshr@ti.com: Fix a checkpatch warning]
      Signed-off-by: default avatarVignesh Raghavendra <vigneshr@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      55f2d8d5
    • Alan Stern's avatar
      HID: hidraw: Fix invalid read in hidraw_ioctl · c53234d8
      Alan Stern authored
      commit 416dacb8 upstream.
      
      The syzbot fuzzer has reported a pair of problems in the
      hidraw_ioctl() function: slab-out-of-bounds read and use-after-free
      read.  An example of the first:
      
      BUG: KASAN: slab-out-of-bounds in strlen+0x79/0x90 lib/string.c:525
      Read of size 1 at addr ffff8881c8035f38 by task syz-executor.4/2833
      
      CPU: 1 PID: 2833 Comm: syz-executor.4 Not tainted 5.3.0-rc2+ #1
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
      Google 01/01/2011
      Call Trace:
        __dump_stack lib/dump_stack.c:77 [inline]
        dump_stack+0xca/0x13e lib/dump_stack.c:113
        print_address_description+0x6a/0x32c mm/kasan/report.c:351
        __kasan_report.cold+0x1a/0x33 mm/kasan/report.c:482
        kasan_report+0xe/0x12 mm/kasan/common.c:612
        strlen+0x79/0x90 lib/string.c:525
        strlen include/linux/string.h:281 [inline]
        hidraw_ioctl+0x245/0xae0 drivers/hid/hidraw.c:446
        vfs_ioctl fs/ioctl.c:46 [inline]
        file_ioctl fs/ioctl.c:509 [inline]
        do_vfs_ioctl+0xd2d/0x1330 fs/ioctl.c:696
        ksys_ioctl+0x9b/0xc0 fs/ioctl.c:713
        __do_sys_ioctl fs/ioctl.c:720 [inline]
        __se_sys_ioctl fs/ioctl.c:718 [inline]
        __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:718
        do_syscall_64+0xb7/0x580 arch/x86/entry/common.c:296
        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      RIP: 0033:0x459829
      Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7
      48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff
      ff 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
      RSP: 002b:00007f7a68f6dc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459829
      RDX: 0000000000000000 RSI: 0000000080404805 RDI: 0000000000000004
      RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000246 R12: 00007f7a68f6e6d4
      R13: 00000000004c21de R14: 00000000004d5620 R15: 00000000ffffffff
      
      The two problems have the same cause: hidraw_ioctl() fails to test
      whether the device has been removed.  This patch adds the missing test.
      
      Reported-and-tested-by: syzbot+5a6c4ec678a0c6ee84ba@syzkaller.appspotmail.com
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: <stable@vger.kernel.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c53234d8
    • Alan Stern's avatar
      HID: logitech: Fix general protection fault caused by Logitech driver · 1336cc7e
      Alan Stern authored
      commit 5f924277 upstream.
      
      The syzbot fuzzer found a general protection fault in the HID subsystem:
      
      kasan: CONFIG_KASAN_INLINE enabled
      kasan: GPF could be caused by NULL-ptr deref or user memory access
      general protection fault: 0000 [#1] SMP KASAN
      CPU: 0 PID: 3715 Comm: syz-executor.3 Not tainted 5.2.0-rc6+ #15
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
      Google 01/01/2011
      RIP: 0010:__pm_runtime_resume+0x49/0x180 drivers/base/power/runtime.c:1069
      Code: ed 74 d5 fe 45 85 ed 0f 85 9a 00 00 00 e8 6f 73 d5 fe 48 8d bd c1 02
      00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 48
      89 fa 83 e2 07 38 d0 7f 08 84 c0 0f 85 fe 00 00 00
      RSP: 0018:ffff8881d99d78e0 EFLAGS: 00010202
      RAX: dffffc0000000000 RBX: 0000000000000020 RCX: ffffc90003f3f000
      RDX: 0000000416d8686d RSI: ffffffff82676841 RDI: 00000020b6c3436a
      RBP: 00000020b6c340a9 R08: ffff8881c6d64800 R09: fffffbfff0e84c25
      R10: ffff8881d99d7940 R11: ffffffff87426127 R12: 0000000000000004
      R13: 0000000000000000 R14: ffff8881d9b94000 R15: ffffffff897f9048
      FS:  00007f047f542700(0000) GS:ffff8881db200000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000001b30f21000 CR3: 00000001ca032000 CR4: 00000000001406f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
        pm_runtime_get_sync include/linux/pm_runtime.h:226 [inline]
        usb_autopm_get_interface+0x1b/0x50 drivers/usb/core/driver.c:1707
        usbhid_power+0x7c/0xe0 drivers/hid/usbhid/hid-core.c:1234
        hid_hw_power include/linux/hid.h:1038 [inline]
        hidraw_open+0x20d/0x740 drivers/hid/hidraw.c:282
        chrdev_open+0x219/0x5c0 fs/char_dev.c:413
        do_dentry_open+0x497/0x1040 fs/open.c:778
        do_last fs/namei.c:3416 [inline]
        path_openat+0x1430/0x3ff0 fs/namei.c:3533
        do_filp_open+0x1a1/0x280 fs/namei.c:3563
        do_sys_open+0x3c0/0x580 fs/open.c:1070
        do_syscall_64+0xb7/0x560 arch/x86/entry/common.c:301
        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      It turns out the fault was caused by a bug in the HID Logitech driver,
      which violates the requirement that every pathway calling
      hid_hw_start() must also call hid_hw_stop().  This patch fixes the bug
      by making sure the requirement is met.
      
      Reported-and-tested-by: syzbot+3cbe5cd105d2ad56a1df@syzkaller.appspotmail.com
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: <stable@vger.kernel.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1336cc7e
    • Alan Stern's avatar
      HID: prodikeys: Fix general protection fault during probe · c0a697d3
      Alan Stern authored
      commit 98375b86 upstream.
      
      The syzbot fuzzer provoked a general protection fault in the
      hid-prodikeys driver:
      
      kasan: CONFIG_KASAN_INLINE enabled
      kasan: GPF could be caused by NULL-ptr deref or user memory access
      general protection fault: 0000 [#1] SMP KASAN
      CPU: 0 PID: 12 Comm: kworker/0:1 Not tainted 5.3.0-rc5+ #28
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
      Google 01/01/2011
      Workqueue: usb_hub_wq hub_event
      RIP: 0010:pcmidi_submit_output_report drivers/hid/hid-prodikeys.c:300  [inline]
      RIP: 0010:pcmidi_set_operational drivers/hid/hid-prodikeys.c:558 [inline]
      RIP: 0010:pcmidi_snd_initialise drivers/hid/hid-prodikeys.c:686 [inline]
      RIP: 0010:pk_probe+0xb51/0xfd0 drivers/hid/hid-prodikeys.c:836
      Code: 0f 85 50 04 00 00 48 8b 04 24 4c 89 7d 10 48 8b 58 08 e8 b2 53 e4 fc
      48 8b 54 24 20 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f
      85 13 04 00 00 48 ba 00 00 00 00 00 fc ff df 49 8b
      
      The problem is caused by the fact that pcmidi_get_output_report() will
      return an error if the HID device doesn't provide the right sort of
      output report, but pcmidi_set_operational() doesn't bother to check
      the return code and assumes the function call always succeeds.
      
      This patch adds the missing check and aborts the probe operation if
      necessary.
      
      Reported-and-tested-by: syzbot+1088533649dafa1c9004@syzkaller.appspotmail.com
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: <stable@vger.kernel.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c0a697d3
    • Jack Morgenstein's avatar
      IB/core: Add an unbound WQ type to the new CQ API · 787f774b
      Jack Morgenstein authored
      commit f794809a upstream.
      
      The upstream kernel commit cited below modified the workqueue in the
      new CQ API to be bound to a specific CPU (instead of being unbound).
      This caused ALL users of the new CQ API to use the same bound WQ.
      
      Specifically, MAD handling was severely delayed when the CPU bound
      to the WQ was busy handling (higher priority) interrupts.
      
      This caused a delay in the MAD "heartbeat" response handling,
      which resulted in ports being incorrectly classified as "down".
      
      To fix this, add a new "unbound" WQ type to the new CQ API, so that users
      have the option to choose either a bound WQ or an unbound WQ.
      
      For MADs, choose the new "unbound" WQ.
      
      Fixes: b7363e67 ("IB/device: Convert ib-comp-wq to be CPU-bound")
      Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.m>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      787f774b
    • Marcel Holtmann's avatar
      Revert "Bluetooth: validate BLE connection interval updates" · 6b48ef1f
      Marcel Holtmann authored
      [ Upstream commit 68d19d7d ]
      
      This reverts commit c49a8682.
      
      There are devices which require low connection intervals for usable operation
      including keyboards and mice. Forcing a static connection interval for
      these types of devices has an impact in latency and causes a regression.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      6b48ef1f
  2. 21 Sep, 2019 1 commit