From nobody Sat Feb 3 16:11:42 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 4TRyM65vNgz59fBB for ; Sat, 3 Feb 2024 16:11:46 +0000 (UTC) (envelope-from paulf2718@gmail.com) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TRyM614gfz4QT5 for ; Sat, 3 Feb 2024 16:11:46 +0000 (UTC) (envelope-from paulf2718@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=MtZehiXN; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of paulf2718@gmail.com designates 2a00:1450:4864:20::331 as permitted sender) smtp.mailfrom=paulf2718@gmail.com Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40fccd09082so8047615e9.2 for ; Sat, 03 Feb 2024 08:11:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706976704; x=1707581504; darn=freebsd.org; h=in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=EmIO7VmnW4Owd43AsoCsu6SF8kDNWHmCvYOfJ/c9bb4=; b=MtZehiXN49UjAGo/BFSixdicl6Xb+bB5jn/U5zWlhsbkCJyxRHlANkD4XRnQGHC+xp RKgL6aiZjCRLovFMECy08rY7G32QTabAm4LGlDzyL1Qw+qAqfuJ4N97rncbXKZWaclA8 PjE7BHGWQoxrzwkRbh7biop64I78L35ZS7j+PppzuxYO796N3KsRZ/55V1XGvJqSLikR seH1iLejd7fk5sIGqwzORv0CnyBDhnEfzOLd3NrEgYJD48S49FTe7rEn3YCncgpzSKN5 q8ucWTPLwg5BCipJZ3BnEG2VSn4pxs9LBLZnKa+3wVqLIo9EmdlohOiQjO2bIe3dTwN4 l9yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706976704; x=1707581504; h=in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=EmIO7VmnW4Owd43AsoCsu6SF8kDNWHmCvYOfJ/c9bb4=; b=jDZq7xZwJDCNrI+KA4RbAApvXkQBNQFyo5yN7YYMnjTwHYOB5Vh7GR8c2hC06y/E24 y7JWhCIJURDYsOS0xjntvugesxbLfFzwXfRY555dgn8XhbG9iPJWDdfl0OxM4pIgIMDU zFeVGLOhYzdXFBEa+oJjy0gb+c6W/2bwaoKu824qlDH4WIMInqODojYRK3cmtx5+CHni 007QUelfYH/PhaWUPqC65D4OF4I7KiSBBnS1xP9mVd7stbu3BOyYGXwtwopfRT7/ONZp YHSNvXvN9CWUCKIh8UWqP96/Du1ygYMJizqfvv5tjN7ag0GQ3QwmUd35MzL4L+CneGd1 P7Lw== X-Gm-Message-State: AOJu0Ywrqf41UDmP1xm6xUNxnZELbZtCiNv+QHH9JDtS9JbEohF5Px0H Lc1kh9a27OlOB6SM0aHEq0W2z/ixIxYpLtN5ECOIxNqNz48jwMh2lGQEMMZR X-Google-Smtp-Source: AGHT+IE81GeYAQISjmYbB/ui5YwgFv92CvpX7f+091uIDpzTh3DZzA3HkIE906o5LoIsDWNwfVDUtA== X-Received: by 2002:a05:600c:5104:b0:40f:d1e4:606d with SMTP id o4-20020a05600c510400b0040fd1e4606dmr897494wms.3.1706976703671; Sat, 03 Feb 2024 08:11:43 -0800 (PST) Received: from [192.168.1.19] ([147.161.183.29]) by smtp.gmail.com with ESMTPSA id l16-20020a05600c4f1000b0040ecdd672fasm3269540wmq.13.2024.02.03.08.11.43 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 03 Feb 2024 08:11:43 -0800 (PST) Content-Type: multipart/alternative; boundary="------------Lzv0HbUPiLaqwaTtWCEXAQwd" Message-ID: <8a34573d-4a6c-4d5d-a771-b39279059547@gmail.com> Date: Sat, 3 Feb 2024 17:11:42 +0100 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 User-Agent: Mozilla Thunderbird Subject: Re: libc/libsys split coming soon To: freebsd-current@freebsd.org References: Content-Language: en-US From: Paul Floyd In-Reply-To: X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.99 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; XM_UA_NO_VERSION(0.01)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::331:from] X-Rspamd-Queue-Id: 4TRyM614gfz4QT5 This is a multi-part message in MIME format. --------------Lzv0HbUPiLaqwaTtWCEXAQwd Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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? > 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. > 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? A+ Paul --------------Lzv0HbUPiLaqwaTtWCEXAQwd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


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?

  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.

  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?

A+

Paul

--------------Lzv0HbUPiLaqwaTtWCEXAQwd--