18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * AppArmor security module
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * This file contains AppArmor file mediation function definitions.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright 2017 Canonical Ltd.
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef __AA_MOUNT_H
118c2ecf20Sopenharmony_ci#define __AA_MOUNT_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <linux/fs.h>
148c2ecf20Sopenharmony_ci#include <linux/path.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#include "domain.h"
178c2ecf20Sopenharmony_ci#include "policy.h"
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci/* mount perms */
208c2ecf20Sopenharmony_ci#define AA_MAY_PIVOTROOT	0x01
218c2ecf20Sopenharmony_ci#define AA_MAY_MOUNT		0x02
228c2ecf20Sopenharmony_ci#define AA_MAY_UMOUNT		0x04
238c2ecf20Sopenharmony_ci#define AA_AUDIT_DATA		0x40
248c2ecf20Sopenharmony_ci#define AA_MNT_CONT_MATCH	0x40
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#define AA_MS_IGNORE_MASK (MS_KERNMOUNT | MS_NOSEC | MS_ACTIVE | MS_BORN)
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ciint aa_remount(struct aa_label *label, const struct path *path,
298c2ecf20Sopenharmony_ci	       unsigned long flags, void *data);
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ciint aa_bind_mount(struct aa_label *label, const struct path *path,
328c2ecf20Sopenharmony_ci		  const char *old_name, unsigned long flags);
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ciint aa_mount_change_type(struct aa_label *label, const struct path *path,
368c2ecf20Sopenharmony_ci			 unsigned long flags);
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ciint aa_move_mount(struct aa_label *label, const struct path *path,
398c2ecf20Sopenharmony_ci		  const char *old_name);
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ciint aa_new_mount(struct aa_label *label, const char *dev_name,
428c2ecf20Sopenharmony_ci		 const struct path *path, const char *type, unsigned long flags,
438c2ecf20Sopenharmony_ci		 void *data);
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ciint aa_umount(struct aa_label *label, struct vfsmount *mnt, int flags);
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ciint aa_pivotroot(struct aa_label *label, const struct path *old_path,
488c2ecf20Sopenharmony_ci		 const struct path *new_path);
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#endif /* __AA_MOUNT_H */
51