Skip to contentSkip to conversation

EDAC/mc: Really fix error path ordering in edac_mc_alloc()

PATCH Applied Jean Delvare 3 participants 4 messages Nov 3 – Nov 4 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 EDAC/mc: Really fix error path ordering in edac_mc_alloc()

The backport of 51520e03e70d ("EDAC/mc: Fix error path ordering in edac_mc_alloc()") to stable kernel branches is incomplete due to a different memory allocation scheme. In v6.19 and earlier, the device initialization must be moved further up so that all jumps to the error label are covered.

---
I believe that CVE-2026-31689 is not properly fixed in kernels v6.19 and older as of today, and the patch below shall address that. Affected branches still under maintenance would be v6.18, v6.12, v6.6 and v6.1. v6.19 is equally affected but no longer maintained.

I wrote to Borislav earlier about this but I'm unsure if my message reached him as I did not hear back. So I'm sending it to the stable kernel list this time.

 drivers/edac/edac_mc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/edac/edac_mc.c +3 -3
@@ -366,13 +366,13 @@ struct mem_ctl_info *edac_mc_alloc(unsig
 	if (!mci)
 		return NULL;
 
+	mci->dev.release = mci_release;
+	device_initialize(&mci->dev);
+
 	mci->layers = kcalloc(n_layers, sizeof(struct edac_mc_layer), GFP_KERNEL);
 	if (!mci->layers)
 		goto error;
 
-	mci->dev.release = mci_release;
-	device_initialize(&mci->dev);
-
 	mci->pvt_info = kzalloc(sz_pvt, GFP_KERNEL);
 	if (!mci->pvt_info)
 		goto error;
Signature · 2 lines
Jean Delvare
SUSE L3 Support
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jean Delvare

The backport of 51520e03e70d ("EDAC/mc: Fix error path ordering in edac_mc_alloc()") to stable kernel branches is incomplete due to a different memory allocation scheme. In v6.19 and earlier, the device initialization must be moved further up so that all jumps to the error label are covered.

looks about right:

Quoted 4 lines

I believe that CVE-2026-31689 is not properly fixed in kernels v6.19 and older as of today, and the patch below shall address that. Affected branches still under maintenance would be v6.18, v6.12, v6.6 and v6.1. v6.19 is equally affected but no longer maintained.

Have you audited all those other trees, whether backporting it there is correct?

Quoted 2 lines

I wrote to Borislav earlier about this but I'm unsure if my message reached him as I did not hear back.

Borislav is regularly overloaded with shit. :-\

Sorry that I couldn't get back to you.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#2 lore raw
Quoted 7 lines · Borislav Petkov
Quoted 6 lines · Jean Delvare

The backport of 51520e03e70d ("EDAC/mc: Fix error path ordering in edac_mc_alloc()") to stable kernel branches is incomplete due to a different memory allocation scheme. In v6.19 and earlier, the device initialization must be moved further up so that all jumps to the error label are covered.

Quoted 6 lines
Quoted 2 lines

looks about right:

Thanks for the review.

Quoted 7 lines
Quoted 4 lines

I believe that CVE-2026-31689 is not properly fixed in kernels v6.19 and older as of today, and the patch below shall address that. Affected branches still under maintenance would be v6.18, v6.12, v6.6 and v6.1. v6.19 is equally affected but no longer maintained.

Have you audited all those other trees, whether backporting it there is correct?

Yes I did.

Signature · 2 lines
Jean Delvare
SUSE L3 Support
maintainer Applied
#3 lore raw
In reply to Jean Delvare
Quoted 2 lines · Jean Delvare

Affected
branches still under maintenance would be v6.18, v6.12, v6.6 and v6.1.

Queued for 6.18, 6.12, 6.6 and 6.1, thanks.

Signature · 2 lines
Thanks,
Sasha