Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3781957pxj; Mon, 24 May 2021 14:58:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwae2dycG0Ezz8SzeroPnBCoybLfdO5/p7gdvOcd77bBQ1vesQOUzzaaV2ux88Lo9vK4w1/ X-Received: by 2002:a92:b102:: with SMTP id t2mr18038206ilh.102.1621893505212; Mon, 24 May 2021 14:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621893505; cv=none; d=google.com; s=arc-20160816; b=unmMjlgj5gIih6FPcFwB4ubcHSXFKyE5P8Nw8FMpMDRqpjDeWxF+zGbKHjEHcUVKfY UwlRcJKZYDTNpFzQu7ja5TDgoN1bKPhkaMlQ60s4fNgYpn2g7CzzxAfqTyhJcqeb1jra 46QmiFypHX7ydMDE+LL90JfY3gpZfQJVzwAw4WnYNogEgxftb+e8xCcsBWNCdJaJk/BO 28aKl6xoclsTHvCtsu7lH7BDCbjeGUx+5trxQQSb74J79Q5MT6tplkeSwQMha9wrcXzy f++qKWtJ9mZoI4DvPsARblU9lhuaw+chxf9QewhJe+plWQ1w8MFffkDUbJO5rFuB5myi MxtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5gru9PVSldm9ZmZlO4m+Ju3OlI/5DhFm561GNKJM9vg=; b=ZnGjzKVTVUaTIcUON8+G0MEPGuIXPoE6WvrM7xc5ZXfdSmPxveY1raHdoKnySpgT8M 8QXDAEU6U9tqlDXazK0FNKVZG+hnBz/3AvBNEDpQ0/N7D3DwiREoUxbs2L7INspWpg7G qO2TI3KjUD2N942nVlpNWy+nzt3MWRbP/1dtKl/zcWr4AsgNJZAmQVNYQcSaA9wkHXJM 86mRp2D4C6Du73aIig4alDz6Aomxl9H54dJPNz83n1AIeYFwNyh54il8JeKzeIcxQkLK ATJObgZbSv0KitCS9ZeSD7M6w0LGW/Ym+2ObbO25n3OM35KIIi3I7uM5i/gDLIg4kjAG UhYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q5HWxNpa; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k7si9648135ilh.42.2021.05.24.14.58.10; Mon, 24 May 2021 14:58:25 -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=@kernel.org header.s=k20201202 header.b=q5HWxNpa; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233778AbhEXV7V (ORCPT + 99 others); Mon, 24 May 2021 17:59:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:53202 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233603AbhEXV7U (ORCPT ); Mon, 24 May 2021 17:59:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0139161403; Mon, 24 May 2021 21:57:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621893472; bh=mT2xSuaz7GfCwIuGVfSy11J/JNH1BcBFokdxMEzAXCY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=q5HWxNpaLfusJXb1UsoaR1Ao6nLHxOw108FYU8AyYlZ99PhyTvL8wygw7Mf7FtTw/ IuIvU8amvov34lCweXLN6Qo3+StJncqYsSu+i648fRZtO7lcl7DU6sJgDxEydUcO+6 rfuaLxBM8/rDotVM3/S9fYrZs+/V26b931rtkU43Fwq7RhCOLIxcGlwishI5RiZ7sy 0LZCWnfm1ekNDri6+Nn2HcfNfAaVzFDmCAtv6TgD1ZO/YtYb4+Pc9DHCD9fEL14oFj Wa9oHGRP2Lbre+3vN6dYrAgHoGBU7/Z06yRB73PisdPLjSBldLdqrHRixmuXx18nmj z3dRqG7lgwCJA== Date: Mon, 24 May 2021 14:57:50 -0700 From: Eric Biggers To: Liu Shixin Cc: Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] crypto: algboss - Replaced simple_strtol() with kstrtouint() Message-ID: References: <20210524120834.1580343-1-liushixin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210524120834.1580343-1-liushixin2@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, May 24, 2021 at 08:08:34PM +0800, Liu Shixin wrote: > The simple_strtol() function is deprecated in some situation since > it does not check for the range overflow. Use kstrtouint() instead. > > Signed-off-by: Liu Shixin > --- > crypto/algboss.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/crypto/algboss.c b/crypto/algboss.c > index 5ebccbd6b74e..64bb8dab9584 100644 > --- a/crypto/algboss.c > +++ b/crypto/algboss.c > @@ -140,8 +140,8 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval) > param->attrs[i].nu32.attr.rta_len = > sizeof(param->attrs[i].nu32); > param->attrs[i].nu32.attr.rta_type = CRYPTOA_U32; > - param->attrs[i].nu32.data.num = > - simple_strtol(name, NULL, 0); > + if (unlikely(kstrtouint(name, 0, ¶m->attrs[i].nu32.data.num))) > + goto err_free_param; It would be better to just remove all the code related to CRYPTOA_U32 and crypto_attr_u32, as it is never used. - Eric