From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9E201E497; Thu, 23 May 2024 13:19:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716470348; cv=none; b=N2RobsLiv9FROlLQh2eO6IgD1vJwOykI9HrPHpFp3KTk/3fE7bF8n9Hpw7JW2c8+bzcaru6jon7r4M5ed+AZMn3Ht94IOuc4IWVlvubkRI3BV1ZNiSKQwTKuhfo5SzA+hjM4gHYMCgrtoWeMBRYsy1ESrS3wuaeH2V0i+2kbgPs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716470348; c=relaxed/simple; bh=lda/JvoJt+TY0TzJSLVp/oVXym+3Z/43llqYC449YTY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ONqxUqjry9uRZZoquUgeYb7pf4vmPEK9zMdiMuHMivUVyLZB64TZ9gHIJRUQ//gDvrwBuRp2Q1RaUAjDg3YJc3J1tpV3eF3t5R+2QnhgGuc1G8LRBlGM529EAaNeW39yKcN9kOBj0W0MmTeFNydnpzt2GD87kOySN4wIMIl0D44= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TMiHCFWk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="TMiHCFWk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42C58C2BD10; Thu, 23 May 2024 13:19:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716470348; bh=lda/JvoJt+TY0TzJSLVp/oVXym+3Z/43llqYC449YTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TMiHCFWkRWcffIC/22n9Coj3ESkz1ILTvxJQbWGZWOIKWJPPK41Jkogq1z8393XZw eejLI9OIRCCp+NP76NqI+rS9F9ePq9H2aT8Ml9wDL25iuyzOVLRfBMup3VzXrEbSAK g665iq7JiYJHQ0butHuWjKH7qnEWUouiewCQdHRg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Chris Hyser , Jonathan Corbet Subject: [PATCH 5.15 22/23] admin-guide/hw-vuln/core-scheduling: fix return type of PR_SCHED_CORE_GET Date: Thu, 23 May 2024 15:13:18 +0200 Message-ID: <20240523130328.787045698@linuxfoundation.org> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240523130327.956341021@linuxfoundation.org> References: <20240523130327.956341021@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Weißschuh commit 8af2d1ab78f2342f8c4c3740ca02d86f0ebfac5a upstream. sched_core_share_pid() copies the cookie to userspace with put_user(id, (u64 __user *)uaddr), expecting 64 bits of space. The "unsigned long" datatype that is documented in core-scheduling.rst however is only 32 bits large on 32 bit architectures. Document "unsigned long long" as the correct data type that is always 64bits large. This matches what the selftest cs_prctl_test.c has been doing all along. Fixes: 0159bb020ca9 ("Documentation: Add usecases, design and interface for core scheduling") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/util-linux/df7a25a0-7923-4f8b-a527-5e6f0064074d@t-8ch.de/ Signed-off-by: Thomas Weißschuh Reviewed-by: Chris Hyser Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20240423-core-scheduling-cookie-v1-1-5753a35f8dfc@weissschuh.net Signed-off-by: Greg Kroah-Hartman --- Documentation/admin-guide/hw-vuln/core-scheduling.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/Documentation/admin-guide/hw-vuln/core-scheduling.rst +++ b/Documentation/admin-guide/hw-vuln/core-scheduling.rst @@ -66,8 +66,8 @@ arg4: will be performed for all tasks in the task group of ``pid``. arg5: - userspace pointer to an unsigned long for storing the cookie returned by - ``PR_SCHED_CORE_GET`` command. Should be 0 for all other commands. + userspace pointer to an unsigned long long for storing the cookie returned + by ``PR_SCHED_CORE_GET`` command. Should be 0 for all other commands. In order for a process to push a cookie to, or pull a cookie from a process, it is required to have the ptrace access mode: `PTRACE_MODE_READ_REALCREDS` to the