• Dan Rosenberg's avatar
    Btrfs: fix checks in BTRFS_IOC_CLONE_RANGE · 2ebc3464
    Dan Rosenberg authored
    1.  The BTRFS_IOC_CLONE and BTRFS_IOC_CLONE_RANGE ioctls should check
    whether the donor file is append-only before writing to it.
    
    2.  The BTRFS_IOC_CLONE_RANGE ioctl appears to have an integer
    overflow that allows a user to specify an out-of-bounds range to copy
    from the source file (if off + len wraps around).  I haven't been able
    to successfully exploit this, but I'd imagine that a clever attacker
    could use this to read things he shouldn't.  Even if it's not
    exploitable, it couldn't hurt to be safe.
    Signed-off-by: default avatarDan Rosenberg <dan.j.rosenberg@gmail.com>
    cc: stable@kernel.org
    Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
    2ebc3464
ioctl.c 48.7 KB