From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C30D3CBE7C; Mon, 20 Apr 2026 21:27:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776720440; cv=none; b=Fqm6iru0accOewNKfkRjQU46N5+/I4XGViqTnyjHSdUxFopn6B2HyYI833UQhF3GdCnbeIozjq/AE176E2XIxGzp8Ybih3x0k/xQ4inQH2uEibzItyOAEgP4R+VXZsufZ5XArrY7BE1W2hQzCgLEKk7fwg2gerhMtmwVx/QZlNs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776720440; c=relaxed/simple; bh=qlnOmayLZWq5+rChCXv5r4L985/F8fnSk8pZa60Husk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n2bFmz/Wkh1Egg2IRtiRNCrUvA9GrFoWfYKCKfHXNe44e1N0YVEuno6a/v+mSR6AH23UQKRCJbr7nGQml6UwWoz5InsDiuFj7SbZeZz+86l2dA/7gqmifo9nL0vOd4JjrEYyNBiilJXkP7KBMF9muS6NCGCf/HTBbRKMPrQ7NKo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=RfPpc401; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="RfPpc401" Received: from narnia.corp.microsoft.com (unknown [40.78.12.246]) by linux.microsoft.com (Postfix) with ESMTPSA id C80B520B6F01; Mon, 20 Apr 2026 14:27:17 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C80B520B6F01 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1776720439; bh=cYnQboYCTOnpw9a+m4bi+A/DVRLWzC/s3FksZgUhAyQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RfPpc401/CIInzMB08wF01yN4J5CFBzdg+yOaRT1CiKK/npofn2MG80FSbQyBiHbR 3oCFuyH0fd5de19/adcJ/2pEJr1ZDpFHQ8qVWo8wi0SgDlUwlYYO/3xv+66jmb6OOK MLZA6zcbE4BeWJPG5eFncD+xmDGxKODa4qZD9PYA= From: Blaise Boscaccy To: "Blaise Boscaccy" , "Jonathan Corbet" , "Paul Moore" , "James Morris" , "Serge E. Hallyn" , =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , =?UTF-8?q?G=C3=BCnther=20Noack?= , "Dr. David Alan Gilbert" , "Andrew Morton" , James.Bottomley@HansenPartnership.com, dhowells@redhat.com, "Fan Wu" , "Ryan Foster" , "Randy Dunlap" , linux-security-module@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, "Song Liu" Subject: [PATCH v5 08/10] hornet: Add a light skeleton data extractor scripts Date: Mon, 20 Apr 2026 14:26:40 -0700 Message-ID: <20260420212653.438685-9-bboscaccy@linux.microsoft.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260420212653.438685-1-bboscaccy@linux.microsoft.com> References: <20260420212653.438685-1-bboscaccy@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-security-module@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit These script eases light skeleton development against Hornet by generating a data payloads which can be used for signing a light skeleton binary using gen_sig. Signed-off-by: Blaise Boscaccy --- scripts/hornet/extract-insn.sh | 27 +++++++++++++++++++++++++++ scripts/hornet/extract-map.sh | 27 +++++++++++++++++++++++++++ scripts/hornet/extract-skel.sh | 27 +++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100755 scripts/hornet/extract-insn.sh create mode 100755 scripts/hornet/extract-map.sh create mode 100755 scripts/hornet/extract-skel.sh diff --git a/scripts/hornet/extract-insn.sh b/scripts/hornet/extract-insn.sh new file mode 100755 index 0000000000000..52338f057ff6b --- /dev/null +++ b/scripts/hornet/extract-insn.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (c) 2025 Microsoft Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of version 2 of the GNU General Public +# License as published by the Free Software Foundation. + +function usage() { + echo "Sample script for extracting instructions" + echo "autogenerated eBPF lskel headers" + echo "" + echo "USAGE: header_file" + exit +} + +ARGC=$# + +EXPECTED_ARGS=1 + +if [ $ARGC -ne $EXPECTED_ARGS ] ; then + usage +else + printf $(gcc -E $1 | grep "opts_insn" | \ + awk -F"=" '{print $2}' | sed 's/;\+$//' | sed 's/\"//g') +fi diff --git a/scripts/hornet/extract-map.sh b/scripts/hornet/extract-map.sh new file mode 100755 index 0000000000000..c309f505c6238 --- /dev/null +++ b/scripts/hornet/extract-map.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (c) 2025 Microsoft Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of version 2 of the GNU General Public +# License as published by the Free Software Foundation. + +function usage() { + echo "Sample script for extracting instructions" + echo "autogenerated eBPF lskel headers" + echo "" + echo "USAGE: header_file" + exit +} + +ARGC=$# + +EXPECTED_ARGS=1 + +if [ $ARGC -ne $EXPECTED_ARGS ] ; then + usage +else + printf $(gcc -E $1 | grep "opts_data" | \ + awk -F"=" '{print $2}' | sed 's/;\+$//' | sed 's/\"//g') +fi diff --git a/scripts/hornet/extract-skel.sh b/scripts/hornet/extract-skel.sh new file mode 100755 index 0000000000000..6550a86b89917 --- /dev/null +++ b/scripts/hornet/extract-skel.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (c) 2025 Microsoft Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of version 2 of the GNU General Public +# License as published by the Free Software Foundation. + +function usage() { + echo "Sample script for extracting instructions and map data out of" + echo "autogenerated eBPF lskel headers" + echo "" + echo "USAGE: header_file field" + exit +} + +ARGC=$# + +EXPECTED_ARGS=2 + +if [ $ARGC -ne $EXPECTED_ARGS ] ; then + usage +else + printf $(gcc -E $1 | grep "static const char opts_$2" | \ + awk -F"=" '{print $2}' | sed 's/;\+$//' | sed 's/\"//g') +fi -- 2.53.0