函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\util.c Create Date:2022-07-27 15:46:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:get_cmdline() - copy the cmdline value to a buffer.*@task: the task whose cmdline value to copy.*@buffer: the buffer to copy to.*@buflen: the length of the buffer. Larger cmdline values are truncated* to this length.

函数原型:int get_cmdline(struct task_struct *task, char *buffer, int buflen)

返回类型:int

参数:

类型参数名称
struct task_struct *task
char *buffer
intbuflen
855  res等于0
857  mm等于get_task_mm - acquire a reference to the task's mm* Returns %NULL if the task has no mm. Checks PF_KTHREAD (meaning* this kernel workthread has transiently adopted a user mm with use_mm,* to do its AIO) is not set and if so returns a reference to it, after
859  如果非mm则转到:out
861  如果非arg_end则转到:out_mm
864  加自旋锁
865  arg_start等于arg_start
866  arg_end等于arg_end
867  env_start等于env_start
868  env_end等于env_end
869  自旋锁解锁
871  len等于arg_endarg_start
873  如果len大于buflenlen等于buflen
876  res等于access_process_vm(task, arg_start, buffer, len, get_user_pages read/write w/o permission )
882  如果res大于0且buffer[res - 1]不等于'\0'且len小于buflen
883  len等于字符串长度
884  如果len小于res
885  res等于len
886  否则
887  len等于env_endenv_start
888  如果len大于buflenreslen等于buflenres
893  res等于字符串长度
896  out_mm :
897  Decrement the use count and release all resources for an mm.
898  out :
899  返回:res
调用者
名称描述
kstrdup_quotable_cmdlineReturns allocated NULL-terminated string containing process* command line, with inter-argument NULLs replaced with spaces,* and other special characters escaped.
audit_log_proctitle