On morello architecture, use of kernel pointers in the uapi structures is not permitted, due to different alignment requirements between kernel and userspace. These pointers should be the new type __nf_kptr_t, whose size changes depening on the pc/non-pcUABI. Modify these to use a union which will be accessed in the kernel using the original member pointer, but will actually be of size __nf_kptr_t, avoiding heavy casting needed when using to new type directly.
Signed-off-by: Joshua Lant joshualant@gmail.com --- include/uapi/linux/netfilter/x_tables.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/include/uapi/linux/netfilter/x_tables.h b/include/uapi/linux/netfilter/x_tables.h index e695b6d34a6f..fe081b3a5293 100644 --- a/include/uapi/linux/netfilter/x_tables.h +++ b/include/uapi/linux/netfilter/x_tables.h @@ -29,7 +29,10 @@ struct xt_entry_match { __u16 match_size;
/* Used inside the kernel */ - struct xt_match *match; + union { + struct xt_match *match; + __nf_kptr_t __match; + }; } kernel;
/* Total length */ @@ -52,7 +55,10 @@ struct xt_entry_target { __u16 target_size;
/* Used inside the kernel */ - struct xt_target *target; + union { + struct xt_target *target; + __nf_kptr_t __target; + }; } kernel;
/* Total length */