1. 05 Feb, 2020 33 commits
  2. 29 Jan, 2020 7 commits
    • Greg Kroah-Hartman's avatar
      Linux 4.9.212 · 6f8dc956
      Greg Kroah-Hartman authored
      6f8dc956
    • Martin Schiller's avatar
      net/x25: fix nonblocking connect · c4efc614
      Martin Schiller authored
      commit e21dba7a upstream.
      
      This patch fixes 2 issues in x25_connect():
      
      1. It makes absolutely no sense to reset the neighbour and the
      connection state after a (successful) nonblocking call of x25_connect.
      This prevents any connection from being established, since the response
      (call accept) cannot be processed.
      
      2. Any further calls to x25_connect() while a call is pending should
      simply return, instead of creating new Call Request (on different
      logical channels).
      
      This patch should also fix the "KASAN: null-ptr-deref Write in
      x25_connect" and "BUG: unable to handle kernel NULL pointer dereference
      in x25_connect" bugs reported by syzbot.
      Signed-off-by: default avatarMartin Schiller <ms@dev.tdt.de>
      Reported-by: syzbot+429c200ffc8772bfe070@syzkaller.appspotmail.com
      Reported-by: syzbot+eec0c87f31a7c3b66f7b@syzkaller.appspotmail.com
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c4efc614
    • Kadlecsik József's avatar
      netfilter: ipset: use bitmap infrastructure completely · 1bbbcf6d
      Kadlecsik József authored
      commit 32c72165 upstream.
      
      The bitmap allocation did not use full unsigned long sizes
      when calculating the required size and that was triggered by KASAN
      as slab-out-of-bounds read in several places. The patch fixes all
      of them.
      
      Reported-by: syzbot+fabca5cbf5e54f3fe2de@syzkaller.appspotmail.com
      Reported-by: syzbot+827ced406c9a1d9570ed@syzkaller.appspotmail.com
      Reported-by: syzbot+190d63957b22ef673ea5@syzkaller.appspotmail.com
      Reported-by: syzbot+dfccdb2bdb4a12ad425e@syzkaller.appspotmail.com
      Reported-by: syzbot+df0d0f5895ef1f41a65b@syzkaller.appspotmail.com
      Reported-by: syzbot+b08bd19bb37513357fd4@syzkaller.appspotmail.com
      Reported-by: syzbot+53cdd0ec0bbabd53370a@syzkaller.appspotmail.com
      Signed-off-by: default avatarJozsef Kadlecsik <kadlec@netfilter.org>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1bbbcf6d
    • Andy Shevchenko's avatar
      bitmap: Add bitmap_alloc(), bitmap_zalloc() and bitmap_free() · 33a451d9
      Andy Shevchenko authored
      commit c42b65e3 upstream.
      
      A lot of code become ugly because of open coding allocations for bitmaps.
      
      Introduce three helpers to allow users be more clear of intention
      and keep their code neat.
      
      Note, due to multiple circular dependencies we may not provide
      the helpers as inliners. For now we keep them exported and, perhaps,
      at some point in the future we will sort out header inclusion and
      inheritance.
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      33a451d9
    • Andy Shevchenko's avatar
      md: Avoid namespace collision with bitmap API · b5475640
      Andy Shevchenko authored
      commit e64e4018 upstream.
      
      bitmap API (include/linux/bitmap.h) has 'bitmap' prefix for its methods.
      
      On the other hand MD bitmap API is special case.
      Adding 'md' prefix to it to avoid name space collision.
      
      No functional changes intended.
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Acked-by: default avatarShaohua Li <shli@kernel.org>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      [only take the bitmap_free change for stable - gregkh]
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b5475640
    • Bo Wu's avatar
      scsi: iscsi: Avoid potential deadlock in iscsi_if_rx func · df19092a
      Bo Wu authored
      commit bba340c7 upstream.
      
      In iscsi_if_rx func, after receiving one request through
      iscsi_if_recv_msg func, iscsi_if_send_reply will be called to try to
      reply to the request in a do-while loop.  If the iscsi_if_send_reply
      function keeps returning -EAGAIN, a deadlock will occur.
      
      For example, a client only send msg without calling recvmsg func, then
      it will result in the watchdog soft lockup.  The details are given as
      follows:
      
      	sock_fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ISCSI);
      	retval = bind(sock_fd, (struct sock addr*) & src_addr, sizeof(src_addr);
      	while (1) {
      		state_msg = sendmsg(sock_fd, &msg, 0);
      		//Note: recvmsg(sock_fd, &msg, 0) is not processed here.
      	}
      	close(sock_fd);
      
      watchdog: BUG: soft lockup - CPU#7 stuck for 22s! [netlink_test:253305] Sample time: 4000897528 ns(HZ: 250) Sample stat:
      curr: user: 675503481560, nice: 321724050, sys: 448689506750, idle: 4654054240530, iowait: 40885550700, irq: 14161174020, softirq: 8104324140, st: 0
      deta: user: 0, nice: 0, sys: 3998210100, idle: 0, iowait: 0, irq: 1547170, softirq: 242870, st: 0 Sample softirq:
               TIMER:        992
               SCHED:          8
      Sample irqstat:
               irq    2: delta       1003, curr:    3103802, arch_timer
      CPU: 7 PID: 253305 Comm: netlink_test Kdump: loaded Tainted: G           OE
      Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015
      pstate: 40400005 (nZcv daif +PAN -UAO)
      pc : __alloc_skb+0x104/0x1b0
      lr : __alloc_skb+0x9c/0x1b0
      sp : ffff000033603a30
      x29: ffff000033603a30 x28: 00000000000002dd
      x27: ffff800b34ced810 x26: ffff800ba7569f00
      x25: 00000000ffffffff x24: 0000000000000000
      x23: ffff800f7c43f600 x22: 0000000000480020
      x21: ffff0000091d9000 x20: ffff800b34eff200
      x19: ffff800ba7569f00 x18: 0000000000000000
      x17: 0000000000000000 x16: 0000000000000000
      x15: 0000000000000000 x14: 0001000101000100
      x13: 0000000101010000 x12: 0101000001010100
      x11: 0001010101010001 x10: 00000000000002dd
      x9 : ffff000033603d58 x8 : ffff800b34eff400
      x7 : ffff800ba7569200 x6 : ffff800b34eff400
      x5 : 0000000000000000 x4 : 00000000ffffffff
      x3 : 0000000000000000 x2 : 0000000000000001
      x1 : ffff800b34eff2c0 x0 : 0000000000000300 Call trace:
      __alloc_skb+0x104/0x1b0
      iscsi_if_rx+0x144/0x12bc [scsi_transport_iscsi]
      netlink_unicast+0x1e0/0x258
      netlink_sendmsg+0x310/0x378
      sock_sendmsg+0x4c/0x70
      sock_write_iter+0x90/0xf0
      __vfs_write+0x11c/0x190
      vfs_write+0xac/0x1c0
      ksys_write+0x6c/0xd8
      __arm64_sys_write+0x24/0x30
      el0_svc_common+0x78/0x130
      el0_svc_handler+0x38/0x78
      el0_svc+0x8/0xc
      
      Link: https://lore.kernel.org/r/EDBAAA0BBBA2AC4E9C8B6B81DEEE1D6915E3D4D2@dggeml505-mbx.china.huawei.comSigned-off-by: default avatarBo Wu <wubo40@huawei.com>
      Reviewed-by: default avatarZhiqiang Liu <liuzhiqiang26@huawei.com>
      Reviewed-by: default avatarLee Duncan <lduncan@suse.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      df19092a
    • Dan Carpenter's avatar
      bcache: silence static checker warning · 94e7963c
      Dan Carpenter authored
      commit da22f0ee upstream.
      
      In olden times, closure_return() used to have a hidden return built in.
      We removed the hidden return but forgot to add a new return here.  If
      "c" were NULL we would oops on the next line, but fortunately "c" is
      never NULL.  Let's just remove the if statement.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarColy Li <colyli@suse.de>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      94e7963c