From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 377812D5925 for ; Thu, 9 Jul 2026 16:23:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783614229; cv=none; b=JAaFm88soGKgyK2ZYLZIqU6x+hMAUwscUi92hzp9r+cp9UjMTj01O+iNC13aNBlyazSypPbwpvBVOkwxTd6Ti5a65K2tT+yL2j1NQdVMWdT+JIYmePGHN0zdGr6f9vcFVlbRz/KCWw0a34WJFPAyZUYjJmx5cv6GhQPk1+SbDqU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783614229; c=relaxed/simple; bh=PYgbxg9gRqFkI+16o1eOO4t2hXv+bYRFkiZ971QQZko=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Tn34AiouGwwj9hPyUxs/zP5ShJmj/EMRfCsf7YAFxY9g+Cf1Sslrl29Bnj/Lxyj3wyzMlvcDLkuW5hO/SHvw6JqXRvHo6xLt8h12NsC4yX2r1B8JJGf7mH/QbS5NrJCaz5A9XoOHhmkW3WN1MRqOtv2dWuSPMCx029TkaJS6488= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kTtKQlVI; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kTtKQlVI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3E801F000E9; Thu, 9 Jul 2026 16:23:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783614227; bh=PVNPrFU1PGB9ZkQlUfz3ePnrtlBWmUW1vci7gbMc020=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=kTtKQlVI2aH1amHksEa7rfow7dWVS+iS2z4YE+Iqh/T8+Ez5emEdqU1kdTkaojuWs OKJk7lW+oT4uvf04ob+D3ohM9aoF8ZJD479QfbEOC0R1m57bfYtZLQA6geu/uz6b0K /lSg2t46nMG+6NTk82rnjRKlnXyNfa0QcvcA+vIC8NDBI3i7Ah7K0vfnkJ4IiosS81 dGiM7S9+9FvucYQjofrQJWnr41v3kbEpvt6ntqA8Lf1UqpsGYGYif6fGK72sB8cQBU oe++fLwVLSnhkAy9AkoHjEauWHassFGXYqo/RAuzcpteROSfe16KP1+JnaDRJDSjvX /r0+r0Y0kf48A== Date: Thu, 9 Jul 2026 09:23:47 -0700 From: Kees Cook To: Thomas Gleixner Cc: LKML , Peter Zijlstra , Michael Ellerman , Shrikanth Hegde , linuxppc-dev@lists.ozlabs.org, Huacai Chen , loongarch@lists.linux.dev, Paul Walmsley , Palmer Dabbelt , linux-riscv@lists.infradead.org, Sven Schnelle , linux-s390@vger.kernel.org, x86@kernel.org, Mark Rutland , Jinjie Ruan , Andy Lutomirski , Oleg Nesterov , Richard Henderson , Russell King , Catalin Marinas , Guo Ren , Geert Uytterhoeven , Thomas Bogendoerfer , Helge Deller , Yoshinori Sato , Richard Weinberger , Chris Zankel , linux-arm-kernel@lists.infradead.org, linux-alpha@vger.kernel.org, linux-csky@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org, Arnd Bergmann , Vineet Gupta , Will Deacon , Brian Cain , Michal Simek , Dinh Nguyen , "David S. Miller" , Andreas Larsson , linux-snps-arc@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-openrisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, Michal =?iso-8859-1?Q?Such=E1nek?= , Jonathan Corbet , linux-doc@vger.kernel.org Subject: Re: [patch 02/18] randomize_kstack: Provide add_random_kstack_offset_irqsoff() Message-ID: <202607090922.4ECAE32C07@keescook> References: <20260707181957.433213175@kernel.org> <20260707190253.768842729@kernel.org> Precedence: bulk X-Mailing-List: sparclinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260707190253.768842729@kernel.org> On Tue, Jul 07, 2026 at 09:06:02PM +0200, Thomas Gleixner wrote: > add_random_kstack_offset() uses get/put_cpu_var() which is pointless > overhead when it is invoked from low level entry code with interrupts > disabled. > > Provide a irqsoff() variant, which avoids that. > > Signed-off-by: Thomas Gleixner Seems good. I don't think macro'izing the interior is worth it since both cases are very short, with only the lockdep and raw bits changed. Reviewed-by: Kees Cook -Kees -- Kees Cook From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1555C43458 for ; Thu, 9 Jul 2026 16:24:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IGJbYaHCyK949FwefUTFBHY38U/FL3SLqFgCztE9VPY=; b=amr9wEL6/08NeQ uDG+ysIVRaaju/by7IUIRWfHxMOUtJxTt7f12OgtMujB1rJsq1tBZMK86GmDo4KVk5nEi4tC+QKbj ceU4SfAXLHdrPBTQWHGUEKJuubDbzpl/D/94Zasmo2FoFdX8eTdLOIHkn6z7Io4GVeMlSiu+jJxgO cokYXSWSDaYh1o6vbNTu3CCGY7DmTKn0Up/tEqPm07GHwjQKICteEo4pNVAJqj9EMp0nmX0NDFjiQ 5W6ELIBvU6cuGcIsdUOhrtqorjKItqtFdBW544im3u5yE9e9CMvlQ24cvbpV9zwEALB8k+vzotrWq JVe/0ZHpihsxMf2zCVKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1whrXT-0000000321H-0d3M; Thu, 09 Jul 2026 16:23:51 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1whrXQ-000000031zu-3R3W; Thu, 09 Jul 2026 16:23:48 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 16346405C4; Thu, 9 Jul 2026 16:23:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3F271F00A3A; Thu, 9 Jul 2026 16:23:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783614228; bh=PVNPrFU1PGB9ZkQlUfz3ePnrtlBWmUW1vci7gbMc020=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=dEsGFvG0entc+CRLpmVOaUBCJG4D03DxA7ZPHMA+0bz+ArzFZ4oZ25h3XsZAVyxRR x10/LoE7lElTzHD06XWpE2m6rYMtKRUGebUhQapIBfB+ep4fG37Ng0RaVsx6GdmjM4 W83GkVnhwTOjct2PRlsvXAgfF8WsuxadhgjUrZKIFxbiAgM07wgLkRHLtXBID76WXL vXpw2i5GZ2AEQYDFtIGxLdWwAY7AsLhILvFuoodFrluXUPHF4msNedMhyKYrHXoB8T JJj34DTu2/8Sq2sDLaSW1Xi2u/2ZNgMk1vZ51THvkxDDB/2K6ZsmwZ7UkwuT1KfO4D Hq6xN5eyBwNEw== Date: Thu, 9 Jul 2026 09:23:47 -0700 From: Kees Cook To: Thomas Gleixner Cc: LKML , Peter Zijlstra , Michael Ellerman , Shrikanth Hegde , linuxppc-dev@lists.ozlabs.org, Huacai Chen , loongarch@lists.linux.dev, Paul Walmsley , Palmer Dabbelt , linux-riscv@lists.infradead.org, Sven Schnelle , linux-s390@vger.kernel.org, x86@kernel.org, Mark Rutland , Jinjie Ruan , Andy Lutomirski , Oleg Nesterov , Richard Henderson , Russell King , Catalin Marinas , Guo Ren , Geert Uytterhoeven , Thomas Bogendoerfer , Helge Deller , Yoshinori Sato , Richard Weinberger , Chris Zankel , linux-arm-kernel@lists.infradead.org, linux-alpha@vger.kernel.org, linux-csky@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org, Arnd Bergmann , Vineet Gupta , Will Deacon , Brian Cain , Michal Simek , Dinh Nguyen , "David S. Miller" , Andreas Larsson , linux-snps-arc@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-openrisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, Michal =?iso-8859-1?Q?Such=E1nek?= , Jonathan Corbet , linux-doc@vger.kernel.org Subject: Re: [patch 02/18] randomize_kstack: Provide add_random_kstack_offset_irqsoff() Message-ID: <202607090922.4ECAE32C07@keescook> References: <20260707181957.433213175@kernel.org> <20260707190253.768842729@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260707190253.768842729@kernel.org> X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Tue, Jul 07, 2026 at 09:06:02PM +0200, Thomas Gleixner wrote: > add_random_kstack_offset() uses get/put_cpu_var() which is pointless > overhead when it is invoked from low level entry code with interrupts > disabled. > > Provide a irqsoff() variant, which avoids that. > > Signed-off-by: Thomas Gleixner Seems good. I don't think macro'izing the interior is worth it since both cases are very short, with only the lockdep and raw bits changed. Reviewed-by: Kees Cook -Kees -- Kees Cook _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 956C3C43458 for ; Thu, 9 Jul 2026 16:23:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VGFrKB5zT3ZQaZRX+gdY0bGMqy8WW1FZHlQpGtyoIgQ=; b=YJ7QwnU+bV2n6f aZwOKQCOS56Rfg2jNoI7ewd6BQPBUNXbsJxTp4kW9tHV+5ITULPNMkmyWIvLbKASmfv4euvifv2fV sK1NDss9RHGFA+12EfWGZQiY6qMZaPIZIv8PaXDjPCRHjOdqxPF6rI2XW1ccb7oXEzDXLTHgnv2/u wez5dJQrRt87HzGlqLUcQhHho7MZ63rx6Rb/IJDwtOm8ggRSOO5uUlPGAPnvgPQSFp7S34Gqq71So blCQSodYZ/76ryA7gr8Rz6AmoxcE5EF4zViLlhZI5T38B4ucADpdU/NKDjPR4AnsoOobZU3NL/KDR 3YvYgN+QzB7a7OpV3/sw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1whrXT-0000000321N-1DQv; Thu, 09 Jul 2026 16:23:51 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1whrXQ-000000031zu-3R3W; Thu, 09 Jul 2026 16:23:48 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 16346405C4; Thu, 9 Jul 2026 16:23:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3F271F00A3A; Thu, 9 Jul 2026 16:23:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783614228; bh=PVNPrFU1PGB9ZkQlUfz3ePnrtlBWmUW1vci7gbMc020=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=dEsGFvG0entc+CRLpmVOaUBCJG4D03DxA7ZPHMA+0bz+ArzFZ4oZ25h3XsZAVyxRR x10/LoE7lElTzHD06XWpE2m6rYMtKRUGebUhQapIBfB+ep4fG37Ng0RaVsx6GdmjM4 W83GkVnhwTOjct2PRlsvXAgfF8WsuxadhgjUrZKIFxbiAgM07wgLkRHLtXBID76WXL vXpw2i5GZ2AEQYDFtIGxLdWwAY7AsLhILvFuoodFrluXUPHF4msNedMhyKYrHXoB8T JJj34DTu2/8Sq2sDLaSW1Xi2u/2ZNgMk1vZ51THvkxDDB/2K6ZsmwZ7UkwuT1KfO4D Hq6xN5eyBwNEw== Date: Thu, 9 Jul 2026 09:23:47 -0700 From: Kees Cook To: Thomas Gleixner Cc: LKML , Peter Zijlstra , Michael Ellerman , Shrikanth Hegde , linuxppc-dev@lists.ozlabs.org, Huacai Chen , loongarch@lists.linux.dev, Paul Walmsley , Palmer Dabbelt , linux-riscv@lists.infradead.org, Sven Schnelle , linux-s390@vger.kernel.org, x86@kernel.org, Mark Rutland , Jinjie Ruan , Andy Lutomirski , Oleg Nesterov , Richard Henderson , Russell King , Catalin Marinas , Guo Ren , Geert Uytterhoeven , Thomas Bogendoerfer , Helge Deller , Yoshinori Sato , Richard Weinberger , Chris Zankel , linux-arm-kernel@lists.infradead.org, linux-alpha@vger.kernel.org, linux-csky@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org, Arnd Bergmann , Vineet Gupta , Will Deacon , Brian Cain , Michal Simek , Dinh Nguyen , "David S. Miller" , Andreas Larsson , linux-snps-arc@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-openrisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, Michal =?iso-8859-1?Q?Such=E1nek?= , Jonathan Corbet , linux-doc@vger.kernel.org Subject: Re: [patch 02/18] randomize_kstack: Provide add_random_kstack_offset_irqsoff() Message-ID: <202607090922.4ECAE32C07@keescook> References: <20260707181957.433213175@kernel.org> <20260707190253.768842729@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260707190253.768842729@kernel.org> X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org On Tue, Jul 07, 2026 at 09:06:02PM +0200, Thomas Gleixner wrote: > add_random_kstack_offset() uses get/put_cpu_var() which is pointless > overhead when it is invoked from low level entry code with interrupts > disabled. > > Provide a irqsoff() variant, which avoids that. > > Signed-off-by: Thomas Gleixner Seems good. I don't think macro'izing the interior is worth it since both cases are very short, with only the lockdep and raw bits changed. Reviewed-by: Kees Cook -Kees -- Kees Cook _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc