Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1619866ybc; Wed, 13 Nov 2019 01:31:41 -0800 (PST) X-Google-Smtp-Source: APXvYqwEirLqtI4cS9K1qqPdU/y++JUfan5zC96g4waOMiikSyminAB7m046D/2e+dRQeJrLUUY2 X-Received: by 2002:a05:6402:382:: with SMTP id o2mr2404279edv.61.1573637501640; Wed, 13 Nov 2019 01:31:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573637501; cv=none; d=google.com; s=arc-20160816; b=gpsFw4CxlG3x4QmBsxWwulS5z1Q6BW+1CKSjqaSuCQNWE5YKysr4jgCzSu1Mj3q6LT uw7aFwPfc68lxv5DzcY6ZuLsfoFXoaz+e4bYMUhx8cbLb5rj7qoeeTdoHaugZBvpubpK UxCXcf1UQxTMWMTB6AGYZFRPL8KkL9Ib0WEtQWQjRJSzXQzkhW2BsVWGLGNCK+x4Jw/Y zoaiQIIARmopmH3rRXoS/nwIk84+69V3Exi9im7nMGjrYS+TnzfTitXzAR6n4oBrTPa7 zA0Y1t3uPSXGdziS37OXILkm/DO+kcLtpS0e5KMi09JRSeZ0Dk3nHBP8gowqkzXYo8Ku pwwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=e1zirwPJNwiKhF5FklceUIWF8O2zwUnyjAk4/O0J12I=; b=qrjTmbA3a+4BtxZHVhmbMofNhvrFwsHVUUNunZLw9VnqWnI/WwQ+oJBkrww+ToJK0/ y16d1yRU+xU6gd6qWzq8YFjue5uP5nwSCY4YDnz367YH3NtXOcZUkUQqc8hOkYZqKuFg LPwfIzRYPzUCE9PbYYDTYysBCQaYBHDY1+7kLUtU8jvYwTNNudmj3roIs7uF4aSRgEjy sFJsZ9rc9aJ4c45/9GPfEb3SOjuQ7tZaGSP6Gw6LneaNsFaGLj41yLzgIh7GHBJu19Sk 96zgVvSIMjTcD0wP1VGjC/ugIPtXoxvNAOyifZiwCsLDXkuMObrwSDH9gFrSlKORqXG8 x3Fg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t6si843829eji.80.2019.11.13.01.31.17; Wed, 13 Nov 2019 01:31:41 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727415AbfKMJaO (ORCPT + 99 others); Wed, 13 Nov 2019 04:30:14 -0500 Received: from relay.sw.ru ([185.231.240.75]:39208 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbfKMJaN (ORCPT ); Wed, 13 Nov 2019 04:30:13 -0500 Received: from finist_cl7.qa.sw.ru ([10.94.4.83] helo=finist-ce7.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1iUoyE-00062s-Rr; Wed, 13 Nov 2019 12:29:51 +0300 From: Konstantin Khorenko To: Jessica Yu , Prarit Bhargava , Barret Rhoden Cc: Konstantin Khorenko , Andrey Ryabinin , linux-kernel@vger.kernel.org, David Arcari , Heiko Carstens Subject: [PATCH 0/1] kernel/module.c: don't allow modprobe to hang forever on a module load Date: Wed, 13 Nov 2019 12:29:49 +0300 Message-Id: <20191113092950.15556-1-khorenko@virtuozzo.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After commit 6e6de3dee51a ("kernel/module.c: Only return -EEXIST for modules that have finished loading") the simple test leads to hanged modprobe process (INTERRUPTIBLE): 1. Make sure nft_ct module is not used by your firewall rules. 2. Run 3 copies of # export i=0; while true; if [[ $(($i % 100)) -eq 0 ]] ; then \ echo "i=$i"; fi; do modprobe nft_ct; i=$(($i + 1)); done 3. Run 2 copies of # while true; do rmmod nft_ct; done Hanged "modprobe" process will appear in ~ 10 seconds. # cat /proc/30184/stack [<0>] load_module+0x53f/0x2060 [<0>] __do_sys_finit_module+0xd2/0x100 [<0>] do_syscall_64+0x5b/0x1c0 [<0>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Konstantin Khorenko (1): kernel/module.c: wakeup processes in module_wq on module unload kernel/module.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.15.1