From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2417BCA9EB6 for ; Wed, 23 Oct 2019 15:55:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EADC121A4C for ; Wed, 23 Oct 2019 15:55:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571846121; bh=Y7Lr0dSo9vPkjoOvo8jyQHCOR5ujworwo+eRGqcgAag=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-ID:From; b=E3RfKxBQ3z7AyqlNof1HegTpY7AU5s4MaGPSPgvWLhud7qD7QW9Ns/0hs6zizvskk VlcXkWLbWZj3bkk8758SpFbesIU1oTyu9wfNnOvXoMGx1/CFsEnAmVLNoSurHqln/o D0Ibu0JG3ANHNniAp2lr7w/1QYceKiAg6m2V5OXg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404237AbfJWPzR (ORCPT ); Wed, 23 Oct 2019 11:55:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:40976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390909AbfJWPzR (ORCPT ); Wed, 23 Oct 2019 11:55:17 -0400 Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 354432086D; Wed, 23 Oct 2019 15:55:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571846116; bh=Y7Lr0dSo9vPkjoOvo8jyQHCOR5ujworwo+eRGqcgAag=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=A2m/3DgN3LZVEw2SKZeypXEA3sbaslgNkWzggAAlTdPpxHX7wBuxYjY/STyNCtnwk eTfoBoUmihaVKi2SOpWBzk9y78VKv9lt0K35sz2JHIE/9Xe0XqtTAqX1pEB+hSdCUk 4D/7jeVpDgg94i2xV1Ohb+TBqwpK35CnUXBspFzU= Subject: Re: [PATCH v2] usbip: Fix free of unallocated memory in vhci tx To: Julia Lawall , Suwan Kim Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, valentina.manea.m@gmail.com, kbuild test robot , shuah References: <20191022093017.8027-1-suwan.kim027@gmail.com> From: shuah Message-ID: <2c3acd02-9687-80fb-27c9-d64d7932b7ab@kernel.org> Date: Wed, 23 Oct 2019 09:55:15 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On 10/22/19 3:51 AM, Julia Lawall wrote: > > > On Tue, 22 Oct 2019, Suwan Kim wrote: > >> iso_buffer should be set to NULL after use and free in the while loop. >> In the case of isochronous URB in the while loop, iso_buffer is >> allocated and after sending it to server, buffer is deallocated. And >> then, if the next URB in the while loop is not a isochronous pipe, >> iso_buffer still holds the previously deallocated buffer address and >> kfree tries to free wrong buffer address. >> >> Fixes: ea44d190764b ("usbip: Implement SG support to vhci-hcd and stub driver") >> Reported-by: kbuild test robot >> Reported-by: Julia Lawall >> Signed-off-by: Suwan Kim > > Reviewed-by: Julia Lawall > >> --- >> v1 - v2: Move the setting NULL after kfree() and add the comment >> --- Thanks. Acked-by: Shuah Khan thanks, -- Shuah