Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2195953/?format=api
{ "id": 2195953, "url": "http://patchwork.ozlabs.org/api/patches/2195953/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260212140917.1443253-4-peter.maydell@linaro.org/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260212140917.1443253-4-peter.maydell@linaro.org>", "list_archive_url": null, "date": "2026-02-12T14:09:15", "name": "[3/5] net: mark struct eth_header as QEMU_PACKED", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "406bdbc9c9801ad5f1c546a9a7dfa7a660342b33", "submitter": { "id": 5111, "url": "http://patchwork.ozlabs.org/api/people/5111/?format=api", "name": "Peter Maydell", "email": "peter.maydell@linaro.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260212140917.1443253-4-peter.maydell@linaro.org/mbox/", "series": [ { "id": 491981, "url": "http://patchwork.ozlabs.org/api/series/491981/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=491981", "date": "2026-02-12T14:09:12", "name": "net: mark eth_header, udp_header, tcp_header as QEMU_PACKED", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/491981/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2195953/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2195953/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=ZweqdSax;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fBchv2sh3z1xr1\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 13 Feb 2026 01:13:19 +1100 (AEDT)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vqXNv-0000hY-PV; Thu, 12 Feb 2026 09:09:36 -0500", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>)\n id 1vqXNo-0000gC-6V\n for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:09:29 -0500", "from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>)\n id 1vqXNm-0006QC-Eo\n for qemu-devel@nongnu.org; Thu, 12 Feb 2026 09:09:27 -0500", "by mail-wm1-x32d.google.com with SMTP id\n 5b1f17b1804b1-4801c2fae63so65897575e9.2\n for <qemu-devel@nongnu.org>; Thu, 12 Feb 2026 06:09:26 -0800 (PST)", "from lanath.. (wildly.archaic.org.uk. [81.2.115.145])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-4835dd0e327sm123266885e9.14.2026.02.12.06.09.23\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 12 Feb 2026 06:09:23 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1770905365; x=1771510165; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=R3cLi2JyUm8wKd97bhkRBOBT0oLXAVRHi0iTXd33KdY=;\n b=ZweqdSaxwMnuxbs0GxNbZdZeGUI8d6h/xXdSFqsC6s93XzXckb59j4BJ/IsR6+84lb\n oVac8Fkcjp8Y2mzrRnZnHrj7DwEXzyO2sgSeUz42Gs8sdEAKEN+3tcpfEghFkKqu25+1\n v77FdKmfoqSQQyuG5o8ZrGeKs3qAapzPf+Pkb2OxETFifMsjBgq99ANX6oyLFoZZq54f\n EVPQHvbz8+UiAT6lIlv7Jo5vi/Xlg7TYCS/wujAuqjCE6TVOFc2DOfxx0lUTLSV3P8kI\n arYKFJfKKRyv95lOz2wj95ZzF8caRdRS9R4pQrl5n1PwUWn2KlH1BjmskhpJc60hiVHv\n 7dmQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1770905365; x=1771510165;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=R3cLi2JyUm8wKd97bhkRBOBT0oLXAVRHi0iTXd33KdY=;\n b=wF6EutAqcJjvRykIxTUqVLxdgPECGFdsEHolLA1AGiO7zb/7CadF0oatLiT2FTNCyH\n XcbegAgbKqULCc9D8dUWo53ssJ5bg9yD2pfqNt+fAhP08r8hlhZqvevWe1Bd9/plv2V0\n xx00+JKzcXMn+vazeKa0MpHJfOx3zmZUyni6EpKIaPxhqG+DhpFdZ+KhiBOSMvJCEfLy\n +gRhpL5GbywHgfvpyBt7YXZefE0b8Rk2hiV2SPSH9Yn9/+WQhx3w2jDYcanQlru0HQYD\n dTs4PCITjuMsiab62drwqORdJPmsjnphYNARDBMiB5yTDZJ2xDrTQoar9fdfXsM03GPR\n b5WQ==", "X-Gm-Message-State": "AOJu0YylwVma2ObcXvpy2fp/rv5DgE34GXBp+UAtugVrovVDnwrWhNcI\n P+y+La6R8KcPNkk7OMBXPTAfk6xX1Wl91hSZ/ZYZNs5rB8VDjcIowjAHQ0v14f4te21nhNZzlwd\n /j/8w", "X-Gm-Gg": "AZuq6aK1ju8tnEAEvcHI6lMfggD+2Ud4tj1VYQ0XSPZK6bLpUbpbGkwrC4+3N6n7YUy\n fWqMwEQIR6jp6Kih01xwHkLVD1ngT0gQbJNSSQthPsE6E8cTAVnz7pp4H7rISLYVjnWbgb6tXcj\n ACK5C9r3d6T1lFrhTbXcYvPHssvtNssMnDfZKOZasjLE2/YWTiMTeWBWqeJfeMb41tVZx1JFb5p\n 1fI+jebhBwe79/Ru4OlmpUkXjwQ+MyAk0StyQfDz0B3MwP4KIeNMnrC01mszUs0FdIdpjP8d76Q\n 8sMdEiRUTr75zZFB7Oc63j5LlMbuvewDpbxv4RtX0eHEuIWUParULLyHBsaWbCgVcbrZK+67gIt\n 0eshipP/jqs5xLaFf+tQ84WatfobDqPMB4X0q8Ha2RIBd9dCIkgtrUB0M4Msetdr0K9Ib8z0YvJ\n ZPJeQyLG71+wfUSWgrPjBCKJaFrgivD/UcZZeIQElptLPn8YwLvTuQ5OM6EhzGW44SNn2/jbmSL\n JoOUsPh7zQ7OUI5cZvdrXtWmxsO9Mw=", "X-Received": "by 2002:a05:600c:8b2e:b0:471:14af:c715 with SMTP id\n 5b1f17b1804b1-483656ae449mr37134725e9.3.1770905364554;\n Thu, 12 Feb 2026 06:09:24 -0800 (PST)", "From": "Peter Maydell <peter.maydell@linaro.org>", "To": "qemu-devel@nongnu.org", "Cc": "Jiri Pirko <jiri@resnulli.us>, Jason Wang <jasowang@redhat.com>,\n Dmitry Fleytman <dmitry.fleytman@gmail.com>,\n Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>,\n Patrick Venture <venture@google.com>", "Subject": "[PATCH 3/5] net: mark struct eth_header as QEMU_PACKED", "Date": "Thu, 12 Feb 2026 14:09:15 +0000", "Message-ID": "<20260212140917.1443253-4-peter.maydell@linaro.org>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260212140917.1443253-1-peter.maydell@linaro.org>", "References": "<20260212140917.1443253-1-peter.maydell@linaro.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=2a00:1450:4864:20::32d;\n envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.google.com", "X-Spam_score_int": "-20", "X-Spam_score": "-2.1", "X-Spam_bar": "--", "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no", "X-Spam_action": "no action", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "qemu development <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "The eth_header is not actually guaranteed to be aligned. We attempt\nto deal with this in some places such as net_checksum_calculate() by\nusing lduw_be_p() and so on to access the fields, but this is not\nsufficient to be correct, because even accessing a byte member within\na misaligned struct is undefined behaviour. The clang sanitizer will\nemit an error like this if you run the sifive_u_mmc functional test\nwith sanitizers enabled:\n\n../../net/checksum.c:78:47: runtime error: member access within misaligned address 0x561f52f35011 for type 'struct eth_header', which requires 2 byte alignment\n0x561f52f35011: note: pointer points here\n 00 00 00 00 33 33 00 00 00 16 52 54 00 12 34 56 86 dd 60 00 00 00 00 24 00 01 00 00 00 00 00 00\n ^\n #0 0x561f20608459 in net_checksum_calculate /home/pm215/qemu/build/clang/../../net/checksum.c:78:47\n #1 0x561f20117bfa in gem_transmit /home/pm215/qemu/build/clang/../../hw/net/cadence_gem.c:1386:21\n #2 0x561f20115c61 in gem_write /home/pm215/qemu/build/clang/../../hw/net/cadence_gem.c:1650:13\n\nSUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../net/checksum.c:78:47\n\nFix this by marking the eth_header struct as QEMU_PACKED, so that the\ncompiler knows it might be unaligned and will generate the right code\nfor accessing fields.\n\nThis is similar to commit f8b94b4c520 (\"net: mark struct ip_header as\nQEMU_PACKED\") where we fixed this for a different struct defined in\nthis file.\n\nSigned-off-by: Peter Maydell <peter.maydell@linaro.org>\n---\nThis came up back at the beginning of last year:\nhttps://lore.kernel.org/qemu-devel/CAFEAcA-gyMTz-KpmamyXcKX9QOL=yYHDMPRF2Xji_uJbG02WpA@mail.gmail.com/\nbut we never got around to making the fix.\n---\n include/net/eth.h | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)", "diff": "diff --git a/include/net/eth.h b/include/net/eth.h\nindex 14c34f530f..63f598d7cd 100644\n--- a/include/net/eth.h\n+++ b/include/net/eth.h\n@@ -39,7 +39,7 @@ struct eth_header {\n uint8_t h_dest[ETH_ALEN]; /* destination eth addr */\n uint8_t h_source[ETH_ALEN]; /* source ether addr */\n uint16_t h_proto; /* packet type ID field */\n-};\n+} QEMU_PACKED;\n \n struct vlan_header {\n uint16_t h_tci; /* priority and VLAN ID */\n", "prefixes": [ "3/5" ] }