Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:ssize_t tomoyo_write_control(struct tomoyo_io_buffer *head, const char __user *buffer, const int buffer_len)

Type:ssize_t

Parameter:

TypeParameterName
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  If Not write Then Return -EINVAL
2665  If Not 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) Then Return -EFAULT
2667  If mutex_lock_interruptible( & Exclusive lock for this structure. ) Then Return -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  When avail_len > 0 cycle
2679  If Not cp Then
2680  error = -ENOMEM
2681  Break
2684  kfree(cp0)
2686  cp0 = cp
2690  error = -EFAULT
2691  Break
2693  buffer++
2694  avail_len--
2695  cp0[ Bytes available for writing. ++] = c
2696  If c != '\n' Then Continue
2698  cp0[ Bytes available for writing. - 1] = '\0'
2699  Bytes available for writing. = 0
2700  tomoyo_normalize_line(cp0)
2701  If Not strcmp(cp0, "reset") Then
2704  memset( & r, 0, size of r )
2705  Continue
2711  Break
2717  If Not strcmp(cp0, "select transition_only") Then
2719  Continue
2722  Default
2747  out :
2750  Return error
Caller
NameDescribe
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.