linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Andreas Dilger <adilger@clusterfs.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>,
	linux-ext4@vger.kernel.org, Jim Garlick <garlick@llnl.gov>
Subject: Re: [PATCH] added sanity check for xattr validation
Date: Thu, 21 Jun 2007 15:50:37 -0500	[thread overview]
Message-ID: <467AE49D.6030207@redhat.com> (raw)
In-Reply-To: <20070226223322.GA30215@schatzie.adilger.int>

Andreas Dilger wrote:
> Ted,
> the attached patch adds an extra validity test in check_ext_attr().  If
> an attribute's e_value_size is zero the current code does not allocate
> a region for it and as a result the e_value_offs value is not verified.
> However, if e_value_offs is very large then the later call to
> ext2fs_ext_attr_hash_entry() can dereference bad memory and crash e2fsck.

Did this patch get lost?  Don't see it in Hg...

Thanks,
-Eric

> Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
> Signed-off-by: Jim Garlick <garlick@llnl.gov>
> 
> =========================== e_value_offs.patch ============================
> 
> Index: e2fsprogs-1.39/e2fsck/pass1.c
> ===================================================================
> --- e2fsprogs-1.39.orig/e2fsck/pass1.c	2007-02-10 15:43:36.000000000 +0530
> +++ e2fsprogs-1.39/e2fsck/pass1.c	2007-02-10 15:45:36.000000000 +0530
> @@ -1346,6 +1347,11 @@
>  			if (fix_problem(ctx, PR_1_EA_BAD_VALUE, pctx))
>  				goto clear_extattr;
>  		}
> +		if (entry->e_value_offs + entry->e_value_size > fs->blocksize) {
> +			if (fix_problem(ctx, PR_1_EA_BAD_VALUE, pctx))
> +				goto clear_extattr;
> +			break;
> +		}
>  		if (entry->e_value_size &&
>  		    region_allocate(region, entry->e_value_offs,
>  				    EXT2_EXT_ATTR_SIZE(entry->e_value_size))) {
> =========================== e_value_offs.patch ============================
> 
> Cheers, Andreas
> --
> Andreas Dilger
> Principal Software Engineer
> Cluster File Systems, Inc.
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2007-06-21 20:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-26 22:33 [PATCH] added sanity check for xattr validation Andreas Dilger
2007-06-21 20:50 ` Eric Sandeen [this message]
2007-06-22  6:23   ` Theodore Tso

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=467AE49D.6030207@redhat.com \
    --to=sandeen@redhat.com \
    --cc=adilger@clusterfs.com \
    --cc=garlick@llnl.gov \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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;
as well as URLs for NNTP newsgroup(s).