From nobody Mon Mar 07 19:48:51 2022 X-Original-To: ports-bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F0AE719F97F1 for ; Mon, 7 Mar 2022 19:48:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KC8Cl5G34z3Jdq for ; Mon, 7 Mar 2022 19:48:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94C246A21 for ; Mon, 7 Mar 2022 19:48:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 227JmpCA005300 for ; Mon, 7 Mar 2022 19:48:51 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 227JmpeX005299 for ports-bugs@FreeBSD.org; Mon, 7 Mar 2022 19:48:51 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 262407] net/realtek-re-kmod: kernel panic when generating MAC address Date: Mon, 07 Mar 2022 19:48:51 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: evgeni@debian.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ale@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646682531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ins5kyFElGXj1kA/xFE5dzptfshgudCKPOKCjfFSam8=; b=tVTyRfJpTbg5Hd/TJ1f18nY9IYDupUN6gBSx/lvjDsQlZkxx7y3HTLvE6F74c9luZdBH8D 4xeZQ0Cue0lPCqOuZ1M7KQlsjDQ3TEpTc4GFg9Dpa3hFqNjsalJEx0sKBrAeisb6X48a/H rWxo/nbozVh7NlSCAP3M2r01uTQVNf/s5260xuNq35UDoTRc8aVdnHt/+RjZq4QZYD4JPZ CCe+C8NHy5yrX0EqiDK1a+swzc8F7sX9vkcBzub62WR7ClET9e86BR6ZpXI0CcUXXSsEnv iHojjzH0bfNZc7OKPkmTBzeNCWFKc1dwWDQ4kIs3YL0itxVEtFST+z15hbub/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646682531; a=rsa-sha256; cv=none; b=S5zFc5Fr4W0PTD1WGdT3NdfY3J3YDxc0n87Givp2Bn5I4NsFPPAGbskYzvyd1JkTyL2JBN eLN6lUp/NV7wsrBwPHc2hy2KsEt6l55r4cBjPMnMIxwshftsOmOYblRG2i0M/ZNCxZ3STZ otPSLMslGEZtgmEvtvNhs89aGmjvvnJ/HGhtS6oS43MVNz8ei0KRoHByOM/etqTvaU3gFA timofguYeYEue+f0Evwhih0nlXOsZdy475AcifPsYyLIjR4vrebZPp4bNI13uuCAyWClx/ OBMDBlmn/kCzFJO6/JhT8S1CHmVbgt/WyNXUc/ZVy6XD3pTo9zPkJfw6EuPDiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262407 Bug ID: 262407 Summary: net/realtek-re-kmod: kernel panic when generating MAC address Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: ale@FreeBSD.org Reporter: evgeni@debian.org Flags: maintainer-feedback?(ale@FreeBSD.org) Assignee: ale@FreeBSD.org Ohai, there exists hardware (like [1]) that has no ethernet address burned into t= he EEPROM. Realteks driver (contrary to the one in the FreeBSD kernel, see #262406) tries to accommodate for that by generating a random mac address: 3890- if (!is_valid_ether_addr(eaddr)) { 3891- device_printf(dev,"Invalid ether addr: %6D\n", eaddr, ":"); 3892: random_ether_addr(eaddr); 3893- device_printf(dev,"Random ether addr: %6D\n", eaddr, "= :"); 3894- } However, the net/realtek-re-kmod port patches (in files/patch-if__re.c) the `random_ether_addr` call to be=20 ether_gen_addr(sc->re_ifp, (struct ether_addr *)eaddr); instead. This leads to a crash on my HW, with the following trace: KDB: stack backtrace: #0 0xffff00000050d058 at kdb_backtrace+0x60 #1 0xffff0000004b7228 at vpanic+0x184 #2 0xffff0000004b70a0 at panic+0x44 #3 0xffff000000824d2c at data_abort+0x1d8 #4 0xffff000000805078 at handle_el1h_sync+0x78 #5 0xffff00000051434c at kvprintf+0xbb4 #6 0xffff00000051434c at kvprintf+0xbb4 #7 0xffff000000515100 at vsnprintf+0x3c #8 0xffff0000005c70c8 at vasprintf+0x4c #9 0xffff0000005c7190 at asprintf+0x40 #10 0xffff0000005eb284 at ether_gen_addr+0x74 #11 0xffff000001222294 at re_attach+0x1b90 #12 0xffff0000004f9254 at device_attach+0x400 #13 0xffff0000004fa770 at bus_generic_attach+0x4c #14 0xffff000000236e08 at pci_attach+0xe0 #15 0xffff0000004f9254 at device_attach+0x400 #16 0xffff0000004fa770 at bus_generic_attach+0x4c #17 0xffff0000004f9254 at device_attach+0x400 I am not exactly sure *what* triggers this. At first I thought it'd be the = cast of eaddr, but that *should* work. ether_gen_addr *does* call asprintf, so it might be that? Reverting to the original random code from Realtek works. Thanks! [1] https://www.dfrobot.com/product-2242.html --=20 You are receiving this mail because: You are the assignee for the bug.=