Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4090796pxb; Mon, 8 Feb 2021 07:44:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJxCeHACfSK2ucUBwDpZSK9TALhTh85Bxb38KMwHHbY9syC/zxx7sl5imPGB7BlLVvLKxfYe X-Received: by 2002:a05:6402:1cc1:: with SMTP id ds1mr2987852edb.10.1612799060718; Mon, 08 Feb 2021 07:44:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612799060; cv=none; d=google.com; s=arc-20160816; b=dvU8n+vhDARKif4iBE7mNXS4hq/4bjhQrv3SI7C/b9xpwTU1/qHBwQ2nELBIXLJ2nc c5Ylhn3WHhQ8ktOnvq8HNZeRfVsDB/hzHovgncsFHGcx8IvndfjAh85n1LtPHTdGO+Tl jZ724hZKhp9WrIj8QnXjvCBHcCkq7aysi8Ajk4mBgKOpZ19bHaKWLTfU1erVQc77CzOj 86WT5IDAVPbK/+OnM6JUWWiWYuUp7zRNQ1JFb1nFPQf1zZpK5NJoXyrjunG+E3L3GGMA HwIh7anFOsHKTdupguydVQHLGBYz/W/q9iE5lLlzdZlbuJUpmEO4DqFNiy85RhLZElnF 2xNw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+r+hXQOtSUNjWy9Z2Ufjdfrm6EXo9Bre2hoN6BktalI=; b=KOq4ngMwx8Ey23kBMMHt7NSTwSYA1WgD0OwG7RQXrOlwUs8oL5ivTzNxcsI0wIlOYI emjJu43SiJwxBziyYJpaPfDaOWendy5XrsfUI09/+nYCQ/W6UXCV1os0ByD34E9RTPJG jZZUYQGzB5bWnmr1dyyD70KcGAZisCoRymU8pVgofVDvjroFpZrmRO3NsaPruV1ermTt SXH+mTr9DtAzUuEUUt2eaI8do/6H11E0hTgpo/YE9GO1EUHBp4z1t6/EqjqiqfM2AFqv u973qQ/c37uCxoD4rzqVzPPgVrjv+Jb0x7Sd4sY5LCDZo021aDlToWFKHYlYhZR79+T3 SNhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KsyIihtV; 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=pass (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 y8si12397526edp.207.2021.02.08.07.43.56; Mon, 08 Feb 2021 07:44:20 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=KsyIihtV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234059AbhBHPlW (ORCPT + 99 others); Mon, 8 Feb 2021 10:41:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:52062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232221AbhBHPGM (ORCPT ); Mon, 8 Feb 2021 10:06:12 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 00BF364ED5; Mon, 8 Feb 2021 15:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612796683; bh=BzrQ+Brp4qSgyNAtHGJ0AshXoAVuslOy0sbxqUDQg0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KsyIihtVoaGUv73AyAktBU5B2BjfbZcRuxlCrJgP9+1keoiESluof167uTlTSv1aK /PpN9glXuyGx5MpR+fRoHUKXdv7twrWy6q5QkhloNNiNt0z28k1RkJB3mT9tVEmiib YTfuGasb4NfweW+vSSng8aCyW8RueadtH4b6mCwc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Thomas Gleixner , "Peter Zijlstra (Intel)" , Lee Jones Subject: [PATCH 4.9 08/43] futex: Replace pointless printk in fixup_owner() Date: Mon, 8 Feb 2021 16:00:34 +0100 Message-Id: <20210208145806.624737255@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210208145806.281758651@linuxfoundation.org> References: <20210208145806.281758651@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Signed-off-by: Greg Kroah-Hartman --- kernel/futex.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) --- a/kernel/futex.c +++ b/kernel/futex.c @@ -2447,14 +2447,10 @@ static int fixup_owner(u32 __user *uaddr /* * 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;