Re: + move-magic-numbers-into-magich.patch added to -mm tree

From: Casey Schaufler
Date: Mon Jun 29 2009 - 21:31:43 EST


akpm@xxxxxxxxxxxxxxxxxxxx wrote:
> The patch titled
> Move magic numbers into magic.h
> has been added to the -mm tree. Its filename is
> move-magic-numbers-into-magich.patch
>
> Before you just go and hit "reply", please:
> a) Consider who else should be cc'ed
> b) Prefer to cc a suitable mailing list as well
> c) Ideally: find the original patch on the mailing list and do a
> reply-to-all to that, adding suitable additional cc's
>
> *** Remember to use Documentation/SubmitChecklist when testing your code ***
>
> See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
> out what to do about this
>
> The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
>
> ------------------------------------------------------
> Subject: Move magic numbers into magic.h
> From: Nick Black <dank@xxxxxxxxx>
>
> Move various magic-number definitions into magic.h.
>
> Signed-off-by: Nick Black <dank@xxxxxxxxx>
> Acked-by: Pekka Enberg <penberg@xxxxxxxxxxxxxx>
> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
> Cc: Casey Schaufler <casey@xxxxxxxxxxxxxxxx>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
>

Acked-by: Casey Schaufler <casey@xxxxxxxxxxxxxxxx>

Thank you.
> ---
>
> fs/devpts/inode.c | 3 +--
> include/linux/magic.h | 4 ++++
> net/socket.c | 3 +--
> security/smack/smack_lsm.c | 8 +-------
> 4 files changed, 7 insertions(+), 11 deletions(-)
>
> diff -puN fs/devpts/inode.c~move-magic-numbers-into-magich fs/devpts/inode.c
> --- a/fs/devpts/inode.c~move-magic-numbers-into-magich
> +++ a/fs/devpts/inode.c
> @@ -18,14 +18,13 @@
> #include <linux/mount.h>
> #include <linux/tty.h>
> #include <linux/mutex.h>
> +#include <linux/magic.h>
> #include <linux/idr.h>
> #include <linux/devpts_fs.h>
> #include <linux/parser.h>
> #include <linux/fsnotify.h>
> #include <linux/seq_file.h>
>
> -#define DEVPTS_SUPER_MAGIC 0x1cd1
> -
> #define DEVPTS_DEFAULT_MODE 0600
> /*
> * ptmx is a new node in /dev/pts and will be unused in legacy (single-
> diff -puN include/linux/magic.h~move-magic-numbers-into-magich include/linux/magic.h
> --- a/include/linux/magic.h~move-magic-numbers-into-magich
> +++ a/include/linux/magic.h
> @@ -53,4 +53,8 @@
> #define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA
>
> #define STACK_END_MAGIC 0x57AC6E9D
> +
> +#define DEVPTS_SUPER_MAGIC 0x1cd1
> +#define SOCKFS_MAGIC 0x534F434B
> +
> #endif /* __LINUX_MAGIC_H__ */
> diff -puN net/socket.c~move-magic-numbers-into-magich net/socket.c
> --- a/net/socket.c~move-magic-numbers-into-magich
> +++ a/net/socket.c
> @@ -86,6 +86,7 @@
> #include <linux/audit.h>
> #include <linux/wireless.h>
> #include <linux/nsproxy.h>
> +#include <linux/magic.h>
>
> #include <asm/uaccess.h>
> #include <asm/unistd.h>
> @@ -235,8 +236,6 @@ int move_addr_to_user(struct sockaddr *k
> return __put_user(klen, ulen);
> }
>
> -#define SOCKFS_MAGIC 0x534F434B
> -
> static struct kmem_cache *sock_inode_cachep __read_mostly;
>
> static struct inode *sock_alloc_inode(struct super_block *sb)
> diff -puN security/smack/smack_lsm.c~move-magic-numbers-into-magich security/smack/smack_lsm.c
> --- a/security/smack/smack_lsm.c~move-magic-numbers-into-magich
> +++ a/security/smack/smack_lsm.c
> @@ -30,17 +30,11 @@
> #include <net/netlabel.h>
> #include <net/cipso_ipv4.h>
> #include <linux/audit.h>
> +#include <linux/magic.h>
> #include "smack.h"
>
> #define task_security(task) (task_cred_xxx((task), security))
>
> -/*
> - * I hope these are the hokeyist lines of code in the module. Casey.
> - */
> -#define DEVPTS_SUPER_MAGIC 0x1cd1
> -#define SOCKFS_MAGIC 0x534F434B
> -#define TMPFS_MAGIC 0x01021994
> -
> /**
> * smk_fetch - Fetch the smack label from a file.
> * @ip: a pointer to the inode
> _
>
> Patches currently in -mm which might be from dank@xxxxxxxxx are
>
> move-magic-numbers-into-magich.patch
>
> --
> To unsubscribe from this list: send the line "unsubscribe mm-commits" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/