函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\audit.c Create Date:2022-07-27 21:02:34
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:moyo_init_log - Allocate buffer for audit logs

函数原型:char *tomoyo_init_log(struct tomoyo_request_info *r, int len, const char *fmt, va_list args)

返回类型:char

参数:

类型参数名称
struct tomoyo_request_info *r
intlen
const char *fmt
va_listargs
247  char * buf = NULL
248  char * bprm_info = NULL
249  const char * header = NULL
250  char * realpath = NULL
251  const char * symlink = NULL
253  domainname等于name
255  header等于moyo_print_header - Get header line of audit log.*@r: Pointer to "struct tomoyo_request_info".* Returns string representation.* This function uses kmalloc(), so caller must kfree() if this function* didn't return NULL.
256  如果非header则返回:NULL
259  len加等于strlen - Find the length of a string*@s: The string to be sizedstrlen - Find the length of a string*@s: The string to be sized加10
260  如果For holding parameters specific to execve() request.* NULL if not dealing do_execve().
261  file等于file
263  realpath等于tomoyo_realpath_from_path( & f_path)
264  bprm_info等于moyo_print_bprm - Print "struct linux_binprm" for auditing
265  如果非realpath或非bprm_info则转到:out
268  len加等于strlen - Find the length of a string*@s: The string to be sized加80加strlen - Find the length of a string*@s: The string to be sized
269  否则如果For holding parameters specific to operations which deal files.* NULL if not dealing files.* Content of symbolic link to be created. NULL for operations other * than symlink().
270  symlink等于name
272  len加等于18加strlen - Find the length of a string*@s: The string to be sized
274  len等于moyo_round2 - Round up to power of 2 for calculating memory usage.*@size: Size to be rounded up.* Returns @size.* Since SLOB does not round up, this function simply returns @size.
275  buf等于分配内存并置零
276  如果非buf则转到:out
278  len自减
279  pos等于snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
280  如果realpath
281  bprm等于bprm
283  pos加等于snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
286  否则如果symlinkpos加等于snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
289  pos加等于snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
290  vsnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@args: Arguments for the format string* This function generally
291  out :
292  释放内存
293  释放内存
294  释放内存
295  返回:buf
调用者
名称描述
tomoyo_write_log2moyo_write_log2 - Write an audit log.*@r: Pointer to "struct tomoyo_request_info".*@len: Buffer size needed for @fmt and @args.*@fmt: The printf()'s format string.*@args: va_list structure for @fmt.* Returns nothing.
tomoyo_supervisormoyo_supervisor - Ask for the supervisor's decision