lkml.org 
[lkml]   [2013]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[ 30/38] ext4: fix data offset overflow on 32-bit archs in ext4_inline_data_fiemap()
    Date
    3.9-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Jan Kara <jack@suse.cz>

    commit eaf3793728d07d995f1e74250b2d0005f7ae98b5 upstream.

    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>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    fs/ext4/inline.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/fs/ext4/inline.c
    +++ b/fs/ext4/inline.c
    @@ -1702,7 +1702,7 @@ int ext4_inline_data_fiemap(struct 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);



    \
     
     \ /
      Last update: 2013-07-19 08:42    [W:4.336 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site