arm64/mm: Poison initmem while freeing with free_reserved_area()
PATCH 1/1 arm64/mm: Poison initmem while freeing with free_reserved_area()
Platform implementation for free_initmem() should poison the memory while freeing it up. Hence pass across POISON_FREE_INITMEM while calling into free_reserved_area(). The same is being followed in the generic fallback for free_initmem() and some other platforms overriding it.
--- arch/arm64/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/init.c +1 -1
@@ -571,7 +571,7 @@ void free_initmem(void) {free_reserved_area (lm_alias (__init_begin),lm_alias (__init_end), -0 ,"unused kernel" ); +POISON_FREE_INITMEM ,"unused kernel" );/* * Unmap the __init region but leave the VM area in place. This * prevents the region from being reused for kernel modules, which
Signature · 1 line
2.20.1
Quoted 10 lines · Anshuman Khandual
Platform implementation for
free_initmem()should poison the memory while freeing it up. Hence pass acrossPOISON_FREE_INITMEMwhile calling intofree_reserved_area(). The same is being followed in the generic fallback forfree_initmem()and some other platforms overriding it.Cc Catalin Marinas <[email protected]>Cc Will Deacon <[email protected]>Cc Mark Rutland <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>
Is there a good reason you haven't made a similar change to free_initrd_mem() - the same logic seems to apply. However this change looks fine to me.
Quoted 18 lines
--- arch/arm64/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm64/mm/init.c +1
-1@@ -571,7 +571,7 @@ void free_initmem(void) {free_reserved_area (lm_alias (__init_begin),lm_alias (__init_end), -0 ,"unused kernel" ); +POISON_FREE_INITMEM ,"unused kernel" );/* * Unmap the __init region but leave the VM area in place. This * prevents the region from being reused for kernel modules, which
Quoted 12 lines · Steven Price
Quoted 10 lines · Anshuman Khandual
Platform implementation for
free_initmem()should poison the memory while freeing it up. Hence pass acrossPOISON_FREE_INITMEMwhile calling intofree_reserved_area(). The same is being followed in the generic fallback forfree_initmem()and some other platforms overriding it.Cc Catalin Marinas <[email protected]>Cc Will Deacon <[email protected]>Cc Mark Rutland <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>
Quoted 3 lines
Is there a good reason you haven't made a similar change to
free_initrd_mem()- the same logic seems to apply. However this change looks fine to me.
We will use generic free_initrd_mem() going forward as proposed in a recent patch which does call free_reserved_area() with POISON_FREE_INITMEM.
https://patchwork.kernel.org/patch/11165379/
Quoted 23 lines
Reviewed-by Steven Price <[email protected]>Quoted 18 lines
--- arch/arm64/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm64/mm/init.c +1
-1@@ -571,7 +571,7 @@ void free_initmem(void) {free_reserved_area (lm_alias (__init_begin),lm_alias (__init_end), -0 ,"unused kernel" ); +POISON_FREE_INITMEM ,"unused kernel" );/* * Unmap the __init region but leave the VM area in place. This * prevents the region from being reused for kernel modules, which
Quoted 15 lines · Anshuman Khandual
Quoted 12 lines · Steven Price
Quoted 10 lines · Anshuman Khandual
Platform implementation for
free_initmem()should poison the memory while freeing it up. Hence pass acrossPOISON_FREE_INITMEMwhile calling intofree_reserved_area(). The same is being followed in the generic fallback forfree_initmem()and some other platforms overriding it.Cc Catalin Marinas <[email protected]>Cc Will Deacon <[email protected]>Cc Mark Rutland <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>
Quoted 8 lines
Quoted 3 lines
Is there a good reason you haven't made a similar change to
free_initrd_mem()- the same logic seems to apply. However this change looks fine to me.We will use generic
free_initrd_mem()going forward as proposed in a recent patch which does callfree_reserved_area()withPOISON_FREE_INITMEM.
Great - that sounds like a very good reason!
Thanks,
Steve
Quoted 29 lines
Quoted 7 lines
Reviewed-by Steven Price <[email protected]>Quoted 4 lines
--- arch/arm64/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 16 lines
Quoted 6 lines
arch/arm64/mm/init.c +0
-0arch/arm64/mm/init.c void free_initmem(void) · line 577
Quoted 8 lines
arch/arm64/mm/init.c +1
-1@@ -571,7 +571,7 @@ void free_initmem(void) {free_reserved_area (lm_alias (__init_begin),lm_alias (__init_end), -0 ,"unused kernel" ); +POISON_FREE_INITMEM ,"unused kernel" );/* * Unmap the __init region but leave the VM area in place. This * prevents the region from being reused for kernel modules, which _______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 19 lines · Anshuman Khandual
Platform implementation for
free_initmem()should poison the memory while freeing it up. Hence pass acrossPOISON_FREE_INITMEMwhile calling intofree_reserved_area(). The same is being followed in the generic fallback forfree_initmem()and some other platforms overriding it.Cc Catalin Marinas <[email protected]>Cc Will Deacon <[email protected]>Cc Mark Rutland <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>--- arch/arm64/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm64/mm/init.c +0
-0
arch/arm64/mm/init.c void free_initmem(void) · line 574
Quoted 5 lines
arch/arm64/mm/init.c +1
-1@@ -571,7 +571,7 @@ void free_initmem(void) {free_reserved_area (lm_alias (__init_begin),lm_alias (__init_end), -0 ,"unused kernel" ); +POISON_FREE_INITMEM ,"unused kernel" );
Will
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 10 lines · Anshuman Khandual
Platform implementation for
free_initmem()should poison the memory while freeing it up. Hence pass acrossPOISON_FREE_INITMEMwhile calling intofree_reserved_area(). The same is being followed in the generic fallback forfree_initmem()and some other platforms overriding it.Cc Catalin Marinas <[email protected]>Cc Will Deacon <[email protected]>Cc Mark Rutland <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>
Queued for 5.5. Thanks.
Signature · 1 line
Catalin