Skip to content
  1. Jan 03, 2019
    • Stefano Brivio's avatar
      ipv6: route: Fix return value of ip6_neigh_lookup() on neigh_create() error · 7adf3246
      Stefano Brivio authored
      
      
      In ip6_neigh_lookup(), we must not return errors coming from
      neigh_create(): if creation of a neighbour entry fails, the lookup should
      return NULL, in the same way as it's done in __neigh_lookup().
      
      Otherwise, callers legitimately checking for a non-NULL return value of
      the lookup function might dereference an invalid pointer.
      
      For instance, on neighbour table overflow, ndisc_router_discovery()
      crashes ndisc_update() by passing ERR_PTR(-ENOBUFS) as 'neigh' argument.
      
      Reported-by: default avatarJianlin Shi <jishi@redhat.com>
      Fixes: f8a1b43b ("net/ipv6: Create a neigh_lookup for FIB entries")
      Signed-off-by: default avatarStefano Brivio <sbrivio@redhat.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7adf3246
    • Eric Dumazet's avatar
      net/hamradio/6pack: use mod_timer() to rearm timers · 202700e3
      Eric Dumazet authored
      
      
      Using del_timer() + add_timer() is generally unsafe on SMP,
      as noticed by syzbot. Use mod_timer() instead.
      
      kernel BUG at kernel/time/timer.c:1136!
      invalid opcode: 0000 [#1] PREEMPT SMP KASAN
      CPU: 1 PID: 1026 Comm: kworker/u4:4 Not tainted 4.20.0+ #2
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Workqueue: events_unbound flush_to_ldisc
      RIP: 0010:add_timer kernel/time/timer.c:1136 [inline]
      RIP: 0010:add_timer+0xa81/0x1470 kernel/time/timer.c:1134
      Code: 4d 89 7d 40 48 c7 85 70 fe ff ff 00 00 00 00 c7 85 7c fe ff ff ff ff ff ff 48 89 85 90 fe ff ff e9 e6 f7 ff ff e8 cf 42 12 00 <0f> 0b e8 c8 42 12 00 0f 0b e8 c1 42 12 00 4c 89 bd 60 fe ff ff e9
      RSP: 0018:ffff8880a7fdf5a8 EFLAGS: 00010293
      RAX: ffff8880a7846340 RBX: dffffc0000000000 RCX: 0000000000000000
      RDX: 0000000000000000 RSI: ffffffff816f3ee1 RDI: ffff88808a514ff8
      RBP: ffff8880a7fdf760 R08: 0000000000000007 R09: ffff8880a7846c58
      R10: ffff8880a7846340 R11: 0000000000000000 R12: ffff88808a514ff8
      R13: ffff88808a514ff8 R14: ffff88808a514dc0 R15: 0000000000000030
      FS:  0000000000000000(0000) GS:ffff8880ae700000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 000000000061c500 CR3: 00000000994d9000 CR4: 00000000001406e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       decode_prio_command drivers/net/hamradio/6pack.c:903 [inline]
       sixpack_decode drivers/net/hamradio/6pack.c:971 [inline]
       sixpack_receive_buf drivers/net/hamradio/6pack.c:457 [inline]
       sixpack_receive_buf+0xf9c/0x1470 drivers/net/hamradio/6pack.c:434
       tty_ldisc_receive_buf+0x164/0x1c0 drivers/tty/tty_buffer.c:465
       tty_port_default_receive_buf+0x114/0x190 drivers/tty/tty_port.c:38
       receive_buf drivers/tty/tty_buffer.c:481 [inline]
       flush_to_ldisc+0x3b2/0x590 drivers/tty/tty_buffer.c:533
       process_one_work+0xd0c/0x1ce0 kernel/workqueue.c:2153
       worker_thread+0x143/0x14a0 kernel/workqueue.c:2296
       kthread+0x357/0x430 kernel/kthread.c:246
       ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Cc: Andreas Koensgen <ajk@comnets.uni-bremen.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      202700e3
    • Xue Chaojing's avatar
      net-next/hinic:add shutdown callback · 53fe3ed1
      Xue Chaojing authored
      
      
      If there is no shutdown callback, our board will report pcie UNF errors
      after restarting. This patch add shutdown callback for hinic.
      
      Signed-off-by: default avatarXue Chaojing <xuechaojing@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      53fe3ed1
  2. Jan 02, 2019
  3. Jan 01, 2019
    • Tyrel Datwyler's avatar
      ibmveth: fix DMA unmap error in ibmveth_xmit_start error path · 756af9c6
      Tyrel Datwyler authored
      
      
      Commit 33a48ab1 ("ibmveth: Fix DMA unmap error") fixed an issue in the
      normal code path of ibmveth_xmit_start() that was originally introduced by
      Commit 6e8ab30e ("ibmveth: Add scatter-gather support"). This original
      fix missed the error path where dma_unmap_page is wrongly called on the
      header portion in descs[0] which was mapped with dma_map_single. As a
      result a failure to DMA map any of the frags results in a dmesg warning
      when CONFIG_DMA_API_DEBUG is enabled.
      
      ------------[ cut here ]------------
      DMA-API: ibmveth 30000002: device driver frees DMA memory with wrong function
        [device address=0x000000000a430000] [size=172 bytes] [mapped as page] [unmapped as single]
      WARNING: CPU: 1 PID: 8426 at kernel/dma/debug.c:1085 check_unmap+0x4fc/0xe10
      ...
      <snip>
      ...
      DMA-API: Mapped at:
      ibmveth_start_xmit+0x30c/0xb60
      dev_hard_start_xmit+0x100/0x450
      sch_direct_xmit+0x224/0x490
      __qdisc_run+0x20c/0x980
      __dev_queue_xmit+0x1bc/0xf20
      
      This fixes the API misuse by unampping descs[0] with dma_unmap_single.
      
      Fixes: 6e8ab30e ("ibmveth: Add scatter-gather support")
      Signed-off-by: default avatarTyrel Datwyler <tyreld@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      756af9c6
  4. Dec 31, 2018
  5. Dec 30, 2018
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf · f7d18ef6
      David S. Miller authored
      
      
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      The following patchset contains Netfilter fixes for net, specifically
      fixes for the nf_conncount infrastructure which is causing troubles
      since 5c789e13 ("netfilter: nf_conncount: Add list lock and gc
      worker, and RCU for init tree search"). Patches aim to simplify this
      infrastructure while fixing up the problems:
      
      1) Use fixed size CONNCOUNT_SLOTS in nf_conncount, from Shawn Bohrer.
      
      2) Incorrect signedness in age calculation from find_or_evict(),
         from Florian Westphal.
      
      3) Proper locking for the garbage collector workqueue callback,
         first make a patch to count how many nodes can be collected
         without holding locks, then grab lock and release them. Also
         from Florian.
      
      4) Restart node lookup from the insertion path, after releasing nodes
         via packet path garbage collection. Shawn Bohrer described a scenario
         that may result in inserting a connection in an already dead list
         node. Patch from Florian.
      
      5) Merge lookup and add function to avoid a hold release and re-grab.
         From Florian.
      
      6) Be safe and iterate over the node lists under the spinlock.
      
      7) Speculative list nodes removal via garbage collection, check if
         list node got a connection while it was scheduled for deletion
         via gc.
      
      8) Accidental argument swap in find_next_bit() that leads to more
         frequent scheduling of the workqueue. From Florian Westphal.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f7d18ef6
  6. Dec 29, 2018
  7. Dec 28, 2018