lkml.org 
[lkml]   [2020]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2 1/1] netfilter: nat: add a range check for l3/l4 protonum
Hi,

This patch is much smaller and if you confirm this is address the
issue, then this is awesome.

On Mon, Aug 03, 2020 at 06:31:56PM +0000, William Mcvicker wrote:
[...]
> diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
> index 31fa94064a62..56d310f8b29a 100644
> --- a/net/netfilter/nf_conntrack_netlink.c
> +++ b/net/netfilter/nf_conntrack_netlink.c
> @@ -1129,6 +1129,8 @@ ctnetlink_parse_tuple(const struct nlattr * const cda[],
> if (!tb[CTA_TUPLE_IP])
> return -EINVAL;
>
> + if (l3num >= NFPROTO_NUMPROTO)
> + return -EINVAL;

l3num can only be either NFPROTO_IPV4 or NFPROTO_IPV6.

Other than that, bail out with EOPNOTSUPP.

Thank you.

\
 
 \ /
  Last update: 2020-08-04 13:38    [W:1.087 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site