Due to compiler padding, the EVS library sends uninitialized data which then
gets used in the exec for group name. Attached test program shows the problem
and verifies the patch.
Attached patch also applies to 0.82 with a little fuzz.
/Hans
diff -Naur openais-0.80.3/include/ipc_evs.h openais-0.80.3.hafe/include/ipc_evs.h
--- openais-0.80.3/include/ipc_evs.h 2007-06-24 08:33:09.000000000 +0200
+++ openais-0.80.3.hafe/include/ipc_evs.h 2008-03-06 10:57:39.000000000 +0100
@@ -78,7 +78,7 @@
struct req_lib_evs_join {
mar_res_header_t header;
int group_entries;
- struct evs_group groups[0];
+ struct evs_group groups[0] __attribute__((aligned(8)));
};
struct res_lib_evs_join {
@@ -88,7 +88,7 @@
struct req_lib_evs_leave {
mar_res_header_t header;
int group_entries;
- struct evs_group groups[0];
+ struct evs_group groups[0] __attribute__((aligned(8)));
};
struct res_lib_evs_leave {
@@ -111,7 +111,7 @@
evs_guarantee_t guarantee;
int msg_len;
int group_entries;
- struct evs_group groups[0];
+ struct evs_group groups[0] __attribute__((aligned(8)));
};
struct res_lib_evs_mcast_groups {
@@ -123,7 +123,7 @@
mar_req_header_t header;
int group_entries;
int msg_len;
- struct evs_group groups[0];
+ struct evs_group groups[0] __attribute__((aligned(8)));
/* data goes here */
};
#include <stdio.h>
#include <assert.h>
#include "ipc_evs.h"
int main()
{
struct req_lib_evs_join join;
struct req_lib_evs_leave leave;
struct req_lib_evs_mcast_groups mcast_groups;
struct req_lib_evs_mcast_joined mcast_joined;
struct res_evs_deliver_callback cb;
assert(((char*) &join + sizeof(join)) == (char*) &join.groups);
assert(((char*) &leave + sizeof(leave)) == (char*) &leave.groups);
assert(((char*) &mcast_groups + sizeof(mcast_groups)) == (char*) &mcast_groups.groups);
assert(((char*) &mcast_joined + sizeof(mcast_joined)) == (char*) &mcast_joined.msg);
assert(((char*) &cb + sizeof(cb)) == (char*) &cb.msg);
}
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais