Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5689186rwi; Sun, 23 Oct 2022 10:07:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6rv4jDOv8yechsThorbDcuLAxkAySQ57IixMSXauMi+YQvzj425Yv4QyBF9pTydl8Um+kT X-Received: by 2002:a17:906:1ec5:b0:78d:b3d1:183b with SMTP id m5-20020a1709061ec500b0078db3d1183bmr23921209ejj.709.1666544845729; Sun, 23 Oct 2022 10:07:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666544845; cv=none; d=google.com; s=arc-20160816; b=dbkpl457AXlfTacfzoQWDy1jW8BSvcKsUiK4tKx5VjYOuEWvowX7qxGN0P9fTUm/bM 0o7xkX0D3Fs7s6LnTGo/nZRYex5gX2KKduhDdlU0eAe/c7ui7Xj02ePJVV6KnggFLz7j 5q+TbqoBvb1pVyLmEn6f++fG8PzXVl00eQz9pRDSLRbxLYIOYJ3t2gyspz3u+RqFnrDr UtzzWXl4W4z4U0P6ddSk8nLiKkAtZx+HwyzbvkK/VUTWeAKMXUoprjhwmF0RuhwiojFK QtoGCcigdo3QC+e3PLy30cnAwp3wyWJAEyhWg5ZKWh9uFWxoje6Lh6pmhX2HEqGy4Lgu faCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=GuzuQhIcB7Yfe4z2AbKUpBq28LkvJC35LhO4Q+pZ32Y=; b=L+oGgJiU00fA6vcR74DBhlWstIW46c62e/pjmScs0W81U1CKrsTBIRr5O4g/IrYXXK 7b8xZlJsMMoX57djSnrOnpoQbpUH3WzIA7A7yllMlnnbdkBt5Hd1YoZK/+hM7Rp7Rs0j xJwv9nLwuYx352aOtVUzbcEX5UX4XGX8rQB18YcAjryLnpwOen8dfdhqt/VoKasms8yL SEbqbWFuUAku9SOHRKz5x4oQJ1OplOBsVGC6iECx+eag0zZooBwyNs+d3WCD69vIiwSX yZRg3uj3fWyvXcUr4rsH6n6Ks71Ej+KSh5GholSNuTahH0gJmoeNyVk0+LkLUwmetCTd dolQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=jmF+fva0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa24-20020a1709076d1800b0078deaf6b447si25151854ejc.624.2022.10.23.10.07.00; Sun, 23 Oct 2022 10:07:25 -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; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=jmF+fva0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230469AbiJWQtM (ORCPT + 99 others); Sun, 23 Oct 2022 12:49:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230421AbiJWQtB (ORCPT ); Sun, 23 Oct 2022 12:49:01 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 222016290E; Sun, 23 Oct 2022 09:48:59 -0700 (PDT) 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=GuzuQhIcB7Yfe4z2AbKUpBq28LkvJC35LhO4Q+pZ32Y=; b=jmF+fva0+Nx5RKXkeUD9TtxFNh fAaPggxx1+y2jc39t5752FZxxWz3uSdcYKSo/6UOqlHNzJOaOkzcru8OXGAERJPaOQgOZIAXKuSTV raadxOtLixW4xamuhf7Li/Vlz6IWHtHpV3W1GLaiYoSxTqY0Df0RkUtYZF97wHutRIUFeGSeCKTiN cFo952krO17YbJUBJYj62ZZGU0Qj09FwAYQ7YjB/X9QK18vXbRXIdmVCNU3TkFIquIwluSTcir40U zF4yuc9i1LzlxEA4For8TRFGL0RPfZrS4RS6RM+3iZLAUxc3ffRI/rFxz2o9dsA+Jta9qjvpg2N45 ue4K80Ng==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1ome9d-00DBvg-0u; Sun, 23 Oct 2022 16:48:53 +0000 Date: Sun, 23 Oct 2022 17:48:53 +0100 From: Al Viro To: Hawkins Jiawei Cc: 18801353760@163.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH -next 0/5] fs: fix possible null-ptr-deref when parsing param Message-ID: References: <20221023163945.39920-1-yin31149@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221023163945.39920-1-yin31149@gmail.com> Sender: Al Viro X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,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 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...