mount.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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(struct aa_label *label, const struct path *path,
  23. unsigned long flags, void *data);
  24. int aa_bind_mount(struct aa_label *label, const struct path *path,
  25. const char *old_name, unsigned long flags);
  26. int aa_mount_change_type(struct aa_label *label, const struct path *path,
  27. unsigned long flags);
  28. int aa_move_mount(struct aa_label *label, const struct path *path,
  29. const char *old_name);
  30. int aa_new_mount(struct aa_label *label, const char *dev_name,
  31. const struct path *path, const char *type, unsigned long flags,
  32. void *data);
  33. int aa_umount(struct aa_label *label, struct vfsmount *mnt, int flags);
  34. int aa_pivotroot(struct aa_label *label, const struct path *old_path,
  35. const struct path *new_path);
  36. #endif /* __AA_MOUNT_H */