Skip to contentSkip to conversation

linux-next: build failure after merge of the bluetooth tree

PATCH Stephen Rothwell 3 participants 3 messages Jul 27, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the bluetooth tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

net/bluetooth/sco.c: In function 'sco_sock_setsockopt':
net/bluetooth/sco.c:862:3: error: cannot convert to a pointer type

  862 |   if (get_user(opt, (u32 __user *)optval)) {
      |   ^~

net/bluetooth/sco.c:862:3: error: cannot convert to a pointer type net/bluetooth/sco.c:862:3: error: cannot convert to a pointer type

Caused by commit

00398e1d5183 ("Bluetooth: Add support for BT_PKT_STATUS CMSG data for SCO connections")

interacting with commit

a7b75c5a8c41 ("net: pass a sockptr_t into ->setsockopt")

from the net-next tree.

I have applied the following merge fix patch:

From: Stephen Rothwell <[email protected]>
Date: Mon, 27 Jul 2020 13:41:30 +1000
Subject: [PATCH] Bluetooth: fix for introduction of sockptr_t

---
 net/bluetooth/sco.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/sco.c +1 -1
index 6e6b03844a2a..dcf7f96ff417 100644
@@ -859,7 +859,7 @@ static int sco_sock_setsockopt(struct socket *sock, int level, int optname,
 		break;
 
 	case BT_PKT_STATUS:
-		if (get_user(opt, (u32 __user *)optval)) {
+		if (copy_from_sockptr(&opt, optval, sizeof(u32))) {
 			err = -EFAULT;
 			break;
 		}
Signature · 5 lines
2.27.0

-- 
Cheers,
Stephen Rothwell
#2 lore raw

Same here, thanks for the fix!

Quoted 2 lines · Christoph Hellwig

The fixup looks good to me, thanks.