Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
[LibOS] Align char msg[] in shim_ipc_msg to 16 bytes
Browse files Browse the repository at this point in the history
The msg field of 'struct shim_ipc_msg' will for example be cast to
'struct shim_ipc_sysv_tellkey*' (in ipc_sysv_tellkey_callback()) and
needs to be properly aligned. There are also casts to other IPC-related
structures that also require alignment.
  • Loading branch information
stefanberger authored and mkow committed Jan 20, 2021
1 parent 17ab04d commit 1b8848b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion LibOS/shim/include/shim_ipc.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ struct shim_ipc_msg {
size_t size;
IDTYPE src, dst;
unsigned long seq;
char msg[];
/* msg is used to store and read various structures, we need to ensure its proper alignment */
// TODO: this is only a temporary workaround until we rewrite the IPC subsystem.
char msg[] __attribute__((aligned(16)));
} __attribute__((packed));

struct shim_ipc_port;
Expand Down

0 comments on commit 1b8848b

Please sign in to comment.