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 825DF79F6 for ; Tue, 29 Oct 2024 01:56:37 +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=1730166997; cv=none; b=r7hhtNFMW8LnsS7VL01cTstmTvjb6yg2fGebBDQMAleTdJMrLEuXhZHUH097LfDOWIdDtyofz4mw8CaSInFdI3elHfE3UGPnX8/dYDDB+emP6iv62LodsNp3alr/OYPZDc3um3WMWdjOQAblO791S4OVOBLMD4XeGgIBCYI7jUA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730166997; c=relaxed/simple; bh=41qgNbkuNB++x016Enkhu+Sr9GqznlHTZ+ppdrv2jKE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=bOq0G7UzcOvLmzvabRZOzOdbPtKmF08xcLW/Yu/q0pb0NPgtiZiOiDs8RFLmiIFY6YvQvcH2qgI4x7mn3O/GUOkmvsEdaePYNqKy4TA5bacxj3SAVlAyhcphoi/GhjgXLZ7orEj2wPkIgbXe6lxyFRqrf8S44H6AB7FWBiD0kZs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vFesjoki; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vFesjoki" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 760DEC4CEC3; Tue, 29 Oct 2024 01:56:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730166997; bh=41qgNbkuNB++x016Enkhu+Sr9GqznlHTZ+ppdrv2jKE=; h=From:To:Cc:Subject:Date:From; b=vFesjokirzD3CSXnjSe11UM1tanp4jC3NfrJDQESb30+0izAuFGUrILJbWRKKSZDt mdV7FgWd0cgom4o3SzOMSnthSO26pvVkq+x8yjqvT9wVgSL620mM7FZcfJu3daPqq5 reaz1ybMB07J7L0YCrKyU9nWc4xpAtTvCLeqfcues/SUSPh4YiBaTA81Sd11hDeoZr DR/hPaGuSKL6mL3ju3Zhh7gfaooa7RrRXqvX6e9cCNWpUsbuz3aHCLE/psI2yENi9R ekz/O30HFcBWuLsLR2Q8Nbekio25IhD38oL3yWHQfXk5foy2LaE627ehKUw35i2gqX 3+AXxFqIepeTA== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Borislav Petkov , Peter Zijlstra , Pawan Gupta , Waiman Long , Dave Hansen , Ingo Molnar , Linus Torvalds , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, Andrew Cooper , Mark Rutland , "Kirill A . Shutemov" Subject: [PATCH v3 0/6] x86/uaccess: avoid barrier_nospec() Date: Mon, 28 Oct 2024 18:56:13 -0700 Message-ID: X-Mailer: git-send-email 2.47.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit v3: - rebase on Linus' patch (v6.12-rc5) - remove putuser(), copy_to_user(), clear_user() changes: as Linus points out, they don't produce a value that could be used in a dependent load to leak anything. - convert 32-bit versions of copy_from_user(), get_user() and __get_user() and converge code. Josh Poimboeuf (6): x86/uaccess: Avoid barrier_nospec() in 64-bit copy_from_user() x86/uaccess: Avoid barrier_nospec() in 64-bit __get_user() x86/uaccess: Avoid barrier_nospec() in 32-bit copy_from_user() x86/uaccess: Convert 32-bit get_user() to unconditional pointer masking x86/uaccess: Avoid barrier_nospec() in 32-bit __get_user() x86/uaccess: Converge [__]get_user() implementations arch/powerpc/include/asm/uaccess.h | 2 + arch/x86/include/asm/uaccess.h | 34 ++++++++++++ arch/x86/include/asm/uaccess_32.h | 1 + arch/x86/include/asm/uaccess_64.h | 30 +---------- arch/x86/lib/getuser.S | 85 ++++++++---------------------- include/linux/uaccess.h | 6 --- 6 files changed, 61 insertions(+), 97 deletions(-) -- 2.47.0