Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3177530pxf; Sun, 21 Mar 2021 22:47:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVExXSaUvAHRj7Quc78UNW039R6qzFKGn8G6yaeoHmxc3maoUXcK4bSaL2jIdAj4oi0HN2 X-Received: by 2002:aa7:d503:: with SMTP id y3mr23421104edq.142.1616392039711; Sun, 21 Mar 2021 22:47:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616392039; cv=none; d=google.com; s=arc-20160816; b=T4he7CR+hOY+hM7ltXFBjeqXK9UD3p3ZZ2gR3FUeldIN9neVYXEFlDFpm47E175JW+ AHFFXFUdBgKO5bIthMNWUvyBwHInqc/OJJ51PAOolmmtG53CbFWzxJozYdSQSVo/i3iU m7RVbQE8jkNb2pa9BlDZMQgJ/ZVrDkJBrrKEZL8lUgEj4aSaqah21cMVOsJNGDK7N27c dMJ131K81Oz0TJjex5oof42aeO3W4qbcgc3BveGkUOoFfmFvLgjk5eiAY8pLxWWbKEJ6 yYan08vN1KCaa8DpgqEgrWrBB5YyC1ni/BH7+Cvqm1U0wcrmyWykFeIcDDJE3ziGLSdf qUfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=6lqeceNwNjvLIvI4KG2Mzz1t5DsQN3/hObHOkdaqajk=; b=dcZQblD/D36Z1/j7IZKZMziIvPp2SqfiFCq8t6WHX2FMDCN/vC/bkY6lfEWtvoJn3d makJVW206s4AIUJzr91x2YwnCaFFto1Rb9fNdtnM5lpqnlCa9aIK4/6nBxEhK7YZZs2G DnYfP17aarx+jOGbKJVNnLIA54bO2nF8ETYlhPk1o+2wCFN5BZFdWiEhN53dtULB4Ph+ KqGVVQWraDc5naoUcLAn8LyVS8lkbVMXT2BFR25DmZdiWTK/NXd8fFz0G1AHNmfEOVoi 5ffKTJKCh39OxVjg+W5xQOWEaK1b9g6zoHZ0foX8AR3c5GY6UC7CCBXaqf6OUp4kYZtO u90g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=BPFsK4L7; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q2si11015261edw.238.2021.03.21.22.46.49; Sun, 21 Mar 2021 22:47:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=BPFsK4L7; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229482AbhCVFqP (ORCPT + 99 others); Mon, 22 Mar 2021 01:46:15 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:37258 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229621AbhCVFqE (ORCPT ); Mon, 22 Mar 2021 01:46:04 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 12M5isjs043843; Mon, 22 Mar 2021 05:45:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=6lqeceNwNjvLIvI4KG2Mzz1t5DsQN3/hObHOkdaqajk=; b=BPFsK4L7FOeZ5xC1VGWYZ6uRVeYG1eLYglHjoFQYCFnFsYv1vyyMPEV4/cOxM6FC9rmd W3Djc+YxxpJeQT5/I5VGkDkXNc2zRmX+vX8+UnHyqh4BjK7pUQ92mDatjQSihLkRmY3a dNvB6WFD2L5cZsSko6+d+lw1zoTdIiIjAoJnZChu5YTfq7q6Bk1qvvseVwRyr5f+K/q/ /NwnUzUNntw8YqeQg+wM19+Kky4YPYHsFBlVS5RCHJImVMMFMtOOyW7OLNNcWeDFNh3g oO2pO/LrdaM27ZQgD5FZQ3JJWIPih04Rv2aKAPtue/Lq2nmrfi2mESnX26zXiAh2UJZ0 1A== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 37d8fr2cbd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Mar 2021 05:45:33 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 12M5eHj5129213; Mon, 22 Mar 2021 05:45:31 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 37dtxwj09v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Mar 2021 05:45:31 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 12M5jUZE018654; Mon, 22 Mar 2021 05:45:30 GMT Received: from kadam (/102.36.221.92) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 21 Mar 2021 22:45:29 -0700 Date: Mon, 22 Mar 2021 08:45:22 +0300 From: Dan Carpenter To: Eric Biggers Cc: linux-crypto@vger.kernel.org, Neil Horman , Corentin Labbe , stable@vger.kernel.org Subject: Re: [PATCH] crypto: rng - fix crypto_rng_reset() refcounting when !CRYPTO_STATS Message-ID: <20210322054522.GC1667@kadam> References: <20210322050748.265604-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210322050748.265604-1-ebiggers@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-IMR: 1 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9930 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxlogscore=999 malwarescore=0 phishscore=0 bulkscore=0 mlxscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103220044 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9930 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 spamscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 adultscore=0 malwarescore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103220045 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Sun, Mar 21, 2021 at 10:07:48PM -0700, Eric Biggers wrote: > From: Eric Biggers > > crypto_stats_get() is a no-op when the kernel is compiled without > CONFIG_CRYPTO_STATS, so pairing it with crypto_alg_put() unconditionally > (as crypto_rng_reset() does) is wrong. > Presumably the intention was that _get() and _put() should always pair. It's really ugly and horrible that they don't. We could have predicted bug like this would happen and will continue to happen until the crypto_stats_get() is renamed. regards, dan carpenter