From: David Miller <davem@davemloft.net> Date: 2017-01-03 14:55:10
From: Reiter Wolfgang <redacted>
Date: Tue, 3 Jan 2017 01:39:10 +0100
Final nlmsg_len field update must reflect inserted net_dm_drop_point
data.
This patch depends on previous patch:
"drop_monitor: add missing call to genlmsg_end"
Signed-off-by: Reiter Wolfgang <redacted>
I don't understand why the current code doesn't work properly.
All over the tree, the pattern is:
x = genlmsg_put(skb, ...);
...
genlmsg_end(skb, x);
And that is exactly what the code is doing right now.
From: Neil Horman <nhorman@tuxdriver.com> Date: 2017-01-03 16:05:59
On Tue, Jan 03, 2017 at 09:54:19AM -0500, David Miller wrote:
From: Reiter Wolfgang <redacted>
Date: Tue, 3 Jan 2017 01:39:10 +0100
quoted
Final nlmsg_len field update must reflect inserted net_dm_drop_point
data.
This patch depends on previous patch:
"drop_monitor: add missing call to genlmsg_end"
Signed-off-by: Reiter Wolfgang <redacted>
I don't understand why the current code doesn't work properly.
All over the tree, the pattern is:
x = genlmsg_put(skb, ...);
...
genlmsg_end(skb, x);
And that is exactly what the code is doing right now.
Because reset_per_cpu_data should close the use of of the established skb
that was being written to. Without this patch we add the END tlv to the skb
that is just getting started for use in the drop monitor, rather than for the
skb that is getting returned for use in sending up to user space listeners.
Or am I missing something?
From: David Miller <davem@davemloft.net> Date: 2017-01-03 16:12:39
From: Neil Horman <nhorman@tuxdriver.com>
Date: Tue, 3 Jan 2017 11:04:43 -0500
On Tue, Jan 03, 2017 at 09:54:19AM -0500, David Miller wrote:
quoted
From: Reiter Wolfgang <redacted>
Date: Tue, 3 Jan 2017 01:39:10 +0100
quoted
Final nlmsg_len field update must reflect inserted net_dm_drop_point
data.
This patch depends on previous patch:
"drop_monitor: add missing call to genlmsg_end"
Signed-off-by: Reiter Wolfgang <redacted>
I don't understand why the current code doesn't work properly.
All over the tree, the pattern is:
x = genlmsg_put(skb, ...);
...
genlmsg_end(skb, x);
And that is exactly what the code is doing right now.
Because reset_per_cpu_data should close the use of of the established skb
that was being written to. Without this patch we add the END tlv to the skb
that is just getting started for use in the drop monitor, rather than for the
skb that is getting returned for use in sending up to user space listeners.
Or am I missing something?
That's the critical part I didn't see, thanks for explaining.
Applied and queued up for -stabel, thanks.
From: Wolfgang Reiter <hidden> Date: 2017-01-03 23:09:57
Yes, genlmsg_end changes nlmsg_len field dependent on skb->tail.
After allocation in reset_per_cpu_data skb->tail is modified in
trace_drop_common via __nla_reserve_nohdr.
Best place for setting nlmsg_len to its final value is after being
swapped out in reset_per_cpu_data.
Neil Horman [off-list ref] writes:
On Tue, Jan 03, 2017 at 09:54:19AM -0500, David Miller wrote:
quoted
From: Reiter Wolfgang <redacted>
Date: Tue, 3 Jan 2017 01:39:10 +0100
quoted
Final nlmsg_len field update must reflect inserted net_dm_drop_point
data.
This patch depends on previous patch:
"drop_monitor: add missing call to genlmsg_end"
Signed-off-by: Reiter Wolfgang <redacted>
I don't understand why the current code doesn't work properly.
All over the tree, the pattern is:
x = genlmsg_put(skb, ...);
...
genlmsg_end(skb, x);
And that is exactly what the code is doing right now.
Because reset_per_cpu_data should close the use of of the established skb
that was being written to. Without this patch we add the END tlv to the skb
that is just getting started for use in the drop monitor, rather than for the
skb that is getting returned for use in sending up to user space listeners.
Or am I missing something?