[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANpmjNM96MCD-JY=+OkQ4PZK3jV4027PCPRQ0bMVm9kvhGC=4Q@mail.gmail.com>
Date: Wed, 16 Jul 2025 17:28:49 +0200
From: Marco Elver <elver@...gle.com>
To: Uladzislau Rezki <urezki@...il.com>
Cc: Byungchul Park <byungchul@...com>, Yeo Reum Yun <YeoReum.Yun@....com>,
Andrey Konovalov <andreyknvl@...il.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>, "glider@...gle.com" <glider@...gle.com>,
"dvyukov@...gle.com" <dvyukov@...gle.com>, Vincenzo Frascino <Vincenzo.Frascino@....com>,
"bigeasy@...utronix.de" <bigeasy@...utronix.de>, "clrkwllms@...nel.org" <clrkwllms@...nel.org>,
"rostedt@...dmis.org" <rostedt@...dmis.org>,
"max.byungchul.park@...il.com" <max.byungchul.park@...il.com>, "ysk@...lloc.com" <ysk@...lloc.com>,
"kasan-dev@...glegroups.com" <kasan-dev@...glegroups.com>, "linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-rt-devel@...ts.linux.dev" <linux-rt-devel@...ts.linux.dev>,
"kernel_team@...ynix.com" <kernel_team@...ynix.com>
Subject: Re: [PATCH v2] kasan: remove kasan_find_vm_area() to prevent possible deadlock
On Wed, 16 Jul 2025 at 11:09, Uladzislau Rezki <urezki@...il.com> wrote:
>
> On Mon, Jul 14, 2025 at 08:27:40AM +0900, Byungchul Park wrote:
> > On Sat, Jul 12, 2025 at 03:46:10PM +0000, Yeo Reum Yun wrote:
> > > Hi ByungChul,
> > >
> > > [...]
> > > > I checked the critical section by &vn->busy.lock in find_vm_area(). The
> > > > time complextity looks O(log N). I don't think an irq disabled section
> > > > of O(log N) is harmful. I still think using
> > > > spin_lock_irqsave(&vn->busy.lock) can resolve this issue with no worry
> > > > of significant irq delay. Am I missing something?
> > >
> > > I don't agree for this.
> > > since in PREEMPT_RT case, it has the same problem.
> > >
> > > In case of PREEMPT_RT, spin_lock_irqsave() becomes rt_spin_lock() which is sleepable.
> > > But, KASAN calls "rt_spin_lock()" holding raw_spin_lock_irqsave() which is definitely wrong.
> >
> > It's another issue than irq handling latency, but it's about lock usage
> > correctness. You are right.
> >
> There is vmalloc_dump_obj() function which should be used IMO:
>
> <snip>
> pr_err("The buggy address %px belongs to a vmalloc virtual mapping, dump it...\n", addr);
> vmalloc_dump_obj(addr);
> <snip>
>
> we use trylock there to eliminate an issue if invoked from the IRQ
> context.
Something like that should work:
https://lkml.kernel.org/r/20250716152448.3877201-1-elver@google.com
Powered by blists - more mailing lists