Disable the non-KMS code so that we can enable the hardened build flags

This commit is contained in:
Adam Jackson 2022-02-23 15:07:32 -05:00 committed by Stepan Oksanichenko
parent aa8f7f16ea
commit d9b691a005
5 changed files with 153 additions and 3 deletions

View File

@ -0,0 +1 @@
eb4909a61bb45e1c88ea66f968bc79e55b1239c4 xf86-video-vmware-13.2.1.tar.bz2

View File

@ -0,0 +1,60 @@
From 515aad74707ed978b7ed3744d604b6520df18b3f Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Wed, 23 Feb 2022 14:39:43 -0500
Subject: [PATCH xf86-video-vmware] mustard: Disable the non-KMS support
We don't support it in RHEL and should never be able to hit this. That
part of the driver is the only part requiring vgahw or shadowfb symbols,
neither of which are present at module load time, so the #if 0 work here
keeps any of those symbol references from being linked into the final
driver, after which we can build this driver with full hardening
cflags.
---
src/vmware.c | 2 ++
src/vmware_bootstrap.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/vmware.c b/src/vmware.c
index 12f12ed..1f6007f 100644
--- a/src/vmware.c
+++ b/src/vmware.c
@@ -1642,6 +1642,7 @@ VMWAREValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags)
return MODE_OK;
}
+#if 0
void
vmwlegacy_hookup(ScrnInfoPtr pScrn)
{
@@ -1653,6 +1654,7 @@ vmwlegacy_hookup(ScrnInfoPtr pScrn)
pScrn->FreeScreen = VMWAREFreeScreen;
pScrn->ValidMode = VMWAREValidMode;
}
+#endif
#ifdef XFree86LOADER
void
diff --git a/src/vmware_bootstrap.c b/src/vmware_bootstrap.c
index d7ab070..30e6b86 100644
--- a/src/vmware_bootstrap.c
+++ b/src/vmware_bootstrap.c
@@ -239,7 +239,6 @@ VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
#else
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Driver was compiled without KMS- and 3D support.\n");
-#endif /* defined(BUILD_VMWGFX) */
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Disabling 3D support.\n");
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
@@ -259,6 +258,8 @@ VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
DEVICE_ID(pciInfo));
return (*pScrn->PreInit)(pScrn, flags);
+#endif /* defined(BUILD_VMWGFX) */
+ return FALSE;
};
#if XSERVER_LIBPCIACCESS
--
2.34.1

View File

@ -0,0 +1,19 @@
diff -up xf86-video-vmware-13.2.1/vmwgfx/vmwgfx_output.c.jx xf86-video-vmware-13.2.1/vmwgfx/vmwgfx_output.c
--- xf86-video-vmware-13.2.1/vmwgfx/vmwgfx_output.c.jx 2016-11-15 23:06:33.000000000 -0500
+++ xf86-video-vmware-13.2.1/vmwgfx/vmwgfx_output.c 2022-02-23 15:04:31.494921797 -0500
@@ -33,7 +33,6 @@
#include "xorg-server.h"
#include <xf86drm.h>
-#include <xf86drmMode.h>
#include <xf86str.h>
#include <randrstr.h>
#include <xf86Crtc.h>
@@ -48,6 +47,7 @@
#endif
#include "vmwgfx_driver.h"
+#include <xf86drmMode.h>
/**
* struct output_prop - Structure representing an output property.

View File

@ -0,0 +1,60 @@
From 50ab008cb965dc9e47e0a84a1950e2485bbd3c44 Mon Sep 17 00:00:00 2001
From: Martin Krastev <krastevm@vmware.com>
Date: Tue, 30 Nov 2021 11:47:39 -0800
Subject: [PATCH xf86-video-vmware] vmwgfx: Change header inclusion order to
avoid xorg headers catching stdbool.h
libdrm commit e641e2a632d779f638ac2ba983b9fceb20b3fac4 added
stdbool.h to the library headers which conflicts with xorg headers.
Signed-off-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Signed-off-by: Zack Rusin <zackr@vmware.com>
---
vmwgfx/vmwgfx_driver.h | 6 +++---
vmwgfx/vmwgfx_saa.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/vmwgfx/vmwgfx_driver.h b/vmwgfx/vmwgfx_driver.h
index fa8e308..467fb21 100644
--- a/vmwgfx/vmwgfx_driver.h
+++ b/vmwgfx/vmwgfx_driver.h
@@ -36,15 +36,15 @@
#include <stddef.h>
#include <stdint.h>
#include <errno.h>
-#include <drm.h>
-#include <xf86drm.h>
-#include <xf86drmMode.h>
#include <xorg-server.h>
#include <xf86.h>
#include <xf86Crtc.h>
#include <xf86xv.h>
#include <xa_tracker.h>
#include <xf86Module.h>
+#include <drm.h>
+#include <xf86drm.h>
+#include <xf86drmMode.h>
#include "../src/compat-api.h"
#ifdef DRI2
diff --git a/vmwgfx/vmwgfx_saa.c b/vmwgfx/vmwgfx_saa.c
index 0881e2f..457f397 100644
--- a/vmwgfx/vmwgfx_saa.c
+++ b/vmwgfx/vmwgfx_saa.c
@@ -29,11 +29,11 @@
#include <xorgVersion.h>
#include <mi.h>
#include <fb.h>
-#include <xf86drmMode.h>
#include <xa_context.h>
#include "vmwgfx_saa.h"
#include "vmwgfx_drmi.h"
#include "vmwgfx_saa_priv.h"
+#include <xf86drmMode.h>
/*
* Damage to be added as soon as we attach storage to the pixmap.
--
2.34.1

View File

@ -4,8 +4,6 @@
#global gitdate 20150211
#global gitversion 8f0cf7c
%undefine _hardened_build
%if 0%{?gitdate}
%global gver .%{gitdate}git%{gitversion}
%endif
@ -13,7 +11,7 @@
Summary: Xorg X11 vmware video driver
Name: xorg-x11-drv-vmware
Version: 13.2.1
Release: 17%{?gver}%{?dist}
Release: 18%{?gver}%{?dist}
URL: http://www.x.org
License: MIT
@ -25,6 +23,11 @@ Source0: ftp://ftp.x.org/pub/individual/driver/%{tarball}-%{version}.tar.bz2
Patch0: 0001-saa-Build-compatibility-with-xserver-1.20.patch
# 2044901 - annocheck FAIL: bind-now test (xorg-x11-drv-vmware)
Patch10: 0001-vmwgfx-Change-header-inclusion-order-to-avoid-xorg-h.patch
Patch11: 0001-mustard-fix-more-stdbool.patch
Patch12: 0001-mustard-Disable-the-non-KMS-support.patch
ExclusiveArch: %{ix86} x86_64 ia64
BuildRequires: make
@ -44,6 +47,9 @@ X.Org X11 vmware video driver.
%prep
%setup -q -n %{tarball}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}}
%patch0 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%build
autoreconf -v --install || exit 1
@ -62,6 +68,10 @@ find $RPM_BUILD_ROOT -regex ".*\.la$" | xargs rm -f --
%{_mandir}/man4/vmware.4*
%changelog
* Wed Feb 23 2022 Adam Jackson <ajax@redhat.com> - 13.2.1-18
- Disable the non-KMS code so that we can enable the hardened build flags
Resolves: rhbz#2044901
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 13.2.1-17
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688