函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:moyo_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.

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

返回类型:void

参数:

类型参数名称
struct tomoyo_request_info *r
intlen
const char *fmt
va_listargs
370  bool quota_exceeded = false
372  如果非moyo_get_audit - Get audit mode.*@ns: Pointer to "struct tomoyo_policy_namespace".*@profile: Profile number.*@index: Index number of functionality.*@is_granted: True if granted log, false otherwise.则转到:out
375  buf等于moyo_init_log - Allocate buffer for audit logs
376  如果非buf则转到:out
378  entry等于分配内存并置零
379  如果非entry
380  释放内存
381  转到:out
383  log等于buf
384  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.
389  size等于lenmoyo_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.
390  加自旋锁
391  如果tomoyo_memory_quota[TOMOYO_MEMORY_AUDIT]且tomoyo_memory_used[TOMOYO_MEMORY_AUDIT]加size大于等于tomoyo_memory_quota[TOMOYO_MEMORY_AUDIT]则
394  quota_exceeded = true
395  否则
396  tomoyo_memory_used[TOMOYO_MEMORY_AUDIT]加等于size
397  添加链表项
398  Length of "stuct list_head tomoyo_log". 自加
400  自旋锁解锁
401  如果quota_exceeded
402  释放内存
403  释放内存
404  转到:out
406  wake_up( & Wait queue for /sys/kernel/security/tomoyo/audit. )
407  out :
408  返回
调用者
名称描述
tomoyo_write_logmoyo_write_log - Write an audit log.*@r: Pointer to "struct tomoyo_request_info".*@fmt: The printf()'s format string, followed by parameters.* Returns nothing.
tomoyo_supervisormoyo_supervisor - Ask for the supervisor's decision