aboutsummaryrefslogtreecommitdiff
path: root/include/apos/canary.h
blob: 30a3dd23ffe1a3fe26037648e669a6262d061714 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef APOS_CANARY_H
#define APOS_CANARY_H

/**
 * @file canary.h
 * Kernel stack canary handling.
 */

#include <apos/tcb.h>
#include <apos/types.h>

/**
 * Place canary at end of kernel stack.
 *
 * @param t \ref tcb whose kernel stack to place canary in.
 */
void set_canary(struct tcb *t);

/**
 * Check that canary hasn't been accidentally overwritten.
 *
 * @param t \ref tcb whose kernel stack canary to check.
 * @return \ref true if overwritten, \ref false otherwise.
 */
bool check_canary(struct tcb *t);

#endif /* APOS_CANARY_H */