lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 2 Sep 2019 22:06:35 +0200
From:   Greg KH <greg@...ah.com>
To:     Guenter Roeck <linux@...ck-us.net>
Cc:     Kalle Valo <kvalo@...eaurora.org>, Hui Peng <benquike@...il.com>,
        security@...nel.org, Mathias Payer <mathias.payer@...elwelt.net>,
        "David S. Miller" <davem@...emloft.net>,
        linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Fix a double free bug in rsi_91x_deinit

On Mon, Sep 02, 2019 at 12:32:37PM -0700, Guenter Roeck wrote:
> On 9/2/19 11:47 AM, Greg KH wrote:
> > On Sun, Sep 01, 2019 at 07:08:29AM -0700, Guenter Roeck wrote:
> > > On 9/1/19 1:03 AM, Kalle Valo wrote:
> > > > Guenter Roeck <linux@...ck-us.net> writes:
> > > > 
> > > > > On Mon, Aug 19, 2019 at 06:02:29PM -0400, Hui Peng wrote:
> > > > > > `dev` (struct rsi_91x_usbdev *) field of adapter
> > > > > > (struct rsi_91x_usbdev *) is allocated  and initialized in
> > > > > > `rsi_init_usb_interface`. If any error is detected in information
> > > > > > read from the device side,  `rsi_init_usb_interface` will be
> > > > > > freed. However, in the higher level error handling code in
> > > > > > `rsi_probe`, if error is detected, `rsi_91x_deinit` is called
> > > > > > again, in which `dev` will be freed again, resulting double free.
> > > > > > 
> > > > > > This patch fixes the double free by removing the free operation on
> > > > > > `dev` in `rsi_init_usb_interface`, because `rsi_91x_deinit` is also
> > > > > > used in `rsi_disconnect`, in that code path, the `dev` field is not
> > > > > >    (and thus needs to be) freed.
> > > > > > 
> > > > > > This bug was found in v4.19, but is also present in the latest version
> > > > > > of kernel.
> > > > > > 
> > > > > > Reported-by: Hui Peng <benquike@...il.com>
> > > > > > Reported-by: Mathias Payer <mathias.payer@...elwelt.net>
> > > > > > Signed-off-by: Hui Peng <benquike@...il.com>
> > > > > 
> > > > > FWIW:
> > > > > 
> > > > > Reviewed-by: Guenter Roeck <linux@...ck-us.net>
> > > > > 
> > > > > This patch is listed as fix for CVE-2019-15504, which has a CVSS 2.0 score
> > > > > of 10.0 (high) and CVSS 3.0 score of 9.8 (critical).
> > > > 
> > > > A double free in error path is considered as a critical CVE issue? I'm
> > > > very curious, why is that?
> > > > 
> > > 
> > > You'd have to ask the people assigning CVSS scores. However, if the memory
> > > was reallocated, that reallocated memory (which is still in use) is freed.
> > > Then all kinds of bad things can happen.
> > 
> > Yes, but moving from "bad things _can_ happen" to "bad things happen" in
> > an instance like this will be a tough task.  It also requires physical
> > access to the machine.
> > 
> 
> Is this correct even with usbip enabled ?

Who has usbip enabled anywhere?  :)

I don't know if usbip can trigger this type of thing, maybe someone
needs to test that...

thanks,

greg k-h

Powered by blists - more mailing lists