From mboxrd@z Thu Jan 1 00:00:00 1970 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 9D068C6FA82 for ; Sun, 4 Sep 2022 00:28:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229576AbiIDA2K (ORCPT ); Sat, 3 Sep 2022 20:28:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbiIDA2J (ORCPT ); Sat, 3 Sep 2022 20:28:09 -0400 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB1E74DB43 for ; Sat, 3 Sep 2022 17:28:08 -0700 (PDT) Received: from fsav112.sakura.ne.jp (fsav112.sakura.ne.jp [27.133.134.239]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 2840RRg8093852; Sun, 4 Sep 2022 09:27:27 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav112.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav112.sakura.ne.jp); Sun, 04 Sep 2022 09:27:27 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav112.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 2840RQqi093848 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Sun, 4 Sep 2022 09:27:27 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: <38d892bd-8ace-c4e9-9d73-777d3828acbc@I-love.SAKURA.ne.jp> Date: Sun, 4 Sep 2022 09:27:22 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH v2] 9p/trans_fd: perform read/write with TIF_SIGPENDING set Content-Language: en-US To: Dominique Martinet Cc: Christian Schoenebeck , Eric Van Hensbergen , Latchesar Ionkov , syzbot , v9fs-developer@lists.sourceforge.net, syzkaller-bugs@googlegroups.com, netdev@vger.kernel.org, linux-fsdevel References: <00000000000039af4d05915a9f56@google.com> <345de429-a88b-7097-d177-adecf9fed342@I-love.SAKURA.ne.jp> <4293faaf-8279-77e2-8b1a-aff765416980@I-love.SAKURA.ne.jp> <69253379.JACLdFHAbQ@silver> From: Tetsuo Handa In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2022/09/04 8:39, Dominique Martinet wrote: > Is there any reason you spent time working on v2, or is that just > theorical for not messing with userland fd ? Just theoretical for not messing with userland fd, for programs generated by fuzzers might use fds passed to the mount() syscall. I imagined that syzbot again reports this problem when it started playing with fcntl(). For robustness, not messing with userland fd is the better. ;-) > > unless there's any reason I'll try to find time to test v1 and queue it > for 6.1 OK. > We seem to check for EAGAIN where kernel_read/write end up being called > and there's a poll for scheduling so it -should- work, but I assume this > hasn't been tested much and might take a bit of time to test. Right. Since the I/O in kernel side is poll based multiplexing, forcing non-blocking I/O -should- work. (But I can't test e.g. changes in CPU time usage because I don't have environment to test. I assume that poll based multiplexing saves us from doing busy looping.) We are currently checking for ERESTARTSYS and EAGAIN. The former is for non-socket fds which do not have O_NONBLOCK flag, and the latter is for socket fds which have O_NONBLOCK flag. If we enforce O_NONBLOCK flag, the former will become redundant. I think we can remove the former check after you tested that setting O_NONBLOCK flag on non-socket fds does not break.