Protecting Smart Devices from the Bottom-Up