|
|
bd1529 |
From 1730f7bb306e13689a7684fd93ae5b8383a28d2f Mon Sep 17 00:00:00 2001
|
|
|
bd1529 |
From: Michal Sekletar <msekletar@users.noreply.github.com>
|
|
|
bd1529 |
Date: Fri, 31 May 2019 15:23:23 +0200
|
|
|
bd1529 |
Subject: [PATCH] dbus-execute: make transfer of CPUAffinity endian safe
|
|
|
bd1529 |
(#12711)
|
|
|
bd1529 |
|
|
|
bd1529 |
We store the affinity mask in the native endian. However, over D-Bus we
|
|
|
bd1529 |
must transfer the mask in little endian byte order.
|
|
|
bd1529 |
|
|
|
bd1529 |
This is the second part of c367f996f5f091a63f812f0140b304c649be77fc.
|
|
|
bd1529 |
|
|
|
bd1529 |
(cherry picked from commit 75e40119a471454516ad0acc96f6f4094e7fb652)
|
|
|
bd1529 |
|
|
|
bd1529 |
Related: #1740657
|
|
|
bd1529 |
---
|
|
|
bd1529 |
src/core/dbus-execute.c | 5 ++++-
|
|
|
bd1529 |
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
bd1529 |
|
|
|
bd1529 |
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
|
|
|
bd1529 |
index f9527e56b2..d5acca384f 100644
|
|
|
bd1529 |
--- a/src/core/dbus-execute.c
|
|
|
bd1529 |
+++ b/src/core/dbus-execute.c
|
|
|
bd1529 |
@@ -215,12 +215,15 @@ static int property_get_cpu_affinity(
|
|
|
bd1529 |
sd_bus_error *error) {
|
|
|
bd1529 |
|
|
|
bd1529 |
ExecContext *c = userdata;
|
|
|
bd1529 |
+ _cleanup_free_ uint8_t *array = NULL;
|
|
|
bd1529 |
+ size_t allocated;
|
|
|
bd1529 |
|
|
|
bd1529 |
assert(bus);
|
|
|
bd1529 |
assert(reply);
|
|
|
bd1529 |
assert(c);
|
|
|
bd1529 |
|
|
|
bd1529 |
- return sd_bus_message_append_array(reply, 'y', c->cpu_set.set, c->cpu_set.allocated);
|
|
|
bd1529 |
+ (void) cpu_set_to_dbus(&c->cpu_set, &array, &allocated);
|
|
|
bd1529 |
+ return sd_bus_message_append_array(reply, 'y', array, allocated);
|
|
|
bd1529 |
}
|
|
|
bd1529 |
|
|
|
bd1529 |
static int property_get_numa_mask(
|