Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp721466pxb; Tue, 5 Apr 2022 20:18:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9fJyeEY7+nr7UDgep2YDM8c+jo0LQQStEB3LZ2mUdiszHA964RifOU2+9sb2gWjBzKG/r X-Received: by 2002:a17:90a:128e:b0:1ca:7dd0:691e with SMTP id g14-20020a17090a128e00b001ca7dd0691emr7503402pja.29.1649215093386; Tue, 05 Apr 2022 20:18:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649215093; cv=none; d=google.com; s=arc-20160816; b=bSTFRe9rEGcP4d/ozUvEdXX3t2rKp3EZwwyI0m5LwLvUF7JhK8g+1HAhepAPqcvAE4 Y79tcqNPh1lg27wozgBldBsLmufNNDaY6BjzlgmVYS02CqpaHGy6/blPSTNXWliew1hm h28x3XB4ZPDcjQ/WgU8VcqhdYepkEqYmDoqwdYDL54E2ELEatfzJqi3EikfIdkQjgLes yGMcZ2e84NOY8aPRJoK6NnlAnIr18Y5juX9Y4A0BBi8cD3hgU2aaxzysirffxdKo4+/j 6AeBPbpKyAv53JRP1UmVdRdPQrP1+TESlxFNhH2Di1du9uURPpKoGLvZGVFF7ufJXvvQ CdRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1Ma1zVBxABPn+0J/kwULuWsKhIHWT7y5CXS6sqJS+Uw=; b=WNSbV4SkWhezYnvM8+OM6rzOg/OscxTxfWe6Z060gcUsQoZPvItZ3Zg3EQ/k9cVl6R Fj8mSfh2yxqHnyX8B25jB0vNlx0idOI4YO80B04D1klg7+BhGTcssxT2rHSXjxWFtN8K NXjf3intQ01yAFCUQGQShUiIT1xaIfuHUeh0H10WN7KnlVzbvoV5/gUCaBHOt1jlmaNL K+gdeSXPCWpADth1fk3ElKrAb6jVPrBVYVBjUxrD4vnV7hcONKfVhGOUAUsz0YNX31OU zzs+fb6aKZDxAgG5UtD5qMBETkaTzUfCWxIpptiuaFrBaDafu98Se2L0CanLQnRFlOsl KXvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xHy+RdmY; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id bd8-20020a170902830800b00153b2d16499si13567218plb.161.2022.04.05.20.18.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 20:18:13 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xHy+RdmY; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E933E17E34F; Tue, 5 Apr 2022 19:54:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245740AbiDEJMP (ORCPT + 99 others); Tue, 5 Apr 2022 05:12:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239536AbiDEIUN (ORCPT ); Tue, 5 Apr 2022 04:20:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E8F81087; Tue, 5 Apr 2022 01:15:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EE9AE609D0; Tue, 5 Apr 2022 08:15:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F339C385A0; Tue, 5 Apr 2022 08:15:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649146539; bh=ozgDpeQbRz+nwF7LtcGxvCmInBpHwmGYhYa0sZuN1KA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xHy+RdmY1Z8i1OZCdqIhMDL/wRbzqZul23g55cFPJTjBSruyM7Us22JvmaPi/DwA3 RzTDNlpZIee2e6b2fWSz4Zi3xKjrLbfDexTLnCl7ooO4PGPmcZtwZEXbBkArDm1dw9 puMBjVehDS09m3/BXM8LeBlGvVKXFADM85UM0SQI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Khoroshilov , Trond Myklebust , Sasha Levin Subject: [PATCH 5.17 0762/1126] NFS: remove unneeded check in decode_devicenotify_args() Date: Tue, 5 Apr 2022 09:25:09 +0200 Message-Id: <20220405070429.949588497@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexey Khoroshilov [ Upstream commit cb8fac6d2727f79f211e745b16c9abbf4d8be652 ] [You don't often get email from khoroshilov@ispras.ru. Learn why this is important at http://aka.ms/LearnAboutSenderIdentification.] Overflow check in not needed anymore after we switch to kmalloc_array(). Signed-off-by: Alexey Khoroshilov Fixes: a4f743a6bb20 ("NFSv4.1: Convert open-coded array allocation calls to kmalloc_array()") Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- fs/nfs/callback_xdr.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index f90de8043b0f..8dcb08e1a885 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c @@ -271,10 +271,6 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp, n = ntohl(*p++); if (n == 0) goto out; - if (n > ULONG_MAX / sizeof(*args->devs)) { - status = htonl(NFS4ERR_BADXDR); - goto out; - } args->devs = kmalloc_array(n, sizeof(*args->devs), GFP_KERNEL); if (!args->devs) { -- 2.34.1