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] [day] [month] [year] [list]
Message-ID: <1bd6db20-7012-49d5-9e9f-38a84c3946a5@arm.com>
Date: Mon, 16 Dec 2024 10:01:55 +0530
From: Anshuman Khandual <anshuman.khandual@....com>
To: Leesoo Ahn <lsahn@...eel.net>
Cc: Catalin Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>,
 Andrew Morton <akpm@...ux-foundation.org>,
 Kefeng Wang <wangkefeng.wang@...wei.com>,
 Suren Baghdasaryan <surenb@...gle.com>, Ryan Roberts <ryan.roberts@....com>,
 Joey Gouly <joey.gouly@....com>, Mark Brown <broonie@...nel.org>,
 Ard Biesheuvel <ardb@...nel.org>,
 "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)"
 <linux-arm-kernel@...ts.infradead.org>,
 open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] arm64: mm: fault: replace the behavior of fault_info[18]



On 12/14/24 15:08, Leesoo Ahn wrote:
> I just figured out that do_sea(..) isn't the right function to deal
> with VMSAv9-128.
> Please ignore this patch.

Right, actual handling needs to be sorted out when 128 bit PTE is enabled.
For example, following change might be required to handle 128 bit related
faults but the handlers such as do_sea(), do_bad(), do_translation_fault()
need to be changed and tested for 128 bit PTE format.

--- a/arch/arm64/include/asm/esr.h
+++ b/arch/arm64/include/asm/esr.h
@@ -415,7 +415,8 @@ static inline bool esr_fsc_is_translation_fault(unsigned long esr)
               (esr == ESR_ELx_FSC_FAULT_L(2)) ||
               (esr == ESR_ELx_FSC_FAULT_L(1)) ||
               (esr == ESR_ELx_FSC_FAULT_L(0)) ||
-              (esr == ESR_ELx_FSC_FAULT_L(-1));
+              (esr == ESR_ELx_FSC_FAULT_L(-1)) ||
+              (esr == ESR_ELx_FSC_FAULT_L(-2));
 }
 
 static inline bool esr_fsc_is_permission_fault(unsigned long esr)
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 8b281cf308b3..3a35c580395e 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -823,7 +823,7 @@ static const struct fault_info fault_info[] = {
        { do_page_fault,        SIGSEGV, SEGV_ACCERR,   "level 3 permission fault"      },
        { do_sea,               SIGBUS,  BUS_OBJERR,    "synchronous external abort"    },
        { do_tag_check_fault,   SIGSEGV, SEGV_MTESERR,  "synchronous tag check fault"   },
-       { do_bad,               SIGKILL, SI_KERNEL,     "unknown 18"                    },
+       { do_sea,               SIGKILL, SI_KERNEL,     "level -2 (translation table walk)"     },
        { do_sea,               SIGKILL, SI_KERNEL,     "level -1 (translation table walk)"     },
        { do_sea,               SIGKILL, SI_KERNEL,     "level 0 (translation table walk)"      },
        { do_sea,               SIGKILL, SI_KERNEL,     "level 1 (translation table walk)"      },
@@ -847,9 +847,9 @@ static const struct fault_info fault_info[] = {
        { do_bad,               SIGKILL, SI_KERNEL,     "unknown 39"                    },
        { do_bad,               SIGKILL, SI_KERNEL,     "unknown 40"                    },
        { do_bad,               SIGKILL, SI_KERNEL,     "level -1 address size fault"   },
-       { do_bad,               SIGKILL, SI_KERNEL,     "unknown 42"                    },
+       { do_translation_fault, SIGSEGV, SEGV_MAPERR,   "level -2 translation fault"    },
        { do_translation_fault, SIGSEGV, SEGV_MAPERR,   "level -1 translation fault"    },
-       { do_bad,               SIGKILL, SI_KERNEL,     "unknown 44"                    },
+       { do_bad,               SIGKILL, SI_KERNEL,     "level -2 address size fault"   },
        { do_bad,               SIGKILL, SI_KERNEL,     "unknown 45"                    },
        { do_bad,               SIGKILL, SI_KERNEL,     "unknown 46"                    },
        { do_bad,               SIGKILL, SI_KERNEL,     "unknown 47"                    },


> 
> BR
> Leesoo
> 
> 2024년 12월 14일 (토) 오후 6:20, Leesoo Ahn <lsahn@...eel.net>님이 작성:
>>
>> Replace the behavior of 18th element of fault_info with the 'fn' member to
>> do_sea(..) and 'name' to 'level -2 (translation table walk)' based on
>> the information[1] of the latest reference manual[2].
>>
>> The information has described in the chapter, D24.2.40 of [2] and
>> DFSC[5:0] bit (stands for Data Fault Status Code).
>>
>> [1]: Synchronous External abort on translation table walk, level -2
>> [2]: Arm Architecture Reference Manual, for A-profile architecture
>>
>> Signed-off-by: Leesoo Ahn <lsahn@...eel.net>
>> ---
>>  arch/arm64/mm/fault.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
>> index ef63651099a9..b1c08289a5cc 100644
>> --- a/arch/arm64/mm/fault.c
>> +++ b/arch/arm64/mm/fault.c
>> @@ -863,7 +863,7 @@ static const struct fault_info fault_info[] = {
>>         { do_page_fault,        SIGSEGV, SEGV_ACCERR,   "level 3 permission fault"      },
>>         { do_sea,               SIGBUS,  BUS_OBJERR,    "synchronous external abort"    },
>>         { do_tag_check_fault,   SIGSEGV, SEGV_MTESERR,  "synchronous tag check fault"   },
>> -       { do_bad,               SIGKILL, SI_KERNEL,     "unknown 18"                    },
>> +       { do_sea,               SIGKILL, SI_KERNEL,     "level -2 (translation table walk)"     },
>>         { do_sea,               SIGKILL, SI_KERNEL,     "level -1 (translation table walk)"     },
>>         { do_sea,               SIGKILL, SI_KERNEL,     "level 0 (translation table walk)"      },
>>         { do_sea,               SIGKILL, SI_KERNEL,     "level 1 (translation table walk)"      },
>> --
>> 2.46.1
>>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ