Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this questionIn do_execve()
there is a call to prepare_bprm_creds(bprm)
in line number 1396.
prepare_bprm_creds(struct linux_binprm *bprm)
function definition it calls prepare_exec_creds()
in line number 1121.
Could you开发者_高级运维 please explain to me the working of prepare_bprm_creds(struct linux_binprm *bprm)
(what it does).For future reference, please cite filename and version number, not just line number. Better yet, link to a LXR listing. In any case...
prepare_bprm_creds eventually calls prepare_creds, which allocates a struct cred - this will eventually hold the security context of the new task (ie, per-thread security information). Along the way, execution also passes through prepare_exec_creds, which allocates a thread_group_cred structure, which holds some security information that is shared for all threads in a process.
Note that this only allocates memory for the structure; the new credentials are set in prepare_binprm later.
As for credentials, there is documentation at Documentation/credentials.txt.
精彩评论