|
|
675592 |
From 5fe8bfedd40a614374fdcb430694de00aedae2c5 Mon Sep 17 00:00:00 2001
|
|
|
675592 |
From: Joe Lawrence <joe.lawrence@redhat.com>
|
|
|
675592 |
Date: Thu, 18 Jan 2024 09:42:47 -0500
|
|
|
675592 |
Subject: [KPATCH CVE-2022-42896] kpatch fixes for CVE-2022-42896
|
|
|
675592 |
MIME-Version: 1.0
|
|
|
675592 |
Content-Type: text/plain; charset=UTF-8
|
|
|
675592 |
Content-Transfer-Encoding: 8bit
|
|
|
675592 |
|
|
|
675592 |
Kernels:
|
|
|
675592 |
3.10.0-1160.95.1.el7
|
|
|
675592 |
3.10.0-1160.99.1.el7
|
|
|
675592 |
3.10.0-1160.102.1.el7
|
|
|
675592 |
3.10.0-1160.105.1.el7
|
|
|
675592 |
|
|
|
675592 |
|
|
|
675592 |
Kpatch-MR: https://gitlab.com/redhat/prdsc/rhel/src/kpatch/rhel-7/-/merge_requests/66
|
|
|
675592 |
Changes since last build:
|
|
|
675592 |
[x86_64]:
|
|
|
675592 |
igb_main.o: changed function: igb_configure
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_chan_hold
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_conn_get
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_global_chan_by_psm
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_recv_frame
|
|
|
675592 |
l2cap_core.o: new function: klp_l2cap_le_sig_cmd
|
|
|
675592 |
sch_atm.o: changed function: atm_tc_peek
|
|
|
675592 |
sch_atm.o: changed function: sch_atm_dequeue
|
|
|
675592 |
sch_drr.o: changed function: drr_dequeue
|
|
|
675592 |
sch_dsmark.o: changed function: dsmark_peek
|
|
|
675592 |
sch_hfsc.o: changed function: hfsc_enqueue
|
|
|
675592 |
sch_hfsc.o: changed function: qdisc_peek_len
|
|
|
675592 |
sch_multiq.o: changed function: multiq_peek
|
|
|
675592 |
sch_prio.o: changed function: prio_peek
|
|
|
675592 |
sch_qfq.o: changed function: qfq_change_class
|
|
|
675592 |
sch_qfq.o: changed function: qfq_dequeue
|
|
|
675592 |
sch_red.o: changed function: red_peek
|
|
|
675592 |
sch_sfb.o: changed function: sfb_peek
|
|
|
675592 |
sch_tbf.o: changed function: tbf_dequeue
|
|
|
675592 |
|
|
|
675592 |
[ppc64le]:
|
|
|
675592 |
l2cap_core.o: changed function: __l2cap_chan_add
|
|
|
675592 |
l2cap_core.o: changed function: __l2cap_physical_cfm
|
|
|
675592 |
l2cap_core.o: changed function: __set_monitor_timer
|
|
|
675592 |
l2cap_core.o: changed function: __set_retrans_timer.part.24
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_ack_timeout
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_build_conf_req
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_chan_busy
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_chan_close
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_chan_connect
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_chan_del
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_chan_hold
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_chan_put
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_chan_send
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_chan_timeout
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_conn_add.part.28
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_conn_del
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_conn_start
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_connect
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_connect_cfm
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_connect_create_rsp
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_data_channel
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_disconn_cfm
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_do_create
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_do_start
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_ertm_resend
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_ertm_send
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_global_fixed_chan
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_handle_rej
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_handle_srej
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_logical_cfm
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_monitor_timeout
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_move_done
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_move_setup
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_parse_conf_rsp.constprop.36
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_pass_to_tx
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_process_reqseq
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_recv_frame
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_retrans_timeout
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_retransmit_all
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_rx
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_rx_state_recv
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_security_cfm
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_send_ack
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_send_efs_conf_rsp
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_send_i_or_rr_or_rnr
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_send_move_chan_cfm
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_send_move_chan_cfm_icid
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_send_move_chan_req
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_send_rr_or_rnr
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_send_sframe
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_send_srej
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_send_srej_tail
|
|
|
675592 |
l2cap_core.o: changed function: l2cap_start_connection
|
|
|
675592 |
l2cap_core.o: new function: l2cap_connect_req
|
|
|
675592 |
sch_atm.o: changed function: atm_tc_bind_filter
|
|
|
675592 |
sch_atm.o: changed function: atm_tc_change
|
|
|
675592 |
sch_atm.o: changed function: atm_tc_delete
|
|
|
675592 |
sch_atm.o: changed function: atm_tc_destroy
|
|
|
675592 |
sch_atm.o: changed function: atm_tc_enqueue
|
|
|
675592 |
sch_atm.o: changed function: atm_tc_find
|
|
|
675592 |
sch_atm.o: changed function: atm_tc_graft
|
|
|
675592 |
sch_atm.o: changed function: atm_tc_leaf
|
|
|
675592 |
sch_atm.o: changed function: atm_tc_peek
|
|
|
675592 |
sch_atm.o: changed function: atm_tc_put
|
|
|
675592 |
sch_atm.o: changed function: atm_tc_reset
|
|
|
675592 |
sch_atm.o: changed function: atm_tc_tcf_block
|
|
|
675592 |
sch_atm.o: changed function: sch_atm_dequeue
|
|
|
675592 |
sch_drr.o: changed function: drr_dequeue
|
|
|
675592 |
sch_dsmark.o: changed function: dsmark_bind_filter
|
|
|
675592 |
sch_dsmark.o: changed function: dsmark_change
|
|
|
675592 |
sch_dsmark.o: changed function: dsmark_destroy
|
|
|
675592 |
sch_dsmark.o: changed function: dsmark_dump_class
|
|
|
675592 |
sch_dsmark.o: changed function: dsmark_init
|
|
|
675592 |
sch_dsmark.o: changed function: dsmark_peek
|
|
|
675592 |
sch_dsmark.o: changed function: dsmark_reset
|
|
|
675592 |
sch_hfsc.o: changed function: hfsc_change_class
|
|
|
675592 |
sch_hfsc.o: changed function: hfsc_dequeue
|
|
|
675592 |
sch_hfsc.o: changed function: hfsc_enqueue
|
|
|
675592 |
sch_multiq.o: changed function: multiq_peek
|
|
|
675592 |
sch_prio.o: changed function: prio_peek
|
|
|
675592 |
sch_qfq.o: changed function: qfq_change_class
|
|
|
675592 |
sch_qfq.o: changed function: qfq_dequeue
|
|
|
675592 |
sch_red.o: changed function: red_peek
|
|
|
675592 |
sch_sfb.o: changed function: sfb_peek
|
|
|
675592 |
sch_tbf.o: changed function: tbf_dequeue
|
|
|
675592 |
|
|
|
675592 |
---------------------------
|
|
|
675592 |
|
|
|
675592 |
Modifications:
|
|
|
675592 |
- function l2cap_le_sig_cmd has no fentry/mcount call, so add a "klp_"
|
|
|
675592 |
prefix to the patched version and its callers
|
|
|
675592 |
- for ppc64le, add __attribute__((optimize("-fno-optimize-sibling-calls")))
|
|
|
675592 |
l2cap_chan_hold()
|
|
|
675592 |
l2cap_disconn_cfm()
|
|
|
675592 |
l2cap_handle_rej()
|
|
|
675592 |
l2cap_handle_srej()
|
|
|
675592 |
l2cap_monitor_timeout()
|
|
|
675592 |
l2cap_pass_to_tx()
|
|
|
675592 |
l2cap_retransmit_all()
|
|
|
675592 |
l2cap_send_efs_conf_rsp()
|
|
|
675592 |
l2cap_send_sframe()
|
|
|
675592 |
|
|
|
675592 |
commit d8f15b60a96ba8ce5d3d55518eb939d9bebd87a9
|
|
|
675592 |
Author: David Marlin <dmarlin@redhat.com>
|
|
|
675592 |
Date: Tue Jan 9 23:44:57 2024 -0600
|
|
|
675592 |
|
|
|
675592 |
Bluetooth: L2CAP: Fix L2CAP_CR_SCID_IN_USE value
|
|
|
675592 |
|
|
|
675592 |
JIRA: https://issues.redhat.com/browse/RHEL-2742
|
|
|
675592 |
CVE: CVE-2022-42896
|
|
|
675592 |
|
|
|
675592 |
commit d8edd9ed156a1a840f1b1c2dbbf458684d6eea6e
|
|
|
675592 |
Author: Marcin Kraglak <marcin.kraglak@tieto.com>
|
|
|
675592 |
Date: Wed Mar 8 14:09:41 2017 +0100
|
|
|
675592 |
|
|
|
675592 |
Bluetooth: L2CAP: Fix L2CAP_CR_SCID_IN_USE value
|
|
|
675592 |
|
|
|
675592 |
Fix issue found during L2CAP qualification test TP/LE/CFC/BV-20-C.
|
|
|
675592 |
|
|
|
675592 |
Signed-off-by: Marcin Kraglak <marcin.kraglak@tieto.com>
|
|
|
675592 |
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
|
|
|
675592 |
|
|
|
675592 |
Signed-off-by: David Marlin <dmarlin@redhat.com>
|
|
|
675592 |
|
|
|
675592 |
commit ae6cdce73d24b5cdccb89f88552bd6a9074f0aed
|
|
|
675592 |
Author: David Marlin <dmarlin@redhat.com>
|
|
|
675592 |
Date: Tue Jan 9 23:45:05 2024 -0600
|
|
|
675592 |
|
|
|
675592 |
Bluetooth: Use separate L2CAP LE credit based connection result values
|
|
|
675592 |
|
|
|
675592 |
JIRA: https://issues.redhat.com/browse/RHEL-2742
|
|
|
675592 |
CVE: CVE-2022-42896
|
|
|
675592 |
|
|
|
675592 |
commit 571f739083e2544b343b5998608de679519de4e9
|
|
|
675592 |
Author: Mallikarjun Phulari <mallikarjun.phulari@intel.com>
|
|
|
675592 |
Date: Fri Oct 5 14:48:12 2018 +0530
|
|
|
675592 |
|
|
|
675592 |
Bluetooth: Use separate L2CAP LE credit based connection result values
|
|
|
675592 |
|
|
|
675592 |
Add the result values specific to L2CAP LE credit based connections
|
|
|
675592 |
and change the old result values wherever they were used.
|
|
|
675592 |
|
|
|
675592 |
Signed-off-by: Mallikarjun Phulari <mallikarjun.phulari@intel.com>
|
|
|
675592 |
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
|
|
|
675592 |
|
|
|
675592 |
Signed-off-by: David Marlin <dmarlin@redhat.com>
|
|
|
675592 |
|
|
|
675592 |
commit b45513e7819c6d7fe8bcd8bcf94670e0da9cc949
|
|
|
675592 |
Author: David Marlin <dmarlin@redhat.com>
|
|
|
675592 |
Date: Tue Jan 9 23:46:25 2024 -0600
|
|
|
675592 |
|
|
|
675592 |
Bluetooth: L2CAP: Fix accepting connection request for invalid SPSM
|
|
|
675592 |
|
|
|
675592 |
JIRA: https://issues.redhat.com/browse/RHEL-2742
|
|
|
675592 |
|
|
|
675592 |
CVE: CVE-2022-42896
|
|
|
675592 |
|
|
|
675592 |
Conflicts:
|
|
|
675592 |
Our 3.10 tree does not include support for Bluetooth Enhanced Credit Based Mode,
|
|
|
675592 |
so omit hunk #2 of:
|
|
|
675592 |
711f8c3fb3db Bluetooth: L2CAP: Fix accepting connection request for invalid SPSM
|
|
|
675592 |
|
|
|
675592 |
commit 711f8c3fb3db61897080468586b970c87c61d9e4
|
|
|
675592 |
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
|
|
|
675592 |
Date: Mon Oct 31 16:10:32 2022 -0700
|
|
|
675592 |
|
|
|
675592 |
Bluetooth: L2CAP: Fix accepting connection request for invalid SPSM
|
|
|
675592 |
|
|
|
675592 |
The Bluetooth spec states that the valid range for SPSM is from
|
|
|
675592 |
0x0001-0x00ff so it is invalid to accept values outside of this range:
|
|
|
675592 |
|
|
|
675592 |
BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 3, Part A
|
|
|
675592 |
page 1059:
|
|
|
675592 |
Table 4.15: L2CAP_LE_CREDIT_BASED_CONNECTION_REQ SPSM ranges
|
|
|
675592 |
|
|
|
675592 |
CVE: CVE-2022-42896
|
|
|
675592 |
CC: stable@vger.kernel.org
|
|
|
675592 |
Reported-by: Tamás Koczka <poprdi@google.com>
|
|
|
675592 |
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
|
|
|
675592 |
Reviewed-by: Tedd Ho-Jeong An <tedd.an@intel.com>
|
|
|
675592 |
|
|
|
675592 |
Signed-off-by: David Marlin <dmarlin@redhat.com>
|
|
|
675592 |
|
|
|
675592 |
commit a766b7a5d576eb559319776f8fa400f00128937e
|
|
|
675592 |
Author: David Marlin <dmarlin@redhat.com>
|
|
|
675592 |
Date: Tue Jan 9 23:47:13 2024 -0600
|
|
|
675592 |
|
|
|
675592 |
Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm
|
|
|
675592 |
|
|
|
675592 |
JIRA: https://issues.redhat.com/browse/RHEL-2742
|
|
|
675592 |
CVE: CVE-2022-42896
|
|
|
675592 |
|
|
|
675592 |
commit f937b758a188d6fd328a81367087eddbb2fce50f
|
|
|
675592 |
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
|
|
|
675592 |
Date: Mon Oct 31 16:10:33 2022 -0700
|
|
|
675592 |
|
|
|
675592 |
Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm
|
|
|
675592 |
|
|
|
675592 |
l2cap_global_chan_by_psm shall not return fixed channels as they are not
|
|
|
675592 |
meant to be connected by (S)PSM.
|
|
|
675592 |
|
|
|
675592 |
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
|
|
|
675592 |
Reviewed-by: Tedd Ho-Jeong An <tedd.an@intel.com>
|
|
|
675592 |
|
|
|
675592 |
Signed-off-by: David Marlin <dmarlin@redhat.com>
|
|
|
675592 |
|
|
|
675592 |
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
|
|
|
675592 |
---
|
|
|
675592 |
include/net/bluetooth/l2cap.h | 17 +++++++----
|
|
|
675592 |
net/bluetooth/l2cap_core.c | 55 +++++++++++++++++++++++++----------
|
|
|
675592 |
2 files changed, 50 insertions(+), 22 deletions(-)
|
|
|
675592 |
|
|
|
675592 |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
|
|
|
675592 |
index 45f3a951974c..1b0dfbb0eb82 100644
|
|
|
675592 |
--- a/include/net/bluetooth/l2cap.h
|
|
|
675592 |
+++ b/include/net/bluetooth/l2cap.h
|
|
|
675592 |
@@ -277,12 +277,17 @@ struct l2cap_conn_rsp {
|
|
|
675592 |
#define L2CAP_CR_SEC_BLOCK 0x0003
|
|
|
675592 |
#define L2CAP_CR_NO_MEM 0x0004
|
|
|
675592 |
#define L2CAP_CR_BAD_AMP 0x0005
|
|
|
675592 |
-#define L2CAP_CR_AUTHENTICATION 0x0005
|
|
|
675592 |
-#define L2CAP_CR_AUTHORIZATION 0x0006
|
|
|
675592 |
-#define L2CAP_CR_BAD_KEY_SIZE 0x0007
|
|
|
675592 |
-#define L2CAP_CR_ENCRYPTION 0x0008
|
|
|
675592 |
-#define L2CAP_CR_INVALID_SCID 0x0009
|
|
|
675592 |
-#define L2CAP_CR_SCID_IN_USE 0x0010
|
|
|
675592 |
+
|
|
|
675592 |
+/* credit based connect results */
|
|
|
675592 |
+#define L2CAP_CR_LE_SUCCESS 0x0000
|
|
|
675592 |
+#define L2CAP_CR_LE_BAD_PSM 0x0002
|
|
|
675592 |
+#define L2CAP_CR_LE_NO_MEM 0x0004
|
|
|
675592 |
+#define L2CAP_CR_LE_AUTHENTICATION 0x0005
|
|
|
675592 |
+#define L2CAP_CR_LE_AUTHORIZATION 0x0006
|
|
|
675592 |
+#define L2CAP_CR_LE_BAD_KEY_SIZE 0x0007
|
|
|
675592 |
+#define L2CAP_CR_LE_ENCRYPTION 0x0008
|
|
|
675592 |
+#define L2CAP_CR_LE_INVALID_SCID 0x0009
|
|
|
675592 |
+#define L2CAP_CR_LE_SCID_IN_USE 0X000A
|
|
|
675592 |
|
|
|
675592 |
/* connect/create channel status */
|
|
|
675592 |
#define L2CAP_CS_NO_INFO 0x0000
|
|
|
675592 |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
|
|
|
675592 |
index 4338810b0d58..a3bed86517e7 100644
|
|
|
675592 |
--- a/net/bluetooth/l2cap_core.c
|
|
|
675592 |
+++ b/net/bluetooth/l2cap_core.c
|
|
|
675592 |
@@ -480,6 +480,7 @@ static void l2cap_chan_destroy(struct kref *kref)
|
|
|
675592 |
kfree(chan);
|
|
|
675592 |
}
|
|
|
675592 |
|
|
|
675592 |
+__attribute__((optimize("-fno-optimize-sibling-calls")))
|
|
|
675592 |
void l2cap_chan_hold(struct l2cap_chan *c)
|
|
|
675592 |
{
|
|
|
675592 |
BT_DBG("chan %p orig refcnt %d", c, kref_read(&c->kref));
|
|
|
675592 |
@@ -682,9 +683,9 @@ static void l2cap_chan_le_connect_reject(struct l2cap_chan *chan)
|
|
|
675592 |
u16 result;
|
|
|
675592 |
|
|
|
675592 |
if (test_bit(FLAG_DEFER_SETUP, &chan->flags))
|
|
|
675592 |
- result = L2CAP_CR_AUTHORIZATION;
|
|
|
675592 |
+ result = L2CAP_CR_LE_AUTHORIZATION;
|
|
|
675592 |
else
|
|
|
675592 |
- result = L2CAP_CR_BAD_PSM;
|
|
|
675592 |
+ result = L2CAP_CR_LE_BAD_PSM;
|
|
|
675592 |
|
|
|
675592 |
l2cap_state_change(chan, BT_DISCONN);
|
|
|
675592 |
|
|
|
675592 |
@@ -1067,6 +1068,7 @@ static struct sk_buff *l2cap_create_sframe_pdu(struct l2cap_chan *chan,
|
|
|
675592 |
return skb;
|
|
|
675592 |
}
|
|
|
675592 |
|
|
|
675592 |
+__attribute__((optimize("-fno-optimize-sibling-calls")))
|
|
|
675592 |
static void l2cap_send_sframe(struct l2cap_chan *chan,
|
|
|
675592 |
struct l2cap_ctrl *control)
|
|
|
675592 |
{
|
|
|
675592 |
@@ -1792,7 +1794,7 @@ static struct l2cap_chan *l2cap_global_chan_by_psm(int state, __le16 psm,
|
|
|
675592 |
if (link_type == LE_LINK && c->src_type == BDADDR_BREDR)
|
|
|
675592 |
continue;
|
|
|
675592 |
|
|
|
675592 |
- if (c->psm == psm) {
|
|
|
675592 |
+ if (c->chan_type != L2CAP_CHAN_FIXED && c->psm == psm) {
|
|
|
675592 |
int src_match, dst_match;
|
|
|
675592 |
int src_any, dst_any;
|
|
|
675592 |
|
|
|
675592 |
@@ -1822,6 +1824,7 @@ static struct l2cap_chan *l2cap_global_chan_by_psm(int state, __le16 psm,
|
|
|
675592 |
return c1;
|
|
|
675592 |
}
|
|
|
675592 |
|
|
|
675592 |
+__attribute__((optimize("-fno-optimize-sibling-calls")))
|
|
|
675592 |
static void l2cap_monitor_timeout(struct work_struct *work)
|
|
|
675592 |
{
|
|
|
675592 |
struct l2cap_chan *chan = container_of(work, struct l2cap_chan,
|
|
|
675592 |
@@ -2062,6 +2065,7 @@ static void l2cap_retransmit(struct l2cap_chan *chan,
|
|
|
675592 |
l2cap_ertm_resend(chan);
|
|
|
675592 |
}
|
|
|
675592 |
|
|
|
675592 |
+__attribute__((optimize("-fno-optimize-sibling-calls")))
|
|
|
675592 |
static void l2cap_retransmit_all(struct l2cap_chan *chan,
|
|
|
675592 |
struct l2cap_ctrl *control)
|
|
|
675592 |
{
|
|
|
675592 |
@@ -2862,6 +2866,7 @@ static void l2cap_tx(struct l2cap_chan *chan, struct l2cap_ctrl *control,
|
|
|
675592 |
}
|
|
|
675592 |
}
|
|
|
675592 |
|
|
|
675592 |
+__attribute__((optimize("-fno-optimize-sibling-calls")))
|
|
|
675592 |
static void l2cap_pass_to_tx(struct l2cap_chan *chan,
|
|
|
675592 |
struct l2cap_ctrl *control)
|
|
|
675592 |
{
|
|
|
675592 |
@@ -3702,7 +3707,7 @@ void __l2cap_le_connect_rsp_defer(struct l2cap_chan *chan)
|
|
|
675592 |
rsp.mtu = cpu_to_le16(chan->imtu);
|
|
|
675592 |
rsp.mps = cpu_to_le16(chan->mps);
|
|
|
675592 |
rsp.credits = cpu_to_le16(chan->rx_credits);
|
|
|
675592 |
- rsp.result = cpu_to_le16(L2CAP_CR_SUCCESS);
|
|
|
675592 |
+ rsp.result = cpu_to_le16(L2CAP_CR_LE_SUCCESS);
|
|
|
675592 |
|
|
|
675592 |
l2cap_send_cmd(conn, chan->ident, L2CAP_LE_CONN_RSP, sizeof(rsp),
|
|
|
675592 |
&rsp;;
|
|
|
675592 |
@@ -4055,6 +4060,8 @@ static inline void set_default_fcs(struct l2cap_chan *chan)
|
|
|
675592 |
chan->fcs = L2CAP_FCS_CRC16;
|
|
|
675592 |
}
|
|
|
675592 |
|
|
|
675592 |
+
|
|
|
675592 |
+__attribute__((optimize("-fno-optimize-sibling-calls")))
|
|
|
675592 |
static void l2cap_send_efs_conf_rsp(struct l2cap_chan *chan, void *data,
|
|
|
675592 |
u8 ident, u16 flags)
|
|
|
675592 |
{
|
|
|
675592 |
@@ -5318,7 +5325,7 @@ static int l2cap_le_connect_rsp(struct l2cap_conn *conn,
|
|
|
675592 |
credits = __le16_to_cpu(rsp->credits);
|
|
|
675592 |
result = __le16_to_cpu(rsp->result);
|
|
|
675592 |
|
|
|
675592 |
- if (result == L2CAP_CR_SUCCESS && (mtu < 23 || mps < 23 ||
|
|
|
675592 |
+ if (result == L2CAP_CR_LE_SUCCESS && (mtu < 23 || mps < 23 ||
|
|
|
675592 |
dcid < L2CAP_CID_DYN_START ||
|
|
|
675592 |
dcid > L2CAP_CID_LE_DYN_END))
|
|
|
675592 |
return -EPROTO;
|
|
|
675592 |
@@ -5339,7 +5346,7 @@ static int l2cap_le_connect_rsp(struct l2cap_conn *conn,
|
|
|
675592 |
l2cap_chan_lock(chan);
|
|
|
675592 |
|
|
|
675592 |
switch (result) {
|
|
|
675592 |
- case L2CAP_CR_SUCCESS:
|
|
|
675592 |
+ case L2CAP_CR_LE_SUCCESS:
|
|
|
675592 |
if (__l2cap_get_chan_by_dcid(conn, dcid)) {
|
|
|
675592 |
err = -EBADSLT;
|
|
|
675592 |
break;
|
|
|
675592 |
@@ -5353,8 +5360,8 @@ static int l2cap_le_connect_rsp(struct l2cap_conn *conn,
|
|
|
675592 |
l2cap_chan_ready(chan);
|
|
|
675592 |
break;
|
|
|
675592 |
|
|
|
675592 |
- case L2CAP_CR_AUTHENTICATION:
|
|
|
675592 |
- case L2CAP_CR_ENCRYPTION:
|
|
|
675592 |
+ case L2CAP_CR_LE_AUTHENTICATION:
|
|
|
675592 |
+ case L2CAP_CR_LE_ENCRYPTION:
|
|
|
675592 |
/* If we already have MITM protection we can't do
|
|
|
675592 |
* anything.
|
|
|
675592 |
*/
|
|
|
675592 |
@@ -5493,11 +5500,24 @@ static int l2cap_le_connect_req(struct l2cap_conn *conn,
|
|
|
675592 |
BT_DBG("psm 0x%2.2x scid 0x%4.4x mtu %u mps %u", __le16_to_cpu(psm),
|
|
|
675592 |
scid, mtu, mps);
|
|
|
675592 |
|
|
|
675592 |
+ /* BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 3, Part A
|
|
|
675592 |
+ * page 1059:
|
|
|
675592 |
+ *
|
|
|
675592 |
+ * Valid range: 0x0001-0x00ff
|
|
|
675592 |
+ *
|
|
|
675592 |
+ * Table 4.15: L2CAP_LE_CREDIT_BASED_CONNECTION_REQ SPSM ranges
|
|
|
675592 |
+ */
|
|
|
675592 |
+ if (!psm || __le16_to_cpu(psm) > L2CAP_PSM_LE_DYN_END) {
|
|
|
675592 |
+ result = L2CAP_CR_LE_BAD_PSM;
|
|
|
675592 |
+ chan = NULL;
|
|
|
675592 |
+ goto response;
|
|
|
675592 |
+ }
|
|
|
675592 |
+
|
|
|
675592 |
/* Check if we have socket listening on psm */
|
|
|
675592 |
pchan = l2cap_global_chan_by_psm(BT_LISTEN, psm, &conn->hcon->src,
|
|
|
675592 |
&conn->hcon->dst, LE_LINK);
|
|
|
675592 |
if (!pchan) {
|
|
|
675592 |
- result = L2CAP_CR_BAD_PSM;
|
|
|
675592 |
+ result = L2CAP_CR_LE_BAD_PSM;
|
|
|
675592 |
chan = NULL;
|
|
|
675592 |
goto response;
|
|
|
675592 |
}
|
|
|
675592 |
@@ -5507,28 +5527,28 @@ static int l2cap_le_connect_req(struct l2cap_conn *conn,
|
|
|
675592 |
|
|
|
675592 |
if (!smp_sufficient_security(conn->hcon, pchan->sec_level,
|
|
|
675592 |
SMP_ALLOW_STK)) {
|
|
|
675592 |
- result = L2CAP_CR_AUTHENTICATION;
|
|
|
675592 |
+ result = L2CAP_CR_LE_AUTHENTICATION;
|
|
|
675592 |
chan = NULL;
|
|
|
675592 |
goto response_unlock;
|
|
|
675592 |
}
|
|
|
675592 |
|
|
|
675592 |
/* Check for valid dynamic CID range */
|
|
|
675592 |
if (scid < L2CAP_CID_DYN_START || scid > L2CAP_CID_LE_DYN_END) {
|
|
|
675592 |
- result = L2CAP_CR_INVALID_SCID;
|
|
|
675592 |
+ result = L2CAP_CR_LE_INVALID_SCID;
|
|
|
675592 |
chan = NULL;
|
|
|
675592 |
goto response_unlock;
|
|
|
675592 |
}
|
|
|
675592 |
|
|
|
675592 |
/* Check if we already have channel with that dcid */
|
|
|
675592 |
if (__l2cap_get_chan_by_dcid(conn, scid)) {
|
|
|
675592 |
- result = L2CAP_CR_SCID_IN_USE;
|
|
|
675592 |
+ result = L2CAP_CR_LE_SCID_IN_USE;
|
|
|
675592 |
chan = NULL;
|
|
|
675592 |
goto response_unlock;
|
|
|
675592 |
}
|
|
|
675592 |
|
|
|
675592 |
chan = pchan->ops->new_connection(pchan);
|
|
|
675592 |
if (!chan) {
|
|
|
675592 |
- result = L2CAP_CR_NO_MEM;
|
|
|
675592 |
+ result = L2CAP_CR_LE_NO_MEM;
|
|
|
675592 |
goto response_unlock;
|
|
|
675592 |
}
|
|
|
675592 |
|
|
|
675592 |
@@ -5563,7 +5583,7 @@ static int l2cap_le_connect_req(struct l2cap_conn *conn,
|
|
|
675592 |
chan->ops->defer(chan);
|
|
|
675592 |
} else {
|
|
|
675592 |
l2cap_chan_ready(chan);
|
|
|
675592 |
- result = L2CAP_CR_SUCCESS;
|
|
|
675592 |
+ result = L2CAP_CR_LE_SUCCESS;
|
|
|
675592 |
}
|
|
|
675592 |
|
|
|
675592 |
response_unlock:
|
|
|
675592 |
@@ -5665,7 +5685,7 @@ done:
|
|
|
675592 |
return 0;
|
|
|
675592 |
}
|
|
|
675592 |
|
|
|
675592 |
-static inline int l2cap_le_sig_cmd(struct l2cap_conn *conn,
|
|
|
675592 |
+static inline int klp_l2cap_le_sig_cmd(struct l2cap_conn *conn,
|
|
|
675592 |
struct l2cap_cmd_hdr *cmd, u16 cmd_len,
|
|
|
675592 |
u8 *data)
|
|
|
675592 |
{
|
|
|
675592 |
@@ -5738,7 +5758,7 @@ static inline void l2cap_le_sig_channel(struct l2cap_conn *conn,
|
|
|
675592 |
goto drop;
|
|
|
675592 |
}
|
|
|
675592 |
|
|
|
675592 |
- err = l2cap_le_sig_cmd(conn, cmd, len, skb->data);
|
|
|
675592 |
+ err = klp_l2cap_le_sig_cmd(conn, cmd, len, skb->data);
|
|
|
675592 |
if (err) {
|
|
|
675592 |
struct l2cap_cmd_rej_unk rej;
|
|
|
675592 |
|
|
|
675592 |
@@ -6012,6 +6032,7 @@ static int l2cap_rx_queued_iframes(struct l2cap_chan *chan)
|
|
|
675592 |
return err;
|
|
|
675592 |
}
|
|
|
675592 |
|
|
|
675592 |
+__attribute__((optimize("-fno-optimize-sibling-calls")))
|
|
|
675592 |
static void l2cap_handle_srej(struct l2cap_chan *chan,
|
|
|
675592 |
struct l2cap_ctrl *control)
|
|
|
675592 |
{
|
|
|
675592 |
@@ -6070,6 +6091,7 @@ static void l2cap_handle_srej(struct l2cap_chan *chan,
|
|
|
675592 |
}
|
|
|
675592 |
}
|
|
|
675592 |
|
|
|
675592 |
+__attribute__((optimize("-fno-optimize-sibling-calls")))
|
|
|
675592 |
static void l2cap_handle_rej(struct l2cap_chan *chan,
|
|
|
675592 |
struct l2cap_ctrl *control)
|
|
|
675592 |
{
|
|
|
675592 |
@@ -7442,6 +7464,7 @@ int l2cap_disconn_ind(struct hci_conn *hcon)
|
|
|
675592 |
return conn->disc_reason;
|
|
|
675592 |
}
|
|
|
675592 |
|
|
|
675592 |
+__attribute__((optimize("-fno-optimize-sibling-calls")))
|
|
|
675592 |
static void l2cap_disconn_cfm(struct hci_conn *hcon, u8 reason)
|
|
|
675592 |
{
|
|
|
675592 |
if (hcon->type != ACL_LINK && hcon->type != LE_LINK)
|
|
|
675592 |
--
|
|
|
675592 |
2.44.0
|
|
|
675592 |
|
|
|
675592 |
|