Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp126216pxb; Mon, 7 Feb 2022 07:45:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwCU8dIl7O3SCQTW7tJgPQTEMU6tYyDXPe+iOoyqdeTOYYQpXZtq4eFXVG8ivQH4hTLcjE X-Received: by 2002:a17:907:7b84:: with SMTP id ne4mr290280ejc.8.1644248704689; Mon, 07 Feb 2022 07:45:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644248704; cv=none; d=google.com; s=arc-20160816; b=gs75Izg9mQRNgQb6YqiPjuTuMp0S9X57OvXYvAiqEGfczrzqBF5scRBzVxejhOubCV nMnxiFLROr1FZvTDPbdF6+KEB2Lc/ljpOvtxKkR1oPdyvo/V3W5cus+EPsi7sa930jBD IT9LU5bjLowF3zwDFdWfdqaYe9ReEtA+qovoYVDSquUlXLwgN9+p+P5wIDRWA96coi5n RijTDedeKZvpbMsNOHPedY3AHjeWH46iTfcjoCAyG75Zxj4euDSyn9fT6Ms64qs+Lua0 HWvomATHGmjmhCMPyg+rLIaG53eKBt7QGZ2prCJy5s+caJ2qsDq9AgIcxavJ0fnnUg8W e2zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=7H047Zo1N1+uZqBGqXhve5zp5Ovo3/WcmoeG+ihz6CE=; b=iYG+cWwUqt1CSTaH/IIHo0/eYpKHUx2QFuBiO1pjhY1q0qtZYzEDSH7glQWlD1lRG8 ZvPdFMJnK5n/aWNcO+Aw0krvpm1kJKEFxiRPWejynoJjgaDevIySihB6tFXst8ej8nne OEL7rYguZarc9a5EUS6D01E0keOEe1p0bBnPsT5bKsEY0LxECPKKox8pJm4LHDJ1lU+s EYlqOgDe0OMBde08OhUHR7HM84/ReUAli+fw8KOGYFCaNv3pMHIriZcre2p5X2wpkWaN QwoSjNExxYVWOEhjS35HqclbJ/xVNATyZz654VUPFxPRtm8uSHmekDHi6iJxYvSjL0dJ Tjjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=T3VDDiv0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc12si7689611ejc.210.2022.02.07.07.44.38; Mon, 07 Feb 2022 07:45:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=T3VDDiv0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242969AbiBGADd (ORCPT + 99 others); Sun, 6 Feb 2022 19:03:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242994AbiBGADc (ORCPT ); Sun, 6 Feb 2022 19:03:32 -0500 X-Greylist: delayed 571 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 06 Feb 2022 16:03:30 PST Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E912C06173B; Sun, 6 Feb 2022 16:03:29 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id E5B52360FCC; Sun, 6 Feb 2022 18:53:56 -0500 (EST) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id qCDmv1sssdj6; Sun, 6 Feb 2022 18:53:56 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 423253611AC; Sun, 6 Feb 2022 18:53:56 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 423253611AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1644191636; bh=7H047Zo1N1+uZqBGqXhve5zp5Ovo3/WcmoeG+ihz6CE=; h=Date:From:To:Message-ID:MIME-Version; b=T3VDDiv0Touz7GFuXOYpoI9oCLZQcc5rkph0H/dhTifNqJqTLNPVFaW6qipYb0vXp G2j7k1+gosinc5vBCItDhTo64jERJCxAdOGy15QjRitw58Y4Pj5F5pQhhUe53RLxnJ sje8HmE7S3mk6FjnH1r15l+b8tjZScBY0hZaInsgYrpFIpwSNPj9JPGUQXDghX968g oTvbpapOGpSQKLuwrkDoaWmC2d6sGf89N1zlwvoMf1+kET/IElELdzWkmo1Ppo4Dxd AcSsc3OqGD/jQmdYVTAMeKiOH2B1xplTqOy+5W0jXH2QL+WF01Mb7Nbugh4y7AI7CS 5oxp4+u3Bkhgg== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id QUeyeigDF4Rh; Sun, 6 Feb 2022 18:53:56 -0500 (EST) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id 2E1F5360D6D; Sun, 6 Feb 2022 18:53:56 -0500 (EST) Date: Sun, 6 Feb 2022 18:53:56 -0500 (EST) From: Mathieu Desnoyers To: Peter Zijlstra Cc: linux-kernel , Thomas Gleixner , paulmck , Boqun Feng , "H. Peter Anvin" , Paul Turner , linux-api , Christian Brauner , Florian Weimer , David Laight , carlos , Peter Oskolkov , libc-coord@lists.openwall.com Message-ID: <1576236784.46087.1644191636055.JavaMail.zimbra@efficios.com> In-Reply-To: References: <20220203193853.21511-1-mathieu.desnoyers@efficios.com> Subject: Re: [RFC PATCH 1/3] rseq: Introduce feature size and alignment ELF auxiliary vector entries MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_4203 (ZimbraWebClient - FF96 (Linux)/8.8.15_GA_4203) Thread-Topic: rseq: Introduce feature size and alignment ELF auxiliary vector entries Thread-Index: H40c2UEJQsV5nzI4UFsy4Q8I+aXV2A== X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Feb 6, 2022, at 4:49 PM, Peter Zijlstra peterz@infradead.org wrote: > On Thu, Feb 03, 2022 at 02:38:51PM -0500, Mathieu Desnoyers wrote: > >> @@ -286,6 +287,10 @@ create_elf_tables(struct linux_binprm *bprm, const struct >> elfhdr *exec, >> if (bprm->have_execfd) { >> NEW_AUX_ENT(AT_EXECFD, bprm->execfd); >> } >> +#ifdef CONFIG_RSEQ >> + NEW_AUX_ENT(AT_RSEQ_FEATURE_SIZE, offsetof(struct rseq, end)); > > I've gotta ask, what's up with offsetof(, end) vs sizeof() ? sizeof() includes the 12 bytes of padding at the end of struct rseq, for a total of 32 bytes (currently). offsetof(, end) is currently 20 bytes, which is the offset exactly after the last field. For the "feature size" (meaning the populated fields), we really want a size that excludes padding. Thanks, Mathieu > >> + NEW_AUX_ENT(AT_RSEQ_ALIGN, __alignof__(struct rseq)); > > +#endif -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com