Function report |
Source Code:security\tomoyo\common.c |
Create Date:2022-07-28 19:37:07 |
Last Modify:2020-03-18 09:15:18 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:moyo_open_control - open() for /sys/kernel/security/tomoyo/ interface.*@type: Type of interface.*@file: Pointer to "struct file".* Returns 0 on success, negative value otherwise.
Proto:int tomoyo_open_control(const u8 type, struct file *file)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
const u8 | type | |
struct file * | file |
2416 | head = 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). |
2421 | Type of this interface. = type |
2423 | Case type == TOMOYO_DOMAINPOLICY |
2425 | write = moyo_write_domain - Write domain policy.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock(). |
2426 | read = moyo_read_domain - Read domain policy.*@head: Pointer to "struct tomoyo_io_buffer".* Caller holds tomoyo_read_lock(). |
2427 | Break |
2428 | Case type == TOMOYO_EXCEPTIONPOLICY |
2430 | write = moyo_write_exception - Write exception policy.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock(). |
2431 | read = moyo_read_exception - Read exception policy.*@head: Pointer to "struct tomoyo_io_buffer".* Caller holds tomoyo_read_lock(). |
2432 | Break |
2433 | Case type == TOMOYO_AUDIT |
2435 | poll = moyo_poll_log - Wait for an audit log.*@file: Pointer to "struct file".*@wait: Pointer to "poll_table". Maybe NULL.* Returns EPOLLIN | EPOLLRDNORM when ready to read an audit log. |
2436 | read = moyo_read_log - Read an audit log.*@head: Pointer to "struct tomoyo_io_buffer".* Returns nothing. |
2437 | Break |
2438 | Case type == TOMOYO_PROCESS_STATUS |
2440 | write = moyo_write_pid: Specify PID to obtain domainname.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0. |
2442 | Break |
2443 | Case type == TOMOYO_VERSION |
2445 | read = moyo_read_version: Get version.*@head: Pointer to "struct tomoyo_io_buffer".* Returns version information. |
2446 | Size of read buffer. = 128 |
2447 | Break |
2448 | Case type == TOMOYO_STAT |
2450 | write = moyo_write_stat - Set memory quota.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0. |
2451 | read = moyo_read_stat - Read statistic data.*@head: Pointer to "struct tomoyo_io_buffer".* Returns nothing. |
2452 | Size of read buffer. = 1024 |
2453 | Break |
2454 | Case type == TOMOYO_PROFILE |
2456 | write = moyo_write_profile - Write profile table.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, negative value otherwise. |
2457 | read = moyo_read_profile - Read profile table.*@head: Pointer to "struct tomoyo_io_buffer".* Returns nothing. |
2458 | Break |
2459 | Case type == TOMOYO_QUERY |
2461 | write = moyo_write_answer - Write the supervisor's decision.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, -EINVAL otherwise. |
2462 | read = moyo_read_query - Read access requests which violated policy in enforcing mode.*@head: Pointer to "struct tomoyo_io_buffer". |
2463 | Break |
2464 | Case type == TOMOYO_MANAGER |
2466 | write = moyo_write_manager - Write manager policy.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock(). |
2467 | read = moyo_read_manager - Read manager policy.*@head: Pointer to "struct tomoyo_io_buffer".* Caller holds tomoyo_read_lock(). |
2468 | Break |
2470 | If Not (f_mode & le is open for reading ) Then |
2477 | Else if Not poll Then |
2479 | If Not Size of read buffer. Then Size of read buffer. = 4096 * 2 |
2481 | Buffer for reading. = 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). |
2482 | If Not Buffer for reading. Then |
2487 | If Not (f_mode & le is open for writing ) Then |
2492 | write = NULL |
2493 | Else if write Then |
2494 | Size of write buffer. = 4096 * 2 |
2495 | Buffer for writing. = 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). |
2496 | If Not Buffer for writing. Then |
2508 | If type == TOMOYO_QUERY Then atomic_inc( & Number of "struct file" referring /sys/kernel/security/tomoyo/query* interface.) |
2511 | tomoyo_notify_gc(head, true) |
2512 | Return 0 |
Name | Describe |
---|---|
tomoyo_open | moyo_open - open() for /sys/kernel/security/tomoyo/ interface.*@inode: Pointer to "struct inode".*@file: Pointer to "struct file".* Returns 0 on success, negative value otherwise. |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |