1. 14 Sep, 2020 9 commits
    • Xin Long's avatar
      tipc: use skb_unshare() instead in tipc_buf_append() · ff48b622
      Xin Long authored
      In tipc_buf_append() it may change skb's frag_list, and it causes
      problems when this skb is cloned. skb_unclone() doesn't really
      make this skb's flag_list available to change.
      
      Shuang Li has reported an use-after-free issue because of this
      when creating quite a few macvlan dev over the same dev, where
      the broadcast packets will be cloned and go up to the stack:
      
       [ ] BUG: KASAN: use-after-free in pskb_expand_head+0x86d/0xea0
       [ ] Call Trace:
       [ ]  dump_stack+0x7c/0xb0
       [ ]  print_address_description.constprop.7+0x1a/0x220
       [ ]  kasan_report.cold.10+0x37/0x7c
       [ ]  check_memory_region+0x183/0x1e0
       [ ]  pskb_expand_head+0x86d/0xea0
       [ ]  process_backlog+0x1df/0x660
       [ ]  net_rx_action+0x3b4/0xc90
       [ ]
       [ ] Allocated by task 1786:
       [ ]  kmem_cache_alloc+0xbf/0x220
       [ ]  skb_clone+0x10a/0x300
       [ ]  macvlan_broadcast+0x2f6/0x590 [macvlan]
       [ ]  macvlan_process_broadcast+0x37c/0x516 [macvlan]
       [ ]  process_one_work+0x66a/0x1060
       [ ]  worker_thread+0x87/0xb10
       [ ]
       [ ] Freed by task 3253:
       [ ]  kmem_cache_free+0x82/0x2a0
       [ ]  skb_release_data+0x2c3/0x6e0
       [ ]  kfree_skb+0x78/0x1d0
       [ ]  tipc_recvmsg+0x3be/0xa40 [tipc]
      
      So fix it by using skb_unshare() instead, which would create a new
      skb for the cloned frag and it'll be safe to change its frag_list.
      The similar things were also done in sctp_make_reassembled_event(),
      which is using skb_copy().
      Reported-by: default avatarShuang Li <shuali@redhat.com>
      Fixes: 37e22164 ("tipc: rename and move message reassembly function")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ff48b622
    • Peilin Ye's avatar
      tipc: Fix memory leak in tipc_group_create_member() · bb3a420d
      Peilin Ye authored
      tipc_group_add_to_tree() returns silently if `key` matches `nkey` of an
      existing node, causing tipc_group_create_member() to leak memory. Let
      tipc_group_add_to_tree() return an error in such a case, so that
      tipc_group_create_member() can handle it properly.
      
      Fixes: 75da2163 ("tipc: introduce communication groups")
      Reported-and-tested-by: syzbot+f95d90c454864b3b5bc9@syzkaller.appspotmail.com
      Cc: Hillf Danton <hdanton@sina.com>
      Link: https://syzkaller.appspot.com/bug?id=048390604fe1b60df34150265479202f10e13affSigned-off-by: default avatarPeilin Ye <yepeilin.cs@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bb3a420d
    • David Ahern's avatar
      ipv4: Initialize flowi4_multipath_hash in data path · 1869e226
      David Ahern authored
      flowi4_multipath_hash was added by the commit referenced below for
      tunnels. Unfortunately, the patch did not initialize the new field
      for several fast path lookups that do not initialize the entire flow
      struct to 0. Fix those locations. Currently, flowi4_multipath_hash
      is random garbage and affects the hash value computed by
      fib_multipath_hash for multipath selection.
      
      Fixes: 24ba1440 ("route: Add multipath_hash in flowi_common to make user-define hash")
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Cc: wenxu <wenxu@ucloud.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1869e226
    • David S. Miller's avatar
      Merge branch 'net-lantiq-Fix-bugs-in-NAPI-handling' · 9d6e0c8b
      David S. Miller authored
      Hauke Mehrtens says:
      
      ====================
      net: lantiq: Fix bugs in NAPI handling
      
      This fixes multiple bugs in the NAPI handling.
      
      Changes since:
      v1:
       - removed stable tag from "net: lantiq: use netif_tx_napi_add() for TX NAPI"
       - Check the NAPI budged in "net: lantiq: Use napi_complete_done()"
       - Add extra fix "net: lantiq: Disable IRQs only if NAPI gets scheduled"
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9d6e0c8b
    • Hauke Mehrtens's avatar
      net: lantiq: Disable IRQs only if NAPI gets scheduled · 9423361d
      Hauke Mehrtens authored
      The napi_schedule() call will only schedule the NAPI if it is not
      already running. To make sure that we do not deactivate interrupts
      without scheduling NAPI only deactivate the interrupts in case NAPI also
      gets scheduled.
      Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9423361d
    • Hauke Mehrtens's avatar
      net: lantiq: Use napi_complete_done() · c582a7fe
      Hauke Mehrtens authored
      Use napi_complete_done() and activate the interrupts when this function
      returns true. This way the generic NAPI code can take care of activating
      the interrupts.
      Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c582a7fe
    • Hauke Mehrtens's avatar
      net: lantiq: use netif_tx_napi_add() for TX NAPI · 74c7b80e
      Hauke Mehrtens authored
      netif_tx_napi_add() should be used for NAPI in the TX direction instead
      of the netif_napi_add() function.
      Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      74c7b80e
    • Hauke Mehrtens's avatar
      net: lantiq: Wake TX queue again · dea36631
      Hauke Mehrtens authored
      The call to netif_wake_queue() when the TX descriptors were freed was
      missing. When there are no TX buffers available the TX queue will be
      stopped, but it was not started again when they are available again,
      this is fixed in this patch.
      
      Fixes: fe1a5642 ("net: lantiq: Add Lantiq / Intel VRX200 Ethernet driver")
      Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dea36631
    • Olympia Giannou's avatar
      rndis_host: increase sleep time in the query-response loop · 4202c9fd
      Olympia Giannou authored
      Some WinCE devices face connectivity issues via the NDIS interface. They
      fail to register, resulting in -110 timeout errors and failures during the
      probe procedure.
      
      In this kind of WinCE devices, the Windows-side ndis driver needs quite
      more time to be loaded and configured, so that the linux rndis host queries
      to them fail to be responded correctly on time.
      
      More specifically, when INIT is called on the WinCE side - no other
      requests can be served by the Client and this results in a failed QUERY
      afterwards.
      
      The increase of the waiting time on the side of the linux rndis host in
      the command-response loop leaves the INIT process to complete and respond
      to a QUERY, which comes afterwards. The WinCE devices with this special
      "feature" in their ndis driver are satisfied by this fix.
      Signed-off-by: default avatarOlympia Giannou <olympia.giannou@leica-geosystems.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4202c9fd
  2. 12 Sep, 2020 5 commits
  3. 11 Sep, 2020 1 commit
  4. 10 Sep, 2020 22 commits
  5. 09 Sep, 2020 3 commits