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

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