There are several proposed origins of the word smut. According to the Oxford English Dictionary,[1] smut originated from the Middle English word smot, which had a similar meaning to its later definition – to smear or dirty. This form of smut comes from the 14th century. According to Etymonline, smut took on the meaning “indecent or obscene language” in the 1660s, which is closer to its modern use.
[1] https://www.oed.com/dictionary/smut_v?tab=meaning_and_use&tl=true.
[3] https://www.google.com/search?q=\%22smut\%22&tbm=bks&tbs=cdr:1,cd_min:1934,cd_max:1965&lr=lang_en.