Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp519097ybe; Wed, 18 Sep 2019 22:35:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPZiJp889pmrxKxiZVQDE+jKXgIgZAdSUmHRcjAiYTy7MuA404eka7kUqttR3YEHICFwJz X-Received: by 2002:a17:906:7fda:: with SMTP id r26mr5096775ejs.170.1568871325496; Wed, 18 Sep 2019 22:35:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568871325; cv=none; d=google.com; s=arc-20160816; b=Oyqzy/k3rHS3tz4GJn7Vc42MBc7rYniGaXJx5P+JMZeqRaN0uGLxV1WIs9DNe6ZWXX UeaTuJhXBBMjFqJ9SG6E0tfQ9yn1NX2JFBbsVfsRU2UP4RdiSmJf0tOYAOpL/0uzQGFS VerJfJAGiA8y8E92JqDBcZcDVYuQnkODpAPW8r7RdP7HQknvhKyTMG3mzn6fun4k75im /eimNL554sDjciQjIMXFC0ILr+4wXBPKFCkGeHgSmqDlx9hdTjPr6jXepr4TUWflYwEX dWOoXXyQ+PmJMnqFI7W2c+xA0xazvDLM5/j5hK7z9X2yPHTQrzINIPiIofIpEfUDBEZ6 mhzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=MIPOlNeNhj5QWEMNrDCQCfFcaec93orjqh1TxJcBo14=; b=t4en0Xm0WmxOMPUKB4ggtyKKWyXLs9VocxXLeAmbAwII6UGtRB1j3jELKTNcBzso54 hRTXnqQrYWPvPjHGhlmQi79bcqhQubN6Z1oHKvWF+Hh9ZpoZkp8SzkesRoqxVgyRqrtJ QotXN4dnIwvXvcGzzik2Uw/IYFMM+QCEP5h8iwnJSli0HhCCoN0FQAqV3sExtor0mpi5 6Bvrhm+EZgz2J9dDXNdc+Ee3uL9shzxGTTPR2tj5GzsrJZ3yCs7Tgw/aynTdTKl7BHWX ZeEoj1frk2n6TByUiwpstDtR9KwT8yOX6Ec1k1irhveChtfL/mNDf3JHw/OZuOsTPDEw Xy6Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id um16si3996598ejb.12.2019.09.18.22.35.02; Wed, 18 Sep 2019 22:35:25 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388515AbfISC6c (ORCPT + 99 others); Wed, 18 Sep 2019 22:58:32 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2677 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388440AbfISC6X (ORCPT ); Wed, 18 Sep 2019 22:58:23 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C655714591BE98259A92; Thu, 19 Sep 2019 10:58:19 +0800 (CST) Received: from use12-sp2.huawei.com (10.67.189.174) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.439.0; Thu, 19 Sep 2019 10:58:10 +0800 From: Xiaoming Ni To: , , , , , , , , , , , , , , , , , , , CC: , , , , , , Subject: [PATCH v4 0/3] kernel/notifier.c: intercepting duplicate registrations to avoid infinite loops Date: Thu, 19 Sep 2019 10:58:05 +0800 Message-ID: <1568861888-34045-1-git-send-email-nixiaoming@huawei.com> X-Mailer: git-send-email 1.8.5.6 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.189.174] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Registering the same notifier to a hook repeatedly can cause the hook list to form a ring or lose other members of the list. so, need add a check in in notifier_chain_register(), intercepting duplicate registrations to avoid infinite loops v1: * use notifier_chain_cond_register replace notifier_chain_register v2: * Add a check in notifier_chain_register() to avoid duplicate registration * remove notifier_chain_cond_register() to avoid duplicate code * remove blocking_notifier_chain_cond_register() to avoid duplicate code v3: * Add a cover letter. v4: * Add Reviewed-by and adjust the title. Xiaoming Ni (3): kernel/notifier.c: intercepting duplicate registrations to avoid infinite loops kernel/notifier.c: remove notifier_chain_cond_register() kernel/notifier.c: remove blocking_notifier_chain_cond_register() include/linux/notifier.h | 4 ---- kernel/notifier.c | 41 +++-------------------------------------- net/sunrpc/rpc_pipe.c | 2 +- 3 files changed, 4 insertions(+), 43 deletions(-) -- 1.8.5.6