Blame SOURCES/kvm-hw-arm-virt-Remove-the-dtb-kaslr-seed-machine-option.patch

29b115
From 69f771c3dc641431f3e98497cbd3832edb69284f Mon Sep 17 00:00:00 2001
29b115
From: Eric Auger <eric.auger@redhat.com>
29b115
Date: Tue, 3 May 2022 08:56:52 +0200
29b115
Subject: [PATCH 1/5] hw/arm/virt: Remove the dtb-kaslr-seed machine option
29b115
29b115
RH-Author: Eric Auger <eric.auger@redhat.com>
29b115
RH-MergeRequest: 82: hw/arm/virt: Remove the dtb-kaslr-seed machine option
29b115
RH-Commit: [1/2] a89dcd7f22e04ae39de99795d3f34cdd0b831bc0 (eauger1/centos-qemu-kvm)
29b115
RH-Bugzilla: 2046029
29b115
RH-Acked-by: Gavin Shan <gshan@redhat.com>
29b115
RH-Acked-by: Andrew Jones <drjones@redhat.com>
29b115
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
29b115
29b115
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2046029
29b115
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=45133161
29b115
Upstream Status: RHEL-only
29b115
Tested: Boot RHEL guest and check the option is not available
29b115
29b115
In RHEL we do not want to expose the dtb-kaslr-seed virt machine
29b115
option. Indeed the default 'on' value matches our need as
29b115
random data in the DTB does not cause any boot failure and we
29b115
want to support KASLR for the guest.
29b115
29b115
Signed-off-by: Eric Auger <eric.auger@redhat.com>
29b115
29b115
---
29b115
---
29b115
 hw/arm/virt.c | 11 +++--------
29b115
 1 file changed, 3 insertions(+), 8 deletions(-)
29b115
29b115
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
29b115
index e06862d22a..bde4f77994 100644
29b115
--- a/hw/arm/virt.c
29b115
+++ b/hw/arm/virt.c
29b115
@@ -2350,6 +2350,7 @@ static void virt_set_its(Object *obj, bool value, Error **errp)
29b115
     vms->its = value;
29b115
 }
29b115
 
29b115
+#if 0 /* Disabled for Red Hat Enterprise Linux */
29b115
 static bool virt_get_dtb_kaslr_seed(Object *obj, Error **errp)
29b115
 {
29b115
     VirtMachineState *vms = VIRT_MACHINE(obj);
29b115
@@ -2363,6 +2364,7 @@ static void virt_set_dtb_kaslr_seed(Object *obj, bool value, Error **errp)
29b115
 
29b115
     vms->dtb_kaslr_seed = value;
29b115
 }
29b115
+#endif /* disabled for RHEL */
29b115
 
29b115
 static char *virt_get_oem_id(Object *obj, Error **errp)
29b115
 {
29b115
@@ -3346,13 +3348,6 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data)
29b115
                                           "Override the default value of field OEM Table ID "
29b115
                                           "in ACPI table header."
29b115
                                           "The string may be up to 8 bytes in size");
29b115
-
29b115
-    object_class_property_add_bool(oc, "dtb-kaslr-seed",
29b115
-                                   virt_get_dtb_kaslr_seed,
29b115
-                                   virt_set_dtb_kaslr_seed);
29b115
-    object_class_property_set_description(oc, "dtb-kaslr-seed",
29b115
-                                          "Set off to disable passing of kaslr-seed "
29b115
-                                          "dtb node to guest");
29b115
 }
29b115
 
29b115
 static void rhel_virt_instance_init(Object *obj)
29b115
@@ -3397,7 +3392,7 @@ static void rhel_virt_instance_init(Object *obj)
29b115
     /* MTE is disabled by default and non-configurable for RHEL */
29b115
     vms->mte = false;
29b115
 
29b115
-    /* Supply a kaslr-seed by default */
29b115
+    /* Supply a kaslr-seed by default and non-configurable for RHEL */
29b115
     vms->dtb_kaslr_seed = true;
29b115
 
29b115
     vms->irqmap = a15irqmap;
29b115
-- 
29b115
2.31.1
29b115