================================================================== BUG: KASAN: slab-out-of-bounds in asn1_ber_decoder+0x1436/0x1c20 lib/asn1_decoder.c:233 Read of size 1 at addr ffff8801dad78202 by task syz-executor6/3318 CPU: 0 PID: 3318 Comm: syz-executor6 Not tainted 4.14.0-rc5-mm1+ #20 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:16 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:52 print_address_description+0x73/0x250 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report+0x25b/0x340 mm/kasan/report.c:409 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:427 asn1_ber_decoder+0x1436/0x1c20 lib/asn1_decoder.c:233 x509_cert_parse+0x1dd/0x680 crypto/asymmetric_keys/x509_cert_parser.c:89 x509_key_preparse+0x64/0x8b0 crypto/asymmetric_keys/x509_public_key.c:174 asymmetric_key_preparse+0xa8/0x110 crypto/asymmetric_keys/asymmetric_type.c:386 key_create_or_update+0x4c6/0xe20 security/keys/key.c:846 SYSC_add_key security/keys/keyctl.c:122 [inline] SyS_add_key+0x18a/0x340 security/keys/keyctl.c:62 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x452879 RSP: 002b:00007fc3ad1e9be8 EFLAGS: 00000212 ORIG_RAX: 00000000000000f8 RAX: ffffffffffffffda RBX: 0000000000758020 RCX: 0000000000452879 RDX: 0000000020ce1000 RSI: 0000000020ef2ffb RDI: 0000000020dff000 RBP: 0000000000000082 R08: ffffffffffffffff R09: 0000000000000000 R10: 0000000000000002 R11: 0000000000000212 R12: 00000000006f3d70 R13: 00000000ffffffff R14: 00007fc3ad1ea6d4 R15: 0000000000000000 Allocated by task 3318: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551 __do_kmalloc_node mm/slab.c:3676 [inline] __kmalloc_node+0x47/0x70 mm/slab.c:3683 kmalloc_node include/linux/slab.h:541 [inline] kvmalloc_node+0x99/0xd0 mm/util.c:397 kvmalloc include/linux/mm.h:538 [inline] SYSC_add_key security/keys/keyctl.c:104 [inline] SyS_add_key+0x279/0x340 security/keys/keyctl.c:62 entry_SYSCALL_64_fastpath+0x1f/0xbe Freed by task 1: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3492 [inline] kfree+0xca/0x250 mm/slab.c:3807 acpi_os_free include/acpi/platform/aclinuxex.h:96 [inline] acpi_ns_get_node_unlocked+0x294/0x2ca drivers/acpi/acpica/nsutils.c:732 acpi_ns_get_node+0x44/0x62 drivers/acpi/acpica/nsutils.c:772 acpi_ns_evaluate+0xc8/0x8d3 drivers/acpi/acpica/nseval.c:103 acpi_ut_evaluate_object+0x122/0x3c4 drivers/acpi/acpica/uteval.c:94 acpi_ut_execute_power_methods+0xe6/0x1dd drivers/acpi/acpica/uteval.c:322 acpi_get_object_info+0x5c9/0xc6c drivers/acpi/acpica/nsxfname.c:411 acpi_set_pnp_ids drivers/acpi/scan.c:1243 [inline] acpi_init_device_object+0x1024/0x1b70 drivers/acpi/scan.c:1555 acpi_add_single_object+0x1ca/0x1d80 drivers/acpi/scan.c:1587 acpi_bus_check_add+0x380/0xa50 drivers/acpi/scan.c:1827 acpi_ns_walk_namespace+0x1d1/0x31e drivers/acpi/acpica/nswalk.c:270 acpi_walk_namespace+0xb5/0xef drivers/acpi/acpica/nsxfeval.c:641 acpi_bus_scan+0x120/0x150 drivers/acpi/scan.c:2008 acpi_scan_init+0x3ce/0x848 drivers/acpi/scan.c:2150 acpi_init+0x830/0x8e6 drivers/acpi/bus.c:1228 do_one_initcall+0x9e/0x330 init/main.c:824 do_initcall_level init/main.c:890 [inline] do_initcalls init/main.c:898 [inline] do_basic_setup init/main.c:916 [inline] kernel_init_freeable+0x469/0x521 init/main.c:1064 kernel_init+0x13/0x172 init/main.c:991 ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431 The buggy address belongs to the object at ffff8801dad78200 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 2 bytes inside of 32-byte region [ffff8801dad78200, ffff8801dad78220) The buggy address belongs to the page: page:ffffea00076b5e00 count:1 mapcount:0 mapping:ffff8801dad78000 index:0xffff8801dad78fc1 flags: 0x200000000000100(slab) raw: 0200000000000100 ffff8801dad78000 ffff8801dad78fc1 0000000100000022 raw: ffffea00076b5c20 ffff8801dac01238 ffff8801dac001c0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801dad78100: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff8801dad78180: fb fb fb fb fc fc fc fc 00 00 00 00 fc fc fc fc >ffff8801dad78200: 02 fc fc fc fc fc fc fc 05 fc fc fc fc fc fc fc ^ ffff8801dad78280: 00 00 03 fc fc fc fc fc fb fb fb fb fc fc fc fc ffff8801dad78300: 04 fc fc fc fc fc fc fc 05 fc fc fc fc fc fc fc ==================================================================