Skip to content

Commit 7821618

Browse files
committed
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: 3c79107 ("netfilter: ctnetlink: don't use conntrack/expect object addresses as id") Reported-by: [email protected] Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 0e03c64 commit 7821618

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/netfilter/nf_conntrack_netlink.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3420,7 +3420,8 @@ static int ctnetlink_del_expect(struct sk_buff *skb,
34203420

34213421
if (cda[CTA_EXPECT_ID]) {
34223422
__be32 id = nla_get_be32(cda[CTA_EXPECT_ID]);
3423-
if (ntohl(id) != (u32)(unsigned long)exp) {
3423+
3424+
if (id != nf_expect_get_id(exp)) {
34243425
nf_ct_expect_put(exp);
34253426
return -ENOENT;
34263427
}

0 commit comments

Comments
 (0)