[haiku-bugs] Re: [Haiku] #9099: KDL on load with Atheros L1 Gigabit Ethernet (built in ASUS M51SN laptop)

  • From: "kvark" <trac@xxxxxxxxxxxx>
  • Date: Wed, 31 Oct 2012 14:52:06 -0000

#9099: KDL on load with Atheros L1 Gigabit Ethernet (built in ASUS M51SN laptop)
----------------------------------+----------------------------------
   Reporter:  kvark               |      Owner:  axeld
       Type:  bug                 |     Status:  new
   Priority:  high                |  Milestone:  R1
  Component:  Servers/net_server  |    Version:  R1/Development
 Resolution:                      |   Keywords:  atheros,ethernet,KDL
 Blocked By:                      |   Blocking:
Has a Patch:  0                   |   Platform:  x86
----------------------------------+----------------------------------

Comment (by kvark):

 I found some suspicious code in Atheros ethernet driver.
 File: /haiku/src/add-
 ons/kernel/drivers/network/attansic_l1/dev/age/if_age.c
 Line: 3045
 (looking from here:
 
http://code.metager.de/source/xref/haiku/src/libs/compat/freebsd_network/fbsd_busdma_x86.c#792)

 {{{
 bus_dma_segment_t segs[1];
 }}}

 The host function (''age_newbuf'') allocates 1-element array of segments
 on the stack, while the receiver function (''bus_dmamap_load_mbuf_sg'') is
 free to use a number of them. That can easily cause page fault in the
 stack area (what is what happened, as far as I see).

 I don't know what size this array should be, and I would prefer if the
 maximum array size was passed along to the lower-level functions to
 prevent over-writing. Unfortunately, I can't build haiku source at the
 moment to test this, because this laptop doesn't boot at all (as described
 in the bug).

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/9099#comment:1>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: