Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp202093imm; Thu, 20 Sep 2018 21:49:52 -0700 (PDT) X-Google-Smtp-Source: ANB0VdarPTSJcal7nziU28GGqwTvDYUJmPb9m42huLmgaSBO999t6SxbF62ojfmAtYIHZ+56847R X-Received: by 2002:a63:1566:: with SMTP id 38-v6mr39665127pgv.383.1537505392489; Thu, 20 Sep 2018 21:49:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537505392; cv=none; d=google.com; s=arc-20160816; b=jy9SZr1t0l48klN128CMLVM4u9YTvTsMBMTetjDeSMTHvToLRMOnqw0EJs7l4zRwO5 qw+R7T04L9201n9QC6Lz3A1DrOy/PiQ0zcUwQ7PrnaXjPJhMd3r+qkWh+j98V1qMjPOH W9TjV44HoDJyD5jnyRwgxBjGVUiouB7BB+4OIzsEBiIASEEOLmiET/cGsX4VJ8t2cB2Y Ky/Q4PE6AcfHFoz+XtUDzsxH0KnEYIXxam6X78e1oUL2y7FWlCOx1lpkQEPzglSCKnTH y6JvJpQggno1E/qmspcGJoNkLfTLcRJsU7CJ5/z6y23etQj05vWjZaFCpnEe9QcuXhcR 1W9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=0TRl4AIfe8CP0g/UEVTNb7bi0wZZ2TU4oIw8WxCT2uM=; b=PKxe/vPvZdiBiIRLFT0sbkeNqh4kudl2YiD3W/UZ6SQJzEe5K6AnOEWIF9X6bq6+/y Bh9DB89GxmG19tiEgPPriVnW7MAlH+8RuS68w2lDUbUyBZHTgcQEcO7ek9T5xFU1zIuk mpi5yeIbUPnjZGFSIQGTeA9DLgEfPNLWxBc8TfXGUfr5bj12F4xzM+V/Q/ralCz/wp0V oQmpDU1kA4jmgDO6b2/ieKrzqQF7ehfSLxT2Xb75t+qmXUjfXIkmMlopcSOYrRPrUAf7 NQ2tRlsJcEw6bgNGmdEAcQGa37RqLbh9g4Zo6uJhHqD9hz6rh+WWM1fRv+mOs9tuopwh k8xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=e4NoLzMK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d41-v6si25659749pla.172.2018.09.20.21.49.20; Thu, 20 Sep 2018 21:49:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=e4NoLzMK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389010AbeIUKgU (ORCPT + 99 others); Fri, 21 Sep 2018 06:36:20 -0400 Received: from mail-yb1-f193.google.com ([209.85.219.193]:41513 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725887AbeIUKgT (ORCPT ); Fri, 21 Sep 2018 06:36:19 -0400 Received: by mail-yb1-f193.google.com with SMTP id v10-v6so4923419ybm.8 for ; Thu, 20 Sep 2018 21:49:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0TRl4AIfe8CP0g/UEVTNb7bi0wZZ2TU4oIw8WxCT2uM=; b=e4NoLzMKmyxVmRWLbwZr+PGEGPu/M0L6+AeglJhaBfSW+Q6ET4LJYxTR+OBtcxrfS4 lOToRKngS99wWUrQVAVlOlAFwBRVHqQ1JlLRcJo4Mmsk5xclK+ybgv41it/GlCI+3Ncq kMGL3jiZc90E/lvWqdXleBKwu5r8/IpuDJ1+o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0TRl4AIfe8CP0g/UEVTNb7bi0wZZ2TU4oIw8WxCT2uM=; b=tinJbOEbsqT8qZegWiuMK1mrRuDYh/CUwPCjljlAg+wAZiBfm+RbMdEqCF9HDl1Cmi uWxM5ppWy1S/kadebW+/XXASsh6/OiL9Yzsq63I1BEac9y+2k4uN9Wgl1IfgfhIWSDY4 k2U3UGkimF0ZgedcmXziJlMno2Yv4Os4+5h7u+rN03rQQJn9TQ9hnmSQWkmNlQzObfxo ueUg9HA4CWq8V1Q9sxzrNrxEoV0yQQDwT0vHoLl+ldZmEC0DulJ6VbmxoRODgVXEIiFc uDwtjftNNfmrJQAVb9Mea2TWxEeTTrnDsj+Hxke70r3A/ViF7CLYuBe2v3UuZTX8otzI 4R2Q== X-Gm-Message-State: APzg51DB5YONXTYDQCEyP4ynVaRIG7GFtcCw78GpjC6O474++8wmU7Ml GMxaOycA1iCxPCWCmhQXFWuvyHBqV0E= X-Received: by 2002:a25:a2d1:: with SMTP id c17-v6mr6472975ybn.400.1537505355576; Thu, 20 Sep 2018 21:49:15 -0700 (PDT) Received: from mail-yw1-f43.google.com (mail-yw1-f43.google.com. [209.85.161.43]) by smtp.gmail.com with ESMTPSA id t2-v6sm5845223ywd.99.2018.09.20.21.49.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 21:49:14 -0700 (PDT) Received: by mail-yw1-f43.google.com with SMTP id q129-v6so4707626ywg.8 for ; Thu, 20 Sep 2018 21:49:13 -0700 (PDT) X-Received: by 2002:a81:2908:: with SMTP id p8-v6mr193600ywp.407.1537505353513; Thu, 20 Sep 2018 21:49:13 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:5f04:0:0:0:0:0 with HTTP; Thu, 20 Sep 2018 21:49:12 -0700 (PDT) In-Reply-To: <1537494404-16473-1-git-send-email-zhongjiang@huawei.com> References: <1537494404-16473-1-git-send-email-zhongjiang@huawei.com> From: Kees Cook Date: Thu, 20 Sep 2018 21:49:12 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RESEND PATCH] error-injection: remove meaningless null pointer check before debugfs_remove_recursive To: zhong jiang Cc: Andrew Morton , Masami Hiramatsu , Ingo Molnar , Thomas Gleixner , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 20, 2018 at 6:46 PM, zhong jiang wrote: > debugfs_remove_recursive has taken the null pointer into account. > just remove the null check before debugfs_remove_recursive. > > Acked-by: Masami Hiramatsu > Signed-off-by: zhong jiang Acked-by: Kees Cook -Kees > --- > kernel/fail_function.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/kernel/fail_function.c b/kernel/fail_function.c > index bc80a4e..17f75b5 100644 > --- a/kernel/fail_function.c > +++ b/kernel/fail_function.c > @@ -173,8 +173,7 @@ static void fei_debugfs_remove_attr(struct fei_attr *attr) > struct dentry *dir; > > dir = debugfs_lookup(attr->kp.symbol_name, fei_debugfs_dir); > - if (dir) > - debugfs_remove_recursive(dir); > + debugfs_remove_recursive(dir); > } > > static int fei_kprobe_handler(struct kprobe *kp, struct pt_regs *regs) > -- > 1.7.12.4 > -- Kees Cook Pixel Security