11 Jan, 2012

2 commits

  • Conflicts:
    fs/ext4/ioctl.c

    Theodore Ts'o
     
  • Commit 503358ae01b70ce6909d19dd01287093f6b6271c ("ext4: avoid divide by
    zero when trying to mount a corrupted file system") fixes CVE-2009-4307
    by performing a sanity check on s_log_groups_per_flex, since it can be
    set to a bogus value by an attacker.

    sbi->s_log_groups_per_flex = sbi->s_es->s_log_groups_per_flex;
    groups_per_flex = 1 << sbi->s_log_groups_per_flex;

    if (groups_per_flex < 2) { ... }

    This patch fixes two potential issues in the previous commit.

    1) The sanity check might only work on architectures like PowerPC.
    On x86, 5 bits are used for the shifting amount. That means, given a
    large s_log_groups_per_flex value like 36, groups_per_flex = 1 << 36
    is essentially 1 << 4 = 16, rather than 0. This will bypass the check,
    leaving s_log_groups_per_flex and groups_per_flex inconsistent.

    2) The sanity check relies on undefined behavior, i.e., oversized shift.
    A standard-confirming C compiler could rewrite the check in unexpected
    ways. Consider the following equivalent form, assuming groups_per_flex
    is unsigned for simplicity.

    groups_per_flex = 1 << sbi->s_log_groups_per_flex;
    if (groups_per_flex == 0 || groups_per_flex == 1) {

    We compile the code snippet using Clang 3.0 and GCC 4.6. Clang will
    completely optimize away the check groups_per_flex == 0, leaving the
    patched code as vulnerable as the original. GCC keeps the check, but
    there is no guarantee that future versions will do the same.

    Signed-off-by: Xi Wang
    Signed-off-by: "Theodore Ts'o"
    Cc: stable@vger.kernel.org

    Xi Wang
     

10 Jan, 2012

3 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    vfs: new helper - d_make_root()
    dcache: use a dispose list in select_parent
    ceph: d_alloc_root() may fail
    ext4: fix failure exits
    isofs: inode leak on mount failure

    Linus Torvalds
     
  • a) leaking root dentry is bad
    b) in case of failed ext4_mb_init() we don't want to do ext4_mb_release()
    c) OTOH, in the same case we *do* want ext4_ext_release()

    Signed-off-by: Al Viro

    Al Viro
     
  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    ext2/3/4: delete unneeded includes of module.h
    ext{3,4}: Fix potential race when setversion ioctl updates inode
    udf: Mark LVID buffer as uptodate before marking it dirty
    ext3: Don't warn from writepage when readonly inode is spotted after error
    jbd: Remove j_barrier mutex
    reiserfs: Force inode evictions before umount to avoid crash
    reiserfs: Fix quota mount option parsing
    udf: Treat symlink component of type 2 as /
    udf: Fix deadlock when converting file from in-ICB one to normal one
    udf: Cleanup calling convention of inode_getblk()
    ext2: Fix error handling on inode bitmap corruption
    ext3: Fix error handling on inode bitmap corruption
    ext3: replace ll_rw_block with other functions
    ext3: NULL dereference in ext3_evict_inode()
    jbd: clear revoked flag on buffers before a new transaction started
    ext3: call ext3_mark_recovery_complete() when recovery is really needed

    Linus Torvalds
     

09 Jan, 2012

5 commits

  • Delete any instances of include module.h that were not strictly
    required. In the case of ext2, the declaration of MODULE_LICENSE
    etc. were in inode.c but the module_init/exit were in super.c, so
    relocate the MODULE_LICENCE/AUTHOR block to super.c which makes it
    consistent with ext3 and ext4 at the same time.

    Signed-off-by: Paul Gortmaker
    Signed-off-by: Jan Kara

    Paul Gortmaker
     
  • The EXT{3,4}_IOC_SETVERSION ioctl() updates i_ctime and i_generation
    without i_mutex. This can lead to a race with the other operations that
    update i_ctime. This is not a big issue but let's make the ioctl consistent
    with how we handle e.g. other timestamp updates and use i_mutex to protect
    inode changes.

    Signed-off-by: Djalal Harouni
    Signed-off-by: Jan Kara

    Djalal Harouni
     
  • Both ext3 and ext4 put the half-created symlink inode into the orphan list
    for a while (see the comment in ext[34]_symlink() for gory details). Then,
    if everything went fine, they pull it out of the orphan list and bump the
    link count back to 1. The thing is, inc_nlink() is going to complain about
    seeing somebody changing i_nlink from 0 to 1. With a good reason, since
    normally something like that is a bug. Explicit set_nlink(inode, 1) does
    the same thing as inc_nlink() here, but it does *not* complain - exactly
    because it should be usable in strange situations like this one.

    Signed-off-by: Al Viro

    Al Viro
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (53 commits)
    Kconfig: acpi: Fix typo in comment.
    misc latin1 to utf8 conversions
    devres: Fix a typo in devm_kfree comment
    btrfs: free-space-cache.c: remove extra semicolon.
    fat: Spelling s/obsolate/obsolete/g
    SCSI, pmcraid: Fix spelling error in a pmcraid_err() call
    tools/power turbostat: update fields in manpage
    mac80211: drop spelling fix
    types.h: fix comment spelling for 'architectures'
    typo fixes: aera -> area, exntension -> extension
    devices.txt: Fix typo of 'VMware'.
    sis900: Fix enum typo 'sis900_rx_bufer_status'
    decompress_bunzip2: remove invalid vi modeline
    treewide: Fix comment and string typo 'bufer'
    hyper-v: Update MAINTAINERS
    treewide: Fix typos in various parts of the kernel, and fix some comments.
    clockevents: drop unknown Kconfig symbol GENERIC_CLOCKEVENTS_MIGR
    gpio: Kconfig: drop unknown symbol 'CS5535_GPIO'
    leds: Kconfig: Fix typo 'D2NET_V2'
    sound: Kconfig: drop unknown symbol ARCH_CLPS7500
    ...

    Fix up trivial conflicts in arch/powerpc/platforms/40x/Kconfig (some new
    kconfig additions, close to removed commented-out old ones)

    Linus Torvalds
     
  • * 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (76 commits)
    PM / Hibernate: Implement compat_ioctl for /dev/snapshot
    PM / Freezer: fix return value of freezable_schedule_timeout_killable()
    PM / shmobile: Allow the A4R domain to be turned off at run time
    PM / input / touchscreen: Make st1232 use device PM QoS constraints
    PM / QoS: Introduce dev_pm_qos_add_ancestor_request()
    PM / shmobile: Remove the stay_on flag from SH7372's PM domains
    PM / shmobile: Don't include SH7372's INTCS in syscore suspend/resume
    PM / shmobile: Add support for the sh7372 A4S power domain / sleep mode
    PM: Drop generic_subsys_pm_ops
    PM / Sleep: Remove forward-only callbacks from AMBA bus type
    PM / Sleep: Remove forward-only callbacks from platform bus type
    PM: Run the driver callback directly if the subsystem one is not there
    PM / Sleep: Make pm_op() and pm_noirq_op() return callback pointers
    PM/Devfreq: Add Exynos4-bus device DVFS driver for Exynos4210/4212/4412.
    PM / Sleep: Merge internal functions in generic_ops.c
    PM / Sleep: Simplify generic system suspend callbacks
    PM / Hibernate: Remove deprecated hibernation snapshot ioctls
    PM / Sleep: Fix freezer failures due to racy usermodehelper_is_disabled()
    ARM: S3C64XX: Implement basic power domain support
    PM / shmobile: Use common always on power domain governor
    ...

    Fix up trivial conflict in fs/xfs/xfs_buf.c due to removal of unused
    XBT_FORCE_SLEEP bit

    Linus Torvalds
     

07 Jan, 2012

2 commits


05 Jan, 2012

8 commits

  • A couple more functions can reasonably be made static if desired.

    Signed-off-by: Eric Sandeen
    Signed-off-by: "Theodore Ts'o"

    Eric Sandeen
     
  • The ext4_initxattrs symbol is used only in this file, so it should be
    declared static.

    Signed-off-by: Djalal Harouni
    Signed-off-by: "Theodore Ts'o"

    Djalal Harouni
     
  • Reserve the ext4 features flags EXT4_FEATURE_RO_COMPAT_METADATA_CSUM,
    EXT4_FEATURE_INCOMPAT_INLINEDATA, and EXT4_FEATURE_INCOMPAT_LARGEDIR.

    Signed-off-by: "Theodore Ts'o"

    Theodore Ts'o
     
  • Currently the value reported for max_batch_time is really the
    value of min_batch_time.

    Reported-by: Russell Coker
    Signed-off-by: Ben Hutchings

    Ben Hutchings
     
  • Online resize ioctls 'EXT4_IOC_GROUP_EXTEND' and 'EXT4_IOC_GROUP_ADD'
    call ext4_resize_begin() to check permissions and to set the
    EXT4_RESIZING bit lock, they do their work and they must finish with
    ext4_resize_end() which calls clear_bit_unlock() to unlock and to
    avoid -EBUSY errors for the next resize operations.

    This patch adds the missing ext4_resize_end() calls on error paths.

    Patch tested.

    Cc: stable@vger.kernel.org
    Signed-off-by: Djalal Harouni
    Signed-off-by: "Theodore Ts'o"

    Djalal Harouni
     
  • This patch lets ext4_group_add() call ext4_flex_group_add().

    Signed-off-by: Yongqiang Yang
    Signed-off-by: "Theodore Ts'o"

    Yongqiang Yang
     
  • ext4_group_extend_no_check() is moved out from ext4_group_extend(),
    this patch lets ext4_group_extend() call ext4_group_extentd_no_check()
    instead.

    Signed-off-by: Yongqiang Yang
    Signed-off-by: "Theodore Ts'o"

    Yongqiang Yang
     
  • This patch adds new online resize interface, whose input argument is a
    64-bit integer indicating how many blocks there are in the resized fs.

    In new resize impelmentation, all work like allocating group tables
    are done by kernel side, so the new resize interface can support
    flex_bg feature and prepares ground for suppoting resize with features
    like bigalloc and exclude bitmap. Besides these, user-space tools just
    passes in the new number of blocks.

    We delay initializing the bitmaps and inode tables of added groups if
    possible and add multi groups (a flex groups) each time, so new resize
    is very fast like mkfs.

    Signed-off-by: Yongqiang Yang
    Signed-off-by: "Theodore Ts'o"

    Yongqiang Yang
     

04 Jan, 2012

16 commits


29 Dec, 2011

4 commits

  • ext4_{set,clear}_bit() is defined as __test_and_{set,clear}_bit_le() for
    ext4. Only two ext4_{set,clear}_bit() calls check the return value. The
    rest of calls ignore the return value and they can be replaced with
    __{set,clear}_bit_le().

    This changes ext4_{set,clear}_bit() from __test_and_{set,clear}_bit_le()
    to __{set,clear}_bit_le() and introduces ext4_test_and_{set,clear}_bit()
    for the two places where old bit needs to be returned.

    This ext4_{set,clear}_bit() change is considered safe, because if someone
    uses these macros without noticing the change, new ext4_{set,clear}_bit
    don't have return value and causes compiler errors where the return value
    is used.

    This also removes unused ext4_find_first_zero_bit().

    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: "Theodore Ts'o"

    Akinobu Mita
     
  • The functions ext4_block_truncate_page() and ext4_block_zero_page_range()
    are no longer used, so remove them.

    Signed-off-by: Zheng Liu
    Signed-off-by: "Theodore Ts'o"

    Zheng Liu
     
  • Signed-off-by: "Theodore Ts'o"

    Theodore Ts'o
     
  • Fix ext4_debug format in ext4_ext_handle_uninitialized_extents() and
    ext4_end_io_dio().

    Signed-off-by: Zheng Liu
    Signed-off-by: "Theodore Ts'o"

    Zheng Liu