console: Expand dummy functions for CFI
This expands the no-op dummy functions into full prototypes to avoid indirect call mismatches when running under Control Flow Integrity checking, like with Clang's -fsanitize=cfi. Co-Developed-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
209f668cd2
commit
c396a5bf45
@@ -673,14 +673,14 @@ static bool newport_scroll(struct vc_data *vc, unsigned int t, unsigned int b,
|
||||
return true;
|
||||
}
|
||||
|
||||
static int newport_dummy(struct vc_data *c)
|
||||
static int newport_set_origin(struct vc_data *vc)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define DUMMY (void *) newport_dummy
|
||||
static void newport_save_screen(struct vc_data *vc) { }
|
||||
|
||||
const struct consw newport_con = {
|
||||
static const struct consw newport_con = {
|
||||
.owner = THIS_MODULE,
|
||||
.con_startup = newport_startup,
|
||||
.con_init = newport_init,
|
||||
@@ -694,8 +694,8 @@ const struct consw newport_con = {
|
||||
.con_blank = newport_blank,
|
||||
.con_font_set = newport_font_set,
|
||||
.con_font_default = newport_font_default,
|
||||
.con_set_origin = DUMMY,
|
||||
.con_save_screen = DUMMY
|
||||
.con_set_origin = newport_set_origin,
|
||||
.con_save_screen = newport_save_screen
|
||||
};
|
||||
|
||||
static int newport_probe(struct gio_device *dev,
|
||||
|
Reference in New Issue
Block a user