[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CA+fCnZd-0jE22cocyL8XPC4oEuY508U-7PB1oYOkTxJiLeUTiQ@mail.gmail.com>
Date: Tue, 8 Mar 2022 15:09:43 +0100
From: Andrey Konovalov <andreyknvl@...il.com>
To: Alexander Potapenko <glider@...gle.com>
Cc: andrey.konovalov@...ux.dev, Marco Elver <elver@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Andrey Ryabinin <ryabinin.a.a@...il.com>,
kasan-dev <kasan-dev@...glegroups.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Memory Management List <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>,
Andrey Konovalov <andreyknvl@...gle.com>
Subject: Re: [PATCH mm 05/22] kasan: print basic stack frame info for SW_TAGS
On Wed, Mar 2, 2022 at 6:34 PM Alexander Potapenko <glider@...gle.com> wrote:
>
>> diff --git a/mm/kasan/report_sw_tags.c b/mm/kasan/report_sw_tags.c
>> index d2298c357834..44577b8d47a7 100644
>> --- a/mm/kasan/report_sw_tags.c
>> +++ b/mm/kasan/report_sw_tags.c
>> @@ -51,3 +51,14 @@ void kasan_print_tags(u8 addr_tag, const void *addr)
>>
>> pr_err("Pointer tag: [%02x], memory tag: [%02x]\n", addr_tag, *shadow);
>> }
>> +
>> +#ifdef CONFIG_KASAN_STACK
>> +void kasan_print_address_stack_frame(const void *addr)
>> +{
>> + if (WARN_ON(!object_is_on_stack(addr)))
>> + return;
>> +
>> + pr_err("The buggy address belongs to stack of task %s/%d\n",
>> + current->comm, task_pid_nr(current));
>
> This comm/pid pattern starts to appear often, maybe we could replace it with an inline function performing pr_cont()?
Sounds good, will do if/when posting a v2. Thanks!
Powered by blists - more mailing lists