Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ruby 2.6.1 #11184

Merged
merged 3 commits into from
Feb 20, 2019
Merged

ruby 2.6.1 #11184

merged 3 commits into from
Feb 20, 2019

Conversation

firefart
Copy link
Contributor

@firefart firefart commented Dec 29, 2018

@firefart
Copy link
Contributor Author

BTW rubocop still targets ruby 2.2 (https://github.com/rapid7/metasploit-framework/blob/master/.rubocop.yml#L12).

We might change this in the future but it can have implications on distros like kali and such as they might not have the required ruby version installed

@bcoles
Copy link
Contributor

bcoles commented Dec 29, 2018

We might change this in the future but it can have implications on distros like kali and such as they might not have the required ruby version installed

Kali Rolling has supported Ruby 2.5 default since ~2017.

@acammack-r7 acammack-r7 added the blocked Blocked by one or more additional tasks label Jan 2, 2019
@acammack-r7
Copy link
Contributor

Gonna mark this as delayed for the moment until we have a chance to address the possibility of breaking changes.

@firefart
Copy link
Contributor Author

firefart commented Jan 2, 2019

@acammack-r7 there should be no breaking changes on this one. The stuff discussed above is a separate issue

@busterb
Copy link
Member

busterb commented Jan 3, 2019

This should only affect what version of Ruby developers test when building Metasploit. Distributions like Kali, Pro, Omnibus, etc. all use their own locally-specified Ruby anyway. In other words, this just forces developers and folks following on github to possibly update if they're using a Ruby version manager that honors .ruby-version.

There's an argument that the sooner we start testing, the sooner we'll be ready when a distro bumps versions. However, #7814 is an example of when we weren't ready before a distro switched, even though we started early (It took 4 months (#7819) to get all of the upstream gems sorted out). #10699 is an example of a surprise Ruby 2.5-related bug (#10177 (comment)) that still took about 9 months to identify and fix from release. So no guarantees it'll be any easier this time around, whether we bump now or wait.

So, I'll ask, what did we want to address before we started testing Ruby 2.6 with this PR? Debian (and therefore Kali Rolling, etc.) switched to 2.5 March 4th last year, for reference: https://lists.debian.org/debian-ruby/2018/03/msg00013.html

@anthraxx any thoughts on the schedule for ArchLinux?

@anthraxx
Copy link

anthraxx commented Jan 3, 2019 via email

@acammack-r7
Copy link
Contributor

acammack-r7 commented Jan 3, 2019

@busterb I don't think this will be as big a deal as, say, the 2.4 release, but there have been a lot of internal changes to the Ruby VM and I at least want a full test run on 2.6 before bumping in tree. There's nothing stopping people from bumping their local .ruby-version and trying it out themselves (I, for example, am having a hard time building nokogiri 1.8.5, which I installed just fine on 2.5.3 yesterday).

@sempervictus
Copy link
Contributor

While I am a fan of "the faster we update the faster we catch bugs," the recent work @busterb did to fix pivot sockets due to an MRI change is a cautionary tale: its often not immediately visible that breakage happens at the interpreter level.
Would it be possible to rig the current CI infra to test against a few MRI versions so that we see regressions between PRs/branches as delineated by interpretater revision? Won't catch the pivot socket thing, but that was especially nasty...

@busterb
Copy link
Member

busterb commented Jan 15, 2019

I think I'm gonna move this forward, now that we got a lot of the other bundler 2.0 problems out of the way. Let me check with the vulndb folks to make sure it doesn't hose them.

@busterb
Copy link
Member

busterb commented Jan 15, 2019

We may need to add the travis-ci bits first, then switch .ruby-version in a second commit. I think there are some infrastructure things that aren't ready for .ruby-version to switch to 2.6.

@sempervictus
Copy link
Contributor

I've got an rvm gemset build running at the office, will ping back results when I get back there, but Ill be using 2.6 if it builds and report any issues. Any spare time right now will be focused on getting http proxy landed and upstreaming http transport changes needed for DNS transports, but the jit is too compelling, and until @brixen gets his back, or truffle becomes usable, this looks like the best way to get complex metasm stuff to work in the handler window.

@sempervictus
Copy link
Contributor

Seems to work, been playing with it any chance i get and leaving it running in the background to see if the JIT or anything else will leak/blow up... so far so good:

[*] [2019.01.27-05:27:21] 10.219.0.146:445 - Obtaining a service manager handle...
[*] [2019.01.27-05:27:21] 10.219.0.146:445 - Creating the service...
[+] [2019.01.27-05:27:23] 10.219.0.146:445 - Successfully created the service
[*] [2019.01.27-05:27:23] 10.219.0.146:445 - Changing service description...
[*] [2019.01.27-05:27:25] 10.219.0.146:445 - Starting the service...
[+] [2019.01.27-05:27:25] 10.219.0.146:445 - Service start timed out, OK if running a command or non-service executable...
[*] [2019.01.27-05:27:25] 10.219.0.146:445 - Removing the service...
[+] [2019.01.27-05:27:25] 10.219.0.146:445 - Successfully removed the service
[*] [2019.01.27-05:27:25] 10.219.0.146:445 - Closing service handle...
(2019-01-27)05:27 (S:0 J:6)msf  exploit(windows/smb/psexec) > ruby -v
[*] exec: ruby -v

ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
(2019-01-27)05:27 (S:0 J:6)msf  exploit(windows/smb/psexec) >

@busterb busterb self-assigned this Jan 29, 2019
@busterb
Copy link
Member

busterb commented Jan 29, 2019

Thanks for the update @sempervictus . We've locally been enjoying some kind of silly fallout from rubygems 2.5 / Bundler 2.x and other things tangentially-related to Ruby 2.6.

@firefart
Copy link
Contributor Author

@firefart
Copy link
Contributor Author

firefart commented Feb 5, 2019

I just pushed updates to this branch so 2.6.1 is used

@firefart firefart changed the title ruby 2.6.0 ruby 2.6.1 Feb 5, 2019
@sempervictus
Copy link
Contributor

The actual fix for 2.6.1 seems pertinent to us...
Once we move up, might be worth revisiting Rex core libs and updating to use some of the new primitives, making things better for jit, etc.
Thanks @firefart

@busterb busterb removed the blocked Blocked by one or more additional tasks label Feb 8, 2019
@busterb
Copy link
Member

busterb commented Feb 8, 2019

Could we add a patch like this so we don't get an annoying warning on startup? Unfortunately ruby/bigdecimal#115 will cause annoyance until we can get rid of rails 4.x in framework.

diff --git a/lib/msf/core.rb b/lib/msf/core.rb
index 35a702d3b1..f07bf40651 100644
--- a/lib/msf/core.rb
+++ b/lib/msf/core.rb
@@ -13,6 +13,12 @@
 # Include backported features for older versions of Ruby
 require 'backports'
 
+require 'bigdecimal'
+
+def BigDecimal.new(*args, **kwargs)
+  BigDecimal(*args, **kwargs)
+end
+
 # The framework-core depends on Rex
 require 'rex'
 require 'rex/ui'

@firefart
Copy link
Contributor Author

@busterb added your code

@busterb
Copy link
Member

busterb commented Feb 20, 2019

Thanks. I'll land this and we'll keep an eye out for any regressions.

@busterb busterb merged commit c68c44c into rapid7:master Feb 20, 2019
@busterb busterb added the rn-no-release-notes no release notes label Feb 20, 2019
busterb added a commit that referenced this pull request Feb 20, 2019
@busterb busterb removed the rn-no-release-notes no release notes label Feb 20, 2019
@busterb
Copy link
Member

busterb commented Feb 20, 2019

Release Notes

This adds initial Metasploit support for Ruby 2.6 and later.

@firefart firefart deleted the ruby2.6 branch February 20, 2019 06:31
msjenkins-r7 pushed a commit that referenced this pull request Feb 20, 2019
@gdavidson-r7 gdavidson-r7 added the rn-enhancement release notes enhancement label Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn-enhancement release notes enhancement ruby-compat
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants