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 2BBEE3043D0 for ; Mon, 24 Nov 2025 17:11:25 +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=1764004286; cv=none; b=DAaYGEW8kye65JW+0Y2gxdAVuCCS9eYJ0tlnVxwJusdstFUm5/wk473P1t4nvYgLWMISELWDLaBJpgCHqns48P+DrRfe+MjLlNp6x16Tmq107KB/Fzt6nV4va4torYw0i+qIA8kcVCKoDNdVXxRG9l8cakJw2WPbaTdycRkSnbA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764004286; c=relaxed/simple; bh=bWEp3vPM9oHHrXo0a4SYBugyipdbCtP06g6AkOcLzNo=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=Ml/Znay2L9q4wcKZ/DOUqL7AC41yAa9WXn8OMV2JBZyYSxs4fWb/an4HTNWDJFJYVwbX04ApM6c597Ksf6o5mjmSg3rkKjWUNcvSriMNZ5xuICRUtLxo5oyzcn1H4g0SZGUqZUyLuQz5RKdhwjLgE90PQIyUhnEo4gegEWEEk/c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=T7PUyzdc; 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="T7PUyzdc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F528C4CEF1; Mon, 24 Nov 2025 17:11:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1764004285; bh=bWEp3vPM9oHHrXo0a4SYBugyipdbCtP06g6AkOcLzNo=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=T7PUyzdcYOjYhbjL+noP71iMLU8qCNV4cVOJ/3rJKP8WjNW1x4z3T6+ZZtTcS9Haq s6vahxmY3XasEIi9II3M+gLfrS24ITj/yUv3VWqrA++GwfiuH6RXrStGykTjTztoTf KeToYQ2GnMQTh3y6C9TOYK7GtjGXAcrmRwora7MppvsGsQdV2BoNMakYpfKchhbsUk Exdp3ErPxTI0X53u/lgExx9u67FY6q9WuKhctfH0J6eLLzYtFG8xHqmSkeAb5TWg/r R3PAEx4ag7w0O5LKZ0zoNIdlR0TcVU0Z5ijT1ZJam14GdQQf0lN9aFFMePyJeoy8S5 gEwAy1kpPyfuQ== Date: Mon, 24 Nov 2025 09:11:23 -0800 From: Kees Cook To: Will Deacon , Ryan Roberts CC: Arnd Bergmann , Ard Biesheuvel , Jeremy Linton , Catalin Marinas , Mark Rutland , "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List Subject: Re: [DISCUSSION] kstack offset randomization: bugs and performance User-Agent: K-9 Mail for Android In-Reply-To: References: <66c4e2a0-c7fb-46c2-acce-8a040a71cd8e@arm.com> Message-ID: 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: quoted-printable On November 24, 2025 6:36:25 AM PST, Will Deacon wrote= : >On Mon, Nov 17, 2025 at 11:31:22AM +0000, Ryan Roberts wrote: >> On 17/11/2025 11:30, Ryan Roberts wrote: >> > Could this give us a middle ground between strong-crng and >> > weak-timestamp-counter? Perhaps the main issue is that we need to sto= re the >> > secret key for a long period? >> >=20 >> >=20 >> > Anyway, I plan to work up a series with the bugfixes and performance >> > improvements=2E I'll add the siphash approach as an experimental addi= tion and get >> > some more detailed numbers for all the options=2E But wanted to raise= it all here >> > first to get any early feedback=2E > >FWIW, I share Mark's concerns about using a counter for this=2E Given tha= t >the feature currently appears to be both slow _and_ broken I'd vote for >either removing it or switching over to per-thread offsets as a first >step=2E That it has potential weaknesses doesn't mean it should be entirely remove= d=2E > We already have a per-task stack canary with >CONFIG_STACKPROTECTOR_PER_TASK so I don't understand the reluctance to >do something similar here=2E That's not a reasonable comparison: the stack canary cannot change arbitra= rily for a task or it would immediately crash on a function return=2E :) >Speeding up the crypto feels like something that could happen separately= =2E Sure=2E But let's see what Ryan's patches look like=2E The suggested chang= es sound good to me=2E -Kees --=20 Kees Cook