From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13766C41513 for ; Thu, 10 Aug 2023 13:08:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232740AbjHJNIn (ORCPT ); Thu, 10 Aug 2023 09:08:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbjHJNIk (ORCPT ); Thu, 10 Aug 2023 09:08:40 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36E65E5D for ; Thu, 10 Aug 2023 06:07:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691672878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Gv2PHDy05xeKCb4ONOqV5jsjjW0Plf8giK9Cu4AytwA=; b=FaVaPQEUgfsdFhy0xXC+DrlcJRoGJJmTQ8GwDlgTvytTilvX8yonxK74F6LjsBT+b5tRtf hkH3LUqPCqAuFbnGjdZxeNSRkKdtesVMFAQ0yV3UoFzWu3t/Tvn9EM5UxU9I2IhOCNTDcJ K7S6rm2dDIHj89M0AGr1LDGP9/EZ0OQ= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-12-YI7mgYmVP4al5-pb-1FX0A-1; Thu, 10 Aug 2023 09:07:55 -0400 X-MC-Unique: YI7mgYmVP4al5-pb-1FX0A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A46151C07263; Thu, 10 Aug 2023 13:07:53 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id 33D24C15BB8; Thu, 10 Aug 2023 13:07:50 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <4c49176f-147a-4283-f1b1-32aac7b4b996@gmail.com> <20230522121125.2595254-1-dhowells@redhat.com> <20230522121125.2595254-9-dhowells@redhat.com> <2267272.1686150217@warthog.procyon.org.uk> <5a9d4ffb-a569-3f60-6ac8-070ab5e5f5ad@gmail.com> <776549.1687167344@warthog.procyon.org.uk> <7337a904-231d-201d-397a-7bbe7cae929f@gmail.com> <20230630102143.7deffc30@kernel.org> To: Tariq Toukan Cc: dhowells@redhat.com, Jakub Kicinski , netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Paolo Abeni , Willem de Bruijn , David Ahern , Matthew Wilcox , Al Viro , Christoph Hellwig , Jens Axboe , Jeff Layton , Christian Brauner , Chuck Lever III , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Boris Pismenny , John Fastabend , Gal Pressman , ranro@nvidia.com, samiram@nvidia.com, drort@nvidia.com, Tariq Toukan Subject: Re: [PATCH net-next v10 08/16] tls: Inline do_tcp_sendpages() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3480242.1691672869.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Thu, 10 Aug 2023 14:07:49 +0100 Message-ID: <3480243.1691672869@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tariq Toukan wrote: > We are collecting more info on how the repro is affected by the differen= t > parameters. I'm wondering if userspace is feeding the unspliceable page in somehow. C= ould you try running with the attached changes? It might help catch the point = at which the offending page is first spliced into the pipe and any backtrace might help localise the driver that's producing it. Thanks, David --- diff --git a/fs/splice.c b/fs/splice.c index 3e2a31e1ce6a..877df1de3863 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -218,6 +218,8 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe, while (!pipe_full(head, tail, pipe->max_usage)) { struct pipe_buffer *buf =3D &pipe->bufs[head & mask]; = + WARN_ON_ONCE(!sendpage_ok(spd->pages[page_nr])); + buf->page =3D spd->pages[page_nr]; buf->offset =3D spd->partial[page_nr].offset; buf->len =3D spd->partial[page_nr].len; @@ -252,6 +254,8 @@ ssize_t add_to_pipe(struct pipe_inode_info *pipe, stru= ct pipe_buffer *buf) unsigned int mask =3D pipe->ring_size - 1; int ret; = + WARN_ON_ONCE(!sendpage_ok(buf->page)); + if (unlikely(!pipe->readers)) { send_sig(SIGPIPE, current, 0); ret =3D -EPIPE; @@ -861,6 +865,8 @@ ssize_t splice_to_socket(struct pipe_inode_info *pipe,= struct file *out, break; } = + WARN_ON_ONCE(!sendpage_ok(buf->page)); + bvec_set_page(&bvec[bc++], buf->page, seg, buf->offset); remain -=3D seg; if (remain =3D=3D 0 || bc >=3D ARRAY_SIZE(bvec)) @@ -1411,6 +1417,8 @@ static int iter_to_pipe(struct iov_iter *from, for (i =3D 0; i < n; i++) { int size =3D min_t(int, left, PAGE_SIZE - start); = + WARN_ON_ONCE(!sendpage_ok(pages[i])); + buf.page =3D pages[i]; buf.offset =3D start; buf.len =3D size;