Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:smk_write_ptrace - write() for /smack/ptrace*@file: file pointer*@buf: data from user space*@count: bytes sent*@ppos: where to start - must be 0

Proto:static ssize_t smk_write_ptrace(struct file *file, const char __user *buf, size_t count, loff_t *ppos)

Type:ssize_t

Parameter:

TypeParameterName
struct file *file
const char __user *buf
size_tcount
loff_t *ppos
2791  If Not smack_privileged - are all privilege requirements met*@cap: The requested capability* Is the task privileged and allowed to be privileged* by the onlycap rule.* Returns true if the task is allowed to be privileged, false if it's not. Then Return -EPERM
2794  If ppos != 0 || count >= size of temp || count == 0 Then Return -EINVAL
2797  If copy_from_user(temp, buf, count) != 0 Then Return -EFAULT
2800  temp[count] = '\0'
2802  If sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments != 1 Then Return -EINVAL
2804  If i < Ptrace rules || i > SMACK_PTRACE_MAX Then Return -EINVAL
2806  Ptrace current rule* SMACK_PTRACE_DEFAULT regular smack ptrace rules (/proc based)* SMACK_PTRACE_EXACT labels must match, but can be overriden with* CAP_SYS_PTRACE* SMACK_PTRACE_DRACONIAN lables must match, CAP_SYS_PTRACE has no effect = i
2808  Return count