Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:selinux_add_mnt_opt

Proto:static int selinux_add_mnt_opt(const char *option, const char *val, int len, void **mnt_opts)

Type:int

Parameter:

TypeParameterName
const char *option
const char *val
intlen
void **mnt_opts
1041  token = Opt_error
1044  When i < ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(tokens) cycle
1045  If strcmp(option, name) == 0 Then
1046  token = opt
1047  Break
1051  If token == Opt_error Then Return -EINVAL
1054  If token != Opt_seclabel Then
1055  val = kmemdup_nul - Create a NUL-terminated string from unterminated data*@s: The data to stringify*@len: The size of the data*@gfp: the GFP mask used in the kmalloc() call when allocating memory* Return: newly allocated copy of @s with NUL-termination or %NULL
1056  If Not val Then
1057  rc = -ENOMEM
1058  Go to free_opt
1061  rc = selinux_add_opt(token, val, mnt_opts)
1062  If Value for the false possibility is greater at compile time(rc) Then
1063  kfree(val)
1064  Go to free_opt
1066  Return rc
1068  free_opt :
1069  If mnt_opts Then
1070  selinux_free_mnt_opts( * mnt_opts)
1071  * mnt_opts = NULL
1073  Return rc