Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2846890lqt; Tue, 23 Apr 2024 03:35:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVzh3SkNwG2T2qO4Wy8SRQedbVoj+AgW9ohhVSXgBPSXZ9DalGjpj7nXgk9ZzOX//LtVXb6zQxoBz5eWY5JFoSYOGjjyxiRK8n9smunOQ== X-Google-Smtp-Source: AGHT+IEYNAdD7y02lgg/of/dmGLi3vrf1fIk0VAoJuzD9YWl3uWvVeOq6LA6HBbk4GsIwj2LrMAt X-Received: by 2002:a05:620a:4621:b0:790:8785:d8a9 with SMTP id br33-20020a05620a462100b007908785d8a9mr474783qkb.33.1713868500036; Tue, 23 Apr 2024 03:35:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713868500; cv=pass; d=google.com; s=arc-20160816; b=lcj8PmMTe/OAhwHP7gHcuRomOSsywNT6AShoEKXelGig+hZt8IhvywN/LiKjqARD1s aS6kWxJt+4Q0Vl5E+JwcV9NeQzTDCa7I4Uqm/e1ql0P15rW874j6V4a2Jlf/07Fb1Rt3 DnXxJwGzoXHTlxSz1ic3LAcQFTJOpF9WODlBltu11WmkATL3OseP7e+vYV1hRoxK4z9+ OAl8q2kB8PypSADq4Bmdng4zBZv5r085n3y3xnZ3benMGzsc+NKyYBeYiu79BnTJ6699 KYn3XxtNOGSIxvEMoxE5SfYsNHzJsmxB/2ykjolPGzpB2yEu0KQfbtkl0VzKAKmtLqco qe2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=77ivQCkCCaNOEhWMZgoXiGL3F6L/+6vnPAQg+qRpNz0=; fh=Uwa4IWXXKJwRZYO39w65TVaqpJ1UrESA6HypQ5y5vPE=; b=kD1//8tGEJMVoOlAbESLR3oG6V99sg26BurMilz8FJfEiHPzKx3GUBFBGt3KkxXhf6 f/aW1uuQw+rr006ODCHCzyITG0EtAL0hl9WHIHwHTb21lWpXT3sVssv5ZSh/zrbKyg5n mBfBb4kPkBVqtMr9d3NeQlWcKx0gvFmPO096iKSW8TOrt+FJB6a0x+hQRV7JAbLmo0C1 zsp+ClAGB7C8hzxgDE0BxkkaPT8mC3zT0yTpuAgs9xwXL2oL8N2fzWcxef7BxXSpRqj0 /vNHhRQin5NV2//uxAxnvkWxu9brxEaCdILoDFzFyf9+tVXtiCY59OoKTRBygMQOwD8T WBMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=pjmsJBd0; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-154875-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154875-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id k25-20020ae9f119000000b0078d5efaed99si12180914qkg.667.2024.04.23.03.34.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 03:35:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154875-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=pjmsJBd0; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-154875-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154875-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BE1551C217C7 for ; Tue, 23 Apr 2024 10:34:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1DAE45FEE6; Tue, 23 Apr 2024 10:34:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="pjmsJBd0" Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 60EEF37147; Tue, 23 Apr 2024 10:34:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713868492; cv=none; b=PGhR5A+bkFKXZeTMoJOSNGQZNq99Dol0varl19SKJVZGl0LFDhT/KXgnvH1jltbKM/6XYQ+SRQqkOTIBIwgweFBmOdoZLBpXK/qq/lSYuo2/R4htsUgDVzbSgfdhe+nJLx3J6VTBPrczgJnig4yl8OE7u/dRnzKwSJ3QS3qqsRM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713868492; c=relaxed/simple; bh=KwbPcjrXsaN9eBiRQy+fJ9TI6jMFZegKAgDYMpZNJdM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=l18kxxCFT/BxRPW/zJyLh+BketoqJsNCycat3dCAYSgEJBdcP7HLMh+A+yLIe6u7/o1znvc9Ce/2gEg4p8IVLMRc5B8GZTtFRiyvrvatAOMkCW8s7/OXJbGoPERiPB21iGtZneCALF2DBzXshdG5Es9F5/vFh4SMIpJ0LsjFjG4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=pjmsJBd0; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1713868488; bh=KwbPcjrXsaN9eBiRQy+fJ9TI6jMFZegKAgDYMpZNJdM=; h=From:Date:Subject:To:Cc:From; b=pjmsJBd0v+P59KM67nzYcRDzVTYZlnVLnM4dpCMlJFmnik6IGbQMQ3WhUmQeVH2dN 7ZcFK1cb8ULPCZF1S20yh+Leutr4nyumJji4ATkCq8dH/15QHRDrMOiTI1GexJM/pp u5kHBpOlp9ERu9vwGlcifI+DF+e8mFRz68hEecME= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 23 Apr 2024 12:34:25 +0200 Subject: [PATCH] admin-guide/hw-vuln/core-scheduling: fix return type of PR_SCHED_CORE_GET Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240423-core-scheduling-cookie-v1-1-5753a35f8dfc@weissschuh.net> X-B4-Tracking: v=1; b=H4sIALCOJ2YC/x3MQQqAIBBA0avErBNGs4iuEi3SphwKDaUIwrsnL d/i/xcSRaYEQ/VCpJsTB18g6wqsm/1GgpdiUKg0atUIGyKJZB0t18F+Kw47kzDYttJqNNh3UOI z0srPPx6nnD+NHGzzaAAAAA== To: Thomas Gleixner , Borislav Petkov , Peter Zijlstra , Josh Poimboeuf , Pawan Gupta , Jonathan Corbet , "Joel Fernandes (Google)" , Chris Hyser , Josh Don Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713868488; l=1859; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=KwbPcjrXsaN9eBiRQy+fJ9TI6jMFZegKAgDYMpZNJdM=; b=JGquxRziWJbrB0Tbk8Ppl9VeteFIloDvuyOExYZGiqPT81OPpbtPqZNAfzkxoB1t3AHAKoBbX KLKCKKJzT1lBpL7VvsFV1xY8gIi4iuLpjh64HbiJa8QtfYC/c9LUY0N X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= 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 --- Documentation/admin-guide/hw-vuln/core-scheduling.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/hw-vuln/core-scheduling.rst b/Documentation/admin-guide/hw-vuln/core-scheduling.rst index cf1eeefdfc32..a92e10ec402e 100644 --- a/Documentation/admin-guide/hw-vuln/core-scheduling.rst +++ b/Documentation/admin-guide/hw-vuln/core-scheduling.rst @@ -67,8 +67,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 --- base-commit: 71b1543c83d65af8215d7558d70fc2ecbee77dcf change-id: 20240423-core-scheduling-cookie-b0551c40b086 Best regards, -- Thomas Weißschuh