]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.11.2/bluetooth-fix-user-channel-for-32bit-userspace-on-64bit-kernel.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.11.2 / bluetooth-fix-user-channel-for-32bit-userspace-on-64bit-kernel.patch
1 From ab89f0bdd63a3721f7cd3f064f39fc4ac7ca14d4 Mon Sep 17 00:00:00 2001
2 From: Szymon Janc <szymon.janc@codecoup.pl>
3 Date: Mon, 24 Apr 2017 18:25:04 -0700
4 Subject: Bluetooth: Fix user channel for 32bit userspace on 64bit kernel
5
6 From: Szymon Janc <szymon.janc@codecoup.pl>
7
8 commit ab89f0bdd63a3721f7cd3f064f39fc4ac7ca14d4 upstream.
9
10 Running 32bit userspace on 64bit kernel results in MSG_CMSG_COMPAT being
11 defined as 0x80000000. This results in sendmsg failure if used from 32bit
12 userspace running on 64bit kernel. Fix this by accounting for MSG_CMSG_COMPAT
13 in flags check in hci_sock_sendmsg.
14
15 Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
16 Signed-off-by: Marko Kiiskila <marko@runtime.io>
17 Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20 ---
21 net/bluetooth/hci_sock.c | 3 ++-
22 1 file changed, 2 insertions(+), 1 deletion(-)
23
24 --- a/net/bluetooth/hci_sock.c
25 +++ b/net/bluetooth/hci_sock.c
26 @@ -1680,7 +1680,8 @@ static int hci_sock_sendmsg(struct socke
27 if (msg->msg_flags & MSG_OOB)
28 return -EOPNOTSUPP;
29
30 - if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_NOSIGNAL|MSG_ERRQUEUE))
31 + if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_NOSIGNAL|MSG_ERRQUEUE|
32 + MSG_CMSG_COMPAT))
33 return -EINVAL;
34
35 if (len < 4 || len > HCI_MAX_FRAME_SIZE)