Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754152AbbKWRz7 (ORCPT ); Mon, 23 Nov 2015 12:55:59 -0500 Received: from ares41.inai.de ([46.4.122.207]:37612 "EHLO ares41.inai.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753565AbbKWRz4 (ORCPT ); Mon, 23 Nov 2015 12:55:56 -0500 Date: Mon, 23 Nov 2015 18:55:55 +0100 (CET) From: Jan Engelhardt To: David Laight cc: "'Florian Westphal'" , Tejun Heo , "davem@davemloft.net" , "pablo@netfilter.org" , "kaber@trash.net" , "kadlec@blackhole.kfki.hu" , "daniel@iogearbox.net" , "daniel.wagner@bmw-carit.de" , "nhorman@tuxdriver.co" , "lizefan@huawei.com" , "hannes@cmpxchg.org" , "netdev@vger.kernel.org" , "netfilter-devel@vger.kernel.org" , "coreteam@netfilter.org" , "cgroups@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kernel-team@fb.com" , "ninasc@fb.com" , Neil Horman Subject: RE: [PATCH 9/9] netfilter: implement xt_cgroup cgroup2 path match In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1CBDA8E2@AcuExch.aculab.com> Message-ID: References: <1448122441-9335-1-git-send-email-tj@kernel.org> <1448122441-9335-10-git-send-email-tj@kernel.org> <20151121165605.GC25336@breakpoint.cc> <063D6719AE5E284EB5DD2968C1650D6D1CBDA8E2@AcuExch.aculab.com> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1058 Lines: 30 On Monday 2015-11-23 18:35, David Laight wrote: >From: Florian Westphal >> Sent: 21 November 2015 16:56 >> > +struct xt_cgroup_info_v1 { >> > + char path[PATH_MAX]; >> > + __u32 classid; >> > + >> > + /* kernel internal data */ >> > + void *priv __attribute__((aligned(8))); >> > +}; >> >> Ahem. Am I reading this right? This struct is > 4k in size? >> If so -- Ugh. Does sizeof(path) really have to be PATH_MAX? > >I've not looked at the use, but could you put 'char path[];' >as the last member an require any allocations to be long enough >to contain the actual path? Oh, smart :) Yeah, ebt_among does something like that. (.matchsize = -1, hint) Except that the "priv" pointer seems to be ruining the fun here - kernel vars have to be last, which collides with the requirements for []-type members. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/