From owner-freebsd-current@freebsd.org Tue Mar 2 18:13:18 2021 Return-Path: Delivered-To: freebsd-current@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 7A16054A901 for ; Tue, 2 Mar 2021 18:13:18 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (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 4DqlcF5wL6z4pNp; Tue, 2 Mar 2021 18:13:17 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x72f.google.com with SMTP id z190so21192332qka.9; Tue, 02 Mar 2021 10:13:17 -0800 (PST) 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:in-reply-to; bh=arXLROydBs/mu2ss1g3QV3xroz2PxKL9NND9DMQRDMQ=; b=ItITc9GJyGBXl9+/Vlgt3iv3DW3x8+oPaJDBKeBOEVGBiTQKEMFjL6JAZ/v6fqbaab h6F3djgrgIfIu6mOgjupXfHnHf1GtnyFAMvAu9LvuMgQQ+vFgQmW3hiCIk/vsMFrEUzy DQrULrJsyYBsoyCMxnaO6eCoFhGnhofd1p9XtC6dVy7WdTCQY2CJBXyPJ5Vfz4XFOsn/ 5L7qw2YksyHC0MWM3VrDA8BaWPyj2M4FVhbJy4ATjdKg+n2qoB+5bcMbL223yQ+lXHRF aQMYbQxq3mgn5Ki2+doR4R4do1ozs5ihfjudSg5Z0npgnz8e9NaA8Koi9lHLJW5tKsbu 1dAw== 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:in-reply-to; bh=arXLROydBs/mu2ss1g3QV3xroz2PxKL9NND9DMQRDMQ=; b=nv/AnsLOQ8Sie7B0Gu8JFeYLy5eRTyt1/Cx/rW6+2wF+n/yQyAZqIIShr7YN2XVsPW Xr4HJuui2MMA9HLne31STVHDX+o4Okv9rNj9sRah+QSX/mMzJGt4kpWwhMcnqJMdKzB7 +Ugv4x5H2dVYa9ZT0LiMqF3o3GOhjCf2TNHd9orRWqILQzpGFasL0aCS4SCDyQLCUDZ4 +63nhiGw8CVdOZl18kUIa2+gGbJPXexN/LON8V5Xkl/x/s4zSUTdS6ntUoQm9nmVF5Wm GvW1hUkI4RpkyrW7e/liHElcnh3X6PtsfWA5/7ulxKEZzL6dTpP1T4ZWff+vu4rab9dM Iv+g== X-Gm-Message-State: AOAM533CXuVIhnZjU46qbOaFOzoVkA4E6Yo/ylJ2/KMTsydKeEk67MPl Jmk92SC8hawYi4ZAijVm1AIaJwDaw9c= X-Google-Smtp-Source: ABdhPJyNZ6dKjhfzlnWi4oOTsD4l+0lieloRHJuN5iBxRko7ETjyk1yHFheJAYVgUzUdckDn/u1Qag== X-Received: by 2002:a37:484f:: with SMTP id v76mr20168094qka.312.1614708796562; Tue, 02 Mar 2021 10:13:16 -0800 (PST) Received: from nuc ([142.126.164.150]) by smtp.gmail.com with ESMTPSA id u35sm8683458qtb.18.2021.03.02.10.13.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 10:13:16 -0800 (PST) Sender: Mark Johnston Date: Tue, 2 Mar 2021 13:13:16 -0500 From: Mark Johnston To: Chuck Tuffli Cc: FreeBSD-Current Subject: Re: bhyve fopen failure Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4DqlcF5wL6z4pNp X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=ItITc9GJ; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::72f as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [0.62 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::72f:from]; 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]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_SPAM_MEDIUM(0.33)[0.329]; NEURAL_SPAM_SHORT(0.99)[0.994]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::72f:from:127.0.2.255]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::72f:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-current] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 18:13:18 -0000 On Tue, Mar 02, 2021 at 09:31:22AM -0800, Chuck Tuffli wrote: > I'm porting some code to bhyve and am getting a failure I don't > understand. This is git as of af11c2029006 FWIW. > > The code in question is for an emulated device and looks like: > dbg = fopen("/tmp/bhyve_ata.log", "w+"); > if (dbg == NULL) > perror("fopen"); > > Running this fails with: > fopen: Not permitted in capability mode > Googling suggests this might be capsicum related. If so, what do I > need to change to allow writes to a debug file? You would need to either open the file in the driver's initialization routine, which I believe is executed before bhyve enters capability mode, or add -DWITHOUT_CAPSICUM to the bhyve CFLAGS and recompile.