public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Zach Brown <zab@zabbo.net>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfs_repair: properly detect reserved attribute names
Date: Thu, 14 May 2015 10:22:10 -0400	[thread overview]
Message-ID: <20150514142210.GC23683@bfoster.bfoster> (raw)
In-Reply-To: <555416A6.4020401@redhat.com>

On Wed, May 13, 2015 at 10:29:42PM -0500, Eric Sandeen wrote:
> This function in xfs_repair tries to make sure that if an attr
> name reserved for acls exists in the root namespace, then its
> value is a valid acl.
> 
> However, because it only compares up to the length of the
> reserved name, superstrings may match and cause false positive
> xfs_repair errors.
> 
> Ensure that both the length and the content match before
> flagging it as an error.
> 
> Spotted-by: Zach Brown <zab@zabbo.net>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---

Looks good:

Reviewed-by: Brian Foster <bfoster@redhat.com>

So it looks like master doesn't have the sizeof(unsigned char *)
problem and the 4.1 update branch does, so we want to make sure that
kernel fix makes it into the latter...

> 
> diff --git a/repair/attr_repair.c b/repair/attr_repair.c
> index 27442c4..89a5bbf 100644
> --- a/repair/attr_repair.c
> +++ b/repair/attr_repair.c
> @@ -747,9 +747,10 @@ valuecheck(
>  	void *valuep;
>  	int clearit = 0;
>  
> -	if ((strncmp(namevalue, SGI_ACL_FILE, SGI_ACL_FILE_SIZE) == 0) ||
> -			(strncmp(namevalue, SGI_ACL_DEFAULT,
> -				SGI_ACL_DEFAULT_SIZE) == 0)) {
> +	if ((namelen == SGI_ACL_FILE_SIZE &&
> +	     strncmp(namevalue, SGI_ACL_FILE, SGI_ACL_FILE_SIZE) == 0) ||
> +	    (namelen == SGI_ACL_DEFAULT_SIZE &&
> +	     strncmp(namevalue, SGI_ACL_DEFAULT, SGI_ACL_DEFAULT_SIZE) == 0)) {
>  		if (value == NULL) {
>  			valuep = malloc(valuelen);
>  			if (!valuep)
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2015-05-14 14:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14  3:29 [PATCH] xfs_repair: properly detect reserved attribute names Eric Sandeen
2015-05-14 14:22 ` Brian Foster [this message]
2015-05-14 15:05   ` Eric Sandeen

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=20150514142210.GC23683@bfoster.bfoster \
    --to=bfoster@redhat.com \
    --cc=sandeen@redhat.com \
    --cc=xfs@oss.sgi.com \
    --cc=zab@zabbo.net \
    /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