[RFC PATCH 10/11] linux/interrupt: Fix prototype matching property

joao
2022-04-20T00:44:07Z

From: Joao Moreira <joao@overdrivepizza.com>

Unions will make function pointers with different prototypes be used through
the same call. This leads into the same call instruction being used for
calling functions with different prototypes, making them unsuitable for
prototype-based fine-grained CFI.

Fix this CFI policy violation by removing the function pointer union in
the tasklet struct.

Signed-off-by: Joao Moreira <joao@overdrivepizza.com>
---
include/linux/interrupt.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index f40754caaefa..8d5504b0f20b 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -650,10 +650,8 @@ struct tasklet_struct
unsigned long state;
atomic_t count;
bool use_callback;
- union {
- void (*func)(unsigned long data);
- void (*callback)(struct tasklet_struct *t);
- };
+ void (*func)(unsigned long data);
+ void (*callback)(struct tasklet_struct *t);
unsigned long data;
};

--
2.35.1