Software: Breaking through the clouds

IoT Security Foundation Conference: cars are becoming IoT connected devices

Chris Hills from Phaedrus Systems asks if the UN realises that WMDs are safer than cars

 

Over the past few months I have been to several non-automotive conferences, all of which have spotlighted aspects of automotive software. When taken together they start to paint a very disturbing picture.

Part of the problem is that the automotive world is actually two separate worlds unhappily co-habiting. On one side we have the safety engineers going cautiously and on the other the marketing people racing ahead adding more and more infotainment bells and whistles.

They are both working on a consumer item that in many countries kills more people per year than firearms, and often more than any other cause, despite the many advances in automotive safety. In the middle of this sandwich of safety and consumerism is the filling of software.

The numbers of vehicles recalled every year is now regularly in the millions and this excludes those that have their software quietly patched during servicing. These recalls are distributed across many manufacturers. Not all of them are caused by software, or at least not directly, but increasingly software is at the heart of the problem.

At the Safety Critical Systems Club's High Integrity Software event in Bristol, Phil Koopman, who was an expert witness for the plaintiffs in the Toyota-Brookout unintended acceleration case, explained some 20 per cent of what he knew of the case: the other 80 per cent being covered by NDAs and court orders. The following is my assessment, not Koopman’s comments.

Toyota lost the case partly because another expert witness could inject an error that could theoretically cause the problem, even if no one could show that it actually happened. However, the other reason Toyota lost was because the code was not Misra C compliant.

That is a bit flippant, but also sort of true. The expert witnesses did talk about the vast number of examples in the code that are Misra C: 2004 errors. Some of the source predates 2004, but Misra C: 2004 was version two of Misra C: 1998, itself a codification of what was considered good practice from the mid 1990s. So while the code was not Misra C compliant neither was it what would be considered good practice.

In fact the plaintiffs' lawyer famously said,  “…they put what’s called spaghetti in their code”. What killed the case was that to a jury of lay people the code was a mess, not even up to standard good practice let alone best practice. It has been surmised by some that the plaintiffs won largely because there were no programmers on the jury who would say “Yeah, that’s coding for you!” and shrug it off. This is in itself a serious problem: software people shouldn't just shrug it off and say “that’s coding”. Non-programmers, such as vehicle owners and their lawyers, are going to expect good practice if not best practice.

In the VW emissions test, senior management have been reported as suggesting that the code to defeat the emissions test was created by “a couple of rogue programmers”. Many people thought it was believable that a few programmers did it: programming has that sort of reputation. Software development generally, not just in automotive, needs to grow up and become a serious profession. 

But wait! The automotive marketing teams are demanding in-vehicle infotainment and a host of fancy features. This adds a full home IT and entertainment system, and more, to the vehicle.

Not long after the HIS conference, I was at the IoT Security Foundation Conference. There weren’t, as far as I could tell, any automotive people at the conference, despite two of the presentations being on hacking mobile IoT devices. Yes cars are now becoming IoT connected devices. The horse has left the stable.

The headline presentation was how to hack a Tesla S. This was fascinating for the embedded people present as it was clear that with the infotainment system the hackers were effectively working in an IT world. When it was argued that Linux was perhaps not the best for this system the response was that it was better than Windows. Many of us in the room agreed but said both were unsuitable. However, the response was infotainment uses these systems, and if you want infotainment you have to accept an IT type system.

That being so, then the interface between infotainment and the safety critical systems in, for instance, the drive train has to be well defined and secure. This was the case with the Tesla. Despite having physical access to the hardware, including connectors on circuit boards, the hacking team had enormous difficulty going any further. They had access to the source code of the rtos, and the developers had made some implementation errors, but they had very limited success in breaking through the gateway.

Tesla had clearly thought through the problems. Other presentations mentioned hacks through the Wifi on various vehicles, notably the Jeep hack. It seems fairly clear that Jeep, along with others, had not adequately partitioned the infotainment system, with its communications interfaces, from the control system. Modern vehicles, with Bluetooth, Wifi, USB and mobile phone connections for two way data and associated connectors, are easy targets for casual hackers. The sort of people who, when sitting in a coffee shop see a range of Wifi targets, some from cars outside in the car park, look just to see what they are and what happens if they interrogate them.

For more serious hackers, they can legitimately obtain a car and investigate it, just as the Tesla hackers did: much easier than trying to hack a bank or industrial plant.

Did you notice that we have moved from bad automotive software unintentionally causing errors to intentional hacking? Modern vehicles are now targets and have more software with more control and more access points than many other systems.

Even though, in many cases, the basic software is not good, we are seeing more and more advanced driver assistance systems, leading to fully autonomous vehicles. When the inevitable crashes and injuries occur, who then will be responsible; the driver, the system specifier, the coder? Probably that will depend on whose barrister argues what and who is on the jury.

The third event I went to was the Safety Critical Systems Club's The Ethics of Acceptable Safety. There were a lot of people from the defence industry there. Interestingly, despite, as I said earlier, vehicles regularly killing more people per year than the weapons, there were no representative of the automotive industry: a pity.

Apart from cleaning up the atrocious standard of a lot of automotive spaghetti, at least to the level of order perhaps of lasagne, and thinking about what automation and connectivity there should be, there is a need for a long hard look at the ethics and security of vehicles as much as any other weapon of mass destruction.

 

Chris Hills is technical specialist with Phaedrus Systems

 

www.phaedsys.com

 

Recommend to Colleagues: