Message ID | 1266583307-3049-2-git-send-email-fwestphal@astaro.com |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
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 {
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@sipsolutions.net> Signed-off-by: Florian Westphal <fwestphal@astaro.com> --- no changes since v1. net/netlink/af_netlink.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)