From patchwork Tue Jan 11 18:43:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 49885 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9BBB238A9402 for ; Tue, 11 Jan 2022 18:45:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9BBB238A9402 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1641926737; bh=L1VLanmDhV8F/eUNa22fV2wmDVlKfHVhZcEoOmlqGsE=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=fKqzqyiNALgtSEz5SO2Iglg+5RDdNHRucsLCgRYWQ2Md/m0gie5WPZQd0fYF5RffU fQ2s/YUuLa06qYKEqFZldE3T2Xf89h1lFg6qDj2abRTrR4tH0lrm2bwHxOUvfikD3t TM7pMH6wwvCe4b1V6mQaCXcQY5Qh9bYXNNBhyiHM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id CB122389041B for ; Tue, 11 Jan 2022 18:43:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CB122389041B Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-249-hpgrXSE9PJq14U8yJfWCEA-1; Tue, 11 Jan 2022 13:43:56 -0500 X-MC-Unique: hpgrXSE9PJq14U8yJfWCEA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 62C34801B32 for ; Tue, 11 Jan 2022 18:43:55 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 873777E663 for ; Tue, 11 Jan 2022 18:43:54 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 2/5] Linux: Remove HAVE_AUX_SECURE, HAVE_AUX_XID, HAVE_AUX_PAGESIZE In-Reply-To: References: X-From-Line: f2484ab06df5b82df754234edf4a20c54f665025 Mon Sep 17 00:00:00 2001 Message-Id: Date: Tue, 11 Jan 2022 19:43:52 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" They are always defined. --- sysdeps/unix/sysv/linux/dl-sysdep.c | 55 +---------------------------- sysdeps/unix/sysv/linux/ldsodefs.h | 12 ------- 2 files changed, 1 insertion(+), 66 deletions(-) diff --git a/sysdeps/unix/sysv/linux/dl-sysdep.c b/sysdeps/unix/sysv/linux/dl-sysdep.c index 4f60cecf98..72aa109f2f 100644 --- a/sysdeps/unix/sysv/linux/dl-sysdep.c +++ b/sysdeps/unix/sysv/linux/dl-sysdep.c @@ -85,21 +85,6 @@ _dl_sysdep_start (void **start_argptr, ElfW(Word) phnum = 0; ElfW(Addr) user_entry; ElfW(auxv_t) *av; -#ifdef HAVE_AUX_SECURE -# define set_seen(tag) (tag) /* Evaluate for the side effects. */ -# define set_seen_secure() ((void) 0) -#else - uid_t uid = 0; - gid_t gid = 0; - unsigned int seen = 0; -# define set_seen_secure() (seen = -1) -# ifdef HAVE_AUX_XID -# define set_seen(tag) (tag) /* Evaluate for the side effects. */ -# else -# define M(type) (1 << (type)) -# define set_seen(tag) seen |= M ((tag)->a_type) -# endif -#endif #ifdef NEED_DL_SYSINFO uintptr_t new_sysinfo = 0; #endif @@ -116,7 +101,7 @@ _dl_sysdep_start (void **start_argptr, "CONSTANT_MINSIGSTKSZ is constant"); GLRO(dl_minsigstacksize) = CONSTANT_MINSIGSTKSZ; - for (av = GLRO(dl_auxv); av->a_type != AT_NULL; set_seen (av++)) + for (av = GLRO(dl_auxv); av->a_type != AT_NULL; av++) switch (av->a_type) { case AT_PHDR: @@ -131,20 +116,7 @@ _dl_sysdep_start (void **start_argptr, case AT_ENTRY: user_entry = av->a_un.a_val; break; -#ifndef HAVE_AUX_SECURE - case AT_UID: - case AT_EUID: - uid ^= av->a_un.a_val; - break; - case AT_GID: - case AT_EGID: - gid ^= av->a_un.a_val; - break; -#endif case AT_SECURE: -#ifndef HAVE_AUX_SECURE - seen = -1; -#endif __libc_enable_secure = av->a_un.a_val; break; case AT_PLATFORM: @@ -183,31 +155,6 @@ _dl_sysdep_start (void **start_argptr, dl_hwcap_check (); -#ifndef HAVE_AUX_SECURE - if (seen != -1) - { - /* Fill in the values we have not gotten from the kernel through the - auxiliary vector. */ -# ifndef HAVE_AUX_XID -# define SEE(UID, var, uid) \ - if ((seen & M (AT_##UID)) == 0) var ^= __get##uid () - SEE (UID, uid, uid); - SEE (EUID, uid, euid); - SEE (GID, gid, gid); - SEE (EGID, gid, egid); -# endif - - /* If one of the two pairs of IDs does not match this is a setuid - or setgid run. */ - __libc_enable_secure = uid | gid; - } -#endif - -#ifndef HAVE_AUX_PAGESIZE - if (GLRO(dl_pagesize) == 0) - GLRO(dl_pagesize) = __getpagesize (); -#endif - #ifdef NEED_DL_SYSINFO if (new_sysinfo != 0) { diff --git a/sysdeps/unix/sysv/linux/ldsodefs.h b/sysdeps/unix/sysv/linux/ldsodefs.h index 011756ddc1..af108991f0 100644 --- a/sysdeps/unix/sysv/linux/ldsodefs.h +++ b/sysdeps/unix/sysv/linux/ldsodefs.h @@ -24,16 +24,4 @@ /* Get the real definitions. */ #include_next -/* We can assume that the kernel always provides the AT_UID, AT_EUID, - AT_GID, and AT_EGID values in the auxiliary vector from 2.4.0 or so on. */ -#define HAVE_AUX_XID - -/* We can assume that the kernel always provides the AT_SECURE value - in the auxiliary vector from 2.5.74 or so on. */ -#define HAVE_AUX_SECURE - -/* Starting with one of the 2.4.0 pre-releases the Linux kernel passes - up the page size information. */ -#define HAVE_AUX_PAGESIZE - #endif /* ldsodefs.h */