From owner-freebsd-current@freebsd.org Thu Mar 4 16:24:44 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 64E80550FA0 for ; Thu, 4 Mar 2021 16:24:44 +0000 (UTC) (envelope-from ctuffli@gmail.com) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (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 4Drx6354nvz4WJP; Thu, 4 Mar 2021 16:24:43 +0000 (UTC) (envelope-from ctuffli@gmail.com) Received: by mail-ed1-f49.google.com with SMTP id h10so35581807edl.6; Thu, 04 Mar 2021 08:24:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=a+OsouHRUnfPG6bcAeXR8k4D908lj81IzaQvrYz3a5A=; b=mWu2MB8f5ensIiVS5PKfBrQboE3HDnYk1ZTgYLNA0pLVfnI/0K+d8dAd7CbnlbQ/63 Qp5/90RYoQCj87kE5v6eThwSJl0/GC05P6e4IGk4hRd0KOwXAMgqPX1bp8Vxot7o5Pjn GWkDMzNuBfZd3wMlysNT55YCK3SuSrbWcFG0fB7roCuXOmd8dfl9ZuMPz3R/d/hKVXJ+ YvtVnObKzNrprY/UnKdz/oDugXM2gl16xZkKx6jyJ7AOnbJeDeJxth9OgaqerlTKSaib VUcWHIUtkytC0nEl+thvGPGKLSKtfaMhYqFNwowDN52b0weh0WhC4f23J9jn/gSWPeFb ylow== X-Gm-Message-State: AOAM531S5zE+E9vB3OzSxJ5xCCXZuHX5aGr5h2qsJx9eefo+FghD5MvQ rXnobau9ndA6eE+fl2umW4osh0rCcgU= X-Google-Smtp-Source: ABdhPJxJmdTKN80merjgeA36fFbK5nj+0UhewyYF9CKnbpVmd3Bdj8F5jIpbx2rS7Tn5ujrUIkGv0w== X-Received: by 2002:a05:6402:4ce:: with SMTP id n14mr5188149edw.309.1614875082267; Thu, 04 Mar 2021 08:24:42 -0800 (PST) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com. [209.85.218.50]) by smtp.gmail.com with ESMTPSA id f17sm24077178edu.28.2021.03.04.08.24.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Mar 2021 08:24:41 -0800 (PST) Received: by mail-ej1-f50.google.com with SMTP id hs11so50561743ejc.1; Thu, 04 Mar 2021 08:24:41 -0800 (PST) X-Received: by 2002:a17:906:1fd2:: with SMTP id e18mr5342348ejt.49.1614875081755; Thu, 04 Mar 2021 08:24:41 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Chuck Tuffli Date: Thu, 4 Mar 2021 08:24:30 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: bhyve fopen failure To: Mark Johnston Cc: FreeBSD-Current Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4Drx6354nvz4WJP X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of ctuffli@gmail.com designates 209.85.208.49 as permitted sender) smtp.mailfrom=ctuffli@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.208.49:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000]; SPAMHAUS_ZRD(0.00)[209.85.208.49:from:127.0.2.255]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.999]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.49:from]; FORGED_SENDER(0.30)[chuck@freebsd.org,ctuffli@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.49:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[chuck@freebsd.org,ctuffli@gmail.com]; 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: Thu, 04 Mar 2021 16:24:44 -0000 On Tue, Mar 2, 2021 at 10:13 AM Mark Johnston wrote: > > 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. Thanks to you both; that did the trick. I was confused as other emulated devices are doing the same thing, but there must be an ordering difference that allows them to work (I assume). --chuck