From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 A27C45698 for ; Wed, 12 Apr 2023 14:24:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YPL5BBTcasYPLyMcAw8sBNleYmI9kHBYcWCLDriGfOA=; b=MsX2N+ExLwZ/qPROWUdCDVge61 vRXyMh9YoXcvIvjZTGiKYMrxKueZuGp7TGiGPT4WV2L+/EneY+bKu5t9Oj0NeDe0swUWRqv9FvRVl IN4/UqBDEYTb/Ed7jKVsaeMpHVtfsGeo/rytVooKCEvGWQrcLwxTAy3x97MwtwEnE+l3SNH+qBDbT NbnUUWa1jDIIyPVbF6flX/Bb8PVX4DAuRd+MhhjUd2YPzHxElxRni7cB3cm0/DWyY+R1PBbAfgux4 bupMueJPqKAQrn2exXnCL1TXtbYCfTVObqxkUPFgOqHdzVGB7jcaWKEh6AklMIcc6UEn1xbdtHUbr O0J/KkhA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pmbOO-006w6x-Bc; Wed, 12 Apr 2023 14:24:12 +0000 Date: Wed, 12 Apr 2023 15:24:12 +0100 From: Matthew Wilcox To: Tetsuo Handa Cc: syzbot , ntfs3@lists.linux.dev, syzkaller-bugs@googlegroups.com, Konstantin Komarov , Hillf Danton , linux-fsdevel , linux-mm , trix@redhat.com, ndesaulniers@google.com, nathan@kernel.org Subject: Re: [PATCH] fs/ntfs3: disable page fault during ntfs_fiemap() Message-ID: References: <000000000000e2102c05eeaf9113@google.com> <00000000000031b80705ef5d33d1@google.com> <60f6bb85-825c-95e2-79b8-25a2d0e9979e@I-love.SAKURA.ne.jp> Precedence: bulk X-Mailing-List: ntfs3@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <60f6bb85-825c-95e2-79b8-25a2d0e9979e@I-love.SAKURA.ne.jp> On Wed, Apr 12, 2023 at 10:29:37PM +0900, Tetsuo Handa wrote: > On 2023/04/12 22:13, Matthew Wilcox wrote: > >> Also, since Documentation/filesystems/fiemap.rst says that "If an error > >> is encountered while copying the extent to user memory, -EFAULT will be > >> returned.", I assume that ioctl(FS_IOC_FIEMAP) users can handle -EFAULT > >> error. > > > > What? No, that doesn't mean "You can return -EFAULT because random luck". > > That means "If you pass it an invalid address, you'll get -EFAULT back". > > > > NACK. > > Then, why does fiemap.rst say "If an error is encountered" rather than > "If an invalid address is passed" ? Because people are bad at writing. > Does the definition of -EFAULT limited to "the caller does not have permission > to access this address" ? Or the address isn't mapped. > If copy_to_user() must not fail other than "the caller does not have > permission to access this address", what should we do for now? > Just remove ntfs_fiemap() and return -EOPNOTSUPP ? No, fix it properly. Or don't fix it at all and let somebody else fix it.