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

Andrew Donnellan ajd at linux.ibm.com
Thu Mar 5 11:30:46 AEDT 2020


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/

-- 
Andrew Donnellan              OzLabs, ADL Canberra
ajd at linux.ibm.com             IBM Australia Limited



More information about the Linuxppc-dev mailing list