]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
ffaf8e31cb630a870b1d03ee08a0923b1f2f5516
[thirdparty/kernel/stable-queue.git] /
1 From 71bb99a02b32b4cc4265118e85f6035ca72923f0 Mon Sep 17 00:00:00 2001
2 From: Al Viro <viro@zeniv.linux.org.uk>
3 Date: Fri, 19 Dec 2014 06:20:59 +0000
4 Subject: Bluetooth: bnep: bnep_add_connection() should verify that it's dealing with l2cap socket
5
6 From: Al Viro <viro@zeniv.linux.org.uk>
7
8 commit 71bb99a02b32b4cc4265118e85f6035ca72923f0 upstream.
9
10 same story as cmtp
11
12 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15
16 ---
17 net/bluetooth/bnep/core.c | 3 +++
18 1 file changed, 3 insertions(+)
19
20 --- a/net/bluetooth/bnep/core.c
21 +++ b/net/bluetooth/bnep/core.c
22 @@ -533,6 +533,9 @@ int bnep_add_connection(struct bnep_conn
23
24 BT_DBG("");
25
26 + if (!l2cap_is_socket(sock))
27 + return -EBADFD;
28 +
29 baswap((void *) dst, &l2cap_pi(sock->sk)->chan->dst);
30 baswap((void *) src, &l2cap_pi(sock->sk)->chan->src);
31