From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932218AbdJPQcd (ORCPT ); Mon, 16 Oct 2017 12:32:33 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:55982 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932181AbdJPQcb (ORCPT ); Mon, 16 Oct 2017 12:32:31 -0400 Message-ID: <1508171548.22379.27.camel@codethink.co.uk> Subject: Re: [PATCH 4.4 20/41] bsg-lib: dont free job in bsg_prepare_job From: Ben Hutchings To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Christoph Hellwig , Ming Lei , Jens Axboe Date: Mon, 16 Oct 2017 17:32:28 +0100 In-Reply-To: <20171003114221.108020321@linuxfoundation.org> References: <20171003114219.900672076@linuxfoundation.org> <20171003114221.108020321@linuxfoundation.org> Organization: Codethink Ltd. Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2017-10-03 at 14:21 +0200, Greg Kroah-Hartman wrote: > 4.4-stable review patch.  If anyone has any objections, please let me know. > > ------------------ > > From: Christoph Hellwig > > commit f507b54dccfd8000c517d740bc45f20c74532d18 upstream. > > The job structure is allocated as part of the request, so we should not > free it in the error path of bsg_prepare_job. That function doesn't exist here (it was introduced in 4.13). Instead, this backport has modified bsg_create_job(), creating a leak. Please revert this on the 3.18, 4.4 and 4.9 stable branches. Ben. > Signed-off-by: Christoph Hellwig > Reviewed-by: Ming Lei > Signed-off-by: Jens Axboe > Signed-off-by: Greg Kroah-Hartman > > --- >  block/bsg-lib.c |    1 - >  1 file changed, 1 deletion(-) > > --- a/block/bsg-lib.c > +++ b/block/bsg-lib.c > @@ -147,7 +147,6 @@ static int bsg_create_job(struct device >  failjob_rls_rqst_payload: >   kfree(job->request_payload.sg_list); >  failjob_rls_job: > - kfree(job); >   return -ENOMEM; >  } >   > > > -- Ben Hutchings Software Developer, Codethink Ltd.