History

mm/vma: remove mmap_action->success_hook

This hook was introduced to work around code that seemed to absolutely require access to a VMA pointer upon mmap(). However, providing this hook leaves a backdoor to drivers getting access to the very thing mmap_prepare eliminates - a pointer to the VMA. Let's solve this contradiction by removing it. The key intended user was hugetlb, however it seems that the best course now is to avoid allowing all drivers the ability to work around mmap_prepare, and find a different solution there.

Lorenzo Stoakes committed 5 months ago

Commit 8876dc01 parent 17986193 files · +0 −22Browse files

Showing the changes to include (1 of 3 files). Show all

Unified · Split

include/linux/mm_types.h+0−10
@@ -843,16 +843,6 @@ struct mmap_action { · 842 unmodified lines
843 };843 };
844 enum mmap_action_type type;844 enum mmap_action_type type;
845 845
846 /*
847 * If specified, this hook is invoked after the selected action has been
848 * successfully completed. Note that the VMA write lock still held.
849 *
850 * The absolute minimum ought to be done here.
851 *
852 * Returns 0 on success, or an error code.
853 */
854 int (*success_hook)(const struct vm_area_struct *vma);
855
856 /*846 /*
857 * If specified, this hook is invoked when an error occurred when847 * If specified, this hook is invoked when an error occurred when
858 * attempting the selected action.848 * attempting the selected action.