Skip to content

Commit 8807850

Browse files
committed
Merge tag 'nf-24-11-14' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf
Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for net: 1) Update .gitignore in selftest to skip conntrack_reverse_clash, from Li Zhijian. 2) Fix conntrack_dump_flush return values, from Guan Jing. 3) syzbot found that ipset's bitmap type does not properly checks for bitmap's first ip, from Jeongjun Park. * tag 'nf-24-11-14' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: ipset: add missing range check in bitmap_ip_uadt selftests: netfilter: Fix missing return values in conntrack_dump_flush selftests: netfilter: Add missing gitignore file ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents c53bf10 + 35f56c5 commit 8807850

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

net/netfilter/ipset/ip_set_bitmap_ip.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,8 @@ bitmap_ip_uadt(struct ip_set *set, struct nlattr *tb[],
163163
ret = ip_set_get_hostipaddr4(tb[IPSET_ATTR_IP_TO], &ip_to);
164164
if (ret)
165165
return ret;
166-
if (ip > ip_to) {
166+
if (ip > ip_to)
167167
swap(ip, ip_to);
168-
if (ip < map->first_ip)
169-
return -IPSET_ERR_BITMAP_RANGE;
170-
}
171168
} else if (tb[IPSET_ATTR_CIDR]) {
172169
u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]);
173170

@@ -178,7 +175,7 @@ bitmap_ip_uadt(struct ip_set *set, struct nlattr *tb[],
178175
ip_to = ip;
179176
}
180177

181-
if (ip_to > map->last_ip)
178+
if (ip < map->first_ip || ip_to > map->last_ip)
182179
return -IPSET_ERR_BITMAP_RANGE;
183180

184181
for (; !before(ip_to, ip); ip += map->hosts) {

tools/testing/selftests/net/netfilter/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
audit_logread
33
connect_close
44
conntrack_dump_flush
5+
conntrack_reverse_clash
56
sctp_collision
67
nf_queue

tools/testing/selftests/net/netfilter/conntrack_dump_flush.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ static int build_cta_tuple_v4(struct nlmsghdr *nlh, int type,
4343
mnl_attr_nest_end(nlh, nest_proto);
4444

4545
mnl_attr_nest_end(nlh, nest);
46+
47+
return 0;
4648
}
4749

4850
static int build_cta_tuple_v6(struct nlmsghdr *nlh, int type,
@@ -71,6 +73,8 @@ static int build_cta_tuple_v6(struct nlmsghdr *nlh, int type,
7173
mnl_attr_nest_end(nlh, nest_proto);
7274

7375
mnl_attr_nest_end(nlh, nest);
76+
77+
return 0;
7478
}
7579

7680
static int build_cta_proto(struct nlmsghdr *nlh)
@@ -90,6 +94,8 @@ static int build_cta_proto(struct nlmsghdr *nlh)
9094
mnl_attr_nest_end(nlh, nest_proto);
9195

9296
mnl_attr_nest_end(nlh, nest);
97+
98+
return 0;
9399
}
94100

95101
static int conntrack_data_insert(struct mnl_socket *sock, struct nlmsghdr *nlh,

0 commit comments

Comments
 (0)