http://git.kernel.org/?p=linux/kernel/git/mason/btrfs-progs.git I can repeatedly get the following SEGV from running "btrfs device stats" on a device node for an Ext3/4 filesystem. This happens with the version of the code downloaded from the above GIT repository as well as with an older version. Obviously the command in question is not going to do anything useful when run against a non-BTRFS filesystem, but it should do something other than crash. Program received signal SIGSEGV, Segmentation fault. 0x000000000045842d in get_fs_info (path=0x7fffffffce60 "/boot", fi_args=0x7fffffffe6c0, di_ret=0x7fffffffe6b8) at utils.c:1560 1560 fi_args->max_id = fs_devices_mnt->latest_devid; (gdb) bt #0 0x000000000045842d in get_fs_info (path=0x7fffffffce60 "/boot", fi_args=0x7fffffffe6c0, di_ret=0x7fffffffe6b8) at utils.c:1560 #1 0x0000000000408576 in cmd_dev_stats (argc=2, argv=0x7fffffffec78) at cmds-device.c:331 #2 0x0000000000404177 in handle_command_group (grp=0x684660, argc=2, argv=0x7fffffffec78) at btrfs.c:154 #3 0x0000000000408830 in cmd_device (argc=3, argv=0x7fffffffec70) at cmds-device.c:410 #4 0x000000000040450e in main (argc=3, argv=0x7fffffffec70) at btrfs.c:296 -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/ -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Sat, 10 Aug 2013 07:07:50 PM Russell Coker wrote:> I can repeatedly get the following SEGV from running "btrfs device stats" on > a device node for an Ext3/4 filesystem. This happens with the version of > the code downloaded from the above GIT repository as well as with an older > version. Obviously the command in question is not going to do anything > useful when run against a non-BTRFS filesystem, but it should do something > other than crash.The code calls btrfs_read_dev_super() on that filesystem, but it looks like the checks are failing to detect it as not btrfs. :-( I can reproduce the crash here too with ext3 and XFS filesystems. -- Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC This email may come with a PGP signature as a file. Do not panic. For more info see: http://en.wikipedia.org/wiki/OpenPGP
On 08/10/2013 09:56 PM, Chris Samuel wrote:> On Sat, 10 Aug 2013 07:07:50 PM Russell Coker wrote: > >> I can repeatedly get the following SEGV from running "btrfs device stats" on >> a device node for an Ext3/4 filesystem. This happens with the version of >> the code downloaded from the above GIT repository as well as with an older >> version. Obviously the command in question is not going to do anything >> useful when run against a non-BTRFS filesystem, but it should do something >> other than crash. > > The code calls btrfs_read_dev_super() on that filesystem, but it looks like the > checks are failing to detect it as not btrfs. :-( > > I can reproduce the crash here too with ext3 and XFS filesystems.There are quite a number of bug similar to this (that was reported to the mainling list here, but hard to search now) which is all triggered by using the backup super block invariably. v6: access to backup superblock http://permalink.gmane.org/gmane.comp.file-systems.btrfs/24746 provided fix. But it needs rebase, if you could goback in git this patch might apply nicely for testing. Thanks, Anand -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html