Bug 710534 - buffer overflow in btrfs if device name too long
Summary: buffer overflow in btrfs if device name too long
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: btrfs-progs
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Josef Bacik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 689509
TreeView+ depends on / blocked
 
Reported: 2011-06-03 16:02 UTC by Milan Broz
Modified: 2013-09-30 00:38 UTC (History)
3 users (show)

Fixed In Version: btrfs-progs-0.20.rc1.20130917git194aa4a-1.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-30 00:38:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Proposed patch (3.16 KB, patch)
2011-06-03 16:02 UTC, Milan Broz
no flags Details | Diff

Description Milan Broz 2011-06-03 16:02:10 UTC
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.

Comment 2 Fedora End Of Life 2013-04-03 15:25:11 UTC
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

Comment 3 Fedora Update System 2013-09-18 15:51:55 UTC
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

Comment 4 Eric Sandeen 2013-09-18 15:53:04 UTC
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

Comment 5 Fedora Update System 2013-09-19 02:07:42 UTC
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).

Comment 6 Fedora Update System 2013-09-30 00:38:35 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.