From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19041 invoked from network); 13 Jan 2022 21:57:50 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 13 Jan 2022 21:57:50 -0000 Received: (qmail 13443 invoked by uid 550); 13 Jan 2022 21:57:44 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 12247 invoked from network); 13 Jan 2022 21:57:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642111052; 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=TMX/kWIlUA1AE1kmxxn6oC9JgTpebsg3ohbjH9GEsvI=; b=QCy0z4QKlCt2xk5bhBdER2Um5YkPf6Fu8Tba23UZaZXhCp/Zc1iQompjvFpPRrBHr2i8a0 AsFFdIbvsBLZPAaZZsxKMiODaivolV/fRy4FB3pz8+e5ikzTJrW+ByQ3ulSnnspGEJqy+G vYbuENM8MWr0Yt5+DWAol7lqFtwl8K0= X-MC-Unique: L8FNEgkdMraDDmpSMaBG_A-1 From: Florian Weimer To: Andy Lutomirski Cc: linux-arch@vger.kernel.org, Linux API , linux-x86_64@vger.kernel.org, kernel-hardening@lists.openwall.com, linux-mm@kvack.org, the arch/x86 maintainers , musl@lists.openwall.com, libc-alpha@sourceware.org, linux-kernel@vger.kernel.org, Dave Hansen , Kees Cook , Andrei Vagin References: <3a1c8280967b491bf6917a18fbff6c9b52e8df24.1641398395.git.fweimer@redhat.com> <54ae0e1f8928160c1c4120263ea21c8133aa3ec4.1641398395.git.fweimer@redhat.com> <564ba9d6b8f88d139be556d039aadb4b8e078eba.1641398395.git.fweimer@redhat.com> <4db8cff9-8bf8-0c45-6956-4b1b19b53b2f@kernel.org> Date: Thu, 13 Jan 2022 22:57:20 +0100 In-Reply-To: <4db8cff9-8bf8-0c45-6956-4b1b19b53b2f@kernel.org> (Andy Lutomirski's message of "Thu, 13 Jan 2022 13:31:04 -0800") Message-ID: <87pmovxprz.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Subject: [musl] Re: [PATCH v3 3/3] x86: Add test for arch_prctl(ARCH_VSYSCALL_CONTROL) * Andy Lutomirski: > On 1/5/22 08:03, Florian Weimer wrote: >> Signed-off-by: Florian Weimer > > This seems like a respectable test case, but why does it work so hard > to avoid using libc? Back when this was still a true lockout and not a toggle, it was necessary to bypass the startup code, so that the test still works once the (g)libc startup starts activating the lockout. The /proc mounting is there to support running as init in a VM (which makes development so much easier). I could ditch the /proc mounting, perform some limited data gathering in a pre-_start routine, undo a potential lockout before the tests, and then use libc functions for the actual test. It would probably be a bit less code (printf is nice), but I'd probably have to use direct system calls for the early data gathering anyway, so those parts would still be there. Thanks, Florian