summaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2024-07-13 16:47:38 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2024-07-17 19:00:47 +0200
commit782161895eb4ac45cf7cfa8db375bd4766cb8299 (patch)
tree2cc7ca097db4f6b0a5e9e8502d6d5ed5e81f2814 /net/netfilter
parent0e03c643dc9389e61fa484562dae58c8d6e96d63 (diff)
downloadlinux-782161895eb4ac45cf7cfa8db375bd4766cb8299.tar.gz
linux-782161895eb4ac45cf7cfa8db375bd4766cb8299.tar.bz2
linux-782161895eb4ac45cf7cfa8db375bd4766cb8299.zip
netfilter: ctnetlink: use helper function to calculate expect ID
Delete expectation path is missing a call to the nf_expect_get_id() helper function to calculate the expectation ID, otherwise LSB of the expectation object address is leaked to userspace. Fixes: 3c79107631db ("netfilter: ctnetlink: don't use conntrack/expect object addresses as id") Reported-by: zdi-disclosures@trendmicro.com Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nf_conntrack_netlink.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 3b846cbdc050..4cbf71d0786b 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -3420,7 +3420,8 @@ static int ctnetlink_del_expect(struct sk_buff *skb,
if (cda[CTA_EXPECT_ID]) {
__be32 id = nla_get_be32(cda[CTA_EXPECT_ID]);
- if (ntohl(id) != (u32)(unsigned long)exp) {
+
+ if (id != nf_expect_get_id(exp)) {
nf_ct_expect_put(exp);
return -ENOENT;
}