Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754231AbbHRW2Y (ORCPT ); Tue, 18 Aug 2015 18:28:24 -0400 Received: from mout.gmx.net ([212.227.17.20]:54687 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751465AbbHRW2U (ORCPT ); Tue, 18 Aug 2015 18:28:20 -0400 Date: Wed, 19 Aug 2015 00:27:51 +0200 From: Sebastian Herbszt To: Johannes Thumshirn , James Smart , Dick Kennedy Cc: "James E.J. Bottomley" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Colin King , Sebastian Herbszt Subject: Re: [PATCH] lpfc: Fix possible use-after-free and double free in lpfc_mbx_cmpl_rdp_page_a2() Message-ID: <20150819002751.00000f06@localhost> In-Reply-To: References: <1439809382-32419-1-git-send-email-jthumshirn@suse.de> <20150817232634.00006d80@localhost> X-Mailer: Claws Mail 3.9.2-55-g74b05b (GTK+ 2.16.6; i586-pc-mingw32msvc) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:tdIplWzIk3OzyhAJfZ9oqX0gy8QZ/oSKy7vaC43Cz4TTLMFiE8V aNxmsu34jt2zd0L/Vosx4JSwiKjn/YTL5QznleMRMeIK3lq9njnw6JijOnKHEj74zYV8pQu /Mu3RixUxnYbFDznDD9/hGl9pfUGeXjHUBmFUKP0uS70ASA5ZD+PtE0o6SnHScpSM50jPC2 YBtTtLDIecCVHqsXhM2eg== X-UI-Out-Filterresults: notjunk:1;V01:K0:NRKt2lwja/U=:1sJPgufbwvWc3FC7Gd9N98 L2nRUDPOxWWX2rIuC9tGhbBbme9AvV+aA7IoF92EW8rxslLjvUqNXuYukb2ChaHxiWWRhi63A uZqpMR2l0BCf6vIQsphtGdGpk2cnzqwT6QhwWf41LFyXIFc4wD7uhpVDeLGb4uBzeDdn0IPUN YxaRINL8Fx5uH1Y0j1Xgw6Z+tJXVB2PEDgxn+N8N16fd+8zuqBiuPpY4RA5nh4JV0sMxo6WnS rtATDvqizkG2G9rlBWvpCWiM31RRKGpyjPiR2yYs+JoxOnx6IRTyJ5aKA/6ooua/CItYPcoHO 7mYDKPjUJFXTN68tH+mDwIv8VjZkDfDWRnUDEVp9GmyZi4RfnZSRWSRyJaEAV2K9Dc30Yzf5m QzHbOqKleFsokuZAlDdYvHfArncjgTS6+0leThRhlQ5l8EiHRgtENUhtLB9J+7CUuZ2O4a3VN VQ55trY4NgLLZJWPheamo1P0H8W1PCMGsFHRvQqboj+S08EwnV9rIN+72E7D0Al91ffW6OoeP p7ukwd+7fr059/MtUec3ssuWpLK0L2J6SnRd3OjW9UhaoSroOt70DOr31eG62P4LWOSal7c41 mMXffM0WJU27dAJJm/1o8IaL4NNzec2Q1RsH2/vKW7+QmPvBKwD9z9Ji0kpObgzBvg6ir8LaC efYPpnDxVsc0cHCIM7ZBXF03yOiDoee9TjhVguLZUwKTKmdoKRBooAjLS0XWLr2OSV2MM8Rcn JJsJY7q7kYRIKd3lv1W5cX1zAlpdxLHXHJtecw== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1307 Lines: 38 Johannes Thumshirn wrote: > Sebastian Herbszt writes: > > > Johannes Thumshirn wrote: > >> If the bf_get() call in lpfc_mbx_cmpl_rdp_page_a2() does succeeds, execution > >> continues normally and mp gets kfree()d. > >> > >> If the subsequent call to lpfc_sli_issue_mbox() fails execution jumps to the > >> error label where lpfc_mbuf_free() is called with mp->virt and mp->phys as > >> function arguments. This is the use after free. Following the use after free mp > >> gets kfree()d again which is a double free. > > > > A similar patch was posted by Colin Ian King on 2015-07-31 [1]. > > > > [1] http://marc.info/?l=linux-scsi&m=143835937206204&w=2 > > OK, > > Is it already in James' tree (haven't checked)? The problematic code was > merged for 4.2-rc1 so if the fix (Collin's or mine I don't care) could go > in while we're still in the rc phase, we could avoid all that stable > circus. > > Thanks for digging this out. > > Byte, > Johannes It is not yet in scsi.git. James S., Dick, which patch do you prefer? Sebastian -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/