[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7b93efe6-fb54-d6f8-dd3b-3fb260652f15@canonical.com>
Date: Sat, 28 May 2022 11:26:28 +0200
From: Heinrich Schuchardt <heinrich.schuchardt@...onical.com>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Atish Patra <atishp@...shpatra.org>,
linux-efi <linux-efi@...r.kernel.org>,
linux-riscv <linux-riscv@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
stable@...r.kernel.org
Subject: Re: [PATCH] riscv: read-only pages should not be writable
On 5/28/22 11:13, Ard Biesheuvel wrote:
> On Sat, 28 May 2022 at 03:41, Heinrich Schuchardt
> <heinrich.schuchardt@...onical.com> wrote:
>>
>> If EFI pages are marked as read-only,
>> we should remove the _PAGE_WRITE flag.
>>
>> The current code overwrites an unused value.
>>
>> Fixes: b91540d52a08b ("RISC-V: Add EFI runtime services")
>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@...onical.com>
>> ---
>> arch/riscv/kernel/efi.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/riscv/kernel/efi.c b/arch/riscv/kernel/efi.c
>> index 024159298231..1aa540350abd 100644
>> --- a/arch/riscv/kernel/efi.c
>> +++ b/arch/riscv/kernel/efi.c
>> @@ -65,7 +65,7 @@ static int __init set_permissions(pte_t *ptep, unsigned long addr, void *data)
>>
>> if (md->attribute & EFI_MEMORY_RO) {
>> val = pte_val(pte) & ~_PAGE_WRITE;
>> - val = pte_val(pte) | _PAGE_READ;
>> + val |= _PAGE_READ;
>> pte = __pte(val);
>> }
>> if (md->attribute & EFI_MEMORY_XP) {
>> --
>> 2.36.1
>>
>
> Thanks Heinrich
>
> Queued in efi/urgent.
I guess this should also be down-ported to 5.15 and 5.10.
Best regards
Heinrich
Powered by blists - more mailing lists