public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.vnet.ibm.com>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs <linux-xfs@vger.kernel.org>,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH] xfs: include the XFS magic number in magic.h
Date: Tue, 12 Dec 2017 18:35:34 -0500	[thread overview]
Message-ID: <1513121734.3476.79.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <20171212211302.GW5858@dastard>

Hi Dave,

On Wed, 2017-12-13 at 08:13 +1100, Dave Chinner wrote:
> On Tue, Dec 12, 2017 at 09:21:09AM -0500, Mimi Zohar wrote:
> > Move the XFS_SB_MAGIC definition to magic.h.
> > 
> > Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
> > ---
> >  fs/xfs/libxfs/xfs_format.h | 3 ++-
> >  include/uapi/linux/magic.h | 1 +
> >  2 files changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
> > index 1acb584fc5f7..05f7d83e5f88 100644
> > --- a/fs/xfs/libxfs/xfs_format.h
> > +++ b/fs/xfs/libxfs/xfs_format.h
> > @@ -18,6 +18,8 @@
> >  #ifndef __XFS_FORMAT_H__
> >  #define __XFS_FORMAT_H__
> >  
> > +#include <linux/magic.h>
> > +
> >  /*
> >   * XFS On Disk Format Definitions
> >   *
> > @@ -38,7 +40,6 @@ struct xfs_ifork;
> >   * Fits into a sector-sized buffer at address 0 of each allocation group.
> >   * Only the first of these is ever updated except during growfs.
> >   */
> > -#define	XFS_SB_MAGIC		0x58465342	/* 'XFSB' */
> >  #define	XFS_SB_VERSION_1	1		/* 5.3, 6.0.1, 6.1 */
> >  #define	XFS_SB_VERSION_2	2		/* 6.2 - attributes */
> >  #define	XFS_SB_VERSION_3	3		/* 6.2 - new inode version */
> 
> NAK.
> 
> The XFS superblock magic number is part of the on-disk format
> definition of XFS. It belongs with all the other on-disk format
> definitions in this file.
> 
> Besides, there is almost never a good reason to be doing stuff based
> on filesystem magic numbers. What, exactly, do you need to know
> filesystem magic numbers for in the kernel?

IMA measures, appraises, and audits files based on policy.  The
builtin in measurement and appraisal policies can be defined on the
boot command line (eg. ima_policy=tcb|appraise_tcb|secure_boot).
 These initial builtin policies are course grain. 

After the LSMs are enabled, the IMA policy can be defined in terms of
the LSM labels and other file metadata (eg. UUID, uid, euid, fsmagic,
...).  Normally the builtin policies are subsequently replaced with a
custom policy in the initramfs.

Mimi


      reply	other threads:[~2017-12-12 23:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12 14:21 [PATCH] xfs: include the XFS magic number in magic.h Mimi Zohar
2017-12-12 14:26 ` Christoph Hellwig
2017-12-12 14:34   ` Mimi Zohar
2017-12-12 14:36     ` Christoph Hellwig
2017-12-12 15:04       ` Mimi Zohar
2017-12-12 23:30         ` Dave Chinner
2017-12-12 23:55           ` Mimi Zohar
2017-12-13  0:13             ` Dave Chinner
2017-12-13  1:21               ` Mimi Zohar
2017-12-13  2:59                 ` Dave Chinner
2017-12-13  8:43                   ` Christoph Hellwig
2017-12-13 14:04                   ` Mimi Zohar
2017-12-12 21:13 ` Dave Chinner
2017-12-12 23:35   ` Mimi Zohar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1513121734.3476.79.camel@linux.vnet.ibm.com \
    --to=zohar@linux.vnet.ibm.com \
    --cc=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox