"Is it legal to record a cover of someone else’s song?
When you record a cover version of someone else's song, you need to get a mechanical license authorizing you to reproduce their composition.
A “mechanical license” is the industry name for an agreement that gives you permission from a songwriter or publisher to record a song that you do not own the songwriting copyright for. The main situation in which a mechanical license would be necessary is if you want to write a cover song. But that’s not the only situation where you could need a mechanical license."
- From https://www.newmediarights.org/business_models/artist/it_legal_record_cover_someone_else%E2%80%99s_song