1. 21 Apr, 2021 3 commits
    • Vasily Gorbik's avatar
      s390/disassembler: increase ebpf disasm buffer size · 6f3353c2
      Vasily Gorbik authored
      Current ebpf disassembly buffer size of 64 is too small. E.g. this line
      takes 65 bytes:
      01fffff8005822e: ec8100ed8065\tclgrj\t%r8,%r1,8,001fffff80058408\n\0
      
      Double the buffer size like it is done for the kernel disassembly buffer.
      
      Fixes the following KASAN finding:
      
      UG: KASAN: stack-out-of-bounds in print_fn_code+0x34c/0x380
      Write of size 1 at addr 001fff800ad5f970 by task test_progs/853
      
      CPU: 53 PID: 853 Comm: test_progs Not tainted
      5.12.0-rc7-23786-g23457d86b1f0-dirty #19
      Hardware name: IBM 3906 M04 704 (LPAR)
      Call Trace:
       [<0000000cd8e0538a>] show_stack+0x17a/0x1668
       [<0000000cd8e2a5d8>] dump_stack+0x140/0x1b8
       [<0000000cd8e16e74>] print_address_description.constprop.0+0x54/0x260
       [<0000000cd75a8698>] kasan_report+0xc8/0x130
       [<0000000cd6e26da4>] print_fn_code+0x34c/0x380
       [<0000000cd6ea0f4e>] bpf_int_jit_compile+0xe3e/0xe58
       [<0000000cd72c4c88>] bpf_prog_select_runtime+0x5b8/0x9c0
       [<0000000cd72d1bf8>] bpf_prog_load+0xa78/0x19c0
       [<0000000cd72d7ad6>] __do_sys_bpf.part.0+0x18e/0x768
       [<0000000cd6e0f392>] do_syscall+0x12a/0x220
       [<0000000cd8e333f8>] __do_syscall+0x98/0xc8
       [<0000000cd8e54834>] system_call+0x6c/0x94
      1 lock held by test_progs/853:
       #0: 0000000cd9bf7460 (report_lock){....}-{2:2}, at:
           kasan_report+0x96/0x130
      
      addr 001fff800ad5f970 is located in stack of task test_progs/853 at
      offset 96 in frame:
       print_fn_code+0x0/0x380
      this frame has 1 object:
       [32, 96) 'buffer'
      
      Memory state around the buggy address:
       001fff800ad5f800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
       001fff800ad5f880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      >001fff800ad5f900: 00 00 f1 f1 f1 f1 00 00 00 00 00 00 00 00 f3 f3
                                                                   ^
       001fff800ad5f980: f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00 00
       001fff800ad5fa00: 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00
      
      Cc: <stable@vger.kernel.org>
      Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      6f3353c2
    • Harald Freudenberger's avatar
      s390/archrandom: add parameter check for s390_arch_random_generate · 28096067
      Harald Freudenberger authored
      A review of the code showed, that this function which is exposed
      within the whole kernel should do a parameter check for the
      amount of bytes requested. If this requested bytes is too high
      an unsigned int overflow could happen causing this function to
      try to memcpy a really big memory chunk.
      
      This is not a security issue as there are only two invocations
      of this function from arch/s390/include/asm/archrandom.h and both
      are not exposed to userland.
      Reported-by: default avatarSven Schnelle <svens@linux.ibm.com>
      Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      28096067
    • Harald Freudenberger's avatar
      s390/zcrypt: fix zcard and zqueue hot-unplug memleak · 70fac808
      Harald Freudenberger authored
      Tests with kvm and a kmemdebug kernel showed, that on hot unplug the
      zcard and zqueue structs for the unplugged card or queue are not
      properly freed because of a mismatch with get/put for the embedded
      kref counter.
      
      This fix now adjusts the handling of the kref counters. With init the
      kref counter starts with 1. This initial value needs to drop to zero
      with the unregister of the card or queue to trigger the release and
      free the object.
      
      Fixes: 29c2680f ("s390/ap: fix ap devices reference counting")
      Reported-by: default avatarMarc Hartmayer <mhartmay@linux.ibm.com>
      Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      70fac808
  2. 20 Apr, 2021 1 commit
  3. 18 Apr, 2021 3 commits
  4. 15 Apr, 2021 3 commits
  5. 12 Apr, 2021 23 commits
  6. 07 Apr, 2021 3 commits
  7. 05 Apr, 2021 4 commits