[Bug 197535] [re] [panic] if_re (Realtek 8168) causes memory write after free and kernel panic

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Feb 19 17:50:55 UTC 2015


--- Comment #9 from luca.pizzamiglio at gmail.com ---
I collect some other information about this error and I'm a little bit
I added some printf in the re_rxeof() function, to understand who's overwriting
the memory after free (my suspect was the DMA was writing in the wrong place):

re0: idx 22 - rxstat 0x3201C040 - cur_rx at 0xfffff8000179b160
re0: rl_rx_list 0xfffff8000179b000 - rl_rx_list_addr 0x179b000
Memory modified after free 0xfffff800069da800(2048) val=ffffffff @
re0: newbuf m 0xfffff800069f0600 - segs.ds_addr 0x00000000069da800
re0: newbuf m->m_data 0xfffff800069da800

rl_rx_list is the pointer to the rl_desc list
rl_rx_list_addr is the phy address used by the device (DMA segment)
The newbuf function allocate a new mbuf and load it in a new dma segment:
m->m_data is the virtual address
segs.ds_addr is the phy address used by the device (DMA segment)

Apparently, the driver can really get data from DMA.
I've still to explain:
* received XX packets, "netstat -s" shows 0 packets received
* after the first 256 packets, the first descriptor of the ring is overwritten
by a new one that is always: rl_desc->cmdstat is 0x80000800 => no packets
* how some rl_desc are flying away causing page faults... 

The Linux firmware actually is not a real firmware, but it seems to me a way to
encode and hide the chip initialization.

You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-bugs mailing list