forked from luck/tmp_suning_uos_patched
8bdb25f7ae
commit d9e9d2300681d68a775c28de6aa6e5290ae17796 upstream. Find all the return-thunk sites and record them in a .return_sites section such that the kernel can undo this. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Borislav Petkov <bp@suse.de> [cascardo: conflict fixup because of functions added to support IBT] Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com> [bwh: Backported to 5.10: adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
34 lines
757 B
C
34 lines
757 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Copyright (C) 2020 Matt Helsley <mhelsley@vmware.com>
|
|
*/
|
|
|
|
#ifndef _OBJTOOL_H
|
|
#define _OBJTOOL_H
|
|
|
|
#include <stdbool.h>
|
|
#include <linux/list.h>
|
|
#include <linux/hashtable.h>
|
|
|
|
#include "elf.h"
|
|
|
|
#define __weak __attribute__((weak))
|
|
|
|
struct objtool_file {
|
|
struct elf *elf;
|
|
struct list_head insn_list;
|
|
DECLARE_HASHTABLE(insn_hash, 20);
|
|
struct list_head retpoline_call_list;
|
|
struct list_head return_thunk_list;
|
|
struct list_head static_call_list;
|
|
bool ignore_unreachables, c_file, hints, rodata;
|
|
};
|
|
|
|
struct objtool_file *objtool_open_read(const char *_objname);
|
|
|
|
int check(struct objtool_file *file);
|
|
int orc_dump(const char *objname);
|
|
int orc_create(struct objtool_file *file);
|
|
|
|
#endif /* _OBJTOOL_H */
|