[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1270506431-25578-2-git-send-email-fw@strlen.de>
Date: Tue, 6 Apr 2010 00:27:08 +0200
From: Florian Westphal <fw@...len.de>
To: netdev@...r.kernel.org
Cc: johannes@...solutions.net, Florian Westphal <fwestphal@...aro.com>,
Florian Westphal <fw@...len.de>
Subject: [PATCH 1/4] netlink: append NLMSG_DONE to compatskb, too
From: Florian Westphal <fwestphal@...aro.com>
modules using netlink may supply a 2nd skb, (via frag_list)
that contains an alternative data set meant for applications
using 32bit compatibility mode.
In such a case, netlink_recvmsg will use this 2nd skb instead of the
original one.
Without this patch, such compat applications will retrieve
all netlink dump data, but will then get an unexpected EOF.
Cc: Johannes Berg <johannes@...solutions.net>
Signed-off-by: Florian Westphal <fw@...len.de>
---
net/netlink/af_netlink.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 274d977..beaada0 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1709,6 +1709,14 @@ static int netlink_dump(struct sock *sk)
memcpy(nlmsg_data(nlh), &len, sizeof(len));
+#ifdef CONFIG_COMPAT_NETLINK_MESSAGES
+ if (unlikely(skb_shinfo(skb)->frag_list)) {
+ nlh = nlmsg_put_answer(skb_shinfo(skb)->frag_list, cb,
+ NLMSG_DONE, sizeof(len), NLM_F_MULTI);
+ if (nlh)
+ memcpy(nlmsg_data(nlh), &len, sizeof(len));
+ }
+#endif
if (sk_filter(sk, skb))
kfree_skb(skb);
else {
--
1.6.4.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists