From patchwork Wed Feb 3 13:45:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 375412 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp418302ejt; Wed, 3 Feb 2021 05:49:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLKK1d9EWpkzUPdk8KbXyQCdqeVqiPHH0eZ2ITkwKHfrO3WHz82V55VJ28/lS0mWOi9bzr X-Received: by 2002:a17:906:af86:: with SMTP id mj6mr1194934ejb.509.1612360160111; Wed, 03 Feb 2021 05:49:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612360160; cv=none; d=google.com; s=arc-20160816; b=W3ZC15R+cHA4PMn2Bzh6aYvHv3mJ0tiVme8/PEBA0hRHcHeNjPpxXZANrDGK+9AETV 8nxutPZ4LCFEdFDoC3/jqnzjhnbMPWqehBEbl7BM3maDEMUtuQlxyjbw7X2RfE0PyUg1 rDsBueJe1RLenn9w4IXy1v66e4JV+r3NYk4H3Mu5Cr8w7yRTnQ87SBBRpa89uLLmDK3H BQk0DXPyw4WOgUnyCa50PMgx0qb4wgtMCdStI3HNJEqb7yoWTDmwys9gb5N/UNt1alWg xRmBR1ndI2recOAs8ZbwD5mcgI1rNQ9Qhl8T+uzmMKTuQNOEdfgdhsZUkcds4ClNj+FY ujoA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=shpeaE1Az2Txha1mF0lLFgmVrxxkpcKGoNrqgxMpIXg=; b=f69Nv+NntprWQ1ihMnMEJg5Zb9fQ24iqu9Q6OGXPb0HFnjfyOKILbPAiWYBf8Icwn0 htFwwYvma7TqQhMMGfYV6XXwBS1feQa0lffdW3OWoP+t8FyaWcODdealIcJ/vxGHy3wK FFCxDU9djmAQ46tx3LsMcRSgHo5kl5OZK6+yevCkJx6Mh4iQJhPz3cu3yyX4QmPs/Mlu M8tEtxfddJ6M2IgTL3nAXM4gn+LJSDZS9WPkfz7jfhXYC2yQmKO8aCxJ/2KVQMJ1nMJl qqmDWHipkLIsp78qIse6dB3CMda9WIvi5Py/l13XuD0vwurbk/isOLcqV4bSsIYmdRVJ sVdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qa3hzvqV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si1469620ejz.742.2021.02.03.05.49.19; Wed, 03 Feb 2021 05:49:20 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=Qa3hzvqV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231629AbhBCNrP (ORCPT + 13 others); Wed, 3 Feb 2021 08:47:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232182AbhBCNqn (ORCPT ); Wed, 3 Feb 2021 08:46:43 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CE95C06178B for ; Wed, 3 Feb 2021 05:45:54 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id o10so3996600wmc.1 for ; Wed, 03 Feb 2021 05:45:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=shpeaE1Az2Txha1mF0lLFgmVrxxkpcKGoNrqgxMpIXg=; b=Qa3hzvqV8OBIHpAT4INGETBQtIOw7lrqD8+uUkzmqDN9yuM1J6fdHHbL+lGLyTNEKb MEd/TUFRyRhoPvolmxnAHLgR5cRZTRgIp8DXVhnLdbrd9P+Zue2cu+qcYW6LJsQlHHSn b5ceLNWqOQIay0GXUVSHBCPJSBUak4uH3dLaW1xnzgszVICQ73F2jzPBopB88Ir4pnIE DAD2m6V+2sBxnVs5M43Mh6URUsJTvhtK57w2XrcN7w4/4FVuV5MaXfPDMjGcKchjIjoZ Xntw4c0j4zNTNfzHM4di1q09hD+caDnaLDkCMO0KLeC518svncoadT3VKEi3HzIcoq7F SCZQ== 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=shpeaE1Az2Txha1mF0lLFgmVrxxkpcKGoNrqgxMpIXg=; b=NXkh8crWVCeosaqUsfEREltd2S0TxC5TIRkWtgcKCBe+nyWAI473A+cq9suVrdEtwS Hqk0DS1buJpGv7rotw8Vpsszgrzde5L2XgcFJ7wpTgPwsGW7ZZZG8tTBjSOeMHiQzhZJ Zxwd/a4cl1VChu4zzM7SuELXPf8fTFhc0oAenLB+rtdwTdhxjRkG2Y2RA2Rdgoykg/dE dYaL+EByXMQd1/NQ823nl+Q8kSeXWXw58nBTHD4SD2uaKkgm2LxDZvR8X4TUTLY4xhCP skAc65LCR/QoHNhAeC2q7QFw7A2Vs7jbXES/+av3sGLsJQ0H7pHfkK0Te+2NJcy+oHEM a/Wg== X-Gm-Message-State: AOAM530z1loKexfl+5iTapIBj2vI+Tus9CDlZHN+qtPFzORqwAxgpYFP Huz49K0SExGB1J7jedVypX5A6MIGdQvBfA== X-Received: by 2002:a1c:25c2:: with SMTP id l185mr2905518wml.62.1612359952877; Wed, 03 Feb 2021 05:45:52 -0800 (PST) Received: from dell.default ([91.110.221.188]) by smtp.gmail.com with ESMTPSA id r124sm2867900wmr.16.2021.02.03.05.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 05:45:52 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Cc: Thomas Gleixner , Peter Zijlstra , Lee Jones Subject: [PATCH 05/10] futex: Replace pointless printk in fixup_owner() Date: Wed, 3 Feb 2021 13:45:34 +0000 Message-Id: <20210203134539.2583943-6-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210203134539.2583943-1-lee.jones@linaro.org> References: <20210203134539.2583943-1-lee.jones@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Thomas Gleixner [ Upstream commit 04b79c55201f02ffd675e1231d731365e335c307 ] If that unexpected case of inconsistent arguments ever happens then the futex state is left completely inconsistent and the printk is not really helpful. Replace it with a warning and make the state consistent. Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Signed-off-by: Lee Jones --- kernel/futex.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) -- 2.25.1 diff --git a/kernel/futex.c b/kernel/futex.c index 8b137505fb502..e44203956d54c 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -2447,14 +2447,10 @@ static int fixup_owner(u32 __user *uaddr, struct futex_q *q, int locked) /* * Paranoia check. If we did not take the lock, then we should not be - * the owner of the rt_mutex. + * the owner of the rt_mutex. Warn and establish consistent state. */ - if (rt_mutex_owner(&q->pi_state->pi_mutex) == current) { - printk(KERN_ERR "fixup_owner: ret = %d pi-mutex: %p " - "pi-state %p\n", ret, - q->pi_state->pi_mutex.owner, - q->pi_state->owner); - } + if (WARN_ON_ONCE(rt_mutex_owner(&q->pi_state->pi_mutex) == current)) + return fixup_pi_state_owner(uaddr, q, current); out: return ret ? ret : locked;