linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <clm@fb.com>
To: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: <linux-btrfs@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Mark Fasheh <mfasheh@suse.de>, David Sterba <dsterba@suse.cz>
Subject: Re: [PATCH] Btrfs:__add_inode_ref: out of bounds memory read when looking for extended ref.
Date: Tue, 3 Mar 2015 10:35:53 -0500	[thread overview]
Message-ID: <1425396953.29552.3@mail.thefacebook.com> (raw)
In-Reply-To: <1425396698-31009-1-git-send-email-quentin.casasnovas@oracle.com>



On Tue, Mar 3, 2015 at 10:31 AM, Quentin Casasnovas 
<quentin.casasnovas@oracle.com> wrote:
> Improper arithmetics when calculting the address of the extended ref 
> could
> lead to an out of bounds memory read and kernel panic.
> 
> Signed-off-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>
> ---
>  fs/btrfs/tree-log.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git fs/btrfs/tree-log.c fs/btrfs/tree-log.c
> index 9a37f8b..c5b8ba3 100644
> --- fs/btrfs/tree-log.c
> +++ fs/btrfs/tree-log.c
> @@ -1012,7 +1012,7 @@ again:
>  		base = btrfs_item_ptr_offset(leaf, path->slots[0]);
> 
>  		while (cur_offset < item_size) {
> -			extref = (struct btrfs_inode_extref *)base + cur_offset;
> +			extref = (struct btrfs_inode_extref *)(base + cur_offset);
> 
>  			victim_name_len = btrfs_inode_extref_name_len(leaf, extref);
> 

Thanks, this goes back to 3.7+ (Mark's original extref code).  I'll tag 
for stable and add Dave's reviewed by:

Reviewed-by: David Sterba <dsterba@suse.cz>

-chris




      reply	other threads:[~2015-03-03 15:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1424966437-29795-1-git-send-email-quentin.casasnovas@oracle.com>
2015-03-03 14:38 ` [PATCH] Btrfs:__add_inode_ref: out of bounds memory read when looking for extended ref David Sterba
2015-03-03 15:23   ` Chris Mason
2015-03-03 15:31     ` Quentin Casasnovas
2015-03-03 15:35       ` Chris Mason [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=1425396953.29552.3@mail.thefacebook.com \
    --to=clm@fb.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfasheh@suse.de \
    --cc=quentin.casasnovas@oracle.com \
    /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).