Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27780702rwd; Tue, 4 Jul 2023 07:47:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlGUobio0whfHzQP5erDisjoyecq4uSUubm0xcD+ygwIYOK6HUvAvVKLHMd1Z6FL66MAdGZF X-Received: by 2002:a17:90b:3d8f:b0:258:9621:913f with SMTP id pq15-20020a17090b3d8f00b002589621913fmr15629628pjb.3.1688482028469; Tue, 04 Jul 2023 07:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688482028; cv=none; d=google.com; s=arc-20160816; b=pyPsEho10qZUmxa1woOXHlkPPcrOZ8S2TfTX9u1nnOAMiY2xcRyoN8iqBUPRfKTrqz FYxjX0MUP92H/t8SfND6jM0ZUZRnm+0/u/pM8NBhnui2AFH5kf7NQyHPL3DFOtFBcCB9 UHLKnbRvTYzBn88W0XEVaiLWnDGzUjznwvqsZEkQjT+wy/PhJ9x0HXPYHrg9Lw+jZ6Pg Z4OMXOppuVfloy87z8KrcjyTjb6u03tDcVnV3FPPRbRqgw8Yq3RESY0b6HCpfTY096NI Kt8vA+ftHLcU9t6dPdM7Uze0tEtWPApvas1Ta3wpcntMGQDvMIg+V1DDxybjkoQSAd/2 pwpA== 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-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=gYHch/SklDJL/CopH6fHbY5oof68s+i62UNUpHYmC24=; fh=51wms6boE4GvjmosLq9DnAPh/Ah3fB0FVI5yu8bsZ8M=; b=XlCiFSz/E4IqfyssthFdI2D9EW0R1ZmHL8QaWZkkkod1UMsJrxbis5FLtKwROoaiIz TlHAgl7MvooSSr4f1JhIxKikPWr8BizJY17K9AITmzI4Y+d5uGbXJlsBQZGanDwt703R ex0N73R8Zrb6E2l55rWF/Sey8ls6HGxsRnCL3koWAS5mRcBkOGtle4X42CPAQZHOHV5h k7svnKEk9ndmyiFdqHMbHs2K3Ivhn/zwZlT+g6DRsnrnMn7FAkEIPWOLwwmmJb2SqL8S wzsQQMU3AfAeNam2hM3lFW4uH4+fzCimnySqt9skO1AyaRUh6DPP2Jy3WNIH3Q97g3Mq A96Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WVolJ3hX; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 ay2-20020a17090b030200b00262f7d7d2dfsi16975359pjb.40.2023.07.04.07.46.49; Tue, 04 Jul 2023 07:47:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=WVolJ3hX; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 S231131AbjGDOe5 (ORCPT + 99 others); Tue, 4 Jul 2023 10:34:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230200AbjGDOe5 (ORCPT ); Tue, 4 Jul 2023 10:34:57 -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 F2EC0E5B for ; Tue, 4 Jul 2023 07:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688481253; 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: in-reply-to:in-reply-to:references:references; bh=gYHch/SklDJL/CopH6fHbY5oof68s+i62UNUpHYmC24=; b=WVolJ3hXZFrf47aLRYJIU6JEC90Gbcf5UpFYbl0jA1XS5l5wpm4OD6yM4i5jCA9cuUR6qt G2pRz2isMszaJcyYLeDpaeTp2BL1UIIFhsh3cqMQKvbrShF1U8kocdN7tZ85cNln6ceGVe yq4DE/7H2u6O9P0vHZVnIXfgG2ZHEuo= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [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-650-TumVCkMINnWZXNJl7_pR8g-1; Tue, 04 Jul 2023 10:34:10 -0400 X-MC-Unique: TumVCkMINnWZXNJl7_pR8g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8077B1C04B40; Tue, 4 Jul 2023 14:34:09 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.195]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0A681121314; Tue, 4 Jul 2023 14:34:08 +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: To: =?UTF-8?B?T25kcmVqIE1vc27DocSNZWs=?= Cc: dhowells@redhat.com, Linux Crypto Mailing List , Herbert Xu , Paolo Abeni , netdev@vger.kernel.org Subject: Re: Regression bisected to "crypto: af_alg: Convert af_alg_sendpage() to use MSG_SPLICE_PAGES" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1506613.1688481248.1@warthog.procyon.org.uk> Date: Tue, 04 Jul 2023 15:34:08 +0100 Message-ID: <1506614.1688481248@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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, T_SCC_BODY_TEXT_LINE 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-crypto@vger.kernel.org The problem is caused by this bit in af_alg_sendmsg(): /* use the existing memory in an allocated page */ if (ctx->merge) { sgl = list_entry(ctx->tsgl_list.prev, struct af_alg_tsgl, list); sg = sgl->sg + sgl->cur - 1; len = min_t(size_t, len, PAGE_SIZE - sg->offset - sg->length); err = memcpy_from_msg(page_address(sg_page(sg)) + sg->offset + sg->length, msg, len); if (err) goto unlock; sg->length += len; ctx->merge = (sg->offset + sg->length) & (PAGE_SIZE - 1); ctx->used += len; copied += len; size -= len; continue; } it doesn't exist in the old af_alg_sendpage() code. It merges data supplied by sendmsg() into the last page in the list if there's space. So we need a flag to keep track of whether the last page is appendable-to or not. David