Return to Video

Software Defined Emissions (33c3)

  • 0:00 - 0:13
    33c3 intro music
  • 0:13 - 0:16
    Herald: Let me present Felix Domke with
  • 0:16 - 0:20
    the Software Defined Emissions: A Hacker's
    Review of Dieselgate.
  • 0:20 - 0:26
    applause
  • 0:26 - 0:29
    Felix Domke: Yeah, hey everyone. Thank you
  • 0:29 - 0:34
    for coming here. I saw there are a lot of
    interesting talks at the same time in the
  • 0:34 - 0:39
    other rooms, so thank you for coming here
    and listening to me about software-defined
  • 0:39 - 0:46
    emissions. "A Hacker's Review of
    Dieselgate" is the subtitle. I'm Felix
  • 0:46 - 0:53
    Domke. I usually do embedded software,
    mainly security. I'm definitely not on
  • 0:53 - 0:59
    cars and definitely not on things that
    have combustion thingies, so I only got
  • 0:59 - 1:04
    dragged into car software last year when
    my own Volkswagen car was accused of
  • 1:04 - 1:11
    cheating and I wanted to know what exactly
    was going on. I held the talk last year
  • 1:11 - 1:16
    about some of the details of the
    Volkswagen Sharan defeat device. For the
  • 1:16 - 1:21
    details you can take a look at that talk.
    This time I want to look more at the
  • 1:21 - 1:27
    process of finding or analyzing car
    software. I want to look at whether this
  • 1:27 - 1:36
    process scales to more cars. The first
    step when having a piece of software that
  • 1:36 - 1:41
    does not always do what people think it
    does is, well obtain a firmware image,
  • 1:41 - 1:46
    obtain a binary image of the firmware, and
    in the case of my car I knew it was a
  • 1:46 - 1:52
    Bosch EDC17, which is a Bosch ECU that a
    lot of cars use, including my Volkswagen
  • 1:52 - 1:58
    car. So, I didn't know anything about
    ECUs, dumping software and so on, so I
  • 1:58 - 2:02
    asked Google "Hey, what do I need to do to
    dump an EDC 17," and Google had a lot of
  • 2:02 - 2:08
    answers for this, but usually those were
    people that wanted to sell me some device.
  • 2:08 - 2:13
    Those were chip tuners that built their
    own devices where you can plug in the ECU
  • 2:13 - 2:19
    and then it extracts the image, usually by
    exploiting some bugs in the software. But
  • 2:19 - 2:23
    I didn't really want to buy something and
    it takes like a lot of time until I get in
  • 2:23 - 2:28
    my hands. I wanted to start. So I was
    looking to do this on my own. What these
  • 2:28 - 2:35
    sites usually tell you without paying is
    how you wire up your given ECU for their
  • 2:35 - 2:42
    device, so they tell you where to connect
    12 volt, where to connect the CAN bus,
  • 2:42 - 2:47
    which is the serial communication bus that
    the ECU uses to communicate with the rest
  • 2:47 - 2:54
    of the car
    devices. Usually it's pretty easy, so...
  • 2:54 - 2:58
    when analyzing ECU it makes a lot of sense
    to reproduce the scenario on your desk and
  • 2:58 - 3:05
    not in your car, so in order to make an
    ECU boot all you need is ground, 12 volts,
  • 3:05 - 3:10
    there's usually an ignition pin that you
    also have to supply 12 volt to it, and
  • 3:10 - 3:16
    then it boots. So on my desk it looked
    something like this, and then once we have
  • 3:16 - 3:23
    the setup we can boot the ECU, we can use
    Python to talk to the ECU, which is great,
  • 3:23 - 3:28
    and then we can use socket CAN, which is
    the Linux CAN support that's really great,
  • 3:28 - 3:32
    and we can even use MicroPython if we
    want to have a smaller device that we can
  • 3:32 - 3:39
    put in a car. So we can talk with the ECU.
    Talking with the ECU in modern cars,
  • 3:39 - 3:45
    there's a protocol called UDS. Basically,
    I simplified this slightly, you can ask
  • 3:45 - 3:50
    the ECU "Hey, I want to read memory by
    address," you give it an address and you
  • 3:50 - 3:55
    ask it to read four bytes in this case of
    that address, and then it returns it to
  • 3:55 - 4:01
    you. So I thought "Hey, maybe I can use
    this to dump the software." In my case the
  • 4:01 - 4:05
    device responds with a Security Access
    Denied, so I looked into what I need to
  • 4:05 - 4:10
    do. You actually have to do a Security
    Access command. You send a command that's
  • 4:10 - 4:16
    called Request Seed. You get back
    basically a 32 bit random number and then
  • 4:16 - 4:20
    what you have to do is to, have to
    process this seed through a super-secret
  • 4:20 - 4:25
    function and then return it in a response
    call. The question is how do we know this
  • 4:25 - 4:30
    super secret function. There are multiple
    methods. We can look at the ECU software
  • 4:30 - 4:34
    itself, if the algorithms in there, to
    verify it. We can reverse diagnostic
  • 4:34 - 4:40
    software that uses this mechanism. So for
    example the Volkswagen software they use
  • 4:40 - 4:43
    for car shops, or maybe someone else
    already reversed this and put it in their
  • 4:43 - 4:49
    own tools which may be easier to get it
    from in terms of third-party diagnostic
  • 4:49 - 4:55
    software. And in the case of my Bosch ECU,
    the super secret function was this. I
  • 4:55 - 5:00
    basically had to add this number to it.
    The mechanism is called pin code.
  • 5:00 - 5:06
    It's in... I mean it's not super
    secret. Anyway, once I know this...
  • 5:06 - 5:14
    applause
    Yeah, thank you. I mean, it... once you
  • 5:14 - 5:19
    do this, you send back the result and hey,
    then you can read... you can send the read
  • 5:19 - 5:24
    command again and, hey you're getting back
    data, so this is great, right? We can read
  • 5:24 - 5:29
    memory at runtime of the ECU, and we can
    even do this while the car is operating.
  • 5:29 - 5:34
    However it turns out that for the Bosch
    ECU you can only dump specific regions. You
  • 5:34 - 5:39
    can dump most of memory, some memory areas
    are excluded, but most of the interesting
  • 5:39 - 5:44
    stuff you can read. But you can't read any
    code. You cannot read anything in flash.
  • 5:44 - 5:50
    But we are hackers, of course, so we find
    a way. The CPU used in these ECUs is a
  • 5:50 - 5:57
    Infineon TriCore CPU, and it's used, at
    least this particular one, was used in the
  • 5:57 - 6:04
    ECU I cared about, and the security model
    for this chip is that you can always enter
  • 6:04 - 6:08
    a specific bootloader mode and execute
    your own code, so you can strap a few
  • 6:08 - 6:11
    lines they... the chip tuners tell you
    that, right, they tell you what's high and
  • 6:11 - 6:17
    low, which pins you have to connect your
    ground and 3.3 volt, and then it enters
  • 6:17 - 6:21
    this bootloader mode, you can upload some
    piece of code. However, you can't read the
  • 6:21 - 6:26
    flash, because the flash is locked. When
    you start in bootloader mode, the flash is
  • 6:26 - 6:33
    not readable until you write a specific
    password to a register. That was not so
  • 6:33 - 6:37
    great, so I looked into what else I could
    do. The datasheet is very specific on how
  • 6:37 - 6:43
    to operate this chip. For example there's
    this one flash supply pin. So, even though
  • 6:43 - 6:47
    the flash is in the same package as the
    rest of the CPU, it has a dedicated supply
  • 6:47 - 6:53
    pin and it tells you which parameters not
    to exceed to ensure correct operation, but
  • 6:53 - 6:57
    I really don't want the correct operation
    which is in this case preventing me from
  • 6:57 - 7:03
    dumping the flash. So, what can we do? We
    can violate the requirements. The
  • 7:03 - 7:06
    requirements for 3.3 volts. Let's see what
    happens outside of that range. And turns
  • 7:06 - 7:12
    out, down to a certain voltage level,
    roughly 1.6 volt, everything just works as
  • 7:12 - 7:18
    normal. That doesn't help us.
    And below that voltage the device hangs in
  • 7:18 - 7:21
    the bootloader, so that doesn't help us
    either. The interesting parts happened
  • 7:21 - 7:26
    when you are at the very specific voltage
    level, and this is a little bit
  • 7:26 - 7:31
    unscientific, because it's really just the
    voltage level I tried, and then most of
  • 7:31 - 7:35
    the time the device comes up and flash is
    protected, and then the remaining times
  • 7:35 - 7:39
    the device comes up and hangs in the
    bootloader. But one in 10 times something
  • 7:39 - 7:45
    interesting happened. The device came up
    and the flash was not protected, so I
  • 7:45 - 7:54
    could dump it out.
    applause
  • 7:54 - 7:58
    So having the image now in my hands, I
    could start in actually reversing the
  • 7:58 - 8:03
    defeat device and what I found was - I
    don't want to duplicate a lot of what I
  • 8:03 - 8:07
    talked about in the last talk - I found a
    function called "acoustic function," or
  • 8:07 - 8:13
    "Akustikfunktion" in German. It's a
    function that senses vehicle speed, the
  • 8:13 - 8:17
    duration of the engine operation, and some
    other things, and then controls emission
  • 8:17 - 8:21
    related functionality, or in short you can
    say that this is the test cycle detection
  • 8:21 - 8:26
    that enables the defeat device. And I
    verified it to exist on my Sharan device
  • 8:26 - 8:32
    by driving through the test cycle and
    logging data. And during the last year I
  • 8:32 - 8:37
    verified that it's actually the same
    defeat device, more or less, that exists
  • 8:37 - 8:41
    on a lot of other Volkswagen cars. All
    these Volkswagen defeat devices that we
  • 8:41 - 8:46
    talked about for the Euro 5 cars, they use
    more or less the same acoustic function.
  • 8:46 - 8:51
    Basically, to remind you, there are a few
    curves stored in the software that look
  • 8:51 - 9:00
    like this. This is the NEDC. This is the
    test cycle you have to drive a car
  • 9:00 - 9:05
    through. They exactly define how fast you
    have to drive for a given time in seconds,
  • 9:05 - 9:10
    so it's speed over time. If we draw this
    as distance over time it looks like this.
  • 9:10 - 9:17
    So this is the distance you got. You're
    not really moving the car, because you're
  • 9:17 - 9:22
    doing this in a lab on a dynamometer, but
    what the car thinks it has moved to, and
  • 9:22 - 9:26
    if we overlay this with the curves we
    found in a software there's a perfect
  • 9:26 - 9:31
    match. So this is the way how they
    describe the test cycle. So this was for
  • 9:31 - 9:37
    my Sharan. So I looked into, what do the
    other cars do, especially what do the
  • 9:37 - 9:42
    cars in North America do, because they're
    not using the NEDC. And I found something
  • 9:42 - 9:48
    interesting, or some someone sent an
    interesting document to me, that was this.
  • 9:48 - 9:54
    It was an emission service action. It
    basically describes how there was a recall
  • 9:54 - 9:58
    for some vehicles, that required a
    software update in the shop.
  • 9:58 - 10:03
    So this is basically the document that
    informs the car shop what they have to do,
  • 10:03 - 10:09
    and it had something very interesting in
    it. By the way, this was in December 2014,
  • 10:09 - 10:13
    so this was way before the whole
    Dieselgate was public, but this was
  • 10:13 - 10:17
    already while the EPA was already talking
    with Volkswagen, already demanding
  • 10:17 - 10:22
    explanations. All that investigation was
    already proceeding. Volkswagen knew about
  • 10:22 - 10:27
    this, that people figured out about the
    defeat device, and it had something very
  • 10:27 - 10:31
    interesting in it, that said "in addition,
    the vehicle's engine management software
  • 10:31 - 10:35
    had been improved to ensure the vehicle's
    tailpipe emissions are optimized and
  • 10:35 - 10:41
    operating efficiently." That sounds really
    fishy to me, so I was curious, what
  • 10:41 - 10:46
    exactly did they change in the software
    update? And luckily they tell you the old
  • 10:46 - 10:53
    and the new software versions, and you can
    then go and look them up on a firmware
  • 10:53 - 10:58
    DVD, that you can download on the
    Volkswagen website, and it turned out that
  • 10:58 - 11:03
    it's an ECU software similar to the the
    Bosch ECU software I looked at before. So
  • 11:03 - 11:08
    there's an acoustic function again there,
    and the curve stored there, they match the
  • 11:08 - 11:15
    US test cycles. This is one of them. There
    are many more test cycles in the US, so
  • 11:15 - 11:18
    there's another curve that matches this,
    and this is the curve stored in the
  • 11:18 - 11:27
    software and this is the corresponding
    test cycle. And there are a lot of them.
  • 11:27 - 11:33
    But I noticed something really
    interesting, and some of the curves...
  • 11:33 - 11:42
    they were much wider open than the other
    ones. So for example this one... there's
  • 11:42 - 11:46
    really a nonzero probability that if you
    just have your morning commute, through, I
  • 11:46 - 11:50
    don't know, some streets or something,
    that you accidentally match this driving
  • 11:50 - 11:55
    cycle every time you start driving in the
    morning, so the car would, every time you
  • 11:55 - 12:00
    drive this, think it is in test cycle
    mode, and would operate with the
  • 12:00 - 12:06
    optimized... in the optimized emission
    mode and apparently this caused problems
  • 12:06 - 12:12
    and what I saw, what Volkswagen added in
    the software that was part of this recall,
  • 12:12 - 12:16
    was this function. So, this is from it
    from a disassembly. In pseudocode, this is
  • 12:16 - 12:22
    this. So they started looking at the
    steering wheel angle, and if they figured
  • 12:22 - 12:28
    out that you move the steering wheel
    angle, then they ignored the curves, the
  • 12:28 - 12:32
    more open curves. So the idea is "Yeah, if
    you move the steering wheel, you're
  • 12:32 - 12:39
    definitely not in a test cycle, so at that
    point we do not try to operate in this
  • 12:39 - 12:43
    emission optimized mode. And it's a
    little bit of speculation, but it matches
  • 12:43 - 12:48
    up pretty well with with all the facts
    that I read, is that because those cars
  • 12:48 - 12:53
    operated in the test cycle mode too often,
    that eventually caused the the particulate
  • 12:53 - 13:00
    filters to clog, and their solution for
    Volkswagen, and again, this was while they
  • 13:00 - 13:05
    were already investigated by the EPA, was
    to add the steering wheel angle detection.
  • 13:05 - 13:09
    For more details, I worked with this with
    the NDR, and they produced a feature on
  • 13:09 - 13:14
    that, so there are some more details.
    So this is Volkswagen, but there are more
  • 13:14 - 13:21
    cars, and if we look at this... this is a
    meta-study based on something that the the
  • 13:21 - 13:26
    Ministry of Transport... they tested a lot
    of diesel cars and what they found was
  • 13:26 - 13:32
    this. This is actually a representation by
    the ICCT. So the orange line is the
  • 13:32 - 13:39
    emission limit, and the bars have an upper
    and lower end, and the lower end is how
  • 13:39 - 13:44
    much emissions the cars have. This is just
    for nitrogen oxides, for NOx emissions,
  • 13:44 - 13:49
    what they had in the lab, when you're
    driving the test cycle. So and you can see
  • 13:49 - 13:53
    all of these cars managed to stay under
    the orange line, so they get their
  • 13:53 - 13:58
    certification, but when driving them on a
    real street, they produce the emissions
  • 13:58 - 14:02
    corresponding to the upper end of that
    bar, which is for some cars significantly
  • 14:02 - 14:09
    higher. It's off by a factor of 10 and
    more. When you're driving the car on a
  • 14:09 - 14:13
    street. And this is interesting, because
    the cars, they can meet the emission
  • 14:13 - 14:17
    goals. The question is why don't they
    always meet the emission goals?
  • 14:17 - 14:23
    Why do they operate so differently in the
    test cycle than on the street? And I try
  • 14:23 - 14:29
    to give you a partial answer. And let's
    look at how a car can optimize emissions.
  • 14:29 - 14:33
    The first thing they do... so this is a
    very simplified diesel engine. So fresh
  • 14:33 - 14:39
    air goes in, fuel goes out, and there's an
    exhaust pipe, right? And a lot of nitrogen
  • 14:39 - 14:45
    oxide, a lot of NOx, goes out as well, and
    we don't want that. So we added an EGR
  • 14:45 - 14:49
    valve, which is basically a valve that
    causes a part... a fraction of the
  • 14:49 - 14:54
    outgoing air to recirculate again through
    the engine and burn again. And what this
  • 14:54 - 14:59
    causes is that the flame temperature goes
    down, and if we look at the relationship,
  • 14:59 - 15:05
    it's very simplified here, but with a
    lower flame temperature you get fewer NOx
  • 15:05 - 15:11
    concentrations, so you improve emissions
    by lowering the flame temperature, however
  • 15:11 - 15:18
    at the same time you're increasing the
    soot level, or the particulate matter, and
  • 15:18 - 15:23
    there is this trade-off - if you do too
    much of EGR, too much of the exhaust gas
  • 15:23 - 15:28
    recirculation, you're getting too much
    soot, and the other hand if you do it too
  • 15:28 - 15:32
    few, you get too much NOx, so you can
    argue that the green area isn't really
  • 15:32 - 15:37
    great, because there's no point where both
    of them are great. And here we see the
  • 15:37 - 15:46
    result of a clogged EGR valve. If there's
    too much soot it will clog. EGR, as the
  • 15:46 - 15:54
    conclusion, is the least cost solution. It
    doesn't really work at higher loads. It
  • 15:54 - 15:58
    works at low loads, and it does not
    require exhaust... high exhaust
  • 15:58 - 16:03
    temperatures, which is great, but
    excessive use of that clogs particulate
  • 16:03 - 16:07
    filters, affects the combustion, the
    drivability goes down, and there are
  • 16:07 - 16:11
    trade-offs with this. It's also not very
    useful for higher engine loads, for
  • 16:11 - 16:17
    example when you're accelerating you have
    to disable EGR at high speeds. So a better
  • 16:17 - 16:22
    method, that was added on top of this, is
    called "selective catalytic reduction". I
  • 16:22 - 16:27
    am... so, basically the idea is you have
    an SCR catalyst in your exhaust pipe...
  • 16:27 - 16:34
    there are more catalysts there, but let's
    talk about NOx, and in there, this
  • 16:34 - 16:40
    happens. We can simplify this, somehow,
    and say if you put ammonia into this
  • 16:40 - 16:44
    catalyst, the NOx is converted to nitrogen
    and water.
  • 16:44 - 16:48
    And Nitrogen and water is great, it's
    harmless. It's already part of the air.
  • 16:48 - 16:53
    The only issue is ammonia is this and this
    is not something you want the driver to
  • 16:53 - 16:59
    refill in your car. So instead this
    solution is we can create ammonia in the
  • 16:59 - 17:03
    car from using from something that's less
    dangerous, and we have the reaction there.
  • 17:03 - 17:10
    We can simplify this again and say we take
    urea - Harnstoff auf Deutsch - and heat,
  • 17:10 - 17:16
    and we create ammonia. Urea or urea
    solution is this. It's called AdBlue or
  • 17:16 - 17:21
    DEF - diesel exhaust fluid - it's not
    dangerous. You can buy it, you can
  • 17:21 - 17:26
    transport it... it's relatively cheap. The
    idea is, we have this reaction, it
  • 17:26 - 17:33
    requires ammonia in the catalyst, and we
    put AdBlue into it, or urea, and using the
  • 17:33 - 17:36
    heat that we have from the exhaust pipe,
    we create the ammonia that we need to
  • 17:36 - 17:44
    reduce the nitrogen oxides back to
    nitrogen and water. There's a great
  • 17:44 - 17:48
    property of this, that some of the ammonia
    that's produced in the catalyst stays
  • 17:48 - 17:53
    there until it's used up, so
    there's some storage there. So the the
  • 17:53 - 17:57
    requirement for creating ammonia is heat,
    and if you don't have heat, but for
  • 17:57 - 18:01
    example because you just started up your
    engine... if there is still ammonia from
  • 18:01 - 18:06
    the last usage in your catalyst you can
    still use that, and use that up, and by
  • 18:06 - 18:10
    the time you have used it up, maybe the
    heat is enough to supply more AdBlue and
  • 18:10 - 18:18
    then fill up that storage. The downside is
    you need a pump to dose the AdBlue, and
  • 18:18 - 18:22
    you need lots of software to control this
    process. And you need a heater because the
  • 18:22 - 18:26
    AdBlue freezes at some point, and it's an
    expensive solution, it adds roughly $500
  • 18:26 - 18:32
    to a car, which can be significant amount
    of money for a small car, and it requires
  • 18:32 - 18:38
    a large AdBlue tank for long service
    intervals, so you don't have to refill it
  • 18:38 - 18:42
    every few thousand kilometers or
    something. The great thing about SCR is
  • 18:42 - 18:48
    that it's efficient at higher loads.
    There's a third method called LNT, Lean
  • 18:48 - 18:52
    NOx Trap, it's cheaper than SCR for
    smaller engine, it doesn't require
  • 18:52 - 18:54
    anything,
    however the bad thing is it requires
  • 18:54 - 18:59
    frequent re-generation, which decreases
    fuel efficiency, so it's kind of a stop-
  • 18:59 - 19:03
    gap solution. And it's not efficient for
    continuous high engine load, for example
  • 19:03 - 19:07
    if you're driving on the German Autobahn
    at full speed, then LNT is not going to
  • 19:07 - 19:13
    help you much. For the sake of this talk,
    let's keep in mind that EGR is exhaust gas
  • 19:13 - 19:16
    recirculation, that's the thing that
    operates within the engine and then we
  • 19:16 - 19:21
    have the SCR, the selective catalytic
    reduction, that uses AdBlue and is after
  • 19:21 - 19:27
    the engine. We also saw that all these
    technologies have significant trade-offs
  • 19:27 - 19:32
    for NOx compliance, so we can kind of see
    the motivation for a defeat device here,
  • 19:32 - 19:37
    because it would be the solution to all of
    these trade-offs. You get no downsides
  • 19:37 - 19:43
    during regular driving, because nobody can
    measure your emissions and while
  • 19:43 - 19:47
    maintaining conformance because during a
    test cycle you have perfect emissions.
  • 19:47 - 19:54
    That kind of explains why there are defeat
    devices. OK, let's get back to the bigger
  • 19:54 - 20:02
    picture and see what other cars do. So
    this is an Opel car, it's a Zafira car,
  • 20:02 - 20:07
    it's a Euro 6 car, it's a pretty modern
    car, it has an SCR catalyst. In theory it
  • 20:07 - 20:14
    should have really great, low emissions,
    especially at higher speeds because that's
  • 20:14 - 20:18
    where SCR is good at. But quite
    surprisingly it doesn't. If we look again
  • 20:18 - 20:24
    at this report, we can see that this
    Zafira exceeds the limit by up to 12x
  • 20:24 - 20:29
    compared to the Euro 6 limit. This is
    especially interesting because there's
  • 20:29 - 20:35
    this Opel advertisement where they
    advertise their diesel technology applying
  • 20:35 - 20:40
    to the Insignia and the Zafira and they
    say a lot of diesel fun without regrets,
  • 20:40 - 20:45
    the new diesel generation of Opel achieves
    best emission values and gasoline levels.
  • 20:45 - 20:49
    Yeah, after they got sued for this they
    had to change it slightly and they had to
  • 20:49 - 20:54
    add this to the sentence.
    scattered laughter
  • 20:56 - 20:59
    So, during this testing, they had
    this 12x emission
  • 20:59 - 21:03
    limits. For example, one particular test
    was to drive the test cycle in the same
  • 21:03 - 21:06
    way, but at a different temperature,
    at 10°C,
  • 21:06 - 21:10
    and the car exceeded the
    values by a factor of 6 even though the
  • 21:10 - 21:15
    car would be operated in the very same
    way. It was just that the ambient air
  • 21:15 - 21:22
    temperature was 10°C instead
    of 25. So they asked Opel why this was the
  • 21:22 - 21:27
    case during their investigation, and Opel
    responded, saying that the EGR and the SCR
  • 21:27 - 21:33
    injection, they work to the full extent in
    the temperature range of 20 to 30°C.
  • 21:33 - 21:42
    It's what they call "normal use".
    So our question was, is it really just the
  • 21:42 - 21:50
    temperature window? So we got a car and
    investigated. The ECU in that car is a
  • 21:50 - 21:56
    General Motors ECU. It's developed in-
    house, Opel is a GM daughter. It uses an
  • 21:56 - 22:06
    automotive PowerPC, yay PowerPC! It uses
    somewhat obscure variable length
  • 22:06 - 22:13
    instruction extension to PowerPC. So how
    do we start? Again, we need a firmware
  • 22:13 - 22:19
    image. So let's ask the Internet, "How do
    I dump this ECU?" Luckily, someone in some
  • 22:19 - 22:24
    chip tuning forum already uploaded their
    stock ECU, which means they're what they
  • 22:24 - 22:30
    dumped from their ECU using some chip
    tuning tool. It's not the same ECU, but
  • 22:30 - 22:34
    it's very similar and I hope they shared
    some code so I can analyze the software,
  • 22:34 - 22:41
    maybe find a way to dump it. So the dump
    was made with this tool and the tool did
  • 22:41 - 22:46
    not let me export the binary. And the tool
    is free, however to use any of the
  • 22:46 - 22:51
    features in that software, you have to buy
    their expensive hardware, that then
  • 22:51 - 22:56
    connects to the car, which I didn't want.
    This is how their software looks like. I
  • 22:56 - 22:59
    loaded the image I found on the internet,
    and I couldn't save it or anything without
  • 22:59 - 23:05
    having the device attached. However, I can
    just use a memory debugger and just dump
  • 23:05 - 23:10
    it from the address space, and that gave
    me a first firmware image to start with. I
  • 23:10 - 23:14
    threw it in a disassembler and I found the
    UDS function and, yeah, it implements read
  • 23:14 - 23:19
    memory by address, so that's good. Most of
    the RAM was readable without a security
  • 23:19 - 23:25
    challenge. That is good, so I didn't even
    need a security challenge to read RAM.
  • 23:25 - 23:30
    However, the flash, it is readable, but
    only with the security challenge. So let's
  • 23:30 - 23:37
    take a look at the security challenge.
    Maybe it's as simple as the Bosch one. So
  • 23:37 - 23:41
    their way of doing this is, they store
    16-bit input and output value in the
  • 23:41 - 23:45
    firmware, and it's different for every
    device, and they don't store the algorithm
  • 23:45 - 23:51
    to compute the output from the input,
    instead they just store the pair, and,
  • 23:51 - 23:56
    well, it's just 16 bit, right, so let's
    brute force it. The issue is, you can only
  • 23:56 - 24:03
    try every 15 seconds, so it's kind of
    lame. The question is, how do the GM
  • 24:03 - 24:08
    tools, the original factory tools, get
    access to that? Luckily, chip tuners had
  • 24:08 - 24:13
    reversed that and then obfuscated it into
    their own tools. But that can be de-
  • 24:13 - 24:19
    obfuscated and eventually it's just a
    little bit amount of bit shifting and so
  • 24:19 - 24:26
    that was easy to fix. And also the the GM
    repair manuals tell you how to wire up the
  • 24:26 - 24:31
    ECU. They tell you where to put 12 volts,
    the CAN bus again, and ground, and the
  • 24:31 - 24:36
    ignition pin, and with all of that in
    place, I can do the security challenge. I
  • 24:36 - 24:42
    can now read all of flash memory and read
    the four megabytes of PowerPC code, which
  • 24:42 - 24:47
    mostly consists of mathematical functions.
    There are no strings or anything, it's
  • 24:47 - 24:52
    really hard to find what a function does,
    what... There are thousands of variables.
  • 24:52 - 24:56
    It's really hard to find what they mean,
    right, so I need to know some entry
  • 24:56 - 25:01
    points, some known data values, and then I
    could refer to... one thing I could find
  • 25:01 - 25:06
    are real-world constants, for example
    there's the density of diesel fuel stored,
  • 25:06 - 25:11
    which allows me to understand that this is
    something related to fuel, an amount of
  • 25:11 - 25:17
    fuel. Or more useful are the OBD2 calls.
    So there are some standardized things you
  • 25:17 - 25:22
    can ask an ECU, that's engine rpm, vehicle
    speed, and things like that, and I would
  • 25:22 - 25:28
    find that table in the firmware and then I
    had a first start of things like RPM,
  • 25:28 - 25:33
    speed, and so on. That was a good start.
    It's not much more than what you can see
  • 25:33 - 25:37
    here. So there's a lot of stuff not
    included in these.
  • 25:37 - 25:40
    The next thing I did was, I drove the car
  • 25:40 - 25:44
    for a few weeks and I let a device
    attached that would constantly log all
  • 25:44 - 25:50
    memory using the rebuy address thing, and
    every few minutes I would get one memory
  • 25:50 - 25:55
    dump, basically. It's a few hundred
    kilobytes of RAM, and then I put this into
  • 25:55 - 26:01
    my disassembly, and that allowed me to
    understand more of what individual
  • 26:01 - 26:07
    variables do there. And I found some
    interesting things. So the first thing,
  • 26:07 - 26:11
    one of the first things I found, was
    basically something that resembles this.
  • 26:11 - 26:16
    So there was something that look at the
    ambient temperature, and this basically
  • 26:16 - 26:23
    checks for range, right, and it did...
    this was for controlling the SCR systems,
  • 26:23 - 26:28
    and it's interesting to know that the NEDC
    requires the temperature between 20
  • 26:28 - 26:32
    and 30°C, and this is right
    centered around this, when they check from
  • 26:32 - 26:39
    17.5 to 33°C. But this was of
    course nothing new. I found something
  • 26:39 - 26:44
    similar, however, another temperature
    check. And as you can see it's written in
  • 26:44 - 26:48
    a different way. It effectively achieves
    the same thing, but it's a separate piece
  • 26:48 - 26:53
    of code, and this time it was for the EGR
    system. So we have these two exhaust
  • 26:53 - 26:58
    treatment or optimization mechanisms
    there, EGR and SCR, and they don't share
  • 26:58 - 27:02
    code. They have their own temperature
    window. So we found the temperature
  • 27:02 - 27:06
    window, which was known to exist. The
    question was, is there more? And one thing
  • 27:06 - 27:12
    we found was this: It's basically reading
    the vehicle speed and comparing to a fixed
  • 27:12 - 27:18
    number, and it turned out it's something
    like this. So it would check the
  • 27:18 - 27:24
    vehicle speed and if it's above 145 km/h
    it would set a flag and then under 140 it
  • 27:24 - 27:27
    would clear. Keep in mind that the NEDC
    maximum speed
  • 27:27 - 27:34
    120 km/h, so during a test cycle that
    would never happen. So let's see if this,
  • 27:34 - 27:39
    what we found in software, if this really
    translate something the car does in the
  • 27:39 - 27:45
    real world, and it's getting slightly
    technical here, I apologize, but we need
  • 27:45 - 27:52
    to log some variables and a useful value
    to to know is, how much NOx is there after
  • 27:52 - 27:57
    the engine, and after the SCR catalyst,
    and luckily there are 2 NOx sensors in the
  • 27:57 - 28:01
    car. One before and one after the
    catalyst, and they give you basically the
  • 28:01 - 28:05
    NOx concentration in ppm. So we log that,
    and we also log the signal of how much
  • 28:05 - 28:10
    AdBlue is dosed into the system, and we
    log the catalyst temperature. And one
  • 28:10 - 28:14
    thing to keep in mind is that there's also
    this amount of ammonia that's stored in
  • 28:14 - 28:19
    the catalyst. We don't have this as a
    value, but just keep this in mind. And
  • 28:19 - 28:27
    this is how we've driven the car. The
    blue line is the vehicle speed. You can
  • 28:27 - 28:34
    see that it goes from 0 to 150 km/h, and
    the critical point here is the 145 km/h
  • 28:34 - 28:39
    that we found in the firmware. The green
    one is the catalyst temperature, which we
  • 28:39 - 28:46
    see between ambient level, and then up to
    380 degrees. The critical point here is
  • 28:46 - 28:53
    200 degrees Celsius, where this urea to
    ammonia process starts to work. We logged
  • 28:53 - 28:58
    something that is the SCR strategy. So it
    turns out there are multiple ways how the
  • 28:58 - 29:05
    ECU computes how much AdBlue to dose and I
    call them strategy. So 0 means off, no
  • 29:05 - 29:09
    AdBlue is dosed. 1 means the regular way
    that keeps into account the storage
  • 29:09 - 29:15
    mechanism, and then 2 is a special reduced
    way. And then also we log the actual
  • 29:15 - 29:24
    dosing value. And then we also had the
    sensor data from between the engine and
  • 29:24 - 29:32
    the catalyst, and between the catalyst
    and the exhaust. The first thing that
  • 29:32 - 29:38
    happens... or, actually nothing happens
    until the point where we reach 200°C
  • 29:38 - 29:47
    at the catalyst. You can...
    until that point, as I said the required
  • 29:47 - 29:51
    temperature is not... does not allow
    AdBlue dosing, and then it starts dosing
  • 29:51 - 29:59
    quite a few amount of AdBlue. But then,
    when we cross the 145 km/h, the SCR
  • 29:59 - 30:07
    strategy changes, and no further AdBlue is
    dosed until basically this point, and this
  • 30:07 - 30:15
    point is exactly 120 seconds after we go
    lower than 140 km/h. So this matches what
  • 30:15 - 30:17
    we found
    in the software, right, this was what we
  • 30:17 - 30:20
    found in the
    software. So we can see that this was
  • 30:20 - 30:28
    actually true. This is real behavior of
    the ECU. And to look at the effect of
  • 30:28 - 30:35
    this, you have to check the difference
    between the blue and the green line in the
  • 30:35 - 30:41
    lower diagram, between basically the
    amount of NOx that is removed by the SCR
  • 30:41 - 30:46
    catalyst. And you can see during the
    regular operation quite a lot of NOx is
  • 30:46 - 30:50
    removed. The blue line goes up because
    we're driving faster and faster, and the
  • 30:50 - 30:57
    green line goes down almost to zero, and
    this this works for quite a while, and it
  • 30:57 - 31:03
    even keeps working a while until the
    catalyst runs out of ammonia, and then it
  • 31:03 - 31:07
    would need more AdBlue to operate, but
    because we're in the reduced mode it does
  • 31:07 - 31:14
    not put any more AdBlue into the system.
    So the SCR basically stops working, and
  • 31:14 - 31:19
    the emission levels reach the engine
    emissions, so no further... The SCR system
  • 31:19 - 31:25
    does not work in this red area. And here
    we see this again, so here are the
  • 31:25 - 31:28
    sequences of active dosing. Here we see
    where the catalyst temperature is too low
  • 31:28 - 31:34
    for dosing. We see the regular operation.
    We see where it's still working,
  • 31:34 - 31:38
    because there's still ammonia stored and
    then until we run out of ammonia and no
  • 31:38 - 31:46
    refill happens, until exactly 120 seconds
    after going below 140 kilometers an hour.
  • 31:46 - 31:53
    So our conclusion after this is that the
    SCR is programmed to stop working at 145
  • 31:53 - 31:58
    km/h. The efficiency goes to 0. Opel
    offered a hand-waving explanation, one of
  • 31:58 - 32:02
    the press releases why this is necessary.
    They argued with some physical details,
  • 32:02 - 32:08
    and we presented these physical details to
    some experts, professors that work with
  • 32:08 - 32:14
    combustion engines for a long time. Most
    of them disagree with these explanations,
  • 32:14 - 32:20
    I mean, yeah. But more importantly, other
    cars including my Volkswagen Sharan
  • 32:20 - 32:27
    device, which is Euro 5 car, so one
    generation older, and it's known to have a
  • 32:27 - 32:34
    defeat device, and it performs
    significantly better than this car. OK, we
  • 32:34 - 32:40
    continue to look. We found something here
    that is a... that looks like this. It
  • 32:40 - 32:45
    takes a... there's a
    barometric pressure sensor that sends us
  • 32:45 - 32:49
    the pressure of the air and compares it
    with a value and if we look at how
  • 32:49 - 32:55
    pressure is related to height we see that
    what they check with is 91.5 kilopascal
  • 32:55 - 33:00
    and which corresponds to 850 meter. And
    apparently Europe's highest test center's
  • 33:00 - 33:06
    at 800 meter, which may be a coincidence
    or not. But above that point they reduce
  • 33:06 - 33:11
    their CR system as well. Now, the
    interesting thing is... yeah barometric
  • 33:11 - 33:15
    pressure is something very important to
    know for an ECU. There's a good reason to
  • 33:15 - 33:19
    have the sensor for all of the combustion
    process. You need to know how much air
  • 33:19 - 33:24
    there is. So for EGR it makes a lot of
    sense to have this, but for SCR, which is
  • 33:24 - 33:30
    the system after the engine, no combustion
    is happening. We are not aware of any
  • 33:30 - 33:36
    effect that the outside air pressure has
    on the SCR system, and also other SC
  • 33:36 - 33:41
    equipped cars don't have this mechanism,
    so... for us it does not make
  • 33:41 - 33:47
    physically... it doesn't seem to be
    physically required. So far we looked at
  • 33:47 - 33:54
    SCR. Let's look at EGR. What we saw was,
    when we drove the car during the test
  • 33:54 - 33:56
    cycle, so we put it in the lab and drive
    the
  • 33:56 - 34:02
    test cycle, we consistently saw much
    higher EGR values, much higher than
  • 34:02 - 34:05
    compared to driving on the street,
    compared to all kind of scenarios that we
  • 34:05 - 34:09
    drove on the street. So higher EGR value
    here means, that the EGR valve, that I
  • 34:09 - 34:14
    showed you earlier, is more open, more
    exhaust gas recirculates to the engine. It
  • 34:14 - 34:21
    causes lower NOx emissions before the SCR
    catalyst, and we really... we're curious
  • 34:21 - 34:26
    why did the car behave so differently when
    running on a street than running in a test
  • 34:26 - 34:29
    cycle. And we already took into account
    temperature, so the temperature was not
  • 34:29 - 34:35
    the issue anymore. And thankfully the car,
    when it computes the reason for reducing
  • 34:35 - 34:42
    EGR, it stores a reason in some variable
    that we can log, and it looks like this.
  • 34:42 - 34:47
    There is a number of things that can
    happen, that causes the ECU to switch to
  • 34:47 - 34:52
    some low EGR mode, and a few of them
    make sense, for example if something is
  • 34:52 - 34:56
    broken, fault flags are set, or if the, I
    don't know, the coolant temperature is out
  • 34:56 - 35:03
    of range, it makes sense to just keep the
    device running at all cost. But when none
  • 35:03 - 35:08
    of these reasons apply, the value stored
    is 2, and 2 basically means, that the full
  • 35:08 - 35:17
    EGR operation is used, so it's basically
    the NOx-optimized mode with the fewest
  • 35:17 - 35:22
    emissions. And then we looked at some
    real-world driving, you can see this in
  • 35:22 - 35:26
    the background - the vehicle speed is in
    the background - and we saw that... the
  • 35:26 - 35:31
    red graph shows you the reason to go to
    this limited EGR mode and what we saw is
  • 35:31 - 35:38
    that most of the time the reason is 13 and
    only a few times it's 2, which means that
  • 35:38 - 35:43
    it's not limited. And looking into this
    more details, we see it sometimes drops
  • 35:43 - 35:49
    back to 2, to the unlimited mode, to the
    optimized... emission optimized mode, but
  • 35:49 - 35:54
    any acceleration, or almost any
    acceleration switches it back to 13, and
  • 35:54 - 36:00
    then it stays there for a long time. And
    13, if we look it up, is what I call load
  • 36:00 - 36:07
    limit. And then, interestingly, if we run
    it through the NEDC, we never saw a 13. So
  • 36:07 - 36:11
    the engine stays in mode 2 all the time,
    and 16 just means that the engine is off.
  • 36:11 - 36:17
    But we never see 13. So this explains why
    the EGR values were so different in a test
  • 36:17 - 36:23
    cycle. So, let's look into this load limit
    function that we found. It's basically
  • 36:23 - 36:30
    defined by curves, by five curves. For
    every gear there's a curve, or for a
  • 36:30 - 36:36
    bucket of gears. It's basically that they
    look up RPM, they get a value for that
  • 36:36 - 36:45
    curve, and if you exceed that value, they
    switch to the reduced EGR mode. What they
  • 36:45 - 36:50
    compare this threshold with is the amount
    of fuel injected per cylinder per
  • 36:50 - 36:53
    revolution, but you can also say this is
    torque, just with a
  • 36:53 - 36:59
    constant factor. And then once you are
    outside of one of these curves, it
  • 36:59 - 37:05
    switches to the non-optimized mode where
    it emits a lot more emissions, and then
  • 37:05 - 37:10
    you have to go back into the green area to
    switch back to the optimized mode. So
  • 37:10 - 37:12
    let's see what this means in practice. So
    here we
  • 37:12 - 37:19
    have a car, and the traffic light is red,
    so the car stops, and then the traffic
  • 37:19 - 37:26
    light goes green and the car accelerates,
    and accelerates, and accelerates, gets
  • 37:26 - 37:34
    faster and faster, and then it's at the
    highest speed here, and drives for a
  • 37:34 - 37:39
    while. And this is a typical city cycle,
    this is there to... how you drive in a
  • 37:39 - 37:45
    city, and then the next traffic light
    turns red and the car brakes and stops in
  • 37:45 - 37:53
    front of the traffic light. Let's take a
    look at this again with one more variable,
  • 37:53 - 38:02
    the RPM. We can see that when the car
    starts moving, the RPM goes up. And then
  • 38:02 - 38:06
    at some point there is a drop in RPM, and
    this is because it's a manual transmission
  • 38:06 - 38:10
    and the driver switched to the next gear.
    Now it's switched to again the next gear,
  • 38:10 - 38:16
    and this causes the RPM to drop, but the
    speed to remain almost
  • 38:16 - 38:20
    constant, and it drives for a long time in
    the same gear, and then the traffic light
  • 38:20 - 38:25
    goes red, the driver presses the clutch,
    the engine goes back to idle state, there
  • 38:25 - 38:29
    is no connection anymore to the wheels,
    between the engines and the wheels, and
  • 38:29 - 38:37
    the car gets slower. OK, one more
    variable. It's the last one, I promise. It
  • 38:37 - 38:44
    is torque. The engine power in kilowatt or
    something is not just a function of RPM,
  • 38:44 - 38:48
    it's a function of RPM and torque. so RPM
    and torque together are very useful to
  • 38:48 - 38:54
    characterize engine behavior. And a very
    good way to do this is to have a graph
  • 38:54 - 39:00
    where we put RPM on the one axis and
    torque we put on the other axis, and then
  • 39:00 - 39:06
    we draw this in two dimensions, and so we
    get this, basically. This is the operating
  • 39:06 - 39:14
    points we go through when driving the
    cycle we saw. So the green dot here
  • 39:14 - 39:22
    indicates where we are. And so we restart
    the car, the car accelerates, sorry, the
  • 39:22 - 39:28
    car idles for a while, so the green dot
    stays there. It idles at around 800 RPM,
  • 39:28 - 39:33
    almost no torque, because there's nothing
    to move, and then the driver accelerates
  • 39:33 - 39:39
    and the torque goes up, the RPM goes up
    more slowly, and then at some point, the
  • 39:39 - 39:44
    driver presses the clutch, which
    disconnects the engine, the
  • 39:44 - 39:49
    torque goes down, the RPM adjusts to the
    speed of the next gear, and then the
  • 39:49 - 39:54
    driver releases the clutch and now the
    engine again has to move the car, so the
  • 39:54 - 39:59
    torque goes up until reaching the the
    highest RPM value and then that the driver
  • 39:59 - 40:04
    again switches to the next gear, so the
    whole thing repeats, and then while the
  • 40:04 - 40:09
    car is driving, the majority of this the
    cycle, the engine spends in this one
  • 40:09 - 40:15
    operating point. We're currently at 1800
    RPM or something, and 80 Newton meter or
  • 40:15 - 40:20
    so torque. And then at some point the
    driver presses the clutch, the engine goes
  • 40:20 - 40:27
    back to idle and stays there, basically.
    So this is how you read this diagram. And
  • 40:27 - 40:34
    now what we found in the firmware was that
    overlaid basically on this representation
  • 40:34 - 40:42
    we see a mask, or a limit. If we go over
    this curve, those are the same curves that
  • 40:42 - 40:50
    I showed you earlier, just laid on top of
    this. If we go over this curve,
  • 40:50 - 40:59
    then we switch to the worse emission mode,
    we switch to the mode where the EGR value
  • 40:59 - 41:07
    is limited. So we can see in our driving
    that this happens basically at this point,
  • 41:07 - 41:10
    the point where the driver
    accelerates above a certain point, that
  • 41:10 - 41:18
    causes it to go over the load limit and
    the engine basically switches or
  • 41:18 - 41:23
    significantly reduces EGR. And that's fine
    because EGR doesn't work when you need a
  • 41:23 - 41:28
    lot of engine power, so it make sense that
    that's at that point, and what we would
  • 41:28 - 41:33
    think is that it switches back once we
    leave this load envelope, once we go below
  • 41:33 - 41:37
    the limit again, once we are inside the
    limit, we would expect the ECU to switch
  • 41:37 - 41:43
    back to the full EGR operation. But what
    we see instead is that this does not
  • 41:43 - 41:50
    happen, and the reason is that you don't
    have to go under the maximum, the load
  • 41:50 - 41:55
    limit, you have to go into this green
    area. You have to go back to idling at a
  • 41:55 - 42:00
    very low RPM to switch back to the full
    EGR mode and this only happens at the very
  • 42:00 - 42:05
    end. When the driving cycle is almost
    done, when the driver presses the clutch
  • 42:05 - 42:12
    and lets the engine idle. So especially
    this long sequence where the driver... the
  • 42:12 - 42:18
    car was driving at the same speed, we were
    technically in ... within the load limit,
  • 42:18 - 42:22
    where we're not exceeding the load limit,
    but because we previously exceeded the
  • 42:22 - 42:27
    load limit and it doesn't matter for how
    long you exceeded it, and we did not go to
  • 42:27 - 42:33
    the green area before, we were still in
    this low EGR, high emission mode, even
  • 42:33 - 42:41
    though we're still within the load limit
    imposed by the software. So let's take a
  • 42:41 - 42:48
    look at how often this actually happens in
    real-world data. So here's us driving
  • 42:48 - 42:53
    through a city, and we can see we
    constantly exceed these load limits. And
  • 42:53 - 43:01
    this is driving on the Autobahn, and yeah
    we constantly exceed those. But they look
  • 43:01 - 43:06
    interesting. They look as if they had been
    designed according to something, right,
  • 43:06 - 43:13
    they have the specific form and it's not
    just... yeah, I... I don't know... and it
  • 43:13 - 43:16
    turns out if you do something really
    strange, you can stay within these limits,
  • 43:16 - 43:21
    so we tried that and we managed to stay
    within the limit by doing something, and
  • 43:21 - 43:25
    we... it was reproducible, we could do
    this a lot of time it would always stay in
  • 43:25 - 43:32
    this limit and the answer is: If you drive
    the test cycle you're staying in this
  • 43:32 - 43:41
    limit.
    applause
  • 43:41 - 43:48
    So yeah, these curves basically defined...
    they closely correlate to the limits that
  • 43:48 - 43:56
    you need to pass the NEDC. Okay, to be
    clear it is fully acceptable that the EGR
  • 43:56 - 44:01
    rate is reduced when... for higher engine
    loads. It's natural, you have to do this.
  • 44:01 - 44:07
    For example, when you accelerate the EGR
    rate will decrease up to zero probably,
  • 44:07 - 44:11
    when you do it ... when you're running at
    high speeds, all of that is great. So this
  • 44:11 - 44:15
    method of having a load limit ... well,
    you can argue if really having the load
  • 44:15 - 44:19
    limit exactly where the NEDC is makes
    sense, but having a load limit is okay,
  • 44:19 - 44:23
    right? However, what we think is not okay
    is that, if you only exceeded the limit
  • 44:23 - 44:29
    once ... um... you would stay in this high
    emissions mode for potentially a long time
  • 44:29 - 44:35
    until you get back to low speed idle the
    next time. And we think that is the
  • 44:35 - 44:40
    problem. We ... so far this was all based
    on what we saw in the software, so let's
  • 44:40 - 44:47
    see if this translates to something that
    happens in reality. So to repro this we...
  • 44:47 - 44:52
    the car... drive at constantly... or we
    let it idle, then we accelerate it to
  • 44:52 - 44:56
    2,000 RPM, we let it drive there for a
    while and then we quickly exceeded the
  • 44:56 - 45:03
    load limit by going to 3,000 and then
    going back and then after doing that we
  • 45:03 - 45:07
    would again stay at 2,000 RPM. So it looks
    like this and we would naturally expect
  • 45:07 - 45:13
    the engine to operate in the same way on
    the left and on the right side because the
  • 45:13 - 45:17
    engine is doing the same thing there, it's
    the same torque level, it's the same RPM,
  • 45:17 - 45:22
    everything is the same. So we would expect
    the same emissions, right, um ... and it
  • 45:22 - 45:26
    turns out it isn't. And ... this is a
    slightly convoluted diagram. So if you
  • 45:26 - 45:32
    look at the green and red bars in the
    middle you can see what happens before and
  • 45:32 - 45:36
    after exceeding the limit for just once.
    And in the middle you can see the EGR
  • 45:36 - 45:41
    position, the EGR valve position, and you
    can see that we get pretty high values
  • 45:41 - 45:50
    between... 6... maybe 65 percent or
    something before exceeding the load limit
  • 45:50 - 45:53
    once.
    And after we exceeded it once even though
  • 45:53 - 45:58
    the engine again is operating in the same
    exact operating point, we see much lower
  • 45:58 - 46:04
    EGR valve positions, around 50% or
    something. And if we look at the bottom we
  • 46:04 - 46:09
    see what the engine NOx emissions and we
    see that they are significantly higher on
  • 46:09 - 46:13
    the right side than they are on the left
    side. So this... for me, this does not
  • 46:13 - 46:18
    sound like this is truly optimized for
    emissions because the engine is doing the
  • 46:18 - 46:26
    same thing, in both cases the emissions
    should be low. So going back to this quote
  • 46:26 - 46:31
    that it works, the EGR and SCR injection
    work to the full extent in a temperature
  • 46:31 - 46:37
    range of 20 to 30°C. Okay,
    but what about the EGR load limit and what
  • 46:37 - 46:41
    about the the barometric pressure limit
    for SCR and what about the SCR speed
  • 46:41 - 46:46
    limit? That would not be "to the full
    extent", right? And the Opel answer is
  • 46:46 - 46:50
    really interesting. Of course, they denied
    doing a test cycle detection, they say
  • 46:50 - 46:57
    they don't do that. And what they said is,
    when asked whether they lied to the KBA
  • 46:57 - 47:01
    when saying that it works to the full
    extent they said "The statement 'fully'
  • 47:01 - 47:12
    was really related to the NEDC test
    schedule, right, which... it went on and
  • 47:12 - 47:17
    further... the Opel CEO had to say this.
    He said: "The recent
  • 47:17 - 47:21
    accusations based on the findings of
    hacker Mr. Felix Domke" - hey, that's me -
  • 47:21 - 47:26
    "are misleading oversimplifications and
    misinterpretations of the complicated
  • 47:26 - 47:31
    interrelationships of a modern emission
    control system of a diesel engine.
  • 47:31 - 47:35
    Emission control devices are highly
    sophisticated integrated systems which
  • 47:35 - 47:39
    cannot be broken down into isolated
    parameters." Especially not by a hacker,
  • 47:39 - 47:50
    right?
    applause
  • 47:50 - 47:55
    That was kind of funny. There was another
    funny thing. Sorry, I only have a German
  • 47:55 - 47:58
    quote and I didn't want to translate it,
    but when Opel basically ... they
  • 47:58 - 48:02
    repeatedly say they don't have a cycle
    detection, right, and they say it's not a
  • 48:02 - 48:09
    cycle detection because, if you use the
    car on the street in the same way as you
  • 48:09 - 48:13
    would do them during the test cycle, the
    car would behave in the same way, so it's
  • 48:13 - 48:24
    not...,right? applause ... and ... okay.
    But what is with Volkswagen, right, they
  • 48:24 - 48:28
    have the same thing, if you drive the NEDC
    on the street the car will go to test mode
  • 48:28 - 48:36
    they have the same thing. I don't see how
    this does not represent a cycle detection.
  • 48:36 - 48:42
    That was a lot of things to say about
    Opel, but on the bright side, they also
  • 48:42 - 48:47
    said that they will - even though all that
    was incorrect, what we found - they said
  • 48:47 - 48:51
    "We will further improve the efficiency of
    emissions after treatment of our SCR
  • 48:51 - 48:56
    diesel engines and so on as far as the
    laws of physics allow. This includes a
  • 48:56 - 49:00
    voluntary service action" - and this
    basically means a software update for your
  • 49:00 - 49:05
    car - "for the cars that are already on
    the road starting in June." So that is
  • 49:05 - 49:09
    great. They're actually improving
    something. Question's in which year,
  • 49:09 - 49:17
    because this statement is from May 2016
    and it's not out yet, but... Opel actually
  • 49:17 - 49:21
    provided a new software already in July
    and I think they already worked on this
  • 49:21 - 49:27
    for quite a while and in July 16 the German
    KBA, the Kraftfahrtbundesamt, the Federal
  • 49:27 - 49:32
    Motor Transport Authority, they are pretty
    nice actually, and they do know about what
  • 49:32 - 49:36
    they do, they are bit limited by the
    resources they have, and by the manpower
  • 49:36 - 49:42
    they have, but they know about cars and
    they know how to do these investigations.
  • 49:42 - 49:45
    I mean, they're a little bit bound, but
    what they should do and what they should
  • 49:45 - 49:49
    not do, but they asked me to review a new
    ECU software that was given to them by
  • 49:49 - 49:57
    Opel for the Zafira in question and
    Insignia, which had a similar ECU and I
  • 49:57 - 50:01
    looked at that software and I dumped the
    firmware and I looked at basically all the
  • 50:01 - 50:05
    code sequences that I looked at before and
    I was positively surprised because they
  • 50:05 - 50:11
    removed... they addressed each of our
    concerns. All of them, within the physical
  • 50:11 - 50:15
    limitations of course. So they improved
    the temperature window and everything, so
  • 50:15 - 50:19
    there was a significant improvement. They
    were able to improve the software and they
  • 50:19 - 50:26
    let the DUH, which is the German
    Environmental Aid, they used a PEMS system
  • 50:26 - 50:29
    - PEMS is a portable
    emissions measurement system. It's
  • 50:29 - 50:33
    something you put on the exhaust pipe on
    your car and then you can measure the
  • 50:33 - 50:41
    exhaust during real-world driving, and
    Opel gave them a car with the new ECU
  • 50:41 - 50:46
    software. Otherwise the car was identical
    to the old software, and the results are
  • 50:46 - 50:50
    this, right, so on the left side you see
    the old software, that has all these
  • 50:50 - 50:55
    things that we criticized, and on the
    right side you see the same car with a new
  • 50:55 - 51:00
    ECU software and it's significantly
    better. It's only slightly above the
  • 51:00 - 51:06
    limit, right, but it's much better than
    before and to put this in relation,
  • 51:06 - 51:11
    before they were on the list pretty bad -
    so this is sorted by worst to best - so
  • 51:11 - 51:16
    they are in the, well, upper half at
    least, and now they are almost one of the
  • 51:16 - 51:22
    best cars, just by switching the ECU
    software. And I mean this is great news,
  • 51:22 - 51:28
    right, they actually improved their cars.
    Let's just hope they get this out to the
  • 51:28 - 51:31
    cars soon. Let's just hope it doesn't have
    side effects and something, but I'm sure
  • 51:31 - 51:37
    Opel knows how to test for this. Going
    back to these, we worked on the Opel
  • 51:37 - 51:44
    thing... I think the Opel case, it....
    once they actually upgrade the cars, and
  • 51:44 - 51:49
    once the cars really show these great
    values that the preliminary software
  • 51:49 - 51:53
    showed, I think we can close the Opel
    case, but there's a lot of other cars
  • 51:53 - 52:00
    still to look at, and really, I mean...
    the effort to do this does not scale to so
  • 52:00 - 52:06
    many cars, so we need to do something more
    fundamentally to improve the situation.
  • 52:06 - 52:12
    What I found out is that digital control
    systems, they are black boxes. The
  • 52:12 - 52:18
    manufacturers have designed them to be
    black boxes. They even boast to you that
  • 52:18 - 52:22
    they are 7,000 parameter in there and no
    hacker can understand this and it's a very
  • 52:22 - 52:27
    sophisticated problem. They are designed
    to be black box, and this is not just true
  • 52:27 - 52:32
    for Opel, this is true for all car
    manufacturers. Nobody wants anyone to look
  • 52:32 - 52:38
    into their ECUs, and people seem to be ok
    with that. Like they think "Oh this is so
  • 52:38 - 52:41
    complicated, there are so many German
    engineers working on
  • 52:41 - 52:46
    this problem, they must have found a great
    solution." So we are trusting these black
  • 52:46 - 52:53
    boxes and we are not able to review the
    black boxes that we put into our cars and
  • 52:53 - 52:59
    we have to trust the manufacturer to do
    the right thing and currently, the
  • 52:59 - 53:04
    investigation to do this without
    assistance from the manufacturer, it does
  • 53:04 - 53:12
    not scale. We can do it but... the
    manufacturers can put more security on
  • 53:12 - 53:18
    their ECUs... it probably can be broken,
    but it takes a lot more time, so it simply
  • 53:18 - 53:24
    does not scale sufficiently. The issue is
    black boxes are really powerful, right.
  • 53:24 - 53:28
    Black boxes can hurt people with, for
    example, excessive emissions. They can
  • 53:28 - 53:33
    kill people if we think think about
    autonomous cars that do mistakes. So what
  • 53:33 - 53:40
    we do need, I think, is more transparency.
    A system that can kill people needs to be
  • 53:40 - 53:44
    reviewable by the people. I think this is
    a very important thing.
  • 53:44 - 53:53
    applause
  • 53:53 - 53:57
    So, to have a system that can kill
  • 53:57 - 54:02
    people... to have it reviewable by the
    people, we need to do things. For example,
  • 54:02 - 54:07
    we need... we want access to source code
    for reviews. It doesn't necessarily mean
  • 54:07 - 54:11
    we want open source, but we don't ask at
    all the car manufacturers to open source
  • 54:11 - 54:15
    all the software. That's not what I'm
    talking about. What we need is... think
  • 54:15 - 54:19
    about how Microsoft is sharing source code
    of Windows with universities or other
  • 54:19 - 54:26
    countries. We need experts to look at the
    source code, and we want control software
  • 54:26 - 54:30
    that is reviewable by design, that has a
    lot of documentation, that has good
  • 54:30 - 54:34
    comments, that is human readable code. I
    don't want to see a disassembly, I want to
  • 54:34 - 54:38
    see the source, the MATLAB, or whatever
    they are using to define the functionality
  • 54:38 - 54:44
    source, and read that. And I want to
    understand why did they choose that
  • 54:44 - 54:49
    curve of that map in this way? What was
    the design criteria? That needs to be
  • 54:49 - 54:55
    reviewed. And we need transparency for
    control software decisions, which means
  • 54:55 - 55:03
    that if a car operates in a certain way,
    if I'm driving that car, I want to choose
  • 55:03 - 55:07
    that I can log what the car is doing, for
    example by putting
  • 55:07 - 55:11
    in, I don't know, a USB stick or something
    if it's my car, and then the car will log
  • 55:11 - 55:17
    all the data to that. That is... in the
    end that allows me to reconstruct any
  • 55:17 - 55:22
    decision that the software does. I think
    this is required to have the necessary
  • 55:22 - 55:31
    transparency, that allows us to un-
    blackbox these devices. All right.
  • 55:31 - 56:01
    Thank you very much.
    applause
  • 56:01 - 56:04
    Okay, I actually finished five minutes
    early. I didn't think this would happen,
  • 56:04 - 56:06
    so...
    Herald: I'm so surprised.
  • 56:06 - 56:08
    F: I am surprised too.
    Herald: You are on time. You have five
  • 56:08 - 56:10
    minutes left
    F: Wow, what do I do with these five
  • 56:10 - 56:12
    minutes
    Herald: We can walk around the stage or...
  • 56:12 - 56:15
    Maybe people have some questions?
    F: I think so!
  • 56:15 - 56:24
    Herald: Well, let's ask the Internet! Is
    the Internet ready?
  • 56:24 - 56:29
    Signal Angel: Yes. Our first question:
    What dou you think is the responsibility
  • 56:29 - 56:33
    of Bosch as a supplier for having their
    software and hardware used for this?
  • 56:33 - 56:37
    F: So the question was: What's the
    responsibility for Bosch, who built the
  • 56:37 - 56:43
    software for Volkswagen? It's a good
    question and I have to be careful in what
  • 56:43 - 56:48
    I answer. My personal opinion, and let's
    take this aside from Volkswagen and Bosch,
  • 56:48 - 56:52
    is that if you build software that you
    know is used to be illegally it should...
  • 56:52 - 56:57
    it must be your responsibility to not do
    that. And I'm not sure if this is
  • 56:57 - 57:04
    something that is legally enforceable, but
    it should be something that's enforceable
  • 57:04 - 57:11
    ethically or for all of us programmers,
    that we don't build software that is
  • 57:11 - 57:17
    designed to break the law.
    applause
  • 57:17 - 57:21
    Herald: We quickly hop over to microphone
    1 please.
  • 57:21 - 57:25
    Microphone: Thank you for a wonderful
    talk. I'm just wondering if you're aware
  • 57:25 - 57:31
    of some cases of Volkswagen cars in
    Australia, which was suffering from sudden
  • 57:31 - 57:36
    and rapid power loss. This was happening
    about five years ago and there was a case
  • 57:36 - 57:42
    where a Volkswagen suffered rapid power
    loss on a motorway. The driver was Mrs.
  • 57:42 - 57:48
    Melissa Ryan and she was rear-ended by a
    truck and killed. So when you say that
  • 57:48 - 57:53
    these things can cause death, were you...
    are you aware that any sort of Volkswagen
  • 57:53 - 57:58
    software has been leading to power loss in
    the vehicles and affecting
  • 57:58 - 58:02
    performance on the road, now I don't know
    whether Australian driving conditions are
  • 58:02 - 58:06
    different to European driving conditions,
    and how that might affect that. Have you
  • 58:06 - 58:11
    done any tests that might indicate that
    could be happening in normal driving?
  • 58:11 - 58:15
    F: Yeah, so... the question was whether
    I'm aware of, I think an Australian
  • 58:15 - 58:17
    incident, right, where...
    M1: Can I...
  • 58:17 - 58:21
    F: Yeah.
    M1: There were many reported cases. One of
  • 58:21 - 58:24
    them was fatal, but there were many
    reported cases of that happening.
  • 58:24 - 58:28
    F: Of a sudden power loss, is that right?
    M1: Sudden and rapid power loss in the
  • 58:28 - 58:31
    engine.
    F: Yeah, of the engine. I'm not aware of
  • 58:31 - 58:39
    these incidents and I what I do know
    and... is that the the personal safety is
  • 58:39 - 58:43
    the number one design criteria for ECUs.
    That does not mean that they are perfect,
  • 58:43 - 58:47
    of course, that could mean that rare
    bugs... that there could be malfunctions.
  • 58:47 - 58:53
    I don't know about this, but at least it's
    the first design principle to provide the
  • 58:53 - 58:58
    safety for the people driving the car,
    which i think is a good thing, right. It's
  • 58:58 - 59:02
    not the profit or anything, or at least we
    can hope so. I'm not aware of this
  • 59:02 - 59:08
    particular incidence, and so I can't
    really say anything more about this. It
  • 59:08 - 59:12
    would be great if... Are you aware of any
    additional details that were found in the
  • 59:12 - 59:16
    investigation, please sent them to me.
    M1: Volkswagen was claiming that this was
  • 59:16 - 59:21
    a gearbox problem on automatic cars, but
    then it started happening on manual cars
  • 59:21 - 59:25
    as well, so that excuse went out of the
    window.
  • 59:25 - 59:27
    F: The issue with the problems is that
    most of them are very complex, so they
  • 59:27 - 59:33
    probably involve more than just the engine
    ECU, so they're very... but it's a
  • 59:33 - 59:37
    good example of where we need to
    understand exactly what is happening, and
  • 59:37 - 59:42
    where we may not want to rely on
    Volkswagen or any other manufacturer alone
  • 59:42 - 59:49
    to assist in figuring out what happens. We
    need more transparency there so that we
  • 59:49 - 59:54
    can have definitely neutral accident
    investigations.
  • 59:54 - 59:58
    Herald: This was a long question and
    really detailed answer. Thank you very
  • 59:58 - 60:00
    much.
    F: Sorry, I will be short
  • 60:00 - 60:07
    Herald: Felix, that's your applause
    applause
  • 60:07 - 60:19
    music
  • 60:19 - 60:31
    subtitles created by c3subtitles.de
    in the year 2018. Join, and help us!
Title:
Software Defined Emissions (33c3)
Description:

more » « less
Video Language:
English
Duration:
01:00:31

English subtitles

Revisions