Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp1208113rwl; Thu, 10 Aug 2023 07:58:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHalLC1SAqeXypNDYhbYsCofsmV4SBkyc8xIr7zWkAkA8Q3jLS67pK1NW7Ny+8FpZwBCh+ X-Received: by 2002:a17:906:32d4:b0:99c:ac84:663b with SMTP id k20-20020a17090632d400b0099cac84663bmr2407092ejk.65.1691679523083; Thu, 10 Aug 2023 07:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691679523; cv=none; d=google.com; s=arc-20160816; b=bxKWig0+JbFqX41Z0YGs1KOI7iuYqCVjRuaaL582fwCgt4nsgCjQX58qQ81Ncf0dnL /RrQiGnXFudwfINEGwAgmb20NOlMYY9Rb4eBlKb+APoSphCS7VuK/obnJ+MeLEZspJyK os6Vqo6f483Fk7XhmXebR0IEYHHTyOO+tsnIY3wnDPO7M6F1Mw3lnUFwKK2bEfjVJKOk ynbKJtoN5f6RRmPPt2zVleBt6Aou1omwRpCSonHC5gsmRB2aPph/QHL5EcIbi1RWqdJ+ Yi7YViGhHIfCXQPoLPz0rSF+772tlg0KLdisWehka99O06fdB3O62wKiNOgqx+dUM5vR Wl/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:references:in-reply-to:from :organization:dkim-signature; bh=Gv2PHDy05xeKCb4ONOqV5jsjjW0Plf8giK9Cu4AytwA=; fh=5ofyhT1ZKwBB80gEnFl8GqNNGrdXOe0+8W9FtsefZiw=; b=e/a9HR8FGBkbTsF7zm0wK/LaEslvs96sOfyTV02FVhLQADKKoP8T+ipeXNMYF81hPf CA3LxUGN0OpuzW6Glmuo9yn2rHWRIx7/Cq9KREqeL2B5NW7ABXB23BHLHo1f8F8hZwVW 80amaPr0A0g3EHaekykG38G6sNgcaknhKnrFtpL2P9hRM+W/UehjIS6ulpTpTanXFESl x5XHCBSVrYmtExYFYzbNsPV64r9lE0J3OyDAlK2QK+stL9KPnQJp8W0jDsjMyYbu2qI4 6Xyj7m92mFqknB8EbveiA+qi9HwHV1gKA0MFLaLT3+8SRogZbs6xKMdZgAXMOpk2gydx VaxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FaVaPQEU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l1-20020a170906938100b0099bd4f6106esi1702083ejx.105.2023.08.10.07.58.17; Thu, 10 Aug 2023 07:58:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@redhat.com header.s=mimecast20190719 header.b=FaVaPQEU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230205AbjHJNIl (ORCPT + 99 others); Thu, 10 Aug 2023 09:08:41 -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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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-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;