Does the Torah permit cannibalism?
Is a person allowed to eat human flesh?
The gemara in Kesubos 60a has a discussion about why mother's milk is permitted to drink. The Gemara says that we learn out from the fact that the Torah repeats the prohibition by a גמל, that a camel is prohibited but the milk and blood of a human being is permitted. The rishonim (Tosafos, Ramban, Rashba, and others) point out that in the Sifri (שמיני) instead of blood being permitted it says that בשר, human flesh is permitted. These Rishonim say that there is no contradiction and in actuality all 3 (milk, blood, and flesh) are permitted min hatorah.
The Rambam (מאכלות אסורות ב,ג) disagrees and writes that although there is no לאו there is an איסור עשה to eat human flesh. The Acharonim explain that the Rambam understood as follows. If human flesh was permitted to eat, then why do we need a pasuk to permit milk and blood, after all, there is a principle that יוצא מן הטהור טהור? Therefore there must be an issur to eat human flesh and consequently we need the pasuk to be מתיר milk and blood. Presumably the other Rishonim hold that all 3 are learned out together and therefore we can't apply the Rambam's logic.
The Malbim (שמיני) has a fascinating explanation as to why human flesh should be prohibited. He writes that a human being is never called a חיה (except for once in Bereishis where it says נפש חיה, but that has a different meaning). Therefore, human flesh cannot be prohibited based on the pesukim prohibiting animals. Rather, the prohibition is based on the original prohibition on אדם הראשון. After אדם is created Hashem permits him to eat from all the trees in Gan Eden, but he was prohibited from eating anything else (meat) including human flesh. After the mabul when Hashem permitted Noach to eat meat, he was only permitted to eat the flesh of animals, the original prohibition on אדם as it related to human flesh still applied and still applies today. In other words, the Malbim says, why can't we eat human flesh today? Because hashem prohibited it to אדם.
To sum up, there is a whole group of Rishonim who hold that min hatorah there is no issur in eating human flesh while the Rambam holds that it is an איסור עשה.
Please note, the whole above discussion is on a level of d'oraysa and does not get into various side issues (such as a dead body is אסור בהנאה) and ethical issues.