Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1498630imm; Wed, 20 Jun 2018 20:16:20 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLhF66RiyKWFwTMYKyK11Wl8WWGri4dw6/EDWrIwIXlky4siopKsOijwATAXQcK208IyOl2 X-Received: by 2002:a63:7f4e:: with SMTP id p14-v6mr20816283pgn.27.1529550980177; Wed, 20 Jun 2018 20:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529550980; cv=none; d=google.com; s=arc-20160816; b=J23kOGANFCSFKEILheCaFuOD8UvKQGXw6BxdvvonEV6pSm1HkqMB+oevSwOiK01HAI x0GRWCblq+FjdUm7m2Psnm19P7/QLhVWEKv8KBItHBNKOd4aux9d2jHiAVVer2SgDTH4 ea4Coy+EO34NhO3xCmHuXkiIiuqu5Xfp1UVl5S8VPcy0ouMeZ3YQ8/m2joDiYSp3Jx0T RlTGDFVZ58vb9M2UP/l2F0dyDb9Qlnu/jnr/dPSH6aEa0ZYAb1sTQubiPmXlvlGtiMXg rTeLVL9syPFyu/seY7h9KOrzmh7F44X4d5KiUWo+VMdyXYPwTacsd2TzgWNfiq8y8Fxk 3egg== 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:from:cc:to:dkim-signature:arc-authentication-results; bh=EoyQPZYlHsfxO8tSnUKsnrVIsKXHjxJDP97fp/Bqf6M=; b=cL8zh952VGJqbI5RPkGaMdLoaRqTw4T12QYg8IJdNfULXfR//KDIq0LiScF7vDM9Eg 8qf+gKDj8akcogzWVuX0cNGWe+or9C8snDXKQ7Q3I8pALvXfFm8kgx3vt+s/2S4iQiCk aEN97yHTUYj87+oZuPiAFeihDMrc8ezFKXaVZJdcHPAAhyBczCjwVc1kPlSVzRSC1quC mKyPxmkPQp7MKxI2bA8XiYrP5QVxPQhB3FIWxoeK11acx+lW073k2JuvcYq+ysbvFtQH MzXRN91EYJLP+cunGt+lS4kHA8BUVYWe+cJliwe5gcSSvwQKybKjgQme3XxBXwo4pXyR HNgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Mt4mbZTY; 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 7-v6si3712353plc.179.2018.06.20.20.16.06; Wed, 20 Jun 2018 20:16:20 -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=Mt4mbZTY; 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 S1754707AbeFUDPV (ORCPT + 99 others); Wed, 20 Jun 2018 23:15:21 -0400 Received: from mail-pf0-f180.google.com ([209.85.192.180]:42835 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754157AbeFUDPT (ORCPT ); Wed, 20 Jun 2018 23:15:19 -0400 Received: by mail-pf0-f180.google.com with SMTP id w7-v6so773205pfn.9 for ; Wed, 20 Jun 2018 20:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=EoyQPZYlHsfxO8tSnUKsnrVIsKXHjxJDP97fp/Bqf6M=; b=Mt4mbZTY8pvStfamlYvvzl8xcxA8xio7R3p09oSmSJg2AonD6rMNuZxwAi9bSiO3NY toTWczae8D2oVeXBk3tJhCl/c+vH2QoKkCHRLyDZNjl6Pe/m/zwA8hye0mGkLgBNkkUi SNzM7m//MARd+ocZzHztzwiVWwfr56dlSdtv0ajVsAvuXqY9LCvgCFRMCIq8n5SBCZiQ CUgTSebYY+6MM84x4ojsOURtGY1ESNdB6uAnOdsI0s0pzATcZQhH1coFDT8OYaSHKYdf pUzdWGRHl8a3XPTr6466tLuxSDVXXNdDkLZoIzyzwQNZWxOsd55TIG/rhPwFDSwY7p+u dgzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=EoyQPZYlHsfxO8tSnUKsnrVIsKXHjxJDP97fp/Bqf6M=; b=eMRLlg74gqNYk1PCD1fk0UqSwqcUtywhKOgnubZbGqm+BcLB+EKcIkIenNnoLzcaa9 fH1qYYizQDARLDeHrFA77VgULtdrwmY48mNuA6jZBI2o0AQ/kh+4l1sPMvE9LY03m3hS MQ5BqjU10IzXpkBqtrngweWXO3OsWEjR813NH1JHqZ8JqSJckhydI5KPlxnGbXE69HPC 5mfuZPOyaOZ5/MPA0EDebnbnnKna7JxVbN3yLhipEStNtRNRXd0MGoppoDV476DqJqZX fktvj7K+su7Od+I0aIDx1uvY/MdShTP9mg934GKVDomUPNPgbGthLzCxiiIA43wMWWXg 9VnA== X-Gm-Message-State: APt69E3+akOZjXMW6VJ2eO8eR/yHlq6/YXGnCsbyl3OQytOLFaD8FJdo 69AOJhs9aSRNLtR6m9vdPw/mmFDB X-Received: by 2002:a63:bd01:: with SMTP id a1-v6mr20831531pgf.319.1529550918813; Wed, 20 Jun 2018 20:15:18 -0700 (PDT) Received: from ?IPv6:2402:f000:1:1501:200:5efe:166.111.70.11? ([2402:f000:1:1501:200:5efe:a66f:460b]) by smtp.gmail.com with ESMTPSA id h124-v6sm6374958pfc.100.2018.06.20.20.15.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 20:15:18 -0700 (PDT) To: peterz@infradead.org, mingo@redhat.com Cc: Linux Kernel Mailing List From: Jia-Ju Bai Subject: [BUG] kernel: locking: a possible sleep-in-atomic-context bug in rt_mutex_slowlock() Message-ID: <10fdf749-b47c-587c-96cb-9a877d8760ac@gmail.com> Date: Thu, 21 Jun 2018 11:14:49 +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 kernel may sleep with holding a spinlock. The function call path (from bottom to top) in Linux-4.16.7 is: [FUNC] schedule kernel/locking/rtmutex.c, 1223: schedule in rt_mutex_handle_deadlock kernel/locking/rtmutex.c, 1273: rt_mutex_handle_deadlock in rt_mutex_slowlock kernel/locking/rtmutex.c, 1249: _raw_spin_lock_irqsave in rt_mutex_slowlock This bug is found by my static analysis tool (DSAC-2) and checked by my code review. I do not know how to correctly fix this bug, so I just report them. Best wishes, Jia-Ju Bai