From: Amadeusz Sławiński Date: Thu, 14 Jul 2016 08:50:23 +0000 (+0200) Subject: Bluetooth: Fix l2cap_sock_setsockopt() with optname BT_RCVMTU X-Git-Tag: v3.16.39~269 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2d6f94ebcd19b2e65fbadcea5ab42c1d08faf7ca;p=thirdparty%2Fkernel%2Fstable.git Bluetooth: Fix l2cap_sock_setsockopt() with optname BT_RCVMTU commit 23bc6ab0a0912146fd674a0becc758c3162baabc upstream. When we retrieve imtu value from userspace we should use 16 bit pointer cast instead of 32 as it's defined that way in headers. Fixes setsockopt calls on big-endian platforms. Signed-off-by: Amadeusz Sławiński Signed-off-by: Marcel Holtmann Signed-off-by: Ben Hutchings --- diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index d0fd8b04f2e66..071d35c9f3b48 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c @@ -921,7 +921,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, break; } - if (get_user(opt, (u32 __user *) optval)) { + if (get_user(opt, (u16 __user *) optval)) { err = -EFAULT; break; }