VirtualBox

Changeset 60104 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 18, 2016 7:20:19 PM (9 years ago)
Author:
vboxsync
Message:

bugref:8087: Additions/x11: support non-root X server: prevent loading the kernel driver if any of the virtual consoles is in graphics mode to prevent conflicts with user-space drivers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/drm/vbox_drv.c

    r59964 r60104  
    5252#include <linux/module.h>
    5353#include <linux/console.h>
     54#include <linux/vt_kern.h>
    5455
    5556#include <drm/drmP.h>
     
    244245static int __init vbox_init(void)
    245246{
     247    unsigned i;
     248
    246249#ifdef CONFIG_VGA_CONSOLE
    247250    if (vgacon_text_force() && vbox_modeset == -1)
     
    251254    if (vbox_modeset == 0)
    252255        return -EINVAL;
     256
     257    /* Do not load if any of the virtual consoles is in graphics mode to be
     258     * sure that we do not pick a fight with a user-mode driver or VESA. */
     259    for (i = 0; i < MAX_NR_CONSOLES - 1; ++i)
     260        if (vc_cons[i].d->vc_mode == KD_GRAPHICS)
     261            return -EINVAL;
     262
    253263    return drm_pci_init(&driver, &vbox_pci_driver);
    254264}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette