aboutsummaryrefslogtreecommitdiff
path: root/net/bluetooth/l2cap_sock.c
diff options
context:
space:
mode:
authorNathan Chancellor <natechancellor@gmail.com>2020-10-17 19:41:12 -0700
committerdragonGR <alex@dragongr.dev>2020-10-21 17:48:12 +0300
commitb95c30af9b48bddb166a50c8cd8e5b046b443ca5 (patch)
tree5b6d24aa3d4f44570343affa07e7ea50cc7cb766 /net/bluetooth/l2cap_sock.c
parent15c7ef27ab40e8ccda729e0736eb91a7e387e2bb (diff)
Merge 4.14.202 into kernel.lnx.4.14.r4-relHEADr11.0q10.0
Changes in 4.14.202: (19 commits) Bluetooth: fix kernel oops in store_pending_adv_report Bluetooth: A2MP: Fix not initializing all members Bluetooth: L2CAP: Fix calling sk_filter on non-socket based channel Bluetooth: MGMT: Fix not checking if BT_HS is enabled Bluetooth: Consolidate encryption handling in hci_encrypt_cfm Bluetooth: Fix update of connection state in `hci_encrypt_cfm` Bluetooth: Disconnect if E0 is used for Level 4 media: usbtv: Fix refcounting mixup USB: serial: option: add Cellient MPL200 card USB: serial: option: Add Telit FT980-KS composition staging: comedi: check validity of wMaxPacketSize of usb endpoints found USB: serial: pl2303: add device-id for HP GC device USB: serial: ftdi_sio: add support for FreeCalypso JTAG+UART adapters reiserfs: Initialize inode keys properly reiserfs: Fix oops during mount drivers/net/ethernet/marvell/mvmdio.c: Fix non OF case crypto: bcm - Verify GCM/CCM key length in setkey crypto: qat - check cipher length for aead AES-CBC-HMAC-SHA Linux 4.14.202 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Diffstat (limited to 'net/bluetooth/l2cap_sock.c')
-rw-r--r--net/bluetooth/l2cap_sock.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 511a1da6ca97..7ff82f97e42c 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -1477,6 +1477,19 @@ static void l2cap_sock_suspend_cb(struct l2cap_chan *chan)
sk->sk_state_change(sk);
}
+static int l2cap_sock_filter(struct l2cap_chan *chan, struct sk_buff *skb)
+{
+ struct sock *sk = chan->data;
+
+ switch (chan->mode) {
+ case L2CAP_MODE_ERTM:
+ case L2CAP_MODE_STREAMING:
+ return sk_filter(sk, skb);
+ }
+
+ return 0;
+}
+
static const struct l2cap_ops l2cap_chan_ops = {
.name = "L2CAP Socket Interface",
.new_connection = l2cap_sock_new_connection_cb,
@@ -1491,6 +1504,7 @@ static const struct l2cap_ops l2cap_chan_ops = {
.set_shutdown = l2cap_sock_set_shutdown_cb,
.get_sndtimeo = l2cap_sock_get_sndtimeo_cb,
.alloc_skb = l2cap_sock_alloc_skb_cb,
+ .filter = l2cap_sock_filter,
};
static void l2cap_sock_destruct(struct sock *sk)