Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

safety: enforce expected messages in rx hook #1657

Closed
wants to merge 11 commits into from

Conversation

sshane
Copy link
Contributor

@sshane sshane commented Sep 7, 2023

Valid should be false if message is not in address checks. Catches a lot of missing checks/bugs in test_models

  • race condition with alt brake message (both exist on sienna)
  • interceptor not in address checks

There are some impacts to think about with the interceptor safety param:

  • If openpilot were not to set it when there's an interceptor, panda would think openpilot gas is user gas and disengage. That's fine.
  • If openpilot were to set it when there is no interceptor, panda would not detect user gas, but address checks should prevent enabling. That's fine.

Meanwhile:

  • Currently if we're using interceptor and its message dropped out and openpilot were to stay engaged, panda would not notice anything wrong and stay engaged, not detecting any user gas. This is not fine.

So the interceptor param addition should strictly be safe.

@sshane sshane added car safety vehicle-specific safety code bugfix labels Sep 7, 2023
@sshane sshane marked this pull request as draft September 7, 2023 08:35
Comment on lines 114 to 115
{.msg = {{0x1a0, 0, 32, .check_checksum = true, .max_counter = 0xffU, .expected_timestep = 20000U},
{0x1a0, 2, 32, .check_checksum = true, .max_counter = 0xffU, .expected_timestep = 20000U}, { 0 }}},
Copy link
Contributor Author

@sshane sshane Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't do this, race condition. need new rx check list, pending a PR like #1655 for CAN FD. ICE cars can be radar ACC or camera ACC

@sshane
Copy link
Contributor Author

sshane commented Sep 7, 2023

Pre-req for Hyundai cleanups, found bugs there too and want to start with one brand. Also requires a safety param for the interceptor which isn't in the address checks, but dynamically detected.

@sshane
Copy link
Contributor Author

sshane commented Sep 7, 2023

not sure how to handle the interceptor param yet, don't want to double the addr checks (?)

@sshane sshane closed this Sep 7, 2023
@sshane sshane deleted the rx-hook-expected-msgs branch September 7, 2023 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix car safety vehicle-specific safety code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant