Skip to content

Commit 14e8d56

Browse files
wr0112358gregkh
authored andcommitted
drop_monitor: consider inserted data in genlmsg_end
[ Upstream commit 3b48ab2248e61408910e792fe84d6ec466084c1a ] 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 <wr0112358@gmail.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 81e7916 commit 14e8d56

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

net/core/drop_monitor.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ static struct sk_buff *reset_per_cpu_data(struct per_cpu_dm_data *data)
107107
}
108108
msg = nla_data(nla);
109109
memset(msg, 0, al);
110-
genlmsg_end(skb, msg_header);
111110
goto out;
112111

113112
err:
@@ -117,6 +116,13 @@ static struct sk_buff *reset_per_cpu_data(struct per_cpu_dm_data *data)
117116
swap(data->skb, skb);
118117
spin_unlock_irqrestore(&data->lock, flags);
119118

119+
if (skb) {
120+
struct nlmsghdr *nlh = (struct nlmsghdr *)skb->data;
121+
struct genlmsghdr *gnlh = (struct genlmsghdr *)nlmsg_data(nlh);
122+
123+
genlmsg_end(skb, genlmsg_data(gnlh));
124+
}
125+
120126
return skb;
121127
}
122128

0 commit comments

Comments
 (0)