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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B059C4708D for ; Wed, 4 Jan 2023 19:20:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235360AbjADTUe (ORCPT ); Wed, 4 Jan 2023 14:20:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239824AbjADTUa (ORCPT ); Wed, 4 Jan 2023 14:20:30 -0500 X-Greylist: delayed 336 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 04 Jan 2023 11:20:28 PST Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD9301C41E; Wed, 4 Jan 2023 11:20:28 -0800 (PST) Received: from [172.17.203.2] (port=49315 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1pD9Dn-007RCJ-8t; Wed, 04 Jan 2023 19:14:43 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.94.2) (envelope-from ) id 1pD9Dm-000OQS-RT; Wed, 04 Jan 2023 20:14:42 +0100 From: Florian Weimer To: Mathieu Desnoyers Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, Thomas Gleixner , "Paul E . McKenney" , Boqun Feng , "H . Peter Anvin" , Paul Turner , linux-api@vger.kernel.org, Christian Brauner , David.Laight@ACULAB.COM, carlos@redhat.com, Peter Oskolkov , Alexander Mikhalitsyn , Chris Kennelly Subject: Re: [PATCH 05/30] selftests/rseq: Use ELF auxiliary vector for extensible rseq References: <20221122203932.231377-1-mathieu.desnoyers@efficios.com> <20221122203932.231377-6-mathieu.desnoyers@efficios.com> Date: Wed, 04 Jan 2023 20:14:42 +0100 In-Reply-To: <20221122203932.231377-6-mathieu.desnoyers@efficios.com> (Mathieu Desnoyers's message of "Tue, 22 Nov 2022 15:39:07 -0500") Message-ID: <87a62yun6l.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Mathieu Desnoyers: > +static > +unsigned int get_rseq_feature_size(void) > +{ > + unsigned long auxv_rseq_feature_size, auxv_rseq_align; > + > + auxv_rseq_align = getauxval(AT_RSEQ_ALIGN); > + assert(!auxv_rseq_align || auxv_rseq_align <= RSEQ_THREAD_AREA_ALLOC_SIZE); > + > + auxv_rseq_feature_size = getauxval(AT_RSEQ_FEATURE_SIZE); > + assert(!auxv_rseq_feature_size || auxv_rseq_feature_size <= RSEQ_THREAD_AREA_ALLOC_SIZE); > + if (auxv_rseq_feature_size) > + return auxv_rseq_feature_size; > + else > + return ORIG_RSEQ_FEATURE_SIZE; > +} Do you intend to use the auxiliary vector as the userspace handshake for glibc-managed rseq, too? I don't think it works if the kernel overtakes glibc. Or is there some other approach shown in the series that I missed? Maybe we should just skip the existing padding and use it only for some vaguely kernel-internal purpose (say through a vDSO helper), so that it is less of an issue how to communicate the presence of these fields to userspace.