Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\audit.c Create Date:2022-07-28 19:33:25
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:void tomoyo_write_log2(struct tomoyo_request_info *r, int len, const char *fmt, va_list args)

Type:void

Parameter:

TypeParameterName
struct tomoyo_request_info *r
intlen
const char *fmt
va_listargs
370  bool quota_exceeded = false
372  If Not 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. Then Go to out
375  buf = moyo_init_log - Allocate buffer for audit logs
376  If Not buf Then Go to out
378  entry = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
379  If Not entry Then
380  kfree(buf)
381  Go to 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 = 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.
390  spin_lock( & Lock for "struct list_head tomoyo_log". )
391  If tomoyo_memory_quota[TOMOYO_MEMORY_AUDIT] && tomoyo_memory_used[TOMOYO_MEMORY_AUDIT] + size >= tomoyo_memory_quota[TOMOYO_MEMORY_AUDIT] Then
394  quota_exceeded = true
395  Else
396  tomoyo_memory_used[TOMOYO_MEMORY_AUDIT] += size
397  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
398  Length of "stuct list_head tomoyo_log". ++
400  spin_unlock( & Lock for "struct list_head tomoyo_log". )
401  If quota_exceeded Then
402  kfree(buf)
403  kfree(entry)
404  Go to out
406  wake_up( & Wait queue for /sys/kernel/security/tomoyo/audit. )
407  out :
408  Return
Caller
NameDescribe
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