Skip to content

Commit ff1c4cf

Browse files
sjancgregkh
authored andcommitted
Bluetooth: Fix user channel for 32bit userspace on 64bit kernel
commit ab89f0bdd63a3721f7cd3f064f39fc4ac7ca14d4 upstream. Running 32bit userspace on 64bit kernel results in MSG_CMSG_COMPAT being defined as 0x80000000. This results in sendmsg failure if used from 32bit userspace running on 64bit kernel. Fix this by accounting for MSG_CMSG_COMPAT in flags check in hci_sock_sendmsg. Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl> Signed-off-by: Marko Kiiskila <marko@runtime.io> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9bd2cc5 commit ff1c4cf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

net/bluetooth/hci_sock.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,8 @@ static int hci_sock_sendmsg(struct socket *sock, struct msghdr *msg,
11641164
if (msg->msg_flags & MSG_OOB)
11651165
return -EOPNOTSUPP;
11661166

1167-
if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_NOSIGNAL|MSG_ERRQUEUE))
1167+
if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_NOSIGNAL|MSG_ERRQUEUE|
1168+
MSG_CMSG_COMPAT))
11681169
return -EINVAL;
11691170

11701171
if (len < 4 || len > HCI_MAX_FRAME_SIZE)

0 commit comments

Comments
 (0)