What if you intend to specify certain specific memory protections (a combination of read, write, and execute protections) for the memory pages you allocate? In this case, use the underlying __vmalloc() API (it is exported). Consider the following comment in the kernel source (mm/vmalloc.c):
* For tight control over page level allocator and protection flags
* use __vmalloc() instead.
The signature of the __vmalloc() API shows how we can achieve this:
void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot);
FYI, from the 5.8 kernel, the __vmalloc() function's third parameter - pgprot_t prot - has been removed (as there weren't any users for page permissions besides the usual ones; https://github.com/torvalds/linux/commit/88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca). Tells us another thing regarding the kernel community - if a feature isn't being used by anyone, it's...