Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3501897imu; Mon, 7 Jan 2019 04:40:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/VzRfpEysv7d9h1k1/lsix1acfTxKJFuE6FjXj5rTsXSra9dMEZu/qyhvrZ3cPj6GJ2bjiA X-Received: by 2002:a62:d448:: with SMTP id u8mr62852290pfl.105.1546864826580; Mon, 07 Jan 2019 04:40:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546864826; cv=none; d=google.com; s=arc-20160816; b=a5knskhGtrmidQXcTtNzLbY7hK8nyFoRH8JpMNy/IFgi3azLPLIp4aVyQF4soiEZMV BLsglMfYjoNLD1oUlTuSOxLqspL0pr5muKn9ayzTVcWs+u+0ykb187HpkQc3+PB76JTq YdMoLHVOv7LEBpdx+yiFgML9sUmLToRFEs+qkQuvwZ9J6oU9HFtTJEo7v6QYNiFWMP5M SY7sUKKdQPdOfggoo52G/J9KN7Ja/r2HxybVhed9IsWBQ0SojzzIGa0TXNUyhcZq9G+C VCEuC1tNebbXg+fn3xVWfTDUPVoAhHQHa40UH7Nntpusq6szmRgWD4u9+4IjseQGdqi0 engQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CL+BCLy9hkjpMJyMddQdpLgyYh4j9G6SnUV6+WxGKvU=; b=uXookBNlINRzJOU3iGUbBCzrwGHB6J5X4V9uIkDT4O638oI1IC/DManRwrRwDj6KDe xk6HVIv7PIMyyV1ZtNfxQLYCyM5ZNncBNu6WswzL5rCn5gq7Gk5cufTT/7kPKtZRcVIV k7U5tnx9ZvcvYut9XKm4F5dhvK1xuR02y+F1qTDgQ3LJWse9v2aURc7K3H18fIIU0qSZ nUF1KR37LIKz08etrbd+0DOqHuW4rFeLYAcFbriBd2XEC7/jm3991CKNmhljD3V2RanD 5x/JO6ekkj/0/uhzoFko/j4IsuJ1qZxI0IImoGklfGf0+kA6IcP/PscdAZ1vCOQLn2mU fQJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2NQ61BOT; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2si63050473pgh.475.2019.01.07.04.40.11; Mon, 07 Jan 2019 04:40:26 -0800 (PST) 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=@kernel.org header.s=default header.b=2NQ61BOT; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727918AbfAGMiV (ORCPT + 99 others); Mon, 7 Jan 2019 07:38:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:53450 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727460AbfAGMiT (ORCPT ); Mon, 7 Jan 2019 07:38:19 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7957020859; Mon, 7 Jan 2019 12:38:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546864699; bh=8F5HsyIgdYko+KDC9Ydp8PAwcUEyTRA8rQETaqJ2KW8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2NQ61BOTbZbrnZf+6xI87wfY70w67tkw1T+8AppOXULaIlu3K2y7F5jgPYvJGu22G A3SK7sXxSqQtvgF+jqUGTXfUEZ6PB/9QWqVmu21BBpthZlsB1yWwtrOn+fZzltaJhd iW/611b9GhYbP/jCoFp8YBnSITJYAEOHUIf/cuBM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Greg Kurz , Andrew Donnellan , Michael Ellerman Subject: [PATCH 4.20 070/145] ocxl: Fix endiannes bug in ocxl_link_update_pe() Date: Mon, 7 Jan 2019 13:31:47 +0100 Message-Id: <20190107104446.397241613@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107104437.308206189@linuxfoundation.org> References: <20190107104437.308206189@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Greg Kurz commit e1e71e201703500f708bdeaf64660a2a178cb6a0 upstream. All fields in the PE are big-endian. Use cpu_to_be32() like everywhere else something is written to the PE. Otherwise a wrong TID will be used by the NPU. If this TID happens to point to an existing thread sharing the same mm, it could be woken up by error. This is highly improbable though. The likely outcome of this is the NPU not finding the target thread and forcing the AFU into sending an interrupt, which userspace is supposed to handle anyway. Fixes: e948e06fc63a ("ocxl: Expose the thread_id needed for wait on POWER9") Cc: stable@vger.kernel.org # v4.18 Signed-off-by: Greg Kurz Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- drivers/misc/ocxl/link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/misc/ocxl/link.c +++ b/drivers/misc/ocxl/link.c @@ -566,7 +566,7 @@ int ocxl_link_update_pe(void *link_handl mutex_lock(&spa->spa_lock); - pe->tid = tid; + pe->tid = cpu_to_be32(tid); /* * The barrier makes sure the PE is updated