From nobody Wed May 31 22:36:54 2023 X-Original-To: freebsd-arm@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 4QWkdz4nLLz4XktC for ; Wed, 31 May 2023 22:36:55 +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 4QWkdy4Xxpz3ynQ for ; Wed, 31 May 2023 22:36:54 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685572614; 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=/MnLhzKi3aGnNnQ4eFOXRXjZ2fJGsjjg13SqWaGTego=; b=xYuFbmtsxBgXhApg8C5Ihxn5JP+Spxp8lwlhL94RaVfUrq3D1Ki+bbC85iPW0lPJVZSmVr VP11FbFqTsw0x02UoPoUCVDcwNvPzqB1YEpFWzr1nD8enQA2pyUPkN/OAOi9ar8I+HvjN2 oRYhR//4DFDJBFf0Pic2ThFfSLfhV3DZr4QGEyonO+Rpqyu2ArA3Mmqh1uXeCTJobjwOud LHmQygvwiJvImNw+Eaf/SrpyRO4Q9wrYo+DbWMDKMvSm7en5Xwce7jzToKHqWGiTV7LkF6 g+pydmTHEDTFaQr8IV/uNHyyGO1CCnyS+eY5xPlYYkT7MNyv5aXJEslz5Bij3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685572614; a=rsa-sha256; cv=none; b=XNVTly6pJTaC7CoS1Sh+fAhNBE7sQTfJ4O/9dXtyXSNOkgLaKlz/Ck9auwuTwOq3A93bMb hE9lkRTJJGwAUHrkEj44i4XKP2t2U9KG8ndZKcq7kNr6Aiuyv1yaQd9nXFw1bFw8JKxWBO yxgQ3ToXRvYKwOS51X8JLAhLIWmhxQ7yz4thXbiDOE+cs1ERDgZAs6lA/bqVW36CsH0XZ6 BiIJ4HjgkhnRghPqLuuElNoKs7TqnQE6nb6KWftlY64pOfbW4FDr/feiLpnJpsKzAgFmKa nOQ1nnnJzcVSnLryf6uGzCWUGZmCk3PFU5fNDlY7fjm9tKwnzncCHcDLqZDKKA== 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 4QWkdy3f4fzsLj for ; Wed, 31 May 2023 22:36:54 +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 34VMasNS048626 for ; Wed, 31 May 2023 22:36:54 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 34VMasGC048625 for freebsd-arm@FreeBSD.org; Wed, 31 May 2023 22:36:54 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: freebsd-arm@FreeBSD.org Subject: [Bug 271759] [panic] [usb] [if_ure] unaligned access Date: Wed, 31 May 2023 22:36:54 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: arm X-Bugzilla-Version: 13.2-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: freebsd@darkain.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-arm@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter 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: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271759 Bug ID: 271759 Summary: [panic] [usb] [if_ure] unaligned access Product: Base System Version: 13.2-STABLE Hardware: arm OS: Any Status: New Severity: Affects Some People Priority: --- Component: arm Assignee: freebsd-arm@FreeBSD.org Reporter: freebsd@darkain.com https://github.com/freebsd/freebsd-src/blob/main/sys/dev/usb/net/if_ure.c#L= L616C1-L617C24 ure_makembuf() has the following code: /* uether_newbuf does this. */ m_adj(m, ETHER_ALIGN); based on that comment, it looks like someone copied m_adj() over because the base usb ethernet driver has it, without really testing it or setting up the mbuf correctly. when m_adj is called here, m->m_len is 0 at this point so the call to m_adj= () does nothing. because of this, the data is never shifted by 2 bytes, causing an unaligned access to the IP headers when byte swapping later in the stack when convert= ing from network-order to host-order, causing a panic on 32-bit ARM systems. NOTE: virtio-net has a similar unaligned access issue, however that driver isn't calling m_adj() at all it looks like. This is referenced over in: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271288 --=20 You are receiving this mail because: You are the assignee for the bug.=