-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Bluetooth: Remove rx < tx prio check #71391
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
Bluetooth: Remove rx < tx prio check #71391
Conversation
The comment states the reason for this requirement is to detect violations by a remote peer. The ATT version of this was removed in ea04fd9. TLDR: It's neither possible for, nor the job of the host to police the remote device. We remove this requirement to be more flexible about the number of priority levels in the system, and to avoid the temptation of using priorities as a synchronization mechanism. Signed-off-by: Aleksander Wasaznik <[email protected]>
If a remote device sends 2 ATT requests without waiting for a response today, what does the Zephyr host do? If the RX thread gets a higher priority than the TX thread, will it handle it the same way? Just want to make sure that this doesn't allow for remote devices to DOS us if the thread priorities are "incorrect" |
|
Then we should have a test for the DoS instead :) |
Yeah, it should be trivial to run (or even make a CI config) for that test where the RX thread has a higher priority than the TX thread, to see if we can actually remove this requirement without potentionally breaking stuff |
The current implementation will just-work, handing the pipelined the requests.
Yes. But the TX of the first response may be delayed and sent with the second.
This is a valid concern. The DOS in this case means the host will use more |
Thalley
left a comment
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.
As long as receiving multiple ATT requests from a malfunctioning/malicious remote device device doesn't when RX has higher prio than TX doesn't break things, I'm OK with removing this
It would be nice to have a least some testing where CONFIG_BT_RX_PRIO > CONFIG_BT_HCI_TX_PRIO to ensure that Zephyr works without this restricton
|
@alwa-nordic can you add a |
The comment states the reason for this requirement is to detect violations by a remote peer. The ATT version of this was removed in ea04fd9. TLDR: It's neither possible for, nor the job of the host to police the remote device.
We remove this requirement to be more flexible about the number of priority levels in the system, and to avoid the temptation of using priorities as a synchronization mechanism.