Bug 773704 - Gem install on RHEL 5.x fails with buffer overflow
Summary: Gem install on RHEL 5.x fails with buffer overflow
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 2.x
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Fabiano Franz
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 785852
Blocks: 767033
TreeView+ depends on / blocked
 
Reported: 2012-01-12 16:48 UTC by Matt Hicks
Modified: 2015-05-15 01:45 UTC (History)
7 users (show)

Fixed In Version: rhc-0.93.14-1+
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-08 17:58:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Matt Hicks 2012-01-12 16:48:08 UTC
Description of problem:
When running 'gem install rhc' on a RHEL 5.x machine (verified on 5.6 and 5.7), it encounters a buffer overflow error.  For example:


Version-Release number of selected component (if applicable):
Specific to RHEL 5.6+ and the packaged version of Ruby.

How reproducible:
Always

Steps to Reproduce:
1. Find a RHEL 5.6 machine
2. gem install rhc
  
Actual results:

[root@********-app1 ~]# gem install rhc
*** buffer overflow detected ***: /usr/bin/ruby terminated
======= Backtrace: =========
/lib64/libc.so.6(__chk_fail+0x2f)[0x30a78e803f]
/usr/lib64/ruby/1.8/x86_64-linux/syck.so(rb_syck_mktime+0x48e)[0x2b06c90dcc7e]
/usr/lib64/ruby/1.8/x86_64-linux/syck.so(yaml_org_handler+0x860)[0x2b06c90dd590]
/usr/lib64/ruby/1.8/x86_64-linux/syck.so(syck_defaultresolver_node_import+0x39)[0x2b06c90dd799]
/usr/lib64/libruby.so.1.8[0x30a883492e]
/usr/lib64/libruby.so.1.8[0x30a8834e48]
/usr/lib64/libruby.so.1.8[0x30a88353f2]
/usr/lib64/libruby.so.1.8(rb_funcall+0x85)[0x30a88356c5]
/usr/lib64/ruby/1.8/x86_64-linux/syck.so(rb_syck_load_handler+0x47)[0x2b06c90dc727]
/usr/lib64/ruby/1.8/x86_64-linux/syck.so(syck_hdlr_add_node+0x39)[0x2b06c90d84f9]
/usr/lib64/ruby/1.8/x86_64-linux/syck.so(syckparse+0xb45)[0x2b06c90d21f5]
/usr/lib64/ruby/1.8/x86_64-linux/syck.so(syck_parse+0x19)[0x2b06c90d6c19]
/usr/lib64/ruby/1.8/x86_64-linux/syck.so(syck_parser_load+0xed)[0x2b06c90dc59d]
/usr/lib64/libruby.so.1.8[0x30a883492e]
...


Expected results:
The gem installs successfully.

Additional info:

Speaking with vondruch, he thinks this might be solved with the following patch (we would need to backport to Ruby 1.8.5):

https://github.com/ruby/ruby/commit/65e137a74c1a6c1dddac44ca6f9d569828fb38d8#ext/syck/rubyext.c

Also, this isn't specific to the 'rhc' rubygem.  There are other examples of this behavior as well:

https://github.com/brianmario/yajl-ruby/issues/89
https://github.com/ezmobius/redis-rb/issues/131

Comment 1 Rob Millner 2012-01-27 23:11:49 UTC
Taking bug.  Will file a ticket against RHEL 5 to make a ruby patch and then block this bug on it.

Comment 2 Rob Millner 2012-01-30 19:08:49 UTC
Waiting on Bugzilla ticket 785852.

Comment 3 Xiaoli Tian 2012-04-06 06:37:22 UTC
Move it back to assigned since it does not fixed really in case developers miss it while searching bugs.

Comment 4 Mike McGrath 2012-05-15 19:41:17 UTC
I *THINK this bug might be fixed with the newest client tools and the bundling of json we're using.

Fabiano, can you confirm?

Comment 5 Fabiano Franz 2012-05-30 03:44:27 UTC
Should be fixed on rhc-0.93.14-1+ since we are not using json-pure.

Comment 6 yquan 2012-05-31 08:25:50 UTC
It is fixed now.
I tested on rhel-5.6 with ruby-1.9.2


[root@dhcp-66-73-98 home]# gem list

*** LOCAL GEMS ***

minitest (1.6.0)
rake (0.8.7)
rdoc (2.5.8)
[root@dhcp-66-73-98 home]# gem install rhc
Building native extensions.  This could take a while...
Successfully installed parseconfig-0.5.2
Successfully installed mime-types-1.18
Successfully installed rest-client-1.6.7
Successfully installed rhc-0.92.11
4 gems installed
Installing ri documentation for parseconfig-0.5.2...
Installing ri documentation for mime-types-1.18...
Installing ri documentation for rest-client-1.6.7...
Installing ri documentation for rhc-0.92.11...
Installing RDoc documentation for parseconfig-0.5.2...
Installing RDoc documentation for mime-types-1.18...
Installing RDoc documentation for rest-client-1.6.7...
Installing RDoc documentation for rhc-0.92.11...


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