[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1266583307-3049-2-git-send-email-fwestphal@astaro.com>
Date: Fri, 19 Feb 2010 13:41:43 +0100
From: Florian Westphal <fwestphal@...aro.com>
To: netdev@...r.kernel.org
Cc: johannes@...solutions.net, Florian Westphal <fwestphal@...aro.com>
Subject: [PATCH 1/5] netlink: append NLMSG_DONE to compatskb, too
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 <fwestphal@...aro.com>
---
no changes since v1.
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 4c5972b..4910031 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1698,6 +1698,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.3.3
--
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