Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1138168pxa; Thu, 20 Aug 2020 03:41:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznfmJI6In+fOrnJTi7qUCQPxUnmKRyS8gBR8k/ljUlilDAok0GSz3IkJljlEEJbQLY5utU X-Received: by 2002:a05:6402:2206:: with SMTP id cq6mr2243383edb.349.1597920064237; Thu, 20 Aug 2020 03:41:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597920064; cv=none; d=google.com; s=arc-20160816; b=KtqXX7CydmcnHrOMJCxRRk0PvsEe+AogvUsK7Cl3QZlc7WnWP01YdevfBE9iKTbj0V 6NQ1AqzhKeTX4hPwe2+WYsQe3aRo7GCIzYVRU8c1Iw+Fc0OjK2wHMNjV1B+wRsd4WEfr eqN7ShqyD0wH5XF5rQzutMDzx/vXD93DIKipxINRaSZ47TSN3KJwtBG2tHEjBqdYY8XW k0XGF57lWn3kc14jaRvsm1ZK/ljBUGQQVtAqxm3puFiT8IvFcIjL0A3EX2oQJfQZ0NRk H/Bx2nXOa8HChFXKVejQxBxiou08JsRXXxr1F44xdtDm4vSMeWKwPBNp2W4Ue6ccavrp ei1w== 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=bha4SjsUhIla1vXlVeFAYJIAe56IWUpk8onMtgx1Kgc=; b=aceA0vMXhbUyI1wISN/37zT3bM/F8bhJeDkJwyu0CDIoFXwh4efzDKFcDZ76+snXlt w+4KTbOcjcvLV0VKN/khDc+68v0EEQkJ3w4cdHVQR7Ikyex/pjK5RBkWSsFDSEPYQpnY 8J02GDn90DFfR56ZLuKJFCJVYi5d4BGjZ0oeLGzGP/fwbTKvcRaj+2gFdX9VBUFFgwAI sh5Ud/wZzs1V0CKJJhQr9tRSsrUmqXtzTlcs+WNaoeiR79jC8IyRcdD+1CpimAYHAFvh prBzbD2WNB+m5txd36ka+IINER9pamH4KgoJ53XmeCwxfF5c+GGl2JuzFpntT0pAbUPH KEIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fvLEP49Q; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ck3si1171439edb.324.2020.08.20.03.40.39; Thu, 20 Aug 2020 03:41:04 -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=fvLEP49Q; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730718AbgHTKjg (ORCPT + 99 others); Thu, 20 Aug 2020 06:39:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:39756 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729358AbgHTKR6 (ORCPT ); Thu, 20 Aug 2020 06:17:58 -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 3624420738; Thu, 20 Aug 2020 10:17:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597918677; bh=An8rfrtl2kc96SZkWhF6Ux9sc4/KRpyOvQhPLtfCEFw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fvLEP49Q4p54o8ATD3QGFiEdFcPVPugvLrybN74ptqbE0RGo96GJOIe43pJac42s9 8OP6+bQx1PAWOlLcE9kB0NV0KrD+vZifyrsr3UXn7k87tts+9XeTimq7ies7gsk+3E Sbr406DIeDBMUS3mYUJVyP75Cg262zxMBjEUPWjo= 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.4 026/149] x86/i8259: Use printk_deferred() to prevent deadlock Date: Thu, 20 Aug 2020 11:21:43 +0200 Message-Id: <20200820092126.988641157@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820092125.688850368@linuxfoundation.org> References: <20200820092125.688850368@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 @@ -204,7 +204,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; }