Re: [PATCH v13 0/3] drivers/base: Introduce revocable
From: Bartosz Golaszewski
Date: Thu Sep 17 2026 - 06:32:24 EST
On Sat, 12 Sep 2026 14:35:26 +0200, Tzung-Bi Shih <tzungbi@xxxxxxxxxx> said:
> This series introduces the "revocable" mechanism, a synchronization
> primitive designed to prevent Use-After-Free errors.
>
> - Patch 1 introduces the revocable which is an implementation of ideas
> from the talk [1][2].
>
> - Patch 2 adds KUnit test cases.
>
> - Patch 3 transitions the UAF prevention logic within the GPIO core
> (gpiolib) to use the "revocable" mechanism.
>
> The existing code aims to prevent UAF issues when the underlying GPIO
> chip is removed. The patch replaces that custom logic with the
> generic "revocable" API, which is designed to handle such lifecycle
> dependencies. There should be no changes in behavior.
>
> Since v9, there are two ways to manage the resource provider handle.
> - Embedded allocation: patch 3 is the user.
> - Dynamic allocation: no user yet; I could find it later.
>
> [1] https://lpc.events/event/17/contributions/1627/
> [2] https://lpc.events/event/19/contributions/2262/
Tested-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>