From nobody Tue Oct 21 22:18:34 2025 X-Original-To: dev-commits-src-all@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 4crmsc6WYbz6D6Kr for ; Tue, 21 Oct 2025 22:18:44 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4crmsc4VZpz3FFt for ; Tue, 21 Oct 2025 22:18:44 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-4e88cd19bc5so6671881cf.3 for ; Tue, 21 Oct 2025 15:18:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761085119; x=1761689919; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=wuXORG2bAoeV/UCX4A3LHwY2OsSKt5lEjCEc0FFrBQQ=; b=SjPSCDaZp4Zq2ON1ToDI3RxxnqUp6jlEZ62ih45CNsRGEmzAQt8CI30Q0SW/SVu2+y 92wPU/LZIw0KYgH5Jn76JwbtzZCy7Oi+KgoVgOQSjJBxcgX3qSuUxpV2B8JgDdXH84vA Cs9GEXqlbIFsedkfKthrDNhA/tfwAYLGKgfxwnESLDXDFsQAqlTBcLItzLHbqXSogVQH UAgy4cRP/RHMXPOx6Z3kG/aYfrBeteW7XuAfaKROER1BQi1JH9Bz7/iooPldSzSZvR+v GFYY9x6gmMGq7Rai3rQwF4OpHeDA7+sAuMyK5rmQovSFjLo38SMsMT1cTSLtT5o8S2ek NX8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761085119; x=1761689919; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wuXORG2bAoeV/UCX4A3LHwY2OsSKt5lEjCEc0FFrBQQ=; b=QG0r30x+N4gBSmHx48YhMP/mlt4uH27KeOHLAROGSZ7W2P7tZo5jmB92pjSzecck67 fYNKEuSqomUEBtPENoQlrylj5E6AEG3sorZLb1LfKTiOkKZQI5UfVRWmOc0o7BmBIhaX f4IzE9rnaUdP9tzm3gCZ7ByNLE2xZpjTKTkqxPtEr5DtHr4a+52EAOt15p0tQGdgxGqL c3op79Evt8Sz9w5sqp53dMnywZkdjl/Xna1cKGcvg4n2CnPAXMQtN6TaR7U57XVKxS4T COnoCOqhGirynr1O2g4nS9K94K0kn7MhS6B+gLPjXgcVEW9gOWVqvQ5VM2KaiTAC843A uiUQ== X-Forwarded-Encrypted: i=1; AJvYcCUGUOBGXuV5JgYKT+HcBaWvqvl02G9+0W/qtZ+yWFeLDgMy8PVcnttACwryk0ALEqRNW12nObOz2X0rzt8aGtn1f20A@freebsd.org X-Gm-Message-State: AOJu0YypFDDV+gdr6TReAXB+KkjN3J93tzMq2qaROaVv/l4Cv16OElCO loDcuXOC2M1HePgGPVvW5uR7lVWieiSIdBnjNJVOaOluKiHAoWOk48hg X-Gm-Gg: ASbGncu74U9fUN5dNlf+HKksx7y7l85Z9wn+ZZ9FPbCtfodaiMCvKKkY6V5hkcMvP42 ZpN/ifBRCiJDHVpeZHZI8mjTkZ4urqk2cA/nAglFwyQhZ+uuXns+Nu6AEP8/XFU1YuPNAOBFXxV 3dcYjl4Jqdu/zEGmUlkeMZTXVWN/7BNO/28IuioP2oOEH5gAMoOS24r0tw54YFeBCMFG8L3XeNk iOgVoPiOwQ/9M3HoVMycZGOuuNQUP1qHFEJcFQBhAnsZplxZUx38ZgsLKE+0nvkTApVB55fI5b1 kGigKQYaV2QQPTc2OviATXfB5n8ywqmbK9wV3pj/H3kF447HDLyRaw2umWUMF7W/b9/8y9gcJLx allf9Ssy+hsj4rMGJd9K8oL0CV1FXg7Fbd7mBU7NLfz8nXcDP9uvINBV2sEqnC1j/FEBq1xrB48 T9VDCTS2KN+WP5qPDjnw== X-Google-Smtp-Source: AGHT+IFm6vIF7dxAQRbzeaeBovGWt8Vts2kVLJbeK2QG2YEUP1ZIji5L9+NJ2FwaONI01i694KiHmA== X-Received: by 2002:ac8:5646:0:b0:4e8:9f18:6e5e with SMTP id d75a77b69052e-4e89f187138mr160277451cf.33.1761085118655; Tue, 21 Oct 2025 15:18:38 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4e8af0126a9sm77979121cf.12.2025.10.21.15.18.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Oct 2025 15:18:37 -0700 (PDT) Date: Tue, 21 Oct 2025 18:18:34 -0400 From: Mark Johnston To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e11768e94787 - main - vmm: Add PRIV_DRIVER checks for passthru ioctls Message-ID: References: <202510211749.59LHnJ49029334@gitrepo.freebsd.org> <5pr96847-3p44-6043-50o4-4np23n9022q3@mnoonqbm.arg> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5pr96847-3p44-6043-50o4-4np23n9022q3@mnoonqbm.arg> X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4crmsc4VZpz3FFt On Tue, Oct 21, 2025 at 09:02:59PM +0000, Bjoern A. Zeeb wrote: > On Tue, 21 Oct 2025, Mark Johnston wrote: > > > The branch main has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=e11768e94787bef2866486ba8616353716a10447 > > > > commit e11768e94787bef2866486ba8616353716a10447 > > Author: Mark Johnston > > AuthorDate: 2025-10-21 17:34:29 +0000 > > Commit: Mark Johnston > > CommitDate: 2025-10-21 17:34:29 +0000 > > > > vmm: Add PRIV_DRIVER checks for passthru ioctls > > > > In preparation for allowing non-root users to create and access bhyve > > VMs, add privilege checks for ioctls which operate on passthru devices. > > Does this mean we need to have a way to give a user a priveledge in order > to also use pssthru (likely not easily possible currently; different longer > topic I am happy to talk about as it came up elsewhere recently). > > That said if we go there I think DRIVER may be a dangerous priveledge > but then again the user may need to setup interfaces for networking just > as well which is kind of orthotognal to the system administration concept. > > Giving a user PRIV_DRIVER is likely never ever going to be a good idea given > the catchall it is used as so we one day might need a more flexible, more > finegrained system ... > > > So in conclusion what your commit message is saying (if I understand it right): > a user will be allowed to start bhyve but not be allowed to use certain features, > like passthru? That's right. I'd like to make it possible to create and run bhyve VMs as an unprivileged user (provided that they belong to an as-yet uncreated "vmm" group), but passthru functionality will remain root-only. > > Reviewed by: corvink > > MFC after: 2 weeks > > Sponsored by: The FreeBSD Foundation > > Sponsored by: Klara, Inc. > > Differential Revision: https://reviews.freebsd.org/D53144 > > --- > > sys/amd64/vmm/vmm_dev_machdep.c | 18 +++++++++++------- > > sys/dev/vmm/vmm_dev.c | 7 +++++++ > > sys/dev/vmm/vmm_dev.h | 1 + > > 3 files changed, 19 insertions(+), 7 deletions(-) > > -- > Bjoern A. Zeeb r15:7