Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp977415ybe; Thu, 19 Sep 2019 06:53:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqygjtxNIWZyv32m73uoCqEcTMVqmYXqTNkPMXckhySqiI6KrjeBOiPgmQNY2khVTWJ1B/CM X-Received: by 2002:a50:cc46:: with SMTP id n6mr16412141edi.7.1568901234892; Thu, 19 Sep 2019 06:53:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568901234; cv=none; d=google.com; s=arc-20160816; b=F0c4hKYNWXZWHyAzsynxIG0ur0WnXuLK/TBUOLwLqB8V9E3upDP/0+M34Yiw2K3CRf vdjdS/PaLKsK2pruisyREjHPS/lu6o40PLqmlhArA/z+23i65U5UUudqMdQqStdU26dL THHv6CXwGz33PSEOecBf33heOXpMbk+6RPR1Os3bK0/4w/xakOnCTNcoV5SfX5oSaYF3 N9mZEUtkq/mGlUMQ0tge1HRTCln4sqPSuSOcDQQGjVyelvqxC73pinR0nWv7OhV+0yaK UDHIiRlezK2wuwWK0VkZEjlyVe6f26AYSjAfS0nnjgWpGMM/fElWxmm/KIPkWnhzEFbu dAfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=ZbmAL48bHOeXFKVdPziPVnUuAjSC3lkknYbwpwMT6UM=; b=bfFtpvSukGYS8HhpMz1EpZhExwI/emqkIKRhM12Of8sdRlNMroJ0SzfcoY2+fsyIpo nUv/rIwh2lJ+g7Vji0VHNP/VXEFlTjK/ZKqM7/urj3wb2apYId6BBScOLuRZdd1y79FI kNRuUUZQN83boeGAxrg9BrYMqL2FJBCRfxD7jUqs9D1cRDasvSi+P51Mgma8GOvyiY9t pcB0j26ogaJ8GLftrH2aQ+1LgcK1TmcMc9XKmFexAd7gThpDPrnVi0d0qxJS6hyICkV+ 2UI5JIH5Um8mB7kr+xnme9/Uw4GKXv/zl+D+3azkpahntHReph30/F5T3T9Dc1jApuei j97g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-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 nm3si4425972ejb.310.2019.09.19.06.53.26; Thu, 19 Sep 2019 06:53:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-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-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388593AbfISMz3 (ORCPT + 99 others); Thu, 19 Sep 2019 08:55:29 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2739 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389212AbfISMz2 (ORCPT ); Thu, 19 Sep 2019 08:55:28 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 91770C78C476D9935686; Thu, 19 Sep 2019 20:55:25 +0800 (CST) Received: from [127.0.0.1] (10.57.88.168) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.439.0; Thu, 19 Sep 2019 20:55:19 +0800 Subject: Re: [PATCH v4 1/3] kernel/notifier.c: intercepting duplicate registrations to avoid infinite loops To: Greg KH CC: , , , , , , , , , , , , , , , , , , , , , , , , References: <1568861888-34045-1-git-send-email-nixiaoming@huawei.com> <1568861888-34045-2-git-send-email-nixiaoming@huawei.com> <20190919063615.GA2069346@kroah.com> From: Xiaoming Ni Message-ID: Date: Thu, 19 Sep 2019 20:55:19 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190919063615.GA2069346@kroah.com> Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.57.88.168] X-CFilter-Loop: Reflected Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 2019/9/19 14:36, Greg KH wrote: > On Thu, Sep 19, 2019 at 10:58:06AM +0800, Xiaoming Ni wrote: >> Registering the same notifier to a hook repeatedly can cause the hook >> list to form a ring or lose other members of the list. >> >> case1: An infinite loop in notifier_chain_register() can cause soft lockup >> atomic_notifier_chain_register(&test_notifier_list, &test1); >> atomic_notifier_chain_register(&test_notifier_list, &test1); >> atomic_notifier_chain_register(&test_notifier_list, &test2); >> >> case2: An infinite loop in notifier_chain_register() can cause soft lockup >> atomic_notifier_chain_register(&test_notifier_list, &test1); >> atomic_notifier_chain_register(&test_notifier_list, &test1); >> atomic_notifier_call_chain(&test_notifier_list, 0, NULL); >> >> case3: lose other hook test2 >> atomic_notifier_chain_register(&test_notifier_list, &test1); >> atomic_notifier_chain_register(&test_notifier_list, &test2); >> atomic_notifier_chain_register(&test_notifier_list, &test1); >> >> case4: Unregister returns 0, but the hook is still in the linked list, >> and it is not really registered. If you call notifier_call_chain >> after ko is unloaded, it will trigger oops. >> >> If the system is configured with softlockup_panic and the same >> hook is repeatedly registered on the panic_notifier_list, it >> will cause a loop panic. >> >> Add a check in notifier_chain_register(), >> Intercepting duplicate registrations to avoid infinite loops >> >> Signed-off-by: Xiaoming Ni >> Reviewed-by: Vasily Averin >> --- >> kernel/notifier.c | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) > > > > This is not the correct way to submit patches for inclusion in the > stable kernel tree. Please read: > https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html > for how to do this properly. > thanks for your guidance I thought that as long as the code exists in the stable branch, it should be copied to stable@kernel.org it is my mistake, These patches are intended to be sent to the main line. Should I resend it again? > > > Same thing goes for all of the patches in this series. > > thanks, > > greg k-h > > . > thanks Xiaoming Ni