Yes this follows law of conservation of mass.
First we want to know what happens in forming rust. As it is indicated in the question Oxygen in air will contribute to that. But also we need some amount of moisture for rust reaction.
`4Fe+3O_2 rarr 2Fe_2O_3`
This is the general reaction in forming of rust.
Simply we can say at the initial stage it was only Fe in the metal. But after rust formation we have oxygen also in the metal as `Fe_2O_3` . So mass will increase after rusting process.
Let us say we had 4 moles of Fe in the metal.
So to react with Fe we need 3 `O_2` moles because `Fe:O_2` = 4:3
Mass of elements:
Fe = 56 g/mol
O = 16 g/mol
Molar mass of `Fe_2O_3` = 160 g/mol
Mass of reactants = 4*56+3*16*2 = 320 g
Mass of results = 2(160) = 320 g
So the law of conservation of mass is satisfied.