Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\umh.c Create Date:2022-07-28 09:22:47
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:rk_usermode_blob - fork a blob of bytes as a usermode process*@data: a blob of bytes that can be do_execv-ed as a file*@len: length of the blob*@info: information about usermode process (shouldn't be NULL)* If info->cmdline is set it will be used as

Proto:int fork_usermode_blob(void *data, size_t len, struct umh_info *info)

Type:int

Parameter:

TypeParameterName
void *data
size_tlen
struct umh_info *info
503  pos = 0
506  file = shmem_kernel_file_setup("", len, 0)
507  If IS_ERR(file) Then Return PTR_ERR(file)
510  written = kernel_write(file, data, len, & pos)
511  If written != len Then
512  err = written
513  If err >= 0 Then err = -ENOMEM
515  Go to out
518  err = -ENOMEM
519  sub_info = call_usermodehelper_setup_file(file, umh_pipe_setup, umh_clean_and_save_pid, info)
521  If Not sub_info Then Go to out
524  err = all_usermodehelper_exec - start a usermode application*@sub_info: information about the subprocessa*@wait: wait for the application to finish and return status.* when UMH_NO_WAIT don't wait at all, but you get no useful error back
525  If Not err Then
526  mutex_lock( & umh_list_lock)
527  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
528  mutex_unlock( & umh_list_lock)
530  out :
531  fput(file)
532  Return err