1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #include <linux/kernel.h>
3 #include <linux/printk.h>
4 #include <linux/slab.h>
5 #include <linux/string.h>
7 void do_fortify_tests(void);
10 #define __BUF_LARGE 32
11 struct fortify_object
{
13 char buf
[__BUF_SMALL
];
17 #define LITERAL_SMALL "AAAAAAAAAAAAAAA"
18 #define LITERAL_LARGE "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
19 const char small_src
[__BUF_SMALL
] = LITERAL_SMALL
;
20 const char large_src
[__BUF_LARGE
] = LITERAL_LARGE
;
22 char small
[__BUF_SMALL
];
23 char large
[__BUF_LARGE
];
24 struct fortify_object instance
;
27 void do_fortify_tests(void)
29 /* Normal initializations. */
30 memset(&instance
, 0x32, sizeof(instance
));
31 memset(small
, 0xA5, sizeof(small
));
32 memset(large
, 0x5A, sizeof(large
));