Tracking performance with cosmic rays in CMS