From nobody Mon Feb 5 16:02:19 2024 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TTB3Q2RGCz58TVy for ; Mon, 5 Feb 2024 16:02:26 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TTB3P4rWjz4KL6 for ; Mon, 5 Feb 2024 16:02:25 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=freebsd.org (policy=none); spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 0E3ED3C019A; Mon, 5 Feb 2024 16:02:19 +0000 (UTC) Date: Mon, 5 Feb 2024 16:02:19 +0000 From: Brooks Davis To: Paul Floyd Cc: freebsd-current@freebsd.org Subject: Re: libc/libsys split coming soon Message-ID: References: <8a34573d-4a6c-4d5d-a771-b39279059547@gmail.com> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8a34573d-4a6c-4d5d-a771-b39279059547@gmail.com> X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.60 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : No valid SPF, No valid DKIM,none]; ONCE_RECEIVED(0.10)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_ONE(0.00)[1]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FREEFALL_USER(0.00)[brooks]; ARC_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; R_DKIM_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_TLS_LAST(0.00)[]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; R_SPF_NA(0.00)[no SPF record] X-Rspamd-Queue-Id: 4TTB3P4rWjz4KL6 On Sat, Feb 03, 2024 at 05:11:42PM +0100, Paul Floyd wrote: > > On 02/02/2024 23:31, Brooks Davis wrote: > > TL;DR: The implementation of system calls is moving to a seperate > > library (libsys). No changes are required to existing software (except > > to ensure that libsys is present when building custom disk images). > > > > Code:https://github.com/freebsd/freebsd-src/pull/908 > > > > After nearly a decade of intermittent work, I'm about to land a series > > of patches which moves system calls, vdso support, and libc's parsing of > > the ELF auxiliary argument vector into a separate library (libsys). I > > plan to do this early next week (February 5th). > > > > This change serves three primary purposes: > > 1. It's easier to completely replace system call implementations for > > tracing or compartmentalization purposes. > > Will that affect code that makes syscalls without currently linking to libc? Such programs might be broken in these environments but it would depend a lot on the details of both the program and the replacement syscall layer. > > 2. It simplifies the implementation of restrictions on system calls such > > as those implemented by OpenBSD's msyscall(2) > > (https://man.openbsd.org/msyscall.2). > > That's one to ignore for tools that make syscalls outside of the libc memory > mapping. Should someone implement msyscall(2) there will certainly be an opt out mechanism along the usual lines that uses elfctl and procctl. > > 3. It allows language runtimes to link with libsys for system call > > implementations without requiring libc. > > I see that pagesize is on the list of functions that are moving. There are a > couple of other functions that might cause me problems if libc isn't linked. > > Could you do a quick test with an exe linked to libsys but not libc running > under Valgrind memcheck, please? Could you suggest a more concrete example? -- Brooks