Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2751251rwb; Wed, 30 Nov 2022 10:20:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf54sxAXxJ2uUCd1YEG+wr/Repy2sUKH17CJMHuQuPsj3dHdWzAgXNI6NAlXUAZd6bBXl9Do X-Received: by 2002:a05:6402:3785:b0:461:e598:e0bb with SMTP id et5-20020a056402378500b00461e598e0bbmr11018429edb.21.1669832417895; Wed, 30 Nov 2022 10:20:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669832417; cv=none; d=google.com; s=arc-20160816; b=lbqDYWJmDtjokD7vEIRwzDNwIXsxOygybWmK0vHPn5yoKHKb8qbKv81fquVwabRP4P ErsGIs2WBrIZ/8Iy9zZ9t4YmL3pf0Fkuea7i/WnN02tx8UPnsxRueFeoXXnkP1OkSqNv FTYV1XxOdJ0RKgNZ3TyDeoctwfrs9uSAYSryFQPncvpLxXDj3XwwYPD+8ncFhagu3dCH le/GYJ4gUq17a/gOmlfXkrFBkWtI8qVQbmsPfdATKun+2DlNjYy+qrPBa8UMH9EK4tvt 9FqAZAN2dtAHN1oygJCqogoc4F+sndp1fdSP5ng4duEnGJUQiQPknyKAjADr7tJAdkDE 8G2w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=SjD1fbjJbjIHgTM6qjifz7Qoa67vlAWykxPC1NHzCT8=; b=PYV2xvr8zwl83kfooA+O8fExc3LKk+k+cTMgkWHO903lj3G9HbN1pgU/jr5RFLBOOY 1d9aDAmZPXytxQ7aLoFrYEf4WNit4Qv7GiJdSXUWM8dn0leUhXEUNYYpC5G1C+YXm/Gc 1sklUCU0G7S9gSAIgS1YJ8gAHxIxjh8Gr2hDp+q8vA0wzGGipD3dpBWl1lYNKnfKLBQb KBl8L0x5odCp/jVcDDnYmETawaX9czjNFXDv/SXaP2+tZgZozHXshW0J6Z1AsqIZUToZ 5/v4PRhLcQJAPvkKCzjRYnZig8+949yYBjFab12lvKzG8q/hqozGRnPSkoxvRM1wfulM yRUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TD4orS8+; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h10-20020a05640250ca00b00453688643fasi2042995edb.260.2022.11.30.10.19.52; Wed, 30 Nov 2022 10:20:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-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=@kernel.org header.s=k20201202 header.b=TD4orS8+; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230156AbiK3SSc (ORCPT + 99 others); Wed, 30 Nov 2022 13:18:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230173AbiK3SSL (ORCPT ); Wed, 30 Nov 2022 13:18:11 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C35A18B184 for ; Wed, 30 Nov 2022 10:15:38 -0800 (PST) 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 6D2D6B81C9D for ; Wed, 30 Nov 2022 18:15:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABBAFC433D6; Wed, 30 Nov 2022 18:15:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669832129; bh=8jF1vgKRCb+QRwGb6evUrsz3ZuHKcMT1cygCoD2VWS4=; h=From:To:Cc:Subject:Date:From; b=TD4orS8+j3ZaO+6iiGXeG39DjgT6NZnBIFCoUw8Wtntd3hk9FY520qQQuAc5El7Nb gqZQDs6QzMb2Q0mN4zN0rhGssFy+eY3l4JZWrEwlMp49cy5rPKtbTpF4sm+F2aDBJc HmzqRwYpKwf43mSyQQbSuIcY+PGXw6pR+YlY0q3X0z8RwMQ6LiA1+A6GAHsmuT8yD1 Q0xPT3Fx50Gj/6LByeOYH9WfztRUAUx7VJfK+XagftfKjcnR6bjaVavfz1R1BfAUUZ H0KI3P88qKBBBij7t0ealK+vrfD1kegLO0BYRggAWI3FkokBmJ/xusz3+FWLqeld+Y hi3mc8i86C8iA== From: Anna Schumaker To: linux-nfs@vger.kernel.org, trond.myklebust@hammerspace.com Cc: anna@kernel.org Subject: [PATCH 1/3] NFSv4.2: Set the correct size scratch buffer for decoding READ_PLUS Date: Wed, 30 Nov 2022 13:15:25 -0500 Message-Id: <20221130181527.766485-1-anna@kernel.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 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 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-nfs@vger.kernel.org From: Anna Schumaker The scratch_buf array is 16 bytes, but I was passing 32 to the xdr_set_scratch_buffer() function. Fix this by using sizeof(), which is what I probably should have been doing this whole time. Fixes: d3b00a802c84 ("NFS: Replace the READ_PLUS decoding code") Signed-off-by: Anna Schumaker --- fs/nfs/nfs42xdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c index fe1aeb0f048f..2fd465cab631 100644 --- a/fs/nfs/nfs42xdr.c +++ b/fs/nfs/nfs42xdr.c @@ -1142,7 +1142,7 @@ static int decode_read_plus(struct xdr_stream *xdr, struct nfs_pgio_res *res) if (!segs) return -ENOMEM; - xdr_set_scratch_buffer(xdr, &scratch_buf, 32); + xdr_set_scratch_buffer(xdr, &scratch_buf, sizeof(scratch_buf)); status = -EIO; for (i = 0; i < segments; i++) { status = decode_read_plus_segment(xdr, &segs[i]); -- 2.38.1