Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6127564iog; Thu, 23 Jun 2022 11:56:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ueRCXo+HAjLRwZTmvLPGE5WaxO8qxqgG1b1b3TqBBmwH5ANZQKfRxY51Z5FjvJ3oIGumYf X-Received: by 2002:a05:6402:84d:b0:435:a764:9aad with SMTP id b13-20020a056402084d00b00435a7649aadmr12522355edz.332.1656010592893; Thu, 23 Jun 2022 11:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656010592; cv=none; d=google.com; s=arc-20160816; b=G7kmyVTD7cZ9Wfautqk0xuss9KrWGMFgQXvNYvPCH++7AjPOqJbNz8NapReWIEyjvA awYCmxkBEjBCFsL7Ru5wGvnWTfAGIZsZP3acRbdm+KnWu58+8k6Qa30vmsn76IwfGIEz bAvNfsROhIGtu5kpqO+baPGzJuJScCojbwR4FQB0MrPQB7BSyZ/oXG+Y9B/FWX51GgfV VoSmuThzRpPMIxPz2vhO0U7me9/7N5gQ3Q950059O1odS57AefqZmV832RxvHgQ4q/J3 dE58CJkingyg3xW6FvrfESuFJrwizHXhaVxINqdljetFCVZZ2nRYC/2YTNr3/O0JzXty 5ZUw== 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=0yTh7295Q+tl8q5k4fLu3ltxjDDzTo2dscNBo6CuYlQ=; b=yHqla7GFNQc4OarCgex4cbBu3RgzjtmHpg/qlBac5GsSNgLv87F9i+N8iCwgZkWPgW Ie1anY/OFiemAu5kINOtbePfH/mJJppMLIb8qTdEJyqc6CUpr4MuSfSTBqz2SGSPB+7B eSUrG6WaqdXjJntbiJX8CM3OOQKI9gkP3Xr4ufbwTvw1U8JAKV17SIFwXfMKCG2e+P0H POXTuQVW15lpE5SHB5Z06W2Ro0x0gmv5wf01jwoaL/niyHNYAwO3Kvp58lA5QGgoWEXQ niys4WfIufgxT/KEq1wmAntj3r9yG7WZ+0+rXAs2xYRwEhOcuZA6l3KmtB0Nn7k5WnbH oD5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hN8XDIUS; 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 cs21-20020a170906dc9500b007232e05af5esi2005225ejc.287.2022.06.23.11.56.07; Thu, 23 Jun 2022 11:56:32 -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=hN8XDIUS; 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 S234324AbiFWSUl (ORCPT + 99 others); Thu, 23 Jun 2022 14:20:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236796AbiFWSR2 (ORCPT ); Thu, 23 Jun 2022 14:17:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 243B31BEA4; Thu, 23 Jun 2022 10:23:44 -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 AEE8A61EE5; Thu, 23 Jun 2022 17:23:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87081C341C4; Thu, 23 Jun 2022 17:23:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656005022; bh=eVK8vlGSvvQndlAiBX0xjJxVD2cAGmDzUQkJP/Po380=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hN8XDIUSIjDdKzFKuJkDAX2XKfTOFwZkHSK/wA5/80OjQFkb6VrjqfYM9kh6S1COy Gy2cSZ5EpctqQfk4HGHg1mLp4rrEf/454GUFjgZqdZHYxzGXTHlGKIMuGB+XdbVhDZ 5732MpV/uFln4XXLPDoHOLcdmpWuQolLljF3wUjs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Chuck Lever , Anna Schumaker , Ben Hutchings Subject: [PATCH 4.19 227/234] xprtrdma: fix incorrect header size calculations Date: Thu, 23 Jun 2022 18:44:54 +0200 Message-Id: <20220623164349.473012104@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164343.042598055@linuxfoundation.org> References: <20220623164343.042598055@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: Colin Ian King commit 912288442cb2f431bf3c8cb097a5de83bc6dbac1 upstream. Currently the header size calculations are using an assignment operator instead of a += operator when accumulating the header size leading to incorrect sizes. Fix this by using the correct operator. Addresses-Coverity: ("Unused value") Fixes: 302d3deb2068 ("xprtrdma: Prevent inline overflow") Signed-off-by: Colin Ian King Reviewed-by: Chuck Lever Signed-off-by: Anna Schumaker [bwh: Backported to 4.19: adjust context] Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- net/sunrpc/xprtrdma/rpc_rdma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/net/sunrpc/xprtrdma/rpc_rdma.c +++ b/net/sunrpc/xprtrdma/rpc_rdma.c @@ -72,7 +72,7 @@ static unsigned int rpcrdma_max_call_hea /* Maximum Read list size */ maxsegs += 2; /* segment for head and tail buffers */ - size = maxsegs * rpcrdma_readchunk_maxsz * sizeof(__be32); + size += maxsegs * rpcrdma_readchunk_maxsz * sizeof(__be32); /* Minimal Read chunk size */ size += sizeof(__be32); /* segment count */ @@ -98,7 +98,7 @@ static unsigned int rpcrdma_max_reply_he /* Maximum Write list size */ maxsegs += 2; /* segment for head and tail buffers */ - size = sizeof(__be32); /* segment count */ + size += sizeof(__be32); /* segment count */ size += maxsegs * rpcrdma_segment_maxsz * sizeof(__be32); size += sizeof(__be32); /* list discriminator */