Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1744871ybg; Wed, 23 Oct 2019 22:33:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxsWz1XTfGXHZOT2Q6Acw05ZuWZ9sK334YGcm7OCGfMbZF4HcZv7YkhxSgGnrXl1y/v4/9 X-Received: by 2002:a17:907:4150:: with SMTP id od24mr932541ejb.135.1571895230242; Wed, 23 Oct 2019 22:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571895230; cv=none; d=google.com; s=arc-20160816; b=tACLODbapO5S2kh3ywssfIY0BhQ2U67Ce8UpgG0SgyQ5c3402UCu745gkAupx6vogh coAoGQ/SOTl2LgHXiyVDX/4LCOBQ9X3mvPLJIx24U+iENfSRBA5rhxNaGZ4XUxB4vrh+ l0LyyERbYWL6FxdIxRLiPqg4NSlc2W81Ju1hRDJO4lXpu+WtvFkaG9H0n8uwD61f8Rgx 3y6kfCTa/nVytatn0oI/glc0DK632KV8bykHFUKhj4Iyl1ygX3ZUt0g5EyxT+WHKb5YE Pxp1BCLu5T2HIKGoRAdxz6PZ8SR95TlTyPgX2Ar5tv+AprHkK/LLJFVOZ3LXzXrqBySQ m4YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=6GslppH5Pv+fTAicp9eLhF7iDmrQSbDXy4r9vZwUrPo=; b=McUbOKkIaeByRb+7wap99Q9tysr2L4hof1mxlofnA+xn/D1zR3S3w0KqDXJdl7hNyp zHhONx5sziKfw/H6THlfkNOIcl4CYEEUVzwhzlsorZy4Dv42WR1YYY5ip/SULgbM1H8w EEodEYjjaFpn/9bfQAPqLpB0KO9FFgvFvMBqbvXuUkk2NCyBJGW4CI9Ar5eXXLc7vh44 7XRroUPf/oqgrum1iqm2e3ryQAF1hD1NY3X/DB43rkQoAhxVEM6W7R2aTCS2G2+bmoQ9 B0UUSJXYE2Ec3qPQTd1SyLsJSqum58JmrzpP7GdHfG88bcUGGVelF30xhallKVgErov2 lgfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="A2m/3DgN"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7si5484787edb.439.2019.10.23.22.33.25; Wed, 23 Oct 2019 22:33:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="A2m/3DgN"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404336AbfJWPzR (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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