Cross-Layer Design for Secure and Resilient Control of Cyber-Physical Systems in Smart Cities