Message ID | 20240221112637.5396-13-fw@strlen.de (mailing list archive) |
---|---|
State | Accepted |
Commit | 26f4dac11775a1ca24e2605cb30e828d4dbdea93 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next,01/12] netfilter: expect: Simplify the allocation of slab caches in nf_conntrack_expect_init | expand |
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index 21624d68314f..da5d929c7c85 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c @@ -1142,7 +1142,8 @@ void xt_compat_target_from_user(struct xt_entry_target *t, void **dstptr, if (target->compat_from_user) target->compat_from_user(t->data, ct->data); else - memcpy(t->data, ct->data, tsize - sizeof(*ct)); + unsafe_memcpy(t->data, ct->data, tsize - sizeof(*ct), + /* UAPI 0-sized destination */); tsize += off; t->u.user.target_size = tsize;