[PATCH 06/17] prmem: test cases for memory protection

Dave Hansen dave.hansen at intel.com
Thu Oct 25 16:43:52 UTC 2018


> +static bool is_address_protected(void *p)
> +{
> +	struct page *page;
> +	struct vmap_area *area;
> +
> +	if (unlikely(!is_vmalloc_addr(p)))
> +		return false;
> +	page = vmalloc_to_page(p);
> +	if (unlikely(!page))
> +		return false;
> +	wmb(); /* Flush changes to the page table - is it needed? */

No.

The rest of this is just pretty verbose and seems to have been very
heavily copied and pasted.  I guess that's OK for test code, though.



More information about the Linux-security-module-archive mailing list