VYPR
Unrated severityNVD Advisory· Published Jun 3, 2026

CVE-2026-46246

CVE-2026-46246

Description

In the Linux kernel, the following vulnerability has been resolved:

power: supply: pm8916_lbc: Fix use-after-free for extcon in IRQ handler

Using the devm_ variant for requesting IRQ _before_ the devm_ variant for allocating/registering the extcon handle, means that the extcon handle will be deallocated/unregistered _before_ the interrupt handler (since devm_ naturally deallocates in reverse allocation order). This means that during removal, there is a race condition where an interrupt can fire just _after_ the extcon handle has been freed, *but* just _before_ the corresponding unregistration of the IRQ handler has run.

This will lead to the IRQ handler calling extcon_set_state_sync() with a freed extcon handle. Which usually crashes the system or otherwise silently corrupts the memory...

Fix this racy use-after-free by making sure the IRQ is requested _after_ the registration of the extcon handle.

Affected products

1

Patches

8
48e0f68b50c3

power: supply: pm8916_lbc: Fix use-after-free for extcon in IRQ handler

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.gitWaqar HameedJan 23, 2026Fixed in 6.19.4via kernel-cna
1 file changed · +5 6
  • drivers/power/supply/pm8916_lbc.c+5 6 modified
    diff --git a/drivers/power/supply/pm8916_lbc.c b/drivers/power/supply/pm8916_lbc.c
    index 3ca717d84aade..6b631012a7959 100644
    --- a/drivers/power/supply/pm8916_lbc.c
    +++ b/drivers/power/supply/pm8916_lbc.c
    @@ -327,11 +327,6 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
     	if (irq < 0)
     		return irq;
     
    -	ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_lbc_charger_state_changed_irq,
    -					IRQF_ONESHOT, "pm8916_lbc", chg);
    -	if (ret)
    -		return ret;
    -
     	chg->edev = devm_extcon_dev_allocate(dev, pm8916_lbc_charger_cable);
     	if (IS_ERR(chg->edev))
     		return PTR_ERR(chg->edev);
    @@ -340,6 +335,11 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
     	if (ret < 0)
     		return dev_err_probe(dev, ret, "failed to register extcon device\n");
     
    +	ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_lbc_charger_state_changed_irq,
    +					IRQF_ONESHOT, "pm8916_lbc", chg);
    +	if (ret)
    +		return ret;
    +
     	ret = regmap_read(chg->regmap, chg->reg[LBC_USB] + PM8916_INT_RT_STS, &tmp);
     	if (ret)
     		goto comm_error;
    -- 
    cgit 1.3-korg
    
    
    
9fab0120907e

power: supply: pm8916_lbc: Fix use-after-free for extcon in IRQ handler

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.gitWaqar HameedJan 23, 2026Fixed in 6.12.75via kernel-cna
1 file changed · +5 6
  • drivers/power/supply/pm8916_lbc.c+5 6 modified
    diff --git a/drivers/power/supply/pm8916_lbc.c b/drivers/power/supply/pm8916_lbc.c
    index ab324ce3b8721..e6c44f342eeb4 100644
    --- a/drivers/power/supply/pm8916_lbc.c
    +++ b/drivers/power/supply/pm8916_lbc.c
    @@ -327,11 +327,6 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
     	if (irq < 0)
     		return irq;
     
    -	ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_lbc_charger_state_changed_irq,
    -					IRQF_ONESHOT, "pm8916_lbc", chg);
    -	if (ret)
    -		return ret;
    -
     	chg->edev = devm_extcon_dev_allocate(dev, pm8916_lbc_charger_cable);
     	if (IS_ERR(chg->edev))
     		return PTR_ERR(chg->edev);
    @@ -340,6 +335,11 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
     	if (ret < 0)
     		return dev_err_probe(dev, ret, "failed to register extcon device\n");
     
    +	ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_lbc_charger_state_changed_irq,
    +					IRQF_ONESHOT, "pm8916_lbc", chg);
    +	if (ret)
    +		return ret;
    +
     	ret = regmap_read(chg->regmap, chg->reg[LBC_USB] + PM8916_INT_RT_STS, &tmp);
     	if (ret)
     		goto comm_error;
    -- 
    cgit 1.3-korg
    
    
    
47abfc207ab0

power: supply: pm8916_lbc: Fix use-after-free for extcon in IRQ handler

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.gitWaqar HameedJan 23, 2026Fixed in 6.18.14via kernel-cna
1 file changed · +5 6
  • drivers/power/supply/pm8916_lbc.c+5 6 modified
    diff --git a/drivers/power/supply/pm8916_lbc.c b/drivers/power/supply/pm8916_lbc.c
    index 3ca717d84aade..6b631012a7959 100644
    --- a/drivers/power/supply/pm8916_lbc.c
    +++ b/drivers/power/supply/pm8916_lbc.c
    @@ -327,11 +327,6 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
     	if (irq < 0)
     		return irq;
     
    -	ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_lbc_charger_state_changed_irq,
    -					IRQF_ONESHOT, "pm8916_lbc", chg);
    -	if (ret)
    -		return ret;
    -
     	chg->edev = devm_extcon_dev_allocate(dev, pm8916_lbc_charger_cable);
     	if (IS_ERR(chg->edev))
     		return PTR_ERR(chg->edev);
    @@ -340,6 +335,11 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
     	if (ret < 0)
     		return dev_err_probe(dev, ret, "failed to register extcon device\n");
     
    +	ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_lbc_charger_state_changed_irq,
    +					IRQF_ONESHOT, "pm8916_lbc", chg);
    +	if (ret)
    +		return ret;
    +
     	ret = regmap_read(chg->regmap, chg->reg[LBC_USB] + PM8916_INT_RT_STS, &tmp);
     	if (ret)
     		goto comm_error;
    -- 
    cgit 1.3-korg
    
    
    
230672599196

power: supply: pm8916_lbc: Fix use-after-free for extcon in IRQ handler

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.gitWaqar HameedJan 23, 2026Fixed in 7.0via kernel-cna
1 file changed · +5 6
  • drivers/power/supply/pm8916_lbc.c+5 6 modified
    diff --git a/drivers/power/supply/pm8916_lbc.c b/drivers/power/supply/pm8916_lbc.c
    index 3ca717d84aade..6b631012a7959 100644
    --- a/drivers/power/supply/pm8916_lbc.c
    +++ b/drivers/power/supply/pm8916_lbc.c
    @@ -327,11 +327,6 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
     	if (irq < 0)
     		return irq;
     
    -	ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_lbc_charger_state_changed_irq,
    -					IRQF_ONESHOT, "pm8916_lbc", chg);
    -	if (ret)
    -		return ret;
    -
     	chg->edev = devm_extcon_dev_allocate(dev, pm8916_lbc_charger_cable);
     	if (IS_ERR(chg->edev))
     		return PTR_ERR(chg->edev);
    @@ -340,6 +335,11 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
     	if (ret < 0)
     		return dev_err_probe(dev, ret, "failed to register extcon device\n");
     
    +	ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_lbc_charger_state_changed_irq,
    +					IRQF_ONESHOT, "pm8916_lbc", chg);
    +	if (ret)
    +		return ret;
    +
     	ret = regmap_read(chg->regmap, chg->reg[LBC_USB] + PM8916_INT_RT_STS, &tmp);
     	if (ret)
     		goto comm_error;
    -- 
    cgit 1.3-korg
    
    
    
230672599196

power: supply: pm8916_lbc: Fix use-after-free for extcon in IRQ handler

1 file changed · +5 6
  • drivers/power/supply/pm8916_lbc.c+5 6 modified
    diff --git a/drivers/power/supply/pm8916_lbc.c b/drivers/power/supply/pm8916_lbc.c
    index 3ca717d84aade..6b631012a7959 100644
    --- a/drivers/power/supply/pm8916_lbc.c
    +++ b/drivers/power/supply/pm8916_lbc.c
    @@ -327,11 +327,6 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
     	if (irq < 0)
     		return irq;
     
    -	ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_lbc_charger_state_changed_irq,
    -					IRQF_ONESHOT, "pm8916_lbc", chg);
    -	if (ret)
    -		return ret;
    -
     	chg->edev = devm_extcon_dev_allocate(dev, pm8916_lbc_charger_cable);
     	if (IS_ERR(chg->edev))
     		return PTR_ERR(chg->edev);
    @@ -340,6 +335,11 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
     	if (ret < 0)
     		return dev_err_probe(dev, ret, "failed to register extcon device\n");
     
    +	ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_lbc_charger_state_changed_irq,
    +					IRQF_ONESHOT, "pm8916_lbc", chg);
    +	if (ret)
    +		return ret;
    +
     	ret = regmap_read(chg->regmap, chg->reg[LBC_USB] + PM8916_INT_RT_STS, &tmp);
     	if (ret)
     		goto comm_error;
    -- 
    cgit 1.3-korg
    
    
    
47abfc207ab0

power: supply: pm8916_lbc: Fix use-after-free for extcon in IRQ handler

1 file changed · +5 6
  • drivers/power/supply/pm8916_lbc.c+5 6 modified
    diff --git a/drivers/power/supply/pm8916_lbc.c b/drivers/power/supply/pm8916_lbc.c
    index 3ca717d84aade..6b631012a7959 100644
    --- a/drivers/power/supply/pm8916_lbc.c
    +++ b/drivers/power/supply/pm8916_lbc.c
    @@ -327,11 +327,6 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
     	if (irq < 0)
     		return irq;
     
    -	ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_lbc_charger_state_changed_irq,
    -					IRQF_ONESHOT, "pm8916_lbc", chg);
    -	if (ret)
    -		return ret;
    -
     	chg->edev = devm_extcon_dev_allocate(dev, pm8916_lbc_charger_cable);
     	if (IS_ERR(chg->edev))
     		return PTR_ERR(chg->edev);
    @@ -340,6 +335,11 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
     	if (ret < 0)
     		return dev_err_probe(dev, ret, "failed to register extcon device\n");
     
    +	ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_lbc_charger_state_changed_irq,
    +					IRQF_ONESHOT, "pm8916_lbc", chg);
    +	if (ret)
    +		return ret;
    +
     	ret = regmap_read(chg->regmap, chg->reg[LBC_USB] + PM8916_INT_RT_STS, &tmp);
     	if (ret)
     		goto comm_error;
    -- 
    cgit 1.3-korg
    
    
    
48e0f68b50c3

power: supply: pm8916_lbc: Fix use-after-free for extcon in IRQ handler

1 file changed · +5 6
  • drivers/power/supply/pm8916_lbc.c+5 6 modified
    diff --git a/drivers/power/supply/pm8916_lbc.c b/drivers/power/supply/pm8916_lbc.c
    index 3ca717d84aade..6b631012a7959 100644
    --- a/drivers/power/supply/pm8916_lbc.c
    +++ b/drivers/power/supply/pm8916_lbc.c
    @@ -327,11 +327,6 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
     	if (irq < 0)
     		return irq;
     
    -	ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_lbc_charger_state_changed_irq,
    -					IRQF_ONESHOT, "pm8916_lbc", chg);
    -	if (ret)
    -		return ret;
    -
     	chg->edev = devm_extcon_dev_allocate(dev, pm8916_lbc_charger_cable);
     	if (IS_ERR(chg->edev))
     		return PTR_ERR(chg->edev);
    @@ -340,6 +335,11 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
     	if (ret < 0)
     		return dev_err_probe(dev, ret, "failed to register extcon device\n");
     
    +	ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_lbc_charger_state_changed_irq,
    +					IRQF_ONESHOT, "pm8916_lbc", chg);
    +	if (ret)
    +		return ret;
    +
     	ret = regmap_read(chg->regmap, chg->reg[LBC_USB] + PM8916_INT_RT_STS, &tmp);
     	if (ret)
     		goto comm_error;
    -- 
    cgit 1.3-korg
    
    
    
9fab0120907e

power: supply: pm8916_lbc: Fix use-after-free for extcon in IRQ handler

1 file changed · +5 6
  • drivers/power/supply/pm8916_lbc.c+5 6 modified
    diff --git a/drivers/power/supply/pm8916_lbc.c b/drivers/power/supply/pm8916_lbc.c
    index ab324ce3b8721..e6c44f342eeb4 100644
    --- a/drivers/power/supply/pm8916_lbc.c
    +++ b/drivers/power/supply/pm8916_lbc.c
    @@ -327,11 +327,6 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
     	if (irq < 0)
     		return irq;
     
    -	ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_lbc_charger_state_changed_irq,
    -					IRQF_ONESHOT, "pm8916_lbc", chg);
    -	if (ret)
    -		return ret;
    -
     	chg->edev = devm_extcon_dev_allocate(dev, pm8916_lbc_charger_cable);
     	if (IS_ERR(chg->edev))
     		return PTR_ERR(chg->edev);
    @@ -340,6 +335,11 @@ static int pm8916_lbc_charger_probe(struct platform_device *pdev)
     	if (ret < 0)
     		return dev_err_probe(dev, ret, "failed to register extcon device\n");
     
    +	ret = devm_request_threaded_irq(dev, irq, NULL, pm8916_lbc_charger_state_changed_irq,
    +					IRQF_ONESHOT, "pm8916_lbc", chg);
    +	if (ret)
    +		return ret;
    +
     	ret = regmap_read(chg->regmap, chg->reg[LBC_USB] + PM8916_INT_RT_STS, &tmp);
     	if (ret)
     		goto comm_error;
    -- 
    cgit 1.3-korg
    
    
    

Vulnerability mechanics

Root cause

"A use-after-free vulnerability occurs due to incorrect ordering of resource allocation and deallocation in the IRQ handler."

Attack vector

During device removal, a race condition can occur where an interrupt fires after the extcon handle has been freed but before the IRQ handler is fully unregistered. This allows the IRQ handler to call `extcon_set_state_sync()` with a deallocated `extcon` handle. This typically leads to a system crash or memory corruption.

Affected code

The vulnerability exists in the `pm8916_lbc_charger_probe` function within `drivers/power/supply/pm8916_lbc.c`. Specifically, the order of requesting the IRQ before allocating the extcon device leads to the use-after-free.

What the fix does

The patch corrects the vulnerability by reordering the `devm_request_threaded_irq()` call to occur after the `devm_extcon_dev_allocate()` and registration calls. This ensures that the `extcon` handle is still valid when the interrupt handler is invoked, preventing the use-after-free condition. The fix is applied in `drivers/power/supply/pm8916_lbc.c` [patch_id=4686767].

Generated on Jun 3, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

4

News mentions

0

No linked articles in our index yet.