It's both of them.
Indra -> .... -> Madara -> Sasuke.
Ashura -> .... -> Minato -> Naruto
When madara died, indra reincarnated into sasuke. This is evidenced by kyuubi stating sasuke's chakra was a sinister as madara. That was pretty much a foreshadowing of this stuff. Kurama's never stated such a thing for any other uchiha, not even obito.
Then, Madara got revived, So the piece of indra he contained came back with him.
It's the same way ashura has been reincarnated into minato then naruto as you can see by how both their KCM forms look. Which is completely different from any other jin's bijuu form.