From owner-freebsd-hackers@freebsd.org Mon Apr 26 17:40:06 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED5305E99D7 for ; Mon, 26 Apr 2021 17:40:06 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTXGZ3pH3z3tSv for ; Mon, 26 Apr 2021 17:40:06 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x730.google.com with SMTP id z2so20341922qkb.9 for ; Mon, 26 Apr 2021 10:40:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=9kySJDUPuqASOo2DEGsCHjXGsIo9DS4rwXq+rXdb4yQ=; b=OcVRsNKBo0McAG9EmOHDHOaLRAu0LrmGnZ6lq72nYMi9/vnVvLh0MBQTYk5MxgF25u HxEoE53e0mssXHABLWyPToy8mTh+U9NRj2pbd6b5LwXc0lP5WGOhQQhUzWj44cvIHgjx VkHoAZ3pYSFbcs9zFL0Yk72Za9QV1nejy6YCZGPFcm6TveoJUKzc2MbRKQ/CXluw9oiK XDe/sqJipUquNpCnpcZn4UkYU289EDWCZSIBCxXiqmBjGUZJPp8wrJL3w4ZGK3meVnzh rZ5mnnKagNu9MqzpI3STZprcQsoIBh+24CyJVAHm52nzLdRMAxeWdJEI0wXlLE0gS9j7 BGeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=9kySJDUPuqASOo2DEGsCHjXGsIo9DS4rwXq+rXdb4yQ=; b=FK8Gl1BCZVpuuWx+qY8PS+gleSpen/OpE1D+gNYfqya9flyxA4T2g2eMtODJQOXgkO 2O1fwjPnwgAk14S0+0ga8HlmrvA5Q+/fGfaRLyJLC30S+5/PiTNLE+EFiFWGzzPJmnX4 NlOXfQKKgSKVF3m+Mkyl/M6BmOBqipLWXFcVxB+Rg1/8BAPb9AMC/BiO9+WMOTbosOmz va8MWNXoXSg0hzes1HplCd+J3TQKgPrGvvK44TgFrxVrUWDIZOOTa6+93F4wMNuTaCV5 cBVa3+GCftbgkU7npPmdc3a6yhtBBV99kSx1PhlyumwCEp0tpUYDh09hzCtvI+mdP8tE JuvQ== X-Gm-Message-State: AOAM530JZngZ9goJHvCmH+5hsyCY48vC2sMXTqMhDmj4glyCzq0XZaMV +VgotDxplxU1MbNbk+NLOHw= X-Google-Smtp-Source: ABdhPJyfC29G6MjvNCXWob9z6GQZEq+s/THxi4wTWUA4ZwL5LnrAXZGqfrXCK0PQMDV7EnGcZn9Z8w== X-Received: by 2002:a37:a48a:: with SMTP id n132mr18290747qke.199.1619458805933; Mon, 26 Apr 2021 10:40:05 -0700 (PDT) Received: from nuc ([142.126.164.150]) by smtp.gmail.com with ESMTPSA id f16sm4507775qtq.43.2021.04.26.10.40.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Apr 2021 10:40:05 -0700 (PDT) Sender: Mark Johnston Date: Mon, 26 Apr 2021 13:39:52 -0400 From: Mark Johnston To: =?utf-8?B?SW9udcib?= Mihalache Cc: freebsd-hackers@freebsd.org Subject: Re: cap_sysctlbyname for hw.vmm.destroy Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Queue-Id: 4FTXGZ3pH3z3tSv X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=OcVRsNKB; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::730 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-2.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::730:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::730:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::730:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 17:40:07 -0000 On Mon, Apr 26, 2021 at 05:16:14PM +0300, IonuČ› Mihalache wrote: > Hello, > > I am working on adding capsicum support for the bhyve snapshot feature. At > the end of the suspend process, the guest should be destroyed and the code > handles this part with a sysctlbyname call which is not working in > capability mode. I don't know what is the problem but even when using > cap_sysctlbyname I still get the same error code (EPERM). I tried the > example from the documentation aswell [1] and still the same error code. > What could be the problem? I have a FreeBSD13 host and a FreeBSD13 guest. I'm not sure why it would happen unless the casper process is somehow running as a non-root user. Can you share the code you're testing somewhere?