mount.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * AppArmor security module
  4. *
  5. * This file contains AppArmor file mediation function definitions.
  6. *
  7. * Copyright 2017 Canonical Ltd.
  8. */
  9. #ifndef __AA_MOUNT_H
  10. #define __AA_MOUNT_H
  11. #include <linux/fs.h>
  12. #include <linux/path.h>
  13. #include "domain.h"
  14. #include "policy.h"
  15. /* mount perms */
  16. #define AA_MAY_PIVOTROOT 0x01
  17. #define AA_MAY_MOUNT 0x02
  18. #define AA_MAY_UMOUNT 0x04
  19. #define AA_AUDIT_DATA 0x40
  20. #define AA_MNT_CONT_MATCH 0x40
  21. #define AA_MS_IGNORE_MASK (MS_KERNMOUNT | MS_NOSEC | MS_ACTIVE | MS_BORN)
  22. int aa_remount(const struct cred *subj_cred,
  23. struct aa_label *label, const struct path *path,
  24. unsigned long flags, void *data);
  25. int aa_bind_mount(const struct cred *subj_cred,
  26. struct aa_label *label, const struct path *path,
  27. const char *old_name, unsigned long flags);
  28. int aa_mount_change_type(const struct cred *subj_cred,
  29. struct aa_label *label, const struct path *path,
  30. unsigned long flags);
  31. int aa_move_mount_old(const struct cred *subj_cred,
  32. struct aa_label *label, const struct path *path,
  33. const char *old_name);
  34. int aa_move_mount(const struct cred *subj_cred,
  35. struct aa_label *label, const struct path *from_path,
  36. const struct path *to_path);
  37. int aa_new_mount(const struct cred *subj_cred,
  38. struct aa_label *label, const char *dev_name,
  39. const struct path *path, const char *type, unsigned long flags,
  40. void *data);
  41. int aa_umount(const struct cred *subj_cred,
  42. struct aa_label *label, struct vfsmount *mnt, int flags);
  43. int aa_pivotroot(const struct cred *subj_cred,
  44. struct aa_label *label, const struct path *old_path,
  45. const struct path *new_path);
  46. #endif /* __AA_MOUNT_H */