1. 20 May, 2020 8 commits
    • Eric Dumazet's avatar
      sch_sfq: validate silly quantum values · 019495fa
      Eric Dumazet authored
      [ Upstream commit df4953e4 ]
      
      syzbot managed to set up sfq so that q->scaled_quantum was zero,
      triggering an infinite loop in sfq_dequeue()
      
      More generally, we must only accept quantum between 1 and 2^18 - 7,
      meaning scaled_quantum must be in [1, 0x7FFF] range.
      
      Otherwise, we also could have a loop in sfq_dequeue()
      if scaled_quantum happens to be 0x8000, since slot->allot
      could indefinitely switch between 0 and 0x8000.
      
      Fixes: eeaeb068 ("sch_sfq: allow big packets and be fair")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: syzbot+0251e883fe39e7a0cb0a@syzkaller.appspotmail.com
      Cc: Jason A. Donenfeld <Jason@zx2c4.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      019495fa
    • Eric Dumazet's avatar
      sch_choke: avoid potential panic in choke_reset() · 6f96cc39
      Eric Dumazet authored
      [ Upstream commit 8738c85c ]
      
      If choke_init() could not allocate q->tab, we would crash later
      in choke_reset().
      
      BUG: KASAN: null-ptr-deref in memset include/linux/string.h:366 [inline]
      BUG: KASAN: null-ptr-deref in choke_reset+0x208/0x340 net/sched/sch_choke.c:326
      Write of size 8 at addr 0000000000000000 by task syz-executor822/7022
      
      CPU: 1 PID: 7022 Comm: syz-executor822 Not tainted 5.7.0-rc1-syzkaller #0
      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+0x188/0x20d lib/dump_stack.c:118
       __kasan_report.cold+0x5/0x4d mm/kasan/report.c:515
       kasan_report+0x33/0x50 mm/kasan/common.c:625
       check_memory_region_inline mm/kasan/generic.c:187 [inline]
       check_memory_region+0x141/0x190 mm/kasan/generic.c:193
       memset+0x20/0x40 mm/kasan/common.c:85
       memset include/linux/string.h:366 [inline]
       choke_reset+0x208/0x340 net/sched/sch_choke.c:326
       qdisc_reset+0x6b/0x520 net/sched/sch_generic.c:910
       dev_deactivate_queue.constprop.0+0x13c/0x240 net/sched/sch_generic.c:1138
       netdev_for_each_tx_queue include/linux/netdevice.h:2197 [inline]
       dev_deactivate_many+0xe2/0xba0 net/sched/sch_generic.c:1195
       dev_deactivate+0xf8/0x1c0 net/sched/sch_generic.c:1233
       qdisc_graft+0xd25/0x1120 net/sched/sch_api.c:1051
       tc_modify_qdisc+0xbab/0x1a00 net/sched/sch_api.c:1670
       rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5454
       netlink_rcv_skb+0x15a/0x410 net/netlink/af_netlink.c:2469
       netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
       netlink_unicast+0x537/0x740 net/netlink/af_netlink.c:1329
       netlink_sendmsg+0x882/0xe10 net/netlink/af_netlink.c:1918
       sock_sendmsg_nosec net/socket.c:652 [inline]
       sock_sendmsg+0xcf/0x120 net/socket.c:672
       ____sys_sendmsg+0x6bf/0x7e0 net/socket.c:2362
       ___sys_sendmsg+0x100/0x170 net/socket.c:2416
       __sys_sendmsg+0xec/0x1b0 net/socket.c:2449
       do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295
      
      Fixes: 77e62da6 ("sch_choke: drop all packets in queue during reset")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Cc: Cong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6f96cc39
    • Matt Jolly's avatar
      net: usb: qmi_wwan: add support for DW5816e · fd6d7ca2
      Matt Jolly authored
      [ Upstream commit 57c7f2bd ]
      
      Add support for Dell Wireless 5816e to drivers/net/usb/qmi_wwan.c
      Signed-off-by: default avatarMatt Jolly <Kangie@footclan.ninja>
      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>
      fd6d7ca2
    • Tariq Toukan's avatar
      net/mlx4_core: Fix use of ENOSPC around mlx4_counter_alloc() · 4a0593e4
      Tariq Toukan authored
      [ Upstream commit 40e47307 ]
      
      When ENOSPC is set the idx is still valid and gets set to the global
      MLX4_SINK_COUNTER_INDEX.  However gcc's static analysis cannot tell that
      ENOSPC is impossible from mlx4_cmd_imm() and gives this warning:
      
      drivers/net/ethernet/mellanox/mlx4/main.c:2552:28: warning: 'idx' may be
      used uninitialized in this function [-Wmaybe-uninitialized]
       2552 |    priv->def_counter[port] = idx;
      
      Also, when ENOSPC is returned mlx4_allocate_default_counters should not
      fail.
      
      Fixes: 6de5f7f6 ("net/mlx4_core: Allocate default counter per port")
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4a0593e4
    • Scott Dial's avatar
      net: macsec: preserve ingress frame ordering · dc9d8659
      Scott Dial authored
      [ Upstream commit ab046a5d ]
      
      MACsec decryption always occurs in a softirq context. Since
      the FPU may not be usable in the softirq context, the call to
      decrypt may be scheduled on the cryptd work queue. The cryptd
      work queue does not provide ordering guarantees. Therefore,
      preserving order requires masking out ASYNC implementations
      of gcm(aes).
      
      For instance, an Intel CPU with AES-NI makes available the
      generic-gcm-aesni driver from the aesni_intel module to
      implement gcm(aes). However, this implementation requires
      the FPU, so it is not always available to use from a softirq
      context, and will fallback to the cryptd work queue, which
      does not preserve frame ordering. With this change, such a
      system would select gcm_base(ctr(aes-aesni),ghash-generic).
      While the aes-aesni implementation prefers to use the FPU, it
      will fallback to the aes-asm implementation if unavailable.
      
      By using a synchronous version of gcm(aes), the decryption
      will complete before returning from crypto_aead_decrypt().
      Therefore, the macsec_decrypt_done() callback will be called
      before returning from macsec_decrypt(). Thus, the order of
      calls to macsec_post_decrypt() for the frames is preserved.
      
      While it's presumable that the pure AES-NI version of gcm(aes)
      is more performant, the hybrid solution is capable of gigabit
      speeds on modest hardware. Regardless, preserving the order
      of frames is paramount for many network protocols (e.g.,
      triggering TCP retries). Within the MACsec driver itself, the
      replay protection is tripped by the out-of-order frames, and
      can cause frames to be dropped.
      
      This bug has been present in this code since it was added in
      v4.6, however it may not have been noticed since not all CPUs
      have FPU offload available. Additionally, the bug manifests
      as occasional out-of-order packets that are easily
      misattributed to other network phenomena.
      
      When this code was added in v4.6, the crypto/gcm.c code did
      not restrict selection of the ghash function based on the
      ASYNC flag. For instance, x86 CPUs with PCLMULQDQ would
      select the ghash-clmulni driver instead of ghash-generic,
      which submits to the cryptd work queue if the FPU is busy.
      However, this bug was was corrected in v4.8 by commit
      b30bdfa8, and was backported
      all the way back to the v3.14 stable branch, so this patch
      should be applicable back to the v4.6 stable branch.
      Signed-off-by: default avatarScott Dial <scott@scottdial.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dc9d8659
    • Eric Dumazet's avatar
      fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks · ce0ca3d9
      Eric Dumazet authored
      [ Upstream commit 14695212 ]
      
      My intent was to not let users set a zero drop_batch_size,
      it seems I once again messed with min()/max().
      
      Fixes: 9d18562a ("fq_codel: add batch ability to fq_codel_drop()")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ce0ca3d9
    • Julia Lawall's avatar
      dp83640: reverse arguments to list_add_tail · c510cc4b
      Julia Lawall authored
      [ Upstream commit 86530837 ]
      
      In this code, it appears that phyter_clocks is a list head, based on
      the previous list_for_each, and that clock->list is intended to be a
      list element, given that it has just been initialized in
      dp83640_clock_init.  Accordingly, switch the arguments to
      list_add_tail, which takes the list head as the second argument.
      
      Fixes: cb646e2b ("ptp: Added a clock driver for the National Semiconductor PHYTER.")
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@inria.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c510cc4b
    • Matt Jolly's avatar
      USB: serial: qcserial: Add DW5816e support · 851ad197
      Matt Jolly authored
      commit 78d6de3c upstream.
      
      Add support for Dell Wireless 5816e to drivers/usb/serial/qcserial.c
      Signed-off-by: default avatarMatt Jolly <Kangie@footclan.ninja>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      851ad197
  2. 10 May, 2020 19 commits
  3. 05 May, 2020 13 commits