Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp650843pxb; Tue, 5 Apr 2022 17:20:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZXk8yzrnA9u0DFISQKYg3DW8eIL+GcVMx2oMo4JT1uP7rHHVX9RRvdh51LsFJp5s10Fvw X-Received: by 2002:a17:902:ca02:b0:156:956d:786e with SMTP id w2-20020a170902ca0200b00156956d786emr5750469pld.16.1649204410634; Tue, 05 Apr 2022 17:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649204410; cv=none; d=google.com; s=arc-20160816; b=mkTzlvtiYAKR5278P0S7ubUMtrqp1Fs/0YIDRPSQkRgpnneYg4XJFL8OLOHAI6Lh0I pbl7Z0QHtfBWnDuZn3sv92Zg2dBht1Ss0RD7A9yqAFxpNWsvwA3SzgMDfz78WvjOnhuy uEVflNZKP6gfQsMVWu4ENSWX8PWsmUkqYAHoggybccrZxiv1uajNzcg8H0/dRKJxhCqi fS5dJa4Zr17DjG2+n4E7pjKJGKTupK7p3BykS4nu/ljueO8iZt30D1ZD7lOVhZ1Gs47Y m2Vj0iZcvdK4fwWP6Ab1yXAeChykReUvBhTsgzgfyV8gMEaifZdbLx7niQAPrAAENqkd 2Z7A== 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=DM4Wxa1NBgFGtSwtd3ku7PU72zNAu4Ftkk5HOLP4pLs=; b=CxNPtJ6isSJUfVl7atqw5BRR2G9Mkfr80JgylaX+NAM/1gCI77k9Twz9ubhh5L48zP EQLNQkpQnfw4jLsJCRqsgVrvoBKgMYM2iIu8OrhejlnOccA2yy43YY8bXInDuN8TnNBN w/8903AX08WbGVB4bbs0t7DiQjHGVnxPOET4j1oHbZm123+rglxkHd/nI8kJIuxmFRGp rFwpmgI8Mu7snxJMAg/7gL1zyqQsSD4KPe//ZVSQu7SbbI3EPSb5suezYDSchnY06csY 7Q4rJ0+Ip3QzImt/qj9NZioMbl8mQkRkSOMfaY87WbcrsEX+xdYH8+0yxsk7y0JC0B3c qkhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=09AgoInt; 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 r29-20020a635d1d000000b00398833d206dsi14251055pgb.505.2022.04.05.17.20.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 17:20:10 -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=09AgoInt; 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 out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C550518DABA; Tue, 5 Apr 2022 17:06:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383794AbiDEM0a (ORCPT + 99 others); Tue, 5 Apr 2022 08:26:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240936AbiDEIsR (ORCPT ); Tue, 5 Apr 2022 04:48:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9930327B1E; Tue, 5 Apr 2022 01:36:35 -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 ACB9E61540; Tue, 5 Apr 2022 08:36:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE35BC385A4; Tue, 5 Apr 2022 08:36:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649147778; bh=YZdqkHxdou06xEwB5O8wkX6sBT8EGjd1hPU579OKop8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=09AgoInte2gpBfjbn/ljy08/M8XtAjzBK3+tdc6I/8Le16Htm6RpCU3QNhJox2KRb Xsk4fSKIDEWR4350fVnEkmsontbsro18fd9Tc0hLrdso0BjyjwFKHku2Y/EWIBO6GV YYeBA6twWYWcawLlSY4m6rm4iQVcWlF9fa3lnwj4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Chuck Lever Subject: [PATCH 5.16 0069/1017] NFSD: prevent integer overflow on 32 bit systems Date: Tue, 5 Apr 2022 09:16:22 +0200 Message-Id: <20220405070356.238304577@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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: Dan Carpenter commit 23a9dbbe0faf124fc4c139615633b9d12a3a89ef upstream. On a 32 bit system, the "len * sizeof(*p)" operation can have an integer overflow. Cc: stable@vger.kernel.org Signed-off-by: Dan Carpenter Signed-off-by: Chuck Lever Signed-off-by: Greg Kroah-Hartman --- include/linux/sunrpc/xdr.h | 2 ++ 1 file changed, 2 insertions(+) --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h @@ -731,6 +731,8 @@ xdr_stream_decode_uint32_array(struct xd if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0)) return -EBADMSG; + if (len > SIZE_MAX / sizeof(*p)) + return -EBADMSG; p = xdr_inline_decode(xdr, len * sizeof(*p)); if (unlikely(!p)) return -EBADMSG;