Live data from Hacker News

Samsung Blu-ray players bricked because of an XML config file

theregister.com

41–50 of 181 posts

Re: Samsung Blu-ray players bricked because of an XML config file

#41
post #32

Earlier quoted context omitted.

But that is the point I was trying to make. No language can save you from logic errors, but a lot of languages let you recover from errors in functions. The simplest way is exception handling in Java like try { parse(xmlFile) } catch ( ... ) {.... } There is no reason the device should get in an undefined state if parsing that file fails or even completely crash.

What specifically goes in the catch block? Please be precise.

Either proceed with some safe default values or at least go into a maintenance mode, where the file can be replaced or newly downloaded.

Re: Samsung Blu-ray players bricked because of an XML config file

#42
post #13

Programming errors happen, but thats why I don't get, that companies still use programming languages, where such errors result in a crash vs. an error which can be handled and recovered from. A faulty XML file shouldn't render the whole machine unusable.

What language makes it impossible to write if parse(config) == false then reboot?

if !parse(config) then reboot. Please, for the love of God.

Re: Samsung Blu-ray players bricked because of an XML config file

#43
post #4

That's why: " What does a factory reset entail?" is a fascinating question. Everyone assumes you'll lose your settings during a factory reset, but what isn't as clear cut: Does it revert the firmware to whatever it was shipped with (bugs and all)? Some vendors do, but most vendors do not. A legitimate factory reset (inc. firmware) mechanism or USB boot/reflash would have likely saved Samsung considerable amounts of m…

> Does it revert the firmware to whatever it was shipped with (bugs and all)? Some vendors do, but most vendors do not. I think that's the only reasonable thing to do. Have the original firmware either as an actual rom, or only writable with an enable jumper flipped; use a power on key sequence to boot from the original firmware, copy to normal firmware and reboot into normal firmware (which is now the original firmw…

Companies seem to care more about preventing users from rolling back firmware than they do about releasing firmware that works. I've had more than one device wrecked because it happened to be out of warranty when I installed a firmware update that ruined something important.

Re: Samsung Blu-ray players bricked because of an XML config file

#44

That's why: " What does a factory reset entail?" is a fascinating question. Everyone assumes you'll lose your settings during a factory reset, but what isn't as clear cut: Does it revert the firmware to whatever it was shipped with (bugs and all)? Some vendors do, but most vendors do not. A legitimate factory reset (inc. firmware) mechanism or USB boot/reflash would have likely saved Samsung considerable amounts of m…

Downside of this is that you could end up in a different broken state: ex. What if the original firmware now has too old of a CA bundle?

This could be avoided by using your own PKI for updates (and bundle your own root), but I assume most devices out there are using Web PKI for updates.

Re: Samsung Blu-ray players bricked because of an XML config file

#45

Earlier quoted context omitted.

In this case the XML file parsed fine, but the contents (specifically an empty element that the firmware expected to be populated) caused a crash.

I guess I should rephrase. What language makes it impossible to call abort() after a required XML element is found to be missing?

Presumably languages which default to optional instead of null with the default ergonomics being to “or_else” instead of “unwrap” will encourage safer error handling.

It works for me, but I don’t know if it is yet well known what the effect of developer UX on error rate is.

Re: Samsung Blu-ray players bricked because of an XML config file

#46
post #44

That's why: " What does a factory reset entail?" is a fascinating question. Everyone assumes you'll lose your settings during a factory reset, but what isn't as clear cut: Does it revert the firmware to whatever it was shipped with (bugs and all)? Some vendors do, but most vendors do not. A legitimate factory reset (inc. firmware) mechanism or USB boot/reflash would have likely saved Samsung considerable amounts of m…

Downside of this is that you could end up in a different broken state: ex. What if the original firmware now has too old of a CA bundle? This could be avoided by using your own PKI for updates (and bundle your own root), but I assume most devices out there are using Web PKI for updates.

Better write a firmware to avoid this problem i have written in the past firmware for devices that don't affect the user experience including CA's, server domain or ip and other parts that don't require a full firmware update, better to "waste" development time thinking of all future problems that are out or your hand than bother the final users IMO. As a developer you should think every problem you could face or you aren't using the best practices of software development.

Re: Samsung Blu-ray players bricked because of an XML config file

#47

Earlier quoted context omitted.

What language makes it impossible to write if parse(config) == false then reboot?

if !parse(config) then reboot. Please, for the love of God.

I’m sorry but I find ruby „reboot unless config.parse?” much more readable here.

Re: Samsung Blu-ray players bricked because of an XML config file

#48
post #21

I think the best approach is to never, ever connect a device like a TV, Blu-ray player, etc to the internet. That's the only way they'll survive. So far no HDMI-based attacks. Hotglue the ethernet port?

At least TVs on the (originally) European DVB broadcast system can pick up firmware from broadcasts.

Packets in the transport stream include the necessary firmware.

Re: Samsung Blu-ray players bricked because of an XML config file

#49

That's why: " What does a factory reset entail?" is a fascinating question. Everyone assumes you'll lose your settings during a factory reset, but what isn't as clear cut: Does it revert the firmware to whatever it was shipped with (bugs and all)? Some vendors do, but most vendors do not. A legitimate factory reset (inc. firmware) mechanism or USB boot/reflash would have likely saved Samsung considerable amounts of m…

> Does it revert the firmware to whatever it was shipped with (bugs and all)? Some vendors do, but most vendors do not. I think if it doesn't revert to the firmware it had when shipped by the factory , it shouldn't be considered a factory reset.

Just a guess, but I would assume the term factory reset referred to clearing user settings before devices commonly had firmware update capabilities. So the legacy name should not be used to imply how the function should work in relation to firmware downgrade.

Re: Samsung Blu-ray players bricked because of an XML config file

#50
post #32

Earlier quoted context omitted.

But that is the point I was trying to make. No language can save you from logic errors, but a lot of languages let you recover from errors in functions. The simplest way is exception handling in Java like try { parse(xmlFile) } catch ( ... ) {.... } There is no reason the device should get in an undefined state if parsing that file fails or even completely crash.

What specifically goes in the catch block? Please be precise.

In the case of an appliance device where the XML file was externally supplied? Continue as though the file never existed (and possibly also delete the XML file).
Post reply on HN