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: <f659c498-a273-f249-a81b-cab1ed1ba2bb@ghiti.fr>
Date:   Fri, 16 Apr 2021 06:47:19 -0400
From:   Alex Ghiti <alex@...ti.fr>
To:     Anup Patel <anup@...infault.org>
Cc:     Jonathan Corbet <corbet@....net>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Albert Ou <aou@...s.berkeley.edu>,
        Arnd Bergmann <arnd@...db.de>,
        Andrey Ryabinin <aryabinin@...tuozzo.com>,
        Alexander Potapenko <glider@...gle.com>,
        Dmitry Vyukov <dvyukov@...gle.com>, linux-doc@...r.kernel.org,
        linux-riscv <linux-riscv@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org List" <linux-kernel@...r.kernel.org>,
        kasan-dev@...glegroups.com,
        linux-arch <linux-arch@...r.kernel.org>,
        Linux Memory Management List <linux-mm@...ck.org>
Subject: Re: [PATCH] riscv: Protect kernel linear mapping only if
 CONFIG_STRICT_KERNEL_RWX is set

Hi Anup,

Le 4/16/21 à 6:41 AM, Anup Patel a écrit :
> On Thu, Apr 15, 2021 at 4:34 PM Alexandre Ghiti <alex@...ti.fr> wrote:
>>
>> If CONFIG_STRICT_KERNEL_RWX is not set, we cannot set different permissions
>> to the kernel data and text sections, so make sure it is defined before
>> trying to protect the kernel linear mapping.
>>
>> Signed-off-by: Alexandre Ghiti <alex@...ti.fr>
> 
> Maybe you should add "Fixes:" tag in commit tag ?

Yes you're right I should have done that. Maybe Palmer will squash it as 
it just entered for-next?

> 
> Otherwise it looks good.
> 
> Reviewed-by: Anup Patel <anup@...infault.org>

Thank you!

Alex

> 
> Regards,
> Anup
> 
>> ---
>>   arch/riscv/kernel/setup.c | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
>> index 626003bb5fca..ab394d173cd4 100644
>> --- a/arch/riscv/kernel/setup.c
>> +++ b/arch/riscv/kernel/setup.c
>> @@ -264,12 +264,12 @@ void __init setup_arch(char **cmdline_p)
>>
>>          sbi_init();
>>
>> -       if (IS_ENABLED(CONFIG_STRICT_KERNEL_RWX))
>> +       if (IS_ENABLED(CONFIG_STRICT_KERNEL_RWX)) {
>>                  protect_kernel_text_data();
>> -
>> -#if defined(CONFIG_64BIT) && defined(CONFIG_MMU)
>> -       protect_kernel_linear_mapping_text_rodata();
>> +#ifdef CONFIG_64BIT
>> +               protect_kernel_linear_mapping_text_rodata();
>>   #endif
>> +       }
>>
>>   #ifdef CONFIG_SWIOTLB
>>          swiotlb_init(1);
>> --
>> 2.20.1
>>
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ