Fix a wrong value passed to __find_vmap_area()
Subsystems (2)
Uladzislau Rezki (Sony)
maintainerPATCH 1/1 Fix a wrong value passed to __find_vmap_area()
There was a type in the vmalloc_dump_obj() function. Instead of passing a real address which is "objp" an "addr" was used what is wrong and not initialized.
--- mm/vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/vmalloc.c +1 -1
@@ -4688,7 +4688,7 @@ bool vmalloc_dump_obj(void *object) vn =addr_to_node ((unsigned long )objp);if (spin_trylock (&vn->busy.lock)) { - va =__find_vmap_area (addr, &vn->busy.root); + va =__find_vmap_area ((unsigned long )objp, &vn->busy.root);if (va && va->vm) { addr = (unsigned long )va->vm->addr;
Signature · 1 line
2.39.2
Quoted 6 lines · Uladzislau Rezki (Sony)
There was a type in the
vmalloc_dump_obj()function. Instead of passing a real address which is "objp" an "addr" was used what is wrong and not initialized.Reported-by kernel test robot <[email protected]>Fixes e88b85b81d5 ("mm: vmalloc: offload free_vmap_area_lock lock")
I am not sure that e88b85b81d5 introduced this. Based on the diff, I think it was actually commit 86817057732a ("mm: vmalloc: remove global vmap_area_root rb-tree"). Does not really matter for the patch text but I think it does matter for what change this gets squashed into.
Quoted 22 lines
Signed-off-by Uladzislau Rezki (Sony) <[email protected]>--- mm/vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/vmalloc.c +1
-1@@ -4688,7 +4688,7 @@ bool vmalloc_dump_obj(void *object) vn =addr_to_node ((unsigned long )objp);if (spin_trylock (&vn->busy.lock)) { - va =__find_vmap_area (addr, &vn->busy.root); + va =__find_vmap_area ((unsigned long )objp, &vn->busy.root);if (va && va->vm) { addr = (unsigned long )va->vm->addr;Signature · 1 line
2.39.2
Uladzislau Rezki
maintainerQuoted 5 lines · Nathan Chancellor
Quoted 4 lines · Uladzislau Rezki (Sony)
There was a type in the
vmalloc_dump_obj()function. Instead of passing a real address which is "objp" an "addr" was used what is wrong and not initialized.
Quoted 8 lines
Quoted 2 lines
Reported-by kernel test robot <[email protected]>Fixes e88b85b81d5 ("mm: vmalloc: offload free_vmap_area_lock lock")I am not sure that
e88b85b81d5introduced this. Based on the diff, I think it was actually commit86817057732a("mm: vmalloc: remove globalvmap_area_rootrb-tree"). Does not really matter for the patch text but I think it does matter for what change this gets squashed into.
Right you are! Below is updated version:
<snip>
From 98f1fd2d3913f3b7bcbe49785a78f67999151f1c Mon Sep 17 00:00:00 2001
From: "Uladzislau Rezki (Sony)" <[email protected]>
Date: Thu, 11 Jan 2024 13:04:07 +0100
Subject: [PATCH 1/2] mm: vmalloc: Fix a wrong value passed to
__find_vmap_area()
There was a type in the vmalloc_dump_obj() function. Instead of passing a real address which is "objp" an "addr" was used what is wrong and not initialized.
--- mm/vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/vmalloc.c +1 -1
@@ -4688,7 +4688,7 @@ bool vmalloc_dump_obj(void *object) vn =addr_to_node ((unsigned long )objp);if (spin_trylock (&vn->busy.lock)) { - va =__find_vmap_area (addr, &vn->busy.root); + va =__find_vmap_area ((unsigned long )objp, &vn->busy.root);if (va && va->vm) { addr = (unsigned long )va->vm->addr;
Signature · 5 lines
2.39.2 <snip> -- Uladzislau Rezki
Lorenzo Stoakes
Reviewed-byQuoted 23 lines · Uladzislau Rezki
Quoted 5 lines · Nathan Chancellor
Quoted 4 lines · Uladzislau Rezki (Sony)
There was a type in the
vmalloc_dump_obj()function. Instead of passing a real address which is "objp" an "addr" was used what is wrong and not initialized.Quoted 8 lines
Quoted 2 lines
Reported-by kernel test robot <[email protected]>Fixes e88b85b81d5 ("mm: vmalloc: offload free_vmap_area_lock lock")I am not sure that
e88b85b81d5introduced this. Based on the diff, I think it was actually commit86817057732a("mm: vmalloc: remove globalvmap_area_rootrb-tree"). Does not really matter for the patch text but I think it does matter for what change this gets squashed into.Right you are! Below is updated version:
<snip>
From98f1fd2d3913f3b7bcbe49785a78f67999151f1cMon Sep 17 00:00:00 2001
From: "Uladzislau Rezki (Sony)" <[email protected]>
Date: Thu, 11 Jan 2024 13:04:07 +0100
Subject: [PATCH 1/2] mm: vmalloc: Fix a wrong value passed to
__find_vmap_area()
Quoted 6 lines
There was a type in the
vmalloc_dump_obj()function. Instead of passing a real address which is "objp" an "addr" was used what is wrong and not initialized.Reported-by kernel test robot <[email protected]>Fixes 86817057732a ("mm: vmalloc: remove global vmap_area_root rb-tree")
I know the commits are likely to get squashed/messed with (this is now d1d9bdd672c4 in my mm-unstable tree), will this get corrected in the commit message also? Slightly tricky one.
Perhaps a note for Andrew unless his scripts do this already - please update this to wherever "mm: vmalloc: remove global vmap_area_root rb-tree" lands?
Quoted 23 lines
Signed-off-by Uladzislau Rezki (Sony) <[email protected]>--- mm/vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/vmalloc.c +1
-2@@ -4688,7 +4688,7 @@ bool vmalloc_dump_obj(void *object) vn =addr_to_node ((unsigned long )objp);if (spin_trylock (&vn->busy.lock)) { - va =__find_vmap_area (addr, &vn->busy.root); + va =__find_vmap_area ((unsigned long )objp, &vn->busy.root);if (va && va->vm) { addr = (unsigned long )va->vm->addr; --2.39.2
<snip>
Quoted 2 lines
--
Uladzislau Rezki
Otherwise looks good to me. I have some style comments but perhaps better for me to address on the actual patch series! Feel free to add:
Andrew Morton
maintainerQuoted 7 lines · On Tue, 16 Jan 2024 22:13:17 +0000 Lorenzo Stoakes <[email protected]> wrote:
Quoted 6 lines
There was a type in the
vmalloc_dump_obj()function. Instead of passing a real address which is "objp" an "addr" was used what is wrong and not initialized.Reported-by kernel test robot <[email protected]>Fixes 86817057732a ("mm: vmalloc: remove global vmap_area_root rb-tree")
Quoted 7 lines
I know the commits are likely to get squashed/messed with (this is now
d1d9bdd672c4in my mm-unstable tree), will this get corrected in the commit message also? Slightly tricky one.Perhaps a note for Andrew unless his scripts do this already - please update this to wherever "mm: vmalloc: remove global
vmap_area_rootrb-tree" lands?
Yep, I'll scrunch together
mm-vmalloc-remove-global-vmap_area_root-rb-tree.patch mm-vmalloc-remove-global-vmap_area_root-rb-tree-fix.patch mm-vmalloc-remove-global-vmap_area_root-rb-tree-fix-2.patch
before merging it all into mm-stable and shall tidy up the changelog trail.