[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <69017167-6e7a-dcaa-424e-38efed39596a@osg.samsung.com>
Date: Fri, 6 Apr 2018 13:00:57 -0600
From: Shuah Khan <shuahkh@....samsung.com>
To: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
valentina.manea.m@...il.com, shuah@...nel.org,
gregkh@...uxfoundation.org
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
Shuah Khan <shuahkh@....samsung.com>
Subject: Re: [PATCH] usbip: vhci_hcd: check rhport before using in
vhci_hub_control()
On 04/06/2018 02:01 AM, Sergei Shtylyov wrote:
> Hello!
>
> On 4/6/2018 1:31 AM, Shuah Khan wrote:
>
>> Validate !rhport < 0 before using it to access port_status array.
>
> Why '!'?
>
I should have explained it better in the commit log.
rhport is set based on input wIndex which could be 0. This isn't
the case for all the Request but some. wIndex is range checked in
the code paths that it shouldn't be. The same applies to rhport
in some request handling paths. Without the checks there is the
potential for out of bounds access on port_status array.
thanks,
-- Shuah
Powered by blists - more mailing lists