mount.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * AppArmor security module
  3. *
  4. * This file contains AppArmor file mediation function definitions.
  5. *
  6. * Copyright 2017 Canonical Ltd.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation, version 2 of the
  11. * License.
  12. */
  13. #ifndef __AA_MOUNT_H
  14. #define __AA_MOUNT_H
  15. #include <linux/fs.h>
  16. #include <linux/path.h>
  17. #include "domain.h"
  18. #include "policy.h"
  19. /* mount perms */
  20. #define AA_MAY_PIVOTROOT 0x01
  21. #define AA_MAY_MOUNT 0x02
  22. #define AA_MAY_UMOUNT 0x04
  23. #define AA_AUDIT_DATA 0x40
  24. #define AA_MNT_CONT_MATCH 0x40
  25. #define AA_MS_IGNORE_MASK (MS_KERNMOUNT | MS_NOSEC | MS_ACTIVE | MS_BORN)
  26. int aa_remount(struct aa_label *label, const struct path *path,
  27. unsigned long flags, void *data);
  28. int aa_bind_mount(struct aa_label *label, const struct path *path,
  29. const char *old_name, unsigned long flags);
  30. int aa_mount_change_type(struct aa_label *label, const struct path *path,
  31. unsigned long flags);
  32. int aa_move_mount(struct aa_label *label, const struct path *path,
  33. const char *old_name);
  34. int aa_new_mount(struct aa_label *label, const char *dev_name,
  35. const struct path *path, const char *type, unsigned long flags,
  36. void *data);
  37. int aa_umount(struct aa_label *label, struct vfsmount *mnt, int flags);
  38. int aa_pivotroot(struct aa_label *label, const struct path *old_path,
  39. const struct path *new_path);
  40. #endif /* __AA_MOUNT_H */