Skip to content

Commit

Permalink
kasan: simplify print_report
Browse files Browse the repository at this point in the history
To simplify reading the implementation of print_report(), remove the
tagged_addr variable and rename untagged_addr to addr.

Link: https://lkml.kernel.org/r/f64f5f1093b3c06896bf0f850c5d9e661313fcb2.1662411799.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <[email protected]>
Reviewed-by: Marco Elver <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Cc: Evgenii Stepanov <[email protected]>
Cc: Peter Collingbourne <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
xairy authored and akpm00 committed Oct 3, 2022
1 parent 559756e commit a794898
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions mm/kasan/report.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,17 +397,16 @@ static void print_memory_metadata(const void *addr)

static void print_report(struct kasan_report_info *info)
{
void *tagged_addr = info->access_addr;
void *untagged_addr = kasan_reset_tag(tagged_addr);
u8 tag = get_tag(tagged_addr);
void *addr = kasan_reset_tag(info->access_addr);
u8 tag = get_tag(info->access_addr);

print_error_description(info);
if (addr_has_metadata(untagged_addr))
if (addr_has_metadata(addr))
kasan_print_tags(tag, info->first_bad_addr);
pr_err("\n");

if (addr_has_metadata(untagged_addr)) {
print_address_description(untagged_addr, tag);
if (addr_has_metadata(addr)) {
print_address_description(addr, tag);
print_memory_metadata(info->first_bad_addr);
} else {
dump_stack_lvl(KERN_ERR);
Expand Down

0 comments on commit a794898

Please sign in to comment.