Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1759570lqp; Mon, 15 Apr 2024 17:12:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWaGp5AZcNtyTlLVPWSJVNkstLeKvYoNzBCYW8OQaqS4LxbCO6XwCwdTSxCScsis/VaTT/ylg7/59EoyowUWg4Ye4fw8rQrraarkhNiXw== X-Google-Smtp-Source: AGHT+IEYmO1qIrj/b1kLdGC6j19nITbsD05QsIx4vSCmWVx6Sb2w/+RWO5t5uFS4jGT1tOCbxyah X-Received: by 2002:a05:6a00:190b:b0:6ed:4288:650a with SMTP id y11-20020a056a00190b00b006ed4288650amr11829577pfi.19.1713226322141; Mon, 15 Apr 2024 17:12:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713226322; cv=pass; d=google.com; s=arc-20160816; b=vqfD/BidroGIJ2rpaIY9wyi6qBpD4ty0yulzdKWsrdTB32ZPgp4q50Y5y/l0UE45Mn 8S0zf5VLF5flHsNQC+JCFakj4SjRLQwhbo2ngHuRF7yf0pLxK4dHDZlZ9abYdL1NXG7h cS8XmqQtSxCSwtxSGR26r9aW4zpSI8PVT+JMIhj4slxHaSb7Zy7PNu20P5+dPSg4AvR9 ecadF9AlRCBjQC4fpmIgpClUCjRh1M/hAC40Mzm0RjmPMIAIvLJk7HZ8eZ+FeoS5oPSl BlmovDtsCA3rCtDtVSzQlD8HcOtpeWP9rHFwCYJJ05fFlJFlCgtYXyz6AyDEduirjTk+ AuUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=QgpRX25WcBTadwRMQIY0mjh2vDCvBvK7RwDvhG8WPMY=; fh=Vr1Td+7qQ6XtZNcNXq6FkJeLRTopXefc/04D11YiJ1U=; b=0w92kK1nlcE/bJgqHXrtQ4l0Rpkm9wAaTj7sVkKz1sBVQZ7CXo4lDWkbw9nMFugnd2 wFQWET5g1Mi3bAwl1doJf3VSY/rr0rOSclSpgbNjj82P0/tIm+gwwO9x+giL6lxeafwJ oKOZtXA4dTXE9pUltpAfjb6DpE8wM+P7+KSbs6XC4KkKTPnukY+8jp9o512GYqxk1NcW ntkNeI+Y8MplrMOrX7Kfmbrm0KBhDDvu7U2oUJuxVgYWGHrHNMnM3YgzeP3camuFdM4G 7o0TZP0i/8LDZl6tTBvnTmQmv/o++uO6Gui3VzEio7ex4W6Jajv3w2gKN1dOo+wKoOhs HRsw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=auh6ZTKh; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-145911-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145911-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q29-20020a63751d000000b005cdf89f64ffsi8657191pgc.482.2024.04.15.17.12.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 17:12:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145911-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=auh6ZTKh; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-145911-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145911-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 02BCBB22F6E for ; Mon, 15 Apr 2024 21:08:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82F87157470; Mon, 15 Apr 2024 21:08:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="auh6ZTKh" Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3587F156F2C for ; Mon, 15 Apr 2024 21:08:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713215310; cv=none; b=i3Nvdch4ZigQAeHowuMxJhB1dsanuho8daU0C9Vrnrwu+kiDDnIar7DUNanfoQv0/OahBrUgBbP1OR8ObvfhhY2Tl/MyhAv+u2+hPGwAGK/j0XoAUHQ2bZiSoJbwn0K4KcLbGuYsE5s1jK52uQYKoYm8K4ZjWqyee65XLmF91ZE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713215310; c=relaxed/simple; bh=9zW25fHq1ZD5HHdi3TNMFeS3vITYxyMxTWLWlaElhF4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=G6lyGSVQg7lfZKB68M3M/y4TYhqd3wOrdSjdvFfEjL1taRvVrKz3jAdijUEnuU1hWkCUQkmy1mX1082yboaQA6PmwT2nxRSIfGuyawSn3qjlvRLPzXVKSIx2Gapm+1qwBO7ENoDnEFWaYdcrZQKZlHLJ5sQGtJjysHa5wfQDmkM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=auh6ZTKh; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=QgpRX25WcBTadwRMQIY0mjh2vDCvBvK7RwDvhG8WPMY=; b=auh6ZTKhB8miyj5dBJcEPZNfSn 06AE3PCeyrOEX1A7zSx2wBfefOd3GvJAb24Al7vZBKJekMrxLMmJECCRbA6g+zOh8J0FPzgdoH8Ui NJ/2YRqviFru6OSZyb+gCUNsJ8BD9qK5jU8+aFkKuHfz9+nEJLU7XPoMu/82w0jF5w+LfaOnLaW4W sgVUc9EDTdjR32ogzTsaMFf3haNUmTb7ugRF943H4PDXr4VowWIQx6lg1ER+zvOScFSHo3gRN4/cp XEKXSLNDuwi1bjiQRJtf8kFCvNePCbvAITZH6/yAsn0Pqq5voPRoSrPJ1ui5QHAp6b9z62A8i+QPg uILARhBA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rwTYx-00D1Au-1A; Mon, 15 Apr 2024 21:08:27 +0000 Date: Mon, 15 Apr 2024 22:08:27 +0100 From: Al Viro To: Jens Axboe Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 002/437] fs: add generic read/write iterator helpers Message-ID: <20240415210827.GX2118490@ZenIV> References: <20240411153126.16201-1-axboe@kernel.dk> <20240411153126.16201-3-axboe@kernel.dk> <20240415195504.GU2118490@ZenIV> <898afc09-428f-4da2-a620-d7ca9f37133c@kernel.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <898afc09-428f-4da2-a620-d7ca9f37133c@kernel.dk> Sender: Al Viro On Mon, Apr 15, 2024 at 02:11:56PM -0600, Jens Axboe wrote: > do_loop_{readv,writev} need to look like the one io_uring had, which was > just an augmented version of the fs/ version. At least for handling > anything that is IOVEC/UBUF/BVEC. IOVEC and UBUF: pointer will be __user one; copy_from_user() works. KVEC: kernel pointer. Try copy_from_user() on that on x86 with SMAP (or on e.g. sparc64, etc.) and you'll get an oops. BVEC: page + offset, page quite possibly not mapped anywhere in kernel page tables. And "just kmap() around the call of your callback" is not a good idea either, for even more reason that for KVEC.