freebsd-skq/usr.sbin/bhyve
robak 746101149f bhyve: avoid applying capsicum capabilities to file that was not opened
When using -l option targeting file that can't be opened (ie. nmdm module
is not loaded and /dev/nmdm* is specified) bhyve tries to apply capsicum
capabilities to a file that was not opened.

Enclose that code in an if statement and only run it on correctly opened
descriptor also providing meaningful message in case of an error.

Submitted by:	Pawel Biernacki <pawel.biernacki@gmail.com>
Reviewed by:	grehan, emaste
Sponsoied by:	Mysterious Code Ltd.
Differential Revision:	D12985
2017-11-11 22:50:14 +00:00
..
acpi.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
acpi.h Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
ahci.h Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
atkbdc.c Import bhyve_graphics into CURRENT. Thanks to all who tested 2016-07-04 03:19:06 +00:00
atkbdc.h Import bhyve_graphics into CURRENT. Thanks to all who tested 2016-07-04 03:19:06 +00:00
bhyve.8 Bump manpage date. 2017-06-02 02:37:17 +00:00
bhyvegc.c bhyvegc_resize: make use of reallocarray(3) for bounds-checking. 2017-05-24 14:24:47 +00:00
bhyvegc.h Import bhyve_graphics into CURRENT. Thanks to all who tested 2016-07-04 03:19:06 +00:00
bhyverun.c Capsicum support for bhyve(8). 2017-02-14 13:35:59 +00:00
bhyverun.h Fix CTASSERT issue in a more clean way 2016-07-06 16:02:15 +00:00
block_if.c Capsicum support for bhyve(8). 2017-02-14 13:35:59 +00:00
block_if.h Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
bootrom.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
bootrom.h Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
console.c Import bhyve_graphics into CURRENT. Thanks to all who tested 2016-07-04 03:19:06 +00:00
console.h Import bhyve_graphics into CURRENT. Thanks to all who tested 2016-07-04 03:19:06 +00:00
consport.c bhyve: whitespace fix for r313727 2017-02-14 16:49:32 +00:00
dbgport.c Capsicum support for bhyve(8). 2017-02-14 13:35:59 +00:00
dbgport.h Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
fwctl.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
fwctl.h Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
inout.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
inout.h Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
ioapic.c Make PCI interupts allocation static when using bootrom (UEFI). 2016-07-14 17:16:10 +00:00
ioapic.h Make PCI interupts allocation static when using bootrom (UEFI). 2016-07-14 17:16:10 +00:00
Makefile Add VNC Authentication support based on RFC6143 section 7.2.2. 2017-06-02 02:35:16 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
mem.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
mem.h Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
mevent_test.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
mevent.c Capsicum support for bhyve(8). 2017-02-14 13:35:59 +00:00
mevent.h Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
mptbl.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
mptbl.h Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
pci_ahci.c Fix variable for sizeof() in previous commit. 2017-04-02 20:57:59 +00:00
pci_e82545.c bhyve/pci_e82545.c: squelch gcc warning for noreturn procedure 2017-07-28 21:42:59 +00:00
pci_emul.c Make PCI interupts allocation static when using bootrom (UEFI). 2016-07-14 17:16:10 +00:00
pci_emul.h Add emulation for multiple (up to 16) MSI vectors for AHCI. 2016-07-08 21:30:18 +00:00
pci_fbuf.c Add VNC Authentication support based on RFC6143 section 7.2.2. 2017-06-02 02:35:16 +00:00
pci_hostbridge.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
pci_irq.c Make PCI interupts allocation static when using bootrom (UEFI). 2016-07-14 17:16:10 +00:00
pci_irq.h Make PCI interupts allocation static when using bootrom (UEFI). 2016-07-14 17:16:10 +00:00
pci_lpc.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
pci_lpc.h Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
pci_passthru.c We need CAP_MMAP_RW on memfd, since init_msix_table() may call mmap(). 2017-04-27 05:48:52 +00:00
pci_uart.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
pci_virtio_block.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
pci_virtio_console.c Capsicum support for bhyve(8). 2017-02-14 13:35:59 +00:00
pci_virtio_net.c Capsicum support for bhyve(8). 2017-02-14 13:35:59 +00:00
pci_virtio_rnd.c Capsicum support for bhyve(8). 2017-02-14 13:35:59 +00:00
pci_xhci.c Make comments match the code. No functional change. 2017-04-28 05:09:51 +00:00
pci_xhci.h Import bhyve_graphics into CURRENT. Thanks to all who tested 2016-07-04 03:19:06 +00:00
pm.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
post.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
ps2kbd.c Implement right shift/ctl, and convert the VNC/xorg scancode 2016-07-11 06:31:15 +00:00
ps2kbd.h Import bhyve_graphics into CURRENT. Thanks to all who tested 2016-07-04 03:19:06 +00:00
ps2mouse.c Make sure the 'Always-one' bit is always set to one, 2017-01-08 20:29:35 +00:00
ps2mouse.h Import bhyve_graphics into CURRENT. Thanks to all who tested 2016-07-04 03:19:06 +00:00
rfb.c Check if pthread_create(3) successfully created the thread prior to call 2017-06-16 01:26:01 +00:00
rfb.h Add VNC Authentication support based on RFC6143 section 7.2.2. 2017-06-02 02:35:16 +00:00
rtc.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
rtc.h Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
smbiostbl.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
smbiostbl.h Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
sockstream.c Import bhyve_graphics into CURRENT. Thanks to all who tested 2016-07-04 03:19:06 +00:00
sockstream.h Import bhyve_graphics into CURRENT. Thanks to all who tested 2016-07-04 03:19:06 +00:00
spinup_ap.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
spinup_ap.h Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
task_switch.c Fix CTASSERT issue in a more clean way 2016-07-06 16:02:15 +00:00
uart_emul.c bhyve: avoid applying capsicum capabilities to file that was not opened 2017-11-11 22:50:14 +00:00
uart_emul.h Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
usb_emul.c Import bhyve_graphics into CURRENT. Thanks to all who tested 2016-07-04 03:19:06 +00:00
usb_emul.h Import bhyve_graphics into CURRENT. Thanks to all who tested 2016-07-04 03:19:06 +00:00
usb_mouse.c This fixes a typo in bhyve's USB mouse emulation. 2017-03-22 16:53:03 +00:00
vga.c bhyve/vga.c: fix atc_color_select_67 bit shift 2017-07-28 21:47:10 +00:00
vga.h Import bhyve_graphics into CURRENT. Thanks to all who tested 2016-07-04 03:19:06 +00:00
virtio.c Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00
virtio.h Use correct PCI device id for virtio-rng. 2017-01-08 20:58:58 +00:00
xmsr.c Update several more URLs 2017-10-29 08:17:03 +00:00
xmsr.h Create branch for bhyve graphics import. 2016-05-27 06:22:24 +00:00