public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* batman-adv: design suggestions
@ 2010-08-09 20:34 Vasiliy Kulikov
  2010-08-09 20:53 ` Sven Eckelmann
  2010-08-13 18:18 ` Vasiliy Kulikov
  0 siblings, 2 replies; 10+ messages in thread
From: Vasiliy Kulikov @ 2010-08-09 20:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Andrew Lunn, Sven Eckelmann, Marek Lindner,
	Simon Wunderlich, devel, linux-kernel

Hi folks,

I was reading batman-adv sources and noted:


1) Some incoming packets may cause a storm of error logs, such as at
routing.c:862


	if (icmp_packet->msg_type != ECHO_REQUEST) {
		pr_warning("Warning - can't forward icmp packet from %pM to "
			   "%pM: ttl exceeded\n", icmp_packet->orig,
			   icmp_packet->dst);

  Any flooding bad guy is able to fill our disks with logs.
  This should be logged only at some slow rate (e.g. 5 logs/sec) or as
  pr_debug().


2) It seems to me that NF_HOOK() at hard-interface.c:458 is misused:

    ...
	ret = NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, dev, NULL,
		      batman_skb_recv_finish);
	if (ret != 1)
		goto err_out;

	/* packet should hold at least type and version */
	if (unlikely(skb_headlen(skb) < 2))
		goto err_free;

	/* expect a valid ethernet header here. */
	if (unlikely(skb->mac_len != sizeof(struct ethhdr)
				|| !skb_mac_header(skb)))
		goto err_free;
    ...

    static int batman_skb_recv_finish(struct sk_buff *skb)
    {
        return NF_ACCEPT;
    }

  As I understand, if there is any hook that returns NF_STOLEN, then skb
  is leaked.


Thanks,
Vasiliy.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-08-14 17:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-09 20:34 batman-adv: design suggestions Vasiliy Kulikov
2010-08-09 20:53 ` Sven Eckelmann
2010-08-12 12:48   ` Vasiliy Kulikov
2010-08-14 14:50     ` Marek Lindner
2010-08-14 16:19       ` Vasiliy Kulikov
2010-08-14 17:10         ` Marek Lindner
2010-08-13 18:18 ` Vasiliy Kulikov
2010-08-13 23:25   ` Sven Eckelmann
2010-08-14 14:59   ` Marek Lindner
2010-08-14 16:13     ` Vasiliy Kulikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox