Discussion:
gre_output() issue.
(too old to reply)
Sean Boudreau
2007-08-13 20:43:21 UTC
Permalink
Hi:

gre_output() isn't checking IFF_RUNNING | IFF_UP
properly. The interesting case is when gre_compute_route()
fails and IFF_RUNNING is knocked down but IFF_UP is left
set. A recursion lock up can result.

Any objections before I commit?

-seanb


Index: net/if_gre.c
===================================================================
RCS file: /cvsroot/src/sys/net/if_gre.c,v
retrieving revision 1.98
diff -r1.98 if_gre.c
611c611,612
< if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == 0 ||
---
if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) !=
(IFF_UP | IFF_RUNNING) ||
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Jason Thorpe
2007-08-14 04:01:33 UTC
Permalink
Post by Sean Boudreau
gre_output() isn't checking IFF_RUNNING | IFF_UP
properly. The interesting case is when gre_compute_route()
fails and IFF_RUNNING is knocked down but IFF_UP is left
set. A recursion lock up can result.
Any objections before I commit?
Not from me.
Post by Sean Boudreau
-seanb
Index: net/if_gre.c
===================================================================
RCS file: /cvsroot/src/sys/net/if_gre.c,v
retrieving revision 1.98
diff -r1.98 if_gre.c
611c611,612
< if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == 0 ||
---
if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) !=
(IFF_UP | IFF_RUNNING) ||
-- thorpej


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Young
2007-08-14 05:50:44 UTC
Permalink
Post by Sean Boudreau
gre_output() isn't checking IFF_RUNNING | IFF_UP
properly. The interesting case is when gre_compute_route()
fails and IFF_RUNNING is knocked down but IFF_UP is left
set. A recursion lock up can result.
Any objections before I commit?
No objections. Can you say more about the recursion lock-up?

Dave
--
David Young OJC Technologies
***@ojctech.com Urbana, IL * (217) 278-3933 ext 24

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Sean Boudreau
2007-08-14 13:42:13 UTC
Permalink
Post by David Young
Post by Sean Boudreau
gre_output() isn't checking IFF_RUNNING | IFF_UP
properly. The interesting case is when gre_compute_route()
fails and IFF_RUNNING is knocked down but IFF_UP is left
set. A recursion lock up can result.
Any objections before I commit?
No objections. Can you say more about the recursion lock-up?
Committed.

You could reproduce the issue as follows where the inner and
outer addrs are the same. This would cause my 3.1 box to
reboot. My 4.0 box would lock hard: probably some spin scenario
after the refactoring to a separate kthread...

# ifconfig -a
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
# route flush > /dev/null
# ifconfig gre0 create
# ifconfig gre0 11.0.0.1 11.0.0.2
# ifconfig gre0 tunnel 11.0.0.1 11.0.0.2
# ping -n 11.0.0.2

-seanb

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...