Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4777839ioa; Wed, 27 Apr 2022 10:53:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzcyy1QAG35G5Q8CV2fksrKqt8i8nvuzhT6/XCYBUY03sazg1DeDxbOGoLjowoMKnOHKl1 X-Received: by 2002:a17:90a:c002:b0:1d9:250a:73c8 with SMTP id p2-20020a17090ac00200b001d9250a73c8mr28142411pjt.133.1651082029338; Wed, 27 Apr 2022 10:53:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651082029; cv=none; d=google.com; s=arc-20160816; b=wUyICuvoo158oVxAlGrhgIdTqoDF80eLT5I35/KS9Aai2qXVWJqF9Uj0Xlxz25zex8 IA63loFaQzS9MEADLIVWR0orWMqch5kzfg+1uIqNJJ3lKFlCOOmBx2+F6vEGrUCrDqtL MUH1QJ4HaNVdPL6ZPWqR3vH3ol1GvsiirXvQRXPFMRKp5EToZnd4aaaNM/YvS+a9iHmH 6+DZsPSDjHG0DX5vPr4HVrAds9SUKOu7U4gL+bydoRGNZ5xe8cfmbaEo3srhHb7OtRzk g1xbRO1Jba2gGeP1/br7xJWUiqelBdFyym4DbNqw2sQUIwACu4IGFSujzdW8uUazrqse tY6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=BzSUWHcbSbIUG8Be1XSOAdrtfZjDbG3/mXUuT1itZXc=; b=DS7DYQjK11aTHyDeh2JYxU0jo4xprtdL2uVSx8X5fmtaifQPiDQtvthsXFbTJRIrqu mCwpv/SY18hYzHxLyq4QduoDY3OWaE0hUprVlfkDfLmkUpteWO9rRZa/tTz+l5GuynQf 52dWyTmh1y3f0AVksBjej7o9XOxK2uHxoomHAwNCLdv0mdPGcpohgNz/0BRNjxCRIjkg kFDjLbG3UTIP50R2ZSI8iZO3BdqdoCA5i14wVosCuXepghNkxzvpnCH92G75OPSBg7rc zxBg+OfqH2E8fbw0jdrit5b88pb8KmP+Uo7juX0SKwrozPDRjnPEuL0Fk69/ixt1VB5y 4Rvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VxBKksre; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 140-20020a630792000000b003842921930bsi2070935pgh.808.2022.04.27.10.53.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 10:53:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VxBKksre; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1F46876295; Wed, 27 Apr 2022 10:27:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244008AbiD0Ra7 (ORCPT + 99 others); Wed, 27 Apr 2022 13:30:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243990AbiD0Ra4 (ORCPT ); Wed, 27 Apr 2022 13:30:56 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDC6474DE0; Wed, 27 Apr 2022 10:27:44 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id h1so2121552pfv.12; Wed, 27 Apr 2022 10:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=BzSUWHcbSbIUG8Be1XSOAdrtfZjDbG3/mXUuT1itZXc=; b=VxBKksreuBYZNErBWS4bqoHxx9xPZ+nj7mVZ8RqPksMrWbPjOByZHpFdHzo8eSwE2u w0IBM7UDwKQ9irFxTXg3OIdwxCtw43Gya+r26wQEgMOpDgotTePN6z9Ud3zEprsY7wDA vHv6/vFQcrhrV7mnbZfG5AJS8yA5w3J3kMVR5fPwdYev2n78fTZhEQipueB5bG5jT2O8 k/sn58V9WXDgx8fgm+9QncL3AM3wQ7FvHyf8wBlf02BMg9GrA+4hSbCZdiyx4uPXObko dAyFfnUtiicAro3PGwNm6nQqZVQXHCskWr9ymzMRZYAtlIl00Zgbi6qaD2ZwdzG3HLDk 3JLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=BzSUWHcbSbIUG8Be1XSOAdrtfZjDbG3/mXUuT1itZXc=; b=YCVFoOdwRO+h0zPWaqmvJe9ZEyc0EY6q5dVifIbGHtjzdyzSLuwvwfAc/7/S34qj94 fr5/+w1Z2zDtavxTrhSQTU82TDj7nysBD1HlUmy+Q9jauSi5yvrV511i2DTkfCVPmUqp 9tqOTO0N1bYfI5DqM73OzIEl+0g40SByMbqty3253UWdazn/KGfRmrMQdUD5x2irVatd Ibet57vdmqHLNOc3Rz8/Y87c0EgEX6tWJFNirPcet26/zRNuTYpsR3AnDfkoOEJmMiG5 rgEcziJDpUYDuY2lOr6ytzbLW97QyWsriTPu09dlzyBvei7QIA2y2DoD7X/T1fwnu376 o3/g== X-Gm-Message-State: AOAM530ZO2W0PAjH66hriyfsNmFs2PTjIpELw92Inrh1pi9CAagumSMm UT0v7MyppTfvt/cQtM/3xSA= X-Received: by 2002:a05:6a00:1749:b0:50a:8eed:b824 with SMTP id j9-20020a056a00174900b0050a8eedb824mr31049201pfc.50.1651080464269; Wed, 27 Apr 2022 10:27:44 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::5:4f81]) by smtp.gmail.com with ESMTPSA id h9-20020a17090a054900b001d953eb2412sm3669504pjf.19.2022.04.27.10.27.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 10:27:43 -0700 (PDT) Sender: Tejun Heo Date: Wed, 27 Apr 2022 07:27:42 -1000 From: Tejun Heo To: Minchan Kim Cc: Greg Kroah-Hartman , Jirka Hladky , Thorsten Leemhuis , linux-kernel , regressions@lists.linux.dev, Justin Forbes , stable@vger.kernel.org Subject: Re: [PATCH] kernfs: fix NULL dereferencing in kernfs_remove Message-ID: References: <20220427172152.3505364-1-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220427172152.3505364-1-minchan@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no 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 Wed, Apr 27, 2022 at 10:21:51AM -0700, Minchan Kim wrote: > kernfs_remove supported NULL kernfs_node param to bail out but revent ^ typo > per-fs lock change introduced regression that dereferencing the > param without NULL check so kernel goes crash. > > This patch checks the NULL kernfs_node in kernfs_remove and if so, > just return. ... > Cc: stable@vger.kernel.org > Link: https://bugzilla.kernel.org/show_bug.cgi?id=215696 > Link: https://lore.kernel.org/lkml/CAE4VaGDZr_4wzRn2___eDYRtmdPaGGJdzu_LCSkJYuY9BEO3cw@mail.gmail.com/ > Fixes: 393c3714081a (kernfs: switch global kernfs_rwsem lock to per-fs lock) > Reported-by: Jirka Hladky > Tested-by: Jirka Hladky > Signed-off-by: Minchan Kim Acked-by: Tejun Heo Thanks. -- tejun