Stellar masses of SDSS-III/BOSS galaxies at z ∼ 0.5 and constraints to galaxy formation models