Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6508667pxb; Tue, 15 Feb 2022 04:07:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzvAiCW4lLujuvTeLTnHsGpLPbZXufuYqm/4mlX8pajWiStvZQkOYxP7qBqEWpAclaFeSvQ X-Received: by 2002:a62:878e:: with SMTP id i136mr1106265pfe.8.1644926849654; Tue, 15 Feb 2022 04:07:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644926849; cv=none; d=google.com; s=arc-20160816; b=gPUU+wiwFtlkFqnPVuSE5o12qpBvJIuVctYxz9rhkjPvVi+ZxRE9saTCar1dxIq7/v wr6NhdryULQQz30V5/c8C65E84Jxym4QW6MzGGtfsqbqKyWg+m8EOmQyPYTWY+wY1w+K JuIJ/xYb7TJh5iBE9aapOiVple+7GMpbF2RzgIDLQun+e8RugQM/9pxsA9i/F4+wOiIh gnx2WwdpadLO7DFteV9EKC8BWvACL3x7svCERjkQDYTbbwy2xG/R4YdEMbxE/hCFVFE/ eH7w05y3CJElT6SXFEYFGRz/NsawLwVeBO831jMhvFH9szRzfYnmvHPeyQ16HLpHyHxZ bjSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=q7EL+1amZss9C9+8sqNRlDQwW3Y8TLCl9tp1UC/JDCw=; b=yXly8ms2B2lcOMo5LdZYnZk9FkTXYgVEjGNNW6ZoSHfzTwHtXQl27L+yXmk0tfb09Z 6sl/AjyCU0AHyKV8rUiKMzEtobzNzwHocCUmCbp/D1dFRSk6IgJnsX0kEWfg5SqQV2ko cX5KvAX7v3H4iLJe8SanVw77OSquXF5UUVd4dkZiPEPO+bfx4BIyamHzBsH730HmKRFW +w55nAR4JKAgcI8oI52HJZJYmFNLNaVQiCz4EF4KqqLj8ohf9FLzHz0QiJofwL3dzX7+ BZzMpH1F4SWLV3CRGFmlltjLdVX3HyUr7OWcjcKrmSGJ/mpLj1KayFT8TFb8t3Ot+2pp INaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 134si2484066pga.633.2022.02.15.04.06.37; Tue, 15 Feb 2022 04:07:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235404AbiBOKZQ (ORCPT + 99 others); Tue, 15 Feb 2022 05:25:16 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231349AbiBOKZP (ORCPT ); Tue, 15 Feb 2022 05:25:15 -0500 X-Greylist: delayed 458 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 15 Feb 2022 02:25:05 PST Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCFEB22B3D for ; Tue, 15 Feb 2022 02:25:05 -0800 (PST) Received: from hednb3.intra.ispras.ru (unknown [10.10.2.52]) by mail.ispras.ru (Postfix) with ESMTPSA id 3E0114076B21; Tue, 15 Feb 2022 10:17:26 +0000 (UTC) From: Alexey Khoroshilov To: Trond Myklebust , Anna Schumaker Cc: Alexey Khoroshilov , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: [PATCH] NFS: remove unneeded check in decode_devicenotify_args() Date: Tue, 15 Feb 2022 13:17:04 +0300 Message-Id: <1644920224-24966-1-git-send-email-khoroshilov@ispras.ru> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-nfs@vger.kernel.org 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()") --- 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.7.4