Re: [PATCH v2 2/3] mm: add LSM hook for writes to readonly memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Jann Horn <jann@xxxxxxxxx> 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@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]