summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDmitry Safonov <dima@arista.com>2020-09-21 15:36:55 +0100
committerAlistair Delva <adelva@google.com>2020-11-02 16:37:23 +0000
commitf0fee529f3b89d49e01e883c7c78e112ac8943b1 (patch)
treeefcb5e90c76aa7fb425b49b61b2562a352cfd4d8 /include
parent7ba7521120771376dfa85f53b1b7db075ddaad24 (diff)
BACKPORT: xfrm/compat: Add 32=>64-bit messages translator
Provide the user-to-kernel translator under XFRM_USER_COMPAT, that creates for 32-bit xfrm-user message a 64-bit translation. The translation is afterwards reused by xfrm_user code just as if userspace had sent 64-bit message. Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> (cherry picked from commit 5106f4a8acff480e244300bc5097c0ad7048c3a2) [adelva: nlmsg_parse_deprecated -> nlmsg_parse] Bug: 163141236 Signed-off-by: Alistair Delva <adelva@google.com> Change-Id: If15999b86e4704b75307fbcc3d7f0c8d8bc89e7a
Diffstat (limited to 'include')
-rw-r--r--include/net/xfrm.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 1c32d693e9d1..b75b69b255f5 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1827,11 +1827,16 @@ static inline int xfrm_tunnel_check(struct sk_buff *skb, struct xfrm_state *x,
}
extern const int xfrm_msg_min[XFRM_NR_MSGTYPES];
+extern const struct nla_policy xfrma_policy[XFRMA_MAX+1];
struct xfrm_translator {
/* Allocate frag_list and put compat translation there */
int (*alloc_compat)(struct sk_buff *skb, const struct nlmsghdr *src);
+ /* Allocate nlmsg with 64-bit translaton of received 32-bit message */
+ struct nlmsghdr *(*rcv_msg_compat)(const struct nlmsghdr *nlh,
+ int maxtype, const struct nla_policy *policy);
+
struct module *owner;
};