http://weblog.rubyonrails.org/2017/4/27/Rails-5-1-final/
When 5.1 is released, bug fixes apply only to 5.1.x.
Normal security fixes apply to 5.1.x and 5.0.x.
Serious security fixes apply to 5.1.x, 5.0.x and 4.2.x.
That is, 4.x is basically not supported.