lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5d771515-e630-bc6e-b81b-8fd208c21011@arm.com>
Date:   Fri, 4 Oct 2019 11:52:23 +0100
From:   Steven Price <steven.price@....com>
To:     Anshuman Khandual <anshuman.khandual@....com>,
        linux-arm-kernel@...ts.infradead.org
Cc:     Mark Rutland <mark.rutland@....com>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arm64/mm: Poison initmem while freeing with
 free_reserved_area()

On 04/10/2019 11:48, Anshuman Khandual wrote:
> 
> 
> On 10/04/2019 03:49 PM, Steven Price wrote:
>> On 04/10/2019 05:23, Anshuman Khandual wrote:
>>> 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.
>>>
>>> Cc: Catalin Marinas <catalin.marinas@....com>
>>> Cc: Will Deacon <will@...nel.org>
>>> Cc: Mark Rutland <mark.rutland@....com>
>>> Cc: linux-kernel@...r.kernel.org
>>> Signed-off-by: Anshuman Khandual <anshuman.khandual@....com>
>>
>> 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/

Great - that sounds like a very good reason!

Thanks,

Steve

>>
>> Reviewed-by: Steven Price <steven.price@....com>
>>
>>> ---
>>>  arch/arm64/mm/init.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
>>> index 45c00a54909c..ea7d38011e83 100644
>>> --- a/arch/arm64/mm/init.c
>>> +++ b/arch/arm64/mm/init.c
>>> @@ -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
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ