3d965b33e4
Improve the reporting of buffer overflows under CONFIG_FORTIFY_SOURCE to help accelerate debugging efforts. The calculations are all just sitting in registers anyway, so pass them along to the function to be reported. For example, before: detected buffer overflow in memcpy and after: memcpy: detected buffer overflow: 4096 byte read of buffer size 1 Link: https://lore.kernel.org/r/20230407192717.636137-10-keescook@chromium.org Signed-off-by: Kees Cook <keescook@chromium.org>
22 lines
654 B
C
22 lines
654 B
C
#ifndef MISC_H
|
|
#define MISC_H
|
|
|
|
#include <linux/compiler.h>
|
|
|
|
void error(char *x) __noreturn;
|
|
extern unsigned long free_mem_ptr;
|
|
extern unsigned long free_mem_end_ptr;
|
|
void __div0(void);
|
|
void
|
|
decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
|
|
unsigned long free_mem_ptr_end_p, int arch_id);
|
|
void __fortify_panic(const u8 reason, size_t avail, size_t size);
|
|
int atags_to_fdt(void *atag_list, void *fdt, int total_space);
|
|
uint32_t fdt_check_mem_start(uint32_t mem_start, const void *fdt);
|
|
int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x));
|
|
|
|
extern char input_data[];
|
|
extern char input_data_end[];
|
|
|
|
#endif
|