Quick search by citation:

17 U.S. Code § 906 - Limitation on exclusive rights: reverse engineering; first sale

(a) Notwithstanding the provisions of section 905, it is not an infringement of the exclusive rights of the owner of a mask work for—
(1)
a person to reproduce the mask work solely for the purpose of teaching, analyzing, or evaluating the concepts or techniques embodied in the mask work or the circuitry, logic flow, or organization of components used in the mask work; or
(2)
a person who performs the analysis or evaluation described in paragraph (1) to incorporate the results of such conduct in an original mask work which is made to be distributed.
(b)
Notwithstanding the provisions of section 905(2), the owner of a particular semiconductor chip product made by the owner of the mask work, or by any person authorized by the owner of the mask work, may import, distribute, or otherwise dispose of or use, but not reproduce, that particular semiconductor chip product without the authority of the owner of the mask work.