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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77DF0C61DA4 for ; Wed, 22 Feb 2023 12:06:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231467AbjBVMGO (ORCPT ); Wed, 22 Feb 2023 07:06:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231737AbjBVMFw (ORCPT ); Wed, 22 Feb 2023 07:05:52 -0500 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5192E3866D for ; Wed, 22 Feb 2023 04:05:20 -0800 (PST) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 5C82B92009C; Wed, 22 Feb 2023 13:05:19 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 593FD92009B; Wed, 22 Feb 2023 12:05:19 +0000 (GMT) Date: Wed, 22 Feb 2023 12:05:19 +0000 (GMT) From: "Maciej W. Rozycki" To: "Jason A. Donenfeld" cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Kees Cook , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] x86: Use `get_random_u8' for kernel stack offset randomization In-Reply-To: Message-ID: References: <874jrptmk9.ffs@tglx> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Feb 2023, Jason A. Donenfeld wrote: > > > Please provide numbers on contemporary hardware. > > > > Jason, is this something you could help me with to back up your claim? > > > > My access to modern x86 gear is limited and I just don't have anything I > > can randomly fiddle with (I guess an Intel Core 2 Duo T5600 processor back > > from 2008 doesn't count as "contemporary", does it?). > > I imagine tglx wants real life performance numbers rather than a > microbench of the rng. So the thing to do would be to exercise > arch_exit_to_user_mode() a bunch. Does this trigger on every syscall, > even invalid ones? If so, you could make a test like: > > #include > #include > > int main(int argc, char *argv[]) > { > for (int i = 0; i < (1 << 26); ++i) > syscall(0xffffffff); > return 0; > } > > And then see if the timing changes across your patch. Thanks. Though that does not solve my lack of suitable hardware, sigh. It's not like I have x86 systems scattered all over the place. I guess I could try to benchmark with said T5600 piece, but it won't be until April the earliest as I'm away most of the time. Maciej