Re: [PATCH v2 2/3] mm: add LSM hook for writes to readonly memory
From: Ingo Molnar <mingo@kernel.org>
Date: 2016-09-29 06:25:20
Also in:
lkml
* Jann Horn [off-list ref] wrote:
+/* + * subject_cred must be the subjective credentials using which access is + * requested. + * object_cred must be the objective credentials of the target task at the time + * the mm_struct was acquired. + * Both of these may be NULL if FOLL_FORCE is unset or FOLL_WRITE is unset.
Hm, I have trouble parsing the first sentence.
- return __get_user_pages_locked(current, current->mm, start, nr_pages, - write, force, pages, vmas, NULL, false, - FOLL_TOUCH); + return __get_user_pages_locked(current, current->mm, current_cred(), + current_real_cred(), start, + nr_pages, write, force, pages, vmas, + NULL, false, FOLL_TOUCH);
So the parameter passing was disgustig before, and now it became super disgusing! Would it improve the code if we added a friendly helper structure (or two if that's better) to clean up all the interactions within these various functions? Thanks, Ingo -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>