In this paper, we investigate location-based frequency allocation schemes in a two-layer ultra-dense network (UDN) with a wideband eavesdropper to efficiently enhance the macro layer security in the whole working bandwidth. The cross-tier interference, treated as evil by traditional wisdom, is employed to confuse the malicious node as well as to tackle the conflict between the secrecy and traditional performances through the prudent spectrum allocation among the small cells. Three games are designed to progressively give insight into the frequency assignment problems under increasingly strict scenes. With the help of game theoretic stochastic learning approaches and location information, small cell base stations (SBSs) are endowed with the ability to distributedly select the subchannel with no requirement on the eavesdropper's CSI. First, more specifically, we focus on the security problem, aiming to promote the safety transmission of macro users by leveraging a state field, and thus formulate the spectrum selection of SBSs as a state-based potential game, which guarantees a budget-balanced utility design. The existence of a recurrent state equilibrium point is proved, and that it is able to maximize the total safety transmission probability of all subchannels. A step forward, we take the service delay of SBSs into consideration, nowadays, as numerous new services are delay-sensitive. To this end, an exact potential game, in which the equilibrium always exists, is built to help SBSs strike a balance between altruistically helping the macro users and selfishly keeping their own performances. Furthermore, a fully distributed non-cooperative game that requires no exchange among SBSs is put forward. The proposed scheme may work well even when the backhaul is limited or even unavailable since all the SBSs only depend on the observation of their own instantaneous performances. Finally, the numerical results validate the effectiveness of the proposed games on improving the safety transmission probability while guaranteeing a better service within small cells. INDEX TERMS Ultra-dense networks, physical layer security, delay, state-based game, reinforcement learning.