Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:aa_pivotroot

Proto:int aa_pivotroot(struct aa_label *label, const struct path *old_path, const struct path *new_path)

Type:int

Parameter:

TypeParameterName
struct aa_label *label
const struct path *old_path
const struct path *new_path
694  struct aa_label * target = NULL
695  char * old_buffer = NULL, * new_buffer = NULL, * info = NULL
698  AA_BUG(!label)
699  AA_BUG(!old_path)
700  AA_BUG(!new_path)
702  old_buffer = aa_get_buffer(false)
703  new_buffer = aa_get_buffer(false)
704  error = -ENOMEM
705  If Not old_buffer || Not new_buffer Then Go to out
707  target = _label_build - abstract out the build of a label transition*@L: label the transition is being computed for*@P: profile parameter derived from L by this macro, can be passed to FN*@GFP: memory allocation type to use(label, profile, GFP_KERNEL, helper fn for transition on pivotroot* Returns: label for transition or ERR_PTR. Does not return NULL)
710  If Not target Then
711  info = "label build failed"
712  error = -ENOMEM
713  Go to fail
714  Else if Not IS_ERR(target) Then
715  error = aa_replace_current_label - replace the current tasks label*@label: new label (NOT NULL)* Returns: 0 or error on failure
716  If error Then
719  Go to out
721  Else error = PTR_ERR(target)
724  out :
725  aa_put_buffer(old_buffer)
726  aa_put_buffer(new_buffer)
728  Return error
730  fail :
732  error = fn_for_each(label, profile, audit_mount - handle the auditing of mount operations*@profile: the profile being enforced (NOT NULL)*@op: operation being mediated (NOT NULL)*@name: name of object being mediated (MAYBE NULL)*@src_name: src_name of object being mediated )
738  Go to out
Caller
NameDescribe
apparmor_sb_pivotroot