* [PATCH net] netlink: reset network header before passing to taps
@ 2014-08-07 20:22 Daniel Borkmann
2014-08-07 23:06 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Borkmann @ 2014-08-07 20:22 UTC (permalink / raw)
To: davem; +Cc: netdev, marcel
netlink doesn't set any network header offset thus when the skb is
being passed to tap devices via dev_queue_xmit_nit(), it emits klog
false positives due to it being unset like:
...
[ 124.990397] protocol 0000 is buggy, dev nlmon0
[ 124.990411] protocol 0000 is buggy, dev nlmon0
...
So just reset the network header before passing to the device; for
packet sockets that just means nothing will change - mac and net
offset hold the same value just as before.
Reported-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
---
net/netlink/af_netlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index a324b4b..2e152e5 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -213,7 +213,7 @@ static int __netlink_deliver_tap_skb(struct sk_buff *skb,
nskb->protocol = htons((u16) sk->sk_protocol);
nskb->pkt_type = netlink_is_kernel(sk) ?
PACKET_KERNEL : PACKET_USER;
-
+ skb_reset_network_header(nskb);
ret = dev_queue_xmit(nskb);
if (unlikely(ret > 0))
ret = net_xmit_errno(ret);
--
1.7.11.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] netlink: reset network header before passing to taps
2014-08-07 20:22 [PATCH net] netlink: reset network header before passing to taps Daniel Borkmann
@ 2014-08-07 23:06 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-08-07 23:06 UTC (permalink / raw)
To: dborkman; +Cc: netdev, marcel
From: Daniel Borkmann <dborkman@redhat.com>
Date: Thu, 7 Aug 2014 22:22:47 +0200
> netlink doesn't set any network header offset thus when the skb is
> being passed to tap devices via dev_queue_xmit_nit(), it emits klog
> false positives due to it being unset like:
>
> ...
> [ 124.990397] protocol 0000 is buggy, dev nlmon0
> [ 124.990411] protocol 0000 is buggy, dev nlmon0
> ...
>
> So just reset the network header before passing to the device; for
> packet sockets that just means nothing will change - mac and net
> offset hold the same value just as before.
>
> Reported-by: Marcel Holtmann <marcel@holtmann.org>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Applied and queued up for -stable.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-07 23:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-07 20:22 [PATCH net] netlink: reset network header before passing to taps Daniel Borkmann
2014-08-07 23:06 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).