mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 00:14:44 +01:00
Allow make-* flags with remount operations
While the mount syscall documentation disallows this, the kernel silently ignores make-* flags when doing a remount, and real applications were passing this conflicting set of flags. Because changing the kernel to reject this combination would break userspace, we should allow them instead. For an example: see https://bugs.launchpad.net/apparmor/+bug/2091424. Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
This commit is contained in:
parent
6d7b5df947
commit
52babe8054
1 changed files with 7 additions and 1 deletions
|
@ -108,7 +108,13 @@
|
||||||
#define MS_MOVE_FLAGS (MS_MOVE)
|
#define MS_MOVE_FLAGS (MS_MOVE)
|
||||||
|
|
||||||
#define MS_CMDS (MS_MOVE | MS_REMOUNT | MS_BIND | MS_RBIND | MS_MAKE_CMDS)
|
#define MS_CMDS (MS_MOVE | MS_REMOUNT | MS_BIND | MS_RBIND | MS_MAKE_CMDS)
|
||||||
#define MS_REMOUNT_FLAGS (MS_ALL_FLAGS & ~(MS_CMDS & ~MS_REMOUNT & ~MS_BIND & ~MS_RBIND))
|
/*
|
||||||
|
* This allows MS_MAKE_CMDS, by design: while remount and make-* shouldn't be
|
||||||
|
* used together, real-world applications do use them together, and the Linux
|
||||||
|
* kernel ignores the make-* flags when doing a remount instead of returning
|
||||||
|
* EINVAL. See https://bugs.launchpad.net/apparmor/+bug/2091424 for an example.
|
||||||
|
*/
|
||||||
|
#define MS_REMOUNT_FLAGS (MS_ALL_FLAGS & ~MS_MOVE_FLAGS)
|
||||||
#define MS_NEW_FLAGS (MS_ALL_FLAGS & ~MS_CMDS)
|
#define MS_NEW_FLAGS (MS_ALL_FLAGS & ~MS_CMDS)
|
||||||
|
|
||||||
#define MNT_SRC_OPT 1
|
#define MNT_SRC_OPT 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue