CVE-2026-139561: pinctrl: pinctrl-generic-mux: Fix provider resource leak on re-parse
In the Linux kernel, the following vulnerability has been resolved:
pinctrl: pinctrl-generic-mux: Fix provider resource leak on re-parse
The pinctrl core re-parses a consumer's pinctrl on every probe attempt (pinctrlbindpins() runs before the driver's probe(), and again on each deferred-probe retry or re-bind), so .dtnodetomap() must be side-effect free and safe to call repeatedly.
muxpinmuxdtnodetomap() instead allocated provider-side resources on every call - the muxpinfunction, the group name table and a muxstate reference, plus a group name and a pinctrlgenericaddgroup() registration via pinctrlgenerictomap(). All of these are allocated with devm() against the provider device, so they live for the provider's lifetime and are only released when the provider itself is unbound. The .dtfreemap() path never touches them; it frees the per-consumer pinctrlmap only. Every re-parse therefore adds another set of provider-side allocations that are never reclaimed, so a consumer that repeatedly defers probe or is re-bound leaks memory and muxstate references on the provider without bound.
The groups and functions of a board-level mux are static and fully described by the device tree, so build them once at probe time in the new muxpinctrlprobedt(). muxpinmuxdtnodetomap() then only looks up the already registered group and builds the per-consumer mux map, which the core frees via .dtfreemap. As the mux has no pin electrical configuration, no config map is emitted.
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to the leak?
Systems using the generic mux pinctrl path are affected when a consumer's pinctrl configuration is parsed more than once. This can occur during deferred-probe retries or when a consumer driver is re-bound.
What resources accumulate, and when are they released?
Each re-parse can add provider-side mux function, group-name, mux_state, and group-registration resources. Because these are allocated against the provider device, they remain until the provider is unbound.
Does freeing the consumer's pinctrl map reclaim the leaked resources?
No. The .dt_free_map() path frees only the per-consumer pinctrl_map and does not release the provider-side allocations created during parsing.