函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:ssize_t tomoyo_write_control(struct tomoyo_io_buffer *head, const char __user *buffer, const int buffer_len)

返回类型:ssize_t

参数:

类型参数名称
struct tomoyo_io_buffer *head
const char __user *buffer
const intbuffer_len
2658  error等于buffer_len
2659  avail_len等于buffer_len
2660  cp0等于Buffer for writing.
2663  如果非write则返回:负EINVAL
2665  如果非access_ok - Checks if a user space pointer is valid*@addr: User space pointer to start of block to check*@size: Size of block to check* Context: User context only. This function may sleep if pagefaults are* enabled.(buffer, buffer_len)则返回:负EFAULT
2667  如果mutex_lock_interruptible( & Exclusive lock for this structure. )则返回:负EINTR
2669  read_user_buf_avail等于0
2670  idx等于moyo_read_lock - Take lock for protecting policy.* Returns index number for tomoyo_read_unlock().
2672 avail_len大于0循环
2676  len等于Size of write buffer. 乘2
2679  如果非cp
2680  error等于负ENOMEM
2681  退出
2684  释放内存
2685  Buffer for writing. 等于cp
2686  cp0等于cp
2690  error等于负EFAULT
2691  退出
2693  buffer自加
2694  avail_len自减
2695  cp0[ Bytes available for writing. ++]等于c
2696  如果c不等于'\n'则继续下一循环
2698  cp0[ Bytes available for writing. - 1]等于'\0'
2699  Bytes available for writing. 等于0
2700  tomoyo_normalize_line(cp0)
2701  如果非字符串比较
2704  memset( & r, 0, r的长度)
2705  继续下一循环
2711  退出
2717  如果非字符串比较
2719  继续下一循环
2722  默认
2747  out :
2750  返回:error
调用者
名称描述
tomoyo_writemoyo_write - write() for /sys/kernel/security/tomoyo/ interface.*@file: Pointer to "struct file".*@buf: Pointer to buffer.*@count: Size of @buf.*@ppos: Unused.* Returns @count on success, negative value otherwise.