Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp516356pxx; Wed, 28 Oct 2020 10:06:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwd/nwpsbQtGuGSc2LY6GwULlHICCjqZPLWOvzqSh0RdkcT1Eudf2MSOHUUprgyMl2OKpKt X-Received: by 2002:a50:e881:: with SMTP id f1mr8889953edn.58.1603904770503; Wed, 28 Oct 2020 10:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603904770; cv=none; d=google.com; s=arc-20160816; b=C+ffYE837JHzHoMmWn70g1OlhwJqiNghKRypPfy4rRul1MiyrMKTKvHmVVYXc1AWhc i3DIVQRg7tOnr+QeTXpTVqWEHhSsrrBK+OkU/N4veHEKlZQSQQfEhtVCebs/jvyAv+WJ yInQDa5UxluAJ/hc0g7ygW+WnUikm3GnHwuNVoCDTc/Mh2fVExteiPUbPWtVUYMqCfeb CDNfYm/Yp7adzfRgAl6b86xi8tT7dJ2WMO/e+n6ja4UCdfg9MuTmeGAehWrpbnoMZMLn 3dEHCkpW0TnBBmK0fvAWO6pTdXpj+pT5yNJrr/YP5SQuBY1uv8uLi4OJ/LonH0tBi3hE EY8w== 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=MI6oun7OdlHyzDQyvjUpoww6cSDjoVBnNJkBBPPW6PY=; b=uz6u2j7am5jVMl1Ge/Ye1BD9RgqixRcNiRR1yJ6oSaF4v6Hr9v31dQ9uLw66cWBi4z aoS/NDN8uw/GRIzcCIfumxVUmKVIRyIXSwuZSU3ZeWptt1RD+8KbfVJleI/f/n689eMd hulqIKqJ0qtcjQw/uG1BuuFphFy7mdV1EvXuXN5URmkp+GGbpkEVQLN7Xz8wHoN71mnY pn41p2DOaZEzjTpx2b+mHRtw3SdHhILIc+sZforn3CweFKzZAzM9f4c1qDzh0K2EJG4k jrM3QOwieOvOET3OeGVIbu0LWMDJ0DVqT+7bmQfK8HTPjuHq8Ru7Fro9iEtUMmzdEIch mrlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q6txOo69; 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=fail (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 z17si3710274ejc.499.2020.10.28.10.05.44; Wed, 28 Oct 2020 10:06:10 -0700 (PDT) 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=@kernel.org header.s=default header.b=q6txOo69; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1820086AbgJ0Rcs (ORCPT + 99 others); Tue, 27 Oct 2020 13:32:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:40588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762156AbgJ0OlP (ORCPT ); Tue, 27 Oct 2020 10:41:15 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6962822265; Tue, 27 Oct 2020 14:41:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809674; bh=JTuT4yKUCAiLFq6/KUrdr0dtjcioYZ70llywaHk5ttY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q6txOo69i/c3ksEvF8tdJmGu0rcF8+lGt9fE0uFjOJfWrIE1lKtkvdzW1lm+qsWoR tjO9s8b9h0kaRu/SbM9JfkdJ2d5nB/gMf59wI8eY/ogAGEbUSRUUkCOtDNx+XIcJiu a1yBWDlpVf02jFgS2mEy6fGF3ClGV8H/yjkSVyt0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Aloni , "J. Bruce Fields" , Sasha Levin Subject: [PATCH 5.4 278/408] svcrdma: fix bounce buffers for unaligned offsets and multiple pages Date: Tue, 27 Oct 2020 14:53:36 +0100 Message-Id: <20201027135507.936388066@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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: Dan Aloni [ Upstream commit c327a310ec4d6ecbea13185ed56c11def441d9ab ] This was discovered using O_DIRECT at the client side, with small unaligned file offsets or IOs that span multiple file pages. Fixes: e248aa7be86 ("svcrdma: Remove max_sge check at connect time") Signed-off-by: Dan Aloni Signed-off-by: J. Bruce Fields Signed-off-by: Sasha Levin --- net/sunrpc/xprtrdma/svc_rdma_sendto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index 217106c66a13c..25e8922c10b28 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c @@ -609,10 +609,11 @@ static int svc_rdma_pull_up_reply_msg(struct svcxprt_rdma *rdma, while (remaining) { len = min_t(u32, PAGE_SIZE - pageoff, remaining); - memcpy(dst, page_address(*ppages), len); + memcpy(dst, page_address(*ppages) + pageoff, len); remaining -= len; dst += len; pageoff = 0; + ppages++; } } -- 2.25.1