lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090629130934.GA835@qemfd.net>
Date:	Mon, 29 Jun 2009 09:09:34 -0400
From:	nick black <dank@...fd.net>
To:	Pekka Enberg <penberg@...helsinki.fi>
Cc:	William Irwin <wli@...omorphy.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	man-pages <mtk.manpages@...il.com>, linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	casey@...aufler-ca.com, jmorris@...ei.org
Subject: Re: [PATCH] hugetlbfs: publish HUGETLBFS_MAGIC via linux/magic.h

nick black left as an exercise for the reader:
> Pekka Enberg left as an exercise for the reader:
> > Hi Nick,
> > This looks good to me as well but it should be a separate patch as the
> > change has nothing to do with hugetlbfs. While at it, you should
> > probably move SOCKFS_MAGIC and DEVPTS_SUPER_MAGIC to <linux/magic.h>
> > and remove the definitions from smack.
> 
> Thanks for the review, Pekka, and I couldn't agree more. Here's a second
> version of the patch, a rather more equal-opportunity unification
> of magic numbers (I'll resend with a new Subject if that's preferred):

Ahh, I realize you want two patches. Here's the minimal hugetlbfs patch;
I'll send the magic number unification as another thread. My worry there is
whether SOCKFS_MAGIC and DEVPTS_SUPER_MAGIC ought be exposed to userspace --
[f]statfs(2)'s manpage makes it clear that HUGETLBFS_MAGIC is to be visible.

[f]statfs(2) *does* refer to DEVFS_SUPER_MAGIC, which doesn't exist anywhere
in the 2.6.31-rc1 tree. A typo, or legacy cruft from the devfs of yesteryear?
Either way, that doesn't answer whether SOCKFS_ ought be exported.

Thanks very much for the feedback!

Signed-off-by: Nick Black <dank@...fd.net>
diff -uprN -X linux-2.6.31-rc1-pristine/Documentation/dontdiff linux-2.6.31-rc1-pristine/fs/hugetlbfs/inode.c linux-2.6.31-rc1/fs/hugetlbfs/inode.c
--- linux-2.6.31-rc1-pristine/fs/hugetlbfs/inode.c	2009-06-24 19:25:37.000000000 -0400
+++ linux-2.6.31-rc1/fs/hugetlbfs/inode.c	2009-06-29 07:52:43.000000000 -0400
@@ -31,12 +31,10 @@
 #include <linux/statfs.h>
 #include <linux/security.h>
 #include <linux/ima.h>
+#include <linux/magic.h>
 
 #include <asm/uaccess.h>
 
-/* some random number */
-#define HUGETLBFS_MAGIC	0x958458f6
-
 static const struct super_operations hugetlbfs_ops;
 static const struct address_space_operations hugetlbfs_aops;
 const struct file_operations hugetlbfs_file_operations;
diff -uprN -X linux-2.6.31-rc1-pristine/Documentation/dontdiff linux-2.6.31-rc1-pristine/include/linux/magic.h linux-2.6.31-rc1/include/linux/magic.h
--- linux-2.6.31-rc1-pristine/include/linux/magic.h	2009-06-24 19:25:37.000000000 -0400
+++ linux-2.6.31-rc1/include/linux/magic.h	2009-06-29 08:55:57.000000000 -0400
@@ -13,6 +13,7 @@
 #define SECURITYFS_MAGIC	0x73636673
 #define SELINUX_MAGIC		0xf97cff8c
 #define TMPFS_MAGIC		0x01021994
+#define HUGETLBFS_MAGIC 	0x958458f6	/* some random number */
 #define SQUASHFS_MAGIC		0x73717368
 #define EFS_SUPER_MAGIC		0x414A53
 #define EXT2_SUPER_MAGIC	0xEF53

-- 
                                      Nick Black <dankamongmen@....org>
                                             Principal Engineer, McAfee
                                  Grad student, GT College of Computing
                    "np: the class of dashed hopes, and idle dreams..."

Download attachment "signature.asc" of type "application/pgp-signature" (198 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ