Elf64_Ehdr *ehdr_ptr;
Elf64_Phdr phdr;
u64 phdr_sz = 0, note_off;
+ struct vm_struct *vm;
ehdr_ptr = (Elf64_Ehdr *)elfptr;
if (!*notes_buf)
return -ENOMEM;
+ /* Allow users to remap ELF note segment buffer on vmalloc
+ * memory using remap_vmalloc_range. */
+ vm = find_vm_area(*notes_buf);
+ BUG_ON(!vm);
+ vm->flags |= VM_USERMAP;
+
rc = copy_notes_elf64(ehdr_ptr, *notes_buf);
if (rc < 0)
return rc;
Elf32_Ehdr *ehdr_ptr;
Elf32_Phdr phdr;
u64 phdr_sz = 0, note_off;
+ struct vm_struct *vm;
ehdr_ptr = (Elf32_Ehdr *)elfptr;
if (!*notes_buf)
return -ENOMEM;
+ /* Allow users to remap ELF note segment buffer on vmalloc
+ * memory using remap_vmalloc_range. */
+ vm = find_vm_area(*notes_buf);
+ BUG_ON(!vm);
+ vm->flags |= VM_USERMAP;
+
rc = copy_notes_elf32(ehdr_ptr, *notes_buf);
if (rc < 0)
return rc;