Re: [PATCH] socket: Provide bounce buffer for constant sized put_cmsg()

From: kbuild test robot
Date: Fri Feb 02 2018 - 01:35:35 EST


Hi Kees,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.15 next-20180201]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Kees-Cook/socket-Provide-bounce-buffer-for-constant-sized-put_cmsg/20180202-113637
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> net/bluetooth/hci_sock.c:1406:17: sparse: incorrect type in initializer (invalid types) @@ expected void _val @@ got void _val @@
net/bluetooth/hci_sock.c:1406:17: expected void _val
net/bluetooth/hci_sock.c:1406:17: got void <noident>
>> net/bluetooth/hci_sock.c:1406:17: sparse: expression using sizeof(void)
In file included from include/linux/compat.h:16:0,
from include/linux/ethtool.h:17,
from include/linux/netdevice.h:41,
from include/net/sock.h:51,
from include/net/bluetooth/bluetooth.h:29,
from net/bluetooth/hci_sock.c:32:
net/bluetooth/hci_sock.c: In function 'hci_sock_cmsg':
include/linux/socket.h:355:19: error: variable or field '_val' declared void
_val = 14- ^
net/bluetooth/hci_sock.c:1406:3: note: in expansion of macro 'put_cmsg'
put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, len, data);
^~~~~~~~
include/linux/socket.h:355:26: warning: dereferencing 'void pointer
_val = 20- ^~~~~~~
net/bluetooth/hci_sock.c:1406:3: note: in expansion of macro 'put_cmsg'
put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, len, data);
^~~~~~~~
include/linux/socket.h:355:26: error: void value not ignored as it ought to be
_val = 26- ^
net/bluetooth/hci_sock.c:1406:3: note: in expansion of macro 'put_cmsg'
put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, len, data);
^~~~~~~~

vim +1406 net/bluetooth/hci_sock.c

767c5eb5 Marcel Holtmann 2007-09-09 1405
767c5eb5 Marcel Holtmann 2007-09-09 @1406 put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, len, data);
a61bbcf2 Patrick McHardy 2005-08-14 1407 }
^1da177e Linus Torvalds 2005-04-16 1408 }
^1da177e Linus Torvalds 2005-04-16 1409

:::::: The code at line 1406 was first introduced by commit
:::::: 767c5eb5d35aeb85987143f0a730bc21d3ecfb3d [Bluetooth] Add compat handling for timestamp structure

:::::: TO: Marcel Holtmann <marcel@xxxxxxxxxxxx>
:::::: CC: Marcel Holtmann <marcel@xxxxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation