Regulate 5V to 5V with LM1117?

Adding another regulator is a bad idea since it complicates the power line.

A better solution is to protect your circuit by shutting off the power when the input voltage exceeds some limit. The circuit below will disconnect the source if the voltage goes over 5.5V. You can make it closer to 5V by reducing the Zener voltage from the shown 5.1V device.

schematic

simulate this circuit – Schematic created using CircuitLab

Description:

When Vin is under 5.5V the zener is off as is Q1. R3 holds the gate of M1 low turning it on as a low resistance. When Vin rises above 5.5V D1 holds the base of Q1 down turning it on which pulls up the voltage on R3 to close to Vin, which turns off M1.


The LM1117, although very cheap, particularly in clone versions, is not really an LDO regulator, more of a medium drop-out regulator.

You can use a CMOS LDO regulator as you suggest, it will just appear as a resistor when your input voltage is 5V, however you would also have to account for the power dissipation at maximum input voltage (and many of them are not rated for much input voltage to begin with). Trevor's circuit cuts off the device for overvoltage so it does not suffer from that particular ailment.

Another issue is the body diode of the internal pass MOSFET which will not provide reverse voltage protection, so you would need to add another external MOSFET and zener diode + resistor to get reverse voltage protection (if needed).