Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4908535rwi; Sat, 22 Oct 2022 19:20:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5HAw6QD/vgIPj5EfwHvho1YZnAbY38jgbNQUNFtJ+buE0Ii28RoMx4St9g7Q1u6Fycaaro X-Received: by 2002:a17:907:9625:b0:78d:bb06:9072 with SMTP id gb37-20020a170907962500b0078dbb069072mr21994230ejc.472.1666491642415; Sat, 22 Oct 2022 19:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666491642; cv=none; d=google.com; s=arc-20160816; b=VBZanjFMlkQHBID5KXYsteZ8ZXpoubpDjhCo9g45PimlJ2nQw7ubxeV4mv5AisVA7l 7kuSIcAHBM5g/ud2ySGp9vrVrlPh9H1JgmAlfu2ot5BDPv8nTmRjCtmILtDOIxyfRPDM DeVyYjbnWd0dd0vWpMcFpq/NtsazQvy4a3/0VFDeIMlPbSQyGobx5IaF0t8m2Y9bZWcj NkZpy/G+pSkvycGZm40wfbYan9hZvZR6EoNuY7zEn68CTlVm4PSK7jd99BIb6jp01qiH jTKgoqrFngD3LnDCs8i4BBLPJvaPBGbr0C5TlJ2C4S87BGkrgjoY1BNDm3jOFoziYnzw dE+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from:cc :references:to:content-language:subject:user-agent:mime-version:date :message-id; bh=2PXdSrNZqC6zy8KPv9Rka4QioB/hC6PhTQLLb/9cpCs=; b=f3LQEijC6Ef3tjtVYuxqfVuf32AUrdDCTcyE3xPfOJIkQFqZrmNTqDvLaMtkOcjgpW agY6qyhtUAKfBj3VrZUQeXX9BaFUfay8xx0QAybdF5L43kk7LCnKOTpLRHCAy1EsmkCw y+LXvEg/7q2HT+GNl0FwVJPaMvq1LBHVV4t/DZ+6D/0SITfdpFojlToGMnE9WGeTLY6k ATvLVmG5iJSYDZDEZd0Nb93fDfaKK1eXNtyCY8YHTX/MTbVsSIDyBBbt1Tgv6dUiUaO3 qTCF/CG7ghNgxm/R3xLTHTZ/YneKBdEb0ocZBtSYBp5RpVjW1/X4ldx/BJl1VO8BvKlO nc0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a16-20020aa7cf10000000b00456eaa4fb1fsi12330306edy.223.2022.10.22.19.20.10; Sat, 22 Oct 2022 19:20:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229761AbiJWCTR (ORCPT + 99 others); Sat, 22 Oct 2022 22:19:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229568AbiJWCTO (ORCPT ); Sat, 22 Oct 2022 22:19:14 -0400 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76C8313F27 for ; Sat, 22 Oct 2022 19:19:13 -0700 (PDT) Received: from fsav115.sakura.ne.jp (fsav115.sakura.ne.jp [27.133.134.242]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 29N2I4V4009579; Sun, 23 Oct 2022 11:18:04 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav115.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav115.sakura.ne.jp); Sun, 23 Oct 2022 11:18:04 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav115.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 29N2I3UB009568 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Sun, 23 Oct 2022 11:18:03 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: Date: Sun, 23 Oct 2022 11:18:00 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [syzbot] general protection fault in _parse_integer_fixup_radix Content-Language: en-US To: syzbot , syzkaller-bugs@googlegroups.com, Ian Kent , Andrew Morton References: <0000000000002feb6605eb71458e@google.com> Cc: hughd@google.com, linux-kernel@vger.kernel.org, Al Viro , Carlos Maiolino , David Howells , kernel test robot , Miklos Szeredi , Siddhesh Poyarekar , "Theodore Ts'o" , Hawkins Jiawei From: Tetsuo Handa In-Reply-To: <0000000000002feb6605eb71458e@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_NONE 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-kernel@vger.kernel.org syzbot is reporting that "vfs: parse: deal with zero length string value" in linux-next.git broke tmpfs's mount option parsing, for tmpfs is expecting that vfs_parse_fs_string() returning 0 implies that param.string != NULL. The "nr_inodes" parameter for tmpfs is interpreted as "nr_inodes=$integer", but the addition of if (!v_size) { param.string = NULL; param.type = fs_value_is_empty; } else { to vfs_parse_fs_string() and if (param->type == fs_value_is_empty) return 0; to fs_param_is_string() broke expectation by tmpfs. Parsing an fs string that has zero length should result in the parameter being set to NULL so that downstream processing handles it correctly. is wrong and Parsing an fs string that has zero length should result in invalid argument error so that downstream processing does not dereference NULL param.string field. is correct for the "nr_inodes" parameter. How do we want to fix? Should we add param.string != NULL checks into the downstream callers (like Hawkins Jiawei did for https://syzkaller.appspot.com/bug?extid=a3e6acd85ded5c16a709 ) ? Or should we add if (!*param.string) param.string = NULL; rewriting into downstream callers which expect For example, the proc mount table processing should print "(none)" in this case to preserve mount record field count, but if the value points to the NULL string this doesn't happen. behavior? On 2022/10/20 15:16, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit: a72b55bc981b Add linux-next specific files for 20221019 > git tree: linux-next > console+strace: https://syzkaller.appspot.com/x/log.txt?x=1728c644880000 > kernel config: https://syzkaller.appspot.com/x/.config?x=200524babbc01b2a > dashboard link: https://syzkaller.appspot.com/bug?extid=db1d2ea936378be0e4ea > compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12afb08c880000 > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11001c72880000 > > Downloadable assets: > disk image: https://storage.googleapis.com/syzbot-assets/fa24fb5893fd/disk-a72b55bc.raw.xz > vmlinux: https://storage.googleapis.com/syzbot-assets/cf1b7e7b579c/vmlinux-a72b55bc.xz > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > Reported-by: syzbot+db1d2ea936378be0e4ea@syzkaller.appspotmail.com >