From owner-freebsd-bugs@FreeBSD.ORG Thu Feb 19 17:50:55 2015 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D88171BC for ; Thu, 19 Feb 2015 17:50:55 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5B2D83C for ; Thu, 19 Feb 2015 17:50:55 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t1JHotsW000911 for ; Thu, 19 Feb 2015 17:50:55 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 197535] [re] [panic] if_re (Realtek 8168) causes memory write after free and kernel panic Date: Thu, 19 Feb 2015 17:50:55 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: luca.pizzamiglio@gmail.com X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: mfc-stable10? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2015 17:50:55 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197535 --- Comment #9 from luca.pizzamiglio@gmail.com --- I collect some other information about this error and I'm a little bit confused. 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 @ 0xfffff800069da800 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.