Received: by 10.223.176.5 with SMTP id f5csp973708wra; Sat, 3 Feb 2018 14:53:04 -0800 (PST) X-Google-Smtp-Source: AH8x226l/IxSmre9PFZQgRccetEmMobbQCDi5UAP0QblZm7v9WDFZ50b2bhaEFGMee7jbfiI5YsE X-Received: by 10.99.143.2 with SMTP id n2mr36449996pgd.14.1517698384171; Sat, 03 Feb 2018 14:53:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517698384; cv=none; d=google.com; s=arc-20160816; b=tOS6Yc4IifnLgdws1JU1Dz9eY4t98pW6TXytfhGnf7UZU7ECBDBDMi1jex8cs4jBi1 /mCvLcHqtgtv1Z1PDVxiHszjRCUW1pqORlvl3ntszIT/+IRrutOdCbjOYKrIjgwn9L3m 3W8OT3Yel/voX13sYuSfuHSSHYuVXSM14gEtUv3qP6X/ZMl1XftR90TO3yPZOS/80ksV oIn+SevQ0SQahHpE+M0B6Yy/ADmWYmkeSBG3R0C3qsU+ZwDaOwr54z1wqNwwUfEKEJa0 AWaBJX/GovVksg7skT6Z0auLE4pigqHvg1RpzVDZcLU5uyedI3clNWc47vOqik1cxm13 9z6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=zAW/GPIxEE6VCsQY+oIhXeXxjr60TITWOlfpxgh7HIk=; b=BKW1Ke3JAQB3TXGRL2G5ZkN6lv8cYG3Ho+iK8kQJwwfJEdjb26bmdyEW8jDgMJiDqI MZH9V9Sbqc1SZ/PgdUZGEL5KCBc6J8YLVGj02wjpy00gHMlV1dY9aKM7Jw2PNxbVR1pk EUZNQcEEsq8XcDV6XJinFiyhSbKQgjdjlXjCWuq29KPyyUrlvT8lATEPGcMw1G5OPCvU 2iEgFyFzFTRhwm5vxaUWm3D8ufxuWK86oGTL6NaKL6DFYGWL2AoyytNwGZPAgUjcwW0Q ewUBY8c1ARcJxIIsFTrlXkgHYXDV083ZPzLPvloemjGjq3g4WvWnHnZMnWF/1V9f70/L dUrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=RWElolb+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az8-v6si4224858plb.723.2018.02.03.14.52.50; Sat, 03 Feb 2018 14:53:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=RWElolb+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755442AbeBCSrx (ORCPT + 99 others); Sat, 3 Feb 2018 13:47:53 -0500 Received: from mail-co1nam03on0092.outbound.protection.outlook.com ([104.47.40.92]:4928 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753068AbeBCSCR (ORCPT ); Sat, 3 Feb 2018 13:02:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=zAW/GPIxEE6VCsQY+oIhXeXxjr60TITWOlfpxgh7HIk=; b=RWElolb+x8yeYWViKMIqixSk/YMkx6C6J5V/kMYuNSCV8fbD2q7y0ul190oCuy0YI/l62Y83AQ56YXVNYEINt/znG+13fNWa02H8ZqpDsYP9XDJO0xadjkUxjSCPtIZmtIPcm5GRcZMVHXxgCoLrt9WHNZOVXXoyaFifhIoVdCU= Received: from BL0PR2101MB1027.namprd21.prod.outlook.com (52.132.20.161) by BL0PR2101MB1092.namprd21.prod.outlook.com (52.132.24.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.485.4; Sat, 3 Feb 2018 18:01:24 +0000 Received: from BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9]) by BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9%3]) with mapi id 15.20.0485.006; Sat, 3 Feb 2018 18:01:24 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Pablo Neira Ayuso , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 046/110] netfilter: nf_tables: fix chain filter in nf_tables_dump_rules() Thread-Topic: [PATCH AUTOSEL for 4.14 046/110] netfilter: nf_tables: fix chain filter in nf_tables_dump_rules() Thread-Index: AQHTnRjtVCSBtka3T0OhrA0lnbR4oQ== Date: Sat, 3 Feb 2018 18:00:50 +0000 Message-ID: <20180203180015.29073-46-alexander.levin@microsoft.com> References: <20180203180015.29073-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180015.29073-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BL0PR2101MB1092;6:ag5KB+Bws7LXrovZvnRvGx5RxLskoXwoaite5brV7gv81UkUY3b1C8nr8P1GvBmVUQlMgYJxlwH9G6oMwQmQxxXOe0hHeI4qzk6b3V/wxVkEQ01D2UbRj64Ep4pDkqbmXlHZ574vbc1QBCyjhzABIIlNuFrAaL8Ux4Y8sSpTzINXpD0I/+975QfCKIsXjgNld66ydSK2g3SqjblT5Z5YHwhrAWPHn6oQqtHlBxwyalUtjIvcaa3lSNjpu/dlLR/zQhFh1EGk9pa8L2ZxPTdCaBHbhnfnIBZSJA9WZv2bWgztOc7N30fYVUVAZv09IX3fWCWxFOzphjv3LTwbhyvvHzXS7R8tzp9yrpVceH7jayhrpzTjMDqKTukx8CY8Uj5L;5:VZdCp6w7nZf4aZr4SCkpJDBiMU4Oxq10uFxYXiBb4PqaLL+xLYlF2eAG28QX/nqjxBW0b4soyLRT6i+72GNDtMTLScqshT0qGuikVz7158IqO8eN6z1lig4sb7BYQKsg4ccu8eJ+iWSzeIc0kppwYFI/3h6SKHyIBuDRxcnFKIQ=;24:jmg1nUss9DuNkrNvnUk3YXohyM7wBVepb2MflEo9XP6wNpKWg/KJKXc3kxYJ0tSkgtMse32AdyDh2ETKbGONnRF+3kVXSA6Mm8pqI7lBNqw=;7:4U6vPwh+yc5tL8c34d5uc0fffQ4HY5e14YYR5PfmjbZo33znLTJqbA706PW5gPFrOaDpMP+nuDgP7ZJHLaq6ooXS0uRh4ab39ffsQHIo9uhjC4UlZ9AmC/tW3GWuR9/l8JPe9trxRfK3SSSehPAt6+2HYW+6kC9pRRDCQHhwipP4R0+uYS2IjVsvhNeccbLcWpxszH25rrMjjq7QtKBGu91CL44Vv2I0UlSYPzfzdhQMNkSmS8ijFXSbrP1xPF07 x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 6662b8b2-8256-4881-99d2-08d56b3023f4 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:BL0PR2101MB1092; x-ms-traffictypediagnostic: BL0PR2101MB1092: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231101)(2400082)(944501161)(6055026)(61426038)(61427038)(6041288)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:BL0PR2101MB1092;BCL:0;PCL:0;RULEID:;SRVR:BL0PR2101MB1092; x-forefront-prvs: 05724A8921 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(39380400002)(376002)(346002)(396003)(366004)(189003)(199004)(3280700002)(14454004)(3660700001)(105586002)(3846002)(6666003)(22452003)(6116002)(99286004)(305945005)(7736002)(2950100002)(66066001)(478600001)(54906003)(110136005)(68736007)(316002)(86362001)(106356001)(186003)(26005)(59450400001)(6506007)(76176011)(6346003)(10090500001)(575784001)(102836004)(6436002)(4326008)(8936002)(2501003)(53936002)(86612001)(2900100001)(6486002)(2906002)(6512007)(25786009)(97736004)(72206003)(1076002)(107886003)(36756003)(5660300001)(5250100002)(8676002)(81156014)(81166006)(10290500003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR2101MB1092;H:BL0PR2101MB1027.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: bPahcEO6wYOBkysWSXidvSNzQUM8Cl3b+n9b9sLrYLM66SZEuP9th/Qqgtdd82jlZ6NeaYfKGBlSG8ebOWF8tA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6662b8b2-8256-4881-99d2-08d56b3023f4 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2018 18:00:50.5659 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1092 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pablo Neira Ayuso [ Upstream commit 24c0df82ef7919e4d10cf2e4e65d368eb2e8ea21 ] ctx->chain may be null now that we have very large object names, so we cannot check for ctx->chain[0] here. Fixes: b7263e071aba7 ("netfilter: nf_tables: Allow table names of up to 255= chars") Signed-off-by: Pablo Neira Ayuso Acked-by: Phil Sutter Signed-off-by: Sasha Levin --- net/netfilter/nf_tables_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 64e1ee091225..ce49946f755e 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -2072,7 +2072,7 @@ static int nf_tables_dump_rules(struct sk_buff *skb, continue; =20 list_for_each_entry_rcu(chain, &table->chains, list) { - if (ctx && ctx->chain[0] && + if (ctx && ctx->chain && strcmp(ctx->chain, chain->name) !=3D 0) continue; =20 --=20 2.11.0