From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756809AbcKWQjJ (ORCPT ); Wed, 23 Nov 2016 11:39:09 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:38290 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756641AbcKWQjI (ORCPT ); Wed, 23 Nov 2016 11:39:08 -0500 X-ME-Sender: X-Sasl-enc: ZAeLsDskvyhpRPM0UJ065jVPism3Jz6EcLF2z3T6fgwb 1479919146 Date: Wed, 23 Nov 2016 17:39:17 +0100 From: Greg KH To: Wolfgang Wilhelm Cc: linux-usb@vger.kernel.org, Austin S Hemmelgarn , linux-kernel@vger.kernel.org Subject: Re: Problem with USB driver using two devices Message-ID: <20161123163917.GC10750@kroah.com> References: <55FABF0F.5831.182EDC5@wilhelm.fastcomtec.com> <5835962F.20615.B8710F6@wilhelm.fastcomtec.com> <20161123145747.GA4137@kroah.com> <5835C11F.28335.C2ECC3B@wilhelm.fastcomtec.com> <20161123163545.GB10750@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161123163545.GB10750@kroah.com> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 23, 2016 at 05:35:45PM +0100, Greg KH wrote: > On Wed, Nov 23, 2016 at 05:17:35PM +0100, Wolfgang Wilhelm wrote: > > Thankyou very much for the really fast answer. > > > > I don't get any error messages and I can communicate with > > the driver for the second device via ioctrl and write functions, > > i.e. write registers and read registers via the RBUF ioctrl function, > > only the read function for the second device does not work, > > i.e. no data is obtained from the mcs6_read function for the > > second device. > > Hm, let me go look at the driver again, maybe something's odd with it. I don't see anything odd with your read function, is it just timing out? Have you tried doing read/writes from userspace with libusb and that works correctly? > > Which security problems do you see in the code? > > No checking that the values given to you by userspace are actually valid > and within "sane" ranges :) Oh, also your ioctl types need to be better specified than "int" as that doesn't make much sense with 64bit kernels and a 32bit userspace. You need to use types like __u32 in order to make sure that works correctly in all situations. thanks, greg k-h