Messages in this thread | | | Date | Wed, 13 Jul 2022 11:53:15 +0200 | From | Peter Zijlstra <> | Subject | Re: [PATCH bpf-next 1/3] mm/vmalloc: introduce vmalloc_exec which allocates RO+X memory |
| |
On Wed, Jul 13, 2022 at 12:18:44AM -0700, Song Liu wrote: > +/** > + * vmalloc_exec - allocate RO+X memory in kernel text space > + * @size: allocation size > + * > + * Allocate @size of RO+X memory in kernel text space. This memory can be > + * used to serve dynamic kernel text, such as BPF programs. > + * > + * The memory allocated is filled illegal instructions. > + * > + * Return: pointer to the allocated memory or %NULL on error > + */ > +void *vmalloc_exec(size_t size) > +{ > + return vmalloc_exec_pack_alloc(size); > +} > +EXPORT_SYMBOL_GPL(vmalloc_exec);
NAK! modules do *NOT* get to allocate text.
| |