Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3098597pxb; Mon, 18 Apr 2022 15:54:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyK/Y/muZABMeK/uRamS6f5MGLJXEWNdEYIVgXbjy/0NVAlD+gr3IH+M+nmzOvTsRnU0nqq X-Received: by 2002:a17:907:2d91:b0:6e8:abf6:c368 with SMTP id gt17-20020a1709072d9100b006e8abf6c368mr11479017ejc.124.1650322462485; Mon, 18 Apr 2022 15:54:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650322462; cv=none; d=google.com; s=arc-20160816; b=OKMlukLuf03jynLORbHZi7us4AfRG8KavRBktE+ljUGraWPAQmPHktI5HdNVDF3LE9 UqskVAouT70ZHB71j5pmQ6DKfp8KHRb5rGhw3NfG5P9gDfeNZcJ9fTq8LxVpq4DjrQ+U EsZAyTOjjf1SE+jsYLVWur2bm7L6pCEw4S+aisiP1DtIM/TzN9K6GgXfzKeODSJAxoUK XGMWn6EvAXOXELD9a3DfaLScaNNpEClM+eon5pVtU624U+0wXpDkV407Pnh14jXX50sj fhX/Iz8XkmT9psfhI0gY0z0QGW4Vwbs13YPAtZkJ+CJlv9CH6GgRiw069u6oUqXq4rTl xWdA== 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=KjDlVT5x4srk1gNGtHThj4U+ucmgU6JBd2cknDGWAEE=; b=qOlhk8JMUAjH7BD7RwtKEcipzinfqvVZ5eHBJsnpNyD20+8SfaZyPBaAvHg74ydIws ShFbAu0bCMM2ANHM/AbXNGuntzydDh0Bik1GDeOxwIfuSbcqtuz40pYVUWZf76Q24Wm/ d6toXkzUS5YYEJYCA+5RleUdFdj96jStx3vz/tGJ0vHT5JD5xn5LsPiy0Obb1my0wmDi 1aj9tXRgzScEL6R6Uq+zFc+HSpfWGMbajP3e7ALdeBI2R5ziu9mg6rylyjgXho9LZIQH wy7+5wnAYYukOMJBzjoPTGEDkjo49G44gvrOMB2sJUFBbLgVx1QMjYXA4IuzXJGVtU7H NnBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d20A0Ci+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r5-20020a170906350500b006e7ee07b7e7si6916173eja.866.2022.04.18.15.53.59; Mon, 18 Apr 2022 15:54:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d20A0Ci+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245087AbiDRNth (ORCPT + 99 others); Mon, 18 Apr 2022 09:49:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244221AbiDRNaM (ORCPT ); Mon, 18 Apr 2022 09:30:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7BC841320; Mon, 18 Apr 2022 05:54:13 -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 C1F3061254; Mon, 18 Apr 2022 12:54:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B484BC385A1; Mon, 18 Apr 2022 12:54:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286452; bh=9blielkUU3jnaei6YyQ5N0kO0yi6eCp8QevtmQDr0no=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d20A0Ci+UpPFlUwn+uAPblYMhPgz3Tw9j5B+nQqcvlgDvojG5aJgRRql1CA5YmcP8 C3S/oSS5KFiL/2fd00CggmOpNzk6wcX8EIouqUhZaxe3C9w2PkXZFz9Qj11pSeqdzF tz5DwPC0RtZFv67Bqx4uwzRCIft3lDlOYhEqOzYw= 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 4.14 140/284] NFS: remove unneeded check in decode_devicenotify_args() Date: Mon, 18 Apr 2022 14:12:01 +0200 Message-Id: <20220418121215.439766961@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@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=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 36c34be839d0..737c37603fb1 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c @@ -278,10 +278,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