Check for PCuABI and modify function declarations accordingly, changing user** into * __capability * __capability.
Signed-off-by: Joshua Lant joshualant@gmail.com --- net/bridge/netfilter/ebtables.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index 99d82676f780..4066a72b8c14 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c @@ -1633,7 +1633,12 @@ static int ebt_compat_match_offset(const struct xt_match *match, return xt_compat_match_offset(match); }
-static int compat_match_to_user(struct ebt_entry_match *m, void __user **dstptr, +static int compat_match_to_user(struct ebt_entry_match *m, +#ifdef CONFIG_CHERI_PURECAP_UABI + void *__capability * dstptr, +#else + void __user **dstptr, +#endif unsigned int *size) { const struct xt_match *match = m->u.match; @@ -1665,7 +1670,11 @@ static int compat_match_to_user(struct ebt_entry_match *m, void __user **dstptr, }
static int compat_target_to_user(struct ebt_entry_target *t, +#ifdef CONFIG_CHERI_PURECAP_UABI + void *__capability * dstptr, +#else void __user **dstptr, +#endif unsigned int *size) { const struct xt_target *target = t->u.target; @@ -1697,15 +1706,24 @@ static int compat_target_to_user(struct ebt_entry_target *t, }
static int compat_watcher_to_user(struct ebt_entry_watcher *w, - void __user **dstptr, - unsigned int *size) +#ifdef CONFIG_CHERI_PURECAP_UABI + void *__capability * dstptr, +#else + void __user **dstptr, +#endif + unsigned int *size) { return compat_target_to_user((struct ebt_entry_target *)w, dstptr, size); }
-static int compat_copy_entry_to_user(struct ebt_entry *e, void __user **dstptr, - unsigned int *size) +static int compat_copy_entry_to_user(struct ebt_entry *e, +#ifdef CONFIG_CHERI_PURECAP_UABI + void *__capability * dstptr, +#else + void __user **dstptr, +#endif + unsigned int *size) { struct ebt_entry_target *t; struct ebt_entry __user *ce;