Skip to content

Commit

Permalink
[LibOS] Remove unused canary in shim_tcb
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Kowalczyk <mkow@invisiblethingslab.com>
  • Loading branch information
mkow committed Sep 6, 2021
1 parent 40e942d commit d2dbe40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
4 changes: 2 additions & 2 deletions LibOS/shim/include/arch/x86_64/shim_entry_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#define SHIM_ENTRY_API_H_

/* Offsets for GS register at which entry vectors can be found */
#define SHIM_SYSCALLDB_OFFSET 32
#define SHIM_CALL_OFFSET 40
#define SHIM_SYSCALLDB_OFFSET 24
#define SHIM_CALL_OFFSET 32

#ifdef __ASSEMBLER__

Expand Down
8 changes: 0 additions & 8 deletions LibOS/shim/include/shim_tcb.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#include "shim_entry_api.h"
#include "shim_tcb-arch.h"

#define SHIM_TCB_CANARY 0xdeadbeef

struct shim_context {
PAL_CONTEXT* regs;
long syscall_nr;
Expand All @@ -19,7 +17,6 @@ struct shim_context {

typedef struct shim_tcb shim_tcb_t;
struct shim_tcb {
uint64_t canary;
shim_tcb_t* self;

/* Function pointers for patched code calling into Graphene. */
Expand All @@ -46,7 +43,6 @@ static_assert(
"SHIM_CALL_OFFSET must match");

static inline void __shim_tcb_init(shim_tcb_t* shim_tcb) {
shim_tcb->canary = SHIM_TCB_CANARY;
shim_tcb->self = shim_tcb;
shim_tcb->syscalldb = &syscalldb;
shim_tcb->handle_call = &handle_call;
Expand All @@ -68,8 +64,4 @@ static inline shim_tcb_t* shim_get_tcb(void) {
return SHIM_TCB_GET(self);
}

static inline bool shim_tcb_check_canary(void) {
return SHIM_TCB_GET(canary) == SHIM_TCB_CANARY;
}

#endif /* _SHIM_H_ */

0 comments on commit d2dbe40

Please sign in to comment.