Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\common.c Create Date:2022-07-28 19:34:59
Last Modify:2020-03-18 09:15:18 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:moyo_select_domain - Parse select command.*@head: Pointer to "struct tomoyo_io_buffer".*@data: String to parse.* Returns true on success, false otherwise.* Caller holds tomoyo_read_lock().

Proto:static bool tomoyo_select_domain(struct tomoyo_io_buffer *head, const char *data)

Type:bool

Parameter:

TypeParameterName
struct tomoyo_io_buffer *head
const char *data
994  struct tomoyo_domain_info * domain = NULL
995  bool global_pid = false
997  If strncmp(data, "select ", 7) Then Return false
999  data += 7
1000  If (sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments == 1 || (global_pid = true, sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments == 1)) Then
1004  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
1005  If global_pid Then p = Must be called under rcu_read_lock().
1007  Else p = find_task_by_vpid(pid)
1009  If p Then domain = domain_info
1011  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1012  Else if Not strncmp(data, "domain=", 7) Then
1013  If tomoyo_domain_def(data + 7) Then domain = moyo_find_domain - Find a domain by the given name.*@domainname: The domainname to find.* Returns pointer to "struct tomoyo_domain_info" if found, NULL otherwise.* Caller holds tomoyo_read_lock().
1015  Else if sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments == 1 Then
1016  domain = tomoyo_find_domain_by_qid(pid)
1017  Else Return false
1019  The position currently writing to. = domain
1021  If Not Buffer for reading. Then Return true
1023  memset( & r, 0, size of r )
1024  print_this_domain_only = true
1025  If domain Then domain = list
1027  Else eof = 1
1029  moyo_io_printf - printf() to "struct tomoyo_io_buffer" structure.*@head: Pointer to "struct tomoyo_io_buffer".*@fmt: The printf()'s format string, followed by parameters.
1030  If domain && Delete flag. Then moyo_io_printf - printf() to "struct tomoyo_io_buffer" structure.*@head: Pointer to "struct tomoyo_io_buffer".*@fmt: The printf()'s format string, followed by parameters.
1032  Return true
Caller
NameDescribe
tomoyo_write_controlmoyo_write_control - write() for /sys/kernel/security/tomoyo/ interface.*@head: Pointer to "struct tomoyo_io_buffer".*@buffer: Pointer to buffer to read from.*@buffer_len: Size of @buffer.* Returns @buffer_len on success, negative value otherwise.