From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 79BDC2D59FA; Thu, 27 Nov 2025 16:58:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764262738; cv=none; b=qF6eQZqf7QPHmwHjMzPwVSI+7fGvxF/VB11O+0ZLxZ55fQmHEopdrszBzoazRGr30QJRRr6aTFURvmlZtjqThbVWLRQumHrnQM2XzJqBNCQAVFsj0kmhQGJxgXwmNpPNeyRKBWcVm8qYB4Sl/YqNT+BOZsb1B5QwkWPHHxUTMv4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764262738; c=relaxed/simple; bh=kyyCXVcy7Ma4Vh4qLETgMW1gghAuksUXTAsMvtpFRu4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Kfv9Vagvz1s6SOQG/BpJZoO8bHnTmtR+oR0zMbbRtCxyZz3iWtcxKTLrh7aRcw22k4Ws8nRcq72ZLDyfLmdBx/WjgjxVHTBWT2yqtpi5b17KRCgmBatAui10NGVVB2bcfbrE+I4p7HHp9DjuLUPw3msW6GFxGDZcJKe4Oj2VlRI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 55F47176A; Thu, 27 Nov 2025 08:58:48 -0800 (PST) Received: from J2N7QTR9R3 (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8B8CE3F66E; Thu, 27 Nov 2025 08:58:53 -0800 (PST) Date: Thu, 27 Nov 2025 16:58:50 +0000 From: Mark Rutland To: Ryan Roberts Cc: Ard Biesheuvel , Ard Biesheuvel , linux-hardening@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Kees Cook , Will Deacon , Arnd Bergmann , Jeremy Linton , Catalin Marinas , "Jason A. Donenfeld" Subject: Re: [RFC/RFT PATCH 0/6] Improve get_random_u8() for use in randomize kstack Message-ID: References: <20251127092226.1439196-8-ardb+git@google.com> 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=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Nov 27, 2025 at 03:56:59PM +0000, Ryan Roberts wrote: > On 27/11/2025 15:03, Ard Biesheuvel wrote: > > So the question is really whether we want to dedicate 16 bytes per > > task for this. I wouldn't mind personally, but it is something our > > internal QA engineers tend to obsess over. > > Yeah that's a good point. I think it's a fair point that some people will obsesses over this, but I think the concern is misplaced. I know that people were very happy for the kernel FPSIMD context to disappear from task_struct, but 16 bytes is a fair amount smaller, and I'm pretty sure we can offset that with a small/moderate amount of work. AFAICT there are extant holes in task_struct that could easily account for 16 bytes. I can also see a few ways to rework arm64's thread_info and thread_struct (which are both embedded within task_struct) to save some space. > Is this something we could potentially keep at the start of the > kstack? Is there any precident for keeping state there at the moment? > For arm64, I know there is a general feeling that 16K for the stack > more than enough (but we are stuck with it because 8K isn't quite > enough). So it would be "for free". I guess it would be tricky to do > this in an arch-agnostic way though... We went out of our way to stop playing silly games like that when we moved thread_info into task_struct; please let's not bring that back. Mark.