Skip to contentSkip to conversation

EFI fix

GIT PULL Ingo Molnar 3 participants 6 messages Jan 11, 2019 – Jan 12, 2019 EFI

lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest efi-urgent-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git efi-urgent-for-linus

# HEAD: b12f5440d8ca02e8f9ab4f1461f9214295cc4f66 Merge branch 'linus' into efi/urgent, to resolve conflict

A single fix that adds an annotation to resolve a kmemleak false positive.

Thanks,

Ingo

------------------>
Qian Cai (1):
efi: Let kmemleak ignore false positives

 drivers/firmware/efi/efi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/firmware/efi/efi.c +3 -0
index 4c46ff6f2242..7ac09dd8f268 100644
@@ -31,6 +31,7 @@
 #include <linux/acpi.h>
 #include <linux/ucs2_string.h>
 #include <linux/memblock.h>
+#include <linux/kmemleak.h>
 
 #include <asm/early_ioremap.h>
 
@@ -1026,6 +1027,8 @@ int __ref efi_mem_reserve_persistent(phys_addr_t addr, u64 size)
 	if (!rsv)
 		return -ENOMEM;
 
+	kmemleak_ignore(rsv);
+
 	rsv->size = EFI_MEMRESERVE_COUNT(PAGE_SIZE);
 	atomic_set(&rsv->count, 1);
 	rsv->entry[0].base = addr;
#1 lore raw
Quoted 37 lines · Ingo Molnar

Linus,

Please pull the latest efi-urgent-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git efi-urgent-for-linus

# HEAD: b12f5440d8ca02e8f9ab4f1461f9214295cc4f66 Merge branch 'linus' into efi/urgent, to resolve conflict

A single fix that adds an annotation to resolve a kmemleak false positive.

Thanks,

Ingo

------------------>
Qian Cai (1):
efi: Let kmemleak ignore false positives

 drivers/firmware/efi/efi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/firmware/efi/efi.c +1 -0
index 4c46ff6f2242..7ac09dd8f268 100644
@@ -31,6 +31,7 @@
 #include <linux/acpi.h>
 #include <linux/ucs2_string.h>
 #include <linux/memblock.h>
+#include <linux/kmemleak.h>
 
 #include <asm/early_ioremap.h>
 

drivers/firmware/efi/efi.c int __ref efi_mem_reserve_persistent(phys_addr_t addr, u64 size) · line 1034

Quoted 8 lines
drivers/firmware/efi/efi.c +2 -0
@@ -1026,6 +1027,8 @@ int __ref efi_mem_reserve_persistent(phys_addr_t addr, u64 size)
        if (!rsv)
                return -ENOMEM;
 
+       kmemleak_ignore(rsv);
+
        rsv->size = EFI_MEMRESERVE_COUNT(PAGE_SIZE);
        atomic_set(&rsv->count, 1);
        rsv->entry[0].base = addr;

I was hoping we could merge this patch (so we can backport it), but resolve the conflict by dropping the kmemleak_ignore() again, since it will now complain since the kmalloc() has been replaced with a __get_free_page() in the mean time (if that makes sense)

#2 lore raw
Quoted 3 lines · Ard Biesheuvel

I was hoping we could merge this patch (so we can backport it), but resolve the conflict by dropping the kmemleak_ignore() again [..]

Well, we'd drop the new #include line also, since it would be pointless without the kmemleak_ignore().

End result: there would be nothing left. Better not to merge it at all.

It's easy enough to backport, and just say "done differently upstream in commit 80424b02d42b ("efi: Reduce the amount of memblock reservations for persistent allocations").

The stable tree doesn't require that the *same* commits be upstream, it only requires that the fixes be upstream and Greg&al want a pointer to the upstream fix just so that they know they're not fixing something that might still be broken upstream.

See for example (just random googling)

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=37435f7e80ef9adc32a69013c18f135e3f434244

which shows that "fixed differently upstream" case and points to why.

Linus

#3 lore raw
Quoted 10 lines · Linus Torvalds
Quoted 3 lines · Ard Biesheuvel

I was hoping we could merge this patch (so we can backport it), but resolve the conflict by dropping the kmemleak_ignore() again [..]

Well, we'd drop the new #include line also, since it would be pointless without the kmemleak_ignore().

End result: there would be nothing left. Better not to merge it at all.

Indeed!

Quoted 9 lines

It's easy enough to backport, and just say "done differently upstream in commit 80424b02d42b ("efi: Reduce the amount of memblock reservations for persistent allocations").

The stable tree doesn't require that the *same* commits be upstream, it only requires that the fixes be upstream and Greg&al want a pointer to the upstream fix just so that they know they're not fixing something that might still be broken upstream.

Quoted 5 lines

See for example (just random googling)

   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=37435f7e80ef9adc32a69013c18f135e3f434244

which shows that "fixed differently upstream" case and points to why.

Thanks - I'm dropping the commit from efi/urgent.

Ingo

#4 lore raw
In reply to Ingo Molnar
Quoted 3 lines · Ingo Molnar

A single fix that adds an annotation to resolve a kmemleak false positive.

This one is apparently obviated by commit 80424b02d42b ("efi: Reduce the amount of memblock reservations for persistent allocations")

Linus

#5 lore raw
Quoted 7 lines · Linus Torvalds
Quoted 3 lines · Ingo Molnar

A single fix that adds an annotation to resolve a kmemleak false positive.

This one is apparently obviated by commit 80424b02d42b ("efi: Reduce the amount of memblock reservations for persistent allocations")

... and it turns out I mis-merged it in tip:master not realizing this connection (hence the pull request) - so good thing that Ard warned about this and you double checked it!

Thanks,

Ingo