From patchwork Mon Feb 26 09:15:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 877746 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=nbd.name Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=nbd.name header.i=@nbd.name header.b="G/wbjY5W"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zqblg568mz9s1q for ; Mon, 26 Feb 2018 20:15:43 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752208AbeBZJPm (ORCPT ); Mon, 26 Feb 2018 04:15:42 -0500 Received: from nbd.name ([46.4.11.11]:58246 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752005AbeBZJPa (ORCPT ); Mon, 26 Feb 2018 04:15:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=HrpNsFO5ZJDYQoBjGoZ4ci5FTt2aAAxjPUxgINFvwQM=; b=G/wbjY5WNQ1NO2wA87vmortjTt mhGZCZx7Y0E+nizob8LYzl8yx7xBkRMhIaKgfo61aQQcOtl4FTe/Ynt6uxpcibVfUvnE18Kn1A6ZA DHD/0AELS4nL3RYNpvjhWJ7k6xLfLdghpj/d5J5y6zc4MdIXWfaLoiPg0CgDUqkDdDUk=; Received: by maeck.local (Postfix, from userid 501) id 7538715A004E; Mon, 26 Feb 2018 10:15:25 +0100 (CET) From: Felix Fietkau To: netfilter-devel@vger.kernel.org Cc: pablo@netfilter.org, nbd@nbd.name Subject: [PATCH v3 11/17] netfilter: nf_flow_table: fix priv pointer for netdev hook Date: Mon, 26 Feb 2018 10:15:18 +0100 Message-Id: <20180226091524.47061-12-nbd@nbd.name> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180226091524.47061-1-nbd@nbd.name> References: <20180226091524.47061-1-nbd@nbd.name> Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org The offload ip hook expects a pointer to the flowtable, not to the rhashtable. Since the rhashtable is the first member, this is safe for the moment, but breaks as soon as the structure layout changes Signed-off-by: Felix Fietkau --- 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 4e5d0e918b7b..f0052f8b0b9e 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -4955,7 +4955,7 @@ static int nf_tables_flowtable_parse_hook(const struct nft_ctx *ctx, flowtable->ops[i].pf = NFPROTO_NETDEV; flowtable->ops[i].hooknum = hooknum; flowtable->ops[i].priority = priority; - flowtable->ops[i].priv = &flowtable->data.rhashtable; + flowtable->ops[i].priv = &flowtable->data; flowtable->ops[i].hook = flowtable->data.type->hook; flowtable->ops[i].dev = dev_array[i]; }