report.c (babddbfb7d7d70ae7f10fedd75a45d8ad75fdddf) report.c (17c17567fe510857b18fe01b7a88027600e76ac6)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * This file contains common KASAN error reporting code.
4 *
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 * Author: Andrey Ryabinin <ryabinin.a.a@gmail.com>
7 *
8 * Some code borrowed from https://github.com/xairy/kasan-prototype by

--- 607 unchanged lines hidden (view full) ---

616 /*
617 * Conservatively set is_write=true, because no details are available.
618 * In this mode, kasan.fault=panic_on_write is like kasan.fault=panic.
619 */
620 end_report(&flags, NULL, true);
621}
622#endif /* CONFIG_KASAN_HW_TAGS */
623
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * This file contains common KASAN error reporting code.
4 *
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 * Author: Andrey Ryabinin <ryabinin.a.a@gmail.com>
7 *
8 * Some code borrowed from https://github.com/xairy/kasan-prototype by

--- 607 unchanged lines hidden (view full) ---

616 /*
617 * Conservatively set is_write=true, because no details are available.
618 * In this mode, kasan.fault=panic_on_write is like kasan.fault=panic.
619 */
620 end_report(&flags, NULL, true);
621}
622#endif /* CONFIG_KASAN_HW_TAGS */
623
624#if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)
624/*
625/*
625 * With CONFIG_KASAN, accesses to bogus pointers (outside the high
626 * With CONFIG_KASAN_INLINE, accesses to bogus pointers (outside the high
626 * canonical half of the address space) cause out-of-bounds shadow memory reads
627 * before the actual access. For addresses in the low canonical half of the
628 * address space, as well as most non-canonical addresses, that out-of-bounds
629 * shadow memory access lands in the non-canonical part of the address space.
630 * Help the user figure out what the original bogus pointer was.
631 */
632void kasan_non_canonical_hook(unsigned long addr)
633{

--- 19 unchanged lines hidden (view full) ---

653 bug_type = "null-ptr-deref";
654 else if (orig_addr < TASK_SIZE)
655 bug_type = "probably user-memory-access";
656 else
657 bug_type = "maybe wild-memory-access";
658 pr_alert("KASAN: %s in range [0x%016lx-0x%016lx]\n", bug_type,
659 orig_addr, orig_addr + KASAN_GRANULE_SIZE - 1);
660}
627 * canonical half of the address space) cause out-of-bounds shadow memory reads
628 * before the actual access. For addresses in the low canonical half of the
629 * address space, as well as most non-canonical addresses, that out-of-bounds
630 * shadow memory access lands in the non-canonical part of the address space.
631 * Help the user figure out what the original bogus pointer was.
632 */
633void kasan_non_canonical_hook(unsigned long addr)
634{

--- 19 unchanged lines hidden (view full) ---

654 bug_type = "null-ptr-deref";
655 else if (orig_addr < TASK_SIZE)
656 bug_type = "probably user-memory-access";
657 else
658 bug_type = "maybe wild-memory-access";
659 pr_alert("KASAN: %s in range [0x%016lx-0x%016lx]\n", bug_type,
660 orig_addr, orig_addr + KASAN_GRANULE_SIZE - 1);
661}
662#endif