Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * AppArmor security module
0004  *
0005  * This file contains AppArmor file mediation function definitions.
0006  *
0007  * Copyright 2017 Canonical Ltd.
0008  */
0009 
0010 #ifndef __AA_MOUNT_H
0011 #define __AA_MOUNT_H
0012 
0013 #include <linux/fs.h>
0014 #include <linux/path.h>
0015 
0016 #include "domain.h"
0017 #include "policy.h"
0018 
0019 /* mount perms */
0020 #define AA_MAY_PIVOTROOT    0x01
0021 #define AA_MAY_MOUNT        0x02
0022 #define AA_MAY_UMOUNT       0x04
0023 #define AA_AUDIT_DATA       0x40
0024 #define AA_MNT_CONT_MATCH   0x40
0025 
0026 #define AA_MS_IGNORE_MASK (MS_KERNMOUNT | MS_NOSEC | MS_ACTIVE | MS_BORN)
0027 
0028 int aa_remount(struct aa_label *label, const struct path *path,
0029            unsigned long flags, void *data);
0030 
0031 int aa_bind_mount(struct aa_label *label, const struct path *path,
0032           const char *old_name, unsigned long flags);
0033 
0034 
0035 int aa_mount_change_type(struct aa_label *label, const struct path *path,
0036              unsigned long flags);
0037 
0038 int aa_move_mount(struct aa_label *label, const struct path *path,
0039           const char *old_name);
0040 
0041 int aa_new_mount(struct aa_label *label, const char *dev_name,
0042          const struct path *path, const char *type, unsigned long flags,
0043          void *data);
0044 
0045 int aa_umount(struct aa_label *label, struct vfsmount *mnt, int flags);
0046 
0047 int aa_pivotroot(struct aa_label *label, const struct path *old_path,
0048          const struct path *new_path);
0049 
0050 #endif /* __AA_MOUNT_H */