On Sat, Sep 13, 2014 at 4:04 PM, Greg Stark wrote:
> On Sat, Aug 30, 2014 at 11:50 PM, Mike Frysinger wrote:
> > that isn't to say settings should be lost on battery drain. but changes
> > there have to be done without compromising security, and even then they most
> > likely won't be backported to older devices.
>
> Supposedly that work-around can reset those flags from an unsigned
> boot image so I don't think there's any actual clear security
> rationale for those settings. It looks like they were added to be
> "more secure" without carefully thinking through what threat vector
> they're actually protecting against.
the extended developer mode features are not hard required for
shipping a product (like USB/SD/legacy booting). they exist because
firmware devs spend some of their "spare" time to try and do right by
our customers. but when it comes to security, it's safer to be
pessimistic and default to "no" than to inadvertently introduce a
firmware/ec exploit in the read-only portion of flash. we only have
one chance to get this right :). over time as we see a feature
progress and get a better handle on how things look, we can
investigate relaxing certain flows.
in this particular case, while the recovery image rootfs is modified,
the kernel is not. so the kernel is still properly signed and the
firmware validates it. the fact that the kernel then allows itself to
mount & execute an unsigned rootfs is because the device is in dev
mode. if you flipped the dev mode switch back, then the recovery
kernel should have rejected the modified rootfs.
disclaimer: if it still does execute unsigned code in non dev mode :),
then this isn't exactly a security issue either. once you eject the
recovery image, the firmware will require the installed kernel to be
properly signed, and that will require the rootfs to be properly
signed.
arguably, having the firmware be more restrictive than the recovery
image in terms of what it allows to boot by default is not
intentional. we probably want to file a bug on the topic to noodle
over it some more and harmonize the behavior.
> Moreover, my battery never ran out. It seems there's some code path
> where those flags get reset explicitly lying in wait to trap
> unsuspecting users. In my case it happened when I was intentionally
> trying the rescue instructions so my suspicion is that the
> ESC+F3+Power recovery sequence resets them.
if this is reproducible, then we should file a bug via
http://crbug.com/new to investigate and fix newer versions.
-mike