A Canon on faith or morals, as well as the doctrine on which it is based, would be regarded as infallible.
However, an anathema itself is a disciplinary judgment of the Church on persons. WHile the canon that contains the anathema, and the doctrine on which the anathema is based are infallible, the anathema itself is not infallible. An anathema, like all other discplinary judgments of the Church, can be revoked by the Church through the power of the keys.
For example, a Council states:
“He who believes in X, let him be anathema.”
Such a person will be under anathema. If the person repents of the heresy, the anathema against that person will be removed (proving that the anathema itself is not the object of infallibility). But the Canon itself remains unchangeable.
I hope that helps.
Blessings,
Marduk