Oxidation of carbon in porous solids