31 Oct, 2018

1 commit

  • Inserting a new record in a btree may require splitting several of its
    nodes. If we hit ENOSPC halfway through, the new nodes will be left
    orphaned and their records will be lost. This could mean lost inodes or
    extents.

    Henceforth, check the available disk space before making any changes.
    This still leaves the potential problem of corruption on ENOMEM.

    There is no need to reserve space before deleting a catalog record, as we
    do for hfsplus. This difference is because hfs index nodes have fixed
    length keys.

    Link: http://lkml.kernel.org/r/ab5fc8a7d5ffccfd5f27b1cf2cb4ceb6c110da74.1536269131.git.ernesto.mnd.fernandez@gmail.com
    Signed-off-by: Ernesto A. Fernández
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ernesto A. Fernández
     

28 Sep, 2016

1 commit

  • CURRENT_TIME_SEC is not y2038 safe. current_time() will
    be transitioned to use 64 bit time along with vfs in a
    separate patch.
    There is no plan to transistion CURRENT_TIME_SEC to use
    y2038 safe time interfaces.

    current_time() will also be extended to use superblock
    range checking parameters when range checking is introduced.

    This works because alloc_super() fills in the the s_time_gran
    in super block to NSEC_PER_SEC.

    Signed-off-by: Deepa Dinamani
    Acked-by: Jan Kara
    Signed-off-by: Al Viro

    Deepa Dinamani
     

21 Jul, 2016

1 commit


13 May, 2016

1 commit


21 Jan, 2016

1 commit


11 Dec, 2014

1 commit

  • Relying on the sign (after casting to int) of the difference of two
    quantities for comparison is usually wrong. For example, should a-b
    turn out to be 2^31, the return value of cmp(a,b) is -2^31; but that
    would also be the return value from cmp(b, a). So a compares less than
    b and b compares less than a. One can also easily find three values
    a,b,c such that a compares less than b, b compares less than c, but a
    does not compare less than c.

    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Vyacheslav Dubeyko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     

01 May, 2013

3 commits

  • Use a more current logging style.

    Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
    hfsplus now uses "hfsplus: " for all messages.
    Coalesce formats.
    Prefix debugging messages too.

    Signed-off-by: Joe Perches
    Cc: Vyacheslav Dubeyko
    Cc: Hin-Tak Leung
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Use a more current logging style.

    Rename macro and uses.
    Add do {} while (0) to macro.
    Add DBG_ to macro.
    Add and use hfs_dbg_cont variant where appropriate.

    Signed-off-by: Joe Perches
    Cc: Vyacheslav Dubeyko
    Cc: Hin-Tak Leung
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • hfs_find_init() may fail with ENOMEM, but there are places, where the
    returned value is not checked. The consequences can be very unpleasant,
    e.g. kfree uninitialized pointer and inappropriate mutex unlocking.

    The patch adds checks for errors in hfs_find_init().

    Found by Linux Driver Verification project (linuxtesting.org).

    Signed-off-by: Alexey Khoroshilov
    Reviewed-by: Vyacheslav Dubeyko
    Cc: Hin-Tak Leung
    Cc: Al Viro
    Cc: Artem Bityutskiy
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Khoroshilov
     

16 Dec, 2009

1 commit

  • A specially-crafted Hierarchical File System (HFS) filesystem could cause
    a buffer overflow to occur in a process's kernel stack during a memcpy()
    call within the hfs_bnode_read() function (at fs/hfs/bnode.c:24). The
    attacker can provide the source buffer and length, and the destination
    buffer is a local variable of a fixed length. This local variable (passed
    as "&entry" from fs/hfs/dir.c:112 and allocated on line 60) is stored in
    the stack frame of hfs_bnode_read()'s caller, which is hfs_readdir().
    Because the hfs_readdir() function executes upon any attempt to read a
    directory on the filesystem, it gets called whenever a user attempts to
    inspect any filesystem contents.

    [amwang@redhat.com: modify this patch and fix coding style problems]
    Signed-off-by: WANG Cong
    Cc: Eugene Teo
    Cc: Roman Zippel
    Cc: Al Viro
    Cc: Christoph Hellwig
    Cc: Alexey Dobriyan
    Cc: Dave Anderson
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Amerigo Wang
     

17 Oct, 2008

1 commit

  • Fix a stack corruption caused by a corrupted hfs filesystem. If the
    catalog name length is corrupted the memcpy overwrites the catalog btree
    structure. Since the field is limited to HFS_NAMELEN bytes in the
    structure and the file format, we throw an error if it is too long.

    Cc: Roman Zippel
    Signed-off-by: Eric Sesterhenn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sesterhenn
     

19 Jan, 2006

1 commit


08 Sep, 2005

1 commit

  • This adds NLS support to HFS. Using the kernel options iocharset and codepage
    it's possible to map the disk encoding to a local mapping. If these options
    are not used, it falls back to the old direct mapping.

    Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds