From nobody Tue Jun 02 18:19:50 2026 X-Original-To: freebsd-hackers@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 4gVJyc1wJdz6g4rH; Tue, 02 Jun 2026 18:19:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gVJyc1Bpqz46LF; Tue, 02 Jun 2026 18:19:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780424392; 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: content-transfer-encoding:content-transfer-encoding; bh=KNlIBe3JIgKol9JN5Hviz4W7moOFct6P+gQiazX+wu4=; b=Rtc7n0AQAF5VwiAwU6qm51PmsvHgMQOEjCeBJ4Rpjjq64BecuccK6gMyu48utUwuM2jle2 o7HdqcTTDtiGEK0Yjjch3jB7Zt6M6PQchqVMpw56w4tvF10Mx/5TfyQupsRQ4+8V6ks7dI zsLDbuEeu4v5OUsh6SURlp9SJwWH2SF5Zi87aKBmGPuD7esm6uGQNYlLKOhttG/462ZTGq BAzYgEYnSgpfBDlIxDPY4xepz/rtDATffCpCrMbF6wBrk98TSnezYe/y8k9Bi1+MidiWBA gxJwvvNJEjpiGEcbjwCXvd84OfV0mdfqB7aysVtgHjQGDPCjEBFwF4HoOpmwYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780424392; a=rsa-sha256; cv=none; b=PlAspx4yZvVDxkC2w9ScQTcfY5dmQWVKUCdmGCd903UwT0oanIW6QKWKlZKdBRjvoIM2sN 5mBXQ0G6ddZjr6nck8LeVBZ8amVnA2LdCJDeLMgSvqx1nWNpHPhBmzYy0J04pvVsCTEpCj K5Hea9Vp77+8v4Z7Ofcjt6A2o7r2qvE58M/0axFqvlRB+8BFjqd4MypMQCzBPHQdwiUrlR 9gC0tCnpbvL2RBindu1C5CJvaY6zlby2Uqt5u14aSBlrSZGvLOvEhcql3AMD2kFz5wnac5 PLZ21mRwskB/1U8gJubmcesXU2PplE3T8FHwGNik2Q+1xxoWfYyz8Gtd7TuP8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780424392; 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: content-transfer-encoding:content-transfer-encoding; bh=KNlIBe3JIgKol9JN5Hviz4W7moOFct6P+gQiazX+wu4=; b=EAmliNRU2gXhmC8Buz3u9YGUN9x61/4mQ0iwj5LVwSFQBr2gqN45MJhfLbcKJronwMcjeS OA9yu+OBtLzUdFMkHgB3mQD4l+KxFyhYQhWMS/xZPiYUKqEVUVxUjSwJ6F7AQWOiqmZFHp vuzz5BmBHAbl/FSKbNH79Q1mhdXqalFz2RU1kte7hJ9kga7zWm+Y2MZa5taHaoPW1uvOTr awlnipVayLPt5K1XVQZzakY/ETlRechh2ybbT1qKtBuK05A+2vNOiX91BIDsPKDLQZlg52 aoa4UO/WTq4zjKMbAdjhwBZeZzbeJJHPkR8yGtw6nJD1VyLbrjl5LlNc/Ct2gA== Received: from [10.9.4.95] (unknown [209.182.120.176]) (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 did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4gVJyb4TCVz12jV; Tue, 02 Jun 2026 18:19:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <7f5f2137-bd4d-4e27-8049-cf585849103e@FreeBSD.org> Date: Tue, 2 Jun 2026 13:19:50 -0500 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: "freebsd-hackers@FreeBSD.org" , freebsd-arch@freebsd.org From: Kyle Evans Subject: rights(4) split? CAP_WRITE -> CAP_WRITE_DATA + CAP_WRITE_CTRL Cc: pjd@FreeBSD.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, I'm looking at an application where it would be useful to be able to construct a socketpair(2) that can't be used to send fds over, out of an abundance of caution. The application in prison0 is effectively a broker between two jails that it hands each an end of the socketpair, then steps out of the way -- I don't see a reason to leave it capable of carrying SCM_RIGHTS. I'd like to propose splitting CAP_WRITE into CAP_WRITE_DATA and CAP_WRITE_CTRL, with CAP_WRITE being an alias for DATA|CTRL. The caveat is that I don't know if being able to revoke data but not control messages is really feasible or useful, off-hand. In any event, my plan would be to use the last bit available in rights idx 0 for the CTRL right, rename the current CAP_WRITE to CAP_WRITE_DATA, and create a new CAP_WRITE name for the two combined. There's some chance for breakage in applications that haven't been rebuilt with the new definition of CAP_WRITE, but I suspect most of them aren't attempting to send control messages. The in-kernel users of CAP_WRITE look like they could mostly be scoped down to CAP_WRITE_DATA specifically, though maybe that gets a little awkward in `flags_to_rights` mapping of O_WRONLY/O_RDWR. Thoughts? Terrible idea? Thanks, Kyle Evans