Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -1
+2 -1
net/netfilter/nf_conntrack_netlink.c
··· 3420 3420 3421 3421 if (cda[CTA_EXPECT_ID]) { 3422 3422 __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)) { 3424 3425 nf_ct_expect_put(exp); 3425 3426 return -ENOENT; 3426 3427 }