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 CBA79C19F2A for ; Mon, 1 Aug 2022 12:49:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235099AbiHAMtn (ORCPT ); Mon, 1 Aug 2022 08:49:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232073AbiHAMtX (ORCPT ); Mon, 1 Aug 2022 08:49:23 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 12545CE for ; Mon, 1 Aug 2022 05:42:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659357732; 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=luwZH7AXAZbt2o2m1CKSUMj4j+KPl8zJfNy9zV/QSC4=; b=GRlwHZjkXnRRmqBR6blg+NwgsE6fL2fEYPKjbGS14lPpZ9J5lDN2rGE4YjJdlR7UfRzquO NDVmdcascrq6xOv/N4GZtJbPtQrhqrbKsazZ8YvjoxjKtC322nhq0sKXu0QB3mjZMKa3oZ q8B6cAUkOYk5Kl1yBJSZj95urQ9sZNg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-327-j23JarHXPWGQs5qxjJ4c0g-1; Mon, 01 Aug 2022 08:42:07 -0400 X-MC-Unique: j23JarHXPWGQs5qxjJ4c0g-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7D1ED8041BE; Mon, 1 Aug 2022 12:42:06 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 456BF401E5C; Mon, 1 Aug 2022 12:42:05 +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: <20220622041552.737754-9-viro@zeniv.linux.org.uk> References: <20220622041552.737754-9-viro@zeniv.linux.org.uk> <20220622041552.737754-1-viro@zeniv.linux.org.uk> To: Al Viro Cc: dhowells@redhat.com, linux-fsdevel@vger.kernel.org, Linus Torvalds , Jens Axboe , Christoph Hellwig , Matthew Wilcox , Dominique Martinet , Christian Brauner Subject: Re: [PATCH 09/44] new iov_iter flavour - ITER_UBUF MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2806273.1659357724.1@warthog.procyon.org.uk> Date: Mon, 01 Aug 2022 13:42:04 +0100 Message-ID: <2806275.1659357724@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org You need to modify dup_iter() also. That will go through the: return new->iov = kmemdup(new->iov, new->nr_segs * sizeof(struct iovec), flags); case with a ubuf-class iterators, which will clobber new->ubuf. David