Commit 8d0d94f
Bluetooth: L2CAP: Fix accepting multiple L2CAP_ECRED_CONN_REQ
commit 5b3e205 upstream.
Currently the code attempts to accept requests regardless of the
command identifier which may cause multiple requests to be marked
as pending (FLAG_DEFER_SETUP) which can cause more than
L2CAP_ECRED_MAX_CID(5) to be allocated in l2cap_ecred_rsp_defer
causing an overflow.
The spec is quite clear that the same identifier shall not be used on
subsequent requests:
'Within each signaling channel a different Identifier shall be used
for each successive request or indication.'
https://www.bluetooth.com/wp-content/uploads/Files/Specification/HTML/Core-62/out/en/host/logical-link-control-and-adaptation-protocol-specification.html#UUID-32a25a06-4aa4-c6c7-77c5-dcfe3682355d
So this attempts to check if there are any channels pending with the
same identifier and rejects if any are found.
Fixes: 15f02b9 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode")
Reported-by: Yiming Qian <yimingqian591@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 1e9e264 commit 8d0d94f
1 file changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5045 | 5045 | | |
5046 | 5046 | | |
5047 | 5047 | | |
5048 | | - | |
| 5048 | + | |
5049 | 5049 | | |
5050 | 5050 | | |
5051 | 5051 | | |
| |||
5058 | 5058 | | |
5059 | 5059 | | |
5060 | 5060 | | |
| 5061 | + | |
| 5062 | + | |
| 5063 | + | |
| 5064 | + | |
| 5065 | + | |
| 5066 | + | |
| 5067 | + | |
| 5068 | + | |
5061 | 5069 | | |
5062 | 5070 | | |
5063 | 5071 | | |
| |||
0 commit comments