Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4660570ybz; Tue, 28 Apr 2020 15:55:19 -0700 (PDT) X-Google-Smtp-Source: APiQypKLGG+GRRc116YZS4uoMjPED42d0EPdulA1iC+axqDrM7VXko5kNHRXcCl3UCklPFHnvER2 X-Received: by 2002:a17:906:1199:: with SMTP id n25mr88921eja.30.1588114519393; Tue, 28 Apr 2020 15:55:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588114519; cv=none; d=google.com; s=arc-20160816; b=ISEPZDss4y4WTWP8I2r/vQbIK26P9WQmIJ4I6hPomdtZkUUSCrXh7tHzLjJidRMawJ AwEb+H54hIbalYk0jCkn35tcaMGM0oGOUpVwEIhzml+1+Z/tbWdMQE9SNkX+Gle0j/QC G5O1HiHl1Ib1LWrXQLbdwUvWt+/3ZAYmgfss473LfeCW8OmjjxXs6/aiUWfFo4sKTg0e N0IKF1UhR8Hl9/cUE36ySWMP7t7D4kNKuc8b4yMwyA//VFY76BRPYWcdOfpT0jb1uU4q ZFW18XUlGYKvMzAoEO0T6qpxkYqwYroyDnVN7oMcJalxrdRe1o8J/H80IQbJK+nbEUHo uTyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ZNURFMhJF8H58XWmZSjs5eoLExGSUn8DAyzhgohQBbI=; b=DrdgnbMDMcsiksrVsyuCIEaeNVwQILVroRYNsgPUQkzzaTy4v0jtADdn3n+UMOu3DO ZOKIqLG8g9Pk2C7C/n3/kA065swTfByCyJki2tJh8anpTonIgDoka6OSf32+y2huOOcq UJT7oM38QITNXHnktOmWy+ZXYpwFzvSoob+4GrpqTYP5mzatmRSOS3TaWBB0zcp9C6rO POBdu6mbxI4mrtDygPt52m5rllQfNulzo6wIs5o8eE8N59pfKlZcGgzimJe32zZLQwKW GQ4k0aDZI0gR0M0ZLTvy1MNh7DHtwqgF4PVC1+nLkmg0UO7LHtfkQwag07CqlqkO4iKM Hlew== ARC-Authentication-Results: i=1; mx.google.com; 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 62si2526899edc.448.2020.04.28.15.54.04; Tue, 28 Apr 2020 15:55:19 -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; 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726470AbgD1WvI (ORCPT + 99 others); Tue, 28 Apr 2020 18:51:08 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:46842 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725934AbgD1WvH (ORCPT ); Tue, 28 Apr 2020 18:51:07 -0400 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03SMXIPx025824; Tue, 28 Apr 2020 18:50:51 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 30mguwftgp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Apr 2020 18:50:50 -0400 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 03SMXW1k026169; Tue, 28 Apr 2020 18:50:50 -0400 Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com with ESMTP id 30mguwftg3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Apr 2020 18:50:50 -0400 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 03SMeNJ1012807; Tue, 28 Apr 2020 22:50:48 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma01fra.de.ibm.com with ESMTP id 30mcu8d8yk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Apr 2020 22:50:47 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03SMojJj61538642 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Apr 2020 22:50:45 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EED7752057; Tue, 28 Apr 2020 22:50:44 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.4.15]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 43CCC5204F; Tue, 28 Apr 2020 22:50:44 +0000 (GMT) From: Claudio Imbrenda To: akpm@linux-foundation.org, jack@suse.cz, kirill@shutemov.name Cc: borntraeger@de.ibm.com, david@redhat.com, aarcange@redhat.com, linux-mm@kvack.org, frankja@linux.ibm.com, sfr@canb.auug.org.au, jhubbard@nvidia.com, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, dave.hansen@intel.com, peterz@infradead.org, sean.j.christopherson@intel.com Subject: [PATCH v1 1/1] fs/splice: add missing callback for inaccessible pages Date: Wed, 29 Apr 2020 00:50:43 +0200 Message-Id: <20200428225043.3091359-1-imbrenda@linux.ibm.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-28_15:2020-04-28,2020-04-28 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=968 mlxscore=0 suspectscore=0 bulkscore=0 adultscore=0 impostorscore=0 phishscore=0 spamscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004280174 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If a page is inaccesible and it is used for things like sendfile, then the content of the page is not always touched, and can be passed directly to a driver, causing issues. This patch fixes the issue by adding a call to arch_make_page_accessible in page_cache_pipe_buf_confirm; this fixes the issue. Fixes: f28d43636d6f ("mm/gup/writeback: add callbacks for inaccessible pages") Signed-off-by: Claudio Imbrenda --- fs/splice.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/splice.c b/fs/splice.c index 4735defc46ee..f026e0ce9acd 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -106,6 +106,9 @@ static int page_cache_pipe_buf_confirm(struct pipe_inode_info *pipe, struct page *page = buf->page; int err; + if (arch_make_page_accessible(page)) + return -EIO; + if (!PageUptodate(page)) { lock_page(page); -- 2.25.4