Return-Path: From: David Laight To: 'Marcel Holtmann' CC: Chen Gang S , Joe Perches , Sergei Shtylyov , "Gustavo F. Padovan" , Johan Hedberg , "David S. Miller" , "linux-bluetooth@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" Subject: RE: [PATCH v3] net: bluetooth: hci_sock: Use 'const u32 *' instead of 'void *' for 2nd parameter of hci_test_bit() Date: Mon, 9 Feb 2015 16:57:54 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CAE0B02@AcuExch.aculab.com> References: <54D61229.9010904@sunrus.com.cn> <1423338774.2933.9.camel@perches.com> <54D6A729.1070905@sunrus.com.cn> <54D75698.7010808@sunrus.com.cn> <54D82D7D.3000308@sunrus.com.cn> <063D6719AE5E284EB5DD2968C1650D6D1CAE0823@AcuExch.aculab.com> In-Reply-To: Content-Type: text/plain; charset="Windows-1252" MIME-Version: 1.0 List-ID: From: Marcel Holtmann > Hi David, >=20 > >> So at present, in kernel part, we can only say the original authors > >> intended to do like this. And only within kernel part, it can not caus= e > >> issue. I guess, original authors originally knew what we talk about. > > > > I've just searched for hci_u*filter it is all horrid. > > Look at the code for get/set_sockopt of HCI_FILTER. > > Someone seems to have done a complete 'bodge job' of fixing the user in= terface > > for apps (32bit and 64bit) on 64bit kernels. >=20 > we are actually fully aware of that. Just keep in mind that this code is = from 2.4.6 kernel and with > that most likely 14 years old by now. Unfortunately it ended up as usersp= ace API. AFAICT the userspace API is always __u32[2] the long[2] is never exposed to userspace (certainly not through the socket option code). Quite why all the casts were added - instead of changing the type is probably hidden in the annals of the source repo. Some serious archaeology might be in order. David