Commit 3ebb41bf authored by David S. Miller's avatar David S. Miller
Browse files


Pablo Neira Ayuso says:

====================
Netfilter fixes for net

The following patchset contains Netfilter fixes for net:

1) Postpone chain policy update to drop after transaction is complete,
   from Florian Westphal.

2) Add entry to flowtable after confirmation to fix UDP flows with
   packets going in one single direction.

3) Reference count leak in dst object, from Taehee Yoo.

4) Check for TTL field in flowtable datapath, from Taehee Yoo.

5) Fix h323 conntrack helper due to incorrect boundary check,
   from Jakub Jankowski.

6) Fix incorrect rcu dereference when fetching basechain stats,
   from Florian Westphal.

7) Missing error check when adding new entries to flowtable,
   from Taehee Yoo.

8) Use version field in nfnetlink message to honor the nfgen_family
   field, from Kristian Evensen.

9) Remove incorrect configuration check for CONFIG_NF_CONNTRACK_IPV6,
   from Subash Abhinov Kasiviswanathan.

10) Prevent dying entries from being added to the flowtable,
    from Taehee Yoo.

11) Don't hit WARN_ON() with malformed blob in ebtables with
    trailing data after last rule, reported by syzbot, patch
    from Florian Westphal.

12) Remove NFT_CT_TIMEOUT enumeration, never used in the kernel
    code.

13) Fix incorrect definition for NFT_LOGLEVEL_MAX, from Florian
    Westphal.

This batch comes with a conflict that can be fixed with this patch:

diff --cc include/uapi/linux/netfilter/nf_tables.h
index 7bdb234f3d8c,f0cf7b0f4f35..505393c6e959
--- a/include/uapi/linux/netfilter/nf_tables.h
+++ b/include/uapi/linux/netfilter/nf_tables.h
@@@ -966,6 -966,8 +966,7 @@@ enum nft_socket_keys
   * @NFT_CT_DST_IP: conntrack layer 3 protocol destination (IPv4 address)
   * @NFT_CT_SRC_IP6: conntrack layer 3 protocol source (IPv6 address)
   * @NFT_CT_DST_IP6: conntrack layer 3 protocol destination (IPv6 address)
 - * @NFT_CT_TIMEOUT: connection tracking timeout policy assigned to conntrack
+  * @NFT_CT_ID: conntrack id
   */
  enum nft_ct_keys {
  	NFT_CT_STATE,
@@@ -991,6 -993,8 +992,7 @@@
  	NFT_CT_DST_IP,
  	NFT_CT_SRC_IP6,
  	NFT_CT_DST_IP6,
 -	NFT_CT_TIMEOUT,
+ 	NFT_CT_ID,
  	__NFT_CT_MAX
  };
  #define NFT_CT_MAX		(__NFT_CT_MAX - 1)

That replaces the unused NFT_CT_TIMEOUT definition by NFT_CT_ID. If you prefer,
I can also solve this conflict here, just let me know.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 3ee9ae74 92285a07
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -966,7 +966,6 @@ enum nft_socket_keys {
 * @NFT_CT_DST_IP: conntrack layer 3 protocol destination (IPv4 address)
 * @NFT_CT_SRC_IP6: conntrack layer 3 protocol source (IPv6 address)
 * @NFT_CT_DST_IP6: conntrack layer 3 protocol destination (IPv6 address)
 * @NFT_CT_TIMEOUT: connection tracking timeout policy assigned to conntrack
 * @NFT_CT_ID: conntrack id
 */
enum nft_ct_keys {
@@ -993,7 +992,6 @@ enum nft_ct_keys {
	NFT_CT_DST_IP,
	NFT_CT_SRC_IP6,
	NFT_CT_DST_IP6,
	NFT_CT_TIMEOUT,
	NFT_CT_ID,
	__NFT_CT_MAX
};
@@ -1138,7 +1136,7 @@ enum nft_log_level {
	NFT_LOGLEVEL_AUDIT,
	__NFT_LOGLEVEL_MAX
};
#define NFT_LOGLEVEL_MAX	(__NFT_LOGLEVEL_MAX + 1)
#define NFT_LOGLEVEL_MAX	(__NFT_LOGLEVEL_MAX - 1)

/**
 * enum nft_queue_attributes - nf_tables queue expression netlink attributes
+3 −1
Original line number Diff line number Diff line
@@ -2153,7 +2153,9 @@ static int compat_copy_entries(unsigned char *data, unsigned int size_user,
	if (ret < 0)
		return ret;

	WARN_ON(size_remaining);
	if (size_remaining)
		return -EINVAL;

	return state->buf_kern_offset;
}

+1 −1
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ static int nf_h323_error_boundary(struct bitstr *bs, size_t bytes, size_t bits)
	if (bits % BITS_PER_BYTE > 0)
		bytes++;

	if (*bs->cur + bytes > *bs->end)
	if (bs->cur + bytes > bs->end)
		return 1;

	return 0;
+3 −8
Original line number Diff line number Diff line
@@ -748,24 +748,19 @@ static int callforward_do_filter(struct net *net,
		}
		break;
	}
#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6)
#if IS_ENABLED(CONFIG_IPV6)
	case AF_INET6: {
		const struct nf_ipv6_ops *v6ops;
		struct rt6_info *rt1, *rt2;
		struct flowi6 fl1, fl2;

		v6ops = nf_get_ipv6_ops();
		if (!v6ops)
			return 0;

		memset(&fl1, 0, sizeof(fl1));
		fl1.daddr = src->in6;

		memset(&fl2, 0, sizeof(fl2));
		fl2.daddr = dst->in6;
		if (!v6ops->route(net, (struct dst_entry **)&rt1,
		if (!nf_ip6_route(net, (struct dst_entry **)&rt1,
				  flowi6_to_flowi(&fl1), false)) {
			if (!v6ops->route(net, (struct dst_entry **)&rt2,
			if (!nf_ip6_route(net, (struct dst_entry **)&rt2,
					  flowi6_to_flowi(&fl2), false)) {
				if (ipv6_addr_equal(rt6_nexthop(rt1, &fl1.daddr),
						    rt6_nexthop(rt2, &fl2.daddr)) &&
+1 −1
Original line number Diff line number Diff line
@@ -1256,7 +1256,7 @@ static int ctnetlink_del_conntrack(struct net *net, struct sock *ctnl,
	struct nf_conntrack_tuple tuple;
	struct nf_conn *ct;
	struct nfgenmsg *nfmsg = nlmsg_data(nlh);
	u_int8_t u3 = nfmsg->nfgen_family;
	u_int8_t u3 = nfmsg->version ? nfmsg->nfgen_family : AF_UNSPEC;
	struct nf_conntrack_zone zone;
	int err;

Loading