In July 2014, the United States Environmental Protection Agency stated that the practice was illegal, as it violated the Clean Air Act which prohibits the manufacturing, sale, and installation "of a part for a motor vehicle that bypasses, defeats, or renders inoperative any emission control device [and] prohibits anyone from tampering with an emission control device on a motor vehicle by removing it or making it inoperable prior to or after the sale or delivery to the buyer."
https://en.wikipedia.org/wiki/Rolling_coal#Legality