Commit 92562927826fceb2f8e69c89e28161b8c1e0b125

Authored by Mimi Zohar
Committed by James Morris
1 parent 93db628658

integrity: special fs magic

Discussion on the mailing list questioned the use of these
magic values in userspace, concluding these values are already
exported to userspace via statfs and their correct/incorrect
usage is left up to the userspace application.

  - Move special fs magic number definitions to magic.h
  - Add magic.h include

Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Reviewed-by: James Morris <jmorris@namei.org>
Signed-off-by: James Morris <jmorris@namei.org>

Showing 4 changed files with 7 additions and 7 deletions Side-by-side Diff

... ... @@ -26,8 +26,7 @@
26 26 #include <linux/debugfs.h>
27 27 #include <linux/fsnotify.h>
28 28 #include <linux/string.h>
29   -
30   -#define DEBUGFS_MAGIC 0x64626720
  29 +#include <linux/magic.h>
31 30  
32 31 static struct vfsmount *debugfs_mount;
33 32 static int debugfs_mount_count;
include/linux/magic.h
... ... @@ -6,6 +6,10 @@
6 6 #define AFS_SUPER_MAGIC 0x5346414F
7 7 #define AUTOFS_SUPER_MAGIC 0x0187
8 8 #define CODA_SUPER_MAGIC 0x73757245
  9 +#define DEBUGFS_MAGIC 0x64626720
  10 +#define SYSFS_MAGIC 0x62656572
  11 +#define SECURITYFS_MAGIC 0x73636673
  12 +#define TMPFS_MAGIC 0x01021994
9 13 #define EFS_SUPER_MAGIC 0x414A53
10 14 #define EXT2_SUPER_MAGIC 0xEF53
11 15 #define EXT3_SUPER_MAGIC 0xEF53
... ... @@ -50,13 +50,11 @@
50 50 #include <linux/migrate.h>
51 51 #include <linux/highmem.h>
52 52 #include <linux/seq_file.h>
  53 +#include <linux/magic.h>
53 54  
54 55 #include <asm/uaccess.h>
55 56 #include <asm/div64.h>
56 57 #include <asm/pgtable.h>
57   -
58   -/* This magic number is used in glibc for posix shared memory */
59   -#define TMPFS_MAGIC 0x01021994
60 58  
61 59 #define ENTRIES_PER_PAGE (PAGE_CACHE_SIZE/sizeof(unsigned long))
62 60 #define ENTRIES_PER_PAGEPAGE (ENTRIES_PER_PAGE*ENTRIES_PER_PAGE)
... ... @@ -20,8 +20,7 @@
20 20 #include <linux/init.h>
21 21 #include <linux/namei.h>
22 22 #include <linux/security.h>
23   -
24   -#define SECURITYFS_MAGIC 0x73636673
  23 +#include <linux/magic.h>
25 24  
26 25 static struct vfsmount *mount;
27 26 static int mount_count;