1. Nov 11, 2022
  2. Nov 10, 2022
    • Leonid Ravich's avatar
      IB/mad: Don't call to function that might sleep while in atomic context · 5c20311d
      Leonid Ravich authored
      Tracepoints are not allowed to sleep, as such the following splat is
      generated due to call to ib_query_pkey() in atomic context.
      
      WARNING: CPU: 0 PID: 1888000 at kernel/trace/ring_buffer.c:2492 rb_commit+0xc1/0x220
      CPU: 0 PID: 1888000 Comm: kworker/u9:0 Kdump: loaded Tainted: G           OE    --------- -  - 4.18.0-305.3.1.el8.x86_64 #1
       Hardware name: Red Hat KVM, BIOS 1.13.0-2.module_el8.3.0+555+a55c8938 04/01/2014
       Workqueue: ib-comp-unb-wq ib_cq_poll_work [ib_core]
       RIP: 0010:rb_commit+0xc1/0x220
       RSP: 0000:ffffa8ac80f9bca0 EFLAGS: 00010202
       RAX: ffff8951c7c01300 RBX: ffff8951c7c14a00 RCX: 0000000000000246
       RDX: ffff8951c707c000 RSI: ffff8951c707c57c RDI: ffff8951c7c14a00
       RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
       R10: ffff8951c7c01300 R11: 0000000000000001 R12: 0000000000000246
       R13: 0000000000000000 R14: ffffffff964c70c0 R15: 0000000000000000
       FS:  0000000000000000(0000) GS:ffff8951fbc00000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 00007f20e8f39010 CR3: 000000002ca10005 CR4: 0000000000170ef0
       Call Trace:
        ring_buffer_unlock_commit+0x1d/0xa0
        trace_buffer_unlock_commit_regs+0x3b/0x1b0
        trace_event_buffer_commit+0x67/0x1d0
        trace_event_raw_event_ib_mad_recv_done_handler+0x11c/0x160 [ib_core]
        ib_mad_recv_done+0x48b/0xc10 [ib_core]
        ? trace_event_raw_event_cq_poll+0x6f/0xb0 [ib_core]
        __ib_process_cq+0x91/0x1c0 [ib_core]
        ib_cq_poll_work+0x26/0x80 [ib_core]
        process_one_work+0x1a7/0x360
        ? create_worker+0x1a0/0x1a0
        worker_thread+0x30/0x390
        ? create_worker+0x1a0/0x1a0
        kthread+0x116/0x130
        ? kthread_flush_work_fn+0x10/0x10
        ret_from_fork+0x35/0x40
       ---[ end trace 78ba8509d3830a16 ]---
      
      Fixes: 821bf1de
      
       ("IB/MAD: Add recv path trace point")
      Signed-off-by: default avatarLeonid Ravich <lravich@gmail.com>
      Link: https://lore.kernel.org/r/Y2t5feomyznrVj7V@leonid-Inspiron-3421
      
      
      Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
      5c20311d
    • Daisuke Matsuda's avatar
      RDMA/rxe: Implement packet length validation on responder · 837a5584
      Daisuke Matsuda authored
      
      
      The function check_length() is supposed to check the length of inbound
      packets on responder, but it actually has been a stub since the driver was
      born. Let it check the payload length and the DMA length.
      
      Signed-off-by: default avatarDaisuke Matsuda <matsuda-daisuke@fujitsu.com>
      Link: https://lore.kernel.org/r/20221107055338.357184-1-matsuda-daisuke@fujitsu.com
      
      
      Reviewed-by: default avatarLi Zhijian <lizhijian@fujitsu.com>
      Acked-by: default avatarZhu Yanjun <zyjzyj2000@gmail.com>
      Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
      837a5584
  3. Nov 09, 2022
  4. Nov 07, 2022
  5. Oct 29, 2022
  6. Oct 27, 2022
  7. Oct 25, 2022
  8. Oct 24, 2022
  9. Oct 19, 2022
  10. Oct 17, 2022
    • Linus Torvalds's avatar
      Linux 6.1-rc1 · 9abf2313
      Linus Torvalds authored
      9abf2313
    • Linus Torvalds's avatar
      Merge tag 'random-6.1-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random · f1947d7c
      Linus Torvalds authored
      Pull more random number generator updates from Jason Donenfeld:
       "This time with some large scale treewide cleanups.
      
        The intent of this pull is to clean up the way callers fetch random
        integers. The current rules for doing this right are:
      
         - If you want a secure or an insecure random u64, use get_random_u64()
      
         - If you want a secure or an insecure random u32, use get_random_u32()
      
           The old function prandom_u32() has been deprecated for a while
           now and is just a wrapper around get_random_u32(). Same for
           get_random_int().
      
         - If you want a secure or an insecure random u16, use get_random_u16()
      
         - If you want a secure or an insecure random u8, use get_random_u8()
      
         - If you want secure or insecure random bytes, use get_random_bytes().
      
           The old function prandom_bytes() has been deprecated for a while
           now and has long been a wrapper around get_random_bytes()
      
         - If you want a non-uniform random u32, u16, or u8 bounded by a
           certain open interval maximum, use prandom_u32_max()
      
           I say "non-uniform", because it doesn't do any rejection sampling
           or divisions. Hence, it stays within the prandom_*() namespace, not
           the get_random_*() namespace.
      
           I'm currently investigating a "uniform" function for 6.2. We'll see
           what comes of that.
      
        By applying these rules uniformly, we get several benefits:
      
         - By using prandom_u32_max() with an upper-bound that the compiler
           can prove at compile-time is ≤65536 or ≤256, internally
           get_random_u16() or get_random_u8() is used, which wastes fewer
           batched random bytes, and hence has higher throughput.
      
         - By using prandom_u32_max() instead of %, when the upper-bound is
           not a constant, division is still avoided, because
           prandom_u32_max() uses a faster multiplication-based trick instead.
      
         - By using get_random_u16() or get_random_u8() in cases where the
           return value is intended to indeed be a u16 or a u8, we waste fewer
           batched random bytes, and hence have higher throughput.
      
        This series was originally done by hand while I was on an airplane
        without Internet. Later, Kees and I worked on retroactively figuring
        out what could be done with Coccinelle and what had to be done
        manually, and then we split things up based on that.
      
        So while this touches a lot of files, the actual amount of code that's
        hand fiddled is comfortably small"
      
      * tag 'random-6.1-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random:
        prandom: remove unused functions
        treewide: use get_random_bytes() when possible
        treewide: use get_random_u32() when possible
        treewide: use get_random_{u8,u16}() when possible, part 2
        treewide: use get_random_{u8,u16}() when possible, part 1
        treewide: use prandom_u32_max() when possible, part 2
        treewide: use prandom_u32_max() when possible, part 1
      f1947d7c