Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2023989pxa; Mon, 3 Aug 2020 05:40:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx49N3/Cf/lOYz+KUctJUFyLvMBpYxZY/jcOPcvPV7gMXa6+3tAw4R+n4wOxC1UmtN1RWP X-Received: by 2002:aa7:c251:: with SMTP id y17mr15958550edo.13.1596458400779; Mon, 03 Aug 2020 05:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596458400; cv=none; d=google.com; s=arc-20160816; b=CFQL01HQJPUzLWZS7DWjue3Jcl2nWld5i/ez+2WRUXNu/hzrDI728w+Y4eDjZ9jahc ZxoV4Xp+Sq2quZqSPUfpGjytHgYZWAbTEiJak1OesYk3K5+lt591EJaqkunrROSf3z9S Ty2WdfT8X7cw7RIjatupwTf07VDKrIFw0FGt4HIoQwOy21MSR9zXwkU1PEvDw4MYyNqT wD8ffY3UlXAouC6mes8ZM9fdhOCNDZHpvMDWXzxkuY8JKBQzbguhdGPX6kCPm65k7RrH rmUHIkTMaJvW8EuKbUpdiuNaXS00Edi2W0OsIB6k5p0QIxmsiVaeXI+E3YDqrcUAunc+ WpmA== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DC/WqW/BLtELB6fwe+4Gpw6oM9dwdL2FwT/EqPx6i8A=; b=ZerJCAf0IdLXy/m1NYadrLpD9Qv1PMcSPliXQ6pvgk4YhHfmHkuQmuJ2d1OIpFQZlf t5jtrQeQ+1v8vmrFDJ/gvUswlhNLbIgweBcsp2VzC3mGSUVYjCjvifj0a1ieVMVUinhS G4v8Ifw1F/+rAYI2aTntSbS2IIOHAgrAYROI/jzU22LntkyI8FOigdQ+ERxNYCdlqaXq yu31+90+EHKHw9sptdabXCZxaBB1qgTAFRPkD43H57iXMWqY+dC8IabZ4KgWSx3hi837 6S61PFnD3aBjihDvon0HJaJm5h+6IhQX22oqxlBy/NgDH+ivJ9hTHCecfZoAQiBiiKAf yKcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xegTBw0l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x22si10380596ejw.73.2020.08.03.05.39.38; Mon, 03 Aug 2020 05:40:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xegTBw0l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729461AbgHCMdg (ORCPT + 99 others); Mon, 3 Aug 2020 08:33:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:33494 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729455AbgHCMde (ORCPT ); Mon, 3 Aug 2020 08:33:34 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3CAEB204EC; Mon, 3 Aug 2020 12:33:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596458012; bh=+3EfgGtmCKrNepVQ0cjyTDgJi1Grs6bidEQ5QqtEGDA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xegTBw0l3Go0/lS2Fo3jd1XdNfrz2InuOB6OWXrfKtwMB1bQUwnU+dCYa4K6RY9t/ oYT239/lpPws0XYtOg3Fx5W5ZPU+iailBBXyH3c4qp+XynQXXAiqI1IGCdwmub4EKz EJ6QgpC4eQdhrITI/85RAyjoc4zSZp701psP0wvw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Thomas Gleixner , Ingo Molnar Subject: [PATCH 4.19 56/56] x86/i8259: Use printk_deferred() to prevent deadlock Date: Mon, 3 Aug 2020 14:20:11 +0200 Message-Id: <20200803121853.061508887@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200803121850.306734207@linuxfoundation.org> References: <20200803121850.306734207@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Gleixner commit bdd65589593edd79b6a12ce86b3b7a7c6dae5208 upstream. 0day reported a possible circular locking dependency: Chain exists of: &irq_desc_lock_class --> console_owner --> &port_lock_key Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&port_lock_key); lock(console_owner); lock(&port_lock_key); lock(&irq_desc_lock_class); The reason for this is a printk() in the i8259 interrupt chip driver which is invoked with the irq descriptor lock held, which reverses the lock operations vs. printk() from arbitrary contexts. Switch the printk() to printk_deferred() to avoid that. Reported-by: kernel test robot Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/87365abt2v.fsf@nanos.tec.linutronix.de Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/i8259.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kernel/i8259.c +++ b/arch/x86/kernel/i8259.c @@ -207,7 +207,7 @@ spurious_8259A_irq: * lets ACK and report it. [once per IRQ] */ if (!(spurious_irq_mask & irqmask)) { - printk(KERN_DEBUG + printk_deferred(KERN_DEBUG "spurious 8259A interrupt: IRQ%d.\n", irq); spurious_irq_mask |= irqmask; }