Re: [RFC 1/2] x86/mm/cpa: always fail when user address is passed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/13/22 23:39, Hyeonggon Yoo wrote:
> @@ -1514,6 +1515,11 @@ static int __change_page_attr(struct cpa_data *cpa, int primary)
>  	pte_t *kpte, old_pte;
>  
>  	address = __cpa_addr(cpa, cpa->curpage);
> +
> +	if (WARN((IS_ENABLED(CONFIG_EFI) ? cpa->pgd != efi_mm.pgd : true)
> +		  && address <= TASK_SIZE_MAX,
> +		 KERN_WARNING "CPA: Got a user address"))
> +		return -EINVAL;

I was expecting this to actually go after _PAGE_USER, not necessarily
userspace addresses themselves.

What does and should happen with the VDSO, for instance?  It's a
_PAGE_USER mapping, but it's >TASK_SIZE.  Should set_page_attr() work on it?




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux