Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:selinux_add_opt

Proto:static int selinux_add_opt(int token, const char *s, void **mnt_opts)

Type:int

Parameter:

TypeParameterName
inttoken
const char *s
void **mnt_opts
997  opts = mnt_opts
999  If token == Opt_seclabel Then Return 0
1002  If Not opts Then
1003  opts = 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).
1004  If Not opts Then Return -ENOMEM
1006  mnt_opts = opts
1008  If Not s Then Return -ENOMEM
1011  Case token == Opt_context
1012  If context || defcontext Then Go to Einval
1014  context = s
1015  Break
1016  Case token == Opt_fscontext
1017  If fscontext Then Go to Einval
1019  fscontext = s
1020  Break
1021  Case token == Opt_rootcontext
1022  If rootcontext Then Go to Einval
1024  rootcontext = s
1025  Break
1026  Case token == Opt_defcontext
1027  If context || defcontext Then Go to Einval
1029  defcontext = s
1030  Break
1032  Return 0
1033  Einval :
1034  pr_warn(SEL_MOUNT_FAIL_MSG)
1035  Return -EINVAL
Caller
NameDescribe
selinux_add_mnt_opt
selinux_sb_eat_lsm_opts
selinux_fs_context_parse_param