Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp544167rwi; Mon, 31 Oct 2022 04:58:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4M698d+AsXeniE5XA2paG/Nb5DEEzlIVlHlGYJjI9MXX8hfG0miXu/enlEG9azKK+qvtDz X-Received: by 2002:a17:90b:2306:b0:212:533:3188 with SMTP id mt6-20020a17090b230600b0021205333188mr32017767pjb.210.1667217485802; Mon, 31 Oct 2022 04:58:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667217485; cv=none; d=google.com; s=arc-20160816; b=NJloRt4gguSO9D/RKbB68YJCsQIOoUrAcxY8Qf7uxvtPouwa11lIZGdTLknPskoyz0 Yq4pkOZCsVHIybsyVMyn/qp5SE6JrOYW54gFoTpOEKNbKIy7axe95Mrn3zRswHW7M29Y X2TetE4j/dPJUz2OAzVjchu7XMfP8/q9p3Kg1QuFOH94akeS8JElJrpZ42JYZFk5fELb JZKSByEwYb0djHnHgldk+qFfqLrk0ujI9uAXaAnwODumRg4XhrC4qiPAnJ3a/Nxdmx1L kI/L2lQKeeBqusVuOVlM+VWoFTwBCArNSHkFsr6KmBzn9YkEMrDc2zZ4luorAQGr5I93 j+Ng== 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 :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=lKuAOCnoO0fHYp4Q9y8HSJJ7NXFgm3IHpkfq2I0JTwA=; b=LfwXa7kwoxkK9UeM/735wIxYSqNI/sKLXTqZmTm6X/qa/3XYtWKHBfEOkmQwRZ8jNo VWHqQQAeAxCgoXb2qIoTY/yKo4/bRZokhM+ib+knTIgw/Fv+zC9LRhMQNktGLf++YWro IKpF10CkjorkdVZGAj33v0ETVp+ERWnoZMVs03o+X/lb9n+d7CQ4lkM/HXiIce3avgim KHZ4gJrkncNuIjdPHfvL5xvUif0wUQNEfbdEL6URWWwEqKu9zPFp6jo3rMIOh8lSIts+ 8T3dD6RZmaA+cNTk/08Dat1XkVRQyuueE8AcDXyi7rGFaMkzbE70Se7aMUEN+3Blmvvo 15jA== 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 r200-20020a632bd1000000b0045fc63bf52csi8862151pgr.764.2022.10.31.04.57.52; Mon, 31 Oct 2022 04:58:05 -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 S230072AbiJaL3l (ORCPT + 99 others); Mon, 31 Oct 2022 07:29:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbiJaL3j (ORCPT ); Mon, 31 Oct 2022 07:29:39 -0400 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0893EDF17; Mon, 31 Oct 2022 04:29:37 -0700 (PDT) Received: from fsav411.sakura.ne.jp (fsav411.sakura.ne.jp [133.242.250.110]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 29VBSTWq091436; Mon, 31 Oct 2022 20:28:29 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav411.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav411.sakura.ne.jp); Mon, 31 Oct 2022 20:28:29 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav411.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 29VBSSNC091431 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Mon, 31 Oct 2022 20:28:29 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: Date: Mon, 31 Oct 2022 20:28:27 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH -next 0/5] fs: fix possible null-ptr-deref when parsing param Content-Language: en-US To: Ian Kent , Hawkins Jiawei , viro@zeniv.linux.org.uk Cc: 18801353760@163.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, cmaiolino@redhat.com, dhowells@redhat.com, hughd@google.com, miklos@szeredi.hu, oliver.sang@intel.com, siddhesh@gotplt.org, syzbot+db1d2ea936378be0e4ea@syzkaller.appspotmail.com, syzkaller-bugs@googlegroups.com, tytso@mit.edu, smfrench@gmail.com, pc@cjr.nz, lsahlber@redhat.com, sprasad@microsoft.com, tom@talpey.com References: <20221024004257.18689-1-yin31149@gmail.com> <7ba9257e-0285-117c-eada-04716230d5af@themaw.net> From: Tetsuo Handa In-Reply-To: <7ba9257e-0285-117c-eada-04716230d5af@themaw.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 On 2022/10/24 12:34, Ian Kent wrote: > > On 24/10/22 08:42, Hawkins Jiawei wrote: >> On Mon, 24 Oct 2022 at 00:48, Al Viro wrote: >>> On Mon, Oct 24, 2022 at 12:39:41AM +0800, Hawkins Jiawei wrote: >>>> According to commit "vfs: parse: deal with zero length string value", >>>> kernel will set the param->string to null pointer in vfs_parse_fs_string() >>>> if fs string has zero length. >>>> >>>> Yet the problem is that, when fs parses its mount parameters, it will >>>> dereferences the param->string, without checking whether it is a >>>> null pointer, which may trigger a null-ptr-deref bug. >>>> >>>> So this patchset reviews all functions for fs to parse parameters, >>>> by using `git grep -n "\.parse_param" fs/*`, and adds sanity check >>>> on param->string if its function will dereference param->string >>>> without check. >>> How about reverting the commit in question instead?  Or dropping it >>> from patch series, depending upon the way akpm handles the pile >>> these days... >> I think both are OK. >> >> On one hand, commit "vfs: parse: deal with zero length string value" >> seems just want to make output more informattive, which probably is not >> the one which must be applied immediately to fix the >> panic. >> >> On the other hand, commit "vfs: parse: deal with zero length string value" >> affects so many file systems, so there are probably some deeper >> null-ptr-deref bugs I ignore, which may take time to review. > > Yeah, it would be good to make the file system handling consistent > but I think there's been a bit too much breakage and it appears not > everyone thinks the approach is the right way to do it. > > I'm thinking of abandoning this and restricting it to the "source" > parameter only to solve the user space mount table parser problem but > still doing it in the mount context code to keep it general (at least > for this case). No progress on this problem, and syzbot is reporting one after the other... I think that reverting is the better choice.