[PATCH v2] powerpc/mm: Fix missing KUAP disable in flush_coherent_icache()

Michael Ellerman mpe at ellerman.id.au
Thu Mar 5 17:08:25 AEDT 2020


Andrew Donnellan <ajd at linux.ibm.com> writes:
> On 4/3/20 10:57 am, Michael Ellerman wrote:
>> diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
>> index ef7b1119b2e2..36a8c7b105ce 100644
>> --- a/arch/powerpc/mm/mem.c
>> +++ b/arch/powerpc/mm/mem.c
>> @@ -373,7 +373,9 @@ static inline bool flush_coherent_icache(unsigned long addr)
>>   	 */
>>   	if (cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) {
>>   		mb(); /* sync */
>> +		allow_read_from_user((void *)addr, L1_CACHE_BYTES);
>>   		icbi((void *)addr);
>> +		prevent_read_from_user((void *)addr, L1_CACHE_BYTES);
>>   		mb(); /* sync */
>>   		isync();
>>   		return true;
>> 
>
> (void *) should be (const void __user *) to avoid sparse warnings.
>
> snowpatch reports: https://patchwork.ozlabs.org/patch/1248671/

Thanks.

cheers


More information about the Linuxppc-dev mailing list