Userspace utilities to manage btrfs filesystems
Go to file
Jeff Liu 521770b7a9 Btrfs-progs: specify label length larger than 255 bytes cause mkfs.btrfs buffer overflow
Hello,

While going through the mkfs.c, I noticed there is an issue for label
length checking, mkfs.btrfs will crashed if the label length exceeding
255 bytes, it's easy to triggered that out as below:

jeff@pibroch:~/opensource/btrfs-progs$ sudo ./mkfs.btrfs -L `perl -e
'print "A"x256'` /usr/src/linux-3.0/img0

WARNING! - Btrfs v0.19-35-g1b444cd IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using

*** buffer overflow detected ***: ./mkfs.btrfs terminated
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x50)[0xb7774df0]
/lib/i386-linux-gnu/libc.so.6(+0xe4cca)[0xb7773cca]
/lib/i386-linux-gnu/libc.so.6(__strcpy_chk+0x3f)[0xb777305f]
./mkfs.btrfs[0x805acc4]
./mkfs.btrfs[0x805def6]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0xb76a5e37]
./mkfs.btrfs[0x8048ef1]
======= Memory map: ========
......

a tiny patch could fix it.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
2011-10-25 09:18:59 -04:00
man Btrfs-progs: add "btrfs subvolume get-default" subcommand 2011-10-25 09:18:59 -04:00
.hgignore
.hgtags
COPYING
INSTALL btrfs-progs-unstable: replace debug-tree to btrfs-debug-tree in INSTALL 2011-10-25 09:18:59 -04:00
Makefile btrfs-progs: commands added 2011-10-25 09:18:59 -04:00
bcp Btrfs-progs: Correct path munging in bcp 2011-10-25 09:18:58 -04:00
bit-radix.c
bit-radix.h
btrfs-defrag.c new util: 'btrfs' 2010-03-11 13:45:47 -05:00
btrfs-image.c Mixed back reference (FORWARD ROLLING FORMAT CHANGE) 2009-06-08 13:30:36 -04:00
btrfs-list.c Btrfs-progs: add "btrfs subvolume get-default" subcommand 2011-10-25 09:18:59 -04:00
btrfs-map-logical.c btrfs-map-logical: segfaults when no output file is given 2011-10-25 09:18:58 -04:00
btrfs-select-super.c btrfsck: decode error properly 2011-10-25 09:18:59 -04:00
btrfs-show.c Deprecate btrfsctl, btrfs-show, btrfs-vol 2011-10-25 09:18:31 -04:00
btrfs-vol.c Deprecate btrfsctl, btrfs-show, btrfs-vol 2011-10-25 09:18:31 -04:00
btrfs-zero-log.c btrfsck: decode error properly 2011-10-25 09:18:59 -04:00
btrfs.c Btrfs-progs: add "btrfs subvolume get-default" subcommand 2011-10-25 09:18:59 -04:00
btrfs_cmds.c check number of args for btrfs sub snap correctly 2011-10-25 09:18:59 -04:00
btrfs_cmds.h Btrfs-progs: add "btrfs subvolume get-default" subcommand 2011-10-25 09:18:59 -04:00
btrfsck.c btrfsck: decode error properly 2011-10-25 09:18:59 -04:00
btrfsctl.c btrfs-progs: cast u64 to long long to avoid printf warnings 2011-10-25 09:18:57 -04:00
btrfslabel.c Add the "btrfs filesystem label" command 2011-10-25 09:18:31 -04:00
btrfslabel.h Add the "btrfs filesystem label" command 2011-10-25 09:18:31 -04:00
btrfstune.c update btrfs-progs for seed device support 2008-11-18 10:40:06 -05:00
convert.c btrfs-convert: fix typo: 'all inode' -> 'all inodes' 2011-10-25 09:18:58 -04:00
crc32c.c
crc32c.h Mixed back reference (FORWARD ROLLING FORMAT CHANGE) 2009-06-08 13:30:36 -04:00
ctree.c Fix unused-but-set errors in gcc-4.6 2011-10-25 09:18:32 -04:00
ctree.h btrfs-progs: scrub ioctls 2011-10-25 09:18:59 -04:00
debug-tree.c btrfs-progs: cast u64 to long long to avoid printf warnings 2011-10-25 09:18:57 -04:00
dir-item.c Fix unused-but-set errors in gcc-4.6 2011-10-25 09:18:32 -04:00
dir-test.c Btrfs: add btrfs-debug-tree -b <block number> to print a single block 2010-04-06 09:30:17 -04:00
disk-io.c btrfs-progs: cast u64 to long long to avoid printf warnings 2011-10-25 09:18:57 -04:00
disk-io.h Btrfs-progs: add a btrfs-select-super command to overwrite the super 2011-10-25 09:18:31 -04:00
extent-cache.c Fix unused-but-set errors in gcc-4.6 2011-10-25 09:18:32 -04:00
extent-cache.h Add semantic checks to btrfsck for files and directories 2009-01-07 14:57:12 -05:00
extent-tree.c btrfs progs: fix extra metadata chunk allocation in --mixed case 2011-10-25 09:18:58 -04:00
extent_io.c mkfs.btrfs: write zeroes instead on uninitialized data. 2011-10-25 09:18:58 -04:00
extent_io.h
file-item.c mkfs.btrfs: return some defined value instead of garbage when lookup checksum 2011-10-25 09:18:58 -04:00
hash.h
hasher.c
inode-item.c
inode-map.c
ioctl-test.c Test the additional ioctl. 2011-10-25 09:18:58 -04:00
ioctl.h btrfs-progs: scrub ioctls 2011-10-25 09:18:59 -04:00
kerncompat.h multidevice support for check_mounted 2010-09-23 20:26:49 -04:00
list.h
mkfs.c Btrfs-progs: specify label length larger than 255 bytes cause mkfs.btrfs buffer overflow 2011-10-25 09:18:59 -04:00
print-tree.c btrfs-progs: cast u64 to long long to avoid printf warnings 2011-10-25 09:18:57 -04:00
print-tree.h Btrfs: add btrfs-debug-tree -b <block number> to print a single block 2010-04-06 09:30:17 -04:00
quick-test.c Btrfs: add btrfs-debug-tree -b <block number> to print a single block 2010-04-06 09:30:17 -04:00
radix-tree.c
radix-tree.h
random-test.c Btrfs: add btrfs-debug-tree -b <block number> to print a single block 2010-04-06 09:30:17 -04:00
rbtree.c
rbtree.h
root-tree.c Btrfs: update converter for the new disk format 2008-12-17 16:10:07 -05:00
scrub.c btrfs-progs: scrub userland implementation 2011-10-25 09:18:59 -04:00
show-blocks Fix showblocks to display different colors for different metadata roots 2009-03-09 13:00:44 -04:00
transaction.h
utils.c btrfs-progs: added check_mounted_where 2011-10-25 09:18:59 -04:00
utils.h btrfs-progs: added check_mounted_where 2011-10-25 09:18:59 -04:00
version.sh btrfs-progs v0.19 2009-06-11 12:56:15 -04:00
volumes.c remove unused variables 2011-10-25 09:18:59 -04:00
volumes.h btrfs-progs: Add new feature to mkfs.btrfs to make file system image file from source directory 2011-10-25 09:18:31 -04:00