Using the molecular dynamics method, the binding energies of impurity atoms of light elements C, N, O with edge dislocations, and the energy of their migration along with dislocation core in metals with fcc lattice Ni, Ag, and Al were calculated. The binding energies of impurity atoms with partial and stair-rod dislocations, as well as with jogs on them, were calculated. It is shown that the binding energy with partial dislocations is significantly lower than with stair-rod ones. The binding energy of an impurity atom with a dislocation is determined mainly by two factors: the depth of the interaction potential of the impurity atom with metal atoms and the ratio of their sizes. For this reason, in most cases, the binding energy for carbon with dislocations was greater than for oxygen atoms. The values of the activation energy of the impurity atoms diffusion along a dislocation core were found. The obtained values are several times lower than the activation energy of impurity diffusion in a pure crystal.