-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: only run rx hooks on whitelisted msgs #1903
base: master
Are you sure you want to change the base?
Conversation
rivian is also bad!
Just did the structure so far, will fix the bugs in another PR first. @adeebshihadeh Did you have any thoughts about how this is done? Maybe it's cleaner if this hook returns a bool like the others, so |
@@ -296,6 +301,7 @@ static safety_config chrysler_init(uint16_t param) { | |||
const safety_hooks chrysler_hooks = { | |||
.init = chrysler_init, | |||
.rx = chrysler_rx_hook, | |||
.rx_relay_malfunction = chrysler_rx_relay_malfunction_hook, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.rx_relay_malfunction = chrysler_rx_relay_malfunction_hook, | |
.stock_ecu_hook = chrysler_stock_ecu_hook, |
?
// the relay malfunction hook runs on all incoming rx messages | ||
if (current_hooks->rx_relay_malfunction != NULL) { | ||
current_hooks->rx_relay_malfunction(to_push); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to do this. We need to keep moving towards removing the Turing completeness in the safety mode implementations. The information for this check should be fully contained the safety mode config struct and not require a full free-form C function.
Instead of adding another, I think we want to remove the fwd hook and use that same config for this. I tried this briefly but it needed some more though: 595685a.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
per usual, the right fix is likely a red diff :)
There's actually failures in 7 safety modes, and the Hyundai ones seem the most complex to fix. We might need to clean up the safety first. Going to fix the latest one only for the release (Rivian): #1949 @jyoung8607 Toyota SEC OC doesn't define different RX checks, so it's missing some of the new addresses, can you fix? |
LMK of any issues, otherwise click merge if your testing likes it. |
#1851 but for rx
catches a few missing rx checks: