Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp326994iog; Thu, 30 Jun 2022 01:21:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s0Dw4bbd9JlbE8iommaCqUm37cE5HBSJD7F3ImZbR+aAXtNpj3EfTKQ/nGJX1Kl/VIhqr2 X-Received: by 2002:a17:906:cc55:b0:72a:667b:2db1 with SMTP id mm21-20020a170906cc5500b0072a667b2db1mr1349406ejb.482.1656577263228; Thu, 30 Jun 2022 01:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656577263; cv=none; d=google.com; s=arc-20160816; b=XO99I8aO8bxrejYuhS0a+7Rr1lYnbr5jYKjw2/lvpcZbh4bS9JwdRCBJZjRJ9MjTh0 RE8sAzn+4R/og6CrCIU9Op2rWyCv2ADU9wADbnRxg+xUN7qADUCKpiulG+aBEkEDG0tG 7gpu9g7H1dsvBCc1Cr6tGgowZ7tS6dfTNPKZJjLz96cipqPyL0oEaE/7dHXo+kPMyTml PlpvhZK4fk/ElH/yZ/+KkbQPM2mVkIOQmgtF81EtNf9/td+2aIGcaAO737XqARHYonpD LG8UmY+bvfnzZIcfUXdpjmQdGjdSXEjvy9AdW2CQqPd1oETsKJ3pQq8adQTNyQn6yq2l bygA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=y/EesN9M3QgaFKIPOr2CexXJ8wdX+PXxZvZvWhGBUik=; b=X/9ka9hrTpOcDFPuax5xH/91f4ujIG92umdbkfeQGLehasiqWgBISMMjHwqVlmiOMO CcwK42l8XTQtspD8X0sbBf+RxSi4SiPo2lz/WUfOl14w/dw7GCOQg7CCyXCqdx9Rl64m 3l7GF5LXQAjqLr4tqDQZg7VjPtUYQXHp7ASi0JDsKXm/O0FR7Py34gOvHi4qDjQBmbhz M74XK+HVjDXBQSj+ehb1pP9rfzOrFffY55S0J3rVXo1Ol2SjlA2hGji73G1Fq1j6fDvc mbvjZyUPWHL9sJfr83QRYFsA9ib/l/O+emWyUnlb/f+NOnaVPFS/tK9V80w1ahdz1YOE n8XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XB9F0ngX; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc13-20020a1709078a0d00b0072a42a29d88si5712250ejc.290.2022.06.30.01.20.38; Thu, 30 Jun 2022 01:21:03 -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=@gmail.com header.s=20210112 header.b=XB9F0ngX; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233827AbiF3IQT (ORCPT + 99 others); Thu, 30 Jun 2022 04:16:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231831AbiF3IPs (ORCPT ); Thu, 30 Jun 2022 04:15:48 -0400 Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3FDF45795 for ; Thu, 30 Jun 2022 01:12:14 -0700 (PDT) Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-101dc639636so24796776fac.6 for ; Thu, 30 Jun 2022 01:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=y/EesN9M3QgaFKIPOr2CexXJ8wdX+PXxZvZvWhGBUik=; b=XB9F0ngX+EKqeYiPFXqTguzN/o+1HfI/vuZwg1NCa5wGDpFzBzmanZtNDM9XUfNVFS LR37llHYg+M9WqaaChQ5frIhVCfoL+6UhagiThWFuwiauYwaVwBrqJfQv9lEqVrSro3K covLCxi7GRs8+RXrXwohqRNDnly12o4Qqj3fuMKWZfE/QKk1XkDtrkopj/UJdD+m6hve 8LQGfWVk5U5xrVFs7cDd6OV9ekWPefegBhQCiBjzmbsumnTLNsgQ8kggQYf76Dt0AUVA TiSeFBM8FAXwLYeUpzylR4vPWaALma6kYdT5dELFSO+sn/b0AeW5z3EghB4pSSLefn1e dUNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=y/EesN9M3QgaFKIPOr2CexXJ8wdX+PXxZvZvWhGBUik=; b=C66ZqzBgF6dg6Z1+ehOrDryQmLmzmeZ6q3xxW/5xY8qPw8jbS38pDV61dSVtdMrVFX 4v1G8H83f++Rh/0rD5NPu+HYpAkQFhZjSmB4kuhLvbE2QBcGdow4Gm/v1frM8nqvtLE8 tZx5pDhbTYFwXKHxgMBtE9pOMdszBLtKC5jr97J1ISWKjzwy8MJL41bChTsZ9xbRs6NY HRgzWzys5WcjGldyRw3woMD9PqZSlKNgHQS621bZ8Jsj10ksWtokL8iKKaIJCvr+MPBQ TjRQt5PfNTWzrIv8DAONncuXz5FdUtBDGQW8cyMuhiDp/qCNT+49OSi1bYBpktQT9f1H xarQ== X-Gm-Message-State: AJIora8mqcxwDp4JSk5COJ6GDjM+KtczxA4kWfsOIq7SfSki9kUqbaq+ suoviltDz509mUwiVeolgRyRPj4g310dGGcHHYJS/n8RbXrNKw== X-Received: by 2002:a05:6870:f618:b0:f3:cb8:91b with SMTP id ek24-20020a056870f61800b000f30cb8091bmr5127939oab.265.1656576733938; Thu, 30 Jun 2022 01:12:13 -0700 (PDT) MIME-Version: 1.0 References: <20220630040047.3241781-1-zys.zljxml@gmail.com> In-Reply-To: From: Katrin Jo Date: Thu, 30 Jun 2022 16:12:03 +0800 Message-ID: Subject: Re: [PATCH] kernfs: fix potential NULL dereference in __kernfs_remove To: Greg KH Cc: tj@kernel.org, viro@zeniv.linux.org.uk, LKML , katrinzhou Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Thu, Jun 30, 2022 at 3:28 PM Greg KH wrote: > > On Thu, Jun 30, 2022 at 12:00:47PM +0800, zys.zljxml@gmail.com wrote: > > From: katrinzhou > > > > When lockdep is enabled, lockdep_assert_held_write would > > cause potential NULL pointer dereference. > > > > Fix the folloeing smatch warnings: > > > > fs/kernfs/dir.c:1353 __kernfs_remove() warn: variable dereferenced before check 'kn' (see line 1346) > > > > Signed-off-by: katrinzhou > > Can you please submit this with your legal name that you use to sign > documents? > > Also, what commit id does this fix? Did you actually hit this with a > real workload? How can this be reproduced and tested? > > thanks, > > greg k-h Sorry for the formatting issue. I'll submit a new patch soon. This problem is found via static code analysis, and by now I have not reproduced / tested it. Best regards, Katrin