Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3396403rwa; Tue, 23 Aug 2022 04:12:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR6w0QvXaiD3YzuTIE4U/qUtlRek+mM1Rqm1OA/hmjsUtKp1qpJolyKx4IH9GQeF4Y52+bvG X-Received: by 2002:a05:6a00:35c3:b0:536:ab9f:ceca with SMTP id dc3-20020a056a0035c300b00536ab9fcecamr8479131pfb.37.1661253149334; Tue, 23 Aug 2022 04:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253149; cv=none; d=google.com; s=arc-20160816; b=IsUyrKodfsZ5oc+CfxlpO1H10rPGiJnz8UHKO3tziIdHnPP60rbuTGYOFo0X2A84gh E3LxFxlWCmtl8EI2QdnenT9sRuHs3/mfHawrcqd90Di/SxRjktiPYTbN0lj/nxGYJj1F ektd8BRN/lLJHDhOLcFlKo32yQwqJsxrOuM0HinnRoa+EM2B7eBeuXYT7/Gi0iVKinEw hwUGdWr7ZcbDWfuc5879Wkm5ngOoft0lkdleWYKhzkIH4WQCq5KDctr5yi6NwyJt+hiA PBhMWaIAqb6HaNPVsOvyQWLLMFAPW0p0kvlV1Itjw/UtVr67BjAIsGjOrKGceuKFI4iM sRjw== 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=0tQNUF0hJZurrVjaEuVsisbBMXg9EqjWCojy67sqEO0=; b=i46gYCmXiE5qBxqUnFT0k96DhMreFbL9RAI3xyUvgcOQ5vQ7lPjc16SVOzh0ZxhdXl AknRDJpMhaMz5uWipRH6o3x3yps8WvMC/1mLkz2adGHms67eTAdik8Fwhf3CzAABrO0q XnMMQn2UV+EDDbLg05oPnDYhZXgntNFV/svSli+JABHo7iRH9/IiUBVyT31UKK8ozFbk iAQuHWLIk7gFhzKyWH/TuSHf3/iijcKz/T1tNR3aVZFq+5n/CEav8l2L9ZA9GxjijnDb lq1r8c8z7K/PXj3bsuW7qZ7XHQyJqApxrKlcXVaoZ+ynpOnumo8j01Oz4GdKCTw7GaSZ K3mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I0KubDfn; 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 66-20020a630245000000b0042a59edc53bsi808009pgc.688.2022.08.23.04.12.18; Tue, 23 Aug 2022 04:12:29 -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=I0KubDfn; 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 S1351764AbiHWJzy (ORCPT + 99 others); Tue, 23 Aug 2022 05:55:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345929AbiHWJyG (ORCPT ); Tue, 23 Aug 2022 05:54:06 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB97B9F77B; Tue, 23 Aug 2022 01:46:27 -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 622E3B81BF8; Tue, 23 Aug 2022 08:46:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5E00C433C1; Tue, 23 Aug 2022 08:46:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244386; bh=d/nMLC3Lz+jLZL1pYaR6VR52kEJoAe2FcyZI315sBwc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I0KubDfnsEdgN1njRQad92H3TEYqQpe+0hnNlyaZg+lEx8yp2ryifjNTz3gebDNa5 iRb6SD76tTbrLHc6r9uo/Uhlio/uhldNMTXJtSx66u0Qwi5NJ84M32fgrYPqrIZsDl 3T/I2B27ryG08chxHaPS2SgT3yPwl6rN2Q5N6vKs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuck Lever , Jeff Layton Subject: [PATCH 5.15 054/244] SUNRPC: Fix xdr_encode_bool() Date: Tue, 23 Aug 2022 10:23:33 +0200 Message-Id: <20220823080100.868709019@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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: Chuck Lever commit c770f31d8f580ed4b965c64f924ec1cc50e41734 upstream. I discovered that xdr_encode_bool() was returning the same address that was passed in the @p parameter. The documenting comment states that the intent is to return the address of the next buffer location, just like the other "xdr_encode_*" helpers. The result was the encoded results of NFSv3 PATHCONF operations were not formed correctly. Fixes: ded04a587f6c ("NFSD: Update the NFSv3 PATHCONF3res encoder to use struct xdr_stream") Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton Signed-off-by: Greg Kroah-Hartman --- include/linux/sunrpc/xdr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h @@ -405,8 +405,8 @@ static inline int xdr_stream_encode_item */ static inline __be32 *xdr_encode_bool(__be32 *p, u32 n) { - *p = n ? xdr_one : xdr_zero; - return p++; + *p++ = n ? xdr_one : xdr_zero; + return p; } /**