Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp933302pxb; Wed, 6 Apr 2022 04:42:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvRgi806MfjAbZSGnYOYah99KX8RNCQDOIr3Xq32CiPsvJ4HCcJ88qz5aAA8LqxDAIshsI X-Received: by 2002:a05:6a00:21c8:b0:4fd:f89f:ec0e with SMTP id t8-20020a056a0021c800b004fdf89fec0emr8409798pfj.83.1649245338121; Wed, 06 Apr 2022 04:42:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649245338; cv=none; d=google.com; s=arc-20160816; b=DQ0gMvVc13dO4QX5+ov1FWlDtLH/pD4Z8eziIuiE50A5inuJj+DcZvZqpzRixQJyBQ Il6SJJ9rKrCWMEZ0wue/NAMb7cpg2hUgCzyTu+0k78C1gUR0p4E6f8yuWnwrd9diV5JT yW3FJEhilCyX5DoE7lxGyd5Jd00C4A00hyaVWmykmji5xp5bJkPBduaTw/alN7Xufltx YbrS49XUmrQ40MdbJLh3paB6Iapycrrl+8xtCtMRibgCZ2pGvcbiQzQ+NmlagdSDGWOP KNAwV6ItMAcFJBzE7vJtu3QUR3vkBD5SfJCXg0JzDnOUs118UNMwpfeydXo6xkiW2A4Q tEUw== 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=0ZPFmu8AjEijetGyDD2E3YPCMHiTStoOuY4OXI+jhss=; b=FDoh8ZtcS5cVaNU6OR9bNSoLZtETY5xM5qYOmhbSTqqHVnoIxGM1cNfpf0t2XhMHdY I+2YCfVcHHu1Bie3G5LoeStT/lgLB4D2LYB/W0TZU2omS+9Sq3FYzJc+aTOVx9Mv/Wli YMtzVAar4eB1bt8a1Lf3VMePSb7sAaLaa0FIQ1DQTbTABqykXRKE6/iHIEl/FGokB9O6 4GtjPW0iocNlrG7+bZRlV5ilY6suBzmvRBpSbLgvNDQ7sfFmve+7h0Dajn6WKu7cKrGk dEIF7hMXk/EJuRPC5GFuloresPbbMKm0si0cuZLiOVS74sC5xa0RLZPwQO7lDPcIE2Zv nKFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xTXvv084; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e3-20020a656783000000b0038285075b9csi15408356pgr.723.2022.04.06.04.42.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:42:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xTXvv084; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 7FBCE548835; Wed, 6 Apr 2022 02:59:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240015AbiDFBWP (ORCPT + 99 others); Tue, 5 Apr 2022 21:22:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349476AbiDEJtz (ORCPT ); Tue, 5 Apr 2022 05:49:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD74327CF2; Tue, 5 Apr 2022 02:47:01 -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 ams.source.kernel.org (Postfix) with ESMTPS id 68F2BB81B14; Tue, 5 Apr 2022 09:47:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BABF1C385A1; Tue, 5 Apr 2022 09:46:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649152019; bh=Lq7uEknIvP4GPj5dBJRcnfmvSL9QX0ZCmPatFqEOiX0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xTXvv0848gzPJaqWM3V0Upby3jzdbu6m2kkk6jC3O0vLOxA6pqv9Qs4DU4JT9hsOi Ur453fUZmItSB+lNr/mKdMAKnM7sjGUraXKYcjEwm10TOQotj0a6H+TI3EYQd3axGA fMbfjaTbhewLBM1zW0LbtZmL0gqAVU00Vu5rZM5M= 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.15 626/913] NFS: remove unneeded check in decode_devicenotify_args() Date: Tue, 5 Apr 2022 09:28:08 +0200 Message-Id: <20220405070358.603196433@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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 ce3d1d5b1291..ea17085ef884 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