[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <37b96f5f-d79e-47bd-9616-b6c8905bc984@gmail.com>
Date: Fri, 4 Jul 2025 14:40:39 +0200
From: Andrey Ryabinin <ryabinin.a.a@...il.com>
To: Yeoreum Yun <yeoreum.yun@....com>, glider@...gle.com,
andreyknvl@...il.com, dvyukov@...gle.com, vincenzo.frascino@....com,
akpm@...ux-foundation.org, bigeasy@...utronix.de, clrkwllms@...nel.org,
rostedt@...dmis.org, byungchul@...com, max.byungchul.park@...il.com,
ysk@...lloc.com
Cc: kasan-dev@...glegroups.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, linux-rt-devel@...ts.linux.dev
Subject: Re: [PATCH v2] kasan: remove kasan_find_vm_area() to prevent possible
deadlock
On 7/3/25 8:10 PM, Yeoreum Yun wrote:
> find_vm_area() couldn't be called in atomic_context.
> If find_vm_area() is called to reports vm area information,
> kasan can trigger deadlock like:
>
> CPU0 CPU1
> vmalloc();
> alloc_vmap_area();
> spin_lock(&vn->busy.lock)
> spin_lock_bh(&some_lock);
> <interrupt occurs>
> <in softirq>
> spin_lock(&some_lock);
> <access invalid address>
> kasan_report();
> print_report();
> print_address_description();
> kasan_find_vm_area();
> find_vm_area();
> spin_lock(&vn->busy.lock) // deadlock!
>
> To prevent possible deadlock while kasan reports, remove kasan_find_vm_area().
>
> Fixes: c056a364e954 ("kasan: print virtual mapping info in reports")
> Reported-by: Yunseong Kim <ysk@...lloc.com>
> Signed-off-by: Yeoreum Yun <yeoreum.yun@....com>
Reviewed-by: Andrey Ryabinin <ryabinin.a.a@...il.com>
Powered by blists - more mailing lists