Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2120782imu; Wed, 28 Nov 2018 22:59:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/X4VoO5wBWt8w1+Z1/AjlZ9xd9fzxvCAwGmyIbGTj0rzdkxlNwSdHSkJmLFv6QIG5VGMPoy X-Received: by 2002:a62:7a8b:: with SMTP id v133mr298057pfc.159.1543474767110; Wed, 28 Nov 2018 22:59:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543474767; cv=none; d=google.com; s=arc-20160816; b=IxrW57XowOxac3Wetwe74T3gwLNwkbEIuS8atXOw0jCCGsL29+sztA3RGFIk67NBPn FCZ+V5VekZaFDe9kaabyXavs4aSSn7I/uaRv9CWx45tfT5PC9rKEQ1o1WVNcDUEJeyV7 p/SJT0o5B0BdD8BQeg8qqV6sCGkiTCubR+xSjVviJ6jAyZke9KDCdc4HMHcSgFRaRqGc xr0I4BQC0hAnO4qCCZ2dwsv8Ao8hy1ebK4mX91F02pYJJI64Mq0TkLF8DvZgbEapi5mD xR0v+Z+kykeFrhkNpLng6ApK9scqJmpabgc7ktjfHtea07nxehwlw1LQUfqnk0qpuB8U cQbw== 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=MeIEkalTgyGuWNMYdVfr4vrc1gurn3pVJcGJU81EXt0=; b=GfO50mwhQiyh7DJXR0okKGxrTc7/l8ju364unq/ePlzXHh9cOFiUqOJS9TzgFW01d4 oG8qdy09l4gYg8tgeo2uNhQ4ENpu+GlBGq++7g5hS6bzZZK9yJN54uFL7ajI9JSZP8Tt qn69wA71L/NvEIqOG41Bfod1RtPjD/MzWy2OLr2LWfkZvVKotqKOdWBxHnc882B07tPZ psnEnKuJXQc96fYsnn0/W1JYKPw7wxgIUAwpenNBzcDLECat2iecUQtOPAvz//3kDaWV LR0gupDwSK/zvp6cp5BGIfW8tN9fLPB/VTZiC408eR/rbTuJ5S9S+4OsACp9VVyj3j2i iclQ== 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 a195si1337607pfd.143.2018.11.28.22.59.10; Wed, 28 Nov 2018 22:59:27 -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 S1727763AbeK2SBi (ORCPT + 99 others); Thu, 29 Nov 2018 13:01:38 -0500 Received: from orcrist.hmeau.com ([104.223.48.154]:52918 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727615AbeK2SBi (ORCPT ); Thu, 29 Nov 2018 13:01:38 -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 1gSGG9-0006xY-Oc; Thu, 29 Nov 2018 14:57:13 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1gSGG7-0004sP-RW; Thu, 29 Nov 2018 14:57:11 +0800 Date: Thu, 29 Nov 2018 14:57:11 +0800 From: Herbert Xu To: Pan Bian 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: <20181129065711.7renu7xnxzp7sr2d@gondor.apana.org.au> References: <1542880816-63838-1-git-send-email-bianpan2016@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1542880816-63838-1-git-send-email-bianpan2016@163.com> 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 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? Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt