  It is shown that substitution of C or N for O recently proposed as a way to
create ferromagnetism in otherwise nonmagnetic oxide insulators is curtailed by
formation of impurity pairs, and the resultant C2 spin=1 dimers as well as the
isoelectronic N2^{2+} interact antiferromagneticallly in p-type MgO. For
C-doped ZnO, however, we demonstrate using the HSE hybrid functional that a
resonance of the spin-polarized C2 pp\pi* states with the host conduction band
results in a long-range ferromagnetic interaction. Magnetism of open-shell
impurity molecules is proposed as a possible route to d0-ferromagnetism in
oxide spintronic materials.
