From nobody Tue Feb 20 17:34:52 2024 X-Original-To: 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 4TfRP913h3z543mt for ; Tue, 20 Feb 2024 17:34:53 +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 4TfRP900gqz4JLY for ; Tue, 20 Feb 2024 17:34:53 +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=1708450493; 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: in-reply-to:in-reply-to:references:references; bh=AZVb3afh3DW7bHQOiKGtkWBxkiU2NseAbuyCeoQ8nKw=; b=MJHzeVM6VGe9U3k5qKmLP1rFMkJcCdFfwteGt4gcVCXnBaaXTpT6bCNS+64vcRgAOudTw0 6BC74B7WTVE+TTHkMg5Jp9FwjpoI8iKxb94HJa5UCiNGB+e9Q2UmAzqYT1ufrEzT9sZSpQ 7f5+KjbAYQd7yL2epp64vZrZoCcd/8dBTJacWnvolfuCxMxeAqsW19hNrv4aTgCPCIhOYV 1/Av1W8F6CHK6bTNPVNC91NR74w5iyJDwyVwla2crUMaq1CWVjBEzONEnKEvl62PBsRmfr HTFM3UL24Q/dzj13JWxxZG4IdayqxsQdmUtxFAfalUhJYWWsDZNihi/oZcih6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708450493; a=rsa-sha256; cv=none; b=LmTyJJpPa3u/oxndP+GXL8veeNLGefpGVptVkC+RePS2LDIKHnH6Tcnh2CsL0FNHlatH7N lArAr1lbsb7l11lQTsXSoc12lXHS9JU6md8RFx6VsehQz3UTe+mgxHR5OgVnUw30yZIdh4 BXzd8K0yhbNtClGe8+rakpuLYH74TWXe47Q5B0ESXrL+YxMJDgzgvGWTZa02UfK+zbqDPg 4UOmZgfAL0xdJeIv/AtCaMGD84/dPgqNdX9XpCjWOFJJqy4fD9eApW2lrG0uISZgLMneGv nyw4gvPm37+Hv54M0AtPJPpRVMG3twENUdUNlrseckF3tW2y/zwW/AwzPwWtJA== 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 4TfRP8697hzSFK for ; Tue, 20 Feb 2024 17:34:52 +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 41KHYqR9039732 for ; Tue, 20 Feb 2024 17:34:52 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 41KHYqt4039730 for bugs@FreeBSD.org; Tue, 20 Feb 2024 17:34:52 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: bugs@FreeBSD.org Subject: [Bug 272965] 14.0-ALPHA1 too: armv7 'Alignment Fault' on read panic during udp_input for kyua's sys/netinet6/exthdr:exthdr ; other udp_input related panics Date: Tue, 20 Feb 2024 17:34:52 +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: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: glebius@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272965 --- Comment #11 from Gleb Smirnoff --- On Thu Dec 21 04:15:04 2023 UTC, mmel@FreeBSD.org wrote: > Unfortunately, I can't agree with that. Aligning the input mbuf is only p= apering > over the real problem and can only work for trivial cases. It doesn't he= lp for > vlans (unless HW strips header), for various protocol encapsulations and = most > importantly it doesn't work at all for IPv6 :( >=20 > The real problem is that our network stack uses undefined behavior. We ca= n alias > a byte buffer to a structure only if the given buffer pointer is conform = with > the desired structure alignment, otherwise the behavior is undefined. Thi= s is, > strictly speaking , required for every architecture. The only way we can = reduce > the required alignment is by using the packed attribute for the affected > structures... I could be wrong, but AFAIU, the network protocols are all designed in such= a manner, that as they stack up on each other, all fields in protocol headers= are aligned, as long as the base of the packet is aligned. So, if the driver m= akes sure 'struct ether_header' is aligned, the upper protocols will also see th= eir headers aligned. A misaligned read may happen only in something like an accept_filter(9) that will read into packet payload. And of course all structures defining network headers are marked with __packed. --=20 You are receiving this mail because: You are the assignee for the bug.=