From patchwork Mon Aug 2 13:46:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 490345 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp1940542jas; Mon, 2 Aug 2021 06:48:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxI9cPiWHeWNL+LkalQgaOo/3wxwLfcFnvys4n2DsgV7eFhmKDFYpDUraxpr+y1mj2NSL2+ X-Received: by 2002:a6b:f707:: with SMTP id k7mr2151815iog.125.1627912089280; Mon, 02 Aug 2021 06:48:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627912089; cv=none; d=google.com; s=arc-20160816; b=DfVDK763v04+rDhZa+67Yp0nCIkZOkWJpu1aKkf4k7CbGzX+etFquMujtID3BlkA8Z gA36d5x18V4RHHf3RBLnd9TPCwdyJo8bOjG4sW0mCo/2kfqwlNlTfZJP4k3tIQ6BNE+k IBesgM6apvqtVUpurcblc5UKY8JmJwoReJ3dhOSljCf1ka6NybVbij5VTvDhO0tiGM1b wm96xdAZYIEILxumEXDojxqv0/vcGO7/Phc0Wjpqroz04Qli8IxWcbJhiB84pDQoFMvj BN8e4XkgyyfJLhz6UHxkuqX6yQ0BkP4YoIOSEhuZ7kZukO2HzPgLA8Y23bG3EQisw1/I aUQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Q89jGrQT4uSlEv+GgwdYWHA/XMPMEt5qJvL/ZC33FB8=; b=PddFBqVZVKTQNm0HUyYoDYDGrwqzQKNNYlKEDDtr77ZeFX6p9984qR2DPLypecjHpB TbpNQCTrpPuMvappwvrZFcLrty8zbkI1Yint4MFISHng+FW9KLHfBZLCN2n4bekfNq3V FbYe+UACyy4Rp4CDUE2cLoeSuiKiXRM/RXszmPKZv/v5YTrlAQ5UOg2leehpkVyk0smd vagqcoalwx1q4aTHYQorZ+N5XNwDByq5lr7RD5gW0g8/Nr7+AYrPT1faSFCt8svbxypx PUVu7zajJ5xOm/8pFM9pJDEy7MtmJNhJmGUDPbNs5PMpZkBozK9FqyZ5OmfLQ0Go71ar 6xSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b15si12624707ioj.7.2021.08.02.06.48.09; Mon, 02 Aug 2021 06:48:09 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234452AbhHBNsP (ORCPT + 12 others); Mon, 2 Aug 2021 09:48:15 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:7917 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234257AbhHBNrf (ORCPT ); Mon, 2 Aug 2021 09:47:35 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GdfNB5NzHz83CY; Mon, 2 Aug 2021 21:43:22 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 2 Aug 2021 21:47:11 +0800 Received: from thunder-town.china.huawei.com (10.174.179.0) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 2 Aug 2021 21:47:11 +0800 From: Zhen Lei To: Greg Kroah-Hartman , stable CC: Zhen Lei , Anna-Maria Gleixner , Mike Galbraith , Sasha Levin , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , linux-kernel Subject: [PATCH 4.4 00/11] Fix a potential infinite loop in RT futex-pi scenarios Date: Mon, 2 Aug 2021 21:46:13 +0800 Message-ID: <20210802134624.1934-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.179.0] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Commit 73d786bd043e "futex: Rework inconsistent rt_mutex/futex_q state" mentions that it could cause an infinite loop, and will fix it in the later patches: bebe5b514345f09 futex: Futex_unlock_pi() determinism cfafcd117da0216 futex: Rework futex_lock_pi() to use rt_mutex_*_proxy_lock() But at the moment they're not backported. In a single-core environment, the probability of triggering is high. I also backported commit b4abf91047cf ("rtmutex: Make wait_lock irq safe"), it fixes a potential deadlock problem. Although it hasn't actually been triggered in our environment at the moment. Other patches are used to resolve conflicts or fix problems caused by new patches. Anna-Maria Gleixner (1): rcu: Update documentation of rcu_read_unlock() Mike Galbraith (1): futex: Handle transient "ownerless" rtmutex state correctly Peter Zijlstra (6): futex: Cleanup refcounting futex,rt_mutex: Introduce rt_mutex_init_waiter() futex: Pull rt_mutex_futex_unlock() out from under hb->lock futex: Rework futex_lock_pi() to use rt_mutex_*_proxy_lock() futex: Futex_unlock_pi() determinism futex,rt_mutex: Fix rt_mutex_cleanup_proxy_lock() Thomas Gleixner (3): futex: Rename free_pi_state() to put_pi_state() rtmutex: Make wait_lock irq safe futex: Avoid freeing an active timer include/linux/rcupdate.h | 4 +- kernel/futex.c | 245 +++++++++++++++++++++----------- kernel/locking/rtmutex.c | 185 +++++++++++++----------- kernel/locking/rtmutex_common.h | 2 +- 4 files changed, 262 insertions(+), 174 deletions(-) -- 2.26.0.106.g9fadedd Acked-by: Joe Korty