1/*
2 * Copyright 2021, J��r��me Duval, jerome.duval@gmail.com.
3 * Distributed under the terms of the MIT License.
4 */
5
6
7#include <sys/cdefs.h>
8
9#include <SupportDefs.h>
10
11#include <util/Random.h>
12
13
14extern "C" {
15
16long __stack_chk_guard;
17
18
19void
20__stack_chk_fail()
21{
22	panic("stack smashing detected\n");
23}
24
25
26}
27
28
29void
30stack_protector_init()
31{
32	__stack_chk_guard = secure_get_random<long>();
33}
34
35