Created attachment 502846 [details] Proposed patch Description of problem: btrfs overwrite memory for too long device paramater e.g. btrfs device scan $(awk 'BEGIN{$5090=OFS="x";print}') ... ** buffer overflow detected ***: btrfs terminated ======= Backtrace: ========= /lib64/libc.so.6(__fortify_fail+0x37)[0x7f0ef2ea0607] /lib64/libc.so.6(+0xf6580)[0x7f0ef2e9e580] btrfs[0x402ec4] btrfs[0x401b48] /lib64/libc.so.6(__libc_start_main+0xed)[0x7f0ef2dc943d] btrfs[0x401df1] Version-Release number of selected component (if applicable): btrfs-progs-0.19-13.fc15.x86_64 (probably all versions) See attached patch - it is not perfect fix (probably there should be error check if string is too long) but at least it avoids trivial strcpy() buffer overflow.
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
btrfs-progs-0.20.rc1.20130917git194aa4a-1.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/btrfs-progs-0.20.rc1.20130917git194aa4a-1.fc19
A new git snapshot of btrfs-progs has been pushed to F19 testing. If possible, please re-test these bugs & feel free to close or comment as appropriate. Thanks, -Eric
Package btrfs-progs-0.20.rc1.20130917git194aa4a-1.fc19: * should fix your issue, * was pushed to the Fedora 19 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing btrfs-progs-0.20.rc1.20130917git194aa4a-1.fc19' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-17126/btrfs-progs-0.20.rc1.20130917git194aa4a-1.fc19 then log in and leave karma (feedback).
btrfs-progs-0.20.rc1.20130917git194aa4a-1.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.