Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1906967pxk; Tue, 1 Sep 2020 10:31:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZ0dk2eNCGmrc5ygR+Ipy3wP9RfwdMwLjd0ZkYue0ThqORZY21jmVCWRUjwr7Kugcs/wwh X-Received: by 2002:a17:906:4356:: with SMTP id z22mr2679046ejm.414.1598981466458; Tue, 01 Sep 2020 10:31:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598981466; cv=none; d=google.com; s=arc-20160816; b=Y6QKxA/CtFc/d4L/nBY72m0KY+o4WAgNA7kpkpQXexXHOX1L9CvUmmtlHihWjsLV0A Bml7FphofDhY4Q670jCQbtSWoBV+n8xpfVbf8m9UlyVMAyJUCBBA+UjM1XT8iFn866x8 hBSuDPc6gF505S0+15KjNgWcTDjlgSlMgYcZHojAjHt4tPBWehZeGmeax52O/UsW1t7J nTzUTbUa0i+EYloeS+u4+veLr+DVO/iOGalQ5eS+79qLUhunuqoDKn8hLSP4SXI3WVkb oHO9nY19WqpNWan7qm4u0t2OejIW6YfFNLs9/dJf3Tpf2BBpdigYR87sC+Ood2XWI1Nd Lb3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=FW5La7opiv4KWG16c7XYpf3DTcgrj7Pdfd83aUNKNrc=; b=yukq+hrcMPFRHGvf4NF5V9BYONij2koJ76X+gneZCcIHPwSCuOpURm1mP7kvVo6+FW RHJGpzpXIsVgsj3cz6VaOELBYWtQT2CPrakWbkNpTQJWN4urTtF66E/FpbAFaq8tWIHk nLUuqq0XutBXvxaDWv1B1lCtV3Qqeja+k9MeSIbgfHCf7xEk8EY3dBcua6mGIxbNWJo5 yjdDBvMn6gOAnz0tvOI/xiLz4cmRGW8+JiYPJcfZ3WNM1rjAj/fElyHcm1WLacMefzp9 ivCU6I9ll486jbZLKZS6Pz1xvJURODVXSd4CaAz5fp2pE2lFKCG2KTwUaKW8mtZdbLcD Lgag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jAYS2ZZc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b2si978869ejk.222.2020.09.01.10.30.40; Tue, 01 Sep 2020 10:31:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jAYS2ZZc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728369AbgIAR3p (ORCPT + 99 others); Tue, 1 Sep 2020 13:29:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727025AbgIAR3n (ORCPT ); Tue, 1 Sep 2020 13:29:43 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87D82C061244 for ; Tue, 1 Sep 2020 10:29:42 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id o20so1184181pfp.11 for ; Tue, 01 Sep 2020 10:29:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FW5La7opiv4KWG16c7XYpf3DTcgrj7Pdfd83aUNKNrc=; b=jAYS2ZZc79qZYnTsWwjv1SadjMN4RsSUm73yL30/GRwcwxgx4b2Nzm1acr8EpXHU9A boOwDj4V+fB5mPRPo+Bphq2QhUwtv9CGHRTG0Mst/tBdwp4NX2vO6i7ag2MSCNrd/HIi AZQ+fBRYvWGIFiYzyOdjiuLJEwGDoPjfTasrm4iP6Bxhunex1Odsdg877c+L2oeUIjyl BvD61dtjU9PXUL0yTB3RKH36Q/pHpRkVTcfkriR5wU0n1ydpyKxsMdyKoKf2KiK0Wrgh jFGMvRTtmQI4gSn4b684qUrpZw/MICxUnYbOWXjmbDcERxcrngcctPQze1oDKK2bpbTD aFyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FW5La7opiv4KWG16c7XYpf3DTcgrj7Pdfd83aUNKNrc=; b=K0iOYNwbbbQXhw9F0hbL/vdt6FilqB/PSyy18prx3MxQOMOjAeHFirtoNFvbG8Xl1q Ge0kmQGl9m131MXcIz53in3KpWocJceW6M87PG7CYgTFgoQ18Q5U5vv8oUD7Hv+5QTeQ TCASlkoJBbd36FQ6bwU35tecO/m8C4vujMfaRd/fCMNY9mU/DQ6YArcmW9UpTDgwcQmf LBqB3JTAH8aMFca/2Sicdcrxd9CpruyFfAUGRIOj60FORDPiWyUzP2SQ70rHPrN03LK+ saK53nUgUDVDN5YpFJ9KyOD+kALYolVOg5nfZs9CulrBBLrASDmcv0FZtd7yR1slIQrK rwBA== X-Gm-Message-State: AOAM533Xp/WpQIz3DGhoZew/32qETEOXxoXOgxgkJr+vwU/daV5MEH5V +TK2AJwJNg3ZC77BkbqrMzjAv5YVnoE5stBqAWXbOA== X-Received: by 2002:a63:d62:: with SMTP id 34mr2356233pgn.179.1598981381718; Tue, 01 Sep 2020 10:29:41 -0700 (PDT) MIME-Version: 1.0 References: <20200727175720.4022402-1-willmcvicker@google.com> <20200727175720.4022402-2-willmcvicker@google.com> <20200729214607.GA30831@salvia> <20200731002611.GA1035680@google.com> <20200731175115.GA16982@salvia> <20200731181633.GA1209076@google.com> <20200803183156.GA3084830@google.com> <20200804113711.GA20988@salvia> <20200901153607.GC4292@willie-the-truck> In-Reply-To: <20200901153607.GC4292@willie-the-truck> From: William Mcvicker Date: Tue, 1 Sep 2020 10:29:25 -0700 Message-ID: Subject: Re: [PATCH v2 1/1] netfilter: nat: add a range check for l3/l4 protonum To: Will Deacon Cc: Pablo Neira Ayuso , security@kernel.org, Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com, stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Will, Pablo is going to add the latest patch to the nf.git tree. Once that happens, I'm going to propose the patch in nf.git get cherry-picked to the -stable branches. Thanks, Will On Tue, Sep 1, 2020 at 8:36 AM Will Deacon wrote: > > Hi Will, Pablo, > > On Tue, Aug 04, 2020 at 01:37:11PM +0200, Pablo Neira Ayuso wrote: > > This patch is much smaller and if you confirm this is address the > > issue, then this is awesome. > > Did that ever get confirmed? AFAICT, nothing ended up landing in the stable > trees for this. > > Cheers, > > Will > > > > 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.