Vasily Gorbik
2afdf47ef5
s390/disassembler: increase ebpf disasm buffer size
...
commit 6f3353c2d2b3eb4de52e9704cb962712033db181 upstream.
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: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-22 10:59:12 +02:00
..
2018-07-28 10:34:10 +09:00
2019-11-24 08:20:43 +01:00
2020-06-30 23:17:14 -04:00
2018-03-28 08:38:24 +02:00
2020-06-30 23:17:14 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-05-07 21:12:39 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-04-02 20:16:12 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-04-10 07:38:54 +02:00
2018-07-04 08:35:18 +02:00
2021-04-14 08:22:35 +02:00
2018-08-16 14:49:15 +02:00
2020-07-09 09:37:09 +02:00
2020-05-10 10:30:09 +02:00
2021-05-22 10:59:12 +02:00
2017-11-24 15:37:12 +01:00
2018-05-09 10:55:01 +02:00
2018-09-20 13:20:23 +02:00
2020-07-16 08:17:22 +02:00
2018-08-23 18:48:43 -07:00
2018-06-25 10:14:38 +02:00
2021-04-28 13:16:52 +02:00
2017-11-02 11:10:55 +01:00
2018-12-05 19:32:10 +01:00
2017-11-13 11:47:01 -08:00
2018-07-02 11:24:59 +02:00
2019-11-06 13:06:20 +01:00
2018-04-10 07:39:00 +02:00
2018-05-07 21:12:42 +02:00
2019-06-04 08:02:34 +02:00
2017-11-02 11:10:55 +01:00
2020-01-27 14:50:42 +01:00
2018-04-16 09:10:22 +02:00
2018-06-21 12:33:19 +02:00
2017-11-24 15:37:12 +01:00
2018-04-16 09:10:23 +02:00
2018-04-10 07:39:00 +02:00
2019-11-24 08:20:44 +01:00
2020-06-07 13:17:55 +02:00
2018-06-12 16:19:22 -07:00
2018-04-05 21:36:27 -07:00
2019-05-14 19:17:59 +02:00
2018-07-18 08:32:17 +02:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2018-12-17 09:24:32 +01:00
2020-11-24 13:27:26 +01:00
2017-11-24 15:37:20 +01:00
2018-07-02 11:24:54 +02:00
2017-11-02 11:10:55 +01:00
2019-10-11 18:20:41 +02:00
2020-04-23 10:30:18 +02:00
2020-08-26 10:31:03 +02:00
2018-05-07 21:12:39 +02:00
2018-04-10 07:38:59 +02:00
2020-08-26 10:31:03 +02:00
2020-10-01 13:14:50 +02:00
2018-07-04 08:35:18 +02:00
2021-03-17 16:43:46 +01:00
2017-11-24 15:37:12 +01:00
2018-11-13 11:08:21 -08:00
2018-02-27 08:05:23 +01:00
2018-09-20 13:20:23 +02:00
2018-04-02 20:16:11 +02:00
2018-07-02 12:32:20 +02:00
2020-11-05 11:08:51 +01:00
2019-10-11 18:20:42 +02:00
2020-05-10 10:30:09 +02:00
2018-04-25 10:44:08 -05:00
2018-04-23 07:57:16 +02:00
2019-11-20 18:47:53 +01:00
2019-08-29 08:28:41 +02:00
2017-11-24 15:37:12 +01:00