Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2156691imu; Wed, 28 Nov 2018 23:49:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/VIxMe7/Fisq9AyCmebfC6OCBXOu9p4rzlSoOx0/r6y7UoMAjOa3paFhdp1gnZQIETRj7vs X-Received: by 2002:a17:902:598e:: with SMTP id p14mr451421pli.260.1543477786550; Wed, 28 Nov 2018 23:49:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543477786; cv=none; d=google.com; s=arc-20160816; b=sxocg1tWU0Ltwcyeh/OR3ZpwbTO5QJOenx+vDxf5n+KhUxHAu7HSrcK/44X/RAU7+X 9FjZTScXWp21mnaJ2Cz8xaGPNO52naINu0rbPUeHwKCc7wdL111skj2/1+b4hWjrTzIg GyhxD6jdXq5z/xcW9KFaAIYuZVbP//8Mknel+aYyMoTNazvJ/LmG5jtaHmL8eJlrj8gX oXX/UdEOMlynEUMAlwm1GvHlJjEQP8iDJuTApIcZ3jDBlerGcZzYepRinmZnFb8Y+iGK 5JXTxX1XY94nK8QAbvbwItnwDfn1n/foe8zb9HgHG0vRhOhjqvYylMFAGdE8FHPI+oyT 1TuA== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=1qvYh0HtzxaAtwDX9ZTAwiISs2FbFxsTz04hf0Xd5W0=; b=EQXmlG4DlAasKxhknmA4NPMOFN0UMfuU2P9lstZCxqP0Meg+E13u591p2tPz0JTKyX ydROPqSpp6z1hUNeJgCgtDLq7LMjJQNboIxhtn+VyUYly786yZULrh0Sb+Y8TaJTA21Q bj6F6AHVYglJojSQ52iioD6EUSDHg8jFCRRofmFWDXWX0jumVL+3rDAqkA/YjpfPxNPU Vm3faRelFwZA2bbuIrimhJnOJP+mrQr9GIrCuoaJNTSkW1wqaJlqc10HAMW93XzVN1l4 UvbkfQ0oCywhzCI2/u768Mc3dzA3oHEeojyI8g0x9TnYat8kyxtImASWnIvCEq0zVd31 KdMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=DDCs3kLQ; 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 h91si1330507pld.411.2018.11.28.23.49.31; Wed, 28 Nov 2018 23:49:46 -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; dkim=pass header.i=@163.com header.s=s110527 header.b=DDCs3kLQ; 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 S1727747AbeK2Swi (ORCPT + 99 others); Thu, 29 Nov 2018 13:52:38 -0500 Received: from m12-18.163.com ([220.181.12.18]:53103 "EHLO m12-18.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726639AbeK2Swh (ORCPT ); Thu, 29 Nov 2018 13:52:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:Message-ID:MIME-Version; bh=1qvYh 0HtzxaAtwDX9ZTAwiISs2FbFxsTz04hf0Xd5W0=; b=DDCs3kLQOYnomTGm+8UXs VSdOVqmclA8ooA1wja6mj5gwa7MKl8y8kla/6GD6M73LKJ9r6iDPwP7WbcZeRQ2/ j50nHhOWCPDsX4C9zMPy1x/rOvzWKhBmcdTjFufMo1IapZw8yoTw9Uhi/LSjTxEQ ZQn0oU268eknZx4nC6bifQ= Received: from bp (unknown [106.120.213.96]) by smtp14 (Coremail) with SMTP id EsCowAC31Imrmf9buZxJCQ--.19691S2; Thu, 29 Nov 2018 15:47:56 +0800 (CST) Date: Thu, 29 Nov 2018 15:47:56 +0800 From: PanBian To: Herbert Xu 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: <20181129074756.GA73370@bp> Reply-To: PanBian References: <1542880816-63838-1-git-send-email-bianpan2016@163.com> <20181129065711.7renu7xnxzp7sr2d@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181129065711.7renu7xnxzp7sr2d@gondor.apana.org.au> User-Agent: Mutt/1.5.24 (2015-08-30) X-CM-TRANSID: EsCowAC31Imrmf9buZxJCQ--.19691S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrtr4fKr4UKw4fCF47Zw15twb_yoWfGrgEg3 yUGr4jkw1DGr97Cw18AFWUur1FgF93Jr15WF1Sg3Zayr98J3yDJanrKwn3W3WUXrZ5Kr9r uFyrXFZxAr9FkjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU5UWrtUUUUU== X-Originating-IP: [106.120.213.96] X-CM-SenderInfo: held01tdqsiiqw6rljoofrz/xtbBZwwOcletsK4i6QAAs4 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 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? Thanks, Pan > > Cheers, > -- > Email: Herbert Xu > Home Page: http://gondor.apana.org.au/~herbert/ > PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt