Measurements are presented of the cross section for the production of at least four jets, of which at least two originate from b quarks, in proton-proton collisions. Data collected with the CMS detector at the LHC at a center-of-mass energy of 7 TeV are used, corresponding to an integrated luminosity of 3 pb-1. The cross section is measured as a function of the jet transverse momentum for pT>20 GeV, and of the jet pseudorapidity for |η|<2.4 (b jets), 4.7 (untagged jets). The correlations in azimuthal angle and pT between the jets are also studied. The inclusive cross section is measured to be σ(pp→2b+2j+X)=69±3(stat)±24(syst) nb. The η and pT distributions of the four jets and the correlations between them are well reproduced by event generators that combine perturbative QCD calculations at next-to-leading-order accuracy with contributions from parton showers and multiparton interactions.