From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Florian Fuchs <fuchsfl@gmail.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Yoshinori Sato <ysato@users.sourceforge.jp>,
Rich Felker <dalias@libc.org>,
John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
Adrian McMenamin <adrianmcmenamin@gmail.com>,
linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
linux-mtd@lists.infradead.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH 18/26] sh: maple: introduce callback_mutex in maple_device
Date: Sat, 4 Jul 2026 16:50:04 -0700 [thread overview]
Message-ID: <akmbL8AmfrxkHN0u@google.com> (raw)
In-Reply-To: <akkrQJfxSCvUptC4@lithos>
Hi Florian,
On Sat, Jul 04, 2026 at 05:48:16PM +0200, Florian Fuchs wrote:
> Hi Dmitry,
>
> On 03 Jul 22:57, Dmitry Torokhov wrote:
> > The Maple bus core invokes client callbacks asynchronously from a
> > workqueue (maple_dma_handler). If a device is removed (or closed) while
> > a callback is in flight, it can lead to UAF bugs if the driver's private
> > data is freed.
> >
> > Introduce callback_mutex in struct maple_device to synchronize
> > callback registration/modification and callback invocation.
...
>
> Thank you so much for your efforts. I can confirm sashikos finding in my
> test (that I saw later),
Thank you for giving the series a spin!
> that this patch hangs the bus if a VMU memcard
> is inserted. So that the peripherals don't work anymore after insertion
> of the memcard. With a last log like:
> Dreamcast_visual_memory 3:01.E: VMU at (3, 1) is busy
Yes, indeed, I overlooked the vmu-flash use case. I will introduce a
lockless way of setting up the callback and a wrapper that takes the
lock and that should solve the deadlock in vmu-flash driver.
I wonder if you had a chance top try out the preceding patches and if
they worked for you? If they do and you can add your tested-by I should
be able to pick up at least the input patches that do not need maple
core changes...
Thanks.
--
Dmitry
WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Florian Fuchs <fuchsfl@gmail.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Yoshinori Sato <ysato@users.sourceforge.jp>,
Rich Felker <dalias@libc.org>,
John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
Adrian McMenamin <adrianmcmenamin@gmail.com>,
linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
linux-mtd@lists.infradead.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH 18/26] sh: maple: introduce callback_mutex in maple_device
Date: Sat, 4 Jul 2026 16:50:04 -0700 [thread overview]
Message-ID: <akmbL8AmfrxkHN0u@google.com> (raw)
In-Reply-To: <akkrQJfxSCvUptC4@lithos>
Hi Florian,
On Sat, Jul 04, 2026 at 05:48:16PM +0200, Florian Fuchs wrote:
> Hi Dmitry,
>
> On 03 Jul 22:57, Dmitry Torokhov wrote:
> > The Maple bus core invokes client callbacks asynchronously from a
> > workqueue (maple_dma_handler). If a device is removed (or closed) while
> > a callback is in flight, it can lead to UAF bugs if the driver's private
> > data is freed.
> >
> > Introduce callback_mutex in struct maple_device to synchronize
> > callback registration/modification and callback invocation.
...
>
> Thank you so much for your efforts. I can confirm sashikos finding in my
> test (that I saw later),
Thank you for giving the series a spin!
> that this patch hangs the bus if a VMU memcard
> is inserted. So that the peripherals don't work anymore after insertion
> of the memcard. With a last log like:
> Dreamcast_visual_memory 3:01.E: VMU at (3, 1) is busy
Yes, indeed, I overlooked the vmu-flash use case. I will introduce a
lockless way of setting up the callback and a wrapper that takes the
lock and that should solve the deadlock in vmu-flash driver.
I wonder if you had a chance top try out the preceding patches and if
they worked for you? If they do and you can add your tested-by I should
be able to pick up at least the input patches that do not need maple
core changes...
Thanks.
--
Dmitry
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2026-07-04 23:50 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-04 5:57 [PATCH 00/26] sh: maple: cleanup and modernize input drivers Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 5:57 ` [PATCH 01/26] sh: maple: include linux/device.h in linux/maple.h Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 6:05 ` sashiko-bot
2026-07-04 5:57 ` [PATCH 02/26] Input: maple_keyb - fix key press detection Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-06 18:08 ` Florian Fuchs
2026-07-06 18:08 ` Florian Fuchs
2026-07-04 5:57 ` [PATCH 03/26] Input: maplecontrol - only enable present axes Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 6:10 ` sashiko-bot
2026-07-04 5:57 ` [PATCH 04/26] Input: maplemouse - stop polling and clear callback on close Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 5:57 ` [PATCH 05/26] Input: maplecontrol " Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 6:07 ` sashiko-bot
2026-07-04 5:57 ` [PATCH 06/26] Input: maplecontrol - simplify maple_device retrieval in open/close Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 6:10 ` sashiko-bot
2026-07-04 5:57 ` [PATCH 07/26] Input: maple_keyb - implement open and close methods Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 5:57 ` [PATCH 08/26] Input: maplemouse - remove redundant drvdata resetting Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 5:57 ` [PATCH 09/26] Input: maple_keyb " Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 5:57 ` [PATCH 10/26] Input: maplecontrol " Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 6:09 ` sashiko-bot
2026-07-04 5:57 ` [PATCH 11/26] Input: maplemouse - remove unused mdev->driver assignment Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 5:57 ` [PATCH 12/26] Input: maplecontrol " Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 6:06 ` sashiko-bot
2026-07-04 5:57 ` [PATCH 13/26] Input: maple_keyb " Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 5:57 ` [PATCH 14/26] mtd: maps: vmu-flash: " Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 6:08 ` sashiko-bot
2026-07-04 5:57 ` [PATCH 15/26] sh: maple: remove not needed maple_unsupported_device driver Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 6:11 ` sashiko-bot
2026-07-04 5:57 ` [PATCH 16/26] sh: maple: remove unused driver field from struct maple_device Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 6:09 ` sashiko-bot
2026-07-04 5:57 ` [PATCH 17/26] sh: maple: implement bus-level probe/remove Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 6:12 ` sashiko-bot
2026-07-04 5:57 ` [PATCH 18/26] sh: maple: introduce callback_mutex in maple_device Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 6:14 ` sashiko-bot
2026-07-04 15:48 ` Florian Fuchs
2026-07-04 15:48 ` Florian Fuchs
2026-07-04 23:50 ` Dmitry Torokhov [this message]
2026-07-04 23:50 ` Dmitry Torokhov
2026-07-04 5:57 ` [PATCH 19/26] Input: maple_keyb - remove redundant mutex and remove method Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 5:57 ` [PATCH 20/26] Input: maple_keyb - convert to devm Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 5:57 ` [PATCH 21/26] Input: maplemouse " Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 5:57 ` [PATCH 22/26] Input: maplecontrol " Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 6:13 ` sashiko-bot
2026-07-04 5:57 ` [PATCH 23/26] Input: maple_keyb - fix style issues Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 5:57 ` [PATCH 24/26] Input: maplemouse " Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 5:57 ` [PATCH 25/26] Input: maplecontrol " Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
2026-07-04 6:12 ` sashiko-bot
2026-07-05 19:28 ` Adrian McMenamin
2026-07-05 19:28 ` Adrian McMenamin
2026-07-05 20:26 ` Dmitry Torokhov
2026-07-05 20:26 ` Dmitry Torokhov
2026-07-04 5:57 ` [PATCH 26/26] Input: maple_keyb - remove redundant 'new' buffer from struct dc_kbd Dmitry Torokhov
2026-07-04 5:57 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=akmbL8AmfrxkHN0u@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=adrianmcmenamin@gmail.com \
--cc=dalias@libc.org \
--cc=fuchsfl@gmail.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-sh@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
--cc=ysato@users.sourceforge.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.