Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2187456imu; Thu, 29 Nov 2018 00:31:03 -0800 (PST) X-Google-Smtp-Source: AFSGD/W+eRL2bopaTNnyKUfxy145omEsLPDKKilsCiAPiRskzpuREzEQw1BwyzavbQHhICIj+UXU X-Received: by 2002:a63:d34a:: with SMTP id u10mr453167pgi.301.1543480263457; Thu, 29 Nov 2018 00:31:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543480263; cv=none; d=google.com; s=arc-20160816; b=nHqHvbbN+KiHBPwyWnmI5AYhS+0aIIcBGHQP/nGFswH57nXmGBcSRsvaPIZBZ8/yqL jaAX5F29rxSFoh6Nq+RA5Ficl1Lfv+qufUpLb77LQKi0Rihzo9kqEjxPcuyjC1H8XTY1 o/5vWZXkYx7pN1EnQbPoNkc6jIcORdyLnvf7LyiieKURNftCrK7kzuK9beZCEDOcRGCt vuDbdfg++cEdhIynK+nBrlB7TaqojVaTM7KYRKIZOtjOkh8rNyR0W8BRWeS1sXfalBWv Of9UHpz0bcsWJh1ZB1HbSi9rqk2YAzRF2+c4o1tpeQW9XzDe3NQtKJmJzfk5MMFINAva vOZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=3T6z+uLowSCm83RWUnsP0VkUWV6DI9kBPV9NM799uqo=; b=aF2vh0FuqdF+qXGfgVOUcn3zpdlGOFci/SlNBKh4WXjbzzj7oJsdtct6DfmjhjsQQf rYGaBEqAgOJ/1/1coAjuSdjBfImL5uSgok9NzQkYD2kwO14KsdSmuOl9XEGcYfCTPdkN MYdsoW8+JBX0zv12qdW/6/45j5d/MQQhNrZTgLEUODGXxcgMt7dDAVvdtesNn1Xw9bIJ 1gygPVz9n+rE5ehEiCxRUpd0I+LHL/oN9CdzT29kYd1AS9Xo+F0JChfpDHAEQRJPviFY znNFap8we1rasJVOjIS9Lxyk07zMr2zBQqivfnQy2uCGohsLMGmoF4dXRtUSHbZULsmF 8MPQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g17si1180662pgi.578.2018.11.29.00.30.47; Thu, 29 Nov 2018 00:31:03 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727645AbeK2Tdq (ORCPT + 99 others); Thu, 29 Nov 2018 14:33:46 -0500 Received: from orcrist.hmeau.com ([104.223.48.154]:53044 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726651AbeK2Tdq (ORCPT ); Thu, 29 Nov 2018 14:33:46 -0500 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1gSHh6-0008U6-Rm; Thu, 29 Nov 2018 16:29:08 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1gSHh6-00058S-K8; Thu, 29 Nov 2018 16:29:08 +0800 Date: Thu, 29 Nov 2018 16:29:08 +0800 From: Herbert Xu To: PanBian Cc: "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] crypto: do not free algorithm before using Message-ID: <20181129082908.ao3uxs4q5bncbctn@gondor.apana.org.au> References: <1542880816-63838-1-git-send-email-bianpan2016@163.com> <20181129065711.7renu7xnxzp7sr2d@gondor.apana.org.au> <20181129074756.GA73370@bp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181129074756.GA73370@bp> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 29, 2018 at 03:47:56PM +0800, PanBian wrote: > On Thu, Nov 29, 2018 at 02:57:11PM +0800, Herbert Xu wrote: > > On Thu, Nov 22, 2018 at 06:00:16PM +0800, Pan Bian wrote: > > > In multiple functions, the algorithm fields are read after its reference > > > is dropped through crypto_mod_put. In this case, the algorithm memory > > > may be freed, resulting in use-after-free bugs. This patch delays the > > > put operation until the algorithm is never used. > > > > > > Signed-off-by: Pan Bian > > > > Patch applied. Thanks! > > > > BTW, this problem exists in almost every other skcipher template, > > e.g., in ctr. Are you working on a fix for them too? > > Probably not. Could you please provide patches to fix them? OK, I'll work on it then. Thanks! -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt