[PATCH v2 2/3] arm64: mm: Handle PAN faults on uaccess CPY* instructions

Robin Murphy robin.murphy at arm.com
Fri Mar 7 10:53:37 PST 2025


On 2025-03-07 6:45 pm, Catalin Marinas wrote:
> On Fri, Feb 28, 2025 at 05:00:05PM +0000, Kristina Martsenko wrote:
>> +bool extable_insn_may_access_user(const struct exception_table_entry *ex,
>> +				  unsigned long esr)
>> +{
>> +	switch (ex->type) {
>> +	case EX_TYPE_UACCESS_CPY:
>> +		return cpy_faulted_on_uaccess(ex, esr);
>> +	default:
>> +		return true;
>> +	}
>> +}
> 
> Not a problem with this patch but I wonder whether we should return
> false for EX_TYPE_LOAD_UNALIGNED_ZEROPAD for completeness

Or maybe rather, true for EX_TYPE_UACCESS_ERR_ZERO and then false in the 
default case?

> (and remove
> the EX_TYPE_KACCESS_ERR_ZERO, it's no longer used. 

I think that's just hidden in the macro swamp of 
__get_mem_asm()/__put_mem_asm()...

Cheers,
Robin.



More information about the linux-arm-kernel mailing list