Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3339831pxj; Mon, 24 May 2021 04:36:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyocAE/5giVw/kvSTvrrHksok2wMzESlK6taiVtZ+d8/bIZ0CN2RD/o2VxTtc2qzmqrBYqm X-Received: by 2002:a05:6402:270c:: with SMTP id y12mr20625140edd.249.1621856184798; Mon, 24 May 2021 04:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621856184; cv=none; d=google.com; s=arc-20160816; b=jm8N66AGP9EkQNJV0t3JBJd/mKzpdJkJtYDJdlnHLCVadcunQA28g44AJSuMZvV4q0 fydyqtIaGEHLZzyjDZ+GFYUILJCmnM8422tMvBbIGlqyakZaW7pKvdPiXaQHt+oj1Ka1 YRkCFCnPL7MmeTLwFSpZXGgHJ+l++9KyFdZN2wajFJ6z39VQw4q8/AzaqsDqs8h1bF64 bMgFfk10bDpmP2xfrM3Kh5xE6GqXMGjTGgprHrLWrsYI05GXpdP/h7y6GyIzLdgMtRP5 gUuXG15peEGIfYpsIk5HZAvovXotAIdnCFeZcnKkG8/7L4UE2rK1574/12jTUJwOLiFy cgEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=4d0zlB4cYKzabDnYYnLr0W4LjJh+7eAsEKnhCCbbowI=; b=IHDYNXYOhLRr9YhJCdz5m2r8jq1wYGdgG6eNnfndo0hyc8xwtQMXuVngxGPuhRHLrE /Cr+GSjqXJrkuka9wunBRaoIvWqxUsPGlsE+qBJoDD913V/jntrVsZsJFy8bywijqpx+ ycBAvGZ5bL0mnMASbPNVP+02IrIXZ7zJqVoBYtuc32psv5u1CTcbPMjgRcLsnTnStuf1 naPIr0l7TyRyTqupaw7SOMIpAn3w5a334Je1kDy6P3JnOaYp8eJLy8teINUMBjYtuEiF cXRMYdD6NZDM0KS0ifu+m+hzwiDiY6SDJeFIIl4fCxt+N/1mhJYOcpnvLF3zUl35Qsk6 yEQw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hh21si12942138ejb.473.2021.05.24.04.35.52; Mon, 24 May 2021 04:36:24 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232706AbhEXLhL (ORCPT + 99 others); Mon, 24 May 2021 07:37:11 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5756 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232651AbhEXLhL (ORCPT ); Mon, 24 May 2021 07:37:11 -0400 Received: from dggems703-chm.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FpZn25CH3zmkLp; Mon, 24 May 2021 19:32:06 +0800 (CST) Received: from dggpemm500009.china.huawei.com (7.185.36.225) by dggems703-chm.china.huawei.com (10.3.19.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 24 May 2021 19:35:41 +0800 Received: from huawei.com (10.175.113.32) by dggpemm500009.china.huawei.com (7.185.36.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 24 May 2021 19:35:41 +0800 From: Liu Shixin To: Herbert Xu , "David S. Miller" CC: , , Liu Shixin Subject: [PATCH -next] crypto: algboss - Replaced simple_strtol() with kstrtouint() Date: Mon, 24 May 2021 20:08:34 +0800 Message-ID: <20210524120834.1580343-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500009.china.huawei.com (7.185.36.225) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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; } param->tb[i + 1] = ¶m->attrs[i].attr; -- 2.18.0.huawei.25