RE: [PATCH 9/9] netfilter: implement xt_cgroup cgroup2 path match

From
Jan Engelhardt <hidden>
Date
2015-11-23 17:55:59
Also in
cgroups, lkml, netfilter-devel
Reply to
David Laight, 2015-11-23
On Monday 2015-11-23 18:35, David Laight wrote:
From: Florian Westphal
quoted
Sent: 21 November 2015 16:56
quoted
+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.
Thread (37 messages) 37 messages, 8 authors, last reply 2015-11-23
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help