linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: stable@vger.kernel.org
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>,
	Jan Kara <jack@suse.cz>, Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH 1/4] ext4: fix data offset overflow on 32-bit archs in ext4_inline_data_fiemap()
Date: Tue,  9 Jul 2013 10:39:29 -0400	[thread overview]
Message-ID: <1373380772-16803-1-git-send-email-tytso@mit.edu> (raw)
In-Reply-To: <20130709143855.GF6000@thunk.org>

From: Jan Kara <jack@suse.cz>

On 32-bit archs when sector_t is defined as 32-bit the logic computing
data offset in ext4_inline_data_fiemap(). Fix that by properly typing
the shifted value.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 fs/ext4/inline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index 3e2bf87..33331b4 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -1842,7 +1842,7 @@ int ext4_inline_data_fiemap(struct inode *inode,
 	if (error)
 		goto out;
 
-	physical = iloc.bh->b_blocknr << inode->i_sb->s_blocksize_bits;
+	physical = (__u64)iloc.bh->b_blocknr << inode->i_sb->s_blocksize_bits;
 	physical += (char *)ext4_raw_inode(&iloc) - iloc.bh->b_data;
 	physical += offsetof(struct ext4_inode, i_block);
 	length = i_size_read(inode);
-- 
1.7.12.rc0.22.gcdd159b


  reply	other threads:[~2013-07-09 14:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-29 12:05 [PATCH 0/4] ext4: Fix overflows in ext4 code Jan Kara
2013-05-29 12:05 ` [PATCH 1/4] ext4: Fix data offset overflow on 32-bit archs in ext4_inline_data_fiemap() Jan Kara
2013-05-29 12:05 ` [PATCH 2/4] ext4: Fix overflows in SEEK_HOLE, SEEK_DATA implementations Jan Kara
2013-05-29 13:51   ` Zheng Liu
2013-05-29 12:05 ` [PATCH 3/4] ext4: Fix data offset overflow in ext4_xattr_fiemap() on 32-bit archs Jan Kara
2013-05-29 12:05 ` [PATCH 4/4] ext4: Fix overflow when counting used blocks on 32-bit architectures Jan Kara
2013-05-31 23:42   ` Theodore Ts'o
2013-07-09 14:14 ` [PATCH 0/4] ext4: Fix overflows in ext4 code Eric Sandeen
2013-07-09 14:38   ` Theodore Ts'o
2013-07-09 14:39     ` Theodore Ts'o [this message]
2013-07-09 14:39       ` [PATCH 2/4] ext4: fix overflows in SEEK_HOLE, SEEK_DATA implementations Theodore Ts'o
2013-07-09 14:39       ` [PATCH 3/4] ext4: fix data offset overflow in ext4_xattr_fiemap() on 32-bit archs Theodore Ts'o
2013-07-09 14:39       ` [PATCH 4/4] ext4: fix overflow when counting used blocks on 32-bit architectures Theodore Ts'o
2013-07-09 15:00     ` [PATCH 0/4] ext4: Fix overflows in ext4 code Eric Sandeen
2013-07-10 15:40     ` Luis Henriques
2013-07-12 13:15     ` Josh Boyer
2013-07-12 14:50       ` Greg KH
2013-07-24  4:46     ` Ben Hutchings

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=1373380772-16803-1-git-send-email-tytso@mit.edu \
    --to=tytso@mit.edu \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=stable@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;
as well as URLs for NNTP newsgroup(s).