From patchwork Tue Dec 1 01:54:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 106614 Received: from mail-dy1-f182.google.com (mail-dy1-f182.google.com [74.125.82.182]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.2336.1796090072748139123 for ; Mon, 30 Nov 2026 17:54:32 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=BjIhwCnS; spf=pass (domain: gmail.com, ip: 74.125.82.182, mailfrom: raj.khem@gmail.com) Received: by mail-dy1-f182.google.com with SMTP id 5a478bee46e88-386c71feeeaso8411326eec.0 for ; Mon, 30 Nov 2026 17:54:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796090072; x=1796694872; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=Sz1TZ59gZIjjyRRpMDg1jlC3iixbT8aBOAEPbkPePKI=; b=BjIhwCnSqG59vRkol2i/Q814u7060WQQs2oHI27n3UvGLMt/NPHAbZWkdV89B8N7li bt1Kr9YNoAdE7CL8+va8/SCzath9XsG8oNPLnWR47a3+1axiNsBQohEvxVzhCe2XBNx1 ZCiAdSfsVFoNhuhWvA7uDqwj4NfEw9ycw1XKW/oJln/iuDtX91dBlSjQi6wd9XLSxnSL g0zJqiNAuI9gs/lTsvxgh/MYCn4YCA/52QkGTJZV0Q+iXQeuSayUKgwyI0+aQ7fNMqh0 0dgarlVoFMS/MN90UgIP2bORBdVSBU2kUaSQGap9P/80K8gAENvy9cWBOVo3GdCgzknf nQxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796090072; x=1796694872; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:sub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ekOIompHf/qPjas2qozWOgs07v7U1bQYUPS0FRdSwZBSOUo0ogTLHdLS/diLGhR/BKA9l/FkTC U9Ry1im1yHREdDd3ar2EaCutd8bez780FUVdEIp/vZsqftBWnHViKSbzEFIBrkuW6pAQUQ3f+RX nuSXRVfPKCDiIQWP3Q3sHJ1c+kLjDFHOf04LDRJ/rS6s5zRASvQtuDO84bGcls/DVPv7Mfm1gS7 KXLj58sbFfLz5yi7CYHGQKoICb7nj4/1pxKNo6eElYA8dM04XGBu/3HUnTHLMnDUGux6u6wgLsb d/lmNcSVrNe+/Qc1OTNXymMDx4VtOiojkyMZ8SloPrG9BPKmetTveioiImb9xsLU9HIZU21Sy8G FguP X-Received: by 2002:a05:7300:1c95:b0:385:8851:fa4a with SMTP id 5a478bee46e88-385885211c2mr34411996eec.6.1796090071822; Mon, 30 Nov 2026 17:54:31 -0800 (PST) Return-Path: Received: from apollo.tail3ccdd3.ts.net ([147.160.63.35]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-386aaae4960sm70345787eec.18.2026.11.30.17.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 17:54:31 -0800 (PST) From: Khem Raj X-Google-Original-From: Khem Raj To: openembedded-devel@lists.openembedded.org Cc: Khem Raj Subject: [meta-oe][PATCH] syzkaller: Fix check-syzos with llvm-objdump on x86-64 Date: Mon, 30 Nov 2026 17:54:29 -0800 Message-ID: <20261201015429.3533511-1-khem.raj@oss.qualcomm.com> X-Mailer: git-send-email 2.56.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Tue, 01 Dec 2026 01:54:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/133618 Since check-syzos.sh uses $OBJDUMP, x86-64 builds with the clang toolchain run llvm-objdump instead of the host GNU objdump. llvm-objdump prints RIP-relative targets as "# 0x2cf730 ", which the script's hex2dec() cannot parse, so check_syzos reports every RIP-relative instruction in the guest section and do_compile fails: [FAIL] Found problematic data access instructions in 'guest'. In function <_ZL28guest_handle_set_irq_handlerP10api_call_2>: 2d0018: 48 8d 15 11 f7 ff ff leaq -0x8ef(%rip), %rdx # 0x2cf730 <__start_guest> All of these targets are inside the guest section. Add a patch that strips the 0x prefix before the address is converted. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj --- ...Accept-0x-prefixed-targets-from-llvm.patch | 38 +++++++++++++++++++ .../recipes-test/syzkaller/syzkaller_git.bb | 1 + 2 files changed, 39 insertions(+) create mode 100644 meta-oe/recipes-test/syzkaller/syzkaller/0002-tools-check-syzos.sh-Accept-0x-prefixed-targets-from-llvm.patch diff --git a/meta-oe/recipes-test/syzkaller/syzkaller/0002-tools-check-syzos.sh-Accept-0x-prefixed-targets-from-llvm.patch b/meta-oe/recipes-test/syzkaller/syzkaller/0002-tools-check-syzos.sh-Accept-0x-prefixed-targets-from-llvm.patch new file mode 100644 index 0000000000..f3e89c20ed --- /dev/null +++ b/meta-oe/recipes-test/syzkaller/syzkaller/0002-tools-check-syzos.sh-Accept-0x-prefixed-targets-from-llvm.patch @@ -0,0 +1,38 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 30 Nov 2026 15:09:08 -0800 +Subject: [PATCH] tools/check-syzos.sh: Accept 0x-prefixed targets from + llvm-objdump + +For amd64 the script takes the target address of each RIP-relative +instruction from the objdump comment. GNU objdump prints it without a +prefix ("# 2cf730 <__start_guest>"), llvm-objdump with one +("# 0x2cf730 <__start_guest>"). hex2dec() rejects the "x", so with +llvm-objdump every RIP-relative instruction in the guest section is +reported, including references inside the section: + + [FAIL] Found problematic data access instructions in 'guest'. + In function <_ZL28guest_handle_set_irq_handlerP10api_call_2>: + 2d0018: 48 8d 15 11 f7 ff ff leaq -0x8ef(%rip), %rdx # 0x2cf730 <__start_guest> + +Strip an optional 0x prefix before converting the address. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + tools/check-syzos.sh | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tools/check-syzos.sh b/tools/check-syzos.sh +index 3f1b6a9..d66a068 100644 +--- a/tools/check-syzos.sh ++++ b/tools/check-syzos.sh +@@ -181,6 +181,8 @@ amd64|arm64|loong64) + if (!sub(/^.*#[[:space:]]*/, "", target_hex)) + next + sub(/[[:space:]].*$/, "", target_hex) ++ # llvm-objdump prints the target as 0x, GNU objdump as . ++ sub(/^0[xX]/, "", target_hex) + target = hex2dec(target_hex) + if (target < 0 || target < guest_start || target >= guest_end) + report(0) diff --git a/meta-oe/recipes-test/syzkaller/syzkaller_git.bb b/meta-oe/recipes-test/syzkaller/syzkaller_git.bb index 384eeb0bb7..59e8efb371 100644 --- a/meta-oe/recipes-test/syzkaller/syzkaller_git.bb +++ b/meta-oe/recipes-test/syzkaller/syzkaller_git.bb @@ -8,6 +8,7 @@ require ${BPN}-licenses.inc SRC_URI = "git://${GO_IMPORT};protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX};branch=master \ file://0001-tools-check-syzos.sh-Use-OBJDUMP-when-it-is-set.patch;patchdir=src/${GO_IMPORT} \ + file://0002-tools-check-syzos.sh-Accept-0x-prefixed-targets-from-llvm.patch;patchdir=src/${GO_IMPORT} \ " SRCREV = "e1f06033b21b05580a0f70130bae79f56b54f31b" require ${BPN}-go-mods.inc