Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp28142imm; Fri, 10 Aug 2018 07:06:45 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwQXtmK+uJIp+NQ0/WUnRzH4zOpeTv0hTrwl7D5mE9KI4eEjb+ypfmQpL3JXz74bYrXQnZK X-Received: by 2002:a63:4a07:: with SMTP id x7-v6mr6749465pga.34.1533910005269; Fri, 10 Aug 2018 07:06:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533910005; cv=none; d=google.com; s=arc-20160816; b=bBwkFZhVtsRGdoUBNC85uZ073O8r00Xxw9YKPG2+Paky6a4zQF64tsT76wqlqPs7AC PdVixD4gbwrW7kt6/s1Ts+G8oZtMN9HIv3Mn494JFps4SexZVbmJWupjXcZwRZ9PxVCP V/gw06SaP9cW7/8KJirEbdQdE4A2YJmTJMO++PkX3oUVU6AGSY0vPsgg3onu7BnhNPFf 8hbJBtL+EdFqfpeh3N0AgzLUWlB1ym0uiStjko//is5omD1fj2XoSOmsDTyrIWCn+C1s aPCk2avUqeZXV53OApdRXUq0q/1jHBBPhsxV88Ha2hG0dj3Q8/khcCGZkWwZt0/dQA3h 9Z+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:mime-version:user-agent:date:message-id :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Ki08Jx3YnliSGLAPep/p6sfozxcIOOmrbzzkmFF5pxo=; b=lfUz6JzHQxtSi41iPD1NUCc5ZEmJFO4LgTpKFNXLwJJLFYwH+cpQpsWehB5nbsp+RL OMLoVwBbT+VsZZL/EukpVcktwKY5uPR16CLHAuyzUop9zfyW7NiURr85Ji8MdBrLz9yv gKNU0eC6/KTi/DhIQNiQ9UdKbMu3j8DwW7r7tz/Nl0nmUc/GxgDWcUa5bZLLPn4DFv5A g2wng5SKkWXgXONiw8qwvGc30TwAlkxr69CpfvPvh3VydFeUZOULXk/jrNkpePlBJYVb 3nEiSAul4+tQ1+6nLapm0bac95Am4LGYvAQdGiscHWQProIRy10kbfsViv6TBtOHC64u gJsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tda+0A4D; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x4-v6si8259527plr.427.2018.08.10.07.06.29; Fri, 10 Aug 2018 07:06:45 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tda+0A4D; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727656AbeHJQdL (ORCPT + 99 others); Fri, 10 Aug 2018 12:33:11 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35683 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727209AbeHJQdK (ORCPT ); Fri, 10 Aug 2018 12:33:10 -0400 Received: by mail-pg1-f196.google.com with SMTP id w10-v6so4466910pgv.2 for ; Fri, 10 Aug 2018 07:03:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=Ki08Jx3YnliSGLAPep/p6sfozxcIOOmrbzzkmFF5pxo=; b=Tda+0A4DXk/rpo/qbcFAfTQcWTgnIeg10hHf1aTiXdu5aX2DRdajj98G5hlpxpx4cg jBoijHE4hPS4PgVBIoURwlb/MH+v9zGAOassn1TfWQYBsDmTeVB7j14XyVvJGFSWDewS BynzY9EhMM4HSVaijlvumbmTRVxcnEJONovw7L3CWbRpitkESi+KsuIl0FN8f4g6Pdju R1gcDwUu79yZWjXNnmyei90U6DY+2m7PeT4SUD4SrlEkkgJBhEUlJ2VesD+zPx9ck1lW qMvFtlTeuM0BVYM+Yh5Xz6woXAHR1SMjAe2Oo4JpYUTIISv1bSCVA15kmFJHoBE+9nHf O6yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=Ki08Jx3YnliSGLAPep/p6sfozxcIOOmrbzzkmFF5pxo=; b=Yjr556bnXLW2Epf3f5bDH303DH0PMyrXy74CLd8VPjzxEsXu/d7EUmW2E3qrumb+BD IaAZNiTVV4q9YDz1Kb98K+g/8zF62np9QWLwabdckGW2l+AZRgx14T2WjZA1Wvx+1zoK 1gjScW2qSERhEBjV1lEPUy/RGXpOfxR39xfhxArj7UDVTamoGM38/b6lLQKKBgrISz7I q33BfdwIMNmPe7HHZXahUw9vDp+sVcJADCAYvwoRrcgmtBZZgQkMKvwGxcoShiJ7Yw9s giGJXGHgG5kAWkyjVQ8pSHvgY5Y2l8VjS1K+gRecsRKryIL8JRLXYQ0AwAxmiwmpHWuh 6zIg== X-Gm-Message-State: AOUpUlEWgCopKvQ8vyofThYUAf80QzJK19zRCEliLFRQ1IizsVlsAc0S VB/MT4Ee2vbbAHiYLluBTLRzzurv X-Received: by 2002:a62:cc4d:: with SMTP id a74-v6mr7298626pfg.200.1533909787606; Fri, 10 Aug 2018 07:03:07 -0700 (PDT) Received: from ?IPv6:2402:f000:1:1501:200:5efe:166.111.71.51? ([2402:f000:1:1501:200:5efe:a66f:4733]) by smtp.gmail.com with ESMTPSA id p11-v6sm17791954pfj.72.2018.08.10.07.03.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 07:03:06 -0700 (PDT) From: Jia-Ju Bai To: Thomas Gleixner , mingo@redhat.com, hpa@zytor.com, mark.rutland@arm.com, swood@redhat.com, paulmck@linux.vnet.ibm.com Cc: x86@kernel.org, linux-kernel@vger.kernel.org Subject: [BUG] x86: kernel: nmi: A possible sleep-in-atomic-context bug in nmi_handle() Message-ID: <75833c57-d263-3b09-8306-62b4a3e371c8@gmail.com> Date: Fri, 10 Aug 2018 22:03:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The code may sleep with holding a rcu read lock. The function call paths (from bottom to top) in Linux-4.16 are: ========== BUG ========== [FUNC] kmalloc(GFP_KERNEL) arch/x86/mm/mmio-mod.c, 237: kmalloc in ioremap_trace_core arch/x86/mm/mmio-mod.c, 289: ioremap_trace_core in mmiotrace_ioremap arch/x86/mm/ioremap.c, 243: mmiotrace_ioremap in __ioremap_caller arch/x86/mm/ioremap.c, 367: __ioremap_caller in ioremap_cache ./include/acpi/acpi_io.h, 13: ioremap_cache in acpi_os_ioremap drivers/acpi/osl.c, 702: acpi_os_ioremap in acpi_os_read_memory drivers/acpi/apei/apei-base.c, 662: acpi_os_read_memory in apei_read drivers/acpi/apei/ghes.c, 335: apei_read in ghes_read_estatus drivers/acpi/apei/ghes.c, 941: ghes_read_estatus in ghes_notify_nmi arch/x86/kernel/nmi.c, 137: [FUNC_PTR]ghes_notify_nmi in nmi_handle arch/x86/kernel/nmi.c, 124: rcu_read_lock in nmi_handle Note that [FUNC_PTR] means a function pointer call is used. I do not find a good way to fix it, so I only report. These possible bugs are found by my static analysis tool (DSAC) and checked by my code review. Best wishes, Jia-Ju Bai