From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id DDD6B3858D28 for ; Tue, 17 Jan 2023 07:57:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DDD6B3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673942264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zcisb5BI6CMfASRkFHN3fBGYG0HmgZdYtE85r16KPOg=; b=YIvDJaD7hxbtAAPITfkGI2Tm8pBD3nC7RzeKu8Nap2/6H4Vo5/7+04dfPNQOfVyZ3G5PGJ L8anukFj5qDDiyK9LQFfpxMMEea0MvMOYiqZ21zW0B8qCGEutWoaWVzILfw3dUIYpCfHfP g5ViHv80KukBq56005UcJERhJZF5tGU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-158-keA0sr66M0-9lX0VL-cscg-1; Tue, 17 Jan 2023 02:57:40 -0500 X-MC-Unique: keA0sr66M0-9lX0VL-cscg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9B04B101B429; Tue, 17 Jan 2023 07:57:40 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.82]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2A6EE40C2064; Tue, 17 Jan 2023 07:57:40 +0000 (UTC) From: Florian Weimer To: Joel Molin via Libc-help Cc: Joel Molin Subject: Re: Why does _dl_protect_relro align the end address down? References: Date: Tue, 17 Jan 2023 08:57:38 +0100 In-Reply-To: (Joel Molin via Libc-help's message of "Mon, 16 Jan 2023 13:26:28 -0800") Message-ID: <87zgah7fv1.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Joel Molin via Libc-help: > Since mprotect will protect entire pages anyway, wouldn't it make a lot > more sense here to say `end = ALIGN_UP(...)`? Apart from feeling more > intuitive, it also seems like it would avoid page size inconsistencies > between runtime and link editing like the one above. ALIGN_UP might make memory read-only that should not be. There's some discussion about the alignment here: PT_GNU_RELRO is somewhat broken I still think this is fairly broken, but there does not seem to be much desire to fix it. Thanks, Florian