Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9437316pxu; Mon, 28 Dec 2020 16:31:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwpBal79TD5s42RzRfXYs72qJQg2dTM4PrFxEnPG1OzbQ+kot/fv9Oa1KZKFKn6aAnNWt0F X-Received: by 2002:a50:d60f:: with SMTP id x15mr43368213edi.224.1609201874474; Mon, 28 Dec 2020 16:31:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609201874; cv=none; d=google.com; s=arc-20160816; b=e66wXh1AVDCMjyXVJWY0QKToU54e0UxHvfdPaLo/rVzyshK2suoA4Up/9Ds+RlQSbJ 8KFNH7nd6ajrwBg95ueVrYo+oMDxaOEakArixaCQM+QrcGnS6ASEKHdVQKPdULY1QLBK 6lg6UvR7hGJZUwfRLRWelGYAJu5apcLZdgxtGvvXzcFQKLCRHd6Ll8Uk94Pkd5N3rlUT CggyHRF0aXRgmxO1rs9fWOQHh+CoSyjebj+dM8wlyLoKUmMzj82jZ1i6gYOwuFmD0zaw Ts9MJiMNNyFRZnwSBlLKVYvuwmmNJ15Ctz3qXDs2g9OI7qjikQApfz+ooodnMdLxbIy5 naqg== 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=BeNo5LXq5ObuBJBUIRLKula8H4LBl+tNNlO1wouOx2w=; b=SiVU1Olb+EwDpA+X99zudLpo+nuhRvzGYJyAaB/3o+kgSBTp83Fq5kX0aqZQI9FhB/ OVEAtDggauCjgfL/8FmmfYjCht2Ior/gA34SagAhqlH9Hv5h0QvyzZVb/5SHrh/69YeN JNq85520q3myWlC5RgrBY+3VKXDX2pA3d2Q7gBDduCm3/Oz76ADbn0xe65l+zHeVwaMg qt7usF1qvoCdZYvKQI3SgsKb4ir7nuJon2WmYsUMTCCId84B9ZLYWSMAcqWJ2/U+SjX9 JLs5y/M6IU90zMQpBR/sM0MCORJyt5J6VX+JDaM+4a3riS9/uL5YNwcSCE5yhhZr5ClW 1LoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lRNZCZwx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g10si18574570ejf.344.2020.12.28.16.30.52; Mon, 28 Dec 2020 16:31:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lRNZCZwx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408773AbgL1Pjy (ORCPT + 99 others); Mon, 28 Dec 2020 10:39:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:49836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405963AbgL1Nsr (ORCPT ); Mon, 28 Dec 2020 08:48:47 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 78488206D4; Mon, 28 Dec 2020 13:48:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609163312; bh=9zCcxbBZCihROBVI0RDvidq1dZsuhI1UZG8VfSxOiH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lRNZCZwxI3sF/+A/K/3hfy/u9rxMW5jhTF6hFFSJjy3jgHJBa9owsMFnksLoXCwUd tGnqsta9VYXZAtcNwIMneIeQ8EsyVJqnRe/UPuDBzKlFXD5qENX6iSS6fD0XiSKpSg 8U6qw2qOsz8G6FEM35eBXQke0276/zyQOw6lS3GE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust , Sasha Levin Subject: [PATCH 5.4 202/453] NFSv4: Fix the alignment of page data in the getdeviceinfo reply Date: Mon, 28 Dec 2020 13:47:18 +0100 Message-Id: <20201228124946.933598986@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124937.240114599@linuxfoundation.org> References: <20201228124937.240114599@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Trond Myklebust [ Upstream commit 046e5ccb4198b990190e11fb52fd9cfd264402eb ] We can fit the device_addr4 opaque data padding in the pages. Fixes: cf500bac8fd4 ("SUNRPC: Introduce rpc_prepare_reply_pages()") Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- fs/nfs/nfs4xdr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 677751bc3a334..9a022a4fb9643 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -3012,15 +3012,19 @@ static void nfs4_xdr_enc_getdeviceinfo(struct rpc_rqst *req, struct compound_hdr hdr = { .minorversion = nfs4_xdr_minorversion(&args->seq_args), }; + uint32_t replen; encode_compound_hdr(xdr, req, &hdr); encode_sequence(xdr, &args->seq_args, &hdr); + + replen = hdr.replen + op_decode_hdr_maxsz; + encode_getdeviceinfo(xdr, args, &hdr); - /* set up reply kvec. Subtract notification bitmap max size (2) - * so that notification bitmap is put in xdr_buf tail */ + /* set up reply kvec. device_addr4 opaque data is read into the + * pages */ rpc_prepare_reply_pages(req, args->pdev->pages, args->pdev->pgbase, - args->pdev->pglen, hdr.replen - 2); + args->pdev->pglen, replen + 2 + 1); encode_nops(&hdr); } -- 2.27.0