diff --git a/SPECS/90/linux/aarch64/0001-arm64-report-guest-crash-to-vmware-hypervisor.patch b/SPECS/90/linux/aarch64/0001-arm64-report-guest-crash-to-vmware-hypervisor.patch deleted file mode 100644 index 1ff2ebf9e2..0000000000 --- a/SPECS/90/linux/aarch64/0001-arm64-report-guest-crash-to-vmware-hypervisor.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 6cb0716fb1c4697ae54f2c92aeac9524f18bab34 Mon Sep 17 00:00:00 2001 -From: Brennan Lamoreaux -Date: Tue, 27 May 2025 17:07:01 +0000 -Subject: [PATCH] arm64: report guest crash to vmware hypervisor - -Register the guest crash reporter to panic_notifier_list, -which will be called at panic time. Guest crash reporter -will report the crash to the hypervisor through -a hypercall. - -Signed-off-by: Brennan Lamoreaux ---- - arch/arm64/kernel/vmware.c | 51 +++++++++++++++++++++++++++++++++++--- - 1 file changed, 47 insertions(+), 4 deletions(-) - -diff --git a/arch/arm64/kernel/vmware.c b/arch/arm64/kernel/vmware.c -index 50391b495..4c19da231 100644 ---- a/arch/arm64/kernel/vmware.c -+++ b/arch/arm64/kernel/vmware.c -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -38,10 +39,12 @@ - (VMWARE_CMD_MESSAGE | MESSAGE_TYPE_SEND) - #define VMWARE_CMD_MSG_CLOSE \ - (VMWARE_CMD_MESSAGE | MESSAGE_TYPE_CLOSE) --#define VMWARE_CMD_GETHZ 45 --#define VMWARE_CMD_MESSAGE 30 --#define VMWARE_CMD_GETVERSION 10 --#define VMWARE_HB_CMD_MESSAGE 0 -+ -+#define VMWARE_CMD_GETHZ 45 -+#define VMWARE_CMD_MESSAGE 30 -+#define VMWARE_CMD_GETVERSION 10 -+#define VMWARE_CMD_REPORTGUESTCRASH 102 -+#define VMWARE_HB_CMD_MESSAGE 0 - - #define RPCI_PROTOCOL_NUM 0x49435052 /* 'RPCI' */ - #define GUESTMSG_FLAG_COOKIE 0x80000000 -@@ -52,6 +55,44 @@ struct vmw_msg { - uint32_t cookie_low; - }; - -+static void vmware_cmd_report_guest_crash(void) -+{ -+ register uint64_t w0 asm("w0") = VMWARE_HYPERVISOR_MAGIC; -+ register uint32_t w1 asm("w1") = 0; -+ register uint32_t w2 asm("w2") = VMWARE_CMD_REPORTGUESTCRASH; -+ register uint32_t w3 asm("w3") = VMWARE_HYPERVISOR_PORT; -+ register uint32_t w7 asm("w7") = X86_IO_W7_WITH | -+ 2 << X86_IO_W7_SIZE_SHIFT; -+ -+ __asm__ __volatile__ ("hvc %[magic]" : -+ "+r" (w0), -+ "+r" (w1), -+ "+r" (w2), -+ "+r" (w3) : -+ "r" (w7), -+ [magic] "i" (X86_IO_MAGIC) : -+ "memory"); -+} -+ -+static int vmware_report_guest_crash(struct notifier_block *self, -+ unsigned long action, -+ void *data) -+{ -+ vmware_cmd_report_guest_crash(); -+ return 0; -+} -+ -+static struct notifier_block vmware_guest_crash_reporter = { -+ .notifier_call = vmware_report_guest_crash -+}; -+ -+static int __init register_guest_crash_reporter(void) -+{ -+ atomic_notifier_chain_register(&panic_notifier_list, -+ &vmware_guest_crash_reporter); -+ return 0; -+} -+ - static bool vmware_log_open(struct vmw_msg *msg) - { - register uint64_t x0 asm("x0") = VMWARE_HYPERVISOR_MAGIC; -@@ -232,6 +273,8 @@ static struct kmsg_dumper kmsg_dumper = { - static void __init vmware_platform_setup(void) - { - kmsg_dump_register(&kmsg_dumper); -+ -+ register_guest_crash_reporter(); - } - - static int __init fdt_find_hyper_node(unsigned long node, --- -2.40.4 - diff --git a/SPECS/90/linux/aarch64/0003-of-overlay-Correct-symbol-path-fixups.patch b/SPECS/90/linux/aarch64/0003-of-overlay-Correct-symbol-path-fixups.patch deleted file mode 100644 index 26faf92852..0000000000 --- a/SPECS/90/linux/aarch64/0003-of-overlay-Correct-symbol-path-fixups.patch +++ /dev/null @@ -1,43 +0,0 @@ -From f5ba852479c7a135948de601c4caf857f795508f Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 6 Feb 2020 12:23:15 +0000 -Subject: [PATCH] of: overlay: Correct symbol path fixups - -When symbols from overlays are added to the live tree their paths must -be rebased. The translated symbol is normally the result of joining -the fragment-relative path (with a leading "/") to the target path -(either copied directly from the "target-path" property or resolved -from the phandle). This translation fails when the target is the root -node (a common case for Raspberry Pi overlays) because the resulting -path starts with a double slash. For example, if target-path is "/" and -the fragment adds a node called "newnode", the label associated with -that node will be assigned the path "//newnode", which can't be found -in the tree. - -Fix the failure case by explicitly replacing a target path of "/" with -an empty string. - -Fixes: d1651b03c2df ("of: overlay: add overlay symbols to live device tree") - -Signed-off-by: Phil Elwell -Signed-off-by: Ajay Kaher ---- - drivers/of/overlay.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c -index 50bbe0e..7e585d2 100644 ---- a/drivers/of/overlay.c -+++ b/drivers/of/overlay.c -@@ -245,6 +245,8 @@ static struct property *dup_and_fixup_symbol_prop( - if (!target_path) - return NULL; - target_path_len = strlen(target_path); -+ if (!strcmp(target_path, "/")) -+ target_path_len = 0; - - new_prop = kzalloc(sizeof(*new_prop), GFP_KERNEL); - if (!new_prop) --- -2.7.4 - diff --git a/SPECS/90/linux/acvp_patches/0004-crypto-AF_ALG-add-DH-keygen-ssgen-API.patch b/SPECS/90/linux/acvp_patches/0004-crypto-AF_ALG-add-DH-keygen-ssgen-API.patch deleted file mode 100644 index deaaccab65..0000000000 --- a/SPECS/90/linux/acvp_patches/0004-crypto-AF_ALG-add-DH-keygen-ssgen-API.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 153a39ad5f1a67709869331821602f8e3c579746 Mon Sep 17 00:00:00 2001 -From: Vikash Bansal -Date: Mon, 25 Jan 2021 11:02:35 +0530 -Subject: [PATCH 4/7] crypto: AF_ALG -- add DH keygen / ssgen API - -Add the flags for handling DH key generation and DH shared -secret generation. - -Signed-off-by: Stephan Mueller ---- - include/uapi/linux/if_alg.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/include/uapi/linux/if_alg.h b/include/uapi/linux/if_alg.h -index 6f3340410..b3d296fba 100755 ---- a/include/uapi/linux/if_alg.h -+++ b/include/uapi/linux/if_alg.h -@@ -59,5 +59,7 @@ struct af_alg_iv { - #define ALG_OP_ENCRYPT 1 - #define ALG_OP_SIGN 2 - #define ALG_OP_VERIFY 3 -+#define ALG_OP_KEYGEN 4 -+#define ALG_OP_SSGEN 5 - - #endif /* _LINUX_IF_ALG_H */ --- -2.17.1 - - diff --git a/SPECS/90/linux/aws/Fix-efa-cmake-to-build-from-local-directory.patch b/SPECS/90/linux/aws/Fix-efa-cmake-to-build-from-local-directory.patch deleted file mode 100644 index 43f000c55f..0000000000 --- a/SPECS/90/linux/aws/Fix-efa-cmake-to-build-from-local-directory.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 7f877277a8febd0a9f6d7c5f65e79bcf0365d5db Mon Sep 17 00:00:00 2001 -From: Him Kalyan Bordoloi -Date: Wed, 14 Dec 2022 18:27:37 -0800 -Subject: [PATCH] Fix efa cmake to build from local directory - -cmake only tries to use /lib/modules//build to get linux headers. -Patch makes sure we can use a local build as well - ---- - kernel/linux/efa/CMakeLists.txt | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/kernel/linux/efa/CMakeLists.txt b/kernel/linux/efa/CMakeLists.txt -index 155113d..55e3599 100644 ---- a/kernel/linux/efa/CMakeLists.txt -+++ b/kernel/linux/efa/CMakeLists.txt -@@ -5,10 +5,13 @@ cmake_minimum_required(VERSION 2.8.11) - project(efa C) - - set(KERNEL_VER "" CACHE STRING "Kernel version to build for") -+set(KERNEL_DIR "" CACHE STRING "Kernel build directory") - if(NOT KERNEL_VER) -- execute_process(COMMAND uname -r OUTPUT_VARIABLE uname_r -+ if(NOT KERNEL_DIR) -+ execute_process(COMMAND uname -r OUTPUT_VARIABLE uname_r - OUTPUT_STRIP_TRAILING_WHITESPACE) -- set(KERNEL_DIR "/lib/modules/${uname_r}/build") -+ set(KERNEL_DIR "/lib/modules/${uname_r}/build") -+ endif() - else() - set(KERNEL_DIR "/lib/modules/${KERNEL_VER}/build") - endif() --- -2.17.1 - diff --git a/SPECS/90/linux/canister_builder/crypto/canister_combine.lds b/SPECS/90/linux/canister_builder/crypto/canister_combine.lds deleted file mode 100644 index bdb5d83505..0000000000 --- a/SPECS/90/linux/canister_builder/crypto/canister_combine.lds +++ /dev/null @@ -1,6 +0,0 @@ -SECTIONS -{ - /* do not allow linker to shrink .rodata.str1.1 */ - .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } -} - diff --git a/SPECS/90/linux/check_for_acvp_config_applicability.inc b/SPECS/90/linux/check_for_acvp_config_applicability.inc deleted file mode 100644 index 947aa02137..0000000000 --- a/SPECS/90/linux/check_for_acvp_config_applicability.inc +++ /dev/null @@ -1,16 +0,0 @@ -echo "Check for .config applicability" - -# make doesn't support _smp_mflags -make LC_ALL= olddefconfig - -# Remove comment with a version string -sed -i '3d' .config - -# Check for known acvp diff, else return error -ignore_list="CONFIG_CRYPTO_USER_API_AKCIPHER\|CONFIG_CRYPTO_USER_API_KPP\|CONFIG_CRYPTO_USER_API_ECC" -diff -u .config.old .config -I "$ignore_list" - -# Apply config changes for ACVP Build -./scripts/kconfig/merge_config.sh .config .config_acvp -./scripts/kconfig/merge_config.sh -s -m .config .config_acvp -sed -i '3d' .config diff --git a/SPECS/90/linux/check_kernel_struct_in_canister.inc b/SPECS/90/linux/check_kernel_struct_in_canister.inc deleted file mode 100755 index 9e6480659a..0000000000 --- a/SPECS/90/linux/check_kernel_struct_in_canister.inc +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -file_name="objs" -awk -i inplace '!seen[$0]++' "$file_name" -name_lock="" -name_tsk="" -ret=0 -while read crypto_obj; do - touch ${crypto_obj}-struct - gdb crypto/${crypto_obj} -q -ex="set pagination off" -ex="info types" -ex q | tail -n +2 > ${crypto_obj}-types - while read line; do - if [[ $line =~ ^[0-9]*:[[:space:]]*.*struct|union ]]; then - echo $line | awk '{print "struct "$NF}' | sed -r 's/;+$//' >> ${crypto_obj}-struct - fi - done <${crypto_obj}-types - count=$(cat ${crypto_obj}-struct | wc -l) - echo "List of strctures in ${crypto_obj} is ${count}" - str=$(awk /task_struct/ ${crypto_obj}-struct) - if [ ! -z "$str" ]; then - name_tsk="${name_tsk} ${crypto_obj}" - fi - str=$(awk /spinlock\|mutex/ ${crypto_obj}-struct) - if [ ! -z "$str" ]; then - name_lock="${name_lock} ${crypto_obj}" - fi - rm -f ${crypto_obj}-types - rm -f ${crypto_obj}-struct -done<${file_name} -if [ ! -z "$name_tsk" ]; then - echo "$name_tsk contains task_struct!!!!" - ret=1 -fi -if [ ! -z "$name_lock" ]; then - echo "$name_lock contains spinlock or mutex!!!!" - ret=1 -fi -exit $ret diff --git a/SPECS/90/linux/config.yaml b/SPECS/90/linux/config.yaml index d667ac0002..5f29e1cf81 100644 --- a/SPECS/90/linux/config.yaml +++ b/SPECS/90/linux/config.yaml @@ -174,53 +174,6 @@ sources: sensitive data storage comply with strict security and regulatory standards. supplier: 'Organization: Broadcom, Inc.' -- archive: efa_linux_3.1.0.tar.gz - archive_sha512sum: - 0407d1cd62652831d557969e741537576ff8aef716d98c2a27e24c38359b27d7ece51f2033d99fbd30fdace89f2c4a2d4fb8756b26e98aeca1a1a3b41f9c13be - skip_validation: true - spdx: - package: - detailed_description: AWS Linux kernel drivers for Elastic Fabric - Adapter(EFA). Elastic Fabric Adapter (EFA) is a network device that - provides reliable userspace communication and kernel bypass - capabilities, targeting more consistent latency and higher throughput - than traditional TCP-based communication. - home_page: https://github.com/amzn/amzn-drivers - license_concluded: (BSD-2-Clause OR GPL-2.0-only WITH Linux-syscall-note) - AND (BSD-2-Clause OR GPL-2.0-only) AND (BSD-3-Clause OR GPL-2.0-only) - AND (GPL-2.0-only OR Linux-OpenIB) AND BSD-2-Clause AND BSD-3-Clause AND - GPL-2.0-only AND GPL-2.0-or-later AND Linux-OpenIB AND MIT - license_declared: (BSD-2-Clause OR GPL-2.0-only WITH Linux-syscall-note) - AND (BSD-2-Clause OR GPL-2.0-only) AND (BSD-3-Clause OR GPL-2.0-only) - AND (GPL-2.0-only OR Linux-OpenIB) AND BSD-2-Clause AND BSD-3-Clause AND - GPL-2.0-only AND GPL-2.0-or-later AND Linux-OpenIB AND MIT - short_summary: The open source linux kernel drivers for devices(EFA) used - on AWS platforms. - supplier: 'Organization: Broadcom, Inc.' -- archive: ena_linux_2.17.0.tar.gz - archive_sha512sum: - 5273dc9f92d554791d02362686c4cfd9898ec60b677d0168b73da369d956b391de4183292c42296bf8f7fa70ae1acb66d78842e9239037caf100a1bc9cd1ebeb - skip_validation: true - spdx: - package: - detailed_description: AWS Linux kernel drivers for Elastic Network - Adapter(ENA). ENA is a networking interface designed to make good use of - modern CPU features and system architectures. The ENA device exposes a - lightweight management interface with a minimal set of memory mapped - registers and extendible command set through an Admin Queue. - home_page: https://github.com/amzn/amzn-drivers - license_concluded: (BSD-2-Clause OR GPL-2.0-only WITH Linux-syscall-note) - AND (BSD-2-Clause OR GPL-2.0-only) AND (BSD-3-Clause OR GPL-2.0-only) - AND (GPL-2.0-only OR Linux-OpenIB) AND BSD-2-Clause AND BSD-3-Clause AND - GPL-2.0-only AND GPL-2.0-or-later AND Linux-OpenIB AND MIT - license_declared: (BSD-2-Clause OR GPL-2.0-only WITH Linux-syscall-note) - AND (BSD-2-Clause OR GPL-2.0-only) AND (BSD-3-Clause OR GPL-2.0-only) - AND (GPL-2.0-only OR Linux-OpenIB) AND BSD-2-Clause AND BSD-3-Clause AND - GPL-2.0-only AND GPL-2.0-or-later AND Linux-OpenIB AND MIT - short_summary: The open source linux kernel drivers for devices(ENA) used - on AWS platforms. - supplier: 'Organization: Broadcom, Inc.' - - archive: stalld-v1.19.1.tar.gz archive_sha512sum: f92fd5996482600c6a73324f43eed8a4a1f5e8f092e4a167306804e4230abbb89c37a8bfbb78ffe997310b8bfbb45d4903dd0c51292770dcf5b1d3cd56a78bde diff --git a/SPECS/90/linux/config_x86_64_acvp b/SPECS/90/linux/config_x86_64_acvp deleted file mode 100644 index 4852cee057..0000000000 --- a/SPECS/90/linux/config_x86_64_acvp +++ /dev/null @@ -1,11 +0,0 @@ -CONFIG_CRYPTO_USER=y -CONFIG_CRYPTO_DH=y -CONFIG_CRYPTO_USER_API=y -CONFIG_CRYPTO_USER_API_HASH=y -CONFIG_CRYPTO_USER_API_SKCIPHER=y -CONFIG_CRYPTO_USER_API_RNG=y -CONFIG_CRYPTO_USER_API_RNG_CAVP=y -CONFIG_CRYPTO_USER_API_AEAD=y -CONFIG_CRYPTO_USER_API_AKCIPHER=y -CONFIG_CRYPTO_USER_API_KPP=y -CONFIG_CRYPTO_USER_API_ECC=y diff --git a/SPECS/90/linux/esx/0001-Avoid-extra-scanning-for-peer-host-bridges.patch b/SPECS/90/linux/esx/0001-Avoid-extra-scanning-for-peer-host-bridges.patch deleted file mode 100644 index 58a3354345..0000000000 --- a/SPECS/90/linux/esx/0001-Avoid-extra-scanning-for-peer-host-bridges.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 24693f58ed55300199255b1dcccc698a80a95f4e Mon Sep 17 00:00:00 2001 -From: Ashwin Dayanand Kamat -Date: Thu, 14 Jul 2022 15:36:20 +0000 -Subject: [PATCH] Avoid extra scanning for peer host bridges - -VMware hypervisor doesn't support multiple host bridges. - -pcibios_scan_specific_bus() calls scanning for all buses for peer host bridges. -When mmconfig is initialised pcibios_last_bus is a non zero positive value (0x7f). -Due to which there is increased raw_pci_read() calls when mm_config is initialised. -But VMware hypervisor doesn't support multiple host bridges and for the single host bridge, -the information is provided by ACPI tables. -So avoid extra scanning. - -Signed-off-by: Ashwin Dayanand Kamat ---- - arch/x86/pci/legacy.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/arch/x86/pci/legacy.c b/arch/x86/pci/legacy.c -index 467311b1..1e27fc6a 100644 ---- a/arch/x86/pci/legacy.c -+++ b/arch/x86/pci/legacy.c -@@ -7,6 +7,7 @@ - #include - #include - #include -+#include - - /* - * Discover remaining PCI buses in case there are peer host bridges. -@@ -68,7 +69,12 @@ static int __init pci_subsys_init(void) - } - } - -- pcibios_fixup_peer_bridges(); -+ /* -+ * Multiple peer host bridges are not supported. -+ * Avoid extra scanning. -+ */ -+ if (x86_hyper_type != X86_HYPER_VMWARE) -+ pcibios_fixup_peer_bridges(); - x86_init.pci.init_irq(); - pcibios_init(); - --- -2.30.0 - diff --git a/SPECS/90/linux/esx/0001-Remove-OOM_SCORE_ADJ_MAX-limit-check.patch b/SPECS/90/linux/esx/0001-Remove-OOM_SCORE_ADJ_MAX-limit-check.patch deleted file mode 100644 index d08df19ab0..0000000000 --- a/SPECS/90/linux/esx/0001-Remove-OOM_SCORE_ADJ_MAX-limit-check.patch +++ /dev/null @@ -1,36 +0,0 @@ -From a666b331d08a524f6caaf41f57342311e91c5610 Mon Sep 17 00:00:00 2001 -From: Daniel Mueller -Date: Thu, 25 Jul 2019 10:15:06 -0700 -Subject: [PATCH] Remove OOM_SCORE_ADJ_MAX limit check - -This patch removes the OOM_SCORE_ADJ_MAX limit check. By removing this -check we are able to adjust the OOM score beyond OOM_SCORE_ADJ_MAX -(1000), which provides us with more confidence that the OOM killer will -actually choose the target process to be killed before interfering with -others. That is useful in certain Photon VM based setups where we want -to have a "canary" process that, upon being killed by the OOM, would -inform an agent in the VM that we are under memory pressure, and trigger -a clean shut down of the VM. -With the check in place, the kernel would still favor processes that had -a high score (1000 and above) based on actual memory consumption, -rendering our approach useless. ---- - fs/proc/base.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/fs/proc/base.c b/fs/proc/base.c -index f999e8..089ec0 100644 ---- a/fs/proc/base.c -+++ b/fs/proc/base.c -@@ -1188,7 +1188,7 @@ static ssize_t oom_score_adj_write(struct file *file, const char __user *buf, - if (err) - goto out; - if (oom_score_adj < OOM_SCORE_ADJ_MIN || -- oom_score_adj > OOM_SCORE_ADJ_MAX) { -+ oom_score_adj > SHRT_MAX) { - err = -EINVAL; - goto out; - } --- -2.21.0 - diff --git a/SPECS/90/linux/esx/01-clear-linux.patch b/SPECS/90/linux/esx/01-clear-linux.patch deleted file mode 100644 index cb387641e4..0000000000 --- a/SPECS/90/linux/esx/01-clear-linux.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 7d80ae3e4f1dd73fb61010e5a84135d3e92ba47e Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Tue, 9 May 2017 12:26:58 -0700 -Subject: [PATCH] Patch from Clear Linux - -Signed-off-by: Bo Gan ---- - drivers/video/fbdev/core/fbcon.c | 2 +- - include/linux/blk-mq.h | 2 +- - init/do_mounts.c | 2 +- - mm/vmstat.c | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c -index c910e74..59e1c7c 100644 ---- a/drivers/video/fbdev/core/fbcon.c -+++ b/drivers/video/fbdev/core/fbcon.c -@@ -148,7 +148,7 @@ static const struct consw fb_con; - - #define advance_row(p, delta) (unsigned short *)((unsigned long)(p) + (delta) * vc->vc_size_row) - --static int fbcon_cursor_noblink; -+static int fbcon_cursor_noblink = 1; - - #define divides(a, b) ((!(a) || (b)%(a)) ? 0 : 1) - -diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h -index 1532cd07a597..01ef715ad1a8 100644 ---- a/include/linux/blk-mq.h -+++ b/include/linux/blk-mq.h -@@ -12,7 +12,7 @@ struct blk_mq_tags; - struct blk_flush_queue; - - #define BLKDEV_MIN_RQ 4 --#define BLKDEV_DEFAULT_RQ 128 -+#define BLKDEV_DEFAULT_RQ 4096 - - enum rq_end_io_ret { - RQ_END_IO_NONE, -diff --git a/init/do_mounts.c b/init/do_mounts.c -index e083d54fa167..3ad54972f2c2 100644 ---- a/init/do_mounts.c -+++ b/init/do_mounts.c -@@ -614,7 +614,7 @@ void __init prepare_namespace(void) - * For example, it is not atypical to wait 5 seconds here - * for the touchpad of a laptop to initialize. - */ -- wait_for_device_probe(); -+ async_synchronize_full(); - - md_run_setup(); - -diff --git a/mm/vmstat.c b/mm/vmstat.c -index 90af9a8572f5..9ede6a77f2b2 100644 ---- a/mm/vmstat.c -+++ b/mm/vmstat.c -@@ -1874,7 +1874,7 @@ static const struct seq_operations vmstat_op = { - - #ifdef CONFIG_SMP - static DEFINE_PER_CPU(struct delayed_work, vmstat_work); --int sysctl_stat_interval __read_mostly = HZ; -+int sysctl_stat_interval __read_mostly = 8 * HZ; - - #ifdef CONFIG_PROC_FS - static void refresh_vm_stats(struct work_struct *work) diff --git a/SPECS/90/linux/esx/04-quiet-boot.patch b/SPECS/90/linux/esx/04-quiet-boot.patch deleted file mode 100644 index c0484684bb..0000000000 --- a/SPECS/90/linux/esx/04-quiet-boot.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 721dc6e6bc3473ecdc96dede6d02d0520bb78d2b Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Tue, 29 Sep 2015 16:02:20 -0700 -Subject: [PATCH] scsi/sd.c: Lower log level for "Assuming drive cache..." - message. - ---- - drivers/scsi/sd.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c -index 4e08d1c..2fe5106 100644 ---- a/drivers/scsi/sd.c -+++ b/drivers/scsi/sd.c -@@ -2590,7 +2590,7 @@ defaults: - "Assuming drive cache: write back\n"); - sdkp->WCE = 1; - } else { -- sd_first_printk(KERN_WARNING, sdkp, -+ sd_first_printk(KERN_NOTICE, sdkp, - "Assuming drive cache: write through\n"); - sdkp->WCE = 0; - } --- -1.9.1 - diff --git a/SPECS/90/linux/esx/05-pv-ops-clocksource.patch b/SPECS/90/linux/esx/05-pv-ops-clocksource.patch deleted file mode 100644 index 407aef1358..0000000000 --- a/SPECS/90/linux/esx/05-pv-ops-clocksource.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 725ac7c54935bbff858092e2db302afe88062162 Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Tue, 9 May 2017 12:39:18 -0700 -Subject: [PATCH] x86/vmware: pv-ops clocksource - ---- - arch/x86/kernel/cpu/vmware.c | 21 +++++++++++++++++++++ - 1 file changed, 21 insertions(+) - -diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c -index 1f22ed3..1eb5631 100644 ---- a/arch/x86/kernel/cpu/vmware.c -+++ b/arch/x86/kernel/cpu/vmware.c -@@ -134,6 +134,27 @@ static DEFINE_PER_CPU_DECRYPTED(struct vmware_steal_time, vmw_steal_time) __alig - static bool has_steal_clock; - static bool steal_acc __initdata = true; /* steal time accounting */ - -+static u64 vmware_clock_get_cycles(struct clocksource *cs) -+{ -+ return (u64)rdtsc_ordered(); -+} -+ -+static struct clocksource clocksource_vmware = { -+ .name = "vmware-clock", -+ .read = vmware_clock_get_cycles, -+ .rating = 400, -+ .mask = CLOCKSOURCE_MASK(64), -+ .flags = CLOCK_SOURCE_IS_CONTINUOUS, -+ .vdso_clock_mode = VDSO_CLOCKMODE_TSC, -+}; -+ -+/* We want to use clocksource_vmware from the beginning to avoid drifting in -+ monotonic clock */ -+struct clocksource * __init clocksource_default_clock(void) -+{ -+ return &clocksource_vmware; -+} -+ - static __init int setup_vmw_sched_clock(char *s) - { - vmw_sched_clock = false; -@@ -378,6 +399,7 @@ static void __init vmware_paravirt_ops_setup(void) - vmware_guest_cpu_init(); - #endif - } -+ clocksource_register_khz(&clocksource_vmware, vmware_tsc_khz); - } - #else - #define vmware_paravirt_ops_setup() do {} while (0) diff --git a/SPECS/90/linux/esx/init-do_mounts-recreate-dev-root.patch b/SPECS/90/linux/esx/init-do_mounts-recreate-dev-root.patch deleted file mode 100644 index 6237d69d0e..0000000000 --- a/SPECS/90/linux/esx/init-do_mounts-recreate-dev-root.patch +++ /dev/null @@ -1,43 +0,0 @@ -From fe52a1d246edc822e796d9c7890551e6a4049a27 Mon Sep 17 00:00:00 2001 -From: Miguel Bernal Marin -Date: Fri, 20 Nov 2015 14:01:26 -0600 -Subject: [PATCH 102/127] init: do_mounts: recreate /dev/root - -Rootfs shows as is mounted in /dev/root, but this devices is not present in -/dev directory. - -Signed-off-by: Miguel Bernal Marin ---- - init/do_mounts.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/init/do_mounts.c b/init/do_mounts.c -index b5f9604..e7dddd3 100644 ---- a/init/do_mounts.c -+++ b/init/do_mounts.c -@@ -583,6 +583,8 @@ void __init mount_root(void) - */ - void __init prepare_namespace(void) - { -+ int err; -+ - if (root_delay) { - printk(KERN_INFO "Waiting %d sec before mounting root device...\n", - root_delay); -@@ -630,6 +632,13 @@ void __init prepare_namespace(void) - devtmpfs_mount(); - init_mount(".", "/", NULL, MS_MOVE, NULL); - init_chroot("."); -+#ifdef CONFIG_BLOCK -+ /* recreate the /dev/root */ -+ err = create_dev("/dev/root", ROOT_DEV); -+ -+ if (err < 0) -+ pr_emerg("Failed to create /dev/root: %d\n", err); -+#endif - } - - static bool is_tmpfs; --- -2.14.1 - diff --git a/SPECS/90/linux/esx/serial-8250-do-not-probe-U6-16550A-fifo-size.patch b/SPECS/90/linux/esx/serial-8250-do-not-probe-U6-16550A-fifo-size.patch deleted file mode 100644 index d0688880f8..0000000000 --- a/SPECS/90/linux/esx/serial-8250-do-not-probe-U6-16550A-fifo-size.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 3f0069a352b7a55db73b522918116cd6d6a4dcfd Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Tue, 9 May 2017 12:38:15 -0700 -Subject: [PATCH] serial 8250 do not probe U6 16550A fifo size - ---- - drivers/tty/serial/8250/8250_port.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c -index 080d5a59d0a7..67d5cf07346e 100644 ---- a/drivers/tty/serial/8250/8250_port.c -+++ b/drivers/tty/serial/8250/8250_port.c -@@ -1148,10 +1148,12 @@ static void autoconfig_16550a(struct uart_8250_port *up) - * We distinguish between 16550A and U6 16550A by counting - * how many bytes are in the FIFO. - */ -+#if 0 - if (up->port.type == PORT_16550A && size_fifo(up) == 64) { - up->port.type = PORT_U6_16550A; - up->capabilities |= UART_CAP_AFE; - } -+#endif - } - - /* --- -2.11.0 - diff --git a/SPECS/90/linux/generic/0001-Enable-AUXILIARY_BUS-by-default.patch b/SPECS/90/linux/generic/0001-Enable-AUXILIARY_BUS-by-default.patch deleted file mode 100644 index 5b18863ebe..0000000000 --- a/SPECS/90/linux/generic/0001-Enable-AUXILIARY_BUS-by-default.patch +++ /dev/null @@ -1,25 +0,0 @@ -From cedcd4f4dacd601c993b5358f15d45ab5cae9b10 Mon Sep 17 00:00:00 2001 -From: Bo Gan -Date: Fri, 23 Dec 2022 07:45:06 +0000 -Subject: [PATCH] Enable AUXILIARY_BUS by default - -Signed-off-by: Bo Gan ---- - drivers/base/Kconfig | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig -index 6f04b831a5c0..6568f9b6c457 100644 ---- a/drivers/base/Kconfig -+++ b/drivers/base/Kconfig -@@ -2,6 +2,7 @@ - menu "Generic Driver Options" - - config AUXILIARY_BUS -+ default y - bool - - config UEVENT_HELPER --- -2.25.1 - diff --git a/SPECS/90/linux/generic/vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch b/SPECS/90/linux/generic/vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch deleted file mode 100644 index a066b5ad3b..0000000000 --- a/SPECS/90/linux/generic/vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 854580e7451ba741bddbc832f5df12e16ba43f02 Mon Sep 17 00:00:00 2001 -From: Rolf Neugebauer -Date: Mon, 23 May 2016 18:55:45 +0100 -Subject: [PATCH 11/23] vmbus: Don't spam the logs with unknown GUIDs - -With Hyper-V sockets device types are introduced on the fly. The pr_info() -then prints a message on every connection, which is way too verbose. Since -there doesn't seem to be an easy way to check for registered services, -disable the pr_info() completely. - -Signed-off-by: Rolf Neugebauer ---- - drivers/hv/channel_mgmt.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c -index 8eb1675..5a07371 100644 ---- a/drivers/hv/channel_mgmt.c -+++ b/drivers/hv/channel_mgmt.c -@@ -181,7 +181,6 @@ static u16 hv_get_dev_type(const struct vmbus_channel *channel) - if (guid_equal(guid, &vmbus_devs[i].guid)) - return i; - } -- pr_info("Unknown GUID: %pUl\n", guid); - return i; - } - --- -2.7.4 - diff --git a/SPECS/90/linux/linux-dracut-aarch64.conf b/SPECS/90/linux/linux-dracut-aarch64.conf deleted file mode 100644 index bbfc4bb125..0000000000 --- a/SPECS/90/linux/linux-dracut-aarch64.conf +++ /dev/null @@ -1 +0,0 @@ -add_drivers+=" xen-scsifront xen-blkfront xen-evtchn xen-gntalloc xen-gntdev xen-privcmd xen-pciback xenfs cn dm-mod megaraid_sas nvme nvme-core " diff --git a/SPECS/90/linux/linux-dracut-x86_64.conf b/SPECS/90/linux/linux-dracut-x86_64.conf deleted file mode 100644 index 47be529107..0000000000 --- a/SPECS/90/linux/linux-dracut-x86_64.conf +++ /dev/null @@ -1 +0,0 @@ -add_drivers+=" xen-scsifront xen-blkfront xen-acpi-processor xen-evtchn xen-gntalloc xen-gntdev xen-privcmd xen-pciback xenfs hv_utils hv_vmbus hv_storvsc hv_netvsc hv_sock hv_balloon cn dm-mod megaraid_sas " diff --git a/SPECS/90/linux/linux-esx-dracut.conf b/SPECS/90/linux/linux-esx-dracut.conf deleted file mode 100644 index 9cc37d172c..0000000000 --- a/SPECS/90/linux/linux-esx-dracut.conf +++ /dev/null @@ -1 +0,0 @@ -add_drivers+=" dm-mod " diff --git a/SPECS/90/linux/secure/0004-Fix-PAX-function-pointer-overwritten-for-tasklet-cal.patch b/SPECS/90/linux/secure/0004-Fix-PAX-function-pointer-overwritten-for-tasklet-cal.patch deleted file mode 100644 index 6c15cfa3ce..0000000000 --- a/SPECS/90/linux/secure/0004-Fix-PAX-function-pointer-overwritten-for-tasklet-cal.patch +++ /dev/null @@ -1,35 +0,0 @@ -From bbcfac6abd6a009e7e59703072a5f6619d62575d Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Wed, 6 Jan 2021 07:35:04 +0000 -Subject: [PATCH 4/5] Fix PAX function pointer overwritten for tasklet callback - -Tasklet_struct has union of function pointers which is called based on -use_callback bool value. GCC RAP plugin has a bug which does not generate -RAP hash for the function pointers declared inside union. Fix here is to remove -the union of function pointers and declare it separately. - -Signed-off-by: Keerthana K ---- - include/linux/interrupt.h | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h -index ee8299eb1..d1498e678 100644 ---- a/include/linux/interrupt.h -+++ b/include/linux/interrupt.h -@@ -612,10 +612,8 @@ struct tasklet_struct - unsigned long state; - atomic_t count; - bool use_callback; -- union { -- void (*func)(unsigned long data); -- void (*callback)(struct tasklet_struct *t); -- }; -+ void (*func)(unsigned long data); -+ void (*callback)(struct tasklet_struct *t); - unsigned long data; - }; - --- -2.28.0 - diff --git a/SPECS/90/linux/sev/0079-x86-sev-es-Disable-BIOS-ACPI-RSDP-probing-if-SEV-ES-.patch b/SPECS/90/linux/sev/0079-x86-sev-es-Disable-BIOS-ACPI-RSDP-probing-if-SEV-ES-.patch deleted file mode 100644 index fcaee8066f..0000000000 --- a/SPECS/90/linux/sev/0079-x86-sev-es-Disable-BIOS-ACPI-RSDP-probing-if-SEV-ES-.patch +++ /dev/null @@ -1,36 +0,0 @@ -From e1c5b13e55850963ebd3877c2c7d57b0ab2a4bc6 Mon Sep 17 00:00:00 2001 -From: Bo Gan -Date: Wed, 2 Sep 2020 05:40:06 -0700 -Subject: [PATCH 79/82] x86/sev-es: Disable BIOS ACPI RSDP probing if SEV-ES is - enabled - -Signed-off-by: Bo Gan ---- - arch/x86/boot/compressed/acpi.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c -index 8bcbcee..b93e6b4 100644 ---- a/arch/x86/boot/compressed/acpi.c -+++ b/arch/x86/boot/compressed/acpi.c -@@ -249,6 +249,8 @@ static acpi_physical_address bios_get_rsdp_addr(void) - return 0; - } - -+extern unsigned int get_sev_encryption_bit(void); -+ - /* Return RSDP address on success, otherwise 0. */ - acpi_physical_address get_rsdp_addr(void) - { -@@ -267,7 +269,7 @@ acpi_physical_address get_rsdp_addr(void) - if (!pa) - pa = efi_get_rsdp_addr(); - -- if (!pa) -+ if (!pa && !get_sev_encryption_bit()) - pa = bios_get_rsdp_addr(); - - return pa; --- -2.7.4 - diff --git a/SPECS/90/linux/sev/0080-x86-boot-Enable-vmw-serial-port-via-Super-I-O.patch b/SPECS/90/linux/sev/0080-x86-boot-Enable-vmw-serial-port-via-Super-I-O.patch deleted file mode 100644 index 18a19c4397..0000000000 --- a/SPECS/90/linux/sev/0080-x86-boot-Enable-vmw-serial-port-via-Super-I-O.patch +++ /dev/null @@ -1,84 +0,0 @@ -From a19564ab4baead7c8ad673a611a94b178278d906 Mon Sep 17 00:00:00 2001 -From: Bo Gan -Date: Wed, 2 Sep 2020 05:42:08 -0700 -Subject: [PATCH 80/82] x86/boot: Enable vmw serial port via Super I/O - -Signed-off-by: Bo Gan ---- - arch/x86/boot/early_serial_console.c | 51 ++++++++++++++++++++++++++++++++++++ - 1 file changed, 51 insertions(+) - -diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c -index 023bf1c..9efbc1f 100644 ---- a/arch/x86/boot/early_serial_console.c -+++ b/arch/x86/boot/early_serial_console.c -@@ -4,6 +4,8 @@ - * included from both the compressed kernel and the regular kernel. - */ - #include "boot.h" -+#include "string.h" -+#include - - #define DEFAULT_SERIAL_PORT 0x3f8 /* ttyS0 */ - -@@ -145,8 +147,57 @@ static void parse_console_uart8250(void) - early_serial_init(port, baud); - } - -+/* Registers for the NS PC97338/PC87338 SuperI/O chip. */ -+#define SIO_IDX_REG 0x2e -+#define SIO_DATA_REG 0x2f -+ -+#define FER_IDX 0x00 -+#define PNP1_IDX 0x1C -+#define S1BAL_IDX 0x44 -+#define S1BAH_IDX 0x45 -+ -+static void vmw_sio_write(u8 addr, u8 data) -+{ -+ outb(addr, SIO_IDX_REG); -+ outb(data, SIO_DATA_REG); -+} -+ -+static u8 vmw_sio_read(u8 addr) -+{ -+ outb(addr, SIO_IDX_REG); -+ return inb(SIO_DATA_REG); -+} -+ -+static void vmw_sio_serial_init(void) -+{ -+ u8 fer = vmw_sio_read(FER_IDX); -+ -+ if (fer & 2) -+ return; -+ -+ vmw_sio_write(S1BAL_IDX, 0xfe); -+ vmw_sio_write(S1BAH_IDX, 0); -+ vmw_sio_write(PNP1_IDX, 4); -+ vmw_sio_write(FER_IDX, fer | 2); -+} -+ - void console_init(void) - { -+ unsigned int hyper_vendor_id[3], ecx_f1; -+ unsigned int eax_f1 = 1, eax_f2 = CPUID_VMWARE_INFO_LEAF; -+ -+ asm("cpuid" : "+a" (eax_f1), "=c" (ecx_f1) :: "ebx", "edx"); -+ -+ if (ecx_f1 & (1UL << 31)) { -+ asm("cpuid" : "+a" (eax_f2), -+ "=b"(hyper_vendor_id[0]), -+ "=c"(hyper_vendor_id[1]), -+ "=d"(hyper_vendor_id[2])); -+ -+ if (!memcmp(hyper_vendor_id, "VMwareVMware", 12)) -+ vmw_sio_serial_init(); -+ } -+ - parse_earlyprintk(); - - if (!early_serial_base) --- -2.7.4 - diff --git a/SPECS/90/linux/viomem/Makefile.viomem b/SPECS/90/linux/viomem/Makefile.viomem deleted file mode 100644 index 58b75a636f..0000000000 --- a/SPECS/90/linux/viomem/Makefile.viomem +++ /dev/null @@ -1,7 +0,0 @@ -obj-m := viomem.o - -all: - $(MAKE) -C /lib/modules/$(BUILD_KERNEL)/build M=$(CURDIR) modules - -clean: - $(MAKE) -C /lib/modules/$(BUILD_KERNEL)/build M=$(CURDIR) clean diff --git a/SPECS/90/linux/vmw/0009-esx-vmxnet3-software-timestamping.patch b/SPECS/90/linux/vmw/0009-esx-vmxnet3-software-timestamping.patch deleted file mode 100644 index 58935d53c8..0000000000 --- a/SPECS/90/linux/vmw/0009-esx-vmxnet3-software-timestamping.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -Naur a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c ---- a/drivers/net/vmxnet3/vmxnet3_drv.c 2020-11-09 23:46:32.741883266 -0800 -+++ b/drivers/net/vmxnet3/vmxnet3_drv.c 2020-11-09 23:44:22.621643088 -0800 -@@ -1099,6 +1099,9 @@ - goto drop_pkt; - } - -+ /* timestamp packet in software */ -+ skb_tx_timestamp(skb); -+ - spin_lock_irqsave(&tq->tx_lock, flags); - - if (count > vmxnet3_cmd_ring_desc_avail(&tq->tx_ring)) { -diff -Naur a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c ---- a/drivers/net/vmxnet3/vmxnet3_ethtool.c 2020-11-09 23:38:51.529031950 -0800 -+++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c 2020-11-09 23:47:53.082031551 -0800 -@@ -1204,6 +1204,7 @@ - .set_ringparam = vmxnet3_set_ringparam, - .get_rxnfc = vmxnet3_get_rxnfc, - .set_rxnfc = vmxnet3_set_rxnfc, -+ .get_ts_info = ethtool_op_get_ts_info, - #ifdef VMXNET3_RSS - .get_rxfh_indir_size = vmxnet3_get_rss_indir_size, - .get_rxfh = vmxnet3_get_rss, diff --git a/SPECS/91/linux/0001-block-Fix-validation-of-ioprio-level.patch b/SPECS/91/linux/0001-block-Fix-validation-of-ioprio-level.patch deleted file mode 100644 index 54cbab89d5..0000000000 --- a/SPECS/91/linux/0001-block-Fix-validation-of-ioprio-level.patch +++ /dev/null @@ -1,60 +0,0 @@ -From e70be90cb7c6b34f366a58db8a3f571940883b1c Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Thu, 12 Sep 2024 15:19:36 +0530 -Subject: [PATCH] block: Fix validation of ioprio level - -The commit eca2040972b4 introduced a backward compatibility issue in -the function ioprio_check_cap. - -Before the change, if ioprio contains a level greater than 0x7, it was -treated as -EINVAL: - - data = ioprio & 0x1FFF - if data >= 0x7, return -EINVAL - -Since the change, if ioprio contains a level greater than 0x7 say 0x8 -it is calculated as 0x0: - - level = ioprio & 0x7 - -To maintain backward compatibility the kernel should return -EINVAL in -the above case as well. - -Fixes: eca2040972b4 ("scsi: block: ioprio: Clean up interface definition") -Signed-off-by: Ajay Kaher ---- - block/ioprio.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/block/ioprio.c b/block/ioprio.c -index b5a9425..f830292 100644 ---- a/block/ioprio.c -+++ b/block/ioprio.c -@@ -33,7 +33,7 @@ - int ioprio_check_cap(int ioprio) - { - int class = IOPRIO_PRIO_CLASS(ioprio); -- int level = IOPRIO_PRIO_LEVEL(ioprio); -+ int data = IOPRIO_PRIO_DATA(ioprio); - - switch (class) { - case IOPRIO_CLASS_RT: -@@ -49,13 +49,13 @@ int ioprio_check_cap(int ioprio) - fallthrough; - /* rt has prio field too */ - case IOPRIO_CLASS_BE: -- if (level >= IOPRIO_NR_LEVELS) -+ if (data >= IOPRIO_NR_LEVELS || data < 0) - return -EINVAL; - break; - case IOPRIO_CLASS_IDLE: - break; - case IOPRIO_CLASS_NONE: -- if (level) -+ if (data) - return -EINVAL; - break; - case IOPRIO_CLASS_INVALID: --- -2.7.4 - diff --git a/SPECS/91/linux/0001-sched_info_enqueue-don-t-update-last_queued-on-delay.patch b/SPECS/91/linux/0001-sched_info_enqueue-don-t-update-last_queued-on-delay.patch deleted file mode 100644 index 2dc5cda56d..0000000000 --- a/SPECS/91/linux/0001-sched_info_enqueue-don-t-update-last_queued-on-delay.patch +++ /dev/null @@ -1,56 +0,0 @@ -From c91adc3015638aff2dea65b89fe91f8e9fedfa65 Mon Sep 17 00:00:00 2001 -From: Brennan Lamoreaux -Date: Fri, 10 Jul 2026 15:27:33 -0700 -Subject: [PATCH] sched_info_enqueue: don't update last_queued on delayed - migration - -When a task is on the runqueue in sched_delayed state, it can be -migrated to another CPU/runqueue. In this case, it will call the -normal enqueue task path, (move_queued_task()->enqueue_task_fair()), -which has some guards for this. However, there is no guard in -sched_info_enqueue(), and so last_queued can be set at migration time, -via enqueue_task()->sched_info_enqueue(), even though it's only migrating -from one runqueue to another in sched_delayed state. - -This means that the CPU delay calculation is incorrect if the task gets -woken up again and requeued via requeue_delayed_entity(). The CPU delay -will be based on the migration time, instead of the enqueue time. - -Fix this by adding a guard in sched_info_enqueue() to skip updating the -timestamp when the task is in sched_delayed state. - -Crafted a test scenario to trigger migrations during sched_delayed state, -and read the run delay and other stats from /proc//schedstats. - -Before patch: -Total Run Delay: 6746115520 ns -Total Wakeups: 3763 -Avg Delay/Wakeup: 1792749 ns - -After patch: -Total Run Delay: 3434157802 ns -Total Wakeups: 3666 -Avg Delay/Wakeup: 936758 ns - -Link: https://bugzilla.kernel.org/show_bug.cgi?id=220310 -Signed-off-by: Brennan Lamoreaux ---- - kernel/sched/stats.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/kernel/sched/stats.h b/kernel/sched/stats.h -index 6ade91bce63e..191ca80016f7 100644 ---- a/kernel/sched/stats.h -+++ b/kernel/sched/stats.h -@@ -281,7 +281,7 @@ static void sched_info_arrive(struct rq *rq, struct task_struct *t) - */ - static inline void sched_info_enqueue(struct rq *rq, struct task_struct *t) - { -- if (!t->sched_info.last_queued) -+ if (!t->sched_info.last_queued && !t->se.sched_delayed) - t->sched_info.last_queued = rq_clock(rq); - } - --- -2.53.0 - diff --git a/SPECS/91/linux/0002-perf-record-add-options-to-off-cpu.patch b/SPECS/91/linux/0002-perf-record-add-options-to-off-cpu.patch deleted file mode 100644 index 24a5200897..0000000000 --- a/SPECS/91/linux/0002-perf-record-add-options-to-off-cpu.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 02b19ef84b1fc2fac69da4a6cf7ed82f7fc0641d Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Mon, 15 Sep 2025 17:16:19 +0530 -Subject: [PATCH 2/3] perf/record: add options --off-cpu-kernel - ---off-cpu-kernel to collect off cpu samples using on/off cpu time with-in kernel. - -Signed-off-by: Ajay Kaher -[Guru: Ported to v6.12] -Signed-off-by: Guruswamy Basavaiah ---- - tools/perf/builtin-record.c | 1 + - tools/perf/util/evsel.c | 2 ++ - tools/perf/util/record.h | 1 + - 3 files changed, 4 insertions(+) - -diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c -index ab9035573..95bfcdba7 100644 ---- a/tools/perf/builtin-record.c -+++ b/tools/perf/builtin-record.c -@@ -3564,6 +3564,7 @@ static struct option __record_options[] = { - OPT_BOOLEAN(0, "off-cpu", &record.off_cpu, "Enable off-cpu analysis"), - OPT_STRING(0, "setup-filter", &record.filter_action, "pin|unpin", - "BPF filter action"), -+ OPT_BOOLEAN(0, "off-cpu-kernel", &record.opts.off_cpu_kernel, "Enable kernel based off-cpu analysis"), - OPT_END() - }; - -diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c -index dbf9c8cee..423a03c83 100644 ---- a/tools/perf/util/evsel.c -+++ b/tools/perf/util/evsel.c -@@ -872,6 +872,8 @@ static void __evsel__config_callchain(struct evsel *evsel, struct record_opts *o - attr->exclude_callchain_user = 1; - if (opts->user_callchains) - attr->exclude_callchain_kernel = 1; -+ if (opts->off_cpu_kernel) -+ attr->off_cpu = 1; - if (param->record_mode == CALLCHAIN_LBR) { - if (!opts->branch_stack) { - if (attr->exclude_user) { -diff --git a/tools/perf/util/record.h b/tools/perf/util/record.h -index a6566134e..cfa5e34b7 100644 ---- a/tools/perf/util/record.h -+++ b/tools/perf/util/record.h -@@ -52,6 +52,7 @@ struct record_opts { - bool kcore; - bool text_poke; - bool build_id; -+ bool off_cpu_kernel; - unsigned int freq; - unsigned int mmap_pages; - unsigned int auxtrace_mmap_pages; --- -2.43.0 - diff --git a/SPECS/91/linux/0003-perf-display-off-cpu-samples.patch b/SPECS/91/linux/0003-perf-display-off-cpu-samples.patch deleted file mode 100644 index d0644eddb2..0000000000 --- a/SPECS/91/linux/0003-perf-display-off-cpu-samples.patch +++ /dev/null @@ -1,177 +0,0 @@ -From 3c07a2476462a1ae87ec22fb0a2802f03dcff564 Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Mon, 15 Sep 2025 17:57:30 +0530 -Subject: [PATCH 3/3] perf/report: add off-cpu samples - -off-cpu samples represent the time period for which the target -process not occupying the cpu cycles. - -In following example, perf has collected 15 off-cpu samples and -program was running on cpu for 27%: - -Samples: 24 of 'task-clock:ppp', 15 of 'offcpu', Event count: ~9150831908 (73% offcpu) -+73.77% 73.77% a.out libc.so.6 [.] clock_nanosleep <-- off-cpu sample -+24.04% 24.04% a.out [vdso] [.] __vdso_gettimeofday <-- on-cpu sample - -Signed-off-by: Ajay Kaher -[Guru: Ported to v6.12 kernel] -Signed-off-by: Guruswamy Basavaiah ---- - tools/perf/util/events_stats.h | 2 ++ - tools/perf/util/evsel.c | 2 ++ - tools/perf/util/hist.c | 27 ++++++++++++++++++++++++--- - tools/perf/util/hist.h | 1 + - tools/perf/util/sample.h | 1 + - 5 files changed, 30 insertions(+), 3 deletions(-) - -diff --git a/tools/perf/util/events_stats.h b/tools/perf/util/events_stats.h -index eabd7913c..0162f1f29 100644 ---- a/tools/perf/util/events_stats.h -+++ b/tools/perf/util/events_stats.h -@@ -56,8 +56,10 @@ struct events_stats { - - struct hists_stats { - u64 total_period; -+ u64 total_period_off_cpu; - u64 total_non_filtered_period; - u32 nr_samples; -+ u64 nr_samples_off_cpu; - u32 nr_non_filtered_samples; - u32 nr_lost_samples; - u32 nr_dropped_samples; -diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c -index 423a03c83..2f6f689f3 100644 ---- a/tools/perf/util/evsel.c -+++ b/tools/perf/util/evsel.c -@@ -1156,6 +1156,7 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts, - attr->write_backward = opts->overwrite ? 1 : 0; - attr->read_format = PERF_FORMAT_LOST; - -+ evsel__set_sample_bit(evsel, CPU); - evsel__set_sample_bit(evsel, IP); - evsel__set_sample_bit(evsel, TID); - -@@ -2742,6 +2743,7 @@ int evsel__parse_sample(struct evsel *evsel, union perf_event *event, - u.val32[0] = bswap_32(u.val32[0]); - } - -+ data->off_cpu = u.val32[1]; - data->cpu = u.val32[0]; - array++; - } -diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c -index f387e85a0..4a16e2e68 100644 ---- a/tools/perf/util/hist.c -+++ b/tools/perf/util/hist.c -@@ -23,6 +23,7 @@ - #include "thread.h" - #include "block-info.h" - #include "ui/progress.h" -+#include "ui/util.h" - #include - #include - #include -@@ -732,6 +733,7 @@ __hists__add_entry(struct hists *hists, - .socket = al->socket, - .cpu = al->cpu, - .cpumode = al->cpumode, -+ .off_cpu = sample->off_cpu, - .ip = al->addr, - .level = al->level, - .code_page_size = sample->code_page_size, -@@ -1094,6 +1096,8 @@ iter_add_single_cumulative_entry(struct hist_entry_iter *iter, - callchain_cursor_commit(get_tls_callchain_cursor()); - - hists__inc_nr_samples(hists, he->filtered); -+ if(sample->off_cpu) -+ ++hists->stats.nr_samples_off_cpu; - - return err; - } -@@ -1755,6 +1759,7 @@ void hists__reset_stats(struct hists *hists) - { - hists->nr_entries = 0; - hists->stats.total_period = 0; -+ hists->stats.total_period_off_cpu = 0; - - hists__reset_filter_stats(hists); - } -@@ -1772,6 +1777,9 @@ void hists__inc_stats(struct hists *hists, struct hist_entry *h) - - hists->nr_entries++; - hists->stats.total_period += h->stat.period; -+ -+ if (h->off_cpu) -+ hists->stats.total_period_off_cpu += h->stat.period; - } - - static void hierarchy_recalc_total_periods(struct hists *hists) -@@ -2772,14 +2780,20 @@ int __hists__scnprintf_title(struct hists *hists, char *bf, size_t size, bool sh - struct thread *thread = hists->thread_filter; - int socket_id = hists->socket_filter; - unsigned long nr_samples = hists->stats.nr_samples; -+ unsigned long nr_samples_off_cpu = hists->stats.nr_samples_off_cpu; - u64 nr_events = hists->stats.total_period; -+ int nr_events_off_cpu_percentage = (hists->stats.total_period_off_cpu * 100) / nr_events; - struct evsel *evsel = hists_to_evsel(hists); - const char *ev_name = evsel__name(evsel); - char buf[512], sample_freq_str[64] = ""; -+ char oncpu_str[128] = ""; -+ char offcpu_str[128] = ""; -+ char offcpu_percentage_str[128] = ""; - size_t buflen = sizeof(buf); - char ref[30] = " show reference callgraph, "; - bool enable_ref = false; - -+ - if (symbol_conf.filter_relative) { - nr_samples = hists->stats.nr_non_filtered_samples; - nr_events = hists->stats.total_non_filtered_period; -@@ -2812,10 +2826,17 @@ int __hists__scnprintf_title(struct hists *hists, char *bf, size_t size, bool sh - scnprintf(sample_freq_str, sizeof(sample_freq_str), " %d Hz,", evsel->core.attr.sample_freq); - - nr_samples = convert_unit(nr_samples, &unit); -+ -+ scnprintf(oncpu_str, sizeof(oncpu_str), "%lu%c of '%s',", nr_samples - nr_samples_off_cpu, unit, ev_name); -+ -+ if (evsel->core.attr.off_cpu) { -+ scnprintf(offcpu_str, sizeof(offcpu_str), "%lu%c of '%s',", nr_samples_off_cpu, unit, "offcpu"); -+ scnprintf(offcpu_percentage_str, sizeof(offcpu_percentage_str), "(%d%% offcpu)", nr_events_off_cpu_percentage); -+ } -+ - printed = scnprintf(bf, size, -- "Samples: %lu%c of event%s '%s',%s%sEvent count (approx.): %" PRIu64, -- nr_samples, unit, evsel->core.nr_members > 1 ? "s" : "", -- ev_name, sample_freq_str, enable_ref ? ref : " ", nr_events); -+ "Samples: %s %s %s%sEvent count: ~%" PRIu64 " %s", -+ oncpu_str, offcpu_str, sample_freq_str, enable_ref ? ref : " ", nr_events, offcpu_percentage_str); - - - if (hists->uid_filter_str) -diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h -index 7d7ae94b4..f1b0b4743 100644 ---- a/tools/perf/util/hist.h -+++ b/tools/perf/util/hist.h -@@ -237,6 +237,7 @@ struct hist_entry { - /* We are added by hists__add_dummy_entry. */ - bool dummy; - bool leaf; -+ bool off_cpu; - - char level; - u8 filtered; -diff --git a/tools/perf/util/sample.h b/tools/perf/util/sample.h -index 70b2c3135..59b0951f4 100644 ---- a/tools/perf/util/sample.h -+++ b/tools/perf/util/sample.h -@@ -109,6 +109,7 @@ struct perf_sample { - u16 retire_lat; - }; - bool no_hw_idx; /* No hw_idx collected in branch_stack */ -+ bool off_cpu; - char insn[MAX_INSN]; - void *raw_data; - struct ip_callchain *callchain; --- -2.43.0 - diff --git a/SPECS/91/linux/9p/0001-fs-9p-Add-opt_metaonly-cache-option.patch b/SPECS/91/linux/9p/0001-fs-9p-Add-opt_metaonly-cache-option.patch deleted file mode 100644 index 621f8c020f..0000000000 --- a/SPECS/91/linux/9p/0001-fs-9p-Add-opt_metaonly-cache-option.patch +++ /dev/null @@ -1,98 +0,0 @@ -From b3766db803ff096fdf5d102984f85a8356285e5d Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Wed, 26 Aug 2020 17:03:24 +0530 -Subject: [PATCH 1/8] fs, 9p: Add opt_metaonly cache option - -Read/Write operation of 9p has two executions paths: - -metadata: to bypass caching layer: -v9fs_cached_file_read_iter()->v9fs_file_read_iter() -v9fs_cached_file_write_iter()->v9fs_file_write_iter() - -datapath: to involve generic caching read/write: -v9fs_cached_file_read_iter()->generic_file_read_iter() -v9fs_cached_file_write_iter()->generic_file_write_iter() - -opt_metaonly helps to choose metadata read/write execution -path which bypass caching layer. - -By-default opt_metaonly will be unset. - -Example: cache=loose, metaonly - -Signed-off-by: Ajay Kaher ---- - Documentation/filesystems/9p.rst | 1 + - fs/9p/v9fs.c | 10 ++++++++++ - fs/9p/v9fs.h | 1 + - 3 files changed, 12 insertions(+) - -diff --git a/Documentation/filesystems/9p.rst b/Documentation/filesystems/9p.rst -index 523e036da..15554e010 100644 ---- a/Documentation/filesystems/9p.rst -+++ b/Documentation/filesystems/9p.rst -@@ -238,6 +238,7 @@ Options - cachetag cache tag to use the specified persistent cache. - cache tags for existing cache sessions can be listed at - /sys/fs/9p/caches. (applies only to cache=fscache) -+ metaonly to bypass caching layer, if cache is loose or mmap - - local_lock Use only local posix locking from the perspective of "this" - kernel. Do not perform server side locking. -diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c -index 099cb6719..2277b987c 100644 ---- a/fs/9p/v9fs.c -+++ b/fs/9p/v9fs.c -@@ -41,6 +41,8 @@ enum { - Opt_nodevmap, Opt_noxattr, Opt_directio, Opt_ignoreqv, - /* Access options */ - Opt_access, Opt_posixacl, -+ /* Metadata option: to bypass caching layer */ -+ Opt_metaonly, - /* Lock timeout option */ - Opt_locktimeout, - /* Local lock */ -@@ -66,6 +68,7 @@ static const match_table_t tokens = { - {Opt_posixacl, "posixacl"}, - {Opt_locktimeout, "locktimeout=%u"}, - {Opt_local_lock, "local_lock"}, -+ {Opt_metaonly, "metaonly"}, - {Opt_err, NULL} - }; - -@@ -152,6 +155,9 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root) - if (v9ses->flags & V9FS_NO_XATTR) - seq_puts(m, ",noxattr"); - -+ if (v9ses->metaonly) -+ seq_puts(m, ",metaonly"); -+ - return p9_show_client_options(m, v9ses->clnt); - } - -@@ -372,6 +378,10 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts) - v9ses->session_lock_timeout = (long)option * HZ; - break; - -+ case Opt_metaonly: -+ v9ses->metaonly = true; -+ break; -+ - case Opt_local_lock: - v9ses->flags |= V9FS_LOCAL_LOCK; - break; -diff --git a/fs/9p/v9fs.h b/fs/9p/v9fs.h -index 9dd33721d..48834f09f 100644 ---- a/fs/9p/v9fs.h -+++ b/fs/9p/v9fs.h -@@ -114,6 +114,7 @@ struct v9fs_session_info { - unsigned short debug; - unsigned int afid; - unsigned int cache; -+ bool metaonly; - #ifdef CONFIG_9P_FSCACHE - char *cachetag; - struct fscache_volume *fscache; --- -2.43.7 - diff --git a/SPECS/91/linux/9p/0003-Enable-cache-loose-for-vdfs-9p.patch b/SPECS/91/linux/9p/0003-Enable-cache-loose-for-vdfs-9p.patch deleted file mode 100644 index bb316d8bb6..0000000000 --- a/SPECS/91/linux/9p/0003-Enable-cache-loose-for-vdfs-9p.patch +++ /dev/null @@ -1,105 +0,0 @@ -From b1926a4bd8c00518e0356dbba342dc2a154e9259 Mon Sep 17 00:00:00 2001 -From: Mounesh Badiger -Date: Sun, 23 Aug 2020 17:53:21 +0530 -Subject: [PATCH 3/8] Enable cache=loose for vdfs 9p. - -cache=loose, helps metadata performance, but due -less photon memory datapath performance regressed. - -so only enable loose cache for metadata and datapath -just go through normal zc path. - -Albert Guo -Fri Oct 6 2023 -Removed p9_is_fid_proto_dotx() as it's not used anywhere. - -Albert Guo -Wed Feb 11 2026 -Set v9fs_cached_file_read_iter and v9fs_cached_file_write_iter in -v9fs_file_operations_dotl because v9fs_cached_file_operations_dotl -has been removed. See -https://github.com/torvalds/linux/commit/d9bc0d11e33bd7b6bfeedc570cd5738e5b4c7ca8 - -Revised implementation for v9fs_cached_file_read_iter() and -v9fs_cached_file_write_iter() - -static ssize_t -v9fs_cached_file_read_iter(struct kiocb *iocb, struct iov_iter *to) -{ - struct inode *inode = iocb->ki_filp->f_mapping->host; - struct v9fs_session_info *v9ses = v9fs_inode2v9ses(inode); - - if (v9ses->metaonly) { - return netfs_unbuffered_read_iter(iocb, to); - } - - return v9fs_file_read_iter(iocb, to); -} - -static ssize_t -v9fs_cached_file_write_iter(struct kiocb *iocb, struct iov_iter *from) -{ - struct inode *inode = iocb->ki_filp->f_mapping->host; - struct v9fs_session_info *v9ses = v9fs_inode2v9ses(inode); - - if (v9ses->metaonly) { - return netfs_unbuffered_write_iter(iocb, from); - } - - return v9fs_file_write_iter(iocb, from); -} ---- - fs/9p/vfs_file.c | 30 ++++++++++++++++++++++++++++-- - 1 file changed, 28 insertions(+), 2 deletions(-) - -diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c -index afd5aecde..bed215c2a 100644 ---- a/fs/9p/vfs_file.c -+++ b/fs/9p/vfs_file.c -@@ -414,6 +414,32 @@ v9fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from) - return netfs_file_write_iter(iocb, from); - } - -+static ssize_t -+v9fs_cached_file_read_iter(struct kiocb *iocb, struct iov_iter *to) -+{ -+ struct inode *inode = iocb->ki_filp->f_mapping->host; -+ struct v9fs_session_info *v9ses = v9fs_inode2v9ses(inode); -+ -+ if (v9ses->metaonly) { -+ return netfs_unbuffered_read_iter(iocb, to); -+ } -+ -+ return v9fs_file_read_iter(iocb, to); -+} -+ -+static ssize_t -+v9fs_cached_file_write_iter(struct kiocb *iocb, struct iov_iter *from) -+{ -+ struct inode *inode = iocb->ki_filp->f_mapping->host; -+ struct v9fs_session_info *v9ses = v9fs_inode2v9ses(inode); -+ -+ if (v9ses->metaonly) { -+ return netfs_unbuffered_write_iter(iocb, from); -+ } -+ -+ return v9fs_file_write_iter(iocb, from); -+} -+ - static int v9fs_file_fsync(struct file *filp, loff_t start, loff_t end, - int datasync) - { -@@ -532,8 +558,8 @@ const struct file_operations v9fs_file_operations = { - - const struct file_operations v9fs_file_operations_dotl = { - .llseek = generic_file_llseek, -- .read_iter = v9fs_file_read_iter, -- .write_iter = v9fs_file_write_iter, -+ .read_iter = v9fs_cached_file_read_iter, -+ .write_iter = v9fs_cached_file_write_iter, - .open = v9fs_file_open, - .release = v9fs_dir_release, - .lock = v9fs_file_lock_dotl, --- -2.43.7 - diff --git a/SPECS/91/linux/9p/0004-Ensure-seekdir-take-effect-when-entries-in-readdir-b.patch b/SPECS/91/linux/9p/0004-Ensure-seekdir-take-effect-when-entries-in-readdir-b.patch deleted file mode 100644 index c2adad7be3..0000000000 --- a/SPECS/91/linux/9p/0004-Ensure-seekdir-take-effect-when-entries-in-readdir-b.patch +++ /dev/null @@ -1,104 +0,0 @@ -From e2f5a2787c12680afc936b0bac97ccaac3d48d67 Mon Sep 17 00:00:00 2001 -From: Albert Guo -Date: Thu, 5 Nov 2020 08:43:03 -0800 -Subject: [PATCH 4/8] Ensure seekdir take effect when entries in readdir buf - hasn't been ran out. - -When running Samba server in a 9p mount point, we discovered a wide directory -can't be listed correctly from Windows client due to a bug in Linux 9p driver. -The problem is Windows client can seek to an offset while directory entries -in the readdir buffer hasn't been run out. In this case, the directory seek -isn't honored. The 9p driver still return entries from cache according to old -current position. - -I wrote a test program which mimic the above behavior, and the issue can be -reproduced. - -The fix is to force 9p driver to call TREADDIR whenever -seekdir(v9fs_dir_llseek) -is called. Please note that, if a caller just readdir sequentially, the seekdir -won't be called. - -Testing Done: - -I wrote a test program which reproduce the issue. Now it passed. - -***Note: The fix is crossported from ph1, and this is test program only worked on ph1*** - -/root/readdir_test /vsfs/5d21d211-1105-4cc0-a7b8-19e6e0db841e/vdfsops0aa17ade/a875b95e-11a9-6cdf-de06-020041f286ec/volumes/default > / -tmp/readdir.out -Test passed: expectedNextName:newfile782.txt, actual next name:newfile782.txt - -After my change, I can see TREADDIR starts from seeked offset: (Previously TREADDIR continues from previous readdir rather than reset offset) - -\[12495.548915\] 9pnet: -- v9fs_dir_llseek (22895): name default seek to off: 230704361578168321 (0x333a06500000001) -\[12495.548921\] 9pnet: -- v9fs_dir_readdir_dotl (22895): name default -\[12495.548922\] 9pnet: (00022895) >>> TREADDIR fid 3 offset 230704361578168321 count 16276 - -Tested with Windows SMB client, it can list 1000 files correctly. (Note: This is verified in ph3) ---- - fs/9p/vfs_dir.c | 34 ++++++++++++++++++++++++++++++++-- - 1 file changed, 32 insertions(+), 2 deletions(-) - -diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c -index c97be22d1..44533c364 100644 ---- a/fs/9p/vfs_dir.c -+++ b/fs/9p/vfs_dir.c -@@ -60,6 +60,36 @@ static inline int dt_type(struct p9_wstat *mistat) - return rettype; - } - -+ -+/** -+ * v9fs_dir_llseek - seek to a specific offset for further readdir -+ * @file: file structure to seek on -+ * @offset: file offset to seek to -+ * @whence: type of seek -+ * -+ * This is implementation for directory seek in a 9p file system -+ */ -+ -+static loff_t v9fs_dir_llseek(struct file *file, loff_t offset, int whence) -+{ -+ struct p9_fid *fid = file->private_data; -+ struct p9_rdir *rdir = fid->rdir; -+ -+ /* -+ * Reset head so that v9fs_dir_readdir_xxx will call p9_client_readdir to -+ * refetch dir entries. -+ * Some applications may reset the offset before previous readdir finishes. -+ */ -+ if (rdir) { -+ rdir->head = rdir->tail; -+ } -+ -+ p9_debug(P9_DEBUG_VFS, "name %pD seek to off: %lld (0x%llx)\n", -+ file, offset, offset); -+ return generic_file_llseek(file, offset, whence); -+} -+ -+ - /** - * v9fs_alloc_rdir_buf - Allocate buffer used for read and readdir - * @filp: opened file structure -@@ -242,7 +272,7 @@ int v9fs_dir_release(struct inode *inode, struct file *filp) - - const struct file_operations v9fs_dir_operations = { - .read = generic_read_dir, -- .llseek = generic_file_llseek, -+ .llseek = v9fs_dir_llseek, - .iterate_shared = v9fs_dir_readdir, - .open = v9fs_file_open, - .release = v9fs_dir_release, -@@ -250,7 +280,7 @@ const struct file_operations v9fs_dir_operations = { - - const struct file_operations v9fs_dir_operations_dotl = { - .read = generic_read_dir, -- .llseek = generic_file_llseek, -+ .llseek = v9fs_dir_llseek, - .iterate_shared = v9fs_dir_readdir_dotl, - .open = v9fs_file_open, - .release = v9fs_dir_release, --- -2.43.7 - diff --git a/SPECS/91/linux/9p/0005-Initialize-fid-iounit-during-creation-of-p9_fid.patch b/SPECS/91/linux/9p/0005-Initialize-fid-iounit-during-creation-of-p9_fid.patch deleted file mode 100644 index 55c478c90f..0000000000 --- a/SPECS/91/linux/9p/0005-Initialize-fid-iounit-during-creation-of-p9_fid.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 6857ba18a323d92811ae5109faaf2439e320c8ae Mon Sep 17 00:00:00 2001 -From: Mounesh Badiger -Date: Sun, 8 Nov 2020 22:05:48 -0800 -Subject: [PATCH 5/8] Initialize fid->iounit during creation of p9_fid - -In 9p, each fid has iounit feild, if iounit != 0 -then read and write sizes are MIN(count, iounit, msize - HDRSZ). -for tlcreat/tlopen iounit comes from server -and in those cases vdfs initializes iounit to 0. -But in WALK/XATTRWALK cases its garbage value - -This also is a performance problem with reads/writes, -where we require multiple round trips to server to -complete reads and writes. for e.g -> 400 bytes read -and iounit value is 2 and it required us to have 200 -round trips to complete reads, but it is not the case -with vdfs-zero-copy, where we don't consider iounit -value for issuing read and writes. ---- - net/9p/client.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/net/9p/client.c b/net/9p/client.c -index 52a5497cf..362a55827 100644 ---- a/net/9p/client.c -+++ b/net/9p/client.c -@@ -860,6 +860,7 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt) - fid->mode = -1; - fid->uid = current_fsuid(); - fid->clnt = clnt; -+ fid->iounit = 0; - refcount_set(&fid->count, 1); - - idr_preload(GFP_KERNEL); --- -2.43.7 - diff --git a/SPECS/91/linux/9p/0006-fscache-Only-fetch-attr-from-inode-cache-when-cache-.patch b/SPECS/91/linux/9p/0006-fscache-Only-fetch-attr-from-inode-cache-when-cache-.patch deleted file mode 100644 index d665935141..0000000000 --- a/SPECS/91/linux/9p/0006-fscache-Only-fetch-attr-from-inode-cache-when-cache-.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 65bcb4f3fd093eb085c9910f8b65586ad177f5fa Mon Sep 17 00:00:00 2001 -From: Albert Guo -Date: Mon, 16 Nov 2020 04:38:54 -0800 -Subject: [PATCH 6/8] fscache: Only fetch attr from inode cache when cache is - valid - -When setattr is called, the ctime of the file system entry will be updated. -The ctime in the inode cache will be inconsistent with the server. atime and -mtime is incorrect as well as they're truncated according to time granularity. -See setattr_copy(). -In this case, attr cache in the inode has already been marked as invalid -by v9fs_invalidate_inode_attr(). -When a following getattr is called, we only fetch from attr cache when -cache in inode is valid. If it invalid, the attr will be fetched from the -server, this ensures 9p client always get consistent timestamp. -After we fetch attr from 9p server, the cache will become valid by calling -v9fs_stat2inode_dotl(), so the next getattr will be read from cache again as -long as there is no other operations which invalidate the cache. - -Testing Done: -Manual test: -1) Test with a test program: http://engweb.vmware.com/~aguo/test_tools/check_stat.c -Before fix: -nsec is always 0 for getattr after setattr within the same open. -[ /vsfs/dfa5a037-d5df-4012-83c5-8b2e7e535c0b/vdfsops0ac0d7c3/0309c55f-8da0-6245-e60c-02003870d120/volumes/default ]# /root/check_stat fiofile -now.sec = 1607059081, now.usec = 842920 -fstat1: atime.sec=1607059080, atime.nsec=0, mtime.sec=1607059080, mtime.nsec=0, ctime.sec=1607059081, ctime.nsec=0. - -After fix: -nsec is correct. -/vsfs/dfa5a037-d5df-4012-83c5-8b2e7e535c0b/vdfsops0ac0d7c3/0309c55f-8da0-6245-e60c-02003870d120/volumes/default ]# /root/check_stat fiofile -now.sec = 1607067440, now.usec = 464677 -fstat1: atime.sec=1607067439, atime.nsec=464677000, mtime.sec=1607067439, mtime.nsec=464677000, ctime.sec=1607067440, ctime.nsec=474962468. - -2) Tested with Samba durable reconnect. -While fio is running from Windows client, disconnect container network for 30 -seconds. -`docker network disconnect 8e88fcecf152 vdfsops0aa1bfa9 && sleep 30 && docker network connect --ip 10.161.191.169 8e88fcecf152 vdfsops0aa1bfa9` -fio is still kept running without error. I verified from network trace that durable reconnect succeeded. Samba didn't show any durable reconnect failure log. -Notes: the default durable reconnect timeout is 60 seconds in Samba, so the network disconnection can't be last for a long time. ---- - fs/9p/v9fs_vfs.h | 6 ++++++ - fs/9p/vfs_inode.c | 7 +++++-- - fs/9p/vfs_inode_dotl.c | 9 ++++++++- - 3 files changed, 19 insertions(+), 3 deletions(-) - -diff --git a/fs/9p/v9fs_vfs.h b/fs/9p/v9fs_vfs.h -index d3aefbec4..9e9c94e2c 100644 ---- a/fs/9p/v9fs_vfs.h -+++ b/fs/9p/v9fs_vfs.h -@@ -72,6 +72,12 @@ static inline void v9fs_invalidate_inode_attr(struct inode *inode) - v9inode = V9FS_I(inode); - v9inode->cache_validity |= V9FS_INO_INVALID_ATTR; - } -+static inline bool v9fs_inode_attr_is_valid(struct inode *inode) -+{ -+ struct v9fs_inode *v9inode; -+ v9inode = V9FS_I(inode); -+ return !(v9inode->cache_validity & V9FS_INO_INVALID_ATTR); -+} - - int v9fs_open_to_dotl_flags(int flags); - -diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c -index 3e68521f4..0315a9da8 100644 ---- a/fs/9p/vfs_inode.c -+++ b/fs/9p/vfs_inode.c -@@ -981,9 +981,12 @@ v9fs_vfs_getattr(struct mnt_idmap *idmap, const struct path *path, - struct p9_fid *fid; - struct p9_wstat *st; - -- p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry); -+ p9_debug(P9_DEBUG_VFS, "dentry: %p(%pd)\n", dentry, dentry); - v9ses = v9fs_dentry2v9ses(dentry); -- if (v9ses->cache & (CACHE_META|CACHE_LOOSE)) { -+ if (v9fs_inode_attr_is_valid(d_inode(dentry)) && -+ (v9ses->cache & (CACHE_META|CACHE_LOOSE))) { -+ p9_debug(P9_DEBUG_VFS, "cache hit: dentry: %p(%pd)\n", -+ dentry, dentry); - generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat); - return 0; - } else if (v9ses->cache & CACHE_WRITEBACK) { -diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c -index 3397939fd..d6379eff1 100644 ---- a/fs/9p/vfs_inode_dotl.c -+++ b/fs/9p/vfs_inode_dotl.c -@@ -433,7 +433,10 @@ v9fs_vfs_getattr_dotl(struct mnt_idmap *idmap, - - p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry); - v9ses = v9fs_dentry2v9ses(dentry); -- if (v9ses->cache & (CACHE_META|CACHE_LOOSE)) { -+ if (v9fs_inode_attr_is_valid(inode) && -+ (v9ses->cache & (CACHE_META|CACHE_LOOSE))) { -+ p9_debug(P9_DEBUG_VFS, "cache hit: dentry: %p(%pd)\n", -+ dentry, dentry); - generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat); - return 0; - } else if (v9ses->cache) { -@@ -445,6 +448,10 @@ v9fs_vfs_getattr_dotl(struct mnt_idmap *idmap, - "flushing writeback during getattr returned %d\n", retval); - } - } -+ -+ p9_debug(P9_DEBUG_VFS, "cache miss: dentry: %p(%pd)\n", -+ dentry, dentry); -+ - fid = v9fs_fid_lookup(dentry); - if (IS_ERR(fid)) - return PTR_ERR(fid); --- -2.43.7 - diff --git a/SPECS/91/linux/9p/0007-9p-fscache-Make-dcache-work-with-case-insensitive-vo.patch b/SPECS/91/linux/9p/0007-9p-fscache-Make-dcache-work-with-case-insensitive-vo.patch deleted file mode 100644 index 32d9d34929..0000000000 --- a/SPECS/91/linux/9p/0007-9p-fscache-Make-dcache-work-with-case-insensitive-vo.patch +++ /dev/null @@ -1,360 +0,0 @@ -From 86796c37d8f07ed1c30d82b75ff9e36ab400f949 Mon Sep 17 00:00:00 2001 -From: Albert Guo -Date: Tue, 10 Nov 2020 00:06:46 -0800 -Subject: [PATCH 7/8] 9p: fscache Make dcache work with case insensitive - volumes - -We run Samba on top of VDFS 9p volumes to support SMB protocol for Windows -clients which is case insensitive. In order to speed up the Samba -create/delete operation, we enhanced VDFS to support case insensitive lookup. -This functionality is turned on by setting xattr "VMware CaseInsensitive Volume" -as "ci-share" on the default volume. -However, the directory cache for 9p volumes is case sensitive by default. -Due to the above inconsistence, we found incorrect behavior like below: -Step 1: touch a.txt -Step 2: rm A.TXT // a.txt is removed from VDFS volume, but not from dcache. -Step 3: touch a.txt // 9p client finds this entry from dache, so it won't - // actually send create command to 9p server. As a - // result, this file never gets created. - -This patches now checks whether a volume has "VMware CaseInsensitive Volume" -xattr set. When this xattr is set, case insensitive dentry operations will be -set. -To support case insenstive dentry operations, we customized two functions: -d_compare and d_hash. - -Testing Done: -From a 9p mount point which has turn on CI support: -$ touch a.txt && rm A.TXT && touch a.txt - -Before fix: a.txt can't be listed in the directory - -After fix: a.txt can be seen in the directory - -Test unicode string as well, it works as expected. ---- - fs/9p/Makefile | 1 + - fs/9p/vfs_ci.c | 190 +++++++++++++++++++++++++++++++++++++++++++++ - fs/9p/vfs_ci.h | 18 +++++ - fs/9p/vfs_dentry.c | 11 +++ - fs/9p/vfs_super.c | 14 +++- - 5 files changed, 233 insertions(+), 1 deletion(-) - create mode 100644 fs/9p/vfs_ci.c - create mode 100644 fs/9p/vfs_ci.h - -diff --git a/fs/9p/Makefile b/fs/9p/Makefile -index e7800a5c7..3a472b284 100644 ---- a/fs/9p/Makefile -+++ b/fs/9p/Makefile -@@ -9,6 +9,7 @@ obj-$(CONFIG_9P_FS) := 9p.o - vfs_file.o \ - vfs_dir.o \ - vfs_dentry.o \ -+ vfs_ci.o \ - v9fs.o \ - fid.o \ - xattr.o -diff --git a/fs/9p/vfs_ci.c b/fs/9p/vfs_ci.c -new file mode 100644 -index 000000000..8b36628b8 ---- /dev/null -+++ b/fs/9p/vfs_ci.c -@@ -0,0 +1,190 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* -+ * Support for case insensitive operations -+ * -+ * Copyright (C) 2023 by Albert Guo -+ */ -+ -+#include /* For toupper() */ -+#include -+#include -+ -+#include "xattr.h" -+ -+/** -+ * v9fs_dentry_ci_compare - Case insensitive comparison of @name and @str -+ * @dentry: dentry in question -+ * @len: The len of the str -+ * @str: The name of the dentry -+ * @name: The new name to compare -+ * @return 0 if the name matches by case insensitive comparison. -+ */ -+int v9fs_dentry_ci_compare(const struct dentry *dentry, -+ unsigned int len, const char *str, const struct qstr *name) -+{ -+ if (str == NULL || name == NULL) { -+ return 1; -+ } -+ -+ p9_debug(P9_DEBUG_VFS, "str=%s, name=%s\n", str, name->name); -+ /* -+ * We make the assumption here that uppercase characters in the local -+ * codepage are always the same length as their lowercase counterparts. -+ * -+ * If that's ever not the case, then this will fail to match it. -+ */ -+ if (name->len != len) -+ return 1; -+ -+ /* -+ * We assume the 9p name is always encoded with UTF8. -+ */ -+ return strncasecmp(str, name->name, len); -+} -+ -+/** -+ * v9fs_dentry_ci_hash - Compute the hash after converting to upper case -+ * @dentry: dentry in question -+ * @q: The name to compute hash -+ * The hash will be stored in q. -+ * @return 0 -+ */ -+ -+int v9fs_dentry_ci_hash(const struct dentry *dentry, struct qstr *q) -+{ -+ unsigned long hash; -+ int i; -+ -+ hash = init_name_hash(dentry); -+ for (i = 0; i < q->len; i += 1) { -+ hash = partial_name_hash(toupper(q->name[i]), hash); -+ } -+ q->hash = end_name_hash(hash); -+ -+ return 0; -+} -+ -+/** -+ * v9fs_release_dentry_before_d_op - Call this function to release a dentry -+ * before whether a volume is a ci volume is determined. -+ */ -+ -+static void v9fs_release_dentry_before_d_op(struct dentry *entry) -+{ -+ if(!IS_ERR(entry) && entry) { -+ /* -+ * dentry caches direcotroy operations. -+ * We shouldn't cache dentry before d_op is finalized. -+ */ -+ d_drop(entry); -+ dput(entry); -+ } -+} -+ -+/** -+ * v9fs_lookup_comp - Lookup one component from current directory -+ * @parent - dentry for current directory -+ * @comp_name - the name to lookup -+ * @flags - lookup flags -+ * @return dentry for the @comp_anme if found, else return NULL -+ * The caller needs to release the dentry. -+ */ -+ -+static struct dentry *v9fs_lookup_comp( -+ struct dentry *parent, const char *comp_name, int flags) -+{ -+ struct qstr comp_qstr = \ -+ QSTR_INIT(comp_name, strlen(comp_name)); -+ struct dentry *new_dentry = d_alloc(parent, &comp_qstr); -+ struct dentry *res = NULL; -+ struct inode *inode = parent->d_inode; -+ if (new_dentry == NULL) { -+ return NULL; -+ } -+ res = inode->i_op->lookup(inode, new_dentry, flags); -+ if (IS_ERR(res)) { -+ p9_debug(P9_DEBUG_VFS, "Failed to lookup '%s' in dir %p\n", -+ comp_name, parent); -+ v9fs_release_dentry_before_d_op(new_dentry); -+ new_dentry = NULL; -+ } else if (res) { -+ v9fs_release_dentry_before_d_op(new_dentry); -+ new_dentry = res; -+ } -+ p9_debug(P9_DEBUG_VFS, "dir (%p), found new dentry(%p, %s).\n", -+ parent, new_dentry, comp_name); -+ return new_dentry; -+} -+ -+/** -+ * v9fs_ci_volume - Check whether a volume is a case insenstive volume by -+ * checking "VMware CaseInsensitive Volume" xattr on "volumes/default" -+ * -+ * @root - root dentry for the volume -+ * @flags - lookup flags -+ * @return true if the volume is a case insenstive volume, else false -+ * Note: This is for VDFS SMB file system only, for other 9p file systems, false -+ * will be returned. -+ */ -+ -+bool v9fs_ci_volume(struct dentry *root, int flags) -+{ -+ bool ret = false; -+ struct dentry *subvol_dentry = NULL, *vol_dentry = NULL; -+ struct dentry *sym_dentry = NULL, *default_dentry = NULL; -+ char buf[256]; -+ ssize_t xattr_size; -+ const char *ci_xattr_name = "VMware CaseInsensitive Volume"; -+ const char *ci_xattr_value = "ci-share"; -+ char sub_vol_uuid[40] = {0}; -+ struct inode *inode = NULL; -+ const char *link_target; -+ int vol_uuid_len = 0; -+ struct delayed_call call; -+ vol_dentry = v9fs_lookup_comp(root, "volumes", flags); -+ if (IS_ERR(vol_dentry) || vol_dentry == NULL) { -+ goto out; -+ } -+ sym_dentry = v9fs_lookup_comp(vol_dentry, "default", flags); -+ if (IS_ERR(sym_dentry) || sym_dentry == NULL) { -+ goto out; -+ } -+ -+ inode = sym_dentry->d_inode; -+ if (inode->i_op->get_link == NULL) { -+ goto out; -+ } -+ link_target = inode->i_op->get_link(sym_dentry, inode, &call); -+ if (IS_ERR(link_target)) { -+ goto out; -+ } -+ -+ p9_debug(P9_DEBUG_VFS, "Got link target %s\n", link_target); -+ vol_uuid_len = strstr(link_target, "/") - link_target; -+ if (vol_uuid_len > 0 && vol_uuid_len < sizeof(sub_vol_uuid)) { -+ strncpy(sub_vol_uuid, link_target, vol_uuid_len); -+ } else { -+ goto out; -+ } -+ -+ p9_debug(P9_DEBUG_VFS, "Got sub vol UUID %s\n", sub_vol_uuid); -+ subvol_dentry = v9fs_lookup_comp(vol_dentry, sub_vol_uuid, flags); -+ if (IS_ERR(subvol_dentry) || subvol_dentry == NULL) { -+ goto out; -+ } -+ -+ default_dentry = v9fs_lookup_comp(subvol_dentry, "default", flags); -+ -+ xattr_size = v9fs_xattr_get(default_dentry, -+ ci_xattr_name, buf, sizeof(buf)); -+ if (xattr_size > 0 && -+ memcmp(ci_xattr_value, buf, strlen(ci_xattr_value)) == 0) { -+ ret = true; -+ } -+out: -+ v9fs_release_dentry_before_d_op(vol_dentry); -+ v9fs_release_dentry_before_d_op(sym_dentry); -+ v9fs_release_dentry_before_d_op(subvol_dentry); -+ v9fs_release_dentry_before_d_op(default_dentry); -+ return ret; -+} -diff --git a/fs/9p/vfs_ci.h b/fs/9p/vfs_ci.h -new file mode 100644 -index 000000000..36d0633f1 ---- /dev/null -+++ b/fs/9p/vfs_ci.h -@@ -0,0 +1,18 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* -+ * Support for case insensitive operations -+ * -+ * Copyright (C) 2023 by Albert Guo -+ */ -+ -+#ifndef _VFS_CI_H_ -+#define _VFS_CI_H_ -+extern const struct dentry_operations v9fs_cached_dentry_ci_operations; -+int v9fs_dentry_ci_compare(const struct dentry *dentry, -+ unsigned int len, const char *str, -+ const struct qstr *name); -+ -+int v9fs_dentry_ci_hash(const struct dentry *dentry, struct qstr *q); -+ -+bool v9fs_ci_volume(struct dentry *root, int flags); -+#endif -diff --git a/fs/9p/vfs_dentry.c b/fs/9p/vfs_dentry.c -index 01338d4c2..87cd4f34d 100644 ---- a/fs/9p/vfs_dentry.c -+++ b/fs/9p/vfs_dentry.c -@@ -6,6 +6,7 @@ - * Copyright (C) 2002 by Ron Minnich - */ - -+#include /* For toupper() */ - #include - #include - #include -@@ -22,6 +23,7 @@ - #include "v9fs.h" - #include "v9fs_vfs.h" - #include "fid.h" -+#include "vfs_ci.h" - - /** - * v9fs_cached_dentry_delete - called when dentry refcount equals 0 -@@ -106,6 +108,15 @@ const struct dentry_operations v9fs_cached_dentry_operations = { - .d_release = v9fs_dentry_release, - }; - -+const struct dentry_operations v9fs_cached_dentry_ci_operations = { -+ .d_revalidate = v9fs_lookup_revalidate, -+ .d_weak_revalidate = v9fs_lookup_revalidate, -+ .d_delete = v9fs_cached_dentry_delete, -+ .d_release = v9fs_dentry_release, -+ .d_compare = v9fs_dentry_ci_compare, -+ .d_hash = v9fs_dentry_ci_hash, -+}; -+ - const struct dentry_operations v9fs_dentry_operations = { - .d_delete = always_delete_dentry, - .d_release = v9fs_dentry_release, -diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c -index 489db161a..0233bda37 100644 ---- a/fs/9p/vfs_super.c -+++ b/fs/9p/vfs_super.c -@@ -21,12 +21,14 @@ - #include - #include - #include -+#include - - #include "v9fs.h" - #include "v9fs_vfs.h" - #include "fid.h" - #include "xattr.h" - #include "acl.h" -+#include "vfs_ci.h" - - static const struct super_operations v9fs_super_ops, v9fs_super_ops_dotl; - -@@ -113,7 +115,7 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags, - struct p9_fid *fid; - int retval = 0; - -- p9_debug(P9_DEBUG_VFS, "\n"); -+ p9_debug(P9_DEBUG_VFS, "mount options='%s'\n", (char *)data); - - v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL); - if (!v9ses) -@@ -156,6 +158,16 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags, - goto release_sb; - v9fs_fid_add(root, &fid); - -+ /* VDFS: Determine whether the volume has ci xattr set*/ -+ if ((v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE)) { -+ if (v9fs_ci_volume(root, flags)) { -+ sb->s_d_op = &v9fs_cached_dentry_ci_operations; -+ /* Refresh the dentry operations in the root dentry */ -+ d_set_d_op(sb->s_root, sb->s_d_op); -+ p9_debug(P9_DEBUG_VFS, "ci volume: root dentry %p\n", -+ sb->s_root); -+ } -+ } - p9_debug(P9_DEBUG_VFS, " simple set mount, return 0\n"); - return dget(sb->s_root); - --- -2.43.7 - diff --git a/SPECS/91/linux/9p/0008-9p-fscache-Ensure-consistent-blksize-is-returned-fro.patch b/SPECS/91/linux/9p/0008-9p-fscache-Ensure-consistent-blksize-is-returned-fro.patch deleted file mode 100644 index e2c924c295..0000000000 --- a/SPECS/91/linux/9p/0008-9p-fscache-Ensure-consistent-blksize-is-returned-fro.patch +++ /dev/null @@ -1,122 +0,0 @@ -From e52c811646f531f229e5e4d8405d156572172895 Mon Sep 17 00:00:00 2001 -From: Albert Guo -Date: Thu, 10 Dec 2020 21:01:14 -0800 -Subject: [PATCH 8/8] 9p: fscache: Ensure consistent blksize is returned from - 9p client. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When blksize is read from inode cache, it is inherited from -superblock; when blksize is read from 9p server directly, 9p client reset -the blksize explicitly with value got from 9p server. - -9p client cacluates the block size of super block from msize in the mount -option, the relevant code is showed here: -> v9ses->maxdata = v9ses->clnt->msize - P9_IOHDRSZ; -> sb->s_blocksize_bits = fls(v9ses->maxdata - 1); -For vSAN File Service, msize is 16300 in our FSVM, so the blksize becomes 16k -in super block. -However, VDFS server always returns 4k blksize which is the block size of VDFS -file system itself. As a result, we saw below in vSAN File service env: -blksize is 16k if it's read from inode cache, else it will be 4k. -This kind of inconsistent behavior has caused failure in smb durable reconnect -check. - -This fix ensure the behavior in the two cases are consistent. i.e. Save -the blksize as blkbits in the inode so that the blksize got from inode cache is -the same as that got from 9p server. The blksize reported for each inode can be -different from that of the file system. - -Some reference: -1) man page of stat(2) -https://man7.org/linux/man-pages/man2/stat.2.html -The st_blksize doesn't not necessary need to be the same as file system's -block size. - -Explaination about st_blksize from stat(2): -blksize_t st_blksize; /* blocksize for filesystem I/O */ -The st_blksize field gives the "preferred" blocksize for efficient filesystem -I/O. (Writing to a file in smaller chunks may cause an inefficient -read-modify-re‐write.) - -2) NFS client behavior -NFS uses wsize as IO block size -build-scripts.eng.vmware.com:/scripts on /dbc/sc-dbc1105/build/scripts type nfs4 (rw,relatime,vers=4.0,rsize=32768,wsize=32768,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.162.210.5,local_lock=none,addr=10.184.242.20) - -$ stat /dbc/sc-dbc1105/build/scripts/README - File: ‘/dbc/sc-dbc1105/build/scripts/README’ - Size: 151 Blocks: 113 IO Block: 32768 regular file -Device: 2ch/44d Inode: 199622690 Links: 1 -Access: (0644/-rw-r--r--) Uid: (2047837/ syncer) Gid: ( 99/ nobody) -Access: 2016-12-15 14:54:13.206754033 -0800 -Modify: 2016-12-15 14:54:13.206754033 -0800 -Change: 2019-10-02 03:31:13.505042428 -0700 - -Note: VDFS server will also need corresponding change so as to has similar -behavior as NFS. - -Testing Done: -1) blksize is always 16k regardless of whether it's read from inode cache or not. -Use a tool to reproduce/test the issue: http://engweb.vmware.com/~aguo/test_tools/check_stat.c - /check_stat /vsfs/04a44f8d-80d5-417c-b016-70ce395b27d0/h10-161-165-163/f512d25f-d8d0-3d42-afab-020047464a4b/volumes/default/testfile -now.sec = 1607702476, now.usec = 503448 -getattr from cache: -fstat: atime.sec=1607702442, atime.nsec=836342000, mtime.sec=1607702476, mtime.nsec=259390272, ctime.sec=1607702476, ctime.nsec=259390272, blksize=4096. -getattr from 9p server: -fstat: atime.sec=1607702475, atime.nsec=503448000, mtime.sec=1607702475, mtime.nsec=503448000, ctime.sec=1607702476, ctime.nsec=273242695, blksize=4096. -getattr from cache: -fstat: atime.sec=1607702475, atime.nsec=503448000, mtime.sec=1607702475, mtime.nsec=503448000, ctime.sec=1607702476, ctime.nsec=273242695, blksize=4096. - -2) Tested Samba durable reconnect works fine. -docker network disconnect 683de6a3741d h10-161-165-163 && sleep 20 && docker network connect --ip=10.161.165.163 683de6a3741d h10-161-165-163 - -Before fix: -Durable reconnect failed due to below error: - vfs_default_durable_reconnect (fiofile): stat_ex.st_ex_blksize differs: cookie:4096 != stat:16384, denying durable reconnect - [2020/12/11 00:15:31.016476, 3] ../../source3/smbd/smb2_create.c:835(smbd_smb2_create_send) - smbd_smb2_create_send: durable_reconnect failed: NT_STATUS_OBJECT_NAME_NOT_FOUND => NT_STATUS_OBJECT_NAME_NOT_FOUND - -After fix: -Durable reconnect succeeded. -[Srinidhi: rebased on top of CVE-2026-64160 fix.] -Signed-off-by: Srinidhi Rao ---- - fs/9p/vfs_inode_dotl.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c -index d6379eff1..fc5ad6405 100644 ---- a/fs/9p/vfs_inode_dotl.c -+++ b/fs/9p/vfs_inode_dotl.c -@@ -467,8 +467,6 @@ v9fs_vfs_getattr_dotl(struct mnt_idmap *idmap, - - v9fs_stat2inode_dotl(st, d_inode(dentry), 0); - generic_fillattr(&nop_mnt_idmap, request_mask, d_inode(dentry), stat); -- /* Change block size to what the server returned */ -- stat->blksize = st->st_blksize; - - kfree(st); - return 0; -@@ -651,6 +649,9 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode, - if (!(flags & V9FS_STAT2INODE_KEEP_ISIZE)) - i_size_write(inode, stat->st_size); - inode->i_blocks = stat->st_blocks; -+ if (stat->st_blksize != 0) { -+ inode->i_blkbits = fls(stat->st_blksize - 1); -+ } - spin_unlock(&inode->i_lock); - } else { - if (stat->st_result_mask & P9_STATS_ATIME) { -@@ -684,6 +685,9 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode, - } - if (stat->st_result_mask & P9_STATS_BLOCKS) - inode->i_blocks = stat->st_blocks; -+ if (stat->st_blksize != 0) { -+ inode->i_blkbits = fls(stat->st_blksize - 1); -+ } - spin_unlock(&inode->i_lock); - } - if (stat->st_result_mask & P9_STATS_GEN) --- -2.43.7 diff --git a/SPECS/91/linux/CVE/0001-ALSA-usb-audio-Prevent-excessive-number-of-frames.patch b/SPECS/91/linux/CVE/0001-ALSA-usb-audio-Prevent-excessive-number-of-frames.patch deleted file mode 100644 index ab811e660d..0000000000 --- a/SPECS/91/linux/CVE/0001-ALSA-usb-audio-Prevent-excessive-number-of-frames.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 62932d9ed639a9fa71b4ac1a56766a4b43abb7e4 Mon Sep 17 00:00:00 2001 -From: Edward Adam Davis -Date: Tue, 13 Jan 2026 16:29:23 +0800 -Subject: ALSA: usb-audio: Prevent excessive number of frames - -[ Upstream commit ef5749ef8b307bf8717945701b1b79d036af0a15 ] - -In this case, the user constructed the parameters with maxpacksize 40 -for rate 22050 / pps 1000, and packsize[0] 22 packsize[1] 23. The buffer -size for each data URB is maxpacksize * packets, which in this example -is 40 * 6 = 240; When the user performs a write operation to send audio -data into the ALSA PCM playback stream, the calculated number of frames -is packsize[0] * packets = 264, which exceeds the allocated URB buffer -size, triggering the out-of-bounds (OOB) issue reported by syzbot [1]. - -Added a check for the number of single data URB frames when calculating -the number of frames to prevent [1]. - -[1] -BUG: KASAN: slab-out-of-bounds in copy_to_urb+0x261/0x460 sound/usb/pcm.c:1487 -Write of size 264 at addr ffff88804337e800 by task syz.0.17/5506 -Call Trace: - copy_to_urb+0x261/0x460 sound/usb/pcm.c:1487 - prepare_playback_urb+0x953/0x13d0 sound/usb/pcm.c:1611 - prepare_outbound_urb+0x377/0xc50 sound/usb/endpoint.c:333 - -Reported-by: syzbot+6db0415d6d5c635f72cb@syzkaller.appspotmail.com -Closes: https://syzkaller.appspot.com/bug?extid=6db0415d6d5c635f72cb -Tested-by: syzbot+6db0415d6d5c635f72cb@syzkaller.appspotmail.com -Signed-off-by: Edward Adam Davis -Link: https://patch.msgid.link/tencent_9AECE6CD2C7A826D902D696C289724E8120A@qq.com -Signed-off-by: Takashi Iwai -Signed-off-by: Sasha Levin -[Shivani: Backported for CVE-2026-23208. Modified to apply on 6.12.y ] -Signed-off-by: Shivani Agarwal ---- - sound/usb/pcm.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c -index 08bf535ed..3a4666e3b 100644 ---- a/sound/usb/pcm.c -+++ b/sound/usb/pcm.c -@@ -1505,7 +1505,7 @@ static int prepare_playback_urb(struct snd_usb_substream *subs, - - for (i = 0; i < ctx->packets; i++) { - counts = snd_usb_endpoint_next_packet_size(ep, ctx, i, avail); -- if (counts < 0) -+ if (counts < 0 || frames + counts >= ep->max_urb_frames) - break; - /* set up descriptor */ - urb->iso_frame_desc[i].offset = frames * stride; --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-CVE-2026-68399-bpf-Fix-UAF-in-sock-clone-early-bailo.patch b/SPECS/91/linux/CVE/0001-CVE-2026-68399-bpf-Fix-UAF-in-sock-clone-early-bailo.patch deleted file mode 100644 index eead6f1e43..0000000000 --- a/SPECS/91/linux/CVE/0001-CVE-2026-68399-bpf-Fix-UAF-in-sock-clone-early-bailo.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 0e1623d23fb1cf99150c2c0f62c5f27467c45ab1 Mon Sep 17 00:00:00 2001 -From: Matt Bobrowski -Date: Mon, 7 Sep 2026 10:41:26 +0000 -Subject: [PATCH] CVE-2026-68399: bpf: Fix UAF in sock clone early bailouts -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -commit 7cbd0c4cebe4c9f678d15e6b9ba975e1155a107f upstream. - -Similar to recent commit 9b51a6155d14 ("bpf,fork: wipe ->bpf_storage -before bailouts that access it"), sk_clone() performs an initial -shallow copy of the socket field ->sk_bpf_storage via sock_copy() -for the cloned socket newsk. - -If sk_clone() bails out early (e.g. if sk_filter_charge() fails) prior -to calling bpf_sk_storage_clone(), newsk->sk_bpf_storage still points -to the parent socket's BPF local storage. When newsk is subsequently -freed via sk_free(), the deallocation path (__sk_destruct() -> -bpf_sk_storage_free()) destroys the parent socket's BPF local storage, -leading to a use-after-free (UAF) on the parent socket. - -Fix this by resetting newsk->sk_bpf_storage to NULL immediately after -sock_copy() in sk_clone(), and remove the now redundant initialization -from bpf_sk_storage_clone(). - -Fixes: 6ac99e8f23d4 ("bpf: Introduce bpf sk local storage") -Fixes: f12dd75959b0 ("bpf: net: Set sk_bpf_storage back to NULL for cloned sk") -Signed-off-by: Matt Bobrowski -Signed-off-by: Daniel Borkmann -Reviewed-by: Kuniyuki Iwashima -Acked-by: Daniel Borkmann -Link: https://lore.kernel.org/bpf/20260709025316.999913-1-mattbobrowski@google.com -[ Ajay: Modified to apply on v6.12 ] -Signed-off-by: Ajay Kaher ---- - net/core/bpf_sk_storage.c | 2 -- - net/core/sock.c | 3 +++ - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/net/core/bpf_sk_storage.c b/net/core/bpf_sk_storage.c -index bc01b3aa6b0f..ccff64f1da2b 100644 ---- a/net/core/bpf_sk_storage.c -+++ b/net/core/bpf_sk_storage.c -@@ -158,8 +158,6 @@ int bpf_sk_storage_clone(const struct sock *sk, struct sock *newsk) - struct bpf_local_storage_elem *selem; - int ret = 0; - -- RCU_INIT_POINTER(newsk->sk_bpf_storage, NULL); -- - rcu_read_lock(); - sk_storage = rcu_dereference(sk->sk_bpf_storage); - -diff --git a/net/core/sock.c b/net/core/sock.c -index e8b03cf3a428..921326fcf613 100644 ---- a/net/core/sock.c -+++ b/net/core/sock.c -@@ -2411,6 +2411,9 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority) - sock_copy(newsk, sk); - - newsk->sk_prot_creator = prot; -+#ifdef CONFIG_BPF_SYSCALL -+ RCU_INIT_POINTER(newsk->sk_bpf_storage, NULL); -+#endif - - /* SANITY */ - if (likely(newsk->sk_net_refcnt)) { --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-CVE-2026-68404-wifi-cfg80211-use-wiphy-work-for-sock.patch b/SPECS/91/linux/CVE/0001-CVE-2026-68404-wifi-cfg80211-use-wiphy-work-for-sock.patch deleted file mode 100644 index a401e133fb..0000000000 --- a/SPECS/91/linux/CVE/0001-CVE-2026-68404-wifi-cfg80211-use-wiphy-work-for-sock.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 8894d755f7971fc5b4f84e6a413030d4ac85b86b Mon Sep 17 00:00:00 2001 -From: Cen Zhang -Date: Mon, 7 Sep 2026 10:39:49 +0000 -Subject: [PATCH] CVE-2026-68404: wifi: cfg80211: use wiphy work for socket - owner autodisconnect - -commit 0c2ed186bbe14304415476d6707b747dddcd8583 upstream. - -nl80211_netlink_notify() walks the cfg80211 wireless device list when a -NETLINK_GENERIC socket is released. If the socket owns a connection, the -notifier queues the embedded wdev->disconnect_wk work item. - -That work is a plain work_struct today. NETDEV_GOING_DOWN cancels it, but a -NETLINK_URELEASE notifier that already observed conn_owner_nlportid can -queue it after that cancel returns. _cfg80211_unregister_wdev() then -removes the wdev from the list and waits for RCU readers, but -synchronize_net() does not drain work queued by such a reader. - -Make the autodisconnect work a wiphy_work instead. The callback already -needs the wiphy mutex, and wiphy_work runs under that mutex. This lets -teardown cancel pending autodisconnect work while holding the mutex, -without a cancel_work_sync() vs. worker locking concern. - -Also cancel the wiphy work after list_del_rcu() and synchronize_net(). Any -NETLINK_URELEASE notifier that had already reached the wdev list has then -either queued the work and it is removed, or can no longer find the wdev. - -Fixes: bd2522b16884 ("cfg80211: NL80211_ATTR_SOCKET_OWNER support for CMD_CONNECT") -Suggested-by: Johannes Berg -Assisted-by: Codex:gpt-5.5 -Signed-off-by: Cen Zhang -Link: https://patch.msgid.link/20260706152418.779226-1-zzzccc427@gmail.com -Signed-off-by: Johannes Berg -[ Ajay Kaher: Modified to apply on v6.12 ] -Signed-off-by: Ajay Kaher ---- - include/net/cfg80211.h | 2 +- - net/wireless/core.c | 7 ++++--- - net/wireless/core.h | 2 +- - net/wireless/nl80211.c | 3 ++- - net/wireless/sme.c | 6 ++---- - 5 files changed, 10 insertions(+), 10 deletions(-) - -diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h -index 8dcb218e0804..f1db175010d3 100644 ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -6377,7 +6377,7 @@ struct wireless_dev { - enum ieee80211_bss_type conn_bss_type; - u32 conn_owner_nlportid; - -- struct work_struct disconnect_wk; -+ struct wiphy_work disconnect_wk; - u8 disconnect_bssid[ETH_ALEN]; - - struct list_head event_list; -diff --git a/net/wireless/core.c b/net/wireless/core.c -index 5bc3e12e7b2d..522cec4bb3be 100644 ---- a/net/wireless/core.c -+++ b/net/wireless/core.c -@@ -1259,6 +1259,7 @@ static void _cfg80211_unregister_wdev(struct wireless_dev *wdev, - list_del_rcu(&wdev->list); - synchronize_net(); - rdev->devlist_generation++; -+ wiphy_work_cancel(wdev->wiphy, &wdev->disconnect_wk); - - cfg80211_mlme_purge_registrations(wdev); - -@@ -1440,7 +1441,7 @@ void cfg80211_init_wdev(struct wireless_dev *wdev) - wdev->iftype == NL80211_IFTYPE_ADHOC) && !wdev->use_4addr) - wdev->netdev->priv_flags |= IFF_DONT_BRIDGE; - -- INIT_WORK(&wdev->disconnect_wk, cfg80211_autodisconnect_wk); -+ wiphy_work_init(&wdev->disconnect_wk, cfg80211_autodisconnect_wk); - } - - void cfg80211_register_wdev(struct cfg80211_registered_device *rdev, -@@ -1548,9 +1549,9 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, - scoped_guard(wiphy, &rdev->wiphy) { - cfg80211_leave(rdev, wdev); - cfg80211_remove_links(wdev); -+ /* since we just did cfg80211_leave() nothing to do there */ -+ wiphy_work_cancel(wdev->wiphy, &wdev->disconnect_wk); - } -- /* since we just did cfg80211_leave() nothing to do there */ -- cancel_work_sync(&wdev->disconnect_wk); - break; - case NETDEV_DOWN: - wiphy_lock(&rdev->wiphy); -diff --git a/net/wireless/core.h b/net/wireless/core.h -index b02b456cfca3..505acfe4a16d 100644 ---- a/net/wireless/core.h -+++ b/net/wireless/core.h -@@ -418,7 +418,7 @@ void __cfg80211_port_authorized(struct wireless_dev *wdev, const u8 *peer_addr, - const u8 *td_bitmap, u8 td_bitmap_len); - int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev, - struct wireless_dev *wdev); --void cfg80211_autodisconnect_wk(struct work_struct *work); -+void cfg80211_autodisconnect_wk(struct wiphy *wiphy, struct wiphy_work *work); - - /* SME implementation */ - void cfg80211_conn_work(struct work_struct *work); -diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c -index 47e3bcba268a..2cb453f35b57 100644 ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -20105,7 +20105,8 @@ static int nl80211_netlink_notify(struct notifier_block * nb, - wdev->nl_owner_dead = true; - schedule_work(&rdev->destroy_work); - } else if (wdev->conn_owner_nlportid == notify->portid) { -- schedule_work(&wdev->disconnect_wk); -+ wiphy_work_queue(wdev->wiphy, -+ &wdev->disconnect_wk); - } - - cfg80211_release_pmsr(wdev, notify->portid); -diff --git a/net/wireless/sme.c b/net/wireless/sme.c -index ab57648ca577..059b01bdb630 100644 ---- a/net/wireless/sme.c -+++ b/net/wireless/sme.c -@@ -1578,13 +1578,11 @@ int cfg80211_disconnect(struct cfg80211_registered_device *rdev, - * Used to clean up after the connection / connection attempt owner socket - * disconnects - */ --void cfg80211_autodisconnect_wk(struct work_struct *work) -+void cfg80211_autodisconnect_wk(struct wiphy *wiphy, struct wiphy_work *work) - { - struct wireless_dev *wdev = - container_of(work, struct wireless_dev, disconnect_wk); -- struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); -- -- guard(wiphy)(wdev->wiphy); -+ struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); - - if (wdev->conn_owner_nlportid) { - switch (wdev->iftype) { --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-CVE-2026-68409-wifi-mac80211-defer-link-RX-stats-per.patch b/SPECS/91/linux/CVE/0001-CVE-2026-68409-wifi-mac80211-defer-link-RX-stats-per.patch deleted file mode 100644 index 132c777b93..0000000000 --- a/SPECS/91/linux/CVE/0001-CVE-2026-68409-wifi-mac80211-defer-link-RX-stats-per.patch +++ /dev/null @@ -1,81 +0,0 @@ -From f2b172a8ccd0b950e98da94afa95a16ada45a9db Mon Sep 17 00:00:00 2001 -From: Maoyi Xie -Date: Mon, 7 Sep 2026 10:40:37 +0000 -Subject: [PATCH] CVE-2026-68409: wifi: mac80211: defer link RX stats percpu - free to RCU -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -[ Upstream commit aa2eb62525188269cdd402a583b9a8ed94657ff0 ] - -sta_remove_link() frees a removed MLO link's RX stats percpu buffer right -away, but defers only the link container to RCU: - - sta_info_free_link(&alloc->info); - kfree_rcu(alloc, rcu_head); - -The RX fast path reads link_sta under rcu_read_lock and writes the percpu -stats. A reader that resolved link_sta before the removal keeps the -pointer. The container stays alive from the kfree_rcu, so the read still -works. But the percpu block it points to is already freed. This needs -uses_rss. That is when pcpu_rx_stats exists. - -The full STA teardown frees the deflink stats only after -synchronize_net(). The link removal path had no such barrier. The race is -hard to win in practice, but the free should still wait for RCU. - -Free the link together with its data from a single RCU callback, so the -percpu block is reclaimed only after readers drain. - -Fixes: c71420db653a ("wifi: mac80211: RCU-ify link STA pointers") -Link: https://lore.kernel.org/r/20260626080158.3589711-1-maoyixie.tju@gmail.com -Suggested-by: Johannes Berg -Co-developed-by: Kaixuan Li -Signed-off-by: Kaixuan Li -Signed-off-by: Maoyi Xie -Link: https://patch.msgid.link/20260627083028.3826810-1-maoyixie.tju@gmail.com -Signed-off-by: Johannes Berg -Signed-off-by: Sasha Levin -[ Ajay Kaher: Modified to apply on v6.12 ] -Signed-off-by: Ajay Kaher ---- - net/mac80211/sta_info.c | 15 +++++++++++---- - 1 file changed, 11 insertions(+), 4 deletions(-) - -diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c -index 637756516cf5..d50554762a01 100644 ---- a/net/mac80211/sta_info.c -+++ b/net/mac80211/sta_info.c -@@ -355,6 +355,15 @@ static void sta_info_free_link(struct link_sta_info *link_sta) - free_percpu(link_sta->pcpu_rx_stats); - } - -+static void sta_link_free_rcu(struct rcu_head *head) -+{ -+ struct sta_link_alloc *alloc = -+ container_of(head, struct sta_link_alloc, rcu_head); -+ -+ sta_info_free_link(&alloc->info); -+ kfree(alloc); -+} -+ - static void sta_remove_link(struct sta_info *sta, unsigned int link_id, - bool unhash) - { -@@ -379,10 +388,8 @@ static void sta_remove_link(struct sta_info *sta, unsigned int link_id, - sta->sta.valid_links &= ~BIT(link_id); - RCU_INIT_POINTER(sta->link[link_id], NULL); - RCU_INIT_POINTER(sta->sta.link[link_id], NULL); -- if (alloc) { -- sta_info_free_link(&alloc->info); -- kfree_rcu(alloc, rcu_head); -- } -+ if (alloc) -+ call_rcu(&alloc->rcu_head, sta_link_free_rcu); - - ieee80211_sta_recalc_aggregates(&sta->sta); - } --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-CVE-2026-68447-drm-amdkfd-clamp-v9-CRIU-control-stac.patch b/SPECS/91/linux/CVE/0001-CVE-2026-68447-drm-amdkfd-clamp-v9-CRIU-control-stac.patch deleted file mode 100644 index d0ecf13393..0000000000 --- a/SPECS/91/linux/CVE/0001-CVE-2026-68447-drm-amdkfd-clamp-v9-CRIU-control-stac.patch +++ /dev/null @@ -1,99 +0,0 @@ -From 6750065f7715c0dfa9a35417f77681bc5cf9d124 Mon Sep 17 00:00:00 2001 -From: Yongqiang Sun -Date: Mon, 7 Sep 2026 13:39:48 +0000 -Subject: [PATCH] CVE-2026-68447: drm/amdkfd: clamp v9 CRIU control stack - checkpoint copy to BO size - -commit 426ffae6ecc7ec77d32bf8be065c21a1b881b084 upstream. - -CRIU checkpoint copies the MQD control stack using cp_hqd_cntl_stack_size -from hardware without bounding it to the allocated BO region. If the HW -field is larger than the queue's control stack allocation, memcpy reads -past the BO into adjacent GTT memory and can leak kernel data to userspace. - -Store the page-aligned control stack BO size in mqd_manager and clamp -checkpoint copies and reported checkpoint sizes to -min(cp_hqd_cntl_stack_size, mm->ctl_stack_size). Apply the same bound -for multi-XCC v9.4.3 checkpoint layout. - -Signed-off-by: Yongqiang Sun -Reviewed-by: David Francis -Signed-off-by: Alex Deucher -(cherry picked from commit 6c2abd0ec09e86c6323010673766f76050e28aa3) -Cc: stable@vger.kernel.org -Signed-off-by: Greg Kroah-Hartman -[ Ajay: - Modified to apply on v6.12 - — droped changes of checkpoint_mqd_v9_4_3 as not requied for v6.12 ] -Signed-off-by: Ajay Kaher ---- - drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.h | 1 + - drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 16 ++++++++++++++-- - 2 files changed, 15 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.h b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.h -index 17cc1f25c8d0..3b273fbfb20b 100644 ---- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.h -+++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.h -@@ -126,6 +126,7 @@ struct mqd_manager { - struct mutex mqd_mutex; - struct kfd_node *dev; - uint32_t mqd_size; -+ uint32_t ctl_stack_size; - }; - - struct mqd_user_context_save_area_header { -diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c -index 217af36dc097..83d5a083fbdf 100644 ---- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c -+++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c -@@ -27,6 +27,7 @@ - #include - #include "kfd_priv.h" - #include "kfd_mqd_manager.h" -+#include "kfd_topology.h" - #include "v9_structs.h" - #include "gc/gc_9_0_offset.h" - #include "gc/gc_9_0_sh_mask.h" -@@ -371,19 +372,21 @@ static void get_checkpoint_info(struct mqd_manager *mm, void *mqd, u32 *ctl_stac - { - struct v9_mqd *m = get_mqd(mqd); - -- *ctl_stack_size = m->cp_hqd_cntl_stack_size; -+ *ctl_stack_size = min_t(u32, m->cp_hqd_cntl_stack_size, mm->ctl_stack_size); - } - - static void checkpoint_mqd(struct mqd_manager *mm, void *mqd, void *mqd_dst, void *ctl_stack_dst) - { - struct v9_mqd *m; -+ u32 ctl_stack_copy_size; - /* Control stack is located one page after MQD. */ - void *ctl_stack = (void *)((uintptr_t)mqd + PAGE_SIZE); - - m = get_mqd(mqd); -+ ctl_stack_copy_size = min_t(u32, m->cp_hqd_cntl_stack_size, mm->ctl_stack_size); - - memcpy(mqd_dst, m, sizeof(struct v9_mqd)); -- memcpy(ctl_stack_dst, ctl_stack, m->cp_hqd_cntl_stack_size); -+ memcpy(ctl_stack_dst, ctl_stack, ctl_stack_copy_size); - } - - static void restore_mqd(struct mqd_manager *mm, void **mqd, -@@ -883,6 +886,15 @@ struct mqd_manager *mqd_manager_init_v9(enum KFD_MQD_TYPE type, - mqd->checkpoint_mqd = checkpoint_mqd; - mqd->restore_mqd = restore_mqd; - mqd->mqd_size = sizeof(struct v9_mqd); -+ if (dev->kfd->cwsr_enabled) { -+ struct kfd_topology_device *topo_dev; -+ -+ topo_dev = kfd_topology_device_by_id(dev->id); -+ if (topo_dev) -+ mqd->ctl_stack_size = -+ ALIGN(topo_dev->node_props.ctl_stack_size, -+ PAGE_SIZE); -+ } - mqd->mqd_stride = mqd_stride_v9; - #if defined(CONFIG_DEBUG_FS) - mqd->debugfs_show_mqd = debugfs_show_mqd; --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-KVM-arm64-vgic-Handle-race-between-interrupt-affini.patch b/SPECS/91/linux/CVE/0001-KVM-arm64-vgic-Handle-race-between-interrupt-affini.patch deleted file mode 100644 index 71bf1e5721..0000000000 --- a/SPECS/91/linux/CVE/0001-KVM-arm64-vgic-Handle-race-between-interrupt-affini.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 7258770e5814f15e8308ebda82ac9acf6964ba8e Mon Sep 17 00:00:00 2001 -From: Marc Zyngier -Date: Mon, 15 Jun 2026 19:16:25 +0100 -Subject: [PATCH] KVM: arm64: vgic: Handle race between interrupt affinity - change and LPI disabling - -commit 7258770e5814f15e8308ebda82ac9acf6964ba8e upstream. - -Hyunwoo Kim reports some really bad races should the following -situation occur: - -- LPI-I is pending in vcpu-B's AP list -- vcpu-A writes to vcpu-B's RD to disable its LPIs -- vcpu-C moves I from B to C - -If the last two race nicely enough, vgic_prune_ap_list() can drop -the irq and AP list locks, reacquire them, and in the interval -the irq has been freed. UAF follows. - -The fix is two-fold: - -- Before dropping the irq and ap_list locks, take a reference on - the irq - -- Do not try to handle migration of the pending bit: there is no - expectation that this state is retained, as per the architecture - -With that, we're sure that the interrupt is still around, and we -safely remove it from the AP list as it has no target at this -stage (unless another interrupt fires, but that's another story). - -Reported-by: Hyunwoo Kim -Tested-by: Hyunwoo Kim -Link: https://lore.kernel.org/r/ailsCnyoS82r_QRz@v4bel -Link: https://patch.msgid.link/20260615181625.3029352-1-maz@kernel.org -Fixes: 5dd4b924e390a ("KVM: arm/arm64: vgic: Add refcounting for IRQs") -Signed-off-by: Marc Zyngier -Cc: stable@vger.kernel.org -[ Brennan: use vgic_put_irq() as was done previous to d54594acc ] -Signed-off-by: Brennan Lamoreaux ---- - arch/arm64/kvm/vgic/vgic.c | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/arch/arm64/kvm/vgic/vgic.c b/arch/arm64/kvm/vgic/vgic.c -index 5a4768d8cd4f..70a161383e5a 100644 ---- a/arch/arm64/kvm/vgic/vgic.c -+++ b/arch/arm64/kvm/vgic/vgic.c -@@ -142,6 +142,7 @@ void vgic_flush_pending_lpis(struct kvm_vcpu *vcpu) - list_for_each_entry_safe(irq, tmp, &vgic_cpu->ap_list_head, ap_list) { - if (irq->intid >= VGIC_MIN_LPI) { - raw_spin_lock(&irq->irq_lock); -+ irq->pending_latch = false; - list_del(&irq->ap_list); - irq->vcpu = NULL; - raw_spin_unlock(&irq->irq_lock); -@@ -661,7 +662,11 @@ static void vgic_prune_ap_list(struct kvm_vcpu *vcpu) - continue; - } - -- /* This interrupt looks like it has to be migrated. */ -+ /* -+ * This interrupt looks like it has to be migrated, -+ * make sure it is kept alive while locks are dropped. -+ */ -+ vgic_get_irq_kref(irq); - - raw_spin_unlock(&irq->irq_lock); - raw_spin_unlock(&vgic_cpu->ap_list_lock); -@@ -704,6 +709,8 @@ static void vgic_prune_ap_list(struct kvm_vcpu *vcpu) - raw_spin_unlock(&vcpuB->arch.vgic_cpu.ap_list_lock); - raw_spin_unlock(&vcpuA->arch.vgic_cpu.ap_list_lock); - -+ vgic_put_irq(vcpu->kvm, irq); -+ - if (target_vcpu_needs_kick) { - kvm_make_request(KVM_REQ_IRQ_PENDING, target_vcpu); - kvm_vcpu_kick(target_vcpu); diff --git a/SPECS/91/linux/CVE/0001-RDMA-rxe-Fix-iova-to-va-conversion-for-MR-page-sizes.patch b/SPECS/91/linux/CVE/0001-RDMA-rxe-Fix-iova-to-va-conversion-for-MR-page-sizes.patch deleted file mode 100644 index 9bd47a99cf..0000000000 --- a/SPECS/91/linux/CVE/0001-RDMA-rxe-Fix-iova-to-va-conversion-for-MR-page-sizes.patch +++ /dev/null @@ -1,564 +0,0 @@ -From 409c2c5508f3d30627bea576f8676de523cb906e Mon Sep 17 00:00:00 2001 -From: Li Zhijian -Date: Fri, 16 Jan 2026 11:27:53 +0800 -Subject: [PATCH] RDMA/rxe: Fix iova-to-va conversion for MR page sizes != - PAGE_SIZE - -[ Upstream commit 12985e5915a0b8354796efadaaeb201eed115377 ] - -The current implementation incorrectly handles memory regions (MRs) with -page sizes different from the system PAGE_SIZE. The core issue is that -rxe_set_page() is called with mr->page_size step increments, but the -page_list stores individual struct page pointers, each representing -PAGE_SIZE of memory. - -ib_sg_to_page() has ensured that when i>=1 either -a) SG[i-1].dma_end and SG[i].dma_addr are contiguous -or -b) SG[i-1].dma_end and SG[i].dma_addr are mr->page_size aligned. - -This leads to incorrect iova-to-va conversion in scenarios: - -1) page_size < PAGE_SIZE (e.g., MR: 4K, system: 64K): - ibmr->iova = 0x181800 - sg[0]: dma_addr=0x181800, len=0x800 - sg[1]: dma_addr=0x173000, len=0x1000 - - Access iova = 0x181800 + 0x810 = 0x182010 - Expected VA: 0x173010 (second SG, offset 0x10) - Before fix: - - index = (0x182010 >> 12) - (0x181800 >> 12) = 1 - - page_offset = 0x182010 & 0xFFF = 0x10 - - xarray[1] stores system page base 0x170000 - - Resulting VA: 0x170000 + 0x10 = 0x170010 (wrong) - -2) page_size > PAGE_SIZE (e.g., MR: 64K, system: 4K): - ibmr->iova = 0x18f800 - sg[0]: dma_addr=0x18f800, len=0x800 - sg[1]: dma_addr=0x170000, len=0x1000 - - Access iova = 0x18f800 + 0x810 = 0x190010 - Expected VA: 0x170010 (second SG, offset 0x10) - Before fix: - - index = (0x190010 >> 16) - (0x18f800 >> 16) = 1 - - page_offset = 0x190010 & 0xFFFF = 0x10 - - xarray[1] stores system page for dma_addr 0x170000 - - Resulting VA: system page of 0x170000 + 0x10 = 0x170010 (wrong) - -Yi Zhang reported a kernel panic[1] years ago related to this defect. - -Solution: -1. Replace xarray with pre-allocated rxe_mr_page array for sequential - indexing (all MR page indices are contiguous) -2. Each rxe_mr_page stores both struct page* and offset within the - system page -3. Handle MR page_size != PAGE_SIZE relationships: - - page_size > PAGE_SIZE: Split MR pages into multiple system pages - - page_size <= PAGE_SIZE: Store offset within system page -4. Add boundary checks and compatibility validation - -This ensures correct iova-to-va conversion regardless of MR page size -and system PAGE_SIZE relationship, while improving performance through -array-based sequential access. - -Tests on 4K and 64K PAGE_SIZE hosts: -- rdma-core/pytests - $ ./build/bin/run_tests.py --dev eth0_rxe -- blktest: - $ TIMEOUT=30 QUICK_RUN=1 USE_RXE=1 NVMET_TRTYPES=rdma ./check nvme srp rnbd - -[1] https://lore.kernel.org/all/CAHj4cs9XRqE25jyVw9rj9YugffLn5+f=1znaBEnu1usLOciD+g@mail.gmail.com/T/ - -Fixes: 592627ccbdff ("RDMA/rxe: Replace rxe_map and rxe_phys_buf by xarray") -Signed-off-by: Li Zhijian -Link: https://patch.msgid.link/20260116032753.2574363-1-lizhijian@fujitsu.com -Signed-off-by: Leon Romanovsky -[ Keerthana K: Backport to v6.12.y. Upstream's rxe_mr_flush_pmem_iova() - hunk is applied to v6.12's rxe_flush_pmem_iova() instead, since v6.12 - predates the later ODP-support commit that split that function into - an is_odp_mr() dispatcher plus this helper; every other hunk applies - unchanged at the same call sites. ] -Signed-off-by: Keerthana K ---- - drivers/infiniband/sw/rxe/rxe_mr.c | 285 ++++++++++++++++++++++------------ - drivers/infiniband/sw/rxe/rxe_verbs.h | 10 +- - 2 files changed, 196 insertions(+), 99 deletions(-) - -diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c -index da3dee5..2e9ab43 100644 ---- a/drivers/infiniband/sw/rxe/rxe_mr.c -+++ b/drivers/infiniband/sw/rxe/rxe_mr.c -@@ -72,14 +72,46 @@ void rxe_mr_init_dma(int access, struct rxe_mr *mr) - mr->ibmr.type = IB_MR_TYPE_DMA; - } - -+/* -+ * Convert iova to page_info index. The page_info stores pages of size -+ * PAGE_SIZE, but MRs can have different page sizes. This function -+ * handles the conversion for all cases: -+ * -+ * 1. mr->page_size > PAGE_SIZE: -+ * The MR's iova may not be aligned to mr->page_size. We use the -+ * aligned base (iova & page_mask) as reference, then calculate -+ * which PAGE_SIZE sub-page the iova falls into. -+ * -+ * 2. mr->page_size <= PAGE_SIZE: -+ * Use simple shift arithmetic since each page_info entry corresponds -+ * to one or more MR pages. -+ */ - static unsigned long rxe_mr_iova_to_index(struct rxe_mr *mr, u64 iova) - { -- return (iova >> mr->page_shift) - (mr->ibmr.iova >> mr->page_shift); -+ int idx; -+ -+ if (mr_page_size(mr) > PAGE_SIZE) -+ idx = (iova - (mr->ibmr.iova & mr->page_mask)) >> PAGE_SHIFT; -+ else -+ idx = (iova >> mr->page_shift) - -+ (mr->ibmr.iova >> mr->page_shift); -+ -+ WARN_ON(idx >= mr->nbuf); -+ return idx; - } - -+/* -+ * Convert iova to offset within the page_info entry. -+ * -+ * For mr_page_size > PAGE_SIZE, the offset is within the system page. -+ * For mr_page_size <= PAGE_SIZE, the offset is within the MR page size. -+ */ - static unsigned long rxe_mr_iova_to_page_offset(struct rxe_mr *mr, u64 iova) - { -- return iova & (mr_page_size(mr) - 1); -+ if (mr_page_size(mr) > PAGE_SIZE) -+ return iova & (PAGE_SIZE - 1); -+ else -+ return iova & (mr_page_size(mr) - 1); - } - - static bool is_pmem_page(struct page *pg) -@@ -93,37 +125,69 @@ static bool is_pmem_page(struct page *pg) - - static int rxe_mr_fill_pages_from_sgt(struct rxe_mr *mr, struct sg_table *sgt) - { -- XA_STATE(xas, &mr->page_list, 0); - struct sg_page_iter sg_iter; - struct page *page; - bool persistent = !!(mr->access & IB_ACCESS_FLUSH_PERSISTENT); - -+ WARN_ON(mr_page_size(mr) != PAGE_SIZE); -+ - __sg_page_iter_start(&sg_iter, sgt->sgl, sgt->orig_nents, 0); - if (!__sg_page_iter_next(&sg_iter)) - return 0; - -- do { -- xas_lock(&xas); -- while (true) { -- page = sg_page_iter_page(&sg_iter); -+ while (true) { -+ page = sg_page_iter_page(&sg_iter); - -- if (persistent && !is_pmem_page(page)) { -- rxe_dbg_mr(mr, "Page can't be persistent\n"); -- xas_set_err(&xas, -EINVAL); -- break; -- } -- -- xas_store(&xas, page); -- if (xas_error(&xas)) -- break; -- xas_next(&xas); -- if (!__sg_page_iter_next(&sg_iter)) -- break; -+ if (persistent && !is_pmem_page(page)) { -+ rxe_dbg_mr(mr, "Page can't be persistent\n"); -+ return -EINVAL; - } -- xas_unlock(&xas); -- } while (xas_nomem(&xas, GFP_KERNEL)); - -- return xas_error(&xas); -+ mr->page_info[mr->nbuf].page = page; -+ mr->page_info[mr->nbuf].offset = 0; -+ mr->nbuf++; -+ -+ if (!__sg_page_iter_next(&sg_iter)) -+ break; -+ } -+ -+ return 0; -+} -+ -+static int __alloc_mr_page_info(struct rxe_mr *mr, int num_pages) -+{ -+ mr->page_info = kcalloc(num_pages, sizeof(struct rxe_mr_page), -+ GFP_KERNEL); -+ if (!mr->page_info) -+ return -ENOMEM; -+ -+ mr->max_allowed_buf = num_pages; -+ mr->nbuf = 0; -+ -+ return 0; -+} -+ -+static int alloc_mr_page_info(struct rxe_mr *mr, int num_pages) -+{ -+ int ret; -+ -+ WARN_ON(mr->num_buf); -+ ret = __alloc_mr_page_info(mr, num_pages); -+ if (ret) -+ return ret; -+ -+ mr->num_buf = num_pages; -+ -+ return 0; -+} -+ -+static void free_mr_page_info(struct rxe_mr *mr) -+{ -+ if (!mr->page_info) -+ return; -+ -+ kfree(mr->page_info); -+ mr->page_info = NULL; - } - - int rxe_mr_init_user(struct rxe_dev *rxe, u64 start, u64 length, -@@ -134,8 +198,6 @@ int rxe_mr_init_user(struct rxe_dev *rxe, u64 start, u64 length, - - rxe_mr_init(access, mr); - -- xa_init(&mr->page_list); -- - umem = ib_umem_get(&rxe->ib_dev, start, length, access); - if (IS_ERR(umem)) { - rxe_dbg_mr(mr, "Unable to pin memory region err = %d\n", -@@ -143,46 +205,25 @@ int rxe_mr_init_user(struct rxe_dev *rxe, u64 start, u64 length, - return PTR_ERR(umem); - } - -+ err = alloc_mr_page_info(mr, ib_umem_num_pages(umem)); -+ if (err) -+ goto err2; -+ - err = rxe_mr_fill_pages_from_sgt(mr, &umem->sgt_append.sgt); -- if (err) { -- ib_umem_release(umem); -- return err; -- } -+ if (err) -+ goto err1; - - mr->umem = umem; - mr->ibmr.type = IB_MR_TYPE_USER; - mr->state = RXE_MR_STATE_VALID; - - return 0; --} - --static int rxe_mr_alloc(struct rxe_mr *mr, int num_buf) --{ -- XA_STATE(xas, &mr->page_list, 0); -- int i = 0; -- int err; -- -- xa_init(&mr->page_list); -- -- do { -- xas_lock(&xas); -- while (i != num_buf) { -- xas_store(&xas, XA_ZERO_ENTRY); -- if (xas_error(&xas)) -- break; -- xas_next(&xas); -- i++; -- } -- xas_unlock(&xas); -- } while (xas_nomem(&xas, GFP_KERNEL)); -- -- err = xas_error(&xas); -- if (err) -- return err; -- -- mr->num_buf = num_buf; -- -- return 0; -+err1: -+ free_mr_page_info(mr); -+err2: -+ ib_umem_release(umem); -+ return err; - } - - int rxe_mr_init_fast(int max_pages, struct rxe_mr *mr) -@@ -192,7 +233,7 @@ int rxe_mr_init_fast(int max_pages, struct rxe_mr *mr) - /* always allow remote access for FMRs */ - rxe_mr_init(RXE_ACCESS_REMOTE, mr); - -- err = rxe_mr_alloc(mr, max_pages); -+ err = alloc_mr_page_info(mr, max_pages); - if (err) - goto err1; - -@@ -205,26 +246,43 @@ err1: - return err; - } - -+/* -+ * I) MRs with page_size >= PAGE_SIZE, -+ * Split a large MR page (mr->page_size) into multiple PAGE_SIZE -+ * sub-pages and store them in page_info, offset is always 0. -+ * -+ * Called when mr->page_size > PAGE_SIZE. Each call to rxe_set_page() -+ * represents one mr->page_size region, which we must split into -+ * (mr->page_size >> PAGE_SHIFT) individual pages. -+ * -+ * II) MRs with page_size < PAGE_SIZE, -+ * Save each PAGE_SIZE page and its offset within the system page in page_info. -+ */ - static int rxe_set_page(struct ib_mr *ibmr, u64 dma_addr) - { - struct rxe_mr *mr = to_rmr(ibmr); -- struct page *page = ib_virt_dma_to_page(dma_addr); - bool persistent = !!(mr->access & IB_ACCESS_FLUSH_PERSISTENT); -- int err; -+ u32 i, pages_per_mr = mr_page_size(mr) >> PAGE_SHIFT; - -- if (persistent && !is_pmem_page(page)) { -- rxe_dbg_mr(mr, "Page cannot be persistent\n"); -- return -EINVAL; -+ pages_per_mr = MAX(1, pages_per_mr); -+ -+ for (i = 0; i < pages_per_mr; i++) { -+ u64 addr = dma_addr + i * PAGE_SIZE; -+ struct page *sub_page = ib_virt_dma_to_page(addr); -+ -+ if (unlikely(mr->nbuf >= mr->max_allowed_buf)) -+ return -ENOMEM; -+ -+ if (persistent && !is_pmem_page(sub_page)) { -+ rxe_dbg_mr(mr, "Page cannot be persistent\n"); -+ return -EINVAL; -+ } -+ -+ mr->page_info[mr->nbuf].page = sub_page; -+ mr->page_info[mr->nbuf].offset = addr & (PAGE_SIZE - 1); -+ mr->nbuf++; - } - -- if (unlikely(mr->nbuf == mr->num_buf)) -- return -ENOMEM; -- -- err = xa_err(xa_store(&mr->page_list, mr->nbuf, page, GFP_KERNEL)); -- if (err) -- return err; -- -- mr->nbuf++; - return 0; - } - -@@ -234,6 +292,31 @@ int rxe_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sgl, - struct rxe_mr *mr = to_rmr(ibmr); - unsigned int page_size = mr_page_size(mr); - -+ /* -+ * Ensure page_size and PAGE_SIZE are compatible for mapping. -+ * We require one to be a multiple of the other for correct -+ * iova-to-page conversion. -+ */ -+ if (!IS_ALIGNED(page_size, PAGE_SIZE) && -+ !IS_ALIGNED(PAGE_SIZE, page_size)) { -+ rxe_dbg_mr(mr, "MR page size %u must be compatible with PAGE_SIZE %lu\n", -+ page_size, PAGE_SIZE); -+ return -EINVAL; -+ } -+ -+ if (mr_page_size(mr) > PAGE_SIZE) { -+ /* resize page_info if needed */ -+ u32 map_mr_pages = (page_size >> PAGE_SHIFT) * mr->num_buf; -+ -+ if (map_mr_pages > mr->max_allowed_buf) { -+ rxe_dbg_mr(mr, "requested pages %u exceed max %u\n", -+ map_mr_pages, mr->max_allowed_buf); -+ free_mr_page_info(mr); -+ if (__alloc_mr_page_info(mr, map_mr_pages)) -+ return -ENOMEM; -+ } -+ } -+ - mr->nbuf = 0; - mr->page_shift = ilog2(page_size); - mr->page_mask = ~((u64)page_size - 1); -@@ -245,30 +328,30 @@ int rxe_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sgl, - static int rxe_mr_copy_xarray(struct rxe_mr *mr, u64 iova, void *addr, - unsigned int length, enum rxe_mr_copy_dir dir) - { -- unsigned int page_offset = rxe_mr_iova_to_page_offset(mr, iova); -- unsigned long index = rxe_mr_iova_to_index(mr, iova); - unsigned int bytes; -- struct page *page; -- void *va; -+ u8 *va; - - while (length) { -- page = xa_load(&mr->page_list, index); -- if (!page) -+ unsigned long index = rxe_mr_iova_to_index(mr, iova); -+ struct rxe_mr_page *info = &mr->page_info[index]; -+ unsigned int page_offset = rxe_mr_iova_to_page_offset(mr, iova); -+ -+ if (!info->page) - return -EFAULT; - -- bytes = min_t(unsigned int, length, -- mr_page_size(mr) - page_offset); -- va = kmap_local_page(page); -+ page_offset += info->offset; -+ bytes = min_t(unsigned int, length, PAGE_SIZE - page_offset); -+ va = kmap_local_page(info->page); -+ - if (dir == RXE_FROM_MR_OBJ) - memcpy(addr, va + page_offset, bytes); - else - memcpy(va + page_offset, addr, bytes); - kunmap_local(va); - -- page_offset = 0; - addr += bytes; -+ iova += bytes; - length -= bytes; -- index++; - } - - return 0; -@@ -423,9 +506,6 @@ err1: - - int rxe_flush_pmem_iova(struct rxe_mr *mr, u64 iova, unsigned int length) - { -- unsigned int page_offset; -- unsigned long index; -- struct page *page; - unsigned int bytes; - int err; - u8 *va; -@@ -445,21 +525,22 @@ int rxe_flush_pmem_iova(struct rxe_mr *mr, u64 iova, unsigned int length) - return err; - - while (length > 0) { -- index = rxe_mr_iova_to_index(mr, iova); -- page = xa_load(&mr->page_list, index); -- page_offset = rxe_mr_iova_to_page_offset(mr, iova); -- if (!page) -- return -EFAULT; -- bytes = min_t(unsigned int, length, -- mr_page_size(mr) - page_offset); -+ unsigned long index = rxe_mr_iova_to_index(mr, iova); -+ struct rxe_mr_page *info = &mr->page_info[index]; -+ unsigned int page_offset = rxe_mr_iova_to_page_offset(mr, iova); - -- va = kmap_local_page(page); -+ if (!info->page) -+ return -EFAULT; -+ -+ page_offset += info->offset; -+ bytes = min_t(unsigned int, length, PAGE_SIZE - page_offset); -+ -+ va = kmap_local_page(info->page); - arch_wb_cache_pmem(va + page_offset, bytes); - kunmap_local(va); - - length -= bytes; - iova += bytes; -- page_offset = 0; - } - - return 0; -@@ -487,6 +568,7 @@ int rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode, - } else { - unsigned long index; - int err; -+ struct rxe_mr_page *info; - - err = mr_check_range(mr, iova, sizeof(value)); - if (err) { -@@ -495,9 +577,12 @@ int rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode, - } - page_offset = rxe_mr_iova_to_page_offset(mr, iova); - index = rxe_mr_iova_to_index(mr, iova); -- page = xa_load(&mr->page_list, index); -- if (!page) -+ info = &mr->page_info[index]; -+ if (!info->page) - return RESPST_ERR_RKEY_VIOLATION; -+ -+ page_offset += info->offset; -+ page = info->page; - } - - if (unlikely(page_offset & 0x7)) { -@@ -544,6 +629,7 @@ int rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value) - } else { - unsigned long index; - int err; -+ struct rxe_mr_page *info; - - /* See IBA oA19-28 */ - err = mr_check_range(mr, iova, sizeof(value)); -@@ -553,9 +639,12 @@ int rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value) - } - page_offset = rxe_mr_iova_to_page_offset(mr, iova); - index = rxe_mr_iova_to_index(mr, iova); -- page = xa_load(&mr->page_list, index); -- if (!page) -+ info = &mr->page_info[index]; -+ if (!info->page) - return RESPST_ERR_RKEY_VIOLATION; -+ -+ page_offset += info->offset; -+ page = info->page; - } - - /* See IBA A19.4.2 */ -@@ -727,5 +816,5 @@ void rxe_mr_cleanup(struct rxe_pool_elem *elem) - ib_umem_release(mr->umem); - - if (mr->ibmr.type != IB_MR_TYPE_DMA) -- xa_destroy(&mr->page_list); -+ free_mr_page_info(mr); - } -diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.h b/drivers/infiniband/sw/rxe/rxe_verbs.h -index 6573cee..f863cc5 100644 ---- a/drivers/infiniband/sw/rxe/rxe_verbs.h -+++ b/drivers/infiniband/sw/rxe/rxe_verbs.h -@@ -298,6 +298,11 @@ static inline int rkey_is_mw(u32 rkey) - return (index >= RXE_MIN_MW_INDEX) && (index <= RXE_MAX_MW_INDEX); - } - -+struct rxe_mr_page { -+ struct page *page; -+ unsigned int offset; /* offset in system page */ -+}; -+ - struct rxe_mr { - struct rxe_pool_elem elem; - struct ib_mr ibmr; -@@ -314,10 +319,13 @@ struct rxe_mr { - unsigned int page_shift; - u64 page_mask; - -+ /* size of page_info when mr allocated */ - u32 num_buf; -+ /* real size of page_info */ -+ u32 max_allowed_buf; - u32 nbuf; - -- struct xarray page_list; -+ struct rxe_mr_page *page_info; - }; - - static inline unsigned int mr_page_size(struct rxe_mr *mr) --- -2.43.7 diff --git a/SPECS/91/linux/CVE/0001-ata-libata-core-Add-NOLPM-quirk-for-PNY-CS900-1TB-SS.patch b/SPECS/91/linux/CVE/0001-ata-libata-core-Add-NOLPM-quirk-for-PNY-CS900-1TB-SS.patch deleted file mode 100644 index 62e72c82f6..0000000000 --- a/SPECS/91/linux/CVE/0001-ata-libata-core-Add-NOLPM-quirk-for-PNY-CS900-1TB-SS.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 462775c620197adaabc983ce847e5b9878ff4cb0 Mon Sep 17 00:00:00 2001 -From: Bryam Vargas -Date: Fri, 19 Jun 2026 21:54:02 -0500 -Subject: ata: libata-core: Add NOLPM quirk for PNY CS900 1TB SSD - -[ Upstream commit 462775c620197adaabc983ce847e5b9878ff4cb0 ] - -The PNY CS900 1TB SSD (Phison PS3111-S11, DRAM-less) drops off the bus -after entering Device-Initiated Slumber during idle. With the default -med_power_with_dipm policy the link goes down (SStatus 1 SControl 300) -and does not recover, forcing the filesystem read-only. Forcing -max_performance keeps the link stable across prolonged idle. - -Add a NOLPM quirk so link power management is disabled for this drive -specifically, leaving it intact for other devices on the host. - -Cc: stable@vger.kernel.org -Signed-off-by: Bryam Vargas -Reviewed-by: Niklas Cassel -Signed-off-by: Damien Le Moal -[Shivani: Backported for CVE-2026-72031. Modified to apply on 6.12.y ] -Signed-off-by: Shivani Agarwal ---- - drivers/ata/libata-core.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c -index 1111111..2222222 100644 ---- a/drivers/ata/libata-core.c -+++ b/drivers/ata/libata-core.c -@@ -4224,6 +4224,9 @@ static const struct ata_dev_quirks_entry __ata_dev_quirks[] = { - /* Apacer models with LPM issues */ - { "Apacer AS340*", NULL, ATA_QUIRK_NOLPM }, - -+ /* PNY CS900 (Phison PS3111-S11, DRAM-less) drops the link on DIPM */ -+ { "PNY CS900 1TB SSD", NULL, ATA_QUIRK_NOLPM }, -+ - /* These specific Samsung models/firmware-revs do not handle LPM well */ - { "SAMSUNG MZMPC128HBFU-000MV", "CXM14M1Q", ATA_QUIRK_NOLPM }, - { "SAMSUNG SSD PM830 mSATA *", "CXM13D1Q", ATA_QUIRK_NOLPM }, diff --git a/SPECS/91/linux/CVE/0001-bpf-Fix-incorrect-pruning-due-to-atomic-fetch-precis.patch b/SPECS/91/linux/CVE/0001-bpf-Fix-incorrect-pruning-due-to-atomic-fetch-precis.patch deleted file mode 100644 index f0de1d4226..0000000000 --- a/SPECS/91/linux/CVE/0001-bpf-Fix-incorrect-pruning-due-to-atomic-fetch-precis.patch +++ /dev/null @@ -1,126 +0,0 @@ -From 179ee84a89114b854ac2dd1d293633a7f6c8dac1 Mon Sep 17 00:00:00 2001 -From: Daniel Borkmann -Date: Wed, 1 Apr 2026 00:20:19 +0200 -Subject: bpf: Fix incorrect pruning due to atomic fetch precision tracking - -commit 179ee84a89114b854ac2dd1d293633a7f6c8dac1 upstream. - -When backtrack_insn encounters a BPF_STX instruction with BPF_ATOMIC -and BPF_FETCH, the src register (or r0 for BPF_CMPXCHG) also acts as -a destination, thus receiving the old value from the memory location. - -The current backtracking logic does not account for this. It treats -atomic fetch operations the same as regular stores where the src -register is only an input. This leads the backtrack_insn to fail to -propagate precision to the stack location, which is then not marked -as precise! - -Later, the verifier's path pruning can incorrectly consider two states -equivalent when they differ in terms of stack state. Meaning, two -branches can be treated as equivalent and thus get pruned when they -should not be seen as such. - -Fix it as follows: Extend the BPF_LDX handling in backtrack_insn to -also cover atomic fetch operations via is_atomic_fetch_insn() helper. -When the fetch dst register is being tracked for precision, clear it, -and propagate precision over to the stack slot. For non-stack memory, -the precision walk stops at the atomic instruction, same as regular -BPF_LDX. This covers all fetch variants. - -Before: - - 0: (b7) r1 = 8 ; R1=8 - 1: (7b) *(u64 *)(r10 -8) = r1 ; R1=8 R10=fp0 fp-8=8 - 2: (b7) r2 = 0 ; R2=0 - 3: (db) r2 = atomic64_fetch_add((u64 *)(r10 -8), r2) ; R2=8 R10=fp0 fp-8=mmmmmmmm - 4: (bf) r3 = r10 ; R3=fp0 R10=fp0 - 5: (0f) r3 += r2 - mark_precise: frame0: last_idx 5 first_idx 0 subseq_idx -1 - mark_precise: frame0: regs=r2 stack= before 4: (bf) r3 = r10 - mark_precise: frame0: regs=r2 stack= before 3: (db) r2 = atomic64_fetch_add((u64 *)(r10 -8), r2) - mark_precise: frame0: regs=r2 stack= before 2: (b7) r2 = 0 - 6: R2=8 R3=fp8 - 6: (b7) r0 = 0 ; R0=0 - 7: (95) exit - -After: - - 0: (b7) r1 = 8 ; R1=8 - 1: (7b) *(u64 *)(r10 -8) = r1 ; R1=8 R10=fp0 fp-8=8 - 2: (b7) r2 = 0 ; R2=0 - 3: (db) r2 = atomic64_fetch_add((u64 *)(r10 -8), r2) ; R2=8 R10=fp0 fp-8=mmmmmmmm - 4: (bf) r3 = r10 ; R3=fp0 R10=fp0 - 5: (0f) r3 += r2 - mark_precise: frame0: last_idx 5 first_idx 0 subseq_idx -1 - mark_precise: frame0: regs=r2 stack= before 4: (bf) r3 = r10 - mark_precise: frame0: regs=r2 stack= before 3: (db) r2 = atomic64_fetch_add((u64 *)(r10 -8), r2) - mark_precise: frame0: regs= stack=-8 before 2: (b7) r2 = 0 - mark_precise: frame0: regs= stack=-8 before 1: (7b) *(u64 *)(r10 -8) = r1 - mark_precise: frame0: regs=r1 stack= before 0: (b7) r1 = 8 - 6: R2=8 R3=fp8 - 6: (b7) r0 = 0 ; R0=0 - 7: (95) exit - -Fixes: 5ffa25502b5a ("bpf: Add instructions for atomic_[cmp]xchg") -Fixes: 5ca419f2864a ("bpf: Add BPF_FETCH field / create atomic_fetch_add instruction") -Reported-by: STAR Labs SG -Signed-off-by: Daniel Borkmann -Link: https://lore.kernel.org/r/20260331222020.401848-1-daniel@iogearbox.net -Signed-off-by: Alexei Starovoitov -[Shivani: Backported for CVE-2026-43009. Modified to apply on 6.12.y. - Dropped the "|| is_atomic_load_insn(insn)" clause from the condition, - since this kernel does not yet have atomic-load (BPF_LOAD_ACQ) - precision tracking -- is_atomic_load_insn() and BPF_LOAD_ACQ do not - exist here. ] -Signed-off-by: Shivani Agarwal ---- - kernel/bpf/verifier.c | 25 ++++++++++++++++++++++--- - 1 file changed, 22 insertions(+), 3 deletions(-) - -diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c -index 64a6ec8eb..0c91fcbef 100644 ---- a/kernel/bpf/verifier.c -+++ b/kernel/bpf/verifier.c -@@ -578,6 +578,13 @@ static bool is_cmpxchg_insn(const struct bpf_insn *insn) - insn->imm == BPF_CMPXCHG; - } - -+static bool is_atomic_fetch_insn(const struct bpf_insn *insn) -+{ -+ return BPF_CLASS(insn->code) == BPF_STX && -+ BPF_MODE(insn->code) == BPF_ATOMIC && -+ (insn->imm & BPF_FETCH); -+} -+ - static int __get_spi(s32 off) - { - return (-off - 1) / BPF_REG_SIZE; -@@ -3957,10 +3964,22 @@ static int backtrack_insn(struct bpf_verifier_env *env, int idx, int subseq_idx, - * dreg still needs precision before this insn - */ - } -- } else if (class == BPF_LDX) { -- if (!bt_is_reg_set(bt, dreg)) -+ } else if (class == BPF_LDX || is_atomic_fetch_insn(insn)) { -+ u32 load_reg = dreg; -+ -+ /* -+ * Atomic fetch operation writes the old value into -+ * a register (sreg or r0) and if it was tracked for -+ * precision, propagate to the stack slot like we do -+ * in regular ldx. -+ */ -+ if (is_atomic_fetch_insn(insn)) -+ load_reg = insn->imm == BPF_CMPXCHG ? -+ BPF_REG_0 : sreg; -+ -+ if (!bt_is_reg_set(bt, load_reg)) - return 0; -- bt_clear_reg(bt, dreg); -+ bt_clear_reg(bt, load_reg); - - /* scalars can only be spilled into stack w/o losing precision. - * Load from any other memory can be zero extended. --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-bpf-Fix-tcx-netkit-detach-permissions-when-prog-fd-i.patch b/SPECS/91/linux/CVE/0001-bpf-Fix-tcx-netkit-detach-permissions-when-prog-fd-i.patch deleted file mode 100644 index 6c9d2535b9..0000000000 --- a/SPECS/91/linux/CVE/0001-bpf-Fix-tcx-netkit-detach-permissions-when-prog-fd-i.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 05e076b78176db82fcf5f7c41ae9002a82fd0c59 Mon Sep 17 00:00:00 2001 -From: Guillaume Gonnet -Date: Tue, 27 Jan 2026 17:02:00 +0100 -Subject: [PATCH] bpf: Fix tcx/netkit detach permissions when prog fd isn't - given - -[ Upstream commit ae23bc81ddf7c17b663c4ed1b21e35527b0a7131 ] - -This commit fixes a security issue where BPF_PROG_DETACH on tcx or -netkit devices could be executed by any user when no program fd was -provided, bypassing permission checks. The fix adds a capability -check for CAP_NET_ADMIN or CAP_SYS_ADMIN in this case. - -Fixes: e420bed02507 ("bpf: Add fd-based tcx multi-prog infra with link support") -Signed-off-by: Guillaume Gonnet -Link: https://lore.kernel.org/r/20260127160200.10395-1-ggonnet.linux@gmail.com -Signed-off-by: Alexei Starovoitov -[Srinidhi: back-ported this CVE fix to v6.12.y] -Signed-off-by: Srinidhi Rao ---- - include/linux/bpf.h | 5 +++++ - include/linux/bpf_mprog.h | 10 ++++++++++ - kernel/bpf/syscall.c | 7 ++----- - 3 files changed, 17 insertions(+), 5 deletions(-) - -diff --git a/include/linux/bpf.h b/include/linux/bpf.h -index 9e1731db76d8..c35e728137a7 100644 ---- a/include/linux/bpf.h -+++ b/include/linux/bpf.h -@@ -2998,6 +2998,11 @@ static inline void bpf_dynptr_set_rdonly(struct bpf_dynptr_kern *ptr) - } - #endif /* CONFIG_BPF_SYSCALL */ - -+static inline bool bpf_net_capable(void) -+{ -+ return capable(CAP_NET_ADMIN) || capable(CAP_SYS_ADMIN); -+} -+ - static __always_inline int - bpf_probe_read_kernel_common(void *dst, u32 size, const void *unsafe_ptr) - { -diff --git a/include/linux/bpf_mprog.h b/include/linux/bpf_mprog.h -index 929225f7b095..86710b4a6c6e 100644 ---- a/include/linux/bpf_mprog.h -+++ b/include/linux/bpf_mprog.h -@@ -340,4 +340,14 @@ static inline bool bpf_mprog_supported(enum bpf_prog_type type) - return false; - } - } -+ -+static inline bool bpf_mprog_detach_empty(enum bpf_prog_type ptype) -+{ -+ switch (ptype) { -+ case BPF_PROG_TYPE_SCHED_CLS: -+ return bpf_net_capable(); -+ default: -+ return false; -+ } -+} - #endif /* __BPF_MPROG_H */ -diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c -index 3bdfac9b4418..9dacb753b1fd 100644 ---- a/kernel/bpf/syscall.c -+++ b/kernel/bpf/syscall.c -@@ -1206,11 +1206,6 @@ static int map_check_btf(struct bpf_map *map, struct bpf_token *token, - return ret; - } - --static bool bpf_net_capable(void) --{ -- return capable(CAP_NET_ADMIN) || capable(CAP_SYS_ADMIN); --} -- - #define BPF_MAP_CREATE_LAST_FIELD map_token_fd - /* called via syscall */ - static int map_create(union bpf_attr *attr) -@@ -4177,6 +4172,8 @@ static int bpf_prog_detach(const union bpf_attr *attr) - prog = bpf_prog_get_type(attr->attach_bpf_fd, ptype); - if (IS_ERR(prog)) - return PTR_ERR(prog); -+ } else if (!bpf_mprog_detach_empty(ptype)) { -+ return -EPERM; - } - } else if (is_cgroup_prog_type(ptype, 0, false)) { - if (attr->attach_flags || attr->relative_fd) --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-bpf-Guard-conntrack-opts-error-writes.patch b/SPECS/91/linux/CVE/0001-bpf-Guard-conntrack-opts-error-writes.patch deleted file mode 100644 index fc058c7b7b..0000000000 --- a/SPECS/91/linux/CVE/0001-bpf-Guard-conntrack-opts-error-writes.patch +++ /dev/null @@ -1,117 +0,0 @@ -From ed854b2b82cae6d1ddb97ce492737e6784fe78c1 Mon Sep 17 00:00:00 2001 -From: Yiyang Chen -Date: Mon, 7 Sep 2026 07:56:38 +0000 -Subject: [PATCH] bpf: Guard conntrack opts error writes - -[ Upstream commit 6f6183a39533d727deaa5061cadae6dd9e6744d0 ] - -The conntrack lookup and allocation kfuncs take an opts pointer -together with an opts__sz argument. The verifier checks only the memory -range described by opts__sz, but the wrappers unconditionally write -opts->error whenever the internal lookup or allocation helper returns an -error. - -For an invalid size smaller than the end of opts->error, that write can -land outside the verifier-checked range. Keep returning NULL for invalid -arguments, but only report the error through opts->error when the -supplied size includes the field. - -This preserves error reporting for the supported 12-byte and 16-byte -layouts, and for other invalid sizes that still include opts->error. - -Fixes: b4c2b9593a1c ("net/netfilter: Add unstable CT lookup helpers for XDP and TC-BPF") -Fixes: d7e79c97c00c ("net: netfilter: Add kfuncs to allocate and insert CT") -Signed-off-by: Yiyang Chen -Link: https://lore.kernel.org/r/9535e781fe14449b1d4e9bbc3baa7566a93bf512.1781765747.git.chenyy23@mails.tsinghua.edu.cn -Signed-off-by: Alexei Starovoitov -[ Shivani: Backported for CVE-2026-72423. Modified to apply on 6.12.y. - kept the existing 'if (opts)' NULL guard from 6.12.y instead of - pulling in the unrelated upstream commit bddaf9adda72 ("bpf: net: - netfilter: drop dead NULL checks") that removed it, to keep this backport - minimal. ] -Signed-off-by: Shivani Agarwal ---- - net/netfilter/nf_conntrack_bpf.c | 39 +++++++++++--------------------- - 1 file changed, 13 insertions(+), 26 deletions(-) - -diff --git a/net/netfilter/nf_conntrack_bpf.c b/net/netfilter/nf_conntrack_bpf.c -index 4a136fc3a9c0..c91a935a0170 100644 ---- a/net/netfilter/nf_conntrack_bpf.c -+++ b/net/netfilter/nf_conntrack_bpf.c -@@ -64,6 +64,15 @@ enum { - NF_BPF_CT_OPTS_SZ = 16, - }; - -+static void *bpf_ct_opts_result(struct bpf_ct_opts *opts, u32 opts__sz, void *ret) -+{ -+ if (!IS_ERR(ret)) -+ return ret; -+ if (opts && opts__sz >= offsetofend(struct bpf_ct_opts, error)) -+ opts->error = PTR_ERR(ret); -+ return NULL; -+} -+ - static int bpf_nf_ct_tuple_parse(struct bpf_sock_tuple *bpf_tuple, - u32 tuple_len, u8 protonum, u8 dir, - struct nf_conntrack_tuple *tuple) -@@ -298,13 +307,7 @@ bpf_xdp_ct_alloc(struct xdp_md *xdp_ctx, struct bpf_sock_tuple *bpf_tuple, - - nfct = __bpf_nf_ct_alloc_entry(dev_net(ctx->rxq->dev), bpf_tuple, tuple__sz, - opts, opts__sz, 10); -- if (IS_ERR(nfct)) { -- if (opts) -- opts->error = PTR_ERR(nfct); -- return NULL; -- } -- -- return (struct nf_conn___init *)nfct; -+ return (struct nf_conn___init *)bpf_ct_opts_result(opts, opts__sz, nfct); - } - - /* bpf_xdp_ct_lookup - Lookup CT entry for the given tuple, and acquire a -@@ -333,12 +336,7 @@ bpf_xdp_ct_lookup(struct xdp_md *xdp_ctx, struct bpf_sock_tuple *bpf_tuple, - - caller_net = dev_net(ctx->rxq->dev); - nfct = __bpf_nf_ct_lookup(caller_net, bpf_tuple, tuple__sz, opts, opts__sz); -- if (IS_ERR(nfct)) { -- if (opts) -- opts->error = PTR_ERR(nfct); -- return NULL; -- } -- return nfct; -+ return bpf_ct_opts_result(opts, opts__sz, nfct); - } - - /* bpf_skb_ct_alloc - Allocate a new CT entry -@@ -366,13 +364,7 @@ bpf_skb_ct_alloc(struct __sk_buff *skb_ctx, struct bpf_sock_tuple *bpf_tuple, - - net = skb->dev ? dev_net(skb->dev) : sock_net(skb->sk); - nfct = __bpf_nf_ct_alloc_entry(net, bpf_tuple, tuple__sz, opts, opts__sz, 10); -- if (IS_ERR(nfct)) { -- if (opts) -- opts->error = PTR_ERR(nfct); -- return NULL; -- } -- -- return (struct nf_conn___init *)nfct; -+ return (struct nf_conn___init *)bpf_ct_opts_result(opts, opts__sz, nfct); - } - - /* bpf_skb_ct_lookup - Lookup CT entry for the given tuple, and acquire a -@@ -401,12 +393,7 @@ bpf_skb_ct_lookup(struct __sk_buff *skb_ctx, struct bpf_sock_tuple *bpf_tuple, - - caller_net = skb->dev ? dev_net(skb->dev) : sock_net(skb->sk); - nfct = __bpf_nf_ct_lookup(caller_net, bpf_tuple, tuple__sz, opts, opts__sz); -- if (IS_ERR(nfct)) { -- if (opts) -- opts->error = PTR_ERR(nfct); -- return NULL; -- } -- return nfct; -+ return bpf_ct_opts_result(opts, opts__sz, nfct); - } - - /* bpf_ct_insert_entry - Add the provided entry into a CT map --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-btrfs-fix-double-free-of-qgroup-record-after-failure.patch b/SPECS/91/linux/CVE/0001-btrfs-fix-double-free-of-qgroup-record-after-failure.patch deleted file mode 100644 index eb0faa91c4..0000000000 --- a/SPECS/91/linux/CVE/0001-btrfs-fix-double-free-of-qgroup-record-after-failure.patch +++ /dev/null @@ -1,153 +0,0 @@ -From ccb4cb5ce82068420060319d3b1f545c27e0f89b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miquel=20Sabat=C3=A9=20Sol=C3=A0?= -Date: Wed, 1 Oct 2025 20:05:03 +0200 -Subject: [PATCH] btrfs: fix double free of qgroup record after failure to add - delayed ref head -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -[ Upstream commit 725e46298876a2cc1f1c3fb22ba69d29102c3ddf ] - -In the previous code it was possible to incur into a double kfree() -scenario when calling add_delayed_ref_head(). This could happen if the -record was reported to already exist in the -btrfs_qgroup_trace_extent_nolock() call, but then there was an error -later on add_delayed_ref_head(). In this case, since -add_delayed_ref_head() returned an error, the caller went to free the -record. Since add_delayed_ref_head() couldn't set this kfree'd pointer -to NULL, then kfree() would have acted on a non-NULL 'record' object -which was pointing to memory already freed by the callee. - -The problem comes from the fact that the responsibility to kfree the -object is on both the caller and the callee at the same time. Hence, the -fix for this is to shift the ownership of the 'qrecord' object out of -the add_delayed_ref_head(). That is, we will never attempt to kfree() -the given object inside of this function, and will expect the caller to -act on the 'qrecord' object on its own. The only exception where the -'qrecord' object cannot be kfree'd is if it was inserted into the -tracing logic, for which we already have the 'qrecord_inserted_ret' -boolean to account for this. Hence, the caller has to kfree the object -only if add_delayed_ref_head() reports not to have inserted it on the -tracing logic. - -As a side-effect of the above, we must guarantee that -'qrecord_inserted_ret' is properly initialized at the start of the -function, not at the end, and then set when an actual insert -happens. This way we avoid 'qrecord_inserted_ret' having an invalid -value on an early exit. - -The documentation from the add_delayed_ref_head() has also been updated -to reflect on the exact ownership of the 'qrecord' object. - -Fixes: 6ef8fbce0104 ("btrfs: fix missing error handling when adding delayed ref with qgroups enabled") -Reviewed-by: Filipe Manana -Signed-off-by: Miquel Sabaté Solà -Signed-off-by: Filipe Manana -Signed-off-by: David Sterba -Signed-off-by: Sasha Levin -[Shivani: Modified to apply on 6.12.y ] -Signed-off-by: Shivani Agarwal ---- - fs/btrfs/delayed-ref.c | 43 ++++++++++++++++++++++++++++++++---------- - 1 file changed, 33 insertions(+), 10 deletions(-) - -diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c -index cab94d141..1f30171c7 100644 ---- a/fs/btrfs/delayed-ref.c -+++ b/fs/btrfs/delayed-ref.c -@@ -837,9 +837,13 @@ static void init_delayed_ref_head(struct btrfs_delayed_ref_head *head_ref, - } - - /* -- * helper function to actually insert a head node into the rbtree. -- * this does all the dirty work in terms of maintaining the correct -- * overall modification count. -+ * Helper function to actually insert a head node into the xarray. This does all -+ * the dirty work in terms of maintaining the correct overall modification -+ * count. -+ * -+ * The caller is responsible for calling kfree() on @qrecord. More specifically, -+ * if this function reports that it did not insert it as noted in -+ * @qrecord_inserted_ret, then it's safe to call kfree() on it. - * - * Returns an error pointer in case of an error. - */ -@@ -852,12 +856,25 @@ add_delayed_ref_head(struct btrfs_trans_handle *trans, - struct btrfs_fs_info *fs_info = trans->fs_info; - struct btrfs_delayed_ref_head *existing; - struct btrfs_delayed_ref_root *delayed_refs; -- bool qrecord_inserted = false; -+ -+ /* -+ * If 'qrecord_inserted_ret' is provided, then the first thing we need -+ * to do is to initialize it to false just in case we have an exit -+ * before trying to insert the record. -+ */ -+ if (qrecord_inserted_ret) -+ *qrecord_inserted_ret = false; - - delayed_refs = &trans->transaction->delayed_refs; - - /* Record qgroup extent info if provided */ - if (qrecord) { -+ /* -+ * Setting 'qrecord' but not 'qrecord_inserted_ret' will likely -+ * result in a memory leakage. -+ */ -+ ASSERT(qrecord_inserted_ret != NULL); -+ - int ret; - - ret = btrfs_qgroup_trace_extent_nolock(fs_info, delayed_refs, qrecord); -@@ -865,12 +882,10 @@ add_delayed_ref_head(struct btrfs_trans_handle *trans, - /* Clean up if insertion fails or item exists. */ - xa_release(&delayed_refs->dirty_extents, - qrecord->bytenr >> fs_info->sectorsize_bits); -- /* Caller responsible for freeing qrecord on error. */ - if (ret < 0) - return ERR_PTR(ret); -- kfree(qrecord); -- } else { -- qrecord_inserted = true; -+ } else if (qrecord_inserted_ret) { -+ *qrecord_inserted_ret = true; - } - } - -@@ -902,8 +917,6 @@ add_delayed_ref_head(struct btrfs_trans_handle *trans, - delayed_refs->num_heads_ready++; - atomic_inc(&delayed_refs->num_entries); - } -- if (qrecord_inserted_ret) -- *qrecord_inserted_ret = qrecord_inserted; - - return head_ref; - } -@@ -1053,6 +1066,14 @@ static int add_delayed_ref(struct btrfs_trans_handle *trans, - if (IS_ERR(new_head_ref)) { - spin_unlock(&delayed_refs->lock); - ret = PTR_ERR(new_head_ref); -+ -+ /* -+ * It's only safe to call kfree() on 'qrecord' if -+ * add_delayed_ref_head() has _not_ inserted it for -+ * tracing. Otherwise we need to handle this here. -+ */ -+ if (qrecord_inserted) -+ goto free_head_ref; - goto free_record; - } - head_ref = new_head_ref; -@@ -1075,6 +1096,8 @@ static int add_delayed_ref(struct btrfs_trans_handle *trans, - - if (qrecord_inserted) - return btrfs_qgroup_trace_extent_post(trans, record); -+ -+ kfree(record); - return 0; - - free_record: --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-btrfs-skip-global-block-reserve-accounting-for-res.patch b/SPECS/91/linux/CVE/0001-btrfs-skip-global-block-reserve-accounting-for-res.patch deleted file mode 100644 index 6f114eb466..0000000000 --- a/SPECS/91/linux/CVE/0001-btrfs-skip-global-block-reserve-accounting-for-res.patch +++ /dev/null @@ -1,136 +0,0 @@ -From 51a0e8399858621442807a26057bcd1cd3ced046 Mon Sep 17 00:00:00 2001 -From: Dongjiang Zhu -Date: Mon, 13 Jul 2026 16:50:08 +0800 -Subject: [PATCH] btrfs: skip global block reserve accounting for rescue - mounts - -[ Upstream commit 51a0e8399858621442807a26057bcd1cd3ced046 ] - -[BUG] -Mounting with rescue=ibadroots after corrupting the block group tree -root triggers a NULL pointer dereference: - - BUG: kernel NULL pointer dereference, address: 0000000000000100 - RIP: 0010:btrfs_update_global_block_rsv+0x9d/0x1c0 [btrfs] - Call Trace: - fill_dummy_bgs+0xd4/0x120 [btrfs] - open_ctree+0xc6e/0x1ca0 [btrfs] - btrfs_get_tree+0x50d/0xa40 [btrfs] - -The same crash occurs with a corrupted raid stripe tree root, via -btrfs_read_block_groups() instead of fill_dummy_bgs(). - -[CAUSE] -With rescue=ibadroots, btrfs_read_roots() allows the mount to continue -when either root cannot be read, leaving the corresponding root pointer -NULL while its on-disk feature bit remains set. - -btrfs_update_global_block_rsv() then dereferences the missing root based -on the feature bit alone. - -[FIX] -Rescue mounts are fully read-only and cannot start transactions, so the -global reserve is never consumed. Under btrfs_is_full_ro(), mark the -reserve as full and return before performing the accounting. - -And since we need to check if the fs is mount fully RO, export -fs_is_full_ro() as btrfs_is_full_ro(), and move it to fs.h. - -Fixes: 8dbfc14fc736 ("btrfs: account block group tree when calculating global reserve size") -Fixes: 515020900d44 ("btrfs: read raid stripe tree from disk") -Suggested-by: Qu Wenruo -Signed-off-by: Dongjiang Zhu -[ Squash the fs_is_full_ro() export commit into this one. ] -Reviewed-by: Qu Wenruo -Signed-off-by: David Sterba -[ Shivani: Backported for CVE-2026-74571. Modified to apply on 6.12.y. ] -Signed-off-by: Shivani Agarwal ---- - fs/btrfs/block-rsv.c | 19 +++++++++++++++++-- - fs/btrfs/disk-io.c | 11 +---------- - fs/btrfs/fs.h | 9 +++++++++ - 3 files changed, 27 insertions(+), 12 deletions(-) - -diff --git a/fs/btrfs/block-rsv.c b/fs/btrfs/block-rsv.c -index a578bd3b32bb..f111500a2c46 100644 ---- a/fs/btrfs/block-rsv.c -+++ b/fs/btrfs/block-rsv.c -@@ -326,10 +326,25 @@ void btrfs_block_rsv_add_bytes(struct btrfs_block_rsv *block_rsv, - void btrfs_update_global_block_rsv(struct btrfs_fs_info *fs_info) - { - struct btrfs_block_rsv *block_rsv = &fs_info->global_block_rsv; -- struct btrfs_space_info *sinfo = block_rsv->space_info; -+ struct btrfs_space_info *sinfo; - struct btrfs_root *root, *tmp; -- u64 num_bytes = btrfs_root_used(&fs_info->tree_root->root_item); - unsigned int min_items = 1; -+ u64 num_bytes; -+ -+ /* -+ * A full read-only mount (rescue options) cannot start transactions, -+ * so the global reserve is never consumed. Mark it as full and skip -+ * the accounting. -+ */ -+ if (btrfs_is_full_ro(fs_info)) { -+ spin_lock(&block_rsv->lock); -+ block_rsv->full = true; -+ spin_unlock(&block_rsv->lock); -+ return; -+ } -+ -+ sinfo = block_rsv->space_info; -+ num_bytes = btrfs_root_used(&fs_info->tree_root->root_item); - - /* - * The global block rsv is based on the size of the extent tree, the -diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c -index 8befa96374a9..a5aee96f7993 100644 ---- a/fs/btrfs/disk-io.c -+++ b/fs/btrfs/disk-io.c -@@ -3169,15 +3169,6 @@ int btrfs_check_features(struct btrfs_fs_info *fs_info, bool is_rw_mount) - return 0; - } - --static bool fs_is_full_ro(const struct btrfs_fs_info *fs_info) --{ -- if (!sb_rdonly(fs_info->sb)) -- return false; -- if (unlikely(fs_info->mount_opt & BTRFS_MOUNT_FULL_RO_MASK)) -- return true; -- return false; --} -- - int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_devices) - { - u32 sectorsize; -@@ -3287,7 +3278,7 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device - WRITE_ONCE(fs_info->fs_error, -EUCLEAN); - - /* If the fs has any rescue options, no transaction is allowed. */ -- if (fs_is_full_ro(fs_info)) -+ if (btrfs_is_full_ro(fs_info)) - WRITE_ONCE(fs_info->fs_error, -EROFS); - - /* Set up fs_info before parsing mount options */ -diff --git a/fs/btrfs/fs.h b/fs/btrfs/fs.h -index 219345ff17f5..c9eca8b13f7a 100644 ---- a/fs/btrfs/fs.h -+++ b/fs/btrfs/fs.h -@@ -1034,6 +1034,15 @@ void __btrfs_clear_fs_compat_ro(struct btrfs_fs_info *fs_info, u64 flag, - #define btrfs_test_opt(fs_info, opt) ((fs_info)->mount_opt & \ - BTRFS_MOUNT_##opt) - -+static inline bool btrfs_is_full_ro(const struct btrfs_fs_info *fs_info) -+{ -+ if (!sb_rdonly(fs_info->sb)) -+ return false; -+ if (unlikely(fs_info->mount_opt & BTRFS_MOUNT_FULL_RO_MASK)) -+ return true; -+ return false; -+} -+ - static inline int btrfs_fs_closing(const struct btrfs_fs_info *fs_info) - { - /* Do it this way so we only ever do one test_bit in the normal case. */ --- -2.53.0 diff --git a/SPECS/91/linux/CVE/0001-cgroup-psi-Set-of-priv-to-NULL-upon-file-release.patch b/SPECS/91/linux/CVE/0001-cgroup-psi-Set-of-priv-to-NULL-upon-file-release.patch deleted file mode 100644 index 31f3b6e0de..0000000000 --- a/SPECS/91/linux/CVE/0001-cgroup-psi-Set-of-priv-to-NULL-upon-file-release.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 4e4cb686eb672444ec86645e9ad6453733eab33a Mon Sep 17 00:00:00 2001 -From: Chen Ridong -Date: Fri, 22 Aug 2025 07:07:15 +0000 -Subject: [PATCH 05/22] cgroup/psi: Set of->priv to NULL upon file release - -[ Upstream commit 94a4acfec14615e971eb2c9e1fa6c992c85ff6c6 ] - -Setting of->priv to NULL when the file is released enables earlier bug -detection. This allows potential bugs to manifest as NULL pointer -dereferences rather than use-after-free errors[1], which are generally more -difficult to diagnose. - -[1] https://lore.kernel.org/cgroups/38ef3ff9-b380-44f0-9315-8b3714b0948d@huaweicloud.com/T/#m8a3b3f88f0ff3da5925d342e90043394f8b2091b -Signed-off-by: Chen Ridong -Signed-off-by: Tejun Heo -[Srinidhi: cherry picked from commit 94a4acfec14615e971eb2c9e1fa6c992c85ff6c6 for linux v6.12.y] -Signed-off-by: Srinidhi Rao ---- - kernel/cgroup/cgroup.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c -index db00ce43df44..d4ea7dfada9f 100644 ---- a/kernel/cgroup/cgroup.c -+++ b/kernel/cgroup/cgroup.c -@@ -4162,6 +4162,7 @@ static void cgroup_file_release(struct kernfs_open_file *of) - cft->release(of); - put_cgroup_ns(ctx->ns); - kfree(ctx); -+ of->priv = NULL; - } - - static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf, --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-cgroup-rstat-validate-cpu-before-css_rstat_cpu-acce.patch b/SPECS/91/linux/CVE/0001-cgroup-rstat-validate-cpu-before-css_rstat_cpu-acce.patch deleted file mode 100644 index 11978fcf46..0000000000 --- a/SPECS/91/linux/CVE/0001-cgroup-rstat-validate-cpu-before-css_rstat_cpu-acce.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 8817005efbdfdf5d4e4814cb5dc52b53d12917d7 Mon Sep 17 00:00:00 2001 -From: Qing Ming -Date: Sat, 16 May 2026 15:08:49 +0800 -Subject: [PATCH] cgroup/rstat: validate cpu before css_rstat_cpu() access - -commit 8817005efbdfdf5d4e4814cb5dc52b53d12917d7 upstream. - -css_rstat_updated() is exposed as a BPF kfunc and accepts a -caller-provided cpu argument. The function uses cpu for per-cpu rstat -lookups without checking whether it refers to a valid possible CPU. - -A BPF iter/cgroup program with CAP_BPF and CAP_PERFMON can pass an -invalid cpu value. On an unfixed UBSCAN_BOUNDS test kernel, cpu == -0x7fffffff triggers: - - UBSAN: array-index-out-of-bounds in kernel/cgroup/rstat.c:31:9 - index 2147483647 is out of range for type 'long unsigned int [64]' - Call Trace: - css_rstat_updated - bpf_iter_run_prog - cgroup_iter_seq_show - bpf_seq_read - -Add cpu validation to the BPF-facing css_rstat_updated() kfunc and -move the common implementation to __css_rstat_updated() for in-kernel -callers. - -Fixes: a319185be9f5 ("cgroup: bpf: enable bpf programs to integrate with rstat") -Signed-off-by: Qing Ming -Signed-off-by: Tejun Heo -[ Brennan: 6.12.y predates the css-based rstat rework (a97915559f5c), so - the split below is cgroup_rstat_updated()/__cgroup_rstat_updated() - rather than css_rstat_updated()/__css_rstat_updated() -- same - struct-cgroup-taking kfunc that's been there since a319185be9f5, just - not yet renamed to the css-based signature ] -Signed-off-by: Brennan Lamoreaux ---- - block/blk-cgroup.c | 2 +- - include/linux/cgroup.h | 1 + - kernel/cgroup/rstat.c | 19 ++++++++++++++++--- - mm/memcontrol.c | 2 +- - 4 files changed, 19 insertions(+), 5 deletions(-) - -diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c -index d95104f..727a220 100644 ---- a/block/blk-cgroup.c -+++ b/block/blk-cgroup.c -@@ -2190,7 +2190,7 @@ void blk_cgroup_bio_start(struct bio *bio) - } - - u64_stats_update_end_irqrestore(&bis->sync, flags); -- cgroup_rstat_updated(blkcg->css.cgroup, cpu); -+ __cgroup_rstat_updated(blkcg->css.cgroup, cpu); - put_cpu(); - } - -diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h -index 2a510db..66a2835 100644 ---- a/include/linux/cgroup.h -+++ b/include/linux/cgroup.h -@@ -688,6 +688,7 @@ static inline void cgroup_path_from_kernfs_id(u64 id, char *buf, size_t buflen) - /* - * cgroup scalable recursive statistics. - */ -+void __cgroup_rstat_updated(struct cgroup *cgrp, int cpu); - void cgroup_rstat_updated(struct cgroup *cgrp, int cpu); - void cgroup_rstat_flush(struct cgroup *cgrp); - void cgroup_rstat_flush_hold(struct cgroup *cgrp); -diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c -index c4ce2f5..d8bdebd 100644 ---- a/kernel/cgroup/rstat.c -+++ b/kernel/cgroup/rstat.c -@@ -1,6 +1,7 @@ - // SPDX-License-Identifier: GPL-2.0-only - #include "cgroup-internal.h" - -+#include - #include - - #include -@@ -74,7 +75,7 @@ void _cgroup_rstat_cpu_unlock(raw_spinlock_t *cpu_lock, int cpu, - } - - /** -- * cgroup_rstat_updated - keep track of updated rstat_cpu -+ * __cgroup_rstat_updated - keep track of updated rstat_cpu - * @cgrp: target cgroup - * @cpu: cpu on which rstat_cpu was updated - * -@@ -82,7 +83,7 @@ void _cgroup_rstat_cpu_unlock(raw_spinlock_t *cpu_lock, int cpu, - * rstat_cpu->updated_children list. See the comment on top of - * cgroup_rstat_cpu definition for details. - */ --__bpf_kfunc void cgroup_rstat_updated(struct cgroup *cgrp, int cpu) -+void __cgroup_rstat_updated(struct cgroup *cgrp, int cpu) - { - raw_spinlock_t *cpu_lock = per_cpu_ptr(&cgroup_rstat_cpu_lock, cpu); - unsigned long flags; -@@ -129,6 +130,18 @@ __bpf_kfunc void cgroup_rstat_updated(struct cgroup *cgrp, int cpu) - _cgroup_rstat_cpu_unlock(cpu_lock, cpu, cgrp, flags, true); - } - -+/* -+ * BPF-facing wrapper for __cgroup_rstat_updated(). Validate the -+ * caller-provided CPU before passing it to the internal rstat updater. -+ */ -+__bpf_kfunc void cgroup_rstat_updated(struct cgroup *cgrp, int cpu) -+{ -+ if (unlikely(cpu < 0 || cpu >= nr_cpu_ids || !cpu_possible(cpu))) -+ return; -+ -+ __cgroup_rstat_updated(cgrp, cpu); -+} -+ - /** - * cgroup_rstat_push_children - push children cgroups into the given list - * @head: current head of the list (= subtree root) -@@ -511,7 +524,7 @@ static void cgroup_base_stat_cputime_account_end(struct cgroup *cgrp, - unsigned long flags) - { - u64_stats_update_end_irqrestore(&rstatc->bsync, flags); -- cgroup_rstat_updated(cgrp, smp_processor_id()); -+ __cgroup_rstat_updated(cgrp, smp_processor_id()); - put_cpu_ptr(rstatc); - } - -diff --git a/mm/memcontrol.c b/mm/memcontrol.c -index dcd2d0e..d278e28 100644 ---- a/mm/memcontrol.c -+++ b/mm/memcontrol.c -@@ -569,7 +569,7 @@ static inline void memcg_rstat_updated(struct mem_cgroup *memcg, int val) - if (!val) - return; - -- cgroup_rstat_updated(memcg->css.cgroup, cpu); -+ __cgroup_rstat_updated(memcg->css.cgroup, cpu); - statc = this_cpu_ptr(memcg->vmstats_percpu); - for (; statc; statc = statc->parent) { - stats_updates = READ_ONCE(statc->stats_updates) + abs(val); diff --git a/SPECS/91/linux/CVE/0001-drm-amdgpu-fix-amdgpu_hmm_range_get_pages.patch b/SPECS/91/linux/CVE/0001-drm-amdgpu-fix-amdgpu_hmm_range_get_pages.patch deleted file mode 100644 index 95909983ff..0000000000 --- a/SPECS/91/linux/CVE/0001-drm-amdgpu-fix-amdgpu_hmm_range_get_pages.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 962d684b5dc0741dcd93485d41b450de402d5592 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Christian=20K=C3=B6nig?= -Date: Wed, 18 Feb 2026 12:53:27 +0100 -Subject: [PATCH] drm/amdgpu: fix amdgpu_hmm_range_get_pages -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -commit 962d684b5dc0741dcd93485d41b450de402d5592 upstream. - -The notifier sequence must only be read once or otherwise we could work -with invalid pages. - -While at it also fix the coding style, e.g. drop the pre-initialized -return value and use the common define for 2G range. - -Signed-off-by: Christian König -Reviewed-by: Vitaly Prosyak -Tested-by: Vitaly Prosyak -Reviewed-by: Alex Deucher -Signed-off-by: Alex Deucher -(cherry picked from commit c08972f555945cda57b0adb72272a37910153390) -Cc: stable@vger.kernel.org -[ Brennan: this commit's own diff is context-identical to 6.12.y except - for the notifier_seq move and the MAX_WALK_BYTE/r=0 style cleanup -- - ported both. The struct-amdgpu_hmm_range-taking signature and the - kzalloc'd-vs-caller-supplied hmm_range shown as unchanged context in - upstream's diff come from an earlier, separate refactor not in 6.12.y - (6.12.y still kzalloc's its own struct hmm_range and returns it via - **phmm_range), so that part was left as-is rather than backported -- - it isn't part of this commit's own delta ] -Signed-off-by: Brennan Lamoreaux ---- - drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | 11 +++++------ - 1 file changed, 5 insertions(+), 6 deletions(-) - -diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c -index e36fede..ffd8370 100644 ---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c -+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c -@@ -51,8 +51,6 @@ - #include "amdgpu_amdkfd.h" - #include "amdgpu_hmm.h" - --#define MAX_WALK_BYTE (2UL << 30) -- - /** - * amdgpu_hmm_invalidate_gfx - callback to notify about mm change - * -@@ -170,12 +168,13 @@ int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *notifier, - void *owner, struct page **pages, - struct hmm_range **phmm_range) - { -+ const u64 max_bytes = SZ_2G; - struct hmm_range *hmm_range; - unsigned long end; - unsigned long timeout; - unsigned long i; - unsigned long *pfns; -- int r = 0; -+ int r; - - hmm_range = kzalloc(sizeof(*hmm_range), GFP_KERNEL); - if (unlikely(!hmm_range)) -@@ -196,8 +195,9 @@ int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *notifier, - end = start + npages * PAGE_SIZE; - hmm_range->dev_private_owner = owner; - -+ hmm_range->notifier_seq = mmu_interval_read_begin(notifier); - do { -- hmm_range->end = min(hmm_range->start + MAX_WALK_BYTE, end); -+ hmm_range->end = min(hmm_range->start + max_bytes, end); - - pr_debug("hmm range: start = 0x%lx, end = 0x%lx", - hmm_range->start, hmm_range->end); -@@ -205,7 +205,6 @@ int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *notifier, - timeout = jiffies + msecs_to_jiffies(HMM_RANGE_DEFAULT_TIMEOUT); - - retry: -- hmm_range->notifier_seq = mmu_interval_read_begin(notifier); - r = hmm_range_fault(hmm_range); - if (unlikely(r)) { - if (r == -EBUSY && !time_after(jiffies, timeout)) -@@ -215,7 +214,7 @@ retry: - - if (hmm_range->end == end) - break; -- hmm_range->hmm_pfns += MAX_WALK_BYTE >> PAGE_SHIFT; -+ hmm_range->hmm_pfns += max_bytes >> PAGE_SHIFT; - hmm_range->start = hmm_range->end; - } while (hmm_range->end < end); - diff --git a/SPECS/91/linux/CVE/0001-drm-amdgpu-vcn-set-no_user_fence-for-VCN-v4.0-enc-r.patch b/SPECS/91/linux/CVE/0001-drm-amdgpu-vcn-set-no_user_fence-for-VCN-v4.0-enc-r.patch deleted file mode 100644 index aeca0020f5..0000000000 --- a/SPECS/91/linux/CVE/0001-drm-amdgpu-vcn-set-no_user_fence-for-VCN-v4.0-enc-r.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 51f694221047c84fa185be98210eb2c354ffb8c6 Mon Sep 17 00:00:00 2001 -From: Yinjie Yao -Date: Mon, 27 Apr 2026 11:45:36 -0400 -Subject: [PATCH] drm/amdgpu/vcn: set no_user_fence for VCN v4.0 enc ring -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -commit 51f694221047c84fa185be98210eb2c354ffb8c6 upstream. - -VCN encoder and decoder rings do not support 64-bit user fence writes, -reject CS submissions with user fences. - -Fixes: 8da1170a16e4 ("drm/amdgpu: add VCN4 ip block support") -Reviewed-by: Christian König -Reviewed-by: Alex Deucher -Signed-off-by: Yinjie Yao -Signed-off-by: Alex Deucher -(cherry picked from commit fd852c048b46f9825e904a4f3f4538fe9d8827d9) -Signed-off-by: Brennan Lamoreaux ---- - drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c -index 5dec92691f73..bbdd017cbafb 100644 ---- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c -+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c -@@ -1921,6 +1921,7 @@ static struct amdgpu_ring_funcs vcn_v4_0_unified_ring_vm_funcs = { - .type = AMDGPU_RING_TYPE_VCN_ENC, - .align_mask = 0x3f, - .nop = VCN_ENC_CMD_NO_OP, -+ .no_user_fence = true, - .extra_dw = sizeof(struct amdgpu_vcn_rb_metadata), - .get_rptr = vcn_v4_0_unified_ring_get_rptr, - .get_wptr = vcn_v4_0_unified_ring_get_wptr, diff --git a/SPECS/91/linux/CVE/0001-drm-amdkfd-Check-bounds-on-CRIU-restore-queue-type-a.patch b/SPECS/91/linux/CVE/0001-drm-amdkfd-Check-bounds-on-CRIU-restore-queue-type-a.patch deleted file mode 100644 index 1fdd9d45d7..0000000000 --- a/SPECS/91/linux/CVE/0001-drm-amdkfd-Check-bounds-on-CRIU-restore-queue-type-a.patch +++ /dev/null @@ -1,120 +0,0 @@ -From fd1691ec62701c982ea32e749678988c67fd4c21 Mon Sep 17 00:00:00 2001 -From: David Francis -Date: Mon, 6 Jul 2026 10:19:04 -0400 -Subject: [PATCH] drm/amdkfd: Check bounds on CRIU restore queue type and mqd - size - -[ Upstream commit 47ea05f246bebc81c7796f56265cffd812cf0601 ] - -We weren't checking whether the values provided in the private -data in kfd CRIU restore were within bounds. - -For queue type, add a KFD_QUEUE_TYPE_MAX and ensure the provided -type is less than it. - -For mqd_size, add new function mqd_size_from_queue_type and confirm -that the provided mqd_size matches expectations. - -Reviewed-by: David Yat Sin -Signed-off-by: David Francis -Signed-off-by: Alex Deucher -(cherry picked from commit f19d8086f6644083c913d70bfdeee20e1b6f46a5) -Cc: stable@vger.kernel.org -[ Keerthana K: Backport to v6.12.y ] -Signed-off-by: Keerthana K ---- - .../drm/amd/amdkfd/kfd_device_queue_manager.c | 6 +++++ - .../drm/amd/amdkfd/kfd_device_queue_manager.h | 2 ++ - drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 3 ++- - .../amd/amdkfd/kfd_process_queue_manager.c | 24 +++++++++++++------ - 4 files changed, 27 insertions(+), 8 deletions(-) - -diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c -index 9035eebe9cd6..0f70ccfa83d4 100644 ---- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c -+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c -@@ -3530,6 +3530,12 @@ bool kfd_dqm_is_queue_in_process(struct device_queue_manager *dqm, - dqm_unlock(dqm); - return r; - } -+ -+size_t mqd_size_from_queue_type(struct device_queue_manager *dqm, enum kfd_queue_type type) -+{ -+ return dqm->mqd_mgrs[get_mqd_type_from_queue_type(type)]->mqd_size; -+} -+ - #if defined(CONFIG_DEBUG_FS) - - static void seq_reg_dump(struct seq_file *m, -diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h -index 09ab36f8e8c6..c03b6e6fb368 100644 ---- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h -+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h -@@ -327,6 +327,8 @@ int debug_refresh_runlist(struct device_queue_manager *dqm); - bool kfd_dqm_is_queue_in_process(struct device_queue_manager *dqm, - struct qcm_process_device *qpd, - int doorbell_off, u32 *queue_format); -+size_t mqd_size_from_queue_type(struct device_queue_manager *dqm, -+ enum kfd_queue_type type); - - static inline unsigned int get_sh_mem_bases_32(struct kfd_process_device *pdd) - { -diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h -index fb7e02523b7e..84f05ec5dcd5 100644 ---- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h -+++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h -@@ -431,7 +431,8 @@ enum kfd_queue_type { - KFD_QUEUE_TYPE_HIQ, - KFD_QUEUE_TYPE_DIQ, - KFD_QUEUE_TYPE_SDMA_XGMI, -- KFD_QUEUE_TYPE_SDMA_BY_ENG_ID -+ KFD_QUEUE_TYPE_SDMA_BY_ENG_ID, -+ KFD_QUEUE_TYPE_MAX, - }; - - enum kfd_queue_format { -diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c -index 4ba100236abb..720f9c2279d3 100644 ---- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c -+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c -@@ -1015,6 +1015,23 @@ int kfd_criu_restore_queue(struct kfd_process *p, - goto exit; - } - -+ pdd = kfd_process_device_data_by_id(p, q_data->gpu_id); -+ if (!pdd) { -+ pr_err("Failed to get pdd\n"); -+ ret = -EINVAL; -+ goto exit; -+ } -+ -+ if (q_data->type >= KFD_QUEUE_TYPE_MAX) { -+ ret = -EINVAL; -+ goto exit; -+ } -+ -+ if (q_data->mqd_size != mqd_size_from_queue_type(pdd->dev->dqm, q_data->type)) { -+ ret = -EINVAL; -+ goto exit; -+ } -+ - *priv_data_offset += sizeof(*q_data); - q_extra_data_size = (uint64_t)q_data->ctl_stack_size + q_data->mqd_size; - -@@ -1037,13 +1054,6 @@ int kfd_criu_restore_queue(struct kfd_process *p, - - *priv_data_offset += q_extra_data_size; - -- pdd = kfd_process_device_data_by_id(p, q_data->gpu_id); -- if (!pdd) { -- pr_err("Failed to get pdd\n"); -- ret = -EINVAL; -- goto exit; -- } -- - /* data stored in this order: mqd, ctl_stack */ - mqd = q_extra_data; - ctl_stack = mqd + q_data->mqd_size; --- -2.43.7 - diff --git a/SPECS/91/linux/CVE/0001-drm-i915-gt-Fix-NULL-deref-on-sched_engine-alloc-fai.patch b/SPECS/91/linux/CVE/0001-drm-i915-gt-Fix-NULL-deref-on-sched_engine-alloc-fai.patch deleted file mode 100644 index 546c103359..0000000000 --- a/SPECS/91/linux/CVE/0001-drm-i915-gt-Fix-NULL-deref-on-sched_engine-alloc-fai.patch +++ /dev/null @@ -1,92 +0,0 @@ -From edd4804f07b8369ed472de19272974e2bf2a6271 Mon Sep 17 00:00:00 2001 -From: Joonas Lahtinen -Date: Wed, 1 Jul 2026 14:45:13 +0300 -Subject: [PATCH] drm/i915/gt: Fix NULL deref on sched_engine alloc failure - -[ Upstream commit 82ec992c404c3dc774c5e9f3d4aa858e97187675 ] - -Avoid using intel_context_put() before intel_context_init() in -execlists_create_virtual() as the kref_put() inside would lead -to NULL deref on the IOCTL path when sched_engine allocation fails. - -Discovered using AI-assisted static analysis confirmed by -Intel Product Security. - -Reported-by: Martin Hodo -Fixes: 3e28d37146db ("drm/i915: Move priolist to new i915_sched_engine object") -Cc: Matthew Brost -Cc: Daniele Ceraolo Spurio -Cc: Tvrtko Ursulin -Cc: # v5.15+ -Signed-off-by: Joonas Lahtinen -Reviewed-by: Andi Shyti -Signed-off-by: Tvrtko Ursulin -Link: https://lore.kernel.org/r/20260701114513.221254-1-joonas.lahtinen@linux.intel.com -(cherry picked from commit 4f2a12f2d50e9f48227656e4dcbd6423506be31d) -Signed-off-by: Rodrigo Vivi -[ Keerthana K: Backport to v6.12.y ] -Signed-off-by: Keerthana K ---- - .../drm/i915/gt/intel_execlists_submission.c | 19 ++++++++++--------- - 1 file changed, 10 insertions(+), 9 deletions(-) - -diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c -index 72090f52fb85..c8501f823991 100644 ---- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c -+++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c -@@ -3935,11 +3935,11 @@ execlists_create_virtual(struct intel_engine_cs **siblings, unsigned int count, - struct drm_i915_private *i915 = siblings[0]->i915; - struct virtual_engine *ve; - unsigned int n; -- int err; -+ int err = -ENOMEM; - - ve = kzalloc(struct_size(ve, siblings, count), GFP_KERNEL); - if (!ve) -- return ERR_PTR(-ENOMEM); -+ goto err; - - ve->base.i915 = i915; - ve->base.gt = siblings[0]->gt; -@@ -3971,10 +3971,8 @@ execlists_create_virtual(struct intel_engine_cs **siblings, unsigned int count, - intel_engine_init_execlists(&ve->base); - - ve->base.sched_engine = i915_sched_engine_create(ENGINE_VIRTUAL); -- if (!ve->base.sched_engine) { -- err = -ENOMEM; -- goto err_put; -- } -+ if (!ve->base.sched_engine) -+ goto err_noput; - ve->base.sched_engine->private_data = &ve->base; - - ve->base.cops = &virtual_context_ops; -@@ -3990,10 +3988,8 @@ execlists_create_virtual(struct intel_engine_cs **siblings, unsigned int count, - intel_context_init(&ve->context, &ve->base); - - ve->base.breadcrumbs = intel_breadcrumbs_create(NULL); -- if (!ve->base.breadcrumbs) { -- err = -ENOMEM; -+ if (!ve->base.breadcrumbs) - goto err_put; -- } - - for (n = 0; n < count; n++) { - struct intel_engine_cs *sibling = siblings[n]; -@@ -4068,8 +4064,13 @@ execlists_create_virtual(struct intel_engine_cs **siblings, unsigned int count, - virtual_engine_initial_hint(ve); - return &ve->context; - -+err_noput: -+ kfree(ve); -+ goto err; -+ - err_put: - intel_context_put(&ve->context); -+err: - return ERR_PTR(err); - } - --- -2.43.7 - diff --git a/SPECS/91/linux/CVE/0001-esp-fix-page-frag-reference-leak-on-skb_to_sgvec-failure.patch b/SPECS/91/linux/CVE/0001-esp-fix-page-frag-reference-leak-on-skb_to_sgvec-failure.patch deleted file mode 100644 index 2bc4f2c644..0000000000 --- a/SPECS/91/linux/CVE/0001-esp-fix-page-frag-reference-leak-on-skb_to_sgvec-failure.patch +++ /dev/null @@ -1,166 +0,0 @@ -From b97698a0b09dcec257e4d99933a4b9ccfb7e218d Mon Sep 17 00:00:00 2001 -From: Alessandro Schino <7991aleschino@gmail.com> -Date: Fri, 5 Jun 2026 14:22:15 +0200 -Subject: [PATCH] esp: fix page frag reference leak on skb_to_sgvec failure - -[ Upstream commit 2982e599fff6faa21c8df147d96fc7af6c1a2f24 ] - -In esp_output_tail(), when esp->inplace is false, the old skb page frags -are replaced with a new page from the xfrm page_frag cache. The source -scatterlist (sg) is built from the old frags before the replacement, and -esp_ssg_unref() is responsible for releasing the old page references -after the crypto operation completes. - -However, if the second skb_to_sgvec() call (which builds the destination -scatterlist from the new page) fails, the code jumps to error_free which -only calls kfree(tmp). The old page frag references captured in the -source scatterlist are never released: - - 1. sg[] is built from old frags via skb_to_sgvec() (no extra get_page) - 2. nr_frags is set to 1 and frag[0] is replaced with the new page - 3. Second skb_to_sgvec() fails -> goto error_free - 4. kfree(tmp) frees the sg[] memory but old frags are not unref'd - 5. kfree_skb() only releases frag[0] (the new page), not the old ones - -Fix this by adding a bool parameter to esp_ssg_unref() that, when true, -unconditionally unrefs the source scatterlist frags without checking -req->src and req->dst, since those fields are not yet initialized by -aead_request_set_crypt() at the point of the error. Existing callers -pass false to preserve the original behavior. - -The same issue exists in both esp4 and esp6 as the code is identical. - -Fixes: cac2661c53f3 ("esp4: Avoid skb_cow_data whenever possible") -Fixes: 03e2a30f6a27 ("esp6: Avoid skb_cow_data whenever possible") - -Signed-off-by: Alessandro Schino <7991aleschino@gmail.com> -Signed-off-by: Steffen Klassert -Stable-dep-of: 26aad08a9289 ("esp: fix page frag reference leak on skb_to_sgvec failure") -Signed-off-by: Sasha Levin -[ Applied patch to v6.12 by Gerrit Photon ] ---- - net/ipv4/esp4.c | 17 +++++++++++------ - net/ipv6/esp6.c | 17 +++++++++++------ - 2 files changed, 22 insertions(+), 12 deletions(-) - -diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c -index 6c8c789de..4151bc22a 100644 ---- a/net/ipv4/esp4.c -+++ b/net/ipv4/esp4.c -@@ -96,7 +96,7 @@ static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead, - __alignof__(struct scatterlist)); - } - --static void esp_ssg_unref(struct xfrm_state *x, void *tmp, struct sk_buff *skb) -+static void esp_ssg_unref(struct xfrm_state *x, void *tmp, struct sk_buff *skb, bool already_unref) - { - struct crypto_aead *aead = x->data; - int extralen = 0; -@@ -113,10 +113,13 @@ static void esp_ssg_unref(struct xfrm_state *x, void *tmp, struct sk_buff *skb) - /* Unref skb_frag_pages in the src scatterlist if necessary. - * Skip the first sg which comes from skb->data. - */ -- if (req->src != req->dst) -- for (sg = sg_next(req->src); sg; sg = sg_next(sg)) -+ if (already_unref || req->src != req->dst) { -+ struct scatterlist *src = already_unref ? esp_req_sg(aead, req) : req->src; -+ -+ for (sg = sg_next(src); sg; sg = sg_next(sg)) - skb_page_unref(page_to_netmem(sg_page(sg)), - skb->pp_recycle); -+ } - } - - #ifdef CONFIG_INET_ESPINTCP -@@ -220,7 +223,7 @@ static void esp_output_done(void *data, int err) - } - - tmp = ESP_SKB_CB(skb)->tmp; -- esp_ssg_unref(x, tmp, skb); -+ esp_ssg_unref(x, tmp, skb, false); - kfree(tmp); - - if (xo && (xo->flags & XFRM_DEV_RESUME)) { -@@ -569,8 +572,10 @@ int esp_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info * - err = skb_to_sgvec(skb, dsg, - (unsigned char *)esph - skb->data, - assoclen + ivlen + esp->clen + alen); -- if (unlikely(err < 0)) -+ if (unlikely(err < 0)) { -+ esp_ssg_unref(x, tmp, skb, true); - goto error_free; -+ } - } - - if ((x->props.flags & XFRM_STATE_ESN)) -@@ -602,7 +607,7 @@ int esp_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info * - } - - if (sg != dsg) -- esp_ssg_unref(x, tmp, skb); -+ esp_ssg_unref(x, tmp, skb, false); - - if (!err && x->encap && x->encap->encap_type == TCP_ENCAP_ESPINTCP) - err = esp_output_tail_tcp(x, skb); -diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c -index 809815962..83d3f3b3d 100644 ---- a/net/ipv6/esp6.c -+++ b/net/ipv6/esp6.c -@@ -113,7 +113,7 @@ static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead, - __alignof__(struct scatterlist)); - } - --static void esp_ssg_unref(struct xfrm_state *x, void *tmp, struct sk_buff *skb) -+static void esp_ssg_unref(struct xfrm_state *x, void *tmp, struct sk_buff *skb, bool already_unref) - { - struct crypto_aead *aead = x->data; - int extralen = 0; -@@ -130,10 +130,13 @@ static void esp_ssg_unref(struct xfrm_state *x, void *tmp, struct sk_buff *skb) - /* Unref skb_frag_pages in the src scatterlist if necessary. - * Skip the first sg which comes from skb->data. - */ -- if (req->src != req->dst) -- for (sg = sg_next(req->src); sg; sg = sg_next(sg)) -+ if (already_unref || req->src != req->dst) { -+ struct scatterlist *src = already_unref ? esp_req_sg(aead, req) : req->src; -+ -+ for (sg = sg_next(src); sg; sg = sg_next(sg)) - skb_page_unref(page_to_netmem(sg_page(sg)), - skb->pp_recycle); -+ } - } - - #ifdef CONFIG_INET6_ESPINTCP -@@ -254,7 +257,7 @@ static void esp_output_done(void *data, int err) - } - - tmp = ESP_SKB_CB(skb)->tmp; -- esp_ssg_unref(x, tmp, skb); -+ esp_ssg_unref(x, tmp, skb, false); - kfree(tmp); - - esp_output_encap_csum(skb); -@@ -600,8 +603,10 @@ int esp6_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info - err = skb_to_sgvec(skb, dsg, - (unsigned char *)esph - skb->data, - assoclen + ivlen + esp->clen + alen); -- if (unlikely(err < 0)) -+ if (unlikely(err < 0)) { -+ esp_ssg_unref(x, tmp, skb, true); - goto error_free; -+ } - } - - if ((x->props.flags & XFRM_STATE_ESN)) -@@ -634,7 +639,7 @@ int esp6_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info - } - - if (sg != dsg) -- esp_ssg_unref(x, tmp, skb); -+ esp_ssg_unref(x, tmp, skb, false); - - if (!err && x->encap && x->encap->encap_type == TCP_ENCAP_ESPINTCP) - err = esp_output_tail_tcp(x, skb); --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-eventfs-Use-children-field-for-rcu-head-and-add-memo.patch b/SPECS/91/linux/CVE/0001-eventfs-Use-children-field-for-rcu-head-and-add-memo.patch deleted file mode 100644 index 3051d8b5c8..0000000000 --- a/SPECS/91/linux/CVE/0001-eventfs-Use-children-field-for-rcu-head-and-add-memo.patch +++ /dev/null @@ -1,104 +0,0 @@ -From a3a7cf7a2099b86befe1c38f839a4dab475d469f Mon Sep 17 00:00:00 2001 -From: Steven Rostedt -Date: Sat, 8 Aug 2026 09:42:15 -0400 -Subject: [PATCH 1/2] eventfs: Use children field for rcu head and add memory - barriers - -commit f0ece16ffca7384787b692431961ce202907acf5 upstream. - -When an eventfs inode is freed, it sets ei->is_freed and then uses its -ei->list to add it to the srcu link list as the list field is a union with -the rcu list head. As the ei->list is used to iterate over an SRCU -protected list without taking the eventfs_mutex, there's nothing stopping -the iteration over that list to see the ei->rcu instead of the ei->list -and it will read a corrupt target. - -To fix this, change the union of the rcu list head with the children list. -On freeing the eventfs inode, set the is_free and execute a smp_wmb() -before adding the eventfs inode to the SRCU list. - -On iteration of the ei->children list, at the start, execute a smp_rmb() -and then read the is_freed of the ei to see if the children list is still -valid. If is_freed is set, then the ei_child read is not valid and the -loop should exit immediately. - -Cc: stable@vger.kernel.org -Link: https://patch.msgid.link/20260808094215.4252430d@robin -Fixes: 704f960dbee2f ("eventfs: Read ei->entries before ei->children in eventfs_iterate()") -Reported-by: Sashiko -Closes: https://sashiko.dev/#/patchset/20260806022719.375354-1-shuangpeng.kernel%40gmail.com -Reviewed-by: Masami Hiramatsu (Google) -Signed-off-by: Steven Rostedt -Signed-off-by: Greg Kroah-Hartman -Signed-off-by: Guruswamy Basavaiah ---- - fs/tracefs/event_inode.c | 26 ++++++++++++++++++++++++++ - fs/tracefs/internal.h | 4 ++-- - 2 files changed, 28 insertions(+), 2 deletions(-) - -diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c -index a7b082a665bd..ca0bc6a7eb24 100644 ---- a/fs/tracefs/event_inode.c -+++ b/fs/tracefs/event_inode.c -@@ -124,7 +124,17 @@ static inline void put_ei(struct eventfs_inode *ei) - static inline void free_ei(struct eventfs_inode *ei) - { - if (ei) { -+ /* The ei should have no children if it is being freed. */ -+ WARN_ON_ONCE(!list_empty(&ei->children)); - ei->is_freed = 1; -+ /* -+ * The SRCU iteration has a smp_rmb() to make sure it -+ * sees a child (that may have already been freed) -+ * before it reads is_free. If is_free is set, it must -+ * not use the child it acquired from ei->children, as -+ * the list may be used for SRCU. -+ */ -+ smp_wmb(); - put_ei(ei); - } - } -@@ -649,6 +659,22 @@ static int eventfs_iterate(struct file *file, struct dir_context *ctx) - list_for_each_entry_srcu(ei_child, &ei->children, list, - srcu_read_lock_held(&eventfs_srcu)) { - -+ /* -+ * If the ei is being freed, then the ei->children may be -+ * being used as the rcu list, which means the next element -+ * may be garbage. The ei->is_free is set before switching -+ * the ei->children over to ei->rcu. The read memory barrier -+ * here makes sure the ei_child is read before is_free is -+ * updated. -+ * -+ * Matches the smp_wmb() in free_ei() -+ */ -+ smp_rmb(); -+ if (ei->is_freed) { -+ ret = -EINVAL; -+ goto out; -+ } -+ - if (c > 0) { - c--; - continue; -diff --git a/fs/tracefs/internal.h b/fs/tracefs/internal.h -index a4a7f8431aff..c61481d04c8e 100644 ---- a/fs/tracefs/internal.h -+++ b/fs/tracefs/internal.h -@@ -46,11 +46,11 @@ struct eventfs_attr { - * @ino: The saved inode number - */ - struct eventfs_inode { -+ struct list_head list; - union { -- struct list_head list; -+ struct list_head children; - struct rcu_head rcu; - }; -- struct list_head children; - const struct eventfs_entry *entries; - const char *name; - struct eventfs_attr *entry_attrs; --- -2.43.0 - diff --git a/SPECS/91/linux/CVE/0001-fbdev-Wrap-user-invoked-calls-to-fb_set_var-in-helpe.patch b/SPECS/91/linux/CVE/0001-fbdev-Wrap-user-invoked-calls-to-fb_set_var-in-helpe.patch deleted file mode 100644 index fb34ec1c44..0000000000 --- a/SPECS/91/linux/CVE/0001-fbdev-Wrap-user-invoked-calls-to-fb_set_var-in-helpe.patch +++ /dev/null @@ -1,171 +0,0 @@ -From 1cb6d43a91dba3b49640d727b4c298477a1863f3 Mon Sep 17 00:00:00 2001 -From: Thomas Zimmermann -Date: Wed, 27 May 2026 17:14:02 +0200 -Subject: [PATCH 1/2] fbdev: Wrap user-invoked calls to fb_set_var() in helper - -[ Upstream commit 6f611e5e5f3327cf2e2daabe6ee5acac58cc784e ] - -Handle fbcon during display updates in fb_set_var_from_user(). Check -with fbcon if the mode change is possible, update hardware state and -finally update fbcon. Update all callers. - -Only the FBIOPUT_VSCREENINFO ioctl currently does all steps. Other -mode-changes callers in sysfs and driver code are missing fbcon-related -steps. - -With the new helper, ps3fb and sh_mobile_lcdcfb no longer maintain -fbcon state themselves. - -Signed-off-by: Thomas Zimmermann -Signed-off-by: Helge Deller -Signed-off-by: Keerthana K ---- - drivers/video/fbdev/core/fb_chrdev.c | 6 +----- - drivers/video/fbdev/core/fbcon.c | 2 -- - drivers/video/fbdev/core/fbmem.c | 13 +++++++++++++ - drivers/video/fbdev/core/fbsysfs.c | 4 +--- - drivers/video/fbdev/ps3fb.c | 5 +---- - drivers/video/fbdev/sh_mobile_lcdcfb.c | 5 +---- - include/linux/fb.h | 2 ++ - 7 files changed, 19 insertions(+), 18 deletions(-) - -diff --git a/drivers/video/fbdev/core/fb_chrdev.c b/drivers/video/fbdev/core/fb_chrdev.c -index 4ebd16b7e3b8..54f926fb411b 100644 ---- a/drivers/video/fbdev/core/fb_chrdev.c -+++ b/drivers/video/fbdev/core/fb_chrdev.c -@@ -85,11 +85,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, - var.activate &= ~FB_ACTIVATE_KD_TEXT; - console_lock(); - lock_fb_info(info); -- ret = fbcon_modechange_possible(info, &var); -- if (!ret) -- ret = fb_set_var(info, &var); -- if (!ret) -- fbcon_update_vcs(info, var.activate & FB_ACTIVATE_ALL); -+ ret = fb_set_var_from_user(info, &var); - unlock_fb_info(info); - console_unlock(); - if (!ret && copy_to_user(argp, &var, sizeof(var))) -diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c -index 01b6a03b80b0..d24baf26eb75 100644 ---- a/drivers/video/fbdev/core/fbcon.c -+++ b/drivers/video/fbdev/core/fbcon.c -@@ -2751,7 +2751,6 @@ void fbcon_update_vcs(struct fb_info *info, bool all) - else - fbcon_modechanged(info); - } --EXPORT_SYMBOL(fbcon_update_vcs); - - /* let fbcon check if it supports a new screen resolution */ - int fbcon_modechange_possible(struct fb_info *info, struct fb_var_screeninfo *var) -@@ -2779,7 +2778,6 @@ int fbcon_modechange_possible(struct fb_info *info, struct fb_var_screeninfo *va - - return 0; - } --EXPORT_SYMBOL_GPL(fbcon_modechange_possible); - - int fbcon_mode_deleted(struct fb_info *info, - struct fb_videomode *mode) -diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c -index a689b390fce3..044a8f327cc2 100644 ---- a/drivers/video/fbdev/core/fbmem.c -+++ b/drivers/video/fbdev/core/fbmem.c -@@ -341,6 +341,19 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) - } - EXPORT_SYMBOL(fb_set_var); - -+int fb_set_var_from_user(struct fb_info *info, struct fb_var_screeninfo *var) -+{ -+ int ret = fbcon_modechange_possible(info, var); -+ -+ if (!ret) -+ ret = fb_set_var(info, var); -+ if (!ret) -+ fbcon_update_vcs(info, var->activate & FB_ACTIVATE_ALL); -+ -+ return ret; -+} -+EXPORT_SYMBOL(fb_set_var_from_user); -+ - int - fb_blank(struct fb_info *info, int blank) - { -diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c -index 10c3cfb959f4..572bf45d9d98 100644 ---- a/drivers/video/fbdev/core/fbsysfs.c -+++ b/drivers/video/fbdev/core/fbsysfs.c -@@ -22,9 +22,7 @@ static int activate(struct fb_info *fb_info, struct fb_var_screeninfo *var) - var->activate |= FB_ACTIVATE_FORCE; - console_lock(); - lock_fb_info(fb_info); -- err = fb_set_var(fb_info, var); -- if (!err) -- fbcon_update_vcs(fb_info, var->activate & FB_ACTIVATE_ALL); -+ err = fb_set_var_from_user(fb_info, var); - unlock_fb_info(fb_info); - console_unlock(); - if (err) -diff --git a/drivers/video/fbdev/ps3fb.c b/drivers/video/fbdev/ps3fb.c -index dbcda307f6a6..1376d19b19ae 100644 ---- a/drivers/video/fbdev/ps3fb.c -+++ b/drivers/video/fbdev/ps3fb.c -@@ -29,7 +29,6 @@ - #include - #include - #include --#include - #include - - #include -@@ -830,9 +829,7 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd, - /* Force, in case only special bits changed */ - var.activate |= FB_ACTIVATE_FORCE; - par->new_mode_id = val; -- retval = fb_set_var(info, &var); -- if (!retval) -- fbcon_update_vcs(info, var.activate & FB_ACTIVATE_ALL); -+ retval = fb_set_var_from_user(info, &var); - console_unlock(); - } - break; -diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c -index 6b37b188af31..84aa2086d5ae 100644 ---- a/drivers/video/fbdev/sh_mobile_lcdcfb.c -+++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c -@@ -15,7 +15,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -1769,11 +1768,9 @@ static void sh_mobile_fb_reconfig(struct fb_info *info) - var.height = ch->display.height; - var.activate = FB_ACTIVATE_NOW; - -- if (fb_set_var(info, &var) < 0) -+ if (fb_set_var_from_user(info, &var) < 0) - /* Couldn't reconfigure, hopefully, can continue as before */ - return; -- -- fbcon_update_vcs(info, true); - } - - /* -diff --git a/include/linux/fb.h b/include/linux/fb.h -index d87d6547c6e4..8f41d449fb9d 100644 ---- a/include/linux/fb.h -+++ b/include/linux/fb.h -@@ -537,6 +537,8 @@ extern int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var); - extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var); - extern int fb_blank(struct fb_info *info, int blank); - -+int fb_set_var_from_user(struct fb_info *info, struct fb_var_screeninfo *var); -+ - /* - * Helpers for framebuffers in I/O memory - */ --- -2.43.7 - diff --git a/SPECS/91/linux/CVE/0001-fbdev-bound-mode-sysfs-output-to-the-sysfs-buffer.patch b/SPECS/91/linux/CVE/0001-fbdev-bound-mode-sysfs-output-to-the-sysfs-buffer.patch deleted file mode 100644 index b12c8bf2f5..0000000000 --- a/SPECS/91/linux/CVE/0001-fbdev-bound-mode-sysfs-output-to-the-sysfs-buffer.patch +++ /dev/null @@ -1,88 +0,0 @@ -From b918b9080264083dd3190c91cfff7763007e38e0 Mon Sep 17 00:00:00 2001 -From: Melbin K Mathew -Date: Thu, 2 Jul 2026 01:42:46 +0200 -Subject: [PATCH] fbdev: bound mode sysfs output to the sysfs buffer - -[ Upstream commit d15d51fb26e830af58f3f21964f1c09c239077ea ] - -mode_string() uses snprintf() which can return a value larger than the -remaining buffer space. show_modes() accumulates the return value into i -without checking whether i has reached PAGE_SIZE, causing the offset to -advance past the sysfs buffer if the modelist is long enough. - -Add a size parameter to mode_string() and use scnprintf() to return -only the bytes actually written. Add an early return when offset -already exceeds the buffer. In show_modes(), stop accumulating once -the buffer is full. - -Cc: stable@vger.kernel.org # v7.1+ -Signed-off-by: Melbin K Mathew -Signed-off-by: Helge Deller -[ Shivani: Backported for CVE-2026-80580. Modified to apply on 6.12.y ] -Signed-off-by: Shivani Agarwal ---- - drivers/video/fbdev/core/fbsysfs.c | 15 ++++++++++----- - 1 file changed, 10 insertions(+), 5 deletions(-) - -diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c -index 10c3cfb959f4..6bbda920d924 100644 ---- a/drivers/video/fbdev/core/fbsysfs.c -+++ b/drivers/video/fbdev/core/fbsysfs.c -@@ -32,12 +32,15 @@ static int activate(struct fb_info *fb_info, struct fb_var_screeninfo *var) - return 0; - } - --static int mode_string(char *buf, unsigned int offset, -+static int mode_string(char *buf, size_t size, unsigned int offset, - const struct fb_videomode *mode) - { - char m = 'U'; - char v = 'p'; - -+ if (offset >= size) -+ return 0; -+ - if (mode->flag & FB_MODE_IS_DETAILED) - m = 'D'; - if (mode->flag & FB_MODE_IS_VESA) -@@ -50,7 +53,7 @@ static int mode_string(char *buf, unsigned int offset, - if (mode->vmode & FB_VMODE_DOUBLE) - v = 'd'; - -- return snprintf(&buf[offset], PAGE_SIZE - offset, "%c:%dx%d%c-%d\n", -+ return scnprintf(&buf[offset], size - offset, "%c:%dx%d%c-%d\n", - m, mode->xres, mode->yres, v, mode->refresh); - } - -@@ -69,7 +72,7 @@ static ssize_t store_mode(struct device *device, struct device_attribute *attr, - - list_for_each_entry(modelist, &fb_info->modelist, list) { - mode = &modelist->mode; -- i = mode_string(mstr, 0, mode); -+ i = mode_string(mstr, sizeof(mstr), 0, mode); - if (strncmp(mstr, buf, max(count, i)) == 0) { - - var = fb_info->var; -@@ -91,7 +94,7 @@ static ssize_t show_mode(struct device *device, struct device_attribute *attr, - if (!fb_info->mode) - return 0; - -- return mode_string(buf, 0, fb_info->mode); -+ return mode_string(buf, PAGE_SIZE, 0, fb_info->mode); - } - - static ssize_t store_modes(struct device *device, -@@ -141,7 +144,9 @@ static ssize_t show_modes(struct device *device, struct device_attribute *attr, - i = 0; - list_for_each_entry(modelist, &fb_info->modelist, list) { - mode = &modelist->mode; -- i += mode_string(buf, i, mode); -+ i += mode_string(buf, PAGE_SIZE, i, mode); -+ if (i >= PAGE_SIZE - 1) -+ break; - } - return i; - } --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-libceph-Fix-potential-out-of-bounds-access-in-__ceph.patch b/SPECS/91/linux/CVE/0001-libceph-Fix-potential-out-of-bounds-access-in-__ceph.patch deleted file mode 100644 index 75c654221b..0000000000 --- a/SPECS/91/linux/CVE/0001-libceph-Fix-potential-out-of-bounds-access-in-__ceph.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 74ecd2c5d8bbf70e6dfbf2cdf2398c6652a8f9fc Mon Sep 17 00:00:00 2001 -From: Raphael Zimmer -Date: Tue, 28 Apr 2026 14:15:46 +0200 -Subject: [PATCH] libceph: Fix potential out-of-bounds access in - __ceph_x_decrypt() - -[ Upstream commit 821365487aa58d06bda65c676ba215d506ba9768 ] - -In __ceph_x_decrypt(), a part of the buffer p is interpreted as a -ceph_x_encrypt_header, and the magic field of this struct is accessed. -This happens without any guarantee that the buffer is large enough to -hold this struct. The function parameter ciphertext_len represents the -length of the ciphertext to decrypt and is guaranteed to be at most the -remaining size of the allocated buffer p. However, this value is not -necessarily greater than sizeof(ceph_x_encrypt_header). E.g., a message -frame of type FRAME_TAG_AUTH_REPLY_MORE, that is just as long to hold -the ciphertext at its end with a ciphertext_len of 8 or less, can -trigger an out-of-bounds memory access when accessing hdr->magic. - -This patch fixes the issue by adding a check to ensure that the -decrypted plaintext in the buffer is large enough to represent at least -the ceph_x_encrypt_header. - -Cc: stable@vger.kernel.org -Signed-off-by: Raphael Zimmer -Reviewed-by: Ilya Dryomov -Signed-off-by: Ilya Dryomov -[Srinidhi: back-ported this CVE fix to v6.12.y] -Signed-off-by: Srinidhi Rao ---- - net/ceph/auth_x.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c -index c83559f015e4..f805a813308f 100644 ---- a/net/ceph/auth_x.c -+++ b/net/ceph/auth_x.c -@@ -86,6 +86,11 @@ static int __ceph_x_decrypt(struct ceph_crypto_key *secret, void *p, - if (ret) - return ret; - -+ if (plaintext_len < sizeof(*hdr)) { -+ pr_err("%s plaintext too small %d\n", __func__, plaintext_len); -+ return -EINVAL; -+ } -+ - if (le64_to_cpu(hdr->magic) != CEPHX_ENC_MAGIC) { - pr_err("%s bad magic\n", __func__); - return -EINVAL; --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-md-raid10-fix-writes_pending-leak-on-write-request-f.patch b/SPECS/91/linux/CVE/0001-md-raid10-fix-writes_pending-leak-on-write-request-f.patch deleted file mode 100644 index f5f059d77b..0000000000 --- a/SPECS/91/linux/CVE/0001-md-raid10-fix-writes_pending-leak-on-write-request-f.patch +++ /dev/null @@ -1,115 +0,0 @@ -From e045d6ed33f8faa3e3dd6dc33c62ec01e3ad275d Mon Sep 17 00:00:00 2001 -From: Abd-Alrhman Masalkhi -Date: Sat, 13 Jun 2026 18:28:08 +0000 -Subject: md/raid10: fix writes_pending leak on write request failures - -[ Upstream commit e045d6ed33f8faa3e3dd6dc33c62ec01e3ad275d ] - -raid10_make_request() acquires a writes_pending reference with -md_write_start() before dispatching write requests. Several failure -paths in raid10_write_request() complete the bio and return without -reaching the normal write completion path, causing the corresponding -md_write_end() to be skipped. - -Make raid10_write_request() return a status indicating whether the write -request was successfully queued. This allows raid10_make_request() to -release the writes_pending reference with md_write_end() when a write -request fails. - -Fixes: 4cf58d952909 ("md/raid10: Handle bio_split() errors") -Fixes: c9aa889b035f ("md: raid10 add nowait support") -Signed-off-by: Abd-Alrhman Masalkhi -Link: https://patch.msgid.link/20260613182810.1317258-3-abd.masalkhi@gmail.com -Signed-off-by: Yu Kuai -[Shivani: Backported for CVE-2026-72439. Modified to apply on 6.12.y ] -Signed-off-by: Shivani Agarwal ---- -diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c -index 06189fa..ffcec19 100644 ---- a/drivers/md/raid10.c -+++ b/drivers/md/raid10.c -@@ -1349,7 +1349,7 @@ retry_wait: - } - } - --static void raid10_write_request(struct mddev *mddev, struct bio *bio, -+static bool raid10_write_request(struct mddev *mddev, struct bio *bio, - struct r10bio *r10_bio) - { - struct r10conf *conf = mddev->private; -@@ -1366,7 +1366,7 @@ static void raid10_write_request(struct mddev *mddev, struct bio *bio, - /* Bail out if REQ_NOWAIT is set for the bio */ - if (bio->bi_opf & REQ_NOWAIT) { - bio_wouldblock_error(bio); -- return; -+ return false; - } - for (;;) { - prepare_to_wait(&conf->wait_barrier, -@@ -1382,7 +1382,7 @@ static void raid10_write_request(struct mddev *mddev, struct bio *bio, - sectors = r10_bio->sectors; - if (!regular_request_wait(mddev, conf, bio, sectors)) { - free_r10bio(r10_bio); -- return; -+ return false; - } - - if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && -@@ -1399,7 +1399,7 @@ static void raid10_write_request(struct mddev *mddev, struct bio *bio, - if (bio->bi_opf & REQ_NOWAIT) { - allow_barrier(conf); - bio_wouldblock_error(bio); -- return; -+ return false; - } - mddev_add_trace_msg(conf->mddev, - "raid10 wait reshape metadata"); -@@ -1507,7 +1507,8 @@ static void raid10_write_request(struct mddev *mddev, struct bio *bio, - raid10_write_one_disk(mddev, r10_bio, bio, true, i); - } - one_write_done(r10_bio); -- return; -+ return true; -+ - err_handle: - for (k = 0; k < i; k++) { - int d = r10_bio->devs[k].devnum; -@@ -1527,10 +1528,12 @@ err_handle: - bio->bi_status = errno_to_blk_status(error); - set_bit(R10BIO_Uptodate, &r10_bio->state); - raid_end_bio_io(r10_bio); -+ return false; - } - --static void __make_request(struct mddev *mddev, struct bio *bio, int sectors) -+static bool __make_request(struct mddev *mddev, struct bio *bio, int sectors) - { -+ bool ret; - struct r10conf *conf = mddev->private; - struct r10bio *r10_bio; - -@@ -1546,10 +1549,13 @@ static void __make_request(struct mddev *mddev, struct bio *bio, int sectors) - memset(r10_bio->devs, 0, sizeof(r10_bio->devs[0]) * - conf->geo.raid_disks); - -+ ret = true; - if (bio_data_dir(bio) == READ) - raid10_read_request(mddev, bio, r10_bio, true); - else -- raid10_write_request(mddev, bio, r10_bio); -+ ret = raid10_write_request(mddev, bio, r10_bio); -+ -+ return ret; - } - - static void raid_end_discard_bio(struct r10bio *r10bio) -@@ -1895,7 +1901,8 @@ static bool raid10_make_request(struct mddev *mddev, struct bio *bio) - sectors = chunk_sects - - (bio->bi_iter.bi_sector & - (chunk_sects - 1)); -- __make_request(mddev, bio, sectors); -+ if (!__make_request(mddev, bio, sectors)) -+ md_write_end(mddev); - - /* In case raid10d snuck in to freeze_array */ - wake_up_barrier(conf); diff --git a/SPECS/91/linux/CVE/0001-mm-call-free_folio-directly-in-folio_.patch b/SPECS/91/linux/CVE/0001-mm-call-free_folio-directly-in-folio_.patch deleted file mode 100644 index 6284990f2d..0000000000 --- a/SPECS/91/linux/CVE/0001-mm-call-free_folio-directly-in-folio_.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 2de4d2749b5e6970ac5824967ba7bdccb9b1cc84 Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Wed, 15 Jul 2026 09:23:57 +0000 -Subject: [PATCH] CVE-2026-31589: mm: call ->free_folio() directly in - folio_unmap_invalidate() - -From: Matthew Wilcox (Oracle) - -commit 615d9bb2ccad42f9e21d837431e401db2e471195 upstream. - -We can only call filemap_free_folio() if we have a reference to (or hold a -lock on) the mapping. Otherwise, we've already removed the folio from the -mapping so it no longer pins the mapping and the mapping can be removed, -causing a use-after-free when accessing mapping->a_ops. - -Follow the same pattern as __remove_mapping() and load the free_folio -function pointer before dropping the lock on the mapping. That lets us -make filemap_free_folio() static as this was the only caller outside -filemap.c. - -Link: https://lore.kernel.org/20260413184314.3419945-1-willy@infradead.org -Fixes: fb7d3bc41493 ("mm/filemap: drop streaming/uncached pages when writeback completes") -Signed-off-by: Matthew Wilcox (Oracle) -Reported-by: Google Big Sleep -Cc: Jens Axboe -Cc: Jan Kara -Cc: -Signed-off-by: Andrew Morton -[ Ajay: Modified to apply on v6.12 — adapted to invalidate_complete_folio2(), - the pre-refactor name of folio_unmap_invalidate() in the 6.12 series ] -Signed-off-by: Ajay Kaher ---- - mm/filemap.c | 3 ++- - mm/internal.h | 1 - - mm/truncate.c | 7 ++++++- - 3 files changed, 8 insertions(+), 3 deletions(-) - -diff --git a/mm/filemap.c b/mm/filemap.c -index dc6a84519..48c2e02a9 100644 ---- a/mm/filemap.c -+++ b/mm/filemap.c -@@ -233,7 +233,8 @@ void __filemap_remove_folio(struct folio *folio, void *shadow) - page_cache_delete(mapping, folio, shadow); - } - --void filemap_free_folio(struct address_space *mapping, struct folio *folio) -+static void filemap_free_folio(const struct address_space *mapping, -+ struct folio *folio) - { - void (*free_folio)(struct folio *); - int refs = 1; -diff --git a/mm/internal.h b/mm/internal.h -index 3bfc1dc2d..bef6af8d2 100644 ---- a/mm/internal.h -+++ b/mm/internal.h -@@ -401,7 +401,6 @@ unsigned find_lock_entries(struct address_space *mapping, pgoff_t *start, - pgoff_t end, struct folio_batch *fbatch, pgoff_t *indices); - unsigned find_get_entries(struct address_space *mapping, pgoff_t *start, - pgoff_t end, struct folio_batch *fbatch, pgoff_t *indices); --void filemap_free_folio(struct address_space *mapping, struct folio *folio); - int truncate_inode_folio(struct address_space *mapping, struct folio *folio); - bool truncate_inode_partial_folio(struct folio *folio, loff_t start, - loff_t end); -diff --git a/mm/truncate.c b/mm/truncate.c -index fb5c20b57..9b9d59aa0 100644 ---- a/mm/truncate.c -+++ b/mm/truncate.c -@@ -574,6 +574,8 @@ EXPORT_SYMBOL(invalidate_mapping_pages); - static int invalidate_complete_folio2(struct address_space *mapping, - struct folio *folio) - { -+ void (*free_folio)(struct folio *); -+ - if (folio->mapping != mapping) - return 0; - -@@ -590,9 +592,12 @@ static int invalidate_complete_folio2(struct address_space *mapping, - xa_unlock_irq(&mapping->i_pages); - if (mapping_shrinkable(mapping)) - inode_add_lru(mapping->host); -+ free_folio = mapping->a_ops->free_folio; - spin_unlock(&mapping->host->i_lock); - -- filemap_free_folio(mapping, folio); -+ if (free_folio) -+ free_folio(folio); -+ folio_put_refs(folio, folio_nr_pages(folio)); - return 1; - failed: - xa_unlock_irq(&mapping->i_pages); --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-net-handshake-hand-off-the-pinned-file-reference-to-.patch b/SPECS/91/linux/CVE/0001-net-handshake-hand-off-the-pinned-file-reference-to-.patch deleted file mode 100644 index ba6343be52..0000000000 --- a/SPECS/91/linux/CVE/0001-net-handshake-hand-off-the-pinned-file-reference-to-.patch +++ /dev/null @@ -1,140 +0,0 @@ -From f4251190e58b209999c1ba9e6d2976136a1be055 Mon Sep 17 00:00:00 2001 -From: Chuck Lever -Date: Mon, 25 May 2026 12:51:19 -0400 -Subject: [PATCH] net/handshake: hand off the pinned file reference to - accept_doit - -[Upstream commit f4251190e58b209999c1ba9e6d2976136a1be055 ] - -handshake_req_next() removes the request from the per-net pending list -and drops hn_lock before handshake_nl_accept_doit() reads -req->hr_sk->sk_socket and dereferences sock->file (in get_file() and -fd_install()). In that window a consumer running tls_handshake_cancel() -followed by sockfd_put() or __fput_sync() releases sock->file. -sock_release() then runs sock_orphan(), zeroing sk_socket, and frees the -struct socket. The accept-side code either reads NULL through sk_socket -or chases freed memory. - -Retarget the accept-side dereferences at req->hr_file, which was pinned -at submit time. Hand off an additional file reference inside -handshake_req_next(), under hn_lock, so the accept side operates on a -reference that no concurrent handshake_req_cancel() can revoke. -fd_install() consumes that handed-off reference; on any error path the -caller must fput() it explicitly. - -Update handshake_req_cancel_test2 and _test3 to simulate the fd_install() -consumption with an fput() so the kunit file-count assertions stay balanced. - -Note: In 6.12.y handshake_nl_accept_doit() uses get_unused_fd_flags() + -fd_install() rather than FD_PREPARE()/fd_publish(). The fix is adapted -accordingly: drop the sock->file indirection, use req->hr_file directly, -and add explicit fput() on each error path that bypasses fd_install(). - -Fixes: 3b3009ea8abb ("net/handshake: Create a NETLINK service for handling handshake requests") -Reported-by: Chris Mason -Signed-off-by: Chuck Lever -Reviewed-by: Hannes Reinecke -Signed-off-by: Guruswamy Basavaiah ---- - net/handshake/handshake-test.c | 8 ++++++++ - net/handshake/netlink.c | 7 +++---- - net/handshake/request.c | 22 +++++++++++++++++++++- - 3 files changed, 32 insertions(+), 5 deletions(-) - -diff --git a/net/handshake/handshake-test.c b/net/handshake/handshake-test.c ---- a/net/handshake/handshake-test.c -+++ b/net/handshake/handshake-test.c -@@ -375,6 +375,10 @@ - /* Pretend to accept this request */ - next = handshake_req_next(hn, HANDSHAKE_HANDLER_CLASS_TLSHD); - KUNIT_ASSERT_PTR_EQ(test, req, next); -+ /* Simulate fd_install() consuming the file reference handed -+ * off by handshake_req_next(); see handshake_nl_accept_doit(). -+ */ -+ fput(filp); - - /* Act */ - result = handshake_req_cancel(sock->sk); -@@ -417,6 +421,10 @@ - /* Pretend to accept this request */ - next = handshake_req_next(hn, HANDSHAKE_HANDLER_CLASS_TLSHD); - KUNIT_ASSERT_PTR_EQ(test, req, next); -+ /* Simulate fd_install() consuming the file reference handed -+ * off by handshake_req_next(); see handshake_nl_accept_doit(). -+ */ -+ fput(filp); - - /* Pretend to complete this request */ - handshake_complete(next, -ETIMEDOUT, NULL); -diff --git a/net/handshake/netlink.c b/net/handshake/netlink.c ---- a/net/handshake/netlink.c -+++ b/net/handshake/netlink.c -@@ -92,7 +92,6 @@ - struct net *net = sock_net(skb->sk); - struct handshake_net *hn = handshake_pernet(net); - struct handshake_req *req = NULL; -- struct socket *sock; - int class, fd, err; - - err = -EOPNOTSUPP; -@@ -109,20 +108,21 @@ - if (!req) - goto out_status; - -- sock = req->hr_sk->sk_socket; - fd = get_unused_fd_flags(O_CLOEXEC); - if (fd < 0) { - err = fd; -+ fput(req->hr_file); /* drop ref from handshake_req_next() */ - goto out_complete; - } - - err = req->hr_proto->hp_accept(req, info, fd); - if (err) { - put_unused_fd(fd); -+ fput(req->hr_file); /* drop ref from handshake_req_next() */ - goto out_complete; - } - -- fd_install(fd, get_file(sock->file)); -+ fd_install(fd, req->hr_file); - - trace_handshake_cmd_accept(net, req, req->hr_sk, fd); - return 0; -diff --git a/net/handshake/request.c b/net/handshake/request.c ---- a/net/handshake/request.c -+++ b/net/handshake/request.c -@@ -181,6 +181,17 @@ - return ret; - } - -+/** -+ * handshake_req_next - Return the next queued handshake request -+ * @hn: per-net handshake state -+ * @class: handler class to match -+ * -+ * On a non-NULL return, the caller owns an extra reference -+ * on @req->hr_file. FD_PREPARE() consumes it on success; on -+ * the error path the caller must fput() it. -+ * -+ * Return: pointer to a removed handshake_req, or NULL. -+ */ - struct handshake_req *handshake_req_next(struct handshake_net *hn, int class) - { - struct handshake_req *req, *pos; -@@ -191,6 +202,13 @@ - if (pos->hr_proto->hp_handler_class != class) - continue; - __remove_pending_locked(hn, pos); -+ /* Hand off a file reference to the accept side under -+ * hn_lock. A concurrent handshake_req_cancel() can drop -+ * hr_file before accept reaches fd_install(); this extra -+ * reference keeps the file alive until fd_install() takes -+ * ownership. -+ */ -+ get_file(pos->hr_file); - req = pos; - break; - } --- -2.39.0 diff --git a/SPECS/91/linux/CVE/0001-net-mlx5e-Fix-publication-race-for-priv-channel_stat.patch b/SPECS/91/linux/CVE/0001-net-mlx5e-Fix-publication-race-for-priv-channel_stat.patch deleted file mode 100644 index 046edcf4ae..0000000000 --- a/SPECS/91/linux/CVE/0001-net-mlx5e-Fix-publication-race-for-priv-channel_stat.patch +++ /dev/null @@ -1,272 +0,0 @@ -From 5a799714e8ca0bce9ea40694f49914cf1adbbaa9 Mon Sep 17 00:00:00 2001 -From: Feng Liu -Date: Tue, 30 Jun 2026 14:51:51 +0300 -Subject: net/mlx5e: Fix publication race for priv->channel_stats[] - -[ Upstream commit 5a799714e8ca0bce9ea40694f49914cf1adbbaa9 ] - -mlx5e_channel_stats_alloc() publishes a new entry to -priv->channel_stats[] and then increments priv->stats_nch as a -publication token, but neither store carries any memory barrier: - - priv->channel_stats[ix] = kvzalloc_node(...); - if (!priv->channel_stats[ix]) - return -ENOMEM; - priv->stats_nch++; - -Concurrent readers compute the loop bound from priv->stats_nch and -then dereference priv->channel_stats[i] using plain accesses, e.g. - - for (i = 0; i < priv->stats_nch; i++) { - struct mlx5e_channel_stats *cs = priv->channel_stats[i]; - ... cs->rq.packets ... - } - -On weakly-ordered architectures (ARM, PowerPC, RISC-V) the writes to -channel_stats[ix] and stats_nch may become visible to other CPUs out -of program order. A reader can observe stats_nch == N while still -seeing channel_stats[N-1] == NULL, leading to a NULL pointer -dereference in the channel_stats loop. - -This has been observed in production on BlueField-3 DPUs (arm64), -where ovs-vswitchd queries netdev statistics over netlink during NIC -bringup, racing mlx5e_open_channel() -> mlx5e_channel_stats_alloc() -on another CPU: - - Unable to handle kernel NULL pointer dereference at virtual address 0x840 - Hardware name: BlueField-3 DPU - pc : mlx5e_fold_sw_stats64+0x30/0x180 [mlx5_core] - Call trace: - mlx5e_fold_sw_stats64+0x30/0x180 [mlx5_core] - dev_get_stats+0x50/0xc0 - ovs_vport_get_stats+0x38/0xac [openvswitch] - ovs_vport_cmd_fill_info+0x194/0x290 [openvswitch] - ovs_vport_cmd_get+0xbc/0x10c [openvswitch] - genl_family_rcv_msg_doit+0xd0/0x160 - genl_rcv_msg+0xec/0x1f0 - netlink_rcv_skb+0x64/0x130 - genl_rcv+0x40/0x60 - netlink_unicast+0x2fc/0x370 - netlink_sendmsg+0x1dc/0x454 - ... - __arm64_sys_sendmsg+0x2c/0x40 - -Add mlx5e_stats_nch_write() and mlx5e_stats_nch_read() helpers in en.h -that wrap the smp_store_release()/smp_load_acquire() pair on stats_nch. -The release/acquire pair establishes the contract: - - stats_nch == N => channel_stats[0..N-1] are visible and non-NULL. - -Publish the stats_nch increment via mlx5e_stats_nch_write() in the -writer (mlx5e_channel_stats_alloc()), and read stats_nch via -mlx5e_stats_nch_read() in all readers: mlx5e RX/TX queue stats, -mlx5e_get_base_stats(), ethtool channels stats, IPoIB stats, the -sw_stats fold and the HV VHCA stats agent. - -Fixes: fa691d0c9c08 ("net/mlx5e: Allocate per-channel stats dynamically at first usage") -Signed-off-by: Feng Liu -Reviewed-by: Eran Ben Elisha -Reviewed-by: Cosmin Ratiu -Reviewed-by: Nimrod Oren -Signed-off-by: Tariq Toukan -Link: https://patch.msgid.link/20260630115151.729219-4-tariqt@nvidia.com -Signed-off-by: Paolo Abeni -[Shivani: Backported for CVE-2026-72341. Modified to apply on 6.12.y ] -Signed-off-by: Shivani Agarwal ---- -diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h -index 0e1890616..c21e27ef6 100644 ---- a/drivers/net/ethernet/mellanox/mlx5/core/en.h -+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h -@@ -946,6 +946,18 @@ struct mlx5e_priv { - struct mlx5_devcom_comp_dev *devcom; - }; - -+static inline u16 mlx5e_stats_nch_read(const struct mlx5e_priv *priv) -+{ -+ /* Pairs with smp_store_release in mlx5e_stats_nch_write(). */ -+ return smp_load_acquire(&priv->stats_nch); -+} -+ -+static inline void mlx5e_stats_nch_write(struct mlx5e_priv *priv, u16 n) -+{ -+ /* Pairs with smp_load_acquire in mlx5e_stats_nch_read(). */ -+ smp_store_release(&priv->stats_nch, n); -+} -+ - struct mlx5e_dev { - struct net_device *netdev; - struct devlink_port dl_port; -diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c -index 1856d2113..adfb49ff4 100644 ---- a/drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c -+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c -@@ -33,9 +33,10 @@ mlx5e_hv_vhca_fill_ring_stats(struct mlx5e_priv *priv, int ch, - static void mlx5e_hv_vhca_fill_stats(struct mlx5e_priv *priv, void *data, - int buf_len) - { -+ u16 nch = mlx5e_stats_nch_read(priv); - int ch, i = 0; - -- for (ch = 0; ch < priv->stats_nch; ch++) { -+ for (ch = 0; ch < nch; ch++) { - void *buf = data + i; - - if (WARN_ON_ONCE(buf + -@@ -50,8 +51,9 @@ static void mlx5e_hv_vhca_fill_stats(struct mlx5e_priv *priv, void *data, - - static int mlx5e_hv_vhca_stats_buf_size(struct mlx5e_priv *priv) - { -- return (sizeof(struct mlx5e_hv_vhca_per_ring_stats) * -- priv->stats_nch); -+ u16 nch = mlx5e_stats_nch_read(priv); -+ -+ return sizeof(struct mlx5e_hv_vhca_per_ring_stats) * nch; - } - - static int mlx5e_hv_vhca_stats_buf_max_size(struct mlx5e_priv *priv) -@@ -106,7 +108,7 @@ static void mlx5e_hv_vhca_stats_control(struct mlx5_hv_vhca_agent *agent, - sagent = &priv->stats_agent; - - block->version = MLX5_HV_VHCA_STATS_VERSION; -- block->rings = priv->stats_nch; -+ block->rings = mlx5e_stats_nch_read(priv); - - if (!block->command) { - cancel_delayed_work_sync(&priv->stats_agent.work); -diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c -index c7eb58fd6..d5ab6e047 100644 ---- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c -+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c -@@ -2603,7 +2603,7 @@ static int mlx5e_channel_stats_alloc(struct mlx5e_priv *priv, int ix, int cpu) - GFP_KERNEL, cpu_to_node(cpu)); - if (!priv->channel_stats[ix]) - return -ENOMEM; -- priv->stats_nch++; -+ mlx5e_stats_nch_write(priv, priv->stats_nch + 1); - - return 0; - } -@@ -3819,9 +3819,10 @@ static int mlx5e_setup_tc(struct net_device *dev, enum tc_setup_type type, - - void mlx5e_fold_sw_stats64(struct mlx5e_priv *priv, struct rtnl_link_stats64 *s) - { -+ u16 nch = mlx5e_stats_nch_read(priv); - int i; - -- for (i = 0; i < priv->stats_nch; i++) { -+ for (i = 0; i < nch; i++) { - struct mlx5e_channel_stats *channel_stats = priv->channel_stats[i]; - struct mlx5e_rq_stats *xskrq_stats = &channel_stats->xskrq; - struct mlx5e_rq_stats *rq_stats = &channel_stats->rq; -@@ -5287,7 +5288,7 @@ static void mlx5e_get_queue_stats_rx(struct net_device *dev, int i, - struct mlx5e_rq_stats *rq_stats; - - ASSERT_RTNL(); -- if (mlx5e_is_uplink_rep(priv) || !priv->stats_nch) -+ if (mlx5e_is_uplink_rep(priv) || !mlx5e_stats_nch_read(priv)) - return; - - channel_stats = priv->channel_stats[i]; -@@ -5307,7 +5308,7 @@ static void mlx5e_get_queue_stats_tx(struct net_device *dev, int i, - struct mlx5e_sq_stats *sq_stats; - - ASSERT_RTNL(); -- if (!priv->stats_nch) -+ if (!mlx5e_stats_nch_read(priv)) - return; - - /* no special case needed for ptp htb etc since txq2sq_stats is kept up -@@ -5324,6 +5325,7 @@ static void mlx5e_get_base_stats(struct net_device *dev, - struct netdev_queue_stats_tx *tx) - { - struct mlx5e_priv *priv = netdev_priv(dev); -+ u16 nch = mlx5e_stats_nch_read(priv); - struct mlx5e_ptp *ptp_channel; - int i, tc; - -@@ -5333,7 +5335,7 @@ static void mlx5e_get_base_stats(struct net_device *dev, - rx->bytes = 0; - rx->alloc_fail = 0; - -- for (i = priv->channels.params.num_channels; i < priv->stats_nch; i++) { -+ for (i = priv->channels.params.num_channels; i < nch; i++) { - struct netdev_queue_stats_rx rx_i = {0}; - - mlx5e_get_queue_stats_rx(dev, i, &rx_i); -@@ -5358,7 +5360,7 @@ static void mlx5e_get_base_stats(struct net_device *dev, - tx->packets = 0; - tx->bytes = 0; - -- for (i = 0; i < priv->stats_nch; i++) { -+ for (i = 0; i < nch; i++) { - struct mlx5e_channel_stats *channel_stats = priv->channel_stats[i]; - - /* handle two cases: -diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c -index 2f077ad1e..652cae2fe 100644 ---- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c -+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c -@@ -528,6 +528,7 @@ static void mlx5e_stats_update_stats_rq_page_pool(struct mlx5e_channel *c) - static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(sw) - { - struct mlx5e_sw_stats *s = &priv->stats.sw; -+ u16 nch = mlx5e_stats_nch_read(priv); - int i; - - memset(s, 0, sizeof(*s)); -@@ -535,7 +536,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(sw) - for (i = 0; i < priv->channels.num; i++) /* for active channels only */ - mlx5e_stats_update_stats_rq_page_pool(priv->channels.c[i]); - -- for (i = 0; i < priv->stats_nch; i++) { -+ for (i = 0; i < nch; i++) { - struct mlx5e_channel_stats *channel_stats = - priv->channel_stats[i]; - -@@ -2438,7 +2439,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(ptp) { return; } - - static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(channels) - { -- int max_nch = priv->stats_nch; -+ int max_nch = mlx5e_stats_nch_read(priv); - - return (NUM_RQ_STATS * max_nch) + - (NUM_CH_STATS * max_nch) + -@@ -2451,8 +2452,8 @@ static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(channels) - - static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(channels) - { -+ int max_nch = mlx5e_stats_nch_read(priv); - bool is_xsk = priv->xsk.ever_used; -- int max_nch = priv->stats_nch; - int i, j, tc; - - for (i = 0; i < max_nch; i++) -@@ -2484,8 +2485,8 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(channels) - - static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(channels) - { -+ int max_nch = mlx5e_stats_nch_read(priv); - bool is_xsk = priv->xsk.ever_used; -- int max_nch = priv->stats_nch; - int i, j, tc; - - for (i = 0; i < max_nch; i++) -diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c -index 0979d672d..2c71e2ac4 100644 ---- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c -+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c -@@ -114,10 +114,11 @@ void mlx5i_cleanup(struct mlx5e_priv *priv) - - static void mlx5i_grp_sw_update_stats(struct mlx5e_priv *priv) - { -+ u16 nch = mlx5e_stats_nch_read(priv); - struct rtnl_link_stats64 s = {}; - int i, j; - -- for (i = 0; i < priv->stats_nch; i++) { -+ for (i = 0; i < nch; i++) { - struct mlx5e_channel_stats *channel_stats; - struct mlx5e_rq_stats *rq_stats; - diff --git a/SPECS/91/linux/CVE/0001-net-mlx5e-RX-Fix-XDP-multi-buf-frag-counting-for-leg.patch b/SPECS/91/linux/CVE/0001-net-mlx5e-RX-Fix-XDP-multi-buf-frag-counting-for-leg.patch deleted file mode 100644 index fc228a4000..0000000000 --- a/SPECS/91/linux/CVE/0001-net-mlx5e-RX-Fix-XDP-multi-buf-frag-counting-for-leg.patch +++ /dev/null @@ -1,128 +0,0 @@ -From 2f28897cb64cf0724ff9d0d8c82e6601ef08fb9d Mon Sep 17 00:00:00 2001 -From: Dragos Tatulea -Date: Thu, 5 Mar 2026 16:26:34 +0200 -Subject: [PATCH] net/mlx5e: RX, Fix XDP multi-buf frag counting for legacy RQ - -[ Upstream commit a6413e6f6c9d9bb9833324cb3753582f7bc0f2fa ] - -XDP multi-buf programs can modify the layout of the XDP buffer when the -program calls bpf_xdp_pull_data() or bpf_xdp_adjust_tail(). The -referenced commit in the fixes tag corrected the assumption in the mlx5 -driver that the XDP buffer layout doesn't change during a program -execution. However, this fix introduced another issue: the dropped -fragments still need to be counted on the driver side to avoid page -fragment reference counting issues. - -Such issue can be observed with the -test_xdp_native_adjst_tail_shrnk_data selftest when using a payload of -3600 and shrinking by 256 bytes (an upcoming selftest patch): the last -fragment gets released by the XDP code but doesn't get tracked by the -driver. This results in a negative pp_ref_count during page release and -the following splat: - - WARNING: include/net/page_pool/helpers.h:297 at mlx5e_page_release_fragmented.isra.0+0x4a/0x50 [mlx5_core], CPU#12: ip/3137 - Modules linked in: [...] - CPU: 12 UID: 0 PID: 3137 Comm: ip Not tainted 6.19.0-rc3+ #12 NONE - Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014 - RIP: 0010:mlx5e_page_release_fragmented.isra.0+0x4a/0x50 [mlx5_core] - [...] - Call Trace: - - mlx5e_dealloc_rx_wqe+0xcb/0x1a0 [mlx5_core] - mlx5e_free_rx_descs+0x7f/0x110 [mlx5_core] - mlx5e_close_rq+0x50/0x60 [mlx5_core] - mlx5e_close_channels+0x36/0x2c0 [mlx5_core] - mlx5e_close_channel+0x1c/0x50 [mlx5_core] - mlx5e_safe_switch_params+0x1a5/0x230 [mlx5_core] - mlx5e_change_mtu+0xf3/0x2f0 [mlx5_core] - netif_set_mtu_ext+0xf1/0x230 - do_setlink.isra.0+0x219/0x1180 - rtnl_newlink+0x79f/0xb60 - rtnetlink_rcv_msg+0x213/0x3a0 - netlink_rcv_skb+0x48/0xf0 - netlink_unicast+0x24a/0x350 - netlink_sendmsg+0x1ee/0x410 - __sock_sendmsg+0x38/0x60 - ____sys_sendmsg+0x232/0x280 - ___sys_sendmsg+0x78/0xb0 - __sys_sendmsg+0x5f/0xb0 - [...] - do_syscall_64+0x57/0xc50 - -This patch fixes the issue by doing page frag counting on all the -original XDP buffer fragments for all relevant XDP actions (XDP_TX , -XDP_REDIRECT and XDP_PASS). This is basically reverting to the original -counting before the commit in the fixes tag. - -As frag_page is still pointing to the original tail, the nr_frags -parameter to xdp_update_skb_frags_info() needs to be calculated -in a different way to reflect the new nr_frags. - -Fixes: afd5ba577c10 ("net/mlx5e: RX, Fix generating skb from non-linear xdp_buff for legacy RQ") -Signed-off-by: Dragos Tatulea -Signed-off-by: Tariq Toukan -Reviewed-by: Amery Hung -Link: https://patch.msgid.link/20260305142634.1813208-6-tariqt@nvidia.com -Signed-off-by: Jakub Kicinski -[Srinidhi: back-ported this CVE fix to v6.12.y. linux v6.12.y still uses -the pre-rename xdp_update_skb_shared_info() API (upstream later renamed it to -xdp_update_skb_frags_info() in a separate, unrelated commit). the frag-count -argument correction is applied to the existing call instead of the renamed one] -Signed-off-by: Srinidhi Rao ---- - drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 11 ++++------- - 1 file changed, 4 insertions(+), 7 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c -index e65a27154a84..c7d6c5806b8c 100644 ---- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c -+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c -@@ -1727,6 +1727,7 @@ mlx5e_skb_from_cqe_nonlinear(struct mlx5e_rq *rq, struct mlx5e_wqe_frag_info *wi - struct skb_shared_info *sinfo; - u32 frag_consumed_bytes; - struct bpf_prog *prog; -+ u8 nr_frags_free = 0; - struct sk_buff *skb; - dma_addr_t addr; - u32 truesize; -@@ -1769,15 +1770,13 @@ mlx5e_skb_from_cqe_nonlinear(struct mlx5e_rq *rq, struct mlx5e_wqe_frag_info *wi - - prog = rcu_dereference(rq->xdp_prog); - if (prog) { -- u8 nr_frags_free, old_nr_frags = sinfo->nr_frags; -+ u8 old_nr_frags = sinfo->nr_frags; - - if (mlx5e_xdp_handle(rq, prog, mxbuf)) { - if (__test_and_clear_bit(MLX5E_RQ_FLAG_XDP_XMIT, - rq->flags)) { - struct mlx5e_wqe_frag_info *pwi; - -- wi -= old_nr_frags - sinfo->nr_frags; -- - for (pwi = head_wi; pwi < wi; pwi++) - pwi->frag_page->frags++; - } -@@ -1785,10 +1784,8 @@ mlx5e_skb_from_cqe_nonlinear(struct mlx5e_rq *rq, struct mlx5e_wqe_frag_info *wi - } - - nr_frags_free = old_nr_frags - sinfo->nr_frags; -- if (unlikely(nr_frags_free)) { -- wi -= nr_frags_free; -+ if (unlikely(nr_frags_free)) - truesize -= nr_frags_free * frag_info->frag_stride; -- } - } - - skb = mlx5e_build_linear_skb( -@@ -1804,7 +1801,7 @@ mlx5e_skb_from_cqe_nonlinear(struct mlx5e_rq *rq, struct mlx5e_wqe_frag_info *wi - - if (xdp_buff_has_frags(&mxbuf->xdp)) { - /* sinfo->nr_frags is reset by build_skb, calculate again. */ -- xdp_update_skb_shared_info(skb, wi - head_wi - 1, -+ xdp_update_skb_shared_info(skb, wi - head_wi - nr_frags_free - 1, - sinfo->xdp_frags_size, truesize, - xdp_buff_is_frag_pfmemalloc( - &mxbuf->xdp)); --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-net-serialize-netif_running-check-in-enqueue_to_backlog.patch b/SPECS/91/linux/CVE/0001-net-serialize-netif_running-check-in-enqueue_to_backlog.patch deleted file mode 100644 index 1ae45bbc9d..0000000000 --- a/SPECS/91/linux/CVE/0001-net-serialize-netif_running-check-in-enqueue_to_backlog.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 871c2e9dab80525fdac4426b5dc36f9549d6baa1 Mon Sep 17 00:00:00 2001 -From: Eric Dumazet -Date: Tue, 16 Jun 2026 14:13:17 +0000 -Subject: [PATCH] net: serialize netif_running() check in enqueue_to_backlog() - -[ Upstream commit 46762cefe7f4e5bffc1eb467810a7bbb02e461d7 ] - -Syzbot reported a KASAN slab-use-after-free in fib_rules_lookup(). - -The root cause is a race condition where packets can escape the backlog -flushing during device unregistration (e.g., during netns exit). - -Commit e9e4dd3267d0 ("net: do not process device backlog during unregistration") -introduced a lockless netif_running() check in enqueue_to_backlog() to -prevent queuing packets to an unregistering device. - -However, this creates a TOCTOU race window. - -A lockless transmitter (like veth_xmit) can pass -the check before dev_close() clears IFF_UP. If the transmitter is then -delayed, flush_all_backlogs() can run and finish before the transmitter -grabs the backlog lock and queues the packet. The packet then escapes -the flush and triggers UAF later when processed. - -Fix this by moving the netif_running() check inside the backlog lock. -This serializes the check with the flush work (which also grabs the lock). -We then either queue the packet before the flush runs (so it gets flushed), -or check netif_running() after the flush/close completes (so it gets dropped). - -Fixes: e9e4dd3267d0 ("net: do not process device backlog during unregistration") -Reported-by: syzbot+965506b59a2de0b6905c@syzkaller.appspotmail.com -Closes: https://lore.kernel.org/netdev/6a315824.b0403584.28d0ff.0000.GAE@google.com/T/#u -Signed-off-by: Eric Dumazet -Cc: Julian Anastasov -Reviewed-by: Kuniyuki Iwashima - -[Ankit: Backported for v6.12.y. Re-set the drop reason to -SKB_DROP_REASON_DEV_READY inside the moved, now-locked netif_running() -check, since this tree always sets a default reason just above it.] -Signed-off-by: Ankit Jain ---- - net/core/dev.c | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/net/core/dev.c b/net/core/dev.c -index 8efe2ea92..28a44ff68 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -5015,10 +5015,6 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu, - int max_backlog; - u32 tail; - -- reason = SKB_DROP_REASON_DEV_READY; -- if (!netif_running(skb->dev)) -- goto bad_dev; -- - reason = SKB_DROP_REASON_CPU_BACKLOG; - sd = &per_cpu(softnet_data, cpu); - -@@ -5029,6 +5025,11 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu, - backlog_lock_irq_save(sd, &flags); - qlen = skb_queue_len(&sd->input_pkt_queue); - if (qlen <= max_backlog && !skb_flow_limit(skb, qlen)) { -+ if (unlikely(!netif_running(skb->dev))) { -+ reason = SKB_DROP_REASON_DEV_READY; -+ backlog_unlock_irq_restore(sd, &flags); -+ goto bad_dev; -+ } - if (!qlen) { - /* Schedule NAPI for backlog device. We can use - * non atomic operation as we own the queue lock. --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-netfilter-bridge-eb_tables-close-module-init-race.patch b/SPECS/91/linux/CVE/0001-netfilter-bridge-eb_tables-close-module-init-race.patch deleted file mode 100644 index 1e59bfd3a7..0000000000 --- a/SPECS/91/linux/CVE/0001-netfilter-bridge-eb_tables-close-module-init-race.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 07c02263aebf6611f0e7339c003ffc2abd17344f Mon Sep 17 00:00:00 2001 -From: Florian Westphal -Date: Thu, 7 May 2026 11:19:22 +0200 -Subject: [PATCH] netfilter: bridge: eb_tables: close module init race - -[ Upstream commit 27414ff1b287ea9a2a11675149ec28e05539f3cc ] - -sashiko reports for unrelated patch: - Does the core ebtables initialization in ebtables.c suffer from a similar race? - Once nf_register_sockopt() completes, the sockopts are exposed globally. - -sockopt has to be registered last, just like in ip/ip6/arptables. - -Fixes: 5b53951cfc85 ("netfilter: ebtables: use net_generic infra") -Signed-off-by: Florian Westphal -Signed-off-by: Pablo Neira Ayuso -Signed-off-by: Sasha Levin -[ Applied patch to v6.12 by Gerrit Photon ] ---- - net/bridge/netfilter/ebtables.c | 11 ++++++----- - 1 file changed, 6 insertions(+), 5 deletions(-) - -diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c -index 044a12d9c..da7d1f411 100644 ---- a/net/bridge/netfilter/ebtables.c -+++ b/net/bridge/netfilter/ebtables.c -@@ -2622,19 +2622,20 @@ static int __init ebtables_init(void) - { - int ret; - -- ret = xt_register_target(&ebt_standard_target); -+ ret = register_pernet_subsys(&ebt_net_ops); - if (ret < 0) - return ret; -- ret = nf_register_sockopt(&ebt_sockopts); -+ -+ ret = xt_register_target(&ebt_standard_target); - if (ret < 0) { -- xt_unregister_target(&ebt_standard_target); -+ unregister_pernet_subsys(&ebt_net_ops); - return ret; - } - -- ret = register_pernet_subsys(&ebt_net_ops); -+ ret = nf_register_sockopt(&ebt_sockopts); - if (ret < 0) { -- nf_unregister_sockopt(&ebt_sockopts); - xt_unregister_target(&ebt_standard_target); -+ unregister_pernet_subsys(&ebt_net_ops); - return ret; - } - --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-netfilter-ebtables-move-to-two-stage-removal-scheme.patch b/SPECS/91/linux/CVE/0001-netfilter-ebtables-move-to-two-stage-removal-scheme.patch deleted file mode 100644 index d9fc72206b..0000000000 --- a/SPECS/91/linux/CVE/0001-netfilter-ebtables-move-to-two-stage-removal-scheme.patch +++ /dev/null @@ -1,196 +0,0 @@ -From 9bea5bad518a1f63714f4942ff9af94d347f8870 Mon Sep 17 00:00:00 2001 -From: Florian Westphal -Date: Wed, 6 May 2026 12:07:18 +0200 -Subject: [PATCH] netfilter: ebtables: move to two-stage removal scheme - -[ Upstream commit b7f0544d86d439cb946515d2ef6a0a75e8626710 ] - -Like previous patches for x_tables, follow same pattern in ebtables. -We can't reuse xt helpers: ebt_table struct layout is incompatible. - -table->ops assignment is now done while still holding the ebt mutex -to make sure we never expose partially-filled table struct. - -Fixes: 87663c39f898 ("netfilter: ebtables: do not hook tables by default") -Reviewed-by: Tristan Madani -Signed-off-by: Florian Westphal -Signed-off-by: Pablo Neira Ayuso -Signed-off-by: Sasha Levin -[ Applied patch to v6.12 by Gerrit Photon ] ---- - net/bridge/netfilter/ebtable_broute.c | 2 +- - net/bridge/netfilter/ebtable_filter.c | 2 +- - net/bridge/netfilter/ebtable_nat.c | 2 +- - net/bridge/netfilter/ebtables.c | 60 +++++++++++++++++---------- - 4 files changed, 40 insertions(+), 26 deletions(-) - -diff --git a/net/bridge/netfilter/ebtable_broute.c b/net/bridge/netfilter/ebtable_broute.c -index 741360219..e6f9e343b 100644 ---- a/net/bridge/netfilter/ebtable_broute.c -+++ b/net/bridge/netfilter/ebtable_broute.c -@@ -128,8 +128,8 @@ static int __init ebtable_broute_init(void) - - static void __exit ebtable_broute_fini(void) - { -- unregister_pernet_subsys(&broute_net_ops); - ebt_unregister_template(&broute_table); -+ unregister_pernet_subsys(&broute_net_ops); - } - - module_init(ebtable_broute_init); -diff --git a/net/bridge/netfilter/ebtable_filter.c b/net/bridge/netfilter/ebtable_filter.c -index dacd81b12..02b6501c1 100644 ---- a/net/bridge/netfilter/ebtable_filter.c -+++ b/net/bridge/netfilter/ebtable_filter.c -@@ -109,8 +109,8 @@ static int __init ebtable_filter_init(void) - - static void __exit ebtable_filter_fini(void) - { -- unregister_pernet_subsys(&frame_filter_net_ops); - ebt_unregister_template(&frame_filter); -+ unregister_pernet_subsys(&frame_filter_net_ops); - } - - module_init(ebtable_filter_init); -diff --git a/net/bridge/netfilter/ebtable_nat.c b/net/bridge/netfilter/ebtable_nat.c -index 0f2a8c611..9985a8255 100644 ---- a/net/bridge/netfilter/ebtable_nat.c -+++ b/net/bridge/netfilter/ebtable_nat.c -@@ -109,8 +109,8 @@ static int __init ebtable_nat_init(void) - - static void __exit ebtable_nat_fini(void) - { -- unregister_pernet_subsys(&frame_nat_net_ops); - ebt_unregister_template(&frame_nat); -+ unregister_pernet_subsys(&frame_nat_net_ops); - } - - module_init(ebtable_nat_init); -diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c -index ba7a61f0c..044a12d9c 100644 ---- a/net/bridge/netfilter/ebtables.c -+++ b/net/bridge/netfilter/ebtables.c -@@ -42,6 +42,7 @@ - - struct ebt_pernet { - struct list_head tables; -+ struct list_head dead_tables; - }; - - struct ebt_template { -@@ -1165,11 +1166,6 @@ static int do_replace(struct net *net, sockptr_t arg, unsigned int len) - - static void __ebt_unregister_table(struct net *net, struct ebt_table *table) - { -- mutex_lock(&ebt_mutex); -- list_del(&table->list); -- mutex_unlock(&ebt_mutex); -- audit_log_nfcfg(table->name, AF_BRIDGE, table->private->nentries, -- AUDIT_XT_OP_UNREGISTER, GFP_KERNEL); - EBT_ENTRY_ITERATE(table->private->entries, table->private->entries_size, - ebt_cleanup_entry, net, NULL); - if (table->private->nentries) -@@ -1270,13 +1266,15 @@ int ebt_register_table(struct net *net, const struct ebt_table *input_table, - for (i = 0; i < num_ops; i++) - ops[i].priv = table; - -- list_add(&table->list, &ebt_net->tables); -- mutex_unlock(&ebt_mutex); -- - table->ops = ops; - ret = nf_register_net_hooks(net, ops, num_ops); -- if (ret) -+ if (ret) { -+ synchronize_rcu(); - __ebt_unregister_table(net, table); -+ } else { -+ list_add(&table->list, &ebt_net->tables); -+ } -+ mutex_unlock(&ebt_mutex); - - audit_log_nfcfg(repl->name, AF_BRIDGE, repl->nentries, - AUDIT_XT_OP_REGISTER, GFP_KERNEL); -@@ -1342,7 +1340,7 @@ void ebt_unregister_template(const struct ebt_table *t) - } - EXPORT_SYMBOL(ebt_unregister_template); - --static struct ebt_table *__ebt_find_table(struct net *net, const char *name) -+void ebt_unregister_table_pre_exit(struct net *net, const char *name) - { - struct ebt_pernet *ebt_net = net_generic(net, ebt_pernet_id); - struct ebt_table *t; -@@ -1351,30 +1349,36 @@ static struct ebt_table *__ebt_find_table(struct net *net, const char *name) - - list_for_each_entry(t, &ebt_net->tables, list) { - if (strcmp(t->name, name) == 0) { -+ list_move(&t->list, &ebt_net->dead_tables); - mutex_unlock(&ebt_mutex); -- return t; -+ nf_unregister_net_hooks(net, t->ops, hweight32(t->valid_hooks)); -+ return; - } - } - - mutex_unlock(&ebt_mutex); -- return NULL; --} -- --void ebt_unregister_table_pre_exit(struct net *net, const char *name) --{ -- struct ebt_table *table = __ebt_find_table(net, name); -- -- if (table) -- nf_unregister_net_hooks(net, table->ops, hweight32(table->valid_hooks)); - } - EXPORT_SYMBOL(ebt_unregister_table_pre_exit); - - void ebt_unregister_table(struct net *net, const char *name) - { -- struct ebt_table *table = __ebt_find_table(net, name); -+ struct ebt_pernet *ebt_net = net_generic(net, ebt_pernet_id); -+ struct ebt_table *t; - -- if (table) -- __ebt_unregister_table(net, table); -+ mutex_lock(&ebt_mutex); -+ -+ list_for_each_entry(t, &ebt_net->dead_tables, list) { -+ if (strcmp(t->name, name) == 0) { -+ list_del(&t->list); -+ audit_log_nfcfg(t->name, AF_BRIDGE, t->private->nentries, -+ AUDIT_XT_OP_UNREGISTER, GFP_KERNEL); -+ __ebt_unregister_table(net, t); -+ mutex_unlock(&ebt_mutex); -+ return; -+ } -+ } -+ -+ mutex_unlock(&ebt_mutex); - } - - /* userspace just supplied us with counters */ -@@ -2595,11 +2599,21 @@ static int __net_init ebt_pernet_init(struct net *net) - struct ebt_pernet *ebt_net = net_generic(net, ebt_pernet_id); - - INIT_LIST_HEAD(&ebt_net->tables); -+ INIT_LIST_HEAD(&ebt_net->dead_tables); - return 0; - } - -+static void __net_exit ebt_pernet_exit(struct net *net) -+{ -+ struct ebt_pernet *ebt_net = net_generic(net, ebt_pernet_id); -+ -+ WARN_ON_ONCE(!list_empty(&ebt_net->tables)); -+ WARN_ON_ONCE(!list_empty(&ebt_net->dead_tables)); -+} -+ - static struct pernet_operations ebt_net_ops = { - .init = ebt_pernet_init, -+ .exit = ebt_pernet_exit, - .id = &ebt_pernet_id, - .size = sizeof(struct ebt_pernet), - }; --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-netfilter-nf_tables-use-list_del_rcu-for-netlink-hoo.patch b/SPECS/91/linux/CVE/0001-netfilter-nf_tables-use-list_del_rcu-for-netlink-hoo.patch deleted file mode 100644 index d10c3c4576..0000000000 --- a/SPECS/91/linux/CVE/0001-netfilter-nf_tables-use-list_del_rcu-for-netlink-hoo.patch +++ /dev/null @@ -1,53 +0,0 @@ -From aa27005b049c14fa642436aae8c5d12f37062dfc Mon Sep 17 00:00:00 2001 -From: Florian Westphal -Date: Thu, 16 Apr 2026 15:14:51 +0200 -Subject: [PATCH] netfilter: nf_tables: use list_del_rcu for netlink hooks - -[ Upstream commit f3224ee463f8f6f6ced7dcdf6081add4f8128527 ] - -nft_netdev_unregister_hooks and __nft_unregister_flowtable_net_hooks need -to use list_del_rcu(), this list can be walked by concurrent dumpers. - -Add a new helper and use it consistently. - -Fixes: f9a43007d3f7 ("netfilter: nf_tables: double hook unregistration in netns path") -Signed-off-by: Florian Westphal -Signed-off-by: Pablo Neira Ayuso -[Srinidhi: back-ported this CVE fix to v6.12.y. The original upstream fix was -based on unrelated ~20-commit "wildcard netdev hook specs" feature series -(hook->ops becoming hook->ops_list, new helper consolidation, netdev notifier -wrapping, etc.) not present in v6.12.y. That series is not required to close -this bug: the vulnerable list_del() calls are unchanged since commit f9a43007d3f7 -which introduced the vulnerability. and every other function upstream touches -was either already list_del_rcu-safe here or is a stack-local list that doesn't -need it. This applies only the two-line fix to the two affected functions] -Signed-off-by: Srinidhi Rao ---- - net/netfilter/nf_tables_api.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c -index 551b6fc1f891..5b297c6f23bf 100644 ---- a/net/netfilter/nf_tables_api.c -+++ b/net/netfilter/nf_tables_api.c -@@ -350,7 +350,7 @@ static void nft_netdev_unregister_hooks(struct net *net, - list_for_each_entry_safe(hook, next, hook_list, list) { - nf_unregister_net_hook(net, &hook->ops); - if (release_netdev) { -- list_del(&hook->list); -+ list_del_rcu(&hook->list); - kfree_rcu(hook, rcu); - } - } -@@ -8474,7 +8474,7 @@ static void __nft_unregister_flowtable_net_hooks(struct net *net, - flowtable->data.type->setup(&flowtable->data, hook->ops.dev, - FLOW_BLOCK_UNBIND); - if (release_netdev) { -- list_del(&hook->list); -+ list_del_rcu(&hook->list); - kfree_rcu(hook, rcu); - } - } --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-netfilter-x_tables-add-and-use-xt_unregister_table_p.patch b/SPECS/91/linux/CVE/0001-netfilter-x_tables-add-and-use-xt_unregister_table_p.patch deleted file mode 100644 index 8822aeadfb..0000000000 --- a/SPECS/91/linux/CVE/0001-netfilter-x_tables-add-and-use-xt_unregister_table_p.patch +++ /dev/null @@ -1,349 +0,0 @@ -From 7b2936b72005dae2ead3f91db8f9c7cdbb8a8f8d Mon Sep 17 00:00:00 2001 -From: Florian Westphal -Date: Wed, 6 May 2026 12:07:15 +0200 -Subject: [PATCH 1/2] netfilter: x_tables: add and use - xt_unregister_table_pre_exit - -[ Upstream commit 527d6931473b75d90e38942aae6537d1a527f1fd ] - -Remove the copypasted variants of _pre_exit and add one single -function in the xtables core. ebtables is not compatible with -x_tables and therefore unchanged. - -This is a preparation patch to reduce noise in the followup -bug fixes. - -Reviewed-by: Tristan Madani -Signed-off-by: Florian Westphal -Signed-off-by: Pablo Neira Ayuso -Stable-dep-of: b4597d5fd7d2 ("netfilter: x_tables: add and use xtables_unregister_table_exit") -Signed-off-by: Sasha Levin -Signed-off-by: Brennan Lamoreaux ---- - include/linux/netfilter/x_tables.h | 1 + - include/linux/netfilter_arp/arp_tables.h | 1 - - include/linux/netfilter_ipv4/ip_tables.h | 1 - - include/linux/netfilter_ipv6/ip6_tables.h | 1 - - net/ipv4/netfilter/arp_tables.c | 9 ------- - net/ipv4/netfilter/arptable_filter.c | 2 +- - net/ipv4/netfilter/ip_tables.c | 9 ------- - net/ipv4/netfilter/iptable_filter.c | 2 +- - net/ipv4/netfilter/iptable_mangle.c | 2 +- - net/ipv4/netfilter/iptable_nat.c | 1 + - net/ipv4/netfilter/iptable_raw.c | 2 +- - net/ipv4/netfilter/iptable_security.c | 2 +- - net/ipv6/netfilter/ip6_tables.c | 9 ------- - net/ipv6/netfilter/ip6table_filter.c | 2 +- - net/ipv6/netfilter/ip6table_mangle.c | 2 +- - net/ipv6/netfilter/ip6table_nat.c | 1 + - net/ipv6/netfilter/ip6table_raw.c | 2 +- - net/ipv6/netfilter/ip6table_security.c | 2 +- - net/netfilter/x_tables.c | 29 +++++++++++++++++++++++ - 19 files changed, 41 insertions(+), 39 deletions(-) - -diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h -index 5897f3dbaf7c..df2022fe440b 100644 ---- a/include/linux/netfilter/x_tables.h -+++ b/include/linux/netfilter/x_tables.h -@@ -310,6 +310,7 @@ struct xt_table *xt_register_table(struct net *net, - struct xt_table_info *bootstrap, - struct xt_table_info *newinfo); - void *xt_unregister_table(struct xt_table *table); -+void xt_unregister_table_pre_exit(struct net *net, u8 af, const char *name); - - struct xt_table_info *xt_replace_table(struct xt_table *table, - unsigned int num_counters, -diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h -index a40aaf645fa4..05631a25e622 100644 ---- a/include/linux/netfilter_arp/arp_tables.h -+++ b/include/linux/netfilter_arp/arp_tables.h -@@ -53,7 +53,6 @@ int arpt_register_table(struct net *net, const struct xt_table *table, - const struct arpt_replace *repl, - const struct nf_hook_ops *ops); - void arpt_unregister_table(struct net *net, const char *name); --void arpt_unregister_table_pre_exit(struct net *net, const char *name); - extern unsigned int arpt_do_table(void *priv, struct sk_buff *skb, - const struct nf_hook_state *state); - -diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h -index 132b0e4a6d4d..13593391d605 100644 ---- a/include/linux/netfilter_ipv4/ip_tables.h -+++ b/include/linux/netfilter_ipv4/ip_tables.h -@@ -26,7 +26,6 @@ int ipt_register_table(struct net *net, const struct xt_table *table, - const struct ipt_replace *repl, - const struct nf_hook_ops *ops); - --void ipt_unregister_table_pre_exit(struct net *net, const char *name); - void ipt_unregister_table_exit(struct net *net, const char *name); - - /* Standard entry. */ -diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h -index 8b8885a73c76..c6d5b927830d 100644 ---- a/include/linux/netfilter_ipv6/ip6_tables.h -+++ b/include/linux/netfilter_ipv6/ip6_tables.h -@@ -27,7 +27,6 @@ extern void *ip6t_alloc_initial_table(const struct xt_table *); - int ip6t_register_table(struct net *net, const struct xt_table *table, - const struct ip6t_replace *repl, - const struct nf_hook_ops *ops); --void ip6t_unregister_table_pre_exit(struct net *net, const char *name); - void ip6t_unregister_table_exit(struct net *net, const char *name); - extern unsigned int ip6t_do_table(void *priv, struct sk_buff *skb, - const struct nf_hook_state *state); -diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c -index b752c9eac998..46b4a91049ef 100644 ---- a/net/ipv4/netfilter/arp_tables.c -+++ b/net/ipv4/netfilter/arp_tables.c -@@ -1578,15 +1578,6 @@ int arpt_register_table(struct net *net, - return ret; - } - --void arpt_unregister_table_pre_exit(struct net *net, const char *name) --{ -- struct xt_table *table = xt_find_table(net, NFPROTO_ARP, name); -- -- if (table) -- nf_unregister_net_hooks(net, table->ops, hweight32(table->valid_hooks)); --} --EXPORT_SYMBOL(arpt_unregister_table_pre_exit); -- - void arpt_unregister_table(struct net *net, const char *name) - { - struct xt_table *table = xt_find_table(net, NFPROTO_ARP, name); -diff --git a/net/ipv4/netfilter/arptable_filter.c b/net/ipv4/netfilter/arptable_filter.c -index 359d00d74095..382345567a60 100644 ---- a/net/ipv4/netfilter/arptable_filter.c -+++ b/net/ipv4/netfilter/arptable_filter.c -@@ -43,7 +43,7 @@ static int arptable_filter_table_init(struct net *net) - - static void __net_exit arptable_filter_net_pre_exit(struct net *net) - { -- arpt_unregister_table_pre_exit(net, "filter"); -+ xt_unregister_table_pre_exit(net, NFPROTO_ARP, "filter"); - } - - static void __net_exit arptable_filter_net_exit(struct net *net) -diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c -index 0ba456c4c634..5c36daa2c4e2 100644 ---- a/net/ipv4/netfilter/ip_tables.c -+++ b/net/ipv4/netfilter/ip_tables.c -@@ -1786,14 +1786,6 @@ int ipt_register_table(struct net *net, const struct xt_table *table, - return ret; - } - --void ipt_unregister_table_pre_exit(struct net *net, const char *name) --{ -- struct xt_table *table = xt_find_table(net, NFPROTO_IPV4, name); -- -- if (table) -- nf_unregister_net_hooks(net, table->ops, hweight32(table->valid_hooks)); --} -- - void ipt_unregister_table_exit(struct net *net, const char *name) - { - struct xt_table *table = xt_find_table(net, NFPROTO_IPV4, name); -@@ -1884,7 +1876,6 @@ static void __exit ip_tables_fini(void) - } - - EXPORT_SYMBOL(ipt_register_table); --EXPORT_SYMBOL(ipt_unregister_table_pre_exit); - EXPORT_SYMBOL(ipt_unregister_table_exit); - EXPORT_SYMBOL(ipt_do_table); - module_init(ip_tables_init); -diff --git a/net/ipv4/netfilter/iptable_filter.c b/net/ipv4/netfilter/iptable_filter.c -index 595bfb492b1c..0dea754a9120 100644 ---- a/net/ipv4/netfilter/iptable_filter.c -+++ b/net/ipv4/netfilter/iptable_filter.c -@@ -61,7 +61,7 @@ static int __net_init iptable_filter_net_init(struct net *net) - - static void __net_exit iptable_filter_net_pre_exit(struct net *net) - { -- ipt_unregister_table_pre_exit(net, "filter"); -+ xt_unregister_table_pre_exit(net, NFPROTO_IPV4, "filter"); - } - - static void __net_exit iptable_filter_net_exit(struct net *net) -diff --git a/net/ipv4/netfilter/iptable_mangle.c b/net/ipv4/netfilter/iptable_mangle.c -index db90db7057cc..4d3b12492308 100644 ---- a/net/ipv4/netfilter/iptable_mangle.c -+++ b/net/ipv4/netfilter/iptable_mangle.c -@@ -96,7 +96,7 @@ static int iptable_mangle_table_init(struct net *net) - - static void __net_exit iptable_mangle_net_pre_exit(struct net *net) - { -- ipt_unregister_table_pre_exit(net, "mangle"); -+ xt_unregister_table_pre_exit(net, NFPROTO_IPV4, "mangle"); - } - - static void __net_exit iptable_mangle_net_exit(struct net *net) -diff --git a/net/ipv4/netfilter/iptable_nat.c b/net/ipv4/netfilter/iptable_nat.c -index a5db7c67d61b..d6c5824943f8 100644 ---- a/net/ipv4/netfilter/iptable_nat.c -+++ b/net/ipv4/netfilter/iptable_nat.c -@@ -129,6 +129,7 @@ static int iptable_nat_table_init(struct net *net) - static void __net_exit iptable_nat_net_pre_exit(struct net *net) - { - ipt_nat_unregister_lookups(net); -+ xt_unregister_table_pre_exit(net, NFPROTO_IPV4, "nat"); - } - - static void __net_exit iptable_nat_net_exit(struct net *net) -diff --git a/net/ipv4/netfilter/iptable_raw.c b/net/ipv4/netfilter/iptable_raw.c -index b46a79091730..6f7afec7954b 100644 ---- a/net/ipv4/netfilter/iptable_raw.c -+++ b/net/ipv4/netfilter/iptable_raw.c -@@ -53,7 +53,7 @@ static int iptable_raw_table_init(struct net *net) - - static void __net_exit iptable_raw_net_pre_exit(struct net *net) - { -- ipt_unregister_table_pre_exit(net, "raw"); -+ xt_unregister_table_pre_exit(net, NFPROTO_IPV4, "raw"); - } - - static void __net_exit iptable_raw_net_exit(struct net *net) -diff --git a/net/ipv4/netfilter/iptable_security.c b/net/ipv4/netfilter/iptable_security.c -index 2b89adc1e575..81175c20ccbe 100644 ---- a/net/ipv4/netfilter/iptable_security.c -+++ b/net/ipv4/netfilter/iptable_security.c -@@ -50,7 +50,7 @@ static int iptable_security_table_init(struct net *net) - - static void __net_exit iptable_security_net_pre_exit(struct net *net) - { -- ipt_unregister_table_pre_exit(net, "security"); -+ xt_unregister_table_pre_exit(net, NFPROTO_IPV4, "security"); - } - - static void __net_exit iptable_security_net_exit(struct net *net) -diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c -index 6c5022242cf0..e6b8f70d205d 100644 ---- a/net/ipv6/netfilter/ip6_tables.c -+++ b/net/ipv6/netfilter/ip6_tables.c -@@ -1792,14 +1792,6 @@ int ip6t_register_table(struct net *net, const struct xt_table *table, - return ret; - } - --void ip6t_unregister_table_pre_exit(struct net *net, const char *name) --{ -- struct xt_table *table = xt_find_table(net, NFPROTO_IPV6, name); -- -- if (table) -- nf_unregister_net_hooks(net, table->ops, hweight32(table->valid_hooks)); --} -- - void ip6t_unregister_table_exit(struct net *net, const char *name) - { - struct xt_table *table = xt_find_table(net, NFPROTO_IPV6, name); -@@ -1891,7 +1883,6 @@ static void __exit ip6_tables_fini(void) - } - - EXPORT_SYMBOL(ip6t_register_table); --EXPORT_SYMBOL(ip6t_unregister_table_pre_exit); - EXPORT_SYMBOL(ip6t_unregister_table_exit); - EXPORT_SYMBOL(ip6t_do_table); - -diff --git a/net/ipv6/netfilter/ip6table_filter.c b/net/ipv6/netfilter/ip6table_filter.c -index 9dcd4501fe80..cf561919bde8 100644 ---- a/net/ipv6/netfilter/ip6table_filter.c -+++ b/net/ipv6/netfilter/ip6table_filter.c -@@ -60,7 +60,7 @@ static int __net_init ip6table_filter_net_init(struct net *net) - - static void __net_exit ip6table_filter_net_pre_exit(struct net *net) - { -- ip6t_unregister_table_pre_exit(net, "filter"); -+ xt_unregister_table_pre_exit(net, NFPROTO_IPV6, "filter"); - } - - static void __net_exit ip6table_filter_net_exit(struct net *net) -diff --git a/net/ipv6/netfilter/ip6table_mangle.c b/net/ipv6/netfilter/ip6table_mangle.c -index ce2cbce9e3ed..1a758f2bc537 100644 ---- a/net/ipv6/netfilter/ip6table_mangle.c -+++ b/net/ipv6/netfilter/ip6table_mangle.c -@@ -89,7 +89,7 @@ static int ip6table_mangle_table_init(struct net *net) - - static void __net_exit ip6table_mangle_net_pre_exit(struct net *net) - { -- ip6t_unregister_table_pre_exit(net, "mangle"); -+ xt_unregister_table_pre_exit(net, NFPROTO_IPV6, "mangle"); - } - - static void __net_exit ip6table_mangle_net_exit(struct net *net) -diff --git a/net/ipv6/netfilter/ip6table_nat.c b/net/ipv6/netfilter/ip6table_nat.c -index e119d4f090cc..4ce45f3d1110 100644 ---- a/net/ipv6/netfilter/ip6table_nat.c -+++ b/net/ipv6/netfilter/ip6table_nat.c -@@ -131,6 +131,7 @@ static int ip6table_nat_table_init(struct net *net) - static void __net_exit ip6table_nat_net_pre_exit(struct net *net) - { - ip6t_nat_unregister_lookups(net); -+ xt_unregister_table_pre_exit(net, NFPROTO_IPV6, "nat"); - } - - static void __net_exit ip6table_nat_net_exit(struct net *net) -diff --git a/net/ipv6/netfilter/ip6table_raw.c b/net/ipv6/netfilter/ip6table_raw.c -index 8af0f8bd036d..923455921c1d 100644 ---- a/net/ipv6/netfilter/ip6table_raw.c -+++ b/net/ipv6/netfilter/ip6table_raw.c -@@ -52,7 +52,7 @@ static int ip6table_raw_table_init(struct net *net) - - static void __net_exit ip6table_raw_net_pre_exit(struct net *net) - { -- ip6t_unregister_table_pre_exit(net, "raw"); -+ xt_unregister_table_pre_exit(net, NFPROTO_IPV6, "raw"); - } - - static void __net_exit ip6table_raw_net_exit(struct net *net) -diff --git a/net/ipv6/netfilter/ip6table_security.c b/net/ipv6/netfilter/ip6table_security.c -index 66018b169b01..c44834d93fc7 100644 ---- a/net/ipv6/netfilter/ip6table_security.c -+++ b/net/ipv6/netfilter/ip6table_security.c -@@ -49,7 +49,7 @@ static int ip6table_security_table_init(struct net *net) - - static void __net_exit ip6table_security_net_pre_exit(struct net *net) - { -- ip6t_unregister_table_pre_exit(net, "security"); -+ xt_unregister_table_pre_exit(net, NFPROTO_IPV6, "security"); - } - - static void __net_exit ip6table_security_net_exit(struct net *net) -diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c -index efe7b7d71e7f..39142f395c1d 100644 ---- a/net/netfilter/x_tables.c -+++ b/net/netfilter/x_tables.c -@@ -1538,6 +1538,35 @@ void *xt_unregister_table(struct xt_table *table) - } - EXPORT_SYMBOL_GPL(xt_unregister_table); - -+/** -+ * xt_unregister_table_pre_exit - pre-shutdown unregister of a table -+ * @net: network namespace -+ * @af: address family (e.g., NFPROTO_IPV4, NFPROTO_IPV6) -+ * @name: name of the table to unregister -+ * -+ * Unregisters the specified netfilter table from the given network namespace -+ * and also unregisters the hooks from netfilter core: no new packets will be -+ * processed. -+ */ -+void xt_unregister_table_pre_exit(struct net *net, u8 af, const char *name) -+{ -+ struct xt_pernet *xt_net = net_generic(net, xt_pernet_id); -+ struct xt_table *t; -+ -+ mutex_lock(&xt[af].mutex); -+ list_for_each_entry(t, &xt_net->tables[af], list) { -+ if (strcmp(t->name, name) == 0) { -+ mutex_unlock(&xt[af].mutex); -+ -+ if (t->ops) /* nat table registers with nat core, t->ops is NULL. */ -+ nf_unregister_net_hooks(net, t->ops, hweight32(t->valid_hooks)); -+ return; -+ } -+ } -+ mutex_unlock(&xt[af].mutex); -+} -+EXPORT_SYMBOL(xt_unregister_table_pre_exit); -+ - #ifdef CONFIG_PROC_FS - static void *xt_table_seq_start(struct seq_file *seq, loff_t *pos) - { --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-netfs-Fix-barriering-when-walking-subrequest-list.patch b/SPECS/91/linux/CVE/0001-netfs-Fix-barriering-when-walking-subrequest-list.patch deleted file mode 100644 index dc65a84eca..0000000000 --- a/SPECS/91/linux/CVE/0001-netfs-Fix-barriering-when-walking-subrequest-list.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 5c6ce05e406520290c1d89da97fb3cd70c09137d Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Thu, 2 Jul 2026 09:23:02 +0100 -Subject: [PATCH] netfs: Fix barriering when walking subrequest list - -commit 5c6ce05e406520290c1d89da97fb3cd70c09137d upstream. - -Fix the barriering used when walking the subrequest list in retry as -there's a possibility of seeing a subreq that's just been added by the -application thread. - -Fixes: ee4cdf7ba857 ("netfs: Speed up buffered reading") -Fixes: 288ace2f57c9 ("netfs: New writeback implementation") -Link: https://sashiko.dev/#/patchset/20260608145432.681865-1-dhowells%40redhat.com -Signed-off-by: David Howells -Link: https://patch.msgid.link/138807.1782980582@warthog.procyon.org.uk -Reviewed-by: Paulo Alcantara (Red Hat) -cc: Paulo Alcantara -cc: netfs@lists.linux.dev -cc: linux-fsdevel@vger.kernel.org -Signed-off-by: Christian Brauner (Amutable) -[ Brennan: write side only, ported to write_collect.c (write_retry.c - doesn't exist yet); read side's retry has no concurrent writer to - race (each rreq has one issuer, gated by nr_outstanding), so no - barrier is needed there ] -Signed-off-by: Brennan Lamoreaux ---- - fs/netfs/write_collect.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/fs/netfs/write_collect.c b/fs/netfs/write_collect.c -index 32735abfa03f..058bc7a166a5 100644 ---- a/fs/netfs/write_collect.c -+++ b/fs/netfs/write_collect.c -@@ -210,7 +210,12 @@ static void netfs_retry_write_stream(struct netfs_io_request *wreq, - !test_bit(NETFS_SREQ_NEED_RETRY, &from->flags)) - return; - -- list_for_each_continue(next, &stream->subrequests) { -+ for (;;) { -+ /* Read pointer to subreq before reading subreq state. */ -+ next = smp_load_acquire(&next->next); -+ if (next == &stream->subrequests) -+ break; -+ - subreq = list_entry(next, struct netfs_io_subrequest, rreq_link); - if (subreq->start + subreq->transferred != start + len || - test_bit(NETFS_SREQ_BOUNDARY, &subreq->flags) || diff --git a/SPECS/91/linux/CVE/0001-netfs-Fix-missing-barriers-when-accessing-stream-sub.patch b/SPECS/91/linux/CVE/0001-netfs-Fix-missing-barriers-when-accessing-stream-sub.patch deleted file mode 100644 index 5f19350211..0000000000 --- a/SPECS/91/linux/CVE/0001-netfs-Fix-missing-barriers-when-accessing-stream-sub.patch +++ /dev/null @@ -1,119 +0,0 @@ -From b5782e2d462c028096f922abca46318cec890670 Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Tue, 12 May 2026 13:33:40 +0100 -Subject: [PATCH] netfs: Fix missing barriers when accessing - stream->subrequests locklessly - -[ Upstream commit b5782e2d462c028096f922abca46318cec890670 ] - -The list of subrequests attached to stream->subrequests is accessed -without locks by netfs_collect_write_results(), and then it accesses -subreq->flags without taking a barrier after getting the subreq -pointer from the list. Relatedly, netfs_prepare_write() does not -use any sort of write barrier when constructing the list to make -sure that the NETFS_SREQ_IN_PROGRESS flag is perceived to be set -first if no lock is taken. - -Fix this by: - - (1) Add a new list_add_tail_release() function that uses a release - barrier to set the pointer to the new member of the list. - - (2) Add a new list_first_entry_or_null_acquire() function that uses - an acquire barrier to read the pointer to the first member in a - list (or return NULL). - - (3) Use list_add_tail_release() in netfs_prepare_write() when adding - a subreq to stream->subrequests, ensuring the IN_PROGRESS flag - store is ordered before the list pointer becomes visible. - - -Fixes: 288ace2f57c9 ("netfs: New writeback implementation") -Link: https://sashiko.dev/#/patchset/20260326104544.509518-1-dhowells%40redhat.com -Signed-off-by: David Howells -Link: https://patch.msgid.link/20260512123404.719402-4-dhowells@redhat.com -cc: Paulo Alcantara -cc: netfs@lists.linux.dev -cc: linux-fsdevel@vger.kernel.org -Signed-off-by: Christian Brauner -[Guru: In 6.12.y the write collector uses stream->front (protected by -smp_load_acquire(&stream->active)) for its initial lockless access, -so write_collect.c does not need changes. The read path uses -rreq->subrequests under rreq->lock and is unaffected. Only the -write-issue list_add_tail_release change and the new list.h helpers -are applicable to 6.12.y.] -Signed-off-by: Guruswamy Basavaiah ---- - fs/netfs/write_issue.c | 3 ++- - include/linux/list.h | 43 +++++++++++++++++++++++++++++++++++++++ - 2 files changed, 45 insertions(+), 1 deletion(-) - -diff --git a/include/linux/list.h b/include/linux/list.h ---- a/include/linux/list.h -+++ b/include/linux/list.h -@@ -183,6 +183,29 @@ - __list_add(new, head->prev, head); - } - -+/** -+ * list_add_tail_release - add a new entry with release barrier -+ * @new: new entry to be added -+ * @head: list head to add it before -+ * -+ * Insert a new entry before the specified head, using a release barrier to set -+ * the ->next pointer that points to it. This is useful for implementing -+ * queues, in particular one that the elements will be walked through forwards -+ * locklessly. -+ */ -+static inline void list_add_tail_release(struct list_head *new, -+ struct list_head *head) -+{ -+ struct list_head *prev = head->prev; -+ -+ if (__list_add_valid(new, prev, head)) { -+ new->next = head; -+ new->prev = prev; -+ head->prev = new; -+ smp_store_release(&prev->next, new); -+ } -+} -+ - /* - * Delete a list entry by making the prev/next entries - * point to each other. -@@ -636,6 +659,20 @@ - pos__ != head__ ? list_entry(pos__, type, member) : NULL; \ - }) - -+/** -+ * list_first_entry_or_null_acquire - get the first element from a list with barrier -+ * @ptr: the list head to take the element from. -+ * @type: the type of the struct this is embedded in. -+ * @member: the name of the list_head within the struct. -+ * -+ * Note that if the list is empty, it returns NULL. -+ */ -+#define list_first_entry_or_null_acquire(ptr, type, member) ({ \ -+ struct list_head *head__ = (ptr); \ -+ struct list_head *pos__ = smp_load_acquire(&head__->next); \ -+ pos__ != head__ ? list_entry(pos__, type, member) : NULL; \ -+}) -+ - /** - * list_next_entry - get the next element in list - * @pos: the type * to cursor -diff --git a/fs/netfs/write_issue.c b/fs/netfs/write_issue.c ---- a/fs/netfs/write_issue.c -+++ b/fs/netfs/write_issue.c -@@ -199,7 +199,8 @@ - * remove entries off of the front. - */ - spin_lock_bh(&wreq->lock); -- list_add_tail(&subreq->rreq_link, &stream->subrequests); -+ /* Write IN_PROGRESS before pointer to new subreq */ -+ list_add_tail_release(&subreq->rreq_link, &stream->subrequests); - if (list_is_first(&subreq->rreq_link, &stream->subrequests)) { - stream->front = subreq; - if (!stream->active) { --- -2.39.0 diff --git a/SPECS/91/linux/CVE/0001-netfs-Fix-missing-locking-around-retry-adding-new-su.patch b/SPECS/91/linux/CVE/0001-netfs-Fix-missing-locking-around-retry-adding-new-su.patch deleted file mode 100644 index abc3055950..0000000000 --- a/SPECS/91/linux/CVE/0001-netfs-Fix-missing-locking-around-retry-adding-new-su.patch +++ /dev/null @@ -1,69 +0,0 @@ -From cce18c263e9623872327ba3c956012f73c1179cc Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Tue, 12 May 2026 13:33:39 +0100 -Subject: [PATCH] netfs: Fix missing locking around retry adding new subreqs - -[ Upstream commit cce18c263e9623872327ba3c956012f73c1179cc ] - -Fix netfs_retry_write_stream() to take the appropriate lock when -discarding excess subrequests from stream->subrequests and when -inserting newly allocated subrequests into stream->subrequests -during a write retry. - -Without the lock, the write collection worker running concurrently -can walk stream->subrequests via list_next_entry() while these -unprotected list_del()/list_add() calls modify the list, causing -list corruption. - -Also fix the 'to' cursor update: after inserting a new subreq with -list_add(&subreq->rreq_link, &to->rreq_link), 'to' must advance to -the newly inserted subreq (= subreq), not to the entry that was -already next in the list (list_next_entry(to, ...)). - -Note: In 6.12.y write_retry.c does not exist yet; the equivalent -retry logic lives in write_collect.c::netfs_retry_write_stream(). -The read retry path in read_retry.c already holds rreq->lock around -all modifications to rreq->subrequests and is not affected. - -Fixes: 288ace2f57c9 ("netfs: New writeback implementation") -Closes: https://sashiko.dev/#/patchset/20260425125426.3855807-1-dhowells%40redhat.com -Signed-off-by: David Howells -Link: https://patch.msgid.link/20260512123404.719402-3-dhowells@redhat.com -cc: Paulo Alcantara -cc: netfs@lists.linux.dev -cc: linux-fsdevel@vger.kernel.org -Signed-off-by: Christian Brauner -[Guru: write part of the code is not present in 6.12, - hence not ported ] -Signed-off-by: Guruswamy Basavaiah ---- - fs/netfs/write_collect.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/fs/netfs/write_collect.c b/fs/netfs/write_collect.c ---- a/fs/netfs/write_collect.c -+++ b/fs/netfs/write_collect.c -@@ -263,7 +263,9 @@ - list_for_each_entry_safe_from(subreq, tmp, - &stream->subrequests, rreq_link) { - trace_netfs_sreq(subreq, netfs_sreq_trace_discard); -+ spin_lock_bh(&wreq->lock); - list_del(&subreq->rreq_link); -+ spin_unlock_bh(&wreq->lock); - netfs_put_subrequest(subreq, false, netfs_sreq_trace_put_done); - if (subreq == to) - break; -@@ -287,8 +289,10 @@ - netfs_sreq_trace_new); - trace_netfs_sreq(subreq, netfs_sreq_trace_split); - -+ spin_lock_bh(&wreq->lock); - list_add(&subreq->rreq_link, &to->rreq_link); -- to = list_next_entry(to, rreq_link); -+ spin_unlock_bh(&wreq->lock); -+ to = subreq; - trace_netfs_sreq(subreq, netfs_sreq_trace_retry); - - stream->sreq_max_len = len; --- -2.39.0 diff --git a/SPECS/91/linux/CVE/0001-netfs-Fix-netfs_create_write_req-to-handle-async-cac.patch b/SPECS/91/linux/CVE/0001-netfs-Fix-netfs_create_write_req-to-handle-async-cac.patch deleted file mode 100644 index df979282ec..0000000000 --- a/SPECS/91/linux/CVE/0001-netfs-Fix-netfs_create_write_req-to-handle-async-cac.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 8ab75e445c161c4cb504aa98e20ce1dd1ecd8e9a Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Thu, 25 Jun 2026 15:06:20 +0100 -Subject: [PATCH] netfs: Fix netfs_create_write_req() to handle async - cache object creation - -[ Upstream commit dbd6f56d975b23241b7bbb11bb8f562af548a0aa ] - -netfs_create_write_req() will skip caching if the fscache cookie is -disabled, but this is a problem because async cache object creation might -not have got far enough yet that has been enabled - thereby causing the -call to fscache_begin_write_operation() to be skipped. - -Fix this by removing the checks on the cookie and delegating this to -fscache_begin_write_operation(). - -Fixes: 7b589a9b45ae ("netfs: Fix handling of USE_PGPRIV2 and WRITE_TO_CACHE flags") -Signed-off-by: David Howells -Link: https://patch.msgid.link/20260625140640.3116900-3-dhowells@redhat.com -cc: Paulo Alcantara -cc: netfs@lists.linux.dev -cc: linux-fsdevel@vger.kernel.org -Signed-off-by: Christian Brauner - -[Ankit: Backported for v6.12.y.] -Signed-off-by: Ankit Jain ---- - fs/netfs/write_issue.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/fs/netfs/write_issue.c b/fs/netfs/write_issue.c -index 7431c0a4252c..c08c2487b311 100644 ---- a/fs/netfs/write_issue.c -+++ b/fs/netfs/write_issue.c -@@ -105,7 +105,7 @@ struct netfs_io_request *netfs_create_write_req(struct address_space *mapping, - _enter("R=%x", wreq->debug_id); - - ictx = netfs_inode(wreq->inode); -- if (is_buffered && netfs_is_cache_enabled(ictx)) -+ if (is_buffered) - fscache_begin_write_operation(&wreq->cache_resources, netfs_i_cookie(ictx)); - - wreq->cleaned_to = wreq->start; --- -2.53.0 diff --git a/SPECS/91/linux/CVE/0001-netfs-Fix-netfs_read_to_pagecache-to-pause-on-subreq.patch b/SPECS/91/linux/CVE/0001-netfs-Fix-netfs_read_to_pagecache-to-pause-on-subreq.patch deleted file mode 100644 index 59d67e33a9..0000000000 --- a/SPECS/91/linux/CVE/0001-netfs-Fix-netfs_read_to_pagecache-to-pause-on-subreq.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 8a8c0cfdf4658fc5b295b7fc87be56e0d76741f4 Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Tue, 12 May 2026 13:33:41 +0100 -Subject: [PATCH] netfs: Fix netfs_read_to_pagecache() to pause on subreq - failure - -[ Upstream commit 8a8c0cfdf4658fc5b295b7fc87be56e0d76741f4 ] - -Fix netfs_read_to_pagecache() so that it pauses the generation of new -subrequests if an already-issued subrequest fails. - -Note: In 6.12.y netfs_read_to_pagecache() does not use netfs_issue_read() -or netfs_wait_for_paused_read() (introduced later). The equivalent fix is -to add NETFS_RREQ_PAUSE/FAILED checks at the done: label before -cond_resched(), using wait_on_bit() directly as the write path does in -write_issue.c. - -Fixes: ee4cdf7ba857 ("netfs: Speed up buffered reading") -Signed-off-by: David Howells -Signed-off-by: Guruswamy Basavaiah ---- - fs/netfs/buffered_read.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/fs/netfs/buffered_read.c b/fs/netfs/buffered_read.c ---- a/fs/netfs/buffered_read.c -+++ b/fs/netfs/buffered_read.c -@@ -325,6 +325,10 @@ static void netfs_read_to_pagecache(struct netfs_io_request *rreq) - done: - size -= slice; - start += slice; -+ if (test_bit(NETFS_RREQ_PAUSE, &rreq->flags)) -+ wait_on_bit(&rreq->flags, NETFS_RREQ_PAUSE, TASK_UNINTERRUPTIBLE); -+ if (test_bit(NETFS_RREQ_FAILED, &rreq->flags)) -+ break; - cond_resched(); - } while (size > 0); - --- -2.39.0 diff --git a/SPECS/91/linux/CVE/0001-nouveau-gsp-drop-WARN_ON-in-ACPI-probes.patch b/SPECS/91/linux/CVE/0001-nouveau-gsp-drop-WARN_ON-in-ACPI-probes.patch deleted file mode 100644 index 7f27d130d3..0000000000 --- a/SPECS/91/linux/CVE/0001-nouveau-gsp-drop-WARN_ON-in-ACPI-probes.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 214b6bde0e941a34ba877cf2f26f85d62fb5d598 Mon Sep 17 00:00:00 2001 -From: Dave Airlie -Date: Thu, 21 Nov 2024 11:46:01 +1000 -Subject: nouveau/gsp: drop WARN_ON in ACPI probes - -commit 9478c166c46934160135e197b049b5a05753f2ad upstream. - -These WARN_ONs seem to trigger a lot, and we don't seem to have a -plan to fix them, so just drop them, as they are most likely -harmless. - -Cc: stable@vger.kernel.org -Fixes: 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM") -Signed-off-by: Dave Airlie -Link: https://patch.msgid.link/20241121014601.229391-1-airlied@gmail.com -Signed-off-by: Danilo Krummrich -Signed-off-by: Greg Kroah-Hartman -[Shivani: Backported for CVE-2026-43485. Modified to apply on 6.12.y. - This code still lives in nvkm/subdev/gsp/r535.c in the 6.12.y series - (upstream later split it out into nvkm/subdev/gsp/rm/r535/gsp.c), so - the fix is applied there instead. ] -Signed-off-by: Shivani Agarwal ---- - drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c -index 3ad4f6e9a..d1633f50e 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c -@@ -1469,8 +1469,8 @@ r535_gsp_acpi_caps(acpi_handle handle, CAPS_METHOD_DATA *caps) - if (!obj) - goto done; - -- if (WARN_ON(obj->type != ACPI_TYPE_BUFFER) || -- WARN_ON(obj->buffer.length != 4)) -+ if (obj->type != ACPI_TYPE_BUFFER || -+ obj->buffer.length != 4) - goto done; - - caps->status = 0; -@@ -1505,8 +1505,8 @@ r535_gsp_acpi_jt(acpi_handle handle, JT_METHOD_DATA *jt) - if (!obj) - goto done; - -- if (WARN_ON(obj->type != ACPI_TYPE_BUFFER) || -- WARN_ON(obj->buffer.length != 4)) -+ if (obj->type != ACPI_TYPE_BUFFER || -+ obj->buffer.length != 4) - goto done; - - jt->status = 0; -@@ -1593,8 +1593,8 @@ r535_gsp_acpi_dod(acpi_handle handle, DOD_METHOD_DATA *dod) - - _DOD = output.pointer; - -- if (WARN_ON(_DOD->type != ACPI_TYPE_PACKAGE) || -- WARN_ON(_DOD->package.count > ARRAY_SIZE(dod->acpiIdList))) -+ if (_DOD->type != ACPI_TYPE_PACKAGE || -+ _DOD->package.count > ARRAY_SIZE(dod->acpiIdList)) - return; - - for (int i = 0; i < _DOD->package.count; i++) { --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-scsi-qla2xxx-Clear-cmds-after-chip-reset.patch b/SPECS/91/linux/CVE/0001-scsi-qla2xxx-Clear-cmds-after-chip-reset.patch deleted file mode 100644 index 51ea7cca2d..0000000000 --- a/SPECS/91/linux/CVE/0001-scsi-qla2xxx-Clear-cmds-after-chip-reset.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 1fe9a94eb0a133a13e870f1bf1c83f8ab392e8fc Mon Sep 17 00:00:00 2001 -From: Tony Battersby -Date: Mon, 10 Nov 2025 11:07:37 -0500 -Subject: [PATCH] scsi: qla2xxx: Clear cmds after chip reset - -[ Upstream commit d46c69a087aa3d1513f7a78f871b80251ea0c1ae ] - -Commit aefed3e5548f ("scsi: qla2xxx: target: Fix offline port handling -and host reset handling") caused two problems: - -1. Commands sent to FW, after chip reset got stuck and never freed as FW - is not going to respond to them anymore. - -2. BUG_ON(cmd->sg_mapped) in qlt_free_cmd(). Commit 26f9ce53817a - ("scsi: qla2xxx: Fix missed DMA unmap for aborted commands") - attempted to fix this, but introduced another bug under different - circumstances when two different CPUs were racing to call - qlt_unmap_sg() at the same time: BUG_ON(!valid_dma_direction(dir)) in - dma_unmap_sg_attrs(). - -So revert "scsi: qla2xxx: Fix missed DMA unmap for aborted commands" and -partially revert "scsi: qla2xxx: target: Fix offline port handling and -host reset handling" at __qla2x00_abort_all_cmds. - -Fixes: aefed3e5548f ("scsi: qla2xxx: target: Fix offline port handling and host reset handling") -Fixes: 26f9ce53817a ("scsi: qla2xxx: Fix missed DMA unmap for aborted commands") -Co-developed-by: Dmitry Bogdanov -Signed-off-by: Dmitry Bogdanov -Signed-off-by: Tony Battersby -Link: https://patch.msgid.link/0e7e5d26-e7a0-42d1-8235-40eeb27f3e98@cybernetics.com -Signed-off-by: Martin K. Petersen -Signed-off-by: Sasha Levin -[ Applied patch to v6.12 by Gerrit Photon ] ---- - drivers/scsi/qla2xxx/qla_os.c | 20 ++++++++++++++++++-- - drivers/scsi/qla2xxx/qla_target.c | 5 +---- - drivers/scsi/qla2xxx/qla_target.h | 1 + - 4 files changed, 21 insertions(+), 7 deletions(-) - -diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c -index b8631698e..6f013b5db 100644 ---- a/drivers/scsi/qla2xxx/qla_os.c -+++ b/drivers/scsi/qla2xxx/qla_os.c -@@ -1888,10 +1888,26 @@ __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res) - continue; - } - cmd = (struct qla_tgt_cmd *)sp; -- cmd->aborted = 1; -+ -+ if (cmd->sg_mapped) -+ qlt_unmap_sg(vha, cmd); -+ -+ if (cmd->state == QLA_TGT_STATE_NEED_DATA) { -+ cmd->aborted = 1; -+ cmd->write_data_transferred = 0; -+ cmd->state = QLA_TGT_STATE_DATA_IN; -+ ha->tgt.tgt_ops->handle_data(cmd); -+ } else { -+ ha->tgt.tgt_ops->free_cmd(cmd); -+ } - break; - case TYPE_TGT_TMCMD: -- /* Skip task management functions. */ -+ /* -+ * Currently, only ABTS response gets on the -+ * outstanding_cmds[] -+ */ -+ ha->tgt.tgt_ops->free_mcmd( -+ (struct qla_tgt_mgmt_cmd *) sp); - break; - default: - break; -diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c -index 11eadb3bd..a1f913fb8 100644 ---- a/drivers/scsi/qla2xxx/qla_target.c -+++ b/drivers/scsi/qla2xxx/qla_target.c -@@ -2487,7 +2487,7 @@ static int qlt_pci_map_calc_cnt(struct qla_tgt_prm *prm) - return -1; - } - --static void qlt_unmap_sg(struct scsi_qla_host *vha, struct qla_tgt_cmd *cmd) -+void qlt_unmap_sg(struct scsi_qla_host *vha, struct qla_tgt_cmd *cmd) - { - struct qla_hw_data *ha; - struct qla_qpair *qpair; -@@ -3817,9 +3817,6 @@ int qlt_abort_cmd(struct qla_tgt_cmd *cmd) - - spin_lock_irqsave(&cmd->cmd_lock, flags); - if (cmd->aborted) { -- if (cmd->sg_mapped) -- qlt_unmap_sg(vha, cmd); -- - spin_unlock_irqrestore(&cmd->cmd_lock, flags); - /* - * It's normal to see 2 calls in this path: -diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h -index 354fca2e7..3644ab140 100644 ---- a/drivers/scsi/qla2xxx/qla_target.h -+++ b/drivers/scsi/qla2xxx/qla_target.h -@@ -1059,6 +1059,7 @@ extern int qlt_abort_cmd(struct qla_tgt_cmd *); - extern void qlt_xmit_tm_rsp(struct qla_tgt_mgmt_cmd *); - extern void qlt_free_mcmd(struct qla_tgt_mgmt_cmd *); - extern void qlt_free_cmd(struct qla_tgt_cmd *cmd); -+extern void qlt_unmap_sg(struct scsi_qla_host *vha, struct qla_tgt_cmd *cmd); - extern void qlt_async_event(uint16_t, struct scsi_qla_host *, uint16_t *); - extern void qlt_enable_vha(struct scsi_qla_host *); - extern void qlt_vport_create(struct scsi_qla_host *, struct qla_hw_data *); --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-sctp-validate-cached-peer-INIT-chunk-length-in-COOKI.patch b/SPECS/91/linux/CVE/0001-sctp-validate-cached-peer-INIT-chunk-length-in-COOKI.patch deleted file mode 100644 index 2b417c1fde..0000000000 --- a/SPECS/91/linux/CVE/0001-sctp-validate-cached-peer-INIT-chunk-length-in-COOKI.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 5a65a2606b2e010b411d184dc70c691a4c1bea9d Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Wed, 15 Jul 2026 11:39:45 +0000 -Subject: [PATCH] CVE-2026-53246: sctp: validate cached peer INIT chunk length in - COOKIE_ECHO processing - -From: Xin Long - -commit 0861615c28de668669d748ef4eb913ea9262d13b upstream. - -When a listening SCTP server processes a COOKIE_ECHO chunk, the cached -peer INIT chunk embedded after the cookie is parsed and its parameters -are later walked by sctp_process_init() using sctp_walk_params(). - -However, the chunk header length of this cached INIT chunk was not -validated against the remaining buffer in the COOKIE_ECHO payload. If -the length field is inflated, the parameter walk can run beyond the -actual received data, leading to out-of-bounds reads and potential -memory corruption during later parameter handling (e.g. STATE_COOKIE -processing and kmemdup() copies). - -Add a bounds check in sctp_unpack_cookie() to ensure the cached INIT -chunk length does not exceed the available data in the COOKIE_ECHO -buffer before it is used. - -Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") -Reported-by: Brian Geffon -Signed-off-by: Xin Long -Link: https://patch.msgid.link/eb60825fa22d6f9e663c7d4dbb69f397b5d34d42.1780362366.git.lucien.xin@gmail.com -Signed-off-by: Jakub Kicinski -[ Ajay Kaher: Modified to apply on v6.12 ] -Signed-off-by: Ajay Kaher ---- - net/sctp/sm_make_chunk.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c -index 96ca40012..0d6ecdcda 100644 ---- a/net/sctp/sm_make_chunk.c -+++ b/net/sctp/sm_make_chunk.c -@@ -1749,6 +1749,7 @@ struct sctp_association *sctp_unpack_cookie( - struct sctp_signed_cookie *cookie; - struct sk_buff *skb = chunk->skb; - struct sctp_cookie *bear_cookie; -+ struct sctp_chunkhdr *ch; - __u8 *digest = ep->digest; - enum sctp_scope scope; - unsigned int len; -@@ -1779,6 +1780,10 @@ struct sctp_association *sctp_unpack_cookie( - cookie = chunk->subh.cookie_hdr; - bear_cookie = &cookie->c; - -+ ch = (struct sctp_chunkhdr *)(bear_cookie + 1); -+ if (ntohs(ch->length) > len - fixed_size) -+ goto malformed; -+ - if (!sctp_sk(ep->base.sk)->hmac) - goto no_hmac; - --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0001-smb-client-fix-chown-chgrp-with-SMB3-POSIX-Extension.patch b/SPECS/91/linux/CVE/0001-smb-client-fix-chown-chgrp-with-SMB3-POSIX-Extension.patch deleted file mode 100644 index e788f4500c..0000000000 --- a/SPECS/91/linux/CVE/0001-smb-client-fix-chown-chgrp-with-SMB3-POSIX-Extension.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 760ef2c579c2609cf17fb1cd5392f64d42d43d33 Mon Sep 17 00:00:00 2001 -From: Ralph Boehme -Date: Sun, 7 Jun 2026 15:23:18 +0200 -Subject: smb/client: fix chown/chgrp with SMB3 POSIX Extensions - -[ Upstream commit 760ef2c579c2609cf17fb1cd5392f64d42d43d33 ] - -Ownership (chown) and group (chgrp) modifications were being ignored when -mounting with SMB3 POSIX Extensions unless CIFS_MOUNT_CIFS_ACL or -CIFS_MOUNT_MODE_FROM_SID were also explicitly set. - -Fix this by checking for posix_extensions in cifs_setattr_nounix() when -updating UID and GID, ensuring that id_mode_to_cifs_acl() is called to map -and set the ownership/group information on the server. - -Cc: stable@vger.kernel.org -Signed-off-by: Ralph Boehme -Signed-off-by: Steve French -[Shivani: Backported for CVE-2026-64388. Modified to apply on 6.12.y ] -Signed-off-by: Shivani Agarwal ---- - fs/smb/client/inode.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c -index 1111111..2222222 100644 ---- a/fs/smb/client/inode.c -+++ b/fs/smb/client/inode.c -@@ -3292,7 +3292,8 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) - gid = attrs->ia_gid; - - if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) || -- (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MODE_FROM_SID)) { -+ (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MODE_FROM_SID) || -+ cifs_sb_master_tcon(cifs_sb)->posix_extensions) { - if (uid_valid(uid) || gid_valid(gid)) { - mode = NO_CHANGE_64; - rc = id_mode_to_cifs_acl(inode, full_path, &mode, diff --git a/SPECS/91/linux/CVE/0001-tcp-fix-stale-per-CPU-tcp_tw_isn-leak-enabling-ISN-p.patch b/SPECS/91/linux/CVE/0001-tcp-fix-stale-per-CPU-tcp_tw_isn-leak-enabling-ISN-p.patch deleted file mode 100644 index 755fb5c1fb..0000000000 --- a/SPECS/91/linux/CVE/0001-tcp-fix-stale-per-CPU-tcp_tw_isn-leak-enabling-ISN-p.patch +++ /dev/null @@ -1,178 +0,0 @@ -From 1bbf0ced1d9db73ac7893c2187f3459288603e0d Mon Sep 17 00:00:00 2001 -From: Eric Dumazet -Date: Tue, 19 May 2026 08:46:11 +0000 -Subject: [PATCH] tcp: fix stale per-CPU tcp_tw_isn leak enabling ISN - prediction - -[ Upstream commit 1bbf0ced1d9db73ac7893c2187f3459288603e0d ] - -Blamed commit moved the TIME_WAIT-derived ISN from the skb control -block to a per-CPU variable, assuming the value would always be consumed -by tcp_conn_request() for the same packet that wrote it. That assumption -is violated by multiple drop paths between the producer -(__this_cpu_write(tcp_tw_isn, isn) in tcp_v{4,6}_rcv()) and the consumer -(tcp_conn_request()): - - - min_ttl / min_hopcount check - - xfrm policy check - - tcp_inbound_hash() MD5/AO mismatch - - tcp_filter() eBPF/SO_ATTACH_FILTER drop - - th->syn && th->fin discard in tcp_rcv_state_process() TCP_LISTEN - - psp_sk_rx_policy_check() in tcp_v{4,6}_do_rcv() - - tcp_checksum_complete() in tcp_v{4,6}_do_rcv() - - tcp_v{4,6}_cookie_check() returning NULL - -When a packet is dropped on any of these paths, tcp_tw_isn is left set. - -The next SYN processed on the same CPU then consumes the non zero value in -tcp_conn_request(), receiving a potentially predictable ISN. - -This patch moves back tcp_tw_isn to skb->cb[], getting rid of the per-cpu -variable. - -Fixes: 41eecbd712b7 ("tcp: replace TCP_SKB_CB(skb)->tcp_tw_isn with a per-cpu field") -Reported-by: Chris Mason -Signed-off-by: Eric Dumazet -Reviewed-by: Kuniyuki Iwashima -Signed-off-by: Guruswamy Basavaiah ---- - include/net/tcp.h | 13 +++++++------ - net/ipv4/tcp.c | 3 --- - net/ipv4/tcp_input.c | 16 ++++++---------- - net/ipv4/tcp_ipv4.c | 3 ++- - net/ipv6/tcp_ipv6.c | 3 ++- - 5 files changed, 18 insertions(+), 20 deletions(-) - -diff --git a/include/net/tcp.h b/include/net/tcp.h ---- a/include/net/tcp.h -+++ b/include/net/tcp.h -@@ -54,8 +54,6 @@ - DECLARE_PER_CPU(unsigned int, tcp_orphan_count); - int tcp_orphan_count_sum(void); - --DECLARE_PER_CPU(u32, tcp_tw_isn); -- - void tcp_time_wait(struct sock *sk, int state, int timeo); - - #define MAX_TCP_HEADER L1_CACHE_ALIGN(128 + MAX_HEADER) -@@ -963,10 +961,13 @@ - __u32 seq; /* Starting sequence number */ - __u32 end_seq; /* SEQ + FIN + SYN + datalen */ - union { -- /* Note : -+ /* Notes : -+ * tcp_tw_isn is used in input path only -+ * (isn chosen by tcp_timewait_state_process()) - * tcp_gso_segs/size are used in write queue only, - * cf tcp_skb_pcount()/tcp_skb_mss() - */ -+ u32 tcp_tw_isn; - struct { - u16 tcp_gso_segs; - u16 tcp_gso_size; -diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c ---- a/net/ipv4/tcp.c -+++ b/net/ipv4/tcp.c -@@ -297,9 +297,6 @@ - DEFINE_PER_CPU(unsigned int, tcp_orphan_count); - EXPORT_PER_CPU_SYMBOL_GPL(tcp_orphan_count); - --DEFINE_PER_CPU(u32, tcp_tw_isn); --EXPORT_PER_CPU_SYMBOL_GPL(tcp_tw_isn); -- - long sysctl_tcp_mem[3] __read_mostly; - EXPORT_IPV6_MOD(sysctl_tcp_mem); - -diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c ---- a/net/ipv4/tcp_input.c -+++ b/net/ipv4/tcp_input.c -@@ -7205,6 +7205,7 @@ - struct sock *sk, struct sk_buff *skb) - { - struct tcp_fastopen_cookie foc = { .len = -1 }; -+ u32 isn = TCP_SKB_CB(skb)->tcp_tw_isn; - struct tcp_options_received tmp_opt; - struct tcp_sock *tp = tcp_sk(sk); - struct net *net = sock_net(sk); -@@ -7215,20 +7216,16 @@ - struct dst_entry *dst; - struct flowi fl; - u8 syncookies; -- u32 isn; - - #ifdef CONFIG_TCP_AO - const struct tcp_ao_hdr *aoh; - #endif - -- isn = __this_cpu_read(tcp_tw_isn); -- if (isn) { -- /* TW buckets are converted to open requests without -- * limitations, they conserve resources and peer is -- * evidently real one. -- */ -- __this_cpu_write(tcp_tw_isn, 0); -- } else { -+ /* If isn is non-zero, this SYN originally matched a TIME_WAIT socket. -+ * TW sockets are converted to open requests without limitations, -+ * we skip the queue limits and syncookie checks in the block below. -+ */ -+ if (!isn) { - syncookies = READ_ONCE(net->ipv4.sysctl_tcp_syncookies); - - if (syncookies == 2 || inet_csk_reqsk_queue_is_full(sk)) { -diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c ---- a/net/ipv4/tcp_ipv4.c -+++ b/net/ipv4/tcp_ipv4.c -@@ -2305,6 +2305,7 @@ - } - } - -+ isn = 0; - process: - if (static_branch_unlikely(&ip4_min_ttl)) { - /* min_ttl can be changed concurrently from do_ip_setsockopt() */ -@@ -2334,6 +2335,7 @@ - th = (const struct tcphdr *)skb->data; - iph = ip_hdr(skb); - tcp_v4_fill_cb(skb, iph, th); -+ TCP_SKB_CB(skb)->tcp_tw_isn = isn; - - skb->dev = NULL; - -@@ -2418,7 +2420,6 @@ - sk = sk2; - tcp_v4_restore_cb(skb); - refcounted = false; -- __this_cpu_write(tcp_tw_isn, isn); - goto process; - } - } -diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c ---- a/net/ipv6/tcp_ipv6.c -+++ b/net/ipv6/tcp_ipv6.c -@@ -1864,6 +1864,7 @@ - } - } - -+ isn = 0; - process: - if (static_branch_unlikely(&ip6_min_hopcount)) { - /* min_hopcount can be changed concurrently from do_ipv6_setsockopt() */ -@@ -1893,6 +1894,7 @@ - th = (const struct tcphdr *)skb->data; - hdr = ipv6_hdr(skb); - tcp_v6_fill_cb(skb, hdr, th); -+ TCP_SKB_CB(skb)->tcp_tw_isn = isn; - - skb->dev = NULL; - -@@ -1979,7 +1981,6 @@ - sk = sk2; - tcp_v6_restore_cb(skb); - refcounted = false; -- __this_cpu_write(tcp_tw_isn, isn); - goto process; - } - } --- -2.39.0 diff --git a/SPECS/91/linux/CVE/0001-xfrm-fix-stale-skb-prev-after-async-crypto-steals-a-.patch b/SPECS/91/linux/CVE/0001-xfrm-fix-stale-skb-prev-after-async-crypto-steals-a-.patch deleted file mode 100644 index 911a486a17..0000000000 --- a/SPECS/91/linux/CVE/0001-xfrm-fix-stale-skb-prev-after-async-crypto-steals-a-.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 9472beda693b3ad8d3466c7b9f4a9baf26c6d22b Mon Sep 17 00:00:00 2001 -From: Petr Wozniak -Date: Sun, 21 Jun 2026 12:03:27 +0200 -Subject: [PATCH] xfrm: fix stale skb->prev after async crypto steals a GSO - segment - -[ Upstream commit 3f4c3919baf0944ad96580467c302bc6c7758b00 ] - -skb_gso_segment() leaves the segment list head with ->prev pointing at -the last segment, an invariant validate_xmit_skb_list() relies on when -it sets its tail pointer (tail = skb->prev). - -When validate_xmit_xfrm() walks a GSO list and some segments are stolen -by async crypto (->xmit() returns -EINPROGRESS), those segments are -unlinked from the list but the head ->prev is never updated. If the -last segment is the one stolen, the returned head still has ->prev -pointing at it, even though it is now owned by the crypto engine and may -be freed. validate_xmit_skb_list() later does tail->next = skb, writing -through that stale pointer -- a use-after-free. - -Repoint skb->prev at the last retained segment before returning. - -Fixes: f53c723902d1 ("net: Add asynchronous callbacks for xfrm on layer 2.") -Signed-off-by: Petr Wozniak -Signed-off-by: Steffen Klassert -Signed-off-by: Sasha Levin -Signed-off-by: Brennan Lamoreaux ---- - net/xfrm/xfrm_device.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c -index 7744ed8e4c83..084cc90613d6 100644 ---- a/net/xfrm/xfrm_device.c -+++ b/net/xfrm/xfrm_device.c -@@ -226,6 +226,14 @@ struct sk_buff *validate_xmit_xfrm(struct sk_buff *skb, netdev_features_t featur - pskb = skb2; - } - -+ /* skb_gso_segment() set skb->prev to the last segment, but async -+ * crypto may have stolen it above without updating ->prev. Repoint -+ * it at the last retained segment so validate_xmit_skb_list() does -+ * not chain onto a segment now owned by the crypto engine. -+ */ -+ if (skb) -+ skb->prev = pskb; -+ - return skb; - } - EXPORT_SYMBOL_GPL(validate_xmit_xfrm); --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0002-ALSA-usb-audio-Use-the-right-limit-for-PCM-OOB-check.patch b/SPECS/91/linux/CVE/0002-ALSA-usb-audio-Use-the-right-limit-for-PCM-OOB-check.patch deleted file mode 100644 index a68da07123..0000000000 --- a/SPECS/91/linux/CVE/0002-ALSA-usb-audio-Use-the-right-limit-for-PCM-OOB-check.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 70b4db7d258118a7464f039112a74ddb49a95b06 Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Wed, 21 Jan 2026 09:20:20 +0100 -Subject: ALSA: usb-audio: Use the right limit for PCM OOB check - -commit 70b4db7d258118a7464f039112a74ddb49a95b06 upstream. - -The recent fix commit for addressing the OOB access of PCM URB data -buffer caused a regression on Behringer UMC2020HD device, resulting in -choppy sound. The fix used ep->max_urb_frames for the upper limit -check, and this is no right value to be referred. - -Use the actual buffer size (ctx->buffer_size) as the upper limit -instead, which also avoids the regression on the device above. - -Fixes: ef5749ef8b30 ("ALSA: usb-audio: Prevent excessive number of frames") -Link: https://bugzilla.kernel.org/show_bug.cgi?id=220997 -Link: https://patch.msgid.link/20260121082025.718748-1-tiwai@suse.de -Signed-off-by: Takashi Iwai -[Shivani: Backported for CVE-2026-23208. Modified to apply on 6.12.y ] -Signed-off-by: Shivani Agarwal ---- - sound/usb/pcm.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c -index 3a4666e3b..5aadd1221 100644 ---- a/sound/usb/pcm.c -+++ b/sound/usb/pcm.c -@@ -1505,7 +1505,8 @@ static int prepare_playback_urb(struct snd_usb_substream *subs, - - for (i = 0; i < ctx->packets; i++) { - counts = snd_usb_endpoint_next_packet_size(ep, ctx, i, avail); -- if (counts < 0 || frames + counts >= ep->max_urb_frames) -+ if (counts < 0 || -+ (frames + counts) * stride > ctx->buffer_size) - break; - /* set up descriptor */ - urb->iso_frame_desc[i].offset = frames * stride; --- -2.53.0 diff --git a/SPECS/91/linux/CVE/0002-fbdev-serialize-mode-sysfs-access-with-lock_fb_info.patch b/SPECS/91/linux/CVE/0002-fbdev-serialize-mode-sysfs-access-with-lock_fb_info.patch deleted file mode 100644 index 2478bc2024..0000000000 --- a/SPECS/91/linux/CVE/0002-fbdev-serialize-mode-sysfs-access-with-lock_fb_info.patch +++ /dev/null @@ -1,140 +0,0 @@ -From 34312b027085543bfc495605c4deb0a85dce2056 Mon Sep 17 00:00:00 2001 -From: Melbin K Mathew -Date: Thu, 2 Jul 2026 01:42:48 +0200 -Subject: [PATCH 2/2] fbdev: serialize mode sysfs access with lock_fb_info() - -[ Upstream commit 061db6b7a910b8378f3b2df64f8c0a3ddc6e85f2 ] - -show_mode(), show_modes(), and store_mode() access fb_info->modelist -and fb_info->mode without holding lock_fb_info(). store_modes() takes -lock_fb_info() while replacing the modelist and freeing the old one. - -A concurrent reader or writer can load a pointer to an old modelist -entry before store_modes() frees it, then dereference freed memory or -store a stale freed pointer in fb_info->mode. - -Take lock_fb_info() in show_mode(), show_modes(), and store_mode() to -serialize with store_modes(). In show_mode(), copy the mode to the -stack and format after dropping the lock. In store_mode(), split -activate() into a _locked variant to avoid double-locking, and hold -the locks for the modelist walk, mode conversion, activation, and -fb_info->mode assignment together. - -Cc: stable@vger.kernel.org # v7.1+ -Signed-off-by: Melbin K Mathew -Signed-off-by: Helge Deller -Signed-off-by: Keerthana K ---- - drivers/video/fbdev/core/fbsysfs.c | 46 ++++++++++++++++++++++++------ - 1 file changed, 38 insertions(+), 8 deletions(-) - -diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c -index 0387f448918d..b5c8424c5082 100644 ---- a/drivers/video/fbdev/core/fbsysfs.c -+++ b/drivers/video/fbdev/core/fbsysfs.c -@@ -15,19 +15,24 @@ - - #define FB_SYSFS_FLAG_ATTR 1 - -+static int activate_locked(struct fb_info *fb_info, -+ struct fb_var_screeninfo *var) -+{ -+ var->activate |= FB_ACTIVATE_FORCE; -+ return fb_set_var_from_user(fb_info, var); -+} -+ - static int activate(struct fb_info *fb_info, struct fb_var_screeninfo *var) - { - int err; - -- var->activate |= FB_ACTIVATE_FORCE; - console_lock(); - lock_fb_info(fb_info); -- err = fb_set_var_from_user(fb_info, var); -+ err = activate_locked(fb_info, var); - unlock_fb_info(fb_info); - console_unlock(); -- if (err) -- return err; -- return 0; -+ -+ return err; - } - - static int mode_string(char *buf, size_t size, unsigned int offset, -@@ -68,6 +73,9 @@ static ssize_t store_mode(struct device *device, struct device_attribute *attr, - - memset(&var, 0, sizeof(var)); - -+ console_lock(); -+ lock_fb_info(fb_info); -+ - list_for_each_entry(modelist, &fb_info->modelist, list) { - mode = &modelist->mode; - i = mode_string(mstr, sizeof(mstr), 0, mode); -@@ -75,12 +83,22 @@ static ssize_t store_mode(struct device *device, struct device_attribute *attr, - - var = fb_info->var; - fb_videomode_to_var(&var, mode); -- if ((err = activate(fb_info, &var))) -+ err = activate_locked(fb_info, &var); -+ if (err) { -+ unlock_fb_info(fb_info); -+ console_unlock(); - return err; -+ } - fb_info->mode = mode; -+ unlock_fb_info(fb_info); -+ console_unlock(); - return count; - } - } -+ -+ unlock_fb_info(fb_info); -+ console_unlock(); -+ - return -EINVAL; - } - -@@ -88,11 +106,20 @@ static ssize_t show_mode(struct device *device, struct device_attribute *attr, - char *buf) - { - struct fb_info *fb_info = dev_get_drvdata(device); -+ struct fb_videomode mode; -+ bool have_mode = false; - -- if (!fb_info->mode) -+ lock_fb_info(fb_info); -+ if (fb_info->mode) { -+ mode = *fb_info->mode; -+ have_mode = true; -+ } -+ unlock_fb_info(fb_info); -+ -+ if (!have_mode) - return 0; - -- return mode_string(buf, PAGE_SIZE, 0, fb_info->mode); -+ return mode_string(buf, PAGE_SIZE, 0, &mode); - } - - static ssize_t store_modes(struct device *device, -@@ -140,12 +167,15 @@ static ssize_t show_modes(struct device *device, struct device_attribute *attr, - const struct fb_videomode *mode; - - i = 0; -+ lock_fb_info(fb_info); - list_for_each_entry(modelist, &fb_info->modelist, list) { - mode = &modelist->mode; - i += mode_string(buf, PAGE_SIZE, i, mode); - if (i >= PAGE_SIZE - 1) - break; - } -+ unlock_fb_info(fb_info); -+ - return i; - } - --- -2.43.7 - diff --git a/SPECS/91/linux/CVE/0002-filemap-Add-folio_next_pos.patch b/SPECS/91/linux/CVE/0002-filemap-Add-folio_next_pos.patch deleted file mode 100644 index 02a46732b5..0000000000 --- a/SPECS/91/linux/CVE/0002-filemap-Add-folio_next_pos.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 92031d2462196c7e2d35c4bfe075110840957cde Mon Sep 17 00:00:00 2001 -From: "Matthew Wilcox (Oracle)" -Date: Fri, 24 Oct 2025 18:08:09 +0100 -Subject: [PATCH] filemap: Add folio_next_pos() - -[ Upstream commit 4511fd86db6f8f94f8aff01044f5c69aa38f81f4 ] - -Replace the open-coded implementation in ocfs2 (which loses the top -32 bits on 32-bit architectures) with a helper in pagemap.h. - -Fixes: 35edec1d52c0 (ocfs2: update truncate handling of partial clusters) -Signed-off-by: Matthew Wilcox (Oracle) -[Srinidhi: back-ported this CVE fix to linux v6.12.y. Backported as a - prerequisite for CVE-2026-64160 (fs/netfs/misc.c in the CVE fix uses - folio_next_pos()). Dropped the fs/ocfs2/alloc.c hunk which is out of - scope for this backport and unrelated to CVE-2026-64160. - Declared folio_next_pos() taking a non-const `struct folio *` instead - of upstream's `const struct folio *`: v6.12.1y's folio_next_index(), - which folio_next_pos() calls, still takes a non-const pointer. - resolve build failure here with -Werror=discarded-qualifiers. All - call sites pass a non-const folio pointer, so this is behaviourally - identical on v6.12.y. second patch out of 4 to fix CVE-2026-64160] -Signed-off-by: Srinidhi Rao ---- - include/linux/pagemap.h | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h -index 68a5f1ff3301..bdc14e820bc2 100644 ---- a/include/linux/pagemap.h -+++ b/include/linux/pagemap.h -@@ -928,6 +928,17 @@ static inline pgoff_t folio_next_index(struct folio *folio) - return folio->index + folio_nr_pages(folio); - } - -+/** -+ * folio_next_pos - Get the file position of the next folio. -+ * @folio: The current folio. -+ * -+ * Return: The position of the folio which follows this folio in the file. -+ */ -+static inline loff_t folio_next_pos(struct folio *folio) -+{ -+ return (loff_t)folio_next_index(folio) << PAGE_SHIFT; -+} -+ - /** - * folio_file_page - The page for a particular index. - * @folio: The folio which contains this index. --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0002-ipv6-ioam-fix-potential-NULL-dereferences-in-__ioam6.patch b/SPECS/91/linux/CVE/0002-ipv6-ioam-fix-potential-NULL-dereferences-in-__ioam6.patch deleted file mode 100644 index 61ed98bc08..0000000000 --- a/SPECS/91/linux/CVE/0002-ipv6-ioam-fix-potential-NULL-dereferences-in-__ioam6.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 9ce06913e64d581765f43be30a2943d5567512bf Mon Sep 17 00:00:00 2001 -From: Eric Dumazet -Date: Thu, 2 Apr 2026 10:17:32 +0000 -Subject: [PATCH 2/2] ipv6: ioam: fix potential NULL dereferences in - __ioam6_fill_trace_data() - -[ Upstream commit 4e65a8b8daa18d63255ec58964dd192c7fdd9f8b ] - -We need to check __in6_dev_get() for possible NULL value, as -suggested by Yiming Qian. - -Also add skb_dst_dev_rcu() instead of skb_dst_dev(), -and two missing READ_ONCE(). - -Note that @dev can't be NULL. - -Fixes: 9ee11f0fff20 ("ipv6: ioam: Data plane support for Pre-allocated Trace") -Reported-by: Yiming Qian -Signed-off-by: Eric Dumazet -Reviewed-by: Justin Iurman -Link: https://patch.msgid.link/20260402101732.1188059-1-edumazet@google.com -Signed-off-by: Jakub Kicinski -Signed-off-by: Sasha Levin -[Shivani: Modified to apply on 6.12.y ] -Signed-off-by: Shivani Agarwal ---- - net/ipv6/ioam6.c | 27 ++++++++++++++++----------- - 1 file changed, 16 insertions(+), 11 deletions(-) - -diff --git a/net/ipv6/ioam6.c b/net/ipv6/ioam6.c -index ebaa6c560..2a5a83eea 100644 ---- a/net/ipv6/ioam6.c -+++ b/net/ipv6/ioam6.c -@@ -714,7 +714,9 @@ static void __ioam6_fill_trace_data(struct sk_buff *skb, - struct ioam6_schema *sc, - unsigned int sclen, bool is_input) - { -- struct net_device *dev = skb_dst_dev(skb); -+ /* Note: skb_dst_dev_rcu() can't be NULL at this point. */ -+ struct net_device *dev = skb_dst_dev_rcu(skb); -+ struct inet6_dev *i_skb_dev, *idev; - struct timespec64 ts; - ktime_t tstamp; - u64 raw64; -@@ -725,13 +727,16 @@ static void __ioam6_fill_trace_data(struct sk_buff *skb, - - data = trace->data + trace->remlen * 4 - trace->nodelen * 4 - sclen * 4; - -+ i_skb_dev = skb->dev ? __in6_dev_get(skb->dev) : NULL; -+ idev = __in6_dev_get(dev); -+ - /* hop_lim and node_id */ - if (trace->type.bit0) { - byte = ipv6_hdr(skb)->hop_limit; - if (is_input) - byte--; - -- raw32 = dev_net(dev)->ipv6.sysctl.ioam6_id; -+ raw32 = READ_ONCE(dev_net(dev)->ipv6.sysctl.ioam6_id); - - *(__be32 *)data = cpu_to_be32((byte << 24) | raw32); - data += sizeof(__be32); -@@ -739,18 +744,18 @@ static void __ioam6_fill_trace_data(struct sk_buff *skb, - - /* ingress_if_id and egress_if_id */ - if (trace->type.bit1) { -- if (!skb->dev) -+ if (!i_skb_dev) - raw16 = IOAM6_U16_UNAVAILABLE; - else -- raw16 = (__force u16)READ_ONCE(__in6_dev_get(skb->dev)->cnf.ioam6_id); -+ raw16 = (__force u16)READ_ONCE(i_skb_dev->cnf.ioam6_id); - - *(__be16 *)data = cpu_to_be16(raw16); - data += sizeof(__be16); - -- if (dev->flags & IFF_LOOPBACK) -+ if ((dev->flags & IFF_LOOPBACK) || !idev) - raw16 = IOAM6_U16_UNAVAILABLE; - else -- raw16 = (__force u16)READ_ONCE(__in6_dev_get(dev)->cnf.ioam6_id); -+ raw16 = (__force u16)READ_ONCE(idev->cnf.ioam6_id); - - *(__be16 *)data = cpu_to_be16(raw16); - data += sizeof(__be16); -@@ -830,7 +835,7 @@ static void __ioam6_fill_trace_data(struct sk_buff *skb, - if (is_input) - byte--; - -- raw64 = dev_net(dev)->ipv6.sysctl.ioam6_id_wide; -+ raw64 = READ_ONCE(dev_net(dev)->ipv6.sysctl.ioam6_id_wide); - - *(__be64 *)data = cpu_to_be64(((u64)byte << 56) | raw64); - data += sizeof(__be64); -@@ -838,18 +843,18 @@ static void __ioam6_fill_trace_data(struct sk_buff *skb, - - /* ingress_if_id and egress_if_id (wide) */ - if (trace->type.bit9) { -- if (!skb->dev) -+ if (!i_skb_dev) - raw32 = IOAM6_U32_UNAVAILABLE; - else -- raw32 = READ_ONCE(__in6_dev_get(skb->dev)->cnf.ioam6_id_wide); -+ raw32 = READ_ONCE(i_skb_dev->cnf.ioam6_id_wide); - - *(__be32 *)data = cpu_to_be32(raw32); - data += sizeof(__be32); - -- if (dev->flags & IFF_LOOPBACK) -+ if ((dev->flags & IFF_LOOPBACK) || !idev) - raw32 = IOAM6_U32_UNAVAILABLE; - else -- raw32 = READ_ONCE(__in6_dev_get(dev)->cnf.ioam6_id_wide); -+ raw32 = READ_ONCE(idev->cnf.ioam6_id_wide); - - *(__be32 *)data = cpu_to_be32(raw32); - data += sizeof(__be32); --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0002-netfilter-x_tables-add-and-use-xtables_unregister_ta.patch b/SPECS/91/linux/CVE/0002-netfilter-x_tables-add-and-use-xtables_unregister_ta.patch deleted file mode 100644 index d1e211269d..0000000000 --- a/SPECS/91/linux/CVE/0002-netfilter-x_tables-add-and-use-xtables_unregister_ta.patch +++ /dev/null @@ -1,334 +0,0 @@ -From 60c29d844b1abc79b036dbfcb6d3ef011cd0b353 Mon Sep 17 00:00:00 2001 -From: Florian Westphal -Date: Wed, 6 May 2026 12:07:17 +0200 -Subject: [PATCH 2/2] netfilter: x_tables: add and use - xtables_unregister_table_exit - -[ Upstream commit b4597d5fd7d2f8cebfffd40dffb5e003cc78964c ] - -Previous change added xtables_unregister_table_pre_exit to detach the -table from the packetpath and to unlink it from the active table list. -In case of rmmod, userspace that is doing set/getsockopt for this table -will not be able to re-instantiate the table: - 1. The larval table has been removed already - 2. existing instantiated table is no longer on the xt pernet table list. - -This adds the second stage helper: - -unlink the table from the dying list, free the hook ops (if any) and do -the audit notification. It replaces xt_unregister_table(). - -Fixes: fdacd57c79b7 ("netfilter: x_tables: never register tables by default") -Reported-by: Tristan Madani -Reviewed-by: Tristan Madani -Closes: https://lore.kernel.org/netfilter-devel/20260429175613.1459342-1-tristmd@gmail.com/ -Signed-off-by: Florian Westphal -Signed-off-by: Pablo Neira Ayuso -Signed-off-by: Sasha Levin -Signed-off-by: Brennan Lamoreaux ---- - include/linux/netfilter/x_tables.h | 2 +- - net/ipv4/netfilter/arp_tables.c | 9 ++-- - net/ipv4/netfilter/ip_tables.c | 9 ++-- - net/ipv4/netfilter/iptable_nat.c | 5 +- - net/ipv6/netfilter/ip6_tables.c | 9 ++-- - net/ipv6/netfilter/ip6table_nat.c | 5 +- - net/netfilter/x_tables.c | 81 +++++++++++++++++++++++------- - 7 files changed, 83 insertions(+), 37 deletions(-) - -diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h -index df2022fe440b..706f08839050 100644 ---- a/include/linux/netfilter/x_tables.h -+++ b/include/linux/netfilter/x_tables.h -@@ -309,8 +309,8 @@ struct xt_table *xt_register_table(struct net *net, - const struct xt_table *table, - struct xt_table_info *bootstrap, - struct xt_table_info *newinfo); --void *xt_unregister_table(struct xt_table *table); - void xt_unregister_table_pre_exit(struct net *net, u8 af, const char *name); -+struct xt_table *xt_unregister_table_exit(struct net *net, u8 af, const char *name); - - struct xt_table_info *xt_replace_table(struct xt_table *table, - unsigned int num_counters, -diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c -index 46b4a91049ef..1490466b146e 100644 ---- a/net/ipv4/netfilter/arp_tables.c -+++ b/net/ipv4/netfilter/arp_tables.c -@@ -1498,13 +1498,11 @@ static int do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len - - static void __arpt_unregister_table(struct net *net, struct xt_table *table) - { -- struct xt_table_info *private; -- void *loc_cpu_entry; -+ struct xt_table_info *private = table->private; - struct module *table_owner = table->me; -+ void *loc_cpu_entry; - struct arpt_entry *iter; - -- private = xt_unregister_table(table); -- - /* Decrease module usage counts and free resources */ - loc_cpu_entry = private->entries; - xt_entry_foreach(iter, loc_cpu_entry, private->size) -@@ -1512,6 +1510,7 @@ static void __arpt_unregister_table(struct net *net, struct xt_table *table) - if (private->number > private->initial_entries) - module_put(table_owner); - xt_free_table_info(private); -+ kfree(table); - } - - int arpt_register_table(struct net *net, -@@ -1580,7 +1579,7 @@ int arpt_register_table(struct net *net, - - void arpt_unregister_table(struct net *net, const char *name) - { -- struct xt_table *table = xt_find_table(net, NFPROTO_ARP, name); -+ struct xt_table *table = xt_unregister_table_exit(net, NFPROTO_ARP, name); - - if (table) - __arpt_unregister_table(net, table); -diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c -index 5c36daa2c4e2..5c9d1227eb79 100644 ---- a/net/ipv4/netfilter/ip_tables.c -+++ b/net/ipv4/netfilter/ip_tables.c -@@ -1701,12 +1701,10 @@ do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) - - static void __ipt_unregister_table(struct net *net, struct xt_table *table) - { -- struct xt_table_info *private; -- void *loc_cpu_entry; -+ struct xt_table_info *private = table->private; - struct module *table_owner = table->me; - struct ipt_entry *iter; -- -- private = xt_unregister_table(table); -+ void *loc_cpu_entry; - - /* Decrease module usage counts and free resources */ - loc_cpu_entry = private->entries; -@@ -1715,6 +1713,7 @@ static void __ipt_unregister_table(struct net *net, struct xt_table *table) - if (private->number > private->initial_entries) - module_put(table_owner); - xt_free_table_info(private); -+ kfree(table); - } - - int ipt_register_table(struct net *net, const struct xt_table *table, -@@ -1788,7 +1787,7 @@ int ipt_register_table(struct net *net, const struct xt_table *table, - - void ipt_unregister_table_exit(struct net *net, const char *name) - { -- struct xt_table *table = xt_find_table(net, NFPROTO_IPV4, name); -+ struct xt_table *table = xt_unregister_table_exit(net, NFPROTO_IPV4, name); - - if (table) - __ipt_unregister_table(net, table); -diff --git a/net/ipv4/netfilter/iptable_nat.c b/net/ipv4/netfilter/iptable_nat.c -index d6c5824943f8..4dae3da4586b 100644 ---- a/net/ipv4/netfilter/iptable_nat.c -+++ b/net/ipv4/netfilter/iptable_nat.c -@@ -119,8 +119,11 @@ static int iptable_nat_table_init(struct net *net) - } - - ret = ipt_nat_register_lookups(net); -- if (ret < 0) -+ if (ret < 0) { -+ xt_unregister_table_pre_exit(net, NFPROTO_IPV4, "nat"); -+ synchronize_rcu(); - ipt_unregister_table_exit(net, "nat"); -+ } - - kfree(repl); - return ret; -diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c -index e6b8f70d205d..c2af6ad18b9f 100644 ---- a/net/ipv6/netfilter/ip6_tables.c -+++ b/net/ipv6/netfilter/ip6_tables.c -@@ -1710,12 +1710,10 @@ do_ip6t_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) - - static void __ip6t_unregister_table(struct net *net, struct xt_table *table) - { -- struct xt_table_info *private; -- void *loc_cpu_entry; -+ struct xt_table_info *private = table->private; - struct module *table_owner = table->me; - struct ip6t_entry *iter; -- -- private = xt_unregister_table(table); -+ void *loc_cpu_entry; - - /* Decrease module usage counts and free resources */ - loc_cpu_entry = private->entries; -@@ -1724,6 +1722,7 @@ static void __ip6t_unregister_table(struct net *net, struct xt_table *table) - if (private->number > private->initial_entries) - module_put(table_owner); - xt_free_table_info(private); -+ kfree(table); - } - - int ip6t_register_table(struct net *net, const struct xt_table *table, -@@ -1794,7 +1793,7 @@ int ip6t_register_table(struct net *net, const struct xt_table *table, - - void ip6t_unregister_table_exit(struct net *net, const char *name) - { -- struct xt_table *table = xt_find_table(net, NFPROTO_IPV6, name); -+ struct xt_table *table = xt_unregister_table_exit(net, NFPROTO_IPV6, name); - - if (table) - __ip6t_unregister_table(net, table); -diff --git a/net/ipv6/netfilter/ip6table_nat.c b/net/ipv6/netfilter/ip6table_nat.c -index 4ce45f3d1110..8088ebaf9b35 100644 ---- a/net/ipv6/netfilter/ip6table_nat.c -+++ b/net/ipv6/netfilter/ip6table_nat.c -@@ -121,8 +121,11 @@ static int ip6table_nat_table_init(struct net *net) - } - - ret = ip6t_nat_register_lookups(net); -- if (ret < 0) -+ if (ret < 0) { -+ xt_unregister_table_pre_exit(net, NFPROTO_IPV6, "nat"); -+ synchronize_rcu(); - ip6t_unregister_table_exit(net, "nat"); -+ } - - kfree(repl); - return ret; -diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c -index 39142f395c1d..855410c52c48 100644 ---- a/net/netfilter/x_tables.c -+++ b/net/netfilter/x_tables.c -@@ -55,6 +55,9 @@ static struct list_head xt_templates[NFPROTO_NUMPROTO]; - - struct xt_pernet { - struct list_head tables[NFPROTO_NUMPROTO]; -+ -+ /* stash area used during netns exit */ -+ struct list_head dead_tables[NFPROTO_NUMPROTO]; - }; - - struct compat_delta { -@@ -1521,23 +1524,6 @@ struct xt_table *xt_register_table(struct net *net, - } - EXPORT_SYMBOL_GPL(xt_register_table); - --void *xt_unregister_table(struct xt_table *table) --{ -- struct xt_table_info *private; -- -- mutex_lock(&xt[table->af].mutex); -- private = table->private; -- list_del(&table->list); -- mutex_unlock(&xt[table->af].mutex); -- audit_log_nfcfg(table->name, table->af, private->number, -- AUDIT_XT_OP_UNREGISTER, GFP_KERNEL); -- kfree(table->ops); -- kfree(table); -- -- return private; --} --EXPORT_SYMBOL_GPL(xt_unregister_table); -- - /** - * xt_unregister_table_pre_exit - pre-shutdown unregister of a table - * @net: network namespace -@@ -1547,6 +1533,14 @@ EXPORT_SYMBOL_GPL(xt_unregister_table); - * Unregisters the specified netfilter table from the given network namespace - * and also unregisters the hooks from netfilter core: no new packets will be - * processed. -+ * -+ * This must be called prior to xt_unregister_table_exit() from the pernet -+ * .pre_exit callback. After this call, the table is no longer visible to -+ * the get/setsockopt path. In case of rmmod, module exit path must have -+ * called xt_unregister_template() prior to unregistering pernet ops to -+ * prevent re-instantiation of the table. -+ * -+ * See also: xt_unregister_table_exit() - */ - void xt_unregister_table_pre_exit(struct net *net, u8 af, const char *name) - { -@@ -1556,6 +1550,7 @@ void xt_unregister_table_pre_exit(struct net *net, u8 af, const char *name) - mutex_lock(&xt[af].mutex); - list_for_each_entry(t, &xt_net->tables[af], list) { - if (strcmp(t->name, name) == 0) { -+ list_move(&t->list, &xt_net->dead_tables[af]); - mutex_unlock(&xt[af].mutex); - - if (t->ops) /* nat table registers with nat core, t->ops is NULL. */ -@@ -1567,6 +1562,50 @@ void xt_unregister_table_pre_exit(struct net *net, u8 af, const char *name) - } - EXPORT_SYMBOL(xt_unregister_table_pre_exit); - -+/** -+ * xt_unregister_table_exit - remove a table during namespace teardown -+ * @net: the network namespace from which to unregister the table -+ * @af: address family (e.g., NFPROTO_IPV4, NFPROTO_IPV6) -+ * @name: name of the table to unregister -+ * -+ * Completes the unregister process for a table. This must be called from -+ * the pernet ops .exit callback. This is the second stage after -+ * xt_unregister_table_pre_exit(). -+ * -+ * pair with xt_unregister_table_pre_exit() during namespace shutdown. -+ * -+ * Return: the unregistered table or NULL if the table was never -+ * instantiated. The caller needs to kfree() the table after it -+ * has removed the family specific matches/targets. -+ */ -+struct xt_table *xt_unregister_table_exit(struct net *net, u8 af, const char *name) -+{ -+ struct xt_pernet *xt_net = net_generic(net, xt_pernet_id); -+ struct xt_table *table; -+ -+ mutex_lock(&xt[af].mutex); -+ list_for_each_entry(table, &xt_net->dead_tables[af], list) { -+ struct nf_hook_ops *ops = NULL; -+ -+ if (strcmp(table->name, name) != 0) -+ continue; -+ -+ list_del(&table->list); -+ -+ audit_log_nfcfg(table->name, table->af, table->private->number, -+ AUDIT_XT_OP_UNREGISTER, GFP_KERNEL); -+ swap(table->ops, ops); -+ mutex_unlock(&xt[af].mutex); -+ -+ kfree(ops); -+ return table; -+ } -+ mutex_unlock(&xt[af].mutex); -+ -+ return NULL; -+} -+EXPORT_SYMBOL_GPL(xt_unregister_table_exit); -+ - #ifdef CONFIG_PROC_FS - static void *xt_table_seq_start(struct seq_file *seq, loff_t *pos) - { -@@ -2009,8 +2048,10 @@ static int __net_init xt_net_init(struct net *net) - struct xt_pernet *xt_net = net_generic(net, xt_pernet_id); - int i; - -- for (i = 0; i < NFPROTO_NUMPROTO; i++) -+ for (i = 0; i < NFPROTO_NUMPROTO; i++) { - INIT_LIST_HEAD(&xt_net->tables[i]); -+ INIT_LIST_HEAD(&xt_net->dead_tables[i]); -+ } - return 0; - } - -@@ -2019,8 +2060,10 @@ static void __net_exit xt_net_exit(struct net *net) - struct xt_pernet *xt_net = net_generic(net, xt_pernet_id); - int i; - -- for (i = 0; i < NFPROTO_NUMPROTO; i++) -+ for (i = 0; i < NFPROTO_NUMPROTO; i++) { - WARN_ON_ONCE(!list_empty(&xt_net->tables[i])); -+ WARN_ON_ONCE(!list_empty(&xt_net->dead_tables[i])); -+ } - } - - static struct pernet_operations xt_net_ops = { --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0002-sched-psi-fix-race-between-file-release-and-pressure.patch b/SPECS/91/linux/CVE/0002-sched-psi-fix-race-between-file-release-and-pressure.patch deleted file mode 100644 index a1c866a40d..0000000000 --- a/SPECS/91/linux/CVE/0002-sched-psi-fix-race-between-file-release-and-pressure.patch +++ /dev/null @@ -1,184 +0,0 @@ -From 016ec330e4a2312db77fd69c8be416f5b26476b4 Mon Sep 17 00:00:00 2001 -From: Edward Adam Davis -Date: Tue, 14 Apr 2026 14:15:43 +0800 -Subject: [PATCH 06/22] sched/psi: fix race between file release and pressure - write - -[ Upstream commit a5b98009f16d8a5fb4a8ff9a193f5735515c38fa ] - -A potential race condition exists between pressure write and cgroup file -release regarding the priv member of struct kernfs_open_file, which -triggers the uaf reported in [1]. - -Consider the following scenario involving execution on two separate CPUs: - - CPU0 CPU1 - ==== ==== - vfs_rmdir() - kernfs_iop_rmdir() - cgroup_rmdir() - cgroup_kn_lock_live() - cgroup_destroy_locked() - cgroup_addrm_files() - cgroup_rm_file() - kernfs_remove_by_name() - kernfs_remove_by_name_ns() - vfs_write() __kernfs_remove() - new_sync_write() kernfs_drain() - kernfs_fop_write_iter() kernfs_drain_open_files() - cgroup_file_write() kernfs_release_file() - pressure_write() cgroup_file_release() - ctx = of->priv; - kfree(ctx); - of->priv = NULL; - cgroup_kn_unlock() - cgroup_kn_lock_live() - cgroup_get(cgrp) - cgroup_kn_unlock() - if (ctx->psi.trigger) // here, trigger uaf for ctx, that is of->priv - -The cgroup_rmdir() is protected by the cgroup_mutex, it also safeguards -the memory deallocation of of->priv performed within cgroup_file_release(). -However, the operations involving of->priv executed within pressure_write() -are not entirely covered by the protection of cgroup_mutex. Consequently, -if the code in pressure_write(), specifically the section handling the -ctx variable executes after cgroup_file_release() has completed, a uaf -vulnerability involving of->priv is triggered. - -Therefore, the issue can be resolved by extending the scope of the -cgroup_mutex lock within pressure_write() to encompass all code paths -involving of->priv, thereby properly synchronizing the race condition -occurring between cgroup_file_release() and pressure_write(). - -And, if an live kn lock can be successfully acquired while executing -the pressure write operation, it indicates that the cgroup deletion -process has not yet reached its final stage; consequently, the priv -pointer within open_file cannot be NULL. Therefore, the operation to -retrieve the ctx value must be moved to a point *after* the live kn -lock has been successfully acquired. - -In another situation, specifically after entering cgroup_kn_lock_live() -but before acquiring cgroup_mutex, there exists a different class of -race condition: - -CPU0: write memory.pressure CPU1: write cgroup.pressure=0 -=========================== ============================= - -kernfs_fop_write_iter() - kernfs_get_active_of(of) - pressure_write() - cgroup_kn_lock_live(memory.pressure) - cgroup_tryget(cgrp) - kernfs_break_active_protection(kn) - ... blocks on cgroup_mutex - - cgroup_pressure_write() - cgroup_kn_lock_live(cgroup.pressure) - cgroup_file_show(memory.pressure, false) - kernfs_show(false) - kernfs_drain_open_files() - cgroup_file_release(of) - kfree(ctx) - of->priv = NULL - cgroup_kn_unlock() - - ... acquires cgroup_mutex - ctx = of->priv; // may now be NULL - if (ctx->psi.trigger) // NULL dereference - -Consequently, there is a possibility that of->priv is NULL, the pressure -write needs to check for this. - -Now that the scope of the cgroup_mutex has been expanded, the original -explicit cgroup_get/put operations are no longer necessary, this is -because acquiring/releasing the live kn lock inherently executes a -cgroup get/put operation. - -[1] -BUG: KASAN: slab-use-after-free in pressure_write+0xa4/0x210 kernel/cgroup/cgroup.c:4011 -Call Trace: - pressure_write+0xa4/0x210 kernel/cgroup/cgroup.c:4011 - cgroup_file_write+0x36f/0x790 kernel/cgroup/cgroup.c:4311 - kernfs_fop_write_iter+0x3b0/0x540 fs/kernfs/file.c:352 - -Allocated by task 9352: - cgroup_file_open+0x90/0x3a0 kernel/cgroup/cgroup.c:4256 - kernfs_fop_open+0x9eb/0xcb0 fs/kernfs/file.c:724 - do_dentry_open+0x83d/0x13e0 fs/open.c:949 - -Freed by task 9353: - cgroup_file_release+0xd6/0x100 kernel/cgroup/cgroup.c:4283 - kernfs_release_file fs/kernfs/file.c:764 [inline] - kernfs_drain_open_files+0x392/0x720 fs/kernfs/file.c:834 - kernfs_drain+0x470/0x600 fs/kernfs/dir.c:525 - -Fixes: 0e94682b73bf ("psi: introduce psi monitor") -Reported-by: syzbot+33e571025d88efd1312c@syzkaller.appspotmail.com -Closes: https://syzkaller.appspot.com/bug?extid=33e571025d88efd1312c -Tested-by: syzbot+33e571025d88efd1312c@syzkaller.appspotmail.com -Signed-off-by: Edward Adam Davis -Reviewed-by: Chen Ridong -Signed-off-by: Tejun Heo -[Srinidhi: cherry picked from commit a5b98009f16d8a5fb4a8ff9a193f5735515c38fa for linux v6.12.y] -Signed-off-by: Srinidhi Rao ---- - kernel/cgroup/cgroup.c | 24 ++++++++++++++++-------- - 1 file changed, 16 insertions(+), 8 deletions(-) - -diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c -index d4ea7dfada9f..c852461ae191 100644 ---- a/kernel/cgroup/cgroup.c -+++ b/kernel/cgroup/cgroup.c -@@ -3876,33 +3876,41 @@ static int cgroup_cpu_pressure_show(struct seq_file *seq, void *v) - static ssize_t pressure_write(struct kernfs_open_file *of, char *buf, - size_t nbytes, enum psi_res res) - { -- struct cgroup_file_ctx *ctx = of->priv; -+ struct cgroup_file_ctx *ctx; - struct psi_trigger *new; - struct cgroup *cgrp; - struct psi_group *psi; -+ ssize_t ret = 0; - - cgrp = cgroup_kn_lock_live(of->kn, false); - if (!cgrp) - return -ENODEV; - -- cgroup_get(cgrp); -- cgroup_kn_unlock(of->kn); -+ ctx = of->priv; -+ if (!ctx) { -+ ret = -ENODEV; -+ goto out_unlock; -+ } - - /* Allow only one trigger per file descriptor */ - if (ctx->psi.trigger) { -- cgroup_put(cgrp); -- return -EBUSY; -+ ret = -EBUSY; -+ goto out_unlock; - } - - psi = cgroup_psi(cgrp); - new = psi_trigger_create(psi, buf, res, of->file, of); - if (IS_ERR(new)) { -- cgroup_put(cgrp); -- return PTR_ERR(new); -+ ret = PTR_ERR(new); -+ goto out_unlock; - } - - smp_store_release(&ctx->psi.trigger, new); -- cgroup_put(cgrp); -+ -+out_unlock: -+ cgroup_kn_unlock(of->kn); -+ if (ret) -+ return ret; - - return nbytes; - } --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0002-sctp-validate-embedded-INIT-chunk-and.patch b/SPECS/91/linux/CVE/0002-sctp-validate-embedded-INIT-chunk-and.patch deleted file mode 100644 index 2e85dc68e8..0000000000 --- a/SPECS/91/linux/CVE/0002-sctp-validate-embedded-INIT-chunk-and.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 027be63f91156464b05f584a12f41ca5702da7de Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Wed, 15 Jul 2026 11:41:10 +0000 -Subject: [PATCH] CVE-2026-53224: sctp: validate embedded INIT chunk and - address list lengths in cookie - -From: Xin Long - -commit 6f4c80a2a7e6d06753b89a578b710a2499a5e62b upstream. - -sctp_unpack_cookie() only checked that the embedded INIT chunk length -did not exceed the remaining cookie payload, but did not ensure that the -INIT chunk is large enough to contain a complete INIT header. - -A malformed COOKIE_ECHO can therefore carry a truncated INIT chunk whose -length field is smaller than sizeof(struct sctp_init_chunk). Later, -sctp_process_init() accesses INIT parameters unconditionally, which may -lead to out-of-bounds reads. - -In addition, raw_addr_list_len is not fully validated against the -remaining cookie payload. When cookie authentication is disabled, an -attacker can supply an oversized raw_addr_list_len and cause -sctp_raw_to_bind_addrs() to read beyond the end of the cookie. The -address parser also lacks sufficient bounds checks for parameter headers -and lengths, allowing malformed address parameters to trigger -out-of-bounds reads. - -Fix this by: - -- requiring the embedded INIT chunk length to be at least sizeof(struct - sctp_init_chunk); -- validating that the INIT chunk and raw address list together fit - within the cookie payload; -- verifying sufficient data exists for each address parameter header and - payload before parsing it. - -Note that sctp_verify_init() must be called after sctp_unpack_cookie() -and before sctp_process_init() when cookie authentication is disabled. -This will be addressed in a separate patch. - -Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") -Reported-by: Sashiko -Signed-off-by: Xin Long -Link: https://patch.msgid.link/75af23a89adf881a0895d511775e4770da367cbf.1780873427.git.lucien.xin@gmail.com -Signed-off-by: Jakub Kicinski -[ Ajay Kaher: Modified to apply on v6.12 ] -Signed-off-by: Ajay Kaher ---- - net/sctp/bind_addr.c | 11 ++++++++++- - net/sctp/sm_make_chunk.c | 9 +++++++-- - 2 files changed, 17 insertions(+), 3 deletions(-) - -diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c -index 6b95d3ba8..0947b276d 100644 ---- a/net/sctp/bind_addr.c -+++ b/net/sctp/bind_addr.c -@@ -275,6 +275,16 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list, - param = (struct sctp_paramhdr *)raw_addr_list; - rawaddr = (union sctp_addr_param *)raw_addr_list; - -+ if (addrs_len < sizeof(*param)) { -+ retval = -EINVAL; -+ goto out_err; -+ } -+ len = ntohs(param->length); -+ if (addrs_len < len) { -+ retval = -EINVAL; -+ goto out_err; -+ } -+ - af = sctp_get_af_specific(param_type2af(param->type)); - if (unlikely(!af) || - !af->from_addr_param(&addr, rawaddr, htons(port), 0)) { -@@ -291,7 +301,6 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list, - goto out_err; - - next: -- len = ntohs(param->length); - addrs_len -= len; - raw_addr_list += len; - } -diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c -index 0d6ecdcda..3a2740228 100644 ---- a/net/sctp/sm_make_chunk.c -+++ b/net/sctp/sm_make_chunk.c -@@ -1752,7 +1752,7 @@ struct sctp_association *sctp_unpack_cookie( - struct sctp_chunkhdr *ch; - __u8 *digest = ep->digest; - enum sctp_scope scope; -- unsigned int len; -+ unsigned int len, chlen; - ktime_t kt; - - /* Header size is static data prior to the actual cookie, including -@@ -1781,7 +1781,12 @@ struct sctp_association *sctp_unpack_cookie( - bear_cookie = &cookie->c; - - ch = (struct sctp_chunkhdr *)(bear_cookie + 1); -- if (ntohs(ch->length) > len - fixed_size) -+ chlen = ntohs(ch->length); -+ if (chlen < sizeof(struct sctp_init_chunk)) -+ goto malformed; -+ if (chlen > len - fixed_size) -+ goto malformed; -+ if (bear_cookie->raw_addr_list_len > len - fixed_size - chlen) - goto malformed; - - if (!sctp_sk(ep->base.sk)->hmac) --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/0002-tls-rx-restore-msg_iter-before-TLS-1.3-optimistic-re.patch b/SPECS/91/linux/CVE/0002-tls-rx-restore-msg_iter-before-TLS-1.3-optimistic-re.patch deleted file mode 100644 index 95705d9a77..0000000000 --- a/SPECS/91/linux/CVE/0002-tls-rx-restore-msg_iter-before-TLS-1.3-optimistic-re.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 1966a9ced2e14ba409f11b698c42b7d96fa32101 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Jean?= -Date: Tue, 4 Aug 2026 12:55:28 +0000 -Subject: [PATCH 2/2] tls: rx: restore msg_iter before TLS 1.3 optimistic retry -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -commit 1c8629651cb54f7b51db8fc0b1a9944e4a4b0f5e upstream. - -tls_decrypt_sg() advances msg->msg_iter when it maps user pages for -the optimistic TLS 1.3 zero-copy path. If the decrypted record turns -out not to be unpadded application data, tls_decrypt_sw() retries into -a kernel skb, but leaves the iterator advanced. - -The subsequent copy from the skb then writes decrypted bytes again at -a later point in the caller iovecs while recvmsg() reports only the -post-retry length. A TLS peer can trigger this after the receiver -enables TLS_RX_EXPECT_NO_PAD. - -Revert the iterator by the number of bytes consumed by the optimistic -mapping before retrying without zero-copy. - -Add a selftest which sends a TLS 1.3 control record with -TLS_RX_EXPECT_NO_PAD enabled and verifies that recvmsg() does not -overwrite later iovecs beyond the returned length. - -Fixes: ce61327ce989 ("tls: rx: support optimistic decrypt to user buffer with TLS 1.3") -Cc: stable@vger.kernel.org -Signed-off-by: Jérémy Jean -Link: https://patch.msgid.link/20260804125528.2139928-1-Jeremy.Jean@oss.cyber.gouv.fr -Signed-off-by: Jakub Kicinski -Signed-off-by: Greg Kroah-Hartman -Signed-off-by: Guruswamy Basavaiah ---- - net/tls/tls_sw.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c -index dd8b70914ce1..2f64869b62b3 100644 ---- a/net/tls/tls_sw.c -+++ b/net/tls/tls_sw.c -@@ -1741,6 +1741,8 @@ tls_decrypt_sw(struct sock *sk, struct tls_context *tls_ctx, - /* If opportunistic TLS 1.3 ZC failed retry without ZC */ - if (unlikely(darg->zc && prot->version == TLS_1_3_VERSION && - darg->tail != TLS_RECORD_TYPE_DATA)) { -+ iov_iter_revert(&msg->msg_iter, strp_msg(darg->skb)->full_len - -+ prot->overhead_size); - darg->zc = false; - if (!darg->tail) - TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSRXNOPADVIOL); --- -2.43.0 - diff --git a/SPECS/91/linux/CVE/0003-sctp-add-INIT-verification-after-cookie-unpacking.patch b/SPECS/91/linux/CVE/0003-sctp-add-INIT-verification-after-cookie-unpacking.patch deleted file mode 100644 index fcc19d6e3d..0000000000 --- a/SPECS/91/linux/CVE/0003-sctp-add-INIT-verification-after-cookie-unpacking.patch +++ /dev/null @@ -1,153 +0,0 @@ -From 6d0c0b2a90b2b66e5515cdd9c279366532336124 Mon Sep 17 00:00:00 2001 -From: Xin Long -Date: Wed, 24 Jun 2026 18:53:12 -0400 -Subject: [PATCH 3/3] sctp: add INIT verification after cookie unpacking - -[ Upstream commit 414c5447fe6a200613dd46d7fdc8454622076cb1 ] - -In SCTP handshake, the INIT chunk is initially processed by the server -and embedded into the cookie carried in INIT-ACK. The client then -returns this cookie via COOKIE-ECHO, where the server unpacks it and -reconstructs the original INIT chunk. - -When cookie authentication is enabled, the cookie contents are protected -against tampering, so reusing the unpacked INIT without re-verification -is safe. - -However, when cookie authentication is disabled, the reconstructed INIT -can no longer be trusted. In this case, the INIT must be explicitly -validated after unpacking to avoid processing potentially tampered data. - -Add sctp_verify_init() checks after cookie unpacking in COOKIE-ECHO -processing paths (sctp_sf_do_5_1D_ce() and sctp_sf_do_5_2_4_dupcook()) -when cookie_auth_enable is disabled. On failure, the new association is -freed and the packet is discarded. - -Also tighten cookie validation in sctp_unpack_cookie() by verifying the -embedded chunk type is SCTP_CID_INIT before treating it as an INIT -chunk. - -Finally, update sctp_verify_init() to validate parameter bounds using -the actual embedded INIT length instead of chunk->chunk_end, since the -INIT stored in COOKIE-ECHO may not span the entire chunk buffer. - -Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") -Signed-off-by: Xin Long -Link: https://patch.msgid.link/ebcbbac574815b0850f371b4bdb02f2e602b94d3.1782341592.git.lucien.xin@gmail.com -Signed-off-by: Jakub Kicinski -[ Shivani: 6.12.y lacks the cookie_auth_enable field (not backported), - so the sctp_verify_init() call runs unconditionally instead of being - gated on it. ] -Signed-off-by: Shivani Agarwal ---- - net/sctp/sm_make_chunk.c | 5 ++++- - net/sctp/sm_statefuns.c | 34 +++++++++++++++++++++++++++++++--- - 2 files changed, 35 insertions(+), 4 deletions(-) - -diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c -index b53ce1d85..350f06747 100644 ---- a/net/sctp/sm_make_chunk.c -+++ b/net/sctp/sm_make_chunk.c -@@ -1781,6 +1781,8 @@ struct sctp_association *sctp_unpack_cookie( - bear_cookie = &cookie->c; - - ch = (struct sctp_chunkhdr *)(bear_cookie + 1); -+ if (ch->type != SCTP_CID_INIT) -+ goto malformed; - chlen = ntohs(ch->length); - if (chlen < sizeof(struct sctp_init_chunk)) - goto malformed; -@@ -2329,7 +2331,8 @@ int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep, - * VIOLATION error. We build the ERROR chunk here and let the normal - * error handling code build and send the packet. - */ -- if (param.v != (void *)chunk->chunk_end) -+ if (param.v != (void *)peer_init + -+ SCTP_PAD4(ntohs(peer_init->chunk_hdr.length))) - return sctp_process_inv_paramlength(asoc, param.p, chunk, errp); - - /* The only missing mandatory param possible today is -diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c -index 613c5c3fa..747c9c092 100644 ---- a/net/sctp/sm_statefuns.c -+++ b/net/sctp/sm_statefuns.c -@@ -705,11 +705,12 @@ enum sctp_disposition sctp_sf_do_5_1D_ce(struct net *net, - struct sctp_cmd_seq *commands) - { - struct sctp_ulpevent *ev, *ai_ev = NULL, *auth_ev = NULL; -+ struct sctp_chunk *err_chk_p = NULL; - struct sctp_association *new_asoc; - struct sctp_init_chunk *peer_init; - struct sctp_chunk *chunk = arg; -- struct sctp_chunk *err_chk_p; - struct sctp_chunk *repl; -+ enum sctp_cid cid; - struct sock *sk; - int error = 0; - -@@ -783,6 +784,18 @@ enum sctp_disposition sctp_sf_do_5_1D_ce(struct net *net, - } - } - -+ peer_init = (struct sctp_init_chunk *)(chunk->subh.cookie_hdr + 1); -+ cid = peer_init->chunk_hdr.type; -+ if (!sctp_verify_init(net, ep, asoc, cid, peer_init, chunk, -+ &err_chk_p)) { -+ sctp_association_free(new_asoc); -+ if (err_chk_p) -+ sctp_chunk_free(err_chk_p); -+ return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); -+ } -+ if (err_chk_p) -+ sctp_chunk_free(err_chk_p); -+ - if (security_sctp_assoc_request(new_asoc, chunk->head_skb ?: chunk->skb)) { - sctp_association_free(new_asoc); - return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); -@@ -796,7 +809,6 @@ enum sctp_disposition sctp_sf_do_5_1D_ce(struct net *net, - /* This is a brand-new association, so these are not yet side - * effects--it is safe to run them here. - */ -- peer_init = (struct sctp_init_chunk *)(chunk->subh.cookie_hdr + 1); - if (!sctp_process_init(new_asoc, chunk, - &chunk->subh.cookie_hdr->c.peer_addr, - peer_init, GFP_ATOMIC)) -@@ -2210,10 +2222,12 @@ enum sctp_disposition sctp_sf_do_5_2_4_dupcook( - void *arg, - struct sctp_cmd_seq *commands) - { -+ struct sctp_chunk *err_chk_p = NULL; - struct sctp_association *new_asoc; -+ struct sctp_init_chunk *peer_init; - struct sctp_chunk *chunk = arg; - enum sctp_disposition retval; -- struct sctp_chunk *err_chk_p; -+ enum sctp_cid cid; - int error = 0; - char action; - -@@ -2282,6 +2296,20 @@ enum sctp_disposition sctp_sf_do_5_2_4_dupcook( - switch (action) { - case 'A': /* Association restart. */ - case 'B': /* Collision case B. */ -+ peer_init = (struct sctp_init_chunk *) -+ (chunk->subh.cookie_hdr + 1); -+ cid = peer_init->chunk_hdr.type; -+ if (!sctp_verify_init(net, ep, asoc, cid, peer_init, chunk, -+ &err_chk_p)) { -+ sctp_association_free(new_asoc); -+ if (err_chk_p) -+ sctp_chunk_free(err_chk_p); -+ return sctp_sf_pdiscard(net, ep, asoc, type, arg, -+ commands); -+ } -+ if (err_chk_p) -+ sctp_chunk_free(err_chk_p); -+ fallthrough; - case 'D': /* Collision case D. */ - /* Update socket peer label if first association. */ - if (security_sctp_assoc_request((struct sctp_association *)asoc, --- -2.53.0 - - diff --git a/SPECS/91/linux/CVE/0004-cifs-Fix-undefined-variables.patch b/SPECS/91/linux/CVE/0004-cifs-Fix-undefined-variables.patch deleted file mode 100644 index c793e5eea7..0000000000 --- a/SPECS/91/linux/CVE/0004-cifs-Fix-undefined-variables.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 4b014e530ac15150007076e3ef8edf66ea056bf8 Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Mon, 18 May 2026 22:13:09 +0100 -Subject: [PATCH] cifs: Fix undefined variables - -[ Upstream commit 8cf8b5ae8e093132b0dce0a932af10c9ef077936 ] - -Fix a couple of undefined variables introduced by the patch to fix tearing -on ->remote_i_size and ->zero_point. For some reason, make W=1 with gcc -doesn't give undefined variable warnings (but clang does). - -Fixes: 2c8f4742bb76 ("netfs: Fix potential for tearing in ->remote_i_size and ->zero_point") -Reported-by: kernel test robot -Closes: https://lore.kernel.org/oe-kbuild-all/202605031459.eX5UbO3K-lkp@intel.com/ -Closes: https://lore.kernel.org/oe-kbuild-all/202605021450.ca5QGqLH-lkp@intel.com/ -cc: Steve French -cc: Paulo Alcantara -cc: Matthew Wilcox -cc: Christian Brauner -cc: linux-cifs@vger.kernel.org -cc: netfs@lists.linux.dev -cc: linux-fsdevel@vger.kernel.org -Signed-off-by: Linus Torvalds -[Srinidhi: cherry picked from commit 8cf8b5ae8e09 for linux 6.12.y. - Mandatory follow-up fix for the CVE-2026-64160. - fourth and last patch to fix CVE-2026-64160] -Signed-off-by: Srinidhi Rao ---- - fs/smb/client/cifsfs.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c -index f26b539e1725..8098cd850c9e 100644 ---- a/fs/smb/client/cifsfs.c -+++ b/fs/smb/client/cifsfs.c -@@ -1286,7 +1286,7 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off, - struct cifsFileInfo *smb_file_src = src_file->private_data; - struct cifsFileInfo *smb_file_target = dst_file->private_data; - struct cifs_tcon *target_tcon, *src_tcon; -- unsigned long long i_size, old_size, new_size, zero_point; -+ unsigned long long i_size, new_size; - unsigned long long destend, fstart, fend; - unsigned int xid; - int rc; -@@ -1354,7 +1354,7 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off, - goto unlock; - - spin_lock(&target_inode->i_lock); -- if (fend > zero_point) -+ if (fend > target_cifsi->netfs._zero_point) - netfs_write_zero_point(target_inode, fend + 1); - i_size = target_inode->i_size; - spin_unlock(&target_inode->i_lock); -@@ -1369,7 +1369,7 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off, - if (target_tcon->ses->server->ops->duplicate_extents) { - rc = target_tcon->ses->server->ops->duplicate_extents(xid, - smb_file_src, smb_file_target, off, len, destoff); -- if (rc == 0 && new_size > old_size) { -+ if (rc == 0 && new_size > i_size) { - truncate_setsize(target_inode, new_size); - fscache_resize_cookie(cifs_inode_cookie(target_inode), - new_size); --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/CVE-2026-53091/0001-net_sched-make-room-for-struct-qdisc_skb_cb-pkt_segs.patch b/SPECS/91/linux/CVE/CVE-2026-53091/0001-net_sched-make-room-for-struct-qdisc_skb_cb-pkt_segs.patch deleted file mode 100644 index 5ced3c2ba1..0000000000 --- a/SPECS/91/linux/CVE/CVE-2026-53091/0001-net_sched-make-room-for-struct-qdisc_skb_cb-pkt_segs.patch +++ /dev/null @@ -1,150 +0,0 @@ -From d5097daba6af74ef15b95bbcc366c8e3ca2a190e Mon Sep 17 00:00:00 2001 -From: Eric Dumazet -Date: Fri, 21 Nov 2025 08:32:43 +0000 -Subject: [PATCH 07/22] net_sched: make room for (struct - qdisc_skb_cb)->pkt_segs - -[ Upstream commit b2a38f6df9dab0b05858746edcbe2403f8f4e4ec ] - -Add a new u16 field, next to pkt_len : pkt_segs - -This will cache shinfo->gso_segs to speed up qdisc deqeue(). - -Move slave_dev_queue_mapping at the end of qdisc_skb_cb, -and move three bits from tc_skb_cb : -- post_ct -- post_ct_snat -- post_ct_dnat - -Signed-off-by: Eric Dumazet -Link: https://patch.msgid.link/20251121083256.674562-2-edumazet@google.com -Signed-off-by: Paolo Abeni -[Srinidhi: cherry picked from commit b2a38f6df9dab0b05858746edcbe2403f8f4e4ec to v6.12.y] -Signed-off-by: Srinidhi Rao ---- - include/net/sch_generic.h | 18 +++++++++--------- - net/core/dev.c | 2 +- - net/sched/act_ct.c | 8 ++++---- - net/sched/cls_api.c | 6 +++--- - net/sched/cls_flower.c | 2 +- - 5 files changed, 18 insertions(+), 18 deletions(-) - -diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h -index d3e1f91f81cd..a5ade9daec11 100644 ---- a/include/net/sch_generic.h -+++ b/include/net/sch_generic.h -@@ -432,13 +432,16 @@ struct tcf_proto { - }; - - struct qdisc_skb_cb { -- struct { -- unsigned int pkt_len; -- u16 slave_dev_queue_mapping; -- u16 tc_classid; -- }; -+ unsigned int pkt_len; -+ u16 pkt_segs; -+ u16 tc_classid; - #define QDISC_CB_PRIV_LEN 20 - unsigned char data[QDISC_CB_PRIV_LEN]; -+ -+ u16 slave_dev_queue_mapping; -+ u8 post_ct:1; -+ u8 post_ct_snat:1; -+ u8 post_ct_dnat:1; - }; - - typedef void tcf_chain_head_change_t(struct tcf_proto *tp_head, void *priv); -@@ -1108,11 +1111,8 @@ struct tc_skb_cb { - struct qdisc_skb_cb qdisc_cb; - u32 drop_reason; - -- u16 zone; /* Only valid if post_ct = true */ -+ u16 zone; /* Only valid if qdisc_skb_cb(skb)->post_ct = true */ - u16 mru; -- u8 post_ct:1; -- u8 post_ct_snat:1; -- u8 post_ct_dnat:1; - }; - - static inline struct tc_skb_cb *tc_skb_cb(const struct sk_buff *skb) -diff --git a/net/core/dev.c b/net/core/dev.c -index 261e3e7945aa..121a15eeac75 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -4115,7 +4115,7 @@ static int tc_run(struct tcx_entry *entry, struct sk_buff *skb, - return ret; - - tc_skb_cb(skb)->mru = 0; -- tc_skb_cb(skb)->post_ct = false; -+ qdisc_skb_cb(skb)->post_ct = false; - tcf_set_drop_reason(skb, *drop_reason); - - mini_qdisc_bstats_cpu_update(miniq, skb); -diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c -index c82755749211..1dc6bc848bc6 100644 ---- a/net/sched/act_ct.c -+++ b/net/sched/act_ct.c -@@ -952,9 +952,9 @@ static int tcf_ct_act_nat(struct sk_buff *skb, - return err & NF_VERDICT_MASK; - - if (action & BIT(NF_NAT_MANIP_SRC)) -- tc_skb_cb(skb)->post_ct_snat = 1; -+ qdisc_skb_cb(skb)->post_ct_snat = 1; - if (action & BIT(NF_NAT_MANIP_DST)) -- tc_skb_cb(skb)->post_ct_dnat = 1; -+ qdisc_skb_cb(skb)->post_ct_dnat = 1; - - return err; - #else -@@ -990,7 +990,7 @@ TC_INDIRECT_SCOPE int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a, - tcf_action_update_bstats(&c->common, skb); - - if (clear) { -- tc_skb_cb(skb)->post_ct = false; -+ qdisc_skb_cb(skb)->post_ct = false; - ct = nf_ct_get(skb, &ctinfo); - if (ct) { - nf_ct_put(ct); -@@ -1101,7 +1101,7 @@ TC_INDIRECT_SCOPE int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a, - out_push: - skb_push_rcsum(skb, nh_ofs); - -- tc_skb_cb(skb)->post_ct = true; -+ qdisc_skb_cb(skb)->post_ct = true; - tc_skb_cb(skb)->zone = p->zone; - out_clear: - if (defrag) -diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c -index 24c1d0480bc5..a63f46e0d612 100644 ---- a/net/sched/cls_api.c -+++ b/net/sched/cls_api.c -@@ -1872,9 +1872,9 @@ int tcf_classify(struct sk_buff *skb, - } - ext->chain = last_executed_chain; - ext->mru = cb->mru; -- ext->post_ct = cb->post_ct; -- ext->post_ct_snat = cb->post_ct_snat; -- ext->post_ct_dnat = cb->post_ct_dnat; -+ ext->post_ct = qdisc_skb_cb(skb)->post_ct; -+ ext->post_ct_snat = qdisc_skb_cb(skb)->post_ct_snat; -+ ext->post_ct_dnat = qdisc_skb_cb(skb)->post_ct_dnat; - ext->zone = cb->zone; - } - } -diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c -index 099ff6a3e1f5..7669371c1354 100644 ---- a/net/sched/cls_flower.c -+++ b/net/sched/cls_flower.c -@@ -326,7 +326,7 @@ TC_INDIRECT_SCOPE int fl_classify(struct sk_buff *skb, - struct tcf_result *res) - { - struct cls_fl_head *head = rcu_dereference_bh(tp->root); -- bool post_ct = tc_skb_cb(skb)->post_ct; -+ bool post_ct = qdisc_skb_cb(skb)->post_ct; - u16 zone = tc_skb_cb(skb)->zone; - struct fl_flow_key skb_key; - struct fl_flow_mask *mask; --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/CVE-2026-53091/0002-net-init-shinfo-gso_segs-from-qdisc_pkt_len_init.patch b/SPECS/91/linux/CVE/CVE-2026-53091/0002-net-init-shinfo-gso_segs-from-qdisc_pkt_len_init.patch deleted file mode 100644 index 0970dadef1..0000000000 --- a/SPECS/91/linux/CVE/CVE-2026-53091/0002-net-init-shinfo-gso_segs-from-qdisc_pkt_len_init.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 0c992a798fe97b12d7340755c20c52cc339c9c73 Mon Sep 17 00:00:00 2001 -From: Eric Dumazet -Date: Fri, 21 Nov 2025 08:32:44 +0000 -Subject: [PATCH 08/22] net: init shinfo->gso_segs from qdisc_pkt_len_init() - -[ Upstream commit be1b70ab21cbe8f8bb8ecf39eb34880882252773 ] - -Qdisc use shinfo->gso_segs for their pkts stats in bstats_update(), -but this field needs to be initialized for SKB_GSO_DODGY users. - -Signed-off-by: Eric Dumazet -Link: https://patch.msgid.link/20251121083256.674562-3-edumazet@google.com -Signed-off-by: Paolo Abeni -[Srinidhi: cherry picked from commit be1b70ab21cbe8f8bb8ecf39eb34880882252773 for linux v6.12.y] -Signed-off-by: Srinidhi Rao ---- - net/core/dev.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/net/core/dev.c b/net/core/dev.c -index 121a15eeac75..0254d30295cf 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -3849,7 +3849,7 @@ EXPORT_SYMBOL_GPL(validate_xmit_skb_list); - - static void qdisc_pkt_len_init(struct sk_buff *skb) - { -- const struct skb_shared_info *shinfo = skb_shinfo(skb); -+ struct skb_shared_info *shinfo = skb_shinfo(skb); - - qdisc_skb_cb(skb)->pkt_len = skb->len; - -@@ -3887,6 +3887,7 @@ static void qdisc_pkt_len_init(struct sk_buff *skb) - if (payload <= 0) - return; - gso_segs = DIV_ROUND_UP(payload, shinfo->gso_size); -+ shinfo->gso_segs = gso_segs; - } - qdisc_skb_cb(skb)->pkt_len += (gso_segs - 1) * hdr_len; - } --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/CVE-2026-53091/0003-net_sched-initialize-qdisc_skb_cb-skb-pkt_segs-in-qd.patch b/SPECS/91/linux/CVE/CVE-2026-53091/0003-net_sched-initialize-qdisc_skb_cb-skb-pkt_segs-in-qd.patch deleted file mode 100644 index b1cc1f6632..0000000000 --- a/SPECS/91/linux/CVE/CVE-2026-53091/0003-net_sched-initialize-qdisc_skb_cb-skb-pkt_segs-in-qd.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 00114251a0de652a86b6d496de84936d6b21a23e Mon Sep 17 00:00:00 2001 -From: Eric Dumazet -Date: Fri, 21 Nov 2025 08:32:45 +0000 -Subject: [PATCH 09/22] net_sched: initialize qdisc_skb_cb(skb)->pkt_segs in - qdisc_pkt_len_init() - -[ Upstream commit 874c1928d37297a02452a404c8b496aad9fee146 ] - -qdisc_pkt_len_init() is currently initalizing qdisc_skb_cb(skb)->pkt_len. - -Add qdisc_skb_cb(skb)->pkt_segs initialization and rename this function -to qdisc_pkt_len_segs_init(). - -Signed-off-by: Eric Dumazet -Link: https://patch.msgid.link/20251121083256.674562-4-edumazet@google.com -Signed-off-by: Paolo Abeni -[Srinidhi: cherry picked from commit 874c1928d37297a02452a404c8b496aad9fee146 for linux v6.12.y] -Signed-off-by: Srinidhi Rao ---- - net/core/dev.c | 15 +++++++++++---- - net/sched/sch_cake.c | 7 +++++-- - 2 files changed, 16 insertions(+), 6 deletions(-) - -diff --git a/net/core/dev.c b/net/core/dev.c -index 0254d30295cf..64e1ae71634d 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -3847,17 +3847,23 @@ struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *d - } - EXPORT_SYMBOL_GPL(validate_xmit_skb_list); - --static void qdisc_pkt_len_init(struct sk_buff *skb) -+static void qdisc_pkt_len_segs_init(struct sk_buff *skb) - { - struct skb_shared_info *shinfo = skb_shinfo(skb); -+ u16 gso_segs; - - qdisc_skb_cb(skb)->pkt_len = skb->len; -+ if (!shinfo->gso_size) { -+ qdisc_skb_cb(skb)->pkt_segs = 1; -+ return; -+ } -+ -+ qdisc_skb_cb(skb)->pkt_segs = gso_segs = shinfo->gso_segs; - - /* To get more precise estimation of bytes sent on wire, - * we add to pkt_len the headers size of all segments - */ -- if (shinfo->gso_size && skb_transport_header_was_set(skb)) { -- u16 gso_segs = shinfo->gso_segs; -+ if (skb_transport_header_was_set(skb)) { - unsigned int hdr_len; - - /* mac layer + network layer */ -@@ -3888,6 +3894,7 @@ static void qdisc_pkt_len_init(struct sk_buff *skb) - return; - gso_segs = DIV_ROUND_UP(payload, shinfo->gso_size); - shinfo->gso_segs = gso_segs; -+ qdisc_skb_cb(skb)->pkt_segs = gso_segs; - } - qdisc_skb_cb(skb)->pkt_len += (gso_segs - 1) * hdr_len; - } -@@ -4472,7 +4479,7 @@ int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev) - - skb_update_prio(skb); - -- qdisc_pkt_len_init(skb); -+ qdisc_pkt_len_segs_init(skb); - tcx_set_ingress(skb, false); - #ifdef CONFIG_NET_EGRESS - if (static_branch_unlikely(&egress_needed_key)) { -diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c -index ba1a5c15e6ca..3b6d4daf48c7 100644 ---- a/net/sched/sch_cake.c -+++ b/net/sched/sch_cake.c -@@ -1403,8 +1403,11 @@ static u32 cake_overhead(struct cake_sched_data *q, const struct sk_buff *skb) - if (!shinfo->gso_size) - return cake_calc_overhead(q, len, off); - -- /* borrowed from qdisc_pkt_len_init() */ -- hdr_len = skb_transport_offset(skb); -+ /* borrowed from qdisc_pkt_len_segs_init() */ -+ if (!skb->encapsulation) -+ hdr_len = skb_transport_offset(skb); -+ else -+ hdr_len = skb_inner_transport_offset(skb); - - /* + transport layer */ - if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/CVE-2026-53091/0004-net-use-qdisc_pkt_len_segs_init-in-sch_handle_ingres.patch b/SPECS/91/linux/CVE/CVE-2026-53091/0004-net-use-qdisc_pkt_len_segs_init-in-sch_handle_ingres.patch deleted file mode 100644 index 2ec268b334..0000000000 --- a/SPECS/91/linux/CVE/CVE-2026-53091/0004-net-use-qdisc_pkt_len_segs_init-in-sch_handle_ingres.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 1eadbb58278fef01e9c0e62959bba05c819e2e6e Mon Sep 17 00:00:00 2001 -From: Eric Dumazet -Date: Fri, 21 Nov 2025 08:32:46 +0000 -Subject: [PATCH 10/22] net: use qdisc_pkt_len_segs_init() in - sch_handle_ingress() - -[ Upstream commit f9e00e51e391d08de31ca98d9f8609a1bceec2d2 ] - -sch_handle_ingress() sets qdisc_skb_cb(skb)->pkt_len. - -We also need to initialize qdisc_skb_cb(skb)->pkt_segs. - -Signed-off-by: Eric Dumazet -Link: https://patch.msgid.link/20251121083256.674562-5-edumazet@google.com -Signed-off-by: Paolo Abeni -[Srinidhi: cherry picked from commit f9e00e51e391d08de31ca98d9f8609a1bceec2d2 for linux v6.12.y] -Signed-off-by: Srinidhi Rao ---- - net/core/dev.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/net/core/dev.c b/net/core/dev.c -index 64e1ae71634d..145d9ca26375 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -4194,7 +4194,7 @@ sch_handle_ingress(struct sk_buff *skb, struct packet_type **pt_prev, int *ret, - *pt_prev = NULL; - } - -- qdisc_skb_cb(skb)->pkt_len = skb->len; -+ qdisc_pkt_len_segs_init(skb); - tcx_set_ingress(skb, true); - - if (static_branch_unlikely(&tcx_needed_key)) { --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/CVE-2026-53091/0005-net-dropreason-add-SKB_DROP_REASON_RECURSION_LIMIT.patch b/SPECS/91/linux/CVE/CVE-2026-53091/0005-net-dropreason-add-SKB_DROP_REASON_RECURSION_LIMIT.patch deleted file mode 100644 index 52f652c404..0000000000 --- a/SPECS/91/linux/CVE/CVE-2026-53091/0005-net-dropreason-add-SKB_DROP_REASON_RECURSION_LIMIT.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 5fe7bfc2ef0ccbf6a1f6cb39bc57ef064cd3a53c Mon Sep 17 00:00:00 2001 -From: Eric Dumazet -Date: Thu, 12 Mar 2026 20:18:23 +0000 -Subject: [PATCH 11/22] net: dropreason: add SKB_DROP_REASON_RECURSION_LIMIT - -[ Upstream commit d15d3de94a4766fb43d7fe7a72ed0479fb268131 ] - -ip[6]tunnel_xmit() can drop packets if a too deep recursion level -is detected. - -Add SKB_DROP_REASON_RECURSION_LIMIT drop reason. - -We will use this reason later in __dev_queue_xmit(). - -Signed-off-by: Eric Dumazet -Reviewed-by: Joe Damato -Link: https://patch.msgid.link/20260312201824.203093-2-edumazet@google.com -Signed-off-by: Jakub Kicinski -[Srinidhi: cherry picked from commit d15d3de94a4766fb43d7fe7a72ed0479fb268131 for linux v6.12.y] -Signed-off-by: Srinidhi Rao ---- - include/net/dropreason-core.h | 3 +++ - include/net/ip6_tunnel.h | 2 +- - net/ipv4/ip_tunnel_core.c | 2 +- - 3 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/include/net/dropreason-core.h b/include/net/dropreason-core.h -index 02e7be19b042..74205b56242d 100644 ---- a/include/net/dropreason-core.h -+++ b/include/net/dropreason-core.h -@@ -100,6 +100,7 @@ - FN(IP_TUNNEL_ECN) \ - FN(TUNNEL_TXINFO) \ - FN(LOCAL_MAC) \ -+ FN(RECURSION_LIMIT) \ - FNe(MAX) - - /** -@@ -458,6 +459,8 @@ enum skb_drop_reason { - * the MAC address of the local netdev. - */ - SKB_DROP_REASON_LOCAL_MAC, -+ /** @SKB_DROP_REASON_RECURSION_LIMIT: Dead loop on virtual device. */ -+ SKB_DROP_REASON_RECURSION_LIMIT, - /** - * @SKB_DROP_REASON_MAX: the maximum of core drop reasons, which - * shouldn't be used as a real 'reason' - only for tracing code gen -diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h -index b4ddfe4b9750..626421679d72 100644 ---- a/include/net/ip6_tunnel.h -+++ b/include/net/ip6_tunnel.h -@@ -162,7 +162,7 @@ static inline void ip6tunnel_xmit(struct sock *sk, struct sk_buff *skb, - dev->name); - DEV_STATS_INC(dev, tx_errors); - } -- kfree_skb(skb); -+ kfree_skb_reason(skb, SKB_DROP_REASON_RECURSION_LIMIT); - return; - } - -diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c -index d0ceb86e1687..157f30af3efc 100644 ---- a/net/ipv4/ip_tunnel_core.c -+++ b/net/ipv4/ip_tunnel_core.c -@@ -64,7 +64,7 @@ void iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb, - DEV_STATS_INC(dev, tx_errors); - } - ip_rt_put(rt); -- kfree_skb(skb); -+ kfree_skb_reason(skb, SKB_DROP_REASON_RECURSION_LIMIT); - return; - } - --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/CVE-2026-53091/0006-net-plumb-drop-reasons-to-__dev_queue_xmit.patch b/SPECS/91/linux/CVE/CVE-2026-53091/0006-net-plumb-drop-reasons-to-__dev_queue_xmit.patch deleted file mode 100644 index 28d477eafd..0000000000 --- a/SPECS/91/linux/CVE/CVE-2026-53091/0006-net-plumb-drop-reasons-to-__dev_queue_xmit.patch +++ /dev/null @@ -1,152 +0,0 @@ -From d2485630227fcd8cce63a8e37c48f2b21a73909a Mon Sep 17 00:00:00 2001 -From: Eric Dumazet -Date: Thu, 12 Mar 2026 20:18:24 +0000 -Subject: [PATCH 12/22] net: plumb drop reasons to __dev_queue_xmit() - -[ Upstream commit 045f977dd4ebdd3ad8e96cf684917adfc5805adb ] - -Add drop reasons to __dev_queue_xmit(): - -- SKB_DROP_REASON_DEV_READY : device is not UP. - -- SKB_DROP_REASON_RECURSION_LIMIT : recursion limit on virtual device is hit. - -Also add an unlikely() for the SKB_DROP_REASON_DEV_READY case, -and reduce indentation level. - -Signed-off-by: Eric Dumazet -Reviewed-by: Joe Damato -Link: https://patch.msgid.link/20260312201824.203093-3-edumazet@google.com -Signed-off-by: Jakub Kicinski -[Srinidhi: cherry picked from commit 045f977dd4ebdd3ad8e96cf684917adfc5805adb for linux v6.12.y] -Signed-off-by: Srinidhi Rao ---- - net/core/dev.c | 89 ++++++++++++++++++++++++++------------------------ - 1 file changed, 46 insertions(+), 43 deletions(-) - -diff --git a/net/core/dev.c b/net/core/dev.c -index 145d9ca26375..c5c83aa4f719 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -4462,9 +4462,10 @@ int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev) - { - struct net_device *dev = skb->dev; - struct netdev_queue *txq = NULL; -- struct Qdisc *q; -- int rc = -ENOMEM; -+ enum skb_drop_reason reason; -+ int cpu, rc = -ENOMEM; - bool again = false; -+ struct Qdisc *q; - - skb_reset_mac_header(skb); - skb_assert_len(skb); -@@ -4532,62 +4533,64 @@ int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev) - * Check this and shot the lock. It is not prone from deadlocks. - *Either shot noqueue qdisc, it is even simpler 8) - */ -- if (dev->flags & IFF_UP) { -- int cpu = smp_processor_id(); /* ok because BHs are off */ -+ if (unlikely(!(dev->flags & IFF_UP))) { -+ reason = SKB_DROP_REASON_DEV_READY; -+ goto drop; -+ } - -- /* Other cpus might concurrently change txq->xmit_lock_owner -- * to -1 or to their cpu id, but not to our id. -- */ -- if (READ_ONCE(txq->xmit_lock_owner) != cpu) { -- bool is_list = false; -+ cpu = smp_processor_id(); /* ok because BHs are off */ - -- if (dev_xmit_recursion()) -- goto recursion_alert; -+ /* Other cpus might concurrently change txq->xmit_lock_owner -+ * to -1 or to their cpu id, but not to our id. -+ */ -+ if (likely(READ_ONCE(txq->xmit_lock_owner) != cpu)) { -+ bool is_list = false; - -- skb = validate_xmit_skb(skb, dev, &again); -- if (!skb) -- goto out; -+ if (dev_xmit_recursion()) -+ goto recursion_alert; - -- HARD_TX_LOCK(dev, txq, cpu); -+ skb = validate_xmit_skb(skb, dev, &again); -+ if (!skb) -+ goto out; - -- if (!netif_xmit_stopped(txq)) { -- is_list = !!skb->next; -+ HARD_TX_LOCK(dev, txq, cpu); - -- dev_xmit_recursion_inc(); -- skb = dev_hard_start_xmit(skb, dev, txq, &rc); -- dev_xmit_recursion_dec(); -+ if (!netif_xmit_stopped(txq)) { -+ is_list = !!skb->next; - -- /* GSO segments a single SKB into -- * a list of frames. TCP expects error -- * to mean none of the data was sent. -- */ -- if (is_list) -- rc = NETDEV_TX_OK; -- } -- HARD_TX_UNLOCK(dev, txq); -- if (!skb) /* xmit completed */ -- goto out; -+ dev_xmit_recursion_inc(); -+ skb = dev_hard_start_xmit(skb, dev, txq, &rc); -+ dev_xmit_recursion_dec(); - -- net_crit_ratelimited("Virtual device %s asks to queue packet!\n", -- dev->name); -- /* NETDEV_TX_BUSY or queue was stopped */ -- if (!is_list) -- rc = -ENETDOWN; -- } else { -- /* Recursion is detected! It is possible, -- * unfortunately -+ /* GSO segments a single SKB into a list of frames. -+ * TCP expects error to mean none of the data was sent. - */ --recursion_alert: -- net_crit_ratelimited("Dead loop on virtual device %s, fix it urgently!\n", -- dev->name); -- rc = -ENETDOWN; -+ if (is_list) -+ rc = NETDEV_TX_OK; - } -+ HARD_TX_UNLOCK(dev, txq); -+ if (!skb) /* xmit completed */ -+ goto out; -+ -+ net_crit_ratelimited("Virtual device %s asks to queue packet!\n", -+ dev->name); -+ /* NETDEV_TX_BUSY or queue was stopped */ -+ if (!is_list) -+ rc = -ENETDOWN; -+ } else { -+ /* Recursion is detected! It is possible unfortunately. */ -+recursion_alert: -+ net_crit_ratelimited("Dead loop on virtual device %s, fix it urgently!\n", -+ dev->name); -+ rc = -ENETDOWN; - } - -+ reason = SKB_DROP_REASON_RECURSION_LIMIT; -+drop: - rcu_read_unlock_bh(); - - dev_core_stats_tx_dropped_inc(dev); -- kfree_skb_list(skb); -+ kfree_skb_list_reason(skb, reason); - return rc; - out: - rcu_read_unlock_bh(); --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/CVE-2026-53091/0007-net-qdisc_pkt_len_segs_init-cleanup.patch b/SPECS/91/linux/CVE/CVE-2026-53091/0007-net-qdisc_pkt_len_segs_init-cleanup.patch deleted file mode 100644 index f546ff47ef..0000000000 --- a/SPECS/91/linux/CVE/CVE-2026-53091/0007-net-qdisc_pkt_len_segs_init-cleanup.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 4a06a343651758210f2adb79db574c5ebf9df869 Mon Sep 17 00:00:00 2001 -From: Eric Dumazet -Date: Fri, 3 Apr 2026 22:15:39 +0000 -Subject: [PATCH 13/22] net: qdisc_pkt_len_segs_init() cleanup - -[ Upstream commit 30e02ec3b4b6bd429a4824f125eb843a291dcccf ] - -Reduce indentation level by returning early if the transport header -was not set. - -Add an unlikely() clause as this is not the common case. - -No functional change. - -Signed-off-by: Eric Dumazet -Reviewed-by: Joe Damato -Link: https://patch.msgid.link/20260403221540.3297753-2-edumazet@google.com -Signed-off-by: Jakub Kicinski -[Srinidhi: cherry picked from commit 30e02ec3b4b6bd429a4824f125eb843a291dcccf for linux v6.12.y] -Signed-off-by: Srinidhi Rao ---- - net/core/dev.c | 57 ++++++++++++++++++++++++++------------------------ - 1 file changed, 30 insertions(+), 27 deletions(-) - -diff --git a/net/core/dev.c b/net/core/dev.c -index c5c83aa4f719..e7580d718f45 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -3850,6 +3850,7 @@ EXPORT_SYMBOL_GPL(validate_xmit_skb_list); - static void qdisc_pkt_len_segs_init(struct sk_buff *skb) - { - struct skb_shared_info *shinfo = skb_shinfo(skb); -+ unsigned int hdr_len; - u16 gso_segs; - - qdisc_skb_cb(skb)->pkt_len = skb->len; -@@ -3863,41 +3864,43 @@ static void qdisc_pkt_len_segs_init(struct sk_buff *skb) - /* To get more precise estimation of bytes sent on wire, - * we add to pkt_len the headers size of all segments - */ -- if (skb_transport_header_was_set(skb)) { -- unsigned int hdr_len; -+ if (unlikely(!skb_transport_header_was_set(skb))) -+ return; - -- /* mac layer + network layer */ -+ /* mac layer + network layer */ -+ if (!skb->encapsulation) - hdr_len = skb_transport_offset(skb); -+ else -+ hdr_len = skb_inner_transport_offset(skb); - -- /* + transport layer */ -- if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))) { -- const struct tcphdr *th; -- struct tcphdr _tcphdr; -+ /* + transport layer */ -+ if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))) { -+ const struct tcphdr *th; -+ struct tcphdr _tcphdr; - -- th = skb_header_pointer(skb, hdr_len, -- sizeof(_tcphdr), &_tcphdr); -- if (likely(th)) -- hdr_len += __tcp_hdrlen(th); -- } else if (shinfo->gso_type & SKB_GSO_UDP_L4) { -- struct udphdr _udphdr; -+ th = skb_header_pointer(skb, hdr_len, -+ sizeof(_tcphdr), &_tcphdr); -+ if (likely(th)) -+ hdr_len += __tcp_hdrlen(th); -+ } else if (shinfo->gso_type & SKB_GSO_UDP_L4) { -+ struct udphdr _udphdr; - -- if (skb_header_pointer(skb, hdr_len, -- sizeof(_udphdr), &_udphdr)) -- hdr_len += sizeof(struct udphdr); -- } -+ if (skb_header_pointer(skb, hdr_len, -+ sizeof(_udphdr), &_udphdr)) -+ hdr_len += sizeof(struct udphdr); -+ } - -- if (unlikely(shinfo->gso_type & SKB_GSO_DODGY)) { -- int payload = skb->len - hdr_len; -+ if (unlikely(shinfo->gso_type & SKB_GSO_DODGY)) { -+ int payload = skb->len - hdr_len; - -- /* Malicious packet. */ -- if (payload <= 0) -- return; -- gso_segs = DIV_ROUND_UP(payload, shinfo->gso_size); -- shinfo->gso_segs = gso_segs; -- qdisc_skb_cb(skb)->pkt_segs = gso_segs; -- } -- qdisc_skb_cb(skb)->pkt_len += (gso_segs - 1) * hdr_len; -+ /* Malicious packet. */ -+ if (payload <= 0) -+ return; -+ gso_segs = DIV_ROUND_UP(payload, shinfo->gso_size); -+ shinfo->gso_segs = gso_segs; -+ qdisc_skb_cb(skb)->pkt_segs = gso_segs; - } -+ qdisc_skb_cb(skb)->pkt_len += (gso_segs - 1) * hdr_len; - } - - static int dev_qdisc_enqueue(struct sk_buff *skb, struct Qdisc *q, --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/CVE-2026-53091/0008-net-pull-headers-in-qdisc_pkt_len_segs_init.patch b/SPECS/91/linux/CVE/CVE-2026-53091/0008-net-pull-headers-in-qdisc_pkt_len_segs_init.patch deleted file mode 100644 index 00a4468aac..0000000000 --- a/SPECS/91/linux/CVE/CVE-2026-53091/0008-net-pull-headers-in-qdisc_pkt_len_segs_init.patch +++ /dev/null @@ -1,168 +0,0 @@ -From 40e864a121a00a609cb084d53710c01f303bf506 Mon Sep 17 00:00:00 2001 -From: Eric Dumazet -Date: Fri, 3 Apr 2026 22:15:40 +0000 -Subject: [PATCH 14/22] net: pull headers in qdisc_pkt_len_segs_init() - -[ Upstream commit 7fb4c19670110f052c04e1ec1d2b953b9f4f57e4 ] - -Most ndo_start_xmit() methods expects headers of gso packets -to be already in skb->head. - -net/core/tso.c users are particularly at risk, because tso_build_hdr() -does a memcpy(hdr, skb->data, hdr_len); - -qdisc_pkt_len_segs_init() already does a dissection of gso packets. - -Use pskb_may_pull() instead of skb_header_pointer() to make -sure drivers do not have to reimplement this. - -Some malicious packets could be fed, detect them so that we can -drop them sooner with a new SKB_DROP_REASON_SKB_BAD_GSO drop_reason. - -Fixes: e876f208af18 ("net: Add a software TSO helper API") -Signed-off-by: Eric Dumazet -Reviewed-by: Joe Damato -Link: https://patch.msgid.link/20260403221540.3297753-3-edumazet@google.com -Signed-off-by: Jakub Kicinski -[Srinidhi: cherry picked from commit 7fb4c19670110f052c04e1ec1d2b953b9f4f57e4 for linux v6.12.y] -Signed-off-by: Srinidhi Rao ---- - include/net/dropreason-core.h | 3 +++ - net/core/dev.c | 51 +++++++++++++++++++++-------------- - 2 files changed, 34 insertions(+), 20 deletions(-) - -diff --git a/include/net/dropreason-core.h b/include/net/dropreason-core.h -index 74205b56242d..5970eead1bb4 100644 ---- a/include/net/dropreason-core.h -+++ b/include/net/dropreason-core.h -@@ -64,6 +64,7 @@ - FN(UNHANDLED_PROTO) \ - FN(SKB_CSUM) \ - FN(SKB_GSO_SEG) \ -+ FN(SKB_BAD_GSO) \ - FN(SKB_UCOPY_FAULT) \ - FN(DEV_HDR) \ - FN(DEV_READY) \ -@@ -323,6 +324,8 @@ enum skb_drop_reason { - SKB_DROP_REASON_SKB_CSUM, - /** @SKB_DROP_REASON_SKB_GSO_SEG: gso segmentation error */ - SKB_DROP_REASON_SKB_GSO_SEG, -+ /** @SKB_DROP_REASON_SKB_BAD_GSO: malicious gso packet. */ -+ SKB_DROP_REASON_SKB_BAD_GSO, - /** - * @SKB_DROP_REASON_SKB_UCOPY_FAULT: failed to copy data from user space, - * e.g., via zerocopy_sg_from_iter() or skb_orphan_frags_rx() -diff --git a/net/core/dev.c b/net/core/dev.c -index e7580d718f45..1955a9b2078f 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -3847,16 +3847,16 @@ struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *d - } - EXPORT_SYMBOL_GPL(validate_xmit_skb_list); - --static void qdisc_pkt_len_segs_init(struct sk_buff *skb) -+static enum skb_drop_reason qdisc_pkt_len_segs_init(struct sk_buff *skb) - { - struct skb_shared_info *shinfo = skb_shinfo(skb); -- unsigned int hdr_len; -+ unsigned int hdr_len, tlen; - u16 gso_segs; - - qdisc_skb_cb(skb)->pkt_len = skb->len; - if (!shinfo->gso_size) { - qdisc_skb_cb(skb)->pkt_segs = 1; -- return; -+ return SKB_NOT_DROPPED_YET; - } - - qdisc_skb_cb(skb)->pkt_segs = gso_segs = shinfo->gso_segs; -@@ -3864,43 +3864,49 @@ static void qdisc_pkt_len_segs_init(struct sk_buff *skb) - /* To get more precise estimation of bytes sent on wire, - * we add to pkt_len the headers size of all segments - */ -- if (unlikely(!skb_transport_header_was_set(skb))) -- return; - - /* mac layer + network layer */ -- if (!skb->encapsulation) -+ if (!skb->encapsulation) { -+ if (unlikely(!skb_transport_header_was_set(skb))) -+ return SKB_NOT_DROPPED_YET; - hdr_len = skb_transport_offset(skb); -- else -+ } else { - hdr_len = skb_inner_transport_offset(skb); -- -+ } - /* + transport layer */ - if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))) { - const struct tcphdr *th; -- struct tcphdr _tcphdr; - -- th = skb_header_pointer(skb, hdr_len, -- sizeof(_tcphdr), &_tcphdr); -- if (likely(th)) -- hdr_len += __tcp_hdrlen(th); -- } else if (shinfo->gso_type & SKB_GSO_UDP_L4) { -- struct udphdr _udphdr; -+ if (!pskb_may_pull(skb, hdr_len + sizeof(struct tcphdr))) -+ return SKB_DROP_REASON_SKB_BAD_GSO; - -- if (skb_header_pointer(skb, hdr_len, -- sizeof(_udphdr), &_udphdr)) -- hdr_len += sizeof(struct udphdr); -+ th = (const struct tcphdr *)(skb->data + hdr_len); -+ tlen = __tcp_hdrlen(th); -+ if (tlen < sizeof(*th)) -+ return SKB_DROP_REASON_SKB_BAD_GSO; -+ hdr_len += tlen; -+ if (!pskb_may_pull(skb, hdr_len)) -+ return SKB_DROP_REASON_SKB_BAD_GSO; -+ } else if (shinfo->gso_type & SKB_GSO_UDP_L4) { -+ if (!pskb_may_pull(skb, hdr_len + sizeof(struct udphdr))) -+ return SKB_DROP_REASON_SKB_BAD_GSO; -+ hdr_len += sizeof(struct udphdr); - } - -+ /* prior pskb_may_pull() might have changed skb->head. */ -+ shinfo = skb_shinfo(skb); - if (unlikely(shinfo->gso_type & SKB_GSO_DODGY)) { - int payload = skb->len - hdr_len; - - /* Malicious packet. */ - if (payload <= 0) -- return; -+ return SKB_DROP_REASON_SKB_BAD_GSO; - gso_segs = DIV_ROUND_UP(payload, shinfo->gso_size); - shinfo->gso_segs = gso_segs; - qdisc_skb_cb(skb)->pkt_segs = gso_segs; - } - qdisc_skb_cb(skb)->pkt_len += (gso_segs - 1) * hdr_len; -+ return SKB_NOT_DROPPED_YET; - } - - static int dev_qdisc_enqueue(struct sk_buff *skb, struct Qdisc *q, -@@ -4476,6 +4482,12 @@ int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev) - if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_SCHED_TSTAMP)) - __skb_tstamp_tx(skb, NULL, NULL, skb->sk, SCM_TSTAMP_SCHED); - -+ reason = qdisc_pkt_len_segs_init(skb); -+ if (unlikely(reason)) { -+ dev_core_stats_tx_dropped_inc(dev); -+ kfree_skb_reason(skb, reason); -+ return -EINVAL; -+ } - /* Disable soft irqs for various locks below. Also - * stops preemption for RCU. - */ -@@ -4483,7 +4495,6 @@ int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev) - - skb_update_prio(skb); - -- qdisc_pkt_len_segs_init(skb); - tcx_set_ingress(skb, false); - #ifdef CONFIG_NET_EGRESS - if (static_branch_unlikely(&egress_needed_key)) { --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/CVE-2026-53091/0009-xfrm-Do-not-clobber-inner-headers-when-already-set.patch b/SPECS/91/linux/CVE/CVE-2026-53091/0009-xfrm-Do-not-clobber-inner-headers-when-already-set.patch deleted file mode 100644 index 48d3a56b99..0000000000 --- a/SPECS/91/linux/CVE/CVE-2026-53091/0009-xfrm-Do-not-clobber-inner-headers-when-already-set.patch +++ /dev/null @@ -1,115 +0,0 @@ -From a239c4ecc4937c272067d1f383cbf35a2b006970 Mon Sep 17 00:00:00 2001 -From: Cosmin Ratiu -Date: Wed, 22 Apr 2026 17:06:48 +0300 -Subject: [PATCH 15/22] xfrm: Don't clobber inner headers when already set - -[ Upstream commit fa90a3145c0340c3f624206a81637c542254ea1d ] - -On VXLAN over IPsec egress, xfrm{4,6}_transport_output() blindly -overwrite inner_transport_header (== the inner TCP header saved in VXLAN -iptunnel_handle_offloads() -> skb_reset_inner_headers()) with the -current transport_header (== the VXLAN outer UDP header set by -udp_tunnel_xmit_skb()). - -This was a latent bug, harmless until commit [1] added a doff validation -check in qdisc_pkt_len_segs_init() for encapsulated GSO packets. With -the wrong inner_transport_header set by xfrm, qdisc_pkt_len_segs_init() -interprets inner_transport_header as a TCP header, reads doff=0 from the -upper byte of the VNI and drops the packet with DROP_REASON_SKB_BAD_GSO. - -Besides the use in GSO to determine the header size of segmented -packets, inner_transport_header might be used by drivers to set up -inner checksum offloading by pointing the HW to the inner transport -header. A quick browse through available drivers shows that mlx5 uses -skb->csum_start specifically for this scenario, while others either -don't support VXLAN over IPsec crypto offload (ixgbe) or the HW is -capable of parsing the packets itself (nfp, Chelsio). - -But in all cases, it is more correct to let the inner_transport_header -point to the innermost header instead of overwriting it in xfrm. - -So fix this by guarding all four inner header save sites in -xfrm_output.c (xfrm{4,6}_transport_output, xfrm{4,6}_tunnel_encap_add) -with a check for skb->inner_protocol. When inner_protocol is set, a -tunnel layer (VXLAN, Geneve, GRE, etc.) has already saved the correct -inner header offsets and they must not be overwritten. When -inner_protocol is zero, no prior tunnel encapsulation exists and xfrm -must save the inner headers itself. The tunnel mode checks are only -added for completion, since they aren't strictly required, as -xfrm_output() forces software GSO in tunnel mode before encap. - -This makes the previously added test pass: - # ./tools/testing/selftests/drivers/net/hw/ipsec_vxlan.py - TAP version 13 - 1..4 - ok 1 ipsec_vxlan.test_vxlan_ipsec_crypto_offload.outer_v4_inner_v4 - ok 2 ipsec_vxlan.test_vxlan_ipsec_crypto_offload.outer_v4_inner_v6 - ok 3 ipsec_vxlan.test_vxlan_ipsec_crypto_offload.outer_v6_inner_v4 - ok 4 ipsec_vxlan.test_vxlan_ipsec_crypto_offload.outer_v6_inner_v6 - # Totals: pass:4 fail:0 xfail:0 xpass:0 skip:0 error:0 - -[1] commit 7fb4c1967011 ("net: pull headers in qdisc_pkt_len_segs_init()") -Fixes: f1bd7d659ef0 ("xfrm: Add encapsulation header offsets while SKB is not encrypted") -Signed-off-by: Cosmin Ratiu -Signed-off-by: Steffen Klassert -[Srinidhi: cherry picked from commit fa90a3145c0340c3f624206a81637c542254ea1d for linux v6.12.y] -Signed-off-by: Srinidhi Rao ---- - net/xfrm/xfrm_output.c | 20 ++++++++++++++------ - 1 file changed, 14 insertions(+), 6 deletions(-) - -diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c -index a5b5d82bd755..3f71bd425b2c 100644 ---- a/net/xfrm/xfrm_output.c -+++ b/net/xfrm/xfrm_output.c -@@ -67,7 +67,9 @@ static int xfrm4_transport_output(struct xfrm_state *x, struct sk_buff *skb) - struct iphdr *iph = ip_hdr(skb); - int ihl = iph->ihl * 4; - -- skb_set_inner_transport_header(skb, skb_transport_offset(skb)); -+ if (!skb->inner_protocol) -+ skb_set_inner_transport_header(skb, -+ skb_transport_offset(skb)); - - skb_set_network_header(skb, -x->props.header_len); - skb->mac_header = skb->network_header + -@@ -168,7 +170,9 @@ static int xfrm6_transport_output(struct xfrm_state *x, struct sk_buff *skb) - int hdr_len; - - iph = ipv6_hdr(skb); -- skb_set_inner_transport_header(skb, skb_transport_offset(skb)); -+ if (!skb->inner_protocol) -+ skb_set_inner_transport_header(skb, -+ skb_transport_offset(skb)); - - hdr_len = xfrm6_hdr_offset(x, skb, &prevhdr); - if (hdr_len < 0) -@@ -277,8 +281,10 @@ static int xfrm4_tunnel_encap_add(struct xfrm_state *x, struct sk_buff *skb) - struct iphdr *top_iph; - int flags; - -- skb_set_inner_network_header(skb, skb_network_offset(skb)); -- skb_set_inner_transport_header(skb, skb_transport_offset(skb)); -+ if (!skb->inner_protocol) { -+ skb_set_inner_network_header(skb, skb_network_offset(skb)); -+ skb_set_inner_transport_header(skb, skb_transport_offset(skb)); -+ } - - skb_set_network_header(skb, -x->props.header_len); - skb->mac_header = skb->network_header + -@@ -322,8 +328,10 @@ static int xfrm6_tunnel_encap_add(struct xfrm_state *x, struct sk_buff *skb) - struct ipv6hdr *top_iph; - int dsfield; - -- skb_set_inner_network_header(skb, skb_network_offset(skb)); -- skb_set_inner_transport_header(skb, skb_transport_offset(skb)); -+ if (!skb->inner_protocol) { -+ skb_set_inner_network_header(skb, skb_network_offset(skb)); -+ skb_set_inner_transport_header(skb, skb_transport_offset(skb)); -+ } - - skb_set_network_header(skb, -x->props.header_len); - skb->mac_header = skb->network_header + --- -2.53.0 - diff --git a/SPECS/91/linux/CVE/KVM-Don-t-accept-obviously-wrong-gsi-values-via-KVM_.patch b/SPECS/91/linux/CVE/KVM-Don-t-accept-obviously-wrong-gsi-values-via-KVM_.patch deleted file mode 100644 index fc99a345fe..0000000000 --- a/SPECS/91/linux/CVE/KVM-Don-t-accept-obviously-wrong-gsi-values-via-KVM_.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 9131bdba4d58bd9abc8133d8df65273314a1493c Mon Sep 17 00:00:00 2001 -From: Jan H. Schönherr -Date: Thu, 7 Sep 2017 19:02:48 +0100 -Subject: [PATCH 14/23] KVM: Don't accept obviously wrong gsi values via KVM_IRQFD - -We cannot add routes for gsi values >= KVM_MAX_IRQ_ROUTES -- see -kvm_set_irq_routing(). Hence, there is no sense in accepting them -via KVM_IRQFD. Prevent them from entering the system in the first -place. - -Signed-off-by: Jan H. Schönherr -Signed-off-by: Paolo Bonzini ---- - virt/kvm/eventfd.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c -index 67b6fc1..dea42bf 100644 ---- a/virt/kvm/eventfd.c -+++ b/virt/kvm/eventfd.c -@@ -568,6 +568,8 @@ kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args) - { - if (args->flags & ~(KVM_IRQFD_FLAG_DEASSIGN | KVM_IRQFD_FLAG_RESAMPLE)) - return -EINVAL; -+ if (args->gsi >= KVM_MAX_IRQ_ROUTES) -+ return -EINVAL; - - if (args->flags & KVM_IRQFD_FLAG_DEASSIGN) - return kvm_irqfd_deassign(kvm, args); --- -2.7.4 - diff --git a/SPECS/91/linux/aarch64/0001-OF-DT-Overlay-configfs-interface.patch b/SPECS/91/linux/aarch64/0001-OF-DT-Overlay-configfs-interface.patch deleted file mode 100644 index 4dfbf56524..0000000000 --- a/SPECS/91/linux/aarch64/0001-OF-DT-Overlay-configfs-interface.patch +++ /dev/null @@ -1,418 +0,0 @@ -From 7c9b1443a5a5293fd6375fa43d3e81d0f3adb2dd Mon Sep 17 00:00:00 2001 -From: Pantelis Antoniou -Date: Wed, 3 Dec 2014 13:23:28 +0200 -Subject: [PATCH] OF: DT-Overlay configfs interface - -This is a port of Pantelis Antoniou's v3 port that makes use of the -new upstreamed configfs support for binary attributes. - -Original commit message: - -Add a runtime interface to using configfs for generic device tree overlay -usage. With it its possible to use device tree overlays without having -to use a per-platform overlay manager. - -Please see Documentation/devicetree/configfs-overlays.txt for more info. - -Changes since v2: -- Removed ifdef CONFIG_OF_OVERLAY (since for now it's required) -- Created a documentation entry -- Slight rewording in Kconfig - -Changes since v1: -- of_resolve() -> of_resolve_phandles(). - -Originally-signed-off-by: Pantelis Antoniou -Signed-off-by: Phil Elwell - -DT configfs: Fix build errors on other platforms - -Signed-off-by: Phil Elwell - -DT configfs: fix build error - -There is an error when compiling rpi-4.6.y branch: - CC drivers/of/configfs.o -drivers/of/configfs.c:291:21: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] - .default_groups = of_cfs_def_groups, - ^ -drivers/of/configfs.c:291:21: note: (near initialization for 'of_cfs_subsys.su_group.default_groups.next') - -The .default_groups is linked list since commit -1ae1602de028acaa42a0f6ff18d19756f8e825c6. -This commit uses configfs_add_default_group to fix this problem. - -Signed-off-by: Slawomir Stepien - -configfs: New of_overlay API - -of: configfs: Use of_overlay_fdt_apply API call - -The published API to the dynamic overlay application mechanism now -takes a Flattened Device Tree blob as input so that it can manage the -lifetime of the unflattened tree. Conveniently, the new API call - -of_overlay_fdt_apply - is virtually a drop-in replacement for -create_overlay, which can now be deleted. - -Signed-off-by: Phil Elwell ---- - .../devicetree/configfs-overlays.txt | 31 ++ - drivers/of/Kconfig | 11 + - drivers/of/Makefile | 1 + - drivers/of/configfs.c | 277 ++++++++++++++++++ - 4 files changed, 320 insertions(+) - create mode 100644 Documentation/devicetree/configfs-overlays.txt - create mode 100644 drivers/of/configfs.c - -diff --git a/Documentation/devicetree/configfs-overlays.txt b/Documentation/devicetree/configfs-overlays.txt -new file mode 100644 -index 00000000000000..5fa43e0643072c ---- /dev/null -+++ b/Documentation/devicetree/configfs-overlays.txt -@@ -0,0 +1,31 @@ -+Howto use the configfs overlay interface. -+ -+A device-tree configfs entry is created in /config/device-tree/overlays -+and and it is manipulated using standard file system I/O. -+Note that this is a debug level interface, for use by developers and -+not necessarily something accessed by normal users due to the -+security implications of having direct access to the kernel's device tree. -+ -+* To create an overlay you mkdir the directory: -+ -+ # mkdir /config/device-tree/overlays/foo -+ -+* Either you echo the overlay firmware file to the path property file. -+ -+ # echo foo.dtbo >/config/device-tree/overlays/foo/path -+ -+* Or you cat the contents of the overlay to the dtbo file -+ -+ # cat foo.dtbo >/config/device-tree/overlays/foo/dtbo -+ -+The overlay file will be applied, and devices will be created/destroyed -+as required. -+ -+To remove it simply rmdir the directory. -+ -+ # rmdir /config/device-tree/overlays/foo -+ -+The rationalle of the dual interface (firmware & direct copy) is that each is -+better suited to different use patterns. The firmware interface is what's -+intended to be used by hardware managers in the kernel, while the copy interface -+make sense for developers (since it avoids problems with namespaces). -diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig -index 0e2d608c3e207d..c634bd8a084327 100644 ---- a/drivers/of/Kconfig -+++ b/drivers/of/Kconfig -@@ -120,4 +120,15 @@ config OF_OVERLAY_KUNIT_TEST - config OF_NUMA - bool - -+config OF_DMA_DEFAULT_COHERENT -+ # arches should select this if DMA is coherent by default for OF devices -+ bool -+ -+config OF_CONFIGFS -+ bool "Device Tree Overlay ConfigFS interface" -+ select CONFIGFS_FS -+ select OF_OVERLAY -+ help -+ Enable a simple user-space driven DT overlay interface. -+ - endif # OF -diff --git a/drivers/of/Makefile b/drivers/of/Makefile -index 379a0afcbdc0bf..f294b36207f80c 100644 ---- a/drivers/of/Makefile -+++ b/drivers/of/Makefile -@@ -1,6 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - obj-y = base.o cpu.o device.o module.o platform.o property.o - obj-$(CONFIG_OF_KOBJ) += kobj.o -+obj-$(CONFIG_OF_CONFIGFS) += configfs.o - obj-$(CONFIG_OF_DYNAMIC) += dynamic.o - obj-$(CONFIG_OF_FLATTREE) += fdt.o empty_root.dtb.o - obj-$(CONFIG_OF_EARLY_FLATTREE) += fdt_address.o -diff --git a/drivers/of/configfs.c b/drivers/of/configfs.c -new file mode 100644 -index 00000000000000..0e6bccb8ff2ef5 ---- /dev/null -+++ b/drivers/of/configfs.c -@@ -0,0 +1,277 @@ -+/* -+ * Configfs entries for device-tree -+ * -+ * Copyright (C) 2013 - Pantelis Antoniou -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version -+ * 2 of the License, or (at your option) any later version. -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "of_private.h" -+ -+struct cfs_overlay_item { -+ struct config_item item; -+ -+ char path[PATH_MAX]; -+ -+ const struct firmware *fw; -+ struct device_node *overlay; -+ int ov_id; -+ -+ void *dtbo; -+ int dtbo_size; -+}; -+ -+static inline struct cfs_overlay_item *to_cfs_overlay_item( -+ struct config_item *item) -+{ -+ return item ? container_of(item, struct cfs_overlay_item, item) : NULL; -+} -+ -+static ssize_t cfs_overlay_item_path_show(struct config_item *item, -+ char *page) -+{ -+ struct cfs_overlay_item *overlay = to_cfs_overlay_item(item); -+ return sprintf(page, "%s\n", overlay->path); -+} -+ -+static ssize_t cfs_overlay_item_path_store(struct config_item *item, -+ const char *page, size_t count) -+{ -+ struct cfs_overlay_item *overlay = to_cfs_overlay_item(item); -+ const char *p = page; -+ char *s; -+ int err; -+ -+ /* if it's set do not allow changes */ -+ if (overlay->path[0] != '\0' || overlay->dtbo_size > 0) -+ return -EPERM; -+ -+ /* copy to path buffer (and make sure it's always zero terminated */ -+ count = snprintf(overlay->path, sizeof(overlay->path) - 1, "%s", p); -+ overlay->path[sizeof(overlay->path) - 1] = '\0'; -+ -+ /* strip trailing newlines */ -+ s = overlay->path + strlen(overlay->path); -+ while (s > overlay->path && *--s == '\n') -+ *s = '\0'; -+ -+ pr_debug("%s: path is '%s'\n", __func__, overlay->path); -+ -+ err = request_firmware(&overlay->fw, overlay->path, NULL); -+ if (err != 0) -+ goto out_err; -+ -+ err = of_overlay_fdt_apply((void *)overlay->fw->data, -+ (u32)overlay->fw->size, &overlay->ov_id, NULL); -+ if (err != 0) -+ goto out_err; -+ -+ return count; -+ -+out_err: -+ -+ release_firmware(overlay->fw); -+ overlay->fw = NULL; -+ -+ overlay->path[0] = '\0'; -+ return err; -+} -+ -+static ssize_t cfs_overlay_item_status_show(struct config_item *item, -+ char *page) -+{ -+ struct cfs_overlay_item *overlay = to_cfs_overlay_item(item); -+ -+ return sprintf(page, "%s\n", -+ overlay->ov_id > 0 ? "applied" : "unapplied"); -+} -+ -+CONFIGFS_ATTR(cfs_overlay_item_, path); -+CONFIGFS_ATTR_RO(cfs_overlay_item_, status); -+ -+static struct configfs_attribute *cfs_overlay_attrs[] = { -+ &cfs_overlay_item_attr_path, -+ &cfs_overlay_item_attr_status, -+ NULL, -+}; -+ -+static ssize_t cfs_overlay_item_dtbo_read(struct config_item *item, -+ void *buf, size_t max_count) -+{ -+ struct cfs_overlay_item *overlay = to_cfs_overlay_item(item); -+ -+ pr_debug("%s: buf=%p max_count=%zu\n", __func__, -+ buf, max_count); -+ -+ if (overlay->dtbo == NULL) -+ return 0; -+ -+ /* copy if buffer provided */ -+ if (buf != NULL) { -+ /* the buffer must be large enough */ -+ if (overlay->dtbo_size > max_count) -+ return -ENOSPC; -+ -+ memcpy(buf, overlay->dtbo, overlay->dtbo_size); -+ } -+ -+ return overlay->dtbo_size; -+} -+ -+static ssize_t cfs_overlay_item_dtbo_write(struct config_item *item, -+ const void *buf, size_t count) -+{ -+ struct cfs_overlay_item *overlay = to_cfs_overlay_item(item); -+ int err; -+ -+ /* if it's set do not allow changes */ -+ if (overlay->path[0] != '\0' || overlay->dtbo_size > 0) -+ return -EPERM; -+ -+ /* copy the contents */ -+ overlay->dtbo = kmemdup(buf, count, GFP_KERNEL); -+ if (overlay->dtbo == NULL) -+ return -ENOMEM; -+ -+ overlay->dtbo_size = count; -+ -+ err = of_overlay_fdt_apply(overlay->dtbo, overlay->dtbo_size, -+ &overlay->ov_id, NULL); -+ if (err != 0) -+ goto out_err; -+ -+ return count; -+ -+out_err: -+ kfree(overlay->dtbo); -+ overlay->dtbo = NULL; -+ overlay->dtbo_size = 0; -+ overlay->ov_id = 0; -+ -+ return err; -+} -+ -+CONFIGFS_BIN_ATTR(cfs_overlay_item_, dtbo, NULL, SZ_1M); -+ -+static struct configfs_bin_attribute *cfs_overlay_bin_attrs[] = { -+ &cfs_overlay_item_attr_dtbo, -+ NULL, -+}; -+ -+static void cfs_overlay_release(struct config_item *item) -+{ -+ struct cfs_overlay_item *overlay = to_cfs_overlay_item(item); -+ -+ if (overlay->ov_id > 0) -+ of_overlay_remove(&overlay->ov_id); -+ if (overlay->fw) -+ release_firmware(overlay->fw); -+ /* kfree with NULL is safe */ -+ kfree(overlay->dtbo); -+ kfree(overlay); -+} -+ -+static struct configfs_item_operations cfs_overlay_item_ops = { -+ .release = cfs_overlay_release, -+}; -+ -+static struct config_item_type cfs_overlay_type = { -+ .ct_item_ops = &cfs_overlay_item_ops, -+ .ct_attrs = cfs_overlay_attrs, -+ .ct_bin_attrs = cfs_overlay_bin_attrs, -+ .ct_owner = THIS_MODULE, -+}; -+ -+static struct config_item *cfs_overlay_group_make_item( -+ struct config_group *group, const char *name) -+{ -+ struct cfs_overlay_item *overlay; -+ -+ overlay = kzalloc(sizeof(*overlay), GFP_KERNEL); -+ if (!overlay) -+ return ERR_PTR(-ENOMEM); -+ -+ config_item_init_type_name(&overlay->item, name, &cfs_overlay_type); -+ return &overlay->item; -+} -+ -+static void cfs_overlay_group_drop_item(struct config_group *group, -+ struct config_item *item) -+{ -+ struct cfs_overlay_item *overlay = to_cfs_overlay_item(item); -+ -+ config_item_put(&overlay->item); -+} -+ -+static struct configfs_group_operations overlays_ops = { -+ .make_item = cfs_overlay_group_make_item, -+ .drop_item = cfs_overlay_group_drop_item, -+}; -+ -+static struct config_item_type overlays_type = { -+ .ct_group_ops = &overlays_ops, -+ .ct_owner = THIS_MODULE, -+}; -+ -+static struct configfs_group_operations of_cfs_ops = { -+ /* empty - we don't allow anything to be created */ -+}; -+ -+static struct config_item_type of_cfs_type = { -+ .ct_group_ops = &of_cfs_ops, -+ .ct_owner = THIS_MODULE, -+}; -+ -+struct config_group of_cfs_overlay_group; -+ -+static struct configfs_subsystem of_cfs_subsys = { -+ .su_group = { -+ .cg_item = { -+ .ci_namebuf = "device-tree", -+ .ci_type = &of_cfs_type, -+ }, -+ }, -+ .su_mutex = __MUTEX_INITIALIZER(of_cfs_subsys.su_mutex), -+}; -+ -+static int __init of_cfs_init(void) -+{ -+ int ret; -+ -+ pr_info("%s\n", __func__); -+ -+ config_group_init(&of_cfs_subsys.su_group); -+ config_group_init_type_name(&of_cfs_overlay_group, "overlays", -+ &overlays_type); -+ configfs_add_default_group(&of_cfs_overlay_group, -+ &of_cfs_subsys.su_group); -+ -+ ret = configfs_register_subsystem(&of_cfs_subsys); -+ if (ret != 0) { -+ pr_err("%s: failed to register subsys\n", __func__); -+ goto out; -+ } -+ pr_info("%s: OK\n", __func__); -+out: -+ return ret; -+} -+late_initcall(of_cfs_init); diff --git a/SPECS/91/linux/aarch64/0001-arm64-report-guest-crash-to-vmware-hypervisor.patch b/SPECS/91/linux/aarch64/0001-arm64-report-guest-crash-to-vmware-hypervisor.patch deleted file mode 100644 index 1ff2ebf9e2..0000000000 --- a/SPECS/91/linux/aarch64/0001-arm64-report-guest-crash-to-vmware-hypervisor.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 6cb0716fb1c4697ae54f2c92aeac9524f18bab34 Mon Sep 17 00:00:00 2001 -From: Brennan Lamoreaux -Date: Tue, 27 May 2025 17:07:01 +0000 -Subject: [PATCH] arm64: report guest crash to vmware hypervisor - -Register the guest crash reporter to panic_notifier_list, -which will be called at panic time. Guest crash reporter -will report the crash to the hypervisor through -a hypercall. - -Signed-off-by: Brennan Lamoreaux ---- - arch/arm64/kernel/vmware.c | 51 +++++++++++++++++++++++++++++++++++--- - 1 file changed, 47 insertions(+), 4 deletions(-) - -diff --git a/arch/arm64/kernel/vmware.c b/arch/arm64/kernel/vmware.c -index 50391b495..4c19da231 100644 ---- a/arch/arm64/kernel/vmware.c -+++ b/arch/arm64/kernel/vmware.c -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -38,10 +39,12 @@ - (VMWARE_CMD_MESSAGE | MESSAGE_TYPE_SEND) - #define VMWARE_CMD_MSG_CLOSE \ - (VMWARE_CMD_MESSAGE | MESSAGE_TYPE_CLOSE) --#define VMWARE_CMD_GETHZ 45 --#define VMWARE_CMD_MESSAGE 30 --#define VMWARE_CMD_GETVERSION 10 --#define VMWARE_HB_CMD_MESSAGE 0 -+ -+#define VMWARE_CMD_GETHZ 45 -+#define VMWARE_CMD_MESSAGE 30 -+#define VMWARE_CMD_GETVERSION 10 -+#define VMWARE_CMD_REPORTGUESTCRASH 102 -+#define VMWARE_HB_CMD_MESSAGE 0 - - #define RPCI_PROTOCOL_NUM 0x49435052 /* 'RPCI' */ - #define GUESTMSG_FLAG_COOKIE 0x80000000 -@@ -52,6 +55,44 @@ struct vmw_msg { - uint32_t cookie_low; - }; - -+static void vmware_cmd_report_guest_crash(void) -+{ -+ register uint64_t w0 asm("w0") = VMWARE_HYPERVISOR_MAGIC; -+ register uint32_t w1 asm("w1") = 0; -+ register uint32_t w2 asm("w2") = VMWARE_CMD_REPORTGUESTCRASH; -+ register uint32_t w3 asm("w3") = VMWARE_HYPERVISOR_PORT; -+ register uint32_t w7 asm("w7") = X86_IO_W7_WITH | -+ 2 << X86_IO_W7_SIZE_SHIFT; -+ -+ __asm__ __volatile__ ("hvc %[magic]" : -+ "+r" (w0), -+ "+r" (w1), -+ "+r" (w2), -+ "+r" (w3) : -+ "r" (w7), -+ [magic] "i" (X86_IO_MAGIC) : -+ "memory"); -+} -+ -+static int vmware_report_guest_crash(struct notifier_block *self, -+ unsigned long action, -+ void *data) -+{ -+ vmware_cmd_report_guest_crash(); -+ return 0; -+} -+ -+static struct notifier_block vmware_guest_crash_reporter = { -+ .notifier_call = vmware_report_guest_crash -+}; -+ -+static int __init register_guest_crash_reporter(void) -+{ -+ atomic_notifier_chain_register(&panic_notifier_list, -+ &vmware_guest_crash_reporter); -+ return 0; -+} -+ - static bool vmware_log_open(struct vmw_msg *msg) - { - register uint64_t x0 asm("x0") = VMWARE_HYPERVISOR_MAGIC; -@@ -232,6 +273,8 @@ static struct kmsg_dumper kmsg_dumper = { - static void __init vmware_platform_setup(void) - { - kmsg_dump_register(&kmsg_dumper); -+ -+ register_guest_crash_reporter(); - } - - static int __init fdt_find_hyper_node(unsigned long node, --- -2.40.4 - diff --git a/SPECS/91/linux/aarch64/0001-vmw_vmci-arm64-support-memory-ordering.patch b/SPECS/91/linux/aarch64/0001-vmw_vmci-arm64-support-memory-ordering.patch deleted file mode 100644 index 3700ebb032..0000000000 --- a/SPECS/91/linux/aarch64/0001-vmw_vmci-arm64-support-memory-ordering.patch +++ /dev/null @@ -1,48 +0,0 @@ -From b934169be7ff51e614e8e78b09a2313d64e32861 Mon Sep 17 00:00:00 2001 -From: Cyprien Laplace -Date: Fri, 29 Nov 2019 16:27:46 -0500 -Subject: [PATCH] vmw_vmci: arm64 support (memory ordering) - -Add virtualization specific barriers for queue pair (de)queueing, -following the core-api/circular-buffers.rst example, that will -map to actual memory barrier instructions on arm64. - -Signed-off-by: Bo Gan ---- - include/linux/vmw_vmci_defs.h | 13 +++++++++++-- - 1 file changed, 11 insertions(+), 2 deletions(-) - -diff --git a/include/linux/vmw_vmci_defs.h b/include/linux/vmw_vmci_defs.h -index 6fb663b36f72..3b41452113f1 100644 ---- a/include/linux/vmw_vmci_defs.h -+++ b/include/linux/vmw_vmci_defs.h -@@ -805,7 +805,12 @@ static inline void *vmci_event_data_payload(struct vmci_event_data *ev_data) - */ - static inline u64 vmci_q_read_pointer(u64 *var) - { -- return READ_ONCE(*(unsigned long *)var); -+ /* -+ * The virt_load_acquire() barrier ensures that all memory -+ * accesses after the load cannot be speculated and executed -+ * before it. -+ */ -+ return virt_load_acquire((unsigned long *)var); - } - - /* -@@ -817,7 +822,11 @@ static inline u64 vmci_q_read_pointer(u64 *var) - static inline void vmci_q_set_pointer(u64 *var, u64 new_val) - { - /* XXX buggered on big-endian */ -- WRITE_ONCE(*(unsigned long *)var, (unsigned long)new_val); -+ /* -+ * The virt_store_release() ensures that all memory operations -+ * done before the store will appear to happen before it. -+ */ -+ virt_store_release((unsigned long *)var, (unsigned long)new_val); - } - - /* --- -2.25.1 - diff --git a/SPECS/91/linux/aarch64/0001-x86-hyper-generalize-hypervisor-type-detection.patch b/SPECS/91/linux/aarch64/0001-x86-hyper-generalize-hypervisor-type-detection.patch deleted file mode 100644 index b1b4be03d5..0000000000 --- a/SPECS/91/linux/aarch64/0001-x86-hyper-generalize-hypervisor-type-detection.patch +++ /dev/null @@ -1,377 +0,0 @@ -From b467c9389a7b5a3d7665a2d140b55903ff2bc86e Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Mon, 28 Nov 2022 11:40:58 +0000 -Subject: [PATCH 1/6] x86, hyper: generalize hypervisor type detection - -To use common driver code for both x86 and arm64, the x86 hypervisor type -detection must be generalized: -- rename x86_hypervisor_type enum to arch_hypervisor_type (as - hypervisor_type is already used), -- remove the X86_ prefix to the new arch_hypervisor_type values, -- move arch_hypervisor_type and hypervisor_is_type() to a common place. - -The next patch in the series adds the hypervisor type detection -framework to the arm64 architecture. - -Tested by building x86_64 with all hypervisor guest configs enabled. - -Signed-off-by: Cyprien Laplace -Signed-off-by: Keerthana K -Signed-off-by: Brennan Lamoreaux ---- - arch/x86/hyperv/hv_init.c | 4 ++-- - arch/x86/include/asm/hypervisor.h | 25 +++---------------------- - arch/x86/kernel/cpu/acrn.c | 2 +- - arch/x86/kernel/cpu/bugs.c | 2 +- - arch/x86/kernel/cpu/hypervisor.c | 6 +++--- - arch/x86/kernel/cpu/mshyperv.c | 2 +- - arch/x86/kernel/cpu/vmware.c | 2 +- - arch/x86/kernel/kvm.c | 2 +- - arch/x86/kvm/x86.c | 4 ++-- - arch/x86/mm/pti.c | 2 +- - arch/x86/xen/enlighten_hvm.c | 2 +- - arch/x86/xen/enlighten_pv.c | 2 +- - drivers/gpu/drm/i915/i915_utils.h | 2 +- - drivers/input/mouse/vmmouse.c | 10 +++++----- - drivers/iommu/hyperv-iommu.c | 2 +- - drivers/misc/vmw_balloon.c | 2 +- - include/linux/hypervisor.h | 26 ++++++++++++++++++++++++++ - 17 files changed, 52 insertions(+), 45 deletions(-) - -diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c -index 95eada299..086c9b83f 100644 ---- a/arch/x86/hyperv/hv_init.c -+++ b/arch/x86/hyperv/hv_init.c -@@ -460,7 +460,7 @@ void __init hyperv_init(void) - union hv_x64_msr_hypercall_contents hypercall_msr; - int cpuhp; - -- if (x86_hyper_type != X86_HYPER_MS_HYPERV) -+ if (hyper_type != HYPER_MS_HYPERV) - return; - - if (hv_common_init()) -@@ -714,7 +714,7 @@ bool hv_is_hyperv_initialized(void) - * Ensure that we're really on Hyper-V, and not a KVM or Xen - * emulation of Hyper-V - */ -- if (x86_hyper_type != X86_HYPER_MS_HYPERV) -+ if (hyper_type != HYPER_MS_HYPERV) - return false; - - /* A TDX VM with no paravisor uses TDX GHCI call rather than hv_hypercall_pg */ -diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h -index e41cbf2ec..9b26424b7 100644 ---- a/arch/x86/include/asm/hypervisor.h -+++ b/arch/x86/include/asm/hypervisor.h -@@ -20,20 +20,10 @@ - #ifndef _ASM_X86_HYPERVISOR_H - #define _ASM_X86_HYPERVISOR_H - --/* x86 hypervisor types */ --enum x86_hypervisor_type { -- X86_HYPER_NATIVE = 0, -- X86_HYPER_VMWARE, -- X86_HYPER_MS_HYPERV, -- X86_HYPER_XEN_PV, -- X86_HYPER_XEN_HVM, -- X86_HYPER_KVM, -- X86_HYPER_JAILHOUSE, -- X86_HYPER_ACRN, --}; -- - #ifdef CONFIG_HYPERVISOR_GUEST - -+#include -+ - #include - #include - #include -@@ -46,7 +36,7 @@ struct hypervisor_x86 { - uint32_t (*detect)(void); - - /* Hypervisor type */ -- enum x86_hypervisor_type type; -+ enum arch_hypervisor_type type; - - /* init time callbacks */ - struct x86_hyper_init init; -@@ -67,17 +57,8 @@ extern const struct hypervisor_x86 x86_hyper_acrn; - extern struct hypervisor_x86 x86_hyper_xen_hvm; - - extern bool nopv; --extern enum x86_hypervisor_type x86_hyper_type; - extern void init_hypervisor_platform(void); --static inline bool hypervisor_is_type(enum x86_hypervisor_type type) --{ -- return x86_hyper_type == type; --} - #else - static inline void init_hypervisor_platform(void) { } --static inline bool hypervisor_is_type(enum x86_hypervisor_type type) --{ -- return type == X86_HYPER_NATIVE; --} - #endif /* CONFIG_HYPERVISOR_GUEST */ - #endif /* _ASM_X86_HYPERVISOR_H */ -diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c -index 2c5b51aad..cc3cde40a 100644 ---- a/arch/x86/kernel/cpu/acrn.c -+++ b/arch/x86/kernel/cpu/acrn.c -@@ -75,7 +75,7 @@ EXPORT_SYMBOL_GPL(acrn_remove_intr_handler); - const __initconst struct hypervisor_x86 x86_hyper_acrn = { - .name = "ACRN", - .detect = acrn_detect, -- .type = X86_HYPER_ACRN, -+ .type = HYPER_ACRN, - .init.init_platform = acrn_init_platform, - .init.x2apic_available = acrn_x2apic_available, - }; -diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c -index d1d8e5ab2..90631c291 100644 ---- a/arch/x86/kernel/cpu/bugs.c -+++ b/arch/x86/kernel/cpu/bugs.c -@@ -2955,7 +2955,7 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr - if (boot_cpu_has(X86_FEATURE_PTI)) - return sysfs_emit(buf, "Mitigation: PTI\n"); - -- if (hypervisor_is_type(X86_HYPER_XEN_PV)) -+ if (hypervisor_is_type(HYPER_XEN_PV)) - return sysfs_emit(buf, "Unknown (XEN PV detected, hypervisor mitigation required)\n"); - - break; -diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c -index 553bfbfc3..b9120b134 100644 ---- a/arch/x86/kernel/cpu/hypervisor.c -+++ b/arch/x86/kernel/cpu/hypervisor.c -@@ -47,8 +47,8 @@ static const __initconst struct hypervisor_x86 * const hypervisors[] = - #endif - }; - --enum x86_hypervisor_type x86_hyper_type; --EXPORT_SYMBOL(x86_hyper_type); -+enum arch_hypervisor_type hyper_type; -+EXPORT_SYMBOL(hyper_type); - - bool __initdata nopv; - static __init int parse_nopv(char *arg) -@@ -104,6 +104,6 @@ void __init init_hypervisor_platform(void) - copy_array(&h->init, &x86_init.hyper, sizeof(h->init)); - copy_array(&h->runtime, &x86_platform.hyper, sizeof(h->runtime)); - -- x86_hyper_type = h->type; -+ hyper_type = h->type; - x86_init.hyper.init_platform(); - } -diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c -index d18078834..34909a970 100644 ---- a/arch/x86/kernel/cpu/mshyperv.c -+++ b/arch/x86/kernel/cpu/mshyperv.c -@@ -644,7 +644,7 @@ static bool hv_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) - const __initconst struct hypervisor_x86 x86_hyper_ms_hyperv = { - .name = "Microsoft Hyper-V", - .detect = ms_hyperv_platform, -- .type = X86_HYPER_MS_HYPERV, -+ .type = HYPER_MS_HYPERV, - .init.x2apic_available = ms_hyperv_x2apic_available, - .init.msi_ext_dest_id = ms_hyperv_msi_ext_dest_id, - .init.init_platform = ms_hyperv_init_platform, -diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c -index 27132984b..1e8868414 100644 ---- a/arch/x86/kernel/cpu/vmware.c -+++ b/arch/x86/kernel/cpu/vmware.c -@@ -586,7 +586,7 @@ static bool vmware_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) - const __initconst struct hypervisor_x86 x86_hyper_vmware = { - .name = "VMware", - .detect = vmware_platform, -- .type = X86_HYPER_VMWARE, -+ .type = HYPER_VMWARE, - .init.init_platform = vmware_platform_setup, - .init.x2apic_available = vmware_legacy_x2apic_available, - #ifdef CONFIG_AMD_MEM_ENCRYPT -diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c -index 21e9e4845..e2cce348e 100644 ---- a/arch/x86/kernel/kvm.c -+++ b/arch/x86/kernel/kvm.c -@@ -1006,7 +1006,7 @@ static bool kvm_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) - const __initconst struct hypervisor_x86 x86_hyper_kvm = { - .name = "KVM", - .detect = kvm_detect, -- .type = X86_HYPER_KVM, -+ .type = HYPER_KVM, - .init.guest_late_init = kvm_guest_init, - .init.x2apic_available = kvm_para_available, - .init.msi_ext_dest_id = kvm_msi_ext_dest_id, -diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c -index 83fe0a781..8ac6ea809 100644 ---- a/arch/x86/kvm/x86.c -+++ b/arch/x86/kvm/x86.c -@@ -9776,7 +9776,7 @@ int kvm_x86_vendor_init(struct kvm_x86_init_ops *ops) - #ifdef CONFIG_X86_64 - pvclock_gtod_register_notifier(&pvclock_gtod_notifier); - -- if (hypervisor_is_type(X86_HYPER_MS_HYPERV)) -+ if (hypervisor_is_type(HYPER_MS_HYPERV)) - set_hv_tscchange_cb(kvm_hyperv_tsc_notifier); - #endif - -@@ -9825,7 +9825,7 @@ void kvm_x86_vendor_exit(void) - kvm_unregister_perf_callbacks(); - - #ifdef CONFIG_X86_64 -- if (hypervisor_is_type(X86_HYPER_MS_HYPERV)) -+ if (hypervisor_is_type(HYPER_MS_HYPERV)) - clear_hv_tscchange_cb(); - #endif - kvm_lapic_exit(); -diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c -index 851ec8f13..4fbc9060a 100644 ---- a/arch/x86/mm/pti.c -+++ b/arch/x86/mm/pti.c -@@ -78,7 +78,7 @@ static enum pti_mode { - - void __init pti_check_boottime_disable(void) - { -- if (hypervisor_is_type(X86_HYPER_XEN_PV)) { -+ if (hypervisor_is_type(HYPER_XEN_PV)) { - pti_mode = PTI_FORCE_OFF; - pti_print_if_insecure("disabled on XEN PV."); - return; -diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c -index 24d2957a4..60bb2494c 100644 ---- a/arch/x86/xen/enlighten_hvm.c -+++ b/arch/x86/xen/enlighten_hvm.c -@@ -326,7 +326,7 @@ static uint32_t __init xen_platform_hvm(void) - struct hypervisor_x86 x86_hyper_xen_hvm __initdata = { - .name = "Xen HVM", - .detect = xen_platform_hvm, -- .type = X86_HYPER_XEN_HVM, -+ .type = HYPER_XEN_HVM, - .init.init_platform = xen_hvm_guest_init, - .init.x2apic_available = xen_x2apic_available, - .init.init_mem_mapping = xen_hvm_init_mem_mapping, -diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c -index d6818c6ca..19927f25b 100644 ---- a/arch/x86/xen/enlighten_pv.c -+++ b/arch/x86/xen/enlighten_pv.c -@@ -1570,7 +1570,7 @@ static uint32_t __init xen_platform_pv(void) - const __initconst struct hypervisor_x86 x86_hyper_xen_pv = { - .name = "Xen PV", - .detect = xen_platform_pv, -- .type = X86_HYPER_XEN_PV, -+ .type = HYPER_XEN_PV, - .runtime.pin_vcpu = xen_pin_vcpu, - .ignore_nopv = true, - }; -diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h -index 71bdc89bd..f23e34168 100644 ---- a/drivers/gpu/drm/i915/i915_utils.h -+++ b/drivers/gpu/drm/i915/i915_utils.h -@@ -364,7 +364,7 @@ static inline bool timer_expired(const struct timer_list *t) - static inline bool i915_run_as_guest(void) - { - #if IS_ENABLED(CONFIG_X86) -- return !hypervisor_is_type(X86_HYPER_NATIVE); -+ return !hypervisor_is_type(HYPER_NATIVE); - #else - /* Not supported yet */ - return false; -diff --git a/drivers/input/mouse/vmmouse.c b/drivers/input/mouse/vmmouse.c -index fb1d986a6..8c24f6443 100644 ---- a/drivers/input/mouse/vmmouse.c -+++ b/drivers/input/mouse/vmmouse.c -@@ -15,7 +15,7 @@ - #include - #include - #include --#include -+#include - #include - - #include "psmouse.h" -@@ -281,9 +281,9 @@ static int vmmouse_enable(struct psmouse *psmouse) - /* - * Array of supported hypervisors. - */ --static enum x86_hypervisor_type vmmouse_supported_hypervisors[] = { -- X86_HYPER_VMWARE, -- X86_HYPER_KVM, -+static enum arch_hypervisor_type vmmouse_supported_hypervisors[] = { -+ HYPER_VMWARE, -+ HYPER_KVM, - }; - - /** -@@ -294,7 +294,7 @@ static bool vmmouse_check_hypervisor(void) - int i; - - for (i = 0; i < ARRAY_SIZE(vmmouse_supported_hypervisors); i++) -- if (vmmouse_supported_hypervisors[i] == x86_hyper_type) -+ if (vmmouse_supported_hypervisors[i] == hyper_type) - return true; - - return false; -diff --git a/drivers/iommu/hyperv-iommu.c b/drivers/iommu/hyperv-iommu.c -index 8a5c17b97..920aeedb9 100644 ---- a/drivers/iommu/hyperv-iommu.c -+++ b/drivers/iommu/hyperv-iommu.c -@@ -126,7 +126,7 @@ static int __init hyperv_prepare_irq_remapping(void) - * For a Hyper-V root partition, ms_hyperv_msi_ext_dest_id() - * will always return false. - */ -- if (!hypervisor_is_type(X86_HYPER_MS_HYPERV) || -+ if (!hypervisor_is_type(HYPER_MS_HYPERV) || - x86_init.hyper.msi_ext_dest_id()) - return -ENODEV; - -diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c -index c817d8c21..775bf67d2 100644 ---- a/drivers/misc/vmw_balloon.c -+++ b/drivers/misc/vmw_balloon.c -@@ -1865,7 +1865,7 @@ static int __init vmballoon_init(void) - * Check if we are running on VMware's hypervisor and bail out - * if we are not. - */ -- if (x86_hyper_type != X86_HYPER_VMWARE) -+ if (hyper_type != HYPER_VMWARE) - return -ENODEV; - - INIT_DELAYED_WORK(&balloon.dwork, vmballoon_work); -diff --git a/include/linux/hypervisor.h b/include/linux/hypervisor.h -index 9efbc54e3..97dc3481f 100644 ---- a/include/linux/hypervisor.h -+++ b/include/linux/hypervisor.h -@@ -40,4 +40,30 @@ static inline bool hypervisor_isolated_pci_functions(void) - return jailhouse_paravirt(); - } - -+/* hypervisor types */ -+enum arch_hypervisor_type { -+ HYPER_NATIVE = 0, -+ HYPER_VMWARE, -+ HYPER_MS_HYPERV, -+ HYPER_XEN_PV, -+ HYPER_XEN_HVM, -+ HYPER_KVM, -+ HYPER_JAILHOUSE, -+ HYPER_ACRN, -+}; -+ -+#ifdef CONFIG_HYPERVISOR_GUEST -+extern enum arch_hypervisor_type hyper_type; -+ -+static inline bool hypervisor_is_type(enum arch_hypervisor_type type) -+{ -+ return hyper_type == type; -+} -+#else -+static inline bool hypervisor_is_type(enum arch_hypervisor_type type) -+{ -+ return type == HYPER_NATIVE; -+} -+#endif /* CONFIG_HYPERVISOR_GUEST */ -+ - #endif /* __LINUX_HYPEVISOR_H */ --- -2.40.4 - diff --git a/SPECS/91/linux/aarch64/0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch b/SPECS/91/linux/aarch64/0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch deleted file mode 100644 index 4991b5d7be..0000000000 --- a/SPECS/91/linux/aarch64/0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch +++ /dev/null @@ -1,164 +0,0 @@ -From 6fafb399a88dd41e784abc105ed3f3b2c392ec81 Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Wed, 25 May 2022 12:31:05 +0000 -Subject: [PATCH 2/6] arm64: Generic hypervisor type detection for arm64 - -Implement hypervisor type detection framework for the arm64 -architecture, enabled with the HYPERVISOR_GUEST config option. - -Signed-off-by: Keerthana K ---- - MAINTAINERS | 9 +++++ - arch/arm64/Kconfig | 10 ++++++ - arch/arm64/include/asm/hypervisor.h | 23 +++++++++++++ - arch/arm64/kernel/Makefile | 1 + - arch/arm64/kernel/hypervisor.c | 52 +++++++++++++++++++++++++++++ - 5 files changed, 95 insertions(+) - create mode 100644 arch/arm64/kernel/hypervisor.c - -diff --git a/MAINTAINERS b/MAINTAINERS -index b878ddc99..eb18f3383 100644 ---- a/MAINTAINERS -+++ b/MAINTAINERS -@@ -24730,6 +24730,15 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/vmware - F: arch/x86/include/asm/vmware.h - F: arch/x86/kernel/cpu/vmware.c - -+VMWARE ARM64 HYPERVISOR INTERFACE -+M: Srivatsa S. Bhat (VMware) -+M: Keerthana K -+R: VMware PV-Drivers Reviewers -+L: virtualization@lists.linux-foundation.org -+F: arch/arm64/include/asm/hypervisor.h -+F: arch/arm64/kernel/hypervisor.c -+F: arch/arm64/kernel/vmware.c -+ - VMWARE PVRDMA DRIVER - M: Bryan Tan - M: Vishnu Dasa -diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig -index 22f8a7bca..6e6fee606 100644 ---- a/arch/arm64/Kconfig -+++ b/arch/arm64/Kconfig -@@ -1586,6 +1586,16 @@ config TRANS_TABLE - def_bool y - depends on HIBERNATION || KEXEC_CORE - -+menuconfig HYPERVISOR_GUEST -+ bool "Linux guest support" -+ help -+ Say Y here to enable options for running Linux under various hyper- -+ visors. This option enables basic hypervisor detection and platform -+ setup. -+ -+ If you say N, all options in this submenu will be skipped and -+ disabled, and Linux guest support won't be built in. -+ - config XEN_DOM0 - def_bool y - depends on XEN -diff --git a/arch/arm64/include/asm/hypervisor.h b/arch/arm64/include/asm/hypervisor.h -index 409e23983..1783d3515 100644 ---- a/arch/arm64/include/asm/hypervisor.h -+++ b/arch/arm64/include/asm/hypervisor.h -@@ -18,4 +18,27 @@ static inline void kvm_arch_init_hyp_services(void) - pkvm_init_hyp_services(); - }; - -+#ifdef CONFIG_HYPERVISOR_GUEST -+ -+#include -+ -+struct arm64_hyper_init { -+ void (*init_platform)(void); -+}; -+ -+struct hypervisor_arm64 { -+ /* Hypervisor name */ -+ const char *name; -+ -+ /* Detection routine - returns a priority (highest wins) */ -+ uint32_t (*detect)(void); -+ -+ /* Hypervisor type */ -+ enum arch_hypervisor_type type; -+ -+ /* init time callbacks */ -+ struct arm64_hyper_init init; -+}; -+ -+#endif /* CONFIG_HYPERVISOR_GUEST */ - #endif -diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile -index 2b112f3b7..156a47036 100644 ---- a/arch/arm64/kernel/Makefile -+++ b/arch/arm64/kernel/Makefile -@@ -70,6 +70,7 @@ obj-$(CONFIG_ARM64_PTR_AUTH) += pointer_auth.o - obj-$(CONFIG_ARM64_MTE) += mte.o - obj-y += vdso-wrap.o - obj-$(CONFIG_COMPAT_VDSO) += vdso32-wrap.o -+obj-$(CONFIG_HYPERVISOR_GUEST) += hypervisor.o - - # Force dependency (vdso*-wrap.S includes vdso.so through incbin) - $(obj)/vdso-wrap.o: $(obj)/vdso/vdso.so -diff --git a/arch/arm64/kernel/hypervisor.c b/arch/arm64/kernel/hypervisor.c -new file mode 100644 -index 000000000..dbf0170ed ---- /dev/null -+++ b/arch/arm64/kernel/hypervisor.c -@@ -0,0 +1,52 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* -+ * Common hypervisor code -+ * -+ * Copyright (C) 2021, VMware, Inc. -+ */ -+ -+#include -+#include -+#include -+ -+static const __initconst struct hypervisor_arm64 * const hypervisors[] = { -+}; -+ -+enum arch_hypervisor_type hyper_type; -+EXPORT_SYMBOL(hyper_type); -+ -+static inline const struct hypervisor_arm64 * __init -+detect_hypervisor_vendor(void) -+{ -+ const struct hypervisor_arm64 *h = NULL, * const *p; -+ u32 pri, max_pri = 0; -+ -+ for (p = hypervisors; p < hypervisors + ARRAY_SIZE(hypervisors); p++) { -+ pri = (*p)->detect(); -+ if (pri > max_pri) { -+ max_pri = pri; -+ h = *p; -+ } -+ } -+ -+ if (h) -+ pr_info("Hypervisor detected: %s\n", h->name); -+ -+ return h; -+} -+ -+static int __init init_hypervisor_platform(void) -+{ -+ const struct hypervisor_arm64 *h; -+ -+ h = detect_hypervisor_vendor(); -+ -+ if (!h) -+ return -EINVAL; -+ hyper_type = h->type; -+ -+ if (h->init.init_platform) -+ h->init.init_platform(); -+ return 0; -+} -+arch_initcall(init_hypervisor_platform); --- -2.40.4 - diff --git a/SPECS/91/linux/aarch64/0003-arm64-VMware-hypervisor-detection.patch b/SPECS/91/linux/aarch64/0003-arm64-VMware-hypervisor-detection.patch deleted file mode 100644 index 598a29a7c5..0000000000 --- a/SPECS/91/linux/aarch64/0003-arm64-VMware-hypervisor-detection.patch +++ /dev/null @@ -1,106 +0,0 @@ -From cf72d49d79ca364410d40f4327ef886136a28a67 Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Wed, 25 May 2022 12:33:13 +0000 -Subject: [PATCH 3/6] arm64: VMware hypervisor detection - -Add VMware hypervisor detection code, using device tree via the -/hypervisor/compatible node or via DMI serial string signature. - -Signed-off-by: Cyprien Laplace -Signed-off-by: Keerthana K ---- - arch/arm64/include/asm/hypervisor.h | 1 + - arch/arm64/kernel/Makefile | 2 +- - arch/arm64/kernel/hypervisor.c | 1 + - arch/arm64/kernel/vmware.c | 43 +++++++++++++++++++++++++++++ - 4 files changed, 46 insertions(+), 1 deletion(-) - create mode 100644 arch/arm64/kernel/vmware.c - -diff --git a/arch/arm64/include/asm/hypervisor.h b/arch/arm64/include/asm/hypervisor.h -index 7981f22a5a56..54f9ffc3d028 100644 ---- a/arch/arm64/include/asm/hypervisor.h -+++ b/arch/arm64/include/asm/hypervisor.h -@@ -29,5 +29,6 @@ struct hypervisor_arm64 { - struct arm64_hyper_init init; - }; - -+extern const struct hypervisor_arm64 arm64_hyper_vmware; - #endif /* CONFIG_HYPERVISOR_GUEST */ - #endif -diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile -index 9191e1debc56..ddea06482084 100644 ---- a/arch/arm64/kernel/Makefile -+++ b/arch/arm64/kernel/Makefile -@@ -74,7 +74,7 @@ obj-$(CONFIG_ARM64_PTR_AUTH) += pointer_auth.o - obj-$(CONFIG_ARM64_MTE) += mte.o - obj-y += vdso-wrap.o - obj-$(CONFIG_COMPAT_VDSO) += vdso32-wrap.o --obj-$(CONFIG_HYPERVISOR_GUEST) += hypervisor.o -+obj-$(CONFIG_HYPERVISOR_GUEST) += hypervisor.o vmware.o - - # Force dependency (vdso*-wrap.S includes vdso.so through incbin) - $(obj)/vdso-wrap.o: $(obj)/vdso/vdso.so -diff --git a/arch/arm64/kernel/hypervisor.c b/arch/arm64/kernel/hypervisor.c -index dbf0170edfdd..b817352bce71 100644 ---- a/arch/arm64/kernel/hypervisor.c -+++ b/arch/arm64/kernel/hypervisor.c -@@ -10,6 +10,7 @@ - #include - - static const __initconst struct hypervisor_arm64 * const hypervisors[] = { -+ &arm64_hyper_vmware, - }; - - enum arch_hypervisor_type hyper_type; -diff --git a/arch/arm64/kernel/vmware.c b/arch/arm64/kernel/vmware.c -new file mode 100644 -index 000000000000..a8d17233b17b ---- /dev/null -+++ b/arch/arm64/kernel/vmware.c -@@ -0,0 +1,43 @@ -+// SPDX-License-Identifier: GPL-2.0 or MIT -+/* -+ * VMware Detection code. -+ * -+ * Copyright (C) 2021, VMware, Inc. -+ * Author : Cyprien Laplace -+ * Author : Keerthana K -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static int __init fdt_find_hyper_node(unsigned long node, -+ const char *uname, -+ int depth, void *data) -+{ -+ return depth == 1 && strcmp(uname, "hypervisor") == 0 && -+ of_flat_dt_is_compatible(node, "vmware"); -+} -+ -+/* -+ * Check for VMware hypervisor signature in the device tree node -+ * hypervisor/compatible or in dmi serial string. -+ */ -+static uint32_t __init vmware_platform(void) -+{ -+ if (of_scan_flat_dt(fdt_find_hyper_node, NULL) || -+ (dmi_available && dmi_name_in_serial("VMware"))) -+ return 1; -+ -+ return 0; -+} -+ -+const __initconst struct hypervisor_arm64 arm64_hyper_vmware = { -+ .name = "VMware", -+ .detect = vmware_platform, -+ .type = HYPER_VMWARE, -+ .init.init_platform = NULL, -+}; --- -2.28.0 - diff --git a/SPECS/91/linux/aarch64/0003-of-overlay-Correct-symbol-path-fixups.patch b/SPECS/91/linux/aarch64/0003-of-overlay-Correct-symbol-path-fixups.patch deleted file mode 100644 index 26faf92852..0000000000 --- a/SPECS/91/linux/aarch64/0003-of-overlay-Correct-symbol-path-fixups.patch +++ /dev/null @@ -1,43 +0,0 @@ -From f5ba852479c7a135948de601c4caf857f795508f Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 6 Feb 2020 12:23:15 +0000 -Subject: [PATCH] of: overlay: Correct symbol path fixups - -When symbols from overlays are added to the live tree their paths must -be rebased. The translated symbol is normally the result of joining -the fragment-relative path (with a leading "/") to the target path -(either copied directly from the "target-path" property or resolved -from the phandle). This translation fails when the target is the root -node (a common case for Raspberry Pi overlays) because the resulting -path starts with a double slash. For example, if target-path is "/" and -the fragment adds a node called "newnode", the label associated with -that node will be assigned the path "//newnode", which can't be found -in the tree. - -Fix the failure case by explicitly replacing a target path of "/" with -an empty string. - -Fixes: d1651b03c2df ("of: overlay: add overlay symbols to live device tree") - -Signed-off-by: Phil Elwell -Signed-off-by: Ajay Kaher ---- - drivers/of/overlay.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c -index 50bbe0e..7e585d2 100644 ---- a/drivers/of/overlay.c -+++ b/drivers/of/overlay.c -@@ -245,6 +245,8 @@ static struct property *dup_and_fixup_symbol_prop( - if (!target_path) - return NULL; - target_path_len = strlen(target_path); -+ if (!strcmp(target_path, "/")) -+ target_path_len = 0; - - new_prop = kzalloc(sizeof(*new_prop), GFP_KERNEL); - if (!new_prop) --- -2.7.4 - diff --git a/SPECS/91/linux/aarch64/0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch b/SPECS/91/linux/aarch64/0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch deleted file mode 100644 index 5662463286..0000000000 --- a/SPECS/91/linux/aarch64/0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch +++ /dev/null @@ -1,316 +0,0 @@ -From 6523e01b0ef1ec965555842b07746effe6bb04c2 Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Wed, 25 May 2022 12:37:48 +0000 -Subject: [PATCH 4/6] arm64: kmsg dumper for VMware hypervisor - -kmsg_dumper dumps kmsg to vmware.log in VMware hosts in case of -a kernel panic in the guest. - -Signed-off-by: Keerthana K -[ Ported to v6.12 ] -Signed-off-by: Brennan Lamoreaux ---- - arch/arm64/include/asm/vmware.h | 51 ++++++++ - arch/arm64/kernel/vmware.c | 222 +++++++++++++++++++++++++++++++- - 2 files changed, 272 insertions(+), 1 deletion(-) - create mode 100644 arch/arm64/include/asm/vmware.h - -diff --git a/arch/arm64/include/asm/vmware.h b/arch/arm64/include/asm/vmware.h -new file mode 100644 -index 000000000..834986a2c ---- /dev/null -+++ b/arch/arm64/include/asm/vmware.h -@@ -0,0 +1,51 @@ -+/* SPDX-License-Identifier: GPL-2.0 or MIT */ -+/* -+ * Copyright (C) 2021, VMware, Inc. -+ * Author : Cyprien Laplace -+ */ -+#ifndef _ASM_ARM64_VMWARE_H -+#define _ASM_ARM64_VMWARE_H -+ -+#include -+ -+/* -+ * Encoding for virtual I/O port translation: HVC 0x86 allows efficient -+ * drop-in replacement for x86 [REP] IN/INS/OUT/OUTS instructions used -+ * for backdoors and virtual devices. -+ */ -+#define X86_IO_MAGIC 0x86 -+/* -+ * Transfer size, bits [1:0] -+ * 00: 1 byte -+ * 01: 2 bytes -+ * 10: 4 bytes -+ * 11: Invalid value -+ */ -+#define X86_IO_W7_SIZE_SHIFT 0 -+/* -+ * Transfer direction, bit [2] -+ * 0: Write (OUT/OUTS/REP OUTS instructions) -+ * 1: Read (IN/INS/REP INS instructions) -+ */ -+#define X86_IO_W7_DIR BIT(2) -+/* -+ * Instruction type, bits [4:3] -+ * 00: Non-string instruction (IN/OUT) without DX register -+ * The port address (8-bit immediate) is set in W7<12:5>. -+ * -+ * 01: Non-string instruction (IN/OUT) with DX register -+ * -+ * 10: String instruction without REP prefix (INS/OUTS) -+ * The direction flag (EFLAGS.DF) is set in W7<5>. -+ * -+ * 11: String instruction with REP prefix (REP INS/REP OUTS) -+ * The direction flag (EFLAGS.DF) is set in W7<5>. -+ */ -+#define X86_IO_W7_WITH BIT(3) -+#define X86_IO_W7_STR BIT(4) -+ -+#define VMWARE_HYPERVISOR_PORT 0x5658 -+#define VMWARE_HYPERVISOR_PORT_HB 0x5659 -+#define VMWARE_HYPERVISOR_MAGIC 0x564D5868 -+ -+#endif /* _ASM_ARM64_VMWARE_H */ -diff --git a/arch/arm64/kernel/vmware.c b/arch/arm64/kernel/vmware.c -index a8d17233b..2364a92d6 100644 ---- a/arch/arm64/kernel/vmware.c -+++ b/arch/arm64/kernel/vmware.c -@@ -12,7 +12,227 @@ - #include - #include - #include -+#include -+ - #include -+#include -+ -+#undef pr_fmt -+#define pr_fmt(fmt) "vmware: " fmt -+ -+#define MESSAGE_STATUS_SUCCESS (0x01 << 16) -+#define MESSAGE_STATUS_CPT (0x10 << 16) -+#define MESSAGE_STATUS_HB (0x80 << 16) -+#define MESSAGE_TYPE_OPEN (0 << 16) -+#define MESSAGE_TYPE_SENDSIZE (1 << 16) -+#define MESSAGE_TYPE_SEND (2 << 16) -+#define MESSAGE_TYPE_CLOSE (6 << 16) -+#define VMWARE_HB_CMD_MSGST_SUCCESS \ -+ (VMWARE_HB_CMD_MESSAGE | MESSAGE_STATUS_SUCCESS) -+ -+#define VMWARE_CMD_MSG_OPEN \ -+ (VMWARE_CMD_MESSAGE | MESSAGE_TYPE_OPEN) -+#define VMWARE_CMD_MSG_SENDSIZE \ -+ (VMWARE_CMD_MESSAGE | MESSAGE_TYPE_SENDSIZE) -+#define VMWARE_CMD_MSG_SEND \ -+ (VMWARE_CMD_MESSAGE | MESSAGE_TYPE_SEND) -+#define VMWARE_CMD_MSG_CLOSE \ -+ (VMWARE_CMD_MESSAGE | MESSAGE_TYPE_CLOSE) -+#define VMWARE_CMD_GETHZ 45 -+#define VMWARE_CMD_MESSAGE 30 -+#define VMWARE_CMD_GETVERSION 10 -+#define VMWARE_HB_CMD_MESSAGE 0 -+ -+#define RPCI_PROTOCOL_NUM 0x49435052 /* 'RPCI' */ -+#define GUESTMSG_FLAG_COOKIE 0x80000000 -+ -+struct vmw_msg { -+ uint32_t id; -+ uint32_t cookie_high; -+ uint32_t cookie_low; -+}; -+ -+static bool vmware_log_open(struct vmw_msg *msg) -+{ -+ register uint64_t x0 asm("x0") = VMWARE_HYPERVISOR_MAGIC; -+ register uint64_t x1 asm("x1") = RPCI_PROTOCOL_NUM | GUESTMSG_FLAG_COOKIE; -+ register uint32_t w2 asm("w2") = VMWARE_CMD_MSG_OPEN; -+ register uint32_t w3 asm("w3") = VMWARE_HYPERVISOR_PORT; -+ register uint32_t w4 asm("w4") = 0; -+ register uint32_t w5 asm("w5") = 0; -+ register uint32_t w7 asm("w7") = X86_IO_W7_WITH | -+ X86_IO_W7_DIR | -+ 2 << X86_IO_W7_SIZE_SHIFT; -+ uint32_t result = 0; -+ -+ __asm__ __volatile__ ("hvc %[magic]" : -+ "+r" (x0), -+ "+r" (w2), -+ "+r" (w3), -+ "+r" (w4), -+ "+r" (w5) : -+ "r" (x1), -+ "r" (w7), -+ [magic] "i" (X86_IO_MAGIC) : -+ "memory"); -+ result = w2; -+ msg->id = w3; -+ msg->cookie_high = w4; -+ msg->cookie_low = w5; -+ -+ return !(result & MESSAGE_STATUS_SUCCESS); -+} -+ -+static bool vmware_log_close(struct vmw_msg *msg) -+{ -+ register uint64_t x0 asm("x0") = VMWARE_HYPERVISOR_MAGIC; -+ register uint64_t x1 asm("x1") = 0; -+ register uint32_t w2 asm("w2") = VMWARE_CMD_MSG_CLOSE; -+ register uint32_t w3 asm("w3") = VMWARE_HYPERVISOR_PORT | msg->id; -+ register uint32_t w4 asm("w4") = msg->cookie_high; -+ register uint32_t w5 asm("w5") = msg->cookie_low; -+ register uint32_t w7 asm("w7") = X86_IO_W7_WITH | -+ X86_IO_W7_DIR | -+ 2 << X86_IO_W7_SIZE_SHIFT; -+ uint32_t result = 0; -+ -+ __asm__ __volatile__ ("hvc %[magic]" : -+ "+r" (x0), -+ "+r" (w2) : -+ "r" (w3), -+ "r" (w4), -+ "r" (w5), -+ "r" (x1), -+ "r" (w7), -+ [magic] "i" (X86_IO_MAGIC) : -+ "memory"); -+ -+ result = w2; -+ return !(result & MESSAGE_STATUS_SUCCESS); -+} -+ -+static inline uint64_t vmware_lb_cmd_msg_send(uint64_t cmd, uint64_t str, -+ struct vmw_msg *msg) -+{ -+ register uint64_t x0 asm("x0") = VMWARE_HYPERVISOR_MAGIC; -+ register uint64_t x1 asm("x1") = str; -+ register uint64_t x2 asm("x2") = cmd; -+ register uint32_t w3 asm("w3") = VMWARE_HYPERVISOR_PORT | -+ msg->id; -+ register uint64_t x4 asm("x4") = msg->cookie_high; -+ register uint32_t w5 asm("w5") = msg->cookie_low; -+ register uint32_t w7 asm("w7") = X86_IO_W7_WITH | -+ X86_IO_W7_DIR | -+ 2 << X86_IO_W7_SIZE_SHIFT; -+ uint64_t ret = 0; -+ -+ __asm__ __volatile__ ("hvc %[magic]" : -+ "+r" (x0), -+ "+r" (x2) : -+ "r" (w3), -+ "r" (x4), -+ "r" (w5), -+ "r" (x1), -+ "r" (w7), -+ [magic] "i" (X86_IO_MAGIC) : -+ "memory"); -+ ret = x2; -+ return ret; -+} -+ -+static inline uint64_t vmware_hb_cmd_msg_send(uint64_t cmd, uint64_t str, -+ uint64_t len, struct vmw_msg *msg) -+{ -+ register uint64_t x0 asm("x0") = VMWARE_HYPERVISOR_MAGIC; -+ register uint32_t w1 asm("w1") = cmd; -+ register uint64_t x2 asm("x2") = len; -+ register uint32_t w3 asm("w3") = VMWARE_HYPERVISOR_PORT_HB | -+ msg->id; -+ register uint64_t x4 asm("x4") = str; -+ register uint32_t w5 asm("w5") = msg->cookie_low; -+ register uint32_t w6 asm("w6") = msg->cookie_high; -+ register uint32_t w7 asm("w7") = X86_IO_W7_WITH | -+ X86_IO_W7_STR; -+ uint64_t ret = 0; -+ -+ __asm__ __volatile__ ("hvc %[magic]" : -+ "+r" (x0), -+ "+r" (w1) : -+ "r" (x2), -+ "r" (x4), -+ "r" (w3), -+ "r" (w5), -+ "r" (w6), -+ "r" (w7), -+ [magic] "i" (X86_IO_MAGIC)); -+ ret = w1; -+ return ret; -+} -+ -+static bool vmware_log_send(struct vmw_msg *msg, const char *log_str) -+{ -+ uint64_t result = 0; -+ uint32_t str; -+ uint32_t len = strlen(log_str); -+ bool retry = false; -+ -+ do { -+ result = vmware_lb_cmd_msg_send(VMWARE_CMD_MSG_SENDSIZE, -+ len, msg); -+ if (!(result & MESSAGE_STATUS_SUCCESS)) -+ goto ret; -+ if (result & MESSAGE_STATUS_HB) { -+ result = vmware_hb_cmd_msg_send(VMWARE_HB_CMD_MSGST_SUCCESS, -+ (uint64_t) log_str, len, msg); -+ } else { -+ do { -+ size_t s = min_t(size_t, sizeof(str), len); -+ -+ memcpy(&str, log_str, s); -+ len -= s; -+ log_str += s; -+ -+ result = vmware_lb_cmd_msg_send(VMWARE_CMD_MSG_SEND, -+ str, msg); -+ } while (len && (result & MESSAGE_STATUS_SUCCESS)); -+ } -+ if (!(result & MESSAGE_STATUS_SUCCESS)) { -+ if (result & MESSAGE_STATUS_CPT) { -+ retry = true; -+ } -+ else -+ goto ret; -+ } -+ } while (retry); -+ret: -+ return !(result & MESSAGE_STATUS_SUCCESS); -+} -+ -+static void kmsg_dumper_vmware_log(struct kmsg_dumper *dumper, -+ struct kmsg_dump_detail *detail) -+{ -+ struct vmw_msg msg; -+ struct kmsg_dump_iter iter; -+ static char line[1024] = {'l', 'o', 'g', ' '}; -+ size_t len = 0; -+ -+ kmsg_dump_rewind(&iter); -+ while (kmsg_dump_get_line(&iter, true, line + 4, -+ sizeof(line) - 4, &len)) { -+ line[len + 4] = '\0'; -+ if (vmware_log_open(&msg) || vmware_log_send(&msg, line) || vmware_log_close(&msg)) -+ break; -+ } -+} -+ -+static struct kmsg_dumper kmsg_dumper = { -+ .dump = kmsg_dumper_vmware_log -+}; -+ -+static void __init vmware_platform_setup(void) -+{ -+ kmsg_dump_register(&kmsg_dumper); -+} - - static int __init fdt_find_hyper_node(unsigned long node, - const char *uname, -@@ -39,5 +259,5 @@ const __initconst struct hypervisor_arm64 arm64_hyper_vmware = { - .name = "VMware", - .detect = vmware_platform, - .type = HYPER_VMWARE, -- .init.init_platform = NULL, -+ .init.init_platform = vmware_platform_setup, - }; --- -2.40.4 - diff --git a/SPECS/91/linux/aarch64/0005-scsi-vmw_pvscsi-add-arm64-support.patch b/SPECS/91/linux/aarch64/0005-scsi-vmw_pvscsi-add-arm64-support.patch deleted file mode 100644 index 62b6439313..0000000000 --- a/SPECS/91/linux/aarch64/0005-scsi-vmw_pvscsi-add-arm64-support.patch +++ /dev/null @@ -1,118 +0,0 @@ -From 068266940bbbec916a1ebf57a59193665425c071 Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Wed, 25 May 2022 12:43:33 +0000 -Subject: [PATCH 5/6] scsi: vmw_pvscsi: add arm64 support - -Upgrade barriers to virtual machine specific barriers, that will map to -actual memory barrier instructions for the arm weaker memory model -ordering. - -Disable driver if 16KB or 64KB pages are selected as the VMware hypervisor -assumes 4KB page size at the moment. - -Signed-off-by: Cyprien Laplace -Signed-off-by: Keerthana K ---- - drivers/scsi/Kconfig | 3 ++- - drivers/scsi/vmw_pvscsi.c | 39 +++++++++++++++++++++++++-------------- - 2 files changed, 27 insertions(+), 15 deletions(-) - -diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig -index 6e3a04107bb6..e56a517a2f44 100644 ---- a/drivers/scsi/Kconfig -+++ b/drivers/scsi/Kconfig -@@ -569,7 +569,8 @@ config SCSI_MYRS - - config VMWARE_PVSCSI - tristate "VMware PVSCSI driver support" -- depends on PCI && SCSI && X86 -+ depends on PCI && SCSI && (X86 || ARM64) -+ depends on !ARM64_16K_PAGES && !ARM64_64K_PAGES && !CPU_BIG_ENDIAN - help - This driver supports VMware's para virtualized SCSI HBA. - To compile this driver as a module, choose M here: the -diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c -index 1f037b8ab904..235d44325e3a 100644 ---- a/drivers/scsi/vmw_pvscsi.c -+++ b/drivers/scsi/vmw_pvscsi.c -@@ -649,13 +649,6 @@ static void pvscsi_complete_request(struct pvscsi_adapter *adapter, - scsi_done(cmd); - } - --/* -- * barrier usage : Since the PVSCSI device is emulated, there could be cases -- * where we may want to serialize some accesses between the driver and the -- * emulation layer. We use compiler barriers instead of the more expensive -- * memory barriers because PVSCSI is only supported on X86 which has strong -- * memory access ordering. -- */ - static void pvscsi_process_completion_ring(struct pvscsi_adapter *adapter) - { - struct PVSCSIRingsState *s = adapter->rings_state; -@@ -666,20 +659,20 @@ static void pvscsi_process_completion_ring(struct pvscsi_adapter *adapter) - struct PVSCSIRingCmpDesc *e = ring + (s->cmpConsIdx & - MASK(cmp_entries)); - /* -- * This barrier() ensures that *e is not dereferenced while -+ * This virt_rmb() ensures that *e is not dereferenced while - * the device emulation still writes data into the slot. - * Since the device emulation advances s->cmpProdIdx only after - * updating the slot we want to check it first. - */ -- barrier(); -+ virt_rmb(); - pvscsi_complete_request(adapter, e); - /* -- * This barrier() ensures that compiler doesn't reorder write -+ * This virt_rmb() ensures that compiler doesn't reorder write - * to s->cmpConsIdx before the read of (*e) inside - * pvscsi_complete_request. Otherwise, device emulation may - * overwrite *e before we had a chance to read it. - */ -- barrier(); -+ virt_rmb(); - s->cmpConsIdx++; - } - } -@@ -764,7 +757,13 @@ static int pvscsi_queue_ring(struct pvscsi_adapter *adapter, - - e->context = pvscsi_map_context(adapter, ctx); - -- barrier(); -+ /* -+ * This virt_wmb() ensures that write to s->reqProdIdx doesn't -+ * get reordered before any write to (*e) above. Otherwise, -+ * device emulation may read *e before we had finished to -+ * write to it. -+ */ -+ virt_wmb(); - - s->reqProdIdx++; - -@@ -1105,9 +1104,21 @@ static void pvscsi_process_msg_ring(const struct pvscsi_adapter *adapter) - struct PVSCSIRingMsgDesc *e = ring + (s->msgConsIdx & - MASK(msg_entries)); - -- barrier(); -+ /* -+ * This virt_rmb() ensures that *e is not dereferenced while -+ * the device emulation still writes data into the slot. -+ * Since the device emulation advances s->msgProdIdx only after -+ * updating the slot we want to check it first. -+ */ -+ virt_rmb(); - pvscsi_process_msg(adapter, e); -- barrier(); -+ /* -+ * This virt_rmb() ensures that write to s->msgConsIdx doesn't -+ * get reordered before the read of (*e) inside -+ * pvscsi_process_msg. Otherwise, device emulation may -+ * overwrite *e before we had a chance to read it. -+ */ -+ virt_rmb(); - s->msgConsIdx++; - } - } --- -2.28.0 - diff --git a/SPECS/91/linux/aarch64/0005-vmw_balloon-add-arm64-support.patch b/SPECS/91/linux/aarch64/0005-vmw_balloon-add-arm64-support.patch deleted file mode 100644 index 1087da1827..0000000000 --- a/SPECS/91/linux/aarch64/0005-vmw_balloon-add-arm64-support.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 75d887c2fc2dd7b44e8259d5ce0b8d5e3b7c83ea Mon Sep 17 00:00:00 2001 -From: Cyprien Laplace -Date: Sat, 30 Nov 2019 11:20:24 -0500 -Subject: [PATCH 5/6] vmw_balloon: add arm64 support - -Use the HVC 0x86 to trigger vmballoon I/O port interface with its backdoor -ABI. - -Disable driver if 16KB or 64KB pages are selected as the VMware hypervisor -assumes 4KB pages at the moment. - -Signed-off-by: Cyprien Laplace -Reviewed-by: Nadav Amit ---- - drivers/misc/Kconfig | 3 +- - drivers/misc/vmw_balloon.c | 57 ++++++++++++++++++++++++++++++++------ - 2 files changed, 50 insertions(+), 10 deletions(-) - -diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig -index fafa8b0d8..695149f04 100644 ---- a/drivers/misc/Kconfig -+++ b/drivers/misc/Kconfig -@@ -363,7 +363,8 @@ config DS1682 - - config VMWARE_BALLOON - tristate "VMware Balloon Driver" -- depends on VMWARE_VMCI && X86 && HYPERVISOR_GUEST -+ depends on VMWARE_VMCI && (X86 || ARM64) && HYPERVISOR_GUEST -+ depends on !ARM64_16K_PAGES && !ARM64_64K_PAGES && !CPU_BIG_ENDIAN - select MEMORY_BALLOON - help - This is VMware physical memory management driver which acts -diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c -index bd5a9ad56..cb709eb17 100644 ---- a/drivers/misc/vmw_balloon.c -+++ b/drivers/misc/vmw_balloon.c -@@ -34,7 +34,9 @@ - #include - #include - #include --#include -+#include -+ -+#include - - MODULE_AUTHOR("VMware, Inc."); - MODULE_DESCRIPTION("VMware Memory Control (Balloon) Driver"); -@@ -458,19 +460,17 @@ static inline void vmballoon_stats_page_add(struct vmballoon *b, - atomic64_add(val, &b->stats->page_stat[stat][size]); - } - -+#if defined CONFIG_X86 - static inline unsigned long --__vmballoon_cmd(struct vmballoon *b, unsigned long cmd, unsigned long arg1, -- unsigned long arg2, unsigned long *result) -+__vmballoon_call(unsigned long cmd, unsigned long arg1, unsigned long arg2, -+ unsigned long *dummy1, unsigned long *result) - { -- unsigned long status, dummy1, dummy2, dummy3, local_result; -- -- vmballoon_stats_op_inc(b, cmd, VMW_BALLOON_OP_STAT); -- -+ unsigned long status, dummy2, dummy3; - asm volatile ("inl %%dx" : - "=a"(status), -- "=c"(dummy1), -+ "=c"(*dummy1), - "=d"(dummy2), -- "=b"(local_result), -+ "=b"(*result), - "=S"(dummy3) : - "0"(VMW_BALLOON_HV_MAGIC), - "1"(cmd), -@@ -478,6 +478,45 @@ __vmballoon_cmd(struct vmballoon *b, unsigned long cmd, unsigned long arg1, - "3"(arg1), - "4"(arg2) : - "memory"); -+ return status; -+} -+#elif defined CONFIG_ARM64 -+static inline unsigned long -+__vmballoon_call(unsigned long cmd, unsigned long arg1, unsigned long arg2, -+ unsigned long *dummy1, unsigned long *result) -+{ -+ register u64 x0 asm("x0") = VMW_BALLOON_HV_MAGIC; -+ register u64 x1 asm("x1") = arg1; -+ register u32 w2 asm("w2") = cmd; -+ register u32 w3 asm("w3") = VMW_BALLOON_HV_PORT; -+ register u32 w4 asm("w4") = arg2; -+ register u32 w7 asm("w7") = X86_IO_W7_WITH | -+ X86_IO_W7_DIR | -+ 2 << X86_IO_W7_SIZE_SHIFT; -+ asm volatile ("hvc %6" : -+ "+r"(x0), -+ "+r"(x1), -+ "+r"(w2), -+ "+r"(w3) : -+ "r" (w4), -+ "r" (w7), -+ "i" (X86_IO_MAGIC) : -+ "memory"); -+ *dummy1 = w2; -+ *result = x1; -+ return x0; -+} -+#endif -+ -+static inline unsigned long -+__vmballoon_cmd(struct vmballoon *b, unsigned long cmd, unsigned long arg1, -+ unsigned long arg2, unsigned long *result) -+{ -+ unsigned long status, dummy1, local_result; -+ -+ vmballoon_stats_op_inc(b, cmd, VMW_BALLOON_OP_STAT); -+ -+ status = __vmballoon_call(cmd, arg1, arg2, &dummy1, &local_result); - - /* update the result if needed */ - if (result) --- -2.28.0 - diff --git a/SPECS/91/linux/aarch64/0006-vmxnet3-build-only-for-x86-and-arm64.patch b/SPECS/91/linux/aarch64/0006-vmxnet3-build-only-for-x86-and-arm64.patch deleted file mode 100644 index 40c7035e7b..0000000000 --- a/SPECS/91/linux/aarch64/0006-vmxnet3-build-only-for-x86-and-arm64.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 7495ae90b1dc68f2cea4a124b78e5ee876220d9c Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Wed, 25 May 2022 12:53:16 +0000 -Subject: [PATCH 6/6] vmxnet3: build only for x86 and arm64 - -The vmxnet3 is already supporting arm64, so there's only Kconfig -changes here. - -Build vmxnet3 driver only for x86 and now arm64 architectures. - -Disable driver if 16KB or 64KB pages are selected as the VMware -hypervisor assumes 4KB pages at the moment. - -Signed-off-by: Cyprien Laplace -Signed-off-by: Keerthana K ---- - drivers/net/Kconfig | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig -index 9920b3a68..21d181ef0 100644 ---- a/drivers/net/Kconfig -+++ b/drivers/net/Kconfig -@@ -614,8 +614,8 @@ config XEN_NETDEV_BACKEND - - config VMXNET3 - tristate "VMware VMXNET3 ethernet driver" -- depends on PCI && INET -- depends on PAGE_SIZE_LESS_THAN_64KB -+ depends on PCI && INET && (X86 || ARM64) -+ depends on PAGE_SIZE_LESS_THAN_64KB && !ARM64_16K_PAGES && !CPU_BIG_ENDIAN - select PAGE_POOL - help - This driver supports VMware's vmxnet3 virtual ethernet NIC. --- -2.40.4 - diff --git a/SPECS/91/linux/acvp_patches/0001-Crypto-Tamper-KAT-PCT-and-Integrity-Test.patch b/SPECS/91/linux/acvp_patches/0001-Crypto-Tamper-KAT-PCT-and-Integrity-Test.patch deleted file mode 100644 index 9a6e01ff03..0000000000 --- a/SPECS/91/linux/acvp_patches/0001-Crypto-Tamper-KAT-PCT-and-Integrity-Test.patch +++ /dev/null @@ -1,313 +0,0 @@ -From 84ba33379c1f55ccc4f32f7532dfe5558654ed28 Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Wed, 22 Nov 2023 08:47:46 +0000 -Subject: [PATCH] Crypto: Tamper KAT, PCT and Integrity Test - -- Introduced new kernel command line parameter(tampertest) to tamper KAT, - PCT and integrity test for FIPS CMVP testing. -- tampertest parameter takes values [-2,-1,1,2,...48]. Each corresponds to - breaking a test. -- Value of -2 tampers Pairwise Consistency Test and simulate a failure. -- Value of -1 tampers Canister Integrity test. -- Values [1,..48] tampers KAT test for the supported algorithms - in LKCM 5.0. - -Signed-off-by: Keerthana K -Signed-off-by: Srish Srinivasan -[Removed rsa, cfb(aes) and added ecdsa-nist-p521 to tamper alg_list] -Signed-off-by: Shivani Agarwal ---- - crypto/Makefile | 1 + - crypto/crypto_tamper_test.c | 107 ++++++++++++++++++++++++++++++++++++ - crypto/ecc.c | 16 +++++- - crypto/testmgr.c | 60 ++++++++++++++++++++ - init/main.c | 9 +++ - 5 files changed, 191 insertions(+), 2 deletions(-) - create mode 100644 crypto/crypto_tamper_test.c - -diff --git a/crypto/Makefile b/crypto/Makefile -index b64406750..0a36a28c8 100644 ---- a/crypto/Makefile -+++ b/crypto/Makefile -@@ -252,6 +252,7 @@ $(obj)/lib-crypto-%.o: $(srctree)/lib/crypto/%.c FORCE - $(call if_changed_rule,cc_o_c) - - canister += crypto_self_test.o -+canister += crypto_tamper_test.o - - canister += fips_integrity.o - -diff --git a/crypto/crypto_tamper_test.c b/crypto/crypto_tamper_test.c -new file mode 100644 -index 000000000..748c28aee ---- /dev/null -+++ b/crypto/crypto_tamper_test.c -@@ -0,0 +1,107 @@ -+/* -+ * Tamper test module -+ * -+ * Copyright (c) 2020-2023 VMware -+ * -+ */ -+#include -+#include -+#include -+#include -+#include -+#include "fips_canister_wrapper.h" -+ -+int tamper_testbuild; -+/* Process kernel command-line parameter at boot time. -++ * tampertest=1 tampertest=2 etc -++ */ -+static int tamper_test(char *str) -+{ -+ tamper_testbuild = simple_strtol(str, NULL, 0); -+ fcw_printk(KERN_INFO "Broken KAT, PCT and Integrity test : %d\n", tamper_testbuild); -+ return 1; -+} -+ -+__setup("tampertest=", tamper_test); -+ -+extern void tamper_ecc_static_keypairs(void); -+ -+static const char * const alg_list[] = { -+ "cbc(aes)", -+ "xts(aes)", -+ "ctr(aes)", -+ "hmac(sha224)", -+ "hmac(sha256)", -+ "hmac(sha384)", -+ "hmac(sha512)", -+ "pkcs1pad(rsa,sha256)", -+ "drbg_pr_ctr_aes128", -+ "drbg_pr_ctr_aes192", -+ "drbg_pr_ctr_aes256", -+ "drbg_pr_sha256", -+ "drbg_pr_sha384", -+ "drbg_pr_sha512", -+ "drbg_pr_hmac_sha256", -+ "drbg_pr_hmac_sha384", -+ "drbg_pr_hmac_sha512", -+ "drbg_nopr_ctr_aes128", -+ "drbg_nopr_ctr_aes192", -+ "drbg_nopr_ctr_aes256", -+ "drbg_nopr_sha256", -+ "drbg_nopr_sha384", -+ "drbg_nopr_sha512", -+ "drbg_nopr_hmac_sha256", -+ "drbg_nopr_hmac_sha384", -+ "drbg_nopr_hmac_sha512", -+ "ecdh-nist-p256", -+ "ecdh-nist-p384", -+ "ecdsa-nist-p256", -+ "ecdsa-nist-p384", -+ "ecdsa-nist-p521", -+ "gcm(aes)", -+ "rfc4106(gcm(aes))", -+ "ccm(aes)", -+ "cts(cbc(aes))", -+ "cmac(aes)", -+ "hmac(sha3-224)", -+ "hmac(sha3-256)", -+ "hmac(sha3-384)", -+ "hmac(sha3-512)", -+ "sha224", -+ "sha256", -+ "sha384", -+ "sha512", -+ "sha3-224", -+ "sha3-256", -+ "sha3-384", -+ "sha3-512", -+}; -+ -+void tamper_input_vector(const char *alg, const char *driver, const char *vector); -+void tamper_input_vector(const char *alg, const char *driver, const char *vector) -+{ -+ int idx = tamper_testbuild - 1; -+ char *test = "\x23\x32\x23\x32\x23\x32\x23\x32"; -+ -+ switch (tamper_testbuild) { -+ case 1 ... 48: -+ if (strcmp(alg, alg_list[idx]) && strcmp(driver, alg_list[idx])) -+ break; -+ -+ memcpy((char *)vector, test, strlen(test)); -+ break; -+ } -+} -+ -+static int __init crypto_tamper_test_init(void) -+{ -+ if (fips_enabled && tamper_testbuild == -2) -+ tamper_ecc_static_keypairs(); -+ -+ return 1; -+} -+ -+static void __exit crypto_tamper_test_exit(void) {} -+ -+arch_initcall(crypto_tamper_test_init); -+module_exit(crypto_tamper_test_exit); -diff --git a/crypto/ecc.c b/crypto/ecc.c -index ac966e156..10a0b3656 100644 ---- a/crypto/ecc.c -+++ b/crypto/ecc.c -@@ -1559,7 +1559,7 @@ struct static_keypair { - u64 pub_key[ECC_MAX_PUB_KEY_SZ]; - }; - --static const struct static_keypair ecc_p256 = { -+static struct static_keypair ecc_p256 = { - .priv_key = { - 9452439779319861540ULL, - 11761858801976435446ULL, -@@ -1580,7 +1580,7 @@ static const struct static_keypair ecc_p256 = { - }, - }; - --static const struct static_keypair ecc_p384 = { -+static struct static_keypair ecc_p384 = { - .priv_key = { - 14313235887423266569ULL, - 9198168633825396889ULL, -@@ -1706,6 +1706,18 @@ int ecc_make_pub_key(unsigned int curve_id, unsigned int ndigits, - return ret; - } - -+void tamper_ecc_static_keypairs(void); -+void tamper_ecc_static_keypairs(void) -+{ -+ u64 *test = fcw_kmalloc(sizeof(u64), GFP_KERNEL); -+ u64 *p256_priv_key = ecc_p256.priv_key; -+ u64 *p384_priv_key = ecc_p384.priv_key; -+ memset(test, 0, sizeof(u64)); -+ memcpy(p256_priv_key, test, sizeof(u64)); -+ memcpy(p384_priv_key, test, sizeof(u64)); -+ kfree(test); -+} -+ - /* SP800-56A section 5.6.2.3.4 partial verification: ephemeral keys only */ - int ecc_is_pubkey_valid_partial(const struct ecc_curve *curve, - struct ecc_point *pk) -diff --git a/crypto/testmgr.c b/crypto/testmgr.c -index 45d667d16..210531256 100644 ---- a/crypto/testmgr.c -+++ b/crypto/testmgr.c -@@ -39,11 +39,67 @@ - #include "fips_canister_wrapper.h" - #include "fips_canister_wrapper_common.h" - -+#include "testmgr.h" -+ -+extern int tamper_testbuild; -+const char ** poison_alg_strs[] = { -+ (const char **)&aes_cbc_tv_template[2].ctext, -+ (const char **)&aes_xts_tv_template[4].ctext, -+ (const char **)&aes_ctr_tv_template[2].ctext, -+ (const char **)&hmac_sha224_tv_template[2].digest, -+ (const char **)&hmac_sha256_tv_template[0].digest, -+ (const char **)&hmac_sha384_tv_template[0].digest, -+ (const char **)&hmac_sha512_tv_template[0].digest, -+ (const char **)&pkcs1pad_rsa_tv_template[0].c, -+ (const char **)&drbg_pr_ctr_aes128_tv_template[0].expected, -+ (const char **)&drbg_pr_ctr_aes192_tv_template[0].expected, -+ (const char **)&drbg_pr_ctr_aes256_tv_template[0].expected, -+ (const char **)&drbg_pr_sha256_tv_template[0].expected, -+ (const char **)&drbg_pr_sha384_tv_template[0].expected, -+ (const char **)&drbg_pr_sha512_tv_template[0].expected, -+ (const char **)&drbg_pr_hmac_sha256_tv_template[0].expected, -+ (const char **)&drbg_pr_hmac_sha384_tv_template[0].expected, -+ (const char **)&drbg_pr_hmac_sha512_tv_template[0].expected, -+ (const char **)&drbg_nopr_ctr_aes128_tv_template[0].expected, -+ (const char **)&drbg_nopr_ctr_aes192_tv_template[0].expected, -+ (const char **)&drbg_nopr_ctr_aes256_tv_template[0].expected, -+ (const char **)&drbg_nopr_sha256_tv_template[0].expected, -+ (const char **)&drbg_nopr_sha384_tv_template[0].expected, -+ (const char **)&drbg_nopr_sha512_tv_template[0].expected, -+ (const char **)&drbg_nopr_hmac_sha256_tv_template[0].expected, -+ (const char **)&drbg_nopr_hmac_sha384_tv_template[0].expected, -+ (const char **)&drbg_nopr_hmac_sha512_tv_template[0].expected, -+ (const char **)&ecdh_p256_tv_template[0].expected_ss, -+ (const char **)&ecdh_p384_tv_template[0].expected_ss, -+ (const char **)&ecdsa_nist_p256_tv_template[0].c, -+ (const char **)&ecdsa_nist_p384_tv_template[0].c, -+ (const char **)&ecdsa_nist_p521_tv_template[0].c, -+ (const char **)&aes_gcm_tv_template[0].ctext, -+ (const char **)&aes_gcm_rfc4106_tv_template[0].ctext, -+ (const char **)&aes_ccm_tv_template[0].ctext, -+ (const char **)&cts_mode_tv_template[0].ctext, -+ (const char **)&aes_cmac128_tv_template[0].digest, -+ (const char **)&hmac_sha3_224_tv_template[0].digest, -+ (const char **)&hmac_sha3_256_tv_template[0].digest, -+ (const char **)&hmac_sha3_384_tv_template[0].digest, -+ (const char **)&hmac_sha3_512_tv_template[0].digest, -+ (const char **)&sha224_tv_template[0].digest, -+ (const char **)&sha256_tv_template[0].digest, -+ (const char **)&sha384_tv_template[0].digest, -+ (const char **)&sha512_tv_template[0].digest, -+ (const char **)&sha3_224_tv_template[0].digest, -+ (const char **)&sha3_256_tv_template[0].digest, -+ (const char **)&sha3_384_tv_template[0].digest, -+ (const char **)&sha3_512_tv_template[0].digest, -+}; -+ - #ifdef CONFIG_CRYPTO_MANAGER_EXTRA_TESTS - static bool noextratests; - static unsigned int fuzz_iterations = 100; - #endif - -+extern void tamper_input_vector(const char *alg, const char *driver, const char *vector); -+ - #ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS - - /* a perfect nop */ -@@ -5645,6 +5701,10 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask) - goto non_fips_alg; - } - -+ if (fips_enabled && tamper_testbuild > 0 && tamper_testbuild <= 48) { -+ tamper_input_vector(alg, driver, *poison_alg_strs[tamper_testbuild-1]); -+ } -+ - rc = 0; - if (i >= 0) - rc |= alg_test_descs[i].test(alg_test_descs + i, driver, -diff --git a/init/main.c b/init/main.c -index 6c2afc299..880dc6ac1 100644 ---- a/init/main.c -+++ b/init/main.c -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -844,6 +845,8 @@ early_param("randomize_kstack_offset", early_randomize_kstack_offset); - #endif - - extern int fips_integrity_init(void); -+extern int tamper_testbuild; -+extern char canister_sections[]; - - static void __init print_unknown_bootoptions(void) - { -@@ -955,6 +958,12 @@ void start_kernel(void) - /* Architectural and non-timekeeping rng init, before allocator init */ - random_init_early(command_line); - -+ if (fips_enabled && tamper_testbuild == -1) { -+ unsigned long p = kallsyms_lookup_name(canister_sections); -+ printk("Simulating broken Integrity test... corrupting canister section\n"); -+ memset((void *)(p + 8), 0, sizeof(unsigned long)); -+ } -+ - fips_integrity_init(); - /* - * These use large bootmem allocations and must precede --- -2.40.4 - diff --git a/SPECS/91/linux/acvp_patches/0001-crypto-AF_ALG-add-sign-verify-API.patch b/SPECS/91/linux/acvp_patches/0001-crypto-AF_ALG-add-sign-verify-API.patch deleted file mode 100644 index 8f3923e502..0000000000 --- a/SPECS/91/linux/acvp_patches/0001-crypto-AF_ALG-add-sign-verify-API.patch +++ /dev/null @@ -1,232 +0,0 @@ -From cc06f342a8e3128d6d1f8ef3957b449576f77028 Mon Sep 17 00:00:00 2001 -From: Vikash Bansal -Date: Mon, 25 Jan 2021 10:53:06 +0530 -Subject: [PATCH] crypto: AF_ALG -- add sign/verify API - -Add the flags for handling signature generation and signature -verification. - -The af_alg helper code as well as the algif_skcipher and algif_aead code -must be changed from a boolean indicating the cipher operation to an -integer because there are now 4 different cipher operations that are -defined. Yet, the algif_aead and algif_skcipher code still only allows -encryption and decryption cipher operations. - -Signed-off-by: Stephan Mueller -Signed-off-by: Tadeusz Struk -Signed-off-by: Shivani Agarwal ---- - crypto/af_alg.c | 10 +++++----- - crypto/algif_aead.c | 28 +++++++++++++++++++--------- - crypto/algif_skcipher.c | 20 ++++++++++++++++---- - include/crypto/if_alg.h | 6 +++--- - include/uapi/linux/if_alg.h | 2 ++ - 5 files changed, 45 insertions(+), 21 deletions(-) - -diff --git a/crypto/af_alg.c b/crypto/af_alg.c -index 3c3cb965f..5dd8a9977 100644 ---- a/crypto/af_alg.c -+++ b/crypto/af_alg.c -@@ -919,7 +919,7 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size, - struct af_alg_tsgl *sgl; - struct af_alg_control con = {}; - long copied = 0; -- bool enc = false; -+ int op = 0; - bool init = false; - int err = 0; - -@@ -930,11 +930,11 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size, - - init = true; - switch (con.op) { -+ case ALG_OP_VERIFY: -+ case ALG_OP_SIGN: - case ALG_OP_ENCRYPT: -- enc = true; -- break; - case ALG_OP_DECRYPT: -- enc = false; -+ op = con.op; - break; - default: - return -EINVAL; -@@ -964,7 +964,7 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size, - ctx->init = true; - - if (init) { -- ctx->enc = enc; -+ ctx->op = op; - if (con.iv) - memcpy(ctx->iv, con.iv->iv, ivsize); - -diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c -index c6c2ce218..e5b17cf65 100644 ---- a/crypto/algif_aead.c -+++ b/crypto/algif_aead.c -@@ -47,7 +47,7 @@ static inline bool aead_sufficient_data(struct sock *sk) - * The minimum amount of memory needed for an AEAD cipher is - * the AAD and in case of decryption the tag. - */ -- return ctx->used >= ctx->aead_assoclen + (ctx->enc ? 0 : as); -+ return ctx->used >= ctx->aead_assoclen + (ctx->op ? 0 : as); - } - - static int aead_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) -@@ -62,6 +62,19 @@ static int aead_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) - return af_alg_sendmsg(sock, msg, size, ivsize); - } - -+static inline int aead_cipher_op(struct af_alg_ctx *ctx, -+ struct af_alg_async_req *areq) -+{ -+ switch (ctx->op) { -+ case ALG_OP_ENCRYPT: -+ return crypto_aead_encrypt(&areq->cra_u.aead_req); -+ case ALG_OP_DECRYPT: -+ return crypto_aead_decrypt(&areq->cra_u.aead_req); -+ default: -+ return -EOPNOTSUPP; -+ } -+} -+ - static int _aead_recvmsg(struct socket *sock, struct msghdr *msg, - size_t ignored, int flags) - { -@@ -114,7 +127,7 @@ static int _aead_recvmsg(struct socket *sock, struct msghdr *msg, - * buffer provides the tag which is consumed resulting in only the - * plaintext without a buffer for the tag returned to the caller. - */ -- if (ctx->enc) -+ if (ctx->op) - outlen = used + as; - else - outlen = used - as; -@@ -150,7 +163,7 @@ static int _aead_recvmsg(struct socket *sock, struct msghdr *msg, - if (usedpages < outlen) { - size_t less = outlen - usedpages; - -- if (used < less + (ctx->enc ? 0 : as)) { -+ if (used < less + (ctx->op ? 0 : as)) { - err = -EINVAL; - goto free; - } -@@ -208,8 +221,7 @@ static int _aead_recvmsg(struct socket *sock, struct msghdr *msg, - aead_request_set_callback(&areq->cra_u.aead_req, - CRYPTO_TFM_REQ_MAY_SLEEP, - af_alg_async_cb, areq); -- err = ctx->enc ? crypto_aead_encrypt(&areq->cra_u.aead_req) : -- crypto_aead_decrypt(&areq->cra_u.aead_req); -+ err = aead_cipher_op(ctx, areq); - - /* AIO operation in progress */ - if (err == -EINPROGRESS) -@@ -222,10 +234,7 @@ static int _aead_recvmsg(struct socket *sock, struct msghdr *msg, - CRYPTO_TFM_REQ_MAY_SLEEP | - CRYPTO_TFM_REQ_MAY_BACKLOG, - crypto_req_done, &ctx->wait); -- err = crypto_wait_req(ctx->enc ? -- crypto_aead_encrypt(&areq->cra_u.aead_req) : -- crypto_aead_decrypt(&areq->cra_u.aead_req), -- &ctx->wait); -+ err = crypto_wait_req(aead_cipher_op(ctx, areq), &ctx->wait); - } - - -@@ -422,6 +431,7 @@ static int aead_accept_parent_nokey(void *private, struct sock *sk) - - INIT_LIST_HEAD(&ctx->tsgl_list); - ctx->len = len; -+ ctx->op = 0; - crypto_init_wait(&ctx->wait); - - ask->private = ctx; -diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c -index 35ebc3e02..54b7cda3a 100644 ---- a/crypto/algif_skcipher.c -+++ b/crypto/algif_skcipher.c -@@ -79,6 +79,19 @@ static int algif_skcipher_export(struct sock *sk, struct skcipher_request *req) - return err; - } - -+static inline int skcipher_cipher_op(struct af_alg_ctx *ctx, -+ struct af_alg_async_req *areq) -+{ -+ switch (ctx->op) { -+ case ALG_OP_ENCRYPT: -+ return crypto_skcipher_encrypt(&areq->cra_u.skcipher_req); -+ case ALG_OP_DECRYPT: -+ return crypto_skcipher_decrypt(&areq->cra_u.skcipher_req); -+ default: -+ return -EOPNOTSUPP; -+ } -+} -+ - static int _skcipher_recvmsg(struct socket *sock, struct msghdr *msg, - size_t ignored, int flags) - { -@@ -175,10 +188,8 @@ static int _skcipher_recvmsg(struct socket *sock, struct msghdr *msg, - CRYPTO_TFM_REQ_MAY_SLEEP | - CRYPTO_TFM_REQ_MAY_BACKLOG, - crypto_req_done, &ctx->wait); -- err = crypto_wait_req(ctx->enc ? -- crypto_skcipher_encrypt(&areq->cra_u.skcipher_req) : -- crypto_skcipher_decrypt(&areq->cra_u.skcipher_req), -- &ctx->wait); -+ err = crypto_wait_req(skcipher_cipher_op(ctx, areq), -+ &ctx->wait); - if (!err) - err = algif_skcipher_export(sk, &areq->cra_u.skcipher_req); - -@@ -371,6 +382,7 @@ static int skcipher_accept_parent_nokey(void *private, struct sock *sk) - - INIT_LIST_HEAD(&ctx->tsgl_list); - ctx->len = len; -+ ctx->op = 0; - crypto_init_wait(&ctx->wait); - - ask->private = ctx; -diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h -index 0cc8fa749..c907a4a6e 100644 ---- a/include/crypto/if_alg.h -+++ b/include/crypto/if_alg.h -@@ -133,10 +133,10 @@ struct af_alg_async_req { - * @more: More data to be expected from user space? - * @merge: Shall new data from user space be merged into existing - * SG? -- * @enc: Cryptographic operation to be performed when -- * recvmsg is invoked. - * @write: True if we are in the middle of a write. - * @init: True if metadata has been sent. -+ * @op: Cryptographic operation to be performed when -+ * recvmsg is invoked. - * @len: Length of memory allocated for this data structure. - * @inflight: Non-zero when AIO requests are in flight. - */ -@@ -154,10 +154,10 @@ struct af_alg_ctx { - - bool more:1, - merge:1, -- enc:1, - write:1, - init:1; - -+ int op; - unsigned int len; - - unsigned int inflight; -diff --git a/include/uapi/linux/if_alg.h b/include/uapi/linux/if_alg.h -index 0824fbc02..3a3b08f75 100644 ---- a/include/uapi/linux/if_alg.h -+++ b/include/uapi/linux/if_alg.h -@@ -57,5 +57,7 @@ struct af_alg_iv { - /* Operations */ - #define ALG_OP_DECRYPT 0 - #define ALG_OP_ENCRYPT 1 -+#define ALG_OP_SIGN 2 -+#define ALG_OP_VERIFY 3 - - #endif /* _LINUX_IF_ALG_H */ --- -2.53.0 - diff --git a/SPECS/91/linux/acvp_patches/0002-crypto-AF_ALG-add-setpubkey-setsockopt-call.patch b/SPECS/91/linux/acvp_patches/0002-crypto-AF_ALG-add-setpubkey-setsockopt-call.patch deleted file mode 100644 index 067fcb686a..0000000000 --- a/SPECS/91/linux/acvp_patches/0002-crypto-AF_ALG-add-setpubkey-setsockopt-call.patch +++ /dev/null @@ -1,98 +0,0 @@ -From b24c7668ab324554dc7fd9211fa27795d9a1cd9a Mon Sep 17 00:00:00 2001 -From: Vikash Bansal -Date: Mon, 25 Jan 2021 10:59:15 +0530 -Subject: [PATCH 2/7] crypto: AF_ALG -- add setpubkey setsockopt call - -For supporting asymmetric ciphers, user space must be able to set the -public key. The patch adds a new setsockopt call for setting the public -key. - -Signed-off-by: Stephan Mueller -Signed-off-by: Shivani Agarwal ---- - crypto/af_alg.c | 20 ++++++++++++++------ - include/crypto/if_alg.h | 1 + - include/uapi/linux/if_alg.h | 1 + - 3 files changed, 16 insertions(+), 6 deletions(-) - -diff --git a/crypto/af_alg.c b/crypto/af_alg.c -index dfb71fa3b..4e15a0ab9 100644 ---- a/crypto/af_alg.c -+++ b/crypto/af_alg.c -@@ -205,13 +205,17 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) - return err; - } - --static int alg_setkey(struct sock *sk, sockptr_t ukey, unsigned int keylen) -+static int alg_setkey(struct sock *sk, sockptr_t ukey, unsigned int keylen, -+ int (*setkey)(void *private, const u8 *key, -+ unsigned int keylen)) - { - struct alg_sock *ask = alg_sk(sk); -- const struct af_alg_type *type = ask->type; - u8 *key; - int err; - -+ if (!setkey) -+ return -ENOPROTOOPT; -+ - key = sock_kmalloc(sk, keylen, GFP_KERNEL); - if (!key) - return -ENOMEM; -@@ -220,7 +224,7 @@ static int alg_setkey(struct sock *sk, sockptr_t ukey, unsigned int keylen) - if (copy_from_sockptr(key, ukey, keylen)) - goto out; - -- err = type->setkey(ask->private, key, keylen); -+ err = setkey(ask->private, key, keylen); - - out: - sock_kzfree_s(sk, key, keylen); -@@ -377,13 +381,17 @@ static int alg_setsockopt(struct socket *sock, int level, int optname, - case ALG_SET_KEY_BY_KEY_SERIAL: - if (sock->state == SS_CONNECTED) - goto unlock; -- if (!type->setkey) -- goto unlock; - - if (optname == ALG_SET_KEY_BY_KEY_SERIAL) - err = alg_setkey_by_key_serial(ask, optval, optlen); - else -- err = alg_setkey(sk, optval, optlen); -+ err = alg_setkey(sk, optval, optlen, type->setkey); -+ break; -+ case ALG_SET_PUBKEY: -+ if (sock->state == SS_CONNECTED) -+ goto unlock; -+ -+ err = alg_setkey(sk, optval, optlen, type->setpubkey); - break; - case ALG_SET_AEAD_AUTHSIZE: - if (sock->state == SS_CONNECTED) -diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h -index 9ef124926..32e3e9840 100644 ---- a/include/crypto/if_alg.h -+++ b/include/crypto/if_alg.h -@@ -44,6 +44,7 @@ struct af_alg_type { - void *(*bind)(const char *name, u32 type, u32 mask); - void (*release)(void *private); - int (*setkey)(void *private, const u8 *key, unsigned int keylen); -+ int (*setpubkey)(void *private, const u8 *key, unsigned int keylen); - int (*setentropy)(void *private, sockptr_t entropy, unsigned int len); - int (*accept)(void *private, struct sock *sk); - int (*accept_nokey)(void *private, struct sock *sk); -diff --git a/include/uapi/linux/if_alg.h b/include/uapi/linux/if_alg.h -index 3a3b08f75..d661aac49 100644 ---- a/include/uapi/linux/if_alg.h -+++ b/include/uapi/linux/if_alg.h -@@ -53,6 +53,7 @@ struct af_alg_iv { - #define ALG_SET_AEAD_AUTHSIZE 5 - #define ALG_SET_DRBG_ENTROPY 6 - #define ALG_SET_KEY_BY_KEY_SERIAL 7 -+#define ALG_SET_PUBKEY 13 - - /* Operations */ - #define ALG_OP_DECRYPT 0 --- -2.39.4 - diff --git a/SPECS/91/linux/acvp_patches/0003-crypto-AF_ALG-add-asymmetric-cipher.patch b/SPECS/91/linux/acvp_patches/0003-crypto-AF_ALG-add-asymmetric-cipher.patch deleted file mode 100644 index 84042ca4fc..0000000000 --- a/SPECS/91/linux/acvp_patches/0003-crypto-AF_ALG-add-asymmetric-cipher.patch +++ /dev/null @@ -1,554 +0,0 @@ -From ee217883d5da1422f959abc89b6c6f565dc42523 Mon Sep 17 00:00:00 2001 -From: Vikash Bansal -Date: Tue, 23 Mar 2021 13:13:00 +0530 -Subject: [PATCH 3/7] crypto: AF_ALG -- add asymmetric cipher - -This patch adds the user space interface for asymmetric ciphers. The -interface allows the use of sendmsg as well as vmsplice to provide data. - -The akcipher interface implementation uses the common AF_ALG interface -code regarding TX and RX SGL handling. - -Signed-off-by: Stephan Mueller -Signed-off-by: Vikash Bansal -Signed-off-by: Srish Srinivasan -[Add memset() to akcipher_accept_parent_nokey() so that -the new "inflight" field is initialized to zero] -Signed-off-by: Shivani Agarwal ---- - crypto/Kconfig | 9 + - crypto/Makefile | 1 + - crypto/algif_akcipher.c | 468 ++++++++++++++++++++++++++++++++++++++++ - include/crypto/if_alg.h | 2 + - 4 files changed, 480 insertions(+) - create mode 100644 crypto/algif_akcipher.c - -diff --git a/crypto/Kconfig b/crypto/Kconfig -index aec7ccaf3..7da59dd68 100644 ---- a/crypto/Kconfig -+++ b/crypto/Kconfig -@@ -1502,6 +1502,15 @@ config CRYPTO_USER_API_ENABLE_OBSOLETE - - endmenu - -+config CRYPTO_USER_API_AKCIPHER -+ tristate "User-space interface for asymmetric key cipher algorithms" -+ depends on NET -+ select CRYPTO_AKCIPHER2 -+ select CRYPTO_USER_API -+ help -+ This option enables the user-space interface for asymmetric -+ key cipher algorithms. -+ - config CRYPTO_HASH_INFO - bool - -diff --git a/crypto/Makefile b/crypto/Makefile -index 3c6030ea9..be16d3992 100644 ---- a/crypto/Makefile -+++ b/crypto/Makefile -@@ -192,6 +192,7 @@ ecrdsa_generic-y += ecrdsa.o - ecrdsa_generic-y += ecrdsa_params.asn1.o - ecrdsa_generic-y += ecrdsa_pub_key.asn1.o - obj-$(CONFIG_CRYPTO_ECRDSA) += ecrdsa_generic.o -+obj-$(CONFIG_CRYPTO_USER_API_AKCIPHER) += algif_akcipher.o - - # - # generic algorithms and the async_tx api -diff --git a/crypto/algif_akcipher.c b/crypto/algif_akcipher.c -new file mode 100644 -index 000000000..4dbbfbcd7 ---- /dev/null -+++ b/crypto/algif_akcipher.c -@@ -0,0 +1,468 @@ -+/* -+ * algif_akcipher: User-space interface for asymmetric cipher algorithms -+ * -+ * Copyright (C) 2018 - 2020, Stephan Mueller -+ * -+ * This file provides the user-space API for asymmetric ciphers. -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License as published by the Free -+ * Software Foundation; either version 2 of the License, or (at your option) -+ * any later version. -+ * -+ * The following concept of the memory management is used: -+ * -+ * The kernel maintains two SGLs, the TX SGL and the RX SGL. The TX SGL is -+ * filled by user space with the data submitted via sendpage/sendmsg. Filling -+ * up the TX SGL does not cause a crypto operation -- the data will only be -+ * tracked by the kernel. Upon receipt of one recvmsg call, the caller must -+ * provide a buffer which is tracked with the RX SGL. -+ * -+ * During the processing of the recvmsg operation, the cipher request is -+ * allocated and prepared. As part of the recvmsg operation, the processed -+ * TX buffers are extracted from the TX SGL into a separate SGL. -+ * -+ * After the completion of the crypto operation, the RX SGL and the cipher -+ * request is released. The extracted TX SGL parts are released together with -+ * the RX SGL release. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+struct akcipher_tfm { -+ struct crypto_akcipher *akcipher; -+ bool has_key; -+}; -+ -+static int akcipher_sendmsg(struct socket *sock, struct msghdr *msg, -+ size_t size) -+{ -+ return af_alg_sendmsg(sock, msg, size, 0); -+} -+ -+static inline int akcipher_cipher_op(struct af_alg_ctx *ctx, -+ struct af_alg_async_req *areq) -+{ -+ switch (ctx->op) { -+ case ALG_OP_ENCRYPT: -+ return crypto_akcipher_encrypt(&areq->cra_u.akcipher_req); -+ case ALG_OP_DECRYPT: -+ return crypto_akcipher_decrypt(&areq->cra_u.akcipher_req); -+ case ALG_OP_SIGN: -+ return crypto_akcipher_sign(&areq->cra_u.akcipher_req); -+ case ALG_OP_VERIFY: -+ areq->cra_u.akcipher_req.dst = NULL; -+ areq->cra_u.akcipher_req.src_len = areq->cra_u.akcipher_req.src_len - areq->cra_u.akcipher_req.dst_len; -+ return crypto_akcipher_verify(&areq->cra_u.akcipher_req); -+ default: -+ return -EOPNOTSUPP; -+ } -+} -+ -+static int _akcipher_recvmsg(struct socket *sock, struct msghdr *msg, -+ size_t ignored, int flags) -+{ -+ struct sock *sk = sock->sk; -+ struct alg_sock *ask = alg_sk(sk); -+ struct sock *psk = ask->parent; -+ struct alg_sock *pask = alg_sk(psk); -+ struct af_alg_ctx *ctx = ask->private; -+ struct akcipher_tfm *akc = pask->private; -+ struct crypto_akcipher *tfm = akc->akcipher; -+ struct af_alg_async_req *areq; -+ size_t len; -+ size_t used; -+ int err; -+ int maxsize; -+ -+ if (!ctx->used) { -+ err = af_alg_wait_for_data(sk, flags, 0); -+ if (err) -+ return err; -+ } -+ -+ maxsize = crypto_akcipher_maxsize(tfm); -+ if (maxsize < 0) -+ return maxsize; -+ -+ /* Allocate cipher request for current operation. */ -+ areq = af_alg_alloc_areq(sk, sizeof(struct af_alg_async_req) + -+ crypto_akcipher_reqsize(tfm)); -+ if (IS_ERR(areq)) -+ return PTR_ERR(areq); -+ -+ /* convert iovecs of output buffers into RX SGL */ -+ err = af_alg_get_rsgl(sk, msg, flags, areq, -1 , &len); -+ if (err) -+ goto free; -+ -+ /* ensure output buffer is sufficiently large */ -+ if (ctx->op != ALG_OP_VERIFY && len < maxsize) { -+ err = -EMSGSIZE; -+ goto free; -+ } -+ -+ /* -+ * Create a per request TX SGL for this request which tracks the -+ * SG entries from the global TX SGL. -+ */ -+ used = ctx->used; -+ areq->tsgl_entries = af_alg_count_tsgl(sk, used); -+ if (!areq->tsgl_entries) -+ areq->tsgl_entries = 1; -+ areq->tsgl = sock_kmalloc(sk, sizeof(*areq->tsgl) * areq->tsgl_entries, -+ GFP_KERNEL); -+ if (!areq->tsgl) { -+ err = -ENOMEM; -+ goto free; -+ } -+ sg_init_table(areq->tsgl, areq->tsgl_entries); -+ af_alg_pull_tsgl(sk, used, areq->tsgl); -+ -+ /* Initialize the crypto operation */ -+ akcipher_request_set_tfm(&areq->cra_u.akcipher_req, tfm); -+ akcipher_request_set_crypt(&areq->cra_u.akcipher_req, areq->tsgl, -+ areq->first_rsgl.sgl.sgl, used, len); -+ -+ if (msg->msg_iocb && !is_sync_kiocb(msg->msg_iocb)) { -+ /* AIO operation */ -+ sock_hold(sk); -+ areq->iocb = msg->msg_iocb; -+ -+ /* Remember output size that will be generated. */ -+ areq->outlen = areq->cra_u.akcipher_req.dst_len ? -+ areq->cra_u.akcipher_req.dst_len : len; -+ -+ akcipher_request_set_callback(&areq->cra_u.akcipher_req, -+ CRYPTO_TFM_REQ_MAY_SLEEP, -+ af_alg_async_cb, areq); -+ err = akcipher_cipher_op(ctx, areq); -+ -+ /* AIO operation in progress */ -+ if (err == -EINPROGRESS || err == -EBUSY) -+ return -EIOCBQUEUED; -+ -+ sock_put(sk); -+ } else { -+ /* Synchronous operation */ -+ akcipher_request_set_callback(&areq->cra_u.akcipher_req, -+ CRYPTO_TFM_REQ_MAY_SLEEP | -+ CRYPTO_TFM_REQ_MAY_BACKLOG, -+ crypto_req_done, -+ &ctx->wait); -+ err = crypto_wait_req(akcipher_cipher_op(ctx, areq), -+ &ctx->wait); -+ } -+ -+free: -+ af_alg_free_resources(areq); -+ -+ return err ? err : areq->cra_u.akcipher_req.dst_len; -+} -+ -+static int akcipher_recvmsg(struct socket *sock, struct msghdr *msg, -+ size_t ignored, int flags) -+{ -+ struct sock *sk = sock->sk; -+ struct alg_sock *ask = alg_sk(sk); -+ struct sock *psk = ask->parent; -+ struct alg_sock *pask = alg_sk(psk); -+ struct akcipher_tfm *akc = pask->private; -+ struct crypto_akcipher *tfm = akc->akcipher; -+ int ret = 0; -+ int err; -+ -+ lock_sock(sk); -+ -+ while (msg_data_left(msg)) { -+ err = _akcipher_recvmsg(sock, msg, ignored, flags); -+ -+ /* -+ * This error covers -EIOCBQUEUED which implies that we can -+ * only handle one AIO request. If the caller wants to have -+ * multiple AIO requests in parallel, he must make multiple -+ * separate AIO calls. -+ */ -+ if (err <= 0) { -+ if (err == -EIOCBQUEUED || err == -EBADMSG || !ret) -+ ret = err; -+ goto out; -+ } -+ -+ ret += err; -+ -+ /* -+ * The caller must provide crypto_akcipher_maxsize per request. -+ * If he provides more, we conclude that multiple akcipher -+ * operations are requested. -+ */ -+ iov_iter_advance(&msg->msg_iter, -+ crypto_akcipher_maxsize(tfm) - err); -+ } -+ -+out: -+ af_alg_wmem_wakeup(sk); -+ release_sock(sk); -+ return ret; -+} -+ -+static struct proto_ops algif_akcipher_ops = { -+ .family = PF_ALG, -+ -+ .connect = sock_no_connect, -+ .socketpair = sock_no_socketpair, -+ .getname = sock_no_getname, -+ .ioctl = sock_no_ioctl, -+ .listen = sock_no_listen, -+ .shutdown = sock_no_shutdown, -+ .mmap = sock_no_mmap, -+ .bind = sock_no_bind, -+ .accept = sock_no_accept, -+ .setsockopt = sock_setsockopt, -+ -+ .release = af_alg_release, -+ .sendmsg = akcipher_sendmsg, -+ .sendpage = af_alg_sendpage, -+ .recvmsg = akcipher_recvmsg, -+ .poll = af_alg_poll, -+}; -+ -+static int akcipher_check_key(struct socket *sock) -+{ -+ struct sock *psk; -+ struct alg_sock *pask; -+ struct akcipher_tfm *tfm; -+ struct sock *sk = sock->sk; -+ struct alg_sock *ask = alg_sk(sk); -+ int err = 0; -+ -+ lock_sock(sk); -+ if (!atomic_read(&ask->nokey_refcnt)) -+ goto unlock_child; -+ -+ psk = ask->parent; -+ pask = alg_sk(ask->parent); -+ tfm = pask->private; -+ -+ lock_sock_nested(psk, SINGLE_DEPTH_NESTING); -+ if (!tfm->has_key) { -+ err = -ENOKEY; -+ goto unlock; -+ } -+ atomic_dec(&pask->nokey_refcnt); -+ atomic_set(&ask->nokey_refcnt, 0); -+ -+ err = 0; -+ -+unlock: -+ release_sock(psk); -+unlock_child: -+ release_sock(sk); -+ -+ return err; -+} -+ -+static int akcipher_sendmsg_nokey(struct socket *sock, struct msghdr *msg, -+ size_t size) -+{ -+ int err; -+ -+ err = akcipher_check_key(sock); -+ if (err) -+ return err; -+ -+ return akcipher_sendmsg(sock, msg, size); -+} -+ -+static ssize_t akcipher_sendpage_nokey(struct socket *sock, struct page *page, -+ int offset, size_t size, int flags) -+{ -+ int err; -+ -+ err = akcipher_check_key(sock); -+ if (err) -+ return err; -+ -+ return af_alg_sendpage(sock, page, offset, size, flags); -+} -+ -+static int akcipher_recvmsg_nokey(struct socket *sock, struct msghdr *msg, -+ size_t ignored, int flags) -+{ -+ int err; -+ -+ err = akcipher_check_key(sock); -+ if (err) -+ return err; -+ -+ return akcipher_recvmsg(sock, msg, ignored, flags); -+} -+ -+static struct proto_ops algif_akcipher_ops_nokey = { -+ .family = PF_ALG, -+ -+ .connect = sock_no_connect, -+ .socketpair = sock_no_socketpair, -+ .getname = sock_no_getname, -+ .ioctl = sock_no_ioctl, -+ .listen = sock_no_listen, -+ .shutdown = sock_no_shutdown, -+ .mmap = sock_no_mmap, -+ .bind = sock_no_bind, -+ .accept = sock_no_accept, -+ .setsockopt = sock_setsockopt, -+ -+ .release = af_alg_release, -+ .sendmsg = akcipher_sendmsg_nokey, -+ .sendpage = akcipher_sendpage_nokey, -+ .recvmsg = akcipher_recvmsg_nokey, -+ .poll = af_alg_poll, -+}; -+ -+static void *akcipher_bind(const char *name, u32 type, u32 mask) -+{ -+ struct akcipher_tfm *tfm; -+ struct crypto_akcipher *akcipher; -+ -+ tfm = kmalloc(sizeof(*tfm), GFP_KERNEL); -+ if (!tfm) -+ return ERR_PTR(-ENOMEM); -+ -+ akcipher = crypto_alloc_akcipher(name, type, mask); -+ if (IS_ERR(akcipher)) { -+ kfree(tfm); -+ return ERR_CAST(akcipher); -+ } -+ -+ tfm->akcipher = akcipher; -+ tfm->has_key = false; -+ -+ return tfm; -+} -+ -+static void akcipher_release(void *private) -+{ -+ struct akcipher_tfm *tfm = private; -+ struct crypto_akcipher *akcipher = tfm->akcipher; -+ -+ crypto_free_akcipher(akcipher); -+ kfree(tfm); -+} -+ -+static int akcipher_setprivkey(void *private, const u8 *key, -+ unsigned int keylen) -+{ -+ struct akcipher_tfm *tfm = private; -+ struct crypto_akcipher *akcipher = tfm->akcipher; -+ int err; -+ -+ err = crypto_akcipher_set_priv_key(akcipher, key, keylen); -+ tfm->has_key = !err; -+ -+ /* Return the maximum size of the akcipher operation. */ -+ if (!err) -+ err = crypto_akcipher_maxsize(akcipher); -+ -+ return err; -+} -+ -+static int akcipher_setpubkey(void *private, const u8 *key, unsigned int keylen) -+{ -+ struct akcipher_tfm *tfm = private; -+ struct crypto_akcipher *akcipher = tfm->akcipher; -+ int err; -+ -+ err = crypto_akcipher_set_pub_key(akcipher, key, keylen); -+ tfm->has_key = !err; -+ -+ /* Return the maximum size of the akcipher operation. */ -+ if (!err) -+ err = crypto_akcipher_maxsize(akcipher); -+ -+ return err; -+} -+ -+static void akcipher_sock_destruct(struct sock *sk) -+{ -+ struct alg_sock *ask = alg_sk(sk); -+ struct af_alg_ctx *ctx = ask->private; -+ -+ af_alg_pull_tsgl(sk, ctx->used, NULL); -+ sock_kfree_s(sk, ctx, ctx->len); -+ af_alg_release_parent(sk); -+} -+ -+static int akcipher_accept_parent_nokey(void *private, struct sock *sk) -+{ -+ struct af_alg_ctx *ctx; -+ struct alg_sock *ask = alg_sk(sk); -+ unsigned int len = sizeof(*ctx); -+ -+ ctx = sock_kmalloc(sk, len, GFP_KERNEL); -+ if (!ctx) -+ return -ENOMEM; -+ -+ memset(ctx, 0, len); -+ -+ INIT_LIST_HEAD(&ctx->tsgl_list); -+ ctx->len = len; -+ crypto_init_wait(&ctx->wait); -+ -+ ask->private = ctx; -+ -+ sk->sk_destruct = akcipher_sock_destruct; -+ -+ return 0; -+} -+ -+static int akcipher_accept_parent(void *private, struct sock *sk) -+{ -+ struct akcipher_tfm *tfm = private; -+ -+ if (!tfm->has_key) -+ return -ENOKEY; -+ -+ return akcipher_accept_parent_nokey(private, sk); -+} -+ -+static const struct af_alg_type algif_type_akcipher = { -+ .bind = akcipher_bind, -+ .release = akcipher_release, -+ .setkey = akcipher_setprivkey, -+ .setpubkey = akcipher_setpubkey, -+ .setauthsize = NULL, -+ .accept = akcipher_accept_parent, -+ .accept_nokey = akcipher_accept_parent_nokey, -+ .ops = &algif_akcipher_ops, -+ .ops_nokey = &algif_akcipher_ops_nokey, -+ .name = "akcipher", -+ .owner = THIS_MODULE -+}; -+ -+static int __init algif_akcipher_init(void) -+{ -+ printk("This build is only for ACVP test (not a production build)\n"); -+ return af_alg_register_type(&algif_type_akcipher); -+} -+ -+static void __exit algif_akcipher_exit(void) -+{ -+ int err = af_alg_unregister_type(&algif_type_akcipher); -+ -+ BUG_ON(err); -+} -+ -+module_init(algif_akcipher_init); -+module_exit(algif_akcipher_exit); -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Stephan Mueller "); -+MODULE_DESCRIPTION("Asymmetric kernel crypto API user space interface"); -diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h -index a26e7015e..e427e47f7 100644 ---- a/include/crypto/if_alg.h -+++ b/include/crypto/if_alg.h -@@ -18,6 +18,7 @@ - - #include - #include -+#include - - #define ALG_MAX_PAGES 16 - -@@ -113,6 +114,7 @@ struct af_alg_async_req { - union { - struct aead_request aead_req; - struct skcipher_request skcipher_req; -+ struct akcipher_request akcipher_req; - } cra_u; - - /* req ctx trails this struct */ --- -2.40.4 - diff --git a/SPECS/91/linux/acvp_patches/0004-crypto-AF_ALG-add-DH-keygen-ssgen-API.patch b/SPECS/91/linux/acvp_patches/0004-crypto-AF_ALG-add-DH-keygen-ssgen-API.patch deleted file mode 100644 index deaaccab65..0000000000 --- a/SPECS/91/linux/acvp_patches/0004-crypto-AF_ALG-add-DH-keygen-ssgen-API.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 153a39ad5f1a67709869331821602f8e3c579746 Mon Sep 17 00:00:00 2001 -From: Vikash Bansal -Date: Mon, 25 Jan 2021 11:02:35 +0530 -Subject: [PATCH 4/7] crypto: AF_ALG -- add DH keygen / ssgen API - -Add the flags for handling DH key generation and DH shared -secret generation. - -Signed-off-by: Stephan Mueller ---- - include/uapi/linux/if_alg.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/include/uapi/linux/if_alg.h b/include/uapi/linux/if_alg.h -index 6f3340410..b3d296fba 100755 ---- a/include/uapi/linux/if_alg.h -+++ b/include/uapi/linux/if_alg.h -@@ -59,5 +59,7 @@ struct af_alg_iv { - #define ALG_OP_ENCRYPT 1 - #define ALG_OP_SIGN 2 - #define ALG_OP_VERIFY 3 -+#define ALG_OP_KEYGEN 4 -+#define ALG_OP_SSGEN 5 - - #endif /* _LINUX_IF_ALG_H */ --- -2.17.1 - - diff --git a/SPECS/91/linux/acvp_patches/0005-crypto-AF_ALG-add-DH-param-ECDH-curve-setsockopt.patch b/SPECS/91/linux/acvp_patches/0005-crypto-AF_ALG-add-DH-param-ECDH-curve-setsockopt.patch deleted file mode 100644 index 83d147053e..0000000000 --- a/SPECS/91/linux/acvp_patches/0005-crypto-AF_ALG-add-DH-param-ECDH-curve-setsockopt.patch +++ /dev/null @@ -1,74 +0,0 @@ -From e03916c6171575028537f09ab6d938189baf6308 Mon Sep 17 00:00:00 2001 -From: Vikash Bansal -Date: Mon, 25 Jan 2021 11:06:25 +0530 -Subject: [PATCH 5/7] crypto: AF_ALG -- add DH param / ECDH curve setsockopt - call - -For supporting DH ciphers, user space must be able to set the -DH parameters. The patch adds a new setsockopt call for setting -these parameters. - -Similarly, the ECDH curve information can be set by user space via the -newly added setsockopt call. - -Signed-off-by: Stephan Mueller -Signed-off-by: Vikash Bansal -Signed-off-by: Shivani Agarwal ---- - crypto/af_alg.c | 12 ++++++++++++ - include/crypto/if_alg.h | 2 ++ - include/uapi/linux/if_alg.h | 2 ++ - 3 files changed, 16 insertions(+) - -diff --git a/crypto/af_alg.c b/crypto/af_alg.c -index 4e15a0ab9..6ea2e3a48 100644 ---- a/crypto/af_alg.c -+++ b/crypto/af_alg.c -@@ -393,6 +393,18 @@ static int alg_setsockopt(struct socket *sock, int level, int optname, - - err = alg_setkey(sk, optval, optlen, type->setpubkey); - break; -+ case ALG_SET_DH_PARAMETERS: -+ if (sock->state == SS_CONNECTED) -+ goto unlock; -+ -+ err = alg_setkey(sk, optval, optlen, type->dhparams); -+ break; -+ case ALG_SET_ECDH_CURVE: -+ if (sock->state == SS_CONNECTED) -+ goto unlock; -+ -+ err = alg_setkey(sk, optval, optlen, type->ecdhcurve); -+ break; - case ALG_SET_AEAD_AUTHSIZE: - if (sock->state == SS_CONNECTED) - goto unlock; -diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h -index 15abd95f3..0a8f4c34a 100644 ---- a/include/crypto/if_alg.h -+++ b/include/crypto/if_alg.h -@@ -46,6 +46,8 @@ struct af_alg_type { - void (*release)(void *private); - int (*setkey)(void *private, const u8 *key, unsigned int keylen); - int (*setpubkey)(void *private, const u8 *key, unsigned int keylen); -+ int (*dhparams)(void *private, const u8 *param, unsigned int paramlen); -+ int (*ecdhcurve)(void *private, const u8 *param, unsigned int paramlen); - int (*setentropy)(void *private, sockptr_t entropy, unsigned int len); - int (*accept)(void *private, struct sock *sk); - int (*accept_nokey)(void *private, struct sock *sk); -diff --git a/include/uapi/linux/if_alg.h b/include/uapi/linux/if_alg.h -index d979c3e7b..3dd202d87 100644 ---- a/include/uapi/linux/if_alg.h -+++ b/include/uapi/linux/if_alg.h -@@ -54,6 +54,8 @@ struct af_alg_iv { - #define ALG_SET_DRBG_ENTROPY 6 - #define ALG_SET_KEY_BY_KEY_SERIAL 7 - #define ALG_SET_PUBKEY 13 -+#define ALG_SET_DH_PARAMETERS 14 -+#define ALG_SET_ECDH_CURVE 15 - - /* Operations */ - #define ALG_OP_DECRYPT 0 --- -2.39.4 - diff --git a/SPECS/91/linux/acvp_patches/0006-crypto-AF_ALG-eliminate-code-duplication.patch b/SPECS/91/linux/acvp_patches/0006-crypto-AF_ALG-eliminate-code-duplication.patch deleted file mode 100644 index a2d9f66004..0000000000 --- a/SPECS/91/linux/acvp_patches/0006-crypto-AF_ALG-eliminate-code-duplication.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 5fac0b8dcb3770c25b27fb5454cfb01e00fdefc3 Mon Sep 17 00:00:00 2001 -From: Vikash Bansal -Date: Mon, 25 Jan 2021 11:08:19 +0530 -Subject: [PATCH 6/7] crypto: AF_ALG - eliminate code duplication - -The handling function for setsockopt contains duplicated code which is -cleaned up with this patch. This patch does not change the functionality. - -Signed-off-by: Stephan Mueller -Signed-off-by: Vikash Bansal -Signed-off-by: Shivani Agarwal ---- - crypto/af_alg.c | 19 +++---------------- - 1 file changed, 3 insertions(+), 16 deletions(-) - -diff --git a/crypto/af_alg.c b/crypto/af_alg.c -index 6ea2e3a48..9c7653dd3 100644 ---- a/crypto/af_alg.c -+++ b/crypto/af_alg.c -@@ -376,45 +376,32 @@ static int alg_setsockopt(struct socket *sock, int level, int optname, - if (level != SOL_ALG || !type) - goto unlock; - -+ if (sock->state == SS_CONNECTED) -+ goto unlock; -+ - switch (optname) { - case ALG_SET_KEY: - case ALG_SET_KEY_BY_KEY_SERIAL: -- if (sock->state == SS_CONNECTED) -- goto unlock; -- - if (optname == ALG_SET_KEY_BY_KEY_SERIAL) - err = alg_setkey_by_key_serial(ask, optval, optlen); - else - err = alg_setkey(sk, optval, optlen, type->setkey); - break; - case ALG_SET_PUBKEY: -- if (sock->state == SS_CONNECTED) -- goto unlock; -- - err = alg_setkey(sk, optval, optlen, type->setpubkey); - break; - case ALG_SET_DH_PARAMETERS: -- if (sock->state == SS_CONNECTED) -- goto unlock; -- - err = alg_setkey(sk, optval, optlen, type->dhparams); - break; - case ALG_SET_ECDH_CURVE: -- if (sock->state == SS_CONNECTED) -- goto unlock; -- - err = alg_setkey(sk, optval, optlen, type->ecdhcurve); - break; - case ALG_SET_AEAD_AUTHSIZE: -- if (sock->state == SS_CONNECTED) -- goto unlock; - if (!type->setauthsize) - goto unlock; - err = type->setauthsize(ask->private, optlen); - break; - case ALG_SET_DRBG_ENTROPY: -- if (sock->state == SS_CONNECTED) -- goto unlock; - if (!type->setentropy) - goto unlock; - --- -2.39.4 - diff --git a/SPECS/91/linux/acvp_patches/0007-crypto-AF_ALG-add-KPP-support.patch b/SPECS/91/linux/acvp_patches/0007-crypto-AF_ALG-add-KPP-support.patch deleted file mode 100644 index 9522a71701..0000000000 --- a/SPECS/91/linux/acvp_patches/0007-crypto-AF_ALG-add-KPP-support.patch +++ /dev/null @@ -1,705 +0,0 @@ -From a1fb1e580ae8dd8c70bfcd9a2bdd2a5a814d75be Mon Sep 17 00:00:00 2001 -From: Vikash Bansal -Date: Tue, 23 Mar 2021 13:19:28 +0530 -Subject: [PATCH] crypto: AF_ALG - add KPP support - -The patch externalizes the KPP kernel crypto API to user space. This -allows user space to make use of Diffie-Hellman and EC Diffie-Hellman -operations. - -The following operations are supported: - - * DH parameters formatted in PKCS#3 with ALG_SET_DH_PARAMETERS - setsockopt. The call returns the buffer length user space must - allocate for the shared secret / public key operation. - - * ECDH curve selection via ALG_SET_ECDH_CURVE setsockopt. The call - returns the buffer length user space must allocate for the shared - secret / public key operation. - - * The private key can be set with the ALG_SET_KEY setsockopt. It is - permissible to provide a NULL key. In this case, the kernel uses the - tries to generate a private key of appropriate size and sets the key - with the TFM. The idea is that the caller can obtain the public key - from the private key, exchange it with the peer, inject the peer's - public key into the kernel and derive the shared secret. This way, - the private key does not leave the kernel realm. The call returns the - buffer length user space must allocate for the shared secret / public - key operation. - - * The public key is obtained from the private key via the recvmsg - operation. For this operation, no data sent to the kernel via sendmsg - or sendpage is required. - - * The shared secret is obtained by providing the peer's public key via - sendmsg / sendpage and reading the shared secret via recvmsg. - -Added support for LKCM 5.0: - - * Removed the use of curve_id as it is no longer present in the ecdh structure - -Signed-off-by: Stephan Mueller -Signed-off-by: Vikash Bansal -Signed-off-by: Srish Srinivasan -[Add memset() to kpp_accept_parent_nokey() so that -the new "inflight" field is initialized to zero] -Signed-off-by: Shivani Agarwal ---- - crypto/Kconfig | 10 + - crypto/Makefile | 1 + - crypto/af_alg.c | 2 + - crypto/algif_kpp.c | 575 ++++++++++++++++++++++++++++++++++++++++ - include/crypto/if_alg.h | 2 + - 5 files changed, 590 insertions(+) - create mode 100644 crypto/algif_kpp.c - -diff --git a/crypto/Kconfig b/crypto/Kconfig -index 7da59dd68..c2bdd2b68 100644 ---- a/crypto/Kconfig -+++ b/crypto/Kconfig -@@ -1511,6 +1511,16 @@ config CRYPTO_USER_API_AKCIPHER - This option enables the user-space interface for asymmetric - key cipher algorithms. - -+config CRYPTO_USER_API_KPP -+ tristate "User-space interface for key protocol primitives algorithms" -+ depends on NET -+ select CRYPTO_KPP2 -+ select CRYPTO_USER_API -+ help -+ This option enables the user-spaces interface for key protocol -+ primitives algorithms. This covers Diffie-Hellman and EC -+ Diffie-Hellman. -+ - config CRYPTO_HASH_INFO - bool - -diff --git a/crypto/Makefile b/crypto/Makefile -index be16d3992..512cf3cee 100644 ---- a/crypto/Makefile -+++ b/crypto/Makefile -@@ -193,6 +193,7 @@ ecrdsa_generic-y += ecrdsa_params.asn1.o - ecrdsa_generic-y += ecrdsa_pub_key.asn1.o - obj-$(CONFIG_CRYPTO_ECRDSA) += ecrdsa_generic.o - obj-$(CONFIG_CRYPTO_USER_API_AKCIPHER) += algif_akcipher.o -+obj-$(CONFIG_CRYPTO_USER_API_KPP) += algif_kpp.o - - # - # generic algorithms and the async_tx api -diff --git a/crypto/af_alg.c b/crypto/af_alg.c -index 812e32f4b..f339d1da0 100644 ---- a/crypto/af_alg.c -+++ b/crypto/af_alg.c -@@ -966,6 +966,8 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size, - case ALG_OP_SIGN: - case ALG_OP_ENCRYPT: - case ALG_OP_DECRYPT: -+ case ALG_OP_KEYGEN: -+ case ALG_OP_SSGEN: - op = con.op; - break; - default: -diff --git a/crypto/algif_kpp.c b/crypto/algif_kpp.c -new file mode 100644 -index 000000000..d2f419400 ---- /dev/null -+++ b/crypto/algif_kpp.c -@@ -0,0 +1,575 @@ -+/* -+ * algif_kpp: User-space interface for key protocol primitives algorithms -+ * -+ * Copyright (C) 2018 - 2020, Stephan Mueller -+ * -+ * This file provides the user-space API for key protocol primitives. -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License as published by the Free -+ * Software Foundation; either version 2 of the License, or (at your option) -+ * any later version. -+ * -+ * The following concept of the memory management is used: -+ * -+ * The kernel maintains two SGLs, the TX SGL and the RX SGL. The TX SGL is -+ * filled by user space with the data submitted via sendpage/sendmsg. Filling -+ * up the TX SGL does not cause a crypto operation -- the data will only be -+ * tracked by the kernel. Upon receipt of one recvmsg call, the caller must -+ * provide a buffer which is tracked with the RX SGL. -+ * -+ * During the processing of the recvmsg operation, the cipher request is -+ * allocated and prepared. As part of the recvmsg operation, the processed -+ * TX buffers are extracted from the TX SGL into a separate SGL. -+ * -+ * After the completion of the crypto operation, the RX SGL and the cipher -+ * request is released. The extracted TX SGL parts are released together with -+ * the RX SGL release. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+struct kpp_tfm { -+ struct crypto_kpp *kpp; -+ bool has_key; -+ -+#define KPP_NO_PARAMS 0 -+#define KPP_DH_PARAMS 1 -+#define KPP_ECDH_PARAMS 2 -+ int has_params; /* Type of KPP mechanism */ -+}; -+ -+static int kpp_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) -+{ -+ return af_alg_sendmsg(sock, msg, size, 0); -+} -+ -+static inline int kpp_cipher_op(struct af_alg_ctx *ctx, -+ struct af_alg_async_req *areq) -+{ -+ switch (ctx->op) { -+ case ALG_OP_KEYGEN: -+ return crypto_kpp_generate_public_key(&areq->cra_u.kpp_req); -+ case ALG_OP_SSGEN: -+ return crypto_kpp_compute_shared_secret(&areq->cra_u.kpp_req); -+ default: -+ return -EOPNOTSUPP; -+ } -+} -+ -+static int _kpp_recvmsg(struct socket *sock, struct msghdr *msg, -+ size_t ignored, int flags) -+{ -+ struct sock *sk = sock->sk; -+ struct alg_sock *ask = alg_sk(sk); -+ struct sock *psk = ask->parent; -+ struct alg_sock *pask = alg_sk(psk); -+ struct af_alg_ctx *ctx = ask->private; -+ struct kpp_tfm *kpp = pask->private; -+ struct crypto_kpp *tfm = kpp->kpp; -+ struct af_alg_async_req *areq; -+ size_t len; -+ size_t used = 0; -+ int err; -+ int maxsize; -+ -+ if (!ctx->used) { -+ err = af_alg_wait_for_data(sk, flags, 0); -+ if (err) -+ return err; -+ } -+ -+ maxsize = crypto_kpp_maxsize(tfm); -+ if (maxsize < 0) -+ return maxsize; -+ -+ /* Allocate cipher request for current operation. */ -+ areq = af_alg_alloc_areq(sk, sizeof(struct af_alg_async_req) + -+ crypto_kpp_reqsize(tfm)); -+ if (IS_ERR(areq)) -+ return PTR_ERR(areq); -+ -+ /* convert iovecs of output buffers into RX SGL */ -+ err = af_alg_get_rsgl(sk, msg, flags, areq, maxsize, &len); -+ if (err) -+ goto free; -+ -+ /* ensure output buffer is sufficiently large */ -+ if (len < maxsize) { -+ err = -EMSGSIZE; -+ goto free; -+ } -+ -+ /* -+ * Create a per request TX SGL for this request which tracks the -+ * SG entries from the global TX SGL. -+ */ -+ if (ctx->op == ALG_OP_SSGEN) { -+ used = ctx->used; -+ -+ areq->tsgl_entries = af_alg_count_tsgl(sk, used); -+ if (!areq->tsgl_entries) -+ areq->tsgl_entries = 1; -+ areq->tsgl = sock_kmalloc( -+ sk, sizeof(*areq->tsgl) * areq->tsgl_entries, -+ GFP_KERNEL); -+ if (!areq->tsgl) { -+ err = -ENOMEM; -+ goto free; -+ } -+ sg_init_table(areq->tsgl, areq->tsgl_entries); -+ af_alg_pull_tsgl(sk, used, areq->tsgl); -+ } -+ -+ /* Initialize the crypto operation */ -+ kpp_request_set_input(&areq->cra_u.kpp_req, areq->tsgl, used); -+ kpp_request_set_output(&areq->cra_u.kpp_req, areq->first_rsgl.sgl.sgl, -+ len); -+ kpp_request_set_tfm(&areq->cra_u.kpp_req, tfm); -+ -+ if (msg->msg_iocb && !is_sync_kiocb(msg->msg_iocb)) { -+ /* AIO operation */ -+ sock_hold(sk); -+ areq->iocb = msg->msg_iocb; -+ -+ /* Remember output size that will be generated. */ -+ areq->outlen = len; -+ -+ kpp_request_set_callback(&areq->cra_u.kpp_req, -+ CRYPTO_TFM_REQ_MAY_SLEEP, -+ af_alg_async_cb, areq); -+ err = kpp_cipher_op(ctx, areq); -+ -+ /* AIO operation in progress */ -+ if (err == -EINPROGRESS || err == -EBUSY) -+ return -EIOCBQUEUED; -+ -+ sock_put(sk); -+ } else { -+ /* Synchronous operation */ -+ kpp_request_set_callback(&areq->cra_u.kpp_req, -+ CRYPTO_TFM_REQ_MAY_SLEEP | -+ CRYPTO_TFM_REQ_MAY_BACKLOG, -+ crypto_req_done, -+ &ctx->wait); -+ err = crypto_wait_req(kpp_cipher_op(ctx, areq), &ctx->wait); -+ } -+ -+free: -+ af_alg_free_resources(areq); -+ -+ return err ? err : len; -+} -+ -+static int kpp_recvmsg(struct socket *sock, struct msghdr *msg, -+ size_t ignored, int flags) -+{ -+ struct sock *sk = sock->sk; -+ struct alg_sock *ask = alg_sk(sk); -+ struct sock *psk = ask->parent; -+ struct alg_sock *pask = alg_sk(psk); -+ struct kpp_tfm *kpp = pask->private; -+ struct crypto_kpp *tfm = kpp->kpp; -+ int ret = 0; -+ int err; -+ -+ lock_sock(sk); -+ -+ while (msg_data_left(msg)) { -+ err = _kpp_recvmsg(sock, msg, ignored, flags); -+ -+ /* -+ * This error covers -EIOCBQUEUED which implies that we can -+ * only handle one AIO request. If the caller wants to have -+ * multiple AIO requests in parallel, he must make multiple -+ * separate AIO calls. -+ */ -+ if (err <= 0) { -+ if (err == -EIOCBQUEUED || err == -EBADMSG || !ret) -+ ret = err; -+ goto out; -+ } -+ -+ ret += err; -+ -+ /* -+ * The caller must provide crypto_kpp_maxsize per request. -+ * If he provides more, we conclude that multiple kpp -+ * operations are requested. -+ */ -+ iov_iter_advance(&msg->msg_iter, -+ crypto_kpp_maxsize(tfm) - err); -+ } -+ -+out: -+ -+ af_alg_wmem_wakeup(sk); -+ release_sock(sk); -+ return ret; -+} -+ -+static struct proto_ops algif_kpp_ops = { -+ .family = PF_ALG, -+ -+ .connect = sock_no_connect, -+ .socketpair = sock_no_socketpair, -+ .getname = sock_no_getname, -+ .ioctl = sock_no_ioctl, -+ .listen = sock_no_listen, -+ .shutdown = sock_no_shutdown, -+ .mmap = sock_no_mmap, -+ .bind = sock_no_bind, -+ .accept = sock_no_accept, -+ -+ .release = af_alg_release, -+ .sendmsg = kpp_sendmsg, -+ .sendpage = af_alg_sendpage, -+ .recvmsg = kpp_recvmsg, -+ .poll = af_alg_poll, -+}; -+ -+static int kpp_check_key(struct socket *sock) -+{ -+ struct sock *psk; -+ struct alg_sock *pask; -+ struct kpp_tfm *tfm; -+ struct sock *sk = sock->sk; -+ struct alg_sock *ask = alg_sk(sk); -+ int err = 0; -+ -+ lock_sock(sk); -+ if (!atomic_read(&ask->nokey_refcnt)) -+ goto unlock_child; -+ -+ psk = ask->parent; -+ pask = alg_sk(ask->parent); -+ tfm = pask->private; -+ -+ lock_sock_nested(psk, SINGLE_DEPTH_NESTING); -+ if (!tfm->has_key || (tfm->has_params == KPP_NO_PARAMS)) { -+ err = -ENOKEY; -+ goto unlock; -+ } -+ -+ atomic_dec(&pask->nokey_refcnt); -+ atomic_set(&ask->nokey_refcnt, 0); -+ -+ err = 0; -+ -+unlock: -+ release_sock(psk); -+unlock_child: -+ release_sock(sk); -+ -+ return err; -+} -+ -+static int kpp_sendmsg_nokey(struct socket *sock, struct msghdr *msg, -+ size_t size) -+{ -+ int err; -+ -+ err = kpp_check_key(sock); -+ if (err) -+ return err; -+ -+ return kpp_sendmsg(sock, msg, size); -+} -+ -+static ssize_t kpp_sendpage_nokey(struct socket *sock, struct page *page, -+ int offset, size_t size, int flags) -+{ -+ int err; -+ -+ err = kpp_check_key(sock); -+ if (err) -+ return err; -+ -+ return af_alg_sendpage(sock, page, offset, size, flags); -+} -+ -+static int kpp_recvmsg_nokey(struct socket *sock, struct msghdr *msg, -+ size_t ignored, int flags) -+{ -+ int err; -+ -+ err = kpp_check_key(sock); -+ if (err) -+ return err; -+ -+ return kpp_recvmsg(sock, msg, ignored, flags); -+} -+ -+static struct proto_ops algif_kpp_ops_nokey = { -+ .family = PF_ALG, -+ -+ .connect = sock_no_connect, -+ .socketpair = sock_no_socketpair, -+ .getname = sock_no_getname, -+ .ioctl = sock_no_ioctl, -+ .listen = sock_no_listen, -+ .shutdown = sock_no_shutdown, -+ .mmap = sock_no_mmap, -+ .bind = sock_no_bind, -+ .accept = sock_no_accept, -+ -+ .release = af_alg_release, -+ .sendmsg = kpp_sendmsg_nokey, -+ .sendpage = kpp_sendpage_nokey, -+ .recvmsg = kpp_recvmsg_nokey, -+ .poll = af_alg_poll, -+}; -+ -+static void *kpp_bind(const char *name, u32 type, u32 mask) -+{ -+ struct kpp_tfm *tfm; -+ struct crypto_kpp *kpp; -+ -+ tfm = kmalloc(sizeof(*tfm), GFP_KERNEL); -+ if (!tfm) -+ return ERR_PTR(-ENOMEM); -+ -+ kpp = crypto_alloc_kpp(name, type, mask); -+ if (IS_ERR(kpp)) { -+ kfree(tfm); -+ return ERR_CAST(kpp); -+ } -+ -+ tfm->kpp = kpp; -+ tfm->has_key = false; -+ tfm->has_params = KPP_NO_PARAMS; -+ -+ return tfm; -+} -+ -+static void kpp_release(void *private) -+{ -+ struct kpp_tfm *tfm = private; -+ struct crypto_kpp *kpp = tfm->kpp; -+ -+ crypto_free_kpp(kpp); -+ kfree(tfm); -+} -+ -+static int kpp_dh_set_secret(struct crypto_kpp *tfm, struct dh *params) -+{ -+ char *packed_key = NULL; -+ unsigned int packed_key_len; -+ int ret; -+ -+ packed_key_len = crypto_dh_key_len(params); -+ packed_key = kmalloc(packed_key_len, GFP_KERNEL); -+ if (!packed_key) -+ return -ENOMEM; -+ -+ ret = crypto_dh_encode_key(packed_key, packed_key_len, params); -+ if (ret) -+ goto out; -+ -+ ret = crypto_kpp_set_secret(tfm, packed_key, packed_key_len); -+ -+out: -+ kfree(packed_key); -+ return ret; -+} -+ -+static int kpp_dh_set_privkey(struct crypto_kpp *tfm, const u8 *key, -+ unsigned int keylen) -+{ -+ struct dh params = { -+ .key = key, -+ .key_size = keylen, -+ .p = NULL, -+ .p_size = 0, -+ .g = NULL, -+ .g_size = 0, -+ }; -+ -+ return kpp_dh_set_secret(tfm, ¶ms); -+} -+ -+static int kpp_ecdh_set_secret(struct crypto_kpp *tfm, struct ecdh *params) -+{ -+ char *packed_key = NULL; -+ unsigned int packed_key_len; -+ int ret; -+ -+ packed_key_len = crypto_ecdh_key_len(params); -+ packed_key = kmalloc(packed_key_len, GFP_KERNEL); -+ if (!packed_key) -+ return -ENOMEM; -+ -+ ret = crypto_ecdh_encode_key(packed_key, packed_key_len, params); -+ if (ret) -+ goto out; -+ -+ ret = crypto_kpp_set_secret(tfm, packed_key, packed_key_len); -+ -+out: -+ kfree(packed_key); -+ return ret; -+} -+ -+static int kpp_ecdh_set_privkey(struct crypto_kpp *tfm, const void *key, -+ unsigned int keylen) -+{ -+ struct ecdh params = { -+ .key = (u8*)key, -+ .key_size = keylen, -+ }; -+ -+ return kpp_ecdh_set_secret(tfm, ¶ms); -+} -+ -+static int kpp_setprivkey(void *private, const u8 *key, unsigned int keylen) -+{ -+ struct kpp_tfm *kpp = private; -+ struct crypto_kpp *tfm = kpp->kpp; -+ int err; -+ -+ if (kpp->has_params == KPP_NO_PARAMS) -+ return -ENOKEY; -+ -+ /* The DH code cannot generate private keys. ECDH can do that */ -+ if ((!key || !keylen) && (kpp->has_params == KPP_DH_PARAMS)) { -+ kpp->has_key = false; -+ return -EOPNOTSUPP; -+ } -+ -+ switch (kpp->has_params) { -+ case KPP_DH_PARAMS: -+ err = kpp_dh_set_privkey(tfm, key, keylen); -+ break; -+ case KPP_ECDH_PARAMS: -+ err = kpp_ecdh_set_privkey(tfm, key, keylen); -+ break; -+ default: -+ err = -EFAULT; -+ } -+ -+ kpp->has_key = !err; -+ -+ /* Return the maximum size of the kpp operation. */ -+ if (!err) -+ err = crypto_kpp_maxsize(tfm); -+ -+ return err; -+} -+ -+static int kpp_ecdh_setcurve(void *private, const u8 *curveid, -+ unsigned int curveidlen) -+{ -+ struct kpp_tfm *kpp = private; -+ struct crypto_kpp *tfm = kpp->kpp; -+ int err; -+ struct ecdh params = { -+ .key = NULL, -+ .key_size = 0, -+ }; -+ -+ /* If parameters were already set, disallow setting them again. */ -+ if (kpp->has_params != KPP_NO_PARAMS) -+ return -EINVAL; -+ -+ if (curveidlen != sizeof(unsigned long)) -+ return -EINVAL; -+ -+ err = kpp_ecdh_set_secret(tfm, ¶ms); -+ if (!err) { -+ kpp->has_params = KPP_ECDH_PARAMS; -+ /* Return the maximum size of the kpp operation. */ -+ err = crypto_kpp_maxsize(tfm); -+ } else -+ kpp->has_params = KPP_NO_PARAMS; -+ -+ return err; -+} -+ -+static void kpp_sock_destruct(struct sock *sk) -+{ -+ struct alg_sock *ask = alg_sk(sk); -+ struct af_alg_ctx *ctx = ask->private; -+ -+ af_alg_pull_tsgl(sk, ctx->used, NULL); -+ sock_kfree_s(sk, ctx, ctx->len); -+ af_alg_release_parent(sk); -+} -+ -+static int kpp_accept_parent_nokey(void *private, struct sock *sk) -+{ -+ struct af_alg_ctx *ctx; -+ struct alg_sock *ask = alg_sk(sk); -+ unsigned int len = sizeof(*ctx); -+ -+ ctx = sock_kmalloc(sk, len, GFP_KERNEL); -+ if (!ctx) -+ return -ENOMEM; -+ -+ memset(ctx, 0, len); -+ -+ INIT_LIST_HEAD(&ctx->tsgl_list); -+ ctx->len = len; -+ crypto_init_wait(&ctx->wait); -+ -+ ask->private = ctx; -+ -+ sk->sk_destruct = kpp_sock_destruct; -+ -+ return 0; -+} -+ -+static int kpp_accept_parent(void *private, struct sock *sk) -+{ -+ struct kpp_tfm *tfm = private; -+ -+ if (!tfm->has_key || (tfm->has_params == KPP_NO_PARAMS)) -+ return -ENOKEY; -+ -+ return kpp_accept_parent_nokey(private, sk); -+} -+ -+static const struct af_alg_type algif_type_kpp = { -+ .bind = kpp_bind, -+ .release = kpp_release, -+ .setkey = kpp_setprivkey, -+ .setpubkey = NULL, -+ .dhparams = NULL, -+ .ecdhcurve = kpp_ecdh_setcurve, -+ .setauthsize = NULL, -+ .accept = kpp_accept_parent, -+ .accept_nokey = kpp_accept_parent_nokey, -+ .ops = &algif_kpp_ops, -+ .ops_nokey = &algif_kpp_ops_nokey, -+ .name = "kpp", -+ .owner = THIS_MODULE -+}; -+ -+static int __init algif_kpp_init(void) -+{ -+ return af_alg_register_type(&algif_type_kpp); -+} -+ -+static void __exit algif_kpp_exit(void) -+{ -+ int err = af_alg_unregister_type(&algif_type_kpp); -+ -+ BUG_ON(err); -+} -+ -+module_init(algif_kpp_init); -+module_exit(algif_kpp_exit); -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Stephan Mueller "); -+MODULE_DESCRIPTION("Key protocol primitives kernel crypto API user space interface"); -diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h -index a330bc18e..f4b219472 100644 ---- a/include/crypto/if_alg.h -+++ b/include/crypto/if_alg.h -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - - #define ALG_MAX_PAGES 16 - -@@ -117,6 +118,7 @@ struct af_alg_async_req { - struct aead_request aead_req; - struct skcipher_request skcipher_req; - struct akcipher_request akcipher_req; -+ struct kpp_request kpp_req; - } cra_u; - - /* req ctx trails this struct */ --- -2.40.4 - diff --git a/SPECS/91/linux/acvp_patches/0008-crypto-AF_ALG-add-ECC-support.patch b/SPECS/91/linux/acvp_patches/0008-crypto-AF_ALG-add-ECC-support.patch deleted file mode 100644 index 2bf90c0220..0000000000 --- a/SPECS/91/linux/acvp_patches/0008-crypto-AF_ALG-add-ECC-support.patch +++ /dev/null @@ -1,366 +0,0 @@ -From ea71c92640a871da306d555b588f42c8e5a90743 Mon Sep 17 00:00:00 2001 -From: srinidhira0 -Date: Tue, 8 Feb 2022 11:10:27 +0000 -Subject: [PATCH] crypto: AF_ALG - add ECC support - -The patch externalizes the ECC crypto API to user space. ECC domain does not -require cipher handler (such as ECDH for KPP) as ECC routines can be called -directly and there is no ECC cipher algo. - -The following operations are supported: - - * Key generation. Return values are private key, public key in form of X and - Y coordinates. - * Key verification. It takes X and Y coordinates of a public key as an input - and performs validation. - -Since we need only 2 operations from ECC: to verify key and to generate -key, simply sendmsg/recvmsg API for this domain will be sufficient. - -Enabling CONFIG_CRYPTO_USER_API_ECC is not recommended for production, but -it will not harm if enabled, as it does not expose used by kernel keys to -user space. - -Added support for LKCM 5.0: - - * In LKCM 4.0 (kernel v5.10.x), nist_p256 was the only fips supported curve. - * In kernel v6.12.x, there are three fips supported curves - nist_p256, nist_p384 and nist_p521 - * Tweaked ecc_sendmsg and ecc_recvmsg to accomodate both these curves while performing - keyVer and keyGen respectively. - * Make allocation of cipher handle fail if a curve other than nist_p256 and nist_p384 - is sent from user-space. - -Signed-off-by: Alexey Makhalov -Signed-off-by: srinidhira0 -Signed-off-by: Srish Srinivasan -Signed-off-by: Shivani Agarwal ---- - crypto/Kconfig | 8 ++ - crypto/Makefile | 1 + - crypto/algif_ecc.c | 283 +++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 292 insertions(+) - create mode 100644 crypto/algif_ecc.c - -diff --git a/crypto/Kconfig b/crypto/Kconfig -index 56bf05e9d..eee024d58 100644 ---- a/crypto/Kconfig -+++ b/crypto/Kconfig -@@ -1480,6 +1480,14 @@ config CRYPTO_USER_API_KPP - primitives algorithms. This covers Diffie-Hellman and EC - Diffie-Hellman. - -+config CRYPTO_USER_API_ECC -+ tristate "User-space interface for ECC primitives algorithms" -+ depends on NET -+ select CRYPTO_USER_API -+ help -+ This option enables the user-spaces interface for ECC -+ primitives algorithms that are used in EC Diffie-Hellman. -+ - config CRYPTO_HASH_INFO - bool - -diff --git a/crypto/Makefile b/crypto/Makefile -index 54e34b93e..a0c21728a 100644 ---- a/crypto/Makefile -+++ b/crypto/Makefile -@@ -173,6 +173,7 @@ ecrdsa_generic-y += ecrdsa_pub_key.asn1.o - obj-$(CONFIG_CRYPTO_ECRDSA) += ecrdsa_generic.o - obj-$(CONFIG_CRYPTO_USER_API_AKCIPHER) += algif_akcipher.o - obj-$(CONFIG_CRYPTO_USER_API_KPP) += algif_kpp.o -+obj-$(CONFIG_CRYPTO_USER_API_ECC) += algif_ecc.o - - # - # generic algorithms and the async_tx api -diff --git a/crypto/algif_ecc.c b/crypto/algif_ecc.c -new file mode 100644 -index 000000000..29cc52a19 ---- /dev/null -+++ b/crypto/algif_ecc.c -@@ -0,0 +1,283 @@ -+/* -+ * algif_ecc: User-space interface for ECC routines -+ * -+ * Copyright (C) 2022, VMware Inc. -+ * Author: Alexey Makhalov -+ * -+ * This file provides the user-space API for ECC routins for keyGen and keyVer -+ * ACVP testing. -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License as published by the Free -+ * Software Foundation; either version 2 of the License, or (at your option) -+ * any later version. -+ * -+ * The following concept of the memory management is used: -+ * -+ * The kernel maintains two SGLs, the TX SGL and the RX SGL. The TX SGL is -+ * filled by user space with the data submitted via sendpage/sendmsg. Filling -+ * up the TX SGL does not cause a crypto operation -- the data will only be -+ * tracked by the kernel. Upon receipt of one recvmsg call, the caller must -+ * provide a buffer which is tracked with the RX SGL. -+ * -+ * During the processing of the recvmsg operation, the cipher request is -+ * allocated and prepared. As part of the recvmsg operation, the processed -+ * TX buffers are extracted from the TX SGL into a separate SGL. -+ * -+ * After the completion of the crypto operation, the RX SGL and the cipher -+ * request is released. The extracted TX SGL parts are released together with -+ * the RX SGL release. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "ecc_curve_defs.h" -+ -+/* -+ * Sendmsg to ecc socket is used only to verify public key curve point. -+ * There are 2 input iov segments, one for x coordinate and another for y. -+ * On success, it returns number of bytes that were verified. -+ * Negative return value means failure. -EINVAL value get returned if -+ * key verification failed. -+ */ -+ -+static int ecc_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) -+{ -+ const struct iovec *iov; -+ int ret; -+ /* FIPS supported curves: nist_p256, nist_p384 and nist_p521 */ -+ const struct ecc_curve *curve = NULL; -+ u8 x_buf[48] = {0}, y_buf[48] = {0}; -+ int curve_id = 0; -+ -+ if (!iter_is_iovec(&msg->msg_iter)) -+ return -ENOTSUPP; -+ -+ if(msg->msg_iter.nr_segs == 3) { -+ -+ iov = msg->msg_iter.__iov; -+ struct ecc_point pk; -+ -+ if(iov[2].iov_len == 256) { -+ curve = &nist_p256; -+ curve_id = 2; -+ } else if(iov[2].iov_len == 384) { -+ curve = &nist_p384; -+ curve_id = 3; -+ } else if(iov[2].iov_len == 192) { -+ curve = &nist_p192; -+ curve_id = 1; -+ } else if(iov[2].iov_len == 521) { -+ curve = &nist_p521; -+ curve_id = 4; -+ } else -+ return -EINVAL; -+ -+ if (iov[0].iov_len != curve->g.ndigits * sizeof(u64) || -+ iov[1].iov_len != curve->g.ndigits * sizeof(u64)) -+ return -EINVAL; -+ -+ ret = copy_from_user(x_buf, iov[0].iov_base, iov[0].iov_len); -+ if (ret) { -+ pr_err("\n Error in copying X from iov_base %p %d\n", -+ iov[0].iov_base, ret); -+ return -ENOMEM; -+ } -+ ret = copy_from_user(y_buf, iov[1].iov_base, iov[1].iov_len); -+ if (ret) { -+ pr_err("\n Error in copying Y from iov_base %p %d\n", -+ iov[1].iov_base, ret); -+ return -ENOMEM; -+ } -+ -+ pk.ndigits = curve->g.ndigits; -+ pk.x = kmalloc(pk.ndigits * sizeof(u64), GFP_KERNEL); -+ if (!pk.x) -+ return -ENOMEM; -+ -+ pk.y = kmalloc(pk.ndigits * sizeof(u64), GFP_KERNEL); -+ if (!pk.y) { -+ kfree(pk.x); -+ return -ENOMEM; -+ } -+ -+ ecc_swap_digits((u64 *)x_buf, pk.x, pk.ndigits); -+ ecc_swap_digits((u64 *)y_buf, pk.y, pk.ndigits); -+ -+ ret = ecc_is_pubkey_valid_full(curve, &pk); -+ -+ -+ kfree(pk.x); -+ kfree(pk.y); -+ return ret; -+ } -+ else -+ return -EINVAL; -+} -+ -+/* -+ * Recvmsg from ecc socket is used only to generate private/public key pair -+ * There are 3 output iov segments, one for private key and other two for x -+ * and y coordinates of the public key. Concatenation of bytes from these -+ * coordinates gives a public key. -+ * On success, it returns number of bytes that were provided. -+ * Negative return value means failure. -+ */ -+static int ecc_recvmsg(struct socket *sock, struct msghdr *msg, -+ size_t ignored, int flags) -+{ -+ const struct iovec *iov; -+ u64 pubkey[12]; -+ int ret; -+ /* FIPS supported curves: nist_p256, nist_p384 and nist_p521 */ -+ struct ecc_curve *curve = NULL; -+ u8 d_buf[48] = {0}; -+ int curve_id = 0; -+ -+ if (!iter_is_iovec(&msg->msg_iter)) -+ return -ENOTSUPP; -+ -+ if (msg->msg_iter.nr_segs != 4) -+ return -EINVAL; -+ -+ iov = msg->msg_iter.__iov; -+ -+ if(iov[3].iov_len == 256) { -+ curve = &nist_p256; -+ curve_id = 2; -+ } else if(iov[3].iov_len == 384) { -+ curve = &nist_p384; -+ curve_id = 3; -+ } else if(iov[3].iov_len == 192) { -+ curve = &nist_p192; -+ curve_id = 1; -+ } else if(iov[3].iov_len == 521) { -+ curve = &nist_p521; -+ curve_id = 4; -+ } else -+ return -EINVAL; -+ -+ if (iov[0].iov_len != curve->g.ndigits * sizeof(u64) || -+ iov[1].iov_len != curve->g.ndigits * sizeof(u64) || -+ iov[2].iov_len != curve->g.ndigits * sizeof(u64)) -+ return -EINVAL; -+ -+ ret = ecc_gen_privkey(curve_id, curve->g.ndigits, (u64 *)d_buf); -+ if (ret < 0) -+ return ret; -+ -+ ret = ecc_make_pub_key(curve_id, curve->g.ndigits, (u64 *)d_buf, pubkey); -+ if (ret < 0) -+ return ret; -+ -+ ret = copy_to_user(iov[0].iov_base, d_buf, iov[0].iov_len); -+ if (ret) { -+ pr_err("\n Error in copying from iov_base %p %d\n", -+ iov[0].iov_base, ret); -+ return -ENOMEM; -+ } -+ ret = copy_to_user(iov[1].iov_base, pubkey, -+ curve->g.ndigits * sizeof(u64)); -+ if (ret) { -+ pr_err("\n Err in copying to user %d\n", ret); -+ return -ENOMEM; -+ } -+ ret = copy_to_user(iov[2].iov_base, &pubkey[curve->g.ndigits], -+ curve->g.ndigits * sizeof(u64)); -+ if (ret) { -+ pr_err("\n Err in copying to user %d\n", ret); -+ return -ENOMEM; -+ } -+ -+ return msg->msg_iter.count; -+} -+ -+static struct proto_ops algif_ecc_ops = { -+ .family = PF_ALG, -+ -+ .connect = sock_no_connect, -+ .socketpair = sock_no_socketpair, -+ .getname = sock_no_getname, -+ .ioctl = sock_no_ioctl, -+ .listen = sock_no_listen, -+ .shutdown = sock_no_shutdown, -+ .mmap = sock_no_mmap, -+ .bind = sock_no_bind, -+ .accept = sock_no_accept, -+ -+ .release = af_alg_release, -+ .sendmsg = ecc_sendmsg, -+ .sendpage = af_alg_sendpage, -+ .recvmsg = ecc_recvmsg, -+ .poll = af_alg_poll, -+}; -+ -+static void *ecc_bind(const char *name, u32 type, u32 mask) -+{ -+ if(!strncmp(name, "ecdh-nist-p192", 14) || -+ !strncmp(name, "ecdh-nist-p256", 14) || -+ !strncmp(name, "ecdh-nist-p384", 14) || -+ !strncmp(name, "ecdh-nist-p521", 14) || -+ !strncmp(name, "ecdsa-nist-p192", 15) || -+ !strncmp(name, "ecdsa-nist-p256", 15) || -+ !strncmp(name, "ecdsa-nist-p384", 15) || -+ !strncmp(name, "ecdsa-nist-p521", 15)) { -+ return 0; -+ } -+ return ERR_PTR(-EINVAL); -+} -+ -+static void ecc_release(void *private) -+{ -+} -+ -+static void ecc_sock_destruct(struct sock *sk) -+{ -+} -+ -+static int ecc_accept_parent(void *private, struct sock *sk) -+{ -+ sk->sk_destruct = ecc_sock_destruct; -+ return 0; -+} -+ -+static const struct af_alg_type algif_type_ecc = { -+ .bind = ecc_bind, -+ .release = ecc_release, -+ .setkey = NULL, -+ .setpubkey = NULL, -+ .dhparams = NULL, -+ .ecdhcurve = NULL, -+ .setauthsize = NULL, -+ .accept = ecc_accept_parent, -+ .accept_nokey = NULL, -+ .ops = &algif_ecc_ops, -+ .ops_nokey = NULL, -+ .name = "ecc", -+ .owner = THIS_MODULE -+}; -+ -+static int __init algif_ecc_init(void) -+{ -+ return af_alg_register_type(&algif_type_ecc); -+} -+ -+static void __exit algif_ecc_exit(void) -+{ -+ int err = af_alg_unregister_type(&algif_type_ecc); -+ -+ BUG_ON(err); -+} -+ -+module_init(algif_ecc_init); -+module_exit(algif_ecc_exit); -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Alexey Makhalov "); -+MODULE_DESCRIPTION("ECC primitives kernel crypto API user space interface"); --- -2.39.4 - diff --git a/SPECS/91/linux/acvp_patches/0009-DRBG-Fix-issues-with-DRBG.patch b/SPECS/91/linux/acvp_patches/0009-DRBG-Fix-issues-with-DRBG.patch deleted file mode 100644 index f5fa8923a0..0000000000 --- a/SPECS/91/linux/acvp_patches/0009-DRBG-Fix-issues-with-DRBG.patch +++ /dev/null @@ -1,58 +0,0 @@ -From a3503190e5f761ec5313685a74318e0dc7c5cbf0 Mon Sep 17 00:00:00 2001 -From: Vikash Bansal -Date: Thu, 28 Jan 2021 08:13:00 +0530 -Subject: [PATCH] drbg: Fixed issue - -Fixed issue with MaxSize and Setting Entropy ---- - crypto/af_alg.c | 7 +++++-- - crypto/algif_rng.c | 5 ++++- - 2 files changed, 9 insertions(+), 3 deletions(-) - -diff --git a/crypto/af_alg.c b/crypto/af_alg.c -index e6ef93a28..6475030d6 100644 ---- a/crypto/af_alg.c -+++ b/crypto/af_alg.c -@@ -238,8 +238,11 @@ static int alg_setsockopt(struct socket *sock, int level, int optname, - int err = -EBUSY; - - lock_sock(sk); -- if (atomic_read(&ask->refcnt) != atomic_read(&ask->nokey_refcnt)) -- goto unlock; -+ -+ if(strcmp(ask->type->name, "rng")) { -+ if (atomic_read(&ask->refcnt) != atomic_read(&ask->nokey_refcnt)) -+ goto unlock; -+ } - - type = ask->type; - -diff --git a/crypto/algif_rng.c b/crypto/algif_rng.c -index 407408c43..1a84f23fe 100644 ---- a/crypto/algif_rng.c -+++ b/crypto/algif_rng.c -@@ -51,7 +51,7 @@ MODULE_AUTHOR("Stephan Mueller "); - MODULE_DESCRIPTION("User-space interface for random number generators"); - - struct rng_ctx { --#define MAXSIZE 128 -+#define MAXSIZE 256 - unsigned int len; - struct crypto_rng *drng; - u8 *addtl; -@@ -293,8 +293,11 @@ static int __maybe_unused rng_setentropy(void *private, sockptr_t entropy, - if (!capable(CAP_SYS_ADMIN)) - return -EACCES; - -+#if 0 -+#Entropy can be set multiple times if pr=true - if (pctx->entropy) - return -EINVAL; -+#endif - - if (len > MAXSIZE) - return -EMSGSIZE; --- -2.17.1 - - diff --git a/SPECS/91/linux/acvp_patches/0011-sock-Remove-sendpage-in-favour-of-sendmsg-MSG_SPLICE.patch b/SPECS/91/linux/acvp_patches/0011-sock-Remove-sendpage-in-favour-of-sendmsg-MSG_SPLICE.patch deleted file mode 100644 index 9112ce21b1..0000000000 --- a/SPECS/91/linux/acvp_patches/0011-sock-Remove-sendpage-in-favour-of-sendmsg-MSG_SPLICE.patch +++ /dev/null @@ -1,136 +0,0 @@ -From 06e5acb5d0880fa2b4026f709a9c41990d3a392c Mon Sep 17 00:00:00 2001 -From: Shivani Agarwal -Date: Wed, 18 Dec 2024 13:26:58 +0000 -Subject: [PATCH] sock: Remove ->sendpage*() in favour of - sendmsg(MSG_SPLICE_PAGES) - -sendpage*() API support is removed from upstream as part of commit -https://github.com/gregkh/linux/commit/dc97391e661009eab46783030d2404c9b6e6f2e7 - -Signed-off-by: Shivani Agarwal ---- - crypto/algif_akcipher.c | 16 +--------------- - crypto/algif_ecc.c | 3 +-- - crypto/algif_kpp.c | 16 +--------------- - 3 files changed, 3 insertions(+), 32 deletions(-) - -diff --git a/crypto/algif_akcipher.c b/crypto/algif_akcipher.c -index 8ed305ecc..a838d265c 100644 ---- a/crypto/algif_akcipher.c -+++ b/crypto/algif_akcipher.c -@@ -13,7 +13,7 @@ - * The following concept of the memory management is used: - * - * The kernel maintains two SGLs, the TX SGL and the RX SGL. The TX SGL is -- * filled by user space with the data submitted via sendpage/sendmsg. Filling -+ * filled by user space with the data submitted via sendmsg. Filling - * up the TX SGL does not cause a crypto operation -- the data will only be - * tracked by the kernel. Upon receipt of one recvmsg call, the caller must - * provide a buffer which is tracked with the RX SGL. -@@ -232,7 +232,6 @@ static struct proto_ops algif_akcipher_ops = { - - .release = af_alg_release, - .sendmsg = akcipher_sendmsg, -- .sendpage = af_alg_sendpage, - .recvmsg = akcipher_recvmsg, - .poll = af_alg_poll, - }; -@@ -284,18 +283,6 @@ static int akcipher_sendmsg_nokey(struct socket *sock, struct msghdr *msg, - return akcipher_sendmsg(sock, msg, size); - } - --static ssize_t akcipher_sendpage_nokey(struct socket *sock, struct page *page, -- int offset, size_t size, int flags) --{ -- int err; -- -- err = akcipher_check_key(sock); -- if (err) -- return err; -- -- return af_alg_sendpage(sock, page, offset, size, flags); --} -- - static int akcipher_recvmsg_nokey(struct socket *sock, struct msghdr *msg, - size_t ignored, int flags) - { -@@ -325,7 +312,6 @@ static struct proto_ops algif_akcipher_ops_nokey = { - - .release = af_alg_release, - .sendmsg = akcipher_sendmsg_nokey, -- .sendpage = akcipher_sendpage_nokey, - .recvmsg = akcipher_recvmsg_nokey, - .poll = af_alg_poll, - }; -diff --git a/crypto/algif_ecc.c b/crypto/algif_ecc.c -index 6cd495584..ef85503c7 100644 ---- a/crypto/algif_ecc.c -+++ b/crypto/algif_ecc.c -@@ -15,7 +15,7 @@ - * The following concept of the memory management is used: - * - * The kernel maintains two SGLs, the TX SGL and the RX SGL. The TX SGL is -- * filled by user space with the data submitted via sendpage/sendmsg. Filling -+ * filled by user space with the data submitted via sendmsg. Filling - * up the TX SGL does not cause a crypto operation -- the data will only be - * tracked by the kernel. Upon receipt of one recvmsg call, the caller must - * provide a buffer which is tracked with the RX SGL. -@@ -241,7 +241,6 @@ static struct proto_ops algif_ecc_ops = { - - .release = af_alg_release, - .sendmsg = ecc_sendmsg, -- .sendpage = af_alg_sendpage, - .recvmsg = ecc_recvmsg, - .poll = af_alg_poll, - }; -diff --git a/crypto/algif_kpp.c b/crypto/algif_kpp.c -index 581eb232d..b4b1cd841 100644 ---- a/crypto/algif_kpp.c -+++ b/crypto/algif_kpp.c -@@ -13,7 +13,7 @@ - * The following concept of the memory management is used: - * - * The kernel maintains two SGLs, the TX SGL and the RX SGL. The TX SGL is -- * filled by user space with the data submitted via sendpage/sendmsg. Filling -+ * filled by user space with the data submitted via sendmsg. Filling - * up the TX SGL does not cause a crypto operation -- the data will only be - * tracked by the kernel. Upon receipt of one recvmsg call, the caller must - * provide a buffer which is tracked with the RX SGL. -@@ -237,7 +237,6 @@ static struct proto_ops algif_kpp_ops = { - - .release = af_alg_release, - .sendmsg = kpp_sendmsg, -- .sendpage = af_alg_sendpage, - .recvmsg = kpp_recvmsg, - .poll = af_alg_poll, - }; -@@ -290,18 +289,6 @@ static int kpp_sendmsg_nokey(struct socket *sock, struct msghdr *msg, - return kpp_sendmsg(sock, msg, size); - } - --static ssize_t kpp_sendpage_nokey(struct socket *sock, struct page *page, -- int offset, size_t size, int flags) --{ -- int err; -- -- err = kpp_check_key(sock); -- if (err) -- return err; -- -- return af_alg_sendpage(sock, page, offset, size, flags); --} -- - static int kpp_recvmsg_nokey(struct socket *sock, struct msghdr *msg, - size_t ignored, int flags) - { -@@ -331,7 +318,6 @@ static struct proto_ops algif_kpp_ops_nokey = { - - .release = af_alg_release, - .sendmsg = kpp_sendmsg_nokey, -- .sendpage = kpp_sendpage_nokey, - .recvmsg = kpp_recvmsg_nokey, - .poll = af_alg_poll, - }; --- -2.39.4 - diff --git a/SPECS/91/linux/acvp_patches/0015-crypto-api-return-status-prints-for-LKCM6-demo.patch b/SPECS/91/linux/acvp_patches/0015-crypto-api-return-status-prints-for-LKCM6-demo.patch deleted file mode 100644 index 451a510f07..0000000000 --- a/SPECS/91/linux/acvp_patches/0015-crypto-api-return-status-prints-for-LKCM6-demo.patch +++ /dev/null @@ -1,432 +0,0 @@ -From db413eb0bf18b72bd934f91ce6445a13f2b9acb0 Mon Sep 17 00:00:00 2001 -From: Brennan Lamoreaux -Date: Tue, 15 Jul 2025 18:22:24 +0000 -Subject: [PATCH] crypto api return status prints for LKCM6 demo - -- these prints appear only when both ACVP_BUILD and KAT_BUILD - are enabled during build - -Signed-off-by: Srish Srinivasan -Signed-off-by: Shivani Agarwal -Signed-off-by: Brennan Lamoreaux ---- - crypto/aead.c | 41 ++++++++++++++++++++++++++++++++++++----- - crypto/ahash.c | 10 +++++++++- - crypto/akcipher.c | 10 ++++++++-- - crypto/algif_ecc.c | 39 +++++++++++++++++++++++++++++++++++---- - crypto/cipher.c | 7 ++++++- - crypto/kpp.c | 10 ++++++++-- - crypto/rng.c | 6 ++++++ - crypto/shash.c | 27 ++++++++++++++++++++++++--- - crypto/skcipher.c | 37 +++++++++++++++++++++++++++++++++---- - 9 files changed, 165 insertions(+), 22 deletions(-) - -diff --git a/crypto/aead.c b/crypto/aead.c -index cade53241..3d497df6a 100644 ---- a/crypto/aead.c -+++ b/crypto/aead.c -@@ -51,6 +51,11 @@ int crypto_aead_setkey(struct crypto_aead *tfm, - else - err = crypto_aead_alg(tfm)->setkey(tfm, key, keylen); - -+ if(err < 0) -+ pr_debug("%ps FAILED, returned %d", crypto_aead_alg(tfm)->setkey, err); -+ else -+ pr_debug("%ps PASSED, returned %d", crypto_aead_alg(tfm)->setkey, err); -+ - if (unlikely(err)) { - crypto_aead_set_flags(tfm, CRYPTO_TFM_NEED_KEY); - return err; -@@ -71,9 +76,12 @@ int crypto_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize) - - if (crypto_aead_alg(tfm)->setauthsize) { - err = crypto_aead_alg(tfm)->setauthsize(tfm, authsize); -- if (err) -+ if (err) { -+ pr_debug("%ps FAILED, returned %d", crypto_aead_alg(tfm)->setauthsize, err); - return err; -+ } - } -+ pr_debug("%ps PASSED, returned %d", crypto_aead_alg(tfm)->setauthsize, err); - - tfm->authsize = authsize; - return 0; -@@ -83,17 +91,26 @@ EXPORT_SYMBOL_GPL(crypto_aead_setauthsize); - int crypto_aead_encrypt(struct aead_request *req) - { - struct crypto_aead *aead = crypto_aead_reqtfm(req); -+ int ret; - - if (crypto_aead_get_flags(aead) & CRYPTO_TFM_NEED_KEY) - return -ENOKEY; - -- return crypto_aead_alg(aead)->encrypt(req); -+ ret = crypto_aead_alg(aead)->encrypt(req); -+ -+ if(ret < 0) -+ pr_debug("%ps FAILED, returned %d", crypto_aead_alg(aead)->encrypt, ret); -+ else -+ pr_debug("%ps PASSED, returned %d", crypto_aead_alg(aead)->encrypt, ret); -+ -+ return ret; - } - EXPORT_SYMBOL_GPL(crypto_aead_encrypt); - - int crypto_aead_decrypt(struct aead_request *req) - { - struct crypto_aead *aead = crypto_aead_reqtfm(req); -+ int ret; - - if (crypto_aead_get_flags(aead) & CRYPTO_TFM_NEED_KEY) - return -ENOKEY; -@@ -101,7 +118,14 @@ int crypto_aead_decrypt(struct aead_request *req) - if (req->cryptlen < crypto_aead_authsize(aead)) - return -EINVAL; - -- return crypto_aead_alg(aead)->decrypt(req); -+ ret = crypto_aead_alg(aead)->decrypt(req); -+ -+ if(ret < 0) -+ pr_debug("%ps FAILED, returned %d", crypto_aead_alg(aead)->decrypt, ret); -+ else -+ pr_debug("%ps PASSED, returned %d", crypto_aead_alg(aead)->decrypt, ret); -+ -+ return ret; - } - EXPORT_SYMBOL_GPL(crypto_aead_decrypt); - -@@ -125,8 +149,15 @@ static int crypto_aead_init_tfm(struct crypto_tfm *tfm) - if (alg->exit) - aead->base.exit = crypto_aead_exit_tfm; - -- if (alg->init) -- return alg->init(aead); -+ int err; -+ if (alg->init) { -+ err = alg->init(aead); -+ if(err) -+ pr_debug("%ps FAILED, returned %d", alg->init, err); -+ else -+ pr_debug("%ps PASSED, returned %d", alg->init, err); -+ return err; -+ } - - return 0; - } -diff --git a/crypto/ahash.c b/crypto/ahash.c -index fe19bf7f1..3ae7aa277 100644 ---- a/crypto/ahash.c -+++ b/crypto/ahash.c -@@ -328,11 +328,19 @@ static void ahash_restore_req(struct ahash_request *req, int err) - int crypto_ahash_update(struct ahash_request *req) - { - struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); -+ int ret; - - if (likely(tfm->using_shash)) - return shash_ahash_update(req, ahash_request_ctx(req)); - -- return crypto_ahash_alg(tfm)->update(req); -+ ret = crypto_ahash_alg(tfm)->update(req); -+ -+ if(ret) -+ pr_debug("%ps FAILED, returned %d", crypto_ahash_alg(tfm)->update, ret); -+ else -+ pr_debug("%ps PASSED, returned %d", crypto_ahash_alg(tfm)->update, ret); -+ -+ return ret; - } - EXPORT_SYMBOL_GPL(crypto_ahash_update); - -diff --git a/crypto/akcipher.c b/crypto/akcipher.c -index e0ff5f4dd..2299345ff 100644 ---- a/crypto/akcipher.c -+++ b/crypto/akcipher.c -@@ -57,8 +57,14 @@ static int crypto_akcipher_init_tfm(struct crypto_tfm *tfm) - if (alg->exit) - akcipher->base.exit = crypto_akcipher_exit_tfm; - -- if (alg->init) -- return alg->init(akcipher); -+ if (alg->init) { -+ int err = alg->init(akcipher); -+ if(err) -+ pr_debug("%ps FAILED, returned %d", alg->init, err); -+ else -+ pr_debug("%ps PASSED, returned %d", alg->init, err); -+ return err; -+ } - - return 0; - } -diff --git a/crypto/algif_ecc.c b/crypto/algif_ecc.c -index db059f37c..0d66ca68b 100644 ---- a/crypto/algif_ecc.c -+++ b/crypto/algif_ecc.c -@@ -112,6 +112,10 @@ static int ecc_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) - ecc_swap_digits((u64 *)y_buf, pk.y, pk.ndigits); - - ret = ecc_is_pubkey_valid_full(curve, &pk); -+ if(!ret) -+ pr_debug("ecc_is_pubkey_valid_full PASSED, returned %d", ret); -+ else -+ pr_debug("ecc_is_pubkey_valid_full FAILED, returned %d", ret); - - - kfree(pk.x); -@@ -161,8 +165,27 @@ static int ecc_recvmsg(struct socket *sock, struct msghdr *msg, - } else if(iov[3].iov_len == 521) { - curve = &nist_p521; - curve_id = 4; -- } else -- return -EINVAL; -+ } else { -+ int skip_gen_privkey = 0; -+ switch(iov[3].iov_len) { -+ case 1: break; -+ case 2: skip_gen_privkey = 1; -+ break; -+ default: return -EINVAL; -+ } -+ -+ if(!skip_gen_privkey) { -+ ret = ecc_gen_privkey(2, 0, (u64 *)d_buf); -+ if (ret < 0) -+ pr_debug("ecc_gen_privkey FAILED, returned %d", ret); -+ return ret; -+ } -+ -+ ret = ecc_make_pub_key(2, 0, (u64 *)d_buf, pubkey); -+ if (ret < 0) -+ pr_debug("ecc_make_pub_key FAILED, returned %d", ret); -+ return ret; -+ } - - if (iov[0].iov_len != curve->g.ndigits * sizeof(u64) || - iov[1].iov_len != curve->g.ndigits * sizeof(u64) || -@@ -170,12 +193,20 @@ static int ecc_recvmsg(struct socket *sock, struct msghdr *msg, - return -EINVAL; - - ret = ecc_gen_privkey(curve_id, curve->g.ndigits, (u64 *)d_buf); -- if (ret < 0) -+ if (ret < 0) { -+ pr_debug("ecc_gen_privkey FAILED, returned %d", ret); - return ret; -+ } -+ else -+ pr_debug("ecc_gen_privkey PASSED, returned %d", ret); - - ret = ecc_make_pub_key(curve_id, curve->g.ndigits, (u64 *)d_buf, pubkey); -- if (ret < 0) -+ if (ret < 0) { -+ pr_debug("ecc_make_pub_key FAILED, returned %d", ret); - return ret; -+ } -+ else -+ pr_debug("ecc_make_pub_key PASSED, returned %d", ret); - - ret = copy_to_user(iov[0].iov_base, d_buf, iov[0].iov_len); - if (ret) { -diff --git a/crypto/cipher.c b/crypto/cipher.c -index 40cae9087..708d0496f 100644 ---- a/crypto/cipher.c -+++ b/crypto/cipher.c -@@ -51,7 +51,12 @@ int crypto_cipher_setkey(struct crypto_cipher *tfm, - if ((unsigned long)key & alignmask) - return setkey_unaligned(tfm, key, keylen); - -- return cia->cia_setkey(crypto_cipher_tfm(tfm), key, keylen); -+ int err = cia->cia_setkey(crypto_cipher_tfm(tfm), key, keylen); -+ if(err) -+ pr_debug("%ps FAILED, returned %d", cia->cia_setkey, err); -+ else -+ pr_debug("%ps PASSED, returned %d", cia->cia_setkey, err); -+ return err; - } - EXPORT_SYMBOL_NS_GPL(crypto_cipher_setkey, CRYPTO_INTERNAL); - -diff --git a/crypto/kpp.c b/crypto/kpp.c -index ecc63a1a9..58c812903 100644 ---- a/crypto/kpp.c -+++ b/crypto/kpp.c -@@ -53,8 +53,14 @@ static int crypto_kpp_init_tfm(struct crypto_tfm *tfm) - if (alg->exit) - kpp->base.exit = crypto_kpp_exit_tfm; - -- if (alg->init) -- return alg->init(kpp); -+ if (alg->init) { -+ int err = alg->init(kpp); -+ if(err) -+ pr_debug("%ps FAILED, returned %d", alg->init, err); -+ else -+ pr_debug("%ps PASSED, returned %d", alg->init, err); -+ return err; -+ } - - return 0; - } -diff --git a/crypto/rng.c b/crypto/rng.c -index 9e327c8c0..139fbac98 100644 ---- a/crypto/rng.c -+++ b/crypto/rng.c -@@ -69,6 +69,12 @@ int crypto_rng_reset(struct crypto_rng *tfm, const u8 *seed, unsigned int slen) - } - - err = crypto_rng_alg(tfm)->seed(tfm, seed, slen); -+ -+ if(err) -+ pr_debug("%ps FAILED, returned %d", crypto_rng_alg(tfm)->seed, err); -+ else -+ pr_debug("%ps PASSED, returned %d", crypto_rng_alg(tfm)->seed, err); -+ - out: - kfree_sensitive(buf); - return err; -diff --git a/crypto/shash.c b/crypto/shash.c -index 301ab42bf..705fd2d83 100644 ---- a/crypto/shash.c -+++ b/crypto/shash.c -@@ -36,6 +36,12 @@ int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key, - int err; - - err = shash->setkey(tfm, key, keylen); -+ -+ if(err) -+ pr_debug("%ps FAILED, returned %d", shash->setkey, err); -+ else -+ pr_debug("%ps PASSED, returned %d", shash->setkey, err); -+ - if (unlikely(err)) { - shash_set_needkey(tfm, shash); - return err; -@@ -49,13 +55,25 @@ EXPORT_SYMBOL_GPL(crypto_shash_setkey); - int crypto_shash_update(struct shash_desc *desc, const u8 *data, - unsigned int len) - { -- return crypto_shash_alg(desc->tfm)->update(desc, data, len); -+ int err = crypto_shash_alg(desc->tfm)->update(desc, data, len); -+ if(err) -+ pr_debug("%ps FAILED, returned %d", crypto_shash_alg(desc->tfm)->update, err); -+ else -+ if(strcmp(crypto_shash_alg(desc->tfm)->base.cra_name, "crc32c")) { -+ pr_debug("%ps PASSED, returned %d", crypto_shash_alg(desc->tfm)->update, err); -+ } -+ return err; - } - EXPORT_SYMBOL_GPL(crypto_shash_update); - - int crypto_shash_final(struct shash_desc *desc, u8 *out) - { -- return crypto_shash_alg(desc->tfm)->final(desc, out); -+ int err = crypto_shash_alg(desc->tfm)->final(desc, out); -+ if(err) -+ pr_debug("%ps FAILED, returned %d", crypto_shash_alg(desc->tfm)->final, err); -+ else -+ pr_debug("%ps PASSED, returned %d", crypto_shash_alg(desc->tfm)->final, err); -+ return err; - } - EXPORT_SYMBOL_GPL(crypto_shash_final); - -@@ -166,8 +184,10 @@ static int crypto_shash_init_tfm(struct crypto_tfm *tfm) - return 0; - - err = alg->init_tfm(hash); -- if (err) -+ if (err) { -+ pr_debug("%ps FAILED, returned %d", alg->init_tfm, err); - return err; -+ } - - /* ->init_tfm() may have increased the descsize. */ - if (WARN_ON_ONCE(hash->descsize > HASH_MAX_DESCSIZE)) { -@@ -175,6 +195,7 @@ static int crypto_shash_init_tfm(struct crypto_tfm *tfm) - alg->exit_tfm(hash); - return -EINVAL; - } -+ pr_debug("%ps PASSED, returned %d", alg->init_tfm, err); - - return 0; - } -diff --git a/crypto/skcipher.c b/crypto/skcipher.c -index fd3273b51..d12250a33 100644 ---- a/crypto/skcipher.c -+++ b/crypto/skcipher.c -@@ -620,6 +620,11 @@ int crypto_skcipher_setkey(struct crypto_skcipher *tfm, const u8 *key, - else - err = cipher->setkey(tfm, key, keylen); - -+ if(err) -+ pr_debug("%ps FAILED, returned %d", cipher->setkey, err); -+ else -+ pr_debug("%ps PASSED, returned %d", cipher->setkey, err); -+ - out: - if (unlikely(err)) { - skcipher_set_needkey(tfm); -@@ -635,12 +640,22 @@ int crypto_skcipher_encrypt(struct skcipher_request *req) - { - struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); - struct skcipher_alg *alg = crypto_skcipher_alg(tfm); -+ int ret; - - if (crypto_skcipher_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) - return -ENOKEY; - if (alg->co.base.cra_type != &crypto_skcipher_type) - return crypto_lskcipher_encrypt_sg(req); -- return alg->encrypt(req); -+ ret = alg->encrypt(req); -+ -+ if(!strstr(alg->base.cra_driver_name, "ecb-cipher_null")) { -+ if(ret) -+ pr_debug("%ps FAILED, returned %d", alg->encrypt, ret); -+ else -+ pr_debug("%ps PASSED, returned %d", alg->encrypt, ret); -+ } -+ -+ return ret; - } - EXPORT_SYMBOL_GPL(crypto_skcipher_encrypt); - -@@ -648,12 +663,20 @@ int crypto_skcipher_decrypt(struct skcipher_request *req) - { - struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); - struct skcipher_alg *alg = crypto_skcipher_alg(tfm); -+ int ret; - - if (crypto_skcipher_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) - return -ENOKEY; - if (alg->co.base.cra_type != &crypto_skcipher_type) - return crypto_lskcipher_decrypt_sg(req); -- return alg->decrypt(req); -+ ret = alg->decrypt(req); -+ -+ if(ret) -+ pr_debug("%ps FAILED, returned %d", alg->decrypt, ret); -+ else -+ pr_debug("%ps PASSED, returned %d", alg->decrypt, ret); -+ -+ return ret; - } - EXPORT_SYMBOL_GPL(crypto_skcipher_decrypt); - -@@ -745,8 +768,14 @@ static int crypto_skcipher_init_tfm(struct crypto_tfm *tfm) - if (alg->exit) - skcipher->base.exit = crypto_skcipher_exit_tfm; - -- if (alg->init) -- return alg->init(skcipher); -+ if(alg->init) { -+ int err = alg->init(skcipher); -+ if(err) -+ pr_debug("%ps FAILED, returned %d", alg->init, err); -+ else -+ pr_debug("%ps PASSED, returned %d", alg->init, err); -+ return err; -+ } - - return 0; - } --- -2.40.4 - diff --git a/SPECS/91/linux/aws/0001-scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch b/SPECS/91/linux/aws/0001-scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch deleted file mode 100644 index 67bcf1576e..0000000000 --- a/SPECS/91/linux/aws/0001-scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 7324cee04e5eaf50907a8545754144091fda2e3c Mon Sep 17 00:00:00 2001 -From: "kernel-team@fedoraproject.org" -Date: Fri, 10 Feb 2012 14:56:13 -0500 -Subject: [PATCH] scsi: sd_revalidate_disk prevent NULL ptr deref - -Bugzilla: 754518 -Upstream-status: Fedora mustard (might be worth dropping...) -(cherry picked from commit 375799a9c882e8dcf2bd663102305315eda18ddb) -Signed-off-by: Munehisa Kamata -Reviewed-by: Cristian Gafton -Reviewed-by: Guru Anbalagane - -CR: https://cr.amazon.com/r/6834769/ - -Reviewed-by: Cristian Gafton -Reviewed-by: Frederick Lefebvre -Reviewed-by: Eduardo Valentin -Signed-off-by: Vallish Vaidyeshwara -CR: https://cr.amazon.com/r/8209723/ - -[Srinidhi Rao ported this patch to v6.12.x] -Signed-off-by: srinidhira0 ---- - drivers/scsi/sd.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c -index 3745cf856..4e0a96cac 100644 ---- a/drivers/scsi/sd.c -+++ b/drivers/scsi/sd.c -@@ -3693,9 +3693,9 @@ static void sd_read_block_zero(struct scsi_disk *sdkp) - static int sd_revalidate_disk(struct gendisk *disk) - { - struct scsi_disk *sdkp = scsi_disk(disk); -- struct scsi_device *sdp = sdkp->device; -- sector_t old_capacity = sdkp->capacity; - struct queue_limits *lim = NULL; -+ struct scsi_device *sdp; -+ sector_t old_capacity; - unsigned char *buffer = NULL; - unsigned int dev_max; - int err = 0; -@@ -3703,6 +3703,11 @@ static int sd_revalidate_disk(struct gendisk *disk) - SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, - "sd_revalidate_disk\n")); - -+ if (WARN_ONCE((!sdkp), "Invalid scsi_disk from %p\n", disk)) -+ goto out; -+ -+ sdp = sdkp->device; -+ old_capacity = sdkp->capacity; - /* - * If the device is offline, don't try and read capacity or any - * of the other niceties. --- -2.39.4 - diff --git a/SPECS/91/linux/aws/0007-xen-manage-keep-track-of-the-on-going-suspend-mode.patch b/SPECS/91/linux/aws/0007-xen-manage-keep-track-of-the-on-going-suspend-mode.patch deleted file mode 100644 index dd6b8ed050..0000000000 --- a/SPECS/91/linux/aws/0007-xen-manage-keep-track-of-the-on-going-suspend-mode.patch +++ /dev/null @@ -1,128 +0,0 @@ -From 1c3629901f09d84a2a97ed95fb81780b9c0319ed Mon Sep 17 00:00:00 2001 -From: Munehisa Kamata -Date: Wed, 12 Jul 2017 23:35:17 +0000 -Subject: [PATCH] xen/manage: keep track of the on-going suspend mode - -To differentiate between Xen suspend, PM suspend and PM hibernation, -keep track of the on-going suspend mode by mainly using a new PM -notifier. Since Xen suspend doesn't have corresponding PM event, its -main logic is modfied to acquire pm_mutex and set the current mode. - -Note that we may see deadlock if PM suspend/hibernation is interrupted -by Xen suspend. PM suspend/hibernation depends on xenwatch thread to -process xenbus state transactions, but the thread will sleep to wait -pm_mutex which is already held by PM suspend/hibernation context in the -scenario. Though, acquirng pm_mutex is still right thing to do, and we -would need to modify Xen shutdown code to avoid the issue. This will be -fixed by a separate patch. - -[Srinidhi Rao ported this patch to v6.6.x] - -Signed-off-by: Munehisa Kamata -Signed-off-by: Anchal Agarwal -Reviewed-by: Sebastian Biemueller -Reviewed-by: Munehisa Kamata -Reviewed-by: Eduardo Valentin -CR: https://cr.amazon.com/r/8273194/ ---- - drivers/xen/manage.c | 59 ++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 59 insertions(+) - -diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c -index c16df629907e..2f265b0a5d08 100644 ---- a/drivers/xen/manage.c -+++ b/drivers/xen/manage.c -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -40,6 +41,16 @@ enum shutdown_state { - /* Ignore multiple shutdown requests. */ - static enum shutdown_state shutting_down = SHUTDOWN_INVALID; - -+enum suspend_modes { -+ NO_SUSPEND = 0, -+ XEN_SUSPEND, -+ PM_SUSPEND, -+ PM_HIBERNATION, -+}; -+ -+/* Protected by pm_mutex */ -+static enum suspend_modes suspend_mode = NO_SUSPEND; -+ - struct suspend_info { - int cancelled; - }; -@@ -98,6 +109,11 @@ static void do_suspend(void) - { - int err; - struct suspend_info si; -+ unsigned int sleep_flags; -+ -+ sleep_flags = lock_system_sleep(); -+ -+ suspend_mode = XEN_SUSPEND; - - shutting_down = SHUTDOWN_SUSPEND; - -@@ -162,6 +178,10 @@ static void do_suspend(void) - thaw_processes(); - out: - shutting_down = SHUTDOWN_INVALID; -+ -+ suspend_mode = NO_SUSPEND; -+ -+ unlock_system_sleep(sleep_flags); - } - #endif /* CONFIG_HIBERNATE_CALLBACKS */ - -@@ -388,3 +408,42 @@ int xen_setup_shutdown_event(void) - EXPORT_SYMBOL_GPL(xen_setup_shutdown_event); - - subsys_initcall(xen_setup_shutdown_event); -+ -+static int xen_pm_notifier(struct notifier_block *notifier, -+ unsigned long pm_event, void *unused) -+{ -+ switch (pm_event) { -+ case PM_SUSPEND_PREPARE: -+ suspend_mode = PM_SUSPEND; -+ break; -+ case PM_HIBERNATION_PREPARE: -+ case PM_RESTORE_PREPARE: -+ suspend_mode = PM_HIBERNATION; -+ break; -+ case PM_POST_SUSPEND: -+ case PM_POST_RESTORE: -+ case PM_POST_HIBERNATION: -+ /* Set back to the default */ -+ suspend_mode = NO_SUSPEND; -+ break; -+ default: -+ pr_warn("Receive unknown PM event 0x%lx\n", pm_event); -+ return -EINVAL; -+ } -+ -+ return 0; -+}; -+ -+static struct notifier_block xen_pm_notifier_block = { -+ .notifier_call = xen_pm_notifier -+}; -+ -+static int xen_setup_pm_notifier(void) -+{ -+ if (!xen_hvm_domain()) -+ return -ENODEV; -+ -+ return register_pm_notifier(&xen_pm_notifier_block); -+} -+ -+subsys_initcall(xen_setup_pm_notifier); --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0008-xen-manage-introduce-helper-function-to-know-the-on-.patch b/SPECS/91/linux/aws/0008-xen-manage-introduce-helper-function-to-know-the-on-.patch deleted file mode 100644 index 415b42da04..0000000000 --- a/SPECS/91/linux/aws/0008-xen-manage-introduce-helper-function-to-know-the-on-.patch +++ /dev/null @@ -1,68 +0,0 @@ -From f118963404d900df39e35c3c4767c9998456beaf Mon Sep 17 00:00:00 2001 -From: Munehisa Kamata -Date: Thu, 13 Jul 2017 00:12:32 +0000 -Subject: [PATCH] xen/manage: introduce helper function to know the on-going - suspend mode - -Introduce simple functions which help to know the on-going suspend mode -so that other Xen-related code can behave differently according to the -current suspend mode. - -[Srinidhi Rao ported this patch to v6.6.x] - -Signed-off-by: Munehisa Kamata -Signed-off-by: Anchal Agarwal -Reviewed-by: Alakesh Haloi -Reviewed-by: Sebastian Biemueller -Reviewed-by: Munehisa Kamata -Reviewed-by: Eduardo Valentin -CR: https://cr.amazon.com/r/8273190/ ---- - drivers/xen/manage.c | 15 +++++++++++++++ - include/xen/xen-ops.h | 4 ++++ - 2 files changed, 19 insertions(+) - -diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c -index 2f265b0a5d08..de89fed344ca 100644 ---- a/drivers/xen/manage.c -+++ b/drivers/xen/manage.c -@@ -51,6 +51,21 @@ enum suspend_modes { - /* Protected by pm_mutex */ - static enum suspend_modes suspend_mode = NO_SUSPEND; - -+bool xen_suspend_mode_is_xen_suspend(void) -+{ -+ return suspend_mode == XEN_SUSPEND; -+} -+ -+bool xen_suspend_mode_is_pm_suspend(void) -+{ -+ return suspend_mode == PM_SUSPEND; -+} -+ -+bool xen_suspend_mode_is_pm_hibernation(void) -+{ -+ return suspend_mode == PM_HIBERNATION; -+} -+ - struct suspend_info { - int cancelled; - }; -diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h -index 47f11bec5e90..c6f64f8d3d63 100644 ---- a/include/xen/xen-ops.h -+++ b/include/xen/xen-ops.h -@@ -41,6 +41,10 @@ u64 xen_steal_clock(int cpu); - - int xen_setup_shutdown_event(void); - -+bool xen_suspend_mode_is_xen_suspend(void); -+bool xen_suspend_mode_is_pm_suspend(void); -+bool xen_suspend_mode_is_pm_hibernation(void); -+ - extern unsigned long *xen_contiguous_bitmap; - - #if defined(CONFIG_XEN_PV) --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0009-xenbus-add-freeze-thaw-restore-callbacks-support.patch b/SPECS/91/linux/aws/0009-xenbus-add-freeze-thaw-restore-callbacks-support.patch deleted file mode 100644 index 5ba5c3645f..0000000000 --- a/SPECS/91/linux/aws/0009-xenbus-add-freeze-thaw-restore-callbacks-support.patch +++ /dev/null @@ -1,203 +0,0 @@ -From 5a1dfe3f931c80e86a9976d68e0d782dc7a2de52 Mon Sep 17 00:00:00 2001 -From: Munehisa Kamata -Date: Thu, 13 Jul 2017 02:00:31 +0000 -Subject: [PATCH] xenbus: add freeze/thaw/restore callbacks support - -Since commit b3e96c0c7562 ("xen: use freeze/restore/thaw PM events for -suspend/resume/chkpt"), xenbus uses PMSG_FREEZE, PMSG_THAW and -PMSG_RESTORE events for Xen suspend. However, they're actually assigned -to xenbus_dev_suspend(), xenbus_dev_cancel() and xenbus_dev_resume() -respectively, and only suspend and resume callbacks are supported at -driver level. To support PM suspend and PM hibernation, modify the bus -level PM callbacks to invoke not only device driver's suspend/resume but -also freeze/thaw/restore. - -Note that we'll use freeze/restore callbacks even for PM suspend whereas -suspend/resume callbacks are normally used in the case, becausae the -existing xenbus device drivers already have suspend/resume callbacks -specifically designed for Xen suspend. So we can allow the device -drivers to keep the existing callbacks wihtout modification. - -[Srinidhi Rao ported this patch to v6.6.x] - -Signed-off-by: Munehisa Kamata -Signed-off-by: Anchal Agarwal -Reviewed-by: Munehisa Kamata -Reviewed-by: Eduardo Valentin -CR: https://cr.amazon.com/r/8273200/ ---- - drivers/xen/xenbus/xenbus_probe.c | 99 ++++++++++++++++++++++++++----- - include/xen/xenbus.h | 3 + - 2 files changed, 86 insertions(+), 16 deletions(-) - -diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c -index 3205e5d724c8..e26c3269c721 100644 ---- a/drivers/xen/xenbus/xenbus_probe.c -+++ b/drivers/xen/xenbus/xenbus_probe.c -@@ -50,6 +50,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -664,26 +665,47 @@ int xenbus_dev_suspend(struct device *dev) - struct xenbus_driver *drv; - struct xenbus_device *xdev - = container_of(dev, struct xenbus_device, dev); -+ int (*cb)(struct xenbus_device *) = NULL; -+ bool xen_suspend = xen_suspend_mode_is_xen_suspend(); - - DPRINTK("%s", xdev->nodename); - - if (dev->driver == NULL) - return 0; - drv = to_xenbus_driver(dev->driver); -- if (drv->suspend) -- err = drv->suspend(xdev); -- if (err) -- dev_warn(dev, "suspend failed: %i\n", err); -+ -+ if (xen_suspend) -+ cb = drv->suspend; -+ else -+ cb = drv->freeze; -+ -+ if (cb) -+ err = cb(xdev); -+ -+ if (err) { -+ dev_warn(dev, "%s failed: %i\n", xen_suspend ? -+ "suspend" : "freeze", err); -+ return err; -+ } -+ -+ if (!xen_suspend) { -+ /* Forget otherend since this can become stale after restore */ -+ free_otherend_watch(xdev); -+ free_otherend_details(xdev); -+ } -+ - return 0; - } - EXPORT_SYMBOL_GPL(xenbus_dev_suspend); - - int xenbus_dev_resume(struct device *dev) - { -- int err; -+ int err = 0; - struct xenbus_driver *drv; - struct xenbus_device *xdev - = container_of(dev, struct xenbus_device, dev); -+ int (*cb)(struct xenbus_device *) = NULL; -+ bool xen_suspend = xen_suspend_mode_is_xen_suspend(); - - DPRINTK("%s", xdev->nodename); - -@@ -692,23 +714,32 @@ int xenbus_dev_resume(struct device *dev) - drv = to_xenbus_driver(dev->driver); - err = talk_to_otherend(xdev); - if (err) { -- dev_warn(dev, "resume (talk_to_otherend) failed: %i\n", err); -+ dev_warn(dev, "%s (talk_to_otherend) failed: %i\n", -+ xen_suspend ? "resume" : "restore", err); - return err; - } - -- xdev->state = XenbusStateInitialising; -+ if (xen_suspend) -+ xdev->state = XenbusStateInitialising; - -- if (drv->resume) { -- err = drv->resume(xdev); -- if (err) { -- dev_warn(dev, "resume failed: %i\n", err); -- return err; -- } -+ if (xen_suspend) -+ cb = drv->resume; -+ else -+ cb = drv->restore; -+ -+ if (cb) -+ err = cb(xdev); -+ -+ if (err) { -+ dev_warn(dev, "%s failed: %i\n", -+ xen_suspend ? "resume" : "restore", err); -+ return err; - } - - err = watch_otherend(xdev); - if (err) { -- dev_warn(dev, "resume (watch_otherend) failed: %d\n", err); -+ dev_warn(dev, "%s (watch_otherend) failed: %d.\n", -+ xen_suspend ? "resume" : "restore", err); - return err; - } - -@@ -718,8 +749,44 @@ EXPORT_SYMBOL_GPL(xenbus_dev_resume); - - int xenbus_dev_cancel(struct device *dev) - { -- /* Do nothing */ -- DPRINTK("cancel"); -+ int err = 0; -+ struct xenbus_driver *drv; -+ struct xenbus_device *xdev -+ = container_of(dev, struct xenbus_device, dev); -+ bool xen_suspend = xen_suspend_mode_is_xen_suspend(); -+ -+ if (xen_suspend) { -+ /* Do nothing */ -+ DPRINTK("cancel"); -+ return 0; -+ } -+ -+ DPRINTK("%s", xdev->nodename); -+ -+ if (dev->driver == NULL) -+ return 0; -+ drv = to_xenbus_driver(dev->driver); -+ -+ err = talk_to_otherend(xdev); -+ if (err) { -+ dev_warn(dev, "thaw (talk_to_otherend) failed: %d.\n", err); -+ return err; -+ } -+ -+ if (drv->thaw) { -+ err = drv->thaw(xdev); -+ if (err) { -+ dev_warn(dev, "thaw failed: %i\n", err); -+ return err; -+ } -+ } -+ -+ err = watch_otherend(xdev); -+ if (err) { -+ dev_warn(dev, "thaw (watch_otherend) failed: %d.\n", err); -+ return err; -+ } -+ - return 0; - } - EXPORT_SYMBOL_GPL(xenbus_dev_cancel); -diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h -index ac22cf08c09f..e7db507596d6 100644 ---- a/include/xen/xenbus.h -+++ b/include/xen/xenbus.h -@@ -117,6 +117,9 @@ struct xenbus_driver { - void (*remove)(struct xenbus_device *dev); - int (*suspend)(struct xenbus_device *dev); - int (*resume)(struct xenbus_device *dev); -+ int (*freeze)(struct xenbus_device *dev); -+ int (*thaw)(struct xenbus_device *dev); -+ int (*restore)(struct xenbus_device *dev); - int (*uevent)(const struct xenbus_device *, struct kobj_uevent_env *); - struct device_driver driver; - int (*read_otherend_details)(struct xenbus_device *dev); --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0010-x86-xen-Introduce-new-function-to-map-HYPERVISOR_sha.patch b/SPECS/91/linux/aws/0010-x86-xen-Introduce-new-function-to-map-HYPERVISOR_sha.patch deleted file mode 100644 index ef411c382f..0000000000 --- a/SPECS/91/linux/aws/0010-x86-xen-Introduce-new-function-to-map-HYPERVISOR_sha.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 099837fd07f5595046ba2a5eb77e67839626b0c7 Mon Sep 17 00:00:00 2001 -From: Anchal Agarwal -Date: Thu, 22 Feb 2018 21:52:42 +0000 -Subject: [PATCH] x86/xen: Introduce new function to map HYPERVISOR_shared_info - on Resume - -Introduce a small function which re-uses shared page's PA allocated -during guest initialization time in reserve_shared_info() and not -allocate new page during resume flow. -It also does the mapping of shared_info_page by calling -xen_hvm_init_shared_info() to use the function. - -Backport Notes: -We don't need this commit 8d5ce0dad4ab2a4c8c8a3c36f6fb8c46b695b053 ("x86/xen: -decouple shared_info mapping from xen_hvm_init_shared_info()") here since -xen_hvm_init_shared_info changed in 4.14 kernel just to do the mapping and -allocation of shared page is done in a separate function. -We don't need to decouple this kernel API anymore - -Signed-off-by: Anchal Agarwal -Reviewed-by: Sebastian Biemueller -Reviewed-by: Munehisa Kamata -Reviewed-by: Eduardo Valentin -CR: https://cr.amazon.com/r/8273203/ ---- - arch/x86/xen/enlighten_hvm.c | 7 +++++++ - arch/x86/xen/xen-ops.h | 2 ++ - 2 files changed, 9 insertions(+) - -diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c -index 3f8c34707c50..9623be6bdd6e 100644 ---- a/arch/x86/xen/enlighten_hvm.c -+++ b/arch/x86/xen/enlighten_hvm.c -@@ -36,6 +36,13 @@ static unsigned long shared_info_pfn; - __ro_after_init bool xen_percpu_upcall; - EXPORT_SYMBOL_GPL(xen_percpu_upcall); - -+void xen_hvm_map_shared_info(void) -+{ -+ xen_hvm_init_shared_info(); -+ if(shared_info_pfn) -+ HYPERVISOR_shared_info = __va(PFN_PHYS(shared_info_pfn)); -+} -+ - void xen_hvm_init_shared_info(void) - { - struct xen_add_to_physmap xatp; -diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h -index a87ab36889e7..f40122117378 100644 ---- a/arch/x86/xen/xen-ops.h -+++ b/arch/x86/xen/xen-ops.h -@@ -56,6 +56,8 @@ void xen_enable_sysenter(void); - void xen_enable_syscall(void); - void xen_vcpu_restore(void); - -+void xen_callback_vector(void); -+void xen_hvm_map_shared_info(void); - void xen_hvm_init_shared_info(void); - void xen_unplug_emulated_devices(void); - --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0011-x86-xen-add-system-core-suspend-and-resume-callbacks.patch b/SPECS/91/linux/aws/0011-x86-xen-add-system-core-suspend-and-resume-callbacks.patch deleted file mode 100644 index 19e7387f90..0000000000 --- a/SPECS/91/linux/aws/0011-x86-xen-add-system-core-suspend-and-resume-callbacks.patch +++ /dev/null @@ -1,130 +0,0 @@ -From f8073890a69d7de12780a218c1b2208c2c2aeb95 Mon Sep 17 00:00:00 2001 -From: Munehisa Kamata -Date: Sat, 11 Feb 2017 00:53:56 +0000 -Subject: [PATCH] x86/xen: add system core suspend and resume callbacks - -Add Xen PVHVM specific system core callbacks for PM suspend and -hibernation support. The callbacks suspend and resume Xen primitives, -like shared_info, pvclock and grant table. Note that Xen suspend can -handle them in a different manner, but system core callbacks are called -from the context. So if the callbacks are called from Xen suspend -context, return immediately. - -Signed-off-by: Munehisa Kamata -Signed-off-by: Anchal Agarwal -Reviewed-by: Munehisa Kamata -Reviewed-by: Eduardo Valentin -CR: https://cr.amazon.com/r/8273204/ ---- - arch/x86/xen/enlighten_hvm.c | 1 + - arch/x86/xen/suspend.c | 53 ++++++++++++++++++++++++++++++++++++ - include/xen/xen-ops.h | 2 ++ - 3 files changed, 56 insertions(+) - -diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c -index 24d2957a4726..156d1f02a9f5 100644 ---- a/arch/x86/xen/enlighten_hvm.c -+++ b/arch/x86/xen/enlighten_hvm.c -@@ -227,6 +227,7 @@ static void __init xen_hvm_guest_init(void) - - xen_panic_handler_init(); - -+ xen_setup_syscore_ops(); - xen_hvm_smp_init(); - WARN_ON(xen_cpuhp_setup(xen_cpu_up_prepare_hvm, xen_cpu_dead_hvm)); - xen_unplug_emulated_devices(); -diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c -index 77a6ea1c60e4..a0fe823b96cd 100644 ---- a/arch/x86/xen/suspend.c -+++ b/arch/x86/xen/suspend.c -@@ -2,17 +2,22 @@ - #include - #include - #include -+#include -+#include - - #include - #include -+#include - #include - #include -+#include - - #include - #include - #include - #include - #include -+#include - - #include "xen-ops.h" - -@@ -80,3 +85,51 @@ void xen_arch_suspend(void) - - on_each_cpu(xen_vcpu_notify_suspend, NULL, 1); - } -+ -+static int xen_syscore_suspend(void) -+{ -+ struct xen_remove_from_physmap xrfp; -+ int ret; -+ -+ /* Xen suspend does similar stuffs in its own logic */ -+ if (xen_suspend_mode_is_xen_suspend()) -+ return 0; -+ -+ xrfp.domid = DOMID_SELF; -+ xrfp.gpfn = __pa(HYPERVISOR_shared_info) >> PAGE_SHIFT; -+ -+ ret = HYPERVISOR_memory_op(XENMEM_remove_from_physmap, &xrfp); -+ if (!ret) -+ HYPERVISOR_shared_info = &xen_dummy_shared_info; -+ -+ return ret; -+} -+ -+static void xen_syscore_resume(void) -+{ -+ /* Xen suspend does similar stuffs in its own logic */ -+ if (xen_suspend_mode_is_xen_suspend()) -+ return; -+ -+ /* No need to setup vcpu_info as it's already moved off */ -+ xen_hvm_map_shared_info(); -+ -+ pvclock_resume(); -+ -+ gnttab_resume(); -+} -+ -+/* -+ * These callbacks will be called with interrupts disabled and when having only -+ * one CPU online. -+ */ -+static struct syscore_ops xen_hvm_syscore_ops = { -+ .suspend = xen_syscore_suspend, -+ .resume = xen_syscore_resume -+}; -+ -+void __init xen_setup_syscore_ops(void) -+{ -+ if (xen_hvm_domain()) -+ register_syscore_ops(&xen_hvm_syscore_ops); -+} -diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h -index 47f11bec5e90..b0064615eeb5 100644 ---- a/include/xen/xen-ops.h -+++ b/include/xen/xen-ops.h -@@ -41,6 +41,8 @@ u64 xen_steal_clock(int cpu); - - int xen_setup_shutdown_event(void); - -+void xen_setup_syscore_ops(void); -+ - bool xen_suspend_mode_is_xen_suspend(void); - bool xen_suspend_mode_is_pm_suspend(void); - bool xen_suspend_mode_is_pm_hibernation(void); --- -2.39.4 - diff --git a/SPECS/91/linux/aws/0012-xen-blkfront-add-callbacks-for-PM-suspend-and-hibern.patch b/SPECS/91/linux/aws/0012-xen-blkfront-add-callbacks-for-PM-suspend-and-hibern.patch deleted file mode 100644 index ce7016b81f..0000000000 --- a/SPECS/91/linux/aws/0012-xen-blkfront-add-callbacks-for-PM-suspend-and-hibern.patch +++ /dev/null @@ -1,332 +0,0 @@ -From 85a0fedeaec23f0223fb45dc70e8264677c375de Mon Sep 17 00:00:00 2001 -From: Munehisa Kamata -Date: Thu, 8 Jun 2017 19:15:55 +0000 -Subject: [PATCH] xen-blkfront: add callbacks for PM suspend and hibernation - -Add freeze and restore callbacks for PM suspend and hibernation support. -The freeze handler stops a block-layer queue and disconnect the frontend -from the backend while freeing ring_info and associated resources. The -restore handler re-allocates ring_info and re-connect to the backedend, -so the rest of the kernel can continue to use the block device -transparently.Also, the handlers are used for both PM -suspend and hibernation so that we can keep the existing suspend/resume -callbacks for Xen suspend without modification. -If a backend doesn't have commit 12ea729645ac ("xen/blkback: unmap all -persistent grants when frontend gets disconnected"), the frontend may see -massive amount of grant table warning when freeing resources. - - [ 36.852659] deferring g.e. 0xf9 (pfn 0xffffffffffffffff) - [ 36.855089] xen:grant_table: WARNING: g.e. 0x112 still in use! - -In this case, persistent grants would need to be disabled. - -Ensure no reqs/rsps in rings before disconnecting. When disconnecting -the frontend from the backend in blkfront_freeze(), there still may be -unconsumed requests or responses in the rings, especially when the -backend is backed by network-based device. If the frontend gets -disconnected with such reqs/rsps remaining there, it can cause -grant warnings and/or losing reqs/rsps by freeing pages afterward. -This can lead resumed kernel into unrecoverable state like unexpected -freeing of grant page and/or hung task due to the lost reqs or rsps. -Therefore we have to ensure that there is no unconsumed requests or -responses before disconnecting. - -Actually, the frontend just needs to wait for some amount of time so that -the backend can process the requests, put responses and notify the -frontend back. Timeout used here is based on some heuristic. If we somehow -hit the timeout, it would mean something serious happens in the backend, -the frontend will just return an error to PM core and PM suspend/hibernation -will be aborted. This may be something should be fixed by the backend side, -but a frontend side fix is probably still worth doing to work with -broader backends. - -Backport Note: -Unlike 4.9 kernel, blk-mq is default for 4.14 kernel and request-based -mode cod eis not included in this frontend driver. - -Signed-off-by: Munehisa Kamata -Signed-off-by: Anchal Agarwal -Reviewed-by: Munehisa Kamata -Reviewed-by: Eduardo Valentin -CR: https://cr.amazon.com/r/8297625/ ---- - drivers/block/xen-blkfront.c | 162 +++++++++++++++++++++++++++++++++-- - 1 file changed, 155 insertions(+), 7 deletions(-) - -diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c -index 59ce113b882a..531e5cd4918e 100644 ---- a/drivers/block/xen-blkfront.c -+++ b/drivers/block/xen-blkfront.c -@@ -49,6 +49,8 @@ - #include - #include - #include -+#include -+#include - - #include - #include -@@ -82,6 +84,8 @@ enum blkif_state { - BLKIF_STATE_CONNECTED, - BLKIF_STATE_SUSPENDED, - BLKIF_STATE_ERROR, -+ BLKIF_STATE_FREEZING, -+ BLKIF_STATE_FROZEN, - }; - - struct grant { -@@ -231,6 +235,7 @@ struct blkfront_info - struct list_head requests; - struct bio_list bio_list; - struct list_head info_list; -+ struct completion wait_backend_disconnected; - }; - - static unsigned int nr_minors; -@@ -270,6 +275,16 @@ static DEFINE_SPINLOCK(minor_lock); - static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo); - static void blkfront_gather_backend_features(struct blkfront_info *info); - static int negotiate_mq(struct blkfront_info *info); -+static void __blkif_free(struct blkfront_info *info); -+ -+static inline bool blkfront_ring_is_busy(struct blkif_front_ring *ring) -+{ -+ if (RING_SIZE(ring) > RING_FREE_REQUESTS(ring) || -+ RING_HAS_UNCONSUMED_RESPONSES(ring)) -+ return true; -+ else -+ return false; -+} - - #define for_each_rinfo(info, ptr, idx) \ - for ((ptr) = (info)->rinfo, (idx) = 0; \ -@@ -1140,6 +1155,7 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity, - goto out_release_minors; - - blkif_set_queue_limits(info, &lim); -+ init_completion(&info->wait_backend_disconnected); - gd = blk_mq_alloc_disk(&info->tag_set, &lim, info); - if (IS_ERR(gd)) { - err = PTR_ERR(gd); -@@ -1184,6 +1200,8 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity, - /* Already hold rinfo->ring_lock. */ - static inline void kick_pending_request_queues_locked(struct blkfront_ring_info *rinfo) - { -+ if (unlikely(rinfo->dev_info->connected == BLKIF_STATE_FREEZING)) -+ return; - if (!RING_FULL(&rinfo->ring)) - blk_mq_start_stopped_hw_queues(rinfo->dev_info->rq, true); - } -@@ -1301,9 +1319,6 @@ static void blkif_free_ring(struct blkfront_ring_info *rinfo) - - static void blkif_free(struct blkfront_info *info, int suspend) - { -- unsigned int i; -- struct blkfront_ring_info *rinfo; -- - /* Prevent new requests being issued until we fix things up. */ - info->connected = suspend ? - BLKIF_STATE_SUSPENDED : BLKIF_STATE_DISCONNECTED; -@@ -1311,6 +1326,14 @@ static void blkif_free(struct blkfront_info *info, int suspend) - if (info->rq) - blk_mq_stop_hw_queues(info->rq); - -+ __blkif_free(info); -+} -+ -+static void __blkif_free(struct blkfront_info *info) -+{ -+ unsigned int i; -+ struct blkfront_ring_info *rinfo; -+ - for_each_rinfo(info, rinfo, i) - blkif_free_ring(rinfo); - -@@ -1522,8 +1545,10 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) - unsigned int eoiflag = XEN_EOI_FLAG_SPURIOUS; - - if (unlikely(info->connected != BLKIF_STATE_CONNECTED)) { -- xen_irq_lateeoi(irq, XEN_EOI_FLAG_SPURIOUS); -- return IRQ_HANDLED; -+ if (info->connected != BLKIF_STATE_FREEZING) { -+ xen_irq_lateeoi(irq, XEN_EOI_FLAG_SPURIOUS); -+ return IRQ_HANDLED; -+ } - } - - spin_lock_irqsave(&rinfo->ring_lock, flags); -@@ -2013,6 +2038,8 @@ static int blkif_recover(struct blkfront_info *info) - struct bio *bio; - struct blkfront_ring_info *rinfo; - -+ bool frozen = info->connected == BLKIF_STATE_FROZEN; -+ - lim = queue_limits_start_update(info->rq); - blkfront_gather_backend_features(info); - blkif_set_queue_limits(info, &lim); -@@ -2035,6 +2062,9 @@ static int blkif_recover(struct blkfront_info *info) - kick_pending_request_queues(rinfo); - } - -+ if (frozen) -+ return 0; -+ - list_for_each_entry_safe(req, n, &info->requests, queuelist) { - /* Requeue pending requests (flush or discard) */ - list_del_init(&req->queuelist); -@@ -2336,6 +2366,7 @@ static void blkfront_connect(struct blkfront_info *info) - - return; - case BLKIF_STATE_SUSPENDED: -+ case BLKIF_STATE_FROZEN: - /* - * If we are recovering from suspension, we need to wait - * for the backend to announce it's features before -@@ -2459,11 +2490,35 @@ static void blkback_changed(struct xenbus_device *dev, - break; - - case XenbusStateClosed: -- if (dev->state == XenbusStateClosed) -+ if (dev->state == XenbusStateClosed) { -+ if (info->connected == BLKIF_STATE_FREEZING) { -+ __blkif_free(info); -+ info->connected = BLKIF_STATE_FROZEN; -+ complete(&info->wait_backend_disconnected); -+ break; -+ } -+ -+ break; -+ } -+ -+ /* -+ * We may somehow receive backend's Closed again while thawing -+ * or restoring and it causes thawing or restoring to fail. -+ * Ignore such unexpected state anyway. -+ */ -+ if (info->connected == BLKIF_STATE_FROZEN && -+ dev->state == XenbusStateInitialised) { -+ dev_dbg(&dev->dev, -+ "ignore the backend's Closed state: %s", -+ dev->nodename); - break; -+ } - fallthrough; - case XenbusStateClosing: -- blkfront_closing(info); -+ if (info->connected == BLKIF_STATE_FREEZING) -+ xenbus_frontend_closed(dev); -+ else -+ blkfront_closing(info); - break; - } - } -@@ -2498,6 +2553,96 @@ static int blkfront_is_ready(struct xenbus_device *dev) - return info->is_ready && info->xbdev; - } - -+static int blkfront_freeze(struct xenbus_device *dev) -+{ -+ unsigned int i; -+ struct blkfront_info *info = dev_get_drvdata(&dev->dev); -+ struct blkfront_ring_info *rinfo; -+ struct blkif_front_ring *ring; -+ /* This would be reasonable timeout as used in xenbus_dev_shutdown() */ -+ unsigned int timeout = 5 * HZ; -+ int err = 0; -+ -+ info->connected = BLKIF_STATE_FREEZING; -+ -+ blk_mq_stop_hw_queues(info->rq); -+ -+ for (i = 0; i < info->nr_rings; i++) { -+ rinfo = &info->rinfo[i]; -+ -+ gnttab_cancel_free_callback(&rinfo->callback); -+ flush_work(&rinfo->work); -+ } -+ -+ for (i = 0; i < info->nr_rings; i++) { -+ spinlock_t *lock; -+ bool busy; -+ unsigned long req_timeout_ms = 25; -+ unsigned long ring_timeout; -+ -+ rinfo = &info->rinfo[i]; -+ ring = &rinfo->ring; -+ -+ lock = &rinfo->ring_lock; -+ -+ ring_timeout = jiffies + -+ msecs_to_jiffies(req_timeout_ms * RING_SIZE(ring)); -+ -+ do { -+ spin_lock_irq(lock); -+ busy = blkfront_ring_is_busy(ring); -+ spin_unlock_irq(lock); -+ -+ if (busy) -+ msleep(req_timeout_ms); -+ else -+ break; -+ } while (time_is_after_jiffies(ring_timeout)); -+ -+ /* Timed out */ -+ if (busy) { -+ xenbus_dev_error(dev, err, "the ring is still busy"); -+ info->connected = BLKIF_STATE_CONNECTED; -+ return -EBUSY; -+ } -+ } -+ -+ /* Kick the backend to disconnect */ -+ xenbus_switch_state(dev, XenbusStateClosing); -+ -+ /* -+ * We don't want to move forward before the frontend is diconnected -+ * from the backend cleanly. -+ */ -+ timeout = wait_for_completion_timeout(&info->wait_backend_disconnected, -+ timeout); -+ if (!timeout) { -+ err = -EBUSY; -+ xenbus_dev_error(dev, err, "Freezing timed out;" -+ "the device may become inconsistent state"); -+ } -+ -+ return err; -+} -+ -+static int blkfront_restore(struct xenbus_device *dev) -+{ -+ struct blkfront_info *info = dev_get_drvdata(&dev->dev); -+ int err = 0; -+ -+ err = negotiate_mq(info); -+ if (err) -+ goto out; -+ -+ err = talk_to_blkback(dev, info); -+ if (err) -+ goto out; -+ blk_mq_update_nr_hw_queues(&info->tag_set, info->nr_rings); -+ -+out: -+ return err; -+} -+ - static const struct block_device_operations xlvbd_block_fops = - { - .owner = THIS_MODULE, -@@ -2519,6 +2664,9 @@ static struct xenbus_driver blkfront_driver = { - .resume = blkfront_resume, - .otherend_changed = blkback_changed, - .is_ready = blkfront_is_ready, -+ .freeze = blkfront_freeze, -+ .thaw = blkfront_restore, -+ .restore = blkfront_restore - }; - - static void purge_persistent_grants(struct blkfront_info *info) --- -2.39.4 - diff --git a/SPECS/91/linux/aws/0013-xen-netfront-add-callbacks-for-PM-suspend-and-hibern.patch b/SPECS/91/linux/aws/0013-xen-netfront-add-callbacks-for-PM-suspend-and-hibern.patch deleted file mode 100644 index fe3f73f416..0000000000 --- a/SPECS/91/linux/aws/0013-xen-netfront-add-callbacks-for-PM-suspend-and-hibern.patch +++ /dev/null @@ -1,210 +0,0 @@ -From 7c8c8d9d1e0f3076e7a0458debb770ee9468ac9e Mon Sep 17 00:00:00 2001 -From: Munehisa Kamata -Date: Mon, 9 Jan 2017 23:36:52 +0000 -Subject: [PATCH] xen-netfront: add callbacks for PM suspend and hibernation - support - -Add freeze and restore callbacks for PM suspend and hibernation support. -The freeze handler simply disconnects the frotnend from the backend and -frees resources associated with queues after disabling the net_device -from the system. The restore handler just changes the frontend state and -let the xenbus handler to re-allocate the resources and re-connect to the -backend. This can be performed transparently to the rest of the system. -The handlers are used for both PM suspend and hibernation so that we can -keep the existing suspend/resume callbacks for Xen suspend without -modification. Freezing netfront devices is normally expected to finish within a few -hundred milliseconds, but it can rarely take more than 5 seconds and -hit the hard coded timeout, it would depend on backend state which may -be congested and/or have complex configuration. While it's rare case, -longer default timeout seems a bit more reasonable here to avoid hitting -the timeout. Also, make it configurable via module parameter so that we -can cover broader setups than what we know currently. - -[Srinidhi Rao ported this patch to v6.6.x] - -Signed-off-by: Munehisa Kamata -Signed-off-by: Anchal Agarwal -Reviewed-by: Eduardo Valentin -Reviewed-by: Munehisa Kamata -CR: https://cr.amazon.com/r/8297632 ---- - drivers/net/xen-netfront.c | 97 +++++++++++++++++++++++++++++++++++++- - 1 file changed, 96 insertions(+), 1 deletion(-) - -diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c -index ad29f370034e..ed8c4835642a 100644 ---- a/drivers/net/xen-netfront.c -+++ b/drivers/net/xen-netfront.c -@@ -43,6 +43,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -59,6 +60,12 @@ - #include - #include - -+enum netif_freeze_state { -+ NETIF_FREEZE_STATE_UNFROZEN, -+ NETIF_FREEZE_STATE_FREEZING, -+ NETIF_FREEZE_STATE_FROZEN, -+}; -+ - /* Module parameters */ - #define MAX_QUEUES_DEFAULT 8 - static unsigned int xennet_max_queues; -@@ -72,6 +79,12 @@ MODULE_PARM_DESC(trusted, "Is the backend trusted"); - - #define XENNET_TIMEOUT (5 * HZ) - -+static unsigned int netfront_freeze_timeout_secs = 10; -+module_param_named(freeze_timeout_secs, -+ netfront_freeze_timeout_secs, uint, 0644); -+MODULE_PARM_DESC(freeze_timeout_secs, -+ "timeout when freezing netfront device in seconds"); -+ - static const struct ethtool_ops xennet_ethtool_ops; - - struct netfront_cb { -@@ -181,6 +194,10 @@ struct netfront_info { - bool bounce; - - atomic_t rx_gso_checksum_fixup; -+ -+ int freeze_state; -+ -+ struct completion wait_backend_disconnected; - }; - - struct netfront_rx_info { -@@ -909,6 +926,21 @@ static void xennet_set_rx_rsp_cons(struct netfront_queue *queue, RING_IDX val) - spin_unlock_irqrestore(&queue->rx_cons_lock, flags); - } - -+static int xennet_disable_interrupts(struct net_device *dev) -+{ -+ struct netfront_info *np = netdev_priv(dev); -+ unsigned int num_queues = dev->real_num_tx_queues; -+ unsigned int i; -+ struct netfront_queue *queue; -+ -+ for (i = 0; i < num_queues; ++i) { -+ queue = &np->queues[i]; -+ disable_irq(queue->tx_irq); -+ disable_irq(queue->rx_irq); -+ } -+ return 0; -+} -+ - static void xennet_move_rx_slot(struct netfront_queue *queue, struct sk_buff *skb, - grant_ref_t ref) - { -@@ -1718,6 +1750,8 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev) - - np->queues = NULL; - -+ init_completion(&np->wait_backend_disconnected); -+ - err = -ENOMEM; - np->rx_stats = netdev_alloc_pcpu_stats(struct netfront_stats); - if (np->rx_stats == NULL) -@@ -2246,6 +2280,50 @@ static int xennet_create_queues(struct netfront_info *info, - return 0; - } - -+static int netfront_freeze(struct xenbus_device *dev) -+{ -+ struct netfront_info *info = dev_get_drvdata(&dev->dev); -+ unsigned long timeout = netfront_freeze_timeout_secs * HZ; -+ int err = 0; -+ -+ xennet_disable_interrupts(info->netdev); -+ -+ netif_device_detach(info->netdev); -+ -+ info->freeze_state = NETIF_FREEZE_STATE_FREEZING; -+ -+ /* Kick the backend to disconnect */ -+ xenbus_switch_state(dev, XenbusStateClosing); -+ -+ /* We don't want to move forward before the frontend is diconnected -+ * from the backend cleanly. -+ */ -+ timeout = wait_for_completion_timeout(&info->wait_backend_disconnected, -+ timeout); -+ if (!timeout) { -+ err = -EBUSY; -+ xenbus_dev_error(dev, err, "Freezing timed out;" -+ "the device may become inconsistent state"); -+ return err; -+ } -+ -+ /* Tear down queues */ -+ xennet_disconnect_backend(info); -+ xennet_destroy_queues(info); -+ -+ info->freeze_state = NETIF_FREEZE_STATE_FROZEN; -+ -+ return err; -+} -+ -+static int netfront_restore(struct xenbus_device *dev) -+{ -+ /* Kick the backend to re-connect */ -+ xenbus_switch_state(dev, XenbusStateInitialising); -+ -+ return 0; -+} -+ - /* Common code used when first setting up, and when resuming. */ - static int talk_to_netback(struct xenbus_device *dev, - struct netfront_info *info) -@@ -2476,6 +2554,8 @@ static int xennet_connect(struct net_device *dev) - spin_unlock_bh(&queue->rx_lock); - } - -+ np->freeze_state = NETIF_FREEZE_STATE_UNFROZEN; -+ - return 0; - } - -@@ -2513,10 +2593,22 @@ static void netback_changed(struct xenbus_device *dev, - break; - - case XenbusStateClosed: -- if (dev->state == XenbusStateClosed) -+ if (dev->state == XenbusStateClosed) { -+ /* dpm context is waiting for the backend */ -+ if (np->freeze_state == NETIF_FREEZE_STATE_FREEZING) -+ complete(&np->wait_backend_disconnected); - break; -+ } - fallthrough; /* Missed the backend's CLOSING state */ - case XenbusStateClosing: -+ /* We may see unexpected Closed or Closing from the backend. -+ * Just ignore it not to prevent the frontend from being -+ * re-connected in the case of PM suspend or hibernation. -+ */ -+ if (np->freeze_state == NETIF_FREEZE_STATE_FROZEN && -+ dev->state == XenbusStateInitialising) { -+ break; -+ } - xenbus_frontend_closed(dev); - break; - } -@@ -2676,6 +2768,9 @@ static struct xenbus_driver netfront_driver = { - .probe = netfront_probe, - .remove = xennet_remove, - .resume = netfront_resume, -+ .freeze = netfront_freeze, -+ .thaw = netfront_restore, -+ .restore = netfront_restore, - .otherend_changed = netback_changed, - }; - --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0014-xen-time-introduce-xen_-save-restore-_steal_clock.patch b/SPECS/91/linux/aws/0014-xen-time-introduce-xen_-save-restore-_steal_clock.patch deleted file mode 100644 index dec796c77e..0000000000 --- a/SPECS/91/linux/aws/0014-xen-time-introduce-xen_-save-restore-_steal_clock.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 67e9d4914ee8dbe6466f3e499acde2e68c309aa5 Mon Sep 17 00:00:00 2001 -From: Munehisa Kamata -Date: Thu, 13 Jul 2017 07:22:39 +0000 -Subject: [PATCH] xen/time: introduce xen_{save,restore}_steal_clock - -Currently, steal time accounting code in scheduler expects steal clock -callback to provide monotonically increasing value. If the accounting -code receives a smaller value than previous one, it uses a negative -value to calculate steal time and results in incorrectly updated idle -and steal time accounting. This breaks userspace tools which read -/proc/stat. - -top - 08:05:35 up 2:12, 3 users, load average: 0.00, 0.07, 0.23 -Tasks: 80 total, 1 running, 79 sleeping, 0 stopped, 0 zombie -Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,30100.0%id, 0.0%wa, 0.0%hi, 0.0%si,-1253874204672.0%st - -This can actually happen when a Xen PVHVM guest gets restored from -hibernation, because such a restored guest is just a fresh domain from -Xen perspective and the time information in runstate info starts over -from scratch. - -This patch introduces xen_save_steal_clock() which saves current values -in runstate info into per-cpu variables. Its couterpart, -xen_restore_steal_clock(), sets offset if it found the current values in -runstate info are smaller than previous ones. xen_steal_clock() is also -modified to use the offset to ensure that scheduler only sees -monotonically increasing number. - -[Srinidhi Rao ported this patch to v6.6.x] - -Signed-off-by: Munehisa Kamata -Signed-off-by: Anchal Agarwal -Reviewed-by: Munehisa Kamata -Reviewed-by: Eduardo Valentin -CR: https://cr.amazon.com/r/8273209/ ---- - drivers/xen/time.c | 29 ++++++++++++++++++++++++++++- - include/xen/xen-ops.h | 2 ++ - 2 files changed, 30 insertions(+), 1 deletion(-) - -diff --git a/drivers/xen/time.c b/drivers/xen/time.c -index 152dd33bb223..bf41e5cf1332 100644 ---- a/drivers/xen/time.c -+++ b/drivers/xen/time.c -@@ -24,6 +24,9 @@ static DEFINE_PER_CPU(struct vcpu_runstate_info, xen_runstate); - - static DEFINE_PER_CPU(u64[4], old_runstate_time); - -+static DEFINE_PER_CPU(u64, xen_prev_steal_clock); -+static DEFINE_PER_CPU(u64, xen_steal_clock_offset); -+ - /* return an consistent snapshot of 64-bit time/counter value */ - static u64 get64(const u64 *p) - { -@@ -150,7 +153,7 @@ bool xen_vcpu_stolen(int vcpu) - return per_cpu(xen_runstate, vcpu).state == RUNSTATE_runnable; - } - --u64 xen_steal_clock(int cpu) -+static u64 __xen_steal_clock(int cpu) - { - struct vcpu_runstate_info state; - -@@ -158,6 +161,30 @@ u64 xen_steal_clock(int cpu) - return state.time[RUNSTATE_runnable] + state.time[RUNSTATE_offline]; - } - -+u64 xen_steal_clock(int cpu) -+{ -+ return __xen_steal_clock(cpu) + per_cpu(xen_steal_clock_offset, cpu); -+} -+ -+void xen_save_steal_clock(int cpu) -+{ -+ per_cpu(xen_prev_steal_clock, cpu) = xen_steal_clock(cpu); -+} -+ -+void xen_restore_steal_clock(int cpu) -+{ -+ u64 steal_clock = __xen_steal_clock(cpu); -+ -+ if (per_cpu(xen_prev_steal_clock, cpu) > steal_clock) { -+ /* Need to update the offset */ -+ per_cpu(xen_steal_clock_offset, cpu) = -+ per_cpu(xen_prev_steal_clock, cpu) - steal_clock; -+ } else { -+ /* Avoid unnecessary steal clock warp */ -+ per_cpu(xen_steal_clock_offset, cpu) = 0; -+ } -+} -+ - void xen_setup_runstate_info(int cpu) - { - struct vcpu_register_runstate_memory_area area; -diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h -index 4385b39242f6..55ec77bb8064 100644 ---- a/include/xen/xen-ops.h -+++ b/include/xen/xen-ops.h -@@ -38,6 +38,8 @@ void xen_time_setup_guest(void); - void xen_manage_runstate_time(int action); - void xen_get_runstate_snapshot(struct vcpu_runstate_info *res); - u64 xen_steal_clock(int cpu); -+void xen_save_steal_clock(int cpu); -+void xen_restore_steal_clock(int cpu); - - int xen_setup_shutdown_event(void); - --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0015-x86-xen-save-and-restore-steal-clock.patch b/SPECS/91/linux/aws/0015-x86-xen-save-and-restore-steal-clock.patch deleted file mode 100644 index cd3e81516e..0000000000 --- a/SPECS/91/linux/aws/0015-x86-xen-save-and-restore-steal-clock.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 265d8003db297d8951a0f6de4ed7a3df9efa8c6c Mon Sep 17 00:00:00 2001 -From: Munehisa Kamata -Date: Fri, 21 Jul 2017 06:06:12 +0000 -Subject: [PATCH] x86/xen: save and restore steal clock - -Save steal clock values of all present CPUs in the system core ops -suspend callbacks. Also, restore a boot CPU's steal clock in the system -core resume callback. For non-boot CPUs, restore after they're brought -up, because runstate info for non-boot CPUs are not active until then. - -[Srinidhi Rao ported this patch to v6.6.x] - -Signed-off-by: Munehisa Kamata -Signed-off-by: Anchal Agarwal -Reviewed-by: Munehisa Kamata -Reviewed-by: Eduardo Valentin -CR: https://cr.amazon.com/r/8273212/ ---- - arch/x86/xen/suspend.c | 13 ++++++++++++- - arch/x86/xen/time.c | 3 +++ - 2 files changed, 15 insertions(+), 1 deletion(-) - -diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c -index 784c4484100b..dae0f74f5390 100644 ---- a/arch/x86/xen/suspend.c -+++ b/arch/x86/xen/suspend.c -@@ -91,12 +91,20 @@ void xen_arch_suspend(void) - static int xen_syscore_suspend(void) - { - struct xen_remove_from_physmap xrfp; -- int ret; -+ int cpu, ret; - - /* Xen suspend does similar stuffs in its own logic */ - if (xen_suspend_mode_is_xen_suspend()) - return 0; - -+ for_each_present_cpu(cpu) { -+ /* -+ * Nonboot CPUs are already offline, but the last copy of -+ * runstate info is still accessible. -+ */ -+ xen_save_steal_clock(cpu); -+ } -+ - xrfp.domid = DOMID_SELF; - xrfp.gpfn = __pa(HYPERVISOR_shared_info) >> PAGE_SHIFT; - -@@ -118,6 +126,9 @@ static void xen_syscore_resume(void) - - pvclock_resume(); - -+ /* Nonboot CPUs will be resumed when they're brought up */ -+ xen_restore_steal_clock(smp_processor_id()); -+ - gnttab_resume(); - } - -diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c -index 52fa5609b7f6..82660f07e65e 100644 ---- a/arch/x86/xen/time.c -+++ b/arch/x86/xen/time.c -@@ -588,6 +588,9 @@ static void xen_hvm_setup_cpu_clockevents(void) - { - int cpu = smp_processor_id(); - xen_setup_runstate_info(cpu); -+ if (cpu) -+ xen_restore_steal_clock(cpu); -+ - /* - * xen_setup_timer(cpu) - snprintf is bad in atomic context. Hence - * doing it xen_hvm_cpu_notify (which gets called by smp_init during --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0016-xen-events-add-xen_shutdown_pirqs-helper-function.patch b/SPECS/91/linux/aws/0016-xen-events-add-xen_shutdown_pirqs-helper-function.patch deleted file mode 100644 index e317df32fa..0000000000 --- a/SPECS/91/linux/aws/0016-xen-events-add-xen_shutdown_pirqs-helper-function.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 1bf7cadccb0d02627835b9185b2a201665759861 Mon Sep 17 00:00:00 2001 -From: Munehisa Kamata -Date: Thu, 24 Aug 2017 22:54:14 +0000 -Subject: [PATCH] xen/events: add xen_shutdown_pirqs helper function - -Add a simple helper function to "shutdown" active PIRQs, which actually -closes event channels but keeps related IRQ structures intact. PM -suspend/hibernation code will rely on this. - -[Srinidhi Rao ported this patch to v6.6.x] - -Signed-off-by: Munehisa Kamata -Signed-off-by: Anchal Agarwal -Reviewed-by: Munehisa Kamata -Reviewed-by: Eduardo Valentin -CR: https://cr.amazon.com/r/8273214/ ---- - drivers/xen/events/events_base.c | 12 ++++++++++++ - include/xen/events.h | 1 + - 2 files changed, 13 insertions(+) - -diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c -index 0c5259c68ade..e402e8d12a8c 100644 ---- a/drivers/xen/events/events_base.c -+++ b/drivers/xen/events/events_base.c -@@ -2111,6 +2111,18 @@ void xen_irq_resume(void) - restore_pirqs(); - } - -+void xen_shutdown_pirqs(void) -+{ -+ struct irq_info *info; -+ -+ list_for_each_entry(info, &xen_irq_list_head, list) { -+ if (info->type != IRQT_PIRQ || !VALID_EVTCHN(info->evtchn)) -+ continue; -+ -+ shutdown_pirq(irq_get_irq_data(info->irq)); -+ } -+} -+ - static struct irq_chip xen_dynamic_chip __read_mostly = { - .name = "xen-dyn", - -diff --git a/include/xen/events.h b/include/xen/events.h -index 7488cd51fbf4..43a587b3496c 100644 ---- a/include/xen/events.h -+++ b/include/xen/events.h -@@ -85,6 +85,7 @@ static inline void notify_remote_via_evtchn(evtchn_port_t port) - void notify_remote_via_irq(int irq); - - void xen_irq_resume(void); -+void xen_shutdown_pirqs(void); - - /* Clear an irq's pending state, in preparation for polling on it */ - void xen_clear_irq_pending(int irq); --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0017-x86-xen-close-event-channels-for-PIRQs-in-system-cor.patch b/SPECS/91/linux/aws/0017-x86-xen-close-event-channels-for-PIRQs-in-system-cor.patch deleted file mode 100644 index 941398db69..0000000000 --- a/SPECS/91/linux/aws/0017-x86-xen-close-event-channels-for-PIRQs-in-system-cor.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 88c4fe5b875a2c7564738b01d2b4603124026377 Mon Sep 17 00:00:00 2001 -From: Munehisa Kamata -Date: Thu, 24 Aug 2017 22:56:36 +0000 -Subject: [PATCH] x86/xen: close event channels for PIRQs in system core - suspend callback - -Close event channels allocated for devices which are backed by PIRQ and -still active when suspending the system core. Normally, the devices are -emulated legacy devices, e.g. PS/2 keyboard, floppy controller and etc. - -Without this, in PM hibernation, information about the event channel -remains in hibernation image, but there is no guarantee that the same -event channel numbers are assigned to the devices when restoring the -system. This may cause conflict like the following and prevent some -devices from being restored correctly. - -[ 102.330821] ------------[ cut here ]------------ -[ 102.333264] WARNING: CPU: 0 PID: 2324 at -drivers/xen/events/events_base.c:878 bind_evtchn_to_irq+0x88/0xf0 -... -[ 102.348057] Call Trace: -[ 102.348057] [] dump_stack+0x63/0x84 -[ 102.348057] [] __warn+0xd1/0xf0 -[ 102.348057] [] warn_slowpath_null+0x1d/0x20 -[ 102.348057] [] bind_evtchn_to_irq+0x88/0xf0 -[ 102.348057] [] ? blkif_copy_from_grant+0xb0/0xb0 [xen_blkfront] -[ 102.348057] [] bind_evtchn_to_irqhandler+0x27/0x80 -[ 102.348057] [] talk_to_blkback+0x425/0xcd0 [xen_blkfront] -[ 102.348057] [] ? __kmalloc+0x1ea/0x200 -[ 102.348057] [] blkfront_restore+0x2d/0x60 [xen_blkfront] -[ 102.348057] [] xenbus_dev_restore+0x58/0x100 -[ 102.348057] [] ? xenbus_frontend_delayed_resume+0x20/0x20 -[ 102.348057] [] xenbus_dev_cond_restore+0x1e/0x30 -[ 102.348057] [] dpm_run_callback+0x4e/0x130 -[ 102.348057] [] device_resume+0xe7/0x210 -[ 102.348057] [] ? pm_dev_dbg+0x80/0x80 -[ 102.348057] [] dpm_resume+0x114/0x2f0 -[ 102.348057] [] hibernation_snapshot+0x15f/0x380 -[ 102.348057] [] hibernate+0x183/0x290 -[ 102.348057] [] state_store+0xcf/0xe0 -[ 102.348057] [] kobj_attr_store+0xf/0x20 -[ 102.348057] [] sysfs_kf_write+0x3a/0x50 -[ 102.348057] [] kernfs_fop_write+0x10b/0x190 -[ 102.348057] [] __vfs_write+0x28/0x120 -[ 102.348057] [] ? rw_verify_area+0x49/0xb0 -[ 102.348057] [] vfs_write+0xb2/0x1b0 -[ 102.348057] [] SyS_write+0x46/0xa0 -[ 102.348057] [] entry_SYSCALL_64_fastpath+0x1a/0xa9 -[ 102.423005] ---[ end trace b8d6718e22e2b107 ]--- -[ 102.425031] genirq: Flags mismatch irq 6. 00000000 (blkif) vs. 00000000 (floppy) - -Note that we don't explicitly re-allocate event channels for such -devices in the resume callback. Re-allocation will occur when PM core -re-enable IRQs for the devices at later point. - -[Srinidhi Rao ported this patch to v6.6.x] - -Signed-off-by: Munehisa Kamata -Signed-off-by: Anchal Agarwal -Reviewed-by: Munehisa Kamata -Reviewed-by: Eduardo Valentin -CR: https://cr.amazon.com/r/8273217/ ---- - arch/x86/xen/suspend.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c -index dae0f74f5390..affa63d4b6bd 100644 ---- a/arch/x86/xen/suspend.c -+++ b/arch/x86/xen/suspend.c -@@ -105,6 +105,8 @@ static int xen_syscore_suspend(void) - xen_save_steal_clock(cpu); - } - -+ xen_shutdown_pirqs(); -+ - xrfp.domid = DOMID_SELF; - xrfp.gpfn = __pa(HYPERVISOR_shared_info) >> PAGE_SHIFT; - --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0018-PM-hibernate-update-the-resume-offset-on-SNAPSHOT_SE.patch b/SPECS/91/linux/aws/0018-PM-hibernate-update-the-resume-offset-on-SNAPSHOT_SE.patch deleted file mode 100644 index 6256a88c9c..0000000000 --- a/SPECS/91/linux/aws/0018-PM-hibernate-update-the-resume-offset-on-SNAPSHOT_SE.patch +++ /dev/null @@ -1,46 +0,0 @@ -From af7bdda476f33609f0a2c06429c9b428dfa9391d Mon Sep 17 00:00:00 2001 -From: Aleksei Besogonov -Date: Fri, 27 Oct 2017 17:59:18 +0000 -Subject: [PATCH] PM / hibernate: update the resume offset on - SNAPSHOT_SET_SWAP_AREA - -The SNAPSHOT_SET_SWAP_AREA is supposed to be used to set the hibernation -offset on a running kernel to enable hibernating to a swap file. -However, it doesn't actually update the swsusp_resume_block variable. As -a result, the hibernation fails at the last step (after all the data is -written out) in the validation of the swap signature in -mark_swapfiles(). - -Before this patch, the command line processing was the only place where -swsusp_resume_block was set. - -[Srinidhi Rao ported this patch to v6.6.x] - -Signed-off-by: Aleksei Besogonov -Signed-off-by: Munehisa Kamata -Signed-off-by: Anchal Agarwal -Reviewed-by: Munehisa Kamata -Reviewed-by: Eduardo Valentin -CR: https://cr.amazon.com/r/8297650/ ---- - kernel/power/user.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/kernel/power/user.c b/kernel/power/user.c -index 3a4e70366f35..0d9a3f899c38 100644 ---- a/kernel/power/user.c -+++ b/kernel/power/user.c -@@ -243,6 +243,10 @@ static int snapshot_set_swap_area(struct snapshot_data *data, - if (data->swap < 0) - return swdev ? -ENODEV : -EINVAL; - data->dev = swdev; -+ -+ swsusp_resume_device = swdev; -+ swsusp_resume_block = offset; -+ - return 0; - } - --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0020-xen-blkfront-Fixed-blkfront_restore-to-remove-a-call.patch b/SPECS/91/linux/aws/0020-xen-blkfront-Fixed-blkfront_restore-to-remove-a-call.patch deleted file mode 100644 index c5bb4ae445..0000000000 --- a/SPECS/91/linux/aws/0020-xen-blkfront-Fixed-blkfront_restore-to-remove-a-call.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 3a1bac6fd8360dfce0f0a9826efda25c2f8130fe Mon Sep 17 00:00:00 2001 -From: Anchal Agarwal -Date: Tue, 5 Jun 2018 20:51:31 +0000 -Subject: [PATCH] xen-blkfront: Fixed blkfront_restore to remove a call to - negotiate_mq - -The code for talk_to_blkback API changed in kernel-4.14.45 to include a call to -negotiate_mq. Subsequent calls causes kernel panic -[ 84.440105] Call Trace: -[ 84.443707] talk_to_blkback+0x6d/0x8b0 [xen_blkfront] -[ 84.449147] blkfront_restore+0x33/0x60 [xen_blkfront] -[ 84.453336] ? xenbus_read_otherend_details+0x50/0xb0 -[ 84.457804] xenbus_dev_cancel+0x5f/0x160 -[ 84.463286] ? xenbus_dev_resume+0x170/0x170 -[ 84.466891] dpm_run_callback+0x3b/0x100 -[ 84.470516] device_resume+0x10d/0x420 -[ 84.473844] dpm_resume+0xfd/0x2f0 -[ 84.476984] hibernation_snapshot+0x218/0x410 -[ 84.480794] hibernate+0x14b/0x270 -[ 84.484030] state_store+0x50/0x60 -[ 84.487443] kernfs_fop_write+0x105/0x180 -[ 84.492695] __vfs_write+0x36/0x160 -[ 84.496672] ? __audit_syscall_entry+0xbc/0x110 -[ 84.502123] vfs_write+0xad/0x1a0 -[ 84.506857] SyS_write+0x52/0xc0 -[ 84.511420] do_syscall_64+0x67/0x100 -[ 84.516365] entry_SYSCALL_64_after_hwframe+0x3d/0xa2 -[ 84.522571] RIP: 0033:0x7f44a03407e4 -[ 84.526210] RSP: 002b:00007ffd5e0ec3c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 -[ 84.534041] RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f44a03407e4 -[ 84.542571] RDX: 0000000000000004 RSI: 0000000001e94990 RDI: 0000000000000001 -[ 84.549142] RBP: 0000000001e94990 R08: 00007f44a060c8c0 R09: 00007f44a0c57740 -[ 84.554658] R10: 00007f44a03cd320 R11: 0000000000000246 R12: 0000000000000004 -[ 84.560411] R13: 0000000000000001 R14: 00007f44a060b760 R15: 0000000000000004 -[ 84.565744] Code: 39 ab e8 00 00 00 77 8a 31 c0 5b 5d c3 44 8b 05 50 57 00 00 45 85 c0 0f 84 2f ff ff ff 89 c0 48 69 f8 e0 40 01 00 e9 30 ff ff ff <0f> 0b 48 8b 7b 28 48 c7 c2 78 58 16 a0 be f4 ff ff ff e8 7e 37 -[ 84.580594] RIP: negotiate_mq+0x12b/0x150 [xen_blkfront] RSP: ffffc90000ebbc70 - -[Srinidhi Rao ported this patch to v6.6.x] - -Signed-off-by: Anchal Agarwal -Reviewed-by: Frank van der Linden -Reviewed-by: Vallish Vaidyeshwara ---- - drivers/block/xen-blkfront.c | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c -index 29aabc49db20..098dd0968295 100644 ---- a/drivers/block/xen-blkfront.c -+++ b/drivers/block/xen-blkfront.c -@@ -2628,11 +2628,6 @@ static int blkfront_restore(struct xenbus_device *dev) - { - struct blkfront_info *info = dev_get_drvdata(&dev->dev); - int err = 0; -- -- err = negotiate_mq(info); -- if (err) -- goto out; -- - err = talk_to_blkback(dev, info); - if (err) - goto out; --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0021-x86-tsc-avoid-system-instability-in-hibernation.patch b/SPECS/91/linux/aws/0021-x86-tsc-avoid-system-instability-in-hibernation.patch deleted file mode 100644 index 3a6934d336..0000000000 --- a/SPECS/91/linux/aws/0021-x86-tsc-avoid-system-instability-in-hibernation.patch +++ /dev/null @@ -1,147 +0,0 @@ -From c56b6a9d0b7119b3b8aafb72a781c2c6c1eb2306 Mon Sep 17 00:00:00 2001 -From: Eduardo Valentin -Date: Mon, 9 Apr 2018 20:50:29 +0000 -Subject: [PATCH] x86: tsc: avoid system instability in hibernation - -System instability are seen during resume from hibernation when system -is under heavy CPU load. This is due to the lack of update of sched -clock data, and the scheduler would then think that heavy CPU hog -tasks need more time in CPU, causing the system to freeze -during the unfreezing of tasks. For example, threaded irqs, -and kernel processes servicing network interface may be delayed -for several tens of seconds, causing the system to be unreachable. - -Situation like this can be reported by using lockup detectors -such as workqueue lockup detectors: - -[root@ip-172-31-67-114 ec2-user]# echo disk > /sys/power/state - -Message from syslogd@ip-172-31-67-114 at May 7 18:23:21 ... - kernel:BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 57s! - -Message from syslogd@ip-172-31-67-114 at May 7 18:23:21 ... - kernel:BUG: workqueue lockup - pool cpus=1 node=0 flags=0x0 nice=0 stuck for 57s! - -Message from syslogd@ip-172-31-67-114 at May 7 18:23:21 ... - kernel:BUG: workqueue lockup - pool cpus=3 node=0 flags=0x1 nice=0 stuck for 57s! - -Message from syslogd@ip-172-31-67-114 at May 7 18:29:06 ... - kernel:BUG: workqueue lockup - pool cpus=3 node=0 flags=0x1 nice=0 stuck for 403s! - -The fix for this situation is to mark the sched clock as unstable -as early as possible in the resume path, leaving it unstable -for the duration of the resume process. This will force the -scheduler to attempt to align the sched clock across CPUs using -the delta with time of day, updating sched clock data. In a post -hibernation event, we can then mark the sched clock as stable -again, avoiding unnecessary syncs with time of day on systems -in which TSC is reliable. - -[Srinidhi Rao ported this patch to v6.6.x] - -Reviewed-by: Erik Quanstrom -Reviewed-by: Frank van der Linden -Reviewed-by: Balbir Singh -Reviewed-by: Munehisa Kamata -Tested-by: Anchal Agarwal -Signed-off-by: Eduardo Valentin - -CR: https://cr.amazon.com/r/8440112/ ---- - arch/x86/kernel/tsc.c | 29 +++++++++++++++++++++++++++++ - include/linux/sched/clock.h | 5 +++++ - kernel/sched/clock.c | 4 ++-- - 3 files changed, 36 insertions(+), 2 deletions(-) - -diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c -index 15f97c0abc9d..40161f8aff88 100644 ---- a/arch/x86/kernel/tsc.c -+++ b/arch/x86/kernel/tsc.c -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -1650,3 +1651,31 @@ unsigned long calibrate_delay_is_known(void) - return 0; - } - #endif -+ -+static int tsc_pm_notifier(struct notifier_block *notifier, -+ unsigned long pm_event, void *unused) -+{ -+ switch (pm_event) { -+ case PM_HIBERNATION_PREPARE: -+ clear_sched_clock_stable(); -+ break; -+ case PM_POST_HIBERNATION: -+ /* Set back to the default */ -+ if (!check_tsc_unstable()) -+ set_sched_clock_stable(); -+ break; -+ } -+ -+ return 0; -+}; -+ -+static struct notifier_block tsc_pm_notifier_block = { -+ .notifier_call = tsc_pm_notifier, -+}; -+ -+static int tsc_setup_pm_notifier(void) -+{ -+ return register_pm_notifier(&tsc_pm_notifier_block); -+} -+ -+subsys_initcall(tsc_setup_pm_notifier); -diff --git a/include/linux/sched/clock.h b/include/linux/sched/clock.h -index 196f0ca351a2..811b8ebb57a5 100644 ---- a/include/linux/sched/clock.h -+++ b/include/linux/sched/clock.h -@@ -41,6 +41,10 @@ static inline void clear_sched_clock_stable(void) - { - } - -+static inline void set_sched_clock_stable(void) -+{ -+} -+ - static inline void sched_clock_idle_sleep_event(void) - { - } -@@ -65,6 +69,7 @@ static __always_inline u64 local_clock(void) - } - #else - extern int sched_clock_stable(void); -+extern void set_sched_clock_stable(void); - extern void clear_sched_clock_stable(void); - - /* -diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c -index 3c6193de9cde..c2a488a667f1 100644 ---- a/kernel/sched/clock.c -+++ b/kernel/sched/clock.c -@@ -114,7 +114,7 @@ notrace static void __scd_stamp(struct sched_clock_data *scd) - scd->tick_raw = sched_clock(); - } - --notrace static void __set_sched_clock_stable(void) -+notrace void set_sched_clock_stable(void) - { - struct sched_clock_data *scd; - -@@ -234,7 +234,7 @@ static int __init sched_clock_init_late(void) - smp_mb(); /* matches {set,clear}_sched_clock_stable() */ - - if (__sched_clock_stable_early) -- __set_sched_clock_stable(); -+ set_sched_clock_stable(); - - return 0; - } --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0022-block-xen-blkfront-consider-new-dom0-features-on-res.patch b/SPECS/91/linux/aws/0022-block-xen-blkfront-consider-new-dom0-features-on-res.patch deleted file mode 100644 index a7db40fefe..0000000000 --- a/SPECS/91/linux/aws/0022-block-xen-blkfront-consider-new-dom0-features-on-res.patch +++ /dev/null @@ -1,84 +0,0 @@ -From d817bbdf710ee1b737cf33bbdc212fb3a90e93a7 Mon Sep 17 00:00:00 2001 -From: Eduardo Valentin -Date: Thu, 18 Oct 2018 22:13:48 +0000 -Subject: [PATCH] block: xen-blkfront: consider new dom0 features on restore - -On regular start, the instance will perform a regular boot, in which rootfs -is mounted accordingly to the xen-blkback features (in particular -feature-barrier and feature-flush-cache). That will setup the journal -accordingly to the provided features on SB. -On a start from hibernation, the instance boots, detects that a hibernation -image is present, push the image to memory and jumps back where it was. There -is no regular mount of the rootfs, it uses the data structures already in -the previous saved memory image. -Now, When the instance hibernates, it may move from its original dom0 to a new dom0 -when it is restarted. -So, given the above, if the xen-blkback features change then the guest -can be in trouble. And I see the original assumption was that the -dom0 environment would be preserved. I did a couple of experiments, -and I confirm that these particular features change quite a lot across -hibernation attempts: -[ 2343.157903] blkfront: xvda: barrier or flush: disabled; persistent grants: disabled; indirect descriptors: enabled; -[ 2444.712339] blkfront: xvda: barrier or flush: disabled; persistent grants: disabled; indirect descriptors: enabled; -[ 2537.105884] blkfront: xvda: flush diskcache: enabled; persistent grants: disabled; indirect descriptors: enabled; -[ 2636.641298] blkfront: xvda: barrier or flush: disabled; persistent grants: disabled; indirect descriptors: enabled; -[ 2729.868349] blkfront: xvda: flush diskcache: enabled; persistent grants: disabled; indirect descriptors: enabled; -[ 2827.118979] blkfront: xvda: flush diskcache: enabled; persistent grants: disabled; indirect descriptors: enabled; -[ 2924.812599] blkfront: xvda: flush diskcache: enabled; persistent grants: disabled; indirect descriptors: enabled; -[ 3018.063399] blkfront: xvda: flush diskcache: enabled; persistent grants: disabled; indirect descriptors: enabled; -[ 3116.685040] blkfront: xvda: flush diskcache: enabled; persistent grants: disabled; indirect descriptors: enabled; -[ 3209.164475] blkfront: xvda: barrier or flush: disabled; persistent grants: disabled; indirect descriptors: enabled; -[ 3317.981362] blkfront: xvda: barrier or flush: disabled; persistent grants: disabled; indirect descriptors: enabled; -[ 3415.939725] blkfront: xvda: flush diskcache: enabled; persistent grants: disabled; indirect descriptors: enabled; -[ 3514.202478] blkfront: xvda: barrier or flush: disabled; persistent grants: disabled; indirect descriptors: enabled; -[ 3619.355791] blkfront: xvda: barrier or flush: disabled; persistent grants: disabled; indirect descriptors: enabled; - -Now, considering the above, this patch fixes the following scenario: -a. Instance boots and sets up bio queue on a dom0 A with softbarrier supported. -b. hibernates -c. When asked to restore, the instance is back on dom0 B with unsupported -softbarrier. -d. Restoration goes well until next journal commit is issued. Remember that -it is still using the previous image rootfs data structures, therefore -is gonna request a softbarrier. -e. The bio will error out and throw a "operation not supported" message -and cause the journal to fail, and it will decide to remount -the rootfs as RO. -[ 1138.909290] print_req_error: operation not supported error, dev xvda, sector 4470400, flags 6008 -[ 1139.025685] Aborting journal on device xvda1-8. -[ 1139.029758] print_req_error: operation not supported error, dev xvda, sector 4460544, flags 26008 -[ 1139.326119] Buffer I/O error on dev xvda1, logical block 0, lost sync page write -[ 1139.331398] EXT4-fs error (device xvda1): ext4_journal_check_start:61: Detected aborted journal -[ 1139.337296] EXT4-fs (xvda1): Remounting filesystem read-only -[ 1139.341006] EXT4-fs (xvda1): previous I/O error to superblock detected -[ 1139.345704] print_req_error: operation not supported error, dev xvda, sector 4096, flags 26008 - -The fix is essentially to read xenbus to query the new xen -blkback capabilities and update them into the request queue. - -[Srinidhi Rao ported this patch to v6.6.x] - -Reviewed-by: Balbir Singh -Reviewed-by: Vallish Vaidyeshwara -Signed-off-by: Eduardo Valentin ---- - drivers/block/xen-blkfront.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c -index 098dd0968295..59cd44ccea8f 100644 ---- a/drivers/block/xen-blkfront.c -+++ b/drivers/block/xen-blkfront.c -@@ -2628,6 +2628,9 @@ static int blkfront_restore(struct xenbus_device *dev) - { - struct blkfront_info *info = dev_get_drvdata(&dev->dev); - int err = 0; -+ -+ blkfront_gather_backend_features(info); -+ xlvbd_flush(info); - err = talk_to_blkback(dev, info); - if (err) - goto out; --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0023-xen-restore-pirqs-on-resume-from-hibernation.patch b/SPECS/91/linux/aws/0023-xen-restore-pirqs-on-resume-from-hibernation.patch deleted file mode 100644 index 6750643ac1..0000000000 --- a/SPECS/91/linux/aws/0023-xen-restore-pirqs-on-resume-from-hibernation.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 02d077b9b46f6ac8982a45e9c3e2273e3d3c9c54 Mon Sep 17 00:00:00 2001 -From: Frank van der Linden -Date: Fri, 26 Oct 2018 21:27:54 +0000 -Subject: [PATCH] xen: restore pirqs on resume from hibernation. - -The hibernation code unlinks event channels from these (legacy) IRQs, so they -must be reinitialized on wakeup, much like in the Xen suspend/resume case. - -[Srinidhi Rao ported this patch to v6.6.x] - -Signed-off-by: Frank van der Linden -Reviewed-by: Cristian Gafton -Reviewed-by: Anchal Agarwal -Reviewed-by: Alakesh Haloi - -CR: https://code.amazon.com/reviews/CR-3702953/ ---- - arch/x86/xen/suspend.c | 2 ++ - drivers/xen/events/events_base.c | 5 +++++ - include/xen/events.h | 1 + - 3 files changed, 8 insertions(+) - -diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c -index affa63d4b6bd..39644923b623 100644 ---- a/arch/x86/xen/suspend.c -+++ b/arch/x86/xen/suspend.c -@@ -132,6 +132,8 @@ static void xen_syscore_resume(void) - xen_restore_steal_clock(smp_processor_id()); - - gnttab_resume(); -+ -+ xen_restore_pirqs(); - } - - /* -diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c -index e402e8d12a8c..913563dbc5d1 100644 ---- a/drivers/xen/events/events_base.c -+++ b/drivers/xen/events/events_base.c -@@ -2123,6 +2123,11 @@ void xen_shutdown_pirqs(void) - } - } - -+void xen_restore_pirqs(void) -+{ -+ restore_pirqs(); -+} -+ - static struct irq_chip xen_dynamic_chip __read_mostly = { - .name = "xen-dyn", - -diff --git a/include/xen/events.h b/include/xen/events.h -index 43a587b3496c..52c9b51cc303 100644 ---- a/include/xen/events.h -+++ b/include/xen/events.h -@@ -86,6 +86,7 @@ void notify_remote_via_irq(int irq); - - void xen_irq_resume(void); - void xen_shutdown_pirqs(void); -+void xen_restore_pirqs(void); - - /* Clear an irq's pending state, in preparation for polling on it */ - void xen_clear_irq_pending(int irq); --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0024-xen-Only-restore-the-ACPI-SCI-interrupt-in-xen_resto.patch b/SPECS/91/linux/aws/0024-xen-Only-restore-the-ACPI-SCI-interrupt-in-xen_resto.patch deleted file mode 100644 index 9fc815e0a1..0000000000 --- a/SPECS/91/linux/aws/0024-xen-Only-restore-the-ACPI-SCI-interrupt-in-xen_resto.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 183fc10543a956143d1b61fd876ba65ea0bcfa76 Mon Sep 17 00:00:00 2001 -From: Frank van der Linden -Date: Sat, 10 Nov 2018 00:18:32 +0000 -Subject: [PATCH] xen: Only restore the ACPI SCI interrupt in - xen_restore_pirqs. - -Restoring all PIRQs, which is the right thing to do, was causing problems -on larger instances. This is a horrible workaround until this issue is fully -understood. - -[Srinidhi Rao ported this patch to v6.6.x] - -Signed-off-by: Frank van der Linden -Reviewed-by: Alakesh Haloi -Reviewed-by: Anchal Agarwal -Reviewed-by: Qian Lu ---- - drivers/xen/events/events_base.c | 42 +++++++++++++++++++++++++++++++- - 1 file changed, 41 insertions(+), 1 deletion(-) - -diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c -index 913563dbc5d1..3f1b588536a8 100644 ---- a/drivers/xen/events/events_base.c -+++ b/drivers/xen/events/events_base.c -@@ -68,6 +68,10 @@ - #include - #include - -+#ifdef CONFIG_ACPI -+#include -+#endif -+ - #include "events_internal.h" - - #undef MODULE_PARAM_PREFIX -@@ -2123,9 +2127,45 @@ void xen_shutdown_pirqs(void) - } - } - -+/* -+ * For now, only restore the ACPI SCI pirq. -+ */ - void xen_restore_pirqs(void) - { -- restore_pirqs(); -+#ifdef CONFIG_ACPI -+ int pirq, rc, irq, gsi; -+ struct physdev_map_pirq map_irq; -+ struct irq_info *info; -+ -+ list_for_each_entry(info, &xen_irq_list_head, list) { -+ if (info->type != IRQT_PIRQ) -+ continue; -+ -+ pirq = info->u.pirq.pirq; -+ gsi = info->u.pirq.gsi; -+ irq = info->irq; -+ -+ if (gsi != acpi_gbl_FADT.sci_interrupt) -+ continue; -+ -+ map_irq.domid = DOMID_SELF; -+ map_irq.type = MAP_PIRQ_TYPE_GSI; -+ map_irq.index = gsi; -+ map_irq.pirq = pirq; -+ -+ rc = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_irq); -+ if (rc) { -+ pr_warn("xen: ACPI SCI interrupt map failed, rc=%d\n", -+ rc); -+ xen_free_irq(irq); -+ continue; -+ } -+ -+ printk(KERN_DEBUG "xen: restored ACPI SCI interrupt\n"); -+ -+ __startup_pirq(irq); -+ } -+#endif - } - - static struct irq_chip xen_dynamic_chip __read_mostly = { --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0026-xen-netfront-call-netif_device_attach-on-resume.patch b/SPECS/91/linux/aws/0026-xen-netfront-call-netif_device_attach-on-resume.patch deleted file mode 100644 index 0904e2122e..0000000000 --- a/SPECS/91/linux/aws/0026-xen-netfront-call-netif_device_attach-on-resume.patch +++ /dev/null @@ -1,39 +0,0 @@ -From b8f3d23f8a8f4e98cef9fcf80eac0baceed2b65a Mon Sep 17 00:00:00 2001 -From: Frank van der Linden -Date: Thu, 31 Jan 2019 21:50:37 +0000 -Subject: [PATCH] xen-netfront: call netif_device_attach on resume - -When xennet_connect is called in the resume path, it needs -to re-attach the netif, otherwise it will no longer be -found by various operations (such as ethtool ioctls, etc). - -[Srinidhi Rao ported this patch to v6.6.x] - -Signed-off-by: Frank van der Linden -Reviewed-by: Alakesh Haloi -Reviewed-by: Vallish Vaidyeshwara ---- - drivers/net/xen-netfront.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c -index ed8c4835642a..6351f1d52ae9 100644 ---- a/drivers/net/xen-netfront.c -+++ b/drivers/net/xen-netfront.c -@@ -2525,6 +2525,13 @@ static int xennet_connect(struct net_device *dev) - device_unregister(&np->xbdev->dev); - return err; - } -+ } else { -+ /* -+ * In the resume / thaw case, the netif needs to be -+ * reattached, as it was detached in netfront_freeze(). -+ */ -+ if (np->freeze_state == NETIF_FREEZE_STATE_FROZEN) -+ netif_device_attach(dev); - } - - rtnl_lock(); --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0054-xen-Restore-xen-pirqs-on-resume-from-hibernation.patch b/SPECS/91/linux/aws/0054-xen-Restore-xen-pirqs-on-resume-from-hibernation.patch deleted file mode 100644 index 34c1744f27..0000000000 --- a/SPECS/91/linux/aws/0054-xen-Restore-xen-pirqs-on-resume-from-hibernation.patch +++ /dev/null @@ -1,142 +0,0 @@ -From 426c9d410d1797700d8127eb7e9e600c997694e2 Mon Sep 17 00:00:00 2001 -From: Anchal Agarwal -Date: Thu, 15 Aug 2019 22:26:27 +0000 -Subject: [PATCH] xen: Restore xen-pirqs on resume from hibernation - -shutdown_pirq is invoked during hibernation path and hence -PIRQs should be restarted during resume. [Commit: xen: Only -restore the ACPI SCI interrupt in xen_restore_pirqs] restores -only ACPI SCI interrupt however, that is not the right thing -to do as all pirqs should be enabled as a part of -resume_device_irqs during suspend/resume device interrupts. -Apparently, chip->irq_startup is called only if IRQD_IRQ_STARTED -is unset during irq_startup on resume. This flag gets cleared by -free_irq->irq_shutdown during suspend. - -free_irq() never gets explicitly called for ioapic-edge and -ioapic-level interrupts as respective drivers do nothing during -suspend/resume. So we shut them down explicitly in the first place -in syscore_suspend path to clear IRQ<>event channel mapping. -shutdown_pirq being called explicitly during suspend does not -clear this flags, hence .irq_enable is called in irq_startup -during resume instead and pirq's never start up. - -This commit exports irq_state_clr_started API to clear the flag -during shutdown_pirq. Also, following the order in which -ipis/virqs/pirqs are restored during xen resume, the same order -should be followed for hibernation path. As per the flow of -hibernation_platform_enter, we should not restore pirqs explicitly -in syscore_resume ops and it should be done in resume devices path. - -[Srinidhi Rao ported this patch to v6.6.x] - -Signed-off-by: Anchal Agarwal ---- - arch/x86/xen/suspend.c | 1 - - drivers/xen/events/events_base.c | 42 +------------------------------- - include/linux/irq.h | 2 ++ - kernel/irq/chip.c | 4 +-- - 4 files changed, 5 insertions(+), 44 deletions(-) - -diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c -index 39644923b623..8be6ffa6bfbe 100644 ---- a/arch/x86/xen/suspend.c -+++ b/arch/x86/xen/suspend.c -@@ -133,7 +133,6 @@ static void xen_syscore_resume(void) - - gnttab_resume(); - -- xen_restore_pirqs(); - } - - /* -diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c -index 3f1b588536a8..c5f1ecde2156 100644 ---- a/drivers/xen/events/events_base.c -+++ b/drivers/xen/events/events_base.c -@@ -2124,50 +2124,10 @@ void xen_shutdown_pirqs(void) - continue; - - shutdown_pirq(irq_get_irq_data(info->irq)); -+ irq_state_clr_started(irq_to_desc(info->irq)); - } - } - --/* -- * For now, only restore the ACPI SCI pirq. -- */ --void xen_restore_pirqs(void) --{ --#ifdef CONFIG_ACPI -- int pirq, rc, irq, gsi; -- struct physdev_map_pirq map_irq; -- struct irq_info *info; -- -- list_for_each_entry(info, &xen_irq_list_head, list) { -- if (info->type != IRQT_PIRQ) -- continue; -- -- pirq = info->u.pirq.pirq; -- gsi = info->u.pirq.gsi; -- irq = info->irq; -- -- if (gsi != acpi_gbl_FADT.sci_interrupt) -- continue; -- -- map_irq.domid = DOMID_SELF; -- map_irq.type = MAP_PIRQ_TYPE_GSI; -- map_irq.index = gsi; -- map_irq.pirq = pirq; -- -- rc = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_irq); -- if (rc) { -- pr_warn("xen: ACPI SCI interrupt map failed, rc=%d\n", -- rc); -- xen_free_irq(irq); -- continue; -- } -- -- printk(KERN_DEBUG "xen: restored ACPI SCI interrupt\n"); -- -- __startup_pirq(irq); -- } --#endif --} -- - static struct irq_chip xen_dynamic_chip __read_mostly = { - .name = "xen-dyn", - -diff --git a/include/linux/irq.h b/include/linux/irq.h -index 90081afa10ce..c79f470d5e17 100644 ---- a/include/linux/irq.h -+++ b/include/linux/irq.h -@@ -812,6 +812,8 @@ extern int irq_set_msi_desc_off(unsigned int irq_base, unsigned int irq_offset, - struct msi_desc *entry); - extern struct irq_data *irq_get_irq_data(unsigned int irq); - -+extern void irq_state_clr_started(struct irq_desc *desc); -+ - static inline struct irq_chip *irq_get_chip(unsigned int irq) - { - struct irq_data *d = irq_get_irq_data(irq); -diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c -index dc94e0bf2c94..29e20445fc5a 100644 ---- a/kernel/irq/chip.c -+++ b/kernel/irq/chip.c -@@ -170,11 +170,11 @@ static void irq_state_clr_masked(struct irq_desc *desc) - irqd_clear(&desc->irq_data, IRQD_IRQ_MASKED); - } - --static void irq_state_clr_started(struct irq_desc *desc) -+void irq_state_clr_started(struct irq_desc *desc) - { - irqd_clear(&desc->irq_data, IRQD_IRQ_STARTED); - } -- -+EXPORT_SYMBOL_GPL(irq_state_clr_started); - static void irq_state_set_started(struct irq_desc *desc) - { - irqd_set(&desc->irq_data, IRQD_IRQ_STARTED); --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0055-block-xen-blkfront-bump-the-maximum-number-of-indire.patch b/SPECS/91/linux/aws/0055-block-xen-blkfront-bump-the-maximum-number-of-indire.patch deleted file mode 100644 index 690909b2e6..0000000000 --- a/SPECS/91/linux/aws/0055-block-xen-blkfront-bump-the-maximum-number-of-indire.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 4aa5c7e978bd910835e02bc4545cd4c48a2f9088 Mon Sep 17 00:00:00 2001 -From: Frank van der Linden -Date: Wed, 27 Nov 2019 22:14:28 +0000 -Subject: [PATCH] block/xen-blkfront: bump the maximum number of indirect - segments up to 64 - -Bump the maximum number of indirect segments up to 64. For blk-mq without -a scheduler, which is the default for multi-queued devices, this is needed -to avoid a throughput regression for 'st1' EBS volumes. - -On a c4.8xlarge instance: - -sudo fio --bs=1M --name=seqread --ioengine=libaio --rw=read --direct=1 --filename=/dev/sdg --clocksource=clock_gettime --size=1G --numjobs=8 - -before: -READ: io=8192.0MB, aggrb=44772KB/s, minb=5596KB/s, maxb=5922KB/s, mint=177050msec, maxt=187361msec - -after: -READ: io=8192.0MB, aggrb=136059KB/s, minb=17007KB/s, maxb=17022KB/s, mint=61600msec, maxt=61654msec - -[Srinidhi Rao ported this patch to v6.6.x] - -Signed-off-by: Frank van der Linden ---- - drivers/block/xen-blkfront.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c -index 59cd44ccea8f..9ae10a83a7a9 100644 ---- a/drivers/block/xen-blkfront.c -+++ b/drivers/block/xen-blkfront.c -@@ -139,7 +139,7 @@ static LIST_HEAD(info_list); - * by the backend driver. - */ - --static unsigned int xen_blkif_max_segments = 32; -+static unsigned int xen_blkif_max_segments = 64; - module_param_named(max_indirect_segments, xen_blkif_max_segments, uint, 0444); - MODULE_PARM_DESC(max_indirect_segments, - "Maximum amount of segments in indirect requests (default is 32)"); --- -2.35.6 - diff --git a/SPECS/91/linux/aws/0185-Introduce-page-touching-DMA-ops-binding.patch b/SPECS/91/linux/aws/0185-Introduce-page-touching-DMA-ops-binding.patch deleted file mode 100644 index e0df44f2b8..0000000000 --- a/SPECS/91/linux/aws/0185-Introduce-page-touching-DMA-ops-binding.patch +++ /dev/null @@ -1,283 +0,0 @@ -From c12a67a2da199593250454127c011beb98d457f1 Mon Sep 17 00:00:00 2001 -From: James Gowans -Date: Fri, 17 Sep 2021 00:45:10 +0200 -Subject: [PATCH] Introduce page touching DMA ops binding - -Allows enabling page touching via a kernel command line parameter. -When enabled, devices which don't have an IOMMU assigned to them will be -assigned the page touching DMA map ops which ensures that any memory -mapped for DMA by that devices will be accessed by the CPU to make it -resident. - -Signed-off-by: James Gowans -Cc-Team: kaos-brimstone -Cc-Team: ec2-memo ---- - MAINTAINERS | 7 ++ - arch/arm64/mm/dma-mapping.c | 6 ++ - include/linux/dma-page-touching.h | 39 +++++++++ - kernel/dma/Kconfig | 10 +++ - kernel/dma/Makefile | 1 + - kernel/dma/page_touching.c | 134 ++++++++++++++++++++++++++++++ - 6 files changed, 197 insertions(+) - create mode 100644 include/linux/dma-page-touching.h - create mode 100644 kernel/dma/page_touching.c - -diff --git a/MAINTAINERS b/MAINTAINERS -index cc40a9d9b8cd..60eec7214654 100644 ---- a/MAINTAINERS -+++ b/MAINTAINERS -@@ -17293,6 +17293,13 @@ F: Documentation/mm/page_table_check.rst - F: include/linux/page_table_check.h - F: mm/page_table_check.c - -+PAGE TOUCHING DMA -+M: James Gowans -+L: ec2-memo@amazon.com -+S: Supported -+F: include/linux/dma-page-touching.h -+F: kernel/dma/page_touching.c -+ - PANASONIC LAPTOP ACPI EXTRAS DRIVER - M: Kenneth Chan - L: platform-driver-x86@vger.kernel.org -diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c -index b2b5792b2caa..0803b3652cd7 100644 ---- a/arch/arm64/mm/dma-mapping.c -+++ b/arch/arm64/mm/dma-mapping.c -@@ -8,6 +8,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -51,4 +52,9 @@ void arch_setup_dma_ops(struct device *dev, bool coherent) - dev->dma_coherent = coherent; - - xen_setup_dma_ops(dev); -+ -+#ifdef CONFIG_DMA_PAGE_TOUCHING -+ if (!dev->dma_ops) -+ setup_dma_page_touching_ops(dev); -+#endif - } -diff --git a/include/linux/dma-page-touching.h b/include/linux/dma-page-touching.h -new file mode 100644 -index 000000000000..8ff9856e994c ---- /dev/null -+++ b/include/linux/dma-page-touching.h -@@ -0,0 +1,39 @@ -+/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */ -+/* -+ * Copyright 2021 Amazon.com, Inc. or its affiliates. -+ * -+ * This software is available to you under a choice of one of two -+ * licenses. You may choose to be licensed under the terms of the GNU -+ * General Public License (GPL) Version 2, available from the file -+ * COPYING in the main directory of this source tree, or the -+ * BSD license below: -+ * -+ * Redistribution and use in source and binary forms, with or -+ * without modification, are permitted provided that the following -+ * conditions are met: -+ * -+ * - Redistributions of source code must retain the above -+ * copyright notice, this list of conditions and the following -+ * disclaimer. -+ * -+ * - Redistributions in binary form must reproduce the above -+ * copyright notice, this list of conditions and the following -+ * disclaimer in the documentation and/or other materials -+ * provided with the distribution. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ * SOFTWARE. -+ */ -+ -+/* -+ * Sets the supplied device's DMA ops to the page toucing DMA ops if -+ * page touching is enabled and the device does not already have -+ * DMA ops assigned. -+ */ -+void setup_dma_page_touching_ops(struct device *dev); -diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig -index c06e56be0ca1..83ebf96a1fe2 100644 ---- a/kernel/dma/Kconfig -+++ b/kernel/dma/Kconfig -@@ -24,6 +24,16 @@ config DMA_OPS_BYPASS - config ARCH_HAS_DMA_MAP_DIRECT - bool - -+config DMA_PAGE_TOUCHING -+ bool "Support touching pages when allocated for DMA" -+ help -+ Builds in support for binding page touching DMA ops to devices which -+ don't have an IOMMU. Memory mapped for DMA by those devices will be -+ access by the CPU via the page touching dma_map_ops to ensure that -+ the memory is resident when running on a memory overcommit host. -+ The capacility must still be set up at boot time via the -+ page_touching.dma_page_touching_enable kernel command line param. -+ - config NEED_SG_DMA_FLAGS - bool - -diff --git a/kernel/dma/Makefile b/kernel/dma/Makefile -index 21926e46ef4f..c552b9831f5b 100644 ---- a/kernel/dma/Makefile -+++ b/kernel/dma/Makefile -@@ -10,3 +10,4 @@ obj-$(CONFIG_SWIOTLB) += swiotlb.o - obj-$(CONFIG_DMA_COHERENT_POOL) += pool.o - obj-$(CONFIG_MMU) += remap.o - obj-$(CONFIG_DMA_MAP_BENCHMARK) += map_benchmark.o -+obj-$(CONFIG_DMA_PAGE_TOUCHING) += page_touching.o -diff --git a/kernel/dma/page_touching.c b/kernel/dma/page_touching.c -new file mode 100644 -index 000000000000..a9bb7901d769 ---- /dev/null -+++ b/kernel/dma/page_touching.c -@@ -0,0 +1,134 @@ -+// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause -+/* -+ * Copyright 2020 Amazon.com, Inc. or its affiliates. -+ * -+ * This software is available to you under a choice of one of two -+ * licenses. You may choose to be licensed under the terms of the GNU -+ * General Public License (GPL) Version 2, available from the file -+ * COPYING in the main directory of this source tree, or the -+ * BSD license below: -+ * -+ * Redistribution and use in source and binary forms, with or -+ * without modification, are permitted provided that the following -+ * conditions are met: -+ * -+ * - Redistributions of source code must retain the above -+ * copyright notice, this list of conditions and the following -+ * disclaimer. -+ * -+ * - Redistributions in binary form must reproduce the above -+ * copyright notice, this list of conditions and the following -+ * disclaimer in the documentation and/or other materials -+ * provided with the distribution. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ * SOFTWARE. -+ */ -+ -+#include -+#include "direct.h" -+#include -+ -+/* -+ * A wrapper around dma_direct which does a readl on the memory being mapped -+ * for DMA to ensure that it becomes resident. -+ * Useful when running in a memory overcommit environment with lazy allocation -+ * and free page reporting. -+ */ -+ -+/* -+ * Set with kernel cmd line param: -+ * page_touching.dma_page_touching_enable=y -+ */ -+static bool dma_page_touching_enable __ro_after_init; -+module_param_named(dma_page_touching_enable, dma_page_touching_enable, bool, 0400); -+MODULE_PARM_DESC(dma_page_touching_enable, -+ "Touch pages allocated for DMA to ensure they are resident"); -+ -+static void touch_each_page(void *start_addr, size_t size) -+{ -+ int addr_offset; -+ -+ for (addr_offset = 0; addr_offset < size; addr_offset += PAGE_SIZE) -+ __raw_readl((char *)start_addr + addr_offset); -+} -+ -+static void *page_touching_dma_alloc(struct device *dev, size_t size, -+ dma_addr_t *dma_handle, gfp_t gfp, -+ unsigned long attrs) -+{ -+ char *kaddr = dma_direct_alloc(dev, size, dma_handle, gfp, attrs); -+ -+ if (!kaddr) -+ return NULL; -+ touch_each_page(kaddr, size); -+ return kaddr; -+ -+} -+ -+static dma_addr_t page_touching_dma_map_page(struct device *dev, struct page *page, -+ unsigned long offset, size_t size, -+ enum dma_data_direction dir, -+ unsigned long attrs) -+{ -+ dma_addr_t dma_handle = dma_direct_map_page(dev, page, offset, size, dir, attrs); -+ -+ if (!(dma_mapping_error(dev, dma_handle))) -+ touch_each_page(page_to_virt(page) + offset, size); -+ return dma_handle; -+} -+ -+static int page_touching_dma_map_sg(struct device *dev, struct scatterlist *sglist, -+ int nents, enum dma_data_direction dir, -+ unsigned long attrs) -+{ -+ struct scatterlist *sg; -+ int i, ret = dma_direct_map_sg(dev, sglist, nents, dir, attrs); -+ -+ if (!ret) -+ goto out; -+ -+ for_each_sg(sglist, sg, nents, i) -+ touch_each_page(page_to_virt(sg_page(sg)) + sg->offset, sg->length); -+ -+out: -+ return ret; -+ -+} -+ -+/* -+ * Only a portion of the dma_map_ops interface is implemented here; enough for -+ * the EC2 ENA / NVMe drivers to work. -+ * Notibly missing is alloc_pages. -+ */ -+const static struct dma_map_ops page_touching_dma_ops = { -+ .alloc = page_touching_dma_alloc, -+ .free = dma_direct_free, -+ .mmap = dma_common_mmap, -+ .map_page = page_touching_dma_map_page, -+ .unmap_page = dma_direct_unmap_page, -+ .map_sg = page_touching_dma_map_sg, -+ .unmap_sg = dma_direct_unmap_sg, -+ .dma_supported = dma_direct_supported, -+ .sync_single_for_cpu = dma_direct_sync_single_for_cpu, -+ .sync_single_for_device = dma_direct_sync_single_for_device, -+ .sync_sg_for_cpu = dma_direct_sync_sg_for_cpu, -+ .dma_supported = dma_direct_supported, -+ .get_required_mask = dma_direct_get_required_mask, -+ .max_mapping_size = dma_direct_max_mapping_size, -+}; -+ -+void setup_dma_page_touching_ops(struct device *dev) -+{ -+ if (!dma_page_touching_enable || dev->dma_ops) -+ return; -+ -+ dev_info(dev, "binding to page touching DMA ops\n"); -+ dev->dma_ops = &page_touching_dma_ops; -+} --- -2.39.4 - diff --git a/SPECS/91/linux/aws/0444-drivers-base-memory-use-MHP_MEMMAP_ON_MEMORY-from-th.patch b/SPECS/91/linux/aws/0444-drivers-base-memory-use-MHP_MEMMAP_ON_MEMORY-from-th.patch deleted file mode 100644 index bc21a6b688..0000000000 --- a/SPECS/91/linux/aws/0444-drivers-base-memory-use-MHP_MEMMAP_ON_MEMORY-from-th.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 0cfeded9e33c985918caa79cd6f8b4497e284875 Mon Sep 17 00:00:00 2001 -From: Frank van der Linden -Date: Thu, 9 Dec 2021 20:41:11 +0000 -Subject: [PATCH] drivers/base/memory: use MHP_MEMMAP_ON_MEMORY from the probe - interface - -If it is possible to use MHP_MEMMAP_ON_MEMORY from the probe interface, -which should normally be the case, do so. - -[Srinidhi Rao ported this patch to v6.6.x] - -Signed-off-by: Frank van der Linden ---- - drivers/base/memory.c | 11 +++++++---- - include/linux/memory_hotplug.h | 1 + - 2 files changed, 8 insertions(+), 4 deletions(-) - -diff --git a/drivers/base/memory.c b/drivers/base/memory.c -index 67858eeb92ed..1e3410ca8b7d 100644 ---- a/drivers/base/memory.c -+++ b/drivers/base/memory.c -@@ -550,9 +550,10 @@ static DEVICE_ATTR_RO(crash_hotplug); - static ssize_t probe_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) - { -- u64 phys_addr; -+ u64 phys_addr, size; - int nid, ret; - unsigned long pages_per_block = PAGES_PER_SECTION * sections_per_block; -+ mhp_t mhp_flags; - - ret = kstrtoull(buf, 0, &phys_addr); - if (ret) -@@ -565,10 +566,12 @@ static ssize_t probe_store(struct device *dev, struct device_attribute *attr, - if (ret) - return ret; - -+ size = MIN_MEMORY_BLOCK_SIZE * sections_per_block; -+ mhp_flags = mhp_supports_memmap_on_memory() ? -+ MHP_MEMMAP_ON_MEMORY : MHP_NONE; -+ - nid = memory_add_physaddr_to_nid(phys_addr); -- ret = __add_memory(nid, phys_addr, -- MIN_MEMORY_BLOCK_SIZE * sections_per_block, -- MHP_NONE); -+ ret = __add_memory(nid, phys_addr, size, mhp_flags); - - if (ret) - goto out; -diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h -index ebe876930e78..d9769660f04c 100644 ---- a/include/linux/memory_hotplug.h -+++ b/include/linux/memory_hotplug.h -@@ -378,6 +378,7 @@ extern struct zone *zone_for_pfn_range(int online_type, int nid, - extern int arch_create_linear_mapping(int nid, u64 start, u64 size, - struct mhp_params *params); - void arch_remove_linear_mapping(u64 start, u64 size); -+extern bool mhp_supports_memmap_on_memory(void); - #endif /* CONFIG_MEMORY_HOTPLUG */ - - #endif /* __LINUX_MEMORY_HOTPLUG_H */ --- -2.39.4 - diff --git a/SPECS/91/linux/aws/0490-Correct-read-overflow-in-page-touching-DMA-ops-bindi.patch b/SPECS/91/linux/aws/0490-Correct-read-overflow-in-page-touching-DMA-ops-bindi.patch deleted file mode 100644 index e28e39c708..0000000000 --- a/SPECS/91/linux/aws/0490-Correct-read-overflow-in-page-touching-DMA-ops-bindi.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 2146f0130cbf0c7c403a6bf0e07af40dc2489e79 Mon Sep 17 00:00:00 2001 -From: Tighe Barris -Date: Wed, 25 May 2022 16:43:55 +0000 -Subject: [PATCH] Correct read overflow in page touching DMA ops binding - -To force a page into residence, a read operation is performed on behalf -of devices without an IOMMU. This functionality is required to facilitate -memory overcommitted hosts. - -Commit 25d4ce2 ("Introduce page touching DMA ops binding") initially -introduced this logic by invoking a '__raw_readl' function. This function -can however read past the bounds of memory mapped for DMA. Instead, -it is replaced with '__raw_readb'. This limits the length of memory read -to a byte, and prevents reading past the range of mapped memory. - -[Srinidhi Rao ported this patch to v6.6.x] - -Fixes: 25d4ce2 ("Introduce page touching DMA ops binding") -Signed-off-by: Tighe Barris -Cc-Team: kaos-brimstone -Cc-Team: ec2-memo ---- - kernel/dma/page_touching.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/kernel/dma/page_touching.c b/kernel/dma/page_touching.c -index a9bb7901d769..c5ffb90a40a5 100644 ---- a/kernel/dma/page_touching.c -+++ b/kernel/dma/page_touching.c -@@ -36,7 +36,7 @@ - #include - - /* -- * A wrapper around dma_direct which does a readl on the memory being mapped -+ * A wrapper around dma_direct which does a readb on the memory being mapped - * for DMA to ensure that it becomes resident. - * Useful when running in a memory overcommit environment with lazy allocation - * and free page reporting. -@@ -56,7 +56,7 @@ static void touch_each_page(void *start_addr, size_t size) - int addr_offset; - - for (addr_offset = 0; addr_offset < size; addr_offset += PAGE_SIZE) -- __raw_readl((char *)start_addr + addr_offset); -+ __raw_readb((char *)start_addr + addr_offset); - } - - static void *page_touching_dma_alloc(struct device *dev, size_t size, --- -2.35.6 - diff --git a/SPECS/91/linux/aws/Fix-efa-cmake-to-build-from-local-directory.patch b/SPECS/91/linux/aws/Fix-efa-cmake-to-build-from-local-directory.patch deleted file mode 100644 index 43f000c55f..0000000000 --- a/SPECS/91/linux/aws/Fix-efa-cmake-to-build-from-local-directory.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 7f877277a8febd0a9f6d7c5f65e79bcf0365d5db Mon Sep 17 00:00:00 2001 -From: Him Kalyan Bordoloi -Date: Wed, 14 Dec 2022 18:27:37 -0800 -Subject: [PATCH] Fix efa cmake to build from local directory - -cmake only tries to use /lib/modules//build to get linux headers. -Patch makes sure we can use a local build as well - ---- - kernel/linux/efa/CMakeLists.txt | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/kernel/linux/efa/CMakeLists.txt b/kernel/linux/efa/CMakeLists.txt -index 155113d..55e3599 100644 ---- a/kernel/linux/efa/CMakeLists.txt -+++ b/kernel/linux/efa/CMakeLists.txt -@@ -5,10 +5,13 @@ cmake_minimum_required(VERSION 2.8.11) - project(efa C) - - set(KERNEL_VER "" CACHE STRING "Kernel version to build for") -+set(KERNEL_DIR "" CACHE STRING "Kernel build directory") - if(NOT KERNEL_VER) -- execute_process(COMMAND uname -r OUTPUT_VARIABLE uname_r -+ if(NOT KERNEL_DIR) -+ execute_process(COMMAND uname -r OUTPUT_VARIABLE uname_r - OUTPUT_STRIP_TRAILING_WHITESPACE) -- set(KERNEL_DIR "/lib/modules/${uname_r}/build") -+ set(KERNEL_DIR "/lib/modules/${uname_r}/build") -+ endif() - else() - set(KERNEL_DIR "/lib/modules/${KERNEL_VER}/build") - endif() --- -2.17.1 - diff --git a/SPECS/91/linux/canister_builder/crypto/canister_combine.lds b/SPECS/91/linux/canister_builder/crypto/canister_combine.lds deleted file mode 100644 index bdb5d83505..0000000000 --- a/SPECS/91/linux/canister_builder/crypto/canister_combine.lds +++ /dev/null @@ -1,6 +0,0 @@ -SECTIONS -{ - /* do not allow linker to shrink .rodata.str1.1 */ - .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } -} - diff --git a/SPECS/91/linux/canister_builder/crypto/fips_integrity.c b/SPECS/91/linux/canister_builder/crypto/fips_integrity.c deleted file mode 100644 index 2df5979d9d..0000000000 --- a/SPECS/91/linux/canister_builder/crypto/fips_integrity.c +++ /dev/null @@ -1,457 +0,0 @@ -/* - * FIPS Integrity check for Crypto API - * - * Copyright (C) 2020 - 2022 VMware, Inc. - * Copyright (c) 2025 Broadcom. All Rights Reserved. The term "Broadcom" - * refers to Broadcom Inc. and/or its subsidiaries. - * - * Authors: Alexey Makhalov - * Keerthana Kalyanasundaram - */ - -#include -#include -#include -#include -#include -#include -#include "fips_integrity.h" -#include "fips_canister_wrapper.h" - -#ifndef FIPS_DEBUG -#define FIPS_DEBUG 0 -#endif - -#define FIPS_CANISTER_VERSION "6.12" -#define FIPS_KERNEL_VERSION "6.12.60-3.ph5" - -#define RUNTIME_HMAC_SIZE 32 - -static unsigned char *canister; -/* Set at canister creation time by final linking */ -extern const int canister_size; -/* Set at canister creation time by 'dd' injection after final linking */ -extern const unsigned char canister_hmac[]; - -struct section_info { - /* Original address (in the loaded kernel) of the section */ - unsigned long saddr; - /* - * Destination address (in the canister image) of the section. - * This is the one which will be restored to its original state. - */ - char *daddr; - unsigned long size; -}; - -static int canister_perform_reverse_relocation(int i, struct relocation *r, char *mem, unsigned long target, unsigned long pc) -{ - int err = 0; - - /* Absolute unsigned 64bit relocation: value = target */ - if (r->type == 0 /* R_X86_64_64 */) { - uint64_t value = *(uint64_t *)mem; - value -= target; - *(uint64_t *)mem = value; -#if FIPS_DEBUG - if (value) { - fcw_printk("%d failed for %d with value %llx\n", i, r->type, value); - err = -ENOENT; - return err; - } -#endif - /* Relative signed 32bit relocation: value = target - pc */ - } else if (r->type == 1 /* R_X86_64_PC32 */) { - int32_t value = *(int32_t *)mem; - value -= (long)target - pc; - *(int32_t *)mem = value; -#if FIPS_DEBUG - if (value) { - fcw_printk("%d failed for %d with value %x\n", i, r->type, value); - err = -ENOENT; - return err; - } -#endif - /* Absolute signed 32bit relocation: value = target */ - } else if (r->type == 2 /* R_X86_64_32S || R_X86_64_32 */) { - int32_t value = *(int32_t *)mem; - value -= target; - *(int32_t *)mem = value; -#if FIPS_DEBUG - if (value) { - fcw_printk("%d failed for %d with value %x\n", i, r->type, value); - err = -ENOENT; - return err; - } -#endif - } else { - fcw_printk(KERN_ERR "FIPS(%s): unknown relocation type: %d\n", __FUNCTION__, r->type); - err = -ENOENT; - return err; - } - - return err; -} - -static int canister_bytecode_interpreter(struct relocation *r, int *pos) -{ - int err = 0; - unsigned char c = 0, n_1 = 0, n_2 = 0, n_3 = 0; - unsigned char rel_add = 0; - - if (!r) { - fcw_printk(KERN_ERR "FIPS(%s): Relocation is NULL\n", __FUNCTION__); - return -ENOENT; - } - c = canister_relocations_bytecode[*pos]; - - if ((c & 0xC0) == 0x0) { /* JMP */ - /* Jmp Offset (6 bits) = 3, 4, 5, 6, 7, 8 bits of first byte */ - r->offset += (c & 0x3F); - r->insn_read_complete = false; - - } else if ((c & 0xC0) == 0x40) { /* LJMP */ - (*pos)++; - n_1 = canister_relocations_bytecode[*pos]; - /* Long Jmp Offset (14 bits) = 3, 4, 5, 6, 7, 8 bits of first byte + next byte */ - r->offset += (((c & 0x3F) << 8) + n_1); - r->insn_read_complete = false; - - } else if ((c & 0xE0) == 0x80) { /* LRPR */ - (*pos)++; - n_1 = canister_relocations_bytecode[*pos]; - /* LRPR signed addend (1 sign bit + 12 bits) = 4th bit + 5, 6, 7, 8 bits of first byte + next byte */ - if ((c & 0x10) >> 4 == 0) { /* Sign bit is 0 */ - r->addend += (((c & 0xF) << 8) + n_1); - } else { /* Sign bit is 1 */ - /* Addend value of 1000000000000 = -4096 */ - if ((((c & 0xF) << 8) + n_1) == 0x0) - r->addend += (-4096); - else - r->addend += (-(((c & 0xF) << 8) + n_1)); - } - r->insn_read_complete = true; - - } else if ((c & 0xE0) == 0xA0) { /* SRPR */ - /* SRPR signed addend (1 sign bit + 4 bits) = 4th bit + 5, 6, 7, 8 bits of first byte */ - if ((c & 0x10) >> 4 == 0) /* Sign bit is 0 */ - r->addend += (c & 0xF); - else { /* Sign bit is 1 */ - /* Addend value of 10000 = -16 */ - if ((c & 0xF) == 0x0) - r->addend += (-16); - else - r->addend += (-(c & 0xF)); - } - r->insn_read_complete = true; - - } else if ((c & 0xE0) == 0xE0) { /* LREL */ - (*pos)++; - n_1 = canister_relocations_bytecode[*pos]; - (*pos)++; - n_2 = canister_relocations_bytecode[*pos]; - (*pos)++; - n_3 = canister_relocations_bytecode[*pos]; - /* Rel Type (2 bits) = 4th and 5th bit from first byte */ - r->type = (c & 0x18) >> 3; - /* Symbol (8 bits) = 6, 7, 8th bit from first byte + first 5 bits from next byte*/ - r->symbol = ((c & 0x7) << 5) + ((n_1 & 0xF8) >> 3); - /* Addend (19 bits) = 6, 7, 8th bit from n_1 + n2 + n3 */ - r->addend = ((n_1 & 0x7) << 16) + (n_2 << 8) + n_3; - r->insn_read_complete = true; - - } else if ((c & 0xF0) == 0xC0) { /* SREL */ - (*pos)++; - n_1 = canister_relocations_bytecode[*pos]; - /* Symbol (8 bits) = 4 bits from first byte + 4 bits from next byte */ - r->symbol = ((c & 0x0F) << 4) + (n_1 >> 4); - /* Rel Type, Addend combination (4 bits) = 5, 6, 7, 8 bits from next byte */ - rel_add = n_1 & 0x0F; - if (rel_add == SREL_INSN_TA_0) { - r->type = 0; - r->addend = 0; - } else if (rel_add == SREL_INSN_TA_1) { - r->type = 0; - r->addend = 5; - } else if (rel_add == SREL_INSN_TA_2) { - r->type = 1; - r->addend = -5; - } else if (rel_add == SREL_INSN_TA_3) { - r->type = 1; - r->addend = -4; - } else if (rel_add == SREL_INSN_TA_4) { - r->type = 1; - r->addend = 0; - } else if (rel_add == SREL_INSN_TA_5) { - r->type = 1; - r->addend = 4; - } else if (rel_add == SREL_INSN_TA_6) { - r->type = 2; - r->addend = 0; - } else { - err = -ENOENT; - return err; - } - r->insn_read_complete = true; - - } else if ((c & 0xF0) == 0xD0) { /* SEC */ - /* Section increment (4 bits) = 5, 6, 7, 8 bits of first byte */ - r->section += (c & 0x0F); - r->insn_read_complete = false; - - } else { - fcw_printk(KERN_ERR "FIPS(%s): Unknown Instruction\n", __FUNCTION__); - err = -ENOENT; - return err; - } - return err; -} - -/* - * First stage of FIPS integrity: - * To restore original canister image for measurement. - * Must be invoked before any changes, except relocations, in measured sections. - */ -int __init fips_integrity_init(void) -{ - int i, err = 0; - int sections_size = canister_sections_size; - const char *ptr = canister_sections; - unsigned char *c; - unsigned long *symbols_addr = 0; - unsigned int offset; - int prev_section = -1; - struct section_info *si = 0; - char *d; - int bytes_remaining; - struct relocation *r = NULL; - int canister_relocations_size; -#if FIPS_DEBUG > 1 - int relocation_number = 0; -#endif - - if (!fips_enabled && - /* This function can be called before jump_label_init, - * so, kernel parameters are not parsed yet. */ - !strstr(boot_command_line, "fips=1")) - return 0; - - /* Canister image to measure */ - c = (unsigned char *)fcw_mem_alloc(canister_size); - if (!c) { - err = -ENOMEM; - goto quit; - } - - /* Description of section regions to put in the canister */ - si = (struct section_info *)fcw_mem_alloc(sizeof(struct section_info) * sections_size); - if (!si) { - err = -ENOMEM; - goto quit; - } - - fcw_printk(KERN_INFO "FIPS(%s): canister %s found (based on %s)\n", __FUNCTION__, - FIPS_CANISTER_VERSION, FIPS_KERNEL_VERSION); - fcw_printk(KERN_INFO "FIPS(%s): processing %d sections, %d bytes\n", - __FUNCTION__, sections_size, canister_size); - d = c; - bytes_remaining = canister_size; - for (i = 0; i < sections_size; i++) { - unsigned long s, e, size; - const char *begin_marker, *end_marker; - begin_marker = ptr; - ptr += strlen(ptr) + 1; - end_marker = ptr; - ptr += strlen(ptr) + 1; - s = kallsyms_lookup_name(begin_marker); - if (!s) { - fcw_printk(KERN_ERR "FIPS(%s): unable to lookup: %s\n", __FUNCTION__, begin_marker); - err = -ENOENT; - goto quit; - } - e = kallsyms_lookup_name(end_marker); - if (!e) { - fcw_printk(KERN_ERR "FIPS(%s): unable to lookup: %s\n", __FUNCTION__, end_marker); - err = -ENOENT; - goto quit; - } - size = e - s; -#if FIPS_DEBUG - fcw_printk("Processing %s: [%lx-%lx], size %ld\n", begin_marker, s, e, size); -#endif - bytes_remaining -= size; - if (bytes_remaining < 0) - break; - /* Copy content of relocated section to the canister */ - memcpy(d, (char *)s, size); - - si[i].saddr = s; - si[i].daddr = d; - si[i].size = size; - d += size; - } - if (bytes_remaining) { - fcw_printk(KERN_ERR "FIPS(%s): invalid canister size or markers\n", __FUNCTION__); - err = -EINVAL; - goto quit; - } - - symbols_addr = (unsigned long *)fcw_mem_alloc(sizeof(unsigned long) * canister_strtab_size); - if (!symbols_addr) { - err = -ENOMEM; - goto quit; - } - /* Look up strtab once. Convert canister_strtab[i] -> symbols_addr[i]. */ - ptr = canister_strtab; - for (i = 0; i < canister_strtab_size; i++) { - symbols_addr[i] = kallsyms_lookup_name(ptr); - if (!symbols_addr[i]) { - fcw_printk(KERN_ERR "FIPS(%s): unable to lookup: %s\n", __FUNCTION__, ptr); - err = -ENOENT; - goto quit; - } - ptr += strlen(ptr) + 1; - } -#if FIPS_DEBUG - fcw_printk("Processed %d symbols\n", canister_strtab_size); -#endif - - /* - * Main interpreter work: perform reverse relocation to resotre - * canister image to its original state. - */ - r = (struct relocation *)fcw_mem_alloc(sizeof(struct relocation)); - memset(r, 0, sizeof(struct relocation)); - for (i = 0; i < canister_relocations_bytecode_size; i++) { - char *mem; - unsigned long target, pc; - - err = canister_bytecode_interpreter(r, &i); - if (err) - goto quit; - - if (!(r->insn_read_complete)) - continue; - /* Relocation target */ - target = symbols_addr[r->symbol]; - target += (int64_t)r->addend; - /* - * Every new section starts with absolute offset. - * All consecutive offsets within the section are relative. - */ - if (prev_section != r->section) { - prev_section = r->section; - offset = 0; - } - /* Relocation offset from the section start */ - offset += r->offset; - /* Relocation actual addess */ - pc = si[r->section].saddr + offset; - /* Where the reverse relocation will happen, inside canister image */ - mem = si[r->section].daddr + offset; -#if FIPS_DEBUG > 1 - fcw_printk("%6d: section %d, rel %d, symbol %d, offset %x(%x), addend %d, target %lx, pc %lx\n", - relocation_number++, r->section, r->type, r->symbol, offset, r->offset, r->addend, target, pc); -#endif - err = canister_perform_reverse_relocation(i, r, mem, target, pc); - if (err) - goto quit; - r->offset = 0; - canister_relocations_size++; - } -#if FIPS_DEBUG - fcw_printk("Processed %d relocations\n", canister_relocations_size); -#endif -quit: - fcw_mem_free(symbols_addr); - fcw_mem_free(si); - fcw_mem_free(r); - if (err) { - fcw_mem_free(c); - panic("FIPS(%s) canister initialization failed.", __FUNCTION__); - } else { - /* It is safe to set 'canister' pointer now. */ - canister = c; - } - - return err; -} - -/* - * Second stage of FIPS integrity: - * To perform canister image measurement and compare with golden value. - * Can be invoked at any time after crypto algorithms initialization and - * self-tests completed. - */ -int __init fips_integrity_check (void) -{ - int err; - unsigned char runtime_hmac[RUNTIME_HMAC_SIZE]; - struct crypto_shash *tfm = NULL; - struct shash_desc *shash; - /* HMAC key. Same key as we used at canister build time. */ - const unsigned char *key = "FIPS-PH5-VMW2025"; - - if (!fips_enabled) - return 0; - - if (!canister) { - fcw_printk (KERN_ERR "FIPS(%s): canister image not found\n", __FUNCTION__); - return -EINVAL; - } - - tfm = crypto_alloc_shash ("hmac(sha256)", 0, 0); - if (IS_ERR(tfm)) { - fcw_printk(KERN_ERR "FIPS(%s): crypto_alloc_shash failed (%d)\n", __FUNCTION__, (int)PTR_ERR(tfm)); - return PTR_ERR(tfm); - } - - err = crypto_shash_setkey (tfm, key, strlen(key)); - if (err) { - fcw_printk(KERN_ERR "FIPS(%s): crypto_hash_setkey failed (%d)\n", __FUNCTION__, err); - goto free_tfm; - } - - shash = fcw_kzalloc(sizeof(*shash) + crypto_shash_descsize(tfm), - GFP_KERNEL); - if (!shash) { - err = -ENOMEM; - goto free_tfm; - } - - shash->tfm = tfm; - err = crypto_shash_digest(shash, canister, canister_size, runtime_hmac); - if (err) - fcw_printk(KERN_ERR "FIPS(%s): crypto_shash_digest failed (%d)\n", __FUNCTION__, err); - - kfree(shash); -free_tfm: - crypto_free_shash (tfm); - fcw_mem_free(canister); -#if FIPS_DEBUG - fcw_printk("canister: %lx %d\n", (unsigned long)canister, canister_size); -#endif - if (err) - return err; - - { - int i; - unsigned char linebuf[(RUNTIME_HMAC_SIZE * 2) + 1]; - - for (i = 0; i < RUNTIME_HMAC_SIZE; i++) - snprintf(&linebuf[i * 2], 3, "%02x", runtime_hmac[i]); - - linebuf[sizeof(linebuf) - 1] = '\0'; - - fcw_printk("FIPS canister HMAC: %s\n", linebuf); - memzero_explicit(linebuf, sizeof(linebuf)); - } - - err = memcmp (canister_hmac, runtime_hmac, sizeof(runtime_hmac)) ? -EACCES: 0; - memzero_explicit(runtime_hmac, sizeof(runtime_hmac)); - if (!err) - fcw_printk("FIPS canister verification passed!"); - else - panic("FIPS canister verification failed!"); - return err; -} diff --git a/SPECS/91/linux/canister_builder/crypto/fips_integrity.h b/SPECS/91/linux/canister_builder/crypto/fips_integrity.h deleted file mode 100644 index 3253711fe6..0000000000 --- a/SPECS/91/linux/canister_builder/crypto/fips_integrity.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * FIPS Integrity check for Crypto API - * - * Copyright (C) 2020 - 2022 VMware, Inc. - * Copyright (c) 2025 Broadcom. All Rights Reserved. The term "Broadcom" - * refers to Broadcom Inc. and/or its subsidiaries. - * - * Author: Alexey Makhalov - * - */ - -/* - * Bits can be moved around to satisfy current core canister. - * TYPE_BITS can easily be 2 and 1 released bit can be added - * to one of the other twos. - */ -#include - -/* - * Relocation type & Addend combinations for SREL instruction - * - * imm type addend - */ -#define SREL_INSN_TA_0 0 /* 0 0 */ -#define SREL_INSN_TA_1 1 /* 0 5 */ -#define SREL_INSN_TA_2 2 /* 1 -5 */ -#define SREL_INSN_TA_3 3 /* 1 -4 */ -#define SREL_INSN_TA_4 4 /* 1 0 */ -#define SREL_INSN_TA_5 5 /* 1 4 */ -#define SREL_INSN_TA_6 6 /* 2 0 */ - -struct __attribute__((packed)) relocation { - unsigned char section; - unsigned char type; - unsigned short symbol; - unsigned int offset; - int addend; - bool insn_read_complete; -}; - -/* Generated data. */ -extern const char canister_sections[]; -extern const int canister_sections_size; -extern const char canister_strtab[]; -extern const int canister_strtab_size; -extern const unsigned char canister_relocations_bytecode[]; -extern const unsigned int canister_relocations_bytecode_size; - diff --git a/SPECS/91/linux/canister_builder/crypto/gen_canister_relocs.c b/SPECS/91/linux/canister_builder/crypto/gen_canister_relocs.c deleted file mode 100644 index 8f8b4095e1..0000000000 --- a/SPECS/91/linux/canister_builder/crypto/gen_canister_relocs.c +++ /dev/null @@ -1,900 +0,0 @@ -/* - * FIPS Integrity canister relocations generator. - * - * Copyright (C) 2020 - 2022 VMware, Inc. - * Copyright (c) 2025 Broadcom. All Rights Reserved. The term "Broadcom" - * refers to Broadcom Inc. and/or its subsidiaries. - * - * Authors: Alexey Makhalov - * Keerthana Kalyanasundaram - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "fips_integrity.h" - -#define MARK_PREFIX_BEGIN "__canister_s" -#define MARK_PREFIX_E_POSITION 11 - -#define INT_MAX ((int)(~0U>>1)) -#define INT_MIN (-INT_MAX - 1) -#define UINT_MAX (~0U) - -/* -* Canister bytecode instruction set -* -* LJMP - Long Jump -* SRPR - Short RPR (Repeat Previous Relocation. Use same reloc type, section and symbol as previous instruction) -* LRPR - Long RPR (Repeat Previous Relocation. Use same reloc type, section and symbol as previous instruction) -* SREL - Short Relocation -* LREL - Long Relocation -* -*-------------------------------------------------------------------------------------------------------------------------------* -| Name |Bytes | Opcode | Param bits | Param | Notes | -|_______|_______|_______________________|_______________________|_______________________________|_______________________________| -| JMP | 1 | 00 {P:6} | 6 | 6 bits of unsigned offset | Offset range [0;63] | -|-------|-------------------------------|-----------------------|-------------------------------|-------------------------------| -| LJMP | 2 | 01 {P:14} | 14 | 14 bits of unsigned offset | Offset range [0;16383] | -|-------|-------------------------------|-----------------------|-------------------------------|-------------------------------| -| LRPR | 2 | 100 {A:13} | 13 | 13 bits of signed addend delta| Addend range [-4096;4095] | -|-------|-------------------------------|-----------------------|-------------------------------|-------------------------------| -| SRPR | 1 | 101 {A:5} | 5 | 5 bits of signed addend delta | Addend range [-16 ; 15] | -|-------|-------------------------------|-----------------------|-------------------------------|-------------------------------| -| | | | | S - 8 bits of unsigned symbol | Symbol range [0;255] | -| SREL | 2 | 1100 {S:8}{C:4} | 12 | C - 4 bits of rel type and | | -| | | | | addend combination, see | | -| | | | | fips_integrity.h | | -|-------|-------------------------------|-----------------------|-------------------------------|-------------------------------| -|SECTION| 1 | 1101 {N:4} | 4 | 4 bits of section increment | Section increment from prev | -|-------|-------------------------------|-----------------------|-------------------------------|-------------------------------| -| | | | |R - 2 bits of rel type | Rel type range [0;3] | -| LREL | 4 | 111 {R:2}{S:8}{A:19} | |S - 8 bits of unsigned symbol | Symbol range [0;255] | -| | | | 29 |A - 19 bits of unsigned addend | Addend range[0;524287] | -| | | | | | | -*-------------------------------------------------------------------------------------------------------------------------------* -*/ - -#define ONE_BYTE_UNSIGNED_MAX_VALUE (1 << 8) - 1 -#define TWO_BYTE_UNSIGNED_MAX_VALUE (1 << 16) -1 -#define THREE_BYTE_UNSIGNED_MAX_VALUE (1 << 24) - 1 -#define FOUR_BYTE_UNSIGNED_MAX_VALUE (~0U) - -/* SEC Instruction */ -#define SEC_INSN_OPCODE 0xD0 /*1101 0000 */ - -/* JMP Insturctions */ -#define JMP_INSN_OPCODE 0x0 /* 0000 0000 */ -#define LJMP_INSN_OPCODE 0x4000 /* 0100 0000 0000 0000 */ -#define LJMP_INSN_MAX_OFFSET 0x3FFF /* 11 1111 1111 1111 */ - -/* Short Rel Instructions */ -#define SREL_INSN_OPCODE 0xC000 /* 1100 0000 0000 0000 */ - -/* Long Rel Instructions */ -#define LREL_INSN_OPCODE 0xE0000000 /* 1110 0000 0000 0000 0000 0000 0000 0000 */ - -/* Short RPR Instructions */ -#define SRPR_INSN_OPCODE_SIGN_BIT_SET 0xB0 /* 1011 0000 */ -#define SRPR_INSN_OPCODE_SIGN_BIT_UNSET 0xA0 /* 1010 0000 */ - -/* Long RPR Instructions */ -#define LRPR_INSN_OPCODE_SIGN_BIT_SET 0x9000 /* 1001 0000 0000 0000 */ -#define LRPR_INSN_OPCODE_SIGN_BIT_UNSET 0x8000 /* 1000 0000 0000 0000 */ - -#define MIN_VALUE_3_BITS_SIGN (-8) /* 1 000 */ -#define MIN_VALUE_4_BITS_SIGN 0xFFFFFFF0 /* 1 0000 */ -#define MIN_VALUE_12_BITS_SIGN 0xFFFFF000 /* 1 0000 0000 0000 */ - -#define MAX_VALUE_3_BITS 0x7 /* 111 */ -#define MAX_VALUE_4_BITS 0xF /* 1111 */ -#define MAX_VALUE_6_BITS 0x3F /* 11 1111 */ -#define MAX_VALUE_12_BITS 0xFFF /* 1111 1111 1111 */ -#define MAX_VALUE_14_BITS 0x3FFF /* 11 1111 1111 1111 */ -#define MAX_VALUE_19_BITS 0x7FFFF /* 111 1111 1111 1111 1111 */ - -#define MAX_SYMBOL 0xFF - -struct symbol_entry { - char *name; - char *based_on; - unsigned int index; - unsigned int addend; -}; - -/* Local, not packed version of relocation structure */ -struct _relocation { - /* Output section index in generated sections table */ - unsigned char section; - /* Relocation type (ours 2 bits value) */ - unsigned char type; - /* Output symbol index in generated symbols table */ - unsigned int symbol; - /* Original relocation addend */ - unsigned int addend; - /* - * Offseti (relative) in output section. Relative means: it contains - * offset from previous relocation location to the current one. - */ - unsigned int offset; -}; - -struct section_marker { - char *name; - char *begin; - char *end; - int ondx; - int symbol_index; -}; - -/* Array of section markers pointers. It is as big as number of sections in input file. */ -static struct section_marker **section_symbols = NULL; -static struct _relocation *canister_relocs = NULL; -/* Number of relocations in canister image */ -static int n_relocs = 0; -/* Number of sections in input file. */ -static size_t n_sections = 0; -static bool initrodata_present = false; -static Elf64_Sym *symtab = 0; - - -static struct relocation *canister_relocations; -static unsigned int bytecode_size = 0; - -static struct section_marker *marker(char *in); -static int error(const char *format, ...); -static void process_section(Elf *elf, Elf_Scn *s, int sndx, struct symbol_entry *symbols, size_t strndx); -static void parse_sections(Elf *elf, size_t shstrndx, int *n_syms, size_t *strndx); -static void dump_header(int ofd, char *prog); -static void dump_sections(int ofd, int sfd); -static void dump_symbols(int ofd, int sfd, struct symbol_entry *symbols, int n_syms); -static void dump_relocations(int ofd, struct symbol_entry *symbols); -static void generate_ldscript(char *filename); - - -/* - * Section markers name generator. - * The rules are: - * 1) dots (.) are removed from section name. - * 2) begin marker is prefixed by __canister_s. - * 3) end marker is prefixed by __canister_e. - * Example: markers for '.init.rodata' will be - * '__canister_sinitrodata' and '__canister_einitrodata' - */ -static struct section_marker *marker(char *in) -{ - int i = 0, l = 0; - struct section_marker *m = (struct section_marker *)malloc(sizeof(struct section_marker)); - if (m == NULL) - error("Unable to allocate memory for section marker"); - m->name = strdup(in); - while (in[i]) { - if (in[i] != '.') - l++; - i++; - } - m->begin = calloc(l + 1 + strlen(MARK_PREFIX_BEGIN), 1); - if (m->begin == NULL) - error("Unable to allocate memory for section marker"); - strcpy(m->begin, MARK_PREFIX_BEGIN); - i = 0; - l = strlen(MARK_PREFIX_BEGIN); - while (in[i]) { - if (in[i] != '.') - m->begin[l++] = in[i]; - i++; - } - if (strcmp(in, ".bss") == 0) { - /* - * BSS section will not be measured, but it can be referenced - * by other sections relocations. So create start label only - * for proper symbol lookup for reverse relocation. - */ - m->end = NULL; - } else { - m->end = strdup(m->begin); - m->end[MARK_PREFIX_E_POSITION] = 'e'; - } - if (!strcmp(in, ".init.rodata")) - initrodata_present = true; - return m; -} - -static int error(const char *format, ...) -{ - va_list args; - va_start(args, format); - vfprintf(stderr, format, args); - fprintf(stderr, "\n"); - va_end(args); - exit(1); -} - -/* - * Populates canister_relocs table by _relocation entries - */ -static void process_section(Elf *elf, Elf_Scn *s, int sndx, struct symbol_entry *symbols, size_t strndx) -{ - Elf_Data *data; - int n, n_entries; - unsigned int offset = 0; - Elf64_Rela *rels; - struct _relocation *r; - data = elf_getdata(s, NULL); - rels = (Elf64_Rela *)data->d_buf; - n_entries = data->d_size / sizeof (Elf64_Rela); - - /* Extend output canister_relocs table by n_entries */ - canister_relocs = (struct _relocation *)realloc(canister_relocs, (n_relocs + n_entries) * sizeof (struct _relocation)); - r = &canister_relocs[n_relocs]; - n_relocs += n_entries; - - for (n = 0; n < n_entries; n++) { - uint32_t r_sym = rels[n].r_info >> 32; /* symbol index */ - uint32_t r_type; /* relocation type */ - /* Shrink 32 bits relocation type to 2 bits */ - switch (rels[n].r_info & 0xffffffff) { - case R_X86_64_64: - r_type = 0; - break; - case R_X86_64_PC32: - case R_X86_64_PLT32: - /* - * arch/x86/tools/relocs.c: - * NB: R_X86_64_PLT32 can be treated as R_X86_64_PC32. - */ - r_type = 1; - break; - case R_X86_64_32: - case R_X86_64_32S: - r_type = 2; - break; - default: - error("Unsupported relocation type %d", rels[n].r_info & 0xffffffff); - } - - /* First time we've seen this r_sym? look up needed. */ - if (!symbols[r_sym].name) { - if (ELF64_ST_TYPE(symtab[r_sym].st_info) == STT_SECTION) { - /* Symbol type is section name. */ - struct section_marker *m = section_symbols[symtab[r_sym].st_shndx]; - /* - * It should point to local section and this section must be - * measured (present in section_symbols). - */ - if (!m) - error("Cannot find marker for section index: %d", symtab[r_sym].st_shndx); - /* - * Do not use section name as a target as in - * vmlinux it will point to aggregated section. - * Use begin marker instead which will survive - * final vmlinux linking and will point to - * actual start of the canister section. - */ - symbols[r_sym].name = m->begin; - } else { - /* Get symbol name */ - symbols[r_sym].name = strdup(elf_strptr(elf, strndx, symtab[r_sym].st_name)); - } - } - if (rels[n].r_addend > INT_MAX || rels[n].r_addend < INT_MIN) - error("r_addend overflow"); - if (rels[n].r_offset - offset > UINT_MAX) - error("r_offset overflow"); - r->section = section_symbols[sndx]->ondx; - r->type = r_type; - r->symbol = r_sym; - r->addend = rels[n].r_addend; - /* Use relative offset to shrink u64 to u32 field. */ - r->offset = rels[n].r_offset - offset; - offset = rels[n].r_offset; - r++; - } -} - -/* - * Walk through all sections: - * - if it is .symtab - save its content and remember number of symbols (*n_syms). - * - if it is .strtab - remember its index (*strndx). - * - create section markers for every SHF_ALLOC section, it it is not in exception list. - */ -static void parse_sections(Elf *elf, size_t shstrndx, int *n_syms, size_t *strndx) -{ - Elf_Scn *section = NULL; - GElf_Shdr section_header; - char *name; - size_t ndx; - int ondx = 0; - - *strndx = 0; - if (elf_getshdrnum (elf, &n_sections) < 0) - error("Unable to get sections number"); - - section_symbols = (struct section_marker **)calloc(n_sections, sizeof(struct section_marker *)); - if (section_symbols == NULL) - error("Unable to allocate memory for section_symbols"); - - for (ndx = 0; ndx < n_sections; ++ndx) - { - section = elf_getscn (elf, ndx); - if (section == NULL) - error("Error getting section"); - - if (gelf_getshdr(section , §ion_header) != §ion_header) - error("getshdr() failed"); - - if ((name = elf_strptr(elf, shstrndx , section_header.sh_name )) == NULL) - error("elf_strptr () failed"); - - if (!strcmp(name, ".symtab")) { - *n_syms = section_header.sh_size / sizeof (Elf64_Sym); - symtab = (Elf64_Sym *)malloc(sizeof(Elf64_Sym) * (*n_syms)); - if (!symtab) - error("symtab allocation failed"); - memcpy(symtab, elf_getdata(section, NULL)->d_buf, sizeof(Elf64_Sym) * (*n_syms)); - continue; - } - if (!strcmp(name, ".strtab")) { - *strndx = ndx; - continue; - } - - if ((section_header.sh_flags & SHF_ALLOC) == 0) - continue; - - if (!strncmp(name, "__jump_table", 12) || - !strncmp(name, ".retpoline_sites", 16) || - !strncmp(name, ".return_sites", 13) || - !strncmp(name, ".printk_index", 13) || - !strncmp(name, "__bug_table", 13)) { - error("ERROR: Forbidden %s section found in canister!! Please fix it."); - } - /* - * .discard, .exitcall.exit and .modinfo sections will be - * dropped at vmlinux linking time (see vmlinux linker - * script: arch/x86/kernel/vmlinux.lds) - * - * Ignore symbol table sections as there are no needs to - * measure them. - * - * Ignore __ex_table as it will be sorted ("corrupted") by - * sort_main_extable() code before fips integrity code. If - * we really want to measure __ex_table, we must run - * fips_integrity_init() before sort_main_extable() - * The same situation is with __jump_table which got sorted - * by jump_label_init(). - * - * Skip ".note.gnu.property" section from canister measurement - * as this section is stripped off from vmlinux. - * - * Skip __mcount_loc section for canister measurement as it will be - * discarded during initial bootup process before canister measurement. - */ - if (!strncmp(name, ".discard.", 9) || - !strcmp(name, ".exitcall.exit") || - !strcmp(name, ".modinfo") || - !strncmp(name, "__ksymtab_", 10) || - !strncmp(name, "___ksymtab", 10) || - !strncmp(name, "___kcrctab", 10) || - !strcmp(name, "__ex_table") || - !strcmp(name, "__jump_table") || - !strcmp(name, "__mcount_loc") || - !strcmp(name, ".note.gnu.property") || - !strcmp(name, "__patchable_function_entries")) - continue; - - /* - * Allocate section_marker structure, - * initialize .name, .begin, .end fields. - */ - section_symbols[ndx] = marker(name); - /* - * ndx - section index in inout file. - * ondx - section index in generated .c file - */ - section_symbols[ndx]->ondx = ondx++; - } - if (!symtab) - error("Unable to find .symtab section"); - if (!*strndx) - error("Unable to find .strtab section"); -} - -static void dump_header(int ofd, char *prog) -{ - dprintf(ofd, - "/*\n" - " * Generated by %s\n" - " */\n" - "#include \"fips_integrity.h\"\n\n", prog); -} - -static void dump_sections(int ofd, int sfd) -{ - int i, n = 0; - /* - * Put all strings in '\0' separated array of chars. - * Do not use array of string (char * canister_sections[]) as - * it introduces new relocations in canister. - */ - dprintf(ofd, "const __section(\".init.rodata\") char canister_sections[] = {\n"); - for (i = 0; i < n_sections; i++) - if (section_symbols[i] && section_symbols[i]->end) { - dprintf(ofd, "\t\"%s\\0\"\n\t\"%s\\0\"\n", - section_symbols[i]->begin, - section_symbols[i]->end); - dprintf(sfd, "%s\n%s\n", section_symbols[i]->begin, - section_symbols[i]->end); - n++; - } - /* We've just introduced/generated fresh .init.rodata section, add its section markers. */ - if (!initrodata_present) { - dprintf(ofd, "\t\"__canister_sinitrodata\\0\"\n\t\"__canister_einitrodata\\0\"\n"); - dprintf(sfd, "__canister_sinitrodata\n__canister_einitrodata\n"); - n++; - } - dprintf(ofd, "};\n"); - dprintf(ofd, "const __section(\".init.rodata\") int canister_sections_size = %d;\n\n", n); -}; - -/* - * Not only dump the symbols table, but post process (optimize) it - * to be used by dump_relocations() later. - */ -static void dump_symbols(int ofd, int sfd, struct symbol_entry *symbols, int n_syms) -{ - int i; - /* Index in output symbol table. */ - uint32_t index = 0; - - /* Use same format as for canister_sections. */ - dprintf(ofd, "const __section(\".init.rodata\") char canister_strtab[] = {\n"); - for (i = 0; i < n_syms; i++) { - int stype, ssection; - if (!symbols[i].name) - continue; - stype = ELF64_ST_TYPE(symtab[i].st_info); - ssection = symtab[i].st_shndx; - if (stype == STT_SECTION) { - /* - * Section symbols always come first. So, symbol_index'es - * will be always initialized before use. - */ - section_symbols[symtab[i].st_shndx]->symbol_index = index; - } else if (ssection != SHN_UNDEF && ssection != SHN_ABS) { - /* - * Optimization. Do not print local symbols, and do not - * look up them at runtime. - * For local relocations, instead of using local symbol, - * use its section begin marker as a symbol, and - * its offset in the section as addend. - * Example: - * target = (address of function A in section .text) - * will be transformed to - * target = (address of __canister_stext) + (offset to A) - */ - symbols[i].based_on = section_symbols[ssection]->begin; - symbols[i].addend = symtab[i].st_value; - symbols[i].index = section_symbols[ssection]->symbol_index; - continue; - } - symbols[i].index = index; - dprintf(ofd, "\t\"%s\\0\" /* %d: %d %x %d %lx */\n", symbols[i].name, index, i, symtab[i].st_info, symtab[i].st_shndx, symtab[i].st_value); - dprintf(sfd, "%s\n", symbols[i].name); - index++; - } - dprintf(ofd, "};\n"); - dprintf(ofd, "const __section(\".init.rodata\") int canister_strtab_size = %d;\n\n", index); -} - -static void dump_relocations(int ofd, struct symbol_entry *symbols) -{ - int i; - /* - * Array of structures is OK, it does not introduce new relocations. - * - * Packed (runtime) version of 'struct relocation' is defined in fips_integrity.h - */ - canister_relocations = (struct relocation *)malloc(sizeof(struct relocation) * n_relocs); - for (i = 0; i < n_relocs; i++) { - struct symbol_entry *s = &symbols[canister_relocs[i].symbol]; - if (s->based_on) { - /* Relocation to collapsed local symbol, print nice comment. */ - canister_relocations[i].section = canister_relocs[i].section; - canister_relocations[i].type = canister_relocs[i].type; - canister_relocations[i].symbol = s->index; - canister_relocations[i].offset = canister_relocs[i].offset; - canister_relocations[i].addend = canister_relocs[i].addend + s->addend; - } else { - /* Relocation to local section or to external (from vmlinux) symbol. */ - canister_relocations[i].section = canister_relocs[i].section; - canister_relocations[i].type = canister_relocs[i].type; - canister_relocations[i].symbol = s->index; - canister_relocations[i].offset = canister_relocs[i].offset; - canister_relocations[i].addend = canister_relocs[i].addend; - } - } -} - -static void generate_ldscript(char *filename) -{ - int i, n = 0; - /* Open output file. */ - int fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - if (fd == -1) - error("Cannot open output file"); - - dprintf(fd, "SECTIONS\n{\n"); - for (i = 0; i < n_sections; i++) - if (section_symbols[i]) { - if (section_symbols[i]->end) { - n++; - dprintf(fd, - " %s : {\n" - " %s = .;\n" - " *(%s)\n" - " %s = .;\n" - " }\n", - section_symbols[i]->name, - section_symbols[i]->begin, - section_symbols[i]->name, - section_symbols[i]->end); - } else { - dprintf(fd, - " %s : {\n" - " %s = .;\n" - " *(%s)\n" - " }\n", - section_symbols[i]->name, - section_symbols[i]->begin, - section_symbols[i]->name); - } - } - /* Section from generated .c file. */ - if (!initrodata_present) - dprintf(fd, - " .init.rodata : {\n" - " __canister_sinitrodata = .;\n" - " *(.init.rodata)\n" - " __canister_einitrodata = .;\n" - " }\n"); - /* - * Some ldscript tricks here: - * - Allocate placeholder for golden canister HMAC value - * - Provide canister_size symbol - */ - dprintf(fd, - " .init.rodata.canister_info : {\n" - " canister_hmac = .;\n" - " . = . + 32;\n" - " canister_size = .;\n" - " LONG("); - for (i = 0; i < n_sections; i++) - if (section_symbols[i]) { - if (section_symbols[i]->end) { - n--; - dprintf(fd, "SIZEOF(%s)", section_symbols[i]->name); - if (n) - dprintf(fd, " + "); - } - } - if (!initrodata_present) - dprintf(fd, " + SIZEOF(.init.rodata)"); - dprintf(fd, ")\n }\n"); - dprintf(fd, "}\n"); - - close(fd); -} - -static void print_insn_byte_wise(unsigned int insn, int nfd) -{ - if (insn <= ONE_BYTE_UNSIGNED_MAX_VALUE) { - dprintf(nfd, "0x%02x, ", insn & 0xff); - bytecode_size++; - } else if (insn <= TWO_BYTE_UNSIGNED_MAX_VALUE) { - dprintf(nfd, "0x%02x, 0x%02x, ", - (insn >> 8) & 0xff, insn & 0xff); - bytecode_size += 2; - } else if (insn <= THREE_BYTE_UNSIGNED_MAX_VALUE) { - dprintf(nfd, "0x%02x, 0x%02x, 0x%02x, ", - (insn >> 16) & 0xff, - (insn >> 8) & 0xff, - insn & 0xff); - bytecode_size += 3; - } else if (insn <= FOUR_BYTE_UNSIGNED_MAX_VALUE) { - dprintf(nfd, "0x%02x, 0x%02x, 0x%02x, 0x%02x, ", - (insn >> 24) & 0xff, - (insn >> 16) & 0xff, - (insn >> 8) & 0xff, - insn & 0xff); - bytecode_size += 4; - } - else { - error("Unsupported canister bytecode instruction size!!"); - } -} - -static void print_jmp_insn(int nfd, unsigned int off) -{ - unsigned short rem_off = 0; - unsigned int jmp; - - if (off <= MAX_VALUE_6_BITS) { - jmp = JMP_INSN_OPCODE | off; - print_insn_byte_wise(jmp, nfd); - } else if (off <= MAX_VALUE_14_BITS) { - jmp = LJMP_INSN_OPCODE | off; - print_insn_byte_wise(jmp, nfd); - } else { - jmp = LJMP_INSN_OPCODE | LJMP_INSN_MAX_OFFSET; - print_insn_byte_wise(jmp, nfd); - rem_off = off - MAX_VALUE_14_BITS; - - while (rem_off >= MAX_VALUE_14_BITS) { - rem_off -= MAX_VALUE_14_BITS; - jmp = LJMP_INSN_OPCODE | LJMP_INSN_MAX_OFFSET; - print_insn_byte_wise(jmp, nfd); - } - if (rem_off) { - if (rem_off <= MAX_VALUE_6_BITS) { - jmp = JMP_INSN_OPCODE | rem_off; - print_insn_byte_wise(jmp, nfd); - } - else { - jmp = LJMP_INSN_OPCODE | rem_off; - print_insn_byte_wise(jmp, nfd); - } - } - } -} - -static void print_sec_insn(int nfd, unsigned short sec_incr) -{ - unsigned int sec; - - sec = SEC_INSN_OPCODE | sec_incr; - print_insn_byte_wise(sec, nfd); - -} - -static void print_srel_insn(int nfd, unsigned short type, unsigned short symbol, int addend) -{ - unsigned int srel; - - if (symbol > MAX_SYMBOL) - error("Symbol index overflow!!! %d > %d\n", symbol, MAX_SYMBOL); - srel = SREL_INSN_OPCODE | (symbol << 4); - if (type == 0 && addend == 0) { - srel = srel | SREL_INSN_TA_0; - } else if (type == 0 && addend == 5) { - srel = srel | SREL_INSN_TA_1; - } else if (type == 1 && addend == -5) { - srel = srel | SREL_INSN_TA_2; - } else if (type == 1 && addend == -4) { - srel = srel | SREL_INSN_TA_3; - } else if (type == 1 && addend == 0) { - srel = srel | SREL_INSN_TA_4; - } else if (type == 1 && addend == 4) { - srel = srel | SREL_INSN_TA_5; - } else if (type == 2 && addend == 0) { - srel = srel | SREL_INSN_TA_6; - } else { - error("Unknown rel type and addend combination!!! %d %d\n", type, addend); - } - print_insn_byte_wise(srel, nfd); -} - -static void print_lrel_insn(int nfd, unsigned short type, unsigned short symbol, int addend) -{ - unsigned int lrel; - - if (symbol > MAX_SYMBOL) - error("Symbol index overflow!!! %d > %d\n", symbol, MAX_SYMBOL); - // LREL instruction: 111{R:2}{S:8}{A:19} - lrel = LREL_INSN_OPCODE | (type << 27) | (symbol << 19) | addend; - print_insn_byte_wise(lrel, nfd); -} - -static void print_srpr_insn(int nfd, int add_del) -{ - unsigned int srpr; - - if (add_del < 0) { - srpr = SRPR_INSN_OPCODE_SIGN_BIT_SET; - if (add_del != -16) { - srpr |= abs(add_del); - } - } else { - srpr = SRPR_INSN_OPCODE_SIGN_BIT_UNSET | add_del; - } - print_insn_byte_wise(srpr, nfd); -} - -static void print_lrpr_insn(int nfd, int add_del) -{ - unsigned int lrpr; - - if (add_del < 0) { - lrpr = LRPR_INSN_OPCODE_SIGN_BIT_SET; - if (add_del != -4096) - lrpr |= abs(add_del); - } else { - lrpr = LRPR_INSN_OPCODE_SIGN_BIT_UNSET | add_del; - } - print_insn_byte_wise(lrpr, nfd); -} - -static void relocation_comment(int ofd, int n, struct relocation *r) -{ - dprintf(ofd, "\n/* %6d %7d %4d %6d %8x %8d %7d */ ", n, - r->section, - r->type, - r->symbol, - r->offset, - r->addend, - bytecode_size); -} - -static void dump_canister_relocations_bytecode(int ofd) -{ - int i; - struct relocation *r, *p = &canister_relocations[0]; - unsigned short sec_incr = 0; - - dprintf(ofd, "const __section(\".init.rodata\") unsigned char canister_relocations_bytecode[] = {\n"); - dprintf(ofd, "/* N section type symbol offset addend BC IP -> bytecode (BC) */"); - relocation_comment(ofd, 0, p); - print_sec_insn(ofd, p->section); - print_jmp_insn(ofd, p->offset); - if (p->addend >= MIN_VALUE_3_BITS_SIGN && p->addend <= MAX_VALUE_3_BITS) { /* SREL INSN */ - print_srel_insn(ofd, p->type, p->symbol, p->addend); - } else if (p->addend > MAX_VALUE_3_BITS && p->addend <= MAX_VALUE_19_BITS) { /* LREL INSN */ - print_lrel_insn(ofd, p->type, p->symbol, p->addend); - } - - for (i = 1; i < n_relocs; i++) { - r = &canister_relocations[i]; - relocation_comment(ofd, i, r); - - if (p->section != r->section) { - sec_incr = r->section - p->section; - print_sec_insn(ofd, sec_incr); - } - - print_jmp_insn(ofd, r->offset); - - if (p->section == r->section && p->type == r->type && p->symbol == r->symbol && - ((r->addend - p->addend) >= MIN_VALUE_12_BITS_SIGN && (r->addend - p->addend) <= MAX_VALUE_12_BITS)) { - - int add_del = r->addend - p->addend; - - /* SRPR instructions */ - if (add_del >= MIN_VALUE_4_BITS_SIGN && add_del <= MAX_VALUE_4_BITS) { - print_srpr_insn(ofd, add_del); - } else { /* LRPR instructions */ - print_lrpr_insn(ofd, add_del); - } - - } else { /* REL instructions */ - if (r->addend >= MIN_VALUE_3_BITS_SIGN && r->addend <= MAX_VALUE_3_BITS) { /* SREL INSN */ - print_srel_insn(ofd, r->type, r->symbol, r->addend); - } else if (r->addend > MAX_VALUE_3_BITS && r->addend <= MAX_VALUE_19_BITS) { /* LREL INSN */ - print_lrel_insn(ofd, r->type, r->symbol, r->addend); - } - } - p = r; - } - dprintf(ofd, "};"); - dprintf(ofd, "\n\nconst unsigned int canister_relocations_bytecode_size = %d;\n", bytecode_size); -} - -int main (int argc, char *argv[]) -{ - int fd, ofd, sfd; - Elf *elf; - GElf_Ehdr ehdr; - Elf_Scn *section; - size_t shstrndx, strndx; - GElf_Shdr section_header; - char *name; - int n_syms = 0; - struct symbol_entry *symbols; - - if (elf_version(EV_CURRENT) == EV_NONE) - error("ELF library initialization failed"); - - /* Open input file, core canister */ - fd = open(argv[1], O_RDONLY); - if (fd == -1) - error("Cannot open input file"); - - elf = elf_begin(fd, ELF_C_READ, NULL); - if (elf == NULL) - error("Unable to parse input file"); - - if (elf_kind(elf) != ELF_K_ELF) - error("Input file is not ELF"); - - if (gelf_getehdr(elf, &ehdr) == NULL) - error("Unable to parse ELF file"); - - if (gelf_getclass(elf) != ELFCLASS64) - error("Expecting ELF64"); - - if (ehdr.e_type != ET_REL) - error("Expecting relocatable object file"); - - if (elf_getshdrstrndx(elf, &shstrndx) != 0) - error("Unable to find section header string table"); - - parse_sections(elf, shstrndx, &n_syms, &strndx); - /* n_syms is know, allocate symbols info table */ - symbols = (struct symbol_entry *)calloc(n_syms, sizeof (struct symbol_entry)); - - /* - * Walk through all sections again to find .rela.* sections we want - * to collect relocation from. - */ - section = NULL; - while ((section = elf_nextscn(elf, section)) != NULL) { - if (gelf_getshdr(section , §ion_header) != §ion_header) - error("getshdr() failed"); - - if (section_header.sh_type != SHT_RELA) - continue; - - if (!section_header.sh_info) - continue; - - if (!section_symbols[section_header.sh_info]) - continue; - - if ((name = elf_strptr(elf, shstrndx, section_header.sh_name )) == NULL) - error("elf_strptr () failed"); - - if (strncmp(name, ".rela", 5)) - continue; - - printf("Processing: %s\n", name); - - process_section(elf, section, section_header.sh_info, symbols, strndx); - } - elf_end(elf); - close(fd); - - /* Open output file, .c file with data for fips_integrity interpreter. */ - ofd = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - if (ofd == -1) - error("Cannot open output file"); - - sfd = open(argv[4], O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - if (sfd == -1) - error("Cannot open output symbols file %s", argv[4]); - /* - * Main rule for generated .c file: do not introduce new relocations - * as it won't be accounted (chicken-egg problem). - */ - dump_header(ofd, argv[0]); - dump_sections(ofd, sfd); - dump_symbols(ofd, sfd, symbols, n_syms); - dump_relocations(ofd, symbols); - - dump_canister_relocations_bytecode(ofd); - - close(ofd); - close(sfd); - - /* Linker script for final canister linking. */ - generate_ldscript(argv[3]); - return 0; -} - - diff --git a/SPECS/91/linux/canister_builder/crypto/partial_reloc.c b/SPECS/91/linux/canister_builder/crypto/partial_reloc.c deleted file mode 100644 index 4f482ffc29..0000000000 --- a/SPECS/91/linux/canister_builder/crypto/partial_reloc.c +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Canister object file relocations reducer. - * - * Copyright (c) 2025 Broadcom. All Rights Reserved. The term "Broadcom" - * refers to Broadcom Inc. and/or its subsidiaries. - * - * Author: Alexey Makhalov - * - * - * `ld -r` performs linking of multiple .o files into single canister object - * file (canister.o). Unfortunately, linker does not apply local relocations, - * but just combines all realocation together in corresponding .rela.* - * sections for later stages, which is vmlinux linking. - * It costs us increased canister_relocations_bytecode and canister_strtab - * tables as well as boot time penalty. - * - * There are 2 known cases where relocation can be locally applied: - * - Relocations for __kcfi_typeid_* ABS symbols produced by .S files. As - * their definitions are already in the canister object file. We can get - * rid of them completely. It will eliminate special handling logic in - * fips_integrity code. - * - PC-relative 32-bit relocation within the same section where relocation - * symbol is defined internally. Example: 2 functions A and B defined in - * .text section of the canister.o. And A calls B. B is local object. So, - * the distance between addresses of these functions will remain the same - * even after the final linking of vmlinux. Apply it now. - * - * Input: relocatable 64-bit x86_64 ELF object (ET_REL) to be modified to - * apply mentioned above local relocations and drop them from relocation - * sections. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef DEBUG -#define DEBUG 0 -#endif - -#if DEBUG -#define dbg(x...) printf(x...) -#else -#define dbg(x...) {} -#endif - -static void error(const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); - va_end(ap); - exit(EXIT_FAILURE); -} - -int main(int argc, char **argv) -{ - Elf *elf; - GElf_Ehdr ehdr; - Elf_Scn *scn = NULL, *symtab_scn = NULL; - GElf_Shdr symtab_shdr; - Elf_Data *symdata; - size_t nsym; - size_t sec_count; - Elf_Scn **scn_by_index; - - if (argc != 2) { - fprintf(stderr, "Usage: %s input.o", argv[0]); - return 2; - } - - const char *filename = argv[1]; - - if (elf_version(EV_CURRENT) == EV_NONE) - error("libelf initialization failed: %s", elf_errmsg(-1)); - - int fd = open(filename, O_RDWR); - if (fd < 0) - error("open(%s): %s", filename, strerror(errno)); - - elf = elf_begin(fd, ELF_C_RDWR, NULL); - if (!elf || (elf_kind(elf) != ELF_K_ELF)) - error("Not an ELF file"); - - if (!gelf_getehdr(elf, &ehdr)) - error("gelf_getehdr: %s", elf_errmsg(-1)); - - if (ehdr.e_type != ET_REL) - error("Input must be relocatable object (ET_REL)"); - - if ((ehdr.e_ident[EI_CLASS] != ELFCLASS64) || (ehdr.e_machine != EM_X86_64)) - error("Only x86_64 ELFCLASS64 supported"); - - /* Get symbol table */ - while ((scn = elf_nextscn(elf, scn)) != NULL) { - if (!gelf_getshdr(scn, &symtab_shdr)) error("gelf_getshdr: %s", elf_errmsg(-1)); - if (symtab_shdr.sh_type == SHT_SYMTAB) { - symtab_scn = scn; - break; - } - } - if (!symtab_scn) - error("No symbol table (SHT_SYMTAB) found"); - - symdata = elf_getdata(symtab_scn, NULL); - if (!symdata) - error("elf_getdata(symtab): %s", elf_errmsg(-1)); - nsym = symdata->d_size / symtab_shdr.sh_entsize; - - /* Map section index -> section */ - sec_count = ehdr.e_shnum; - scn_by_index = calloc(sec_count, sizeof(Elf_Scn*)); - if (!scn_by_index) - error("calloc() failed: %s", strerror(errno)); - - scn = NULL; - while ((scn = elf_nextscn(elf, scn)) != NULL) { - size_t idx = elf_ndxscn(scn); - if (idx < sec_count) - scn_by_index[idx] = scn; - } - -#if DEBUG - size_t shstrndx; - if (elf_getshdrstrndx(elf, &shstrndx) != 0) - error("Unable to find section header string table"); -#endif - - scn = NULL; - while ((scn = elf_nextscn(elf, scn)) != NULL) { - GElf_Shdr shdr; - size_t target_sec_idx, nrel; - Elf_Data *target_sec, *reldat; - unsigned char *relbuf; - size_t relbuf_size = 0; - - if (!gelf_getshdr(scn, &shdr)) - error("gelf_getshdr: %s", elf_errmsg(-1)); - - /* Canister has only .rela types */ - if (shdr.sh_type != SHT_RELA) - continue; - - target_sec_idx = shdr.sh_info; - if (target_sec_idx >= sec_count || scn_by_index[target_sec_idx] == NULL) - continue; - - target_sec = elf_getdata(scn_by_index[target_sec_idx], NULL); - if (!target_sec) - continue; - - reldat = elf_getdata(scn, NULL); - if (!reldat) - continue; - - nrel = reldat->d_size / shdr.sh_entsize; - if (nrel == 0) - continue; - -#if DEBUG - char *name = elf_strptr(elf, shstrndx, shdr.sh_name ); - if (!name) - error("elf_strptr() failed"); -#endif - - /* New relocation table */ - relbuf = malloc(reldat->d_size); - if (!relbuf) - error("malloc() failed: %s", strerror(errno)); - relbuf_size = 0; - - for (size_t i = 0; i < nrel; i++) { - GElf_Rela rela; - GElf_Sym sym; - int applied = 0; - - if (!gelf_getrela(reldat, i, &rela)) - error("gelf_getrela failed"); - - if (GELF_R_SYM(rela.r_info) >= nsym) - error("Relocation symbol index is out of boundary"); - - gelf_getsym(symdata, GELF_R_SYM(rela.r_info), &sym); - - switch (GELF_R_TYPE(rela.r_info)) { - /* - * __kcfi_typeid_* absolute symbols defined in accelerator's glue code, - * and used in corresponding .S files - */ - case R_X86_64_32: - if ((sym.st_shndx == SHN_ABS) && (rela.r_offset + 4 <= target_sec->d_size)) { - if (rela.r_addend) - error("non zero r_addend for ABS symbol"); - *(uint32_t *)((char*)target_sec->d_buf + rela.r_offset) = (uint32_t)sym.st_value; - applied = 1; - dbg("ABS32: %s:0x%lx <- %8lx\n", name+5, rela.r_offset, sym.st_value); - } - break; - /* - * .text referencing to itself as PC relative offset. - * The offset will remain the same after final linking in vmlinux. - */ - case R_X86_64_PC32: - case R_X86_64_PLT32: - if ((sym.st_shndx == target_sec_idx) && (rela.r_offset + 4 <= target_sec->d_size)) { - uint64_t value = (sym.st_value + rela.r_addend - rela.r_offset) & 0xffffffffu; - *(uint32_t *)((char*)target_sec->d_buf + rela.r_offset) = (uint32_t)value; - applied = 1; - dbg("PLT32: %s:0x%lx <- %8lx\n", name+5, rela.r_offset, value); - } - break; - } - - if (!applied) { - unsigned char *raw = (unsigned char*)reldat->d_buf + i * shdr.sh_entsize; - memcpy(relbuf + relbuf_size, raw, shdr.sh_entsize); - relbuf_size += shdr.sh_entsize; - } - } - - - /* No changes in the section, go next */ - if (relbuf_size == reldat->d_size) { - free(relbuf); - continue; - } - - /* Update relocation section, do not free relbuf */ - Elf_Data *first = elf_getdata(scn, NULL); - first->d_buf = relbuf; - first->d_size = relbuf_size; - shdr.sh_size = relbuf_size; - gelf_update_shdr(scn, &shdr); - } - - if (elf_update(elf, ELF_C_WRITE) < 0) - error("elf_update failed: %s", elf_errmsg(-1)); - - elf_end(elf); - close(fd); - return 0; -} - diff --git a/SPECS/91/linux/canister_builder/crypto/update_canister_hmac.sh b/SPECS/91/linux/canister_builder/crypto/update_canister_hmac.sh deleted file mode 100644 index 6f6ba99b6c..0000000000 --- a/SPECS/91/linux/canister_builder/crypto/update_canister_hmac.sh +++ /dev/null @@ -1,84 +0,0 @@ -#! /bin/bash -# -# HMAC injection and canister sanity check script -# -# Copyright (C) 2020 - 2022 VMware, Inc. -# Copyright (c) 2025 Broadcom. All Rights Reserved. The term "Broadcom" -# refers to Broadcom Inc. and/or its subsidiaries. -# -# Author: Alexey Makhalov -# - -set -e - -# Canister obj file -INPUT_FILE=$1 -# Generaged by gen_canister_relocs linker script -LD_SCRIPT=$2 -# Canister image to measure -RAW_FILE=canister.raw -# File with HMAC digest -HMAC_FILE=canister.hmac -KEY="FIPS-PH5-VMW2025" - -trap "exit 1" TERM -function abort() { - echo $1 - kill -s TERM $$ -} - -function fail_if_found() { - nm -u $INPUT_FILE | grep " U $1" > /dev/null && abort "Error: forbidden '$1' usage from the canister was found. Please fix it." ||: -} - -# Canister sanity check: -# Canister should not contain several undefuned symbols, -# it should use alternatives from wrapper instad. -fail_if_found _cond_resched -fail_if_found __kmalloc -fail_if_found kmem_cache_alloc_trace -fail_if_found __list_add_valid -fail_if_found __mutex_init -fail_if_found mutex_lock -fail_if_found mutex_unlock -fail_if_found queue_work_on -fail_if_found latent_entropy -fail_if_found _printk - -# Fail if any symbols are exported. All EXPORT_SYMBOL and EXPORT_SYMBOL_GPL -# usages must be moved to wrapper. This is to ensure the target kernel includes -# __ksymtab/__ksymtab_gpl and ___kcrctab/___kcrctab_gpl correctly. -# See below commit that necessitated this check. -# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=7b4537199a4a8480b8c3ba37a2d44765ce76cd9b -nm $INPUT_FILE | grep " r __ksymtab" > /dev/null && abort "Error: Exported symbols found in canister. Please move them to wrapper" ||: - -# Get sections list from linker script -sections=`grep ": {$" $LD_SCRIPT | cut -d " " -f3` -sfiles="" -for s in $sections; -do - # Extrace section - objcopy -O binary --only-section=$s ${INPUT_FILE} ${RAW_FILE}${s} - sfiles="$sfiles ${RAW_FILE}${s}" -done -# Concatenate all extracted section into canister image -cat $sfiles > ${RAW_FILE} -rm $sfiles - -# Measurement. -openssl dgst -sha256 -hmac $KEY -binary -out $HMAC_FILE $RAW_FILE - -# Get file offset to the canister_hmac placeholder. -# It is in the .init.rodata.canister_info section with 0 offset. -# NOTE: readelf output can be truncated to .data.canist[...] -str=`eu-readelf -S ${INPUT_FILE} | grep init.rodata.canister_info` -test -z "$str" && exit 1 -# return last word -#offset=0x${str##* } -# return 5th word -offset=0x$(echo $str | awk '{print $5}') -# HMAC digest injection -dd if=$HMAC_FILE of=${INPUT_FILE} seek=$((offset)) bs=1 count=32 conv=notrunc status=none - -rm $RAW_FILE $HMAC_FILE - diff --git a/SPECS/91/linux/canister_builder/patches/0001-crypto-Moving-rfc4543-out-of-canister-boundry.patch b/SPECS/91/linux/canister_builder/patches/0001-crypto-Moving-rfc4543-out-of-canister-boundry.patch deleted file mode 100644 index 81dbd82992..0000000000 --- a/SPECS/91/linux/canister_builder/patches/0001-crypto-Moving-rfc4543-out-of-canister-boundry.patch +++ /dev/null @@ -1,113 +0,0 @@ -From c505695037dfed0c9df0d2a28bcd686dff9590fd Mon Sep 17 00:00:00 2001 -From: Ankit Jain -Date: Wed, 8 Oct 2025 08:09:02 +0000 -Subject: [PATCH] crypto: Moving rfc4543 out of canister boundry - -- Do not register and compile rfc4543 in canister - build -- Return EINVAL in fips mode - -Signed-off-by: Ankit Jain ---- - crypto/gcm.c | 25 +++++++++++++++++++++++-- - 1 file changed, 23 insertions(+), 2 deletions(-) - -diff --git a/crypto/gcm.c b/crypto/gcm.c -index 84f7c23d1..7dbfdb9da 100644 ---- a/crypto/gcm.c -+++ b/crypto/gcm.c -@@ -18,7 +18,9 @@ - #include - #include - #include -+#include - -+#ifdef FIPS_CANISTER - struct gcm_instance_ctx { - struct crypto_skcipher_spawn ctr; - struct crypto_ahash_spawn ghash; -@@ -40,6 +42,7 @@ struct crypto_rfc4106_req_ctx { - struct aead_request subreq; - }; - -+#else - struct crypto_rfc4543_instance_ctx { - struct crypto_aead_spawn aead; - }; -@@ -53,7 +56,9 @@ struct crypto_rfc4543_ctx { - struct crypto_rfc4543_req_ctx { - struct aead_request subreq; - }; -+#endif - -+#ifdef FIPS_CANISTER - struct crypto_gcm_ghash_ctx { - unsigned int cryptlen; - struct scatterlist *src; -@@ -78,9 +83,17 @@ static struct { - u8 buf[16]; - struct scatterlist sg; - } *gcm_zeroes; -+#endif - -+#ifndef FIPS_CANISTER -+int crypto_rfc4543_create(struct crypto_template *tmpl, -+ struct rtattr **tb); - static int crypto_rfc4543_copy_src_to_dst(struct aead_request *req, bool enc); -+#endif - -+#ifdef FIPS_CANISTER -+extern int crypto_rfc4543_create(struct crypto_template *tmpl, -+ struct rtattr **tb); - static inline struct crypto_gcm_req_priv_ctx *crypto_gcm_reqctx( - struct aead_request *req) - { -@@ -891,6 +904,7 @@ static int crypto_rfc4106_create(struct crypto_template *tmpl, - } - return err; - } -+#else - - static int crypto_rfc4543_setkey(struct crypto_aead *parent, const u8 *key, - unsigned int keylen) -@@ -1035,7 +1049,7 @@ static void crypto_rfc4543_free(struct aead_instance *inst) - kfree(inst); - } - --static int crypto_rfc4543_create(struct crypto_template *tmpl, -+int crypto_rfc4543_create(struct crypto_template *tmpl, - struct rtattr **tb) - { - u32 mask; -@@ -1044,6 +1058,10 @@ static int crypto_rfc4543_create(struct crypto_template *tmpl, - struct crypto_rfc4543_instance_ctx *ctx; - int err; - -+ /* crypto rfc4543 is not allowed in fips mode. */ -+ if (fips_enabled) -+ return -EINVAL; -+ - err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_AEAD, &mask); - if (err) - return err; -@@ -1106,7 +1124,9 @@ static int crypto_rfc4543_create(struct crypto_template *tmpl, - } - return err; - } -+#endif - -+#ifdef FIPS_CANISTER - static struct crypto_template crypto_gcm_tmpls[] = { - { - .name = "gcm_base", -@@ -1160,5 +1180,6 @@ MODULE_DESCRIPTION("Galois/Counter Mode"); - MODULE_AUTHOR("Mikko Herranen "); - MODULE_ALIAS_CRYPTO("gcm_base"); - MODULE_ALIAS_CRYPTO("rfc4106"); --MODULE_ALIAS_CRYPTO("rfc4543"); - MODULE_ALIAS_CRYPTO("gcm"); -+MODULE_ALIAS_CRYPTO("rfc4543"); -+#endif --- -2.40.4 - diff --git a/SPECS/91/linux/canister_builder/patches/0001-crypto-ecb-Set-ecb-alg-flag-as-Internal.patch b/SPECS/91/linux/canister_builder/patches/0001-crypto-ecb-Set-ecb-alg-flag-as-Internal.patch deleted file mode 100644 index 4b89fccebc..0000000000 --- a/SPECS/91/linux/canister_builder/patches/0001-crypto-ecb-Set-ecb-alg-flag-as-Internal.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 3f3d0258215fc518bc4dcfa61dcfa44b6250f2bb Mon Sep 17 00:00:00 2001 -From: srinidhira0 -Date: Wed, 3 Dec 2025 10:48:10 +0000 -Subject: [PATCH] crypto:ecb: Set ecb alg flag as Internal. - - - ECB algorithm is not part of canister and there is no requirement - to expose ECB to external interfaces. However, ECB is still required - by other AES variants such as ctr-aes, gcm-aes etc. Due to this - fips_allowed flag for ecb cannot be disabled as dependent algo's - self test will fail in FIPS mode. - Hence set cra_flags for ECB algo as CRYPTO_ALG_FIPS_INTERNAL such that - ECB is not exposed through AF_ALG but will be available other AES - variants. - -Signed-off-by: srinidhira0 ---- - arch/x86/crypto/aesni-intel_glue.c | 2 +- - crypto/ecb.c | 12 ++++++++++++ - crypto/skcipher.c | 8 ++++++++ - 3 files changed, 21 insertions(+), 1 deletion(-) - -diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c -index cbed67a0d782..43b5d3aa3c2d 100644 ---- a/arch/x86/crypto/aesni-intel_glue.c -+++ b/arch/x86/crypto/aesni-intel_glue.c -@@ -695,7 +695,7 @@ static struct skcipher_alg aesni_skciphers[] = { - .cra_name = "__ecb(aes)", - .cra_driver_name = "__ecb-aes-aesni", - .cra_priority = 400, -- .cra_flags = CRYPTO_ALG_INTERNAL, -+ .cra_flags = CRYPTO_ALG_INTERNAL | CRYPTO_ALG_FIPS_INTERNAL, - .cra_blocksize = AES_BLOCK_SIZE, - .cra_ctxsize = CRYPTO_AES_CTX_SIZE, - .cra_module = THIS_MODULE, -diff --git a/crypto/ecb.c b/crypto/ecb.c -index e3a67789050e..b9fb7a995b5e 100644 ---- a/crypto/ecb.c -+++ b/crypto/ecb.c -@@ -12,6 +12,7 @@ - #include - #include - #include -+#include - - static int crypto_ecb_crypt(struct crypto_cipher *cipher, const u8 *src, - u8 *dst, unsigned nbytes, bool final, -@@ -126,6 +127,14 @@ static struct lskcipher_instance *lskcipher_alloc_instance_simple2( - inst->free = lskcipher_free_instance_simple2; - - /* Default algorithm properties, can be overridden */ -+ /* -+ * Mark ECB as Internal as it is outside FIPS canister and -+ * there is no requirement for the ECB to be exposed to user space -+ * through AF_ALG -+ */ -+ if (fips_enabled) -+ inst->alg.co.base.cra_flags |= CRYPTO_ALG_FIPS_INTERNAL; -+ - inst->alg.co.base.cra_blocksize = cipher_alg->cra_blocksize; - inst->alg.co.base.cra_alignmask = cipher_alg->cra_alignmask; - inst->alg.co.base.cra_priority = cipher_alg->cra_priority; -@@ -189,6 +198,9 @@ static int crypto_ecb_create(struct crypto_template *tmpl, struct rtattr **tb) - if (cipher_alg->co.ivsize) - return -EINVAL; - -+ if (fips_enabled) -+ inst->alg.co.base.cra_flags |= CRYPTO_ALG_FIPS_INTERNAL; -+ - inst->alg.co.base.cra_ctxsize = cipher_alg->co.base.cra_ctxsize; - inst->alg.setkey = cipher_alg->setkey; - inst->alg.encrypt = cipher_alg->encrypt; -diff --git a/crypto/skcipher.c b/crypto/skcipher.c -index fd3273b519dc..492168f2f11f 100644 ---- a/crypto/skcipher.c -+++ b/crypto/skcipher.c -@@ -23,6 +23,8 @@ - #include - #include - #include -+#include -+#include - #include - #include "skcipher.h" - -@@ -917,6 +919,12 @@ int crypto_register_skcipher(struct skcipher_alg *alg) - struct crypto_alg *base = &alg->base; - int err; - -+ /* ECB is not exposed through AF_ALG when fips_enabled is set. */ -+ if (unlikely(!fips_enabled && -+ strnstr(base->cra_driver_name, "ecb-aes-aesni", -+ CRYPTO_MAX_ALG_NAME))) -+ base->cra_flags &= ~CRYPTO_ALG_FIPS_INTERNAL; -+ - err = skcipher_prepare_alg(alg); - if (err) - return err; --- -2.35.6 - diff --git a/SPECS/91/linux/canister_builder/patches/0002-algapi.c-honor-fcw_skip_tests.patch b/SPECS/91/linux/canister_builder/patches/0002-algapi.c-honor-fcw_skip_tests.patch deleted file mode 100644 index 549d853c7d..0000000000 --- a/SPECS/91/linux/canister_builder/patches/0002-algapi.c-honor-fcw_skip_tests.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 9d3d9392a1b2b5b18b0d5712b54d8893ac01d064 Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Sun, 24 Aug 2025 18:28:03 +0000 -Subject: [PATCH] crypto/algapi.c: honor fcw_skip_tests() - -linux-esx does not need to run alg tests in non fips mode. Skip triggerring -them from algapi layer. - -algboss.c within the canister boundary already handles fcw_skip_tests(), -without corresponding change in algapi.c we catch WARN_ON: - -[ 0.913791] WARNING: CPU: 0 PID: 1 at crypto/api.c:176 crypto_schedule_test+0x66/0x80 -[ 0.914682] Modules linked in: -[ 0.916138] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.1-20.ph5+ #20 -[ 0.918684] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014 -[ 0.922682] RIP: 0010:crypto_schedule_test+0x66/0x80 -[ 0.924775] Code: c6 3a 82 81 82 bf 01 00 00 00 e8 65 52 a6 ff 48 89 da be 01 00 00 00 48 c7 c7 20 43 25 83 e8 e1 36 9d ff 3d 01 80 00 00 74 ca <0f> 0b 48 8b 5d f8 c9 c3 cc cc cc cc 66 66 2e 0f 1f 84 00 00 00 00 -[ 0.926682] RSP: 0000:ffffc90000013d38 EFLAGS: 00010297 -[ 0.929180] RAX: 0000000000000000 RBX: ffffffff8325d808 RCX: c0000000ffffdfff -[ 0.930685] RDX: 0000000000000000 RSI: 00000000ffffdfff RDI: ffffffff83254320 -[ 0.933559] RBP: ffffc90000013d40 R08: 0000000000000000 R09: 0000000000000003 -[ 0.934681] R10: ffffc90000013af8 R11: ffffffff8314b888 R12: 0000000000000000 -[ 0.937631] R13: ffffc90000013d58 R14: ffffffff8366f5d0 R15: 0000000000000004 -[ 0.938686] FS: 0000000000000000(0000) GS:ffff88807dc00000(0000) knlGS:0000000000000000 -[ 0.942238] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 -[ 0.942681] CR2: ffff888003c01000 CR3: 0000000003032001 CR4: 0000000000770ef0 -[ 0.945860] PKRU: 55555554 -[ 0.946683] Call Trace: -[ 0.947677] -[ 0.948603] ? show_regs+0x64/0x70 -[ 0.950092] ? __warn+0x8d/0x140 -[ 0.950682] ? crypto_schedule_test+0x66/0x80 -[ 0.952572] ? report_bug+0x171/0x1a0 -[ 0.954093] ? handle_bug+0x60/0xb0 -[ 0.954685] ? exc_invalid_op+0x18/0x70 -[ 0.956304] ? asm_exc_invalid_op+0x1b/0x20 -[ 0.958083] ? crypto_schedule_test+0x66/0x80 -[ 0.958681] ? crypto_schedule_test+0x5f/0x80 -[ 0.960514] crypto_register_alg+0x9a/0xe0 -[ 0.962294] crypto_register_shashes+0x93/0x170 -[ 0.962682] sha3_generic_mod_init+0x1d/0x70 -[ 0.964422] fcw_arch_initcall+0x1e/0x50 -[ 0.966041] ? __cfi_fcw_arch_initcall+0x10/0x10 -[ 0.966684] do_one_initcall+0x59/0x330 -[ 0.968395] kernel_init_freeable+0x435/0x645 -[ 0.970162] ? __cfi_kernel_init+0x10/0x10 -[ 0.970681] kernel_init+0x1a/0x1d0 -[ 0.972079] ret_from_fork+0x4a/0x70 -[ 0.973591] ? __cfi_kernel_init+0x10/0x10 -[ 0.974682] ret_from_fork_asm+0x1a/0x30 -[ 0.976260] - -Signed-off-by: Alexey Makhalov ---- - crypto/algapi.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/crypto/algapi.c b/crypto/algapi.c -index 004d27e41..3700c4c5d 100644 ---- a/crypto/algapi.c -+++ b/crypto/algapi.c -@@ -20,6 +20,7 @@ - #include - - #include "internal.h" -+#include "fips_canister_wrapper.h" - - static LIST_HEAD(crypto_template_list); - -@@ -268,6 +269,7 @@ static struct crypto_larval *crypto_alloc_test_larval(struct crypto_alg *alg) - - if (!IS_ENABLED(CONFIG_CRYPTO_MANAGER) || - IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS) || -+ fcw_skip_tests() || - (alg->cra_flags & CRYPTO_ALG_INTERNAL)) - return NULL; /* No self-test needed */ - -@@ -1022,6 +1024,9 @@ static void __init crypto_start_tests(void) - if (IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS)) - return; - -+ if (fcw_skip_tests()) -+ return; -+ - set_crypto_boot_test_finished(); - - for (;;) { --- -2.40.4 - diff --git a/SPECS/91/linux/canister_builder/patches/0003-tcrypt-align-to-LKCM.patch b/SPECS/91/linux/canister_builder/patches/0003-tcrypt-align-to-LKCM.patch deleted file mode 100644 index 5e3c1780b7..0000000000 --- a/SPECS/91/linux/canister_builder/patches/0003-tcrypt-align-to-LKCM.patch +++ /dev/null @@ -1,166 +0,0 @@ -From d65caefcfd145be14b1c41f7defd4dabf74217ba Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Wed, 20 Nov 2019 10:52:57 +0530 -Subject: [PATCH] tcrypt: align to LKCM - -1. Disable algorithmic tests which are fips_allowed and not supported in photon. -2. Added tests for DRBG and ECDH algorithms. -3. enable tests for newly included algorithms in LKCM 5.0 - -Signed-off-by: Keerthana K -Signed-off-by: Bo Gan -Signed-off-by: Srish Srinivasan - -[Srinidhi Rao Ported this patch v6.12.y] -Signed-off-by: srinidhira0 - -[Alexey: Rename and make it part of the canister_usage] -Signed-off-by: Alexey Makhalov ---- - crypto/tcrypt.c | 70 +++++++++++++++++++++++++++++++++++++------------ - 1 file changed, 53 insertions(+), 17 deletions(-) - -diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c -index e9e7dceb606e..02c05ef61957 100644 ---- a/crypto/tcrypt.c -+++ b/crypto/tcrypt.c -@@ -1472,7 +1472,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) - break; - - case 2: -- ret = min(ret, tcrypt_test("sha1")); - break; - - case 3: -@@ -1618,10 +1617,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) - ret = min(ret, tcrypt_test("gcm(aes)")); - break; - -- case 36: -- ret = min(ret, tcrypt_test("lzo")); -- break; -- - case 37: - ret = min(ret, tcrypt_test("ccm(aes)")); - break; -@@ -1711,7 +1706,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) - break; - - case 101: -- ret = min(ret, tcrypt_test("hmac(sha1)")); - break; - - case 102: -@@ -1758,10 +1752,63 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) - ret = min(ret, tcrypt_test("hmac(sha3-512)")); - break; - -+ case 117: -+ ret = min(ret, tcrypt_test("ecdsa-nist-p256")); -+ ret = min(ret, tcrypt_test("ecdsa-nist-p384")); -+ break; -+ -+ case 119: -+ ret += tcrypt_test("drbg_pr_ctr_aes128"); -+ ret += tcrypt_test("drbg_pr_ctr_aes192"); -+ ret += tcrypt_test("drbg_pr_ctr_aes256"); -+ break; -+ -+ case 121: -+ ret += tcrypt_test("drbg_pr_hmac_sha256"); -+ ret += tcrypt_test("drbg_pr_hmac_sha384"); -+ ret += tcrypt_test("drbg_pr_hmac_sha512"); -+ break; -+ -+ case 125: -+ ret += tcrypt_test("drbg_nopr_ctr_aes128"); -+ ret += tcrypt_test("drbg_nopr_ctr_aes192"); -+ ret += tcrypt_test("drbg_nopr_ctr_aes256"); -+ break; -+ -+ case 126: -+ ret += tcrypt_test("drbg_nopr_hmac_sha256"); -+ ret += tcrypt_test("drbg_nopr_hmac_sha384"); -+ ret += tcrypt_test("drbg_nopr_hmac_sha512"); -+ break; -+ -+ case 130: -+ ret += tcrypt_test("ecdh-nist-p256"); -+ ret += tcrypt_test("ecdh-nist-p384"); -+ break; -+ -+ case 132: -+ ret += tcrypt_test("drbg_pr_sha256"); -+ ret += tcrypt_test("drbg_pr_sha384"); -+ ret += tcrypt_test("drbg_pr_sha512"); -+ break; -+ - case 115: - ret = min(ret, tcrypt_test("hmac(streebog256)")); - break; - -+ case 133: -+ ret += tcrypt_test("drbg_nopr_sha256"); -+ ret += tcrypt_test("drbg_nopr_sha384"); -+ ret += tcrypt_test("drbg_nopr_sha512"); -+ break; -+ -+ case 134: -+ ret += tcrypt_test("pkcs1pad(rsa,sha224)"); -+ ret += tcrypt_test("pkcs1pad(rsa,sha256)"); -+ ret += tcrypt_test("pkcs1pad(rsa,sha384)"); -+ ret += tcrypt_test("pkcs1pad(rsa,sha512)"); -+ break; -+ - case 116: - ret = min(ret, tcrypt_test("hmac(streebog512)")); - break; -@@ -1787,7 +1834,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) - break; - - case 155: -- ret = min(ret, tcrypt_test("authenc(hmac(sha1),cbc(aes))")); - break; - - case 156: -@@ -1795,7 +1841,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) - break; - - case 157: -- ret = min(ret, tcrypt_test("authenc(hmac(sha1),ecb(cipher_null))")); - break; - - case 158: -@@ -1811,7 +1856,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) - break; - - case 181: -- ret = min(ret, tcrypt_test("authenc(hmac(sha1),cbc(des))")); - break; - case 182: - ret = min(ret, tcrypt_test("authenc(hmac(sha1),cbc(des3_ede))")); -@@ -2223,10 +2267,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) - test_hash_speed("md5", sec, generic_hash_speed_template); - if (mode > 300 && mode < 400) break; - fallthrough; -- case 303: -- test_hash_speed("sha1", sec, generic_hash_speed_template); -- if (mode > 300 && mode < 400) break; -- fallthrough; - case 304: - test_hash_speed("sha256", sec, generic_hash_speed_template); - if (mode > 300 && mode < 400) break; -@@ -2331,10 +2371,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) - test_ahash_speed("md5", sec, generic_hash_speed_template); - if (mode > 400 && mode < 500) break; - fallthrough; -- case 403: -- test_ahash_speed("sha1", sec, generic_hash_speed_template); -- if (mode > 400 && mode < 500) break; -- fallthrough; - case 404: - test_ahash_speed("sha256", sec, generic_hash_speed_template); - if (mode > 400 && mode < 500) break; --- -2.39.4 - diff --git a/SPECS/91/linux/canister_builder/patches/0006-crypto-Disable-rsa-pkcs1pad-encrypt-decrypt-in-FIPS-.patch b/SPECS/91/linux/canister_builder/patches/0006-crypto-Disable-rsa-pkcs1pad-encrypt-decrypt-in-FIPS-.patch deleted file mode 100644 index 3cdea6e92e..0000000000 --- a/SPECS/91/linux/canister_builder/patches/0006-crypto-Disable-rsa-pkcs1pad-encrypt-decrypt-in-FIPS-.patch +++ /dev/null @@ -1,130 +0,0 @@ -From 61573e075f8fef1e6748dcb3fe79772da603994d Mon Sep 17 00:00:00 2001 -From: Vamsi Krishna Brahmajosyula -Date: Mon, 13 Oct 2025 08:37:40 +0000 -Subject: [PATCH] crypto: Disable rsa-pkcs1pad encrypt/decrypt in FIPS mode - -FIPS 186-5 does not allow rsa pkcs1pad encrypt/decrypt, therefore -move the methods out of canister and fail when fips is enabled. - -Signed-off-by: Ankit Jain ---- - crypto/rsa-pkcs1pad.c | 32 ++++++++++++++++++++++++++++++-- - 1 file changed, 30 insertions(+), 2 deletions(-) - -diff --git a/crypto/rsa-pkcs1pad.c b/crypto/rsa-pkcs1pad.c -index cd501195f..bae137b18 100644 ---- a/crypto/rsa-pkcs1pad.c -+++ b/crypto/rsa-pkcs1pad.c -@@ -15,7 +15,9 @@ - #include - #include - #include -+#include - -+#ifdef FIPS_CANISTER - /* - * Hash algorithm OIDs plus ASN.1 DER wrappings [RFC4880 sec 5.2.2]. - */ -@@ -110,16 +112,19 @@ static const struct rsa_asn1_template *rsa_lookup_asn1(const char *name) - return p; - return NULL; - } -+#endif /* FIPS_CANISTER */ - - struct pkcs1pad_ctx { - struct crypto_akcipher *child; - unsigned int key_size; - }; - -+#ifdef FIPS_CANISTER - struct pkcs1pad_inst_ctx { - struct crypto_akcipher_spawn spawn; - const struct rsa_asn1_template *digest_info; - }; -+#endif /* FIPS_CANISTER */ - - struct pkcs1pad_request { - struct scatterlist in_sg[2], out_sg[1]; -@@ -127,6 +132,10 @@ struct pkcs1pad_request { - struct akcipher_request child_req; - }; - -+#ifdef FIPS_CANISTER -+extern int pkcs1pad_encrypt(struct akcipher_request *req); -+extern int pkcs1pad_decrypt(struct akcipher_request *req); -+ - static int pkcs1pad_set_pub_key(struct crypto_akcipher *tfm, const void *key, - unsigned int keylen) - { -@@ -181,6 +190,7 @@ static unsigned int pkcs1pad_get_max_size(struct crypto_akcipher *tfm) - - return ctx->key_size; - } -+#endif /* FIPS_CANISTER */ - - static void pkcs1pad_sg_set_buf(struct scatterlist *sg, void *buf, size_t len, - struct scatterlist *next) -@@ -246,7 +256,11 @@ static void pkcs1pad_encrypt_sign_complete_cb(void *data, int err) - akcipher_request_complete(req, err); - } - --static int pkcs1pad_encrypt(struct akcipher_request *req) -+#ifndef FIPS_CANISTER -+int pkcs1pad_encrypt(struct akcipher_request *req); -+int pkcs1pad_decrypt(struct akcipher_request *req); -+ -+int pkcs1pad_encrypt(struct akcipher_request *req) - { - struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req); - struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm); -@@ -254,6 +268,12 @@ static int pkcs1pad_encrypt(struct akcipher_request *req) - int err; - unsigned int i, ps_end; - -+ -+ if (fips_enabled) { -+ pr_warn_once("rsa pkcs1pad encrypt is not allowed in fips mode.\n"); -+ return -EINVAL; -+ } -+ - if (!ctx->key_size) - return -EINVAL; - -@@ -361,13 +381,18 @@ static void pkcs1pad_decrypt_complete_cb(void *data, int err) - akcipher_request_complete(req, err); - } - --static int pkcs1pad_decrypt(struct akcipher_request *req) -+int pkcs1pad_decrypt(struct akcipher_request *req) - { - struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req); - struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm); - struct pkcs1pad_request *req_ctx = akcipher_request_ctx(req); - int err; - -+ if (fips_enabled) { -+ pr_warn_once("rsa pkcs1pad decrypt is not allowed in fips mode.\n"); -+ return -EINVAL; -+ } -+ - if (!ctx->key_size || req->src_len != ctx->key_size) - return -EINVAL; - -@@ -393,7 +418,9 @@ static int pkcs1pad_decrypt(struct akcipher_request *req) - - return err; - } -+#endif /* !FIPS_CANISTER */ - -+#ifdef FIPS_CANISTER - static int pkcs1pad_sign(struct akcipher_request *req) - { - struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req); -@@ -712,3 +739,4 @@ struct crypto_template rsa_pkcs1pad_tmpl = { - }; - - MODULE_ALIAS_CRYPTO("pkcs1pad"); -+#endif /* FIPS_CANISTER */ --- -2.40.4 - diff --git a/SPECS/91/linux/canister_builder/patches/0007-aead-add-internal_iv-field.patch b/SPECS/91/linux/canister_builder/patches/0007-aead-add-internal_iv-field.patch deleted file mode 100644 index f86711e9e6..0000000000 --- a/SPECS/91/linux/canister_builder/patches/0007-aead-add-internal_iv-field.patch +++ /dev/null @@ -1,124 +0,0 @@ -From af18e5c4a4b484c3127e3427c87f68e99e8b32ae Mon Sep 17 00:00:00 2001 -From: Brennan Lamoreaux -Date: Thu, 25 Sep 2025 18:14:41 +0000 -Subject: [PATCH] aead: add internal_iv field - -Add internal_iv field, used to mark request as using -an internally generated IV (e.g from seqiv). - -Also, change to kzalloc for request allocation to ensure -all request fields are zeroed out at the beginning. - -Signed-off-by: Brennan Lamoreaux ---- - crypto/aead.c | 42 ++++++++++++++++++++++++++++++++++ - include/crypto/aead.h | 7 ++++-- - include/crypto/internal/aead.h | 5 +++- - 3 files changed, 51 insertions(+), 3 deletions(-) - -diff --git a/crypto/aead.c b/crypto/aead.c -index cade53241..06af40b1c 100644 ---- a/crypto/aead.c -+++ b/crypto/aead.c -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include - #include - - #include "internal.h" -@@ -290,5 +291,46 @@ int aead_register_instance(struct crypto_template *tmpl, - } - EXPORT_SYMBOL_GPL(aead_register_instance); - -+static u8 internal_iv_magic = 0; -+static DEFINE_SPINLOCK(internal_iv_magic_lock); -+int aead_request_mark_internal_iv(struct aead_request *req) { -+ int err; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&internal_iv_magic_lock, flags); -+ while(!internal_iv_magic) { -+ err = crypto_get_default_rng(); -+ if(err) -+ break; -+ -+ err = crypto_rng_get_bytes(crypto_default_rng, (u8 *) &internal_iv_magic, -+ sizeof(internal_iv_magic)); -+ crypto_put_default_rng(); -+ if(err) -+ break; -+ } -+ spin_unlock_irqrestore(&internal_iv_magic_lock, flags); -+ -+ if(err) -+ return err; -+ -+ req->internal_iv = internal_iv_magic; -+ return 0; -+} -+ -+int aead_request_is_internal_iv(struct aead_request *req) { -+ unsigned long flags; -+ int ret; -+ -+ if(!req->internal_iv) -+ return 0; -+ -+ spin_lock_irqsave(&internal_iv_magic_lock, flags); -+ ret = (req->internal_iv == internal_iv_magic); -+ spin_unlock_irqrestore(&internal_iv_magic_lock, flags); -+ -+ return ret; -+} -+ - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Authenticated Encryption with Associated Data (AEAD)"); -diff --git a/include/crypto/aead.h b/include/crypto/aead.h -index 0e8a41638..8c8021b86 100644 ---- a/include/crypto/aead.h -+++ b/include/crypto/aead.h -@@ -85,6 +85,7 @@ struct scatterlist; - * @iv: Initialisation vector - * @src: Source data - * @dst: Destination data -+ * @internal_iv: Marks IV as internal - * @__ctx: Start of private context data - */ - struct aead_request { -@@ -98,6 +99,8 @@ struct aead_request { - struct scatterlist *src; - struct scatterlist *dst; - -+ u8 internal_iv; -+ - void *__ctx[] CRYPTO_MINALIGN_ATTR; - }; - -@@ -433,7 +436,7 @@ static inline struct aead_request *aead_request_alloc(struct crypto_aead *tfm, - { - struct aead_request *req; - -- req = kmalloc(sizeof(*req) + crypto_aead_reqsize(tfm), gfp); -+ req = kzalloc(sizeof(*req) + crypto_aead_reqsize(tfm), gfp); - - if (likely(req)) - aead_request_set_tfm(req, tfm); -diff --git a/include/crypto/internal/aead.h b/include/crypto/internal/aead.h -index 28a95eb31..ddd99f92d 100644 ---- a/include/crypto/internal/aead.h -+++ b/include/crypto/internal/aead.h -@@ -163,6 +163,9 @@ int crypto_register_aeads(struct aead_alg *algs, int count); - void crypto_unregister_aeads(struct aead_alg *algs, int count); - int aead_register_instance(struct crypto_template *tmpl, - struct aead_instance *inst); -+int aead_request_is_internal_iv(struct aead_request *req); -+int aead_request_mark_internal_iv(struct aead_request *req); -+ - - #endif /* _CRYPTO_INTERNAL_AEAD_H */ - --- -2.40.4 - diff --git a/SPECS/91/linux/canister_builder/patches/0008-FIPS-Mark-structure-field-differences-between-kernel.patch b/SPECS/91/linux/canister_builder/patches/0008-FIPS-Mark-structure-field-differences-between-kernel.patch deleted file mode 100644 index acac62eabb..0000000000 --- a/SPECS/91/linux/canister_builder/patches/0008-FIPS-Mark-structure-field-differences-between-kernel.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 72534194554a8e1fdbe70952edb181dc9112798c Mon Sep 17 00:00:00 2001 -From: Brennan Lamoreaux -Date: Wed, 27 Aug 2025 17:31:01 +0000 -Subject: [PATCH] FIPS: Mark structure field differences between kernel and - canister - -Use the newly added plugin attribute to mark the intentional type differences -between structure fields. These will be allowed to pass the matching -type check in the matching GCC plugin. - -Signed-off-by: Brennan Lamoreaux - -[Alexey: Make it compatible with canister_build] -Signed-off-by: Alexey Makhalov ---- - include/linux/plugin-attr.h | 9 +++++++++ - include/linux/swait.h | 7 ++++++- - 2 files changed, 15 insertions(+), 1 deletion(-) - create mode 100644 include/linux/plugin-attr.h - -diff --git a/include/linux/plugin-attr.h b/include/linux/plugin-attr.h -new file mode 100644 -index 000000000..386a90eac ---- /dev/null -+++ b/include/linux/plugin-attr.h -@@ -0,0 +1,9 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+ -+/* This attribute is only registered by the match_canister_structs plugin */ -+#ifdef MATCH_CANISTER_STRUCTS -+#define CANISTER_MISMATCH(KERN_TYPE, CANISTER_TYPE) \ -+ __attribute__((canister_mismatch(KERN_TYPE, CANISTER_TYPE))) -+#else -+#define CANISTER_MISMATCH(KERN_TYPE, CANISTER_TYPE) -+#endif -diff --git a/include/linux/swait.h b/include/linux/swait.h -index d32441948..f6662ea40 100644 ---- a/include/linux/swait.h -+++ b/include/linux/swait.h -@@ -7,6 +7,7 @@ - #include - #include - #include -+#include - - /* - * Simple waitqueues are semantically very different to regular wait queues -@@ -41,7 +42,11 @@ - struct task_struct; - - struct swait_queue_head { -- raw_spinlock_t lock; -+#ifdef FIPS_CANISTER -+ unsigned char lock[sizeof(raw_spinlock_t)]; -+#else -+ raw_spinlock_t lock CANISTER_MISMATCH("struct raw_spinlock_t", "unsigned char[4]"); -+#endif - struct list_head task_list; - }; - --- -2.40.4 - diff --git a/SPECS/91/linux/canister_builder/patches/0009-aead_geniv_ctx-drop-lock-field.patch b/SPECS/91/linux/canister_builder/patches/0009-aead_geniv_ctx-drop-lock-field.patch deleted file mode 100644 index 5eb777521e..0000000000 --- a/SPECS/91/linux/canister_builder/patches/0009-aead_geniv_ctx-drop-lock-field.patch +++ /dev/null @@ -1,42 +0,0 @@ -From ee8a90adafe791137795628d88708037034371a7 Mon Sep 17 00:00:00 2001 -From: Brennan Lamoreaux -Date: Thu, 24 Jul 2025 17:58:12 +0000 -Subject: [PATCH] aead_geniv_ctx: drop lock field - -Drop lock field for aead_geniv_ctx to match canister version. -This lock is never used. - -Signed-off-by: Brennan Lamoreaux ---- - crypto/geniv.c | 2 -- - include/crypto/internal/geniv.h | 1 - - 2 files changed, 3 deletions(-) - -diff --git a/crypto/geniv.c b/crypto/geniv.c -index bee4621b4..a1f98fe54 100644 ---- a/crypto/geniv.c -+++ b/crypto/geniv.c -@@ -113,8 +113,6 @@ int aead_init_geniv(struct crypto_aead *aead) - struct crypto_aead *child; - int err; - -- spin_lock_init(&ctx->lock); -- - err = crypto_get_default_rng(); - if (err) - goto out; -diff --git a/include/crypto/internal/geniv.h b/include/crypto/internal/geniv.h -index 7fd7126f5..fbdabe9d4 100644 ---- a/include/crypto/internal/geniv.h -+++ b/include/crypto/internal/geniv.h -@@ -13,7 +13,6 @@ - #include - - struct aead_geniv_ctx { -- spinlock_t lock; - struct crypto_aead *child; - struct crypto_sync_skcipher *sknull; - u8 salt[] __attribute__ ((aligned(__alignof__(u32)))); --- -2.40.4 - diff --git a/SPECS/91/linux/canister_builder/patches/0010-Move-crypto_inc-to-lib-crypto-utils.c.patch b/SPECS/91/linux/canister_builder/patches/0010-Move-crypto_inc-to-lib-crypto-utils.c.patch deleted file mode 100644 index 6fa09726fe..0000000000 --- a/SPECS/91/linux/canister_builder/patches/0010-Move-crypto_inc-to-lib-crypto-utils.c.patch +++ /dev/null @@ -1,137 +0,0 @@ -From fcb72f636896924650565c75cfb3789f8becb809 Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Tue, 16 Sep 2025 20:44:35 +0000 -Subject: [PATCH] Move crypto_inc to lib/crypto/utils.c - -crypto_inc is a utility function similar to crypto_xor. -algapi.c is a wrong place for it. - -Signed-off-by: Alexey Makhalov ---- - crypto/algapi.c | 31 ------------------------------- - include/crypto/algapi.h | 2 -- - include/crypto/utils.h | 2 ++ - lib/crypto/utils.c | 33 +++++++++++++++++++++++++++++++++ - 4 files changed, 35 insertions(+), 33 deletions(-) - -diff --git a/crypto/algapi.c b/crypto/algapi.c -index 685d1930d..d4fc7cc52 100644 ---- a/crypto/algapi.c -+++ b/crypto/algapi.c -@@ -963,37 +963,6 @@ struct crypto_async_request *crypto_dequeue_request(struct crypto_queue *queue) - } - EXPORT_SYMBOL_GPL(crypto_dequeue_request); - --static inline void crypto_inc_byte(u8 *a, unsigned int size) --{ -- u8 *b = (a + size); -- u8 c; -- -- for (; size; size--) { -- c = *--b + 1; -- *b = c; -- if (c) -- break; -- } --} -- --void crypto_inc(u8 *a, unsigned int size) --{ -- __be32 *b = (__be32 *)(a + size); -- u32 c; -- -- if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) || -- IS_ALIGNED((unsigned long)b, __alignof__(*b))) -- for (; size >= 4; size -= 4) { -- c = be32_to_cpu(*--b) + 1; -- *b = cpu_to_be32(c); -- if (likely(c)) -- return; -- } -- -- crypto_inc_byte(a, size); --} --EXPORT_SYMBOL_GPL(crypto_inc); -- - unsigned int crypto_alg_extsize(struct crypto_alg *alg) - { - return alg->cra_ctxsize + -diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h -index 156de41ca..b25f9901c 100644 ---- a/include/crypto/algapi.h -+++ b/include/crypto/algapi.h -@@ -176,8 +176,6 @@ static inline unsigned int crypto_queue_len(struct crypto_queue *queue) - return queue->qlen; - } - --void crypto_inc(u8 *a, unsigned int size); -- - static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm) - { - return tfm->__crt_ctx; -diff --git a/include/crypto/utils.h b/include/crypto/utils.h -index 2594f4577..011b2e6b5 100644 ---- a/include/crypto/utils.h -+++ b/include/crypto/utils.h -@@ -12,6 +12,8 @@ - #include - - void __crypto_xor(u8 *dst, const u8 *src1, const u8 *src2, unsigned int size); -+void crypto_inc(u8 *a, unsigned int size); -+ - - static inline void crypto_xor(u8 *dst, const u8 *src, unsigned int size) - { -diff --git a/lib/crypto/utils.c b/lib/crypto/utils.c -index 87da2a6dd..7711863db 100644 ---- a/lib/crypto/utils.c -+++ b/lib/crypto/utils.c -@@ -8,6 +8,8 @@ - #include - #include - #include -+#include -+#include - - /* - * XOR @len bytes from @src1 and @src2 together, writing the result to @dst -@@ -85,5 +87,36 @@ void __crypto_xor(u8 *dst, const u8 *src1, const u8 *src2, unsigned int len) - } - EXPORT_SYMBOL_GPL(__crypto_xor); - -+static inline void crypto_inc_byte(u8 *a, unsigned int size) -+{ -+ u8 *b = (a + size); -+ u8 c; -+ -+ for (; size; size--) { -+ c = *--b + 1; -+ *b = c; -+ if (c) -+ break; -+ } -+} -+ -+void crypto_inc(u8 *a, unsigned int size) -+{ -+ __be32 *b = (__be32 *)(a + size); -+ u32 c; -+ -+ if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) || -+ IS_ALIGNED((unsigned long)b, __alignof__(*b))) -+ for (; size >= 4; size -= 4) { -+ c = be32_to_cpu(*--b) + 1; -+ *b = cpu_to_be32(c); -+ if (likely(c)) -+ return; -+ } -+ -+ crypto_inc_byte(a, size); -+} -+EXPORT_SYMBOL_GPL(crypto_inc); -+ - MODULE_DESCRIPTION("Crypto library utility functions"); - MODULE_LICENSE("GPL"); --- -2.40.4 - diff --git a/SPECS/91/linux/canister_builder/patches/1000-FIPS-canister-creation.patch b/SPECS/91/linux/canister_builder/patches/1000-FIPS-canister-creation.patch deleted file mode 100644 index bd146c99d7..0000000000 --- a/SPECS/91/linux/canister_builder/patches/1000-FIPS-canister-creation.patch +++ /dev/null @@ -1,1481 +0,0 @@ -From 843fa3ae62dcd5cd49726177197c4dadb8a170bb Mon Sep 17 00:00:00 2001 -From: Vamsi Krishna Brahmajosyula -Date: Mon, 23 Jun 2025 03:09:01 -0500 -Subject: [PATCH] FIPS canister creation - -Canister creation patch. - - Makefile changes to generate canister binary (fips_canister.o) - - Move mutex API out of canister to the wrapper as it expands differently - depending on .config options. The difference is huge in -rt kernel. - - Use mutex instead of spinlock in canister. There is no difference to the - code that use it, but improvement for -rt kernel and simplification for - the wrapper. - - Move kernel memory alloc functions out of canister as their implementations - vary depending on .config options. - - Move cond_resched function to the wrapper. - - Add internal static functions to eliminate glue helpers calls. - - Redo DO_ONCE as it is not supported by integrity code. - - Do not use latent entropy GCC plugin for canister objects - - Do not check indirect call destination signatures from canister - - Remove rsa-pkcs1pad encrypt/decrypt functions from canister - - List canister objs in a file - - Compile canister with __NO_FORTIFY to avoid __bug_table insertion by - string operations such as memcpy. __bug_table is a kernel specific - data structure and must be moved out of the canister. Wrapping functions - like memcpy moves __bug_table out of the canister, but it nullifies the - compile time fortification as parameters size becomes unknown for the - compiler, see fortify_memcpy_chk() comments. - - Remove rfc4543 from canister - -Signed-off-by: Alexey Makhalov -Signed-off-by: Vamsi Krishna Brahmajosyula -Signed-off-by: Keerthana K -Signed-off-by: Shivani Agarwal ---- - arch/x86/crypto/aesni-intel_glue.c | 77 ++++++++++---------- - crypto/Makefile | 112 +++++++++++++++++++++++++++++ - crypto/algboss.c | 8 ++- - crypto/ccm.c | 7 +- - crypto/cmac.c | 3 +- - crypto/ctr.c | 3 +- - crypto/cts.c | 3 +- - crypto/drbg.c | 50 ++++++++----- - crypto/ecc.c | 5 +- - crypto/ecdh.c | 5 +- - crypto/ecdsa.c | 3 +- - crypto/gcm.c | 9 +-- - crypto/hmac.c | 3 +- - crypto/rsa-pkcs1pad.c | 11 ++- - crypto/testmgr.c | 108 +++++++++++++++------------- - crypto/xts.c | 3 +- - include/crypto/drbg.h | 3 +- - 17 files changed, 281 insertions(+), 132 deletions(-) - -diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c -index b0dd83555..55ed01a67 100644 ---- a/arch/x86/crypto/aesni-intel_glue.c -+++ b/arch/x86/crypto/aesni-intel_glue.c -@@ -37,7 +37,10 @@ - #include - #include - #include -+#include - -+void fcw_kernel_fpu_begin(void); -+void fcw_kernel_fpu_end(void); - - #define AESNI_ALIGN 16 - #define AESNI_ALIGN_ATTR __attribute__ ((__aligned__(AESNI_ALIGN))) -@@ -130,9 +133,9 @@ static int aes_set_key_common(struct crypto_aes_ctx *ctx, - if (err) - return err; - -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - aesni_set_key(ctx, in_key, key_len); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - return 0; - } - -@@ -150,9 +153,9 @@ static void aesni_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) - if (!crypto_simd_usable()) { - aes_encrypt(ctx, dst, src); - } else { -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - aesni_enc(ctx, dst, src); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - } - } - -@@ -163,9 +166,9 @@ static void aesni_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) - if (!crypto_simd_usable()) { - aes_decrypt(ctx, dst, src); - } else { -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - aesni_dec(ctx, dst, src); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - } - } - -@@ -186,10 +189,10 @@ static int ecb_encrypt(struct skcipher_request *req) - err = skcipher_walk_virt(&walk, req, false); - - while ((nbytes = walk.nbytes)) { -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - aesni_ecb_enc(ctx, walk.dst.virt.addr, walk.src.virt.addr, - nbytes & AES_BLOCK_MASK); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - nbytes &= AES_BLOCK_SIZE - 1; - err = skcipher_walk_done(&walk, nbytes); - } -@@ -208,10 +211,10 @@ static int ecb_decrypt(struct skcipher_request *req) - err = skcipher_walk_virt(&walk, req, false); - - while ((nbytes = walk.nbytes)) { -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - aesni_ecb_dec(ctx, walk.dst.virt.addr, walk.src.virt.addr, - nbytes & AES_BLOCK_MASK); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - nbytes &= AES_BLOCK_SIZE - 1; - err = skcipher_walk_done(&walk, nbytes); - } -@@ -230,10 +233,10 @@ static int cbc_encrypt(struct skcipher_request *req) - err = skcipher_walk_virt(&walk, req, false); - - while ((nbytes = walk.nbytes)) { -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - aesni_cbc_enc(ctx, walk.dst.virt.addr, walk.src.virt.addr, - nbytes & AES_BLOCK_MASK, walk.iv); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - nbytes &= AES_BLOCK_SIZE - 1; - err = skcipher_walk_done(&walk, nbytes); - } -@@ -252,10 +255,10 @@ static int cbc_decrypt(struct skcipher_request *req) - err = skcipher_walk_virt(&walk, req, false); - - while ((nbytes = walk.nbytes)) { -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - aesni_cbc_dec(ctx, walk.dst.virt.addr, walk.src.virt.addr, - nbytes & AES_BLOCK_MASK, walk.iv); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - nbytes &= AES_BLOCK_SIZE - 1; - err = skcipher_walk_done(&walk, nbytes); - } -@@ -311,10 +314,10 @@ static int cts_cbc_encrypt(struct skcipher_request *req) - if (err) - return err; - -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - aesni_cts_cbc_enc(ctx, walk.dst.virt.addr, walk.src.virt.addr, - walk.nbytes, walk.iv); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - - return skcipher_walk_done(&walk, 0); - } -@@ -367,10 +370,10 @@ static int cts_cbc_decrypt(struct skcipher_request *req) - if (err) - return err; - -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - aesni_cts_cbc_dec(ctx, walk.dst.virt.addr, walk.src.virt.addr, - walk.nbytes, walk.iv); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - - return skcipher_walk_done(&walk, 0); - } -@@ -405,7 +408,7 @@ static int ctr_crypt(struct skcipher_request *req) - err = skcipher_walk_virt(&walk, req, false); - - while ((nbytes = walk.nbytes) > 0) { -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - if (nbytes & AES_BLOCK_MASK) - static_call(aesni_ctr_enc_tfm)(ctx, walk.dst.virt.addr, - walk.src.virt.addr, -@@ -421,7 +424,7 @@ static int ctr_crypt(struct skcipher_request *req) - crypto_inc(walk.iv, AES_BLOCK_SIZE); - nbytes = 0; - } -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - err = skcipher_walk_done(&walk, nbytes); - } - return err; -@@ -456,7 +459,7 @@ static int xctr_crypt(struct skcipher_request *req) - err = skcipher_walk_virt(&walk, req, false); - - while ((nbytes = walk.nbytes) > 0) { -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - if (nbytes & AES_BLOCK_MASK) - aesni_xctr_enc_avx_tfm(ctx, walk.dst.virt.addr, - walk.src.virt.addr, nbytes & AES_BLOCK_MASK, -@@ -474,7 +477,7 @@ static int xctr_crypt(struct skcipher_request *req) - byte_ctr += nbytes; - nbytes = 0; - } -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - err = skcipher_walk_done(&walk, nbytes); - } - return err; -@@ -541,11 +544,11 @@ xts_crypt_slowpath(struct skcipher_request *req, xts_crypt_func crypt_func) - err = skcipher_walk_virt(&walk, req, false); - - while (walk.nbytes) { -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - (*crypt_func)(&ctx->crypt_ctx, - walk.src.virt.addr, walk.dst.virt.addr, - walk.nbytes & ~(AES_BLOCK_SIZE - 1), req->iv); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - err = skcipher_walk_done(&walk, - walk.nbytes & (AES_BLOCK_SIZE - 1)); - } -@@ -566,10 +569,10 @@ xts_crypt_slowpath(struct skcipher_request *req, xts_crypt_func crypt_func) - if (err) - return err; - -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - (*crypt_func)(&ctx->crypt_ctx, walk.src.virt.addr, walk.dst.virt.addr, - walk.nbytes, req->iv); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - - return skcipher_walk_done(&walk, 0); - } -@@ -588,7 +591,7 @@ xts_crypt(struct skcipher_request *req, xts_encrypt_iv_func encrypt_iv, - if (unlikely(cryptlen < AES_BLOCK_SIZE)) - return -EINVAL; - -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - (*encrypt_iv)(&ctx->tweak_ctx, req->iv); - - /* -@@ -610,10 +613,10 @@ xts_crypt(struct skcipher_request *req, xts_encrypt_iv_func encrypt_iv, - req->iv); - kunmap_local(dst_virt); - kunmap_local(src_virt); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - return 0; - } -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - return xts_crypt_slowpath(req, crypt_func); - } - -@@ -1215,10 +1218,10 @@ static int gcm_setkey(struct crypto_aead *tfm, const u8 *raw_key, - err = aes_check_keylen(keylen); - if (err) - return err; -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - aesni_set_key(&key->aes_key, raw_key, keylen); - aes_gcm_precompute(key, flags); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - } else { - static const u8 x_to_the_minus1[16] __aligned(__alignof__(be128)) = { - [0] = 0xc2, [15] = 1 -@@ -1323,8 +1326,8 @@ static void gcm_process_assoc(const struct aes_gcm_key *key, u8 ghash_acc[16], - scatterwalk_unmap(mapped); - scatterwalk_pagedone(&walk, 0, assoclen); - if (need_resched()) { -- kernel_fpu_end(); -- kernel_fpu_begin(); -+ fcw_kernel_fpu_end(); -+ fcw_kernel_fpu_begin(); - } - } - if (unlikely(pos)) -@@ -1377,7 +1380,7 @@ gcm_crypt(struct aead_request *req, int flags) - * section and start a new one if there are multiple data segments or if - * rescheduling is needed while processing the associated data. - */ -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - - /* Pass the associated data through GHASH. */ - gcm_process_assoc(key, ghash_acc, req->src, assoclen, flags); -@@ -1395,11 +1398,11 @@ gcm_crypt(struct aead_request *req, int flags) - aes_gcm_update(key, le_ctr, ghash_acc, walk.src.virt.addr, - walk.dst.virt.addr, nbytes, flags); - le_ctr[0] += nbytes / AES_BLOCK_SIZE; -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - err = skcipher_walk_done(&walk, walk.nbytes - nbytes); - if (err) - return err; -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - } - /* Last segment: process all remaining data. */ - aes_gcm_update(key, le_ctr, ghash_acc, walk.src.virt.addr, -@@ -1435,7 +1438,7 @@ gcm_crypt(struct aead_request *req, int flags) - datalen, tag, taglen, flags)) - err = -EBADMSG; - } -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - if (nbytes) - skcipher_walk_done(&walk, 0); - return err; -diff --git a/crypto/Makefile b/crypto/Makefile -index 768f24db5..b4cb9f756 100644 ---- a/crypto/Makefile -+++ b/crypto/Makefile -@@ -18,9 +18,11 @@ crypto_algapi-y := algapi.o scatterwalk.o $(crypto_algapi-y) - obj-$(CONFIG_CRYPTO_ALGAPI2) += crypto_algapi.o - - obj-$(CONFIG_CRYPTO_AEAD2) += aead.o -+canister += geniv.o - - crypto_skcipher-y += lskcipher.o - crypto_skcipher-y += skcipher.o -+canister += seqiv.o - - obj-$(CONFIG_CRYPTO_SKCIPHER2) += crypto_skcipher.o - ifeq ($(CONFIG_BPF_SYSCALL),y) -@@ -50,6 +52,7 @@ rsa_generic-y += rsaprivkey.asn1.o - rsa_generic-y += rsa.o - rsa_generic-y += rsa_helper.o - rsa_generic-y += rsa-pkcs1pad.o -+canister += $(rsa_generic-y) - $(obj)/rsa-pkcs1pad_crypt.o: $(srctree)/crypto/rsa-pkcs1pad.c FORCE - $(call if_changed_rule,cc_o_c) - obj-$(CONFIG_CRYPTO_RSA) += rsa-pkcs1pad_crypt.o -@@ -58,14 +61,18 @@ $(obj)/ecdsasignature.asn1.o: $(obj)/ecdsasignature.asn1.c $(obj)/ecdsasignature - $(obj)/ecdsa.o: $(obj)/ecdsasignature.asn1.h - ecdsa_generic-y += ecdsa.o - ecdsa_generic-y += ecdsasignature.asn1.o -+canister += $(ecdsa_generic-y) - - crypto_acompress-y := acompress.o - crypto_acompress-y += scompress.o - obj-$(CONFIG_CRYPTO_ACOMP2) += crypto_acompress.o - - cryptomgr-y := algboss.o testmgr.o -+canister += $(cryptomgr-y) - - obj-$(CONFIG_CRYPTO_USER) += crypto_user.o -+canister += hmac.o -+canister += cmac.o - obj-$(CONFIG_CRYPTO_VMAC) += vmac.o - obj-$(CONFIG_CRYPTO_XCBC) += xcbc.o - obj-$(CONFIG_CRYPTO_NULL2) += crypto_null.o -@@ -73,6 +80,9 @@ obj-$(CONFIG_CRYPTO_MD4) += md4.o - obj-$(CONFIG_CRYPTO_MD5) += md5.o - obj-$(CONFIG_CRYPTO_RMD160) += rmd160.o - obj-$(CONFIG_CRYPTO_SHA1) += sha1_generic.o -+canister += sha256_generic.o -+canister += sha512_generic.o -+canister += sha3_generic.o - obj-$(CONFIG_CRYPTO_SM3) += sm3.o - obj-$(CONFIG_CRYPTO_SM3_GENERIC) += sm3_generic.o - obj-$(CONFIG_CRYPTO_STREEBOG) += streebog_generic.o -@@ -81,16 +91,22 @@ CFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns) # https://gcc.gnu.org/b - obj-$(CONFIG_CRYPTO_BLAKE2B) += blake2b_generic.o - CFLAGS_blake2b_generic.o := -Wframe-larger-than=4096 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105930 - obj-$(CONFIG_CRYPTO_ECB) += ecb.o -+canister += cbc.o - obj-$(CONFIG_CRYPTO_PCBC) += pcbc.o -+canister += cts.o - obj-$(CONFIG_CRYPTO_LRW) += lrw.o -+canister += xts.o -+canister += ctr.o - obj-$(CONFIG_CRYPTO_XCTR) += xctr.o - obj-$(CONFIG_CRYPTO_HCTR2) += hctr2.o - obj-$(CONFIG_CRYPTO_KEYWRAP) += keywrap.o - obj-$(CONFIG_CRYPTO_ADIANTUM) += adiantum.o - obj-$(CONFIG_CRYPTO_NHPOLY1305) += nhpoly1305.o -+canister += gcm.o - $(obj)/gcm_rfc4543.o: $(srctree)/crypto/gcm.c FORCE - $(call if_changed_rule,cc_o_c) - obj-$(CONFIG_CRYPTO_GCM) += gcm_rfc4543.o -+canister += ccm.o - obj-$(CONFIG_CRYPTO_CHACHA20POLY1305) += chacha20poly1305.o - obj-$(CONFIG_CRYPTO_AEGIS128) += aegis128.o - aegis128-y := aegis128-core.o -@@ -125,6 +141,7 @@ obj-$(CONFIG_CRYPTO_TWOFISH) += twofish_generic.o - obj-$(CONFIG_CRYPTO_TWOFISH_COMMON) += twofish_common.o - obj-$(CONFIG_CRYPTO_SERPENT) += serpent_generic.o - CFLAGS_serpent_generic.o := $(call cc-option,-fsched-pressure) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149 -+canister += aes_generic.o - CFLAGS_aes_generic.o := $(call cc-option,-fno-code-hoisting) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83356 - obj-$(CONFIG_CRYPTO_SM4) += sm4.o - obj-$(CONFIG_CRYPTO_SM4_GENERIC) += sm4_generic.o -@@ -157,6 +174,7 @@ obj-$(CONFIG_CRYPTO_RNG2) += rng.o - obj-$(CONFIG_CRYPTO_ANSI_CPRNG) += ansi_cprng.o - obj-$(CONFIG_CRYPTO_JITTERENTROPY_TESTINTERFACE) += jitterentropy-testing.o - obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o -+canister += ghash-generic.o - obj-$(CONFIG_CRYPTO_POLYVAL) += polyval-generic.o - obj-$(CONFIG_CRYPTO_USER_API) += af_alg.o - obj-$(CONFIG_CRYPTO_USER_API_HASH) += algif_hash.o -@@ -164,11 +182,14 @@ obj-$(CONFIG_CRYPTO_USER_API_SKCIPHER) += algif_skcipher.o - obj-$(CONFIG_CRYPTO_USER_API_RNG) += algif_rng.o - obj-$(CONFIG_CRYPTO_USER_API_AEAD) += algif_aead.o - obj-$(CONFIG_CRYPTO_ZSTD) += zstd.o -+canister += ecc.o - obj-$(CONFIG_CRYPTO_ESSIV) += essiv.o - obj-$(CONFIG_CRYPTO_CURVE25519) += curve25519-generic.o -+canister += drbg.o - - ecdh_generic-y += ecdh.o - ecdh_generic-y += ecdh_helper.o -+canister += $(ecdh_generic-y) - - $(obj)/ecrdsa_params.asn1.o: $(obj)/ecrdsa_params.asn1.c $(obj)/ecrdsa_params.asn1.h - $(obj)/ecrdsa_pub_key.asn1.o: $(obj)/ecrdsa_pub_key.asn1.c $(obj)/ecrdsa_pub_key.asn1.h -@@ -192,6 +213,97 @@ obj-$(CONFIG_CRYPTO_SIMD) += crypto_simd.o - # Key derivation function - # - obj-$(CONFIG_CRYPTO_KDF800108_CTR) += kdf_sp800108.o -+ -+hostprogs := partial_reloc gen_canister_relocs -+HOSTLDLIBS_partial_reloc = -lelf -+HOSTCFLAGS_partial_reloc = -g -+HOSTLDLIBS_gen_canister_relocs = -lelf -+HOSTCFLAGS_gen_canister_relocs = -g -+ -+quiet_cmd_pr = RELOC $@ -+cmd_pr = $(obj)/partial_reloc $@ -+ -+quiet_cmd_gencr = GENCR $@ -+cmd_gencr = $(obj)/gen_canister_relocs $< $@ $(obj)/canister_markers.lds $(obj)/fips_canister-kallsyms -+ -+quiet_cmd_update_hmac = HMAC $@ -+cmd_update_hmac = $(obj)/update_canister_hmac.sh $@ $(obj)/canister_markers.lds -+ -+aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o -+aesni-intel-$(CONFIG_64BIT) += aes_ctrby8_avx-x86_64.o aes-gcm-aesni-x86_64.o aes-xts-avx-x86_64.o -+ifeq ($(CONFIG_AS_VAES)$(CONFIG_AS_VPCLMULQDQ),yy) -+aesni-intel-$(CONFIG_64BIT) += aes-gcm-avx10-x86_64.o -+OBJECT_FILES_NON_STANDARD_x86-aes-gcm-avx10-x86_64.o := y -+endif -+OBJECT_FILES_NON_STANDARD_x86-aes-gcm-aesni-x86_64.o := y -+OBJECT_FILES_NON_STANDARD_x86-aes-xts-avx-x86_64.o := y -+ -+sha256-ssse3-y := sha256-ssse3-asm.o sha256-avx-asm.o sha256-avx2-asm.o sha256_ssse3_glue.o -+sha256-ssse3-$(CONFIG_AS_SHA256_NI) += sha256_ni_asm.o -+ -+sha512-ssse3-y := sha512-ssse3-asm.o sha512-avx-asm.o sha512-avx2-asm.o sha512_ssse3_glue.o -+ -+ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o -+ -+x86-hwaccelerated-y := $(aesni-intel-y) $(sha256-ssse3-y) $(sha512-ssse3-y) $(ghash-clmulni-intel-y) -+ -+$(obj)/x86-%.o: $(srctree)/arch/x86/crypto/%.c FORCE -+ $(call if_changed_rule,cc_o_c) -+ -+$(obj)/x86-%.o: $(srctree)/arch/x86/crypto/%.S FORCE -+ $(call if_changed_rule,as_o_S) -+ -+lib-crypto-y := aes.o sha256.o -+$(obj)/lib-crypto-%.o: $(srctree)/lib/crypto/%.c FORCE -+ $(call if_changed_rule,cc_o_c) -+ -+canister += crypto_self_test.o -+ -+canister += fips_integrity.o -+ -+extra-y += $(canister) -+ -+canister-objs := $(addprefix crypto/x86-,$(x86-hwaccelerated-y)) $(addprefix crypto/lib-crypto-,$(lib-crypto-y)) $(addprefix $(obj)/,$(canister)) -+ -+$(obj)/canister.o: $(obj)/partial_reloc $(canister-objs) -+ $(Q)$(LD) -z noexecstack -T $(obj)/canister_combine.lds -r $(canister-objs) -o $@ -+ $(call cmd,pr) -+ @$(foreach obj,$(x86-hwaccelerated-y),echo x86-$(obj) > objs;) -+ @$(foreach obj,$(lib-crypto-y),echo lib-crypto-$(obj) >> objs;) -+ @$(foreach obj,$(canister),echo $(obj) >> objs;) -+ -+define UPDATE_CFLAGS = -+ CFLAGS_$1 += -DFIPS_CANISTER -mharden-sls=all -D__NO_FORTIFY -+ CFLAGS_REMOVE_$1 += -DLATENT_ENTROPY_PLUGIN -fplugin=./scripts/gcc-plugins/latent_entropy_plugin.so -fplugin-arg-rap_plugin-check=call $(RETPOLINE_CFLAGS) $(RETHUNK_CFLAGS) -+endef -+$(foreach obj,$(canister),$(eval $(call UPDATE_CFLAGS,$(obj)))) -+ -+define UPDATE_CFLAGS_LIB_CRYPTO = -+ CFLAGS_lib-crypto-$1 += -DFIPS_CANISTER -mharden-sls=all -D__NO_FORTIFY -+ CFLAGS_REMOVE_lib-crypto-$1 += -DLATENT_ENTROPY_PLUGIN -fplugin=./scripts/gcc-plugins/latent_entropy_plugin.so -fplugin-arg-rap_plugin-check=call $(RETPOLINE_CFLAGS) $(RETHUNK_CFLAGS) -+endef -+$(foreach obj,$(lib-crypto-y),$(eval $(call UPDATE_CFLAGS_LIB_CRYPTO,$(obj)))) -+ -+define UPDATE_CFLAGS_X86 = -+ CFLAGS_x86-$1 += -DFIPS_CANISTER -mharden-sls=all -D__NO_FORTIFY -+ CFLAGS_REMOVE_x86-$1 += -DLATENT_ENTROPY_PLUGIN -fplugin=./scripts/gcc-plugins/latent_entropy_plugin.so -fplugin-arg-rap_plugin-check=call $(RETPOLINE_CFLAGS) $(RETHUNK_CFLAGS) -+endef -+$(foreach obj,$(x86-hwaccelerated-y),$(eval $(call UPDATE_CFLAGS_X86,$(obj)))) -+ -+$(src)/canister_relocs.c: $(obj)/canister.o $(obj)/gen_canister_relocs -+ $(call cmd,gencr) -+clean-files += canister_relocs.c -+clean-files += fips_canister-kallsyms -+# Make savecmd_ happy for proper incremental build -+targets += canister_relocs.o $(addprefix x86-,$(x86-hwaccelerated-y)) $(addprefix lib-crypto-,$(lib-crypto-y)) -+$(obj)/canister_markers.lds: $(src)/canister_relocs.c -+ -+clean-files += canister_markers.lds -+ -+$(obj)/fips_canister.o: $(obj)/canister.o $(obj)/canister_relocs.o $(obj)/canister_markers.lds -+ $(Q)$(LD) -z noexecstack -T $(obj)/canister_markers.lds -r $(obj)/canister.o $(obj)/canister_relocs.o -o $@ -+ $(call cmd_and_savecmd,update_hmac) -+ - obj-$(CONFIG_CRYPTO_FIPS) += fips_canister_wrapper.o fips_canister.o - obj-$(CONFIG_CRYPTO_FIPS) += fips_canister_wrapper_internal.o - -diff --git a/crypto/algboss.c b/crypto/algboss.c -index a20926bfd..c905b560a 100644 ---- a/crypto/algboss.c -+++ b/crypto/algboss.c -@@ -19,6 +19,7 @@ - #include - - #include "internal.h" -+#include "fips_canister_wrapper.h" - - struct cryptomgr_param { - struct rtattr *tb[CRYPTO_MAX_ATTRS + 2]; -@@ -84,7 +85,7 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval) - if (!try_module_get(THIS_MODULE)) - goto err; - -- param = kzalloc(sizeof(*param), GFP_KERNEL); -+ param = fcw_kzalloc(sizeof(*param), GFP_KERNEL); - if (!param) - goto err_put_module; - -@@ -192,10 +193,13 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg) - if (IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS)) - return NOTIFY_DONE; - -+ if (fcw_skip_tests()) -+ return NOTIFY_DONE; -+ - if (!try_module_get(THIS_MODULE)) - goto err; - -- param = kzalloc(sizeof(*param), GFP_KERNEL); -+ param = fcw_kzalloc(sizeof(*param), GFP_KERNEL); - if (!param) - goto err_put_module; - -diff --git a/crypto/ccm.c b/crypto/ccm.c -index 36f0acec3..d9172bab5 100644 ---- a/crypto/ccm.c -+++ b/crypto/ccm.c -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include "fips_canister_wrapper.h" - - struct ccm_instance_ctx { - struct crypto_skcipher_spawn ctr; -@@ -459,7 +460,7 @@ static int crypto_ccm_create_common(struct crypto_template *tmpl, - if (err) - return err; - -- inst = kzalloc(sizeof(*inst) + sizeof(*ictx), GFP_KERNEL); -+ inst = fcw_kzalloc(sizeof(*inst) + sizeof(*ictx), GFP_KERNEL); - if (!inst) - return -ENOMEM; - ictx = aead_instance_ctx(inst); -@@ -714,7 +715,7 @@ static int crypto_rfc4309_create(struct crypto_template *tmpl, - if (err) - return err; - -- inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); -+ inst = fcw_kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); - if (!inst) - return -ENOMEM; - -@@ -867,7 +868,7 @@ static int cbcmac_create(struct crypto_template *tmpl, struct rtattr **tb) - if (err) - return err; - -- inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); -+ inst = fcw_kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); - if (!inst) - return -ENOMEM; - spawn = shash_instance_ctx(inst); -diff --git a/crypto/cmac.c b/crypto/cmac.c -index c7aa3665b..9e95294aa 100644 ---- a/crypto/cmac.c -+++ b/crypto/cmac.c -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include "fips_canister_wrapper.h" - - /* - * +------------------------ -@@ -241,7 +242,7 @@ static int cmac_create(struct crypto_template *tmpl, struct rtattr **tb) - if (err) - return err; - -- inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); -+ inst = fcw_kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); - if (!inst) - return -ENOMEM; - spawn = shash_instance_ctx(inst); -diff --git a/crypto/ctr.c b/crypto/ctr.c -index 142049606..6fa3831e1 100644 ---- a/crypto/ctr.c -+++ b/crypto/ctr.c -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include "fips_canister_wrapper.h" - - struct crypto_rfc3686_ctx { - struct crypto_skcipher *child; -@@ -267,7 +268,7 @@ static int crypto_rfc3686_create(struct crypto_template *tmpl, - if (err) - return err; - -- inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); -+ inst = fcw_kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); - if (!inst) - return -ENOMEM; - -diff --git a/crypto/cts.c b/crypto/cts.c -index f5b42156b..7df35e8c7 100644 ---- a/crypto/cts.c -+++ b/crypto/cts.c -@@ -51,6 +51,7 @@ - #include - #include - #include -+#include "fips_canister_wrapper.h" - - struct crypto_cts_ctx { - struct crypto_skcipher *child; -@@ -333,7 +334,7 @@ static int crypto_cts_create(struct crypto_template *tmpl, struct rtattr **tb) - if (err) - return err; - -- inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); -+ inst = fcw_kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); - if (!inst) - return -ENOMEM; - -diff --git a/crypto/drbg.c b/crypto/drbg.c -index 3addce909..bae3f1a2c 100644 ---- a/crypto/drbg.c -+++ b/crypto/drbg.c -@@ -101,6 +101,7 @@ - #include - #include - #include -+#include "fips_canister_wrapper.h" - - /*************************************************************** - * Backend cipher definitions available to DRBG -@@ -1292,13 +1293,13 @@ static inline int drbg_alloc_state(struct drbg_state *drbg) - if (ret < 0) - goto err; - -- drbg->Vbuf = kmalloc(drbg_statelen(drbg) + ret, GFP_KERNEL); -+ drbg->Vbuf = fcw_kmalloc(drbg_statelen(drbg) + ret, GFP_KERNEL); - if (!drbg->Vbuf) { - ret = -ENOMEM; - goto fini; - } - drbg->V = PTR_ALIGN(drbg->Vbuf, ret + 1); -- drbg->Cbuf = kmalloc(drbg_statelen(drbg) + ret, GFP_KERNEL); -+ drbg->Cbuf = fcw_kmalloc(drbg_statelen(drbg) + ret, GFP_KERNEL); - if (!drbg->Cbuf) { - ret = -ENOMEM; - goto fini; -@@ -1317,7 +1318,7 @@ static inline int drbg_alloc_state(struct drbg_state *drbg) - sb_size = drbg_statelen(drbg) + drbg_blocklen(drbg); - - if (0 < sb_size) { -- drbg->scratchpadbuf = kzalloc(sb_size + ret, GFP_KERNEL); -+ drbg->scratchpadbuf = fcw_kzalloc(sb_size + ret, GFP_KERNEL); - if (!drbg->scratchpadbuf) { - ret = -ENOMEM; - goto fini; -@@ -1326,7 +1327,7 @@ static inline int drbg_alloc_state(struct drbg_state *drbg) - } - - if (IS_ENABLED(CONFIG_CRYPTO_FIPS)) { -- drbg->prev = kzalloc(drbg_sec_strength(drbg->core->flags), -+ drbg->prev = fcw_kzalloc(drbg_sec_strength(drbg->core->flags), - GFP_KERNEL); - if (!drbg->prev) { - ret = -ENOMEM; -@@ -1509,9 +1510,9 @@ static int drbg_generate_long(struct drbg_state *drbg, - unsigned int chunk = 0; - slice = ((buflen - len) / drbg_max_request_bytes(drbg)); - chunk = slice ? drbg_max_request_bytes(drbg) : (buflen - len); -- mutex_lock(&drbg->drbg_mutex); -+ fcw_mutex_lock(drbg->drbg_mutex); - err = drbg_generate(drbg, buf + len, chunk, addtl); -- mutex_unlock(&drbg->drbg_mutex); -+ fcw_mutex_unlock(drbg->drbg_mutex); - if (0 > err) - return err; - len += chunk; -@@ -1563,7 +1564,7 @@ static int drbg_instantiate(struct drbg_state *drbg, struct drbg_string *pers, - - pr_devel("DRBG: Initializing DRBG core %d with prediction resistance " - "%s\n", coreref, pr ? "enabled" : "disabled"); -- mutex_lock(&drbg->drbg_mutex); -+ fcw_mutex_lock(drbg->drbg_mutex); - - /* 9.1 step 1 is implicit with the selected DRBG type */ - -@@ -1598,15 +1599,15 @@ static int drbg_instantiate(struct drbg_state *drbg, struct drbg_string *pers, - if (ret && !reseed) - goto free_everything; - -- mutex_unlock(&drbg->drbg_mutex); -+ fcw_mutex_unlock(drbg->drbg_mutex); - return ret; - - unlock: -- mutex_unlock(&drbg->drbg_mutex); -+ fcw_mutex_unlock(drbg->drbg_mutex); - return ret; - - free_everything: -- mutex_unlock(&drbg->drbg_mutex); -+ fcw_mutex_unlock(drbg->drbg_mutex); - drbg_uninstantiate(drbg); - return ret; - } -@@ -1645,9 +1646,9 @@ static void drbg_kcapi_set_entropy(struct crypto_rng *tfm, - { - struct drbg_state *drbg = crypto_rng_ctx(tfm); - -- mutex_lock(&drbg->drbg_mutex); -+ fcw_mutex_lock(drbg->drbg_mutex); - drbg_string_fill(&drbg->test_data, data, len); -- mutex_unlock(&drbg->drbg_mutex); -+ fcw_mutex_unlock(drbg->drbg_mutex); - } - - /*************************************************************** -@@ -1672,7 +1673,7 @@ static int drbg_init_hash_kernel(struct drbg_state *drbg) - return PTR_ERR(tfm); - } - BUG_ON(drbg_blocklen(drbg) != crypto_shash_digestsize(tfm)); -- sdesc = kzalloc(sizeof(struct shash_desc) + crypto_shash_descsize(tfm), -+ sdesc = fcw_kzalloc(sizeof(struct shash_desc) + crypto_shash_descsize(tfm), - GFP_KERNEL); - if (!sdesc) { - crypto_free_shash(tfm); -@@ -1772,7 +1773,7 @@ static int drbg_init_sym_kernel(struct drbg_state *drbg) - drbg->ctr_handle = sk_tfm; - crypto_init_wait(&drbg->ctr_wait); - -- req = skcipher_request_alloc(sk_tfm, GFP_KERNEL); -+ req = fcw_skcipher_request_alloc(sk_tfm, GFP_KERNEL); - if (!req) { - pr_info("DRBG: could not allocate request queue\n"); - drbg_fini_sym_kernel(drbg); -@@ -1784,7 +1785,7 @@ static int drbg_init_sym_kernel(struct drbg_state *drbg) - crypto_req_done, &drbg->ctr_wait); - - alignmask = crypto_skcipher_alignmask(sk_tfm); -- drbg->outscratchpadbuf = kmalloc(DRBG_OUTSCRATCHLEN + alignmask, -+ drbg->outscratchpadbuf = fcw_kmalloc(DRBG_OUTSCRATCHLEN + alignmask, - GFP_KERNEL); - if (!drbg->outscratchpadbuf) { - drbg_fini_sym_kernel(drbg); -@@ -1910,14 +1911,19 @@ static int drbg_kcapi_init(struct crypto_tfm *tfm) - { - struct drbg_state *drbg = crypto_tfm_ctx(tfm); - -- mutex_init(&drbg->drbg_mutex); -+ drbg->drbg_mutex = fcw_mutex_init(); -+ if (!drbg->drbg_mutex) -+ return -ENOMEM; - - return 0; - } - - static void drbg_kcapi_cleanup(struct crypto_tfm *tfm) - { -- drbg_uninstantiate(crypto_tfm_ctx(tfm)); -+ struct drbg_state *drbg = crypto_tfm_ctx(tfm); -+ -+ drbg_uninstantiate(drbg); -+ kfree(drbg->drbg_mutex); - } - - /* -@@ -2010,11 +2016,16 @@ static inline int __init drbg_healthcheck_sanity(void) - drbg_convert_tfm_core("drbg_nopr_hmac_sha512", &coreref, &pr); - #endif - -- drbg = kzalloc(sizeof(struct drbg_state), GFP_KERNEL); -+ drbg = fcw_kzalloc(sizeof(struct drbg_state), GFP_KERNEL); - if (!drbg) - return -ENOMEM; - -- mutex_init(&drbg->drbg_mutex); -+ drbg->drbg_mutex = fcw_mutex_init(); -+ if (!drbg->drbg_mutex) { -+ kfree(drbg); -+ return -ENOMEM; -+ } -+ - drbg->core = &drbg_cores[coreref]; - drbg->reseed_threshold = drbg_max_requests(drbg); - -@@ -2045,6 +2056,7 @@ static inline int __init drbg_healthcheck_sanity(void) - pr_devel("DRBG: Sanity tests for failure code paths successfully " - "completed\n"); - -+ kfree(drbg->drbg_mutex); - kfree(drbg); - return rc; - } -diff --git a/crypto/ecc.c b/crypto/ecc.c -index 6cf9a945f..07eb9a9d5 100644 ---- a/crypto/ecc.c -+++ b/crypto/ecc.c -@@ -37,6 +37,7 @@ - #include - - #include "ecc_curve_defs.h" -+#include "fips_canister_wrapper.h" - - typedef struct { - u64 m_low; -@@ -97,7 +98,7 @@ static u64 *ecc_alloc_digits_space(unsigned int ndigits) - if (!len) - return NULL; - -- return kmalloc(len, GFP_KERNEL); -+ return fcw_kmalloc(len, GFP_KERNEL); - } - - static void ecc_free_digits_space(u64 *space) -@@ -107,7 +108,7 @@ static void ecc_free_digits_space(u64 *space) - - struct ecc_point *ecc_alloc_point(unsigned int ndigits) - { -- struct ecc_point *p = kmalloc(sizeof(*p), GFP_KERNEL); -+ struct ecc_point *p = fcw_kmalloc(sizeof(*p), GFP_KERNEL); - - if (!p) - return NULL; -diff --git a/crypto/ecdh.c b/crypto/ecdh.c -index 72cfd1590..93996076c 100644 ---- a/crypto/ecdh.c -+++ b/crypto/ecdh.c -@@ -11,6 +11,7 @@ - #include - #include - #include -+#include "fips_canister_wrapper.h" - - struct ecdh_ctx { - unsigned int curve_id; -@@ -66,12 +67,12 @@ static int ecdh_compute_value(struct kpp_request *req) - /* Public part is a point thus it has both coordinates */ - public_key_sz = 2 * nbytes; - -- public_key = kmalloc(public_key_sz, GFP_KERNEL); -+ public_key = fcw_kmalloc(public_key_sz, GFP_KERNEL); - if (!public_key) - return -ENOMEM; - - if (req->src) { -- shared_secret = kmalloc(nbytes, GFP_KERNEL); -+ shared_secret = fcw_kmalloc(nbytes, GFP_KERNEL); - if (!shared_secret) - goto free_pubkey; - -diff --git a/crypto/ecdsa.c b/crypto/ecdsa.c -index 80ef16ae6..81b246e39 100644 ---- a/crypto/ecdsa.c -+++ b/crypto/ecdsa.c -@@ -12,6 +12,7 @@ - #include - - #include "ecdsasignature.asn1.h" -+#include "fips_canister_wrapper.h" - - struct ecc_ctx { - unsigned int curve_id; -@@ -136,7 +137,7 @@ static int ecdsa_verify(struct akcipher_request *req) - if (unlikely(!ctx->pub_key_set)) - return -EINVAL; - -- buffer = kmalloc(req->src_len + req->dst_len, GFP_KERNEL); -+ buffer = fcw_kmalloc(req->src_len + req->dst_len, GFP_KERNEL); - if (!buffer) - return -ENOMEM; - -diff --git a/crypto/gcm.c b/crypto/gcm.c -index 7dbfdb9da..a8909a721 100644 ---- a/crypto/gcm.c -+++ b/crypto/gcm.c -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include "fips_canister_wrapper.h" - - #ifdef FIPS_CANISTER - struct gcm_instance_ctx { -@@ -126,7 +127,7 @@ static int crypto_gcm_setkey(struct crypto_aead *aead, const u8 *key, - if (err) - return err; - -- data = kzalloc(sizeof(*data) + crypto_skcipher_reqsize(ctr), -+ data = fcw_kzalloc(sizeof(*data) + crypto_skcipher_reqsize(ctr), - GFP_KERNEL); - if (!data) - return -ENOMEM; -@@ -600,7 +601,7 @@ static int crypto_gcm_create_common(struct crypto_template *tmpl, - if (err) - return err; - -- inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); -+ inst = fcw_kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); - if (!inst) - return -ENOMEM; - ctx = aead_instance_ctx(inst); -@@ -846,7 +847,7 @@ static int crypto_rfc4106_create(struct crypto_template *tmpl, - if (err) - return err; - -- inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); -+ inst = fcw_kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); - if (!inst) - return -ENOMEM; - -@@ -1151,7 +1152,7 @@ static int __init crypto_gcm_module_init(void) - { - int err; - -- gcm_zeroes = kzalloc(sizeof(*gcm_zeroes), GFP_KERNEL); -+ gcm_zeroes = fcw_kzalloc(sizeof(*gcm_zeroes), GFP_KERNEL); - if (!gcm_zeroes) - return -ENOMEM; - -diff --git a/crypto/hmac.c b/crypto/hmac.c -index 7cec25ff9..54a5321ea 100644 ---- a/crypto/hmac.c -+++ b/crypto/hmac.c -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include "fips_canister_wrapper.h" - - struct hmac_ctx { - struct crypto_shash *hash; -@@ -189,7 +190,7 @@ static int hmac_create(struct crypto_template *tmpl, struct rtattr **tb) - if (err) - return err; - -- inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); -+ inst = fcw_kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); - if (!inst) - return -ENOMEM; - spawn = shash_instance_ctx(inst); -diff --git a/crypto/rsa-pkcs1pad.c b/crypto/rsa-pkcs1pad.c -index bae137b18..908dbac18 100644 ---- a/crypto/rsa-pkcs1pad.c -+++ b/crypto/rsa-pkcs1pad.c -@@ -12,10 +12,10 @@ - #include - #include - #include --#include - #include - #include - #include -+#include "fips_canister_wrapper.h" - - #ifdef FIPS_CANISTER - /* -@@ -223,7 +223,7 @@ static int pkcs1pad_encrypt_sign_complete(struct akcipher_request *req, int err) - if (likely(!pad_len)) - goto out; - -- out_buf = kzalloc(ctx->key_size, GFP_ATOMIC); -+ out_buf = fcw_kzalloc(ctx->key_size, GFP_ATOMIC); - err = -ENOMEM; - if (!out_buf) - goto out; -@@ -446,7 +446,7 @@ static int pkcs1pad_sign(struct akcipher_request *req) - return -EOVERFLOW; - } - -- req_ctx->in_buf = kmalloc(ctx->key_size - 1 - req->src_len, -+ req_ctx->in_buf = fcw_kmalloc(ctx->key_size - 1 - req->src_len, - GFP_KERNEL); - if (!req_ctx->in_buf) - return -ENOMEM; -@@ -588,7 +588,7 @@ static int pkcs1pad_verify(struct akcipher_request *req) - !ctx->key_size || sig_size != ctx->key_size) - return -EINVAL; - -- req_ctx->out_buf = kmalloc(ctx->key_size + digest_size, GFP_KERNEL); -+ req_ctx->out_buf = fcw_kmalloc(ctx->key_size + digest_size, GFP_KERNEL); - if (!req_ctx->out_buf) - return -ENOMEM; - -@@ -658,7 +658,7 @@ static int pkcs1pad_create(struct crypto_template *tmpl, struct rtattr **tb) - if (err) - return err; - -- inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); -+ inst = fcw_kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); - if (!inst) - return -ENOMEM; - -@@ -738,5 +738,4 @@ struct crypto_template rsa_pkcs1pad_tmpl = { - .module = THIS_MODULE, - }; - --MODULE_ALIAS_CRYPTO("pkcs1pad"); - #endif /* FIPS_CANISTER */ -diff --git a/crypto/testmgr.c b/crypto/testmgr.c -index 2f5f6b52b..9c69d1be9 100644 ---- a/crypto/testmgr.c -+++ b/crypto/testmgr.c -@@ -37,6 +37,7 @@ - #include - - #include "internal.h" -+#include "fips_canister_wrapper.h" - - MODULE_IMPORT_NS(CRYPTO_INTERNAL); - -@@ -739,7 +740,7 @@ static struct cipher_test_sglists *alloc_cipher_test_sglists(void) - { - struct cipher_test_sglists *tsgls; - -- tsgls = kmalloc(sizeof(*tsgls), GFP_KERNEL); -+ tsgls = fcw_kmalloc(sizeof(*tsgls), GFP_KERNEL); - if (!tsgls) - return NULL; - -@@ -836,7 +837,7 @@ static int prepare_keybuf(const u8 *key, unsigned int ksize, - if (key_offset != 0) { - if (cfg->key_offset_relative_to_alignmask) - key_offset += alignmask; -- keybuf = kmalloc(key_offset + ksize, GFP_KERNEL); -+ keybuf = fcw_kmalloc(key_offset + ksize, GFP_KERNEL); - if (!keybuf) - return -ENOMEM; - keyptr = keybuf + key_offset; -@@ -1699,7 +1700,7 @@ static int test_hash_vec(const struct hash_testvec *vec, unsigned int vec_num, - req, desc, tsgl, hashstate); - if (err) - return err; -- cond_resched(); -+ fcw_cond_resched(); - } - } - #endif -@@ -1805,13 +1806,13 @@ static int test_hash_vs_generic_impl(const char *generic_driver, - return err; - } - -- cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); -+ cfg = fcw_kzalloc(sizeof(*cfg), GFP_KERNEL); - if (!cfg) { - err = -ENOMEM; - goto out; - } - -- generic_desc = kzalloc(sizeof(*desc) + -+ generic_desc = fcw_kzalloc(sizeof(*desc) + - crypto_shash_descsize(generic_tfm), GFP_KERNEL); - if (!generic_desc) { - err = -ENOMEM; -@@ -1841,9 +1842,9 @@ static int test_hash_vs_generic_impl(const char *generic_driver, - * the other implementation against them. - */ - -- vec.key = kmalloc(maxkeysize, GFP_KERNEL); -- vec.plaintext = kmalloc(maxdatasize, GFP_KERNEL); -- vec.digest = kmalloc(digestsize, GFP_KERNEL); -+ vec.key = fcw_kmalloc(maxkeysize, GFP_KERNEL); -+ vec.plaintext = fcw_kmalloc(maxdatasize, GFP_KERNEL); -+ vec.digest = fcw_kmalloc(digestsize, GFP_KERNEL); - if (!vec.key || !vec.plaintext || !vec.digest) { - err = -ENOMEM; - goto out; -@@ -1860,7 +1861,7 @@ static int test_hash_vs_generic_impl(const char *generic_driver, - req, desc, tsgl, hashstate); - if (err) - goto out; -- cond_resched(); -+ fcw_cond_resched(); - } - err = 0; - out: -@@ -1905,7 +1906,7 @@ static int alloc_shash(const char *driver, u32 type, u32 mask, - return PTR_ERR(tfm); - } - -- desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(tfm), GFP_KERNEL); -+ desc = fcw_kmalloc(sizeof(*desc) + crypto_shash_descsize(tfm), GFP_KERNEL); - if (!desc) { - crypto_free_shash(tfm); - return -ENOMEM; -@@ -1947,7 +1948,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs, - } - driver = crypto_ahash_driver_name(atfm); - -- req = ahash_request_alloc(atfm, GFP_KERNEL); -+ req = fcw_ahash_request_alloc(atfm, GFP_KERNEL); - if (!req) { - pr_err("alg: hash: failed to allocate request for %s\n", - driver); -@@ -1963,7 +1964,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs, - if (err) - goto out; - -- tsgl = kmalloc(sizeof(*tsgl), GFP_KERNEL); -+ tsgl = fcw_kmalloc(sizeof(*tsgl), GFP_KERNEL); - if (!tsgl || init_test_sglist(tsgl) != 0) { - pr_err("alg: hash: failed to allocate test buffers for %s\n", - driver); -@@ -1976,7 +1977,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs, - statesize = crypto_ahash_statesize(atfm); - if (stfm) - statesize = max(statesize, crypto_shash_statesize(stfm)); -- hashstate = kmalloc(statesize + TESTMGR_POISON_LEN, GFP_KERNEL); -+ hashstate = fcw_kmalloc(statesize + TESTMGR_POISON_LEN, GFP_KERNEL); - if (!hashstate) { - pr_err("alg: hash: failed to allocate hash state buffer for %s\n", - driver); -@@ -1991,7 +1992,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs, - err = test_hash_vec(&vecs[i], i, req, desc, tsgl, hashstate); - if (err) - goto out; -- cond_resched(); -+ fcw_cond_resched(); - } - err = test_hash_vs_generic_impl(generic_driver, maxkeysize, req, - desc, tsgl, hashstate); -@@ -2271,7 +2272,7 @@ static int test_aead_vec(int enc, const struct aead_testvec *vec, - &cfg, req, tsgls); - if (err) - return err; -- cond_resched(); -+ fcw_cond_resched(); - } - } - #endif -@@ -2501,7 +2502,7 @@ static int test_aead_inauthentic_inputs(struct aead_extra_tests_ctx *ctx) - if (err) - return err; - } -- cond_resched(); -+ fcw_cond_resched(); - } - return 0; - } -@@ -2545,7 +2546,7 @@ static int test_aead_vs_generic_impl(struct aead_extra_tests_ctx *ctx) - return err; - } - -- generic_req = aead_request_alloc(generic_tfm, GFP_KERNEL); -+ generic_req = fcw_aead_request_alloc(generic_tfm, GFP_KERNEL); - if (!generic_req) { - err = -ENOMEM; - goto out; -@@ -2605,7 +2606,7 @@ static int test_aead_vs_generic_impl(struct aead_extra_tests_ctx *ctx) - if (err) - goto out; - } -- cond_resched(); -+ fcw_cond_resched(); - } - err = 0; - out: -@@ -2625,7 +2626,7 @@ static int test_aead_extra(const struct alg_test_desc *test_desc, - if (noextratests) - return 0; - -- ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); -+ ctx = fcw_kzalloc(sizeof(*ctx), GFP_KERNEL); - if (!ctx) - return -ENOMEM; - init_rnd_state(&ctx->rng); -@@ -2639,11 +2640,11 @@ static int test_aead_extra(const struct alg_test_desc *test_desc, - ctx->maxkeysize = max_t(unsigned int, ctx->maxkeysize, - test_desc->suite.aead.vecs[i].klen); - -- ctx->vec.key = kmalloc(ctx->maxkeysize, GFP_KERNEL); -- ctx->vec.iv = kmalloc(crypto_aead_ivsize(ctx->tfm), GFP_KERNEL); -- ctx->vec.assoc = kmalloc(ctx->maxdatasize, GFP_KERNEL); -- ctx->vec.ptext = kmalloc(ctx->maxdatasize, GFP_KERNEL); -- ctx->vec.ctext = kmalloc(ctx->maxdatasize, GFP_KERNEL); -+ ctx->vec.key = fcw_kmalloc(ctx->maxkeysize, GFP_KERNEL); -+ ctx->vec.iv = fcw_kmalloc(crypto_aead_ivsize(ctx->tfm), GFP_KERNEL); -+ ctx->vec.assoc = fcw_kmalloc(ctx->maxdatasize, GFP_KERNEL); -+ ctx->vec.ptext = fcw_kmalloc(ctx->maxdatasize, GFP_KERNEL); -+ ctx->vec.ctext = fcw_kmalloc(ctx->maxdatasize, GFP_KERNEL); - if (!ctx->vec.key || !ctx->vec.iv || !ctx->vec.assoc || - !ctx->vec.ptext || !ctx->vec.ctext) { - err = -ENOMEM; -@@ -2684,7 +2685,7 @@ static int test_aead(int enc, const struct aead_test_suite *suite, - err = test_aead_vec(enc, &suite->vecs[i], i, req, tsgls); - if (err) - return err; -- cond_resched(); -+ fcw_cond_resched(); - } - return 0; - } -@@ -2713,7 +2714,7 @@ static int alg_test_aead(const struct alg_test_desc *desc, const char *driver, - } - driver = crypto_aead_driver_name(tfm); - -- req = aead_request_alloc(tfm, GFP_KERNEL); -+ req = fcw_aead_request_alloc(tfm, GFP_KERNEL); - if (!req) { - pr_err("alg: aead: failed to allocate request for %s\n", - driver); -@@ -3033,7 +3034,7 @@ static int test_skcipher_vec(int enc, const struct cipher_testvec *vec, - &cfg, req, tsgls); - if (err) - return err; -- cond_resched(); -+ fcw_cond_resched(); - } - } - #endif -@@ -3155,13 +3156,13 @@ static int test_skcipher_vs_generic_impl(const char *generic_driver, - return err; - } - -- cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); -+ cfg = fcw_kzalloc(sizeof(*cfg), GFP_KERNEL); - if (!cfg) { - err = -ENOMEM; - goto out; - } - -- generic_req = skcipher_request_alloc(generic_tfm, GFP_KERNEL); -+ generic_req = fcw_skcipher_request_alloc(generic_tfm, GFP_KERNEL); - if (!generic_req) { - err = -ENOMEM; - goto out; -@@ -3206,10 +3207,10 @@ static int test_skcipher_vs_generic_impl(const char *generic_driver, - * the other implementation against them. - */ - -- vec.key = kmalloc(maxkeysize, GFP_KERNEL); -- vec.iv = kmalloc(ivsize, GFP_KERNEL); -- vec.ptext = kmalloc(maxdatasize, GFP_KERNEL); -- vec.ctext = kmalloc(maxdatasize, GFP_KERNEL); -+ vec.key = fcw_kmalloc(maxkeysize, GFP_KERNEL); -+ vec.iv = fcw_kmalloc(ivsize, GFP_KERNEL); -+ vec.ptext = fcw_kmalloc(maxdatasize, GFP_KERNEL); -+ vec.ctext = fcw_kmalloc(maxdatasize, GFP_KERNEL); - if (!vec.key || !vec.iv || !vec.ptext || !vec.ctext) { - err = -ENOMEM; - goto out; -@@ -3230,7 +3231,7 @@ static int test_skcipher_vs_generic_impl(const char *generic_driver, - cfg, req, tsgls); - if (err) - goto out; -- cond_resched(); -+ fcw_cond_resched(); - } - err = 0; - out: -@@ -3263,7 +3264,7 @@ static int test_skcipher(int enc, const struct cipher_test_suite *suite, - err = test_skcipher_vec(enc, &suite->vecs[i], i, req, tsgls); - if (err) - return err; -- cond_resched(); -+ fcw_cond_resched(); - } - return 0; - } -@@ -3292,7 +3293,7 @@ static int alg_test_skcipher(const struct alg_test_desc *desc, - } - driver = crypto_skcipher_driver_name(tfm); - -- req = skcipher_request_alloc(tfm, GFP_KERNEL); -+ req = fcw_skcipher_request_alloc(tfm, GFP_KERNEL); - if (!req) { - pr_err("alg: skcipher: failed to allocate request for %s\n", - driver); -@@ -3334,11 +3335,11 @@ static int test_comp(struct crypto_comp *tfm, - unsigned int i; - int ret; - -- output = kmalloc(COMP_BUF_SIZE, GFP_KERNEL); -+ output = fcw_kmalloc(COMP_BUF_SIZE, GFP_KERNEL); - if (!output) - return -ENOMEM; - -- decomp_output = kmalloc(COMP_BUF_SIZE, GFP_KERNEL); -+ decomp_output = fcw_kmalloc(COMP_BUF_SIZE, GFP_KERNEL); - if (!decomp_output) { - kfree(output); - return -ENOMEM; -@@ -3443,11 +3444,11 @@ static int test_acomp(struct crypto_acomp *tfm, - struct acomp_req *req; - struct crypto_wait wait; - -- output = kmalloc(COMP_BUF_SIZE, GFP_KERNEL); -+ output = fcw_kmalloc(COMP_BUF_SIZE, GFP_KERNEL); - if (!output) - return -ENOMEM; - -- decomp_out = kmalloc(COMP_BUF_SIZE, GFP_KERNEL); -+ decomp_out = fcw_kmalloc(COMP_BUF_SIZE, GFP_KERNEL); - if (!decomp_out) { - kfree(output); - return -ENOMEM; -@@ -3639,7 +3640,7 @@ static int test_cprng(struct crypto_rng *tfm, - - seedsize = crypto_rng_seedsize(tfm); - -- seed = kmalloc(seedsize, GFP_KERNEL); -+ seed = fcw_kmalloc(seedsize, GFP_KERNEL); - if (!seed) { - printk(KERN_ERR "alg: cprng: Failed to allocate seed space " - "for %s\n", algo); -@@ -3839,7 +3840,7 @@ static int drbg_cavs_test(const struct drbg_testvec *test, int pr, - struct crypto_rng *drng; - struct drbg_test_data test_data; - struct drbg_string addtl, pers, testentropy; -- unsigned char *buf = kzalloc(test->expectedlen, GFP_KERNEL); -+ unsigned char *buf = fcw_kzalloc(test->expectedlen, GFP_KERNEL); - - if (!buf) - return -ENOMEM; -@@ -3941,7 +3942,7 @@ static int do_test_kpp(struct crypto_kpp *tfm, const struct kpp_testvec *vec, - int err = -ENOMEM; - struct scatterlist src, dst; - -- req = kpp_request_alloc(tfm, GFP_KERNEL); -+ req = fcw_kpp_request_alloc(tfm, GFP_KERNEL); - if (!req) - return err; - -@@ -3952,7 +3953,7 @@ static int do_test_kpp(struct crypto_kpp *tfm, const struct kpp_testvec *vec, - goto free_req; - - out_len_max = crypto_kpp_maxsize(tfm); -- output_buf = kzalloc(out_len_max, GFP_KERNEL); -+ output_buf = fcw_kzalloc(out_len_max, GFP_KERNEL); - if (!output_buf) { - err = -ENOMEM; - goto free_req; -@@ -4132,13 +4133,13 @@ static int test_akcipher_one(struct crypto_akcipher *tfm, - if (testmgr_alloc_buf(xbuf)) - return err; - -- req = akcipher_request_alloc(tfm, GFP_KERNEL); -+ req = fcw_akcipher_request_alloc(tfm, GFP_KERNEL); - if (!req) - goto free_xbuf; - - crypto_init_wait(&wait); - -- key = kmalloc(vecs->key_len + sizeof(u32) * 2 + vecs->param_len, -+ key = fcw_kmalloc(vecs->key_len + sizeof(u32) * 2 + vecs->param_len, - GFP_KERNEL); - if (!key) - goto free_req; -@@ -4161,7 +4162,7 @@ static int test_akcipher_one(struct crypto_akcipher *tfm, - */ - err = -ENOMEM; - out_len_max = crypto_akcipher_maxsize(tfm); -- outbuf_enc = kzalloc(out_len_max, GFP_KERNEL); -+ outbuf_enc = fcw_kzalloc(out_len_max, GFP_KERNEL); - if (!outbuf_enc) - goto free_key; - -@@ -4238,7 +4239,7 @@ static int test_akcipher_one(struct crypto_akcipher *tfm, - err = 0; - goto free_all; - } -- outbuf_dec = kzalloc(out_len_max, GFP_KERNEL); -+ outbuf_dec = fcw_kzalloc(out_len_max, GFP_KERNEL); - if (!outbuf_dec) { - err = -ENOMEM; - goto free_all; -@@ -5868,13 +5869,22 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask) - int i; - int j; - int rc; -+ static bool done = false; - - if (!fips_enabled && notests) { - printk_once(KERN_INFO "alg: self-tests disabled\n"); - return 0; - } - -- DO_ONCE(testmgr_onetime_init); -+ /* Replace DO_ONCE by this. As DO_ONCE generates jump labels entry -+ * and its data (__once_key) get changed at early boot time at -+ * jump_label_init() from setup_arch(). We cannot run -+ * fips_integrity_init() before that time. So, replace it to -+ * avoid jump table entry creation. */ -+ if (unlikely(!done)) { -+ testmgr_onetime_init(); -+ done = true; -+ } - - if ((type & CRYPTO_ALG_TYPE_MASK) == CRYPTO_ALG_TYPE_CIPHER) { - char nalg[CRYPTO_MAX_ALG_NAME]; -diff --git a/crypto/xts.c b/crypto/xts.c -index 91e391a6b..e271be931 100644 ---- a/crypto/xts.c -+++ b/crypto/xts.c -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include "fips_canister_wrapper.h" - - struct xts_tfm_ctx { - struct crypto_skcipher *child; -@@ -355,7 +356,7 @@ static int xts_create(struct crypto_template *tmpl, struct rtattr **tb) - if (IS_ERR(cipher_name)) - return PTR_ERR(cipher_name); - -- inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); -+ inst = fcw_kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); - if (!inst) - return -ENOMEM; - -diff --git a/include/crypto/drbg.h b/include/crypto/drbg.h -index af5ad51d3..f3e132d6f 100644 ---- a/include/crypto/drbg.h -+++ b/include/crypto/drbg.h -@@ -50,7 +50,6 @@ - #include - #include - #include --#include - #include - #include - -@@ -112,7 +111,7 @@ enum drbg_seed_state { - }; - - struct drbg_state { -- struct mutex drbg_mutex; /* lock around DRBG */ -+ void *drbg_mutex; /* lock around DRBG */ - unsigned char *V; /* internal state 10.1.1.1 1a) */ - unsigned char *Vbuf; - /* hash: static value 10.1.1.1 1b) hmac / ctr: key */ --- -2.40.4 - diff --git a/SPECS/91/linux/canister_builder/patches/1001-aesni_intel-Remove-static-call.patch b/SPECS/91/linux/canister_builder/patches/1001-aesni_intel-Remove-static-call.patch deleted file mode 100644 index 6c34d6b04a..0000000000 --- a/SPECS/91/linux/canister_builder/patches/1001-aesni_intel-Remove-static-call.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 55a12fce71e3544643cf0e7b36e38735adf4530e Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Fri, 29 Nov 2024 06:14:48 +0000 -Subject: [PATCH] aesni_intel: Remove static call - -Static calls are removed from canister because static call -sites (function pointers) are updated during kernel bootup -based on the value of the key. This will fail the FIPS integrity -test. -Signed-off-by: Keerthana K -[Alexey: Fix aesni_ctr_enc_tfm initialization] -Signed-off-by: Alexey Makhalov ---- - arch/x86/crypto/aesni-intel_glue.c | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c -index 55ed01a67..9c4cb927d 100644 ---- a/arch/x86/crypto/aesni-intel_glue.c -+++ b/arch/x86/crypto/aesni-intel_glue.c -@@ -36,7 +36,6 @@ - #include - #include - #include --#include - #include - - void fcw_kernel_fpu_begin(void); -@@ -88,7 +87,9 @@ asmlinkage void aesni_xts_dec(const struct crypto_aes_ctx *ctx, u8 *out, - - asmlinkage void aesni_ctr_enc(struct crypto_aes_ctx *ctx, u8 *out, - const u8 *in, unsigned int len, u8 *iv); --DEFINE_STATIC_CALL(aesni_ctr_enc_tfm, aesni_ctr_enc); -+ -+static void (*aesni_ctr_enc_tfm)(struct crypto_aes_ctx *ctx, u8 *out, -+ const u8 *in, unsigned int len, u8 *iv) = aesni_ctr_enc; - - asmlinkage void aes_ctr_enc_128_avx_by8(const u8 *in, u8 *iv, - void *keys, u8 *out, unsigned int num_bytes); -@@ -410,7 +411,7 @@ static int ctr_crypt(struct skcipher_request *req) - while ((nbytes = walk.nbytes) > 0) { - fcw_kernel_fpu_begin(); - if (nbytes & AES_BLOCK_MASK) -- static_call(aesni_ctr_enc_tfm)(ctx, walk.dst.virt.addr, -+ aesni_ctr_enc_tfm(ctx, walk.dst.virt.addr, - walk.src.virt.addr, - nbytes & AES_BLOCK_MASK, - walk.iv); -@@ -1682,7 +1683,7 @@ static int __init aesni_init(void) - #ifdef CONFIG_X86_64 - if (boot_cpu_has(X86_FEATURE_AVX)) { - /* optimize performance of ctr mode encryption transform */ -- static_call_update(aesni_ctr_enc_tfm, aesni_ctr_enc_avx_tfm); -+ aesni_ctr_enc_tfm = aesni_ctr_enc_avx_tfm; - pr_info("AES CTR mode by8 optimization enabled\n"); - } - #endif /* CONFIG_X86_64 */ --- -2.50.1 - diff --git a/SPECS/91/linux/canister_builder/patches/1002-Disable-retpoline_sites-and-return_sites-sections-in.patch b/SPECS/91/linux/canister_builder/patches/1002-Disable-retpoline_sites-and-return_sites-sections-in.patch deleted file mode 100644 index 28dcb4f495..0000000000 --- a/SPECS/91/linux/canister_builder/patches/1002-Disable-retpoline_sites-and-return_sites-sections-in.patch +++ /dev/null @@ -1,101 +0,0 @@ -From fc1616f79a48660ff7e65ac9ce04b06f523015bc Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Fri, 29 Nov 2024 06:33:52 +0000 -Subject: [PATCH] Disable retpoline_sites and return_sites sections in - canister - -Use "ret;int3" for straight-line-speculation mitigation. - -Signed-off-by: Keerthana K -Signed-off-by: Alexey Makhalov ---- - arch/x86/crypto/aes-gcm-aesni-x86_64.S | 5 +++++ - arch/x86/crypto/aes-gcm-avx10-x86_64.S | 5 +++++ - arch/x86/crypto/aes-xts-avx-x86_64.S | 5 +++++ - arch/x86/crypto/aes_ctrby8_avx-x86_64.S | 5 +++++ - arch/x86/crypto/aesni-intel_asm.S | 5 +++++ - 5 files changed, 25 insertions(+) - -diff --git a/arch/x86/crypto/aes-gcm-aesni-x86_64.S b/arch/x86/crypto/aes-gcm-aesni-x86_64.S -index 45940e288..61cf71b93 100644 ---- a/arch/x86/crypto/aes-gcm-aesni-x86_64.S -+++ b/arch/x86/crypto/aes-gcm-aesni-x86_64.S -@@ -126,6 +126,11 @@ - - #include - -+#if defined(RET) -+#undef RET -+#define RET ret;int3 -+#endif -+ - .section .rodata - .p2align 4 - .Lbswap_mask: -diff --git a/arch/x86/crypto/aes-gcm-avx10-x86_64.S b/arch/x86/crypto/aes-gcm-avx10-x86_64.S -index 97e0ee515..529cf2a35 100644 ---- a/arch/x86/crypto/aes-gcm-avx10-x86_64.S -+++ b/arch/x86/crypto/aes-gcm-avx10-x86_64.S -@@ -83,6 +83,11 @@ - - #include - -+#if defined(RET) -+#undef RET -+#define RET ret;int3 -+#endif -+ - .section .rodata - .p2align 6 - -diff --git a/arch/x86/crypto/aes-xts-avx-x86_64.S b/arch/x86/crypto/aes-xts-avx-x86_64.S -index 48f97b79f..090c9aa29 100644 ---- a/arch/x86/crypto/aes-xts-avx-x86_64.S -+++ b/arch/x86/crypto/aes-xts-avx-x86_64.S -@@ -57,6 +57,11 @@ - #include - #include - -+#if defined(RET) -+#undef RET -+#define RET ret;int3 -+#endif -+ - .section .rodata - .p2align 4 - .Lgf_poly: -diff --git a/arch/x86/crypto/aes_ctrby8_avx-x86_64.S b/arch/x86/crypto/aes_ctrby8_avx-x86_64.S -index 2402b9418..9855930f2 100644 ---- a/arch/x86/crypto/aes_ctrby8_avx-x86_64.S -+++ b/arch/x86/crypto/aes_ctrby8_avx-x86_64.S -@@ -23,6 +23,11 @@ - - #define VMOVDQ vmovdqu - -+#if defined(RET) -+#undef RET -+#define RET ret;int3 -+#endif -+ - /* - * Note: the "x" prefix in these aliases means "this is an xmm register". The - * alias prefixes have no relation to XCTR where the "X" prefix means "XOR -diff --git a/arch/x86/crypto/aesni-intel_asm.S b/arch/x86/crypto/aesni-intel_asm.S -index eb153eff9..ff17e987e 100644 ---- a/arch/x86/crypto/aesni-intel_asm.S -+++ b/arch/x86/crypto/aesni-intel_asm.S -@@ -38,6 +38,11 @@ - - #define GF128MUL_MASK %xmm7 - -+#if defined(RET) -+#undef RET -+#define RET ret;int3 -+#endif -+ - #ifdef __x86_64__ - #define AREG %rax - #define KEYP %rdi --- -2.50.1 - diff --git a/SPECS/91/linux/canister_builder/patches/1005-crypto-Remove-EXPORT_SYMBOL-EXPORT_SYMBOL_GPL-from-c.patch b/SPECS/91/linux/canister_builder/patches/1005-crypto-Remove-EXPORT_SYMBOL-EXPORT_SYMBOL_GPL-from-c.patch deleted file mode 100644 index 55406de6e5..0000000000 --- a/SPECS/91/linux/canister_builder/patches/1005-crypto-Remove-EXPORT_SYMBOL-EXPORT_SYMBOL_GPL-from-c.patch +++ /dev/null @@ -1,475 +0,0 @@ -From 90de474fd5d319a0ea02a63076926505bbefec27 Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Mon, 2 Dec 2024 06:58:48 +0000 -Subject: [PATCH] crypto: Remove EXPORT_SYMBOL, EXPORT_SYMBOL_GPL from - canister - -Signed-off-by: Vamsi Krishna Brahmajosyula -Signed-off-by: Keerthana K ---- - crypto/aes_generic.c | 5 ----- - crypto/ecc.c | 21 --------------------- - crypto/ecdh_helper.c | 5 +---- - crypto/geniv.c | 3 --- - crypto/rsa_helper.c | 2 -- - crypto/sha256_generic.c | 4 ---- - crypto/sha3_generic.c | 3 --- - crypto/sha512_generic.c | 4 ---- - crypto/testmgr.c | 2 -- - lib/crypto/aes.c | 6 ------ - lib/crypto/sha256.c | 4 ---- - 11 files changed, 1 insertion(+), 58 deletions(-) - -diff --git a/crypto/aes_generic.c b/crypto/aes_generic.c -index 3c66d425c..c5bf42c63 100644 ---- a/crypto/aes_generic.c -+++ b/crypto/aes_generic.c -@@ -1118,9 +1118,6 @@ static const u32 crypto_il_tab[4][256] ____cacheline_aligned = { - } - }; - --EXPORT_SYMBOL_GPL(crypto_ft_tab); --EXPORT_SYMBOL_GPL(crypto_it_tab); -- - /** - * crypto_aes_set_key - Set the AES key. - * @tfm: The %crypto_tfm that is used in the context. -@@ -1140,8 +1137,6 @@ int crypto_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, - - return aes_expandkey(ctx, in_key, key_len); - } --EXPORT_SYMBOL_GPL(crypto_aes_set_key); -- - /* encrypt a block of text */ - - #define f_rn(bo, bi, n, k) do { \ -diff --git a/crypto/ecc.c b/crypto/ecc.c -index 7aa54bb27..e0cc81ec9 100644 ---- a/crypto/ecc.c -+++ b/crypto/ecc.c -@@ -50,7 +50,6 @@ const struct ecc_curve *ecc_get_curve25519(void) - { - return &ecc_25519; - } --EXPORT_SYMBOL(ecc_get_curve25519); - - const struct ecc_curve *ecc_get_curve(unsigned int curve_id) - { -@@ -68,7 +67,6 @@ const struct ecc_curve *ecc_get_curve(unsigned int curve_id) - return NULL; - } - } --EXPORT_SYMBOL(ecc_get_curve); - - void ecc_digits_from_bytes(const u8 *in, unsigned int nbytes, - u64 *out, unsigned int ndigits) -@@ -90,7 +88,6 @@ void ecc_digits_from_bytes(const u8 *in, unsigned int nbytes, - } - ecc_swap_digits(in, out, ndigits); - } --EXPORT_SYMBOL(ecc_digits_from_bytes); - - static u64 *ecc_alloc_digits_space(unsigned int ndigits) - { -@@ -132,7 +129,6 @@ struct ecc_point *ecc_alloc_point(unsigned int ndigits) - kfree(p); - return NULL; - } --EXPORT_SYMBOL(ecc_alloc_point); - - void ecc_free_point(struct ecc_point *p) - { -@@ -143,7 +139,6 @@ void ecc_free_point(struct ecc_point *p) - kfree_sensitive(p->y); - kfree_sensitive(p); - } --EXPORT_SYMBOL(ecc_free_point); - - static void vli_clear(u64 *vli, unsigned int ndigits) - { -@@ -165,7 +160,6 @@ bool vli_is_zero(const u64 *vli, unsigned int ndigits) - - return true; - } --EXPORT_SYMBOL(vli_is_zero); - - /* Returns nonzero if bit of vli is set. */ - static u64 vli_test_bit(const u64 *vli, unsigned int bit) -@@ -208,7 +202,6 @@ unsigned int vli_num_bits(const u64 *vli, unsigned int ndigits) - - return ((num_digits - 1) * 64 + i); - } --EXPORT_SYMBOL(vli_num_bits); - - /* Set dest from unaligned bit string src. */ - void vli_from_be64(u64 *dest, const void *src, unsigned int ndigits) -@@ -219,7 +212,6 @@ void vli_from_be64(u64 *dest, const void *src, unsigned int ndigits) - for (i = 0; i < ndigits; i++) - dest[i] = get_unaligned_be64(&from[ndigits - 1 - i]); - } --EXPORT_SYMBOL(vli_from_be64); - - void vli_from_le64(u64 *dest, const void *src, unsigned int ndigits) - { -@@ -229,7 +221,6 @@ void vli_from_le64(u64 *dest, const void *src, unsigned int ndigits) - for (i = 0; i < ndigits; i++) - dest[i] = get_unaligned_le64(&from[i]); - } --EXPORT_SYMBOL(vli_from_le64); - - /* Sets dest = src. */ - static void vli_set(u64 *dest, const u64 *src, unsigned int ndigits) -@@ -251,7 +242,6 @@ int vli_cmp(const u64 *left, const u64 *right, unsigned int ndigits) - - return 0; - } --EXPORT_SYMBOL(vli_cmp); - - /* Computes result = in << c, returning carry. Can modify in place - * (if result == in). 0 < shift < 64. -@@ -348,7 +338,6 @@ u64 vli_sub(u64 *result, const u64 *left, const u64 *right, - - return borrow; - } --EXPORT_SYMBOL(vli_sub); - - /* Computes result = left - right, returning borrow. Can modify in place. */ - static u64 vli_usub(u64 *result, const u64 *left, u64 right, -@@ -1008,7 +997,6 @@ void vli_mod_mult_slow(u64 *result, const u64 *left, const u64 *right, - vli_mult(product, left, right, ndigits); - vli_mmod_slow(result, product, mod, ndigits); - } --EXPORT_SYMBOL(vli_mod_mult_slow); - - /* Computes result = (left * right) % curve_prime. */ - static void vli_mod_mult_fast(u64 *result, const u64 *left, const u64 *right, -@@ -1108,7 +1096,6 @@ void vli_mod_inv(u64 *result, const u64 *input, const u64 *mod, - - vli_set(result, u, ndigits); - } --EXPORT_SYMBOL(vli_mod_inv); - - /* ------ Point operations ------ */ - -@@ -1118,7 +1105,6 @@ bool ecc_point_is_zero(const struct ecc_point *point) - return (vli_is_zero(point->x, point->ndigits) && - vli_is_zero(point->y, point->ndigits)); - } --EXPORT_SYMBOL(ecc_point_is_zero); - - /* Point multiplication algorithm using Montgomery's ladder with co-Z - * coordinates. From https://eprint.iacr.org/2011/338.pdf -@@ -1465,7 +1451,6 @@ void ecc_point_mult_shamir(const struct ecc_point *result, - vli_mod_inv(z, z, curve->p, ndigits); - apply_z(rx, ry, z, curve); - } --EXPORT_SYMBOL(ecc_point_mult_shamir); - - /* - * This function performs checks equivalent to Appendix A.4.2 of FIPS 186-5. -@@ -1509,7 +1494,6 @@ int ecc_is_key_valid(unsigned int curve_id, unsigned int ndigits, - - return __ecc_is_key_valid(curve, private_key, ndigits); - } --EXPORT_SYMBOL(ecc_is_key_valid); - - /* - * ECC private keys are generated using the method of rejection sampling, -@@ -1560,7 +1544,6 @@ int ecc_gen_privkey(unsigned int curve_id, unsigned int ndigits, - - return 0; - } --EXPORT_SYMBOL(ecc_gen_privkey); - - int ecc_make_pub_key(unsigned int curve_id, unsigned int ndigits, - const u64 *private_key, u64 *public_key) -@@ -1596,7 +1579,6 @@ int ecc_make_pub_key(unsigned int curve_id, unsigned int ndigits, - out: - return ret; - } --EXPORT_SYMBOL(ecc_make_pub_key); - - /* SP800-56A section 5.6.2.3.4 partial verification: ephemeral keys only */ - int ecc_is_pubkey_valid_partial(const struct ecc_curve *curve, -@@ -1629,7 +1611,6 @@ int ecc_is_pubkey_valid_partial(const struct ecc_curve *curve, - - return 0; - } --EXPORT_SYMBOL(ecc_is_pubkey_valid_partial); - - /* SP800-56A section 5.6.2.3.3 full verification */ - int ecc_is_pubkey_valid_full(const struct ecc_curve *curve, -@@ -1656,7 +1637,6 @@ int ecc_is_pubkey_valid_full(const struct ecc_curve *curve, - - return ret; - } --EXPORT_SYMBOL(ecc_is_pubkey_valid_full); - - static int get_jitter_ent_random_bytes(u64 *buf, unsigned int len) - { -@@ -1735,7 +1715,6 @@ int crypto_ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits, - out: - return ret; - } --EXPORT_SYMBOL(crypto_ecdh_shared_secret); - - MODULE_DESCRIPTION("core elliptic curve module"); - MODULE_LICENSE("Dual BSD/GPL"); -diff --git a/crypto/ecdh_helper.c b/crypto/ecdh_helper.c -index 5dac6b348..78cd5252f 100644 ---- a/crypto/ecdh_helper.c -+++ b/crypto/ecdh_helper.c -@@ -29,7 +29,6 @@ unsigned int crypto_ecdh_key_len(const struct ecdh *params) - { - return ECDH_KPP_SECRET_MIN_SIZE + params->key_size; - } --EXPORT_SYMBOL_GPL(crypto_ecdh_key_len); - - int crypto_ecdh_encode_key(char *buf, unsigned int len, - const struct ecdh *params) -@@ -52,7 +51,6 @@ int crypto_ecdh_encode_key(char *buf, unsigned int len, - - return 0; - } --EXPORT_SYMBOL_GPL(crypto_ecdh_encode_key); - - int crypto_ecdh_decode_key(const char *buf, unsigned int len, - struct ecdh *params) -@@ -80,5 +78,4 @@ int crypto_ecdh_decode_key(const char *buf, unsigned int len, - params->key = (void *)ptr; - - return 0; --} --EXPORT_SYMBOL_GPL(crypto_ecdh_decode_key); -+} -\ No newline at end of file -diff --git a/crypto/geniv.c b/crypto/geniv.c -index bee4621b4..2ac9bc761 100644 ---- a/crypto/geniv.c -+++ b/crypto/geniv.c -@@ -104,7 +104,6 @@ struct aead_instance *aead_geniv_alloc(struct crypto_template *tmpl, - inst = ERR_PTR(err); - goto out; - } --EXPORT_SYMBOL_GPL(aead_geniv_alloc); - - int aead_init_geniv(struct crypto_aead *aead) - { -@@ -148,7 +147,6 @@ int aead_init_geniv(struct crypto_aead *aead) - crypto_put_default_null_skcipher(); - goto out; - } --EXPORT_SYMBOL_GPL(aead_init_geniv); - - void aead_exit_geniv(struct crypto_aead *tfm) - { -@@ -157,7 +155,6 @@ void aead_exit_geniv(struct crypto_aead *tfm) - crypto_free_aead(ctx->child); - crypto_put_default_null_skcipher(); - } --EXPORT_SYMBOL_GPL(aead_exit_geniv); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Shared IV generator code"); -diff --git a/crypto/rsa_helper.c b/crypto/rsa_helper.c -index 94266f290..9deb71e13 100644 ---- a/crypto/rsa_helper.c -+++ b/crypto/rsa_helper.c -@@ -164,7 +164,6 @@ int rsa_parse_pub_key(struct rsa_key *rsa_key, const void *key, - { - return asn1_ber_decoder(&rsapubkey_decoder, rsa_key, key, key_len); - } --EXPORT_SYMBOL_GPL(rsa_parse_pub_key); - - /** - * rsa_parse_priv_key() - decodes the BER encoded buffer and stores in the -@@ -183,4 +182,3 @@ int rsa_parse_priv_key(struct rsa_key *rsa_key, const void *key, - { - return asn1_ber_decoder(&rsaprivkey_decoder, rsa_key, key, key_len); - } --EXPORT_SYMBOL_GPL(rsa_parse_priv_key); -diff --git a/crypto/sha256_generic.c b/crypto/sha256_generic.c -index b00521f1a..c5c12378b 100644 ---- a/crypto/sha256_generic.c -+++ b/crypto/sha256_generic.c -@@ -23,7 +23,6 @@ const u8 sha224_zero_message_hash[SHA224_DIGEST_SIZE] = { - 0xb0, 0x1f, 0x82, 0x8e, 0xa6, 0x2a, 0xc5, 0xb3, 0xe4, - 0x2f - }; --EXPORT_SYMBOL_GPL(sha224_zero_message_hash); - - const u8 sha256_zero_message_hash[SHA256_DIGEST_SIZE] = { - 0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, -@@ -31,7 +30,6 @@ const u8 sha256_zero_message_hash[SHA256_DIGEST_SIZE] = { - 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, - 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55 - }; --EXPORT_SYMBOL_GPL(sha256_zero_message_hash); - - int crypto_sha256_update(struct shash_desc *desc, const u8 *data, - unsigned int len) -@@ -39,7 +37,6 @@ int crypto_sha256_update(struct shash_desc *desc, const u8 *data, - sha256_update(shash_desc_ctx(desc), data, len); - return 0; - } --EXPORT_SYMBOL(crypto_sha256_update); - - static int crypto_sha256_final(struct shash_desc *desc, u8 *out) - { -@@ -56,7 +53,6 @@ int crypto_sha256_finup(struct shash_desc *desc, const u8 *data, - sha256_update(shash_desc_ctx(desc), data, len); - return crypto_sha256_final(desc, hash); - } --EXPORT_SYMBOL(crypto_sha256_finup); - - static struct shash_alg sha256_algs[2] = { { - .digestsize = SHA256_DIGEST_SIZE, -diff --git a/crypto/sha3_generic.c b/crypto/sha3_generic.c -index 0e36ce003..3aee57c30 100644 ---- a/crypto/sha3_generic.c -+++ b/crypto/sha3_generic.c -@@ -171,7 +171,6 @@ int crypto_sha3_init(struct shash_desc *desc) - memset(sctx->st, 0, sizeof(sctx->st)); - return 0; - } --EXPORT_SYMBOL(crypto_sha3_init); - - int crypto_sha3_update(struct shash_desc *desc, const u8 *data, - unsigned int len) -@@ -209,7 +208,6 @@ int crypto_sha3_update(struct shash_desc *desc, const u8 *data, - - return 0; - } --EXPORT_SYMBOL(crypto_sha3_update); - - int crypto_sha3_final(struct shash_desc *desc, u8 *out) - { -@@ -236,7 +234,6 @@ int crypto_sha3_final(struct shash_desc *desc, u8 *out) - memset(sctx, 0, sizeof(*sctx)); - return 0; - } --EXPORT_SYMBOL(crypto_sha3_final); - - static struct shash_alg algs[] = { { - .digestsize = SHA3_224_DIGEST_SIZE, -diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c -index dbdabde87..7920da6f9 100644 ---- a/crypto/sha512_generic.c -+++ b/crypto/sha512_generic.c -@@ -27,7 +27,6 @@ const u8 sha384_zero_message_hash[SHA384_DIGEST_SIZE] = { - 0x27, 0x4e, 0xde, 0xbf, 0xe7, 0x6f, 0x65, 0xfb, - 0xd5, 0x1a, 0xd2, 0xf1, 0x48, 0x98, 0xb9, 0x5b - }; --EXPORT_SYMBOL_GPL(sha384_zero_message_hash); - - const u8 sha512_zero_message_hash[SHA512_DIGEST_SIZE] = { - 0xcf, 0x83, 0xe1, 0x35, 0x7e, 0xef, 0xb8, 0xbd, -@@ -39,7 +38,6 @@ const u8 sha512_zero_message_hash[SHA512_DIGEST_SIZE] = { - 0x63, 0xb9, 0x31, 0xbd, 0x47, 0x41, 0x7a, 0x81, - 0xa5, 0x38, 0x32, 0x7a, 0xf9, 0x27, 0xda, 0x3e - }; --EXPORT_SYMBOL_GPL(sha512_zero_message_hash); - - static inline u64 Ch(u64 x, u64 y, u64 z) - { -@@ -160,7 +158,6 @@ int crypto_sha512_update(struct shash_desc *desc, const u8 *data, - { - return sha512_base_do_update(desc, data, len, sha512_generic_block_fn); - } --EXPORT_SYMBOL(crypto_sha512_update); - - static int sha512_final(struct shash_desc *desc, u8 *hash) - { -@@ -174,7 +171,6 @@ int crypto_sha512_finup(struct shash_desc *desc, const u8 *data, - sha512_base_do_update(desc, data, len, sha512_generic_block_fn); - return sha512_final(desc, hash); - } --EXPORT_SYMBOL(crypto_sha512_finup); - - static struct shash_alg sha512_algs[2] = { { - .digestsize = SHA512_DIGEST_SIZE, -diff --git a/crypto/testmgr.c b/crypto/testmgr.c -index 510ef0138..b5e29b2ad 100644 ---- a/crypto/testmgr.c -+++ b/crypto/testmgr.c -@@ -6024,5 +6024,3 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask) - } - - #endif /* CONFIG_CRYPTO_MANAGER_DISABLE_TESTS */ -- --EXPORT_SYMBOL_GPL(alg_test); -diff --git a/lib/crypto/aes.c b/lib/crypto/aes.c -index eafe14d02..d6876f690 100644 ---- a/lib/crypto/aes.c -+++ b/lib/crypto/aes.c -@@ -85,9 +85,6 @@ static volatile const u8 __cacheline_aligned aes_inv_sbox[] = { - extern const u8 crypto_aes_sbox[256] __alias(aes_sbox); - extern const u8 crypto_aes_inv_sbox[256] __alias(aes_inv_sbox); - --EXPORT_SYMBOL(crypto_aes_sbox); --EXPORT_SYMBOL(crypto_aes_inv_sbox); -- - static u32 mul_by_x(u32 w) - { - u32 x = w & 0x7f7f7f7f; -@@ -247,7 +244,6 @@ int aes_expandkey(struct crypto_aes_ctx *ctx, const u8 *in_key, - - return 0; - } --EXPORT_SYMBOL(aes_expandkey); - - /** - * aes_encrypt - Encrypt a single AES block -@@ -298,7 +294,6 @@ void aes_encrypt(const struct crypto_aes_ctx *ctx, u8 *out, const u8 *in) - put_unaligned_le32(subshift(st1, 2) ^ rkp[6], out + 8); - put_unaligned_le32(subshift(st1, 3) ^ rkp[7], out + 12); - } --EXPORT_SYMBOL(aes_encrypt); - - /** - * aes_decrypt - Decrypt a single AES block -@@ -349,7 +344,6 @@ void aes_decrypt(const struct crypto_aes_ctx *ctx, u8 *out, const u8 *in) - put_unaligned_le32(inv_subshift(st1, 2) ^ rkp[6], out + 8); - put_unaligned_le32(inv_subshift(st1, 3) ^ rkp[7], out + 12); - } --EXPORT_SYMBOL(aes_decrypt); - - MODULE_DESCRIPTION("Generic AES library"); - MODULE_AUTHOR("Ard Biesheuvel "); -diff --git a/lib/crypto/sha256.c b/lib/crypto/sha256.c -index ca5cd6492..285384817 100644 ---- a/lib/crypto/sha256.c -+++ b/lib/crypto/sha256.c -@@ -146,7 +146,6 @@ void sha256_update(struct sha256_state *sctx, const u8 *data, unsigned int len) - { - lib_sha256_base_do_update(sctx, data, len, sha256_transform_blocks); - } --EXPORT_SYMBOL(sha256_update); - - static void __sha256_final(struct sha256_state *sctx, u8 *out, int digest_size) - { -@@ -158,13 +157,11 @@ void sha256_final(struct sha256_state *sctx, u8 *out) - { - __sha256_final(sctx, out, 32); - } --EXPORT_SYMBOL(sha256_final); - - void sha224_final(struct sha256_state *sctx, u8 *out) - { - __sha256_final(sctx, out, 28); - } --EXPORT_SYMBOL(sha224_final); - - void sha256(const u8 *data, unsigned int len, u8 *out) - { -@@ -174,7 +171,6 @@ void sha256(const u8 *data, unsigned int len, u8 *out) - sha256_update(&sctx, data, len); - sha256_final(&sctx, out); - } --EXPORT_SYMBOL(sha256); - - MODULE_DESCRIPTION("SHA-256 Algorithm"); - MODULE_LICENSE("GPL"); --- -2.50.1 - diff --git a/SPECS/91/linux/canister_builder/patches/1006-Move-kernel-structures-usage-from-canister-to-wrappe.patch b/SPECS/91/linux/canister_builder/patches/1006-Move-kernel-structures-usage-from-canister-to-wrappe.patch deleted file mode 100644 index c1c1cc0c74..0000000000 --- a/SPECS/91/linux/canister_builder/patches/1006-Move-kernel-structures-usage-from-canister-to-wrappe.patch +++ /dev/null @@ -1,3610 +0,0 @@ -From 353b8c298b2a05568d8c08f1d964ef7dc82d8f34 Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Mon, 28 Jul 2025 18:00:18 +0000 -Subject: [PATCH] Move kernel structures usage from canister to wrapper - -- Module init and exit family of function calls moved to wrapper. -- All MODULE_* macro usages have been removed as these macros add information - to .modinfo section which is later dropped at vmlinux linking time. -- Introduced fips_canister_wrapper_internal header file to be used by - by fips_canister_wrapper.c -- Structures like module, raw_spinlock_t, crypto_type that are not directly - accessed inside canister but are nested inside other structures are made - to void pointers. -- Strctures like task_struct, mutex etc that are directly accessed inside - canister are made void pointers and get allocated from wrapper functions. -- Implemented wrapper for printk family of funtions. -- Implemented wrapper for pr_ratelimited family of functions. -- Introduced testmgr and aesni_intel_glue wrapper files to move scatterwalk - and scatterlist APIs as these APIs use struct page. -- Removed module params like panic_on_fail, noextratests, notests, fuzz_iterations - and their functionality from testmgr as these params are not used when built-in -- Added wrapper functions for functions that use struct page to avoid task_struct - usage. -- Moved DEFINE_LOCK_GUARD_1_COND macros to a new header file to prevent - struct spinlock_t getting added to canister objs. As canister files do not - use the functions and variables from the expanded macro, but it gets added - irrespective of the usage. so, removing the macro from canister. - Refer commit: https://github.com/gregkh/linux/commit/e4ab322 - DEFINE_LOCK_GUARD_1_COND is expanded as following which introduces struct spinlock_t: - - DEFINE_LOCK_GUARD_1_COND(raw_spinlock_irqsave, _try, - raw_spin_trylock_irqsave(_T->lock, _T->flags)) - - typedef class_raw_spinlock_irqsave_t class_raw_spinlock_irqsave_try_t; static inline __attribute__((__gnu_inline__)) __attribute__((__unused__)) __attribute__((no_instrument_function)) void class_raw@@@ -"/work/src/photon/lkcm/common/SPECS/linux/v6.12/canister_builder/patches/0008-Move-kernel-structures-usage-from-canister-to-wrappe.patch" [readonly] 3626L, 131247B 1,1 Top -- Structures like module, raw_spinlock_t, crypto_type that are not directly - accessed inside canister but are nested inside other structures are made - to void pointers. -- Strctures like task_struct, mutex etc that are directly accessed inside - canister are made void pointers and get allocated from wrapper functions. -- Implemented wrapper for printk family of funtions. -- Implemented wrapper for pr_ratelimited family of functions. -- Introduced testmgr and aesni_intel_glue wrapper files to move scatterwalk - and scatterlist APIs as these APIs use struct page. -- Removed module params like panic_on_fail, noextratests, notests, fuzz_iterations - and their functionality from testmgr as these params are not used when built-in -- Added wrapper functions for functions that use struct page to avoid task_struct - usage. -- Moved DEFINE_LOCK_GUARD_1_COND macros to a new header file to prevent - struct spinlock_t getting added to canister objs. As canister files do not - use the functions and variables from the expanded macro, but it gets added - irrespective of the usage. so, removing the macro from canister. - Refer commit: https://github.com/gregkh/linux/commit/e4ab322 - DEFINE_LOCK_GUARD_1_COND is expanded as following which introduces struct spinlock_t: - - DEFINE_LOCK_GUARD_1_COND(raw_spinlock_irqsave, _try, - raw_spin_trylock_irqsave(_T->lock, _T->flags)) - - typedef class_raw_spinlock_irqsave_t class_raw_spinlock_irqsave_try_t; static inline __attribute__((__gnu_inline__)) __attribute__((__unused__)) __attribute__((no_instrument_function)) void class_raw_spinlock_irqsave_try_destructor(class_raw_spinlock_irqsave_t *p){ class_raw_spinlock_irqsave_destructor(p); } static inline __attribute__((__gnu_inline__)) __attribute__((__unused__)) __attribute__((no_instrument_function)) class_raw_spinlock_irqsave_t class_raw_spinlock_irqsave_try_constructor(typeof(((class_raw_spinlock_irqsave_t*)0)->lock) l) { class_raw_spinlock_irqsave_t t = ({ class_raw_spinlock_irqsave_t _t = { .lock = l }, *_T = &_t; if (_T->lock && !(({ do { do { ({ unsigned long __dummy; typeof(_T->flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); _T->flags = arch_local_irq_save(); } while (0); } while (0); (_raw_spin_trylock(_T->lock)) ? 1 : ({ do { do { ({ unsigned long __dummy; typeof(_T->flags) __dummy2; (void)(&__dummy == &__dummy2); 1; }); do { } while (0); arch_local_irq_restore(_T->flags); } while (0); } while (0); 0; }); }))) _T->lock = ((void *)0); _t; }); return t; } static inline __attribute__((__gnu_inline__)) __attribute__((__unused__)) __attribute__((no_instrument_function)) void * class_raw_spinlock_irqsave_try_lock_ptr(class_raw_spinlock_irqsave_t *_T) { return class_raw_spinlock_irqsave_lock_ptr(_T); } -- Moved struct x86_cpu_id to wrapper - -Signed-off-by: Keerthana K -Signed-off-by: Ankit Jain -Signed-off-by: Brennan Lamoreaux -Signed-off-by: Alexey Makhalov - -[Srinidhi Rao Migrated this patch to v6.12.41] -Signed-off-by: srinidhira0 ---- - arch/x86/crypto/aesni-intel_glue.c | 110 ++--- - crypto/aes_generic.c | 12 +- - crypto/algboss.c | 40 +- - crypto/cbc.c | 11 +- - crypto/ccm.c | 15 +- - crypto/cmac.c | 12 +- - crypto/ctr.c | 13 +- - crypto/cts.c | 11 +- - crypto/drbg.c | 123 +++--- - crypto/ecc.c | 18 +- - crypto/ecdh.c | 10 +- - crypto/ecdsa.c | 20 +- - crypto/gcm.c | 16 +- - crypto/geniv.c | 7 +- - crypto/ghash-generic.c | 13 +- - crypto/hmac.c | 11 +- - crypto/internal.h | 7 +- - crypto/rsa.c | 11 +- - crypto/rsa_helper.c | 3 +- - crypto/seqiv.c | 12 +- - crypto/sha256_generic.c | 15 +- - crypto/sha3_generic.c | 19 +- - crypto/sha512_generic.c | 15 +- - crypto/testmgr.c | 655 ++++++++-------------------- - crypto/testmgr.h | 23 +- - crypto/xts.c | 13 +- - include/crypto/algapi.h | 6 + - include/crypto/drbg.h | 1 - - include/crypto/if_alg.h | 4 + - include/crypto/internal/skcipher.h | 4 + - include/crypto/sha512_base.h | 1 - - include/linux/crypto.h | 10 +- - include/linux/rtattr.h | 6 + - include/linux/spinlock.h | 24 +- - include/linux/spinlock_cond_guard.h | 20 + - lib/crypto/aes.c | 5 - - lib/crypto/sha256.c | 4 - - 37 files changed, 411 insertions(+), 889 deletions(-) - create mode 100644 include/linux/rtattr.h - create mode 100644 include/linux/spinlock_cond_guard.h - -diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c -index 4f6fe4cdc..917154be8 100644 ---- a/arch/x86/crypto/aesni-intel_glue.c -+++ b/arch/x86/crypto/aesni-intel_glue.c -@@ -19,7 +19,6 @@ - - #include - #include --#include - #include - #include - #include -@@ -42,8 +41,20 @@ void fcw_kernel_fpu_begin(void); - void fcw_kernel_fpu_end(void); - extern void *fcw_kmalloc(size_t size, gfp_t flags); - extern void *fcw_scatterwalk_map(struct scatter_walk *walk); --extern struct page *fcw_sg_page(struct scatterlist *sg); -- -+extern void *fcw_sg_page(struct scatterlist *sg); -+extern void fcw_scatterwalk_pagedone(struct scatter_walk *walk, int out, -+ unsigned int more); -+extern bool fcw_need_resched(void); -+extern void *fcw_kmap_local_page(void *page); -+extern void fcw_kunmap_local(const void *addr); -+extern struct scatterlist *fcw_scatterwalk_ffwd(struct scatterlist dst[2], -+ struct scatterlist *src, -+ unsigned int len); -+extern void fcw_scatterwalk_unmap(void *vaddr); -+extern int fcw_printk(const char *fmt, ...); -+extern bool fcw_boot_cpu_has(unsigned long bit); -+extern bool fcw_x86_match_cpu_zmm_exclusion_list(void); -+extern bool fcw_x86_match_cpu_aesni_cpu_id(void); - - #define AESNI_ALIGN 16 - #define AESNI_ALIGN_ATTR __attribute__ ((__aligned__(AESNI_ALIGN))) -@@ -304,9 +315,9 @@ static int cts_cbc_encrypt(struct skcipher_request *req) - if (req->cryptlen == AES_BLOCK_SIZE) - return 0; - -- dst = src = scatterwalk_ffwd(sg_src, req->src, subreq.cryptlen); -+ dst = src = fcw_scatterwalk_ffwd(sg_src, req->src, subreq.cryptlen); - if (req->dst != req->src) -- dst = scatterwalk_ffwd(sg_dst, req->dst, -+ dst = fcw_scatterwalk_ffwd(sg_dst, req->dst, - subreq.cryptlen); - } - -@@ -360,9 +371,9 @@ static int cts_cbc_decrypt(struct skcipher_request *req) - if (req->cryptlen == AES_BLOCK_SIZE) - return 0; - -- dst = src = scatterwalk_ffwd(sg_src, req->src, subreq.cryptlen); -+ dst = src = fcw_scatterwalk_ffwd(sg_src, req->src, subreq.cryptlen); - if (req->dst != req->src) -- dst = scatterwalk_ffwd(sg_dst, req->dst, -+ dst = fcw_scatterwalk_ffwd(sg_dst, req->dst, - subreq.cryptlen); - } - -@@ -563,9 +574,9 @@ xts_crypt_slowpath(struct skcipher_request *req, xts_crypt_func crypt_func) - - /* Do ciphertext stealing with the last full block and partial block. */ - -- dst = src = scatterwalk_ffwd(sg_src, req->src, req->cryptlen); -+ dst = src = fcw_scatterwalk_ffwd(sg_src, req->src, req->cryptlen); - if (req->dst != req->src) -- dst = scatterwalk_ffwd(sg_dst, req->dst, req->cryptlen); -+ dst = fcw_scatterwalk_ffwd(sg_dst, req->dst, req->cryptlen); - - skcipher_request_set_crypt(req, src, dst, AES_BLOCK_SIZE + tail, - req->iv); -@@ -609,15 +620,13 @@ xts_crypt(struct skcipher_request *req, xts_encrypt_iv_func encrypt_iv, - if (likely(src->length >= cryptlen && dst->length >= cryptlen && - src->offset + cryptlen <= PAGE_SIZE && - dst->offset + cryptlen <= PAGE_SIZE)) { -- struct page *src_page = fcw_sg_page(src); -- struct page *dst_page = fcw_sg_page(dst); -- void *src_virt = kmap_local_page(src_page) + src->offset; -- void *dst_virt = kmap_local_page(dst_page) + dst->offset; -+ void *src_virt = fcw_kmap_local_page(fcw_sg_page(src)) + src->offset; -+ void *dst_virt = fcw_kmap_local_page(fcw_sg_page(dst)) + dst->offset; - - (*crypt_func)(&ctx->crypt_ctx, src_virt, dst_virt, cryptlen, - req->iv); -- kunmap_local(dst_virt); -- kunmap_local(src_virt); -+ fcw_kunmap_local(dst_virt); -+ fcw_kunmap_local(src_virt); - fcw_kernel_fpu_end(); - return 0; - } -@@ -1328,9 +1337,9 @@ static void gcm_process_assoc(const struct aes_gcm_key *key, u8 ghash_acc[16], - pos = len_this_page; - } - next: -- scatterwalk_unmap(mapped); -- scatterwalk_pagedone(&walk, 0, assoclen); -- if (need_resched()) { -+ fcw_scatterwalk_unmap(mapped); -+ fcw_scatterwalk_pagedone(&walk, 0, assoclen); -+ if (fcw_need_resched()) { - fcw_kernel_fpu_end(); - fcw_kernel_fpu_begin(); - } -@@ -1544,31 +1553,11 @@ DEFINE_GCM_ALGS(vaes_avx10_512, FLAG_AVX10_512, - AES_GCM_KEY_AVX10_SIZE, 800); - #endif /* CONFIG_AS_VAES && CONFIG_AS_VPCLMULQDQ */ - --/* -- * This is a list of CPU models that are known to suffer from downclocking when -- * zmm registers (512-bit vectors) are used. On these CPUs, the AES mode -- * implementations with zmm registers won't be used by default. Implementations -- * with ymm registers (256-bit vectors) will be used by default instead. -- */ --static const struct x86_cpu_id zmm_exclusion_list[] = { -- X86_MATCH_VFM(INTEL_SKYLAKE_X, 0), -- X86_MATCH_VFM(INTEL_ICELAKE_X, 0), -- X86_MATCH_VFM(INTEL_ICELAKE_D, 0), -- X86_MATCH_VFM(INTEL_ICELAKE, 0), -- X86_MATCH_VFM(INTEL_ICELAKE_L, 0), -- X86_MATCH_VFM(INTEL_ICELAKE_NNPI, 0), -- X86_MATCH_VFM(INTEL_TIGERLAKE_L, 0), -- X86_MATCH_VFM(INTEL_TIGERLAKE, 0), -- /* Allow Rocket Lake and later, and Sapphire Rapids and later. */ -- /* Also allow AMD CPUs (starting with Zen 4, the first with AVX-512). */ -- {}, --}; -- - static int __init register_avx_algs(void) - { - int err; - -- if (!boot_cpu_has(X86_FEATURE_AVX)) -+ if (!fcw_boot_cpu_has(X86_FEATURE_AVX)) - return 0; - err = simd_register_skciphers_compat(&aes_xts_alg_aesni_avx, 1, - &aes_xts_simdalg_aesni_avx); -@@ -1580,10 +1569,10 @@ static int __init register_avx_algs(void) - if (err) - return err; - #if defined(CONFIG_AS_VAES) && defined(CONFIG_AS_VPCLMULQDQ) -- if (!boot_cpu_has(X86_FEATURE_AVX2) || -- !boot_cpu_has(X86_FEATURE_VAES) || -- !boot_cpu_has(X86_FEATURE_VPCLMULQDQ) || -- !boot_cpu_has(X86_FEATURE_PCLMULQDQ) || -+ if (!fcw_boot_cpu_has(X86_FEATURE_AVX2) || -+ !fcw_boot_cpu_has(X86_FEATURE_VAES) || -+ !fcw_boot_cpu_has(X86_FEATURE_VPCLMULQDQ) || -+ !fcw_boot_cpu_has(X86_FEATURE_PCLMULQDQ) || - !cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL)) - return 0; - err = simd_register_skciphers_compat(&aes_xts_alg_vaes_avx2, 1, -@@ -1591,9 +1580,9 @@ static int __init register_avx_algs(void) - if (err) - return err; - -- if (!boot_cpu_has(X86_FEATURE_AVX512BW) || -- !boot_cpu_has(X86_FEATURE_AVX512VL) || -- !boot_cpu_has(X86_FEATURE_BMI2) || -+ if (!fcw_boot_cpu_has(X86_FEATURE_AVX512BW) || -+ !fcw_boot_cpu_has(X86_FEATURE_AVX512VL) || -+ !fcw_boot_cpu_has(X86_FEATURE_BMI2) || - !cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM | - XFEATURE_MASK_AVX512, NULL)) - return 0; -@@ -1608,7 +1597,7 @@ static int __init register_avx_algs(void) - if (err) - return err; - -- if (x86_match_cpu(zmm_exclusion_list)) { -+ if (fcw_x86_match_cpu_zmm_exclusion_list()) { - int i; - - aes_xts_alg_vaes_avx10_512.base.cra_priority = 1; -@@ -1672,23 +1661,17 @@ static void unregister_avx_algs(void) - } - #endif /* !CONFIG_X86_64 */ - --static const struct x86_cpu_id aesni_cpu_id[] = { -- X86_MATCH_FEATURE(X86_FEATURE_AES, NULL), -- {} --}; --MODULE_DEVICE_TABLE(x86cpu, aesni_cpu_id); -- --static int __init aesni_init(void) -+int __init aesni_init(void) - { - int err; - -- if (!x86_match_cpu(aesni_cpu_id)) -+ if (!fcw_x86_match_cpu_aesni_cpu_id()) - return -ENODEV; - #ifdef CONFIG_X86_64 -- if (boot_cpu_has(X86_FEATURE_AVX)) { -+ if (fcw_boot_cpu_has(X86_FEATURE_AVX)) { - /* optimize performance of ctr mode encryption transform */ - aesni_ctr_enc_tfm = aesni_ctr_enc_avx_tfm; -- pr_info("AES CTR mode by8 optimization enabled\n"); -+ fcw_printk(KERN_INFO pr_fmt() "AES CTR mode by8 optimization enabled\n"); - } - #endif /* CONFIG_X86_64 */ - -@@ -1708,8 +1691,9 @@ static int __init aesni_init(void) - if (err) - goto unregister_skciphers; - -+ - #ifdef CONFIG_X86_64 -- if (boot_cpu_has(X86_FEATURE_AVX)) -+ if (fcw_boot_cpu_has(X86_FEATURE_AVX)) - err = simd_register_skciphers_compat(&aesni_xctr, 1, - &aesni_simd_xctr); - if (err) -@@ -1740,7 +1724,7 @@ static int __init aesni_init(void) - return err; - } - --static void __exit aesni_exit(void) -+void __exit aesni_exit(void) - { - simd_unregister_aeads(aes_gcm_algs_aesni, - ARRAY_SIZE(aes_gcm_algs_aesni), -@@ -1749,15 +1733,9 @@ static void __exit aesni_exit(void) - aesni_simd_skciphers); - crypto_unregister_alg(&aesni_cipher_alg); - #ifdef CONFIG_X86_64 -- if (boot_cpu_has(X86_FEATURE_AVX)) -+ if (fcw_boot_cpu_has(X86_FEATURE_AVX)) - simd_unregister_skciphers(&aesni_xctr, 1, &aesni_simd_xctr); - #endif /* CONFIG_X86_64 */ - unregister_avx_algs(); - } - --late_initcall(aesni_init); --module_exit(aesni_exit); -- --MODULE_DESCRIPTION("AES cipher and modes, optimized with AES-NI or VAES instructions"); --MODULE_LICENSE("GPL"); --MODULE_ALIAS_CRYPTO("aes"); -diff --git a/crypto/aes_generic.c b/crypto/aes_generic.c -index c5bf42c63..d26cc2af0 100644 ---- a/crypto/aes_generic.c -+++ b/crypto/aes_generic.c -@@ -49,7 +49,6 @@ - - #include - #include --#include - #include - #include - #include -@@ -1296,20 +1295,13 @@ static struct crypto_alg aes_alg = { - } - }; - --static int __init aes_init(void) -+int __init aes_init(void) - { - return crypto_register_alg(&aes_alg); - } - --static void __exit aes_fini(void) -+void __exit aes_fini(void) - { - crypto_unregister_alg(&aes_alg); - } - --subsys_initcall(aes_init); --module_exit(aes_fini); -- --MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); --MODULE_LICENSE("Dual BSD/GPL"); --MODULE_ALIAS_CRYPTO("aes"); --MODULE_ALIAS_CRYPTO("aes-generic"); -diff --git a/crypto/algboss.c b/crypto/algboss.c -index a1fd31886..9d5d13bfe 100644 ---- a/crypto/algboss.c -+++ b/crypto/algboss.c -@@ -11,12 +11,11 @@ - #include - #include - #include --#include - #include --#include - #include - #include - #include -+#include - - #include "internal.h" - #include "fips_canister_wrapper.h" -@@ -60,7 +59,7 @@ static int cryptomgr_probe(void *data) - - do { - err = tmpl->create(tmpl, param->tb); -- } while (err == -EAGAIN && !signal_pending(current)); -+ } while (err == -EAGAIN && !fcw_signal_pending()); - - crypto_tmpl_put(tmpl); - -@@ -70,20 +69,22 @@ static int cryptomgr_probe(void *data) - complete_all(¶m->larval->completion); - crypto_alg_put(¶m->larval->alg); - kfree(param); -- module_put_and_kthread_exit(0); -+ fcw_module_put_and_kthread_exit(0); - } - - static int cryptomgr_schedule_probe(struct crypto_larval *larval) - { -- struct task_struct *thread; -+ void *thread; - struct cryptomgr_param *param; - const char *name = larval->alg.cra_name; - const char *p; - unsigned int len; - int i; - -+#ifdef MODULE - if (!try_module_get(THIS_MODULE)) - goto err; -+#endif - - param = fcw_kzalloc(sizeof(*param), GFP_KERNEL); - if (!param) -@@ -155,7 +156,7 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval) - crypto_alg_get(&larval->alg); - param->larval = larval; - -- thread = kthread_run(cryptomgr_probe, param, "cryptomgr_probe"); -+ thread = fcw_kthread_run(cryptomgr_probe, param, "cryptomgr_probe"); - if (IS_ERR(thread)) - goto err_put_larval; - -@@ -166,8 +167,10 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval) - err_free_param: - kfree(param); - err_put_module: -+#ifdef MODULE - module_put(THIS_MODULE); - err: -+#endif - return NOTIFY_OK; - } - -@@ -182,12 +185,12 @@ static int cryptomgr_test(void *data) - crypto_alg_tested(param->driver, err); - - kfree(param); -- module_put_and_kthread_exit(0); -+ fcw_module_put_and_kthread_exit(0); - } - - static int cryptomgr_schedule_test(struct crypto_alg *alg) - { -- struct task_struct *thread; -+ void *thread; - struct crypto_test_param *param; - - if (IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS)) -@@ -196,8 +199,10 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg) - if (fcw_skip_tests()) - return NOTIFY_DONE; - -+#ifdef MODULE - if (!try_module_get(THIS_MODULE)) - goto err; -+#endif - - param = fcw_kzalloc(sizeof(*param), GFP_KERNEL); - if (!param) -@@ -207,7 +212,7 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg) - memcpy(param->alg, alg->cra_name, sizeof(param->alg)); - param->type = alg->cra_flags; - -- thread = kthread_run(cryptomgr_test, param, "cryptomgr_test"); -+ thread = fcw_kthread_run(cryptomgr_test, param, "cryptomgr_test"); - if (IS_ERR(thread)) - goto err_free_param; - -@@ -216,8 +221,10 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg) - err_free_param: - kfree(param); - err_put_module: -+#ifdef MODULE - module_put(THIS_MODULE); - err: -+#endif - return NOTIFY_OK; - } - -@@ -240,25 +247,14 @@ static struct notifier_block cryptomgr_notifier = { - .notifier_call = cryptomgr_notify, - }; - --static int __init cryptomgr_init(void) -+int __init cryptomgr_init(void) - { - return crypto_register_notifier(&cryptomgr_notifier); - } - --static void __exit cryptomgr_exit(void) -+void __exit cryptomgr_exit(void) - { - int err = crypto_unregister_notifier(&cryptomgr_notifier); - fcw_bug_on(err); - } - --/* -- * This is arch_initcall() so that the crypto self-tests are run on algorithms -- * registered early by subsys_initcall(). subsys_initcall() is needed for -- * generic implementations so that they're available for comparison tests when -- * other implementations are registered later by module_init(). -- */ --arch_initcall(cryptomgr_init); --module_exit(cryptomgr_exit); -- --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("Crypto Algorithm Manager"); -diff --git a/crypto/cbc.c b/crypto/cbc.c -index e81918ca6..581990a12 100644 ---- a/crypto/cbc.c -+++ b/crypto/cbc.c -@@ -10,7 +10,6 @@ - #include - #include - #include --#include - - static int crypto_cbc_encrypt_segment(struct crypto_lskcipher *tfm, - const u8 *src, u8 *dst, unsigned nbytes, -@@ -169,19 +168,13 @@ static struct crypto_template crypto_cbc_tmpl = { - .module = THIS_MODULE, - }; - --static int __init crypto_cbc_module_init(void) -+int __init crypto_cbc_module_init(void) - { - return crypto_register_template(&crypto_cbc_tmpl); - } - --static void __exit crypto_cbc_module_exit(void) -+void __exit crypto_cbc_module_exit(void) - { - crypto_unregister_template(&crypto_cbc_tmpl); - } - --subsys_initcall(crypto_cbc_module_init); --module_exit(crypto_cbc_module_exit); -- --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("CBC block cipher mode of operation"); --MODULE_ALIAS_CRYPTO("cbc"); -diff --git a/crypto/ccm.c b/crypto/ccm.c -index 5e870d54e..02275f9df 100644 ---- a/crypto/ccm.c -+++ b/crypto/ccm.c -@@ -13,7 +13,6 @@ - #include - #include - #include --#include - #include - #include "fips_canister_wrapper.h" - -@@ -929,25 +928,15 @@ static struct crypto_template crypto_ccm_tmpls[] = { - }, - }; - --static int __init crypto_ccm_module_init(void) -+int __init crypto_ccm_module_init(void) - { - return crypto_register_templates(crypto_ccm_tmpls, - ARRAY_SIZE(crypto_ccm_tmpls)); - } - --static void __exit crypto_ccm_module_exit(void) -+void __exit crypto_ccm_module_exit(void) - { - crypto_unregister_templates(crypto_ccm_tmpls, - ARRAY_SIZE(crypto_ccm_tmpls)); - } - --subsys_initcall(crypto_ccm_module_init); --module_exit(crypto_ccm_module_exit); -- --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("Counter with CBC MAC"); --MODULE_ALIAS_CRYPTO("ccm_base"); --MODULE_ALIAS_CRYPTO("rfc4309"); --MODULE_ALIAS_CRYPTO("ccm"); --MODULE_ALIAS_CRYPTO("cbcmac"); --MODULE_IMPORT_NS(CRYPTO_INTERNAL); -diff --git a/crypto/cmac.c b/crypto/cmac.c -index 9e95294aa..77e23c57a 100644 ---- a/crypto/cmac.c -+++ b/crypto/cmac.c -@@ -15,7 +15,6 @@ - #include - #include - #include --#include - #include "fips_canister_wrapper.h" - - /* -@@ -298,20 +297,13 @@ static struct crypto_template crypto_cmac_tmpl = { - .module = THIS_MODULE, - }; - --static int __init crypto_cmac_module_init(void) -+int __init crypto_cmac_module_init(void) - { - return crypto_register_template(&crypto_cmac_tmpl); - } - --static void __exit crypto_cmac_module_exit(void) -+void __exit crypto_cmac_module_exit(void) - { - crypto_unregister_template(&crypto_cmac_tmpl); - } - --subsys_initcall(crypto_cmac_module_init); --module_exit(crypto_cmac_module_exit); -- --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("CMAC keyed hash algorithm"); --MODULE_ALIAS_CRYPTO("cmac"); --MODULE_IMPORT_NS(CRYPTO_INTERNAL); -diff --git a/crypto/ctr.c b/crypto/ctr.c -index 6fa3831e1..0d5b6c347 100644 ---- a/crypto/ctr.c -+++ b/crypto/ctr.c -@@ -12,7 +12,6 @@ - #include - #include - #include --#include - #include - #include "fips_canister_wrapper.h" - -@@ -339,23 +338,15 @@ static struct crypto_template crypto_ctr_tmpls[] = { - }, - }; - --static int __init crypto_ctr_module_init(void) -+int __init crypto_ctr_module_init(void) - { - return crypto_register_templates(crypto_ctr_tmpls, - ARRAY_SIZE(crypto_ctr_tmpls)); - } - --static void __exit crypto_ctr_module_exit(void) -+void __exit crypto_ctr_module_exit(void) - { - crypto_unregister_templates(crypto_ctr_tmpls, - ARRAY_SIZE(crypto_ctr_tmpls)); - } - --subsys_initcall(crypto_ctr_module_init); --module_exit(crypto_ctr_module_exit); -- --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("CTR block cipher mode of operation"); --MODULE_ALIAS_CRYPTO("rfc3686"); --MODULE_ALIAS_CRYPTO("ctr"); --MODULE_IMPORT_NS(CRYPTO_INTERNAL); -diff --git a/crypto/cts.c b/crypto/cts.c -index 7df35e8c7..d92cf1d51 100644 ---- a/crypto/cts.c -+++ b/crypto/cts.c -@@ -46,7 +46,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -393,19 +392,13 @@ static struct crypto_template crypto_cts_tmpl = { - .module = THIS_MODULE, - }; - --static int __init crypto_cts_module_init(void) -+int __init crypto_cts_module_init(void) - { - return crypto_register_template(&crypto_cts_tmpl); - } - --static void __exit crypto_cts_module_exit(void) -+void __exit crypto_cts_module_exit(void) - { - crypto_unregister_template(&crypto_cts_tmpl); - } - --subsys_initcall(crypto_cts_module_init); --module_exit(crypto_cts_module_exit); -- --MODULE_LICENSE("Dual BSD/GPL"); --MODULE_DESCRIPTION("CTS-CBC CipherText Stealing for CBC"); --MODULE_ALIAS_CRYPTO("cts"); -diff --git a/crypto/drbg.c b/crypto/drbg.c -index 37ee5181d..50c7afdd1 100644 ---- a/crypto/drbg.c -+++ b/crypto/drbg.c -@@ -287,12 +287,6 @@ static inline void drbg_cpu_to_be32(__u32 val, unsigned char *buf) - - #ifdef CONFIG_CRYPTO_DRBG_CTR - #define CRYPTO_DRBG_CTR_STRING "CTR " --MODULE_ALIAS_CRYPTO("drbg_pr_ctr_aes256"); --MODULE_ALIAS_CRYPTO("drbg_nopr_ctr_aes256"); --MODULE_ALIAS_CRYPTO("drbg_pr_ctr_aes192"); --MODULE_ALIAS_CRYPTO("drbg_nopr_ctr_aes192"); --MODULE_ALIAS_CRYPTO("drbg_pr_ctr_aes128"); --MODULE_ALIAS_CRYPTO("drbg_nopr_ctr_aes128"); - - static void drbg_kcapi_symsetkey(struct drbg_state *drbg, - const unsigned char *key); -@@ -631,12 +625,6 @@ static int drbg_fini_hash_kernel(struct drbg_state *drbg); - - #ifdef CONFIG_CRYPTO_DRBG_HMAC - #define CRYPTO_DRBG_HMAC_STRING "HMAC " --MODULE_ALIAS_CRYPTO("drbg_pr_hmac_sha512"); --MODULE_ALIAS_CRYPTO("drbg_nopr_hmac_sha512"); --MODULE_ALIAS_CRYPTO("drbg_pr_hmac_sha384"); --MODULE_ALIAS_CRYPTO("drbg_nopr_hmac_sha384"); --MODULE_ALIAS_CRYPTO("drbg_pr_hmac_sha256"); --MODULE_ALIAS_CRYPTO("drbg_nopr_hmac_sha256"); - - /* update function of HMAC DRBG as defined in 10.1.2.2 */ - static int drbg_hmac_update(struct drbg_state *drbg, struct list_head *seed, -@@ -749,12 +737,6 @@ static const struct drbg_state_ops drbg_hmac_ops = { - - #ifdef CONFIG_CRYPTO_DRBG_HASH - #define CRYPTO_DRBG_HASH_STRING "HASH " --MODULE_ALIAS_CRYPTO("drbg_pr_sha512"); --MODULE_ALIAS_CRYPTO("drbg_nopr_sha512"); --MODULE_ALIAS_CRYPTO("drbg_pr_sha384"); --MODULE_ALIAS_CRYPTO("drbg_nopr_sha384"); --MODULE_ALIAS_CRYPTO("drbg_pr_sha256"); --MODULE_ALIAS_CRYPTO("drbg_nopr_sha256"); - - /* - * Increment buffer -@@ -1142,15 +1124,19 @@ static int drbg_seed(struct drbg_state *drbg, struct drbg_string *pers, - - /* 9.1 / 9.2 / 9.3.1 step 3 */ - if (pers && pers->len > (drbg_max_addtl(drbg))) { -- pr_devel("DRBG: personalization string too long %zu\n", -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: personalization string too long %zu\n", - pers->len); -+#endif - return -EINVAL; - } - - if (list_empty(&drbg->test_data.list)) { - drbg_string_fill(&data1, drbg->test_data.buf, - drbg->test_data.len); -- pr_devel("DRBG: using test entropy\n"); -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: using test entropy\n"); -+#endif - } else { - /* - * Gather entropy equal to the security strength of the DRBG. -@@ -1174,7 +1160,7 @@ static int drbg_seed(struct drbg_state *drbg, struct drbg_string *pers, - } - - if (fips_enabled && !drbg->jent) { -- pr_err("DRBG: Jitter entropy source does not exist"); -+ fcw_printk(KERN_ERR pr_fmt() "DRBG: Jitter entropy source does not exist"); - goto out; - } - -@@ -1185,7 +1171,7 @@ static int drbg_seed(struct drbg_state *drbg, struct drbg_string *pers, - entropy, - entropylen * 2); - if (fips_enabled && ret) { -- pr_err("DRBG: jent failed with %d\n", ret); -+ fcw_printk(KERN_ERR pr_fmt() "DRBG: jent failed with %d\n", ret); - - /* - * Do not treat the transient failure of the -@@ -1207,12 +1193,12 @@ static int drbg_seed(struct drbg_state *drbg, struct drbg_string *pers, - * failure and report it. - */ - if (ret == -EAGAIN && jent_retry_count > 0) { -- pr_err("DRBG: retrying, retry_count = %d\n", -+ fcw_printk(KERN_ERR pr_fmt() "DRBG: retrying, retry_count = %d\n", - jent_retry_count); - jent_retry_count--; - goto jent_retry; - } else { -- pr_err("DRBG: jent reseed failure,err = %d\n", -+ fcw_printk(KERN_ERR pr_fmt() "DRBG: jent reseed failure,err = %d\n", - ret); - goto out; - } -@@ -1225,8 +1211,10 @@ static int drbg_seed(struct drbg_state *drbg, struct drbg_string *pers, - goto out; - if (!drbg->jent) { - drbg_string_fill(&data1, entropy, entropylen); -- pr_devel("DRBG: (re)seeding with %u bytes of entropy\n", -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: (re)seeding with %u bytes of entropy\n", - entropylen); -+#endif - } else { - - ret = crypto_rng_get_bytes(drbg->jent, -@@ -1234,15 +1222,19 @@ static int drbg_seed(struct drbg_state *drbg, struct drbg_string *pers, - entropylen); - } - if (ret) { -- pr_devel("DRBG: jent failed with %d\n", ret); -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: jent failed with %d\n", ret); -+#endif - if (!reseed || ret != -EAGAIN) - goto out; - } - } - drbg_string_fill(&data1, entropy, entropylen * 2); -- pr_devel("DRBG: Captured 64-bytes random from jitter rng\n"); -- pr_devel("DRBG: (re)seeding with %u bytes of entropy\n", -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: Captured 64-bytes random from jitter rng\n"); -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: (re)seeding with %u bytes of entropy\n", - entropylen * 2); -+#endif - } - list_add_tail(&data1.list, &seedlist); - -@@ -1253,7 +1245,9 @@ static int drbg_seed(struct drbg_state *drbg, struct drbg_string *pers, - */ - if (pers && pers->buf && 0 < pers->len) { - list_add_tail(&pers->list, &seedlist); -- pr_devel("DRBG: using personalization string\n"); -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: using personalization string\n"); -+#endif - } - - if (!reseed) { -@@ -1406,23 +1400,31 @@ static int drbg_generate(struct drbg_state *drbg, - LIST_HEAD(addtllist); - - if (!drbg->core) { -- pr_devel("DRBG: not yet seeded\n"); -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: not yet seeded\n"); -+#endif - return -EINVAL; - } - if (0 == buflen || !buf) { -- pr_devel("DRBG: no output buffer provided\n"); -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: no output buffer provided\n"); -+#endif - return -EINVAL; - } - if (addtl && NULL == addtl->buf && 0 < addtl->len) { -- pr_devel("DRBG: wrong format of additional information\n"); -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: wrong format of additional information\n"); -+#endif - return -EINVAL; - } - - /* 9.3.1 step 2 */ - len = -EINVAL; - if (buflen > (drbg_max_request_bytes(drbg))) { -- pr_devel("DRBG: requested random numbers too large %u\n", -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: requested random numbers too large %u\n", - buflen); -+#endif - goto err; - } - -@@ -1430,8 +1432,10 @@ static int drbg_generate(struct drbg_state *drbg, - - /* 9.3.1 step 4 */ - if (addtl && addtl->len > (drbg_max_addtl(drbg))) { -- pr_devel("DRBG: additional information string too long %zu\n", -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: additional information string too long %zu\n", - addtl->len); -+#endif - goto err; - } - /* 9.3.1 step 5 is implicit with the chosen DRBG */ -@@ -1444,11 +1448,13 @@ static int drbg_generate(struct drbg_state *drbg, - drbg->seeded = DRBG_SEED_STATE_UNSEEDED; - - if (drbg->pr || drbg->seeded == DRBG_SEED_STATE_UNSEEDED) { -- pr_devel("DRBG: reseeding before generation (prediction " -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: reseeding before generation (prediction " - "resistance: %s, state %s)\n", - drbg->pr ? "true" : "false", - (drbg->seeded == DRBG_SEED_STATE_FULL ? - "seeded" : "unseeded")); -+#endif - /* 9.3.1 steps 7.1 through 7.3 */ - len = drbg_seed(drbg, addtl, true); - if (len) -@@ -1460,7 +1466,7 @@ static int drbg_generate(struct drbg_state *drbg, - drbg_nopr_reseed_interval_elapsed(drbg))) { - if (fips_enabled) { - if (IS_ERR_OR_NULL(drbg->jent)) { -- pr_err("DRBG:seed rand,non-existing jent\n"); -+ fcw_printk(KERN_ERR pr_fmt() "DRBG:seed rand,non-existing jent\n"); - fcw_bug(); - goto err; - } -@@ -1505,7 +1511,9 @@ static int drbg_generate(struct drbg_state *drbg, - #if 0 - if (drbg->reseed_ctr && !(drbg->reseed_ctr % 4096)) { - int err = 0; -- pr_devel("DRBG: start to perform self test\n"); -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: start to perform self test\n"); -+#endif - if (drbg->core->flags & DRBG_HMAC) - err = alg_test("drbg_pr_hmac_sha512", - "drbg_pr_hmac_sha512", 0, 0); -@@ -1516,7 +1524,7 @@ static int drbg_generate(struct drbg_state *drbg, - err = alg_test("drbg_pr_sha256", - "drbg_pr_sha256", 0, 0); - if (err) { -- pr_err("DRBG: periodical self test failed\n"); -+ fcw_printk(KERN_ERR pr_fmt() "DRBG: periodical self test failed\n"); - /* - * uninstantiate implies that from now on, only errors - * are returned when reusing this DRBG cipher handle -@@ -1524,7 +1532,9 @@ static int drbg_generate(struct drbg_state *drbg, - drbg_uninstantiate(drbg); - return 0; - } else { -- pr_devel("DRBG: self test successful\n"); -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: self test successful\n"); -+#endif - } - } - #endif -@@ -1580,7 +1590,7 @@ static int drbg_prepare_hrng(struct drbg_state *drbg) - drbg->jent = NULL; - if (fips_enabled) - return err; -- pr_info("DRBG: Continuing without Jitter RNG\n"); -+ fcw_printk(KERN_INFO pr_fmt() "DRBG: Continuing without Jitter RNG\n"); - } - - drbg->jent->base.external = drbg->external; -@@ -1611,8 +1621,10 @@ static int drbg_instantiate(struct drbg_state *drbg, struct drbg_string *pers, - int ret; - bool reseed = true; - -- pr_devel("DRBG: Initializing DRBG core %d with prediction resistance " -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: Initializing DRBG core %d with prediction resistance " - "%s\n", coreref, pr ? "enabled" : "disabled"); -+#endif - fcw_mutex_lock(drbg->drbg_mutex); - - /* 9.1 step 1 is implicit with the selected DRBG type */ -@@ -1717,7 +1729,7 @@ static int drbg_init_hash_kernel(struct drbg_state *drbg) - - tfm = crypto_alloc_shash(drbg->core->backend_cra_name, 0, 0); - if (IS_ERR(tfm)) { -- pr_info("DRBG: could not allocate digest TFM handle: %s\n", -+ fcw_printk(KERN_INFO pr_fmt() "DRBG: could not allocate digest TFM handle: %s\n", - drbg->core->backend_cra_name); - return PTR_ERR(tfm); - } -@@ -1800,7 +1812,7 @@ static int drbg_init_sym_kernel(struct drbg_state *drbg) - - tfm = crypto_alloc_cipher(drbg->core->backend_cra_name, 0, 0); - if (IS_ERR(tfm)) { -- pr_info("DRBG: could not allocate cipher TFM handle: %s\n", -+ fcw_printk(KERN_INFO pr_fmt() "DRBG: could not allocate cipher TFM handle: %s\n", - drbg->core->backend_cra_name); - return PTR_ERR(tfm); - } -@@ -1814,7 +1826,7 @@ static int drbg_init_sym_kernel(struct drbg_state *drbg) - } - sk_tfm = crypto_alloc_skcipher(ctr_name, 0, 0); - if (IS_ERR(sk_tfm)) { -- pr_info("DRBG: could not allocate CTR cipher TFM handle: %s\n", -+ fcw_printk(KERN_INFO pr_fmt() "DRBG: could not allocate CTR cipher TFM handle: %s\n", - ctr_name); - drbg_fini_sym_kernel(drbg); - return PTR_ERR(sk_tfm); -@@ -1824,7 +1836,7 @@ static int drbg_init_sym_kernel(struct drbg_state *drbg) - - req = fcw_skcipher_request_alloc(sk_tfm, GFP_KERNEL); - if (!req) { -- pr_info("DRBG: could not allocate request queue\n"); -+ fcw_printk(KERN_INFO pr_fmt() "DRBG: could not allocate request queue\n"); - drbg_fini_sym_kernel(drbg); - return -ENOMEM; - } -@@ -2107,8 +2119,10 @@ static inline int __init drbg_healthcheck_sanity(void) - /* all tests passed */ - rc = 0; - -- pr_devel("DRBG: Sanity tests for failure code paths successfully " -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "DRBG: Sanity tests for failure code paths successfully " - "completed\n"); -+#endif - - kfree(drbg->drbg_mutex); - kfree(drbg); -@@ -2159,7 +2173,7 @@ static inline void __init drbg_fill_array(struct rng_alg *alg, - alg->seedsize = 0; - } - --static int __init drbg_init(void) -+int __init drbg_init(void) - { - unsigned int i = 0; /* pointer to drbg_algs */ - unsigned int j = 0; /* pointer to drbg_cores */ -@@ -2170,7 +2184,7 @@ static int __init drbg_init(void) - return ret; - - if (ARRAY_SIZE(drbg_cores) * 2 > ARRAY_SIZE(drbg_algs)) { -- pr_info("DRBG: Cannot register all DRBG types" -+ fcw_printk(KERN_INFO pr_fmt() "DRBG: Cannot register all DRBG types" - "(slots needed: %zu, slots available: %zu)\n", - ARRAY_SIZE(drbg_cores) * 2, ARRAY_SIZE(drbg_algs)); - return -EFAULT; -@@ -2192,13 +2206,11 @@ static int __init drbg_init(void) - return crypto_register_rngs(drbg_algs, (ARRAY_SIZE(drbg_cores) * 2)); - } - --static void __exit drbg_exit(void) -+void __exit drbg_exit(void) - { - crypto_unregister_rngs(drbg_algs, (ARRAY_SIZE(drbg_cores) * 2)); - } - --subsys_initcall(drbg_init); --module_exit(drbg_exit); - #ifndef CRYPTO_DRBG_HASH_STRING - #define CRYPTO_DRBG_HASH_STRING "" - #endif -@@ -2208,12 +2220,3 @@ module_exit(drbg_exit); - #ifndef CRYPTO_DRBG_CTR_STRING - #define CRYPTO_DRBG_CTR_STRING "" - #endif --MODULE_LICENSE("GPL"); --MODULE_AUTHOR("Stephan Mueller "); --MODULE_DESCRIPTION("NIST SP800-90A Deterministic Random Bit Generator (DRBG) " -- "using following cores: " -- CRYPTO_DRBG_HASH_STRING -- CRYPTO_DRBG_HMAC_STRING -- CRYPTO_DRBG_CTR_STRING); --MODULE_ALIAS_CRYPTO("stdrng"); --MODULE_IMPORT_NS(CRYPTO_INTERNAL); -diff --git a/crypto/ecc.c b/crypto/ecc.c -index 8cc600a31..916d86b89 100644 ---- a/crypto/ecc.c -+++ b/crypto/ecc.c -@@ -25,16 +25,13 @@ - */ - - #include --#include - #include - #include - #include --#include - #include - #include - #include - #include --#include - - #include "ecc_curve_defs.h" - #include "fips_canister_wrapper.h" -@@ -949,6 +946,9 @@ static bool vli_mmod_fast(u64 *result, u64 *product, - u64 tmp[2 * ECC_MAX_DIGITS]; - const u64 *curve_prime = curve->p; - const unsigned int ndigits = curve->g.ndigits; -+#ifdef CONFIG_PRINTK -+ static void *rs = NULL; -+#endif - - /* All NIST curves have name prefix 'nist_' */ - if (strncmp(curve->name, "nist_", 5) != 0) { -@@ -981,7 +981,11 @@ static bool vli_mmod_fast(u64 *result, u64 *product, - vli_mmod_fast_521(result, product, curve_prime, tmp); - break; - default: -- pr_err_ratelimited("ecc: unsupported digits size!\n"); -+#ifdef CONFIG_PRINTK -+ rs = fcw_init_ratelimit_state(rs); -+ if (fcw_ratelimit(rs, __func__)) -+ fcw_printk(KERN_ERR pr_fmt() "ecc: unsupported digits size!\n"); -+#endif - return false; - } - -@@ -1647,12 +1651,12 @@ static int get_jitter_ent_random_bytes(u64 *buf, unsigned int len) - int ret = 0; - - if (IS_ERR_OR_NULL(jitter_entropy)) { -- pr_err("RNG: Failed to allocated Jitter entropy RNG\n"); -+ fcw_printk(KERN_ERR pr_fmt() "RNG: Failed to allocated Jitter entropy RNG\n"); - return -ENOENT; - } - ret = crypto_rng_get_bytes(jitter_entropy,(u8 *)buf, len); - if (ret) { -- pr_err("RNG: Failed to read from Jitter entropy RNG\n"); -+ fcw_printk(KERN_ERR pr_fmt() "RNG: Failed to read from Jitter entropy RNG\n"); - return -EAGAIN; - } - crypto_free_rng(jitter_entropy); -@@ -1718,5 +1722,3 @@ int crypto_ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits, - return ret; - } - --MODULE_DESCRIPTION("core elliptic curve module"); --MODULE_LICENSE("Dual BSD/GPL"); -diff --git a/crypto/ecdh.c b/crypto/ecdh.c -index 93996076c..4e53880b1 100644 ---- a/crypto/ecdh.c -+++ b/crypto/ecdh.c -@@ -5,7 +5,6 @@ - * Authors: Salvator Benedetto - */ - --#include - #include - #include - #include -@@ -206,7 +205,7 @@ static struct kpp_alg ecdh_nist_p384 = { - - static bool ecdh_nist_p192_registered; - --static int __init ecdh_init(void) -+int __init ecdh_init(void) - { - int ret; - -@@ -233,7 +232,7 @@ static int __init ecdh_init(void) - return ret; - } - --static void __exit ecdh_exit(void) -+void __exit ecdh_exit(void) - { - if (ecdh_nist_p192_registered) - crypto_unregister_kpp(&ecdh_nist_p192); -@@ -241,8 +240,3 @@ static void __exit ecdh_exit(void) - crypto_unregister_kpp(&ecdh_nist_p384); - } - --subsys_initcall(ecdh_init); --module_exit(ecdh_exit); --MODULE_ALIAS_CRYPTO("ecdh"); --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("ECDH generic algorithm"); -diff --git a/crypto/ecdsa.c b/crypto/ecdsa.c -index 81b246e39..e36438b2e 100644 ---- a/crypto/ecdsa.c -+++ b/crypto/ecdsa.c -@@ -3,7 +3,6 @@ - * Copyright (c) 2021 IBM Corporation - */ - --#include - #include - #include - #include -@@ -96,8 +95,10 @@ static int _ecdsa_verify(struct ecc_ctx *ctx, const u64 *hash, const u64 *r, con - return -EBADMSG; - - /* hash is given */ -- pr_devel("hash : %016llx %016llx ... %016llx\n", -+#ifdef DEBUG -+ fcw_printk(KERN_DEBUG pr_fmt() "hash : %016llx %016llx ... %016llx\n", - hash[ndigits - 1], hash[ndigits - 2], hash[0]); -+#endif - - /* s1 = (s^-1) mod n */ - vli_mod_inv(s1, s, curve->n, ndigits); -@@ -336,7 +337,7 @@ static struct akcipher_alg ecdsa_nist_p192 = { - }; - static bool ecdsa_nist_p192_registered; - --static int __init ecdsa_init(void) -+int __init ecdsa_init(void) - { - int ret; - -@@ -370,7 +371,7 @@ static int __init ecdsa_init(void) - return ret; - } - --static void __exit ecdsa_exit(void) -+void __exit ecdsa_exit(void) - { - if (ecdsa_nist_p192_registered) - crypto_unregister_akcipher(&ecdsa_nist_p192); -@@ -379,14 +380,3 @@ static void __exit ecdsa_exit(void) - crypto_unregister_akcipher(&ecdsa_nist_p521); - } - --subsys_initcall(ecdsa_init); --module_exit(ecdsa_exit); -- --MODULE_LICENSE("GPL"); --MODULE_AUTHOR("Stefan Berger "); --MODULE_DESCRIPTION("ECDSA generic algorithm"); --MODULE_ALIAS_CRYPTO("ecdsa-nist-p192"); --MODULE_ALIAS_CRYPTO("ecdsa-nist-p256"); --MODULE_ALIAS_CRYPTO("ecdsa-nist-p384"); --MODULE_ALIAS_CRYPTO("ecdsa-nist-p521"); --MODULE_ALIAS_CRYPTO("ecdsa-generic"); -diff --git a/crypto/gcm.c b/crypto/gcm.c -index 76800f939..7efe5edce 100644 ---- a/crypto/gcm.c -+++ b/crypto/gcm.c -@@ -16,7 +16,6 @@ - #include - #include - #include --#include - #include - #include - #include "fips_canister_wrapper.h" -@@ -1148,7 +1147,7 @@ static struct crypto_template crypto_gcm_tmpls[] = { - }, - }; - --static int __init crypto_gcm_module_init(void) -+int __init crypto_gcm_module_init(void) - { - int err; - -@@ -1166,21 +1165,10 @@ static int __init crypto_gcm_module_init(void) - return err; - } - --static void __exit crypto_gcm_module_exit(void) -+void __exit crypto_gcm_module_exit(void) - { - kfree(gcm_zeroes); - crypto_unregister_templates(crypto_gcm_tmpls, - ARRAY_SIZE(crypto_gcm_tmpls)); - } -- --subsys_initcall(crypto_gcm_module_init); --module_exit(crypto_gcm_module_exit); -- --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("Galois/Counter Mode"); --MODULE_AUTHOR("Mikko Herranen "); --MODULE_ALIAS_CRYPTO("gcm_base"); --MODULE_ALIAS_CRYPTO("rfc4106"); --MODULE_ALIAS_CRYPTO("gcm"); --MODULE_ALIAS_CRYPTO("rfc4543"); - #endif -diff --git a/crypto/geniv.c b/crypto/geniv.c -index 647453a4e..a3600e37f 100644 ---- a/crypto/geniv.c -+++ b/crypto/geniv.c -@@ -13,8 +13,9 @@ - #include - #include - #include --#include -+#include - #include -+#include "fips_canister_wrapper.h" - - static int aead_geniv_setkey(struct crypto_aead *tfm, - const u8 *key, unsigned int keylen) -@@ -53,7 +54,7 @@ struct aead_instance *aead_geniv_alloc(struct crypto_template *tmpl, - if (err) - return ERR_PTR(err); - -- inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); -+ inst = fcw_kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); - if (!inst) - return ERR_PTR(-ENOMEM); - -@@ -154,5 +155,3 @@ void aead_exit_geniv(struct crypto_aead *tfm) - crypto_put_default_null_skcipher(); - } - --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("Shared IV generator code"); -diff --git a/crypto/ghash-generic.c b/crypto/ghash-generic.c -index c70d163c1..0a9180725 100644 ---- a/crypto/ghash-generic.c -+++ b/crypto/ghash-generic.c -@@ -41,7 +41,6 @@ - #include - #include - #include --#include - - static int ghash_init(struct shash_desc *desc) - { -@@ -165,20 +164,12 @@ static struct shash_alg ghash_alg = { - }, - }; - --static int __init ghash_mod_init(void) -+int __init ghash_mod_init(void) - { - return crypto_register_shash(&ghash_alg); - } - --static void __exit ghash_mod_exit(void) -+void __exit ghash_mod_exit(void) - { - crypto_unregister_shash(&ghash_alg); - } -- --subsys_initcall(ghash_mod_init); --module_exit(ghash_mod_exit); -- --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("GHASH hash function"); --MODULE_ALIAS_CRYPTO("ghash"); --MODULE_ALIAS_CRYPTO("ghash-generic"); -diff --git a/crypto/hmac.c b/crypto/hmac.c -index 54a5321ea..fa102cc79 100644 ---- a/crypto/hmac.c -+++ b/crypto/hmac.c -@@ -18,7 +18,6 @@ - #include - #include - #include --#include - #include - #include - #include "fips_canister_wrapper.h" -@@ -250,19 +249,13 @@ static struct crypto_template hmac_tmpl = { - .module = THIS_MODULE, - }; - --static int __init hmac_module_init(void) -+int __init hmac_module_init(void) - { - return crypto_register_template(&hmac_tmpl); - } - --static void __exit hmac_module_exit(void) -+void __exit hmac_module_exit(void) - { - crypto_unregister_template(&hmac_tmpl); - } - --subsys_initcall(hmac_module_init); --module_exit(hmac_module_exit); -- --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("HMAC hash algorithm"); --MODULE_ALIAS_CRYPTO("hmac"); -diff --git a/crypto/internal.h b/crypto/internal.h -index 711a6a5bf..fe6a3cb67 100644 ---- a/crypto/internal.h -+++ b/crypto/internal.h -@@ -13,7 +13,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -174,12 +173,18 @@ static inline void crypto_alg_put(struct crypto_alg *alg) - - static inline int crypto_tmpl_get(struct crypto_template *tmpl) - { -+#ifdef MODULE - return try_module_get(tmpl->module); -+#else -+ return true; -+#endif - } - - static inline void crypto_tmpl_put(struct crypto_template *tmpl) - { -+#ifdef MODULE - module_put(tmpl->module); -+#endif - } - - static inline int crypto_is_larval(struct crypto_alg *alg) -diff --git a/crypto/rsa.c b/crypto/rsa.c -index d5e4d994e..deed6da40 100644 ---- a/crypto/rsa.c -+++ b/crypto/rsa.c -@@ -6,12 +6,12 @@ - */ - - #include --#include - #include - #include - #include - #include - #include -+#include "fips_canister_wrapper.h" - - struct rsa_mpi_key { - MPI n; -@@ -402,7 +402,7 @@ static struct akcipher_alg rsa = { - }, - }; - --static int __init rsa_init(void) -+int __init rsa_init(void) - { - int err; - -@@ -419,14 +419,9 @@ static int __init rsa_init(void) - return 0; - } - --static void __exit rsa_exit(void) -+void __exit rsa_exit(void) - { - crypto_unregister_template(&rsa_pkcs1pad_tmpl); - crypto_unregister_akcipher(&rsa); - } - --subsys_initcall(rsa_init); --module_exit(rsa_exit); --MODULE_ALIAS_CRYPTO("rsa"); --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("RSA generic algorithm"); -diff --git a/crypto/rsa_helper.c b/crypto/rsa_helper.c -index 9deb71e13..3210b0a14 100644 ---- a/crypto/rsa_helper.c -+++ b/crypto/rsa_helper.c -@@ -12,6 +12,7 @@ - #include - #include "rsapubkey.asn1.h" - #include "rsaprivkey.asn1.h" -+#include "fips_canister_wrapper.h" - - int rsa_get_n(void *context, size_t hdrlen, unsigned char tag, - const void *value, size_t vlen) -@@ -32,7 +33,7 @@ int rsa_get_n(void *context, size_t hdrlen, unsigned char tag, - - /* In FIPS mode only allow key size 2K and higher */ - if (n_sz < 256) { -- pr_err("RSA: key size not allowed in FIPS mode\n"); -+ fcw_printk(KERN_ERR pr_fmt() "RSA: key size not allowed in FIPS mode\n"); - return -EINVAL; - } - } -diff --git a/crypto/seqiv.c b/crypto/seqiv.c -index 04928df00..d211c594a 100644 ---- a/crypto/seqiv.c -+++ b/crypto/seqiv.c -@@ -12,9 +12,7 @@ - #include - #include - #include --#include - #include --#include - #include - #include - -@@ -171,19 +169,13 @@ static struct crypto_template seqiv_tmpl = { - .module = THIS_MODULE, - }; - --static int __init seqiv_module_init(void) -+int seqiv_module_init(void) - { - return crypto_register_template(&seqiv_tmpl); - } - --static void __exit seqiv_module_exit(void) -+void seqiv_module_exit(void) - { - crypto_unregister_template(&seqiv_tmpl); - } - --subsys_initcall(seqiv_module_init); --module_exit(seqiv_module_exit); -- --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("Sequence Number IV Generator"); --MODULE_ALIAS_CRYPTO("seqiv"); -diff --git a/crypto/sha256_generic.c b/crypto/sha256_generic.c -index c5c12378b..9bc82ab39 100644 ---- a/crypto/sha256_generic.c -+++ b/crypto/sha256_generic.c -@@ -9,7 +9,6 @@ - */ - #include - #include --#include - #include - #include - #include -@@ -84,23 +83,13 @@ static struct shash_alg sha256_algs[2] = { { - } - } }; - --static int __init sha256_generic_mod_init(void) -+int __init sha256_generic_mod_init(void) - { - return crypto_register_shashes(sha256_algs, ARRAY_SIZE(sha256_algs)); - } - --static void __exit sha256_generic_mod_fini(void) -+void __exit sha256_generic_mod_fini(void) - { - crypto_unregister_shashes(sha256_algs, ARRAY_SIZE(sha256_algs)); - } - --subsys_initcall(sha256_generic_mod_init); --module_exit(sha256_generic_mod_fini); -- --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("SHA-224 and SHA-256 Secure Hash Algorithm"); -- --MODULE_ALIAS_CRYPTO("sha224"); --MODULE_ALIAS_CRYPTO("sha224-generic"); --MODULE_ALIAS_CRYPTO("sha256"); --MODULE_ALIAS_CRYPTO("sha256-generic"); -diff --git a/crypto/sha3_generic.c b/crypto/sha3_generic.c -index 8ab1edd07..7aa5becfc 100644 ---- a/crypto/sha3_generic.c -+++ b/crypto/sha3_generic.c -@@ -10,7 +10,6 @@ - */ - #include - #include --#include - #include - #include - #include -@@ -276,27 +275,13 @@ static struct shash_alg algs[] = { { - .base.cra_module = THIS_MODULE, - } }; - --static int __init sha3_generic_mod_init(void) -+int __init sha3_generic_mod_init(void) - { - return crypto_register_shashes(algs, ARRAY_SIZE(algs)); - } - --static void __exit sha3_generic_mod_fini(void) -+void __exit sha3_generic_mod_fini(void) - { - crypto_unregister_shashes(algs, ARRAY_SIZE(algs)); - } - --subsys_initcall(sha3_generic_mod_init); --module_exit(sha3_generic_mod_fini); -- --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("SHA-3 Secure Hash Algorithm"); -- --MODULE_ALIAS_CRYPTO("sha3-224"); --MODULE_ALIAS_CRYPTO("sha3-224-generic"); --MODULE_ALIAS_CRYPTO("sha3-256"); --MODULE_ALIAS_CRYPTO("sha3-256-generic"); --MODULE_ALIAS_CRYPTO("sha3-384"); --MODULE_ALIAS_CRYPTO("sha3-384-generic"); --MODULE_ALIAS_CRYPTO("sha3-512"); --MODULE_ALIAS_CRYPTO("sha3-512-generic"); -diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c -index 92d8a95f0..5c108024b 100644 ---- a/crypto/sha512_generic.c -+++ b/crypto/sha512_generic.c -@@ -7,7 +7,6 @@ - */ - #include - #include --#include - #include - #include - #include -@@ -201,23 +200,13 @@ static struct shash_alg sha512_algs[2] = { { - } - } }; - --static int __init sha512_generic_mod_init(void) -+int __init sha512_generic_mod_init(void) - { - return crypto_register_shashes(sha512_algs, ARRAY_SIZE(sha512_algs)); - } - --static void __exit sha512_generic_mod_fini(void) -+void __exit sha512_generic_mod_fini(void) - { - crypto_unregister_shashes(sha512_algs, ARRAY_SIZE(sha512_algs)); - } - --subsys_initcall(sha512_generic_mod_init); --module_exit(sha512_generic_mod_fini); -- --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("SHA-512 and SHA-384 Secure Hash Algorithms"); -- --MODULE_ALIAS_CRYPTO("sha384"); --MODULE_ALIAS_CRYPTO("sha384-generic"); --MODULE_ALIAS_CRYPTO("sha512"); --MODULE_ALIAS_CRYPTO("sha512-generic"); -diff --git a/crypto/testmgr.c b/crypto/testmgr.c -index abb33d9ba..3e3cc4d55 100644 ---- a/crypto/testmgr.c -+++ b/crypto/testmgr.c -@@ -21,7 +21,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -38,24 +37,11 @@ - - #include "internal.h" - #include "fips_canister_wrapper.h" -- --MODULE_IMPORT_NS(CRYPTO_INTERNAL); -- --static bool notests; --module_param(notests, bool, 0644); --MODULE_PARM_DESC(notests, "disable crypto self-tests"); -- --static bool panic_on_fail; --module_param(panic_on_fail, bool, 0444); -+#include "fips_canister_wrapper_common.h" - - #ifdef CONFIG_CRYPTO_MANAGER_EXTRA_TESTS - static bool noextratests; --module_param(noextratests, bool, 0644); --MODULE_PARM_DESC(noextratests, "disable expensive crypto self-tests"); -- - static unsigned int fuzz_iterations = 100; --module_param(fuzz_iterations, uint, 0644); --MODULE_PARM_DESC(fuzz_iterations, "number of fuzz test iterations"); - #endif - - #ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS -@@ -70,16 +56,24 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask) - - #include "testmgr.h" - --/* -- * Need slab memory for testing (size in number of pages). -- */ --#define XBUFSIZE 8 -- - /* - * Used by test_cipher() - */ - #define ENCRYPT 1 - #define DECRYPT 0 -+extern int fcw_build_hash_sglist(struct test_sglist *tsgl, -+ const struct hash_testvec *vec, -+ const struct testvec_config *cfg, -+ unsigned int alignmask, -+ const struct test_sg_division *divs[XBUFSIZE]); -+extern int fcw_build_cipher_test_sglists(struct cipher_test_sglists *tsgls, -+ const struct testvec_config *cfg, -+ unsigned int alignmask, -+ unsigned int src_total_len, -+ unsigned int dst_total_len, -+ const struct kvec *inputs, -+ unsigned int nr_inputs); -+extern void *fcw_sg_page_address(struct scatterlist *sg); - - struct aead_test_suite { - const struct aead_testvec *vecs; -@@ -200,9 +194,6 @@ static void testmgr_free_buf(char *buf[XBUFSIZE]) - __testmgr_free_buf(buf, 0); - } - --#define TESTMGR_POISON_BYTE 0xfe --#define TESTMGR_POISON_LEN 16 -- - static inline void testmgr_poison(void *addr, size_t len) - { - memset(addr, TESTMGR_POISON_BYTE, len); -@@ -214,106 +205,6 @@ static inline bool testmgr_is_poison(const void *addr, size_t len) - return memchr_inv(addr, TESTMGR_POISON_BYTE, len) == NULL; - } - --/* flush type for hash algorithms */ --enum flush_type { -- /* merge with update of previous buffer(s) */ -- FLUSH_TYPE_NONE = 0, -- -- /* update with previous buffer(s) before doing this one */ -- FLUSH_TYPE_FLUSH, -- -- /* likewise, but also export and re-import the intermediate state */ -- FLUSH_TYPE_REIMPORT, --}; -- --/* finalization function for hash algorithms */ --enum finalization_type { -- FINALIZATION_TYPE_FINAL, /* use final() */ -- FINALIZATION_TYPE_FINUP, /* use finup() */ -- FINALIZATION_TYPE_DIGEST, /* use digest() */ --}; -- --/* -- * Whether the crypto operation will occur in-place, and if so whether the -- * source and destination scatterlist pointers will coincide (req->src == -- * req->dst), or whether they'll merely point to two separate scatterlists -- * (req->src != req->dst) that reference the same underlying memory. -- * -- * This is only relevant for algorithm types that support in-place operation. -- */ --enum inplace_mode { -- OUT_OF_PLACE, -- INPLACE_ONE_SGLIST, -- INPLACE_TWO_SGLISTS, --}; -- --#define TEST_SG_TOTAL 10000 -- --/** -- * struct test_sg_division - description of a scatterlist entry -- * -- * This struct describes one entry of a scatterlist being constructed to check a -- * crypto test vector. -- * -- * @proportion_of_total: length of this chunk relative to the total length, -- * given as a proportion out of TEST_SG_TOTAL so that it -- * scales to fit any test vector -- * @offset: byte offset into a 2-page buffer at which this chunk will start -- * @offset_relative_to_alignmask: if true, add the algorithm's alignmask to the -- * @offset -- * @flush_type: for hashes, whether an update() should be done now vs. -- * continuing to accumulate data -- * @nosimd: if doing the pending update(), do it with SIMD disabled? -- */ --struct test_sg_division { -- unsigned int proportion_of_total; -- unsigned int offset; -- bool offset_relative_to_alignmask; -- enum flush_type flush_type; -- bool nosimd; --}; -- --/** -- * struct testvec_config - configuration for testing a crypto test vector -- * -- * This struct describes the data layout and other parameters with which each -- * crypto test vector can be tested. -- * -- * @name: name of this config, logged for debugging purposes if a test fails -- * @inplace_mode: whether and how to operate on the data in-place, if applicable -- * @req_flags: extra request_flags, e.g. CRYPTO_TFM_REQ_MAY_SLEEP -- * @src_divs: description of how to arrange the source scatterlist -- * @dst_divs: description of how to arrange the dst scatterlist, if applicable -- * for the algorithm type. Defaults to @src_divs if unset. -- * @iv_offset: misalignment of the IV in the range [0..MAX_ALGAPI_ALIGNMASK+1], -- * where 0 is aligned to a 2*(MAX_ALGAPI_ALIGNMASK+1) byte boundary -- * @iv_offset_relative_to_alignmask: if true, add the algorithm's alignmask to -- * the @iv_offset -- * @key_offset: misalignment of the key, where 0 is default alignment -- * @key_offset_relative_to_alignmask: if true, add the algorithm's alignmask to -- * the @key_offset -- * @finalization_type: what finalization function to use for hashes -- * @nosimd: execute with SIMD disabled? Requires !CRYPTO_TFM_REQ_MAY_SLEEP. -- * This applies to the parts of the operation that aren't controlled -- * individually by @nosimd_setkey or @src_divs[].nosimd. -- * @nosimd_setkey: set the key (if applicable) with SIMD disabled? Requires -- * !CRYPTO_TFM_REQ_MAY_SLEEP. -- */ --struct testvec_config { -- const char *name; -- enum inplace_mode inplace_mode; -- u32 req_flags; -- struct test_sg_division src_divs[XBUFSIZE]; -- struct test_sg_division dst_divs[XBUFSIZE]; -- unsigned int iv_offset; -- unsigned int key_offset; -- bool iv_offset_relative_to_alignmask; -- bool key_offset_relative_to_alignmask; -- enum finalization_type finalization_type; -- bool nosimd; -- bool nosimd_setkey; --}; -- - #define TESTVEC_CONFIG_NAMELEN 192 - - /* -@@ -469,18 +360,6 @@ static const struct testvec_config default_hash_testvec_configs[] = { - } - }; - --static unsigned int count_test_sg_divisions(const struct test_sg_division *divs) --{ -- unsigned int remaining = TEST_SG_TOTAL; -- unsigned int ndivs = 0; -- -- do { -- remaining -= divs[ndivs++].proportion_of_total; -- } while (remaining); -- -- return ndivs; --} -- - #define SGDIVS_HAVE_FLUSHES BIT(0) - #define SGDIVS_HAVE_NOSIMD BIT(1) - -@@ -547,14 +426,6 @@ static bool valid_testvec_config(const struct testvec_config *cfg) - return true; - } - --struct test_sglist { -- char *bufs[XBUFSIZE]; -- struct scatterlist sgl[XBUFSIZE]; -- struct scatterlist sgl_saved[XBUFSIZE]; -- struct scatterlist *sgl_ptr; -- unsigned int nents; --}; -- - static int init_test_sglist(struct test_sglist *tsgl) - { - return __testmgr_alloc_buf(tsgl->bufs, 1 /* two pages per buffer */); -@@ -565,108 +436,6 @@ static void destroy_test_sglist(struct test_sglist *tsgl) - return __testmgr_free_buf(tsgl->bufs, 1 /* two pages per buffer */); - } - --/** -- * build_test_sglist() - build a scatterlist for a crypto test -- * -- * @tsgl: the scatterlist to build. @tsgl->bufs[] contains an array of 2-page -- * buffers which the scatterlist @tsgl->sgl[] will be made to point into. -- * @divs: the layout specification on which the scatterlist will be based -- * @alignmask: the algorithm's alignmask -- * @total_len: the total length of the scatterlist to build in bytes -- * @data: if non-NULL, the buffers will be filled with this data until it ends. -- * Otherwise the buffers will be poisoned. In both cases, some bytes -- * past the end of each buffer will be poisoned to help detect overruns. -- * @out_divs: if non-NULL, the test_sg_division to which each scatterlist entry -- * corresponds will be returned here. This will match @divs except -- * that divisions resolving to a length of 0 are omitted as they are -- * not included in the scatterlist. -- * -- * Return: 0 or a -errno value -- */ --static int build_test_sglist(struct test_sglist *tsgl, -- const struct test_sg_division *divs, -- const unsigned int alignmask, -- const unsigned int total_len, -- struct iov_iter *data, -- const struct test_sg_division *out_divs[XBUFSIZE]) --{ -- struct { -- const struct test_sg_division *div; -- size_t length; -- } partitions[XBUFSIZE]; -- const unsigned int ndivs = count_test_sg_divisions(divs); -- unsigned int len_remaining = total_len; -- unsigned int i; -- -- BUILD_BUG_ON(ARRAY_SIZE(partitions) != ARRAY_SIZE(tsgl->sgl)); -- if (fcw_warn_on(ndivs > ARRAY_SIZE(partitions))) -- return -EINVAL; -- -- /* Calculate the (div, length) pairs */ -- tsgl->nents = 0; -- for (i = 0; i < ndivs; i++) { -- unsigned int len_this_sg = -- min(len_remaining, -- (total_len * divs[i].proportion_of_total + -- TEST_SG_TOTAL / 2) / TEST_SG_TOTAL); -- -- if (len_this_sg != 0) { -- partitions[tsgl->nents].div = &divs[i]; -- partitions[tsgl->nents].length = len_this_sg; -- tsgl->nents++; -- len_remaining -= len_this_sg; -- } -- } -- if (tsgl->nents == 0) { -- partitions[tsgl->nents].div = &divs[0]; -- partitions[tsgl->nents].length = 0; -- tsgl->nents++; -- } -- partitions[tsgl->nents - 1].length += len_remaining; -- -- /* Set up the sgl entries and fill the data or poison */ -- sg_init_table(tsgl->sgl, tsgl->nents); -- for (i = 0; i < tsgl->nents; i++) { -- unsigned int offset = partitions[i].div->offset; -- void *addr; -- -- if (partitions[i].div->offset_relative_to_alignmask) -- offset += alignmask; -- -- while (offset + partitions[i].length + TESTMGR_POISON_LEN > -- 2 * PAGE_SIZE) { -- if (fcw_warn_on(offset <= 0)) -- return -EINVAL; -- offset /= 2; -- } -- -- addr = &tsgl->bufs[i][offset]; -- fcw_sg_set_buf(&tsgl->sgl[i], addr, partitions[i].length); -- -- if (out_divs) -- out_divs[i] = partitions[i].div; -- -- if (data) { -- size_t copy_len, copied; -- -- copy_len = min(partitions[i].length, data->count); -- copied = fcw_copy_from_iter(addr, copy_len, data); -- if (fcw_warn_on(copied != copy_len)) -- return -EINVAL; -- testmgr_poison(addr + copy_len, partitions[i].length + -- TESTMGR_POISON_LEN - copy_len); -- } else { -- testmgr_poison(addr, partitions[i].length + -- TESTMGR_POISON_LEN); -- } -- } -- -- sg_mark_end(&tsgl->sgl[tsgl->nents - 1]); -- tsgl->sgl_ptr = tsgl->sgl; -- memcpy(tsgl->sgl_saved, tsgl->sgl, tsgl->nents * sizeof(tsgl->sgl[0])); -- return 0; --} -- - /* - * Verify that a scatterlist crypto operation produced the correct output. - * -@@ -702,7 +471,7 @@ static int verify_correct_output(const struct test_sglist *tsgl, - unchecked_prefix_len = 0; - } - len = min(len, len_to_check); -- actual_output = page_address(fcw_sg_page(sg)) + offset; -+ actual_output = fcw_sg_page_address(sg) + offset; - if (memcmp(expected_output, actual_output, len) != 0) - return -EINVAL; - if (check_poison && -@@ -731,11 +500,6 @@ static bool is_test_sglist_corrupted(const struct test_sglist *tsgl) - return false; - } - --struct cipher_test_sglists { -- struct test_sglist src; -- struct test_sglist dst; --}; -- - static struct cipher_test_sglists *alloc_cipher_test_sglists(void) - { - struct cipher_test_sglists *tsgls; -@@ -767,59 +531,6 @@ static void free_cipher_test_sglists(struct cipher_test_sglists *tsgls) - } - } - --/* Build the src and dst scatterlists for an skcipher or AEAD test */ --static int build_cipher_test_sglists(struct cipher_test_sglists *tsgls, -- const struct testvec_config *cfg, -- unsigned int alignmask, -- unsigned int src_total_len, -- unsigned int dst_total_len, -- const struct kvec *inputs, -- unsigned int nr_inputs) --{ -- struct iov_iter input; -- int err; -- -- iov_iter_kvec(&input, ITER_SOURCE, inputs, nr_inputs, src_total_len); -- err = build_test_sglist(&tsgls->src, cfg->src_divs, alignmask, -- cfg->inplace_mode != OUT_OF_PLACE ? -- max(dst_total_len, src_total_len) : -- src_total_len, -- &input, NULL); -- if (err) -- return err; -- -- /* -- * In-place crypto operations can use the same scatterlist for both the -- * source and destination (req->src == req->dst), or can use separate -- * scatterlists (req->src != req->dst) which point to the same -- * underlying memory. Make sure to test both cases. -- */ -- if (cfg->inplace_mode == INPLACE_ONE_SGLIST) { -- tsgls->dst.sgl_ptr = tsgls->src.sgl; -- tsgls->dst.nents = tsgls->src.nents; -- return 0; -- } -- if (cfg->inplace_mode == INPLACE_TWO_SGLISTS) { -- /* -- * For now we keep it simple and only test the case where the -- * two scatterlists have identical entries, rather than -- * different entries that split up the same memory differently. -- */ -- memcpy(tsgls->dst.sgl, tsgls->src.sgl, -- tsgls->src.nents * sizeof(tsgls->src.sgl[0])); -- memcpy(tsgls->dst.sgl_saved, tsgls->src.sgl, -- tsgls->src.nents * sizeof(tsgls->src.sgl[0])); -- tsgls->dst.sgl_ptr = tsgls->dst.sgl; -- tsgls->dst.nents = tsgls->src.nents; -- return 0; -- } -- /* Out of place */ -- return build_test_sglist(&tsgls->dst, -- cfg->dst_divs[0].proportion_of_total ? -- cfg->dst_divs : cfg->src_divs, -- alignmask, dst_total_len, NULL, NULL); --} -- - /* - * Support for testing passing a misaligned key to setkey(): - * -@@ -1232,7 +943,7 @@ static int build_generic_driver_name(const char *algname, - return 0; - - too_long: -- pr_err("alg: generic driver name for \"%s\" would be too long\n", -+ fcw_printk(KERN_ERR pr_fmt "alg: generic driver name for \"%s\" would be too long\n", - algname); - return -ENAMETOOLONG; - } -@@ -1246,22 +957,6 @@ static void crypto_reenable_simd_for_test(void) - } - #endif /* !CONFIG_CRYPTO_MANAGER_EXTRA_TESTS */ - --static int build_hash_sglist(struct test_sglist *tsgl, -- const struct hash_testvec *vec, -- const struct testvec_config *cfg, -- unsigned int alignmask, -- const struct test_sg_division *divs[XBUFSIZE]) --{ -- struct kvec kv; -- struct iov_iter input; -- -- kv.iov_base = (void *)vec->plaintext; -- kv.iov_len = vec->psize; -- iov_iter_kvec(&input, ITER_SOURCE, &kv, 1, vec->psize); -- return build_test_sglist(tsgl, cfg->src_divs, alignmask, vec->psize, -- &input, divs); --} -- - static int check_hash_result(const char *type, - const u8 *result, unsigned int digestsize, - const struct hash_testvec *vec, -@@ -1270,12 +965,12 @@ static int check_hash_result(const char *type, - const struct testvec_config *cfg) - { - if (memcmp(result, vec->digest, digestsize) != 0) { -- pr_err("alg: %s: %s test failed (wrong result) on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: %s: %s test failed (wrong result) on test vector %s, cfg=\"%s\"\n", - type, driver, vec_name, cfg->name); - return -EINVAL; - } - if (!testmgr_is_poison(&result[digestsize], TESTMGR_POISON_LEN)) { -- pr_err("alg: %s: %s overran result buffer on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: %s: %s overran result buffer on test vector %s, cfg=\"%s\"\n", - type, driver, vec_name, cfg->name); - return -EOVERFLOW; - } -@@ -1287,7 +982,7 @@ static inline int check_shash_op(const char *op, int err, - const struct testvec_config *cfg) - { - if (err) -- pr_err("alg: shash: %s %s() failed with err %d on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: shash: %s %s() failed with err %d on test vector %s, cfg=\"%s\"\n", - driver, op, err, vec_name, cfg->name); - return err; - } -@@ -1316,22 +1011,22 @@ static int test_shash_vec_cfg(const struct hash_testvec *vec, - if (err) { - if (err == vec->setkey_error) - return 0; -- pr_err("alg: shash: %s setkey failed on test vector %s; expected_error=%d, actual_error=%d, flags=%#x\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: shash: %s setkey failed on test vector %s; expected_error=%d, actual_error=%d, flags=%#x\n", - driver, vec_name, vec->setkey_error, err, - crypto_shash_get_flags(tfm)); - return err; - } - if (vec->setkey_error) { -- pr_err("alg: shash: %s setkey unexpectedly succeeded on test vector %s; expected_error=%d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: shash: %s setkey unexpectedly succeeded on test vector %s; expected_error=%d\n", - driver, vec_name, vec->setkey_error); - return -EINVAL; - } - } - - /* Build the scatterlist for the source data */ -- err = build_hash_sglist(tsgl, vec, cfg, 0, divs); -+ err = fcw_build_hash_sglist(tsgl, vec, cfg, 0, divs); - if (err) { -- pr_err("alg: shash: %s: error preparing scatterlist for test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: shash: %s: error preparing scatterlist for test vector %s, cfg=\"%s\"\n", - driver, vec_name, cfg->name); - return err; - } -@@ -1355,13 +1050,13 @@ static int test_shash_vec_cfg(const struct hash_testvec *vec, - if (err) { - if (err == vec->digest_error) - return 0; -- pr_err("alg: shash: %s digest() failed on test vector %s; expected_error=%d, actual_error=%d, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: shash: %s digest() failed on test vector %s; expected_error=%d, actual_error=%d, cfg=\"%s\"\n", - driver, vec_name, vec->digest_error, err, - cfg->name); - return err; - } - if (vec->digest_error) { -- pr_err("alg: shash: %s digest() unexpectedly succeeded on test vector %s; expected_error=%d, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: shash: %s digest() unexpectedly succeeded on test vector %s; expected_error=%d, cfg=\"%s\"\n", - driver, vec_name, vec->digest_error, cfg->name); - return -EINVAL; - } -@@ -1414,7 +1109,7 @@ static int test_shash_vec_cfg(const struct hash_testvec *vec, - return err; - if (!testmgr_is_poison(hashstate + statesize, - TESTMGR_POISON_LEN)) { -- pr_err("alg: shash: %s export() overran state buffer on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: shash: %s export() overran state buffer on test vector %s, cfg=\"%s\"\n", - driver, vec_name, cfg->name); - return -EOVERFLOW; - } -@@ -1463,12 +1158,12 @@ static int check_nonfinal_ahash_op(const char *op, int err, - const struct testvec_config *cfg) - { - if (err) { -- pr_err("alg: ahash: %s %s() failed with err %d on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: ahash: %s %s() failed with err %d on test vector %s, cfg=\"%s\"\n", - driver, op, err, vec_name, cfg->name); - return err; - } - if (!testmgr_is_poison(result, digestsize)) { -- pr_err("alg: ahash: %s %s() used result buffer on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: ahash: %s %s() used result buffer on test vector %s, cfg=\"%s\"\n", - driver, op, vec_name, cfg->name); - return -EINVAL; - } -@@ -1503,22 +1198,22 @@ static int test_ahash_vec_cfg(const struct hash_testvec *vec, - if (err) { - if (err == vec->setkey_error) - return 0; -- pr_err("alg: ahash: %s setkey failed on test vector %s; expected_error=%d, actual_error=%d, flags=%#x\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: ahash: %s setkey failed on test vector %s; expected_error=%d, actual_error=%d, flags=%#x\n", - driver, vec_name, vec->setkey_error, err, - crypto_ahash_get_flags(tfm)); - return err; - } - if (vec->setkey_error) { -- pr_err("alg: ahash: %s setkey unexpectedly succeeded on test vector %s; expected_error=%d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: ahash: %s setkey unexpectedly succeeded on test vector %s; expected_error=%d\n", - driver, vec_name, vec->setkey_error); - return -EINVAL; - } - } - - /* Build the scatterlist for the source data */ -- err = build_hash_sglist(tsgl, vec, cfg, 0, divs); -+ err = fcw_build_hash_sglist(tsgl, vec, cfg, 0, divs); - if (err) { -- pr_err("alg: ahash: %s: error preparing scatterlist for test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: ahash: %s: error preparing scatterlist for test vector %s, cfg=\"%s\"\n", - driver, vec_name, cfg->name); - return err; - } -@@ -1538,13 +1233,13 @@ static int test_ahash_vec_cfg(const struct hash_testvec *vec, - if (err) { - if (err == vec->digest_error) - return 0; -- pr_err("alg: ahash: %s digest() failed on test vector %s; expected_error=%d, actual_error=%d, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: ahash: %s digest() failed on test vector %s; expected_error=%d, actual_error=%d, cfg=\"%s\"\n", - driver, vec_name, vec->digest_error, err, - cfg->name); - return err; - } - if (vec->digest_error) { -- pr_err("alg: ahash: %s digest() unexpectedly succeeded on test vector %s; expected_error=%d, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: ahash: %s digest() unexpectedly succeeded on test vector %s; expected_error=%d, cfg=\"%s\"\n", - driver, vec_name, vec->digest_error, cfg->name); - return -EINVAL; - } -@@ -1593,7 +1288,7 @@ static int test_ahash_vec_cfg(const struct hash_testvec *vec, - return err; - if (!testmgr_is_poison(hashstate + statesize, - TESTMGR_POISON_LEN)) { -- pr_err("alg: ahash: %s export() overran state buffer on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: ahash: %s export() overran state buffer on test vector %s, cfg=\"%s\"\n", - driver, vec_name, cfg->name); - return -EOVERFLOW; - } -@@ -1622,7 +1317,7 @@ static int test_ahash_vec_cfg(const struct hash_testvec *vec, - return err; - err = do_ahash_op(crypto_ahash_final, req, &wait, cfg->nosimd); - if (err) { -- pr_err("alg: ahash: %s final() failed with err %d on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: ahash: %s final() failed with err %d on test vector %s, cfg=\"%s\"\n", - driver, err, vec_name, cfg->name); - return err; - } -@@ -1630,7 +1325,7 @@ static int test_ahash_vec_cfg(const struct hash_testvec *vec, - /* finish with finup() */ - err = do_ahash_op(crypto_ahash_finup, req, &wait, cfg->nosimd); - if (err) { -- pr_err("alg: ahash: %s finup() failed with err %d on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: ahash: %s finup() failed with err %d on test vector %s, cfg=\"%s\"\n", - driver, err, vec_name, cfg->name); - return err; - } -@@ -1797,11 +1492,11 @@ static int test_hash_vs_generic_impl(const char *generic_driver, - if (IS_ERR(generic_tfm)) { - err = PTR_ERR(generic_tfm); - if (err == -ENOENT) { -- pr_warn("alg: hash: skipping comparison tests for %s because %s is unavailable\n", -+ fcw_printk(KERN_WARNING pr_fmt() "alg: hash: skipping comparison tests for %s because %s is unavailable\n", - driver, generic_driver); - return 0; - } -- pr_err("alg: hash: error allocating %s (generic impl of %s): %d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: hash: error allocating %s (generic impl of %s): %d\n", - generic_driver, algname, err); - return err; - } -@@ -1823,7 +1518,7 @@ static int test_hash_vs_generic_impl(const char *generic_driver, - /* Check the algorithm properties for consistency. */ - - if (digestsize != crypto_shash_digestsize(generic_tfm)) { -- pr_err("alg: hash: digestsize for %s (%u) doesn't match generic impl (%u)\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: hash: digestsize for %s (%u) doesn't match generic impl (%u)\n", - driver, digestsize, - crypto_shash_digestsize(generic_tfm)); - err = -EINVAL; -@@ -1831,7 +1526,7 @@ static int test_hash_vs_generic_impl(const char *generic_driver, - } - - if (blocksize != crypto_shash_blocksize(generic_tfm)) { -- pr_err("alg: hash: blocksize for %s (%u) doesn't match generic impl (%u)\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: hash: blocksize for %s (%u) doesn't match generic impl (%u)\n", - driver, blocksize, crypto_shash_blocksize(generic_tfm)); - err = -EINVAL; - goto out; -@@ -1901,7 +1596,7 @@ static int alloc_shash(const char *driver, u32 type, u32 mask, - */ - return 0; - } -- pr_err("alg: hash: failed to allocate shash transform for %s: %ld\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: hash: failed to allocate shash transform for %s: %ld\n", - driver, PTR_ERR(tfm)); - return PTR_ERR(tfm); - } -@@ -1942,7 +1637,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs, - if (IS_ERR(atfm)) { - if (PTR_ERR(atfm) == -ENOENT) - return 0; -- pr_err("alg: hash: failed to allocate transform for %s: %ld\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: hash: failed to allocate transform for %s: %ld\n", - driver, PTR_ERR(atfm)); - return PTR_ERR(atfm); - } -@@ -1950,7 +1645,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs, - - req = fcw_ahash_request_alloc(atfm, GFP_KERNEL); - if (!req) { -- pr_err("alg: hash: failed to allocate request for %s\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: hash: failed to allocate request for %s\n", - driver); - err = -ENOMEM; - goto out; -@@ -1966,7 +1661,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs, - - tsgl = fcw_kmalloc(sizeof(*tsgl), GFP_KERNEL); - if (!tsgl || init_test_sglist(tsgl) != 0) { -- pr_err("alg: hash: failed to allocate test buffers for %s\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: hash: failed to allocate test buffers for %s\n", - driver); - kfree(tsgl); - tsgl = NULL; -@@ -1979,7 +1674,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs, - statesize = max(statesize, crypto_shash_statesize(stfm)); - hashstate = fcw_kmalloc(statesize + TESTMGR_POISON_LEN, GFP_KERNEL); - if (!hashstate) { -- pr_err("alg: hash: failed to allocate hash state buffer for %s\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: hash: failed to allocate hash state buffer for %s\n", - driver); - err = -ENOMEM; - goto out; -@@ -2030,7 +1725,7 @@ static int alg_test_hash(const struct alg_test_desc *desc, const char *driver, - } - for (nr_keyed = 0; nr_unkeyed + nr_keyed < tcount; nr_keyed++) { - if (!template[nr_unkeyed + nr_keyed].ksize) { -- pr_err("alg: hash: test vectors for %s out of order, " -+ fcw_printk(KERN_ERR pr_fmt() "alg: hash: test vectors for %s out of order, " - "unkeyed ones must come first\n", desc->alg); - return -EINVAL; - } -@@ -2082,13 +1777,13 @@ static int test_aead_vec_cfg(int enc, const struct aead_testvec *vec, - err = do_setkey(crypto_aead_setkey, tfm, vec->key, vec->klen, - cfg, alignmask); - if (err && err != vec->setkey_error) { -- pr_err("alg: aead: %s setkey failed on test vector %s; expected_error=%d, actual_error=%d, flags=%#x\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: %s setkey failed on test vector %s; expected_error=%d, actual_error=%d, flags=%#x\n", - driver, vec_name, vec->setkey_error, err, - crypto_aead_get_flags(tfm)); - return err; - } - if (!err && vec->setkey_error) { -- pr_err("alg: aead: %s setkey unexpectedly succeeded on test vector %s; expected_error=%d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: %s setkey unexpectedly succeeded on test vector %s; expected_error=%d\n", - driver, vec_name, vec->setkey_error); - return -EINVAL; - } -@@ -2096,12 +1791,12 @@ static int test_aead_vec_cfg(int enc, const struct aead_testvec *vec, - /* Set the authentication tag size */ - err = crypto_aead_setauthsize(tfm, authsize); - if (err && err != vec->setauthsize_error) { -- pr_err("alg: aead: %s setauthsize failed on test vector %s; expected_error=%d, actual_error=%d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: %s setauthsize failed on test vector %s; expected_error=%d, actual_error=%d\n", - driver, vec_name, vec->setauthsize_error, err); - return err; - } - if (!err && vec->setauthsize_error) { -- pr_err("alg: aead: %s setauthsize unexpectedly succeeded on test vector %s; expected_error=%d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: %s setauthsize unexpectedly succeeded on test vector %s; expected_error=%d\n", - driver, vec_name, vec->setauthsize_error); - return -EINVAL; - } -@@ -2122,14 +1817,14 @@ static int test_aead_vec_cfg(int enc, const struct aead_testvec *vec, - input[0].iov_len = vec->alen; - input[1].iov_base = enc ? (void *)vec->ptext : (void *)vec->ctext; - input[1].iov_len = enc ? vec->plen : vec->clen; -- err = build_cipher_test_sglists(tsgls, cfg, alignmask, -+ err = fcw_build_cipher_test_sglists(tsgls, cfg, alignmask, - vec->alen + (enc ? vec->plen : - vec->clen), - vec->alen + (enc ? vec->clen : - vec->plen), - input, 2); - if (err) { -- pr_err("alg: aead: %s %s: error preparing scatterlists for test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: %s %s: error preparing scatterlists for test vector %s, cfg=\"%s\"\n", - driver, op, vec_name, cfg->name); - return err; - } -@@ -2157,36 +1852,36 @@ static int test_aead_vec_cfg(int enc, const struct aead_testvec *vec, - req->base.complete != crypto_req_done || - req->base.flags != req_flags || - req->base.data != &wait) { -- pr_err("alg: aead: %s %s corrupted request struct on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: %s %s corrupted request struct on test vector %s, cfg=\"%s\"\n", - driver, op, vec_name, cfg->name); - if (req->cryptlen != (enc ? vec->plen : vec->clen)) -- pr_err("alg: aead: changed 'req->cryptlen'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: changed 'req->cryptlen'\n"); - if (req->assoclen != vec->alen) -- pr_err("alg: aead: changed 'req->assoclen'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: changed 'req->assoclen'\n"); - if (req->iv != iv) -- pr_err("alg: aead: changed 'req->iv'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: changed 'req->iv'\n"); - if (req->src != tsgls->src.sgl_ptr) -- pr_err("alg: aead: changed 'req->src'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: changed 'req->src'\n"); - if (req->dst != tsgls->dst.sgl_ptr) -- pr_err("alg: aead: changed 'req->dst'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: changed 'req->dst'\n"); - if (crypto_aead_reqtfm(req) != tfm) -- pr_err("alg: aead: changed 'req->base.tfm'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: changed 'req->base.tfm'\n"); - if (req->base.complete != crypto_req_done) -- pr_err("alg: aead: changed 'req->base.complete'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: changed 'req->base.complete'\n"); - if (req->base.flags != req_flags) -- pr_err("alg: aead: changed 'req->base.flags'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: changed 'req->base.flags'\n"); - if (req->base.data != &wait) -- pr_err("alg: aead: changed 'req->base.data'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: changed 'req->base.data'\n"); - return -EINVAL; - } - if (is_test_sglist_corrupted(&tsgls->src)) { -- pr_err("alg: aead: %s %s corrupted src sgl on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: %s %s corrupted src sgl on test vector %s, cfg=\"%s\"\n", - driver, op, vec_name, cfg->name); - return -EINVAL; - } - if (tsgls->dst.sgl_ptr != tsgls->src.sgl && - is_test_sglist_corrupted(&tsgls->dst)) { -- pr_err("alg: aead: %s %s corrupted dst sgl on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: %s %s corrupted dst sgl on test vector %s, cfg=\"%s\"\n", - driver, op, vec_name, cfg->name); - return -EINVAL; - } -@@ -2205,12 +1900,12 @@ static int test_aead_vec_cfg(int enc, const struct aead_testvec *vec, - else - sprintf(expected_error, "%d", vec->crypt_error); - if (err) { -- pr_err("alg: aead: %s %s failed on test vector %s; expected_error=%s, actual_error=%d, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: %s %s failed on test vector %s; expected_error=%s, actual_error=%d, cfg=\"%s\"\n", - driver, op, vec_name, expected_error, err, - cfg->name); - return err; - } -- pr_err("alg: aead: %s %s unexpectedly succeeded on test vector %s; expected_error=%s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: %s %s unexpectedly succeeded on test vector %s; expected_error=%s, cfg=\"%s\"\n", - driver, op, vec_name, expected_error, cfg->name); - return -EINVAL; - } -@@ -2223,12 +1918,12 @@ static int test_aead_vec_cfg(int enc, const struct aead_testvec *vec, - vec->alen, - enc || cfg->inplace_mode == OUT_OF_PLACE); - if (err == -EOVERFLOW) { -- pr_err("alg: aead: %s %s overran dst buffer on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: %s %s overran dst buffer on test vector %s, cfg=\"%s\"\n", - driver, op, vec_name, cfg->name); - return err; - } - if (err) { -- pr_err("alg: aead: %s %s test failed (wrong result) on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: %s %s test failed (wrong result) on test vector %s, cfg=\"%s\"\n", - driver, op, vec_name, cfg->name); - return err; - } -@@ -2537,11 +2232,11 @@ static int test_aead_vs_generic_impl(struct aead_extra_tests_ctx *ctx) - if (IS_ERR(generic_tfm)) { - err = PTR_ERR(generic_tfm); - if (err == -ENOENT) { -- pr_warn("alg: aead: skipping comparison tests for %s because %s is unavailable\n", -+ fcw_printk(KERN_WARNING pr_fmt() "alg: aead: skipping comparison tests for %s because %s is unavailable\n", - driver, generic_driver); - return 0; - } -- pr_err("alg: aead: error allocating %s (generic impl of %s): %d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: error allocating %s (generic impl of %s): %d\n", - generic_driver, algname, err); - return err; - } -@@ -2556,7 +2251,7 @@ static int test_aead_vs_generic_impl(struct aead_extra_tests_ctx *ctx) - - if (crypto_aead_maxauthsize(tfm) != - crypto_aead_maxauthsize(generic_tfm)) { -- pr_err("alg: aead: maxauthsize for %s (%u) doesn't match generic impl (%u)\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: maxauthsize for %s (%u) doesn't match generic impl (%u)\n", - driver, crypto_aead_maxauthsize(tfm), - crypto_aead_maxauthsize(generic_tfm)); - err = -EINVAL; -@@ -2564,7 +2259,7 @@ static int test_aead_vs_generic_impl(struct aead_extra_tests_ctx *ctx) - } - - if (crypto_aead_ivsize(tfm) != crypto_aead_ivsize(generic_tfm)) { -- pr_err("alg: aead: ivsize for %s (%u) doesn't match generic impl (%u)\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: ivsize for %s (%u) doesn't match generic impl (%u)\n", - driver, crypto_aead_ivsize(tfm), - crypto_aead_ivsize(generic_tfm)); - err = -EINVAL; -@@ -2572,7 +2267,7 @@ static int test_aead_vs_generic_impl(struct aead_extra_tests_ctx *ctx) - } - - if (crypto_aead_blocksize(tfm) != crypto_aead_blocksize(generic_tfm)) { -- pr_err("alg: aead: blocksize for %s (%u) doesn't match generic impl (%u)\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: blocksize for %s (%u) doesn't match generic impl (%u)\n", - driver, crypto_aead_blocksize(tfm), - crypto_aead_blocksize(generic_tfm)); - err = -EINVAL; -@@ -2700,7 +2395,7 @@ static int alg_test_aead(const struct alg_test_desc *desc, const char *driver, - int err; - - if (suite->count <= 0) { -- pr_err("alg: aead: empty test suite for %s\n", driver); -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: empty test suite for %s\n", driver); - return -EINVAL; - } - -@@ -2708,7 +2403,7 @@ static int alg_test_aead(const struct alg_test_desc *desc, const char *driver, - if (IS_ERR(tfm)) { - if (PTR_ERR(tfm) == -ENOENT) - return 0; -- pr_err("alg: aead: failed to allocate transform for %s: %ld\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: failed to allocate transform for %s: %ld\n", - driver, PTR_ERR(tfm)); - return PTR_ERR(tfm); - } -@@ -2716,7 +2411,7 @@ static int alg_test_aead(const struct alg_test_desc *desc, const char *driver, - - req = fcw_aead_request_alloc(tfm, GFP_KERNEL); - if (!req) { -- pr_err("alg: aead: failed to allocate request for %s\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: failed to allocate request for %s\n", - driver); - err = -ENOMEM; - goto out; -@@ -2724,7 +2419,7 @@ static int alg_test_aead(const struct alg_test_desc *desc, const char *driver, - - tsgls = alloc_cipher_test_sglists(); - if (!tsgls) { -- pr_err("alg: aead: failed to allocate test buffers for %s\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: aead: failed to allocate test buffers for %s\n", - driver); - err = -ENOMEM; - goto out; -@@ -2793,13 +2488,13 @@ static int test_cipher(struct crypto_cipher *tfm, int enc, - if (ret) { - if (ret == template[i].setkey_error) - continue; -- pr_err("alg: cipher: %s setkey failed on test vector %u; expected_error=%d, actual_error=%d, flags=%#x\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: cipher: %s setkey failed on test vector %u; expected_error=%d, actual_error=%d, flags=%#x\n", - algo, j, template[i].setkey_error, ret, - crypto_cipher_get_flags(tfm)); - goto out; - } - if (template[i].setkey_error) { -- pr_err("alg: cipher: %s setkey unexpectedly succeeded on test vector %u; expected_error=%d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: cipher: %s setkey unexpectedly succeeded on test vector %u; expected_error=%d\n", - algo, j, template[i].setkey_error); - ret = -EINVAL; - goto out; -@@ -2817,7 +2512,7 @@ static int test_cipher(struct crypto_cipher *tfm, int enc, - - q = data; - if (memcmp(q, result, template[i].len)) { -- printk(KERN_ERR "alg: cipher: Test %d failed " -+ fcw_printk(KERN_ERR "alg: cipher: Test %d failed " - "on %s for %s\n", j, e, algo); - hexdump(q, template[i].len); - ret = -EINVAL; -@@ -2864,13 +2559,13 @@ static int test_skcipher_vec_cfg(int enc, const struct cipher_testvec *vec, - if (err) { - if (err == vec->setkey_error) - return 0; -- pr_err("alg: skcipher: %s setkey failed on test vector %s; expected_error=%d, actual_error=%d, flags=%#x\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: %s setkey failed on test vector %s; expected_error=%d, actual_error=%d, flags=%#x\n", - driver, vec_name, vec->setkey_error, err, - crypto_skcipher_get_flags(tfm)); - return err; - } - if (vec->setkey_error) { -- pr_err("alg: skcipher: %s setkey unexpectedly succeeded on test vector %s; expected_error=%d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: %s setkey unexpectedly succeeded on test vector %s; expected_error=%d\n", - driver, vec_name, vec->setkey_error); - return -EINVAL; - } -@@ -2887,7 +2582,7 @@ static int test_skcipher_vec_cfg(int enc, const struct cipher_testvec *vec, - memset(iv, 0, ivsize); - } else { - if (vec->generates_iv) { -- pr_err("alg: skcipher: %s has ivsize=0 but test vector %s generates IV!\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: %s has ivsize=0 but test vector %s generates IV!\n", - driver, vec_name); - return -EINVAL; - } -@@ -2897,10 +2592,10 @@ static int test_skcipher_vec_cfg(int enc, const struct cipher_testvec *vec, - /* Build the src/dst scatterlists */ - input.iov_base = enc ? (void *)vec->ptext : (void *)vec->ctext; - input.iov_len = vec->len; -- err = build_cipher_test_sglists(tsgls, cfg, alignmask, -+ err = fcw_build_cipher_test_sglists(tsgls, cfg, alignmask, - vec->len, vec->len, &input, 1); - if (err) { -- pr_err("alg: skcipher: %s %s: error preparing scatterlists for test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: %s %s: error preparing scatterlists for test vector %s, cfg=\"%s\"\n", - driver, op, vec_name, cfg->name); - return err; - } -@@ -2926,34 +2621,34 @@ static int test_skcipher_vec_cfg(int enc, const struct cipher_testvec *vec, - req->base.complete != crypto_req_done || - req->base.flags != req_flags || - req->base.data != &wait) { -- pr_err("alg: skcipher: %s %s corrupted request struct on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: %s %s corrupted request struct on test vector %s, cfg=\"%s\"\n", - driver, op, vec_name, cfg->name); - if (req->cryptlen != vec->len) -- pr_err("alg: skcipher: changed 'req->cryptlen'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: changed 'req->cryptlen'\n"); - if (req->iv != iv) -- pr_err("alg: skcipher: changed 'req->iv'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: changed 'req->iv'\n"); - if (req->src != tsgls->src.sgl_ptr) -- pr_err("alg: skcipher: changed 'req->src'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: changed 'req->src'\n"); - if (req->dst != tsgls->dst.sgl_ptr) -- pr_err("alg: skcipher: changed 'req->dst'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: changed 'req->dst'\n"); - if (crypto_skcipher_reqtfm(req) != tfm) -- pr_err("alg: skcipher: changed 'req->base.tfm'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: changed 'req->base.tfm'\n"); - if (req->base.complete != crypto_req_done) -- pr_err("alg: skcipher: changed 'req->base.complete'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: changed 'req->base.complete'\n"); - if (req->base.flags != req_flags) -- pr_err("alg: skcipher: changed 'req->base.flags'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: changed 'req->base.flags'\n"); - if (req->base.data != &wait) -- pr_err("alg: skcipher: changed 'req->base.data'\n"); -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: changed 'req->base.data'\n"); - return -EINVAL; - } - if (is_test_sglist_corrupted(&tsgls->src)) { -- pr_err("alg: skcipher: %s %s corrupted src sgl on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: %s %s corrupted src sgl on test vector %s, cfg=\"%s\"\n", - driver, op, vec_name, cfg->name); - return -EINVAL; - } - if (tsgls->dst.sgl_ptr != tsgls->src.sgl && - is_test_sglist_corrupted(&tsgls->dst)) { -- pr_err("alg: skcipher: %s %s corrupted dst sgl on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: %s %s corrupted dst sgl on test vector %s, cfg=\"%s\"\n", - driver, op, vec_name, cfg->name); - return -EINVAL; - } -@@ -2962,12 +2657,12 @@ static int test_skcipher_vec_cfg(int enc, const struct cipher_testvec *vec, - if (err) { - if (err == vec->crypt_error) - return 0; -- pr_err("alg: skcipher: %s %s failed on test vector %s; expected_error=%d, actual_error=%d, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: %s %s failed on test vector %s; expected_error=%d, actual_error=%d, cfg=\"%s\"\n", - driver, op, vec_name, vec->crypt_error, err, cfg->name); - return err; - } - if (vec->crypt_error) { -- pr_err("alg: skcipher: %s %s unexpectedly succeeded on test vector %s; expected_error=%d, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: %s %s unexpectedly succeeded on test vector %s; expected_error=%d, cfg=\"%s\"\n", - driver, op, vec_name, vec->crypt_error, cfg->name); - return -EINVAL; - } -@@ -2976,19 +2671,19 @@ static int test_skcipher_vec_cfg(int enc, const struct cipher_testvec *vec, - err = verify_correct_output(&tsgls->dst, enc ? vec->ctext : vec->ptext, - vec->len, 0, true); - if (err == -EOVERFLOW) { -- pr_err("alg: skcipher: %s %s overran dst buffer on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: %s %s overran dst buffer on test vector %s, cfg=\"%s\"\n", - driver, op, vec_name, cfg->name); - return err; - } - if (err) { -- pr_err("alg: skcipher: %s %s test failed (wrong result) on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: %s %s test failed (wrong result) on test vector %s, cfg=\"%s\"\n", - driver, op, vec_name, cfg->name); - return err; - } - - /* If applicable, check that the algorithm generated the correct IV */ - if (vec->iv_out && memcmp(iv, vec->iv_out, ivsize) != 0) { -- pr_err("alg: skcipher: %s %s test failed (wrong output IV) on test vector %s, cfg=\"%s\"\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: %s %s test failed (wrong output IV) on test vector %s, cfg=\"%s\"\n", - driver, op, vec_name, cfg->name); - hexdump(iv, ivsize); - return -EINVAL; -@@ -3147,11 +2842,11 @@ static int test_skcipher_vs_generic_impl(const char *generic_driver, - if (IS_ERR(generic_tfm)) { - err = PTR_ERR(generic_tfm); - if (err == -ENOENT) { -- pr_warn("alg: skcipher: skipping comparison tests for %s because %s is unavailable\n", -+ fcw_printk(KERN_WARNING pr_fmt() "alg: skcipher: skipping comparison tests for %s because %s is unavailable\n", - driver, generic_driver); - return 0; - } -- pr_err("alg: skcipher: error allocating %s (generic impl of %s): %d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: error allocating %s (generic impl of %s): %d\n", - generic_driver, algname, err); - return err; - } -@@ -3172,7 +2867,7 @@ static int test_skcipher_vs_generic_impl(const char *generic_driver, - - if (crypto_skcipher_min_keysize(tfm) != - crypto_skcipher_min_keysize(generic_tfm)) { -- pr_err("alg: skcipher: min keysize for %s (%u) doesn't match generic impl (%u)\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: min keysize for %s (%u) doesn't match generic impl (%u)\n", - driver, crypto_skcipher_min_keysize(tfm), - crypto_skcipher_min_keysize(generic_tfm)); - err = -EINVAL; -@@ -3180,7 +2875,7 @@ static int test_skcipher_vs_generic_impl(const char *generic_driver, - } - - if (maxkeysize != crypto_skcipher_max_keysize(generic_tfm)) { -- pr_err("alg: skcipher: max keysize for %s (%u) doesn't match generic impl (%u)\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: max keysize for %s (%u) doesn't match generic impl (%u)\n", - driver, maxkeysize, - crypto_skcipher_max_keysize(generic_tfm)); - err = -EINVAL; -@@ -3188,14 +2883,14 @@ static int test_skcipher_vs_generic_impl(const char *generic_driver, - } - - if (ivsize != crypto_skcipher_ivsize(generic_tfm)) { -- pr_err("alg: skcipher: ivsize for %s (%u) doesn't match generic impl (%u)\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: ivsize for %s (%u) doesn't match generic impl (%u)\n", - driver, ivsize, crypto_skcipher_ivsize(generic_tfm)); - err = -EINVAL; - goto out; - } - - if (blocksize != crypto_skcipher_blocksize(generic_tfm)) { -- pr_err("alg: skcipher: blocksize for %s (%u) doesn't match generic impl (%u)\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: blocksize for %s (%u) doesn't match generic impl (%u)\n", - driver, blocksize, - crypto_skcipher_blocksize(generic_tfm)); - err = -EINVAL; -@@ -3279,7 +2974,7 @@ static int alg_test_skcipher(const struct alg_test_desc *desc, - int err; - - if (suite->count <= 0) { -- pr_err("alg: skcipher: empty test suite for %s\n", driver); -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: empty test suite for %s\n", driver); - return -EINVAL; - } - -@@ -3287,7 +2982,7 @@ static int alg_test_skcipher(const struct alg_test_desc *desc, - if (IS_ERR(tfm)) { - if (PTR_ERR(tfm) == -ENOENT) - return 0; -- pr_err("alg: skcipher: failed to allocate transform for %s: %ld\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: failed to allocate transform for %s: %ld\n", - driver, PTR_ERR(tfm)); - return PTR_ERR(tfm); - } -@@ -3295,7 +2990,7 @@ static int alg_test_skcipher(const struct alg_test_desc *desc, - - req = fcw_skcipher_request_alloc(tfm, GFP_KERNEL); - if (!req) { -- pr_err("alg: skcipher: failed to allocate request for %s\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: failed to allocate request for %s\n", - driver); - err = -ENOMEM; - goto out; -@@ -3303,7 +2998,7 @@ static int alg_test_skcipher(const struct alg_test_desc *desc, - - tsgls = alloc_cipher_test_sglists(); - if (!tsgls) { -- pr_err("alg: skcipher: failed to allocate test buffers for %s\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: skcipher: failed to allocate test buffers for %s\n", - driver); - err = -ENOMEM; - goto out; -@@ -3356,7 +3051,7 @@ static int test_comp(struct crypto_comp *tfm, - ret = crypto_comp_compress(tfm, ctemplate[i].input, - ilen, output, &dlen); - if (ret) { -- printk(KERN_ERR "alg: comp: compression failed " -+ fcw_printk(KERN_ERR "alg: comp: compression failed " - "on test %d for %s: ret=%d\n", i + 1, algo, - -ret); - goto out; -@@ -3367,13 +3062,13 @@ static int test_comp(struct crypto_comp *tfm, - ret = crypto_comp_decompress(tfm, output, - ilen, decomp_output, &dlen); - if (ret) { -- pr_err("alg: comp: compression failed: decompress: on test %d for %s failed: ret=%d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: comp: compression failed: decompress: on test %d for %s failed: ret=%d\n", - i + 1, algo, -ret); - goto out; - } - - if (dlen != ctemplate[i].inlen) { -- printk(KERN_ERR "alg: comp: Compression test %d " -+ fcw_printk(KERN_ERR "alg: comp: Compression test %d " - "failed for %s: output len = %d\n", i + 1, algo, - dlen); - ret = -EINVAL; -@@ -3382,7 +3077,7 @@ static int test_comp(struct crypto_comp *tfm, - - if (memcmp(decomp_output, ctemplate[i].input, - ctemplate[i].inlen)) { -- pr_err("alg: comp: compression failed: output differs: on test %d for %s\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: comp: compression failed: output differs: on test %d for %s\n", - i + 1, algo); - hexdump(decomp_output, dlen); - ret = -EINVAL; -@@ -3400,14 +3095,14 @@ static int test_comp(struct crypto_comp *tfm, - ret = crypto_comp_decompress(tfm, dtemplate[i].input, - ilen, decomp_output, &dlen); - if (ret) { -- printk(KERN_ERR "alg: comp: decompression failed " -+ fcw_printk(KERN_ERR "alg: comp: decompression failed " - "on test %d for %s: ret=%d\n", i + 1, algo, - -ret); - goto out; - } - - if (dlen != dtemplate[i].outlen) { -- printk(KERN_ERR "alg: comp: Decompression test %d " -+ fcw_printk(KERN_ERR "alg: comp: Decompression test %d " - "failed for %s: output len = %d\n", i + 1, algo, - dlen); - ret = -EINVAL; -@@ -3415,7 +3110,7 @@ static int test_comp(struct crypto_comp *tfm, - } - - if (memcmp(decomp_output, dtemplate[i].output, dlen)) { -- printk(KERN_ERR "alg: comp: Decompression test %d " -+ fcw_printk(KERN_ERR "alg: comp: Decompression test %d " - "failed for %s\n", i + 1, algo); - hexdump(decomp_output, dlen); - ret = -EINVAL; -@@ -3472,7 +3167,7 @@ static int test_acomp(struct crypto_acomp *tfm, - - req = acomp_request_alloc(tfm); - if (!req) { -- pr_err("alg: acomp: request alloc failed for %s\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: acomp: request alloc failed for %s\n", - algo); - kfree(input_vec); - ret = -ENOMEM; -@@ -3485,7 +3180,7 @@ static int test_acomp(struct crypto_acomp *tfm, - - ret = crypto_wait_req(crypto_acomp_compress(req), &wait); - if (ret) { -- pr_err("alg: acomp: compression failed on test %d for %s: ret=%d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: acomp: compression failed on test %d for %s: ret=%d\n", - i + 1, algo, -ret); - kfree(input_vec); - acomp_request_free(req); -@@ -3501,7 +3196,7 @@ static int test_acomp(struct crypto_acomp *tfm, - - ret = crypto_wait_req(crypto_acomp_decompress(req), &wait); - if (ret) { -- pr_err("alg: acomp: compression failed on test %d for %s: ret=%d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: acomp: compression failed on test %d for %s: ret=%d\n", - i + 1, algo, -ret); - kfree(input_vec); - acomp_request_free(req); -@@ -3509,7 +3204,7 @@ static int test_acomp(struct crypto_acomp *tfm, - } - - if (req->dlen != ctemplate[i].inlen) { -- pr_err("alg: acomp: Compression test %d failed for %s: output len = %d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: acomp: Compression test %d failed for %s: output len = %d\n", - i + 1, algo, req->dlen); - ret = -EINVAL; - kfree(input_vec); -@@ -3518,7 +3213,7 @@ static int test_acomp(struct crypto_acomp *tfm, - } - - if (memcmp(input_vec, decomp_out, req->dlen)) { -- pr_err("alg: acomp: Compression test %d failed for %s\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: acomp: Compression test %d failed for %s\n", - i + 1, algo); - hexdump(output, req->dlen); - ret = -EINVAL; -@@ -3534,7 +3229,7 @@ static int test_acomp(struct crypto_acomp *tfm, - - ret = crypto_wait_req(crypto_acomp_compress(req), &wait); - if (ret) { -- pr_err("alg: acomp: compression failed on NULL dst buffer test %d for %s: ret=%d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: acomp: compression failed on NULL dst buffer test %d for %s: ret=%d\n", - i + 1, algo, -ret); - kfree(input_vec); - acomp_request_free(req); -@@ -3564,7 +3259,7 @@ static int test_acomp(struct crypto_acomp *tfm, - - req = acomp_request_alloc(tfm); - if (!req) { -- pr_err("alg: acomp: request alloc failed for %s\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: acomp: request alloc failed for %s\n", - algo); - kfree(input_vec); - ret = -ENOMEM; -@@ -3577,7 +3272,7 @@ static int test_acomp(struct crypto_acomp *tfm, - - ret = crypto_wait_req(crypto_acomp_decompress(req), &wait); - if (ret) { -- pr_err("alg: acomp: decompression failed on test %d for %s: ret=%d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: acomp: decompression failed on test %d for %s: ret=%d\n", - i + 1, algo, -ret); - kfree(input_vec); - acomp_request_free(req); -@@ -3585,7 +3280,7 @@ static int test_acomp(struct crypto_acomp *tfm, - } - - if (req->dlen != dtemplate[i].outlen) { -- pr_err("alg: acomp: Decompression test %d failed for %s: output len = %d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: acomp: Decompression test %d failed for %s: output len = %d\n", - i + 1, algo, req->dlen); - ret = -EINVAL; - kfree(input_vec); -@@ -3594,7 +3289,7 @@ static int test_acomp(struct crypto_acomp *tfm, - } - - if (memcmp(output, dtemplate[i].output, req->dlen)) { -- pr_err("alg: acomp: Decompression test %d failed for %s\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: acomp: Decompression test %d failed for %s\n", - i + 1, algo); - hexdump(output, req->dlen); - ret = -EINVAL; -@@ -3609,7 +3304,7 @@ static int test_acomp(struct crypto_acomp *tfm, - - ret = crypto_wait_req(crypto_acomp_decompress(req), &wait); - if (ret) { -- pr_err("alg: acomp: decompression failed on NULL dst buffer test %d for %s: ret=%d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: acomp: decompression failed on NULL dst buffer test %d for %s: ret=%d\n", - i + 1, algo, -ret); - kfree(input_vec); - acomp_request_free(req); -@@ -3642,7 +3337,7 @@ static int test_cprng(struct crypto_rng *tfm, - - seed = fcw_kmalloc(seedsize, GFP_KERNEL); - if (!seed) { -- printk(KERN_ERR "alg: cprng: Failed to allocate seed space " -+ fcw_printk(KERN_ERR "alg: cprng: Failed to allocate seed space " - "for %s\n", algo); - return -ENOMEM; - } -@@ -3658,7 +3353,7 @@ static int test_cprng(struct crypto_rng *tfm, - - err = crypto_rng_reset(tfm, seed, seedsize); - if (err) { -- printk(KERN_ERR "alg: cprng: Failed to reset rng " -+ fcw_printk(KERN_ERR "alg: cprng: Failed to reset rng " - "for %s\n", algo); - goto out; - } -@@ -3667,7 +3362,7 @@ static int test_cprng(struct crypto_rng *tfm, - err = crypto_rng_get_bytes(tfm, result, - template[i].rlen); - if (err < 0) { -- printk(KERN_ERR "alg: cprng: Failed to obtain " -+ fcw_printk(KERN_ERR "alg: cprng: Failed to obtain " - "the correct amount of random data for " - "%s (requested %d)\n", algo, - template[i].rlen); -@@ -3678,7 +3373,7 @@ static int test_cprng(struct crypto_rng *tfm, - err = memcmp(result, template[i].result, - template[i].rlen); - if (err) { -- printk(KERN_ERR "alg: cprng: Test %d failed for %s\n", -+ fcw_printk(KERN_ERR "alg: cprng: Test %d failed for %s\n", - i, algo); - hexdump(result, template[i].rlen); - err = -EINVAL; -@@ -3702,7 +3397,7 @@ static int alg_test_cipher(const struct alg_test_desc *desc, - if (IS_ERR(tfm)) { - if (PTR_ERR(tfm) == -ENOENT) - return 0; -- printk(KERN_ERR "alg: cipher: Failed to load transform for " -+ fcw_printk(KERN_ERR "alg: cipher: Failed to load transform for " - "%s: %ld\n", driver, PTR_ERR(tfm)); - return PTR_ERR(tfm); - } -@@ -3728,7 +3423,7 @@ static int alg_test_comp(const struct alg_test_desc *desc, const char *driver, - if (IS_ERR(acomp)) { - if (PTR_ERR(acomp) == -ENOENT) - return 0; -- pr_err("alg: acomp: Failed to load transform for %s: %ld\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: acomp: Failed to load transform for %s: %ld\n", - driver, PTR_ERR(acomp)); - return PTR_ERR(acomp); - } -@@ -3742,7 +3437,7 @@ static int alg_test_comp(const struct alg_test_desc *desc, const char *driver, - if (IS_ERR(comp)) { - if (PTR_ERR(comp) == -ENOENT) - return 0; -- pr_err("alg: comp: Failed to load transform for %s: %ld\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: comp: Failed to load transform for %s: %ld\n", - driver, PTR_ERR(comp)); - return PTR_ERR(comp); - } -@@ -3778,7 +3473,7 @@ static int alg_test_crc32c(const struct alg_test_desc *desc, - */ - return 0; - } -- printk(KERN_ERR "alg: crc32c: Failed to load transform for %s: " -+ fcw_printk(KERN_ERR "alg: crc32c: Failed to load transform for %s: " - "%ld\n", driver, PTR_ERR(tfm)); - return PTR_ERR(tfm); - } -@@ -3793,13 +3488,13 @@ static int alg_test_crc32c(const struct alg_test_desc *desc, - *ctx = 420553207; - err = crypto_shash_final(shash, (u8 *)&val); - if (err) { -- printk(KERN_ERR "alg: crc32c: Operation failed for " -+ fcw_printk(KERN_ERR "alg: crc32c: Operation failed for " - "%s: %d\n", driver, err); - break; - } - - if (val != cpu_to_le32(~420553207)) { -- pr_err("alg: crc32c: Test failed for %s: %u\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: crc32c: Test failed for %s: %u\n", - driver, le32_to_cpu(val)); - err = -EINVAL; - } -@@ -3820,7 +3515,7 @@ static int alg_test_cprng(const struct alg_test_desc *desc, const char *driver, - if (IS_ERR(rng)) { - if (PTR_ERR(rng) == -ENOENT) - return 0; -- printk(KERN_ERR "alg: cprng: Failed to load transform for %s: " -+ fcw_printk(KERN_ERR "alg: cprng: Failed to load transform for %s: " - "%ld\n", driver, PTR_ERR(rng)); - return PTR_ERR(rng); - } -@@ -3850,7 +3545,7 @@ static int drbg_cavs_test(const struct drbg_testvec *test, int pr, - kfree_sensitive(buf); - if (PTR_ERR(drng) == -ENOENT) - return 0; -- printk(KERN_ERR "alg: drbg: could not allocate DRNG handle for " -+ fcw_printk(KERN_ERR "alg: drbg: could not allocate DRNG handle for " - "%s\n", driver); - return PTR_ERR(drng); - } -@@ -3860,7 +3555,7 @@ static int drbg_cavs_test(const struct drbg_testvec *test, int pr, - drbg_string_fill(&pers, test->pers, test->perslen); - ret = crypto_drbg_reset_test(drng, &pers, &test_data); - if (ret) { -- printk(KERN_ERR "alg: drbg: Failed to reset rng\n"); -+ fcw_printk(KERN_ERR "alg: drbg: Failed to reset rng\n"); - goto outbuf; - } - -@@ -3874,7 +3569,7 @@ static int drbg_cavs_test(const struct drbg_testvec *test, int pr, - buf, test->expectedlen, &addtl); - } - if (ret < 0) { -- printk(KERN_ERR "alg: drbg: could not obtain random data for " -+ fcw_printk(KERN_ERR "alg: drbg: could not obtain random data for " - "driver %s\n", driver); - goto outbuf; - } -@@ -3889,7 +3584,7 @@ static int drbg_cavs_test(const struct drbg_testvec *test, int pr, - buf, test->expectedlen, &addtl); - } - if (ret < 0) { -- printk(KERN_ERR "alg: drbg: could not obtain random data for " -+ fcw_printk(KERN_ERR "alg: drbg: could not obtain random data for " - "driver %s\n", driver); - goto outbuf; - } -@@ -3918,7 +3613,7 @@ static int alg_test_drbg(const struct alg_test_desc *desc, const char *driver, - for (i = 0; i < tcount; i++) { - err = drbg_cavs_test(&template[i], pr, driver, type, mask); - if (err) { -- printk(KERN_ERR "alg: drbg: Test %d failed for %s\n", -+ fcw_printk(KERN_ERR "alg: drbg: Test %d failed for %s\n", - i, driver); - err = -EINVAL; - break; -@@ -3969,10 +3664,11 @@ static int do_test_kpp(struct crypto_kpp *tfm, const struct kpp_testvec *vec, - /* Compute party A's public key */ - err = crypto_wait_req(crypto_kpp_generate_public_key(req), &wait); - if (err) { -- pr_err("alg: %s: Party A: generate public key test failed. err %d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: %s: Party A: generate public key test failed. err %d\n", - alg, err); - goto free_output; - } -+ fcw_printk(KERN_INFO "alg: %s: Party A: generate public key test passed.", alg); - - if (vec->genkey) { - /* Save party A's public key */ -@@ -3985,11 +3681,12 @@ static int do_test_kpp(struct crypto_kpp *tfm, const struct kpp_testvec *vec, - /* Verify calculated public key */ - if (memcmp(vec->expected_a_public, fcw_sg_virt(req->dst), - vec->expected_a_public_size)) { -- pr_err("alg: %s: Party A: generate public key test failed. Invalid output\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: %s: Party A: generate public key test failed. Invalid output\n", - alg); - err = -EINVAL; - goto free_output; - } -+ fcw_printk(KERN_INFO "alg: %s: Party A: verify public key test passed.", alg); - } - - /* Calculate shared secret key by using counter part (b) public key. */ -@@ -4007,7 +3704,7 @@ static int do_test_kpp(struct crypto_kpp *tfm, const struct kpp_testvec *vec, - crypto_req_done, &wait); - err = crypto_wait_req(crypto_kpp_compute_shared_secret(req), &wait); - if (err) { -- pr_err("alg: %s: Party A: compute shared secret test failed. err %d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: %s: Party A: compute shared secret test failed. err %d\n", - alg, err); - goto free_all; - } -@@ -4038,7 +3735,7 @@ static int do_test_kpp(struct crypto_kpp *tfm, const struct kpp_testvec *vec, - err = crypto_wait_req(crypto_kpp_compute_shared_secret(req), - &wait); - if (err) { -- pr_err("alg: %s: Party B: compute shared secret failed. err %d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: %s: Party B: compute shared secret failed. err %d\n", - alg, err); - goto free_all; - } -@@ -4054,7 +3751,7 @@ static int do_test_kpp(struct crypto_kpp *tfm, const struct kpp_testvec *vec, - */ - if (memcmp(shared_secret, fcw_sg_virt(req->dst), - vec->expected_ss_size)) { -- pr_err("alg: %s: compute shared secret test failed. Invalid output\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: %s: compute shared secret test failed. Invalid output\n", - alg); - err = -EINVAL; - } -@@ -4078,7 +3775,7 @@ static int test_kpp(struct crypto_kpp *tfm, const char *alg, - for (i = 0; i < tcount; i++) { - ret = do_test_kpp(tfm, vecs++, alg); - if (ret) { -- pr_err("alg: %s: test failed on vector %d, err=%d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: %s: test failed on vector %d, err=%d\n", - alg, i + 1, ret); - return ret; - } -@@ -4096,7 +3793,7 @@ static int alg_test_kpp(const struct alg_test_desc *desc, const char *driver, - if (IS_ERR(tfm)) { - if (PTR_ERR(tfm) == -ENOENT) - return 0; -- pr_err("alg: kpp: Failed to load tfm for %s: %ld\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: kpp: Failed to load tfm for %s: %ld\n", - driver, PTR_ERR(tfm)); - return PTR_ERR(tfm); - } -@@ -4211,19 +3908,19 @@ static int test_akcipher_one(struct crypto_akcipher *tfm, - /* Run asymmetric encrypt */ - crypto_akcipher_encrypt(req), &wait); - if (err) { -- pr_err("alg: akcipher: %s test failed. err %d\n", op, err); -+ fcw_printk(KERN_ERR pr_fmt() "alg: akcipher: %s test failed. err %d\n", op, err); - goto free_all; - } - if (!vecs->siggen_sigver_test && c) { - if (req->dst_len != c_size) { -- pr_err("alg: akcipher: %s test failed. Invalid output len\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: akcipher: %s test failed. Invalid output len\n", - op); - err = -EINVAL; - goto free_all; - } - /* verify that encrypted message is equal to expected */ - if (memcmp(c, outbuf_enc, c_size) != 0) { -- pr_err("alg: akcipher: %s test failed. Invalid output\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: akcipher: %s test failed. Invalid output\n", - op); - hexdump(outbuf_enc, c_size); - err = -EINVAL; -@@ -4267,12 +3964,12 @@ static int test_akcipher_one(struct crypto_akcipher *tfm, - /* Run asymmetric decrypt */ - crypto_akcipher_decrypt(req), &wait); - if (err) { -- pr_err("alg: akcipher: %s test failed. err %d\n", op, err); -+ fcw_printk(KERN_ERR pr_fmt() "alg: akcipher: %s test failed. err %d\n", op, err); - goto free_all; - } - out_len = req->dst_len; - if (out_len < m_size) { -- pr_err("alg: akcipher: %s test failed. Invalid output len %u\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: akcipher: %s test failed. Invalid output len %u\n", - op, out_len); - err = -EINVAL; - goto free_all; -@@ -4280,7 +3977,7 @@ static int test_akcipher_one(struct crypto_akcipher *tfm, - /* verify that decrypted message is equal to the original msg */ - if (memchr_inv(outbuf_dec, 0, out_len - m_size) || - memcmp(m, outbuf_dec + out_len - m_size, m_size)) { -- pr_err("alg: akcipher: %s test failed. Invalid output\n", op); -+ fcw_printk(KERN_ERR pr_fmt() "alg: akcipher: %s test failed. Invalid output\n", op); - hexdump(outbuf_dec, out_len); - err = -EINVAL; - } -@@ -4309,7 +4006,7 @@ static int test_akcipher(struct crypto_akcipher *tfm, const char *alg, - if (!ret) - continue; - -- pr_err("alg: akcipher: test %d failed for %s, err=%d\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: akcipher: test %d failed for %s, err=%d\n", - i + 1, algo, ret); - return ret; - } -@@ -4326,7 +4023,7 @@ static int alg_test_akcipher(const struct alg_test_desc *desc, - if (IS_ERR(tfm)) { - if (PTR_ERR(tfm) == -ENOENT) - return 0; -- pr_err("alg: akcipher: Failed to load tfm for %s: %ld\n", -+ fcw_printk(KERN_ERR pr_fmt() "alg: akcipher: Failed to load tfm for %s: %ld\n", - driver, PTR_ERR(tfm)); - return PTR_ERR(tfm); - } -@@ -5797,13 +5494,13 @@ static void alg_check_test_descs_order(void) - alg_test_descs[i].alg); - - if (fcw_warn_on(diff > 0)) { -- pr_warn("testmgr: alg_test_descs entries in wrong order: '%s' before '%s'\n", -+ fcw_printk(KERN_WARNING pr_fmt() "testmgr: alg_test_descs entries in wrong order: '%s' before '%s'\n", - alg_test_descs[i - 1].alg, - alg_test_descs[i].alg); - } - - if (fcw_warn_on(diff == 0)) { -- pr_warn("testmgr: duplicate alg_test_descs entry: '%s'\n", -+ fcw_printk(KERN_WARNING pr_fmt() "testmgr: duplicate alg_test_descs entry: '%s'\n", - alg_test_descs[i].alg); - } - } -@@ -5828,7 +5525,7 @@ static void testmgr_onetime_init(void) - alg_check_testvec_configs(); - - #ifdef CONFIG_CRYPTO_MANAGER_EXTRA_TESTS -- pr_warn("alg: extra crypto tests enabled. This is intended for developer use only.\n"); -+ fcw_printk(KERN_WARNING pr_fmt() "alg: extra crypto tests enabled. This is intended for developer use only.\n"); - #endif - } - -@@ -5859,7 +5556,7 @@ static int alg_find_test(const char *alg) - - static int alg_fips_disabled(const char *driver, const char *alg) - { -- pr_info("alg: %s (%s) is disabled due to FIPS\n", alg, driver); -+ fcw_printk(KERN_INFO pr_fmt() "alg: %s (%s) is disabled due to FIPS\n", alg, driver); - - return -ECANCELED; - } -@@ -5871,11 +5568,6 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask) - int rc; - static bool done = false; - -- if (!fips_enabled && notests) { -- printk_once(KERN_INFO "alg: self-tests disabled\n"); -- return 0; -- } -- - /* Replace DO_ONCE by this. As DO_ONCE generates jump labels entry - * and its data (__once_key) get changed at early boot time at - * jump_label_init() from setup_arch(). We cannot run -@@ -5927,13 +5619,12 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask) - - test_done: - if (rc) { -- if (fips_enabled || panic_on_fail) { -+ if (fips_enabled) { - fips_fail_notify(); -- panic("alg: self-tests for %s (%s) failed in %s mode!\n", -- driver, alg, -- fips_enabled ? "fips" : "panic_on_fail"); -+ panic("alg: self-tests for %s (%s) failed in fips mode!\n", -+ driver, alg); - } -- pr_warn("alg: self-tests for %s using %s failed (rc=%d)", -+ fcw_printk(KERN_WARNING pr_fmt() "alg: self-tests for %s using %s failed (rc=%d)", - alg, driver, rc); - if (fcw_is_warn_true(rc != -ENOENT)) { - fcw_warn_printk("alg: self-tests for %s using %s failed (rc=%d)", -@@ -5942,7 +5633,7 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask) - } - } else { - if (fips_enabled) -- pr_info("alg: self-tests for %s (%s) passed\n", -+ fcw_printk(KERN_INFO pr_fmt() "alg: self-tests for %s (%s) passed\n", - driver, alg); - } - -@@ -5968,7 +5659,7 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask) - } - - notest2: -- printk(KERN_INFO "alg: No test for %s (%s)\n", alg, driver); -+ fcw_printk(KERN_INFO "alg: No test for %s (%s)\n", alg, driver); - - if (type & CRYPTO_ALG_FIPS_INTERNAL) - return alg_fips_disabled(driver, alg); -diff --git a/crypto/testmgr.h b/crypto/testmgr.h -index 9b38501a1..505227ef8 100644 ---- a/crypto/testmgr.h -+++ b/crypto/testmgr.h -@@ -20,32 +20,11 @@ - #ifndef _CRYPTO_TESTMGR_H - #define _CRYPTO_TESTMGR_H - -+#include "fips_canister_wrapper.h" - #include - - #define MAX_IVLEN 32 - --/* -- * hash_testvec: structure to describe a hash (message digest) test -- * @key: Pointer to key (NULL if none) -- * @plaintext: Pointer to source data -- * @digest: Pointer to expected digest -- * @psize: Length of source data in bytes -- * @ksize: Length of @key in bytes (0 if no key) -- * @setkey_error: Expected error from setkey() -- * @digest_error: Expected error from digest() -- * @fips_skip: Skip the test vector in FIPS mode -- */ --struct hash_testvec { -- const char *key; -- const char *plaintext; -- const char *digest; -- unsigned int psize; -- unsigned short ksize; -- int setkey_error; -- int digest_error; -- bool fips_skip; --}; -- - /* - * cipher_testvec: structure to describe a symmetric cipher test - * @key: Pointer to key -diff --git a/crypto/xts.c b/crypto/xts.c -index e271be931..3f255ec8f 100644 ---- a/crypto/xts.c -+++ b/crypto/xts.c -@@ -13,7 +13,6 @@ - #include - #include - #include --#include - #include - #include - -@@ -457,21 +456,13 @@ static struct crypto_template xts_tmpl = { - .module = THIS_MODULE, - }; - --static int __init xts_module_init(void) -+int __init xts_module_init(void) - { - return crypto_register_template(&xts_tmpl); - } - --static void __exit xts_module_exit(void) -+void __exit xts_module_exit(void) - { - crypto_unregister_template(&xts_tmpl); - } - --subsys_initcall(xts_module_init); --module_exit(xts_module_exit); -- --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("XTS block cipher mode"); --MODULE_ALIAS_CRYPTO("xts"); --MODULE_IMPORT_NS(CRYPTO_INTERNAL); --MODULE_SOFTDEP("pre: ecb"); -diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h -index b25f9901c..aee693fc3 100644 ---- a/include/crypto/algapi.h -+++ b/include/crypto/algapi.h -@@ -47,7 +47,9 @@ - - struct crypto_aead; - struct crypto_instance; -+#ifdef MODULE - struct module; -+#endif - struct notifier_block; - struct rtattr; - struct scatterlist; -@@ -88,7 +90,11 @@ struct crypto_instance { - struct crypto_template { - struct list_head list; - struct hlist_head instances; -+#ifdef MODULE - struct module *module; -+#else -+ void *module; -+#endif - - int (*create)(struct crypto_template *tmpl, struct rtattr **tb); - -diff --git a/include/crypto/drbg.h b/include/crypto/drbg.h -index 1aede865d..98d9bc16f 100644 ---- a/include/crypto/drbg.h -+++ b/include/crypto/drbg.h -@@ -44,7 +44,6 @@ - #include - #include - #include --#include - #include - #include - #include -diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h -index 107b797c3..e8e091633 100644 ---- a/include/crypto/if_alg.h -+++ b/include/crypto/if_alg.h -@@ -51,7 +51,11 @@ struct af_alg_type { - - struct proto_ops *ops; - struct proto_ops *ops_nokey; -+#ifdef MODULE - struct module *owner; -+#else -+ void *owner; -+#endif - char name[14]; - }; - -diff --git a/include/crypto/internal/skcipher.h b/include/crypto/internal/skcipher.h -index 7ae42afdc..8084a77f2 100644 ---- a/include/crypto/internal/skcipher.h -+++ b/include/crypto/internal/skcipher.h -@@ -58,7 +58,11 @@ struct crypto_lskcipher_spawn { - struct skcipher_walk { - union { - struct { -+#ifdef FIPS_CANISTER -+ void *page; -+#else - struct page *page; -+#endif - unsigned long offset; - } phys; - -diff --git a/include/crypto/sha512_base.h b/include/crypto/sha512_base.h -index 679916a84..4a6001df3 100644 ---- a/include/crypto/sha512_base.h -+++ b/include/crypto/sha512_base.h -@@ -11,7 +11,6 @@ - #include - #include - #include --#include - #include - - #include -diff --git a/include/linux/crypto.h b/include/linux/crypto.h -index 4e0ac13c7..fa6d7d42e 100644 ---- a/include/linux/crypto.h -+++ b/include/linux/crypto.h -@@ -355,7 +355,11 @@ struct crypto_alg { - char cra_name[CRYPTO_MAX_ALG_NAME]; - char cra_driver_name[CRYPTO_MAX_ALG_NAME]; - -+#ifdef FIPS_CANISTER -+ void *cra_type; -+#else - const struct crypto_type *cra_type; -+#endif - - union { - struct cipher_alg cipher; -@@ -365,8 +369,12 @@ struct crypto_alg { - int (*cra_init)(struct crypto_tfm *tfm); - void (*cra_exit)(struct crypto_tfm *tfm); - void (*cra_destroy)(struct crypto_alg *alg); -- -+ -+#ifdef MODULE - struct module *cra_module; -+#else -+ void *cra_module; -+#endif - } CRYPTO_MINALIGN_ATTR; - - /* -diff --git a/include/linux/rtattr.h b/include/linux/rtattr.h -new file mode 100644 -index 000000000..6e1e563d2 ---- /dev/null -+++ b/include/linux/rtattr.h -@@ -0,0 +1,6 @@ -+ -+struct rtattr { -+ unsigned short rta_len; -+ unsigned short rta_type; -+}; -+ -diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h -index d3561c4a0..07528ef66 100644 ---- a/include/linux/spinlock.h -+++ b/include/linux/spinlock.h -@@ -536,8 +536,6 @@ DEFINE_LOCK_GUARD_1(raw_spinlock, raw_spinlock_t, - raw_spin_lock(_T->lock), - raw_spin_unlock(_T->lock)) - --DEFINE_LOCK_GUARD_1_COND(raw_spinlock, _try, raw_spin_trylock(_T->lock)) -- - DEFINE_LOCK_GUARD_1(raw_spinlock_nested, raw_spinlock_t, - raw_spin_lock_nested(_T->lock, SINGLE_DEPTH_NESTING), - raw_spin_unlock(_T->lock)) -@@ -546,50 +544,32 @@ DEFINE_LOCK_GUARD_1(raw_spinlock_irq, raw_spinlock_t, - raw_spin_lock_irq(_T->lock), - raw_spin_unlock_irq(_T->lock)) - --DEFINE_LOCK_GUARD_1_COND(raw_spinlock_irq, _try, raw_spin_trylock_irq(_T->lock)) -- - DEFINE_LOCK_GUARD_1(raw_spinlock_bh, raw_spinlock_t, - raw_spin_lock_bh(_T->lock), - raw_spin_unlock_bh(_T->lock)) - --DEFINE_LOCK_GUARD_1_COND(raw_spinlock_bh, _try, raw_spin_trylock_bh(_T->lock)) -- - DEFINE_LOCK_GUARD_1(raw_spinlock_irqsave, raw_spinlock_t, - raw_spin_lock_irqsave(_T->lock, _T->flags), - raw_spin_unlock_irqrestore(_T->lock, _T->flags), - unsigned long flags) - --DEFINE_LOCK_GUARD_1_COND(raw_spinlock_irqsave, _try, -- raw_spin_trylock_irqsave(_T->lock, _T->flags)) -- - DEFINE_LOCK_GUARD_1(spinlock, spinlock_t, - spin_lock(_T->lock), - spin_unlock(_T->lock)) - --DEFINE_LOCK_GUARD_1_COND(spinlock, _try, spin_trylock(_T->lock)) -- - DEFINE_LOCK_GUARD_1(spinlock_irq, spinlock_t, - spin_lock_irq(_T->lock), - spin_unlock_irq(_T->lock)) - --DEFINE_LOCK_GUARD_1_COND(spinlock_irq, _try, -- spin_trylock_irq(_T->lock)) -- - DEFINE_LOCK_GUARD_1(spinlock_bh, spinlock_t, - spin_lock_bh(_T->lock), - spin_unlock_bh(_T->lock)) - --DEFINE_LOCK_GUARD_1_COND(spinlock_bh, _try, -- spin_trylock_bh(_T->lock)) -- - DEFINE_LOCK_GUARD_1(spinlock_irqsave, spinlock_t, - spin_lock_irqsave(_T->lock, _T->flags), - spin_unlock_irqrestore(_T->lock, _T->flags), - unsigned long flags) - --DEFINE_LOCK_GUARD_1_COND(spinlock_irqsave, _try, -- spin_trylock_irqsave(_T->lock, _T->flags)) -- - DEFINE_LOCK_GUARD_1(read_lock, rwlock_t, - read_lock(_T->lock), - read_unlock(_T->lock)) -@@ -616,5 +596,9 @@ DEFINE_LOCK_GUARD_1(write_lock_irqsave, rwlock_t, - write_unlock_irqrestore(_T->lock, _T->flags), - unsigned long flags) - -+#ifndef FIPS_CANISTER -+#include -+#endif -+ - #undef __LINUX_INSIDE_SPINLOCK_H - #endif /* __LINUX_SPINLOCK_H */ -diff --git a/include/linux/spinlock_cond_guard.h b/include/linux/spinlock_cond_guard.h -new file mode 100644 -index 000000000..8be8fa949 ---- /dev/null -+++ b/include/linux/spinlock_cond_guard.h -@@ -0,0 +1,20 @@ -+ -+DEFINE_LOCK_GUARD_1_COND(raw_spinlock, _try, raw_spin_trylock(_T->lock)) -+ -+DEFINE_LOCK_GUARD_1_COND(raw_spinlock_irq, _try, raw_spin_trylock_irq(_T->lock)) -+ -+DEFINE_LOCK_GUARD_1_COND(raw_spinlock_irqsave, _try, -+ raw_spin_trylock_irqsave(_T->lock, _T->flags)) -+ -+DEFINE_LOCK_GUARD_1_COND(spinlock, _try, spin_trylock(_T->lock)) -+ -+DEFINE_LOCK_GUARD_1_COND(spinlock_irq, _try, -+ spin_trylock_irq(_T->lock)) -+ -+DEFINE_LOCK_GUARD_1_COND(spinlock_irqsave, _try, -+ spin_trylock_irqsave(_T->lock, _T->flags)) -+ -+DEFINE_LOCK_GUARD_1_COND(raw_spinlock_bh, _try, raw_spin_trylock_bh(_T->lock)) -+ -+DEFINE_LOCK_GUARD_1_COND(spinlock_bh, _try, -+ spin_trylock_bh(_T->lock)) -diff --git a/lib/crypto/aes.c b/lib/crypto/aes.c -index d6876f690..d8ed26ca6 100644 ---- a/lib/crypto/aes.c -+++ b/lib/crypto/aes.c -@@ -5,7 +5,6 @@ - - #include - #include --#include - #include - - /* -@@ -344,7 +343,3 @@ void aes_decrypt(const struct crypto_aes_ctx *ctx, u8 *out, const u8 *in) - put_unaligned_le32(inv_subshift(st1, 2) ^ rkp[6], out + 8); - put_unaligned_le32(inv_subshift(st1, 3) ^ rkp[7], out + 12); - } -- --MODULE_DESCRIPTION("Generic AES library"); --MODULE_AUTHOR("Ard Biesheuvel "); --MODULE_LICENSE("GPL v2"); -diff --git a/lib/crypto/sha256.c b/lib/crypto/sha256.c -index e7c449c6b..f5a6ed249 100644 ---- a/lib/crypto/sha256.c -+++ b/lib/crypto/sha256.c -@@ -14,7 +14,6 @@ - #include - #include - #include --#include - #include - - static const u32 SHA256_K[] = { -@@ -160,6 +159,3 @@ void sha256(const u8 *data, unsigned int len, u8 *out) - sha256_update(&sctx, data, len); - sha256_final(&sctx, out); - } -- --MODULE_DESCRIPTION("SHA-256 Algorithm"); --MODULE_LICENSE("GPL"); --- -2.43.7 - diff --git a/SPECS/91/linux/canister_builder/patches/1007-ecc-Add-pairwise-consistency-test-for-every-generate.patch b/SPECS/91/linux/canister_builder/patches/1007-ecc-Add-pairwise-consistency-test-for-every-generate.patch deleted file mode 100644 index 5c2291ec0f..0000000000 --- a/SPECS/91/linux/canister_builder/patches/1007-ecc-Add-pairwise-consistency-test-for-every-generate.patch +++ /dev/null @@ -1,154 +0,0 @@ -From d13eb73f33b818ab58d756eb6b60542cb5893482 Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Sun, 15 Oct 2023 03:25:33 +0000 -Subject: [PATCH] ecc: Add pairwise consistency test for every generated - ECC keypairs - -Signed-off-by: Keerthana K ---- - crypto/ecc.c | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 122 insertions(+) - -diff --git a/crypto/ecc.c b/crypto/ecc.c -index 8dd7fe10d..e456517a2 100644 ---- a/crypto/ecc.c -+++ b/crypto/ecc.c -@@ -1548,6 +1548,125 @@ int ecc_gen_privkey(unsigned int curve_id, unsigned int ndigits, - return 0; - } - -+#define ECC_MAX_PRIV_KEY_SZ 8 -+#define ECC_MAX_PUB_KEY_SZ 12 -+#define ECC_P256_SS_SZ 32 -+#define ECC_P384_SS_SZ 48 -+ -+struct static_keypair { -+ u64 priv_key[ECC_MAX_PRIV_KEY_SZ]; -+ u64 pub_key[ECC_MAX_PUB_KEY_SZ]; -+}; -+ -+static const struct static_keypair ecc_p256 = { -+ .priv_key = { -+ 9452439779319861540ULL, -+ 11761858801976435446ULL, -+ 10581797902970445963ULL, -+ 9419536734775104336ULL, -+ 0, 0, 0, 0, -+ }, -+ .pub_key = { -+ 3547918415549923098ULL, -+ 14179485049500513917ULL, -+ 17671096273477813563ULL, -+ 6890828708320535478ULL, -+ 216030908325808746ULL, -+ 7709452682360784951ULL, -+ 8590731219336823402ULL, -+ 16071639722929465850ULL, -+ 0, 0, 0, 0, -+ }, -+}; -+ -+static const struct static_keypair ecc_p384 = { -+ .priv_key = { -+ 14313235887423266569ULL, -+ 9198168633825396889ULL, -+ 1589555625840288886ULL, -+ 6189876718282884870ULL, -+ 17170508223326936035ULL, -+ 10714409278094487103ULL, -+ 0, 0, -+ -+ }, -+ .pub_key = { -+ 3219089472411039846ULL, -+ 6338061617631358942ULL, -+ 16389706391199467349ULL, -+ 16599922655348274198ULL, -+ 13023764348400057054ULL, -+ 12268192317188507592ULL, -+ 14607969375289705108ULL, -+ 4594462565568104956ULL, -+ 12485352420393681765ULL, -+ 10300752922574070944ULL, -+ 15728762062766055403ULL, -+ 2065027171005275110ULL, -+ }, -+}; -+ -+static int ecc_pct(unsigned int curve_id, unsigned int ndigits, -+ const u64 *private_key, const u64 *public_key) -+{ -+ int ret = 0; -+ u64 *shared_secret_a = NULL; -+ u64 *shared_secret_b = NULL; -+ unsigned short ss_size = 0; -+ const u64* static_priv_key = NULL; -+ const u64* static_pub_key = NULL; -+ u64 priv[ECC_MAX_DIGITS]; -+ -+ if (curve_id == 2) { -+ ss_size = ECC_P256_SS_SZ; -+ static_priv_key = ecc_p256.priv_key; -+ static_pub_key = ecc_p256.pub_key; -+ } else if (curve_id == 3) { -+ ss_size = ECC_P384_SS_SZ; -+ static_priv_key = ecc_p384.priv_key; -+ static_pub_key = ecc_p384.pub_key; -+ } else { -+ return ret; -+ } -+ -+ /* crypto_shared_secret() expects private keys to be in proper -+ * byte order, so swap the static private keys before calling -+ * the function. -+ */ -+ ecc_swap_digits(static_priv_key, priv, ndigits); -+ shared_secret_a = fcw_kmalloc(ss_size, GFP_KERNEL); -+ if (!shared_secret_a) { -+ ret = -ENOMEM; -+ goto out; -+ } -+ shared_secret_b = fcw_kmalloc(ss_size, GFP_KERNEL); -+ if (!shared_secret_b) { -+ ret = -ENOMEM; -+ goto out; -+ } -+ -+ ret = crypto_ecdh_shared_secret(curve_id, ndigits, -+ priv, public_key, shared_secret_a); -+ if (ret < 0) -+ goto out; -+ ret = crypto_ecdh_shared_secret(curve_id, ndigits, -+ private_key, static_pub_key, shared_secret_b); -+ if (ret < 0) -+ goto out; -+ -+ if (memcmp(shared_secret_a, shared_secret_b, ss_size)) { -+ fcw_printk("Pairwise Consistency Test for ECC keys failed\n"); -+ ret = -EFAULT; -+ goto out; -+ } -+ fcw_printk("Pairwise Consistency Test for ECC keys passed\n"); -+ -+out: -+ kfree(shared_secret_a); -+ kfree(shared_secret_b); -+ return ret; -+} -+ - int ecc_make_pub_key(unsigned int curve_id, unsigned int ndigits, - const u64 *private_key, u64 *public_key) - { -@@ -1577,6 +1696,9 @@ int ecc_make_pub_key(unsigned int curve_id, unsigned int ndigits, - ecc_swap_digits(pk->x, public_key, ndigits); - ecc_swap_digits(pk->y, &public_key[ndigits], ndigits); - -+ if (fips_enabled) -+ ret = ecc_pct(curve_id, ndigits, private_key, public_key); -+ - err_free_point: - ecc_free_point(pk); - out: --- -2.50.1 - diff --git a/SPECS/91/linux/canister_builder/patches/1008-Add-ghash-accelerator.patch b/SPECS/91/linux/canister_builder/patches/1008-Add-ghash-accelerator.patch deleted file mode 100644 index d27305bc75..0000000000 --- a/SPECS/91/linux/canister_builder/patches/1008-Add-ghash-accelerator.patch +++ /dev/null @@ -1,168 +0,0 @@ -From 3e672bd7d34400bad24deebf601ee3d67fad3e19 Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Thu, 11 Sep 2025 17:26:16 +0000 -Subject: [PATCH] Add ghash accelerator - -Prepare glue C files to be included into the canister binary. Move to -wrapper calls. Remove modules related stuff and use fcw_ functions. - -.S file: Disable retpoline and return sites and use "ret;int3" for -straight-line-speculation mitigation. - -Signed-off-by: Alexey Makhalov ---- - arch/x86/crypto/ghash-clmulni-intel_asm.S | 5 +++ - arch/x86/crypto/ghash-clmulni-intel_glue.c | 52 +++++++--------------- - 2 files changed, 22 insertions(+), 35 deletions(-) - -diff --git a/arch/x86/crypto/ghash-clmulni-intel_asm.S b/arch/x86/crypto/ghash-clmulni-intel_asm.S -index 99cb983de..3a50fee3a 100644 ---- a/arch/x86/crypto/ghash-clmulni-intel_asm.S -+++ b/arch/x86/crypto/ghash-clmulni-intel_asm.S -@@ -29,6 +29,11 @@ - #define BSWAP %xmm5 - #define IN1 %xmm6 - -+#if defined(RET) -+#undef RET -+#define RET ret;int3 -+#endif -+ - .text - - /* -diff --git a/arch/x86/crypto/ghash-clmulni-intel_glue.c b/arch/x86/crypto/ghash-clmulni-intel_glue.c -index 41bc02e48..4360991c1 100644 ---- a/arch/x86/crypto/ghash-clmulni-intel_glue.c -+++ b/arch/x86/crypto/ghash-clmulni-intel_glue.c -@@ -7,23 +7,20 @@ - * Author: Huang Ying - */ - --#include --#include --#include --#include --#include --#include - #include - #include - #include --#include --#include --#include --#include - - #define GHASH_BLOCK_SIZE 16 - #define GHASH_DIGEST_SIZE 16 - -+extern void fcw_kernel_fpu_begin(void); -+extern void fcw_kernel_fpu_end(void); -+extern bool fcw_x86_match_cpu_pcmul_cpu_id(void); -+extern bool fcw_ghash_do_async(struct cryptd_ahash *tfm); -+int __init ghash_pclmulqdqni_mod_init(void); -+void __exit ghash_pclmulqdqni_mod_exit(void); -+ - void clmul_ghash_mul(char *dst, const le128 *shash); - - void clmul_ghash_update(char *dst, const char *src, unsigned int srclen, -@@ -99,7 +96,7 @@ static int ghash_update(struct shash_desc *desc, - struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); - u8 *dst = dctx->buffer; - -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - if (dctx->bytes) { - int n = min(srclen, dctx->bytes); - u8 *pos = dst + (GHASH_BLOCK_SIZE - dctx->bytes); -@@ -115,7 +112,7 @@ static int ghash_update(struct shash_desc *desc, - } - - clmul_ghash_update(dst, src, srclen, &ctx->shash); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - - if (srclen & 0xf) { - src += srclen - (srclen & 0xf); -@@ -138,9 +135,9 @@ static void ghash_flush(struct ghash_ctx *ctx, struct ghash_desc_ctx *dctx) - while (dctx->bytes--) - *tmp++ ^= 0; - -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - clmul_ghash_mul(dst, &ctx->shash); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - } - - dctx->bytes = 0; -@@ -196,8 +193,7 @@ static int ghash_async_update(struct ahash_request *req) - struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm); - struct cryptd_ahash *cryptd_tfm = ctx->cryptd_tfm; - -- if (!crypto_simd_usable() || -- (in_atomic() && cryptd_ahash_queued(cryptd_tfm))) { -+ if (fcw_ghash_do_async(cryptd_tfm)) { - memcpy(cryptd_req, req, sizeof(*req)); - ahash_request_set_tfm(cryptd_req, &cryptd_tfm->base); - return crypto_ahash_update(cryptd_req); -@@ -214,8 +210,7 @@ static int ghash_async_final(struct ahash_request *req) - struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm); - struct cryptd_ahash *cryptd_tfm = ctx->cryptd_tfm; - -- if (!crypto_simd_usable() || -- (in_atomic() && cryptd_ahash_queued(cryptd_tfm))) { -+ if (fcw_ghash_do_async(cryptd_tfm)) { - memcpy(cryptd_req, req, sizeof(*req)); - ahash_request_set_tfm(cryptd_req, &cryptd_tfm->base); - return crypto_ahash_final(cryptd_req); -@@ -255,8 +250,7 @@ static int ghash_async_digest(struct ahash_request *req) - struct ahash_request *cryptd_req = ahash_request_ctx(req); - struct cryptd_ahash *cryptd_tfm = ctx->cryptd_tfm; - -- if (!crypto_simd_usable() || -- (in_atomic() && cryptd_ahash_queued(cryptd_tfm))) { -+ if (fcw_ghash_do_async(cryptd_tfm)) { - memcpy(cryptd_req, req, sizeof(*req)); - ahash_request_set_tfm(cryptd_req, &cryptd_tfm->base); - return crypto_ahash_digest(cryptd_req); -@@ -331,17 +325,11 @@ static struct ahash_alg ghash_async_alg = { - }, - }; - --static const struct x86_cpu_id pcmul_cpu_id[] = { -- X86_MATCH_FEATURE(X86_FEATURE_PCLMULQDQ, NULL), /* Pickle-Mickle-Duck */ -- {} --}; --MODULE_DEVICE_TABLE(x86cpu, pcmul_cpu_id); -- --static int __init ghash_pclmulqdqni_mod_init(void) -+int __init ghash_pclmulqdqni_mod_init(void) - { - int err; - -- if (!x86_match_cpu(pcmul_cpu_id)) -+ if (!fcw_x86_match_cpu_pcmul_cpu_id()) - return -ENODEV; - - err = crypto_register_shash(&ghash_alg); -@@ -359,15 +347,9 @@ static int __init ghash_pclmulqdqni_mod_init(void) - return err; - } - --static void __exit ghash_pclmulqdqni_mod_exit(void) -+void __exit ghash_pclmulqdqni_mod_exit(void) - { - crypto_unregister_ahash(&ghash_async_alg); - crypto_unregister_shash(&ghash_alg); - } - --module_init(ghash_pclmulqdqni_mod_init); --module_exit(ghash_pclmulqdqni_mod_exit); -- --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("GHASH hash function, accelerated by PCLMULQDQ-NI"); --MODULE_ALIAS_CRYPTO("ghash"); --- -2.40.4 - diff --git a/SPECS/91/linux/canister_builder/patches/1009-Handle-approved-and-non-approved-services.patch b/SPECS/91/linux/canister_builder/patches/1009-Handle-approved-and-non-approved-services.patch deleted file mode 100644 index 2cc752dfa6..0000000000 --- a/SPECS/91/linux/canister_builder/patches/1009-Handle-approved-and-non-approved-services.patch +++ /dev/null @@ -1,350 +0,0 @@ -From a3ef2e1284f656c62ba14c589464855430e2fed6 Mon Sep 17 00:00:00 2001 -From: Vamsi Krishna Brahmajosyula -Date: Fri, 11 Jul 2025 04:20:16 -0500 -Subject: [PATCH] Handle approved and non-approved services - -- Add XTS error log when XTS duplicate test fails -- Remove fips_allowed flag for the following non-approved algorithms - cbcmac(aes) outside of ccm context - ghash-generic outside of gcm context - rfc4309(ccm(aes)) - rfc3686(ctr(aes))) - -Signed-off-by: Keerthana K -Signed-off-by: Vamsi Krishna Brahmajosyula -[ Brennan : Modified to totally block external IVs instead of only print warning ] -Signed-off-by: Brennan Lamoreaux -[Ankit: Removed all approved/non-approved log indicators] -Signed-off-by: Ankit Jain ---- - arch/x86/crypto/aesni-intel_glue.c | 21 +++++++++++++++++++-- - crypto/aes_generic.c | 1 + - crypto/cbc.c | 1 + - crypto/drbg.c | 1 + - crypto/ecc.c | 1 + - crypto/gcm.c | 19 +++++++++++++++++++ - crypto/ghash-generic.c | 1 + - crypto/seqiv.c | 5 +++++ - crypto/sha256_generic.c | 1 + - crypto/sha3_generic.c | 1 + - crypto/sha512_generic.c | 1 + - crypto/testmgr.c | 12 +++++------- - crypto/xts.c | 5 +++-- - 13 files changed, 59 insertions(+), 11 deletions(-) - -diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c -index e47e1d10a..cbed67a0d 100644 ---- a/arch/x86/crypto/aesni-intel_glue.c -+++ b/arch/x86/crypto/aesni-intel_glue.c -@@ -36,6 +36,7 @@ - #include - #include - #include -+#include - - void fcw_kernel_fpu_begin(void); - void fcw_kernel_fpu_end(void); -@@ -56,6 +57,9 @@ extern bool fcw_boot_cpu_has(unsigned long bit); - extern bool fcw_x86_match_cpu_zmm_exclusion_list(void); - extern bool fcw_x86_match_cpu_aesni_cpu_id(void); - -+int __init aesni_init(void); -+void __exit aesni_exit(void); -+ - #define AESNI_ALIGN 16 - #define AESNI_ALIGN_ATTR __attribute__ ((__aligned__(AESNI_ALIGN))) - #define AES_BLOCK_MASK (~(AES_BLOCK_SIZE - 1)) -@@ -507,8 +511,10 @@ static int xts_setkey_aesni(struct crypto_skcipher *tfm, const u8 *key, - int err; - - err = xts_verify_key(tfm, key, keylen); -- if (err) -+ if (err) { -+ fcw_printk(KERN_ERR "XTS verify duplicate key test failed\n"); - return err; -+ } - - keylen /= 2; - -@@ -1378,6 +1384,16 @@ gcm_crypt(struct aead_request *req, int flags) - le_ctr[3] = get_unaligned_be32(req->iv + 0); - } - -+ if (fips_enabled && flags & FLAG_ENC) { -+ if (!aead_request_is_internal_iv(req)) { -+ fcw_printk(KERN_ERR "alg: (%s) (%s) Encryption with external IV is not" -+ " approved in FIPS mode\n", -+ crypto_tfm_alg_driver_name(req->base.tfm), -+ crypto_tfm_alg_name(req->base.tfm)); -+ return -EINVAL; -+ } -+ } -+ - /* Begin walking through the plaintext or ciphertext. */ - if (flags & FLAG_ENC) - err = skcipher_walk_aead_encrypt(&walk, req, false); -@@ -1568,6 +1584,7 @@ static int __init register_avx_algs(void) - aes_gcm_simdalgs_aesni_avx); - if (err) - return err; -+ - #if defined(CONFIG_AS_VAES) && defined(CONFIG_AS_VPCLMULQDQ) - if (!fcw_boot_cpu_has(X86_FEATURE_AVX2) || - !fcw_boot_cpu_has(X86_FEATURE_VAES) || -@@ -1614,6 +1631,7 @@ static int __init register_avx_algs(void) - aes_gcm_simdalgs_vaes_avx10_512); - if (err) - return err; -+ - #endif /* CONFIG_AS_VAES && CONFIG_AS_VPCLMULQDQ */ - return 0; - } -@@ -1691,7 +1709,6 @@ int __init aesni_init(void) - if (err) - goto unregister_skciphers; - -- - #ifdef CONFIG_X86_64 - if (fcw_boot_cpu_has(X86_FEATURE_AVX)) - err = simd_register_skciphers_compat(&aesni_xctr, 1, -diff --git a/crypto/aes_generic.c b/crypto/aes_generic.c -index d26cc2af0..1834d7ef2 100644 ---- a/crypto/aes_generic.c -+++ b/crypto/aes_generic.c -@@ -54,6 +54,7 @@ - #include - #include - #include -+#include "fips_canister_wrapper.h" - - static inline u8 byte(const u32 x, const unsigned n) - { -diff --git a/crypto/cbc.c b/crypto/cbc.c -index 581990a12..5b0fa6fba 100644 ---- a/crypto/cbc.c -+++ b/crypto/cbc.c -@@ -10,6 +10,7 @@ - #include - #include - #include -+#include "fips_canister_wrapper.h" - - static int crypto_cbc_encrypt_segment(struct crypto_lskcipher *tfm, - const u8 *src, u8 *dst, unsigned nbytes, -diff --git a/crypto/drbg.c b/crypto/drbg.c -index 1ed3e3873..7ac35c710 100644 ---- a/crypto/drbg.c -+++ b/crypto/drbg.c -@@ -101,6 +101,7 @@ - #include - #include - #include -+#include - #include "fips_canister_wrapper.h" - - /*************************************************************** -diff --git a/crypto/ecc.c b/crypto/ecc.c -index 774f7e816..4358c9b2a 100644 ---- a/crypto/ecc.c -+++ b/crypto/ecc.c -@@ -32,6 +32,7 @@ - #include - #include - #include -+#include - - #include "ecc_curve_defs.h" - #include "fips_canister_wrapper.h" -diff --git a/crypto/gcm.c b/crypto/gcm.c -index 7efe5edce..a45dba8aa 100644 ---- a/crypto/gcm.c -+++ b/crypto/gcm.c -@@ -465,6 +465,14 @@ static int crypto_gcm_encrypt(struct aead_request *req) - struct skcipher_request *skreq = &pctx->u.skreq; - u32 flags = aead_request_flags(req); - -+ if (fips_enabled && !aead_request_is_internal_iv(req)) { -+ fcw_printk(KERN_ERR "alg: (%s) (%s) Encryption with external IV is not" -+ " approved in FIPS mode\n", -+ crypto_tfm_alg_driver_name(req->base.tfm), -+ crypto_tfm_alg_name(req->base.tfm)); -+ return -EINVAL; -+ } -+ - crypto_gcm_init_common(req); - crypto_gcm_init_crypt(req, req->cryptlen); - skcipher_request_set_callback(skreq, flags, gcm_encrypt_done, req); -@@ -759,6 +767,7 @@ static struct aead_request *crypto_rfc4106_crypt(struct aead_request *req) - } - - aead_request_set_tfm(subreq, child); -+ - aead_request_set_callback(subreq, req->base.flags, req->base.complete, - req->base.data); - aead_request_set_crypt(subreq, rctx->src, -@@ -766,6 +775,8 @@ static struct aead_request *crypto_rfc4106_crypt(struct aead_request *req) - req->cryptlen, iv); - aead_request_set_ad(subreq, req->assoclen - 8); - -+ subreq->internal_iv = req->internal_iv; -+ - return subreq; - } - -@@ -773,6 +784,14 @@ static int crypto_rfc4106_encrypt(struct aead_request *req) - { - int err; - -+ if (fips_enabled && !aead_request_is_internal_iv(req)) { -+ fcw_printk(KERN_ERR "alg: (%s) (%s) Encryption with external IV is not" -+ " approved in FIPS mode\n", -+ crypto_tfm_alg_driver_name(req->base.tfm), -+ crypto_tfm_alg_name(req->base.tfm)); -+ return -EINVAL; -+ } -+ - err = crypto_ipsec_check_assoclen(req->assoclen); - if (err) - return err; -diff --git a/crypto/ghash-generic.c b/crypto/ghash-generic.c -index 0a9180725..b3f1bbd4c 100644 ---- a/crypto/ghash-generic.c -+++ b/crypto/ghash-generic.c -@@ -41,6 +41,7 @@ - #include - #include - #include -+#include "fips_canister_wrapper.h" - - static int ghash_init(struct shash_desc *desc) - { -diff --git a/crypto/seqiv.c b/crypto/seqiv.c -index 1e721a6fa..6274a0ab7 100644 ---- a/crypto/seqiv.c -+++ b/crypto/seqiv.c -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include "fips_canister_wrapper.h" - - static void seqiv_aead_encrypt_complete2(struct aead_request *req, int err) - { -@@ -100,6 +100,10 @@ - crypto_xor(info, ctx->salt, ivsize); - scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1); - -+ err = aead_request_mark_internal_iv(subreq); -+ if(err) -+ return err; -+ - err = crypto_aead_encrypt(subreq); - if (unlikely(unaligned_info)) - seqiv_aead_encrypt_complete2(req, err); -diff --git a/crypto/sha256_generic.c b/crypto/sha256_generic.c -index 9bc82ab39..cbc3cc424 100644 ---- a/crypto/sha256_generic.c -+++ b/crypto/sha256_generic.c -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include "fips_canister_wrapper.h" - - const u8 sha224_zero_message_hash[SHA224_DIGEST_SIZE] = { - 0xd1, 0x4a, 0x02, 0x8c, 0x2a, 0x3a, 0x2b, 0xc9, 0x47, -diff --git a/crypto/sha3_generic.c b/crypto/sha3_generic.c -index 7aa5becfc..0816c388a 100644 ---- a/crypto/sha3_generic.c -+++ b/crypto/sha3_generic.c -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include "fips_canister_wrapper.h" - - /* - * On some 32-bit architectures (h8300), GCC ends up using -diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c -index 5c108024b..00b0531f7 100644 ---- a/crypto/sha512_generic.c -+++ b/crypto/sha512_generic.c -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include "fips_canister_wrapper.h" - - const u8 sha384_zero_message_hash[SHA384_DIGEST_SIZE] = { - 0x38, 0xb0, 0x60, 0xa7, 0x51, 0xac, 0x96, 0x38, -diff --git a/crypto/testmgr.c b/crypto/testmgr.c -index 3e3cc4d55..c0234893e 100644 ---- a/crypto/testmgr.c -+++ b/crypto/testmgr.c -@@ -2425,9 +2425,11 @@ static int alg_test_aead(const struct alg_test_desc *desc, const char *driver, - goto out; - } - -- err = test_aead(ENCRYPT, suite, req, tsgls); -- if (err) -- goto out; -+ if (fips_enabled && !strstr(desc->alg, "gcm(aes)")) { -+ err = test_aead(ENCRYPT, suite, req, tsgls); -+ if (err) -+ goto out; -+ } - - err = test_aead(DECRYPT, suite, req, tsgls); - if (err) -@@ -4110,7 +4112,6 @@ static const struct alg_test_desc alg_test_descs[] = { - }, { - .alg = "authenc(hmac(sha1),rfc3686(ctr(aes)))", - .test = alg_test_null, -- .fips_allowed = 1, - }, { - .alg = "authenc(hmac(sha224),cbc(des))", - .test = alg_test_aead, -@@ -4149,7 +4150,6 @@ static const struct alg_test_desc alg_test_descs[] = { - }, { - .alg = "authenc(hmac(sha256),rfc3686(ctr(aes)))", - .test = alg_test_null, -- .fips_allowed = 1, - }, { - .alg = "authenc(hmac(sha384),cbc(des))", - .test = alg_test_aead, -@@ -4169,7 +4169,6 @@ static const struct alg_test_desc alg_test_descs[] = { - }, { - .alg = "authenc(hmac(sha384),rfc3686(ctr(aes)))", - .test = alg_test_null, -- .fips_allowed = 1, - }, { - .alg = "authenc(hmac(sha512),cbc(aes))", - .fips_allowed = 1, -@@ -4196,7 +4195,6 @@ static const struct alg_test_desc alg_test_descs[] = { - }, { - .alg = "authenc(hmac(sha512),rfc3686(ctr(aes)))", - .test = alg_test_null, -- .fips_allowed = 1, - }, { - .alg = "blake2b-160", - .test = alg_test_hash, -diff --git a/crypto/xts.c b/crypto/xts.c -index 3f255ec8f..dab09e0ab 100644 ---- a/crypto/xts.c -+++ b/crypto/xts.c -@@ -47,9 +47,10 @@ static int xts_setkey(struct crypto_skcipher *parent, const u8 *key, - int err; - - err = xts_verify_key(parent, key, keylen); -- if (err) -+ if (err) { -+ fcw_printk(KERN_ERR "XTS verify duplicate key test failed\n"); - return err; -- -+ } - keylen /= 2; - - /* we need two cipher instances: one to compute the initial 'tweak' --- -2.40.4 - diff --git a/SPECS/91/linux/canister_builder/patches/1010-rsa-pkcs1pad-Add-invalid_hash_len-check-in-sign-veri.patch b/SPECS/91/linux/canister_builder/patches/1010-rsa-pkcs1pad-Add-invalid_hash_len-check-in-sign-veri.patch deleted file mode 100644 index 7ab805cffc..0000000000 --- a/SPECS/91/linux/canister_builder/patches/1010-rsa-pkcs1pad-Add-invalid_hash_len-check-in-sign-veri.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 67f23af2718d6d5d80cb346e3e8238d8d37d473a Mon Sep 17 00:00:00 2001 -From: Vamsi Krishna Brahmajosyula -Date: Mon, 7 Apr 2025 08:02:02 +0000 -Subject: [PATCH] rsa-pkcs1pad: Add invalid_hash_len check in sign/verify - -Upstream code after 6.13 added an additional check to compare -last byte of hash_prefix/digest_info to slen/dlen appropriately - -Port it to 6.12 - -Signed-off-by: Vamsi Krishna Brahmajosyula ---- - crypto/rsa-pkcs1pad.c | 35 ++++++++++++++++++++++++++++++++++- - 1 file changed, 34 insertions(+), 1 deletion(-) - -diff --git a/crypto/rsa-pkcs1pad.c b/crypto/rsa-pkcs1pad.c -index 9cac0a06b..d9b6d7d1d 100644 ---- a/crypto/rsa-pkcs1pad.c -+++ b/crypto/rsa-pkcs1pad.c -@@ -9,6 +9,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -21,6 +22,8 @@ - /* - * Hash algorithm OIDs plus ASN.1 DER wrappings [RFC4880 sec 5.2.2]. - */ -+static const u8 rsa_digest_info_none[] = { }; -+ - static const u8 rsa_digest_info_md5[] = { - 0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05, /* OID */ -@@ -178,6 +181,29 @@ static int pkcs1pad_set_priv_key(struct crypto_akcipher *tfm, const void *key, - return 0; - } - -+static bool pkcs1pad_invalid_hash_len(unsigned int len, -+ const struct rsa_asn1_template *digest_info) -+{ -+ /* -+ * Legacy protocols such as TLS 1.1 or earlier and IKE version 1 -+ * do not prepend a Full Hash Prefix/Digest Info to the hash. In that case, -+ * the size of the Full Hash Prefix is zero. -+ */ -+ if (digest_info->data == rsa_digest_info_none) -+ return false; -+ -+ /* -+ * The final byte of the Full Hash Prefix encodes the hash length. -+ * -+ * This needs to be revisited should hash algorithms with more than -+ * 1016 bits (127 bytes * 8) ever be added. The length would then -+ * be encoded into more than one byte by ASN.1. -+ */ -+ static_assert(HASH_MAX_DIGESTSIZE <= 127); -+ -+ return len != digest_info->data[digest_info->size - 1]; -+} -+ - static unsigned int pkcs1pad_get_max_size(struct crypto_akcipher *tfm) - { - struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm); -@@ -441,6 +467,9 @@ static int pkcs1pad_sign(struct akcipher_request *req) - if (req->src_len + digest_info_size > ctx->key_size - 11) - return -EOVERFLOW; - -+ if (pkcs1pad_invalid_hash_len(req->src_len, digest_info)) -+ return -EINVAL; -+ - if (req->dst_len < ctx->key_size) { - req->dst_len = ctx->key_size; - return -EOVERFLOW; -@@ -579,13 +608,17 @@ static int pkcs1pad_verify(struct akcipher_request *req) - { - struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req); - struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm); -+ struct akcipher_instance *inst = akcipher_alg_instance(tfm); -+ struct pkcs1pad_inst_ctx *ictx = akcipher_instance_ctx(inst); -+ const struct rsa_asn1_template *digest_info = ictx->digest_info; - struct pkcs1pad_request *req_ctx = akcipher_request_ctx(req); - const unsigned int sig_size = req->src_len; - const unsigned int digest_size = req->dst_len; - int err; - - if (fcw_warn_on(req->dst) || fcw_warn_on(!digest_size) || -- !ctx->key_size || sig_size != ctx->key_size) -+ !ctx->key_size || sig_size != ctx->key_size || -+ pkcs1pad_invalid_hash_len(digest_size, digest_info)) - return -EINVAL; - - req_ctx->out_buf = fcw_kmalloc(ctx->key_size + digest_size, GFP_KERNEL); --- -2.40.4 - diff --git a/SPECS/91/linux/canister_builder/patches/1011-sha1-Do-not-register-sha1-to-crypto-backend-when-fip.patch b/SPECS/91/linux/canister_builder/patches/1011-sha1-Do-not-register-sha1-to-crypto-backend-when-fip.patch deleted file mode 100644 index 32171cc448..0000000000 --- a/SPECS/91/linux/canister_builder/patches/1011-sha1-Do-not-register-sha1-to-crypto-backend-when-fip.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 1a194ba0fabf048be0a2a7262d48d3538674717f Mon Sep 17 00:00:00 2001 -From: Vamsi Krishna Brahmajosyula -Date: Thu, 5 Jun 2025 23:39:23 -0500 -Subject: [PATCH] sha1: Do not register sha1 to crypto backend when fips - is enabled - ---- - crypto/sha1_generic.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/crypto/sha1_generic.c b/crypto/sha1_generic.c -index 325b57fe2..24ab7da36 100644 ---- a/crypto/sha1_generic.c -+++ b/crypto/sha1_generic.c -@@ -18,6 +18,7 @@ - #include - #include - #include -+#include - #include - - const u8 sha1_zero_message_hash[SHA1_DIGEST_SIZE] = { -@@ -78,12 +79,16 @@ static struct shash_alg alg = { - - static int __init sha1_generic_mod_init(void) - { -- return crypto_register_shash(&alg); -+ if (!fips_enabled) -+ return crypto_register_shash(&alg); -+ else -+ return 0; - } - - static void __exit sha1_generic_mod_fini(void) - { -- crypto_unregister_shash(&alg); -+ if (!fips_enabled) -+ crypto_unregister_shash(&alg); - } - - subsys_initcall(sha1_generic_mod_init); --- -2.50.1 - diff --git a/SPECS/91/linux/canister_builder/patches/1012-Add-shasums-accelerators.patch b/SPECS/91/linux/canister_builder/patches/1012-Add-shasums-accelerators.patch deleted file mode 100644 index 9fb5612ebe..0000000000 --- a/SPECS/91/linux/canister_builder/patches/1012-Add-shasums-accelerators.patch +++ /dev/null @@ -1,333 +0,0 @@ -From c514cb54f70f498a73cd04e8ac473335d5383dd9 Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Mon, 11 Aug 2025 22:18:52 +0000 -Subject: [PATCH] Add shasums accelerators - -Prepare glue C files to be included into the canister binary. -Move to wrapper calls. Remove modules related stuff - -Signed-off-by: Alexey Makhalov ---- - arch/x86/crypto/sha256_ssse3_glue.c | 67 ++++++++++------------------- - arch/x86/crypto/sha512_ssse3_glue.c | 57 ++++++++++-------------- - 2 files changed, 45 insertions(+), 79 deletions(-) - -diff --git a/arch/x86/crypto/sha256_ssse3_glue.c b/arch/x86/crypto/sha256_ssse3_glue.c -index e04a43d9f..3dc6efa76 100644 ---- a/arch/x86/crypto/sha256_ssse3_glue.c -+++ b/arch/x86/crypto/sha256_ssse3_glue.c -@@ -32,7 +32,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -41,19 +40,17 @@ - #include - #include - -+extern void fcw_kernel_fpu_begin(void); -+extern void fcw_kernel_fpu_end(void); -+extern int fcw_printk(const char *fmt, ...); -+extern bool fcw_boot_cpu_has(unsigned long bit); -+extern bool fcw_x86_match_cpu_sha256_ssse3_cpu_id(void); -+ - asmlinkage void sha256_transform_ssse3(struct sha256_state *state, - const u8 *data, int blocks); - --static const struct x86_cpu_id module_cpu_ids[] = { --#ifdef CONFIG_AS_SHA256_NI -- X86_MATCH_FEATURE(X86_FEATURE_SHA_NI, NULL), --#endif -- X86_MATCH_FEATURE(X86_FEATURE_AVX2, NULL), -- X86_MATCH_FEATURE(X86_FEATURE_AVX, NULL), -- X86_MATCH_FEATURE(X86_FEATURE_SSSE3, NULL), -- {} --}; --MODULE_DEVICE_TABLE(x86cpu, module_cpu_ids); -+int __init sha256_ssse3_mod_init(void); -+void __exit sha256_ssse3_mod_fini(void); - - static int _sha256_update(struct shash_desc *desc, const u8 *data, - unsigned int len, sha256_block_fn *sha256_xform) -@@ -70,9 +67,9 @@ static int _sha256_update(struct shash_desc *desc, const u8 *data, - */ - BUILD_BUG_ON(offsetof(struct sha256_state, state) != 0); - -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - sha256_base_do_update(desc, data, len, sha256_xform); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - - return 0; - } -@@ -83,11 +80,11 @@ static int sha256_finup(struct shash_desc *desc, const u8 *data, - if (!crypto_simd_usable()) - return crypto_sha256_finup(desc, data, len, out); - -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - if (len) - sha256_base_do_update(desc, data, len, sha256_xform); - sha256_base_do_finalize(desc, sha256_xform); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - - return sha256_base_finish(desc, out); - } -@@ -150,7 +147,7 @@ static struct shash_alg sha256_ssse3_algs[] = { { - - static int register_sha256_ssse3(void) - { -- if (boot_cpu_has(X86_FEATURE_SSSE3)) -+ if (fcw_boot_cpu_has(X86_FEATURE_SSSE3)) - return crypto_register_shashes(sha256_ssse3_algs, - ARRAY_SIZE(sha256_ssse3_algs)); - return 0; -@@ -158,7 +155,7 @@ static int register_sha256_ssse3(void) - - static void unregister_sha256_ssse3(void) - { -- if (boot_cpu_has(X86_FEATURE_SSSE3)) -+ if (fcw_boot_cpu_has(X86_FEATURE_SSSE3)) - crypto_unregister_shashes(sha256_ssse3_algs, - ARRAY_SIZE(sha256_ssse3_algs)); - } -@@ -224,8 +221,8 @@ static struct shash_alg sha256_avx_algs[] = { { - static bool avx_usable(void) - { - if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL)) { -- if (boot_cpu_has(X86_FEATURE_AVX)) -- pr_info("AVX detected but unusable.\n"); -+ if (fcw_boot_cpu_has(X86_FEATURE_AVX)) -+ fcw_printk(KERN_INFO pr_fmt() "AVX detected but unusable.\n"); - return false; - } - -@@ -307,8 +304,8 @@ static struct shash_alg sha256_avx2_algs[] = { { - - static bool avx2_usable(void) - { -- if (avx_usable() && boot_cpu_has(X86_FEATURE_AVX2) && -- boot_cpu_has(X86_FEATURE_BMI2)) -+ if (avx_usable() && fcw_boot_cpu_has(X86_FEATURE_AVX2) && -+ fcw_boot_cpu_has(X86_FEATURE_BMI2)) - return true; - - return false; -@@ -390,7 +387,7 @@ static struct shash_alg sha256_ni_algs[] = { { - - static int register_sha256_ni(void) - { -- if (boot_cpu_has(X86_FEATURE_SHA_NI)) -+ if (fcw_boot_cpu_has(X86_FEATURE_SHA_NI)) - return crypto_register_shashes(sha256_ni_algs, - ARRAY_SIZE(sha256_ni_algs)); - return 0; -@@ -398,7 +395,7 @@ static int register_sha256_ni(void) - - static void unregister_sha256_ni(void) - { -- if (boot_cpu_has(X86_FEATURE_SHA_NI)) -+ if (fcw_boot_cpu_has(X86_FEATURE_SHA_NI)) - crypto_unregister_shashes(sha256_ni_algs, - ARRAY_SIZE(sha256_ni_algs)); - } -@@ -408,9 +405,9 @@ static inline int register_sha256_ni(void) { return 0; } - static inline void unregister_sha256_ni(void) { } - #endif - --static int __init sha256_ssse3_mod_init(void) -+int __init sha256_ssse3_mod_init(void) - { -- if (!x86_match_cpu(module_cpu_ids)) -+ if (!fcw_x86_match_cpu_sha256_ssse3_cpu_id()) - return -ENODEV; - - if (register_sha256_ssse3()) -@@ -439,7 +436,7 @@ static int __init sha256_ssse3_mod_init(void) - return -ENODEV; - } - --static void __exit sha256_ssse3_mod_fini(void) -+void __exit sha256_ssse3_mod_fini(void) - { - unregister_sha256_ni(); - unregister_sha256_avx2(); -@@ -447,21 +444,3 @@ static void __exit sha256_ssse3_mod_fini(void) - unregister_sha256_ssse3(); - } - --module_init(sha256_ssse3_mod_init); --module_exit(sha256_ssse3_mod_fini); -- --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("SHA256 Secure Hash Algorithm, Supplemental SSE3 accelerated"); -- --MODULE_ALIAS_CRYPTO("sha256"); --MODULE_ALIAS_CRYPTO("sha256-ssse3"); --MODULE_ALIAS_CRYPTO("sha256-avx"); --MODULE_ALIAS_CRYPTO("sha256-avx2"); --MODULE_ALIAS_CRYPTO("sha224"); --MODULE_ALIAS_CRYPTO("sha224-ssse3"); --MODULE_ALIAS_CRYPTO("sha224-avx"); --MODULE_ALIAS_CRYPTO("sha224-avx2"); --#ifdef CONFIG_AS_SHA256_NI --MODULE_ALIAS_CRYPTO("sha256-ni"); --MODULE_ALIAS_CRYPTO("sha224-ni"); --#endif -diff --git a/arch/x86/crypto/sha512_ssse3_glue.c b/arch/x86/crypto/sha512_ssse3_glue.c -index 6d3b85e53..e8f6a3570 100644 ---- a/arch/x86/crypto/sha512_ssse3_glue.c -+++ b/arch/x86/crypto/sha512_ssse3_glue.c -@@ -30,7 +30,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -39,9 +38,18 @@ - #include - #include - -+extern void fcw_kernel_fpu_begin(void); -+extern void fcw_kernel_fpu_end(void); -+extern int fcw_printk(const char *fmt, ...); -+extern bool fcw_boot_cpu_has(unsigned long bit); -+extern bool fcw_x86_match_cpu_sha512_ssse3_cpu_id(void); -+ - asmlinkage void sha512_transform_ssse3(struct sha512_state *state, - const u8 *data, int blocks); - -+int __init sha512_ssse3_mod_init(void); -+void __exit sha512_ssse3_mod_fini(void); -+ - static int sha512_update(struct shash_desc *desc, const u8 *data, - unsigned int len, sha512_block_fn *sha512_xform) - { -@@ -57,9 +65,9 @@ static int sha512_update(struct shash_desc *desc, const u8 *data, - */ - BUILD_BUG_ON(offsetof(struct sha512_state, state) != 0); - -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - sha512_base_do_update(desc, data, len, sha512_xform); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - - return 0; - } -@@ -70,11 +78,11 @@ static int sha512_finup(struct shash_desc *desc, const u8 *data, - if (!crypto_simd_usable()) - return crypto_sha512_finup(desc, data, len, out); - -- kernel_fpu_begin(); -+ fcw_kernel_fpu_begin(); - if (len) - sha512_base_do_update(desc, data, len, sha512_xform); - sha512_base_do_finalize(desc, sha512_xform); -- kernel_fpu_end(); -+ fcw_kernel_fpu_end(); - - return sha512_base_finish(desc, out); - } -@@ -129,7 +137,7 @@ static struct shash_alg sha512_ssse3_algs[] = { { - - static int register_sha512_ssse3(void) - { -- if (boot_cpu_has(X86_FEATURE_SSSE3)) -+ if (fcw_boot_cpu_has(X86_FEATURE_SSSE3)) - return crypto_register_shashes(sha512_ssse3_algs, - ARRAY_SIZE(sha512_ssse3_algs)); - return 0; -@@ -137,7 +145,7 @@ static int register_sha512_ssse3(void) - - static void unregister_sha512_ssse3(void) - { -- if (boot_cpu_has(X86_FEATURE_SSSE3)) -+ if (fcw_boot_cpu_has(X86_FEATURE_SSSE3)) - crypto_unregister_shashes(sha512_ssse3_algs, - ARRAY_SIZE(sha512_ssse3_algs)); - } -@@ -147,8 +155,8 @@ asmlinkage void sha512_transform_avx(struct sha512_state *state, - static bool avx_usable(void) - { - if (!cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL)) { -- if (boot_cpu_has(X86_FEATURE_AVX)) -- pr_info("AVX detected but unusable.\n"); -+ if (fcw_boot_cpu_has(X86_FEATURE_AVX)) -+ fcw_printk(KERN_INFO pr_fmt() "AVX detected but unusable.\n"); - return false; - } - -@@ -271,8 +279,8 @@ static struct shash_alg sha512_avx2_algs[] = { { - - static bool avx2_usable(void) - { -- if (avx_usable() && boot_cpu_has(X86_FEATURE_AVX2) && -- boot_cpu_has(X86_FEATURE_BMI2)) -+ if (avx_usable() && fcw_boot_cpu_has(X86_FEATURE_AVX2) && -+ fcw_boot_cpu_has(X86_FEATURE_BMI2)) - return true; - - return false; -@@ -285,13 +293,6 @@ static int register_sha512_avx2(void) - ARRAY_SIZE(sha512_avx2_algs)); - return 0; - } --static const struct x86_cpu_id module_cpu_ids[] = { -- X86_MATCH_FEATURE(X86_FEATURE_AVX2, NULL), -- X86_MATCH_FEATURE(X86_FEATURE_AVX, NULL), -- X86_MATCH_FEATURE(X86_FEATURE_SSSE3, NULL), -- {} --}; --MODULE_DEVICE_TABLE(x86cpu, module_cpu_ids); - - static void unregister_sha512_avx2(void) - { -@@ -300,9 +301,9 @@ static void unregister_sha512_avx2(void) - ARRAY_SIZE(sha512_avx2_algs)); - } - --static int __init sha512_ssse3_mod_init(void) -+int __init sha512_ssse3_mod_init(void) - { -- if (!x86_match_cpu(module_cpu_ids)) -+ if (!fcw_x86_match_cpu_sha512_ssse3_cpu_id()) - return -ENODEV; - - if (register_sha512_ssse3()) -@@ -324,24 +325,10 @@ static int __init sha512_ssse3_mod_init(void) - return -ENODEV; - } - --static void __exit sha512_ssse3_mod_fini(void) -+void __exit sha512_ssse3_mod_fini(void) - { - unregister_sha512_avx2(); - unregister_sha512_avx(); - unregister_sha512_ssse3(); - } - --module_init(sha512_ssse3_mod_init); --module_exit(sha512_ssse3_mod_fini); -- --MODULE_LICENSE("GPL"); --MODULE_DESCRIPTION("SHA512 Secure Hash Algorithm, Supplemental SSE3 accelerated"); -- --MODULE_ALIAS_CRYPTO("sha512"); --MODULE_ALIAS_CRYPTO("sha512-ssse3"); --MODULE_ALIAS_CRYPTO("sha512-avx"); --MODULE_ALIAS_CRYPTO("sha512-avx2"); --MODULE_ALIAS_CRYPTO("sha384"); --MODULE_ALIAS_CRYPTO("sha384-ssse3"); --MODULE_ALIAS_CRYPTO("sha384-avx"); --MODULE_ALIAS_CRYPTO("sha384-avx2"); --- -2.40.4 - diff --git a/SPECS/91/linux/canister_builder/patches/1013-Disable-ret-sites-section-in-x86-shasum-object-files.patch b/SPECS/91/linux/canister_builder/patches/1013-Disable-ret-sites-section-in-x86-shasum-object-files.patch deleted file mode 100644 index 130329b6b7..0000000000 --- a/SPECS/91/linux/canister_builder/patches/1013-Disable-ret-sites-section-in-x86-shasum-object-files.patch +++ /dev/null @@ -1,133 +0,0 @@ -From 9942b6fccdc9b691f96b5b73664cbac56416c39b Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Wed, 20 Aug 2025 00:05:55 +0000 -Subject: [PATCH] Disable ret sites section in x86 shasum object files - -Use "ret;int3" for straight-line-speculation mitigation. - -Signed-off-by: Alexey Makhalov ---- - arch/x86/crypto/sha256-avx-asm.S | 5 +++++ - arch/x86/crypto/sha256-avx2-asm.S | 5 +++++ - arch/x86/crypto/sha256-ssse3-asm.S | 5 +++++ - arch/x86/crypto/sha256_ni_asm.S | 5 +++++ - arch/x86/crypto/sha512-avx-asm.S | 5 +++++ - arch/x86/crypto/sha512-avx2-asm.S | 5 +++++ - arch/x86/crypto/sha512-ssse3-asm.S | 5 +++++ - 7 files changed, 35 insertions(+) - -diff --git a/arch/x86/crypto/sha256-avx-asm.S b/arch/x86/crypto/sha256-avx-asm.S -index 53de72bdd..f8b367cf6 100644 ---- a/arch/x86/crypto/sha256-avx-asm.S -+++ b/arch/x86/crypto/sha256-avx-asm.S -@@ -53,6 +53,11 @@ - ## assume buffers not aligned - #define VMOVDQ vmovdqu - -+#if defined(RET) -+#undef RET -+#define RET ret;int3 -+#endif -+ - ################################ Define Macros - - # addm [mem], reg -diff --git a/arch/x86/crypto/sha256-avx2-asm.S b/arch/x86/crypto/sha256-avx2-asm.S -index 0bbec1c75..6f52a1444 100644 ---- a/arch/x86/crypto/sha256-avx2-asm.S -+++ b/arch/x86/crypto/sha256-avx2-asm.S -@@ -54,6 +54,11 @@ - ## assume buffers not aligned - #define VMOVDQ vmovdqu - -+#if defined(RET) -+#undef RET -+#define RET ret;int3 -+#endif -+ - ################################ Define Macros - - # addm [mem], reg -diff --git a/arch/x86/crypto/sha256-ssse3-asm.S b/arch/x86/crypto/sha256-ssse3-asm.S -index 93264ee44..81fcc7c06 100644 ---- a/arch/x86/crypto/sha256-ssse3-asm.S -+++ b/arch/x86/crypto/sha256-ssse3-asm.S -@@ -52,6 +52,11 @@ - ## assume buffers not aligned - #define MOVDQ movdqu - -+#if defined(RET) -+#undef RET -+#define RET ret;int3 -+#endif -+ - ################################ Define Macros - - # addm [mem], reg -diff --git a/arch/x86/crypto/sha256_ni_asm.S b/arch/x86/crypto/sha256_ni_asm.S -index d515a55a3..82adb42bd 100644 ---- a/arch/x86/crypto/sha256_ni_asm.S -+++ b/arch/x86/crypto/sha256_ni_asm.S -@@ -76,6 +76,11 @@ - #define ABEF_SAVE %xmm9 - #define CDGH_SAVE %xmm10 - -+#if defined(RET) -+#undef RET -+#define RET ret;int3 -+#endif -+ - .macro do_4rounds i, m0, m1, m2, m3 - .if \i < 16 - movdqu \i*4(DATA_PTR), \m0 -diff --git a/arch/x86/crypto/sha512-avx-asm.S b/arch/x86/crypto/sha512-avx-asm.S -index 5bfce4b04..863c8e8d0 100644 ---- a/arch/x86/crypto/sha512-avx-asm.S -+++ b/arch/x86/crypto/sha512-avx-asm.S -@@ -50,6 +50,11 @@ - #include - #include - -+#if defined(RET) -+#undef RET -+#define RET ret;int3 -+#endif -+ - .text - - # Virtual Registers -diff --git a/arch/x86/crypto/sha512-avx2-asm.S b/arch/x86/crypto/sha512-avx2-asm.S -index 24973f42c..5f36411f8 100644 ---- a/arch/x86/crypto/sha512-avx2-asm.S -+++ b/arch/x86/crypto/sha512-avx2-asm.S -@@ -52,6 +52,11 @@ - #include - #include - -+#if defined(RET) -+#undef RET -+#define RET ret;int3 -+#endif -+ - .text - - # Virtual Registers -diff --git a/arch/x86/crypto/sha512-ssse3-asm.S b/arch/x86/crypto/sha512-ssse3-asm.S -index 30a2c4777..3efc5214c 100644 ---- a/arch/x86/crypto/sha512-ssse3-asm.S -+++ b/arch/x86/crypto/sha512-ssse3-asm.S -@@ -50,6 +50,11 @@ - #include - #include - -+#if defined(RET) -+#undef RET -+#define RET ret;int3 -+#endif -+ - .text - - # Virtual Registers --- -2.40.4 - diff --git a/SPECS/91/linux/canister_builder/patches/1016-linux-canister-Eliminate-codetag-and-other-taggings-.patch b/SPECS/91/linux/canister_builder/patches/1016-linux-canister-Eliminate-codetag-and-other-taggings-.patch deleted file mode 100644 index 9a79dd9ced..0000000000 --- a/SPECS/91/linux/canister_builder/patches/1016-linux-canister-Eliminate-codetag-and-other-taggings-.patch +++ /dev/null @@ -1,54 +0,0 @@ -From e76157bd6e119d1c577cacb2279330b850cb35e0 Mon Sep 17 00:00:00 2001 -From: Ankit Jain -Date: Sun, 11 May 2025 17:42:09 +0000 -Subject: [PATCH] linux:canister: Eliminate codetag and other taggings structs - -- If CONFIG_MEM_ALLOC_PROFILING is enabled, standard - allocation functions like kmalloc() are redefined to - include the tagging mechanism, adding overhead for - profiling but providing valuable debugging information. -- However, in photon's kernel, CONFIG_MEM_ALLOC_PROFILING - is disabled so it shouldn't include any tagging related - structs in canister binary. -- To ensure this, added an upstream commit from v6.14 -https://github.com/gregkh/linux/commit/07438779313caafe52ac1a1a6958d735a5938988 - and additionally, since it uses an inline - mem_alloc_profiling_enabled() so canister binary still - have tagging structs. Thus, added another patch on top - to handle alloc_hooks_tag based on FIPS_CANISTER - -Signed-off-by: Ankit Jain ---- - include/linux/alloc_tag.h | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/include/linux/alloc_tag.h b/include/linux/alloc_tag.h -index 8f099e4da7fd..51258edfd953 100644 ---- a/include/linux/alloc_tag.h -+++ b/include/linux/alloc_tag.h -@@ -200,6 +200,14 @@ static inline void alloc_tag_sub(union codetag_ref *ref, size_t bytes) {} - - #endif /* CONFIG_MEM_ALLOC_PROFILING */ - -+#ifdef FIPS_CANISTER -+#define alloc_hooks_tag(_tag, _do_alloc) \ -+({ \ -+ typeof(_do_alloc) _res; \ -+ _res = _do_alloc; \ -+ _res; \ -+}) -+#else - #define alloc_hooks_tag(_tag, _do_alloc) \ - ({ \ - typeof(_do_alloc) _res; \ -@@ -212,6 +220,7 @@ static inline void alloc_tag_sub(union codetag_ref *ref, size_t bytes) {} - _res = _do_alloc; \ - _res; \ - }) -+#endif - - #define alloc_hooks(_do_alloc) \ - ({ \ --- -2.39.4 - diff --git a/SPECS/91/linux/check_for_acvp_config_applicability.inc b/SPECS/91/linux/check_for_acvp_config_applicability.inc deleted file mode 100644 index 947aa02137..0000000000 --- a/SPECS/91/linux/check_for_acvp_config_applicability.inc +++ /dev/null @@ -1,16 +0,0 @@ -echo "Check for .config applicability" - -# make doesn't support _smp_mflags -make LC_ALL= olddefconfig - -# Remove comment with a version string -sed -i '3d' .config - -# Check for known acvp diff, else return error -ignore_list="CONFIG_CRYPTO_USER_API_AKCIPHER\|CONFIG_CRYPTO_USER_API_KPP\|CONFIG_CRYPTO_USER_API_ECC" -diff -u .config.old .config -I "$ignore_list" - -# Apply config changes for ACVP Build -./scripts/kconfig/merge_config.sh .config .config_acvp -./scripts/kconfig/merge_config.sh -s -m .config .config_acvp -sed -i '3d' .config diff --git a/SPECS/91/linux/check_kernel_struct_in_canister.inc b/SPECS/91/linux/check_kernel_struct_in_canister.inc deleted file mode 100644 index 9e6480659a..0000000000 --- a/SPECS/91/linux/check_kernel_struct_in_canister.inc +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -file_name="objs" -awk -i inplace '!seen[$0]++' "$file_name" -name_lock="" -name_tsk="" -ret=0 -while read crypto_obj; do - touch ${crypto_obj}-struct - gdb crypto/${crypto_obj} -q -ex="set pagination off" -ex="info types" -ex q | tail -n +2 > ${crypto_obj}-types - while read line; do - if [[ $line =~ ^[0-9]*:[[:space:]]*.*struct|union ]]; then - echo $line | awk '{print "struct "$NF}' | sed -r 's/;+$//' >> ${crypto_obj}-struct - fi - done <${crypto_obj}-types - count=$(cat ${crypto_obj}-struct | wc -l) - echo "List of strctures in ${crypto_obj} is ${count}" - str=$(awk /task_struct/ ${crypto_obj}-struct) - if [ ! -z "$str" ]; then - name_tsk="${name_tsk} ${crypto_obj}" - fi - str=$(awk /spinlock\|mutex/ ${crypto_obj}-struct) - if [ ! -z "$str" ]; then - name_lock="${name_lock} ${crypto_obj}" - fi - rm -f ${crypto_obj}-types - rm -f ${crypto_obj}-struct -done<${file_name} -if [ ! -z "$name_tsk" ]; then - echo "$name_tsk contains task_struct!!!!" - ret=1 -fi -if [ ! -z "$name_lock" ]; then - echo "$name_lock contains spinlock or mutex!!!!" - ret=1 -fi -exit $ret diff --git a/SPECS/91/linux/confdata-format-change-for-split-script.patch b/SPECS/91/linux/confdata-format-change-for-split-script.patch deleted file mode 100644 index b6cb2bcb40..0000000000 --- a/SPECS/91/linux/confdata-format-change-for-split-script.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 01097db6bcd6ec1a850d61fc27941c6c0b0956da Mon Sep 17 00:00:00 2001 -From: Bo Gan -Date: Thu, 15 Dec 2022 11:26:04 +0000 -Subject: [PATCH] confdata: format change for split script - ---- - scripts/kconfig/confdata.c | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c -index 76193ce5a792..7d004a477b63 100644 ---- a/scripts/kconfig/confdata.c -+++ b/scripts/kconfig/confdata.c -@@ -524,7 +524,7 @@ struct comment_style { - }; - - static const struct comment_style comment_style_pound = { -- .decoration = "#", -+ .decoration = "###", - .prefix = "#", - .postfix = "#", - }; -@@ -840,9 +840,8 @@ int conf_write(const char *name) - goto next; - str = menu_get_prompt(menu); - fprintf(out, "\n" -- "#\n" -- "# %s\n" -- "#\n", str); -+ "#%s %s\n", menu->prompt->type == P_MENU ? -+ "" : "#", str); - need_newline = false; - } else if (!sym_is_choice(sym) && - !(sym->flags & SYMBOL_WRITTEN)) { --- -2.35.6 - diff --git a/SPECS/91/linux/config-esx_aarch64 b/SPECS/91/linux/config-esx_aarch64 deleted file mode 100644 index 41000094ee..0000000000 --- a/SPECS/91/linux/config-esx_aarch64 +++ /dev/null @@ -1,4638 +0,0 @@ -# -### Automatically generated file; DO NOT EDIT. -# -CONFIG_CC_VERSION_TEXT="gcc (GCC) 12.2.0" -CONFIG_CC_IS_GCC=y -CONFIG_GCC_VERSION=120200 -CONFIG_CLANG_VERSION=0 -CONFIG_AS_IS_GNU=y -CONFIG_AS_VERSION=23900 -CONFIG_LD_IS_BFD=y -CONFIG_LD_VERSION=23900 -CONFIG_LLD_VERSION=0 -CONFIG_RUSTC_VERSION=0 -CONFIG_RUSTC_LLVM_VERSION=0 -CONFIG_CC_CAN_LINK=y -CONFIG_CC_CAN_LINK_STATIC=y -CONFIG_GCC_ASM_GOTO_OUTPUT_BROKEN=y -CONFIG_CC_HAS_ASM_INLINE=y -CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y -CONFIG_LD_CAN_USE_KEEP_IN_OVERLAY=y -CONFIG_PAHOLE_VERSION=124 -CONFIG_IRQ_WORK=y -CONFIG_BUILDTIME_TABLE_SORT=y -CONFIG_THREAD_INFO_IN_TASK=y - -# General setup -CONFIG_INIT_ENV_ARG_LIMIT=32 -# CONFIG_COMPILE_TEST is not set -# CONFIG_WERROR is not set -CONFIG_LOCALVERSION="-esx" -# CONFIG_LOCALVERSION_AUTO is not set -CONFIG_BUILD_SALT="" -CONFIG_DEFAULT_INIT="" -CONFIG_DEFAULT_HOSTNAME="" -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -CONFIG_SYSVIPC_COMPAT=y -CONFIG_POSIX_MQUEUE=y -CONFIG_POSIX_MQUEUE_SYSCTL=y -# CONFIG_WATCH_QUEUE is not set -CONFIG_CROSS_MEMORY_ATTACH=y -# CONFIG_USELIB is not set -CONFIG_AUDIT=y -CONFIG_HAVE_ARCH_AUDITSYSCALL=y -CONFIG_AUDITSYSCALL=y - -# IRQ subsystem -CONFIG_GENERIC_IRQ_PROBE=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y -CONFIG_GENERIC_IRQ_MIGRATION=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_GENERIC_IRQ_IPI=y -CONFIG_GENERIC_MSI_IRQ=y -CONFIG_IRQ_MSI_IOMMU=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_SPARSE_IRQ=y -# CONFIG_GENERIC_IRQ_DEBUGFS is not set -CONFIG_GENERIC_IRQ_KEXEC_CLEAR_VM_FORWARD=y -# end of IRQ subsystem - -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_ARCH_HAS_TICK_BROADCAST=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y -CONFIG_HAVE_POSIX_CPU_TIMERS_TASK_WORK=y -CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y -CONFIG_CONTEXT_TRACKING=y -CONFIG_CONTEXT_TRACKING_IDLE=y - -# Timers subsystem -CONFIG_TICK_ONESHOT=y -CONFIG_NO_HZ_COMMON=y -# CONFIG_HZ_PERIODIC is not set -CONFIG_NO_HZ_IDLE=y -# CONFIG_NO_HZ_FULL is not set -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y -# end of Timers subsystem - -CONFIG_BPF=y -CONFIG_HAVE_EBPF_JIT=y -CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y - -# BPF subsystem -CONFIG_BPF_SYSCALL=y -CONFIG_BPF_JIT=y -# CONFIG_BPF_JIT_ALWAYS_ON is not set -CONFIG_BPF_JIT_DEFAULT_ON=y -CONFIG_BPF_UNPRIV_DEFAULT_OFF=y -# CONFIG_BPF_PRELOAD is not set -# end of BPF subsystem - -CONFIG_PREEMPT_NONE_BUILD=y -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -# CONFIG_PREEMPT_RT is not set -# CONFIG_PREEMPT_DYNAMIC is not set -# CONFIG_SCHED_CORE is not set - -# CPU/Task time and stats accounting -CONFIG_TICK_CPU_ACCOUNTING=y -# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set -# CONFIG_IRQ_TIME_ACCOUNTING is not set -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_BSD_PROCESS_ACCT_V3=y -CONFIG_TASKSTATS=y -CONFIG_TASK_DELAY_ACCT=y -CONFIG_TASK_XACCT=y -CONFIG_TASK_IO_ACCOUNTING=y -# CONFIG_PSI is not set -# end of CPU/Task time and stats accounting - -CONFIG_CPU_ISOLATION=y - -# RCU Subsystem -CONFIG_TREE_RCU=y -# CONFIG_RCU_EXPERT is not set -CONFIG_TREE_SRCU=y -CONFIG_TASKS_RCU_GENERIC=y -CONFIG_NEED_TASKS_RCU=y -CONFIG_TASKS_TRACE_RCU=y -CONFIG_RCU_STALL_COMMON=y -CONFIG_RCU_NEED_SEGCBLIST=y -# end of RCU Subsystem - -# CONFIG_IKCONFIG is not set -# CONFIG_IKHEADERS is not set -CONFIG_LOG_BUF_SHIFT=18 -CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 -CONFIG_PRINTK_INDEX=y -CONFIG_GENERIC_SCHED_CLOCK=y - -# Scheduler features -# end of Scheduler features - -CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y -CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y -CONFIG_CC_HAS_INT128=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_GCC10_NO_ARRAY_BOUNDS=y -CONFIG_CC_NO_ARRAY_BOUNDS=y -CONFIG_GCC_NO_STRINGOP_OVERFLOW=y -CONFIG_CC_NO_STRINGOP_OVERFLOW=y -CONFIG_ARCH_SUPPORTS_INT128=y -CONFIG_SLAB_OBJ_EXT=y -CONFIG_CGROUPS=y -CONFIG_PAGE_COUNTER=y -# CONFIG_CGROUP_FAVOR_DYNMODS is not set -CONFIG_MEMCG=y -CONFIG_MEMCG_V1=y -CONFIG_BLK_CGROUP=y -CONFIG_CGROUP_WRITEBACK=y -CONFIG_CGROUP_SCHED=y -CONFIG_GROUP_SCHED_WEIGHT=y -CONFIG_FAIR_GROUP_SCHED=y -CONFIG_CFS_BANDWIDTH=y -# CONFIG_RT_GROUP_SCHED is not set -CONFIG_SCHED_MM_CID=y -CONFIG_CGROUP_PIDS=y -CONFIG_CGROUP_RDMA=y -CONFIG_CGROUP_FREEZER=y -CONFIG_CGROUP_HUGETLB=y -CONFIG_CPUSETS=y -CONFIG_CPUSETS_V1=y -CONFIG_PROC_PID_CPUSET=y -CONFIG_CGROUP_DEVICE=y -CONFIG_CGROUP_CPUACCT=y -CONFIG_CGROUP_PERF=y -CONFIG_CGROUP_BPF=y -CONFIG_CGROUP_MISC=y -# CONFIG_CGROUP_DEBUG is not set -CONFIG_SOCK_CGROUP_DATA=y -CONFIG_NAMESPACES=y -CONFIG_UTS_NS=y -CONFIG_TIME_NS=y -CONFIG_IPC_NS=y -CONFIG_USER_NS=y -CONFIG_PID_NS=y -CONFIG_NET_NS=y -# CONFIG_CHECKPOINT_RESTORE is not set -# CONFIG_SCHED_AUTOGROUP is not set -CONFIG_RELAY=y -CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_RD_GZIP=y -CONFIG_RD_BZIP2=y -CONFIG_RD_LZMA=y -CONFIG_RD_XZ=y -CONFIG_RD_LZO=y -CONFIG_RD_LZ4=y -CONFIG_RD_ZSTD=y -# CONFIG_BOOT_CONFIG is not set -# CONFIG_INITRAMFS_PRESERVE_MTIME is not set -CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_LD_ORPHAN_WARN=y -CONFIG_LD_ORPHAN_WARN_LEVEL="warn" -CONFIG_SYSCTL=y -CONFIG_HAVE_UID16=y -CONFIG_SYSCTL_EXCEPTION_TRACE=y -CONFIG_EXPERT=y -CONFIG_UID16=y -CONFIG_MULTIUSER=y -CONFIG_SGETMASK_SYSCALL=y -CONFIG_SYSFS_SYSCALL=y -CONFIG_FHANDLE=y -CONFIG_POSIX_TIMERS=y -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -# CONFIG_BASE_SMALL is not set -CONFIG_FUTEX=y -CONFIG_FUTEX_PI=y -CONFIG_EPOLL=y -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -CONFIG_SHMEM=y -CONFIG_AIO=y -CONFIG_IO_URING=y -CONFIG_ADVISE_SYSCALLS=y -CONFIG_MEMBARRIER=y -CONFIG_KCMP=y -CONFIG_RSEQ=y -# CONFIG_DEBUG_RSEQ is not set -CONFIG_CACHESTAT_SYSCALL=y -# CONFIG_PC104 is not set -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_SELFTEST is not set -# CONFIG_KALLSYMS_ALL is not set -CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y -CONFIG_HAVE_PERF_EVENTS=y - -# Kernel Performance Events And Counters -CONFIG_PERF_EVENTS=y -# CONFIG_DEBUG_PERF_USE_VMALLOC is not set -# end of Kernel Performance Events And Counters - -CONFIG_SYSTEM_DATA_VERIFICATION=y -# CONFIG_PROFILING is not set - -# Kexec and crash features -# CONFIG_KEXEC_FILE is not set -# end of Kexec and crash features -# end of General setup - -CONFIG_ARM64=y -CONFIG_RUSTC_SUPPORTS_ARM64=y -CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y -CONFIG_64BIT=y -CONFIG_MMU=y -CONFIG_ARM64_CONT_PTE_SHIFT=4 -CONFIG_ARM64_CONT_PMD_SHIFT=4 -CONFIG_ARCH_MMAP_RND_BITS_MIN=18 -CONFIG_ARCH_MMAP_RND_BITS_MAX=33 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CSUM=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_SMP=y -CONFIG_KERNEL_MODE_NEON=y -CONFIG_FIX_EARLYCON_MEM=y -CONFIG_PGTABLE_LEVELS=4 -CONFIG_ARCH_SUPPORTS_UPROBES=y -CONFIG_ARCH_PROC_KCORE_TEXT=y -CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y - -# Platform selection -# CONFIG_ARCH_ACTIONS is not set -# CONFIG_ARCH_AIROHA is not set -# CONFIG_ARCH_SUNXI is not set -# CONFIG_ARCH_ALPINE is not set -# CONFIG_ARCH_APPLE is not set -# CONFIG_ARCH_BCM is not set -# CONFIG_ARCH_BERLIN is not set -# CONFIG_ARCH_BITMAIN is not set -# CONFIG_ARCH_EXYNOS is not set -# CONFIG_ARCH_SPARX5 is not set -# CONFIG_ARCH_K3 is not set -# CONFIG_ARCH_LG1K is not set -# CONFIG_ARCH_HISI is not set -# CONFIG_ARCH_KEEMBAY is not set -# CONFIG_ARCH_MEDIATEK is not set -# CONFIG_ARCH_MESON is not set -# CONFIG_ARCH_MVEBU is not set -# CONFIG_ARCH_NXP is not set -# CONFIG_ARCH_MA35 is not set -# CONFIG_ARCH_NPCM is not set -# CONFIG_ARCH_PENSANDO is not set -# CONFIG_ARCH_QCOM is not set -# CONFIG_ARCH_REALTEK is not set -# CONFIG_ARCH_RENESAS is not set -# CONFIG_ARCH_ROCKCHIP is not set -# CONFIG_ARCH_SEATTLE is not set -# CONFIG_ARCH_INTEL_SOCFPGA is not set -# CONFIG_ARCH_STM32 is not set -# CONFIG_ARCH_SYNQUACER is not set -# CONFIG_ARCH_TEGRA is not set -# CONFIG_ARCH_SPRD is not set -# CONFIG_ARCH_THUNDER is not set -# CONFIG_ARCH_THUNDER2 is not set -# CONFIG_ARCH_UNIPHIER is not set -# CONFIG_ARCH_VEXPRESS is not set -# CONFIG_ARCH_VISCONTI is not set -# CONFIG_ARCH_XGENE is not set -# CONFIG_ARCH_ZYNQMP is not set -# end of Platform selection - -# Kernel Features - -# ARM errata workarounds via the alternatives framework -CONFIG_AMPERE_ERRATUM_AC03_CPU_38=y -CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y -CONFIG_ARM64_ERRATUM_826319=y -CONFIG_ARM64_ERRATUM_827319=y -CONFIG_ARM64_ERRATUM_824069=y -CONFIG_ARM64_ERRATUM_819472=y -CONFIG_ARM64_ERRATUM_832075=y -CONFIG_ARM64_ERRATUM_1742098=y -CONFIG_ARM64_ERRATUM_845719=y -CONFIG_ARM64_ERRATUM_843419=y -CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y -CONFIG_ARM64_ERRATUM_1024718=y -CONFIG_ARM64_ERRATUM_1418040=y -CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT=y -CONFIG_ARM64_ERRATUM_1165522=y -CONFIG_ARM64_ERRATUM_1319367=y -CONFIG_ARM64_ERRATUM_1530923=y -CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y -CONFIG_ARM64_ERRATUM_2441007=y -CONFIG_ARM64_ERRATUM_1286807=y -CONFIG_ARM64_ERRATUM_1463225=y -CONFIG_ARM64_ERRATUM_1542419=y -CONFIG_ARM64_ERRATUM_1508412=y -CONFIG_ARM64_ERRATUM_2051678=y -CONFIG_ARM64_ERRATUM_2077057=y -CONFIG_ARM64_ERRATUM_2658417=y -CONFIG_ARM64_WORKAROUND_TSB_FLUSH_FAILURE=y -CONFIG_ARM64_ERRATUM_2054223=y -CONFIG_ARM64_ERRATUM_2067961=y -CONFIG_ARM64_ERRATUM_2441009=y -CONFIG_ARM64_ERRATUM_2457168=y -CONFIG_ARM64_ERRATUM_2645198=y -CONFIG_ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD=y -CONFIG_ARM64_ERRATUM_2966298=y -CONFIG_ARM64_ERRATUM_3117295=y -CONFIG_ARM64_ERRATUM_3194386=y -CONFIG_ARM64_ERRATUM_4118414=y -CONFIG_CAVIUM_ERRATUM_22375=y -# CONFIG_CAVIUM_ERRATUM_23154 is not set -CONFIG_CAVIUM_ERRATUM_27456=y -CONFIG_CAVIUM_ERRATUM_30115=y -CONFIG_CAVIUM_TX2_ERRATUM_219=y -CONFIG_FUJITSU_ERRATUM_010001=y -CONFIG_HISILICON_ERRATUM_161600802=y -CONFIG_HISILICON_ERRATUM_162100801=y -CONFIG_QCOM_FALKOR_ERRATUM_1003=y -CONFIG_QCOM_FALKOR_ERRATUM_1009=y -CONFIG_QCOM_QDF2400_ERRATUM_0065=y -CONFIG_QCOM_FALKOR_ERRATUM_E1041=y -CONFIG_NVIDIA_CARMEL_CNP_ERRATUM=y -CONFIG_ROCKCHIP_ERRATUM_3588001=y -CONFIG_SOCIONEXT_SYNQUACER_PREITS=y -# end of ARM errata workarounds via the alternatives framework - -CONFIG_ARM64_4K_PAGES=y -# CONFIG_ARM64_16K_PAGES is not set -# CONFIG_ARM64_64K_PAGES is not set -# CONFIG_ARM64_VA_BITS_39 is not set -CONFIG_ARM64_VA_BITS_48=y -# CONFIG_ARM64_VA_BITS_52 is not set -CONFIG_ARM64_VA_BITS=48 -CONFIG_ARM64_PA_BITS_48=y -CONFIG_ARM64_PA_BITS=48 -# CONFIG_CPU_BIG_ENDIAN is not set -CONFIG_CPU_LITTLE_ENDIAN=y -CONFIG_SCHED_MC=y -# CONFIG_SCHED_CLUSTER is not set -CONFIG_SCHED_SMT=y -CONFIG_NR_CPUS=128 -CONFIG_HOTPLUG_CPU=y -# CONFIG_NUMA is not set -# CONFIG_HZ_100 is not set -CONFIG_HZ_250=y -# CONFIG_HZ_300 is not set -# CONFIG_HZ_1000 is not set -CONFIG_HZ=250 -CONFIG_SCHED_HRTICK=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_HW_PERF_EVENTS=y -CONFIG_CC_HAVE_SHADOW_CALL_STACK=y -CONFIG_PARAVIRT=y -# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set -CONFIG_ARCH_SUPPORTS_KEXEC_FILE=y -CONFIG_ARCH_SUPPORTS_KEXEC_SIG=y -CONFIG_ARCH_SUPPORTS_KEXEC_IMAGE_VERIFY_SIG=y -CONFIG_ARCH_DEFAULT_KEXEC_IMAGE_VERIFY_SIG=y -CONFIG_ARCH_SUPPORTS_CRASH_DUMP=y -CONFIG_ARCH_DEFAULT_CRASH_DUMP=y -CONFIG_HYPERVISOR_GUEST=y -# CONFIG_XEN is not set -CONFIG_ARCH_FORCE_MAX_ORDER=10 -CONFIG_UNMAP_KERNEL_AT_EL0=y -CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY=y -CONFIG_RODATA_FULL_DEFAULT_ENABLED=y -# CONFIG_ARM64_SW_TTBR0_PAN is not set -CONFIG_ARM64_TAGGED_ADDR_ABI=y -CONFIG_COMPAT=y -CONFIG_KUSER_HELPERS=y -# CONFIG_COMPAT_ALIGNMENT_FIXUPS is not set -CONFIG_ARMV8_DEPRECATED=y -CONFIG_SWP_EMULATION=y -CONFIG_CP15_BARRIER_EMULATION=y -CONFIG_SETEND_EMULATION=y - -# ARMv8.1 architectural features -CONFIG_ARM64_HW_AFDBM=y -CONFIG_ARM64_PAN=y -CONFIG_AS_HAS_LSE_ATOMICS=y -CONFIG_ARM64_LSE_ATOMICS=y -CONFIG_ARM64_USE_LSE_ATOMICS=y -# end of ARMv8.1 architectural features - -# ARMv8.2 architectural features -CONFIG_AS_HAS_ARMV8_2=y -CONFIG_AS_HAS_SHA3=y -CONFIG_ARM64_PMEM=y -CONFIG_ARM64_RAS_EXTN=y -CONFIG_ARM64_CNP=y -# end of ARMv8.2 architectural features - -# ARMv8.3 architectural features -CONFIG_ARM64_PTR_AUTH=y -CONFIG_ARM64_PTR_AUTH_KERNEL=y -CONFIG_CC_HAS_BRANCH_PROT_PAC_RET=y -CONFIG_CC_HAS_SIGN_RETURN_ADDRESS=y -CONFIG_AS_HAS_ARMV8_3=y -CONFIG_AS_HAS_CFI_NEGATE_RA_STATE=y -CONFIG_AS_HAS_LDAPR=y -# end of ARMv8.3 architectural features - -# ARMv8.4 architectural features -CONFIG_ARM64_AMU_EXTN=y -CONFIG_AS_HAS_ARMV8_4=y -CONFIG_ARM64_TLB_RANGE=y -# end of ARMv8.4 architectural features - -# ARMv8.5 architectural features -CONFIG_AS_HAS_ARMV8_5=y -CONFIG_ARM64_BTI=y -CONFIG_CC_HAS_BRANCH_PROT_PAC_RET_BTI=y -CONFIG_ARM64_E0PD=y -CONFIG_ARM64_AS_HAS_MTE=y -CONFIG_ARM64_MTE=y -# end of ARMv8.5 architectural features - -# ARMv8.7 architectural features -CONFIG_ARM64_EPAN=y -# end of ARMv8.7 architectural features - -# ARMv8.9 architectural features -CONFIG_ARM64_POE=y -CONFIG_ARCH_PKEY_BITS=3 -# end of ARMv8.9 architectural features - -CONFIG_ARM64_SVE=y -CONFIG_ARM64_PSEUDO_NMI=y -# CONFIG_ARM64_DEBUG_PRIORITY_MASKING is not set -CONFIG_RELOCATABLE=y -CONFIG_RANDOMIZE_BASE=y -CONFIG_RANDOMIZE_MODULE_REGION_FULL=y -CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_STACKPROTECTOR_PER_TASK=y -CONFIG_ARM64_CONTPTE=y -# end of Kernel Features - -# Boot options -CONFIG_ARM64_ACPI_PARKING_PROTOCOL=y -CONFIG_CMDLINE="" -CONFIG_EFI_STUB=y -CONFIG_EFI=y -# CONFIG_COMPRESSED_INSTALL is not set -CONFIG_DMI=y -# end of Boot options - -# Power management options -# CONFIG_SUSPEND is not set -# CONFIG_HIBERNATION is not set -# CONFIG_PM is not set -CONFIG_CPU_PM=y -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -# end of Power management options - -# CPU Power Management - -# CPU Idle -CONFIG_CPU_IDLE=y -CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y -CONFIG_CPU_IDLE_GOV_LADDER=y -CONFIG_CPU_IDLE_GOV_MENU=y -CONFIG_CPU_IDLE_GOV_TEO=y -CONFIG_DT_IDLE_STATES=y - -# ARM CPU Idle Drivers -CONFIG_ARM_PSCI_CPUIDLE=y -# end of ARM CPU Idle Drivers -# end of CPU Idle - -# CPU Frequency scaling -# CONFIG_CPU_FREQ is not set -# end of CPU Frequency scaling -# end of CPU Power Management - -CONFIG_ARCH_SUPPORTS_ACPI=y -CONFIG_ACPI=y -CONFIG_ACPI_GENERIC_GSI=y -CONFIG_ACPI_CCA_REQUIRED=y -CONFIG_ACPI_THERMAL_LIB=y -# CONFIG_ACPI_DEBUGGER is not set -CONFIG_ACPI_SPCR_TABLE=y -# CONFIG_ACPI_FPDT is not set -CONFIG_ACPI_EC_DEBUGFS=m -CONFIG_ACPI_AC=m -CONFIG_ACPI_BATTERY=m -CONFIG_ACPI_BUTTON=m -# CONFIG_ACPI_TINY_POWER_BUTTON is not set -CONFIG_ACPI_FAN=m -# CONFIG_ACPI_DOCK is not set -CONFIG_ACPI_PROCESSOR_IDLE=y -CONFIG_ACPI_MCFG=y -CONFIG_ACPI_PROCESSOR=y -CONFIG_ACPI_HOTPLUG_CPU=y -CONFIG_ACPI_THERMAL=y -CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y -CONFIG_ACPI_TABLE_UPGRADE=y -# CONFIG_ACPI_DEBUG is not set -CONFIG_ACPI_PCI_SLOT=y -CONFIG_ACPI_CONTAINER=y -CONFIG_ACPI_HED=y -# CONFIG_ACPI_BGRT is not set -CONFIG_ACPI_REDUCED_HARDWARE_ONLY=y -# CONFIG_ACPI_NFIT is not set -CONFIG_HAVE_ACPI_APEI=y -# CONFIG_ACPI_APEI is not set -# CONFIG_ACPI_CONFIGFS is not set -# CONFIG_ACPI_PFRUT is not set -CONFIG_ACPI_IORT=y -CONFIG_ACPI_GTDT=y -CONFIG_ACPI_APMT=y -CONFIG_ACPI_PPTT=y -# CONFIG_ACPI_PCC is not set -# CONFIG_ACPI_FFH is not set -CONFIG_PMIC_OPREGION=y -# CONFIG_ACPI_PRMT is not set -CONFIG_VIRTUALIZATION=y -# CONFIG_KVM is not set -CONFIG_CPU_MITIGATIONS=y - -# General architecture-dependent options -CONFIG_ARCH_HAS_SUBPAGE_FAULTS=y -CONFIG_HOTPLUG_CORE_SYNC=y -CONFIG_HOTPLUG_CORE_SYNC_DEAD=y -# CONFIG_KPROBES is not set -CONFIG_JUMP_LABEL=y -# CONFIG_STATIC_KEYS_SELFTEST is not set -CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -CONFIG_HAVE_IOREMAP_PROT=y -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y -CONFIG_HAVE_FUNCTION_ERROR_INJECTION=y -CONFIG_HAVE_NMI=y -CONFIG_TRACE_IRQFLAGS_SUPPORT=y -CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_ARCH_HAS_FORTIFY_SOURCE=y -CONFIG_ARCH_HAS_KEEPINITRD=y -CONFIG_ARCH_HAS_SET_MEMORY=y -CONFIG_ARCH_HAS_SET_DIRECT_MAP=y -CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y -CONFIG_ARCH_WANTS_NO_INSTR=y -CONFIG_HAVE_ASM_MODVERSIONS=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_RSEQ=y -CONFIG_HAVE_RUST=y -CONFIG_HAVE_FUNCTION_ARG_ACCESS_API=y -CONFIG_HAVE_HW_BREAKPOINT=y -CONFIG_HAVE_PERF_EVENTS_NMI=y -CONFIG_HAVE_HARDLOCKUP_DETECTOR_PERF=y -CONFIG_HAVE_PERF_REGS=y -CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y -CONFIG_MMU_GATHER_TABLE_FREE=y -CONFIG_MMU_GATHER_RCU_TABLE_FREE=y -CONFIG_MMU_LAZY_TLB_REFCOUNT=y -CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y -CONFIG_ARCH_HAS_NMI_SAFE_THIS_CPU_OPS=y -CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y -CONFIG_HAVE_CMPXCHG_LOCAL=y -CONFIG_HAVE_CMPXCHG_DOUBLE=y -CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y -CONFIG_HAVE_ARCH_SECCOMP=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_SECCOMP=y -CONFIG_SECCOMP_FILTER=y -# CONFIG_SECCOMP_CACHE_DEBUG is not set -CONFIG_HAVE_ARCH_STACKLEAK=y -CONFIG_HAVE_STACKPROTECTOR=y -CONFIG_STACKPROTECTOR=y -# CONFIG_STACKPROTECTOR_STRONG is not set -CONFIG_ARCH_SUPPORTS_SHADOW_CALL_STACK=y -# CONFIG_SHADOW_CALL_STACK is not set -CONFIG_ARCH_SUPPORTS_LTO_CLANG=y -CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN=y -CONFIG_LTO_NONE=y -CONFIG_ARCH_SUPPORTS_CFI_CLANG=y -CONFIG_HAVE_CONTEXT_TRACKING_USER=y -CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_MOVE_PUD=y -CONFIG_HAVE_MOVE_PMD=y -CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y -CONFIG_HAVE_ARCH_HUGE_VMAP=y -CONFIG_HAVE_ARCH_HUGE_VMALLOC=y -CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y -CONFIG_ARCH_WANT_PMD_MKWRITE=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_MODULES_USE_ELF_RELA=y -CONFIG_ARCH_WANTS_EXECMEM_LATE=y -CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK=y -CONFIG_SOFTIRQ_ON_OWN_STACK=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -CONFIG_HAVE_ARCH_MMAP_RND_BITS=y -CONFIG_ARCH_MMAP_RND_BITS=18 -CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y -CONFIG_ARCH_MMAP_RND_COMPAT_BITS=11 -CONFIG_HAVE_PAGE_SIZE_4KB=y -CONFIG_PAGE_SIZE_4KB=y -CONFIG_PAGE_SIZE_LESS_THAN_64KB=y -CONFIG_PAGE_SIZE_LESS_THAN_256KB=y -CONFIG_PAGE_SHIFT=12 -CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_OLD_SIGSUSPEND3=y -CONFIG_COMPAT_OLD_SIGACTION=y -CONFIG_COMPAT_32BIT_TIME=y -CONFIG_ARCH_SUPPORTS_RT=y -CONFIG_HAVE_ARCH_VMAP_STACK=y -CONFIG_VMAP_STACK=y -CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET=y -CONFIG_RANDOMIZE_KSTACK_OFFSET=y -# CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT is not set -CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y -CONFIG_STRICT_KERNEL_RWX=y -CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y -CONFIG_STRICT_MODULE_RWX=y -CONFIG_HAVE_ARCH_COMPILER_H=y -CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y -CONFIG_ARCH_USE_MEMREMAP_PROT=y -# CONFIG_LOCK_EVENT_COUNTS is not set -CONFIG_ARCH_HAS_RELR=y -CONFIG_ARCH_HAS_MEM_ENCRYPT=y -CONFIG_HAVE_PREEMPT_DYNAMIC=y -CONFIG_HAVE_PREEMPT_DYNAMIC_KEY=y -CONFIG_ARCH_WANT_LD_ORPHAN_WARN=y -CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y -CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK=y -CONFIG_ARCH_HAVE_TRACE_MMIO_ACCESS=y -CONFIG_ARCH_HAS_HW_PTE_YOUNG=y -CONFIG_ARCH_HAS_KERNEL_FPU_SUPPORT=y - -# GCOV-based kernel profiling -# CONFIG_GCOV_KERNEL is not set -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -# end of GCOV-based kernel profiling - -CONFIG_HAVE_GCC_PLUGINS=y -CONFIG_GCC_PLUGINS=y -# CONFIG_GCC_PLUGIN_LATENT_ENTROPY is not set -CONFIG_FUNCTION_ALIGNMENT_4B=y -CONFIG_FUNCTION_ALIGNMENT=4 -CONFIG_HAVE_ARCH_GET_SECUREBOOT=y -# end of General architecture-dependent options - -CONFIG_RT_MUTEXES=y -CONFIG_MODULE_SIG_FORMAT=y -CONFIG_MODULES=y -# CONFIG_MODULE_DEBUG is not set -# CONFIG_MODULE_FORCE_LOAD is not set -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -# CONFIG_MODULE_UNLOAD_TAINT_TRACKING is not set -# CONFIG_MODVERSIONS is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -CONFIG_MODULE_SIG=y -# CONFIG_MODULE_SIG_FORCE is not set -# CONFIG_MODULE_SIG_ALL is not set -# CONFIG_MODULE_SIG_SHA1 is not set -# CONFIG_MODULE_SIG_SHA256 is not set -# CONFIG_MODULE_SIG_SHA384 is not set -# CONFIG_MODULE_SIG_SHA512 is not set -# CONFIG_MODULE_SIG_SHA3_256 is not set -# CONFIG_MODULE_SIG_SHA3_384 is not set -CONFIG_MODULE_SIG_SHA3_512=y -CONFIG_MODULE_SIG_HASH="sha3-512" -# CONFIG_MODULE_COMPRESS is not set -# CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is not set -CONFIG_MODPROBE_PATH="/sbin/modprobe" -# CONFIG_TRIM_UNUSED_KSYMS is not set -CONFIG_MODULES_TREE_LOOKUP=y -CONFIG_BLOCK=y -CONFIG_BLOCK_LEGACY_AUTOLOAD=y -CONFIG_BLK_CGROUP_RWSTAT=y -CONFIG_BLK_CGROUP_PUNT_BIO=y -CONFIG_BLK_DEV_BSG_COMMON=y -CONFIG_BLK_DEV_BSGLIB=y -# CONFIG_BLK_DEV_INTEGRITY is not set -CONFIG_BLK_DEV_WRITE_MOUNTED=y -# CONFIG_BLK_DEV_ZONED is not set -CONFIG_BLK_DEV_THROTTLING=y -# CONFIG_BLK_WBT is not set -# CONFIG_BLK_CGROUP_IOLATENCY is not set -# CONFIG_BLK_CGROUP_IOCOST is not set -# CONFIG_BLK_CGROUP_IOPRIO is not set -CONFIG_BLK_DEBUG_FS=y -# CONFIG_BLK_SED_OPAL is not set -# CONFIG_BLK_INLINE_ENCRYPTION is not set - -# Partition Types -CONFIG_PARTITION_ADVANCED=y -# CONFIG_ACORN_PARTITION is not set -# CONFIG_AIX_PARTITION is not set -# CONFIG_OSF_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set -# CONFIG_ATARI_PARTITION is not set -# CONFIG_MAC_PARTITION is not set -CONFIG_MSDOS_PARTITION=y -# CONFIG_BSD_DISKLABEL is not set -# CONFIG_MINIX_SUBPARTITION is not set -# CONFIG_SOLARIS_X86_PARTITION is not set -# CONFIG_UNIXWARE_DISKLABEL is not set -# CONFIG_LDM_PARTITION is not set -# CONFIG_SGI_PARTITION is not set -# CONFIG_ULTRIX_PARTITION is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_KARMA_PARTITION is not set -CONFIG_EFI_PARTITION=y -# CONFIG_SYSV68_PARTITION is not set -# CONFIG_CMDLINE_PARTITION is not set -# end of Partition Types - -CONFIG_BLK_MQ_PCI=y -CONFIG_BLOCK_HOLDER_DEPRECATED=y -CONFIG_BLK_MQ_STACKING=y - -# IO Schedulers -# CONFIG_MQ_IOSCHED_DEADLINE is not set -# CONFIG_MQ_IOSCHED_KYBER is not set -# CONFIG_IOSCHED_BFQ is not set -# end of IO Schedulers - -CONFIG_PADATA=y -CONFIG_ASN1=y -CONFIG_ARCH_INLINE_SPIN_TRYLOCK=y -CONFIG_ARCH_INLINE_SPIN_TRYLOCK_BH=y -CONFIG_ARCH_INLINE_SPIN_LOCK=y -CONFIG_ARCH_INLINE_SPIN_LOCK_BH=y -CONFIG_ARCH_INLINE_SPIN_LOCK_IRQ=y -CONFIG_ARCH_INLINE_SPIN_LOCK_IRQSAVE=y -CONFIG_ARCH_INLINE_SPIN_UNLOCK=y -CONFIG_ARCH_INLINE_SPIN_UNLOCK_BH=y -CONFIG_ARCH_INLINE_SPIN_UNLOCK_IRQ=y -CONFIG_ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE=y -CONFIG_ARCH_INLINE_READ_LOCK=y -CONFIG_ARCH_INLINE_READ_LOCK_BH=y -CONFIG_ARCH_INLINE_READ_LOCK_IRQ=y -CONFIG_ARCH_INLINE_READ_LOCK_IRQSAVE=y -CONFIG_ARCH_INLINE_READ_UNLOCK=y -CONFIG_ARCH_INLINE_READ_UNLOCK_BH=y -CONFIG_ARCH_INLINE_READ_UNLOCK_IRQ=y -CONFIG_ARCH_INLINE_READ_UNLOCK_IRQRESTORE=y -CONFIG_ARCH_INLINE_WRITE_LOCK=y -CONFIG_ARCH_INLINE_WRITE_LOCK_BH=y -CONFIG_ARCH_INLINE_WRITE_LOCK_IRQ=y -CONFIG_ARCH_INLINE_WRITE_LOCK_IRQSAVE=y -CONFIG_ARCH_INLINE_WRITE_UNLOCK=y -CONFIG_ARCH_INLINE_WRITE_UNLOCK_BH=y -CONFIG_ARCH_INLINE_WRITE_UNLOCK_IRQ=y -CONFIG_ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE=y -CONFIG_INLINE_SPIN_TRYLOCK=y -CONFIG_INLINE_SPIN_TRYLOCK_BH=y -CONFIG_INLINE_SPIN_LOCK=y -CONFIG_INLINE_SPIN_LOCK_BH=y -CONFIG_INLINE_SPIN_LOCK_IRQ=y -CONFIG_INLINE_SPIN_LOCK_IRQSAVE=y -CONFIG_INLINE_SPIN_UNLOCK_BH=y -CONFIG_INLINE_SPIN_UNLOCK_IRQ=y -CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE=y -CONFIG_INLINE_READ_LOCK=y -CONFIG_INLINE_READ_LOCK_BH=y -CONFIG_INLINE_READ_LOCK_IRQ=y -CONFIG_INLINE_READ_LOCK_IRQSAVE=y -CONFIG_INLINE_READ_UNLOCK=y -CONFIG_INLINE_READ_UNLOCK_BH=y -CONFIG_INLINE_READ_UNLOCK_IRQ=y -CONFIG_INLINE_READ_UNLOCK_IRQRESTORE=y -CONFIG_INLINE_WRITE_LOCK=y -CONFIG_INLINE_WRITE_LOCK_BH=y -CONFIG_INLINE_WRITE_LOCK_IRQ=y -CONFIG_INLINE_WRITE_LOCK_IRQSAVE=y -CONFIG_INLINE_WRITE_UNLOCK=y -CONFIG_INLINE_WRITE_UNLOCK_BH=y -CONFIG_INLINE_WRITE_UNLOCK_IRQ=y -CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE=y -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -CONFIG_MUTEX_SPIN_ON_OWNER=y -CONFIG_RWSEM_SPIN_ON_OWNER=y -CONFIG_LOCK_SPIN_ON_OWNER=y -CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y -CONFIG_QUEUED_SPINLOCKS=y -CONFIG_ARCH_USE_QUEUED_RWLOCKS=y -CONFIG_QUEUED_RWLOCKS=y -CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE=y -CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y -CONFIG_FREEZER=y - -# Executable file formats -CONFIG_BINFMT_ELF=y -CONFIG_COMPAT_BINFMT_ELF=y -CONFIG_ARCH_BINFMT_ELF_STATE=y -CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y -CONFIG_ARCH_HAVE_ELF_PROT=y -CONFIG_ARCH_USE_GNU_PROPERTY=y -CONFIG_ELFCORE=y -CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y -CONFIG_BINFMT_SCRIPT=y -CONFIG_BINFMT_MISC=m -CONFIG_COREDUMP=y -# end of Executable file formats - -# Memory Management options -CONFIG_SWAP=y -# CONFIG_ZSWAP is not set - -# Slab allocator options -CONFIG_SLUB=y -# CONFIG_SLUB_TINY is not set -CONFIG_SLAB_MERGE_DEFAULT=y -# CONFIG_SLAB_FREELIST_RANDOM is not set -# CONFIG_SLAB_FREELIST_HARDENED is not set -# CONFIG_SLAB_BUCKETS is not set -# CONFIG_SLUB_STATS is not set -CONFIG_SLUB_CPU_PARTIAL=y -# CONFIG_RANDOM_KMALLOC_CACHES is not set -# end of Slab allocator options - -# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set -# CONFIG_COMPAT_BRK is not set -CONFIG_SPARSEMEM=y -CONFIG_SPARSEMEM_EXTREME=y -CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y -CONFIG_SPARSEMEM_VMEMMAP=y -CONFIG_HAVE_GUP_FAST=y -CONFIG_ARCH_KEEP_MEMBLOCK=y -CONFIG_EXCLUSIVE_SYSTEM_RAM=y -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y -CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y -# CONFIG_MEMORY_HOTPLUG is not set -CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y -CONFIG_SPLIT_PTE_PTLOCKS=y -CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y -CONFIG_SPLIT_PMD_PTLOCKS=y -CONFIG_MEMORY_BALLOON=y -CONFIG_BALLOON_COMPACTION=y -CONFIG_COMPACTION=y -CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 -# CONFIG_PAGE_REPORTING is not set -CONFIG_MIGRATION=y -CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y -CONFIG_ARCH_ENABLE_THP_MIGRATION=y -CONFIG_PCP_BATCH_SCALE_MAX=5 -CONFIG_PHYS_ADDR_T_64BIT=y -CONFIG_KSM=y -CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 -CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y -# CONFIG_MEMORY_FAILURE is not set -CONFIG_ARCH_WANTS_THP_SWAP=y -CONFIG_TRANSPARENT_HUGEPAGE=y -CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y -# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set -# CONFIG_TRANSPARENT_HUGEPAGE_NEVER is not set -CONFIG_THP_SWAP=y -# CONFIG_READ_ONLY_THP_FOR_FS is not set -CONFIG_PGTABLE_HAS_HUGE_LEAVES=y -CONFIG_ARCH_SUPPORTS_HUGE_PFNMAP=y -CONFIG_ARCH_SUPPORTS_PMD_PFNMAP=y -# CONFIG_CMA is not set -CONFIG_GENERIC_EARLY_IOREMAP=y -# CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set -CONFIG_PAGE_IDLE_FLAG=y -CONFIG_IDLE_PAGE_TRACKING=y -CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y -CONFIG_ARCH_HAS_CURRENT_STACK_POINTER=y -CONFIG_ARCH_HAS_PTE_DEVMAP=y -CONFIG_ARCH_HAS_ZONE_DMA_SET=y -CONFIG_ZONE_DMA=y -CONFIG_ZONE_DMA32=y -CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y -CONFIG_ARCH_HAS_PKEYS=y -CONFIG_ARCH_USES_PG_ARCH_2=y -CONFIG_ARCH_USES_PG_ARCH_3=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_PERCPU_STATS=y -# CONFIG_GUP_TEST is not set -# CONFIG_DMAPOOL_TEST is not set -CONFIG_ARCH_HAS_PTE_SPECIAL=y -CONFIG_MAPPING_DIRTY_HELPERS=y -CONFIG_MEMFD_CREATE=y -CONFIG_SECRETMEM=y -# CONFIG_ANON_VMA_NAME is not set -# CONFIG_USERFAULTFD is not set -# CONFIG_LRU_GEN is not set -CONFIG_ARCH_SUPPORTS_PER_VMA_LOCK=y -CONFIG_PER_VMA_LOCK=y -CONFIG_LOCK_MM_AND_FIND_VMA=y -CONFIG_EXECMEM=y - -# Data Access Monitoring -# CONFIG_DAMON is not set -# end of Data Access Monitoring -# end of Memory Management options - -CONFIG_NET=y -CONFIG_NET_INGRESS=y -CONFIG_NET_EGRESS=y -CONFIG_NET_XGRESS=y -CONFIG_SKB_DECRYPTED=y -CONFIG_SKB_EXTENSIONS=y -CONFIG_NET_DEVMEM=y - -# Networking options -CONFIG_PACKET=m -CONFIG_PACKET_DIAG=m -CONFIG_UNIX=y -CONFIG_AF_UNIX_OOB=y -CONFIG_UNIX_DIAG=m -CONFIG_TLS=m -CONFIG_TLS_DEVICE=y -CONFIG_TLS_TOE=y -CONFIG_XFRM=y -CONFIG_XFRM_ALGO=m -CONFIG_XFRM_USER=m -# CONFIG_XFRM_INTERFACE is not set -CONFIG_XFRM_SUB_POLICY=y -CONFIG_XFRM_MIGRATE=y -CONFIG_XFRM_STATISTICS=y -CONFIG_XFRM_AH=m -CONFIG_XFRM_ESP=m -CONFIG_XFRM_IPCOMP=m -CONFIG_NET_KEY=m -CONFIG_NET_KEY_MIGRATE=y -# CONFIG_XDP_SOCKETS is not set -CONFIG_NET_HANDSHAKE=y -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -CONFIG_IP_ADVANCED_ROUTER=y -CONFIG_IP_FIB_TRIE_STATS=y -CONFIG_IP_MULTIPLE_TABLES=y -CONFIG_IP_ROUTE_MULTIPATH=y -CONFIG_IP_ROUTE_VERBOSE=y -CONFIG_IP_ROUTE_CLASSID=y -# CONFIG_IP_PNP is not set -CONFIG_NET_IPIP=m -CONFIG_NET_IPGRE_DEMUX=m -CONFIG_NET_IP_TUNNEL=m -CONFIG_NET_IPGRE=m -CONFIG_NET_IPGRE_BROADCAST=y -# CONFIG_IP_MROUTE is not set -CONFIG_SYN_COOKIES=y -CONFIG_NET_IPVTI=m -CONFIG_NET_UDP_TUNNEL=m -CONFIG_NET_FOU=m -CONFIG_NET_FOU_IP_TUNNELS=y -CONFIG_INET_AH=m -CONFIG_INET_ESP=m -# CONFIG_INET_ESP_OFFLOAD is not set -# CONFIG_INET_ESPINTCP is not set -CONFIG_INET_IPCOMP=m -CONFIG_INET_TABLE_PERTURB_ORDER=16 -CONFIG_INET_XFRM_TUNNEL=m -CONFIG_INET_TUNNEL=m -CONFIG_INET_DIAG=m -CONFIG_INET_TCP_DIAG=m -CONFIG_INET_UDP_DIAG=m -# CONFIG_INET_RAW_DIAG is not set -# CONFIG_INET_DIAG_DESTROY is not set -CONFIG_TCP_CONG_ADVANCED=y -CONFIG_TCP_CONG_BIC=m -CONFIG_TCP_CONG_CUBIC=y -# CONFIG_TCP_CONG_WESTWOOD is not set -# CONFIG_TCP_CONG_HTCP is not set -# CONFIG_TCP_CONG_HSTCP is not set -# CONFIG_TCP_CONG_HYBLA is not set -# CONFIG_TCP_CONG_VEGAS is not set -# CONFIG_TCP_CONG_NV is not set -# CONFIG_TCP_CONG_SCALABLE is not set -# CONFIG_TCP_CONG_LP is not set -# CONFIG_TCP_CONG_VENO is not set -# CONFIG_TCP_CONG_YEAH is not set -# CONFIG_TCP_CONG_ILLINOIS is not set -CONFIG_TCP_CONG_DCTCP=m -# CONFIG_TCP_CONG_CDG is not set -# CONFIG_TCP_CONG_BBR is not set -CONFIG_DEFAULT_CUBIC=y -# CONFIG_DEFAULT_RENO is not set -CONFIG_DEFAULT_TCP_CONG="cubic" -CONFIG_TCP_SIGPOOL=y -CONFIG_TCP_MD5SIG=y -CONFIG_IPV6=m -CONFIG_IPV6_ROUTER_PREF=y -CONFIG_IPV6_ROUTE_INFO=y -CONFIG_IPV6_OPTIMISTIC_DAD=y -CONFIG_INET6_AH=m -CONFIG_INET6_ESP=m -# CONFIG_INET6_ESP_OFFLOAD is not set -# CONFIG_INET6_ESPINTCP is not set -CONFIG_INET6_IPCOMP=m -CONFIG_IPV6_MIP6=m -# CONFIG_IPV6_ILA is not set -CONFIG_INET6_XFRM_TUNNEL=m -CONFIG_INET6_TUNNEL=m -CONFIG_IPV6_VTI=m -CONFIG_IPV6_SIT=m -CONFIG_IPV6_SIT_6RD=y -CONFIG_IPV6_NDISC_NODETYPE=y -CONFIG_IPV6_TUNNEL=m -CONFIG_IPV6_GRE=m -CONFIG_IPV6_FOU=m -CONFIG_IPV6_FOU_TUNNEL=m -CONFIG_IPV6_MULTIPLE_TABLES=y -CONFIG_IPV6_SUBTREES=y -# CONFIG_IPV6_MROUTE is not set -# CONFIG_IPV6_SEG6_LWTUNNEL is not set -# CONFIG_IPV6_SEG6_HMAC is not set -# CONFIG_IPV6_RPL_LWTUNNEL is not set -# CONFIG_IPV6_IOAM6_LWTUNNEL is not set -# CONFIG_NETLABEL is not set -# CONFIG_MPTCP is not set -CONFIG_NETWORK_SECMARK=y -CONFIG_NET_PTP_CLASSIFY=y -# CONFIG_NETWORK_PHY_TIMESTAMPING is not set -CONFIG_NETFILTER=y -CONFIG_NETFILTER_ADVANCED=y -CONFIG_BRIDGE_NETFILTER=m - -# Core Netfilter Configuration -CONFIG_NETFILTER_INGRESS=y -CONFIG_NETFILTER_EGRESS=y -CONFIG_NETFILTER_NETLINK=m -CONFIG_NETFILTER_FAMILY_BRIDGE=y -CONFIG_NETFILTER_FAMILY_ARP=y -CONFIG_NETFILTER_BPF_LINK=y -# CONFIG_NETFILTER_NETLINK_HOOK is not set -CONFIG_NETFILTER_NETLINK_ACCT=m -CONFIG_NETFILTER_NETLINK_QUEUE=m -CONFIG_NETFILTER_NETLINK_LOG=m -CONFIG_NETFILTER_NETLINK_OSF=m -CONFIG_NF_CONNTRACK=m -CONFIG_NF_LOG_SYSLOG=m -CONFIG_NETFILTER_CONNCOUNT=m -CONFIG_NF_CONNTRACK_MARK=y -CONFIG_NF_CONNTRACK_SECMARK=y -CONFIG_NF_CONNTRACK_ZONES=y -# CONFIG_NF_CONNTRACK_PROCFS is not set -CONFIG_NF_CONNTRACK_EVENTS=y -CONFIG_NF_CONNTRACK_TIMEOUT=y -CONFIG_NF_CONNTRACK_TIMESTAMP=y -CONFIG_NF_CONNTRACK_LABELS=y -CONFIG_NF_CONNTRACK_OVS=y -CONFIG_NF_CT_PROTO_DCCP=y -CONFIG_NF_CT_PROTO_GRE=y -CONFIG_NF_CT_PROTO_SCTP=y -CONFIG_NF_CT_PROTO_UDPLITE=y -CONFIG_NF_CONNTRACK_AMANDA=m -CONFIG_NF_CONNTRACK_FTP=m -CONFIG_NF_CONNTRACK_H323=m -CONFIG_NF_CONNTRACK_IRC=m -CONFIG_NF_CONNTRACK_BROADCAST=m -CONFIG_NF_CONNTRACK_NETBIOS_NS=m -CONFIG_NF_CONNTRACK_SNMP=m -CONFIG_NF_CONNTRACK_PPTP=m -CONFIG_NF_CONNTRACK_SANE=m -CONFIG_NF_CONNTRACK_SIP=m -CONFIG_NF_CONNTRACK_TFTP=m -CONFIG_NF_CT_NETLINK=m -CONFIG_NF_CT_NETLINK_TIMEOUT=m -# CONFIG_NETFILTER_NETLINK_GLUE_CT is not set -CONFIG_NF_NAT=m -CONFIG_NF_NAT_AMANDA=m -CONFIG_NF_NAT_FTP=m -CONFIG_NF_NAT_IRC=m -CONFIG_NF_NAT_SIP=m -CONFIG_NF_NAT_TFTP=m -CONFIG_NF_NAT_REDIRECT=y -CONFIG_NF_NAT_MASQUERADE=y -CONFIG_NF_NAT_OVS=y -CONFIG_NETFILTER_SYNPROXY=m -CONFIG_NF_TABLES=m -CONFIG_NF_TABLES_INET=y -# CONFIG_NF_TABLES_NETDEV is not set -CONFIG_NFT_NUMGEN=m -CONFIG_NFT_CT=m -# CONFIG_NFT_CONNLIMIT is not set -CONFIG_NFT_LOG=m -CONFIG_NFT_LIMIT=m -CONFIG_NFT_MASQ=m -CONFIG_NFT_REDIR=m -CONFIG_NFT_NAT=m -CONFIG_NFT_TUNNEL=m -CONFIG_NFT_QUEUE=m -CONFIG_NFT_QUOTA=m -CONFIG_NFT_REJECT=m -CONFIG_NFT_REJECT_INET=m -CONFIG_NFT_COMPAT=m -CONFIG_NFT_HASH=m -# CONFIG_NFT_XFRM is not set -# CONFIG_NFT_SOCKET is not set -# CONFIG_NFT_OSF is not set -CONFIG_NFT_TPROXY=m -# CONFIG_NFT_SYNPROXY is not set -# CONFIG_NF_FLOW_TABLE is not set -CONFIG_NETFILTER_XTABLES=y -CONFIG_NETFILTER_XTABLES_COMPAT=y - -## Xtables combined modules -CONFIG_NETFILTER_XT_MARK=m -CONFIG_NETFILTER_XT_CONNMARK=m -CONFIG_NETFILTER_XT_SET=m - -## Xtables targets -# CONFIG_NETFILTER_XT_TARGET_AUDIT is not set -CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m -CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m -CONFIG_NETFILTER_XT_TARGET_CONNMARK=m -CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m -CONFIG_NETFILTER_XT_TARGET_CT=m -CONFIG_NETFILTER_XT_TARGET_DSCP=m -CONFIG_NETFILTER_XT_TARGET_HL=m -CONFIG_NETFILTER_XT_TARGET_HMARK=m -CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m -CONFIG_NETFILTER_XT_TARGET_LOG=m -CONFIG_NETFILTER_XT_TARGET_MARK=m -CONFIG_NETFILTER_XT_NAT=m -CONFIG_NETFILTER_XT_TARGET_NETMAP=m -CONFIG_NETFILTER_XT_TARGET_NFLOG=m -CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m -CONFIG_NETFILTER_XT_TARGET_NOTRACK=m -CONFIG_NETFILTER_XT_TARGET_RATEEST=m -CONFIG_NETFILTER_XT_TARGET_REDIRECT=m -CONFIG_NETFILTER_XT_TARGET_MASQUERADE=m -CONFIG_NETFILTER_XT_TARGET_TEE=m -CONFIG_NETFILTER_XT_TARGET_TPROXY=m -CONFIG_NETFILTER_XT_TARGET_TRACE=m -CONFIG_NETFILTER_XT_TARGET_SECMARK=m -CONFIG_NETFILTER_XT_TARGET_TCPMSS=m -CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m - -## Xtables matches -CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m -CONFIG_NETFILTER_XT_MATCH_BPF=m -CONFIG_NETFILTER_XT_MATCH_CGROUP=m -CONFIG_NETFILTER_XT_MATCH_CLUSTER=m -CONFIG_NETFILTER_XT_MATCH_COMMENT=m -CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m -CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m -CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m -CONFIG_NETFILTER_XT_MATCH_CONNMARK=m -CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m -CONFIG_NETFILTER_XT_MATCH_CPU=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m -CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m -CONFIG_NETFILTER_XT_MATCH_DSCP=m -CONFIG_NETFILTER_XT_MATCH_ECN=m -CONFIG_NETFILTER_XT_MATCH_ESP=m -CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m -CONFIG_NETFILTER_XT_MATCH_HELPER=m -CONFIG_NETFILTER_XT_MATCH_HL=m -# CONFIG_NETFILTER_XT_MATCH_IPCOMP is not set -CONFIG_NETFILTER_XT_MATCH_IPRANGE=m -CONFIG_NETFILTER_XT_MATCH_IPVS=m -# CONFIG_NETFILTER_XT_MATCH_L2TP is not set -CONFIG_NETFILTER_XT_MATCH_LENGTH=m -CONFIG_NETFILTER_XT_MATCH_LIMIT=m -CONFIG_NETFILTER_XT_MATCH_MAC=m -CONFIG_NETFILTER_XT_MATCH_MARK=m -CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m -CONFIG_NETFILTER_XT_MATCH_NFACCT=m -CONFIG_NETFILTER_XT_MATCH_OSF=m -CONFIG_NETFILTER_XT_MATCH_OWNER=m -CONFIG_NETFILTER_XT_MATCH_POLICY=m -CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m -CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m -CONFIG_NETFILTER_XT_MATCH_QUOTA=m -CONFIG_NETFILTER_XT_MATCH_RATEEST=m -CONFIG_NETFILTER_XT_MATCH_REALM=m -CONFIG_NETFILTER_XT_MATCH_RECENT=m -CONFIG_NETFILTER_XT_MATCH_SCTP=m -CONFIG_NETFILTER_XT_MATCH_SOCKET=m -CONFIG_NETFILTER_XT_MATCH_STATE=m -CONFIG_NETFILTER_XT_MATCH_STATISTIC=m -CONFIG_NETFILTER_XT_MATCH_STRING=m -CONFIG_NETFILTER_XT_MATCH_TCPMSS=m -CONFIG_NETFILTER_XT_MATCH_TIME=m -CONFIG_NETFILTER_XT_MATCH_U32=m -# end of Core Netfilter Configuration - -CONFIG_IP_SET=m -CONFIG_IP_SET_MAX=256 -CONFIG_IP_SET_BITMAP_IP=m -CONFIG_IP_SET_BITMAP_IPMAC=m -CONFIG_IP_SET_BITMAP_PORT=m -CONFIG_IP_SET_HASH_IP=m -CONFIG_IP_SET_HASH_IPMARK=m -CONFIG_IP_SET_HASH_IPPORT=m -CONFIG_IP_SET_HASH_IPPORTIP=m -CONFIG_IP_SET_HASH_IPPORTNET=m -CONFIG_IP_SET_HASH_IPMAC=m -CONFIG_IP_SET_HASH_MAC=m -CONFIG_IP_SET_HASH_NETPORTNET=m -CONFIG_IP_SET_HASH_NET=m -CONFIG_IP_SET_HASH_NETNET=m -CONFIG_IP_SET_HASH_NETPORT=m -CONFIG_IP_SET_HASH_NETIFACE=m -CONFIG_IP_SET_LIST_SET=m -CONFIG_IP_VS=m -CONFIG_IP_VS_IPV6=y -# CONFIG_IP_VS_DEBUG is not set -CONFIG_IP_VS_TAB_BITS=12 - -## IPVS transport protocol load balancing support -CONFIG_IP_VS_PROTO_TCP=y -CONFIG_IP_VS_PROTO_UDP=y -# CONFIG_IP_VS_PROTO_ESP is not set -# CONFIG_IP_VS_PROTO_AH is not set -# CONFIG_IP_VS_PROTO_SCTP is not set - -## IPVS scheduler -CONFIG_IP_VS_RR=m -CONFIG_IP_VS_WRR=m -# CONFIG_IP_VS_LC is not set -# CONFIG_IP_VS_WLC is not set -# CONFIG_IP_VS_FO is not set -# CONFIG_IP_VS_OVF is not set -# CONFIG_IP_VS_LBLC is not set -# CONFIG_IP_VS_LBLCR is not set -# CONFIG_IP_VS_DH is not set -CONFIG_IP_VS_SH=m -# CONFIG_IP_VS_MH is not set -# CONFIG_IP_VS_SED is not set -# CONFIG_IP_VS_NQ is not set -# CONFIG_IP_VS_TWOS is not set - -## IPVS SH scheduler -CONFIG_IP_VS_SH_TAB_BITS=8 - -## IPVS MH scheduler -CONFIG_IP_VS_MH_TAB_INDEX=12 - -## IPVS application helper -# CONFIG_IP_VS_FTP is not set -CONFIG_IP_VS_NFCT=y -# CONFIG_IP_VS_PE_SIP is not set - -# IP: Netfilter Configuration -CONFIG_NF_DEFRAG_IPV4=m -CONFIG_IP_NF_IPTABLES_LEGACY=m -CONFIG_NF_SOCKET_IPV4=m -CONFIG_NF_TPROXY_IPV4=m -CONFIG_NF_TABLES_IPV4=y -CONFIG_NFT_REJECT_IPV4=m -CONFIG_NFT_DUP_IPV4=m -# CONFIG_NFT_FIB_IPV4 is not set -# CONFIG_NF_TABLES_ARP is not set -CONFIG_NF_DUP_IPV4=m -# CONFIG_NF_LOG_ARP is not set -CONFIG_NF_LOG_IPV4=m -CONFIG_NF_REJECT_IPV4=m -CONFIG_NF_NAT_SNMP_BASIC=m -CONFIG_NF_NAT_PPTP=m -CONFIG_NF_NAT_H323=m -CONFIG_IP_NF_IPTABLES=m -CONFIG_IP_NF_MATCH_AH=m -CONFIG_IP_NF_MATCH_ECN=m -CONFIG_IP_NF_MATCH_RPFILTER=m -CONFIG_IP_NF_MATCH_TTL=m -CONFIG_IP_NF_FILTER=m -CONFIG_IP_NF_TARGET_REJECT=m -CONFIG_IP_NF_TARGET_SYNPROXY=m -CONFIG_IP_NF_NAT=m -CONFIG_IP_NF_TARGET_MASQUERADE=m -CONFIG_IP_NF_TARGET_NETMAP=m -CONFIG_IP_NF_TARGET_REDIRECT=m -CONFIG_IP_NF_MANGLE=m -CONFIG_IP_NF_TARGET_ECN=m -CONFIG_IP_NF_TARGET_TTL=m -CONFIG_IP_NF_RAW=m -CONFIG_IP_NF_SECURITY=m -CONFIG_IP_NF_ARPTABLES=m -CONFIG_IP_NF_ARPFILTER=m -CONFIG_IP_NF_ARP_MANGLE=m -# end of IP: Netfilter Configuration - -# IPv6: Netfilter Configuration -CONFIG_IP6_NF_IPTABLES_LEGACY=m -CONFIG_NF_SOCKET_IPV6=m -CONFIG_NF_TPROXY_IPV6=m -CONFIG_NF_TABLES_IPV6=y -CONFIG_NFT_REJECT_IPV6=m -CONFIG_NFT_DUP_IPV6=m -# CONFIG_NFT_FIB_IPV6 is not set -CONFIG_NF_DUP_IPV6=m -CONFIG_NF_REJECT_IPV6=m -CONFIG_NF_LOG_IPV6=m -CONFIG_IP6_NF_IPTABLES=m -CONFIG_IP6_NF_MATCH_AH=m -CONFIG_IP6_NF_MATCH_EUI64=m -CONFIG_IP6_NF_MATCH_FRAG=m -CONFIG_IP6_NF_MATCH_OPTS=m -CONFIG_IP6_NF_MATCH_HL=m -CONFIG_IP6_NF_MATCH_IPV6HEADER=m -CONFIG_IP6_NF_MATCH_MH=m -CONFIG_IP6_NF_MATCH_RPFILTER=m -CONFIG_IP6_NF_MATCH_RT=m -# CONFIG_IP6_NF_MATCH_SRH is not set -CONFIG_IP6_NF_TARGET_HL=m -CONFIG_IP6_NF_FILTER=m -CONFIG_IP6_NF_TARGET_REJECT=m -CONFIG_IP6_NF_TARGET_SYNPROXY=m -CONFIG_IP6_NF_MANGLE=m -CONFIG_IP6_NF_RAW=m -CONFIG_IP6_NF_SECURITY=m -CONFIG_IP6_NF_NAT=m -CONFIG_IP6_NF_TARGET_MASQUERADE=m -CONFIG_IP6_NF_TARGET_NPT=m -# end of IPv6: Netfilter Configuration - -CONFIG_NF_DEFRAG_IPV6=m -# CONFIG_NF_TABLES_BRIDGE is not set -CONFIG_NF_CONNTRACK_BRIDGE=m -CONFIG_BRIDGE_NF_EBTABLES_LEGACY=m -CONFIG_BRIDGE_NF_EBTABLES=m -CONFIG_BRIDGE_EBT_BROUTE=m -CONFIG_BRIDGE_EBT_T_FILTER=m -CONFIG_BRIDGE_EBT_T_NAT=m -CONFIG_BRIDGE_EBT_802_3=m -CONFIG_BRIDGE_EBT_AMONG=m -CONFIG_BRIDGE_EBT_ARP=m -CONFIG_BRIDGE_EBT_IP=m -CONFIG_BRIDGE_EBT_IP6=m -CONFIG_BRIDGE_EBT_LIMIT=m -CONFIG_BRIDGE_EBT_MARK=m -CONFIG_BRIDGE_EBT_PKTTYPE=m -CONFIG_BRIDGE_EBT_STP=m -CONFIG_BRIDGE_EBT_VLAN=m -CONFIG_BRIDGE_EBT_ARPREPLY=m -CONFIG_BRIDGE_EBT_DNAT=m -CONFIG_BRIDGE_EBT_MARK_T=m -CONFIG_BRIDGE_EBT_REDIRECT=m -CONFIG_BRIDGE_EBT_SNAT=m -CONFIG_BRIDGE_EBT_LOG=m -CONFIG_BRIDGE_EBT_NFLOG=m -# CONFIG_IP_DCCP is not set -# CONFIG_IP_SCTP is not set -# CONFIG_RDS is not set -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_L2TP is not set -CONFIG_STP=m -CONFIG_GARP=m -CONFIG_MRP=m -CONFIG_BRIDGE=m -CONFIG_BRIDGE_IGMP_SNOOPING=y -CONFIG_BRIDGE_VLAN_FILTERING=y -# CONFIG_BRIDGE_MRP is not set -# CONFIG_BRIDGE_CFM is not set -# CONFIG_NET_DSA is not set -CONFIG_VLAN_8021Q=m -CONFIG_VLAN_8021Q_GVRP=y -CONFIG_VLAN_8021Q_MVRP=y -CONFIG_LLC=m -# CONFIG_LLC2 is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_PHONET is not set -# CONFIG_6LOWPAN is not set -# CONFIG_IEEE802154 is not set -CONFIG_NET_SCHED=y - -## Queueing/Scheduling -CONFIG_NET_SCH_HTB=m -CONFIG_NET_SCH_HFSC=m -CONFIG_NET_SCH_PRIO=m -CONFIG_NET_SCH_MULTIQ=m -CONFIG_NET_SCH_RED=m -CONFIG_NET_SCH_SFB=m -CONFIG_NET_SCH_SFQ=m -CONFIG_NET_SCH_TEQL=m -CONFIG_NET_SCH_TBF=m -# CONFIG_NET_SCH_CBS is not set -CONFIG_NET_SCH_ETF=m -CONFIG_NET_SCH_MQPRIO_LIB=m -# CONFIG_NET_SCH_TAPRIO is not set -CONFIG_NET_SCH_GRED=m -CONFIG_NET_SCH_NETEM=m -CONFIG_NET_SCH_DRR=m -CONFIG_NET_SCH_MQPRIO=m -# CONFIG_NET_SCH_SKBPRIO is not set -CONFIG_NET_SCH_CHOKE=m -CONFIG_NET_SCH_QFQ=m -CONFIG_NET_SCH_CODEL=m -CONFIG_NET_SCH_FQ_CODEL=m -# CONFIG_NET_SCH_CAKE is not set -CONFIG_NET_SCH_FQ=m -# CONFIG_NET_SCH_HHF is not set -# CONFIG_NET_SCH_PIE is not set -CONFIG_NET_SCH_PLUG=m -# CONFIG_NET_SCH_ETS is not set -# CONFIG_NET_SCH_DEFAULT is not set - -## Classification -CONFIG_NET_CLS=y -CONFIG_NET_CLS_BASIC=m -CONFIG_NET_CLS_ROUTE4=m -CONFIG_NET_CLS_FW=m -CONFIG_NET_CLS_U32=m -CONFIG_CLS_U32_PERF=y -CONFIG_CLS_U32_MARK=y -CONFIG_NET_CLS_FLOW=m -CONFIG_NET_CLS_CGROUP=m -# CONFIG_NET_CLS_BPF is not set -# CONFIG_NET_CLS_FLOWER is not set -# CONFIG_NET_CLS_MATCHALL is not set -CONFIG_NET_EMATCH=y -CONFIG_NET_EMATCH_STACK=32 -# CONFIG_NET_EMATCH_CMP is not set -# CONFIG_NET_EMATCH_NBYTE is not set -# CONFIG_NET_EMATCH_U32 is not set -# CONFIG_NET_EMATCH_META is not set -# CONFIG_NET_EMATCH_TEXT is not set -# CONFIG_NET_EMATCH_IPSET is not set -# CONFIG_NET_EMATCH_IPT is not set -# CONFIG_NET_CLS_ACT is not set -CONFIG_NET_SCH_FIFO=y -# CONFIG_DCB is not set -CONFIG_DNS_RESOLVER=m -# CONFIG_BATMAN_ADV is not set -CONFIG_OPENVSWITCH=m -CONFIG_OPENVSWITCH_GRE=m -CONFIG_OPENVSWITCH_VXLAN=m -CONFIG_OPENVSWITCH_GENEVE=m -CONFIG_VSOCKETS=y -CONFIG_VSOCKETS_DIAG=m -CONFIG_VSOCKETS_LOOPBACK=y -CONFIG_VMWARE_VMCI_VSOCKETS=y -CONFIG_VIRTIO_VSOCKETS_COMMON=y -CONFIG_NETLINK_DIAG=m -CONFIG_MPLS=y -CONFIG_NET_MPLS_GSO=m -# CONFIG_MPLS_ROUTING is not set -CONFIG_NET_NSH=m -# CONFIG_HSR is not set -# CONFIG_NET_SWITCHDEV is not set -CONFIG_NET_L3_MASTER_DEV=y -# CONFIG_QRTR is not set -# CONFIG_NET_NCSI is not set -CONFIG_PCPU_DEV_REFCNT=y -CONFIG_MAX_SKB_FRAGS=17 -CONFIG_RPS=y -CONFIG_RFS_ACCEL=y -CONFIG_SOCK_RX_QUEUE_MAPPING=y -CONFIG_XPS=y -CONFIG_CGROUP_NET_PRIO=y -CONFIG_CGROUP_NET_CLASSID=y -CONFIG_NET_RX_BUSY_POLL=y -CONFIG_BQL=y -# CONFIG_BPF_STREAM_PARSER is not set -CONFIG_NET_FLOW_LIMIT=y - -# Network testing -# CONFIG_NET_PKTGEN is not set -# end of Network testing -# end of Networking options - -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_BT is not set -# CONFIG_AF_RXRPC is not set -# CONFIG_AF_KCM is not set -CONFIG_STREAM_PARSER=y -# CONFIG_MCTP is not set -CONFIG_FIB_RULES=y -# CONFIG_WIRELESS is not set -# CONFIG_RFKILL is not set -CONFIG_NET_9P=m -CONFIG_NET_9P_FD=m -# CONFIG_NET_9P_DEBUG is not set -# CONFIG_CAIF is not set -# CONFIG_CEPH_LIB is not set -# CONFIG_NFC is not set -# CONFIG_PSAMPLE is not set -# CONFIG_NET_IFE is not set -# CONFIG_LWTUNNEL is not set -CONFIG_DST_CACHE=y -CONFIG_GRO_CELLS=y -CONFIG_SOCK_VALIDATE_XMIT=y -CONFIG_NET_SOCK_MSG=y -CONFIG_PAGE_POOL=y -# CONFIG_PAGE_POOL_STATS is not set -# CONFIG_FAILOVER is not set -CONFIG_ETHTOOL_NETLINK=y - -# Device Drivers -CONFIG_ARM_AMBA=y -CONFIG_HAVE_PCI=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_PCI=y -CONFIG_PCI_DOMAINS=y -CONFIG_PCI_DOMAINS_GENERIC=y -CONFIG_PCI_SYSCALL=y -CONFIG_PCIEPORTBUS=y -CONFIG_HOTPLUG_PCI_PCIE=y -# CONFIG_PCIEAER is not set -CONFIG_PCIEASPM=y -CONFIG_PCIEASPM_DEFAULT=y -# CONFIG_PCIEASPM_POWERSAVE is not set -# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set -# CONFIG_PCIEASPM_PERFORMANCE is not set -# CONFIG_PCIE_PTM is not set -CONFIG_PCI_MSI=y -CONFIG_PCI_QUIRKS=y -# CONFIG_PCI_DEBUG is not set -# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set -# CONFIG_PCI_STUB is not set -# CONFIG_PCI_PF_STUB is not set -CONFIG_PCI_ATS=y -CONFIG_PCI_ECAM=y -CONFIG_PCI_IOV=y -# CONFIG_PCI_PRI is not set -# CONFIG_PCI_PASID is not set -CONFIG_PCI_LABEL=y -# CONFIG_PCI_DYNAMIC_OF_NODES is not set -# CONFIG_PCIE_BUS_TUNE_OFF is not set -CONFIG_PCIE_BUS_DEFAULT=y -# CONFIG_PCIE_BUS_SAFE is not set -# CONFIG_PCIE_BUS_PERFORMANCE is not set -# CONFIG_PCIE_BUS_PEER2PEER is not set -CONFIG_VGA_ARB=y -CONFIG_VGA_ARB_MAX_GPUS=16 -CONFIG_HOTPLUG_PCI=y -CONFIG_HOTPLUG_PCI_ACPI=y -# CONFIG_HOTPLUG_PCI_ACPI_AMPERE_ALTRA is not set -# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set -# CONFIG_HOTPLUG_PCI_CPCI is not set -# CONFIG_HOTPLUG_PCI_SHPC is not set - -# PCI controller drivers -# CONFIG_PCIE_ALTERA is not set -# CONFIG_PCI_HOST_THUNDER_PEM is not set -# CONFIG_PCI_HOST_THUNDER_ECAM is not set -# CONFIG_PCI_FTPCI100 is not set -CONFIG_PCI_HOST_COMMON=y -CONFIG_PCI_HOST_GENERIC=y -# CONFIG_PCI_XGENE is not set -# CONFIG_PCIE_XILINX is not set - -# Cadence-based PCIe controllers -# CONFIG_PCIE_CADENCE_PLAT_HOST is not set -# end of Cadence-based PCIe controllers - -# DesignWare-based PCIe controllers -# CONFIG_PCIE_AL is not set -# CONFIG_PCI_MESON is not set -# CONFIG_PCI_HISI is not set -# CONFIG_PCIE_KIRIN is not set -# CONFIG_PCIE_DW_PLAT_HOST is not set -# end of DesignWare-based PCIe controllers - -# Mobiveil-based PCIe controllers -# end of Mobiveil-based PCIe controllers - -# PLDA-based PCIe controllers -# CONFIG_PCIE_MICROCHIP_HOST is not set -# end of PLDA-based PCIe controllers -# end of PCI controller drivers - -# PCI Endpoint -# CONFIG_PCI_ENDPOINT is not set -# end of PCI Endpoint - -# PCI switch controller drivers -# CONFIG_PCI_SW_SWITCHTEC is not set -# end of PCI switch controller drivers - -# CONFIG_CXL_BUS is not set -# CONFIG_PCCARD is not set -# CONFIG_RAPIDIO is not set - -# Generic Driver Options -CONFIG_AUXILIARY_BUS=y -# CONFIG_UEVENT_HELPER is not set -CONFIG_DEVTMPFS=y -CONFIG_DEVTMPFS_MOUNT=y -# CONFIG_DEVTMPFS_SAFE is not set -CONFIG_STANDALONE=y -CONFIG_PREVENT_FIRMWARE_BUILD=y - -# Firmware loader -CONFIG_FW_LOADER=y -CONFIG_FW_LOADER_DEBUG=y -CONFIG_EXTRA_FIRMWARE="" -# CONFIG_FW_LOADER_USER_HELPER is not set -# CONFIG_FW_LOADER_COMPRESS is not set -# CONFIG_FW_UPLOAD is not set -# end of Firmware loader - -CONFIG_ALLOW_DEV_COREDUMP=y -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set -# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set -CONFIG_GENERIC_CPU_DEVICES=y -CONFIG_GENERIC_CPU_AUTOPROBE=y -CONFIG_GENERIC_CPU_VULNERABILITIES=y -CONFIG_SOC_BUS=y -CONFIG_REGMAP=y -CONFIG_REGMAP_MMIO=y -CONFIG_DMA_SHARED_BUFFER=y -# CONFIG_DMA_FENCE_TRACE is not set -CONFIG_GENERIC_ARCH_TOPOLOGY=y -# CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT is not set -# end of Generic Driver Options - -# Bus devices -CONFIG_ARM_CCI=y -CONFIG_ARM_CCI400_COMMON=y -# CONFIG_VEXPRESS_CONFIG is not set -# CONFIG_MHI_BUS is not set -# CONFIG_MHI_BUS_EP is not set -# end of Bus devices - -# Cache Drivers -# end of Cache Drivers - -CONFIG_CONNECTOR=m - -# Firmware Drivers - -# ARM System Control and Management Interface Protocol -CONFIG_ARM_SCMI_PROTOCOL=y -# CONFIG_ARM_SCMI_RAW_MODE_SUPPORT is not set -# CONFIG_ARM_SCMI_DEBUG_COUNTERS is not set - -# SCMI Transport Drivers -# CONFIG_ARM_SCMI_TRANSPORT_MAILBOX is not set -# CONFIG_ARM_SCMI_TRANSPORT_SMC is not set -# end of SCMI Transport Drivers - -# ARM SCMI NXP i.MX Vendor Protocols -# CONFIG_IMX_SCMI_BBM_EXT is not set -# end of ARM SCMI NXP i.MX Vendor Protocols - -# CONFIG_ARM_SCMI_POWER_CONTROL is not set -# end of ARM System Control and Management Interface Protocol - -CONFIG_ARM_SCPI_PROTOCOL=m -# CONFIG_ARM_SDE_INTERFACE is not set -CONFIG_FIRMWARE_MEMMAP=y -CONFIG_DMIID=y -CONFIG_DMI_SYSFS=m -# CONFIG_ISCSI_IBFT is not set -# CONFIG_FW_CFG_SYSFS is not set -CONFIG_SYSFB=y -# CONFIG_SYSFB_SIMPLEFB is not set -# CONFIG_ARM_FFA_TRANSPORT is not set -# CONFIG_GOOGLE_FIRMWARE is not set - -# EFI (Extensible Firmware Interface) Support -CONFIG_EFI_ESRT=y -CONFIG_EFI_PARAMS_FROM_FDT=y -CONFIG_EFI_RUNTIME_WRAPPERS=y -CONFIG_EFI_GENERIC_STUB=y -# CONFIG_EFI_ZBOOT is not set -CONFIG_EFI_ARMSTUB_DTB_LOADER=y -# CONFIG_EFI_BOOTLOADER_CONTROL is not set -# CONFIG_EFI_CAPSULE_LOADER is not set -# CONFIG_EFI_TEST is not set -# CONFIG_RESET_ATTACK_MITIGATION is not set -# CONFIG_EFI_DISABLE_PCI_DMA is not set -CONFIG_EFI_EARLYCON=y -# CONFIG_EFI_CUSTOM_SSDT_OVERLAYS is not set -# CONFIG_EFI_DISABLE_RUNTIME is not set -# CONFIG_EFI_COCO_SECRET is not set -# end of EFI (Extensible Firmware Interface) Support - -CONFIG_ARM_PSCI_FW=y -# CONFIG_ARM_PSCI_CHECKER is not set - -# Qualcomm firmware drivers -# end of Qualcomm firmware drivers - -CONFIG_HAVE_ARM_SMCCC=y -CONFIG_HAVE_ARM_SMCCC_DISCOVERY=y -CONFIG_ARM_SMCCC_SOC_ID=y - -# Tegra firmware driver -# end of Tegra firmware driver -# end of Firmware Drivers - -# CONFIG_GNSS is not set -# CONFIG_MTD is not set -CONFIG_DTC=y -CONFIG_OF=y -# CONFIG_OF_UNITTEST is not set -CONFIG_OF_FLATTREE=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_KOBJ=y -CONFIG_OF_DYNAMIC=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_IRQ=y -CONFIG_OF_RESERVED_MEM=y -CONFIG_OF_RESOLVE=y -CONFIG_OF_OVERLAY=y -# CONFIG_PARPORT is not set -CONFIG_PNP=y -# CONFIG_PNP_DEBUG_MESSAGES is not set - -## Protocols -CONFIG_PNPACPI=y -CONFIG_BLK_DEV=y -# CONFIG_BLK_DEV_NULL_BLK is not set -CONFIG_CDROM=m -# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set -# CONFIG_ZRAM is not set -CONFIG_BLK_DEV_LOOP=m -CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 -# CONFIG_BLK_DEV_DRBD is not set -CONFIG_BLK_DEV_NBD=m -CONFIG_BLK_DEV_RAM=m -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=16384 -# CONFIG_CDROM_PKTCDVD is not set -# CONFIG_ATA_OVER_ETH is not set -# CONFIG_BLK_DEV_RBD is not set -# CONFIG_BLK_DEV_UBLK is not set - -# NVME Support -CONFIG_NVME_CORE=y -CONFIG_BLK_DEV_NVME=y -# CONFIG_NVME_MULTIPATH is not set -# CONFIG_NVME_VERBOSE_ERRORS is not set -# CONFIG_NVME_FC is not set -# CONFIG_NVME_TCP is not set -# CONFIG_NVME_HOST_AUTH is not set -# CONFIG_NVME_TARGET is not set -# end of NVME Support - -# Misc devices -# CONFIG_AD525X_DPOT is not set -# CONFIG_DUMMY_IRQ is not set -# CONFIG_PHANTOM is not set -# CONFIG_TIFM_CORE is not set -# CONFIG_ICS932S401 is not set -# CONFIG_ENCLOSURE_SERVICES is not set -# CONFIG_HP_ILO is not set -# CONFIG_APDS9802ALS is not set -# CONFIG_ISL29003 is not set -# CONFIG_ISL29020 is not set -# CONFIG_SENSORS_TSL2550 is not set -# CONFIG_SENSORS_BH1770 is not set -# CONFIG_SENSORS_APDS990X is not set -# CONFIG_HMC6352 is not set -# CONFIG_DS1682 is not set -CONFIG_VMWARE_BALLOON=y -# CONFIG_SRAM is not set -# CONFIG_DW_XDATA_PCIE is not set -# CONFIG_PCI_ENDPOINT_TEST is not set -# CONFIG_XILINX_SDFEC is not set -# CONFIG_OPEN_DICE is not set -# CONFIG_VCPU_STALL_DETECTOR is not set -# CONFIG_C2PORT is not set - -# EEPROM support -# CONFIG_EEPROM_AT24 is not set -# CONFIG_EEPROM_MAX6875 is not set -# CONFIG_EEPROM_93CX6 is not set -# CONFIG_EEPROM_IDT_89HPESX is not set -# CONFIG_EEPROM_EE1004 is not set -# end of EEPROM support - -# CONFIG_CB710_CORE is not set - -# Texas Instruments shared transport line discipline -# end of Texas Instruments shared transport line discipline - -# CONFIG_SENSORS_LIS3_I2C is not set - -## Altera FPGA firmware download module (requires I2C) -# CONFIG_ALTERA_STAPL is not set -CONFIG_VMWARE_VMCI=y -# CONFIG_GENWQE is not set -# CONFIG_ECHO is not set -# CONFIG_BCM_VK is not set -# CONFIG_MISC_ALCOR_PCI is not set -# CONFIG_MISC_RTSX_PCI is not set -# CONFIG_MISC_RTSX_USB is not set -# CONFIG_UACCE is not set -# CONFIG_PVPANIC is not set -# CONFIG_KEBA_CP500 is not set -# CONFIG_SBX is not set -# end of Misc devices - -# SCSI device support -CONFIG_SCSI_MOD=y -CONFIG_RAID_ATTRS=m -CONFIG_SCSI_COMMON=y -CONFIG_SCSI=y -CONFIG_SCSI_DMA=y -# CONFIG_SCSI_PROC_FS is not set - -## SCSI support type (disk, tape, CD-ROM) -CONFIG_BLK_DEV_SD=y -# CONFIG_CHR_DEV_ST is not set -CONFIG_BLK_DEV_SR=m -CONFIG_CHR_DEV_SG=m -CONFIG_BLK_DEV_BSG=y -# CONFIG_CHR_DEV_SCH is not set -CONFIG_SCSI_CONSTANTS=y -CONFIG_SCSI_LOGGING=y -CONFIG_SCSI_SCAN_ASYNC=y - -# SCSI Transports -CONFIG_SCSI_SPI_ATTRS=y -# CONFIG_SCSI_FC_ATTRS is not set -CONFIG_SCSI_ISCSI_ATTRS=m -CONFIG_SCSI_SAS_ATTRS=y -# CONFIG_SCSI_SAS_LIBSAS is not set -# CONFIG_SCSI_SRP_ATTRS is not set -# end of SCSI Transports - -CONFIG_SCSI_LOWLEVEL=y -# CONFIG_ISCSI_TCP is not set -# CONFIG_ISCSI_BOOT_SYSFS is not set -# CONFIG_SCSI_CXGB3_ISCSI is not set -# CONFIG_SCSI_CXGB4_ISCSI is not set -# CONFIG_SCSI_BNX2_ISCSI is not set -# CONFIG_BE2ISCSI is not set -# CONFIG_BLK_DEV_3W_XXXX_RAID is not set -# CONFIG_SCSI_HPSA is not set -# CONFIG_SCSI_3W_9XXX is not set -# CONFIG_SCSI_3W_SAS is not set -# CONFIG_SCSI_ACARD is not set -# CONFIG_SCSI_AACRAID is not set -# CONFIG_SCSI_AIC7XXX is not set -# CONFIG_SCSI_AIC79XX is not set -# CONFIG_SCSI_AIC94XX is not set -# CONFIG_SCSI_HISI_SAS is not set -# CONFIG_SCSI_MVSAS is not set -# CONFIG_SCSI_MVUMI is not set -# CONFIG_SCSI_ADVANSYS is not set -# CONFIG_SCSI_ARCMSR is not set -# CONFIG_SCSI_ESAS2R is not set -# CONFIG_MEGARAID_NEWGEN is not set -# CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set -# CONFIG_SCSI_MPT3SAS is not set -# CONFIG_SCSI_MPT2SAS is not set -# CONFIG_SCSI_MPI3MR is not set -# CONFIG_SCSI_SMARTPQI is not set -# CONFIG_SCSI_HPTIOP is not set -# CONFIG_SCSI_BUSLOGIC is not set -# CONFIG_SCSI_MYRB is not set -# CONFIG_SCSI_MYRS is not set -CONFIG_VMWARE_PVSCSI=y -# CONFIG_SCSI_SNIC is not set -# CONFIG_SCSI_DMX3191D is not set -# CONFIG_SCSI_FDOMAIN_PCI is not set -# CONFIG_SCSI_IPS is not set -# CONFIG_SCSI_INITIO is not set -# CONFIG_SCSI_INIA100 is not set -# CONFIG_SCSI_STEX is not set -# CONFIG_SCSI_SYM53C8XX_2 is not set -# CONFIG_SCSI_IPR is not set -# CONFIG_SCSI_QLOGIC_1280 is not set -# CONFIG_SCSI_QLA_ISCSI is not set -# CONFIG_SCSI_DC395x is not set -# CONFIG_SCSI_AM53C974 is not set -# CONFIG_SCSI_WD719X is not set -# CONFIG_SCSI_DEBUG is not set -# CONFIG_SCSI_PMCRAID is not set -# CONFIG_SCSI_PM8001 is not set -# CONFIG_SCSI_DH is not set -# end of SCSI device support - -CONFIG_ATA=y -CONFIG_SATA_HOST=y -CONFIG_PATA_TIMINGS=y -# CONFIG_ATA_VERBOSE_ERROR is not set -CONFIG_ATA_FORCE=y -CONFIG_ATA_ACPI=y -# CONFIG_SATA_PMP is not set - -## Controllers with non-SFF native interface -CONFIG_SATA_AHCI=y -CONFIG_SATA_MOBILE_LPM_POLICY=0 -# CONFIG_SATA_AHCI_PLATFORM is not set -# CONFIG_AHCI_DWC is not set -# CONFIG_AHCI_CEVA is not set -# CONFIG_SATA_INIC162X is not set -# CONFIG_SATA_ACARD_AHCI is not set -# CONFIG_SATA_SIL24 is not set -# CONFIG_ATA_SFF is not set -CONFIG_MD=y -# CONFIG_BLK_DEV_MD is not set -CONFIG_MD_BITMAP_FILE=y -# CONFIG_BCACHE is not set -CONFIG_BLK_DEV_DM_BUILTIN=y -CONFIG_BLK_DEV_DM=m -# CONFIG_DM_DEBUG is not set -CONFIG_DM_BUFIO=m -# CONFIG_DM_DEBUG_BLOCK_MANAGER_LOCKING is not set -CONFIG_DM_BIO_PRISON=m -CONFIG_DM_PERSISTENT_DATA=m -# CONFIG_DM_UNSTRIPED is not set -CONFIG_DM_CRYPT=m -CONFIG_DM_SNAPSHOT=m -CONFIG_DM_THIN_PROVISIONING=m -# CONFIG_DM_CACHE is not set -# CONFIG_DM_WRITECACHE is not set -# CONFIG_DM_EBS is not set -# CONFIG_DM_ERA is not set -# CONFIG_DM_CLONE is not set -CONFIG_DM_MIRROR=m -# CONFIG_DM_LOG_USERSPACE is not set -# CONFIG_DM_RAID is not set -CONFIG_DM_ZERO=m -# CONFIG_DM_MULTIPATH is not set -CONFIG_DM_DELAY=m -# CONFIG_DM_DUST is not set -CONFIG_DM_UEVENT=y -# CONFIG_DM_FLAKEY is not set -# CONFIG_DM_VERITY is not set -# CONFIG_DM_SWITCH is not set -# CONFIG_DM_LOG_WRITES is not set -# CONFIG_DM_INTEGRITY is not set -# CONFIG_DM_AUDIT is not set -# CONFIG_DM_VDO is not set -# CONFIG_TARGET_CORE is not set -CONFIG_FUSION=y -CONFIG_FUSION_SPI=y -CONFIG_FUSION_SAS=y -CONFIG_FUSION_MAX_SGE=128 -# CONFIG_FUSION_CTL is not set -# CONFIG_FUSION_LOGGING is not set - -# IEEE 1394 (FireWire) support -# CONFIG_FIREWIRE is not set -# CONFIG_FIREWIRE_NOSY is not set -# end of IEEE 1394 (FireWire) support - -CONFIG_NETDEVICES=y -CONFIG_NET_CORE=y -CONFIG_BONDING=m -CONFIG_DUMMY=m -CONFIG_WIREGUARD=m -# CONFIG_WIREGUARD_DEBUG is not set -# CONFIG_EQUALIZER is not set -# CONFIG_NET_FC is not set -CONFIG_NET_TEAM=m -CONFIG_NET_TEAM_MODE_BROADCAST=m -CONFIG_NET_TEAM_MODE_ROUNDROBIN=m -CONFIG_NET_TEAM_MODE_RANDOM=m -CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m -CONFIG_NET_TEAM_MODE_LOADBALANCE=m -CONFIG_MACVLAN=m -CONFIG_MACVTAP=m -CONFIG_IPVLAN_L3S=y -CONFIG_IPVLAN=m -# CONFIG_IPVTAP is not set -CONFIG_VXLAN=m -CONFIG_GENEVE=m -# CONFIG_BAREUDP is not set -# CONFIG_GTP is not set -# CONFIG_PFCP is not set -# CONFIG_AMT is not set -# CONFIG_MACSEC is not set -# CONFIG_NETCONSOLE is not set -CONFIG_TUN=m -CONFIG_TAP=m -# CONFIG_TUN_VNET_CROSS_LE is not set -CONFIG_VETH=m -# CONFIG_NLMON is not set -# CONFIG_NETKIT is not set -CONFIG_NET_VRF=m -# CONFIG_ARCNET is not set -CONFIG_ETHERNET=y -# CONFIG_NET_VENDOR_3COM is not set -# CONFIG_NET_VENDOR_ADAPTEC is not set -# CONFIG_NET_VENDOR_AGERE is not set -# CONFIG_NET_VENDOR_ALACRITECH is not set -# CONFIG_NET_VENDOR_ALTEON is not set -# CONFIG_ALTERA_TSE is not set -# CONFIG_NET_VENDOR_AMAZON is not set -CONFIG_NET_VENDOR_AMD=y -# CONFIG_AMD8111_ETH is not set -# CONFIG_PCNET32 is not set -# CONFIG_AMD_XGBE is not set -# CONFIG_PDS_CORE is not set -# CONFIG_NET_VENDOR_AQUANTIA is not set -# CONFIG_NET_VENDOR_ARC is not set -CONFIG_NET_VENDOR_ASIX=y -# CONFIG_NET_VENDOR_ATHEROS is not set -CONFIG_NET_VENDOR_BROADCOM=y -# CONFIG_B44 is not set -# CONFIG_BCMGENET is not set -# CONFIG_BNX2 is not set -# CONFIG_CNIC is not set -# CONFIG_TIGON3 is not set -# CONFIG_BNX2X is not set -# CONFIG_SYSTEMPORT is not set -# CONFIG_BNXT is not set -# CONFIG_NET_VENDOR_CADENCE is not set -# CONFIG_NET_VENDOR_CAVIUM is not set -# CONFIG_NET_VENDOR_CHELSIO is not set -# CONFIG_NET_VENDOR_CISCO is not set -# CONFIG_NET_VENDOR_CORTINA is not set -CONFIG_NET_VENDOR_DAVICOM=y -# CONFIG_DNET is not set -# CONFIG_NET_VENDOR_DEC is not set -# CONFIG_NET_VENDOR_DLINK is not set -# CONFIG_NET_VENDOR_EMULEX is not set -CONFIG_NET_VENDOR_ENGLEDER=y -# CONFIG_TSNEP is not set -# CONFIG_NET_VENDOR_EZCHIP is not set -CONFIG_NET_VENDOR_FUNGIBLE=y -# CONFIG_FUN_ETH is not set -CONFIG_NET_VENDOR_GOOGLE=y -# CONFIG_GVE is not set -# CONFIG_NET_VENDOR_HISILICON is not set -# CONFIG_NET_VENDOR_HUAWEI is not set -# CONFIG_NET_VENDOR_I825XX is not set -CONFIG_NET_VENDOR_INTEL=y -# CONFIG_E100 is not set -CONFIG_E1000=m -CONFIG_E1000E=m -# CONFIG_IGB is not set -# CONFIG_IGBVF is not set -# CONFIG_IXGBE is not set -# CONFIG_IXGBEVF is not set -# CONFIG_I40E is not set -# CONFIG_I40EVF is not set -# CONFIG_ICE is not set -# CONFIG_FM10K is not set -# CONFIG_IGC is not set -# CONFIG_IDPF is not set -# CONFIG_JME is not set -CONFIG_NET_VENDOR_LITEX=y -# CONFIG_LITEX_LITEETH is not set -# CONFIG_NET_VENDOR_MARVELL is not set -# CONFIG_NET_VENDOR_MELLANOX is not set -# CONFIG_NET_VENDOR_META is not set -# CONFIG_NET_VENDOR_MICREL is not set -CONFIG_NET_VENDOR_MICROCHIP=y -# CONFIG_LAN743X is not set -# CONFIG_VCAP is not set -# CONFIG_NET_VENDOR_MICROSEMI is not set -CONFIG_NET_VENDOR_MICROSOFT=y -# CONFIG_NET_VENDOR_MYRI is not set -# CONFIG_FEALNX is not set -# CONFIG_NET_VENDOR_NI is not set -# CONFIG_NET_VENDOR_NATSEMI is not set -# CONFIG_NET_VENDOR_NETERION is not set -# CONFIG_NET_VENDOR_NETRONOME is not set -# CONFIG_NET_VENDOR_NVIDIA is not set -# CONFIG_NET_VENDOR_OKI is not set -# CONFIG_ETHOC is not set -# CONFIG_NET_VENDOR_PACKET_ENGINES is not set -CONFIG_NET_VENDOR_PENSANDO=y -# CONFIG_IONIC is not set -# CONFIG_NET_VENDOR_QLOGIC is not set -# CONFIG_NET_VENDOR_BROCADE is not set -# CONFIG_NET_VENDOR_QUALCOMM is not set -# CONFIG_NET_VENDOR_RDC is not set -# CONFIG_NET_VENDOR_REALTEK is not set -# CONFIG_NET_VENDOR_RENESAS is not set -# CONFIG_NET_VENDOR_ROCKER is not set -# CONFIG_NET_VENDOR_SAMSUNG is not set -# CONFIG_NET_VENDOR_SEEQ is not set -# CONFIG_NET_VENDOR_SILAN is not set -# CONFIG_NET_VENDOR_SIS is not set -# CONFIG_NET_VENDOR_SOLARFLARE is not set -# CONFIG_NET_VENDOR_SMSC is not set -# CONFIG_NET_VENDOR_SOCIONEXT is not set -# CONFIG_NET_VENDOR_STMICRO is not set -# CONFIG_NET_VENDOR_SUN is not set -# CONFIG_NET_VENDOR_SYNOPSYS is not set -# CONFIG_NET_VENDOR_TEHUTI is not set -# CONFIG_NET_VENDOR_TI is not set -CONFIG_NET_VENDOR_VERTEXCOM=y -# CONFIG_NET_VENDOR_VIA is not set -CONFIG_NET_VENDOR_WANGXUN=y -# CONFIG_NGBE is not set -# CONFIG_NET_VENDOR_WIZNET is not set -CONFIG_NET_VENDOR_XILINX=y -# CONFIG_XILINX_EMACLITE is not set -# CONFIG_XILINX_LL_TEMAC is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -# CONFIG_PHYLIB is not set -# CONFIG_MDIO_DEVICE is not set - -# PCS device drivers -# CONFIG_PCS_XPCS is not set -# end of PCS device drivers - -# CONFIG_PPP is not set -# CONFIG_SLIP is not set - -## Host-side USB support is needed for USB Network Adapter support -# CONFIG_USB_NET_DRIVERS is not set -# CONFIG_WLAN is not set -# CONFIG_WAN is not set - -# Wireless WAN -# CONFIG_WWAN is not set -# end of Wireless WAN - -CONFIG_VMXNET3=y -# CONFIG_FUJITSU_ES is not set -# CONFIG_NETDEVSIM is not set -# CONFIG_NET_FAILOVER is not set -# CONFIG_ISDN is not set - -# Input device support -CONFIG_INPUT=y -# CONFIG_INPUT_FF_MEMLESS is not set -# CONFIG_INPUT_SPARSEKMAP is not set -# CONFIG_INPUT_MATRIXKMAP is not set -CONFIG_INPUT_VIVALDIFMAP=y - -## Userland interfaces -CONFIG_INPUT_MOUSEDEV=m -# CONFIG_INPUT_MOUSEDEV_PSAUX is not set -CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 -CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -# CONFIG_INPUT_JOYDEV is not set -CONFIG_INPUT_EVDEV=m -# CONFIG_INPUT_EVBUG is not set - -## Input Device Drivers -CONFIG_INPUT_KEYBOARD=y -# CONFIG_KEYBOARD_ADP5588 is not set -# CONFIG_KEYBOARD_ADP5589 is not set -CONFIG_KEYBOARD_ATKBD=y -# CONFIG_KEYBOARD_QT1050 is not set -# CONFIG_KEYBOARD_QT1070 is not set -# CONFIG_KEYBOARD_QT2160 is not set -# CONFIG_KEYBOARD_DLINK_DIR685 is not set -# CONFIG_KEYBOARD_LKKBD is not set -# CONFIG_KEYBOARD_TCA6416 is not set -# CONFIG_KEYBOARD_TCA8418 is not set -# CONFIG_KEYBOARD_LM8333 is not set -# CONFIG_KEYBOARD_MAX7359 is not set -# CONFIG_KEYBOARD_MPR121 is not set -# CONFIG_KEYBOARD_NEWTON is not set -# CONFIG_KEYBOARD_OPENCORES is not set -# CONFIG_KEYBOARD_SAMSUNG is not set -# CONFIG_KEYBOARD_STOWAWAY is not set -# CONFIG_KEYBOARD_SUNKBD is not set -# CONFIG_KEYBOARD_OMAP4 is not set -# CONFIG_KEYBOARD_XTKBD is not set -# CONFIG_KEYBOARD_CAP11XX is not set -# CONFIG_KEYBOARD_BCM is not set -# CONFIG_KEYBOARD_CYPRESS_SF is not set -CONFIG_INPUT_MOUSE=y -CONFIG_MOUSE_PS2=m -CONFIG_MOUSE_PS2_ALPS=y -CONFIG_MOUSE_PS2_BYD=y -CONFIG_MOUSE_PS2_LOGIPS2PP=y -CONFIG_MOUSE_PS2_SYNAPTICS=y -# CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS is not set -CONFIG_MOUSE_PS2_CYPRESS=y -CONFIG_MOUSE_PS2_TRACKPOINT=y -# CONFIG_MOUSE_PS2_ELANTECH is not set -# CONFIG_MOUSE_PS2_SENTELIC is not set -# CONFIG_MOUSE_PS2_TOUCHKIT is not set -CONFIG_MOUSE_PS2_FOCALTECH=y -# CONFIG_MOUSE_SERIAL is not set -# CONFIG_MOUSE_APPLETOUCH is not set -# CONFIG_MOUSE_BCM5974 is not set -# CONFIG_MOUSE_CYAPA is not set -# CONFIG_MOUSE_ELAN_I2C is not set -# CONFIG_MOUSE_VSXXXAA is not set -# CONFIG_MOUSE_SYNAPTICS_I2C is not set -# CONFIG_MOUSE_SYNAPTICS_USB is not set -# CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_TABLET is not set -# CONFIG_INPUT_TOUCHSCREEN is not set -# CONFIG_INPUT_MISC is not set -# CONFIG_RMI4_CORE is not set - -# Hardware I/O ports -CONFIG_SERIO=y -# CONFIG_SERIO_SERPORT is not set -# CONFIG_SERIO_AMBAKMI is not set -# CONFIG_SERIO_PCIPS2 is not set -CONFIG_SERIO_LIBPS2=y -# CONFIG_SERIO_RAW is not set -# CONFIG_SERIO_ALTERA_PS2 is not set -# CONFIG_SERIO_PS2MULT is not set -# CONFIG_SERIO_ARC_PS2 is not set -# CONFIG_SERIO_APBPS2 is not set -# CONFIG_USERIO is not set -# CONFIG_GAMEPORT is not set -# end of Hardware I/O ports -# end of Input device support - -# Character devices -CONFIG_TTY=y -CONFIG_VT=y -CONFIG_CONSOLE_TRANSLATIONS=y -CONFIG_VT_CONSOLE=y -CONFIG_VT_HW_CONSOLE_BINDING=y -CONFIG_UNIX98_PTYS=y -# CONFIG_LEGACY_PTYS is not set -CONFIG_LEGACY_TIOCSTI=y -CONFIG_LDISC_AUTOLOAD=y - -# Serial drivers -CONFIG_SERIAL_EARLYCON=y -CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set -CONFIG_SERIAL_8250_PNP=y -# CONFIG_SERIAL_8250_16550A_VARIANTS is not set -# CONFIG_SERIAL_8250_FINTEK is not set -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_PCILIB=y -# CONFIG_SERIAL_8250_PCI is not set -CONFIG_SERIAL_8250_EXAR=y -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set -# CONFIG_SERIAL_8250_PCI1XXXX is not set -CONFIG_SERIAL_8250_FSL=y -# CONFIG_SERIAL_8250_DW is not set -# CONFIG_SERIAL_8250_RT288X is not set -# CONFIG_SERIAL_8250_PERICOM is not set -CONFIG_SERIAL_OF_PLATFORM=y - -## Non-8250 serial port support -# CONFIG_SERIAL_AMBA_PL010 is not set -# CONFIG_SERIAL_AMBA_PL011 is not set -# CONFIG_SERIAL_EARLYCON_SEMIHOST is not set -# CONFIG_SERIAL_UARTLITE is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_JSM is not set -# CONFIG_SERIAL_SIFIVE is not set -# CONFIG_SERIAL_SCCNXP is not set -# CONFIG_SERIAL_SC16IS7XX is not set -# CONFIG_SERIAL_ALTERA_JTAGUART is not set -# CONFIG_SERIAL_ALTERA_UART is not set -# CONFIG_SERIAL_XILINX_PS_UART is not set -# CONFIG_SERIAL_ARC is not set -# CONFIG_SERIAL_RP2 is not set -# CONFIG_SERIAL_FSL_LPUART is not set -# CONFIG_SERIAL_FSL_LINFLEXUART is not set -# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set -# CONFIG_SERIAL_SPRD is not set -# end of Serial drivers - -# CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_N_GSM is not set -# CONFIG_NOZOMI is not set -# CONFIG_NULL_TTY is not set -# CONFIG_HVC_DCC is not set -# CONFIG_SERIAL_DEV_BUS is not set -# CONFIG_TTY_PRINTK is not set -# CONFIG_VIRTIO_CONSOLE is not set -# CONFIG_IPMI_HANDLER is not set -CONFIG_HW_RANDOM=m -CONFIG_HW_RANDOM_TIMERIOMEM=m -# CONFIG_HW_RANDOM_BA431 is not set -# CONFIG_HW_RANDOM_CCTRNG is not set -# CONFIG_HW_RANDOM_XIPHERA is not set -# CONFIG_HW_RANDOM_ARM_SMCCC_TRNG is not set -# CONFIG_HW_RANDOM_CN10K is not set -# CONFIG_APPLICOM is not set -# CONFIG_DEVMEM is not set -CONFIG_DEVPORT=y -CONFIG_TCG_TPM=y -CONFIG_TCG_TPM2_HMAC=y -CONFIG_TCG_TIS_CORE=m -CONFIG_TCG_TIS=m -# CONFIG_TCG_TIS_I2C is not set -# CONFIG_TCG_TIS_I2C_CR50 is not set -# CONFIG_TCG_TIS_I2C_ATMEL is not set -# CONFIG_TCG_TIS_I2C_INFINEON is not set -# CONFIG_TCG_TIS_I2C_NUVOTON is not set -# CONFIG_TCG_ATMEL is not set -# CONFIG_TCG_INFINEON is not set -CONFIG_TCG_CRB=y -# CONFIG_TCG_VTPM_PROXY is not set -# CONFIG_TCG_TIS_ST33ZP24_I2C is not set -# CONFIG_XILLYBUS is not set -# CONFIG_XILLYUSB is not set -# end of Character devices - -# I2C support -CONFIG_I2C=m -CONFIG_I2C_BOARDINFO=y -# CONFIG_I2C_CHARDEV is not set -# CONFIG_I2C_MUX is not set -# CONFIG_I2C_HELPER_AUTO is not set -# CONFIG_I2C_SMBUS is not set - -# I2C Algorithms -CONFIG_I2C_ALGOBIT=m -# CONFIG_I2C_ALGOPCF is not set -# CONFIG_I2C_ALGOPCA is not set -# end of I2C Algorithms - -# I2C Hardware Bus support - -## PC SMBus host controller drivers -# CONFIG_I2C_ALI1535 is not set -# CONFIG_I2C_ALI1563 is not set -# CONFIG_I2C_ALI15X3 is not set -# CONFIG_I2C_AMD756 is not set -# CONFIG_I2C_AMD8111 is not set -# CONFIG_I2C_AMD_MP2 is not set -# CONFIG_I2C_I801 is not set -# CONFIG_I2C_ISCH is not set -# CONFIG_I2C_PIIX4 is not set -# CONFIG_I2C_NFORCE2 is not set -# CONFIG_I2C_NVIDIA_GPU is not set -# CONFIG_I2C_SIS5595 is not set -# CONFIG_I2C_SIS630 is not set -# CONFIG_I2C_SIS96X is not set -# CONFIG_I2C_VIA is not set -# CONFIG_I2C_VIAPRO is not set -# CONFIG_I2C_ZHAOXIN is not set - -## ACPI drivers -# CONFIG_I2C_SCMI is not set - -## I2C system bus drivers (mostly embedded / system-on-chip) -# CONFIG_I2C_CADENCE is not set -# CONFIG_I2C_DESIGNWARE_CORE is not set -# CONFIG_I2C_EMEV2 is not set -# CONFIG_I2C_HISI is not set -# CONFIG_I2C_NOMADIK is not set -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PCA_PLATFORM is not set -# CONFIG_I2C_RK3X is not set -# CONFIG_I2C_SIMTEC is not set -# CONFIG_I2C_THUNDERX is not set -# CONFIG_I2C_XILINX is not set - -## External I2C/SMBus adapter drivers -# CONFIG_I2C_DIOLAN_U2C is not set -# CONFIG_I2C_CP2615 is not set -# CONFIG_I2C_PCI1XXXX is not set -# CONFIG_I2C_ROBOTFUZZ_OSIF is not set -# CONFIG_I2C_TAOS_EVM is not set -# CONFIG_I2C_TINY_USB is not set - -## Other I2C/SMBus bus drivers -# CONFIG_I2C_MLXCPLD is not set -# CONFIG_I2C_VIRTIO is not set -# end of I2C Hardware Bus support - -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_SLAVE is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# end of I2C support - -# CONFIG_I3C is not set -# CONFIG_SPI is not set -# CONFIG_SPMI is not set -# CONFIG_HSI is not set -CONFIG_PPS=y -# CONFIG_PPS_DEBUG is not set - -## PPS clients support -# CONFIG_PPS_CLIENT_KTIMER is not set -# CONFIG_PPS_CLIENT_LDISC is not set -# CONFIG_PPS_CLIENT_GPIO is not set - -## PPS generators support - -# PTP clock support -CONFIG_PTP_1588_CLOCK=m -CONFIG_PTP_1588_CLOCK_OPTIONAL=m - -## Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. -# CONFIG_PTP_1588_CLOCK_KVM is not set -# CONFIG_PTP_1588_CLOCK_IDT82P33 is not set -# CONFIG_PTP_1588_CLOCK_IDTCM is not set -# CONFIG_PTP_1588_CLOCK_FC3W is not set -# CONFIG_PTP_1588_CLOCK_MOCK is not set -# end of PTP clock support - -# CONFIG_PINCTRL is not set -# CONFIG_GPIOLIB is not set -# CONFIG_W1 is not set -CONFIG_POWER_RESET=y -# CONFIG_POWER_RESET_RESTART is not set -# CONFIG_POWER_RESET_XGENE is not set -# CONFIG_POWER_RESET_SYSCON is not set -# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set -# CONFIG_SYSCON_REBOOT_MODE is not set -# CONFIG_NVMEM_REBOOT_MODE is not set -# CONFIG_POWER_SEQUENCING is not set -CONFIG_POWER_SUPPLY=y -# CONFIG_POWER_SUPPLY_DEBUG is not set -# CONFIG_IP5XXX_POWER is not set -# CONFIG_TEST_POWER is not set -# CONFIG_CHARGER_ADP5061 is not set -# CONFIG_BATTERY_CW2015 is not set -# CONFIG_BATTERY_DS2780 is not set -# CONFIG_BATTERY_DS2781 is not set -# CONFIG_BATTERY_DS2782 is not set -# CONFIG_BATTERY_SAMSUNG_SDI is not set -# CONFIG_BATTERY_SBS is not set -# CONFIG_CHARGER_SBS is not set -# CONFIG_BATTERY_BQ27XXX is not set -# CONFIG_BATTERY_MAX17042 is not set -# CONFIG_BATTERY_MAX1720X is not set -# CONFIG_CHARGER_MAX8903 is not set -# CONFIG_CHARGER_LP8727 is not set -# CONFIG_CHARGER_LTC4162L is not set -# CONFIG_CHARGER_DETECTOR_MAX14656 is not set -# CONFIG_CHARGER_MAX77976 is not set -# CONFIG_CHARGER_BQ2415X is not set -# CONFIG_BATTERY_GAUGE_LTC2941 is not set -# CONFIG_BATTERY_GOLDFISH is not set -# CONFIG_BATTERY_RT5033 is not set -# CONFIG_CHARGER_BD99954 is not set -# CONFIG_BATTERY_UG3105 is not set -# CONFIG_FUEL_GAUGE_MM8013 is not set -CONFIG_HWMON=m -# CONFIG_HWMON_DEBUG_CHIP is not set - -## Native drivers -# CONFIG_SENSORS_AD7414 is not set -# CONFIG_SENSORS_AD7418 is not set -# CONFIG_SENSORS_ADM1025 is not set -# CONFIG_SENSORS_ADM1026 is not set -# CONFIG_SENSORS_ADM1029 is not set -# CONFIG_SENSORS_ADM1031 is not set -# CONFIG_SENSORS_ADM1177 is not set -# CONFIG_SENSORS_ADM9240 is not set -# CONFIG_SENSORS_ADT7410 is not set -# CONFIG_SENSORS_ADT7411 is not set -# CONFIG_SENSORS_ADT7462 is not set -# CONFIG_SENSORS_ADT7470 is not set -# CONFIG_SENSORS_ADT7475 is not set -# CONFIG_SENSORS_AHT10 is not set -# CONFIG_SENSORS_AQUACOMPUTER_D5NEXT is not set -# CONFIG_SENSORS_AS370 is not set -# CONFIG_SENSORS_ASC7621 is not set -# CONFIG_SENSORS_ASUS_ROG_RYUJIN is not set -# CONFIG_SENSORS_AXI_FAN_CONTROL is not set -# CONFIG_SENSORS_ARM_SCMI is not set -# CONFIG_SENSORS_ARM_SCPI is not set -# CONFIG_SENSORS_ATXP1 is not set -# CONFIG_SENSORS_CHIPCAP2 is not set -# CONFIG_SENSORS_CORSAIR_CPRO is not set -# CONFIG_SENSORS_CORSAIR_PSU is not set -# CONFIG_SENSORS_DRIVETEMP is not set -# CONFIG_SENSORS_DS620 is not set -# CONFIG_SENSORS_DS1621 is not set -# CONFIG_SENSORS_I5K_AMB is not set -# CONFIG_SENSORS_F71805F is not set -# CONFIG_SENSORS_F71882FG is not set -# CONFIG_SENSORS_F75375S is not set -# CONFIG_SENSORS_FTSTEUTATES is not set -# CONFIG_SENSORS_GIGABYTE_WATERFORCE is not set -# CONFIG_SENSORS_GL518SM is not set -# CONFIG_SENSORS_GL520SM is not set -# CONFIG_SENSORS_G760A is not set -# CONFIG_SENSORS_G762 is not set -# CONFIG_SENSORS_HIH6130 is not set -# CONFIG_SENSORS_HS3001 is not set -# CONFIG_SENSORS_IT87 is not set -# CONFIG_SENSORS_JC42 is not set -# CONFIG_SENSORS_POWERZ is not set -# CONFIG_SENSORS_POWR1220 is not set -# CONFIG_SENSORS_LINEAGE is not set -# CONFIG_SENSORS_LTC2945 is not set -# CONFIG_SENSORS_LTC2947_I2C is not set -# CONFIG_SENSORS_LTC2990 is not set -# CONFIG_SENSORS_LTC2991 is not set -# CONFIG_SENSORS_LTC4151 is not set -# CONFIG_SENSORS_LTC4215 is not set -# CONFIG_SENSORS_LTC4222 is not set -# CONFIG_SENSORS_LTC4245 is not set -# CONFIG_SENSORS_LTC4260 is not set -# CONFIG_SENSORS_LTC4261 is not set -# CONFIG_SENSORS_LTC4282 is not set -# CONFIG_SENSORS_MAX127 is not set -# CONFIG_SENSORS_MAX16065 is not set -# CONFIG_SENSORS_MAX1619 is not set -# CONFIG_SENSORS_MAX1668 is not set -# CONFIG_SENSORS_MAX197 is not set -# CONFIG_SENSORS_MAX31730 is not set -# CONFIG_SENSORS_MAX31760 is not set -# CONFIG_MAX31827 is not set -# CONFIG_SENSORS_MAX6620 is not set -# CONFIG_SENSORS_MAX6621 is not set -# CONFIG_SENSORS_MAX6639 is not set -# CONFIG_SENSORS_MAX6650 is not set -# CONFIG_SENSORS_MAX6697 is not set -# CONFIG_SENSORS_MAX31790 is not set -# CONFIG_SENSORS_MC34VR500 is not set -# CONFIG_SENSORS_MCP3021 is not set -# CONFIG_SENSORS_TC654 is not set -# CONFIG_SENSORS_TPS23861 is not set -# CONFIG_SENSORS_MR75203 is not set -# CONFIG_SENSORS_LM63 is not set -# CONFIG_SENSORS_LM73 is not set -# CONFIG_SENSORS_LM75 is not set -# CONFIG_SENSORS_LM77 is not set -# CONFIG_SENSORS_LM78 is not set -# CONFIG_SENSORS_LM80 is not set -# CONFIG_SENSORS_LM83 is not set -# CONFIG_SENSORS_LM85 is not set -# CONFIG_SENSORS_LM87 is not set -# CONFIG_SENSORS_LM90 is not set -# CONFIG_SENSORS_LM92 is not set -# CONFIG_SENSORS_LM93 is not set -# CONFIG_SENSORS_LM95234 is not set -# CONFIG_SENSORS_LM95241 is not set -# CONFIG_SENSORS_LM95245 is not set -# CONFIG_SENSORS_PC87360 is not set -# CONFIG_SENSORS_PC87427 is not set -# CONFIG_SENSORS_NCT6683 is not set -# CONFIG_SENSORS_NCT6775 is not set -# CONFIG_SENSORS_NCT6775_I2C is not set -# CONFIG_SENSORS_NCT7802 is not set -# CONFIG_SENSORS_NCT7904 is not set -# CONFIG_SENSORS_NPCM7XX is not set -# CONFIG_SENSORS_NZXT_KRAKEN2 is not set -# CONFIG_SENSORS_NZXT_KRAKEN3 is not set -# CONFIG_SENSORS_NZXT_SMART2 is not set -# CONFIG_SENSORS_OCC_P8_I2C is not set -# CONFIG_SENSORS_PCF8591 is not set -# CONFIG_PMBUS is not set -# CONFIG_SENSORS_PT5161L is not set -# CONFIG_SENSORS_SBTSI is not set -# CONFIG_SENSORS_SBRMI is not set -# CONFIG_SENSORS_SHT21 is not set -# CONFIG_SENSORS_SHT3x is not set -# CONFIG_SENSORS_SHT4x is not set -# CONFIG_SENSORS_SHTC1 is not set -# CONFIG_SENSORS_SIS5595 is not set -# CONFIG_SENSORS_DME1737 is not set -# CONFIG_SENSORS_EMC1403 is not set -# CONFIG_SENSORS_EMC2103 is not set -# CONFIG_SENSORS_EMC2305 is not set -# CONFIG_SENSORS_EMC6W201 is not set -# CONFIG_SENSORS_SMSC47M1 is not set -# CONFIG_SENSORS_SMSC47M192 is not set -# CONFIG_SENSORS_SMSC47B397 is not set -# CONFIG_SENSORS_SCH5627 is not set -# CONFIG_SENSORS_SCH5636 is not set -# CONFIG_SENSORS_STTS751 is not set -# CONFIG_SENSORS_ADC128D818 is not set -# CONFIG_SENSORS_ADS7828 is not set -# CONFIG_SENSORS_AMC6821 is not set -# CONFIG_SENSORS_INA209 is not set -# CONFIG_SENSORS_INA2XX is not set -# CONFIG_SENSORS_INA238 is not set -# CONFIG_SENSORS_INA3221 is not set -# CONFIG_SENSORS_SPD5118 is not set -# CONFIG_SENSORS_TC74 is not set -# CONFIG_SENSORS_THMC50 is not set -# CONFIG_SENSORS_TMP102 is not set -# CONFIG_SENSORS_TMP103 is not set -# CONFIG_SENSORS_TMP108 is not set -# CONFIG_SENSORS_TMP401 is not set -# CONFIG_SENSORS_TMP421 is not set -# CONFIG_SENSORS_TMP464 is not set -# CONFIG_SENSORS_TMP513 is not set -# CONFIG_SENSORS_VIA686A is not set -# CONFIG_SENSORS_VT1211 is not set -# CONFIG_SENSORS_VT8231 is not set -# CONFIG_SENSORS_W83773G is not set -# CONFIG_SENSORS_W83781D is not set -# CONFIG_SENSORS_W83791D is not set -# CONFIG_SENSORS_W83792D is not set -# CONFIG_SENSORS_W83793 is not set -# CONFIG_SENSORS_W83795 is not set -# CONFIG_SENSORS_W83L785TS is not set -# CONFIG_SENSORS_W83L786NG is not set -# CONFIG_SENSORS_W83627HF is not set -# CONFIG_SENSORS_W83627EHF is not set -# CONFIG_SENSORS_XGENE is not set - -## ACPI drivers -# CONFIG_SENSORS_ACPI_POWER is not set -CONFIG_THERMAL=y -# CONFIG_THERMAL_NETLINK is not set -# CONFIG_THERMAL_STATISTICS is not set -# CONFIG_THERMAL_DEBUGFS is not set -# CONFIG_THERMAL_CORE_TESTING is not set -CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 -CONFIG_THERMAL_OF=y -CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set -# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set -# CONFIG_THERMAL_GOV_FAIR_SHARE is not set -CONFIG_THERMAL_GOV_STEP_WISE=y -# CONFIG_THERMAL_GOV_BANG_BANG is not set -CONFIG_THERMAL_GOV_USER_SPACE=y -# CONFIG_CPU_THERMAL is not set -# CONFIG_THERMAL_EMULATION is not set -# CONFIG_THERMAL_MMIO is not set -CONFIG_WATCHDOG=y -CONFIG_WATCHDOG_CORE=m -# CONFIG_WATCHDOG_NOWAYOUT is not set -CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y -CONFIG_WATCHDOG_OPEN_TIMEOUT=0 -CONFIG_WATCHDOG_SYSFS=y -# CONFIG_WATCHDOG_HRTIMER_PRETIMEOUT is not set - -## Watchdog Pretimeout Governors -# CONFIG_WATCHDOG_PRETIMEOUT_GOV is not set - -## Watchdog Device Drivers -CONFIG_SOFT_WATCHDOG=m -# CONFIG_WDAT_WDT is not set -# CONFIG_XILINX_WATCHDOG is not set -# CONFIG_XILINX_WINDOW_WATCHDOG is not set -# CONFIG_ZIIRAVE_WATCHDOG is not set -# CONFIG_ARM_SP805_WATCHDOG is not set -# CONFIG_ARM_SBSA_WATCHDOG is not set -# CONFIG_CADENCE_WATCHDOG is not set -# CONFIG_DW_WATCHDOG is not set -# CONFIG_MAX63XX_WATCHDOG is not set -# CONFIG_ARM_SMC_WATCHDOG is not set -# CONFIG_ALIM7101_WDT is not set -# CONFIG_I6300ESB_WDT is not set -# CONFIG_HP_WATCHDOG is not set - -## PCI-based Watchdog Cards -# CONFIG_PCIPCWATCHDOG is not set -# CONFIG_WDTPCI is not set - -## USB-based Watchdog Cards -# CONFIG_USBPCWATCHDOG is not set -CONFIG_SSB_POSSIBLE=y -# CONFIG_SSB is not set -CONFIG_BCMA_POSSIBLE=y -# CONFIG_BCMA is not set - -# Multifunction device drivers -# CONFIG_MFD_ADP5585 is not set -# CONFIG_MFD_ACT8945A is not set -# CONFIG_MFD_SMPRO is not set -# CONFIG_MFD_ATMEL_FLEXCOM is not set -# CONFIG_MFD_ATMEL_HLCDC is not set -# CONFIG_MFD_BCM590XX is not set -# CONFIG_MFD_BD9571MWV is not set -# CONFIG_MFD_AXP20X_I2C is not set -# CONFIG_MFD_CS42L43_I2C is not set -# CONFIG_MFD_MADERA is not set -# CONFIG_MFD_MAX5970 is not set -# CONFIG_MFD_DA9062 is not set -# CONFIG_MFD_DA9063 is not set -# CONFIG_MFD_DA9150 is not set -# CONFIG_MFD_DLN2 is not set -# CONFIG_MFD_GATEWORKS_GSC is not set -# CONFIG_MFD_MC13XXX_I2C is not set -# CONFIG_MFD_MP2629 is not set -# CONFIG_MFD_HI6421_PMIC is not set -# CONFIG_LPC_ICH is not set -# CONFIG_LPC_SCH is not set -# CONFIG_MFD_IQS62X is not set -# CONFIG_MFD_JANZ_CMODIO is not set -# CONFIG_MFD_KEMPLD is not set -# CONFIG_MFD_88PM800 is not set -# CONFIG_MFD_88PM805 is not set -# CONFIG_MFD_MAX14577 is not set -# CONFIG_MFD_MAX77650 is not set -# CONFIG_MFD_MAX77686 is not set -# CONFIG_MFD_MAX77693 is not set -# CONFIG_MFD_MAX77714 is not set -# CONFIG_MFD_MAX8907 is not set -# CONFIG_MFD_MT6360 is not set -# CONFIG_MFD_MT6370 is not set -# CONFIG_MFD_MT6397 is not set -# CONFIG_MFD_MENF21BMC is not set -# CONFIG_MFD_VIPERBOARD is not set -# CONFIG_MFD_NTXEC is not set -# CONFIG_MFD_RETU is not set -# CONFIG_MFD_PCF50633 is not set -# CONFIG_MFD_SY7636A is not set -# CONFIG_MFD_RDC321X is not set -# CONFIG_MFD_RT4831 is not set -# CONFIG_MFD_RT5033 is not set -# CONFIG_MFD_RT5120 is not set -# CONFIG_MFD_RK8XX_I2C is not set -# CONFIG_MFD_RN5T618 is not set -# CONFIG_MFD_SI476X_CORE is not set -# CONFIG_MFD_SM501 is not set -# CONFIG_MFD_SKY81452 is not set -CONFIG_MFD_SYSCON=y -# CONFIG_MFD_LP3943 is not set -# CONFIG_MFD_TI_LMU is not set -# CONFIG_TPS6105X is not set -# CONFIG_TPS6507X is not set -# CONFIG_MFD_TPS65086 is not set -# CONFIG_MFD_TPS65217 is not set -# CONFIG_MFD_TI_LP873X is not set -# CONFIG_MFD_TI_LP87565 is not set -# CONFIG_MFD_TPS65218 is not set -# CONFIG_MFD_TPS65219 is not set -# CONFIG_MFD_TPS65912_I2C is not set -# CONFIG_MFD_TPS6594_I2C is not set -# CONFIG_MFD_WL1273_CORE is not set -# CONFIG_MFD_LM3533 is not set -# CONFIG_MFD_TQMX86 is not set -# CONFIG_MFD_VX855 is not set -# CONFIG_MFD_ARIZONA_I2C is not set -# CONFIG_MFD_WM8994 is not set -# CONFIG_MFD_STMFX is not set -# CONFIG_MFD_ATC260X_I2C is not set -# CONFIG_MFD_QCOM_PM8008 is not set -# CONFIG_MFD_CS40L50_I2C is not set -# CONFIG_MFD_RSMU_I2C is not set -# end of Multifunction device drivers - -# CONFIG_REGULATOR is not set -# CONFIG_RC_CORE is not set - -# CEC support -# CONFIG_MEDIA_CEC_SUPPORT is not set -# end of CEC support - -# CONFIG_MEDIA_SUPPORT is not set - -# Graphics support -CONFIG_APERTURE_HELPERS=y -CONFIG_SCREEN_INFO=y -CONFIG_VIDEO=y -# CONFIG_AUXDISPLAY is not set -CONFIG_DRM=m -# CONFIG_DRM_DEBUG_MM is not set -CONFIG_DRM_KMS_HELPER=m -# CONFIG_DRM_PANIC is not set -# CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS is not set -# CONFIG_DRM_DEBUG_MODESET_LOCK is not set -CONFIG_DRM_FBDEV_EMULATION=y -CONFIG_DRM_FBDEV_OVERALLOC=100 -# CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM is not set -# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set -CONFIG_DRM_TTM=m -CONFIG_DRM_TTM_HELPER=m - -# I2C encoder or helper chips -# CONFIG_DRM_I2C_CH7006 is not set -# CONFIG_DRM_I2C_SIL164 is not set -# CONFIG_DRM_I2C_NXP_TDA998X is not set -# CONFIG_DRM_I2C_NXP_TDA9950 is not set -# end of I2C encoder or helper chips - -# ARM devices -# CONFIG_DRM_HDLCD is not set -# CONFIG_DRM_MALI_DISPLAY is not set -# CONFIG_DRM_KOMEDA is not set -# end of ARM devices - -# CONFIG_DRM_RADEON is not set -# CONFIG_DRM_AMDGPU is not set -# CONFIG_DRM_NOUVEAU is not set -# CONFIG_DRM_XE is not set -# CONFIG_DRM_VGEM is not set -# CONFIG_DRM_VKMS is not set -CONFIG_DRM_VMWGFX=m -# CONFIG_DRM_UDL is not set -# CONFIG_DRM_AST is not set -# CONFIG_DRM_MGAG200 is not set -# CONFIG_DRM_QXL is not set -CONFIG_DRM_PANEL=y - -# Display Panels -# CONFIG_DRM_PANEL_ARM_VERSATILE is not set -# CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01 is not set -# CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0 is not set -# end of Display Panels - -CONFIG_DRM_BRIDGE=y -CONFIG_DRM_PANEL_BRIDGE=y - -# Display Interface Bridges -# CONFIG_DRM_CHIPONE_ICN6211 is not set -# CONFIG_DRM_CHRONTEL_CH7033 is not set -# CONFIG_DRM_DISPLAY_CONNECTOR is not set -# CONFIG_DRM_ITE_IT6505 is not set -# CONFIG_DRM_LONTIUM_LT8912B is not set -# CONFIG_DRM_LONTIUM_LT9211 is not set -# CONFIG_DRM_LONTIUM_LT9611 is not set -# CONFIG_DRM_LONTIUM_LT9611UXC is not set -# CONFIG_DRM_ITE_IT66121 is not set -# CONFIG_DRM_LVDS_CODEC is not set -# CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW is not set -# CONFIG_DRM_NWL_MIPI_DSI is not set -# CONFIG_DRM_NXP_PTN3460 is not set -# CONFIG_DRM_PARADE_PS8622 is not set -# CONFIG_DRM_PARADE_PS8640 is not set -# CONFIG_DRM_SAMSUNG_DSIM is not set -# CONFIG_DRM_SIL_SII8620 is not set -# CONFIG_DRM_SII902X is not set -# CONFIG_DRM_SII9234 is not set -# CONFIG_DRM_SIMPLE_BRIDGE is not set -# CONFIG_DRM_THINE_THC63LVD1024 is not set -# CONFIG_DRM_TOSHIBA_TC358762 is not set -# CONFIG_DRM_TOSHIBA_TC358764 is not set -# CONFIG_DRM_TOSHIBA_TC358767 is not set -# CONFIG_DRM_TOSHIBA_TC358768 is not set -# CONFIG_DRM_TOSHIBA_TC358775 is not set -# CONFIG_DRM_TI_DLPC3433 is not set -# CONFIG_DRM_TI_TFP410 is not set -# CONFIG_DRM_TI_SN65DSI83 is not set -# CONFIG_DRM_TI_SN65DSI86 is not set -# CONFIG_DRM_TI_TPD12S015 is not set -# CONFIG_DRM_ANALOGIX_ANX6345 is not set -# CONFIG_DRM_ANALOGIX_ANX78XX is not set -# CONFIG_DRM_ANALOGIX_ANX7625 is not set -# CONFIG_DRM_I2C_ADV7511 is not set -# CONFIG_DRM_CDNS_DSI is not set -# CONFIG_DRM_CDNS_MHDP8546 is not set -# end of Display Interface Bridges - -# CONFIG_DRM_ETNAVIV is not set -# CONFIG_DRM_HISI_HIBMC is not set -# CONFIG_DRM_HISI_KIRIN is not set -# CONFIG_DRM_LOGICVC is not set -# CONFIG_DRM_ARCPGU is not set -# CONFIG_DRM_BOCHS is not set -# CONFIG_DRM_CIRRUS_QEMU is not set -# CONFIG_DRM_GM12U320 is not set -# CONFIG_DRM_SIMPLEDRM is not set -# CONFIG_DRM_PL111 is not set -# CONFIG_DRM_LIMA is not set -# CONFIG_DRM_PANFROST is not set -# CONFIG_DRM_PANTHOR is not set -# CONFIG_DRM_TIDSS is not set -# CONFIG_DRM_GUD is not set -# CONFIG_DRM_SSD130X is not set -# CONFIG_DRM_WERROR is not set -CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y - -# Frame buffer Devices -CONFIG_FB=y -# CONFIG_FB_CIRRUS is not set -# CONFIG_FB_PM2 is not set -# CONFIG_FB_CYBER2000 is not set -# CONFIG_FB_ASILIANT is not set -# CONFIG_FB_IMSTT is not set -# CONFIG_FB_UVESA is not set -CONFIG_FB_EFI=y -# CONFIG_FB_OPENCORES is not set -# CONFIG_FB_S1D13XXX is not set -# CONFIG_FB_NVIDIA is not set -# CONFIG_FB_RIVA is not set -# CONFIG_FB_I740 is not set -# CONFIG_FB_MATROX is not set -# CONFIG_FB_RADEON is not set -# CONFIG_FB_ATY128 is not set -# CONFIG_FB_ATY is not set -# CONFIG_FB_S3 is not set -# CONFIG_FB_SAVAGE is not set -# CONFIG_FB_SIS is not set -# CONFIG_FB_NEOMAGIC is not set -# CONFIG_FB_KYRO is not set -# CONFIG_FB_3DFX is not set -# CONFIG_FB_VOODOO1 is not set -# CONFIG_FB_VT8623 is not set -# CONFIG_FB_TRIDENT is not set -# CONFIG_FB_ARK is not set -# CONFIG_FB_PM3 is not set -# CONFIG_FB_CARMINE is not set -# CONFIG_FB_SMSCUFX is not set -# CONFIG_FB_UDL is not set -# CONFIG_FB_IBM_GXT4500 is not set -# CONFIG_FB_VIRTUAL is not set -# CONFIG_FB_METRONOME is not set -# CONFIG_FB_MB862XX is not set -# CONFIG_FB_SIMPLE is not set -# CONFIG_FB_SM712 is not set -CONFIG_FB_CORE=y -CONFIG_FB_NOTIFY=y -# CONFIG_FIRMWARE_EDID is not set -CONFIG_FB_DEVICE=y -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_IMAGEBLIT=y -CONFIG_FB_SYS_FILLRECT=y -CONFIG_FB_SYS_COPYAREA=y -CONFIG_FB_SYS_IMAGEBLIT=y -# CONFIG_FB_FOREIGN_ENDIAN is not set -CONFIG_FB_SYSMEM_FOPS=y -CONFIG_FB_DEFERRED_IO=y -CONFIG_FB_IOMEM_FOPS=y -CONFIG_FB_IOMEM_HELPERS=y -CONFIG_FB_SYSMEM_HELPERS=y -CONFIG_FB_SYSMEM_HELPERS_DEFERRED=y -# CONFIG_FB_MODE_HELPERS is not set -# CONFIG_FB_TILEBLITTING is not set -# end of Frame buffer Devices - -# Backlight & LCD device support -# CONFIG_LCD_CLASS_DEVICE is not set -# CONFIG_BACKLIGHT_CLASS_DEVICE is not set -# end of Backlight & LCD device support - -CONFIG_HDMI=y - -# Console display driver support -CONFIG_DUMMY_CONSOLE=y -CONFIG_DUMMY_CONSOLE_COLUMNS=80 -CONFIG_DUMMY_CONSOLE_ROWS=25 -CONFIG_FRAMEBUFFER_CONSOLE=y -# CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is not set -CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y -# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set -# CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is not set -# end of Console display driver support - -# CONFIG_LOGO is not set -# end of Graphics support - -# CONFIG_DRM_ACCEL is not set -# CONFIG_SOUND is not set -CONFIG_HID_SUPPORT=y -CONFIG_HID=m -# CONFIG_HID_BATTERY_STRENGTH is not set -# CONFIG_HIDRAW is not set -# CONFIG_UHID is not set -CONFIG_HID_GENERIC=m - -# Special HID drivers -# CONFIG_HID_A4TECH is not set -# CONFIG_HID_ACCUTOUCH is not set -# CONFIG_HID_ACRUX is not set -# CONFIG_HID_APPLEIR is not set -# CONFIG_HID_AUREAL is not set -# CONFIG_HID_BELKIN is not set -# CONFIG_HID_BETOP_FF is not set -# CONFIG_HID_CHERRY is not set -# CONFIG_HID_CHICONY is not set -# CONFIG_HID_COUGAR is not set -# CONFIG_HID_MACALLY is not set -# CONFIG_HID_CMEDIA is not set -# CONFIG_HID_CREATIVE_SB0540 is not set -# CONFIG_HID_CYPRESS is not set -# CONFIG_HID_DRAGONRISE is not set -# CONFIG_HID_EMS_FF is not set -# CONFIG_HID_ELECOM is not set -# CONFIG_HID_ELO is not set -# CONFIG_HID_EVISION is not set -# CONFIG_HID_EZKEY is not set -# CONFIG_HID_GEMBIRD is not set -# CONFIG_HID_GFRM is not set -# CONFIG_HID_GLORIOUS is not set -# CONFIG_HID_HOLTEK is not set -# CONFIG_HID_GOOGLE_STADIA_FF is not set -# CONFIG_HID_VIVALDI is not set -# CONFIG_HID_KEYTOUCH is not set -# CONFIG_HID_KYE is not set -# CONFIG_HID_UCLOGIC is not set -# CONFIG_HID_WALTOP is not set -# CONFIG_HID_VIEWSONIC is not set -# CONFIG_HID_VRC2 is not set -# CONFIG_HID_XIAOMI is not set -# CONFIG_HID_GYRATION is not set -# CONFIG_HID_ICADE is not set -# CONFIG_HID_ITE is not set -# CONFIG_HID_JABRA is not set -# CONFIG_HID_TWINHAN is not set -# CONFIG_HID_KENSINGTON is not set -# CONFIG_HID_LCPOWER is not set -# CONFIG_HID_LENOVO is not set -# CONFIG_HID_LETSKETCH is not set -# CONFIG_HID_MAGICMOUSE is not set -# CONFIG_HID_MALTRON is not set -# CONFIG_HID_MAYFLASH is not set -# CONFIG_HID_MEGAWORLD_FF is not set -# CONFIG_HID_REDRAGON is not set -# CONFIG_HID_MICROSOFT is not set -# CONFIG_HID_MONTEREY is not set -# CONFIG_HID_MULTITOUCH is not set -# CONFIG_HID_NTI is not set -# CONFIG_HID_NTRIG is not set -# CONFIG_HID_ORTEK is not set -# CONFIG_HID_PANTHERLORD is not set -# CONFIG_HID_PENMOUNT is not set -# CONFIG_HID_PETALYNX is not set -# CONFIG_HID_PICOLCD is not set -# CONFIG_HID_PLANTRONICS is not set -# CONFIG_HID_PXRC is not set -# CONFIG_HID_RAZER is not set -# CONFIG_HID_PRIMAX is not set -# CONFIG_HID_RETRODE is not set -# CONFIG_HID_ROCCAT is not set -# CONFIG_HID_SAITEK is not set -# CONFIG_HID_SAMSUNG is not set -# CONFIG_HID_SEMITEK is not set -# CONFIG_HID_SIGMAMICRO is not set -# CONFIG_HID_SPEEDLINK is not set -# CONFIG_HID_STEAM is not set -# CONFIG_HID_STEELSERIES is not set -# CONFIG_HID_SUNPLUS is not set -# CONFIG_HID_RMI is not set -# CONFIG_HID_GREENASIA is not set -# CONFIG_HID_SMARTJOYPLUS is not set -# CONFIG_HID_TIVO is not set -# CONFIG_HID_TOPSEED is not set -# CONFIG_HID_TOPRE is not set -# CONFIG_HID_THRUSTMASTER is not set -# CONFIG_HID_UDRAW_PS3 is not set -# CONFIG_HID_WACOM is not set -# CONFIG_HID_XINMO is not set -# CONFIG_HID_ZEROPLUS is not set -# CONFIG_HID_ZYDACRON is not set -# CONFIG_HID_SENSOR_HUB is not set -# CONFIG_HID_ALPS is not set -# CONFIG_HID_MCP2221 is not set -# end of Special HID drivers - -# HID-BPF support -# end of HID-BPF support - -# USB HID support -CONFIG_USB_HID=m -# CONFIG_HID_PID is not set -# CONFIG_USB_HIDDEV is not set - -# USB HID Boot Protocol drivers -# CONFIG_USB_KBD is not set -# CONFIG_USB_MOUSE is not set -# end of USB HID Boot Protocol drivers -# end of USB HID support - -CONFIG_I2C_HID=m -# CONFIG_I2C_HID_ACPI is not set -# CONFIG_I2C_HID_OF is not set -# CONFIG_I2C_HID_OF_ELAN is not set -# CONFIG_I2C_HID_OF_GOODIX is not set -CONFIG_USB_OHCI_LITTLE_ENDIAN=y -CONFIG_USB_SUPPORT=y -CONFIG_USB_COMMON=m -# CONFIG_USB_ULPI_BUS is not set -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB=m -CONFIG_USB_PCI=y -# CONFIG_USB_PCI_AMD is not set -CONFIG_USB_ANNOUNCE_NEW_DEVICES=y - -## Miscellaneous USB options -CONFIG_USB_DEFAULT_PERSIST=y -# CONFIG_USB_FEW_INIT_RETRIES is not set -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_OTG_PRODUCTLIST is not set -# CONFIG_USB_OTG_DISABLE_EXTERNAL_HUB is not set -CONFIG_USB_AUTOSUSPEND_DELAY=2 -CONFIG_USB_DEFAULT_AUTHORIZATION_MODE=1 -CONFIG_USB_MON=m - -## USB Host Controller Drivers -# CONFIG_USB_C67X00_HCD is not set -CONFIG_USB_XHCI_HCD=m -# CONFIG_USB_XHCI_DBGCAP is not set -CONFIG_USB_XHCI_PCI=m -# CONFIG_USB_XHCI_PCI_RENESAS is not set -# CONFIG_USB_XHCI_PLATFORM is not set -CONFIG_USB_EHCI_HCD=m -CONFIG_USB_EHCI_ROOT_HUB_TT=y -CONFIG_USB_EHCI_TT_NEWSCHED=y -CONFIG_USB_EHCI_PCI=m -# CONFIG_USB_EHCI_FSL is not set -# CONFIG_USB_EHCI_HCD_PLATFORM is not set -# CONFIG_USB_OXU210HP_HCD is not set -# CONFIG_USB_ISP116X_HCD is not set -# CONFIG_USB_OHCI_HCD is not set -CONFIG_USB_UHCI_HCD=m -# CONFIG_USB_SL811_HCD is not set -# CONFIG_USB_R8A66597_HCD is not set -# CONFIG_USB_HCD_TEST_MODE is not set - -## USB Device Class drivers -# CONFIG_USB_ACM is not set -# CONFIG_USB_PRINTER is not set -# CONFIG_USB_WDM is not set -# CONFIG_USB_TMC is not set - -## NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may - -## also be needed; see USB_STORAGE Help for more info -CONFIG_USB_STORAGE=m -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_STORAGE_REALTEK is not set -# CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set -# CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_USBAT is not set -# CONFIG_USB_STORAGE_SDDR09 is not set -# CONFIG_USB_STORAGE_SDDR55 is not set -# CONFIG_USB_STORAGE_JUMPSHOT is not set -# CONFIG_USB_STORAGE_ALAUDA is not set -# CONFIG_USB_STORAGE_ONETOUCH is not set -# CONFIG_USB_STORAGE_KARMA is not set -# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set -# CONFIG_USB_STORAGE_ENE_UB6250 is not set -CONFIG_USB_UAS=m - -## USB Imaging devices -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set -# CONFIG_USBIP_CORE is not set - -## USB dual-mode controller drivers -# CONFIG_USB_CDNS_SUPPORT is not set -# CONFIG_USB_MUSB_HDRC is not set -# CONFIG_USB_DWC3 is not set -# CONFIG_USB_DWC2 is not set -# CONFIG_USB_CHIPIDEA is not set -# CONFIG_USB_ISP1760 is not set - -## USB port drivers -CONFIG_USB_SERIAL=m -CONFIG_USB_SERIAL_GENERIC=y -# CONFIG_USB_SERIAL_SIMPLE is not set -# CONFIG_USB_SERIAL_AIRCABLE is not set -# CONFIG_USB_SERIAL_ARK3116 is not set -# CONFIG_USB_SERIAL_BELKIN is not set -# CONFIG_USB_SERIAL_CH341 is not set -# CONFIG_USB_SERIAL_WHITEHEAT is not set -# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set -CONFIG_USB_SERIAL_CP210X=m -# CONFIG_USB_SERIAL_CYPRESS_M8 is not set -# CONFIG_USB_SERIAL_EMPEG is not set -CONFIG_USB_SERIAL_FTDI_SIO=m -# CONFIG_USB_SERIAL_VISOR is not set -# CONFIG_USB_SERIAL_IPAQ is not set -# CONFIG_USB_SERIAL_IR is not set -# CONFIG_USB_SERIAL_EDGEPORT is not set -# CONFIG_USB_SERIAL_EDGEPORT_TI is not set -# CONFIG_USB_SERIAL_F81232 is not set -# CONFIG_USB_SERIAL_F8153X is not set -# CONFIG_USB_SERIAL_GARMIN is not set -# CONFIG_USB_SERIAL_IPW is not set -# CONFIG_USB_SERIAL_IUU is not set -# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set -# CONFIG_USB_SERIAL_KEYSPAN is not set -# CONFIG_USB_SERIAL_KLSI is not set -# CONFIG_USB_SERIAL_KOBIL_SCT is not set -# CONFIG_USB_SERIAL_MCT_U232 is not set -# CONFIG_USB_SERIAL_METRO is not set -# CONFIG_USB_SERIAL_MOS7720 is not set -# CONFIG_USB_SERIAL_MOS7840 is not set -# CONFIG_USB_SERIAL_MXUPORT is not set -# CONFIG_USB_SERIAL_NAVMAN is not set -# CONFIG_USB_SERIAL_PL2303 is not set -# CONFIG_USB_SERIAL_OTI6858 is not set -# CONFIG_USB_SERIAL_QCAUX is not set -# CONFIG_USB_SERIAL_QUALCOMM is not set -# CONFIG_USB_SERIAL_SPCP8X5 is not set -# CONFIG_USB_SERIAL_SAFE is not set -# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set -# CONFIG_USB_SERIAL_SYMBOL is not set -# CONFIG_USB_SERIAL_TI is not set -# CONFIG_USB_SERIAL_CYBERJACK is not set -# CONFIG_USB_SERIAL_OPTION is not set -# CONFIG_USB_SERIAL_OMNINET is not set -# CONFIG_USB_SERIAL_OPTICON is not set -# CONFIG_USB_SERIAL_XSENS_MT is not set -# CONFIG_USB_SERIAL_WISHBONE is not set -# CONFIG_USB_SERIAL_SSU100 is not set -# CONFIG_USB_SERIAL_QT2 is not set -# CONFIG_USB_SERIAL_UPD78F0730 is not set -# CONFIG_USB_SERIAL_XR is not set -# CONFIG_USB_SERIAL_DEBUG is not set - -## USB Miscellaneous drivers -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_ADUTUX is not set -# CONFIG_USB_SEVSEG is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_CYPRESS_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_APPLEDISPLAY is not set -# CONFIG_APPLE_MFI_FASTCHARGE is not set -# CONFIG_USB_LJCA is not set -# CONFIG_USB_SISUSBVGA is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_TRANCEVIBRATOR is not set -# CONFIG_USB_IOWARRIOR is not set -# CONFIG_USB_TEST is not set -# CONFIG_USB_EHSET_TEST_FIXTURE is not set -# CONFIG_USB_ISIGHTFW is not set -# CONFIG_USB_YUREX is not set -# CONFIG_USB_EZUSB_FX2 is not set -# CONFIG_USB_HUB_USB251XB is not set -# CONFIG_USB_HSIC_USB3503 is not set -# CONFIG_USB_HSIC_USB4604 is not set -# CONFIG_USB_LINK_LAYER_TEST is not set -# CONFIG_USB_CHAOSKEY is not set -# CONFIG_USB_ONBOARD_DEV is not set - -# USB Physical Layer drivers -# CONFIG_NOP_USB_XCEIV is not set -# CONFIG_USB_ISP1301 is not set -# CONFIG_USB_ULPI is not set -# end of USB Physical Layer drivers - -# CONFIG_USB_GADGET is not set -# CONFIG_TYPEC is not set -# CONFIG_USB_ROLE_SWITCH is not set -# CONFIG_MMC is not set -# CONFIG_SCSI_UFSHCD is not set -# CONFIG_MEMSTICK is not set -# CONFIG_NEW_LEDS is not set -# CONFIG_ACCESSIBILITY is not set -# CONFIG_INFINIBAND is not set -CONFIG_EDAC_SUPPORT=y -CONFIG_RTC_LIB=y -CONFIG_RTC_CLASS=y -# CONFIG_RTC_HCTOSYS is not set -# CONFIG_RTC_SYSTOHC is not set -# CONFIG_RTC_DEBUG is not set -# CONFIG_RTC_NVMEM is not set - -## RTC interfaces -CONFIG_RTC_INTF_SYSFS=y -CONFIG_RTC_INTF_PROC=y -CONFIG_RTC_INTF_DEV=y -# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set -# CONFIG_RTC_DRV_TEST is not set - -## I2C RTC drivers -# CONFIG_RTC_DRV_ABB5ZES3 is not set -# CONFIG_RTC_DRV_ABEOZ9 is not set -# CONFIG_RTC_DRV_ABX80X is not set -# CONFIG_RTC_DRV_DS1307 is not set -# CONFIG_RTC_DRV_DS1374 is not set -# CONFIG_RTC_DRV_DS1672 is not set -# CONFIG_RTC_DRV_HYM8563 is not set -# CONFIG_RTC_DRV_MAX6900 is not set -# CONFIG_RTC_DRV_MAX31335 is not set -# CONFIG_RTC_DRV_NCT3018Y is not set -# CONFIG_RTC_DRV_RS5C372 is not set -# CONFIG_RTC_DRV_ISL1208 is not set -# CONFIG_RTC_DRV_ISL12022 is not set -# CONFIG_RTC_DRV_ISL12026 is not set -# CONFIG_RTC_DRV_X1205 is not set -# CONFIG_RTC_DRV_PCF8523 is not set -# CONFIG_RTC_DRV_PCF85063 is not set -# CONFIG_RTC_DRV_PCF85363 is not set -# CONFIG_RTC_DRV_PCF8563 is not set -# CONFIG_RTC_DRV_PCF8583 is not set -# CONFIG_RTC_DRV_M41T80 is not set -# CONFIG_RTC_DRV_BQ32K is not set -# CONFIG_RTC_DRV_S35390A is not set -# CONFIG_RTC_DRV_FM3130 is not set -# CONFIG_RTC_DRV_RX8010 is not set -# CONFIG_RTC_DRV_RX8111 is not set -# CONFIG_RTC_DRV_RX8581 is not set -# CONFIG_RTC_DRV_RX8025 is not set -# CONFIG_RTC_DRV_EM3027 is not set -# CONFIG_RTC_DRV_RV3028 is not set -# CONFIG_RTC_DRV_RV3032 is not set -# CONFIG_RTC_DRV_RV8803 is not set -# CONFIG_RTC_DRV_SD2405AL is not set -# CONFIG_RTC_DRV_SD3078 is not set - -## SPI RTC drivers -CONFIG_RTC_I2C_AND_SPI=m - -## SPI and I2C RTC drivers -# CONFIG_RTC_DRV_DS3232 is not set -# CONFIG_RTC_DRV_PCF2127 is not set -# CONFIG_RTC_DRV_RV3029C2 is not set -# CONFIG_RTC_DRV_RX6110 is not set - -## Platform RTC drivers -# CONFIG_RTC_DRV_DS1286 is not set -# CONFIG_RTC_DRV_DS1511 is not set -# CONFIG_RTC_DRV_DS1553 is not set -# CONFIG_RTC_DRV_DS1685_FAMILY is not set -# CONFIG_RTC_DRV_DS1742 is not set -# CONFIG_RTC_DRV_DS2404 is not set -CONFIG_RTC_DRV_EFI=y -# CONFIG_RTC_DRV_STK17TA8 is not set -# CONFIG_RTC_DRV_M48T86 is not set -# CONFIG_RTC_DRV_M48T35 is not set -# CONFIG_RTC_DRV_M48T59 is not set -# CONFIG_RTC_DRV_MSM6242 is not set -# CONFIG_RTC_DRV_RP5C01 is not set -# CONFIG_RTC_DRV_ZYNQMP is not set - -## on-CPU RTC drivers -# CONFIG_RTC_DRV_PL030 is not set -CONFIG_RTC_DRV_PL031=y -# CONFIG_RTC_DRV_CADENCE is not set -# CONFIG_RTC_DRV_FTRTC010 is not set -# CONFIG_RTC_DRV_R7301 is not set - -## HID Sensor RTC drivers -# CONFIG_RTC_DRV_GOLDFISH is not set -# CONFIG_DMADEVICES is not set - -# DMABUF options -CONFIG_SYNC_FILE=y -# CONFIG_SW_SYNC is not set -# CONFIG_UDMABUF is not set -# CONFIG_DMABUF_MOVE_NOTIFY is not set -# CONFIG_DMABUF_DEBUG is not set -# CONFIG_DMABUF_SELFTESTS is not set -# CONFIG_DMABUF_HEAPS is not set -# CONFIG_DMABUF_SYSFS_STATS is not set -# end of DMABUF options - -CONFIG_UIO=m -# CONFIG_UIO_CIF is not set -# CONFIG_UIO_PDRV_GENIRQ is not set -# CONFIG_UIO_DMEM_GENIRQ is not set -# CONFIG_UIO_AEC is not set -# CONFIG_UIO_SERCOS3 is not set -CONFIG_UIO_PCI_GENERIC=m -# CONFIG_UIO_NETX is not set -# CONFIG_UIO_MF624 is not set -CONFIG_VFIO=m -CONFIG_VFIO_GROUP=y -CONFIG_VFIO_CONTAINER=y -CONFIG_VFIO_IOMMU_TYPE1=m -CONFIG_VFIO_NOIOMMU=y -CONFIG_VFIO_VIRQFD=y -# CONFIG_VFIO_DEBUGFS is not set - -# VFIO support for PCI devices -CONFIG_VFIO_PCI_CORE=m -CONFIG_VFIO_PCI_MMAP=y -CONFIG_VFIO_PCI_INTX=y -CONFIG_VFIO_PCI=m -# CONFIG_NVGRACE_GPU_VFIO_PCI is not set -# end of VFIO support for PCI devices - -# VFIO support for platform devices -# CONFIG_VFIO_PLATFORM is not set -# CONFIG_VFIO_AMBA is not set -# end of VFIO support for platform devices - -CONFIG_IRQ_BYPASS_MANAGER=m -CONFIG_VIRT_DRIVERS=y -CONFIG_VMGENID=y -# CONFIG_NITRO_ENCLAVES is not set -# CONFIG_ARM_PKVM_GUEST is not set -# CONFIG_VIRTIO_MENU is not set -# CONFIG_VDPA is not set -CONFIG_VHOST_MENU=y -# CONFIG_VHOST_NET is not set -# CONFIG_VHOST_VSOCK is not set -# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set -CONFIG_VHOST_ENABLE_FORK_OWNER_CONTROL=y - -# Microsoft Hyper-V guest support -# CONFIG_HYPERV is not set -# end of Microsoft Hyper-V guest support - -# CONFIG_GREYBUS is not set -# CONFIG_COMEDI is not set -# CONFIG_STAGING is not set -# CONFIG_GOLDFISH is not set -# CONFIG_CHROME_PLATFORMS is not set -# CONFIG_MELLANOX_PLATFORM is not set -# CONFIG_SURFACE_PLATFORMS is not set -CONFIG_ARM64_PLATFORM_DEVICES=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_COMMON_CLK=y - -# Clock driver for ARM Reference designs -# CONFIG_CLK_ICST is not set -# CONFIG_CLK_SP810 is not set -# end of Clock driver for ARM Reference designs - -# CONFIG_COMMON_CLK_MAX9485 is not set -# CONFIG_COMMON_CLK_SCMI is not set -# CONFIG_COMMON_CLK_SCPI is not set -# CONFIG_COMMON_CLK_SI5341 is not set -# CONFIG_COMMON_CLK_SI5351 is not set -# CONFIG_COMMON_CLK_SI514 is not set -# CONFIG_COMMON_CLK_SI544 is not set -# CONFIG_COMMON_CLK_SI570 is not set -# CONFIG_COMMON_CLK_CDCE706 is not set -# CONFIG_COMMON_CLK_CDCE925 is not set -# CONFIG_COMMON_CLK_CS2000_CP is not set -# CONFIG_COMMON_CLK_AXI_CLKGEN is not set -# CONFIG_COMMON_CLK_XGENE is not set -# CONFIG_COMMON_CLK_RS9_PCIE is not set -# CONFIG_COMMON_CLK_SI521XX is not set -# CONFIG_COMMON_CLK_VC3 is not set -# CONFIG_COMMON_CLK_VC5 is not set -# CONFIG_COMMON_CLK_VC7 is not set -# CONFIG_COMMON_CLK_FIXED_MMIO is not set -# CONFIG_XILINX_VCU is not set -# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set -# CONFIG_HWSPINLOCK is not set - -# Clock Source drivers -CONFIG_TIMER_OF=y -CONFIG_TIMER_ACPI=y -CONFIG_TIMER_PROBE=y -CONFIG_ARM_ARCH_TIMER=y -CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y -CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND=y -CONFIG_FSL_ERRATUM_A008585=y -# CONFIG_HISILICON_ERRATUM_161010101 is not set -CONFIG_ARM64_ERRATUM_858921=y -# CONFIG_ARM_TIMER_SP804 is not set -# end of Clock Source drivers - -CONFIG_MAILBOX=y -# CONFIG_ARM_MHU is not set -# CONFIG_ARM_MHU_V2 is not set -# CONFIG_ARM_MHU_V3 is not set -# CONFIG_PLATFORM_MHU is not set -# CONFIG_PL320_MBOX is not set -CONFIG_PCC=y -# CONFIG_ALTERA_MBOX is not set -# CONFIG_MAILBOX_TEST is not set -CONFIG_IOMMU_IOVA=y -CONFIG_IOMMU_API=y -CONFIG_IOMMU_SUPPORT=y - -# Generic IOMMU Pagetable Support -CONFIG_IOMMU_IO_PGTABLE=y -CONFIG_IOMMU_IO_PGTABLE_LPAE=y -# CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set -# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set -# CONFIG_IOMMU_IO_PGTABLE_DART is not set -# end of Generic IOMMU Pagetable Support - -# CONFIG_IOMMU_DEBUGFS is not set -# CONFIG_IOMMU_DEFAULT_DMA_STRICT is not set -CONFIG_IOMMU_DEFAULT_DMA_LAZY=y -# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set -CONFIG_OF_IOMMU=y -CONFIG_IOMMU_DMA=y -# CONFIG_IOMMUFD is not set -# CONFIG_ARM_SMMU is not set -# CONFIG_ARM_SMMU_V3 is not set - -# Remoteproc drivers -# CONFIG_REMOTEPROC is not set -# end of Remoteproc drivers - -# Rpmsg drivers -# CONFIG_RPMSG_QCOM_GLINK_RPM is not set -# CONFIG_RPMSG_VIRTIO is not set -# end of Rpmsg drivers - -# CONFIG_SOUNDWIRE is not set - -# SOC (System On Chip) specific Drivers - -# Amlogic SoC drivers -# end of Amlogic SoC drivers - -# Broadcom SoC drivers -# end of Broadcom SoC drivers - -# NXP/Freescale QorIQ SoC drivers -# CONFIG_QUICC_ENGINE is not set -# end of NXP/Freescale QorIQ SoC drivers - -# fujitsu SoC drivers -# CONFIG_A64FX_DIAG is not set -# end of fujitsu SoC drivers - -# i.MX SoC drivers -# end of i.MX SoC drivers - -# Enable LiteX SoC Builder specific drivers -# CONFIG_LITEX_SOC_CONTROLLER is not set -# end of Enable LiteX SoC Builder specific drivers - -# CONFIG_WPCM450_SOC is not set - -# Qualcomm SoC drivers -# end of Qualcomm SoC drivers - -# CONFIG_SOC_TI is not set - -# Xilinx SoC drivers -# end of Xilinx SoC drivers -# end of SOC (System On Chip) specific Drivers - -# PM Domains - -# Amlogic PM Domains -# end of Amlogic PM Domains - -CONFIG_ARM_SCMI_PERF_DOMAIN=y -CONFIG_ARM_SCMI_POWER_DOMAIN=m -CONFIG_ARM_SCPI_POWER_DOMAIN=m - -# Broadcom PM Domains -# end of Broadcom PM Domains - -# i.MX PM Domains -# end of i.MX PM Domains - -# Qualcomm PM Domains -# end of Qualcomm PM Domains -# end of PM Domains - -# CONFIG_PM_DEVFREQ is not set -# CONFIG_EXTCON is not set -# CONFIG_MEMORY is not set -# CONFIG_IIO is not set -# CONFIG_NTB is not set -# CONFIG_PWM is not set - -# IRQ chip support -CONFIG_IRQCHIP=y -CONFIG_ARM_GIC=y -CONFIG_ARM_GIC_MAX_NR=1 -CONFIG_ARM_GIC_V2M=y -CONFIG_ARM_GIC_V3=y -CONFIG_ARM_GIC_V3_ITS=y -CONFIG_IRQ_MSI_LIB=y -# CONFIG_AL_FIC is not set -# CONFIG_XILINX_INTC is not set -CONFIG_PARTITION_PERCPU=y -# end of IRQ chip support - -# CONFIG_IPACK_BUS is not set -CONFIG_RESET_CONTROLLER=y -CONFIG_RESET_SCMI=y -CONFIG_RESET_SIMPLE=y -# CONFIG_RESET_TI_SYSCON is not set -# CONFIG_RESET_TI_TPS380X is not set - -# PHY Subsystem -# CONFIG_GENERIC_PHY is not set -# CONFIG_PHY_CAN_TRANSCEIVER is not set - -# PHY drivers for Broadcom platforms -# CONFIG_BCM_KONA_USB2_PHY is not set -# end of PHY drivers for Broadcom platforms - -# CONFIG_PHY_CADENCE_TORRENT is not set -# CONFIG_PHY_CADENCE_DPHY is not set -# CONFIG_PHY_CADENCE_DPHY_RX is not set -# CONFIG_PHY_CADENCE_SIERRA is not set -# CONFIG_PHY_CADENCE_SALVO is not set -# CONFIG_PHY_PXA_28NM_HSIC is not set -# CONFIG_PHY_PXA_28NM_USB2 is not set -# CONFIG_PHY_LAN966X_SERDES is not set -# CONFIG_PHY_OCELOT_SERDES is not set -# end of PHY Subsystem - -# CONFIG_POWERCAP is not set -# CONFIG_MCB is not set - -# Performance monitor support -CONFIG_ARM_CCI_PMU=m -CONFIG_ARM_CCI400_PMU=y -CONFIG_ARM_CCI5xx_PMU=y -CONFIG_ARM_CCN=m -# CONFIG_ARM_CMN is not set -# CONFIG_ARM_NI is not set -CONFIG_ARM_PMU=y -CONFIG_ARM_PMU_ACPI=y -# CONFIG_ARM_SMMU_V3_PMU is not set -CONFIG_ARM_PMUV3=y -# CONFIG_ARM_DSU_PMU is not set -# CONFIG_ARM_SPE_PMU is not set -# CONFIG_ARM_DMC620_PMU is not set -# CONFIG_ALIBABA_UNCORE_DRW_PMU is not set -# CONFIG_HISI_PMU is not set -# CONFIG_HISI_PCIE_PMU is not set -# CONFIG_HNS3_PMU is not set -# CONFIG_DWC_PCIE_PMU is not set -# CONFIG_ARM_CORESIGHT_PMU_ARCH_SYSTEM_PMU is not set -# end of Performance monitor support - -# CONFIG_RAS is not set -# CONFIG_USB4 is not set - -# Android -# CONFIG_ANDROID_BINDER_IPC is not set -# end of Android - -CONFIG_LIBNVDIMM=m -CONFIG_BLK_DEV_PMEM=m -CONFIG_ND_CLAIM=y -CONFIG_ND_BTT=m -CONFIG_BTT=y -CONFIG_OF_PMEM=m -CONFIG_DAX=y -CONFIG_DEV_DAX=m -CONFIG_NVMEM=y -CONFIG_NVMEM_SYSFS=y -CONFIG_NVMEM_LAYOUTS=y - -# Layout Types -# CONFIG_NVMEM_LAYOUT_SL28_VPD is not set -# CONFIG_NVMEM_LAYOUT_ONIE_TLV is not set -# CONFIG_NVMEM_LAYOUT_U_BOOT_ENV is not set -# end of Layout Types - -# CONFIG_NVMEM_RMEM is not set - -# HW tracing support -# CONFIG_STM is not set -# CONFIG_INTEL_TH is not set -# CONFIG_HISI_PTT is not set -# end of HW tracing support - -# CONFIG_FPGA is not set -# CONFIG_FSI is not set -# CONFIG_TEE is not set -# CONFIG_SIOX is not set -# CONFIG_SLIMBUS is not set -# CONFIG_INTERCONNECT is not set -# CONFIG_COUNTER is not set -# CONFIG_MOST is not set -# CONFIG_PECI is not set -# CONFIG_HTE is not set -# CONFIG_CDX_BUS is not set -# end of Device Drivers - -# File systems -CONFIG_DCACHE_WORD_ACCESS=y -CONFIG_VALIDATE_FS_PARSER=y -CONFIG_FS_IOMAP=y -CONFIG_FS_STACK=y -CONFIG_BUFFER_HEAD=y -CONFIG_LEGACY_DIRECT_IO=y -# CONFIG_EXT2_FS is not set -# CONFIG_EXT3_FS is not set -CONFIG_EXT4_FS=y -CONFIG_EXT4_USE_FOR_EXT2=y -CONFIG_EXT4_FS_POSIX_ACL=y -CONFIG_EXT4_FS_SECURITY=y -# CONFIG_EXT4_DEBUG is not set -CONFIG_JBD2=y -# CONFIG_JBD2_DEBUG is not set -CONFIG_FS_MBCACHE=y -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -CONFIG_XFS_FS=m -CONFIG_XFS_SUPPORT_V4=y -CONFIG_XFS_SUPPORT_ASCII_CI=y -CONFIG_XFS_QUOTA=y -CONFIG_XFS_POSIX_ACL=y -CONFIG_XFS_RT=y -# CONFIG_XFS_ONLINE_SCRUB is not set -# CONFIG_XFS_WARN is not set -# CONFIG_XFS_DEBUG is not set -# CONFIG_GFS2_FS is not set -# CONFIG_OCFS2_FS is not set -CONFIG_BTRFS_FS=m -CONFIG_BTRFS_FS_POSIX_ACL=y -# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set -# CONFIG_BTRFS_DEBUG is not set -# CONFIG_BTRFS_ASSERT is not set -# CONFIG_BTRFS_FS_REF_VERIFY is not set -# CONFIG_NILFS2_FS is not set -# CONFIG_F2FS_FS is not set -# CONFIG_BCACHEFS_FS is not set -CONFIG_FS_POSIX_ACL=y -CONFIG_EXPORTFS=y -CONFIG_EXPORTFS_BLOCK_OPS=y -CONFIG_FILE_LOCKING=y -# CONFIG_FS_ENCRYPTION is not set -# CONFIG_FS_VERITY is not set -CONFIG_FSNOTIFY=y -CONFIG_DNOTIFY=y -CONFIG_INOTIFY_USER=y -CONFIG_FANOTIFY=y -CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y -CONFIG_QUOTA=y -CONFIG_QUOTA_NETLINK_INTERFACE=y -# CONFIG_QUOTA_DEBUG is not set -# CONFIG_QFMT_V1 is not set -# CONFIG_QFMT_V2 is not set -CONFIG_QUOTACTL=y -CONFIG_AUTOFS_FS=m -CONFIG_FUSE_FS=m -# CONFIG_CUSE is not set -# CONFIG_VIRTIO_FS is not set -CONFIG_FUSE_PASSTHROUGH=y -CONFIG_OVERLAY_FS=m -# CONFIG_OVERLAY_FS_REDIRECT_DIR is not set -CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW=y -# CONFIG_OVERLAY_FS_INDEX is not set -# CONFIG_OVERLAY_FS_XINO_AUTO is not set -# CONFIG_OVERLAY_FS_METACOPY is not set -# CONFIG_OVERLAY_FS_DEBUG is not set - -# Caches -CONFIG_NETFS_SUPPORT=m -# CONFIG_NETFS_STATS is not set -# CONFIG_NETFS_DEBUG is not set -CONFIG_FSCACHE=y -# CONFIG_FSCACHE_STATS is not set -# CONFIG_CACHEFILES is not set -# end of Caches - -# CD-ROM/DVD Filesystems -CONFIG_ISO9660_FS=m -CONFIG_JOLIET=y -# CONFIG_ZISOFS is not set -CONFIG_UDF_FS=m -# end of CD-ROM/DVD Filesystems - -# DOS/FAT/EXFAT/NT Filesystems -CONFIG_FAT_FS=m -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m -CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="ascii" -# CONFIG_FAT_DEFAULT_UTF8 is not set -# CONFIG_EXFAT_FS is not set -# CONFIG_NTFS3_FS is not set -# CONFIG_NTFS_FS is not set -# end of DOS/FAT/EXFAT/NT Filesystems - -# Pseudo filesystems -CONFIG_PROC_FS=y -# CONFIG_PROC_KCORE is not set -CONFIG_PROC_SYSCTL=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_PROC_CHILDREN=y -CONFIG_KERNFS=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -CONFIG_TMPFS_POSIX_ACL=y -CONFIG_TMPFS_XATTR=y -# CONFIG_TMPFS_INODE64 is not set -# CONFIG_TMPFS_QUOTA is not set -CONFIG_ARCH_SUPPORTS_HUGETLBFS=y -CONFIG_HUGETLBFS=y -CONFIG_HUGETLB_PAGE=y -CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING=y -CONFIG_ARCH_HAS_GIGANTIC_PAGE=y -CONFIG_CONFIGFS_FS=m -CONFIG_EFIVAR_FS=m -# end of Pseudo filesystems - -CONFIG_MISC_FILESYSTEMS=y -# CONFIG_ORANGEFS_FS is not set -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_ECRYPT_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -# CONFIG_CRAMFS is not set -CONFIG_SQUASHFS=m -CONFIG_SQUASHFS_FILE_CACHE=y -# CONFIG_SQUASHFS_FILE_DIRECT is not set -CONFIG_SQUASHFS_DECOMP_SINGLE=y -# CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set -CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE=y -# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is not set -# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set -# CONFIG_SQUASHFS_XATTR is not set -CONFIG_SQUASHFS_ZLIB=y -# CONFIG_SQUASHFS_LZ4 is not set -CONFIG_SQUASHFS_LZO=y -CONFIG_SQUASHFS_XZ=y -CONFIG_SQUASHFS_ZSTD=y -# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set -# CONFIG_SQUASHFS_EMBEDDED is not set -CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 -# CONFIG_VXFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_OMFS_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_QNX6FS_FS is not set -# CONFIG_ROMFS_FS is not set -# CONFIG_PSTORE is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set -# CONFIG_EROFS_FS is not set -# CONFIG_VTAR is not set -# CONFIG_VTARFS is not set -# CONFIG_TARFS is not set -CONFIG_NETWORK_FILESYSTEMS=y -CONFIG_NFS_FS=m -CONFIG_NFS_V2=m -CONFIG_NFS_V3=m -CONFIG_NFS_V3_ACL=y -CONFIG_NFS_V4=m -# CONFIG_NFS_SWAP is not set -CONFIG_NFS_V4_1=y -CONFIG_NFS_V4_2=y -CONFIG_PNFS_FILE_LAYOUT=m -CONFIG_PNFS_BLOCK=m -CONFIG_PNFS_FLEXFILE_LAYOUT=m -CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org" -# CONFIG_NFS_V4_1_MIGRATION is not set -CONFIG_NFS_V4_SECURITY_LABEL=y -CONFIG_NFS_FSCACHE=y -# CONFIG_NFS_USE_LEGACY_DNS is not set -CONFIG_NFS_USE_KERNEL_DNS=y -CONFIG_NFS_DEBUG=y -CONFIG_NFS_DISABLE_UDP_SUPPORT=y -# CONFIG_NFS_V4_2_READ_PLUS is not set -CONFIG_NFSD=m -# CONFIG_NFSD_V2 is not set -CONFIG_NFSD_V3_ACL=y -CONFIG_NFSD_V4=y -CONFIG_NFSD_PNFS=y -CONFIG_NFSD_BLOCKLAYOUT=y -CONFIG_NFSD_SCSILAYOUT=y -CONFIG_NFSD_FLEXFILELAYOUT=y -# CONFIG_NFSD_V4_2_INTER_SSC is not set -# CONFIG_NFSD_V4_SECURITY_LABEL is not set -# CONFIG_NFSD_LEGACY_CLIENT_TRACKING is not set -CONFIG_GRACE_PERIOD=m -CONFIG_LOCKD=m -CONFIG_LOCKD_V4=y -CONFIG_NFS_ACL_SUPPORT=m -CONFIG_NFS_COMMON=y -# CONFIG_NFS_LOCALIO is not set -CONFIG_NFS_V4_2_SSC_HELPER=y -CONFIG_SUNRPC=m -CONFIG_SUNRPC_GSS=m -CONFIG_SUNRPC_BACKCHANNEL=y -CONFIG_RPCSEC_GSS_KRB5=m -CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_AES_SHA1=y -# CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_AES_SHA2 is not set -CONFIG_SUNRPC_DEBUG=y -# CONFIG_CEPH_FS is not set -CONFIG_CIFS=m -CONFIG_CIFS_STATS2=y -# CONFIG_CIFS_ALLOW_INSECURE_LEGACY is not set -CONFIG_CIFS_UPCALL=y -CONFIG_CIFS_XATTR=y -CONFIG_CIFS_DEBUG=y -# CONFIG_CIFS_DEBUG2 is not set -# CONFIG_CIFS_DEBUG_DUMP_KEYS is not set -CONFIG_CIFS_DFS_UPCALL=y -# CONFIG_CIFS_SWN_UPCALL is not set -# CONFIG_CIFS_FSCACHE is not set -# CONFIG_CIFS_COMPRESSION is not set -# CONFIG_SMB_SERVER is not set -CONFIG_SMBFS=m -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set -CONFIG_9P_FS=m -# CONFIG_9P_FSCACHE is not set -CONFIG_9P_FS_POSIX_ACL=y -CONFIG_9P_FS_SECURITY=y -CONFIG_NLS=y -CONFIG_NLS_DEFAULT="utf8" -CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_CODEPAGE_737=m -CONFIG_NLS_CODEPAGE_775=m -CONFIG_NLS_CODEPAGE_850=m -CONFIG_NLS_CODEPAGE_852=m -CONFIG_NLS_CODEPAGE_855=m -CONFIG_NLS_CODEPAGE_857=m -CONFIG_NLS_CODEPAGE_860=m -CONFIG_NLS_CODEPAGE_861=m -CONFIG_NLS_CODEPAGE_862=m -CONFIG_NLS_CODEPAGE_863=m -CONFIG_NLS_CODEPAGE_864=m -CONFIG_NLS_CODEPAGE_865=m -CONFIG_NLS_CODEPAGE_866=m -CONFIG_NLS_CODEPAGE_869=m -CONFIG_NLS_CODEPAGE_936=m -CONFIG_NLS_CODEPAGE_950=m -CONFIG_NLS_CODEPAGE_932=m -CONFIG_NLS_CODEPAGE_949=m -CONFIG_NLS_CODEPAGE_874=m -CONFIG_NLS_ISO8859_8=m -CONFIG_NLS_CODEPAGE_1250=m -CONFIG_NLS_CODEPAGE_1251=m -CONFIG_NLS_ASCII=y -CONFIG_NLS_ISO8859_1=m -CONFIG_NLS_ISO8859_2=m -CONFIG_NLS_ISO8859_3=m -CONFIG_NLS_ISO8859_4=m -CONFIG_NLS_ISO8859_5=m -CONFIG_NLS_ISO8859_6=m -CONFIG_NLS_ISO8859_7=m -CONFIG_NLS_ISO8859_9=m -CONFIG_NLS_ISO8859_13=m -CONFIG_NLS_ISO8859_14=m -CONFIG_NLS_ISO8859_15=m -CONFIG_NLS_KOI8_R=m -CONFIG_NLS_KOI8_U=m -CONFIG_NLS_MAC_ROMAN=m -CONFIG_NLS_MAC_CELTIC=m -CONFIG_NLS_MAC_CENTEURO=m -CONFIG_NLS_MAC_CROATIAN=m -CONFIG_NLS_MAC_CYRILLIC=m -CONFIG_NLS_MAC_GAELIC=m -CONFIG_NLS_MAC_GREEK=m -CONFIG_NLS_MAC_ICELAND=m -CONFIG_NLS_MAC_INUIT=m -CONFIG_NLS_MAC_ROMANIAN=m -CONFIG_NLS_MAC_TURKISH=m -CONFIG_NLS_UTF8=y -CONFIG_NLS_UCS2_UTILS=m -# CONFIG_DLM is not set -# CONFIG_UNICODE is not set -CONFIG_IO_WQ=y -# end of File systems - -# Security options -CONFIG_KEYS=y -# CONFIG_KEYS_REQUEST_CACHE is not set -# CONFIG_PERSISTENT_KEYRINGS is not set -# CONFIG_TRUSTED_KEYS is not set -# CONFIG_ENCRYPTED_KEYS is not set -# CONFIG_KEY_DH_OPERATIONS is not set -# CONFIG_SECURITY_DMESG_RESTRICT is not set -CONFIG_PROC_MEM_ALWAYS_FORCE=y -# CONFIG_PROC_MEM_FORCE_PTRACE is not set -# CONFIG_PROC_MEM_NO_FORCE is not set -CONFIG_SECURITY=y -CONFIG_SECURITYFS=y -CONFIG_SECURITY_NETWORK=y -# CONFIG_SECURITY_NETWORK_XFRM is not set -CONFIG_SECURITY_PATH=y -CONFIG_LSM_MMAP_MIN_ADDR=65536 -CONFIG_HARDENED_USERCOPY=y -CONFIG_FORTIFY_SOURCE=y -# CONFIG_STATIC_USERMODEHELPER is not set -CONFIG_SECURITY_SELINUX=y -CONFIG_SECURITY_SELINUX_BOOTPARAM=y -CONFIG_SECURITY_SELINUX_DEVELOP=y -CONFIG_SECURITY_SELINUX_AVC_STATS=y -CONFIG_SECURITY_SELINUX_SIDTAB_HASH_BITS=9 -CONFIG_SECURITY_SELINUX_SID2STR_CACHE_SIZE=256 -# CONFIG_SECURITY_SELINUX_DEBUG is not set -# CONFIG_SECURITY_SMACK is not set -# CONFIG_SECURITY_TOMOYO is not set -CONFIG_SECURITY_APPARMOR=y -# CONFIG_SECURITY_APPARMOR_DEBUG is not set -CONFIG_SECURITY_APPARMOR_INTROSPECT_POLICY=y -CONFIG_SECURITY_APPARMOR_HASH=y -CONFIG_SECURITY_APPARMOR_HASH_DEFAULT=y -CONFIG_SECURITY_APPARMOR_EXPORT_BINARY=y -CONFIG_SECURITY_APPARMOR_PARANOID_LOAD=y -# CONFIG_SECURITY_LOADPIN is not set -CONFIG_SECURITY_YAMA=y -# CONFIG_SECURITY_SAFESETID is not set -# CONFIG_SECURITY_LOCKDOWN_LSM is not set -# CONFIG_SECURITY_LANDLOCK is not set -# CONFIG_SECURITY_IPE is not set -CONFIG_INTEGRITY=y -# CONFIG_INTEGRITY_SIGNATURE is not set -CONFIG_INTEGRITY_AUDIT=y -CONFIG_IMA=y -CONFIG_IMA_MEASURE_PCR_IDX=10 -CONFIG_IMA_LSM_RULES=y -CONFIG_IMA_NG_TEMPLATE=y -# CONFIG_IMA_SIG_TEMPLATE is not set -CONFIG_IMA_DEFAULT_TEMPLATE="ima-ng" -# CONFIG_IMA_DEFAULT_HASH_SHA1 is not set -CONFIG_IMA_DEFAULT_HASH_SHA256=y -# CONFIG_IMA_DEFAULT_HASH_SHA512 is not set -CONFIG_IMA_DEFAULT_HASH="sha256" -# CONFIG_IMA_WRITE_POLICY is not set -CONFIG_IMA_READ_POLICY=y -# CONFIG_IMA_APPRAISE is not set -CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS=y -CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS=y -# CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT is not set -# CONFIG_IMA_DISABLE_HTABLE is not set -# CONFIG_EVM is not set -CONFIG_DEFAULT_SECURITY_SELINUX=y -# CONFIG_DEFAULT_SECURITY_APPARMOR is not set -# CONFIG_DEFAULT_SECURITY_DAC is not set -CONFIG_LSM="lockdown,yama,loadpin,safesetid,integrity,selinux,apparmor,smack,tomoyo" - -# Kernel hardening options - -# Memory initialization -CONFIG_CC_HAS_AUTO_VAR_INIT_PATTERN=y -CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO_BARE=y -CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO=y -CONFIG_INIT_STACK_NONE=y -# CONFIG_INIT_STACK_ALL_PATTERN is not set -# CONFIG_INIT_STACK_ALL_ZERO is not set -# CONFIG_GCC_PLUGIN_STACKLEAK is not set -# CONFIG_INIT_ON_ALLOC_DEFAULT_ON is not set -# CONFIG_INIT_ON_FREE_DEFAULT_ON is not set -CONFIG_CC_HAS_ZERO_CALL_USED_REGS=y -# CONFIG_ZERO_CALL_USED_REGS is not set -# end of Memory initialization - -# Hardening of kernel data structures -# CONFIG_LIST_HARDENED is not set -# CONFIG_BUG_ON_DATA_CORRUPTION is not set -# end of Hardening of kernel data structures - -CONFIG_RANDSTRUCT_NONE=y -# CONFIG_RANDSTRUCT_FULL is not set -# CONFIG_RANDSTRUCT_PERFORMANCE is not set -# end of Kernel hardening options -# end of Security options - -CONFIG_XOR_BLOCKS=m -CONFIG_CRYPTO=y - -# Crypto core or helper -CONFIG_CRYPTO_FIPS=y -CONFIG_CRYPTO_FIPS_NAME="Linux Kernel Cryptographic API" -# CONFIG_CRYPTO_FIPS_CUSTOM_VERSION is not set -CONFIG_CRYPTO_ALGAPI=y -CONFIG_CRYPTO_ALGAPI2=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_SIG=y -CONFIG_CRYPTO_SIG2=y -CONFIG_CRYPTO_SKCIPHER=y -CONFIG_CRYPTO_SKCIPHER2=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_RNG_DEFAULT=y -CONFIG_CRYPTO_AKCIPHER2=y -CONFIG_CRYPTO_AKCIPHER=y -CONFIG_CRYPTO_KPP2=y -CONFIG_CRYPTO_KPP=y -CONFIG_CRYPTO_ACOMP2=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -# CONFIG_CRYPTO_USER is not set -# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set -# CONFIG_CRYPTO_MANAGER_EXTRA_TESTS is not set -CONFIG_CRYPTO_NULL=y -CONFIG_CRYPTO_NULL2=y -CONFIG_CRYPTO_PCRYPT=m -CONFIG_CRYPTO_CRYPTD=y -CONFIG_CRYPTO_AUTHENC=m -CONFIG_CRYPTO_TEST=m -# end of Crypto core or helper - -# Public-key cryptography -CONFIG_CRYPTO_RSA=y -# CONFIG_CRYPTO_DH is not set -CONFIG_CRYPTO_ECC=y -CONFIG_CRYPTO_ECDH=y -CONFIG_CRYPTO_ECDSA=y -# CONFIG_CRYPTO_ECRDSA is not set -# CONFIG_CRYPTO_CURVE25519 is not set -# end of Public-key cryptography - -# Block ciphers -CONFIG_CRYPTO_AES=y -# CONFIG_CRYPTO_AES_TI is not set -# CONFIG_CRYPTO_ANUBIS is not set -# CONFIG_CRYPTO_ARIA is not set -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -CONFIG_CRYPTO_DES=y -# CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SEED is not set -# CONFIG_CRYPTO_SERPENT is not set -CONFIG_CRYPTO_SM4=m -# CONFIG_CRYPTO_SM4_GENERIC is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TWOFISH is not set -# end of Block ciphers - -# Length-preserving ciphers and modes -# CONFIG_CRYPTO_ADIANTUM is not set -CONFIG_CRYPTO_ARC4=m -# CONFIG_CRYPTO_CHACHA20 is not set -CONFIG_CRYPTO_CBC=y -CONFIG_CRYPTO_CTR=y -CONFIG_CRYPTO_CTS=y -CONFIG_CRYPTO_ECB=y -# CONFIG_CRYPTO_HCTR2 is not set -# CONFIG_CRYPTO_KEYWRAP is not set -# CONFIG_CRYPTO_LRW is not set -# CONFIG_CRYPTO_PCBC is not set -CONFIG_CRYPTO_XTS=y -CONFIG_CRYPTO_NHPOLY1305=m -# end of Length-preserving ciphers and modes - -# AEAD (authenticated encryption with associated data) ciphers -# CONFIG_CRYPTO_AEGIS128 is not set -# CONFIG_CRYPTO_CHACHA20POLY1305 is not set -CONFIG_CRYPTO_CCM=y -CONFIG_CRYPTO_GCM=y -CONFIG_CRYPTO_GENIV=y -CONFIG_CRYPTO_SEQIV=y -CONFIG_CRYPTO_ECHAINIV=m -CONFIG_CRYPTO_ESSIV=m -# end of AEAD (authenticated encryption with associated data) ciphers - -# Hashes, digests, and MACs -CONFIG_CRYPTO_BLAKE2B=m -CONFIG_CRYPTO_CMAC=y -CONFIG_CRYPTO_GHASH=y -CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_MD4=m -CONFIG_CRYPTO_MD5=y -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_POLY1305 is not set -# CONFIG_CRYPTO_RMD160 is not set -CONFIG_CRYPTO_SHA1=y -CONFIG_CRYPTO_SHA256=y -CONFIG_CRYPTO_SHA512=y -CONFIG_CRYPTO_SHA3=y -CONFIG_CRYPTO_SM3=m -# CONFIG_CRYPTO_SM3_GENERIC is not set -# CONFIG_CRYPTO_STREEBOG is not set -# CONFIG_CRYPTO_VMAC is not set -# CONFIG_CRYPTO_WP512 is not set -# CONFIG_CRYPTO_XCBC is not set -CONFIG_CRYPTO_XXHASH=m -# end of Hashes, digests, and MACs - -# CRCs (cyclic redundancy checks) -CONFIG_CRYPTO_CRC32C=y -# CONFIG_CRYPTO_CRC32 is not set -CONFIG_CRYPTO_CRCT10DIF=y -CONFIG_CRYPTO_CRC64_ROCKSOFT=m -# end of CRCs (cyclic redundancy checks) - -# Compression -CONFIG_CRYPTO_DEFLATE=m -# CONFIG_CRYPTO_LZO is not set -# CONFIG_CRYPTO_842 is not set -# CONFIG_CRYPTO_LZ4 is not set -# CONFIG_CRYPTO_LZ4HC is not set -# CONFIG_CRYPTO_ZSTD is not set -# end of Compression - -# Random number generation -CONFIG_CRYPTO_ANSI_CPRNG=m -CONFIG_CRYPTO_DRBG_MENU=y -CONFIG_CRYPTO_DRBG_HMAC=y -CONFIG_CRYPTO_DRBG_HASH=y -CONFIG_CRYPTO_DRBG_CTR=y -CONFIG_CRYPTO_DRBG=y -CONFIG_CRYPTO_JITTERENTROPY=y -CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_2=y -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_8 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_32 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_64 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_128 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_1024 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_8192 is not set -CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKS=64 -CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE=32 -CONFIG_CRYPTO_JITTERENTROPY_OSR=3 -# CONFIG_CRYPTO_JITTERENTROPY_TESTINTERFACE is not set -# end of Random number generation - -# Userspace interface -CONFIG_CRYPTO_USER_API=m -CONFIG_CRYPTO_USER_API_HASH=m -CONFIG_CRYPTO_USER_API_SKCIPHER=m -CONFIG_CRYPTO_USER_API_RNG=m -# CONFIG_CRYPTO_USER_API_RNG_CAVP is not set -# CONFIG_CRYPTO_USER_API_AEAD is not set -CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y -# end of Userspace interface - -CONFIG_CRYPTO_HASH_INFO=y -CONFIG_CRYPTO_NHPOLY1305_NEON=m -CONFIG_CRYPTO_CHACHA20_NEON=m - -# Accelerated Cryptographic Algorithms for CPU (arm64) -CONFIG_CRYPTO_GHASH_ARM64_CE=m -CONFIG_CRYPTO_POLY1305_NEON=m -CONFIG_CRYPTO_SHA1_ARM64_CE=m -CONFIG_CRYPTO_SHA256_ARM64=m -CONFIG_CRYPTO_SHA2_ARM64_CE=m -CONFIG_CRYPTO_SHA512_ARM64=m -CONFIG_CRYPTO_SHA512_ARM64_CE=m -CONFIG_CRYPTO_SHA3_ARM64=m -# CONFIG_CRYPTO_SM3_NEON is not set -CONFIG_CRYPTO_SM3_ARM64_CE=m -# CONFIG_CRYPTO_POLYVAL_ARM64_CE is not set -CONFIG_CRYPTO_AES_ARM64=m -CONFIG_CRYPTO_AES_ARM64_CE=m -CONFIG_CRYPTO_AES_ARM64_CE_BLK=m -CONFIG_CRYPTO_AES_ARM64_NEON_BLK=m -CONFIG_CRYPTO_AES_ARM64_BS=m -CONFIG_CRYPTO_SM4_ARM64_CE=m -# CONFIG_CRYPTO_SM4_ARM64_CE_BLK is not set -# CONFIG_CRYPTO_SM4_ARM64_NEON_BLK is not set -CONFIG_CRYPTO_AES_ARM64_CE_CCM=m -# CONFIG_CRYPTO_SM4_ARM64_CE_CCM is not set -# CONFIG_CRYPTO_SM4_ARM64_CE_GCM is not set -# end of Accelerated Cryptographic Algorithms for CPU (arm64) - -# CONFIG_CRYPTO_HW is not set -CONFIG_ASYMMETRIC_KEY_TYPE=y -CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y -CONFIG_X509_CERTIFICATE_PARSER=y -# CONFIG_PKCS8_PRIVATE_KEY_PARSER is not set -CONFIG_PKCS7_MESSAGE_PARSER=y -# CONFIG_PKCS7_TEST_KEY is not set -# CONFIG_SIGNED_PE_FILE_VERIFICATION is not set -# CONFIG_FIPS_SIGNATURE_SELFTEST is not set - -# Certificates for signature checking -CONFIG_MODULE_SIG_KEY="certs/signing_key.pem" -CONFIG_MODULE_SIG_KEY_TYPE_RSA=y -# CONFIG_MODULE_SIG_KEY_TYPE_ECDSA is not set -CONFIG_SYSTEM_TRUSTED_KEYRING=y -CONFIG_SYSTEM_TRUSTED_KEYS="photon-cert-bundle.pem" -# CONFIG_SYSTEM_EXTRA_CERTIFICATE is not set -# CONFIG_SECONDARY_TRUSTED_KEYRING is not set -# CONFIG_SYSTEM_BLACKLIST_KEYRING is not set -# end of Certificates for signature checking - -CONFIG_BINARY_PRINTF=y - -# Library routines -CONFIG_RAID6_PQ=m -# CONFIG_RAID6_PQ_BENCHMARK is not set -# CONFIG_PACKING is not set -CONFIG_BITREVERSE=y -CONFIG_HAVE_ARCH_BITREVERSE=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_NET_UTILS=y -# CONFIG_CORDIC is not set -# CONFIG_PRIME_NUMBERS is not set -CONFIG_RATIONAL=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -CONFIG_ARCH_HAS_FAST_MULTIPLIER=y -CONFIG_ARCH_USE_SYM_ANNOTATIONS=y -# CONFIG_INDIRECT_PIO is not set - -# Crypto library routines -CONFIG_CRYPTO_LIB_UTILS=y -CONFIG_CRYPTO_LIB_AES=y -CONFIG_CRYPTO_LIB_AESCFB=y -CONFIG_CRYPTO_LIB_ARC4=m -CONFIG_CRYPTO_LIB_GF128MUL=y -CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y -CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=y -CONFIG_CRYPTO_LIB_CHACHA_GENERIC=m -CONFIG_CRYPTO_LIB_CHACHA_INTERNAL=m -CONFIG_CRYPTO_LIB_CHACHA=m -CONFIG_CRYPTO_LIB_CURVE25519_GENERIC=m -CONFIG_CRYPTO_LIB_CURVE25519_INTERNAL=m -CONFIG_CRYPTO_LIB_CURVE25519=m -CONFIG_CRYPTO_LIB_DES=y -CONFIG_CRYPTO_LIB_POLY1305_RSIZE=9 -CONFIG_CRYPTO_ARCH_HAVE_LIB_POLY1305=y -CONFIG_CRYPTO_LIB_POLY1305_GENERIC=m -CONFIG_CRYPTO_LIB_POLY1305_INTERNAL=m -CONFIG_CRYPTO_LIB_POLY1305=m -CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m -CONFIG_CRYPTO_LIB_SHA1=y -CONFIG_CRYPTO_LIB_SHA256=y -# end of Crypto library routines - -# CONFIG_CRC_CCITT is not set -CONFIG_CRC16=y -# CONFIG_CRC_T10DIF is not set -# CONFIG_CRC64_ROCKSOFT is not set -CONFIG_CRC_ITU_T=m -CONFIG_CRC32=y -# CONFIG_CRC32_SELFTEST is not set -CONFIG_CRC32_SLICEBY8=y -# CONFIG_CRC32_SLICEBY4 is not set -# CONFIG_CRC32_SARWATE is not set -# CONFIG_CRC32_BIT is not set -CONFIG_CRC64=m -# CONFIG_CRC4 is not set -# CONFIG_CRC7 is not set -CONFIG_LIBCRC32C=y -# CONFIG_CRC8 is not set -CONFIG_XXHASH=y -CONFIG_AUDIT_GENERIC=y -CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y -CONFIG_AUDIT_COMPAT_GENERIC=y -# CONFIG_RANDOM32_SELFTEST is not set -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=m -CONFIG_LZO_COMPRESS=m -CONFIG_LZO_DECOMPRESS=y -CONFIG_LZ4_DECOMPRESS=y -CONFIG_ZSTD_COMMON=y -CONFIG_ZSTD_COMPRESS=y -CONFIG_ZSTD_DECOMPRESS=y -CONFIG_XZ_DEC=y -# CONFIG_XZ_DEC_X86 is not set -# CONFIG_XZ_DEC_POWERPC is not set -# CONFIG_XZ_DEC_ARM is not set -# CONFIG_XZ_DEC_ARMTHUMB is not set -CONFIG_XZ_DEC_ARM64=y -# CONFIG_XZ_DEC_SPARC is not set -# CONFIG_XZ_DEC_RISCV is not set -# CONFIG_XZ_DEC_MICROLZMA is not set -CONFIG_XZ_DEC_BCJ=y -# CONFIG_XZ_DEC_TEST is not set -CONFIG_DECOMPRESS_GZIP=y -CONFIG_DECOMPRESS_BZIP2=y -CONFIG_DECOMPRESS_LZMA=y -CONFIG_DECOMPRESS_XZ=y -CONFIG_DECOMPRESS_LZO=y -CONFIG_DECOMPRESS_LZ4=y -CONFIG_DECOMPRESS_ZSTD=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_TEXTSEARCH=y -CONFIG_TEXTSEARCH_KMP=m -CONFIG_TEXTSEARCH_BM=m -CONFIG_TEXTSEARCH_FSM=m -CONFIG_INTERVAL_TREE=y -CONFIG_XARRAY_MULTI=y -CONFIG_ASSOCIATIVE_ARRAY=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAS_IOPORT_MAP=y -CONFIG_HAS_DMA=y -CONFIG_DMA_OPS_HELPERS=y -CONFIG_NEED_SG_DMA_FLAGS=y -CONFIG_NEED_SG_DMA_LENGTH=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_ARCH_DMA_ADDR_T_64BIT=y -CONFIG_DMA_DECLARE_COHERENT=y -CONFIG_ARCH_HAS_SETUP_DMA_OPS=y -CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y -CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU=y -CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y -CONFIG_SWIOTLB=y -# CONFIG_SWIOTLB_DYNAMIC is not set -CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC=y -CONFIG_DMA_NEED_SYNC=y -# CONFIG_DMA_RESTRICTED_POOL is not set -CONFIG_DMA_NONCOHERENT_MMAP=y -CONFIG_DMA_COHERENT_POOL=y -CONFIG_DMA_DIRECT_REMAP=y -# CONFIG_DMA_API_DEBUG is not set -# CONFIG_DMA_MAP_BENCHMARK is not set -CONFIG_SGL_ALLOC=y -CONFIG_CPU_RMAP=y -CONFIG_DQL=y -CONFIG_GLOB=y -# CONFIG_GLOB_SELFTEST is not set -CONFIG_NLATTR=y -CONFIG_CLZ_TAB=y -CONFIG_IRQ_POLL=y -CONFIG_MPILIB=y -CONFIG_DIMLIB=y -CONFIG_LIBFDT=y -CONFIG_OID_REGISTRY=y -CONFIG_UCS2_STRING=y -CONFIG_HAVE_GENERIC_VDSO=y -CONFIG_GENERIC_GETTIMEOFDAY=y -CONFIG_GENERIC_VDSO_TIME_NS=y -CONFIG_VDSO_GETRANDOM=y -CONFIG_FONT_SUPPORT=y -# CONFIG_FONTS is not set -CONFIG_FONT_8x8=y -CONFIG_FONT_8x16=y -CONFIG_SG_POOL=y -CONFIG_ARCH_HAS_PMEM_API=y -CONFIG_MEMREGION=y -CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y -CONFIG_ARCH_STACKWALK=y -CONFIG_STACKDEPOT=y -CONFIG_STACKDEPOT_MAX_FRAMES=64 -CONFIG_SBITMAP=y -# CONFIG_LWQ_TEST is not set -# end of Library routines - -CONFIG_GENERIC_IOREMAP=y -CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y -CONFIG_FIRMWARE_TABLE=y - -# Kernel hacking - -# printk and dmesg options -CONFIG_PRINTK_TIME=y -# CONFIG_PRINTK_CALLER is not set -# CONFIG_STACKTRACE_BUILD_ID is not set -CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 -CONFIG_CONSOLE_LOGLEVEL_QUIET=4 -CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 -# CONFIG_BOOT_PRINTK_DELAY is not set -CONFIG_DYNAMIC_DEBUG=y -CONFIG_DYNAMIC_DEBUG_CORE=y -CONFIG_SYMBOLIC_ERRNAME=y -CONFIG_DEBUG_BUGVERBOSE=y -# end of printk and dmesg options - -CONFIG_DEBUG_KERNEL=y -CONFIG_DEBUG_MISC=y - -# Compile-time checks and compiler options -CONFIG_DEBUG_INFO=y -CONFIG_AS_HAS_NON_CONST_ULEB128=y -# CONFIG_DEBUG_INFO_NONE is not set -CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y -# CONFIG_DEBUG_INFO_DWARF4 is not set -# CONFIG_DEBUG_INFO_DWARF5 is not set -# CONFIG_DEBUG_INFO_REDUCED is not set -CONFIG_DEBUG_INFO_COMPRESSED_NONE=y -# CONFIG_DEBUG_INFO_COMPRESSED_ZLIB is not set -# CONFIG_DEBUG_INFO_SPLIT is not set -# CONFIG_DEBUG_INFO_BTF is not set -CONFIG_PAHOLE_HAS_SPLIT_BTF=y -CONFIG_PAHOLE_HAS_LANG_EXCLUDE=y -# CONFIG_GDB_SCRIPTS is not set -CONFIG_FRAME_WARN=2048 -CONFIG_STRIP_ASM_SYMS=y -# CONFIG_READABLE_ASM is not set -# CONFIG_HEADERS_INSTALL is not set -CONFIG_DEBUG_SECTION_MISMATCH=y -CONFIG_SECTION_MISMATCH_WARN_ONLY=y -# CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B is not set -CONFIG_ARCH_WANT_FRAME_POINTERS=y -CONFIG_FRAME_POINTER=y -# CONFIG_VMLINUX_MAP is not set -# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set -# end of Compile-time checks and compiler options - -# Generic Kernel Debugging Instruments -CONFIG_MAGIC_SYSRQ=y -CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x0 -# CONFIG_MAGIC_SYSRQ_SERIAL is not set -CONFIG_DEBUG_FS=y -CONFIG_DEBUG_FS_ALLOW_ALL=y -# CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set -# CONFIG_DEBUG_FS_ALLOW_NONE is not set -CONFIG_HAVE_ARCH_KGDB=y -# CONFIG_KGDB is not set -CONFIG_ARCH_HAS_UBSAN=y -# CONFIG_UBSAN is not set -CONFIG_HAVE_ARCH_KCSAN=y -CONFIG_HAVE_KCSAN_COMPILER=y -# CONFIG_KCSAN is not set -# end of Generic Kernel Debugging Instruments - -# Networking Debugging -# CONFIG_NET_DEV_REFCNT_TRACKER is not set -# CONFIG_NET_NS_REFCNT_TRACKER is not set -# CONFIG_DEBUG_NET is not set -# CONFIG_DEBUG_NET_SMALL_RTNL is not set -# end of Networking Debugging - -# Memory Debugging -# CONFIG_PAGE_EXTENSION is not set -# CONFIG_DEBUG_PAGEALLOC is not set -CONFIG_SLUB_DEBUG=y -# CONFIG_SLUB_DEBUG_ON is not set -# CONFIG_PAGE_OWNER is not set -# CONFIG_PAGE_TABLE_CHECK is not set -# CONFIG_PAGE_POISONING is not set -# CONFIG_DEBUG_RODATA_TEST is not set -CONFIG_ARCH_HAS_DEBUG_WX=y -# CONFIG_DEBUG_WX is not set -CONFIG_ARCH_HAS_PTDUMP=y -# CONFIG_PTDUMP_DEBUGFS is not set -CONFIG_HAVE_DEBUG_KMEMLEAK=y -# CONFIG_DEBUG_KMEMLEAK is not set -# CONFIG_PER_VMA_LOCK_STATS is not set -# CONFIG_DEBUG_OBJECTS is not set -# CONFIG_SHRINKER_DEBUG is not set -# CONFIG_DEBUG_STACK_USAGE is not set -# CONFIG_SCHED_STACK_END_CHECK is not set -CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE=y -# CONFIG_DEBUG_VM is not set -# CONFIG_DEBUG_VM_PGTABLE is not set -CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y -# CONFIG_DEBUG_VIRTUAL is not set -# CONFIG_DEBUG_MEMORY_INIT is not set -# CONFIG_DEBUG_PER_CPU_MAPS is not set -# CONFIG_MEM_ALLOC_PROFILING is not set -CONFIG_HAVE_ARCH_KASAN=y -CONFIG_HAVE_ARCH_KASAN_SW_TAGS=y -CONFIG_HAVE_ARCH_KASAN_HW_TAGS=y -CONFIG_HAVE_ARCH_KASAN_VMALLOC=y -CONFIG_CC_HAS_KASAN_GENERIC=y -CONFIG_CC_HAS_KASAN_SW_TAGS=y -CONFIG_CC_HAS_WORKING_NOSANITIZE_ADDRESS=y -# CONFIG_KASAN is not set -CONFIG_HAVE_ARCH_KFENCE=y -# CONFIG_KFENCE is not set -# end of Memory Debugging - -# CONFIG_DEBUG_SHIRQ is not set - -# Debug Oops, Lockups and Hangs -# CONFIG_PANIC_ON_OOPS is not set -CONFIG_PANIC_ON_OOPS_VALUE=0 -CONFIG_PANIC_TIMEOUT=0 -# CONFIG_SOFTLOCKUP_DETECTOR is not set -CONFIG_HAVE_HARDLOCKUP_DETECTOR_BUDDY=y -# CONFIG_HARDLOCKUP_DETECTOR is not set -# CONFIG_DETECT_HUNG_TASK is not set -# CONFIG_WQ_WATCHDOG is not set -# CONFIG_WQ_CPU_INTENSIVE_REPORT is not set -# CONFIG_TEST_LOCKUP is not set -# end of Debug Oops, Lockups and Hangs - -# Scheduler Debugging -CONFIG_SCHED_DEBUG=y -CONFIG_SCHED_INFO=y -CONFIG_SCHEDSTATS=y -# end of Scheduler Debugging - -# Lock Debugging (spinlocks, mutexes, etc...) -CONFIG_LOCK_DEBUGGING_SUPPORT=y -# CONFIG_PROVE_LOCKING is not set -# CONFIG_LOCK_STAT is not set -# CONFIG_DEBUG_RT_MUTEXES is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_MUTEXES is not set -# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set -# CONFIG_DEBUG_RWSEMS is not set -# CONFIG_DEBUG_LOCK_ALLOC is not set -# CONFIG_DEBUG_ATOMIC_SLEEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -# CONFIG_LOCK_TORTURE_TEST is not set -# CONFIG_WW_MUTEX_SELFTEST is not set -# CONFIG_SCF_TORTURE_TEST is not set -# CONFIG_CSD_LOCK_WAIT_DEBUG is not set -# end of Lock Debugging (spinlocks, mutexes, etc...) - -# CONFIG_DEBUG_IRQFLAGS is not set -CONFIG_STACKTRACE=y -# CONFIG_DEBUG_KOBJECT is not set - -# Debug kernel data structures -# CONFIG_DEBUG_LIST is not set -# CONFIG_DEBUG_PLIST is not set -# CONFIG_DEBUG_SG is not set -# CONFIG_DEBUG_NOTIFIERS is not set -# CONFIG_DEBUG_MAPLE_TREE is not set -# end of Debug kernel data structures - -# RCU Debugging -# CONFIG_RCU_SCALE_TEST is not set -# CONFIG_RCU_TORTURE_TEST is not set -# CONFIG_RCU_REF_SCALE_TEST is not set -CONFIG_RCU_CPU_STALL_TIMEOUT=60 -CONFIG_RCU_EXP_CPU_STALL_TIMEOUT=0 -# CONFIG_RCU_CPU_STALL_CPUTIME is not set -# CONFIG_RCU_TRACE is not set -# CONFIG_RCU_EQS_DEBUG is not set -# end of RCU Debugging - -# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set -# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set -# CONFIG_LATENCYTOP is not set -CONFIG_USER_STACKTRACE_SUPPORT=y -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_GRAPH_FREGS=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_HAVE_BUILDTIME_MCOUNT_SORT=y -CONFIG_TRACING_SUPPORT=y -# CONFIG_FTRACE is not set -# CONFIG_SAMPLES is not set -CONFIG_HAVE_SAMPLE_FTRACE_DIRECT=y -CONFIG_HAVE_SAMPLE_FTRACE_DIRECT_MULTI=y -# CONFIG_STRICT_DEVMEM is not set - -# arm64 Debugging -# CONFIG_PID_IN_CONTEXTIDR is not set -# CONFIG_DEBUG_EFI is not set -# CONFIG_ARM64_RELOC_TEST is not set -# CONFIG_CORESIGHT is not set -# end of arm64 Debugging - -# Kernel Testing and Coverage -# CONFIG_KUNIT is not set -# CONFIG_NOTIFIER_ERROR_INJECTION is not set -# CONFIG_FAULT_INJECTION is not set -CONFIG_ARCH_HAS_KCOV=y -CONFIG_CC_HAS_SANCOV_TRACE_PC=y -# CONFIG_KCOV is not set -# CONFIG_RUNTIME_TESTING_MENU is not set -CONFIG_ARCH_USE_MEMTEST=y -# CONFIG_MEMTEST is not set -# end of Kernel Testing and Coverage - -# Rust hacking -# end of Rust hacking -# end of Kernel hacking diff --git a/SPECS/91/linux/config-esx_x86_64 b/SPECS/91/linux/config-esx_x86_64 deleted file mode 100644 index 9e6c91a9d3..0000000000 --- a/SPECS/91/linux/config-esx_x86_64 +++ /dev/null @@ -1,4812 +0,0 @@ -# -### Automatically generated file; DO NOT EDIT. -# -CONFIG_CC_VERSION_TEXT="gcc (GCC) 12.2.0" -CONFIG_CC_IS_GCC=y -CONFIG_GCC_VERSION=120200 -CONFIG_CLANG_VERSION=0 -CONFIG_AS_IS_GNU=y -CONFIG_AS_VERSION=23900 -CONFIG_LD_IS_BFD=y -CONFIG_LD_VERSION=23900 -CONFIG_LLD_VERSION=0 -CONFIG_RUSTC_VERSION=0 -CONFIG_RUSTC_LLVM_VERSION=0 -CONFIG_CC_CAN_LINK=y -CONFIG_CC_CAN_LINK_STATIC=y -CONFIG_GCC_ASM_GOTO_OUTPUT_BROKEN=y -CONFIG_TOOLS_SUPPORT_RELR=y -CONFIG_CC_HAS_ASM_INLINE=y -CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y -CONFIG_LD_CAN_USE_KEEP_IN_OVERLAY=y -CONFIG_PAHOLE_VERSION=124 -CONFIG_IRQ_WORK=y -CONFIG_BUILDTIME_TABLE_SORT=y -CONFIG_THREAD_INFO_IN_TASK=y - -# General setup -CONFIG_INIT_ENV_ARG_LIMIT=32 -# CONFIG_COMPILE_TEST is not set -# CONFIG_WERROR is not set -CONFIG_LOCALVERSION="-esx" -# CONFIG_LOCALVERSION_AUTO is not set -CONFIG_BUILD_SALT="" -CONFIG_HAVE_KERNEL_GZIP=y -CONFIG_HAVE_KERNEL_BZIP2=y -CONFIG_HAVE_KERNEL_LZMA=y -CONFIG_HAVE_KERNEL_XZ=y -CONFIG_HAVE_KERNEL_LZO=y -CONFIG_HAVE_KERNEL_LZ4=y -CONFIG_HAVE_KERNEL_ZSTD=y -# CONFIG_KERNEL_GZIP is not set -# CONFIG_KERNEL_BZIP2 is not set -# CONFIG_KERNEL_LZMA is not set -# CONFIG_KERNEL_XZ is not set -# CONFIG_KERNEL_LZO is not set -CONFIG_KERNEL_LZ4=y -# CONFIG_KERNEL_ZSTD is not set -CONFIG_DEFAULT_INIT="" -CONFIG_DEFAULT_HOSTNAME="" -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -CONFIG_SYSVIPC_COMPAT=y -CONFIG_POSIX_MQUEUE=y -CONFIG_POSIX_MQUEUE_SYSCTL=y -# CONFIG_WATCH_QUEUE is not set -CONFIG_CROSS_MEMORY_ATTACH=y -# CONFIG_USELIB is not set -CONFIG_AUDIT=y -CONFIG_HAVE_ARCH_AUDITSYSCALL=y -CONFIG_AUDITSYSCALL=y - -# IRQ subsystem -CONFIG_GENERIC_IRQ_PROBE=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y -CONFIG_GENERIC_PENDING_IRQ=y -CONFIG_GENERIC_IRQ_MIGRATION=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_GENERIC_MSI_IRQ=y -CONFIG_IRQ_MSI_IOMMU=y -CONFIG_GENERIC_IRQ_MATRIX_ALLOCATOR=y -CONFIG_GENERIC_IRQ_RESERVATION_MODE=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_SPARSE_IRQ=y -# CONFIG_GENERIC_IRQ_DEBUGFS is not set -# end of IRQ subsystem - -CONFIG_CLOCKSOURCE_WATCHDOG=y -CONFIG_ARCH_CLOCKSOURCE_INIT=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST_IDLE=y -CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y -CONFIG_GENERIC_CMOS_UPDATE=y -CONFIG_HAVE_POSIX_CPU_TIMERS_TASK_WORK=y -CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y -CONFIG_CONTEXT_TRACKING=y -CONFIG_CONTEXT_TRACKING_IDLE=y - -# Timers subsystem -CONFIG_TICK_ONESHOT=y -CONFIG_NO_HZ_COMMON=y -# CONFIG_HZ_PERIODIC is not set -CONFIG_NO_HZ_IDLE=y -# CONFIG_NO_HZ_FULL is not set -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y -CONFIG_CLOCKSOURCE_WATCHDOG_MAX_SKEW_US=100 -# end of Timers subsystem - -CONFIG_BPF=y -CONFIG_HAVE_EBPF_JIT=y -CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y - -# BPF subsystem -CONFIG_BPF_SYSCALL=y -CONFIG_BPF_JIT=y -# CONFIG_BPF_JIT_ALWAYS_ON is not set -CONFIG_BPF_JIT_DEFAULT_ON=y -CONFIG_BPF_UNPRIV_DEFAULT_OFF=y -# CONFIG_BPF_PRELOAD is not set -# end of BPF subsystem - -CONFIG_PREEMPT_NONE_BUILD=y -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -# CONFIG_PREEMPT_RT is not set -# CONFIG_PREEMPT_DYNAMIC is not set -# CONFIG_SCHED_CORE is not set - -# CPU/Task time and stats accounting -CONFIG_TICK_CPU_ACCOUNTING=y -# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set -# CONFIG_IRQ_TIME_ACCOUNTING is not set -CONFIG_HAVE_SCHED_AVG_IRQ=y -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_BSD_PROCESS_ACCT_V3=y -CONFIG_TASKSTATS=y -CONFIG_TASK_DELAY_ACCT=y -CONFIG_TASK_XACCT=y -CONFIG_TASK_IO_ACCOUNTING=y -# CONFIG_PSI is not set -# end of CPU/Task time and stats accounting - -CONFIG_CPU_ISOLATION=y - -# RCU Subsystem -CONFIG_TREE_RCU=y -# CONFIG_RCU_EXPERT is not set -CONFIG_TREE_SRCU=y -CONFIG_TASKS_RCU_GENERIC=y -CONFIG_NEED_TASKS_RCU=y -CONFIG_TASKS_TRACE_RCU=y -CONFIG_RCU_STALL_COMMON=y -CONFIG_RCU_NEED_SEGCBLIST=y -# end of RCU Subsystem - -# CONFIG_IKCONFIG is not set -# CONFIG_IKHEADERS is not set -CONFIG_LOG_BUF_SHIFT=18 -CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 -CONFIG_PRINTK_INDEX=y -CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y - -# Scheduler features -# end of Scheduler features - -CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y -CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y -CONFIG_CC_HAS_INT128=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_GCC10_NO_ARRAY_BOUNDS=y -CONFIG_CC_NO_ARRAY_BOUNDS=y -CONFIG_GCC_NO_STRINGOP_OVERFLOW=y -CONFIG_CC_NO_STRINGOP_OVERFLOW=y -CONFIG_ARCH_SUPPORTS_INT128=y -CONFIG_SLAB_OBJ_EXT=y -CONFIG_CGROUPS=y -CONFIG_PAGE_COUNTER=y -# CONFIG_CGROUP_FAVOR_DYNMODS is not set -CONFIG_MEMCG=y -CONFIG_MEMCG_V1=y -CONFIG_BLK_CGROUP=y -CONFIG_CGROUP_WRITEBACK=y -CONFIG_CGROUP_SCHED=y -CONFIG_GROUP_SCHED_WEIGHT=y -CONFIG_FAIR_GROUP_SCHED=y -CONFIG_CFS_BANDWIDTH=y -# CONFIG_RT_GROUP_SCHED is not set -CONFIG_SCHED_MM_CID=y -CONFIG_CGROUP_PIDS=y -CONFIG_CGROUP_RDMA=y -CONFIG_CGROUP_FREEZER=y -CONFIG_CGROUP_HUGETLB=y -CONFIG_CPUSETS=y -CONFIG_CPUSETS_V1=y -CONFIG_PROC_PID_CPUSET=y -CONFIG_CGROUP_DEVICE=y -CONFIG_CGROUP_CPUACCT=y -CONFIG_CGROUP_PERF=y -CONFIG_CGROUP_BPF=y -CONFIG_CGROUP_MISC=y -# CONFIG_CGROUP_DEBUG is not set -CONFIG_SOCK_CGROUP_DATA=y -CONFIG_NAMESPACES=y -CONFIG_UTS_NS=y -CONFIG_TIME_NS=y -CONFIG_IPC_NS=y -CONFIG_USER_NS=y -CONFIG_PID_NS=y -CONFIG_NET_NS=y -# CONFIG_CHECKPOINT_RESTORE is not set -# CONFIG_SCHED_AUTOGROUP is not set -CONFIG_RELAY=y -CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_RD_GZIP=y -CONFIG_RD_BZIP2=y -CONFIG_RD_LZMA=y -CONFIG_RD_XZ=y -CONFIG_RD_LZO=y -CONFIG_RD_LZ4=y -CONFIG_RD_ZSTD=y -# CONFIG_BOOT_CONFIG is not set -# CONFIG_INITRAMFS_PRESERVE_MTIME is not set -CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_LD_ORPHAN_WARN=y -CONFIG_LD_ORPHAN_WARN_LEVEL="warn" -CONFIG_SYSCTL=y -CONFIG_HAVE_UID16=y -CONFIG_SYSCTL_EXCEPTION_TRACE=y -CONFIG_HAVE_PCSPKR_PLATFORM=y -CONFIG_EXPERT=y -CONFIG_UID16=y -CONFIG_MULTIUSER=y -CONFIG_SGETMASK_SYSCALL=y -CONFIG_SYSFS_SYSCALL=y -CONFIG_FHANDLE=y -CONFIG_POSIX_TIMERS=y -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -CONFIG_PCSPKR_PLATFORM=y -# CONFIG_BASE_SMALL is not set -CONFIG_FUTEX=y -CONFIG_FUTEX_PI=y -CONFIG_EPOLL=y -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -CONFIG_SHMEM=y -CONFIG_AIO=y -CONFIG_IO_URING=y -CONFIG_ADVISE_SYSCALLS=y -CONFIG_MEMBARRIER=y -CONFIG_KCMP=y -CONFIG_RSEQ=y -# CONFIG_DEBUG_RSEQ is not set -CONFIG_CACHESTAT_SYSCALL=y -# CONFIG_PC104 is not set -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_SELFTEST is not set -# CONFIG_KALLSYMS_ALL is not set -CONFIG_KALLSYMS_ABSOLUTE_PERCPU=y -CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y -CONFIG_HAVE_PERF_EVENTS=y - -# Kernel Performance Events And Counters -CONFIG_PERF_EVENTS=y -# CONFIG_DEBUG_PERF_USE_VMALLOC is not set -# end of Kernel Performance Events And Counters - -CONFIG_SYSTEM_DATA_VERIFICATION=y -# CONFIG_PROFILING is not set - -# Kexec and crash features -# CONFIG_KEXEC is not set -# CONFIG_KEXEC_FILE is not set -# end of Kexec and crash features -# end of General setup - -CONFIG_64BIT=y -CONFIG_X86_64=y -CONFIG_X86=y -CONFIG_INSTRUCTION_DECODER=y -CONFIG_OUTPUT_FORMAT="elf64-x86-64" -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_MMU=y -CONFIG_ARCH_MMAP_RND_BITS_MIN=28 -CONFIG_ARCH_MMAP_RND_BITS_MAX=32 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 -CONFIG_GENERIC_ISA_DMA=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y -CONFIG_ARCH_MAY_HAVE_PC_FDC=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_ARCH_HAS_CPU_RELAX=y -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_AUDIT_ARCH=y -CONFIG_HAVE_INTEL_TXT=y -CONFIG_X86_64_SMP=y -CONFIG_ARCH_SUPPORTS_UPROBES=y -CONFIG_FIX_EARLYCON_MEM=y -CONFIG_DYNAMIC_PHYSICAL_MASK=y -CONFIG_PGTABLE_LEVELS=4 -CONFIG_CC_HAS_SANE_STACKPROTECTOR=y - -# Processor type and features -CONFIG_SMP=y -CONFIG_X86_X2APIC=y -CONFIG_X86_MPPARSE=y -# CONFIG_X86_CPU_RESCTRL is not set -# CONFIG_X86_FRED is not set -# CONFIG_X86_EXTENDED_PLATFORM is not set -# CONFIG_X86_INTEL_LPSS is not set -# CONFIG_X86_AMD_PLATFORM_DEVICE is not set -CONFIG_IOSF_MBI=m -# CONFIG_IOSF_MBI_DEBUG is not set -# CONFIG_SCHED_OMIT_FRAME_POINTER is not set -CONFIG_HYPERVISOR_GUEST=y -CONFIG_PARAVIRT=y -# CONFIG_PARAVIRT_DEBUG is not set -# CONFIG_PARAVIRT_SPINLOCKS is not set -# CONFIG_XEN is not set -# CONFIG_KVM_GUEST is not set -# CONFIG_ARCH_CPUIDLE_HALTPOLL is not set -# CONFIG_PVH is not set -CONFIG_PARAVIRT_TIME_ACCOUNTING=y -# CONFIG_JAILHOUSE_GUEST is not set -# CONFIG_ACRN_GUEST is not set -CONFIG_INTEL_TDX_GUEST=y -# CONFIG_MK8 is not set -# CONFIG_MPSC is not set -# CONFIG_MCORE2 is not set -# CONFIG_MATOM is not set -CONFIG_GENERIC_CPU=y -CONFIG_X86_INTERNODE_CACHE_SHIFT=6 -CONFIG_X86_L1_CACHE_SHIFT=6 -CONFIG_X86_TSC=y -CONFIG_X86_HAVE_PAE=y -CONFIG_X86_CMPXCHG64=y -CONFIG_X86_CMOV=y -CONFIG_X86_MINIMUM_CPU_FAMILY=64 -CONFIG_X86_DEBUGCTLMSR=y -CONFIG_IA32_FEAT_CTL=y -CONFIG_X86_VMX_FEATURE_NAMES=y -# CONFIG_PROCESSOR_SELECT is not set -CONFIG_CPU_SUP_INTEL=y -CONFIG_CPU_SUP_AMD=y -CONFIG_CPU_SUP_HYGON=y -CONFIG_CPU_SUP_CENTAUR=y -CONFIG_CPU_SUP_ZHAOXIN=y -CONFIG_HPET_TIMER=y -CONFIG_HPET_EMULATE_RTC=y -CONFIG_DMI=y -# CONFIG_GART_IOMMU is not set -CONFIG_BOOT_VESA_SUPPORT=y -# CONFIG_MAXSMP is not set -CONFIG_NR_CPUS_RANGE_BEGIN=2 -CONFIG_NR_CPUS_RANGE_END=512 -CONFIG_NR_CPUS_DEFAULT=64 -CONFIG_NR_CPUS=128 -# CONFIG_SCHED_CLUSTER is not set -CONFIG_SCHED_SMT=y -# CONFIG_SCHED_MC is not set -CONFIG_X86_LOCAL_APIC=y -CONFIG_ACPI_MADT_WAKEUP=y -CONFIG_X86_IO_APIC=y -# CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS is not set -# CONFIG_X86_MCE is not set - -# Performance monitoring -CONFIG_PERF_EVENTS_INTEL_UNCORE=y -# CONFIG_PERF_EVENTS_INTEL_RAPL is not set -# CONFIG_PERF_EVENTS_INTEL_CSTATE is not set -# CONFIG_PERF_EVENTS_AMD_POWER is not set -CONFIG_PERF_EVENTS_AMD_UNCORE=y -# CONFIG_PERF_EVENTS_AMD_BRS is not set -# end of Performance monitoring - -CONFIG_X86_VSYSCALL_EMULATION=y -CONFIG_X86_IOPL_IOPERM=y -CONFIG_MICROCODE=y -# CONFIG_MICROCODE_LATE_LOADING is not set -CONFIG_X86_MSR=y -CONFIG_X86_CPUID=y -# CONFIG_X86_5LEVEL is not set -CONFIG_X86_DIRECT_GBPAGES=y -# CONFIG_X86_CPA_STATISTICS is not set -CONFIG_X86_MEM_ENCRYPT=y -CONFIG_AMD_MEM_ENCRYPT=y -# CONFIG_NUMA is not set -CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_ARCH_SPARSEMEM_DEFAULT=y -# CONFIG_ARCH_MEMORY_PROBE is not set -CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 -CONFIG_X86_PMEM_LEGACY_DEVICE=y -CONFIG_X86_PMEM_LEGACY=m -CONFIG_X86_CHECK_BIOS_CORRUPTION=y -# CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK is not set -CONFIG_MTRR=y -CONFIG_MTRR_SANITIZER=y -CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1 -CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1 -CONFIG_X86_PAT=y -CONFIG_X86_UMIP=y -CONFIG_CC_HAS_IBT=y -# CONFIG_X86_KERNEL_IBT is not set -# CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS is not set -CONFIG_ARCH_PKEY_BITS=4 -# CONFIG_X86_INTEL_TSX_MODE_OFF is not set -# CONFIG_X86_INTEL_TSX_MODE_ON is not set -CONFIG_X86_INTEL_TSX_MODE_AUTO=y -CONFIG_X86_SGX=y -# CONFIG_X86_USER_SHADOW_STACK is not set -CONFIG_EFI=y -CONFIG_EFI_STUB=y -CONFIG_EFI_HANDOVER_PROTOCOL=y -# CONFIG_EFI_MIXED is not set -# CONFIG_EFI_RUNTIME_MAP is not set -# CONFIG_HZ_100 is not set -CONFIG_HZ_250=y -# CONFIG_HZ_300 is not set -# CONFIG_HZ_1000 is not set -CONFIG_HZ=250 -CONFIG_SCHED_HRTICK=y -CONFIG_ARCH_SUPPORTS_KEXEC=y -CONFIG_ARCH_SUPPORTS_KEXEC_FILE=y -CONFIG_ARCH_SUPPORTS_KEXEC_PURGATORY=y -CONFIG_ARCH_SUPPORTS_KEXEC_SIG=y -CONFIG_ARCH_SUPPORTS_KEXEC_SIG_FORCE=y -CONFIG_ARCH_SUPPORTS_KEXEC_BZIMAGE_VERIFY_SIG=y -CONFIG_ARCH_SUPPORTS_KEXEC_JUMP=y -CONFIG_ARCH_SUPPORTS_CRASH_DUMP=y -CONFIG_ARCH_DEFAULT_CRASH_DUMP=y -CONFIG_ARCH_SUPPORTS_CRASH_HOTPLUG=y -CONFIG_PHYSICAL_START=0x1000000 -CONFIG_RELOCATABLE=y -CONFIG_RANDOMIZE_BASE=y -CONFIG_X86_NEED_RELOCS=y -CONFIG_PHYSICAL_ALIGN=0x1000000 -CONFIG_DYNAMIC_MEMORY_LAYOUT=y -CONFIG_RANDOMIZE_MEMORY=y -CONFIG_RANDOMIZE_MEMORY_PHYSICAL_PADDING=0xa -CONFIG_HOTPLUG_CPU=y -# CONFIG_COMPAT_VDSO is not set -CONFIG_LEGACY_VSYSCALL_XONLY=y -# CONFIG_LEGACY_VSYSCALL_NONE is not set -# CONFIG_CMDLINE_BOOL is not set -# CONFIG_MODIFY_LDT_SYSCALL is not set -# CONFIG_STRICT_SIGALTSTACK_SIZE is not set -CONFIG_HAVE_LIVEPATCH=y -# end of Processor type and features - -CONFIG_CC_HAS_NAMED_AS=y -CONFIG_CC_HAS_NAMED_AS_FIXED_SANITIZERS=y -CONFIG_USE_X86_SEG_SUPPORT=y -CONFIG_CC_HAS_SLS=y -CONFIG_CC_HAS_RETURN_THUNK=y -CONFIG_CC_HAS_ENTRY_PADDING=y -CONFIG_FUNCTION_PADDING_CFI=11 -CONFIG_FUNCTION_PADDING_BYTES=16 -CONFIG_HAVE_CALL_THUNKS=y -CONFIG_CPU_MITIGATIONS=y -CONFIG_MITIGATION_PAGE_TABLE_ISOLATION=y -CONFIG_MITIGATION_RETPOLINE=y -CONFIG_MITIGATION_RETHUNK=y -CONFIG_MITIGATION_UNRET_ENTRY=y -# CONFIG_MITIGATION_CALL_DEPTH_TRACKING is not set -CONFIG_MITIGATION_IBPB_ENTRY=y -CONFIG_MITIGATION_IBRS_ENTRY=y -CONFIG_MITIGATION_SRSO=y -CONFIG_MITIGATION_SLS=y -CONFIG_MITIGATION_GDS=y -CONFIG_MITIGATION_RFDS=y -CONFIG_MITIGATION_SPECTRE_BHI=y -CONFIG_MITIGATION_MDS=y -CONFIG_MITIGATION_TAA=y -CONFIG_MITIGATION_MMIO_STALE_DATA=y -CONFIG_MITIGATION_L1TF=y -CONFIG_MITIGATION_RETBLEED=y -CONFIG_MITIGATION_SPECTRE_V1=y -CONFIG_MITIGATION_SPECTRE_V2=y -CONFIG_MITIGATION_SRBDS=y -CONFIG_MITIGATION_SSB=y -CONFIG_MITIGATION_ITS=y -CONFIG_MITIGATION_TSA=y -CONFIG_ARCH_HAS_ADD_PAGES=y - -# Power management and ACPI options -# CONFIG_SUSPEND is not set -# CONFIG_HIBERNATION is not set -# CONFIG_PM is not set -CONFIG_ARCH_SUPPORTS_ACPI=y -CONFIG_ACPI=y -CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y -CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y -CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y -# CONFIG_ACPI_DEBUGGER is not set -CONFIG_ACPI_SPCR_TABLE=y -# CONFIG_ACPI_FPDT is not set -CONFIG_ACPI_LPIT=y -# CONFIG_ACPI_REV_OVERRIDE_POSSIBLE is not set -# CONFIG_ACPI_EC_DEBUGFS is not set -# CONFIG_ACPI_AC is not set -# CONFIG_ACPI_BATTERY is not set -CONFIG_ACPI_BUTTON=m -# CONFIG_ACPI_TINY_POWER_BUTTON is not set -CONFIG_ACPI_VIDEO=m -# CONFIG_ACPI_FAN is not set -# CONFIG_ACPI_DOCK is not set -CONFIG_ACPI_CPU_FREQ_PSS=y -CONFIG_ACPI_PROCESSOR_CSTATE=y -CONFIG_ACPI_PROCESSOR_IDLE=y -CONFIG_ACPI_PROCESSOR=y -CONFIG_ACPI_HOTPLUG_CPU=y -# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set -# CONFIG_ACPI_THERMAL is not set -CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y -# CONFIG_ACPI_TABLE_UPGRADE is not set -# CONFIG_ACPI_DEBUG is not set -# CONFIG_ACPI_PCI_SLOT is not set -CONFIG_ACPI_CONTAINER=y -CONFIG_ACPI_HOTPLUG_MEMORY=y -CONFIG_ACPI_HOTPLUG_IOAPIC=y -# CONFIG_ACPI_SBS is not set -# CONFIG_ACPI_HED is not set -# CONFIG_ACPI_BGRT is not set -# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set -CONFIG_ACPI_NFIT=m -# CONFIG_NFIT_SECURITY_DEBUG is not set -CONFIG_HAVE_ACPI_APEI=y -CONFIG_HAVE_ACPI_APEI_NMI=y -# CONFIG_ACPI_APEI is not set -# CONFIG_ACPI_DPTF is not set -CONFIG_ACPI_WATCHDOG=y -# CONFIG_ACPI_CONFIGFS is not set -# CONFIG_ACPI_PFRUT is not set -CONFIG_ACPI_PCC=y -# CONFIG_ACPI_FFH is not set -# CONFIG_PMIC_OPREGION is not set -CONFIG_ACPI_PRMT=y -CONFIG_X86_PM_TIMER=y - -# CPU Frequency scaling -# CONFIG_CPU_FREQ is not set -# end of CPU Frequency scaling - -# CPU Idle -CONFIG_CPU_IDLE=y -CONFIG_CPU_IDLE_GOV_LADDER=y -CONFIG_CPU_IDLE_GOV_MENU=y -# CONFIG_CPU_IDLE_GOV_TEO is not set -# end of CPU Idle - -# CONFIG_INTEL_IDLE is not set -# end of Power management and ACPI options - -# Bus options (PCI etc.) -CONFIG_PCI_DIRECT=y -CONFIG_PCI_MMCONFIG=y -CONFIG_MMCONF_FAM10H=y -# CONFIG_PCI_CNB20LE_QUIRK is not set -# CONFIG_ISA_BUS is not set -CONFIG_ISA_DMA_API=y -CONFIG_AMD_NB=y -# end of Bus options (PCI etc.) - -# Binary Emulations -CONFIG_IA32_EMULATION=y -# CONFIG_IA32_EMULATION_DEFAULT_DISABLED is not set -# CONFIG_X86_X32_ABI is not set -CONFIG_COMPAT_32=y -CONFIG_COMPAT=y -CONFIG_COMPAT_FOR_U64_ALIGNMENT=y -# end of Binary Emulations - -# CONFIG_VIRTUALIZATION is not set -CONFIG_AS_AVX512=y -CONFIG_AS_SHA1_NI=y -CONFIG_AS_SHA256_NI=y -CONFIG_AS_TPAUSE=y -CONFIG_AS_GFNI=y -CONFIG_AS_VAES=y -CONFIG_AS_VPCLMULQDQ=y -CONFIG_AS_WRUSS=y -CONFIG_ARCH_CONFIGURES_CPU_MITIGATIONS=y - -# General architecture-dependent options -CONFIG_HOTPLUG_SMT=y -CONFIG_HOTPLUG_CORE_SYNC=y -CONFIG_HOTPLUG_CORE_SYNC_DEAD=y -CONFIG_HOTPLUG_CORE_SYNC_FULL=y -CONFIG_HOTPLUG_SPLIT_STARTUP=y -CONFIG_HOTPLUG_PARALLEL=y -CONFIG_GENERIC_ENTRY=y -# CONFIG_KPROBES is not set -# CONFIG_JUMP_LABEL is not set -# CONFIG_STATIC_CALL_SELFTEST is not set -CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_HAVE_IOREMAP_PROT=y -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_HAVE_OPTPROBES=y -CONFIG_HAVE_KPROBES_ON_FTRACE=y -CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y -CONFIG_HAVE_FUNCTION_ERROR_INJECTION=y -CONFIG_HAVE_NMI=y -CONFIG_TRACE_IRQFLAGS_SUPPORT=y -CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_ARCH_HAS_FORTIFY_SOURCE=y -CONFIG_ARCH_HAS_SET_MEMORY=y -CONFIG_ARCH_HAS_SET_DIRECT_MAP=y -CONFIG_ARCH_HAS_CPU_FINALIZE_INIT=y -CONFIG_ARCH_HAS_CPU_PASID=y -CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y -CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y -CONFIG_ARCH_WANTS_NO_INSTR=y -CONFIG_HAVE_ASM_MODVERSIONS=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_RSEQ=y -CONFIG_HAVE_RUST=y -CONFIG_HAVE_FUNCTION_ARG_ACCESS_API=y -CONFIG_HAVE_HW_BREAKPOINT=y -CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y -CONFIG_HAVE_USER_RETURN_NOTIFIER=y -CONFIG_HAVE_PERF_EVENTS_NMI=y -CONFIG_HAVE_HARDLOCKUP_DETECTOR_PERF=y -CONFIG_HAVE_PERF_REGS=y -CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y -CONFIG_MMU_GATHER_TABLE_FREE=y -CONFIG_MMU_GATHER_RCU_TABLE_FREE=y -CONFIG_MMU_GATHER_MERGE_VMAS=y -CONFIG_MMU_LAZY_TLB_REFCOUNT=y -CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y -CONFIG_ARCH_HAVE_EXTRA_ELF_NOTES=y -CONFIG_ARCH_HAS_NMI_SAFE_THIS_CPU_OPS=y -CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y -CONFIG_HAVE_CMPXCHG_LOCAL=y -CONFIG_HAVE_CMPXCHG_DOUBLE=y -CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y -CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y -CONFIG_HAVE_ARCH_SECCOMP=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_SECCOMP=y -CONFIG_SECCOMP_FILTER=y -# CONFIG_SECCOMP_CACHE_DEBUG is not set -CONFIG_HAVE_ARCH_STACKLEAK=y -CONFIG_HAVE_STACKPROTECTOR=y -CONFIG_STACKPROTECTOR=y -# CONFIG_STACKPROTECTOR_STRONG is not set -CONFIG_ARCH_SUPPORTS_LTO_CLANG=y -CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN=y -CONFIG_LTO_NONE=y -CONFIG_ARCH_SUPPORTS_CFI_CLANG=y -CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES=y -CONFIG_HAVE_CONTEXT_TRACKING_USER=y -CONFIG_HAVE_CONTEXT_TRACKING_USER_OFFSTACK=y -CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_MOVE_PUD=y -CONFIG_HAVE_MOVE_PMD=y -CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y -CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y -CONFIG_HAVE_ARCH_HUGE_VMAP=y -CONFIG_HAVE_ARCH_HUGE_VMALLOC=y -CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y -CONFIG_ARCH_WANT_PMD_MKWRITE=y -CONFIG_HAVE_ARCH_SOFT_DIRTY=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_MODULES_USE_ELF_RELA=y -CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y -CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK=y -CONFIG_SOFTIRQ_ON_OWN_STACK=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -CONFIG_HAVE_ARCH_MMAP_RND_BITS=y -CONFIG_HAVE_EXIT_THREAD=y -CONFIG_ARCH_MMAP_RND_BITS=28 -CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y -CONFIG_ARCH_MMAP_RND_COMPAT_BITS=8 -CONFIG_HAVE_ARCH_COMPAT_MMAP_BASES=y -CONFIG_HAVE_PAGE_SIZE_4KB=y -CONFIG_PAGE_SIZE_4KB=y -CONFIG_PAGE_SIZE_LESS_THAN_64KB=y -CONFIG_PAGE_SIZE_LESS_THAN_256KB=y -CONFIG_PAGE_SHIFT=12 -CONFIG_HAVE_OBJTOOL=y -CONFIG_HAVE_JUMP_LABEL_HACK=y -CONFIG_HAVE_NOINSTR_HACK=y -CONFIG_HAVE_NOINSTR_VALIDATION=y -CONFIG_HAVE_UACCESS_VALIDATION=y -CONFIG_HAVE_STACK_VALIDATION=y -CONFIG_HAVE_RELIABLE_STACKTRACE=y -CONFIG_OLD_SIGSUSPEND3=y -CONFIG_COMPAT_OLD_SIGACTION=y -CONFIG_COMPAT_32BIT_TIME=y -CONFIG_ARCH_SUPPORTS_RT=y -CONFIG_HAVE_ARCH_VMAP_STACK=y -CONFIG_VMAP_STACK=y -CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET=y -CONFIG_RANDOMIZE_KSTACK_OFFSET=y -# CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT is not set -CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y -CONFIG_STRICT_KERNEL_RWX=y -CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y -CONFIG_STRICT_MODULE_RWX=y -CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y -CONFIG_ARCH_USE_MEMREMAP_PROT=y -# CONFIG_LOCK_EVENT_COUNTS is not set -CONFIG_ARCH_HAS_MEM_ENCRYPT=y -CONFIG_ARCH_HAS_CC_PLATFORM=y -CONFIG_HAVE_STATIC_CALL=y -CONFIG_HAVE_STATIC_CALL_INLINE=y -CONFIG_HAVE_PREEMPT_DYNAMIC=y -CONFIG_HAVE_PREEMPT_DYNAMIC_CALL=y -CONFIG_ARCH_WANT_LD_ORPHAN_WARN=y -CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y -CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK=y -CONFIG_ARCH_HAS_ELFCORE_COMPAT=y -CONFIG_ARCH_HAS_PARANOID_L1D_FLUSH=y -CONFIG_DYNAMIC_SIGFRAME=y -CONFIG_HAVE_ARCH_NODE_DEV_GROUP=y -CONFIG_ARCH_HAS_HW_PTE_YOUNG=y -CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG=y -CONFIG_ARCH_HAS_KERNEL_FPU_SUPPORT=y - -# GCOV-based kernel profiling -# CONFIG_GCOV_KERNEL is not set -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -# end of GCOV-based kernel profiling - -CONFIG_HAVE_GCC_PLUGINS=y -CONFIG_GCC_PLUGINS=y -# CONFIG_GCC_PLUGIN_LATENT_ENTROPY is not set -# CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS is not set -# CONFIG_GCC_PLUGIN_PAD_CANISTER_STRUCTS is not set -CONFIG_FUNCTION_ALIGNMENT_4B=y -CONFIG_FUNCTION_ALIGNMENT_16B=y -CONFIG_FUNCTION_ALIGNMENT=16 -CONFIG_HAVE_ARCH_GET_SECUREBOOT=y -# end of General architecture-dependent options - -CONFIG_RT_MUTEXES=y -CONFIG_MODULE_SIG_FORMAT=y -CONFIG_MODULES=y -# CONFIG_MODULE_DEBUG is not set -# CONFIG_MODULE_FORCE_LOAD is not set -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -# CONFIG_MODULE_UNLOAD_TAINT_TRACKING is not set -# CONFIG_MODVERSIONS is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -CONFIG_MODULE_SIG=y -# CONFIG_MODULE_SIG_FORCE is not set -# CONFIG_MODULE_SIG_ALL is not set -# CONFIG_MODULE_SIG_SHA1 is not set -# CONFIG_MODULE_SIG_SHA256 is not set -# CONFIG_MODULE_SIG_SHA384 is not set -# CONFIG_MODULE_SIG_SHA512 is not set -# CONFIG_MODULE_SIG_SHA3_256 is not set -# CONFIG_MODULE_SIG_SHA3_384 is not set -CONFIG_MODULE_SIG_SHA3_512=y -CONFIG_MODULE_SIG_HASH="sha3-512" -# CONFIG_MODULE_COMPRESS is not set -# CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is not set -CONFIG_MODPROBE_PATH="/sbin/modprobe" -# CONFIG_TRIM_UNUSED_KSYMS is not set -CONFIG_MODULES_TREE_LOOKUP=y -CONFIG_BLOCK=y -CONFIG_BLOCK_LEGACY_AUTOLOAD=y -CONFIG_BLK_CGROUP_RWSTAT=y -CONFIG_BLK_CGROUP_PUNT_BIO=y -CONFIG_BLK_DEV_BSG_COMMON=y -CONFIG_BLK_DEV_BSGLIB=y -# CONFIG_BLK_DEV_INTEGRITY is not set -CONFIG_BLK_DEV_WRITE_MOUNTED=y -# CONFIG_BLK_DEV_ZONED is not set -CONFIG_BLK_DEV_THROTTLING=y -# CONFIG_BLK_WBT is not set -# CONFIG_BLK_CGROUP_IOLATENCY is not set -# CONFIG_BLK_CGROUP_IOCOST is not set -# CONFIG_BLK_CGROUP_IOPRIO is not set -CONFIG_BLK_DEBUG_FS=y -# CONFIG_BLK_SED_OPAL is not set -# CONFIG_BLK_INLINE_ENCRYPTION is not set - -# Partition Types -CONFIG_PARTITION_ADVANCED=y -# CONFIG_ACORN_PARTITION is not set -# CONFIG_AIX_PARTITION is not set -# CONFIG_OSF_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set -# CONFIG_ATARI_PARTITION is not set -# CONFIG_MAC_PARTITION is not set -CONFIG_MSDOS_PARTITION=y -# CONFIG_BSD_DISKLABEL is not set -# CONFIG_MINIX_SUBPARTITION is not set -# CONFIG_SOLARIS_X86_PARTITION is not set -# CONFIG_UNIXWARE_DISKLABEL is not set -# CONFIG_LDM_PARTITION is not set -# CONFIG_SGI_PARTITION is not set -# CONFIG_ULTRIX_PARTITION is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_KARMA_PARTITION is not set -CONFIG_EFI_PARTITION=y -# CONFIG_SYSV68_PARTITION is not set -# CONFIG_CMDLINE_PARTITION is not set -# end of Partition Types - -CONFIG_BLK_MQ_PCI=y -CONFIG_BLOCK_HOLDER_DEPRECATED=y -CONFIG_BLK_MQ_STACKING=y - -# IO Schedulers -# CONFIG_MQ_IOSCHED_DEADLINE is not set -# CONFIG_MQ_IOSCHED_KYBER is not set -# CONFIG_IOSCHED_BFQ is not set -# end of IO Schedulers - -CONFIG_PADATA=y -CONFIG_ASN1=y -CONFIG_INLINE_SPIN_UNLOCK_IRQ=y -CONFIG_INLINE_READ_UNLOCK=y -CONFIG_INLINE_READ_UNLOCK_IRQ=y -CONFIG_INLINE_WRITE_UNLOCK=y -CONFIG_INLINE_WRITE_UNLOCK_IRQ=y -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -CONFIG_MUTEX_SPIN_ON_OWNER=y -CONFIG_RWSEM_SPIN_ON_OWNER=y -CONFIG_LOCK_SPIN_ON_OWNER=y -CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y -CONFIG_QUEUED_SPINLOCKS=y -CONFIG_ARCH_USE_QUEUED_RWLOCKS=y -CONFIG_QUEUED_RWLOCKS=y -CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE=y -CONFIG_ARCH_HAS_SYNC_CORE_BEFORE_USERMODE=y -CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y -CONFIG_FREEZER=y - -# Executable file formats -CONFIG_BINFMT_ELF=y -CONFIG_COMPAT_BINFMT_ELF=y -CONFIG_ELFCORE=y -CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y -CONFIG_BINFMT_SCRIPT=y -CONFIG_BINFMT_MISC=m -CONFIG_COREDUMP=y -# end of Executable file formats - -# Memory Management options -CONFIG_SWAP=y -# CONFIG_ZSWAP is not set - -# Slab allocator options -CONFIG_SLUB=y -# CONFIG_SLUB_TINY is not set -CONFIG_SLAB_MERGE_DEFAULT=y -# CONFIG_SLAB_FREELIST_RANDOM is not set -# CONFIG_SLAB_FREELIST_HARDENED is not set -# CONFIG_SLAB_BUCKETS is not set -# CONFIG_SLUB_STATS is not set -CONFIG_SLUB_CPU_PARTIAL=y -# CONFIG_RANDOM_KMALLOC_CACHES is not set -# end of Slab allocator options - -# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set -# CONFIG_COMPAT_BRK is not set -CONFIG_SPARSEMEM=y -CONFIG_SPARSEMEM_EXTREME=y -CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y -CONFIG_SPARSEMEM_VMEMMAP=y -CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP=y -CONFIG_ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP=y -CONFIG_HAVE_GUP_FAST=y -CONFIG_MEMORY_ISOLATION=y -CONFIG_EXCLUSIVE_SYSTEM_RAM=y -CONFIG_HAVE_BOOTMEM_INFO_NODE=y -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y -CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y -CONFIG_MEMORY_HOTPLUG=y -# CONFIG_MHP_DEFAULT_ONLINE_TYPE_OFFLINE is not set -CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_AUTO=y -# CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_KERNEL is not set -# CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_MOVABLE is not set -CONFIG_MEMORY_HOTREMOVE=y -CONFIG_MHP_MEMMAP_ON_MEMORY=y -CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y -CONFIG_SPLIT_PTE_PTLOCKS=y -CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y -CONFIG_SPLIT_PMD_PTLOCKS=y -CONFIG_MEMORY_BALLOON=y -CONFIG_BALLOON_COMPACTION=y -CONFIG_COMPACTION=y -CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 -# CONFIG_PAGE_REPORTING is not set -CONFIG_MIGRATION=y -CONFIG_DEVICE_MIGRATION=y -CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y -CONFIG_ARCH_ENABLE_THP_MIGRATION=y -CONFIG_CONTIG_ALLOC=y -CONFIG_PCP_BATCH_SCALE_MAX=5 -CONFIG_PHYS_ADDR_T_64BIT=y -CONFIG_MMU_NOTIFIER=y -CONFIG_KSM=y -CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 -CONFIG_ARCH_WANT_GENERAL_HUGETLB=y -CONFIG_ARCH_WANTS_THP_SWAP=y -CONFIG_TRANSPARENT_HUGEPAGE=y -CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y -# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set -# CONFIG_TRANSPARENT_HUGEPAGE_NEVER is not set -CONFIG_THP_SWAP=y -# CONFIG_READ_ONLY_THP_FOR_FS is not set -CONFIG_PGTABLE_HAS_HUGE_LEAVES=y -CONFIG_ARCH_SUPPORTS_HUGE_PFNMAP=y -CONFIG_ARCH_SUPPORTS_PMD_PFNMAP=y -CONFIG_ARCH_SUPPORTS_PUD_PFNMAP=y -CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y -CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y -CONFIG_HAVE_SETUP_PER_CPU_AREA=y -# CONFIG_CMA is not set -CONFIG_GENERIC_EARLY_IOREMAP=y -# CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set -# CONFIG_IDLE_PAGE_TRACKING is not set -CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y -CONFIG_ARCH_HAS_CURRENT_STACK_POINTER=y -CONFIG_ARCH_HAS_PTE_DEVMAP=y -CONFIG_ARCH_HAS_ZONE_DMA_SET=y -# CONFIG_ZONE_DMA is not set -CONFIG_ZONE_DMA32=y -CONFIG_ZONE_DEVICE=y -CONFIG_HMM_MIRROR=y -# CONFIG_DEVICE_PRIVATE is not set -CONFIG_VMAP_PFN=y -CONFIG_ARCH_USES_PG_ARCH_2=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_PERCPU_STATS=y -# CONFIG_GUP_TEST is not set -# CONFIG_DMAPOOL_TEST is not set -CONFIG_ARCH_HAS_PTE_SPECIAL=y -CONFIG_MAPPING_DIRTY_HELPERS=y -CONFIG_MEMFD_CREATE=y -CONFIG_SECRETMEM=y -# CONFIG_ANON_VMA_NAME is not set -# CONFIG_USERFAULTFD is not set -CONFIG_LRU_GEN=y -# CONFIG_LRU_GEN_ENABLED is not set -# CONFIG_LRU_GEN_STATS is not set -CONFIG_LRU_GEN_WALKS_MMU=y -CONFIG_ARCH_SUPPORTS_PER_VMA_LOCK=y -CONFIG_PER_VMA_LOCK=y -CONFIG_LOCK_MM_AND_FIND_VMA=y -CONFIG_IOMMU_MM_DATA=y -CONFIG_EXECMEM=y - -# Data Access Monitoring -# CONFIG_DAMON is not set -# end of Data Access Monitoring -# end of Memory Management options - -CONFIG_NET=y -CONFIG_NET_INGRESS=y -CONFIG_NET_EGRESS=y -CONFIG_NET_XGRESS=y -CONFIG_SKB_DECRYPTED=y -CONFIG_SKB_EXTENSIONS=y -CONFIG_NET_DEVMEM=y - -# Networking options -CONFIG_PACKET=m -CONFIG_PACKET_DIAG=m -CONFIG_UNIX=y -CONFIG_AF_UNIX_OOB=y -CONFIG_UNIX_DIAG=m -CONFIG_TLS=m -CONFIG_TLS_DEVICE=y -CONFIG_TLS_TOE=y -CONFIG_XFRM=y -CONFIG_XFRM_ALGO=m -CONFIG_XFRM_USER=m -# CONFIG_XFRM_USER_COMPAT is not set -# CONFIG_XFRM_INTERFACE is not set -CONFIG_XFRM_SUB_POLICY=y -CONFIG_XFRM_MIGRATE=y -CONFIG_XFRM_STATISTICS=y -CONFIG_XFRM_AH=m -CONFIG_XFRM_ESP=m -CONFIG_XFRM_IPCOMP=m -CONFIG_NET_KEY=m -CONFIG_NET_KEY_MIGRATE=y -# CONFIG_SMC is not set -# CONFIG_XDP_SOCKETS is not set -CONFIG_NET_HANDSHAKE=y -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -CONFIG_IP_ADVANCED_ROUTER=y -CONFIG_IP_FIB_TRIE_STATS=y -CONFIG_IP_MULTIPLE_TABLES=y -CONFIG_IP_ROUTE_MULTIPATH=y -CONFIG_IP_ROUTE_VERBOSE=y -CONFIG_IP_ROUTE_CLASSID=y -# CONFIG_IP_PNP is not set -CONFIG_NET_IPIP=m -CONFIG_NET_IPGRE_DEMUX=m -CONFIG_NET_IP_TUNNEL=m -CONFIG_NET_IPGRE=m -CONFIG_NET_IPGRE_BROADCAST=y -# CONFIG_IP_MROUTE is not set -CONFIG_SYN_COOKIES=y -CONFIG_NET_IPVTI=m -CONFIG_NET_UDP_TUNNEL=m -CONFIG_NET_FOU=m -CONFIG_NET_FOU_IP_TUNNELS=y -CONFIG_INET_AH=m -CONFIG_INET_ESP=m -# CONFIG_INET_ESP_OFFLOAD is not set -# CONFIG_INET_ESPINTCP is not set -CONFIG_INET_IPCOMP=m -CONFIG_INET_TABLE_PERTURB_ORDER=16 -CONFIG_INET_XFRM_TUNNEL=m -CONFIG_INET_TUNNEL=m -CONFIG_INET_DIAG=m -CONFIG_INET_TCP_DIAG=m -CONFIG_INET_UDP_DIAG=m -# CONFIG_INET_RAW_DIAG is not set -# CONFIG_INET_DIAG_DESTROY is not set -CONFIG_TCP_CONG_ADVANCED=y -CONFIG_TCP_CONG_BIC=m -CONFIG_TCP_CONG_CUBIC=y -# CONFIG_TCP_CONG_WESTWOOD is not set -# CONFIG_TCP_CONG_HTCP is not set -# CONFIG_TCP_CONG_HSTCP is not set -# CONFIG_TCP_CONG_HYBLA is not set -# CONFIG_TCP_CONG_VEGAS is not set -# CONFIG_TCP_CONG_NV is not set -# CONFIG_TCP_CONG_SCALABLE is not set -# CONFIG_TCP_CONG_LP is not set -# CONFIG_TCP_CONG_VENO is not set -# CONFIG_TCP_CONG_YEAH is not set -# CONFIG_TCP_CONG_ILLINOIS is not set -CONFIG_TCP_CONG_DCTCP=m -# CONFIG_TCP_CONG_CDG is not set -# CONFIG_TCP_CONG_BBR is not set -CONFIG_DEFAULT_CUBIC=y -# CONFIG_DEFAULT_RENO is not set -CONFIG_DEFAULT_TCP_CONG="cubic" -CONFIG_TCP_SIGPOOL=y -CONFIG_TCP_MD5SIG=y -CONFIG_IPV6=m -CONFIG_IPV6_ROUTER_PREF=y -CONFIG_IPV6_ROUTE_INFO=y -CONFIG_IPV6_OPTIMISTIC_DAD=y -CONFIG_INET6_AH=m -CONFIG_INET6_ESP=m -# CONFIG_INET6_ESP_OFFLOAD is not set -# CONFIG_INET6_ESPINTCP is not set -CONFIG_INET6_IPCOMP=m -CONFIG_IPV6_MIP6=m -# CONFIG_IPV6_ILA is not set -CONFIG_INET6_XFRM_TUNNEL=m -CONFIG_INET6_TUNNEL=m -CONFIG_IPV6_VTI=m -CONFIG_IPV6_SIT=m -CONFIG_IPV6_SIT_6RD=y -CONFIG_IPV6_NDISC_NODETYPE=y -CONFIG_IPV6_TUNNEL=m -CONFIG_IPV6_GRE=m -CONFIG_IPV6_FOU=m -CONFIG_IPV6_FOU_TUNNEL=m -CONFIG_IPV6_MULTIPLE_TABLES=y -CONFIG_IPV6_SUBTREES=y -# CONFIG_IPV6_MROUTE is not set -# CONFIG_IPV6_SEG6_LWTUNNEL is not set -# CONFIG_IPV6_SEG6_HMAC is not set -# CONFIG_IPV6_RPL_LWTUNNEL is not set -# CONFIG_IPV6_IOAM6_LWTUNNEL is not set -# CONFIG_NETLABEL is not set -# CONFIG_MPTCP is not set -CONFIG_NETWORK_SECMARK=y -CONFIG_NET_PTP_CLASSIFY=y -# CONFIG_NETWORK_PHY_TIMESTAMPING is not set -CONFIG_NETFILTER=y -CONFIG_NETFILTER_ADVANCED=y -CONFIG_BRIDGE_NETFILTER=m - -# Core Netfilter Configuration -CONFIG_NETFILTER_INGRESS=y -CONFIG_NETFILTER_EGRESS=y -CONFIG_NETFILTER_NETLINK=m -CONFIG_NETFILTER_FAMILY_BRIDGE=y -CONFIG_NETFILTER_FAMILY_ARP=y -CONFIG_NETFILTER_BPF_LINK=y -# CONFIG_NETFILTER_NETLINK_HOOK is not set -CONFIG_NETFILTER_NETLINK_ACCT=m -CONFIG_NETFILTER_NETLINK_QUEUE=m -CONFIG_NETFILTER_NETLINK_LOG=m -CONFIG_NETFILTER_NETLINK_OSF=m -CONFIG_NF_CONNTRACK=m -CONFIG_NF_LOG_SYSLOG=m -CONFIG_NETFILTER_CONNCOUNT=m -CONFIG_NF_CONNTRACK_MARK=y -CONFIG_NF_CONNTRACK_SECMARK=y -CONFIG_NF_CONNTRACK_ZONES=y -# CONFIG_NF_CONNTRACK_PROCFS is not set -CONFIG_NF_CONNTRACK_EVENTS=y -CONFIG_NF_CONNTRACK_TIMEOUT=y -CONFIG_NF_CONNTRACK_TIMESTAMP=y -CONFIG_NF_CONNTRACK_LABELS=y -CONFIG_NF_CONNTRACK_OVS=y -CONFIG_NF_CT_PROTO_DCCP=y -CONFIG_NF_CT_PROTO_GRE=y -CONFIG_NF_CT_PROTO_SCTP=y -CONFIG_NF_CT_PROTO_UDPLITE=y -CONFIG_NF_CONNTRACK_AMANDA=m -CONFIG_NF_CONNTRACK_FTP=m -CONFIG_NF_CONNTRACK_H323=m -CONFIG_NF_CONNTRACK_IRC=m -CONFIG_NF_CONNTRACK_BROADCAST=m -CONFIG_NF_CONNTRACK_NETBIOS_NS=m -CONFIG_NF_CONNTRACK_SNMP=m -CONFIG_NF_CONNTRACK_PPTP=m -CONFIG_NF_CONNTRACK_SANE=m -CONFIG_NF_CONNTRACK_SIP=m -CONFIG_NF_CONNTRACK_TFTP=m -CONFIG_NF_CT_NETLINK=m -CONFIG_NF_CT_NETLINK_TIMEOUT=m -# CONFIG_NETFILTER_NETLINK_GLUE_CT is not set -CONFIG_NF_NAT=m -CONFIG_NF_NAT_AMANDA=m -CONFIG_NF_NAT_FTP=m -CONFIG_NF_NAT_IRC=m -CONFIG_NF_NAT_SIP=m -CONFIG_NF_NAT_TFTP=m -CONFIG_NF_NAT_REDIRECT=y -CONFIG_NF_NAT_MASQUERADE=y -CONFIG_NF_NAT_OVS=y -CONFIG_NETFILTER_SYNPROXY=m -CONFIG_NF_TABLES=m -CONFIG_NF_TABLES_INET=y -# CONFIG_NF_TABLES_NETDEV is not set -CONFIG_NFT_NUMGEN=m -CONFIG_NFT_CT=m -# CONFIG_NFT_CONNLIMIT is not set -CONFIG_NFT_LOG=m -CONFIG_NFT_LIMIT=m -CONFIG_NFT_MASQ=m -CONFIG_NFT_REDIR=m -CONFIG_NFT_NAT=m -CONFIG_NFT_TUNNEL=m -CONFIG_NFT_QUEUE=m -CONFIG_NFT_QUOTA=m -CONFIG_NFT_REJECT=m -CONFIG_NFT_REJECT_INET=m -CONFIG_NFT_COMPAT=m -CONFIG_NFT_HASH=m -# CONFIG_NFT_XFRM is not set -# CONFIG_NFT_SOCKET is not set -# CONFIG_NFT_OSF is not set -CONFIG_NFT_TPROXY=m -# CONFIG_NFT_SYNPROXY is not set -# CONFIG_NF_FLOW_TABLE is not set -CONFIG_NETFILTER_XTABLES=y -CONFIG_NETFILTER_XTABLES_COMPAT=y - -## Xtables combined modules -CONFIG_NETFILTER_XT_MARK=m -CONFIG_NETFILTER_XT_CONNMARK=m -CONFIG_NETFILTER_XT_SET=m - -## Xtables targets -# CONFIG_NETFILTER_XT_TARGET_AUDIT is not set -CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m -CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m -CONFIG_NETFILTER_XT_TARGET_CONNMARK=m -CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m -CONFIG_NETFILTER_XT_TARGET_CT=m -CONFIG_NETFILTER_XT_TARGET_DSCP=m -CONFIG_NETFILTER_XT_TARGET_HL=m -CONFIG_NETFILTER_XT_TARGET_HMARK=m -CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m -CONFIG_NETFILTER_XT_TARGET_LOG=m -CONFIG_NETFILTER_XT_TARGET_MARK=m -CONFIG_NETFILTER_XT_NAT=m -CONFIG_NETFILTER_XT_TARGET_NETMAP=m -CONFIG_NETFILTER_XT_TARGET_NFLOG=m -CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m -CONFIG_NETFILTER_XT_TARGET_NOTRACK=m -CONFIG_NETFILTER_XT_TARGET_RATEEST=m -CONFIG_NETFILTER_XT_TARGET_REDIRECT=m -CONFIG_NETFILTER_XT_TARGET_MASQUERADE=m -CONFIG_NETFILTER_XT_TARGET_TEE=m -CONFIG_NETFILTER_XT_TARGET_TPROXY=m -CONFIG_NETFILTER_XT_TARGET_TRACE=m -CONFIG_NETFILTER_XT_TARGET_SECMARK=m -CONFIG_NETFILTER_XT_TARGET_TCPMSS=m -CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m - -## Xtables matches -CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m -CONFIG_NETFILTER_XT_MATCH_BPF=m -CONFIG_NETFILTER_XT_MATCH_CGROUP=m -CONFIG_NETFILTER_XT_MATCH_CLUSTER=m -CONFIG_NETFILTER_XT_MATCH_COMMENT=m -CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m -CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m -CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m -CONFIG_NETFILTER_XT_MATCH_CONNMARK=m -CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m -CONFIG_NETFILTER_XT_MATCH_CPU=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m -CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m -CONFIG_NETFILTER_XT_MATCH_DSCP=m -CONFIG_NETFILTER_XT_MATCH_ECN=m -CONFIG_NETFILTER_XT_MATCH_ESP=m -CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m -CONFIG_NETFILTER_XT_MATCH_HELPER=m -CONFIG_NETFILTER_XT_MATCH_HL=m -# CONFIG_NETFILTER_XT_MATCH_IPCOMP is not set -CONFIG_NETFILTER_XT_MATCH_IPRANGE=m -CONFIG_NETFILTER_XT_MATCH_IPVS=m -# CONFIG_NETFILTER_XT_MATCH_L2TP is not set -CONFIG_NETFILTER_XT_MATCH_LENGTH=m -CONFIG_NETFILTER_XT_MATCH_LIMIT=m -CONFIG_NETFILTER_XT_MATCH_MAC=m -CONFIG_NETFILTER_XT_MATCH_MARK=m -CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m -CONFIG_NETFILTER_XT_MATCH_NFACCT=m -CONFIG_NETFILTER_XT_MATCH_OSF=m -CONFIG_NETFILTER_XT_MATCH_OWNER=m -CONFIG_NETFILTER_XT_MATCH_POLICY=m -CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m -CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m -CONFIG_NETFILTER_XT_MATCH_QUOTA=m -CONFIG_NETFILTER_XT_MATCH_RATEEST=m -CONFIG_NETFILTER_XT_MATCH_REALM=m -CONFIG_NETFILTER_XT_MATCH_RECENT=m -CONFIG_NETFILTER_XT_MATCH_SCTP=m -CONFIG_NETFILTER_XT_MATCH_SOCKET=m -CONFIG_NETFILTER_XT_MATCH_STATE=m -CONFIG_NETFILTER_XT_MATCH_STATISTIC=m -CONFIG_NETFILTER_XT_MATCH_STRING=m -CONFIG_NETFILTER_XT_MATCH_TCPMSS=m -CONFIG_NETFILTER_XT_MATCH_TIME=m -CONFIG_NETFILTER_XT_MATCH_U32=m -# end of Core Netfilter Configuration - -CONFIG_IP_SET=m -CONFIG_IP_SET_MAX=256 -CONFIG_IP_SET_BITMAP_IP=m -CONFIG_IP_SET_BITMAP_IPMAC=m -CONFIG_IP_SET_BITMAP_PORT=m -CONFIG_IP_SET_HASH_IP=m -CONFIG_IP_SET_HASH_IPMARK=m -CONFIG_IP_SET_HASH_IPPORT=m -CONFIG_IP_SET_HASH_IPPORTIP=m -CONFIG_IP_SET_HASH_IPPORTNET=m -CONFIG_IP_SET_HASH_IPMAC=m -CONFIG_IP_SET_HASH_MAC=m -CONFIG_IP_SET_HASH_NETPORTNET=m -CONFIG_IP_SET_HASH_NET=m -CONFIG_IP_SET_HASH_NETNET=m -CONFIG_IP_SET_HASH_NETPORT=m -CONFIG_IP_SET_HASH_NETIFACE=m -CONFIG_IP_SET_LIST_SET=m -CONFIG_IP_VS=m -CONFIG_IP_VS_IPV6=y -# CONFIG_IP_VS_DEBUG is not set -CONFIG_IP_VS_TAB_BITS=12 - -## IPVS transport protocol load balancing support -CONFIG_IP_VS_PROTO_TCP=y -CONFIG_IP_VS_PROTO_UDP=y -# CONFIG_IP_VS_PROTO_ESP is not set -# CONFIG_IP_VS_PROTO_AH is not set -# CONFIG_IP_VS_PROTO_SCTP is not set - -## IPVS scheduler -CONFIG_IP_VS_RR=m -CONFIG_IP_VS_WRR=m -# CONFIG_IP_VS_LC is not set -# CONFIG_IP_VS_WLC is not set -# CONFIG_IP_VS_FO is not set -# CONFIG_IP_VS_OVF is not set -# CONFIG_IP_VS_LBLC is not set -# CONFIG_IP_VS_LBLCR is not set -# CONFIG_IP_VS_DH is not set -CONFIG_IP_VS_SH=m -# CONFIG_IP_VS_MH is not set -# CONFIG_IP_VS_SED is not set -# CONFIG_IP_VS_NQ is not set -# CONFIG_IP_VS_TWOS is not set - -## IPVS SH scheduler -CONFIG_IP_VS_SH_TAB_BITS=8 - -## IPVS MH scheduler -CONFIG_IP_VS_MH_TAB_INDEX=12 - -## IPVS application helper -# CONFIG_IP_VS_FTP is not set -CONFIG_IP_VS_NFCT=y -# CONFIG_IP_VS_PE_SIP is not set - -# IP: Netfilter Configuration -CONFIG_NF_DEFRAG_IPV4=m -CONFIG_IP_NF_IPTABLES_LEGACY=m -CONFIG_NF_SOCKET_IPV4=m -CONFIG_NF_TPROXY_IPV4=m -CONFIG_NF_TABLES_IPV4=y -CONFIG_NFT_REJECT_IPV4=m -CONFIG_NFT_DUP_IPV4=m -# CONFIG_NFT_FIB_IPV4 is not set -# CONFIG_NF_TABLES_ARP is not set -CONFIG_NF_DUP_IPV4=m -# CONFIG_NF_LOG_ARP is not set -CONFIG_NF_LOG_IPV4=m -CONFIG_NF_REJECT_IPV4=m -CONFIG_NF_NAT_SNMP_BASIC=m -CONFIG_NF_NAT_PPTP=m -CONFIG_NF_NAT_H323=m -CONFIG_IP_NF_IPTABLES=m -CONFIG_IP_NF_MATCH_AH=m -CONFIG_IP_NF_MATCH_ECN=m -CONFIG_IP_NF_MATCH_RPFILTER=m -CONFIG_IP_NF_MATCH_TTL=m -CONFIG_IP_NF_FILTER=m -CONFIG_IP_NF_TARGET_REJECT=m -CONFIG_IP_NF_TARGET_SYNPROXY=m -CONFIG_IP_NF_NAT=m -CONFIG_IP_NF_TARGET_MASQUERADE=m -CONFIG_IP_NF_TARGET_NETMAP=m -CONFIG_IP_NF_TARGET_REDIRECT=m -CONFIG_IP_NF_MANGLE=m -CONFIG_IP_NF_TARGET_ECN=m -CONFIG_IP_NF_TARGET_TTL=m -CONFIG_IP_NF_RAW=m -CONFIG_IP_NF_SECURITY=m -CONFIG_IP_NF_ARPTABLES=m -CONFIG_IP_NF_ARPFILTER=m -CONFIG_IP_NF_ARP_MANGLE=m -# end of IP: Netfilter Configuration - -# IPv6: Netfilter Configuration -CONFIG_IP6_NF_IPTABLES_LEGACY=m -CONFIG_NF_SOCKET_IPV6=m -CONFIG_NF_TPROXY_IPV6=m -CONFIG_NF_TABLES_IPV6=y -CONFIG_NFT_REJECT_IPV6=m -CONFIG_NFT_DUP_IPV6=m -# CONFIG_NFT_FIB_IPV6 is not set -CONFIG_NF_DUP_IPV6=m -CONFIG_NF_REJECT_IPV6=m -CONFIG_NF_LOG_IPV6=m -CONFIG_IP6_NF_IPTABLES=m -CONFIG_IP6_NF_MATCH_AH=m -CONFIG_IP6_NF_MATCH_EUI64=m -CONFIG_IP6_NF_MATCH_FRAG=m -CONFIG_IP6_NF_MATCH_OPTS=m -CONFIG_IP6_NF_MATCH_HL=m -CONFIG_IP6_NF_MATCH_IPV6HEADER=m -CONFIG_IP6_NF_MATCH_MH=m -CONFIG_IP6_NF_MATCH_RPFILTER=m -CONFIG_IP6_NF_MATCH_RT=m -# CONFIG_IP6_NF_MATCH_SRH is not set -CONFIG_IP6_NF_TARGET_HL=m -CONFIG_IP6_NF_FILTER=m -CONFIG_IP6_NF_TARGET_REJECT=m -CONFIG_IP6_NF_TARGET_SYNPROXY=m -CONFIG_IP6_NF_MANGLE=m -CONFIG_IP6_NF_RAW=m -CONFIG_IP6_NF_SECURITY=m -CONFIG_IP6_NF_NAT=m -CONFIG_IP6_NF_TARGET_MASQUERADE=m -CONFIG_IP6_NF_TARGET_NPT=m -# end of IPv6: Netfilter Configuration - -CONFIG_NF_DEFRAG_IPV6=m -# CONFIG_NF_TABLES_BRIDGE is not set -CONFIG_NF_CONNTRACK_BRIDGE=m -CONFIG_BRIDGE_NF_EBTABLES_LEGACY=m -CONFIG_BRIDGE_NF_EBTABLES=m -CONFIG_BRIDGE_EBT_BROUTE=m -CONFIG_BRIDGE_EBT_T_FILTER=m -CONFIG_BRIDGE_EBT_T_NAT=m -CONFIG_BRIDGE_EBT_802_3=m -CONFIG_BRIDGE_EBT_AMONG=m -CONFIG_BRIDGE_EBT_ARP=m -CONFIG_BRIDGE_EBT_IP=m -CONFIG_BRIDGE_EBT_IP6=m -CONFIG_BRIDGE_EBT_LIMIT=m -CONFIG_BRIDGE_EBT_MARK=m -CONFIG_BRIDGE_EBT_PKTTYPE=m -CONFIG_BRIDGE_EBT_STP=m -CONFIG_BRIDGE_EBT_VLAN=m -CONFIG_BRIDGE_EBT_ARPREPLY=m -CONFIG_BRIDGE_EBT_DNAT=m -CONFIG_BRIDGE_EBT_MARK_T=m -CONFIG_BRIDGE_EBT_REDIRECT=m -CONFIG_BRIDGE_EBT_SNAT=m -CONFIG_BRIDGE_EBT_LOG=m -CONFIG_BRIDGE_EBT_NFLOG=m -# CONFIG_IP_DCCP is not set -# CONFIG_IP_SCTP is not set -# CONFIG_RDS is not set -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_L2TP is not set -CONFIG_STP=m -CONFIG_GARP=m -CONFIG_MRP=m -CONFIG_BRIDGE=m -CONFIG_BRIDGE_IGMP_SNOOPING=y -CONFIG_BRIDGE_VLAN_FILTERING=y -# CONFIG_BRIDGE_MRP is not set -# CONFIG_BRIDGE_CFM is not set -# CONFIG_NET_DSA is not set -CONFIG_VLAN_8021Q=m -CONFIG_VLAN_8021Q_GVRP=y -CONFIG_VLAN_8021Q_MVRP=y -CONFIG_LLC=m -# CONFIG_LLC2 is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_PHONET is not set -# CONFIG_6LOWPAN is not set -# CONFIG_IEEE802154 is not set -CONFIG_NET_SCHED=y - -## Queueing/Scheduling -CONFIG_NET_SCH_HTB=m -CONFIG_NET_SCH_HFSC=m -# CONFIG_NET_SCH_PRIO is not set -CONFIG_NET_SCH_MULTIQ=m -# CONFIG_NET_SCH_RED is not set -# CONFIG_NET_SCH_SFB is not set -CONFIG_NET_SCH_SFQ=m -# CONFIG_NET_SCH_TEQL is not set -# CONFIG_NET_SCH_TBF is not set -# CONFIG_NET_SCH_CBS is not set -CONFIG_NET_SCH_ETF=m -# CONFIG_NET_SCH_TAPRIO is not set -# CONFIG_NET_SCH_GRED is not set -# CONFIG_NET_SCH_NETEM is not set -# CONFIG_NET_SCH_DRR is not set -# CONFIG_NET_SCH_MQPRIO is not set -# CONFIG_NET_SCH_SKBPRIO is not set -# CONFIG_NET_SCH_CHOKE is not set -# CONFIG_NET_SCH_QFQ is not set -# CONFIG_NET_SCH_CODEL is not set -CONFIG_NET_SCH_FQ_CODEL=m -# CONFIG_NET_SCH_CAKE is not set -# CONFIG_NET_SCH_FQ is not set -# CONFIG_NET_SCH_HHF is not set -# CONFIG_NET_SCH_PIE is not set -# CONFIG_NET_SCH_PLUG is not set -# CONFIG_NET_SCH_ETS is not set -# CONFIG_NET_SCH_DEFAULT is not set - -## Classification -CONFIG_NET_CLS=y -CONFIG_NET_CLS_BASIC=m -CONFIG_NET_CLS_ROUTE4=m -CONFIG_NET_CLS_FW=m -CONFIG_NET_CLS_U32=m -CONFIG_CLS_U32_PERF=y -CONFIG_CLS_U32_MARK=y -CONFIG_NET_CLS_FLOW=m -CONFIG_NET_CLS_CGROUP=m -# CONFIG_NET_CLS_BPF is not set -# CONFIG_NET_CLS_FLOWER is not set -# CONFIG_NET_CLS_MATCHALL is not set -CONFIG_NET_EMATCH=y -CONFIG_NET_EMATCH_STACK=32 -# CONFIG_NET_EMATCH_CMP is not set -# CONFIG_NET_EMATCH_NBYTE is not set -# CONFIG_NET_EMATCH_U32 is not set -# CONFIG_NET_EMATCH_META is not set -# CONFIG_NET_EMATCH_TEXT is not set -# CONFIG_NET_EMATCH_IPSET is not set -# CONFIG_NET_EMATCH_IPT is not set -# CONFIG_NET_CLS_ACT is not set -CONFIG_NET_SCH_FIFO=y -# CONFIG_DCB is not set -CONFIG_DNS_RESOLVER=m -# CONFIG_BATMAN_ADV is not set -CONFIG_OPENVSWITCH=m -CONFIG_OPENVSWITCH_GRE=m -CONFIG_OPENVSWITCH_VXLAN=m -CONFIG_OPENVSWITCH_GENEVE=m -CONFIG_VSOCKETS=y -CONFIG_VSOCKETS_DIAG=m -CONFIG_VSOCKETS_LOOPBACK=y -CONFIG_VMWARE_VMCI_VSOCKETS=y -CONFIG_VIRTIO_VSOCKETS_COMMON=y -CONFIG_NETLINK_DIAG=m -CONFIG_MPLS=y -CONFIG_NET_MPLS_GSO=m -# CONFIG_MPLS_ROUTING is not set -CONFIG_NET_NSH=m -# CONFIG_HSR is not set -CONFIG_NET_SWITCHDEV=y -CONFIG_NET_L3_MASTER_DEV=y -# CONFIG_QRTR is not set -# CONFIG_NET_NCSI is not set -CONFIG_PCPU_DEV_REFCNT=y -CONFIG_MAX_SKB_FRAGS=17 -CONFIG_RPS=y -CONFIG_RFS_ACCEL=y -CONFIG_SOCK_RX_QUEUE_MAPPING=y -CONFIG_XPS=y -CONFIG_CGROUP_NET_PRIO=y -CONFIG_CGROUP_NET_CLASSID=y -CONFIG_NET_RX_BUSY_POLL=y -CONFIG_BQL=y -# CONFIG_BPF_STREAM_PARSER is not set -CONFIG_NET_FLOW_LIMIT=y - -# Network testing -# CONFIG_NET_PKTGEN is not set -# end of Network testing -# end of Networking options - -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_BT is not set -# CONFIG_AF_RXRPC is not set -# CONFIG_AF_KCM is not set -CONFIG_STREAM_PARSER=y -# CONFIG_MCTP is not set -CONFIG_FIB_RULES=y -# CONFIG_WIRELESS is not set -# CONFIG_RFKILL is not set -CONFIG_NET_9P=m -CONFIG_NET_9P_FD=m -# CONFIG_NET_9P_RDMA is not set -# CONFIG_NET_9P_DEBUG is not set -# CONFIG_CAIF is not set -# CONFIG_CEPH_LIB is not set -# CONFIG_NFC is not set -# CONFIG_PSAMPLE is not set -# CONFIG_NET_IFE is not set -# CONFIG_LWTUNNEL is not set -CONFIG_DST_CACHE=y -CONFIG_GRO_CELLS=y -CONFIG_SOCK_VALIDATE_XMIT=y -CONFIG_NET_SOCK_MSG=y -CONFIG_NET_DEVLINK=y -CONFIG_PAGE_POOL=y -# CONFIG_PAGE_POOL_STATS is not set -# CONFIG_FAILOVER is not set -CONFIG_ETHTOOL_NETLINK=y - -# Device Drivers -CONFIG_HAVE_PCI=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_PCI=y -CONFIG_PCI_DOMAINS=y -CONFIG_PCIEPORTBUS=y -CONFIG_HOTPLUG_PCI_PCIE=y -# CONFIG_PCIEAER is not set -CONFIG_PCIEASPM=y -CONFIG_PCIEASPM_DEFAULT=y -# CONFIG_PCIEASPM_POWERSAVE is not set -# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set -# CONFIG_PCIEASPM_PERFORMANCE is not set -CONFIG_PCIE_PTM=y -CONFIG_PCI_MSI=y -CONFIG_PCI_QUIRKS=y -# CONFIG_PCI_DEBUG is not set -# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set -# CONFIG_PCI_STUB is not set -# CONFIG_PCI_PF_STUB is not set -CONFIG_PCI_ATS=y -CONFIG_PCI_LOCKLESS_CONFIG=y -CONFIG_PCI_IOV=y -CONFIG_PCI_PRI=y -CONFIG_PCI_PASID=y -# CONFIG_PCI_P2PDMA is not set -CONFIG_PCI_LABEL=y -# CONFIG_PCIE_BUS_TUNE_OFF is not set -CONFIG_PCIE_BUS_DEFAULT=y -# CONFIG_PCIE_BUS_SAFE is not set -# CONFIG_PCIE_BUS_PERFORMANCE is not set -# CONFIG_PCIE_BUS_PEER2PEER is not set -CONFIG_VGA_ARB=y -CONFIG_VGA_ARB_MAX_GPUS=16 -CONFIG_HOTPLUG_PCI=y -CONFIG_HOTPLUG_PCI_ACPI=y -# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set -# CONFIG_HOTPLUG_PCI_CPCI is not set -# CONFIG_HOTPLUG_PCI_SHPC is not set - -# PCI controller drivers -# CONFIG_VMD is not set - -# Cadence-based PCIe controllers -# end of Cadence-based PCIe controllers - -# DesignWare-based PCIe controllers -# CONFIG_PCI_MESON is not set -# CONFIG_PCIE_DW_PLAT_HOST is not set -# end of DesignWare-based PCIe controllers - -# Mobiveil-based PCIe controllers -# end of Mobiveil-based PCIe controllers - -# PLDA-based PCIe controllers -# end of PLDA-based PCIe controllers -# end of PCI controller drivers - -# PCI Endpoint -# CONFIG_PCI_ENDPOINT is not set -# end of PCI Endpoint - -# PCI switch controller drivers -# CONFIG_PCI_SW_SWITCHTEC is not set -# end of PCI switch controller drivers - -# CONFIG_CXL_BUS is not set -# CONFIG_PCCARD is not set -# CONFIG_RAPIDIO is not set - -# Generic Driver Options -CONFIG_AUXILIARY_BUS=y -# CONFIG_UEVENT_HELPER is not set -CONFIG_DEVTMPFS=y -CONFIG_DEVTMPFS_MOUNT=y -# CONFIG_DEVTMPFS_SAFE is not set -CONFIG_STANDALONE=y -CONFIG_PREVENT_FIRMWARE_BUILD=y - -# Firmware loader -CONFIG_FW_LOADER=y -# CONFIG_FW_LOADER_DEBUG is not set -CONFIG_EXTRA_FIRMWARE="" -# CONFIG_FW_LOADER_USER_HELPER is not set -# CONFIG_FW_LOADER_COMPRESS is not set -# CONFIG_FW_UPLOAD is not set -# end of Firmware loader - -CONFIG_ALLOW_DEV_COREDUMP=y -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set -# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set -CONFIG_GENERIC_CPU_DEVICES=y -CONFIG_GENERIC_CPU_AUTOPROBE=y -CONFIG_GENERIC_CPU_VULNERABILITIES=y -CONFIG_DMA_SHARED_BUFFER=y -# CONFIG_DMA_FENCE_TRACE is not set -# CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT is not set -# end of Generic Driver Options - -# Bus devices -# CONFIG_MHI_BUS is not set -# CONFIG_MHI_BUS_EP is not set -# end of Bus devices - -# Cache Drivers -# end of Cache Drivers - -CONFIG_CONNECTOR=m - -# Firmware Drivers - -# ARM System Control and Management Interface Protocol -# end of ARM System Control and Management Interface Protocol - -# CONFIG_EDD is not set -CONFIG_FIRMWARE_MEMMAP=y -CONFIG_DMIID=y -CONFIG_DMI_SYSFS=m -CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y -# CONFIG_ISCSI_IBFT is not set -# CONFIG_FW_CFG_SYSFS is not set -CONFIG_SYSFB=y -# CONFIG_SYSFB_SIMPLEFB is not set -# CONFIG_GOOGLE_FIRMWARE is not set - -# EFI (Extensible Firmware Interface) Support -CONFIG_EFI_ESRT=y -CONFIG_EFI_DXE_MEM_ATTRIBUTES=y -CONFIG_EFI_RUNTIME_WRAPPERS=y -# CONFIG_EFI_BOOTLOADER_CONTROL is not set -# CONFIG_EFI_CAPSULE_LOADER is not set -# CONFIG_EFI_TEST is not set -# CONFIG_APPLE_PROPERTIES is not set -# CONFIG_RESET_ATTACK_MITIGATION is not set -# CONFIG_EFI_RCI2_TABLE is not set -# CONFIG_EFI_DISABLE_PCI_DMA is not set -CONFIG_EFI_EARLYCON=y -# CONFIG_EFI_CUSTOM_SSDT_OVERLAYS is not set -# CONFIG_EFI_DISABLE_RUNTIME is not set -# CONFIG_EFI_COCO_SECRET is not set -CONFIG_UNACCEPTED_MEMORY=y -# end of EFI (Extensible Firmware Interface) Support - -# Qualcomm firmware drivers -# end of Qualcomm firmware drivers - -# Tegra firmware driver -# end of Tegra firmware driver -# end of Firmware Drivers - -# CONFIG_GNSS is not set -CONFIG_MTD=m -# CONFIG_MTD_TESTS is not set - -# Partition parsers -# CONFIG_MTD_CMDLINE_PARTS is not set -# CONFIG_MTD_REDBOOT_PARTS is not set -# end of Partition parsers - -## User Modules And Translation Layers -# CONFIG_MTD_BLOCK is not set -# CONFIG_MTD_BLOCK_RO is not set -# CONFIG_FTL is not set -# CONFIG_NFTL is not set -# CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set -# CONFIG_SSFDC is not set -# CONFIG_SM_FTL is not set -# CONFIG_MTD_OOPS is not set -# CONFIG_MTD_SWAP is not set -# CONFIG_MTD_PARTITIONED_MASTER is not set - -# RAM/ROM/Flash chip drivers -# CONFIG_MTD_CFI is not set -# CONFIG_MTD_JEDECPROBE is not set -CONFIG_MTD_MAP_BANK_WIDTH_1=y -CONFIG_MTD_MAP_BANK_WIDTH_2=y -CONFIG_MTD_MAP_BANK_WIDTH_4=y -CONFIG_MTD_CFI_I1=y -CONFIG_MTD_CFI_I2=y -# CONFIG_MTD_RAM is not set -# CONFIG_MTD_ROM is not set -# CONFIG_MTD_ABSENT is not set -# end of RAM/ROM/Flash chip drivers - -# Mapping drivers for chip access -# CONFIG_MTD_COMPLEX_MAPPINGS is not set -# CONFIG_MTD_PLATRAM is not set -# end of Mapping drivers for chip access - -# Self-contained MTD device drivers -# CONFIG_MTD_PMC551 is not set -# CONFIG_MTD_SLRAM is not set -# CONFIG_MTD_PHRAM is not set -# CONFIG_MTD_MTDRAM is not set -# CONFIG_MTD_BLOCK2MTD is not set - -## Disk-On-Chip Device Drivers -# CONFIG_MTD_DOCG3 is not set -# end of Self-contained MTD device drivers - -# NAND -# CONFIG_MTD_ONENAND is not set -# CONFIG_MTD_RAW_NAND is not set - -# ECC engine support -# CONFIG_MTD_NAND_ECC_SW_HAMMING is not set -# CONFIG_MTD_NAND_ECC_SW_BCH is not set -# CONFIG_MTD_NAND_ECC_MXIC is not set -# end of ECC engine support -# end of NAND - -# LPDDR & LPDDR2 PCM memory drivers -# CONFIG_MTD_LPDDR is not set -# end of LPDDR & LPDDR2 PCM memory drivers - -# CONFIG_MTD_UBI is not set -# CONFIG_MTD_HYPERBUS is not set -# CONFIG_OF is not set -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -# CONFIG_PARPORT is not set -CONFIG_PNP=y -# CONFIG_PNP_DEBUG_MESSAGES is not set - -## Protocols -CONFIG_PNPACPI=y -CONFIG_BLK_DEV=y -# CONFIG_BLK_DEV_NULL_BLK is not set -CONFIG_BLK_DEV_FD=m -# CONFIG_BLK_DEV_FD_RAWCMD is not set -CONFIG_CDROM=m -# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set -# CONFIG_ZRAM is not set -CONFIG_BLK_DEV_LOOP=m -CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 -# CONFIG_BLK_DEV_DRBD is not set -CONFIG_BLK_DEV_NBD=m -CONFIG_BLK_DEV_RAM=m -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=16384 -# CONFIG_CDROM_PKTCDVD is not set -# CONFIG_ATA_OVER_ETH is not set -# CONFIG_BLK_DEV_RBD is not set -# CONFIG_BLK_DEV_UBLK is not set - -# NVME Support -CONFIG_NVME_CORE=y -CONFIG_BLK_DEV_NVME=y -# CONFIG_NVME_MULTIPATH is not set -# CONFIG_NVME_VERBOSE_ERRORS is not set -# CONFIG_NVME_RDMA is not set -# CONFIG_NVME_FC is not set -# CONFIG_NVME_TCP is not set -# CONFIG_NVME_HOST_AUTH is not set -# CONFIG_NVME_TARGET is not set -# end of NVME Support - -# Misc devices -# CONFIG_AD525X_DPOT is not set -# CONFIG_DUMMY_IRQ is not set -# CONFIG_IBM_ASM is not set -# CONFIG_PHANTOM is not set -# CONFIG_TIFM_CORE is not set -# CONFIG_ICS932S401 is not set -# CONFIG_ENCLOSURE_SERVICES is not set -# CONFIG_HP_ILO is not set -# CONFIG_APDS9802ALS is not set -# CONFIG_ISL29003 is not set -# CONFIG_ISL29020 is not set -# CONFIG_SENSORS_TSL2550 is not set -# CONFIG_SENSORS_BH1770 is not set -# CONFIG_SENSORS_APDS990X is not set -# CONFIG_HMC6352 is not set -# CONFIG_DS1682 is not set -CONFIG_VMWARE_BALLOON=y -# CONFIG_SRAM is not set -# CONFIG_DW_XDATA_PCIE is not set -# CONFIG_PCI_ENDPOINT_TEST is not set -# CONFIG_XILINX_SDFEC is not set -# CONFIG_C2PORT is not set - -# EEPROM support -# CONFIG_EEPROM_AT24 is not set -# CONFIG_EEPROM_MAX6875 is not set -# CONFIG_EEPROM_93CX6 is not set -# CONFIG_EEPROM_IDT_89HPESX is not set -# CONFIG_EEPROM_EE1004 is not set -# end of EEPROM support - -# CONFIG_CB710_CORE is not set - -# Texas Instruments shared transport line discipline -# end of Texas Instruments shared transport line discipline - -# CONFIG_SENSORS_LIS3_I2C is not set - -## Altera FPGA firmware download module (requires I2C) -# CONFIG_ALTERA_STAPL is not set -# CONFIG_INTEL_MEI is not set -CONFIG_VMWARE_VMCI=y -# CONFIG_GENWQE is not set -# CONFIG_ECHO is not set -# CONFIG_BCM_VK is not set -# CONFIG_MISC_ALCOR_PCI is not set -# CONFIG_MISC_RTSX_PCI is not set -# CONFIG_MISC_RTSX_USB is not set -# CONFIG_UACCE is not set -# CONFIG_PVPANIC is not set -# CONFIG_KEBA_CP500 is not set -CONFIG_VMWARE_EXTCFG=y -CONFIG_SBX=m -CONFIG_SBX_DTLS=m -# end of Misc devices - -# SCSI device support -CONFIG_SCSI_MOD=y -CONFIG_RAID_ATTRS=m -CONFIG_SCSI_COMMON=y -CONFIG_SCSI=y -CONFIG_SCSI_DMA=y -# CONFIG_SCSI_PROC_FS is not set - -## SCSI support type (disk, tape, CD-ROM) -CONFIG_BLK_DEV_SD=y -# CONFIG_CHR_DEV_ST is not set -CONFIG_BLK_DEV_SR=m -CONFIG_CHR_DEV_SG=m -CONFIG_BLK_DEV_BSG=y -# CONFIG_CHR_DEV_SCH is not set -CONFIG_SCSI_CONSTANTS=y -CONFIG_SCSI_LOGGING=y -CONFIG_SCSI_SCAN_ASYNC=y - -# SCSI Transports -CONFIG_SCSI_SPI_ATTRS=y -# CONFIG_SCSI_FC_ATTRS is not set -CONFIG_SCSI_ISCSI_ATTRS=m -CONFIG_SCSI_SAS_ATTRS=y -# CONFIG_SCSI_SAS_LIBSAS is not set -# CONFIG_SCSI_SRP_ATTRS is not set -# end of SCSI Transports - -CONFIG_SCSI_LOWLEVEL=y -CONFIG_ISCSI_TCP=m -# CONFIG_ISCSI_BOOT_SYSFS is not set -# CONFIG_SCSI_CXGB3_ISCSI is not set -# CONFIG_SCSI_CXGB4_ISCSI is not set -# CONFIG_SCSI_BNX2_ISCSI is not set -# CONFIG_BE2ISCSI is not set -# CONFIG_BLK_DEV_3W_XXXX_RAID is not set -# CONFIG_SCSI_HPSA is not set -# CONFIG_SCSI_3W_9XXX is not set -# CONFIG_SCSI_3W_SAS is not set -# CONFIG_SCSI_ACARD is not set -# CONFIG_SCSI_AACRAID is not set -# CONFIG_SCSI_AIC7XXX is not set -# CONFIG_SCSI_AIC79XX is not set -# CONFIG_SCSI_AIC94XX is not set -# CONFIG_SCSI_MVSAS is not set -# CONFIG_SCSI_MVUMI is not set -# CONFIG_SCSI_ADVANSYS is not set -# CONFIG_SCSI_ARCMSR is not set -# CONFIG_SCSI_ESAS2R is not set -CONFIG_MEGARAID_NEWGEN=y -CONFIG_MEGARAID_MM=m -CONFIG_MEGARAID_MAILBOX=m -# CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set -CONFIG_SCSI_MPT3SAS=m -CONFIG_SCSI_MPT2SAS_MAX_SGE=128 -CONFIG_SCSI_MPT3SAS_MAX_SGE=128 -# CONFIG_SCSI_MPT2SAS is not set -# CONFIG_SCSI_MPI3MR is not set -# CONFIG_SCSI_SMARTPQI is not set -# CONFIG_SCSI_HPTIOP is not set -# CONFIG_SCSI_BUSLOGIC is not set -# CONFIG_SCSI_MYRB is not set -# CONFIG_SCSI_MYRS is not set -CONFIG_VMWARE_PVSCSI=y -# CONFIG_SCSI_SNIC is not set -# CONFIG_SCSI_DMX3191D is not set -# CONFIG_SCSI_FDOMAIN_PCI is not set -# CONFIG_SCSI_ISCI is not set -# CONFIG_SCSI_IPS is not set -# CONFIG_SCSI_INITIO is not set -# CONFIG_SCSI_INIA100 is not set -# CONFIG_SCSI_STEX is not set -# CONFIG_SCSI_SYM53C8XX_2 is not set -# CONFIG_SCSI_IPR is not set -# CONFIG_SCSI_QLOGIC_1280 is not set -# CONFIG_SCSI_QLA_ISCSI is not set -# CONFIG_SCSI_DC395x is not set -# CONFIG_SCSI_AM53C974 is not set -# CONFIG_SCSI_WD719X is not set -# CONFIG_SCSI_DEBUG is not set -# CONFIG_SCSI_PMCRAID is not set -# CONFIG_SCSI_PM8001 is not set -# CONFIG_SCSI_DH is not set -# end of SCSI device support - -CONFIG_ATA=y -CONFIG_SATA_HOST=y -CONFIG_PATA_TIMINGS=y -# CONFIG_ATA_VERBOSE_ERROR is not set -CONFIG_ATA_FORCE=y -CONFIG_ATA_ACPI=y -# CONFIG_SATA_PMP is not set - -## Controllers with non-SFF native interface -CONFIG_SATA_AHCI=y -CONFIG_SATA_MOBILE_LPM_POLICY=0 -# CONFIG_SATA_AHCI_PLATFORM is not set -# CONFIG_AHCI_DWC is not set -# CONFIG_SATA_INIC162X is not set -# CONFIG_SATA_ACARD_AHCI is not set -# CONFIG_SATA_SIL24 is not set -# CONFIG_ATA_SFF is not set -CONFIG_MD=y -# CONFIG_BLK_DEV_MD is not set -# CONFIG_MD_BITMAP_FILE is not set -# CONFIG_BCACHE is not set -CONFIG_BLK_DEV_DM_BUILTIN=y -CONFIG_BLK_DEV_DM=m -# CONFIG_DM_DEBUG is not set -CONFIG_DM_BUFIO=m -# CONFIG_DM_DEBUG_BLOCK_MANAGER_LOCKING is not set -CONFIG_DM_BIO_PRISON=m -CONFIG_DM_PERSISTENT_DATA=m -# CONFIG_DM_UNSTRIPED is not set -CONFIG_DM_CRYPT=m -CONFIG_DM_SNAPSHOT=m -CONFIG_DM_THIN_PROVISIONING=m -# CONFIG_DM_CACHE is not set -# CONFIG_DM_WRITECACHE is not set -# CONFIG_DM_EBS is not set -# CONFIG_DM_ERA is not set -# CONFIG_DM_CLONE is not set -CONFIG_DM_MIRROR=m -# CONFIG_DM_LOG_USERSPACE is not set -# CONFIG_DM_RAID is not set -CONFIG_DM_ZERO=m -# CONFIG_DM_MULTIPATH is not set -CONFIG_DM_DELAY=m -# CONFIG_DM_DUST is not set -CONFIG_DM_UEVENT=y -# CONFIG_DM_FLAKEY is not set -# CONFIG_DM_VERITY is not set -# CONFIG_DM_SWITCH is not set -# CONFIG_DM_LOG_WRITES is not set -# CONFIG_DM_INTEGRITY is not set -# CONFIG_DM_AUDIT is not set -# CONFIG_DM_VDO is not set -# CONFIG_TARGET_CORE is not set -CONFIG_FUSION=y -CONFIG_FUSION_SPI=y -CONFIG_FUSION_SAS=y -CONFIG_FUSION_MAX_SGE=128 -# CONFIG_FUSION_CTL is not set -# CONFIG_FUSION_LOGGING is not set - -# IEEE 1394 (FireWire) support -# CONFIG_FIREWIRE is not set -# CONFIG_FIREWIRE_NOSY is not set -# end of IEEE 1394 (FireWire) support - -# CONFIG_MACINTOSH_DRIVERS is not set -CONFIG_NETDEVICES=y -CONFIG_MII=m -CONFIG_NET_CORE=y -CONFIG_BONDING=m -CONFIG_DUMMY=m -CONFIG_WIREGUARD=m -# CONFIG_WIREGUARD_DEBUG is not set -# CONFIG_EQUALIZER is not set -# CONFIG_NET_FC is not set -CONFIG_NET_TEAM=m -CONFIG_NET_TEAM_MODE_BROADCAST=m -CONFIG_NET_TEAM_MODE_ROUNDROBIN=m -CONFIG_NET_TEAM_MODE_RANDOM=m -CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m -CONFIG_NET_TEAM_MODE_LOADBALANCE=m -CONFIG_MACVLAN=m -CONFIG_MACVTAP=m -CONFIG_IPVLAN_L3S=y -CONFIG_IPVLAN=m -# CONFIG_IPVTAP is not set -CONFIG_VXLAN=m -CONFIG_GENEVE=m -# CONFIG_BAREUDP is not set -# CONFIG_GTP is not set -# CONFIG_PFCP is not set -# CONFIG_AMT is not set -# CONFIG_MACSEC is not set -# CONFIG_NETCONSOLE is not set -CONFIG_TUN=m -CONFIG_TAP=m -# CONFIG_TUN_VNET_CROSS_LE is not set -CONFIG_VETH=m -# CONFIG_NLMON is not set -# CONFIG_NETKIT is not set -CONFIG_NET_VRF=m -# CONFIG_ARCNET is not set -CONFIG_ETHERNET=y -# CONFIG_NET_VENDOR_3COM is not set -# CONFIG_NET_VENDOR_ADAPTEC is not set -# CONFIG_NET_VENDOR_AGERE is not set -# CONFIG_NET_VENDOR_ALACRITECH is not set -# CONFIG_NET_VENDOR_ALTEON is not set -# CONFIG_ALTERA_TSE is not set -# CONFIG_NET_VENDOR_AMAZON is not set -CONFIG_NET_VENDOR_AMD=y -# CONFIG_AMD8111_ETH is not set -CONFIG_PCNET32=m -# CONFIG_AMD_XGBE is not set -# CONFIG_PDS_CORE is not set -# CONFIG_NET_VENDOR_AQUANTIA is not set -# CONFIG_NET_VENDOR_ARC is not set -# CONFIG_NET_VENDOR_ASIX is not set -# CONFIG_NET_VENDOR_ATHEROS is not set -# CONFIG_CX_ECAT is not set -CONFIG_NET_VENDOR_BROADCOM=y -# CONFIG_B44 is not set -# CONFIG_BCMGENET is not set -# CONFIG_BNX2 is not set -# CONFIG_CNIC is not set -# CONFIG_TIGON3 is not set -# CONFIG_BNX2X is not set -# CONFIG_SYSTEMPORT is not set -CONFIG_BNXT=m -# CONFIG_BNXT_SRIOV is not set -# CONFIG_BNXT_FLOWER_OFFLOAD is not set -# CONFIG_BNXT_HWMON is not set -# CONFIG_NET_VENDOR_CADENCE is not set -# CONFIG_NET_VENDOR_CAVIUM is not set -# CONFIG_NET_VENDOR_CHELSIO is not set -# CONFIG_NET_VENDOR_CISCO is not set -# CONFIG_NET_VENDOR_CORTINA is not set -# CONFIG_NET_VENDOR_DAVICOM is not set -# CONFIG_DNET is not set -# CONFIG_NET_VENDOR_DEC is not set -# CONFIG_NET_VENDOR_DLINK is not set -# CONFIG_NET_VENDOR_EMULEX is not set -# CONFIG_NET_VENDOR_ENGLEDER is not set -# CONFIG_NET_VENDOR_EZCHIP is not set -# CONFIG_NET_VENDOR_FUNGIBLE is not set -CONFIG_NET_VENDOR_GOOGLE=y -# CONFIG_GVE is not set -# CONFIG_NET_VENDOR_HUAWEI is not set -# CONFIG_NET_VENDOR_I825XX is not set -CONFIG_NET_VENDOR_INTEL=y -# CONFIG_E100 is not set -CONFIG_E1000=m -CONFIG_E1000E=m -# CONFIG_E1000E_HWTS is not set -# CONFIG_IGB is not set -# CONFIG_IGBVF is not set -# CONFIG_IXGBE is not set -# CONFIG_IXGBEVF is not set -# CONFIG_I40E is not set -# CONFIG_I40EVF is not set -# CONFIG_ICE is not set -# CONFIG_FM10K is not set -# CONFIG_IGC is not set -# CONFIG_IDPF is not set -# CONFIG_JME is not set -# CONFIG_NET_VENDOR_LITEX is not set -# CONFIG_NET_VENDOR_MARVELL is not set -CONFIG_NET_VENDOR_MELLANOX=y -# CONFIG_MLX4_EN is not set -CONFIG_MLX5_CORE=m -# CONFIG_MLX5_FPGA is not set -CONFIG_MLX5_CORE_EN=y -# CONFIG_MLX5_EN_ARFS is not set -# CONFIG_MLX5_EN_RXNFC is not set -# CONFIG_MLX5_MPFS is not set -CONFIG_MLX5_ESWITCH=y -CONFIG_MLX5_BRIDGE=y -CONFIG_MLX5_CORE_IPOIB=y -# CONFIG_MLX5_EN_TLS is not set -CONFIG_MLX5_SW_STEERING=y -CONFIG_MLX5_HW_STEERING=y -# CONFIG_MLX5_SF is not set -# CONFIG_MLX5_DPLL is not set -# CONFIG_MLXSW_CORE is not set -# CONFIG_MLXFW is not set -# CONFIG_NET_VENDOR_META is not set -# CONFIG_NET_VENDOR_MICREL is not set -# CONFIG_NET_VENDOR_MICROCHIP is not set -# CONFIG_NET_VENDOR_MICROSEMI is not set -# CONFIG_NET_VENDOR_MICROSOFT is not set -# CONFIG_NET_VENDOR_MYRI is not set -# CONFIG_FEALNX is not set -# CONFIG_NET_VENDOR_NI is not set -# CONFIG_NET_VENDOR_NATSEMI is not set -# CONFIG_NET_VENDOR_NETERION is not set -# CONFIG_NET_VENDOR_NETRONOME is not set -# CONFIG_NET_VENDOR_NVIDIA is not set -# CONFIG_NET_VENDOR_OKI is not set -# CONFIG_ETHOC is not set -# CONFIG_NET_VENDOR_PACKET_ENGINES is not set -# CONFIG_NET_VENDOR_PENSANDO is not set -# CONFIG_NET_VENDOR_QLOGIC is not set -# CONFIG_NET_VENDOR_BROCADE is not set -# CONFIG_NET_VENDOR_QUALCOMM is not set -# CONFIG_NET_VENDOR_RDC is not set -# CONFIG_NET_VENDOR_REALTEK is not set -# CONFIG_NET_VENDOR_RENESAS is not set -# CONFIG_NET_VENDOR_ROCKER is not set -# CONFIG_NET_VENDOR_SAMSUNG is not set -# CONFIG_NET_VENDOR_SEEQ is not set -# CONFIG_NET_VENDOR_SILAN is not set -# CONFIG_NET_VENDOR_SIS is not set -# CONFIG_NET_VENDOR_SOLARFLARE is not set -# CONFIG_NET_VENDOR_SMSC is not set -# CONFIG_NET_VENDOR_SOCIONEXT is not set -# CONFIG_NET_VENDOR_STMICRO is not set -# CONFIG_NET_VENDOR_SUN is not set -# CONFIG_NET_VENDOR_SYNOPSYS is not set -# CONFIG_NET_VENDOR_TEHUTI is not set -# CONFIG_NET_VENDOR_TI is not set -# CONFIG_NET_VENDOR_VERTEXCOM is not set -# CONFIG_NET_VENDOR_VIA is not set -# CONFIG_NET_VENDOR_WANGXUN is not set -# CONFIG_NET_VENDOR_WIZNET is not set -CONFIG_NET_VENDOR_XILINX=y -# CONFIG_XILINX_EMACLITE is not set -# CONFIG_XILINX_LL_TEMAC is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -# CONFIG_PHYLIB is not set -# CONFIG_MDIO_DEVICE is not set - -# PCS device drivers -# CONFIG_PCS_XPCS is not set -# end of PCS device drivers - -# CONFIG_PPP is not set -# CONFIG_SLIP is not set - -## Host-side USB support is needed for USB Network Adapter support -# CONFIG_USB_NET_DRIVERS is not set -# CONFIG_WLAN is not set -# CONFIG_WAN is not set - -# Wireless WAN -# CONFIG_WWAN is not set -# end of Wireless WAN - -CONFIG_VMXNET3=y -# CONFIG_FUJITSU_ES is not set -# CONFIG_NETDEVSIM is not set -# CONFIG_NET_FAILOVER is not set -# CONFIG_ISDN is not set - -# Input device support -CONFIG_INPUT=y -# CONFIG_INPUT_FF_MEMLESS is not set -# CONFIG_INPUT_SPARSEKMAP is not set -# CONFIG_INPUT_MATRIXKMAP is not set -CONFIG_INPUT_VIVALDIFMAP=y - -## Userland interfaces -CONFIG_INPUT_MOUSEDEV=m -# CONFIG_INPUT_MOUSEDEV_PSAUX is not set -CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 -CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -# CONFIG_INPUT_JOYDEV is not set -CONFIG_INPUT_EVDEV=m -# CONFIG_INPUT_EVBUG is not set - -## Input Device Drivers -CONFIG_INPUT_KEYBOARD=y -# CONFIG_KEYBOARD_ADP5588 is not set -# CONFIG_KEYBOARD_ADP5589 is not set -CONFIG_KEYBOARD_ATKBD=y -# CONFIG_KEYBOARD_QT1050 is not set -# CONFIG_KEYBOARD_QT1070 is not set -# CONFIG_KEYBOARD_QT2160 is not set -# CONFIG_KEYBOARD_DLINK_DIR685 is not set -# CONFIG_KEYBOARD_LKKBD is not set -# CONFIG_KEYBOARD_TCA6416 is not set -# CONFIG_KEYBOARD_TCA8418 is not set -# CONFIG_KEYBOARD_LM8333 is not set -# CONFIG_KEYBOARD_MAX7359 is not set -# CONFIG_KEYBOARD_MPR121 is not set -# CONFIG_KEYBOARD_NEWTON is not set -# CONFIG_KEYBOARD_OPENCORES is not set -# CONFIG_KEYBOARD_SAMSUNG is not set -# CONFIG_KEYBOARD_STOWAWAY is not set -# CONFIG_KEYBOARD_SUNKBD is not set -# CONFIG_KEYBOARD_XTKBD is not set -# CONFIG_KEYBOARD_CYPRESS_SF is not set -CONFIG_INPUT_MOUSE=y -CONFIG_MOUSE_PS2=m -CONFIG_MOUSE_PS2_ALPS=y -CONFIG_MOUSE_PS2_BYD=y -CONFIG_MOUSE_PS2_LOGIPS2PP=y -CONFIG_MOUSE_PS2_SYNAPTICS=y -# CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS is not set -CONFIG_MOUSE_PS2_CYPRESS=y -CONFIG_MOUSE_PS2_LIFEBOOK=y -CONFIG_MOUSE_PS2_TRACKPOINT=y -# CONFIG_MOUSE_PS2_ELANTECH is not set -# CONFIG_MOUSE_PS2_SENTELIC is not set -# CONFIG_MOUSE_PS2_TOUCHKIT is not set -CONFIG_MOUSE_PS2_FOCALTECH=y -CONFIG_MOUSE_PS2_VMMOUSE=y -# CONFIG_MOUSE_SERIAL is not set -# CONFIG_MOUSE_APPLETOUCH is not set -# CONFIG_MOUSE_BCM5974 is not set -# CONFIG_MOUSE_CYAPA is not set -# CONFIG_MOUSE_ELAN_I2C is not set -# CONFIG_MOUSE_VSXXXAA is not set -# CONFIG_MOUSE_SYNAPTICS_I2C is not set -# CONFIG_MOUSE_SYNAPTICS_USB is not set -# CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_TABLET is not set -# CONFIG_INPUT_TOUCHSCREEN is not set -# CONFIG_INPUT_MISC is not set -# CONFIG_RMI4_CORE is not set - -# Hardware I/O ports -CONFIG_SERIO=y -CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y -CONFIG_SERIO_I8042=y -# CONFIG_SERIO_SERPORT is not set -# CONFIG_SERIO_CT82C710 is not set -# CONFIG_SERIO_PCIPS2 is not set -CONFIG_SERIO_LIBPS2=y -# CONFIG_SERIO_RAW is not set -# CONFIG_SERIO_ALTERA_PS2 is not set -# CONFIG_SERIO_PS2MULT is not set -# CONFIG_SERIO_ARC_PS2 is not set -# CONFIG_USERIO is not set -# CONFIG_GAMEPORT is not set -# end of Hardware I/O ports -# end of Input device support - -# Character devices -CONFIG_TTY=y -CONFIG_VT=y -CONFIG_CONSOLE_TRANSLATIONS=y -CONFIG_VT_CONSOLE=y -CONFIG_VT_HW_CONSOLE_BINDING=y -CONFIG_UNIX98_PTYS=y -# CONFIG_LEGACY_PTYS is not set -# CONFIG_LEGACY_TIOCSTI is not set -CONFIG_LDISC_AUTOLOAD=y - -# Serial drivers -CONFIG_SERIAL_EARLYCON=y -CONFIG_SERIAL_8250=y -# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set -CONFIG_SERIAL_8250_PNP=y -# CONFIG_SERIAL_8250_16550A_VARIANTS is not set -# CONFIG_SERIAL_8250_FINTEK is not set -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_PCILIB=y -CONFIG_SERIAL_8250_PCI=y -# CONFIG_SERIAL_8250_EXAR is not set -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set -# CONFIG_SERIAL_8250_PCI1XXXX is not set -CONFIG_SERIAL_8250_DWLIB=y -# CONFIG_SERIAL_8250_DW is not set -# CONFIG_SERIAL_8250_RT288X is not set -CONFIG_SERIAL_8250_LPSS=m -CONFIG_SERIAL_8250_MID=m -CONFIG_SERIAL_8250_PERICOM=m - -## Non-8250 serial port support -# CONFIG_SERIAL_UARTLITE is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_JSM is not set -# CONFIG_SERIAL_LANTIQ is not set -# CONFIG_SERIAL_SCCNXP is not set -# CONFIG_SERIAL_SC16IS7XX is not set -# CONFIG_SERIAL_ALTERA_JTAGUART is not set -# CONFIG_SERIAL_ALTERA_UART is not set -# CONFIG_SERIAL_ARC is not set -# CONFIG_SERIAL_RP2 is not set -# CONFIG_SERIAL_FSL_LPUART is not set -# CONFIG_SERIAL_FSL_LINFLEXUART is not set -# CONFIG_SERIAL_SPRD is not set -# end of Serial drivers - -# CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_N_GSM is not set -# CONFIG_NOZOMI is not set -# CONFIG_NULL_TTY is not set -# CONFIG_SERIAL_DEV_BUS is not set -# CONFIG_TTY_PRINTK is not set -# CONFIG_VIRTIO_CONSOLE is not set -# CONFIG_IPMI_HANDLER is not set -CONFIG_HW_RANDOM=m -# CONFIG_HW_RANDOM_TIMERIOMEM is not set -# CONFIG_HW_RANDOM_INTEL is not set -# CONFIG_HW_RANDOM_AMD is not set -CONFIG_HW_RANDOM_RDRAND=m -# CONFIG_HW_RANDOM_BA431 is not set -# CONFIG_HW_RANDOM_VIA is not set -# CONFIG_HW_RANDOM_XIPHERA is not set -CONFIG_HW_EXTERNAL_ENTROPY=m -# CONFIG_APPLICOM is not set -# CONFIG_MWAVE is not set -# CONFIG_DEVMEM is not set -# CONFIG_NVRAM is not set -CONFIG_DEVPORT=y -# CONFIG_HPET is not set -# CONFIG_HANGCHECK_TIMER is not set -CONFIG_TCG_TPM=y -CONFIG_TCG_TPM2_HMAC=y -CONFIG_TCG_TIS_CORE=y -CONFIG_TCG_TIS=y -# CONFIG_TCG_TIS_I2C is not set -# CONFIG_TCG_TIS_I2C_CR50 is not set -# CONFIG_TCG_TIS_I2C_ATMEL is not set -# CONFIG_TCG_TIS_I2C_INFINEON is not set -# CONFIG_TCG_TIS_I2C_NUVOTON is not set -# CONFIG_TCG_NSC is not set -# CONFIG_TCG_ATMEL is not set -# CONFIG_TCG_INFINEON is not set -CONFIG_TCG_CRB=y -# CONFIG_TCG_VTPM_PROXY is not set -# CONFIG_TCG_TIS_ST33ZP24_I2C is not set -# CONFIG_TELCLOCK is not set -# CONFIG_XILLYBUS is not set -# CONFIG_XILLYUSB is not set -# end of Character devices - -# I2C support -CONFIG_I2C=m -CONFIG_I2C_BOARDINFO=y -# CONFIG_I2C_CHARDEV is not set -# CONFIG_I2C_MUX is not set -# CONFIG_I2C_HELPER_AUTO is not set -# CONFIG_I2C_SMBUS is not set - -# I2C Algorithms -CONFIG_I2C_ALGOBIT=m -# CONFIG_I2C_ALGOPCF is not set -# CONFIG_I2C_ALGOPCA is not set -# end of I2C Algorithms - -# I2C Hardware Bus support - -## PC SMBus host controller drivers -# CONFIG_I2C_ALI1535 is not set -# CONFIG_I2C_ALI1563 is not set -# CONFIG_I2C_ALI15X3 is not set -# CONFIG_I2C_AMD756 is not set -# CONFIG_I2C_AMD8111 is not set -# CONFIG_I2C_AMD_MP2 is not set -# CONFIG_I2C_I801 is not set -# CONFIG_I2C_ISCH is not set -# CONFIG_I2C_ISMT is not set -# CONFIG_I2C_PIIX4 is not set -# CONFIG_I2C_NFORCE2 is not set -# CONFIG_I2C_NVIDIA_GPU is not set -# CONFIG_I2C_SIS5595 is not set -# CONFIG_I2C_SIS630 is not set -# CONFIG_I2C_SIS96X is not set -# CONFIG_I2C_VIA is not set -# CONFIG_I2C_VIAPRO is not set -# CONFIG_I2C_ZHAOXIN is not set - -## ACPI drivers -# CONFIG_I2C_SCMI is not set - -## I2C system bus drivers (mostly embedded / system-on-chip) -# CONFIG_I2C_DESIGNWARE_CORE is not set -# CONFIG_I2C_EMEV2 is not set -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PCA_PLATFORM is not set -# CONFIG_I2C_SIMTEC is not set -# CONFIG_I2C_XILINX is not set - -## External I2C/SMBus adapter drivers -# CONFIG_I2C_DIOLAN_U2C is not set -# CONFIG_I2C_CP2615 is not set -# CONFIG_I2C_PCI1XXXX is not set -# CONFIG_I2C_ROBOTFUZZ_OSIF is not set -# CONFIG_I2C_TAOS_EVM is not set -# CONFIG_I2C_TINY_USB is not set - -## Other I2C/SMBus bus drivers -# CONFIG_I2C_MLXCPLD is not set -# CONFIG_I2C_VIRTIO is not set -# end of I2C Hardware Bus support - -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_SLAVE is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# end of I2C support - -# CONFIG_I3C is not set -# CONFIG_SPI is not set -# CONFIG_SPMI is not set -# CONFIG_HSI is not set -CONFIG_PPS=y -# CONFIG_PPS_DEBUG is not set - -## PPS clients support -# CONFIG_PPS_CLIENT_KTIMER is not set -# CONFIG_PPS_CLIENT_LDISC is not set -# CONFIG_PPS_CLIENT_GPIO is not set - -## PPS generators support - -# PTP clock support -CONFIG_PTP_1588_CLOCK=m -CONFIG_PTP_1588_CLOCK_OPTIONAL=m - -## Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. -# CONFIG_PTP_1588_CLOCK_IDT82P33 is not set -# CONFIG_PTP_1588_CLOCK_IDTCM is not set -# CONFIG_PTP_1588_CLOCK_FC3W is not set -# CONFIG_PTP_1588_CLOCK_MOCK is not set -CONFIG_PTP_1588_CLOCK_VMW=m -# CONFIG_PTP_1588_CLOCK_OCP is not set -# end of PTP clock support - -# CONFIG_PINCTRL is not set -# CONFIG_GPIOLIB is not set -# CONFIG_W1 is not set -CONFIG_POWER_RESET=y -CONFIG_POWER_RESET_PIIX4_POWEROFF=y -# CONFIG_POWER_RESET_RESTART is not set -# CONFIG_POWER_SEQUENCING is not set -CONFIG_POWER_SUPPLY=y -# CONFIG_POWER_SUPPLY_DEBUG is not set -# CONFIG_IP5XXX_POWER is not set -# CONFIG_TEST_POWER is not set -# CONFIG_CHARGER_ADP5061 is not set -# CONFIG_BATTERY_CW2015 is not set -# CONFIG_BATTERY_DS2780 is not set -# CONFIG_BATTERY_DS2781 is not set -# CONFIG_BATTERY_DS2782 is not set -# CONFIG_BATTERY_SAMSUNG_SDI is not set -# CONFIG_BATTERY_SBS is not set -# CONFIG_CHARGER_SBS is not set -# CONFIG_BATTERY_BQ27XXX is not set -# CONFIG_BATTERY_MAX17042 is not set -# CONFIG_BATTERY_MAX1720X is not set -# CONFIG_CHARGER_MAX8903 is not set -# CONFIG_CHARGER_LP8727 is not set -# CONFIG_CHARGER_LTC4162L is not set -# CONFIG_CHARGER_MAX77976 is not set -# CONFIG_CHARGER_BQ2415X is not set -# CONFIG_BATTERY_GAUGE_LTC2941 is not set -# CONFIG_BATTERY_GOLDFISH is not set -# CONFIG_BATTERY_RT5033 is not set -# CONFIG_CHARGER_BD99954 is not set -# CONFIG_BATTERY_UG3105 is not set -# CONFIG_FUEL_GAUGE_MM8013 is not set -CONFIG_HWMON=m -# CONFIG_HWMON_DEBUG_CHIP is not set - -## Native drivers -# CONFIG_SENSORS_ABITUGURU is not set -# CONFIG_SENSORS_ABITUGURU3 is not set -# CONFIG_SENSORS_AD7414 is not set -# CONFIG_SENSORS_AD7418 is not set -# CONFIG_SENSORS_ADM1025 is not set -# CONFIG_SENSORS_ADM1026 is not set -# CONFIG_SENSORS_ADM1029 is not set -# CONFIG_SENSORS_ADM1031 is not set -# CONFIG_SENSORS_ADM1177 is not set -# CONFIG_SENSORS_ADM9240 is not set -# CONFIG_SENSORS_ADT7410 is not set -# CONFIG_SENSORS_ADT7411 is not set -# CONFIG_SENSORS_ADT7462 is not set -# CONFIG_SENSORS_ADT7470 is not set -# CONFIG_SENSORS_ADT7475 is not set -# CONFIG_SENSORS_AHT10 is not set -# CONFIG_SENSORS_AQUACOMPUTER_D5NEXT is not set -# CONFIG_SENSORS_AS370 is not set -# CONFIG_SENSORS_ASC7621 is not set -# CONFIG_SENSORS_ASUS_ROG_RYUJIN is not set -# CONFIG_SENSORS_AXI_FAN_CONTROL is not set -# CONFIG_SENSORS_K8TEMP is not set -# CONFIG_SENSORS_K10TEMP is not set -# CONFIG_SENSORS_FAM15H_POWER is not set -# CONFIG_SENSORS_APPLESMC is not set -# CONFIG_SENSORS_ASB100 is not set -# CONFIG_SENSORS_ATXP1 is not set -# CONFIG_SENSORS_CHIPCAP2 is not set -# CONFIG_SENSORS_CORSAIR_CPRO is not set -# CONFIG_SENSORS_CORSAIR_PSU is not set -# CONFIG_SENSORS_DRIVETEMP is not set -# CONFIG_SENSORS_DS620 is not set -# CONFIG_SENSORS_DS1621 is not set -# CONFIG_SENSORS_DELL_SMM is not set -# CONFIG_SENSORS_I5K_AMB is not set -# CONFIG_SENSORS_F71805F is not set -# CONFIG_SENSORS_F71882FG is not set -# CONFIG_SENSORS_F75375S is not set -# CONFIG_SENSORS_FSCHMD is not set -# CONFIG_SENSORS_FTSTEUTATES is not set -# CONFIG_SENSORS_GIGABYTE_WATERFORCE is not set -# CONFIG_SENSORS_GL518SM is not set -# CONFIG_SENSORS_GL520SM is not set -# CONFIG_SENSORS_G760A is not set -# CONFIG_SENSORS_G762 is not set -# CONFIG_SENSORS_HIH6130 is not set -# CONFIG_SENSORS_HS3001 is not set -# CONFIG_SENSORS_I5500 is not set -# CONFIG_SENSORS_CORETEMP is not set -# CONFIG_SENSORS_IT87 is not set -# CONFIG_SENSORS_JC42 is not set -# CONFIG_SENSORS_POWERZ is not set -# CONFIG_SENSORS_POWR1220 is not set -# CONFIG_SENSORS_LENOVO_EC is not set -# CONFIG_SENSORS_LINEAGE is not set -# CONFIG_SENSORS_LTC2945 is not set -# CONFIG_SENSORS_LTC2947_I2C is not set -# CONFIG_SENSORS_LTC2990 is not set -# CONFIG_SENSORS_LTC2991 is not set -# CONFIG_SENSORS_LTC4151 is not set -# CONFIG_SENSORS_LTC4215 is not set -# CONFIG_SENSORS_LTC4222 is not set -# CONFIG_SENSORS_LTC4245 is not set -# CONFIG_SENSORS_LTC4260 is not set -# CONFIG_SENSORS_LTC4261 is not set -# CONFIG_SENSORS_LTC4282 is not set -# CONFIG_SENSORS_MAX127 is not set -# CONFIG_SENSORS_MAX16065 is not set -# CONFIG_SENSORS_MAX1619 is not set -# CONFIG_SENSORS_MAX1668 is not set -# CONFIG_SENSORS_MAX197 is not set -# CONFIG_SENSORS_MAX31730 is not set -# CONFIG_SENSORS_MAX31760 is not set -# CONFIG_MAX31827 is not set -# CONFIG_SENSORS_MAX6620 is not set -# CONFIG_SENSORS_MAX6621 is not set -# CONFIG_SENSORS_MAX6639 is not set -# CONFIG_SENSORS_MAX6650 is not set -# CONFIG_SENSORS_MAX6697 is not set -# CONFIG_SENSORS_MAX31790 is not set -# CONFIG_SENSORS_MC34VR500 is not set -# CONFIG_SENSORS_MCP3021 is not set -# CONFIG_SENSORS_TC654 is not set -# CONFIG_SENSORS_TPS23861 is not set -# CONFIG_SENSORS_MR75203 is not set -# CONFIG_SENSORS_LM63 is not set -# CONFIG_SENSORS_LM73 is not set -# CONFIG_SENSORS_LM75 is not set -# CONFIG_SENSORS_LM77 is not set -# CONFIG_SENSORS_LM78 is not set -# CONFIG_SENSORS_LM80 is not set -# CONFIG_SENSORS_LM83 is not set -# CONFIG_SENSORS_LM85 is not set -# CONFIG_SENSORS_LM87 is not set -# CONFIG_SENSORS_LM90 is not set -# CONFIG_SENSORS_LM92 is not set -# CONFIG_SENSORS_LM93 is not set -# CONFIG_SENSORS_LM95234 is not set -# CONFIG_SENSORS_LM95241 is not set -# CONFIG_SENSORS_LM95245 is not set -# CONFIG_SENSORS_PC87360 is not set -# CONFIG_SENSORS_PC87427 is not set -# CONFIG_SENSORS_NCT6683 is not set -# CONFIG_SENSORS_NCT6775 is not set -# CONFIG_SENSORS_NCT6775_I2C is not set -# CONFIG_SENSORS_NCT7802 is not set -# CONFIG_SENSORS_NCT7904 is not set -# CONFIG_SENSORS_NPCM7XX is not set -# CONFIG_SENSORS_NZXT_KRAKEN2 is not set -# CONFIG_SENSORS_NZXT_KRAKEN3 is not set -# CONFIG_SENSORS_NZXT_SMART2 is not set -# CONFIG_SENSORS_OCC_P8_I2C is not set -# CONFIG_SENSORS_OXP is not set -# CONFIG_SENSORS_PCF8591 is not set -# CONFIG_PMBUS is not set -# CONFIG_SENSORS_PT5161L is not set -# CONFIG_SENSORS_SBTSI is not set -# CONFIG_SENSORS_SBRMI is not set -# CONFIG_SENSORS_SHT21 is not set -# CONFIG_SENSORS_SHT3x is not set -# CONFIG_SENSORS_SHT4x is not set -# CONFIG_SENSORS_SHTC1 is not set -# CONFIG_SENSORS_SIS5595 is not set -# CONFIG_SENSORS_DME1737 is not set -# CONFIG_SENSORS_EMC1403 is not set -# CONFIG_SENSORS_EMC2103 is not set -# CONFIG_SENSORS_EMC2305 is not set -# CONFIG_SENSORS_EMC6W201 is not set -# CONFIG_SENSORS_SMSC47M1 is not set -# CONFIG_SENSORS_SMSC47M192 is not set -# CONFIG_SENSORS_SMSC47B397 is not set -# CONFIG_SENSORS_SCH5627 is not set -# CONFIG_SENSORS_SCH5636 is not set -# CONFIG_SENSORS_STTS751 is not set -# CONFIG_SENSORS_ADC128D818 is not set -# CONFIG_SENSORS_ADS7828 is not set -# CONFIG_SENSORS_AMC6821 is not set -# CONFIG_SENSORS_INA209 is not set -# CONFIG_SENSORS_INA2XX is not set -# CONFIG_SENSORS_INA238 is not set -# CONFIG_SENSORS_INA3221 is not set -# CONFIG_SENSORS_SPD5118 is not set -# CONFIG_SENSORS_TC74 is not set -# CONFIG_SENSORS_THMC50 is not set -# CONFIG_SENSORS_TMP102 is not set -# CONFIG_SENSORS_TMP103 is not set -# CONFIG_SENSORS_TMP108 is not set -# CONFIG_SENSORS_TMP401 is not set -# CONFIG_SENSORS_TMP421 is not set -# CONFIG_SENSORS_TMP464 is not set -# CONFIG_SENSORS_TMP513 is not set -# CONFIG_SENSORS_VIA_CPUTEMP is not set -# CONFIG_SENSORS_VIA686A is not set -# CONFIG_SENSORS_VT1211 is not set -# CONFIG_SENSORS_VT8231 is not set -# CONFIG_SENSORS_W83773G is not set -# CONFIG_SENSORS_W83781D is not set -# CONFIG_SENSORS_W83791D is not set -# CONFIG_SENSORS_W83792D is not set -# CONFIG_SENSORS_W83793 is not set -# CONFIG_SENSORS_W83795 is not set -# CONFIG_SENSORS_W83L785TS is not set -# CONFIG_SENSORS_W83L786NG is not set -# CONFIG_SENSORS_W83627HF is not set -# CONFIG_SENSORS_W83627EHF is not set -# CONFIG_SENSORS_XGENE is not set - -## ACPI drivers -# CONFIG_SENSORS_ACPI_POWER is not set -# CONFIG_SENSORS_ATK0110 is not set -# CONFIG_SENSORS_ASUS_WMI is not set -# CONFIG_SENSORS_ASUS_EC is not set -# CONFIG_SENSORS_HP_WMI is not set -CONFIG_THERMAL=y -# CONFIG_THERMAL_NETLINK is not set -# CONFIG_THERMAL_STATISTICS is not set -# CONFIG_THERMAL_DEBUGFS is not set -# CONFIG_THERMAL_CORE_TESTING is not set -CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 -CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set -# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set -# CONFIG_THERMAL_GOV_FAIR_SHARE is not set -CONFIG_THERMAL_GOV_STEP_WISE=y -# CONFIG_THERMAL_GOV_BANG_BANG is not set -CONFIG_THERMAL_GOV_USER_SPACE=y -# CONFIG_THERMAL_EMULATION is not set - -# Intel thermal drivers -# CONFIG_INTEL_POWERCLAMP is not set -CONFIG_X86_THERMAL_VECTOR=y -CONFIG_INTEL_TCC=y -CONFIG_X86_PKG_TEMP_THERMAL=m -# CONFIG_INTEL_SOC_DTS_THERMAL is not set - -# ACPI INT340X thermal drivers -# CONFIG_INT340X_THERMAL is not set -# end of ACPI INT340X thermal drivers - -# CONFIG_INTEL_PCH_THERMAL is not set -# CONFIG_INTEL_TCC_COOLING is not set -# CONFIG_INTEL_HFI_THERMAL is not set -# end of Intel thermal drivers - -CONFIG_WATCHDOG=y -CONFIG_WATCHDOG_CORE=m -# CONFIG_WATCHDOG_NOWAYOUT is not set -CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y -CONFIG_WATCHDOG_OPEN_TIMEOUT=0 -CONFIG_WATCHDOG_SYSFS=y -# CONFIG_WATCHDOG_HRTIMER_PRETIMEOUT is not set - -## Watchdog Pretimeout Governors -# CONFIG_WATCHDOG_PRETIMEOUT_GOV is not set - -## Watchdog Device Drivers -# CONFIG_SOFT_WATCHDOG is not set -# CONFIG_LENOVO_SE10_WDT is not set -CONFIG_WDAT_WDT=m -# CONFIG_XILINX_WATCHDOG is not set -# CONFIG_ZIIRAVE_WATCHDOG is not set -# CONFIG_CADENCE_WATCHDOG is not set -# CONFIG_DW_WATCHDOG is not set -# CONFIG_MAX63XX_WATCHDOG is not set -# CONFIG_ACQUIRE_WDT is not set -# CONFIG_ADVANTECH_WDT is not set -# CONFIG_ADVANTECH_EC_WDT is not set -# CONFIG_ALIM1535_WDT is not set -# CONFIG_ALIM7101_WDT is not set -# CONFIG_EBC_C384_WDT is not set -# CONFIG_EXAR_WDT is not set -# CONFIG_F71808E_WDT is not set -# CONFIG_SP5100_TCO is not set -# CONFIG_SBC_FITPC2_WATCHDOG is not set -# CONFIG_EUROTECH_WDT is not set -# CONFIG_IB700_WDT is not set -# CONFIG_IBMASR is not set -# CONFIG_WAFER_WDT is not set -# CONFIG_I6300ESB_WDT is not set -# CONFIG_IE6XX_WDT is not set -# CONFIG_ITCO_WDT is not set -# CONFIG_IT8712F_WDT is not set -# CONFIG_IT87_WDT is not set -# CONFIG_HP_WATCHDOG is not set -# CONFIG_SC1200_WDT is not set -# CONFIG_PC87413_WDT is not set -# CONFIG_NV_TCO is not set -# CONFIG_60XX_WDT is not set -# CONFIG_CPU5_WDT is not set -# CONFIG_SMSC_SCH311X_WDT is not set -# CONFIG_SMSC37B787_WDT is not set -# CONFIG_TQMX86_WDT is not set -# CONFIG_VIA_WDT is not set -# CONFIG_W83627HF_WDT is not set -# CONFIG_W83877F_WDT is not set -# CONFIG_W83977F_WDT is not set -# CONFIG_MACHZ_WDT is not set -# CONFIG_SBC_EPX_C3_WATCHDOG is not set -# CONFIG_NI903X_WDT is not set -# CONFIG_NIC7018_WDT is not set - -## PCI-based Watchdog Cards -# CONFIG_PCIPCWATCHDOG is not set -# CONFIG_WDTPCI is not set - -## USB-based Watchdog Cards -# CONFIG_USBPCWATCHDOG is not set -CONFIG_SSB_POSSIBLE=y -# CONFIG_SSB is not set -CONFIG_BCMA_POSSIBLE=y -# CONFIG_BCMA is not set - -# Multifunction device drivers -# CONFIG_MFD_SMPRO is not set -# CONFIG_MFD_BCM590XX is not set -# CONFIG_MFD_BD9571MWV is not set -# CONFIG_MFD_AXP20X_I2C is not set -# CONFIG_MFD_CS42L43_I2C is not set -# CONFIG_MFD_MADERA is not set -# CONFIG_MFD_DA9062 is not set -# CONFIG_MFD_DA9063 is not set -# CONFIG_MFD_DA9150 is not set -# CONFIG_MFD_DLN2 is not set -# CONFIG_MFD_MC13XXX_I2C is not set -# CONFIG_MFD_MP2629 is not set -# CONFIG_MFD_INTEL_QUARK_I2C_GPIO is not set -# CONFIG_LPC_ICH is not set -# CONFIG_LPC_SCH is not set -# CONFIG_MFD_INTEL_LPSS_ACPI is not set -# CONFIG_MFD_INTEL_LPSS_PCI is not set -# CONFIG_MFD_INTEL_PMC_BXT is not set -# CONFIG_MFD_IQS62X is not set -# CONFIG_MFD_JANZ_CMODIO is not set -# CONFIG_MFD_KEMPLD is not set -# CONFIG_MFD_88PM800 is not set -# CONFIG_MFD_88PM805 is not set -# CONFIG_MFD_MAX14577 is not set -# CONFIG_MFD_MAX77693 is not set -# CONFIG_MFD_MAX8907 is not set -# CONFIG_MFD_MT6360 is not set -# CONFIG_MFD_MT6370 is not set -# CONFIG_MFD_MT6397 is not set -# CONFIG_MFD_MENF21BMC is not set -# CONFIG_MFD_VIPERBOARD is not set -# CONFIG_MFD_RETU is not set -# CONFIG_MFD_PCF50633 is not set -# CONFIG_MFD_SY7636A is not set -# CONFIG_MFD_RDC321X is not set -# CONFIG_MFD_RT4831 is not set -# CONFIG_MFD_RT5033 is not set -# CONFIG_MFD_RT5120 is not set -# CONFIG_MFD_SI476X_CORE is not set -# CONFIG_MFD_SM501 is not set -# CONFIG_MFD_SKY81452 is not set -# CONFIG_MFD_SYSCON is not set -# CONFIG_MFD_LP3943 is not set -# CONFIG_MFD_TI_LMU is not set -# CONFIG_TPS6105X is not set -# CONFIG_TPS6507X is not set -# CONFIG_MFD_TPS65086 is not set -# CONFIG_MFD_TI_LP873X is not set -# CONFIG_MFD_TPS65912_I2C is not set -# CONFIG_MFD_TPS6594_I2C is not set -# CONFIG_MFD_WL1273_CORE is not set -# CONFIG_MFD_LM3533 is not set -# CONFIG_MFD_TQMX86 is not set -# CONFIG_MFD_VX855 is not set -# CONFIG_MFD_ARIZONA_I2C is not set -# CONFIG_MFD_WM8994 is not set -# CONFIG_MFD_ATC260X_I2C is not set -# CONFIG_MFD_CS40L50_I2C is not set -# end of Multifunction device drivers - -# CONFIG_REGULATOR is not set -# CONFIG_RC_CORE is not set - -# CEC support -# CONFIG_MEDIA_CEC_SUPPORT is not set -# end of CEC support - -# CONFIG_MEDIA_SUPPORT is not set - -# Graphics support -CONFIG_APERTURE_HELPERS=y -CONFIG_SCREEN_INFO=y -CONFIG_VIDEO=y -# CONFIG_AUXDISPLAY is not set -# CONFIG_AGP is not set -CONFIG_INTEL_GTT=m -# CONFIG_VGA_SWITCHEROO is not set -CONFIG_GPU_BUDDY=y -CONFIG_DRM=m -CONFIG_DRM_MIPI_DSI=y -# CONFIG_DRM_DEBUG_MM is not set -CONFIG_DRM_KMS_HELPER=m -# CONFIG_DRM_PANIC is not set -# CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS is not set -# CONFIG_DRM_DEBUG_MODESET_LOCK is not set -CONFIG_DRM_FBDEV_EMULATION=y -CONFIG_DRM_FBDEV_OVERALLOC=100 -# CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM is not set -# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set -CONFIG_DRM_DISPLAY_HELPER=m -# CONFIG_DRM_DISPLAY_DP_AUX_CEC is not set -# CONFIG_DRM_DISPLAY_DP_AUX_CHARDEV is not set -CONFIG_DRM_DISPLAY_DP_HELPER=y -CONFIG_DRM_DISPLAY_HDCP_HELPER=y -CONFIG_DRM_DISPLAY_HDMI_HELPER=y -CONFIG_DRM_TTM=m -CONFIG_DRM_EXEC=m -CONFIG_DRM_BUDDY=m -CONFIG_DRM_TTM_HELPER=m -CONFIG_DRM_SUBALLOC_HELPER=m -CONFIG_DRM_SCHED=m - -# I2C encoder or helper chips -# CONFIG_DRM_I2C_CH7006 is not set -# CONFIG_DRM_I2C_SIL164 is not set -# CONFIG_DRM_I2C_NXP_TDA998X is not set -# CONFIG_DRM_I2C_NXP_TDA9950 is not set -# end of I2C encoder or helper chips - -# ARM devices -# end of ARM devices - -# CONFIG_DRM_RADEON is not set -CONFIG_DRM_AMDGPU=m -# CONFIG_DRM_AMDGPU_SI is not set -# CONFIG_DRM_AMDGPU_CIK is not set -CONFIG_DRM_AMDGPU_USERPTR=y -# CONFIG_DRM_AMD_ISP is not set -# CONFIG_DRM_AMDGPU_WERROR is not set - -# ACP (Audio CoProcessor) Configuration -# CONFIG_DRM_AMD_ACP is not set -# end of ACP (Audio CoProcessor) Configuration - -# Display Engine Configuration -# CONFIG_DRM_AMD_DC is not set -# end of Display Engine Configuration - -CONFIG_HSA_AMD=y -# CONFIG_DRM_NOUVEAU is not set -CONFIG_DRM_I915=m -CONFIG_DRM_I915_FORCE_PROBE="" -CONFIG_DRM_I915_CAPTURE_ERROR=y -CONFIG_DRM_I915_COMPRESS_ERROR=y -CONFIG_DRM_I915_USERPTR=y - -# drm/i915 Debugging -# CONFIG_DRM_I915_WERROR is not set -# CONFIG_DRM_I915_REPLAY_GPU_HANGS_API is not set -# CONFIG_DRM_I915_DEBUG is not set -# CONFIG_DRM_I915_DEBUG_MMIO is not set -# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set -# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set -# CONFIG_DRM_I915_DEBUG_GUC is not set -# CONFIG_DRM_I915_SELFTEST is not set -# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set -# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set -# CONFIG_DRM_I915_DEBUG_RUNTIME_PM is not set -# CONFIG_DRM_I915_DEBUG_WAKEREF is not set -# end of drm/i915 Debugging - -# drm/i915 Profile Guided Optimisation -CONFIG_DRM_I915_REQUEST_TIMEOUT=20000 -CONFIG_DRM_I915_FENCE_TIMEOUT=10000 -CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250 -CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500 -CONFIG_DRM_I915_PREEMPT_TIMEOUT=640 -CONFIG_DRM_I915_PREEMPT_TIMEOUT_COMPUTE=7500 -CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000 -CONFIG_DRM_I915_STOP_TIMEOUT=100 -CONFIG_DRM_I915_TIMESLICE_DURATION=1 -# end of drm/i915 Profile Guided Optimisation - -# CONFIG_DRM_XE is not set -# CONFIG_DRM_VGEM is not set -# CONFIG_DRM_VKMS is not set -CONFIG_DRM_VMWGFX=m -# CONFIG_DRM_VMWGFX_MKSSTATS is not set -# CONFIG_DRM_GMA500 is not set -# CONFIG_DRM_UDL is not set -# CONFIG_DRM_AST is not set -# CONFIG_DRM_MGAG200 is not set -# CONFIG_DRM_QXL is not set -# CONFIG_DRM_VIRTIO_GPU is not set -CONFIG_DRM_PANEL=y - -# Display Panels -# CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN is not set -# end of Display Panels - -CONFIG_DRM_BRIDGE=y -CONFIG_DRM_PANEL_BRIDGE=y - -# Display Interface Bridges -# CONFIG_DRM_ANALOGIX_ANX78XX is not set -# end of Display Interface Bridges - -# CONFIG_DRM_ETNAVIV is not set -# CONFIG_DRM_BOCHS is not set -# CONFIG_DRM_CIRRUS_QEMU is not set -# CONFIG_DRM_GM12U320 is not set -# CONFIG_DRM_SIMPLEDRM is not set -# CONFIG_DRM_VBOXVIDEO is not set -# CONFIG_DRM_GUD is not set -# CONFIG_DRM_SSD130X is not set -# CONFIG_DRM_WERROR is not set -CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y - -# Frame buffer Devices -CONFIG_FB=y -# CONFIG_FB_CIRRUS is not set -# CONFIG_FB_PM2 is not set -# CONFIG_FB_CYBER2000 is not set -# CONFIG_FB_ARC is not set -# CONFIG_FB_ASILIANT is not set -# CONFIG_FB_IMSTT is not set -# CONFIG_FB_VGA16 is not set -# CONFIG_FB_UVESA is not set -CONFIG_FB_VESA=y -CONFIG_FB_EFI=y -# CONFIG_FB_N411 is not set -# CONFIG_FB_HGA is not set -# CONFIG_FB_OPENCORES is not set -# CONFIG_FB_S1D13XXX is not set -# CONFIG_FB_NVIDIA is not set -# CONFIG_FB_RIVA is not set -# CONFIG_FB_I740 is not set -# CONFIG_FB_MATROX is not set -# CONFIG_FB_RADEON is not set -# CONFIG_FB_ATY128 is not set -# CONFIG_FB_ATY is not set -# CONFIG_FB_S3 is not set -# CONFIG_FB_SAVAGE is not set -# CONFIG_FB_SIS is not set -# CONFIG_FB_NEOMAGIC is not set -# CONFIG_FB_KYRO is not set -# CONFIG_FB_3DFX is not set -# CONFIG_FB_VOODOO1 is not set -# CONFIG_FB_VT8623 is not set -# CONFIG_FB_TRIDENT is not set -# CONFIG_FB_ARK is not set -# CONFIG_FB_PM3 is not set -# CONFIG_FB_CARMINE is not set -# CONFIG_FB_SMSCUFX is not set -# CONFIG_FB_IBM_GXT4500 is not set -# CONFIG_FB_VIRTUAL is not set -# CONFIG_FB_METRONOME is not set -# CONFIG_FB_MB862XX is not set -# CONFIG_FB_SIMPLE is not set -# CONFIG_FB_SM712 is not set -CONFIG_FB_CORE=y -CONFIG_FB_NOTIFY=y -# CONFIG_FIRMWARE_EDID is not set -# CONFIG_FB_DEVICE is not set -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_IMAGEBLIT=y -CONFIG_FB_SYS_FILLRECT=y -CONFIG_FB_SYS_COPYAREA=y -CONFIG_FB_SYS_IMAGEBLIT=y -# CONFIG_FB_FOREIGN_ENDIAN is not set -CONFIG_FB_SYSMEM_FOPS=y -CONFIG_FB_DEFERRED_IO=y -CONFIG_FB_IOMEM_FOPS=y -CONFIG_FB_IOMEM_HELPERS=y -CONFIG_FB_SYSMEM_HELPERS=y -CONFIG_FB_SYSMEM_HELPERS_DEFERRED=y -# CONFIG_FB_MODE_HELPERS is not set -# CONFIG_FB_TILEBLITTING is not set -# end of Frame buffer Devices - -# Backlight & LCD device support -# CONFIG_LCD_CLASS_DEVICE is not set -CONFIG_BACKLIGHT_CLASS_DEVICE=m -# CONFIG_BACKLIGHT_KTD2801 is not set -# CONFIG_BACKLIGHT_KTZ8866 is not set -# CONFIG_BACKLIGHT_APPLE is not set -# CONFIG_BACKLIGHT_QCOM_WLED is not set -# CONFIG_BACKLIGHT_SAHARA is not set -# CONFIG_BACKLIGHT_ADP8860 is not set -# CONFIG_BACKLIGHT_ADP8870 is not set -# CONFIG_BACKLIGHT_LM3509 is not set -# CONFIG_BACKLIGHT_LM3639 is not set -# CONFIG_BACKLIGHT_LV5207LP is not set -# CONFIG_BACKLIGHT_BD6107 is not set -# CONFIG_BACKLIGHT_ARCXCNN is not set -# end of Backlight & LCD device support - -CONFIG_HDMI=y - -# Console display driver support -CONFIG_VGA_CONSOLE=y -CONFIG_DUMMY_CONSOLE=y -CONFIG_DUMMY_CONSOLE_COLUMNS=80 -CONFIG_DUMMY_CONSOLE_ROWS=25 -CONFIG_FRAMEBUFFER_CONSOLE=y -# CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is not set -CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y -# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set -# CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is not set -# end of Console display driver support - -# CONFIG_LOGO is not set -# end of Graphics support - -# CONFIG_DRM_ACCEL is not set -# CONFIG_SOUND is not set -CONFIG_HID_SUPPORT=y -CONFIG_HID=m -# CONFIG_HID_BATTERY_STRENGTH is not set -# CONFIG_HIDRAW is not set -# CONFIG_UHID is not set -CONFIG_HID_GENERIC=m - -# Special HID drivers -# CONFIG_HID_A4TECH is not set -# CONFIG_HID_ACCUTOUCH is not set -# CONFIG_HID_ACRUX is not set -# CONFIG_HID_APPLEIR is not set -# CONFIG_HID_AUREAL is not set -# CONFIG_HID_BELKIN is not set -# CONFIG_HID_BETOP_FF is not set -# CONFIG_HID_CHERRY is not set -# CONFIG_HID_CHICONY is not set -# CONFIG_HID_COUGAR is not set -# CONFIG_HID_MACALLY is not set -# CONFIG_HID_CMEDIA is not set -# CONFIG_HID_CREATIVE_SB0540 is not set -# CONFIG_HID_CYPRESS is not set -# CONFIG_HID_DRAGONRISE is not set -# CONFIG_HID_EMS_FF is not set -# CONFIG_HID_ELECOM is not set -# CONFIG_HID_ELO is not set -# CONFIG_HID_EVISION is not set -# CONFIG_HID_EZKEY is not set -# CONFIG_HID_GEMBIRD is not set -# CONFIG_HID_GFRM is not set -# CONFIG_HID_GLORIOUS is not set -# CONFIG_HID_HOLTEK is not set -# CONFIG_HID_GOOGLE_STADIA_FF is not set -# CONFIG_HID_VIVALDI is not set -# CONFIG_HID_KEYTOUCH is not set -# CONFIG_HID_KYE is not set -# CONFIG_HID_UCLOGIC is not set -# CONFIG_HID_WALTOP is not set -# CONFIG_HID_VIEWSONIC is not set -# CONFIG_HID_VRC2 is not set -# CONFIG_HID_XIAOMI is not set -# CONFIG_HID_GYRATION is not set -# CONFIG_HID_ICADE is not set -# CONFIG_HID_ITE is not set -# CONFIG_HID_JABRA is not set -# CONFIG_HID_TWINHAN is not set -# CONFIG_HID_KENSINGTON is not set -# CONFIG_HID_LCPOWER is not set -# CONFIG_HID_LENOVO is not set -# CONFIG_HID_LETSKETCH is not set -# CONFIG_HID_MAGICMOUSE is not set -# CONFIG_HID_MALTRON is not set -# CONFIG_HID_MAYFLASH is not set -# CONFIG_HID_MEGAWORLD_FF is not set -# CONFIG_HID_REDRAGON is not set -# CONFIG_HID_MICROSOFT is not set -# CONFIG_HID_MONTEREY is not set -# CONFIG_HID_MULTITOUCH is not set -# CONFIG_HID_NTI is not set -# CONFIG_HID_NTRIG is not set -# CONFIG_HID_ORTEK is not set -# CONFIG_HID_PANTHERLORD is not set -# CONFIG_HID_PENMOUNT is not set -# CONFIG_HID_PETALYNX is not set -# CONFIG_HID_PICOLCD is not set -# CONFIG_HID_PLANTRONICS is not set -# CONFIG_HID_PXRC is not set -# CONFIG_HID_RAZER is not set -# CONFIG_HID_PRIMAX is not set -# CONFIG_HID_RETRODE is not set -# CONFIG_HID_ROCCAT is not set -# CONFIG_HID_SAITEK is not set -# CONFIG_HID_SAMSUNG is not set -# CONFIG_HID_SEMITEK is not set -# CONFIG_HID_SIGMAMICRO is not set -# CONFIG_HID_SPEEDLINK is not set -# CONFIG_HID_STEAM is not set -# CONFIG_HID_STEELSERIES is not set -# CONFIG_HID_SUNPLUS is not set -# CONFIG_HID_RMI is not set -# CONFIG_HID_GREENASIA is not set -# CONFIG_HID_SMARTJOYPLUS is not set -# CONFIG_HID_TIVO is not set -# CONFIG_HID_TOPSEED is not set -# CONFIG_HID_TOPRE is not set -# CONFIG_HID_THRUSTMASTER is not set -# CONFIG_HID_UDRAW_PS3 is not set -# CONFIG_HID_WACOM is not set -# CONFIG_HID_XINMO is not set -# CONFIG_HID_ZEROPLUS is not set -# CONFIG_HID_ZYDACRON is not set -# CONFIG_HID_SENSOR_HUB is not set -# CONFIG_HID_ALPS is not set -# CONFIG_HID_MCP2221 is not set -# end of Special HID drivers - -# HID-BPF support -# end of HID-BPF support - -# USB HID support -CONFIG_USB_HID=m -# CONFIG_HID_PID is not set -# CONFIG_USB_HIDDEV is not set - -# USB HID Boot Protocol drivers -# CONFIG_USB_KBD is not set -# CONFIG_USB_MOUSE is not set -# end of USB HID Boot Protocol drivers -# end of USB HID support - -# CONFIG_I2C_HID is not set - -# Intel ISH HID support -# CONFIG_INTEL_ISH_HID is not set -# end of Intel ISH HID support - -# AMD SFH HID Support -# CONFIG_AMD_SFH_HID is not set -# end of AMD SFH HID Support - -CONFIG_USB_OHCI_LITTLE_ENDIAN=y -CONFIG_USB_SUPPORT=y -CONFIG_USB_COMMON=m -# CONFIG_USB_ULPI_BUS is not set -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB=m -CONFIG_USB_PCI=y -CONFIG_USB_PCI_AMD=y -CONFIG_USB_ANNOUNCE_NEW_DEVICES=y - -## Miscellaneous USB options -CONFIG_USB_DEFAULT_PERSIST=y -# CONFIG_USB_FEW_INIT_RETRIES is not set -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_OTG_PRODUCTLIST is not set -# CONFIG_USB_OTG_DISABLE_EXTERNAL_HUB is not set -CONFIG_USB_AUTOSUSPEND_DELAY=2 -CONFIG_USB_DEFAULT_AUTHORIZATION_MODE=1 -CONFIG_USB_MON=m - -## USB Host Controller Drivers -# CONFIG_USB_C67X00_HCD is not set -CONFIG_USB_XHCI_HCD=m -# CONFIG_USB_XHCI_DBGCAP is not set -CONFIG_USB_XHCI_PCI=m -# CONFIG_USB_XHCI_PCI_RENESAS is not set -# CONFIG_USB_XHCI_PLATFORM is not set -CONFIG_USB_EHCI_HCD=m -CONFIG_USB_EHCI_ROOT_HUB_TT=y -CONFIG_USB_EHCI_TT_NEWSCHED=y -CONFIG_USB_EHCI_PCI=m -# CONFIG_USB_EHCI_FSL is not set -# CONFIG_USB_EHCI_HCD_PLATFORM is not set -# CONFIG_USB_OXU210HP_HCD is not set -# CONFIG_USB_ISP116X_HCD is not set -# CONFIG_USB_OHCI_HCD is not set -CONFIG_USB_UHCI_HCD=m -# CONFIG_USB_SL811_HCD is not set -# CONFIG_USB_R8A66597_HCD is not set -# CONFIG_USB_HCD_TEST_MODE is not set - -## USB Device Class drivers -CONFIG_USB_ACM=m -# CONFIG_USB_PRINTER is not set -# CONFIG_USB_WDM is not set -# CONFIG_USB_TMC is not set - -## NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may - -## also be needed; see USB_STORAGE Help for more info -CONFIG_USB_STORAGE=m -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_STORAGE_REALTEK is not set -# CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set -# CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_USBAT is not set -# CONFIG_USB_STORAGE_SDDR09 is not set -# CONFIG_USB_STORAGE_SDDR55 is not set -# CONFIG_USB_STORAGE_JUMPSHOT is not set -# CONFIG_USB_STORAGE_ALAUDA is not set -# CONFIG_USB_STORAGE_ONETOUCH is not set -# CONFIG_USB_STORAGE_KARMA is not set -# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set -# CONFIG_USB_STORAGE_ENE_UB6250 is not set -# CONFIG_USB_UAS is not set - -## USB Imaging devices -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set -# CONFIG_USBIP_CORE is not set - -## USB dual-mode controller drivers -# CONFIG_USB_CDNS_SUPPORT is not set -# CONFIG_USB_MUSB_HDRC is not set -# CONFIG_USB_DWC3 is not set -# CONFIG_USB_DWC2 is not set -# CONFIG_USB_CHIPIDEA is not set -# CONFIG_USB_ISP1760 is not set - -## USB port drivers -CONFIG_USB_SERIAL=m -CONFIG_USB_SERIAL_GENERIC=y -# CONFIG_USB_SERIAL_SIMPLE is not set -# CONFIG_USB_SERIAL_AIRCABLE is not set -# CONFIG_USB_SERIAL_ARK3116 is not set -# CONFIG_USB_SERIAL_BELKIN is not set -# CONFIG_USB_SERIAL_CH341 is not set -# CONFIG_USB_SERIAL_WHITEHEAT is not set -# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set -CONFIG_USB_SERIAL_CP210X=m -# CONFIG_USB_SERIAL_CYPRESS_M8 is not set -# CONFIG_USB_SERIAL_EMPEG is not set -CONFIG_USB_SERIAL_FTDI_SIO=m -# CONFIG_USB_SERIAL_VISOR is not set -# CONFIG_USB_SERIAL_IPAQ is not set -# CONFIG_USB_SERIAL_IR is not set -# CONFIG_USB_SERIAL_EDGEPORT is not set -# CONFIG_USB_SERIAL_EDGEPORT_TI is not set -# CONFIG_USB_SERIAL_F81232 is not set -# CONFIG_USB_SERIAL_F8153X is not set -# CONFIG_USB_SERIAL_GARMIN is not set -# CONFIG_USB_SERIAL_IPW is not set -# CONFIG_USB_SERIAL_IUU is not set -# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set -# CONFIG_USB_SERIAL_KEYSPAN is not set -# CONFIG_USB_SERIAL_KLSI is not set -# CONFIG_USB_SERIAL_KOBIL_SCT is not set -# CONFIG_USB_SERIAL_MCT_U232 is not set -# CONFIG_USB_SERIAL_METRO is not set -# CONFIG_USB_SERIAL_MOS7720 is not set -# CONFIG_USB_SERIAL_MOS7840 is not set -# CONFIG_USB_SERIAL_MXUPORT is not set -# CONFIG_USB_SERIAL_NAVMAN is not set -# CONFIG_USB_SERIAL_PL2303 is not set -# CONFIG_USB_SERIAL_OTI6858 is not set -# CONFIG_USB_SERIAL_QCAUX is not set -# CONFIG_USB_SERIAL_QUALCOMM is not set -# CONFIG_USB_SERIAL_SPCP8X5 is not set -# CONFIG_USB_SERIAL_SAFE is not set -# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set -# CONFIG_USB_SERIAL_SYMBOL is not set -# CONFIG_USB_SERIAL_TI is not set -# CONFIG_USB_SERIAL_CYBERJACK is not set -# CONFIG_USB_SERIAL_OPTION is not set -# CONFIG_USB_SERIAL_OMNINET is not set -# CONFIG_USB_SERIAL_OPTICON is not set -# CONFIG_USB_SERIAL_XSENS_MT is not set -# CONFIG_USB_SERIAL_WISHBONE is not set -# CONFIG_USB_SERIAL_SSU100 is not set -# CONFIG_USB_SERIAL_QT2 is not set -# CONFIG_USB_SERIAL_UPD78F0730 is not set -# CONFIG_USB_SERIAL_XR is not set -# CONFIG_USB_SERIAL_DEBUG is not set - -## USB Miscellaneous drivers -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_ADUTUX is not set -# CONFIG_USB_SEVSEG is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_CYPRESS_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_APPLEDISPLAY is not set -# CONFIG_APPLE_MFI_FASTCHARGE is not set -# CONFIG_USB_LJCA is not set -# CONFIG_USB_SISUSBVGA is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_TRANCEVIBRATOR is not set -# CONFIG_USB_IOWARRIOR is not set -# CONFIG_USB_TEST is not set -# CONFIG_USB_EHSET_TEST_FIXTURE is not set -# CONFIG_USB_ISIGHTFW is not set -# CONFIG_USB_YUREX is not set -# CONFIG_USB_EZUSB_FX2 is not set -# CONFIG_USB_HUB_USB251XB is not set -# CONFIG_USB_HSIC_USB3503 is not set -# CONFIG_USB_HSIC_USB4604 is not set -# CONFIG_USB_LINK_LAYER_TEST is not set -# CONFIG_USB_CHAOSKEY is not set - -# USB Physical Layer drivers -# CONFIG_NOP_USB_XCEIV is not set -# CONFIG_USB_ISP1301 is not set -# end of USB Physical Layer drivers - -# CONFIG_USB_GADGET is not set -# CONFIG_TYPEC is not set -# CONFIG_USB_ROLE_SWITCH is not set -# CONFIG_MMC is not set -# CONFIG_SCSI_UFSHCD is not set -# CONFIG_MEMSTICK is not set -# CONFIG_NEW_LEDS is not set -# CONFIG_ACCESSIBILITY is not set -CONFIG_INFINIBAND=m -CONFIG_INFINIBAND_USER_MAD=m -CONFIG_INFINIBAND_USER_ACCESS=m -CONFIG_INFINIBAND_USER_MEM=y -CONFIG_INFINIBAND_ON_DEMAND_PAGING=y -CONFIG_INFINIBAND_ADDR_TRANS=y -CONFIG_INFINIBAND_ADDR_TRANS_CONFIGFS=y -CONFIG_INFINIBAND_VIRT_DMA=y -# CONFIG_INFINIBAND_EFA is not set -# CONFIG_INFINIBAND_ERDMA is not set -# CONFIG_MLX4_INFINIBAND is not set -CONFIG_MLX5_INFINIBAND=m -# CONFIG_INFINIBAND_MTHCA is not set -# CONFIG_INFINIBAND_OCRDMA is not set -# CONFIG_INFINIBAND_USNIC is not set -CONFIG_INFINIBAND_VMWARE_PVRDMA=m -# CONFIG_INFINIBAND_RDMAVT is not set -# CONFIG_RDMA_RXE is not set -# CONFIG_RDMA_SIW is not set -# CONFIG_INFINIBAND_IPOIB is not set -# CONFIG_INFINIBAND_SRP is not set -# CONFIG_INFINIBAND_ISER is not set -# CONFIG_INFINIBAND_RTRS_CLIENT is not set -# CONFIG_INFINIBAND_RTRS_SERVER is not set -# CONFIG_INFINIBAND_OPA_VNIC is not set -CONFIG_EDAC_ATOMIC_SCRUB=y -CONFIG_EDAC_SUPPORT=y -CONFIG_RTC_LIB=y -CONFIG_RTC_MC146818_LIB=y -CONFIG_RTC_CLASS=y -# CONFIG_RTC_HCTOSYS is not set -# CONFIG_RTC_SYSTOHC is not set -# CONFIG_RTC_DEBUG is not set -# CONFIG_RTC_NVMEM is not set - -## RTC interfaces -CONFIG_RTC_INTF_SYSFS=y -CONFIG_RTC_INTF_PROC=y -CONFIG_RTC_INTF_DEV=y -# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set -# CONFIG_RTC_DRV_TEST is not set - -## I2C RTC drivers -# CONFIG_RTC_DRV_ABB5ZES3 is not set -# CONFIG_RTC_DRV_ABEOZ9 is not set -# CONFIG_RTC_DRV_ABX80X is not set -# CONFIG_RTC_DRV_DS1307 is not set -# CONFIG_RTC_DRV_DS1374 is not set -# CONFIG_RTC_DRV_DS1672 is not set -# CONFIG_RTC_DRV_MAX6900 is not set -# CONFIG_RTC_DRV_MAX31335 is not set -# CONFIG_RTC_DRV_RS5C372 is not set -# CONFIG_RTC_DRV_ISL1208 is not set -# CONFIG_RTC_DRV_ISL12022 is not set -# CONFIG_RTC_DRV_X1205 is not set -# CONFIG_RTC_DRV_PCF8523 is not set -# CONFIG_RTC_DRV_PCF85063 is not set -# CONFIG_RTC_DRV_PCF85363 is not set -# CONFIG_RTC_DRV_PCF8563 is not set -# CONFIG_RTC_DRV_PCF8583 is not set -# CONFIG_RTC_DRV_M41T80 is not set -# CONFIG_RTC_DRV_BQ32K is not set -# CONFIG_RTC_DRV_S35390A is not set -# CONFIG_RTC_DRV_FM3130 is not set -# CONFIG_RTC_DRV_RX8010 is not set -# CONFIG_RTC_DRV_RX8111 is not set -# CONFIG_RTC_DRV_RX8581 is not set -# CONFIG_RTC_DRV_RX8025 is not set -# CONFIG_RTC_DRV_EM3027 is not set -# CONFIG_RTC_DRV_RV3028 is not set -# CONFIG_RTC_DRV_RV3032 is not set -# CONFIG_RTC_DRV_RV8803 is not set -# CONFIG_RTC_DRV_SD2405AL is not set -# CONFIG_RTC_DRV_SD3078 is not set - -## SPI RTC drivers -CONFIG_RTC_I2C_AND_SPI=m - -## SPI and I2C RTC drivers -# CONFIG_RTC_DRV_DS3232 is not set -# CONFIG_RTC_DRV_PCF2127 is not set -# CONFIG_RTC_DRV_RV3029C2 is not set -# CONFIG_RTC_DRV_RX6110 is not set - -## Platform RTC drivers -CONFIG_RTC_DRV_CMOS=y -# CONFIG_RTC_DRV_DS1286 is not set -# CONFIG_RTC_DRV_DS1511 is not set -# CONFIG_RTC_DRV_DS1553 is not set -# CONFIG_RTC_DRV_DS1685_FAMILY is not set -# CONFIG_RTC_DRV_DS1742 is not set -# CONFIG_RTC_DRV_DS2404 is not set -# CONFIG_RTC_DRV_STK17TA8 is not set -# CONFIG_RTC_DRV_M48T86 is not set -# CONFIG_RTC_DRV_M48T35 is not set -# CONFIG_RTC_DRV_M48T59 is not set -# CONFIG_RTC_DRV_MSM6242 is not set -# CONFIG_RTC_DRV_RP5C01 is not set - -## on-CPU RTC drivers -# CONFIG_RTC_DRV_FTRTC010 is not set - -## HID Sensor RTC drivers -# CONFIG_RTC_DRV_GOLDFISH is not set -# CONFIG_DMADEVICES is not set - -# DMABUF options -CONFIG_SYNC_FILE=y -# CONFIG_SW_SYNC is not set -# CONFIG_UDMABUF is not set -# CONFIG_DMABUF_MOVE_NOTIFY is not set -# CONFIG_DMABUF_DEBUG is not set -# CONFIG_DMABUF_SELFTESTS is not set -# CONFIG_DMABUF_HEAPS is not set -# CONFIG_DMABUF_SYSFS_STATS is not set -# end of DMABUF options - -CONFIG_UIO=m -# CONFIG_UIO_CIF is not set -# CONFIG_UIO_PDRV_GENIRQ is not set -# CONFIG_UIO_DMEM_GENIRQ is not set -# CONFIG_UIO_AEC is not set -# CONFIG_UIO_SERCOS3 is not set -CONFIG_UIO_PCI_GENERIC=m -# CONFIG_UIO_NETX is not set -# CONFIG_UIO_MF624 is not set -CONFIG_VFIO=m -CONFIG_VFIO_GROUP=y -CONFIG_VFIO_CONTAINER=y -CONFIG_VFIO_IOMMU_TYPE1=m -CONFIG_VFIO_NOIOMMU=y -CONFIG_VFIO_VIRQFD=y -# CONFIG_VFIO_DEBUGFS is not set - -# VFIO support for PCI devices -CONFIG_VFIO_PCI_CORE=m -CONFIG_VFIO_PCI_MMAP=y -CONFIG_VFIO_PCI_INTX=y -CONFIG_VFIO_PCI=m -CONFIG_VFIO_PCI_VGA=y -CONFIG_VFIO_PCI_IGD=y -# CONFIG_MLX5_VFIO_PCI is not set -# end of VFIO support for PCI devices - -CONFIG_IRQ_BYPASS_MANAGER=m -CONFIG_VIRT_DRIVERS=y -CONFIG_VMGENID=y -# CONFIG_VBOXGUEST is not set -# CONFIG_NITRO_ENCLAVES is not set -CONFIG_TSM_REPORTS=m -# CONFIG_EFI_SECRET is not set -CONFIG_SEV_GUEST=m -CONFIG_TDX_GUEST_DRIVER=m -CONFIG_VIRTIO_MENU=y -# CONFIG_VIRTIO_PCI is not set -# CONFIG_VIRTIO_MMIO is not set -# CONFIG_VDPA is not set -CONFIG_VHOST_MENU=y -# CONFIG_VHOST_NET is not set -# CONFIG_VHOST_VSOCK is not set -# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set -CONFIG_VHOST_ENABLE_FORK_OWNER_CONTROL=y - -# Microsoft Hyper-V guest support -# CONFIG_HYPERV is not set -# end of Microsoft Hyper-V guest support - -# CONFIG_GREYBUS is not set -# CONFIG_COMEDI is not set -# CONFIG_STAGING is not set -# CONFIG_GOLDFISH is not set -# CONFIG_CHROME_PLATFORMS is not set -# CONFIG_MELLANOX_PLATFORM is not set -# CONFIG_SURFACE_PLATFORMS is not set -CONFIG_X86_PLATFORM_DEVICES=y -CONFIG_ACPI_WMI=m -CONFIG_WMI_BMOF=m -# CONFIG_MXM_WMI is not set -# CONFIG_NVIDIA_WMI_EC_BACKLIGHT is not set -# CONFIG_XIAOMI_WMI is not set -# CONFIG_GIGABYTE_WMI is not set -# CONFIG_YOGABOOK is not set -# CONFIG_ACERHDF is not set -# CONFIG_ACER_WIRELESS is not set -# CONFIG_ACER_WMI is not set -# CONFIG_AMD_HSMP is not set -# CONFIG_AMD_WBRF is not set -# CONFIG_ADV_SWBUTTON is not set -# CONFIG_APPLE_GMUX is not set -# CONFIG_ASUS_LAPTOP is not set -# CONFIG_ASUS_WIRELESS is not set -# CONFIG_EEEPC_LAPTOP is not set -# CONFIG_X86_PLATFORM_DRIVERS_DELL is not set -# CONFIG_FUJITSU_TABLET is not set -# CONFIG_GPD_POCKET_FAN is not set -# CONFIG_X86_PLATFORM_DRIVERS_HP is not set -# CONFIG_WIRELESS_HOTKEY is not set -# CONFIG_IBM_RTL is not set -# CONFIG_SENSORS_HDAPS is not set -# CONFIG_THINKPAD_LMI is not set -# CONFIG_INTEL_IFS is not set -# CONFIG_INTEL_SAR_INT1092 is not set - -# Intel Speed Select Technology interface support -# CONFIG_INTEL_SPEED_SELECT_INTERFACE is not set -# end of Intel Speed Select Technology interface support - -# CONFIG_INTEL_WMI_SBL_FW_UPDATE is not set -# CONFIG_INTEL_WMI_THUNDERBOLT is not set - -# Intel Uncore Frequency Control -# CONFIG_INTEL_UNCORE_FREQ_CONTROL is not set -# end of Intel Uncore Frequency Control - -# CONFIG_INTEL_HID_EVENT is not set -# CONFIG_INTEL_VBTN is not set -# CONFIG_INTEL_PUNIT_IPC is not set -# CONFIG_INTEL_RST is not set -# CONFIG_INTEL_SMARTCONNECT is not set -# CONFIG_INTEL_VSEC is not set -# CONFIG_ACPI_QUICKSTART is not set -# CONFIG_MSI_WMI is not set -# CONFIG_MSI_WMI_PLATFORM is not set -# CONFIG_SAMSUNG_LAPTOP is not set -# CONFIG_SAMSUNG_Q10 is not set -# CONFIG_TOSHIBA_BT_RFKILL is not set -# CONFIG_TOSHIBA_HAPS is not set -# CONFIG_TOSHIBA_WMI is not set -# CONFIG_ACPI_CMPC is not set -# CONFIG_PANASONIC_LAPTOP is not set -# CONFIG_TOPSTAR_LAPTOP is not set -# CONFIG_SERIAL_MULTI_INSTANTIATE is not set -# CONFIG_MLX_PLATFORM is not set -# CONFIG_INSPUR_PLATFORM_PROFILE is not set -# CONFIG_LENOVO_WMI_CAMERA is not set -# CONFIG_INTEL_IPS is not set -# CONFIG_INTEL_SCU_PCI is not set -# CONFIG_INTEL_SCU_PLATFORM is not set -# CONFIG_SIEMENS_SIMATIC_IPC is not set -# CONFIG_WINMATE_FM07_KEYS is not set -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_COMMON_CLK=y -# CONFIG_COMMON_CLK_MAX9485 is not set -# CONFIG_COMMON_CLK_SI5341 is not set -# CONFIG_COMMON_CLK_SI5351 is not set -# CONFIG_COMMON_CLK_SI544 is not set -# CONFIG_COMMON_CLK_CDCE706 is not set -# CONFIG_COMMON_CLK_CS2000_CP is not set -# CONFIG_XILINX_VCU is not set -# CONFIG_HWSPINLOCK is not set - -# Clock Source drivers -CONFIG_CLKEVT_I8253=y -CONFIG_I8253_LOCK=y -CONFIG_CLKBLD_I8253=y -# end of Clock Source drivers - -CONFIG_MAILBOX=y -CONFIG_PCC=y -# CONFIG_ALTERA_MBOX is not set -CONFIG_IOMMU_IOVA=y -CONFIG_IOMMU_API=y -CONFIG_IOMMU_SUPPORT=y - -# Generic IOMMU Pagetable Support -CONFIG_IOMMU_IO_PGTABLE=y -# end of Generic IOMMU Pagetable Support - -# CONFIG_IOMMU_DEBUGFS is not set -# CONFIG_IOMMU_DEFAULT_DMA_STRICT is not set -CONFIG_IOMMU_DEFAULT_DMA_LAZY=y -# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set -CONFIG_IOMMU_DMA=y -CONFIG_IOMMU_SVA=y -CONFIG_IOMMU_IOPF=y -CONFIG_AMD_IOMMU=y -CONFIG_DMAR_TABLE=y -CONFIG_INTEL_IOMMU=y -# CONFIG_INTEL_IOMMU_SVM is not set -CONFIG_INTEL_IOMMU_DEFAULT_ON=y -CONFIG_INTEL_IOMMU_FLOPPY_WA=y -# CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON is not set -# CONFIG_INTEL_IOMMU_PERF_EVENTS is not set -# CONFIG_IOMMUFD is not set -# CONFIG_IRQ_REMAP is not set - -# Remoteproc drivers -# CONFIG_REMOTEPROC is not set -# end of Remoteproc drivers - -# Rpmsg drivers -# CONFIG_RPMSG_QCOM_GLINK_RPM is not set -# CONFIG_RPMSG_VIRTIO is not set -# end of Rpmsg drivers - -# CONFIG_SOUNDWIRE is not set - -# SOC (System On Chip) specific Drivers - -# Amlogic SoC drivers -# end of Amlogic SoC drivers - -# Broadcom SoC drivers -# end of Broadcom SoC drivers - -# NXP/Freescale QorIQ SoC drivers -# end of NXP/Freescale QorIQ SoC drivers - -# fujitsu SoC drivers -# end of fujitsu SoC drivers - -# i.MX SoC drivers -# end of i.MX SoC drivers - -# Enable LiteX SoC Builder specific drivers -# end of Enable LiteX SoC Builder specific drivers - -# CONFIG_WPCM450_SOC is not set - -# Qualcomm SoC drivers -# end of Qualcomm SoC drivers - -# CONFIG_SOC_TI is not set - -# Xilinx SoC drivers -# end of Xilinx SoC drivers -# end of SOC (System On Chip) specific Drivers - -# PM Domains - -# Amlogic PM Domains -# end of Amlogic PM Domains - -# Broadcom PM Domains -# end of Broadcom PM Domains - -# i.MX PM Domains -# end of i.MX PM Domains - -# Qualcomm PM Domains -# end of Qualcomm PM Domains -# end of PM Domains - -# CONFIG_PM_DEVFREQ is not set -# CONFIG_EXTCON is not set -# CONFIG_MEMORY is not set -# CONFIG_IIO is not set -# CONFIG_NTB is not set -# CONFIG_PWM is not set - -# IRQ chip support -# end of IRQ chip support - -# CONFIG_IPACK_BUS is not set -# CONFIG_RESET_CONTROLLER is not set - -# PHY Subsystem -# CONFIG_GENERIC_PHY is not set -# CONFIG_USB_LGM_PHY is not set -# CONFIG_PHY_CAN_TRANSCEIVER is not set - -# PHY drivers for Broadcom platforms -# CONFIG_BCM_KONA_USB2_PHY is not set -# end of PHY drivers for Broadcom platforms - -# CONFIG_PHY_PXA_28NM_HSIC is not set -# CONFIG_PHY_PXA_28NM_USB2 is not set -# CONFIG_PHY_INTEL_LGM_EMMC is not set -# end of PHY Subsystem - -# CONFIG_POWERCAP is not set -# CONFIG_MCB is not set - -# Performance monitor support -# CONFIG_DWC_PCIE_PMU is not set -# end of Performance monitor support - -# CONFIG_RAS is not set -# CONFIG_USB4 is not set - -# Android -# CONFIG_ANDROID_BINDER_IPC is not set -# end of Android - -CONFIG_LIBNVDIMM=m -CONFIG_BLK_DEV_PMEM=m -CONFIG_ND_CLAIM=y -CONFIG_ND_BTT=m -CONFIG_BTT=y -CONFIG_ND_PFN=m -CONFIG_NVDIMM_PFN=y -CONFIG_NVDIMM_DAX=y -CONFIG_DAX=y -CONFIG_DEV_DAX=m -CONFIG_DEV_DAX_PMEM=m -CONFIG_DEV_DAX_KMEM=m -# CONFIG_NVMEM is not set - -# HW tracing support -# CONFIG_STM is not set -# CONFIG_INTEL_TH is not set -# end of HW tracing support - -# CONFIG_FPGA is not set -# CONFIG_TEE is not set -# CONFIG_SIOX is not set -# CONFIG_SLIMBUS is not set -# CONFIG_INTERCONNECT is not set -# CONFIG_COUNTER is not set -# CONFIG_MOST is not set -# CONFIG_PECI is not set -# CONFIG_HTE is not set -# end of Device Drivers - -# File systems -CONFIG_DCACHE_WORD_ACCESS=y -CONFIG_VALIDATE_FS_PARSER=y -CONFIG_FS_IOMAP=y -CONFIG_FS_STACK=y -CONFIG_BUFFER_HEAD=y -CONFIG_LEGACY_DIRECT_IO=y -# CONFIG_EXT2_FS is not set -# CONFIG_EXT3_FS is not set -CONFIG_EXT4_FS=y -CONFIG_EXT4_USE_FOR_EXT2=y -CONFIG_EXT4_FS_POSIX_ACL=y -CONFIG_EXT4_FS_SECURITY=y -# CONFIG_EXT4_DEBUG is not set -CONFIG_JBD2=y -# CONFIG_JBD2_DEBUG is not set -CONFIG_FS_MBCACHE=y -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -CONFIG_XFS_FS=m -CONFIG_XFS_SUPPORT_V4=y -CONFIG_XFS_SUPPORT_ASCII_CI=y -CONFIG_XFS_QUOTA=y -CONFIG_XFS_POSIX_ACL=y -CONFIG_XFS_RT=y -# CONFIG_XFS_ONLINE_SCRUB is not set -# CONFIG_XFS_WARN is not set -# CONFIG_XFS_DEBUG is not set -# CONFIG_GFS2_FS is not set -# CONFIG_OCFS2_FS is not set -CONFIG_BTRFS_FS=m -CONFIG_BTRFS_FS_POSIX_ACL=y -# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set -# CONFIG_BTRFS_DEBUG is not set -# CONFIG_BTRFS_ASSERT is not set -# CONFIG_BTRFS_FS_REF_VERIFY is not set -# CONFIG_NILFS2_FS is not set -# CONFIG_F2FS_FS is not set -# CONFIG_BCACHEFS_FS is not set -CONFIG_FS_DAX=y -CONFIG_FS_DAX_PMD=y -CONFIG_FS_POSIX_ACL=y -CONFIG_EXPORTFS=y -CONFIG_EXPORTFS_BLOCK_OPS=y -CONFIG_FILE_LOCKING=y -# CONFIG_FS_ENCRYPTION is not set -# CONFIG_FS_VERITY is not set -CONFIG_FSNOTIFY=y -CONFIG_DNOTIFY=y -CONFIG_INOTIFY_USER=y -CONFIG_FANOTIFY=y -CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y -CONFIG_QUOTA=y -CONFIG_QUOTA_NETLINK_INTERFACE=y -# CONFIG_QUOTA_DEBUG is not set -# CONFIG_QFMT_V1 is not set -# CONFIG_QFMT_V2 is not set -CONFIG_QUOTACTL=y -CONFIG_AUTOFS_FS=m -CONFIG_FUSE_FS=m -# CONFIG_CUSE is not set -# CONFIG_VIRTIO_FS is not set -CONFIG_FUSE_PASSTHROUGH=y -CONFIG_OVERLAY_FS=m -# CONFIG_OVERLAY_FS_REDIRECT_DIR is not set -CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW=y -# CONFIG_OVERLAY_FS_INDEX is not set -# CONFIG_OVERLAY_FS_XINO_AUTO is not set -# CONFIG_OVERLAY_FS_METACOPY is not set -# CONFIG_OVERLAY_FS_DEBUG is not set - -# Caches -CONFIG_NETFS_SUPPORT=m -# CONFIG_NETFS_STATS is not set -# CONFIG_NETFS_DEBUG is not set -CONFIG_FSCACHE=y -# CONFIG_FSCACHE_STATS is not set -# CONFIG_CACHEFILES is not set -# end of Caches - -# CD-ROM/DVD Filesystems -CONFIG_ISO9660_FS=m -CONFIG_JOLIET=y -# CONFIG_ZISOFS is not set -CONFIG_UDF_FS=m -# end of CD-ROM/DVD Filesystems - -# DOS/FAT/EXFAT/NT Filesystems -CONFIG_FAT_FS=m -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m -CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="ascii" -# CONFIG_FAT_DEFAULT_UTF8 is not set -# CONFIG_EXFAT_FS is not set -# CONFIG_NTFS3_FS is not set -# CONFIG_NTFS_FS is not set -# end of DOS/FAT/EXFAT/NT Filesystems - -# Pseudo filesystems -CONFIG_PROC_FS=y -# CONFIG_PROC_KCORE is not set -CONFIG_PROC_SYSCTL=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_PROC_CHILDREN=y -CONFIG_PROC_PID_ARCH_STATUS=y -CONFIG_KERNFS=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -CONFIG_TMPFS_POSIX_ACL=y -CONFIG_TMPFS_XATTR=y -# CONFIG_TMPFS_INODE64 is not set -# CONFIG_TMPFS_QUOTA is not set -CONFIG_HUGETLBFS=y -# CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON is not set -CONFIG_HUGETLB_PAGE=y -CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP=y -CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING=y -CONFIG_ARCH_HAS_GIGANTIC_PAGE=y -CONFIG_CONFIGFS_FS=m -CONFIG_EFIVAR_FS=m -# end of Pseudo filesystems - -CONFIG_MISC_FILESYSTEMS=y -# CONFIG_ORANGEFS_FS is not set -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_ECRYPT_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -# CONFIG_JFFS2_FS is not set -# CONFIG_CRAMFS is not set -CONFIG_SQUASHFS=m -CONFIG_SQUASHFS_FILE_CACHE=y -# CONFIG_SQUASHFS_FILE_DIRECT is not set -CONFIG_SQUASHFS_DECOMP_SINGLE=y -# CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set -CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE=y -# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is not set -# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set -# CONFIG_SQUASHFS_XATTR is not set -CONFIG_SQUASHFS_ZLIB=y -# CONFIG_SQUASHFS_LZ4 is not set -CONFIG_SQUASHFS_LZO=y -CONFIG_SQUASHFS_XZ=y -CONFIG_SQUASHFS_ZSTD=y -# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set -# CONFIG_SQUASHFS_EMBEDDED is not set -CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 -# CONFIG_VXFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_OMFS_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_QNX6FS_FS is not set -# CONFIG_ROMFS_FS is not set -# CONFIG_PSTORE is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set -# CONFIG_EROFS_FS is not set -# CONFIG_VTAR is not set -CONFIG_VTARFS=m -CONFIG_TARFS=m -CONFIG_NETWORK_FILESYSTEMS=y -CONFIG_NFS_FS=m -CONFIG_NFS_V2=m -CONFIG_NFS_V3=m -CONFIG_NFS_V3_ACL=y -CONFIG_NFS_V4=m -# CONFIG_NFS_SWAP is not set -CONFIG_NFS_V4_1=y -CONFIG_NFS_V4_2=y -CONFIG_PNFS_FILE_LAYOUT=m -CONFIG_PNFS_BLOCK=m -CONFIG_PNFS_FLEXFILE_LAYOUT=m -CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org" -# CONFIG_NFS_V4_1_MIGRATION is not set -CONFIG_NFS_V4_SECURITY_LABEL=y -CONFIG_NFS_FSCACHE=y -# CONFIG_NFS_USE_LEGACY_DNS is not set -CONFIG_NFS_USE_KERNEL_DNS=y -CONFIG_NFS_DEBUG=y -CONFIG_NFS_DISABLE_UDP_SUPPORT=y -# CONFIG_NFS_V4_2_READ_PLUS is not set -CONFIG_NFSD=m -# CONFIG_NFSD_V2 is not set -CONFIG_NFSD_V3_ACL=y -CONFIG_NFSD_V4=y -CONFIG_NFSD_PNFS=y -CONFIG_NFSD_BLOCKLAYOUT=y -CONFIG_NFSD_SCSILAYOUT=y -CONFIG_NFSD_FLEXFILELAYOUT=y -# CONFIG_NFSD_V4_2_INTER_SSC is not set -# CONFIG_NFSD_V4_SECURITY_LABEL is not set -CONFIG_NFSD_LEGACY_CLIENT_TRACKING=y -CONFIG_GRACE_PERIOD=m -CONFIG_LOCKD=m -CONFIG_LOCKD_V4=y -CONFIG_NFS_ACL_SUPPORT=m -CONFIG_NFS_COMMON=y -# CONFIG_NFS_LOCALIO is not set -CONFIG_NFS_V4_2_SSC_HELPER=y -CONFIG_SUNRPC=m -CONFIG_SUNRPC_GSS=m -CONFIG_SUNRPC_BACKCHANNEL=y -CONFIG_RPCSEC_GSS_KRB5=m -CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_AES_SHA1=y -# CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_AES_SHA2 is not set -CONFIG_SUNRPC_DEBUG=y -CONFIG_SUNRPC_XPRT_RDMA=m -# CONFIG_CEPH_FS is not set -CONFIG_CIFS=m -CONFIG_CIFS_STATS2=y -# CONFIG_CIFS_ALLOW_INSECURE_LEGACY is not set -CONFIG_CIFS_UPCALL=y -CONFIG_CIFS_XATTR=y -CONFIG_CIFS_DEBUG=y -# CONFIG_CIFS_DEBUG2 is not set -# CONFIG_CIFS_DEBUG_DUMP_KEYS is not set -CONFIG_CIFS_DFS_UPCALL=y -# CONFIG_CIFS_SWN_UPCALL is not set -# CONFIG_CIFS_SMB_DIRECT is not set -# CONFIG_CIFS_FSCACHE is not set -# CONFIG_CIFS_COMPRESSION is not set -# CONFIG_SMB_SERVER is not set -CONFIG_SMBFS=m -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set -CONFIG_9P_FS=m -# CONFIG_9P_FSCACHE is not set -CONFIG_9P_FS_POSIX_ACL=y -CONFIG_9P_FS_SECURITY=y -CONFIG_NLS=y -CONFIG_NLS_DEFAULT="utf8" -CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_CODEPAGE_737=m -CONFIG_NLS_CODEPAGE_775=m -CONFIG_NLS_CODEPAGE_850=m -CONFIG_NLS_CODEPAGE_852=m -CONFIG_NLS_CODEPAGE_855=m -CONFIG_NLS_CODEPAGE_857=m -CONFIG_NLS_CODEPAGE_860=m -CONFIG_NLS_CODEPAGE_861=m -CONFIG_NLS_CODEPAGE_862=m -CONFIG_NLS_CODEPAGE_863=m -CONFIG_NLS_CODEPAGE_864=m -CONFIG_NLS_CODEPAGE_865=m -CONFIG_NLS_CODEPAGE_866=m -CONFIG_NLS_CODEPAGE_869=m -CONFIG_NLS_CODEPAGE_936=m -CONFIG_NLS_CODEPAGE_950=m -CONFIG_NLS_CODEPAGE_932=m -CONFIG_NLS_CODEPAGE_949=m -CONFIG_NLS_CODEPAGE_874=m -CONFIG_NLS_ISO8859_8=m -CONFIG_NLS_CODEPAGE_1250=m -CONFIG_NLS_CODEPAGE_1251=m -CONFIG_NLS_ASCII=y -CONFIG_NLS_ISO8859_1=m -CONFIG_NLS_ISO8859_2=m -CONFIG_NLS_ISO8859_3=m -CONFIG_NLS_ISO8859_4=m -CONFIG_NLS_ISO8859_5=m -CONFIG_NLS_ISO8859_6=m -CONFIG_NLS_ISO8859_7=m -CONFIG_NLS_ISO8859_9=m -CONFIG_NLS_ISO8859_13=m -CONFIG_NLS_ISO8859_14=m -CONFIG_NLS_ISO8859_15=m -CONFIG_NLS_KOI8_R=m -CONFIG_NLS_KOI8_U=m -CONFIG_NLS_MAC_ROMAN=m -CONFIG_NLS_MAC_CELTIC=m -CONFIG_NLS_MAC_CENTEURO=m -CONFIG_NLS_MAC_CROATIAN=m -CONFIG_NLS_MAC_CYRILLIC=m -CONFIG_NLS_MAC_GAELIC=m -CONFIG_NLS_MAC_GREEK=m -CONFIG_NLS_MAC_ICELAND=m -CONFIG_NLS_MAC_INUIT=m -CONFIG_NLS_MAC_ROMANIAN=m -CONFIG_NLS_MAC_TURKISH=m -CONFIG_NLS_UTF8=y -CONFIG_NLS_UCS2_UTILS=m -# CONFIG_DLM is not set -# CONFIG_UNICODE is not set -CONFIG_IO_WQ=y -# end of File systems - -# Security options -CONFIG_KEYS=y -# CONFIG_KEYS_REQUEST_CACHE is not set -# CONFIG_PERSISTENT_KEYRINGS is not set -# CONFIG_TRUSTED_KEYS is not set -# CONFIG_ENCRYPTED_KEYS is not set -# CONFIG_KEY_DH_OPERATIONS is not set -# CONFIG_SECURITY_DMESG_RESTRICT is not set -CONFIG_PROC_MEM_ALWAYS_FORCE=y -# CONFIG_PROC_MEM_FORCE_PTRACE is not set -# CONFIG_PROC_MEM_NO_FORCE is not set -CONFIG_SECURITY=y -CONFIG_SECURITYFS=y -CONFIG_SECURITY_NETWORK=y -# CONFIG_SECURITY_INFINIBAND is not set -# CONFIG_SECURITY_NETWORK_XFRM is not set -CONFIG_SECURITY_PATH=y -# CONFIG_INTEL_TXT is not set -CONFIG_LSM_MMAP_MIN_ADDR=65536 -CONFIG_HARDENED_USERCOPY=y -CONFIG_FORTIFY_SOURCE=y -# CONFIG_STATIC_USERMODEHELPER is not set -CONFIG_SECURITY_SELINUX=y -CONFIG_SECURITY_SELINUX_BOOTPARAM=y -CONFIG_SECURITY_SELINUX_DEVELOP=y -CONFIG_SECURITY_SELINUX_AVC_STATS=y -CONFIG_SECURITY_SELINUX_SIDTAB_HASH_BITS=9 -CONFIG_SECURITY_SELINUX_SID2STR_CACHE_SIZE=256 -# CONFIG_SECURITY_SELINUX_DEBUG is not set -# CONFIG_SECURITY_SMACK is not set -# CONFIG_SECURITY_TOMOYO is not set -CONFIG_SECURITY_APPARMOR=y -# CONFIG_SECURITY_APPARMOR_DEBUG is not set -CONFIG_SECURITY_APPARMOR_INTROSPECT_POLICY=y -CONFIG_SECURITY_APPARMOR_HASH=y -CONFIG_SECURITY_APPARMOR_HASH_DEFAULT=y -CONFIG_SECURITY_APPARMOR_EXPORT_BINARY=y -CONFIG_SECURITY_APPARMOR_PARANOID_LOAD=y -# CONFIG_SECURITY_LOADPIN is not set -CONFIG_SECURITY_YAMA=y -# CONFIG_SECURITY_SAFESETID is not set -CONFIG_SECURITY_LOCKDOWN_LSM=y -# CONFIG_SECURITY_LOCKDOWN_LSM_EARLY is not set -CONFIG_LOCK_DOWN_KERNEL_IN_SECUREBOOT=y -CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE=y -# CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY is not set -# CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY is not set -CONFIG_SECURITY_SBAT="linux-sbat.csv" -# CONFIG_SECURITY_LANDLOCK is not set -# CONFIG_SECURITY_IPE is not set -CONFIG_INTEGRITY=y -# CONFIG_INTEGRITY_SIGNATURE is not set -CONFIG_INTEGRITY_AUDIT=y -CONFIG_IMA=y -CONFIG_IMA_MEASURE_PCR_IDX=10 -CONFIG_IMA_LSM_RULES=y -CONFIG_IMA_NG_TEMPLATE=y -# CONFIG_IMA_SIG_TEMPLATE is not set -CONFIG_IMA_DEFAULT_TEMPLATE="ima-ng" -# CONFIG_IMA_DEFAULT_HASH_SHA1 is not set -CONFIG_IMA_DEFAULT_HASH_SHA256=y -# CONFIG_IMA_DEFAULT_HASH_SHA512 is not set -CONFIG_IMA_DEFAULT_HASH="sha256" -# CONFIG_IMA_WRITE_POLICY is not set -CONFIG_IMA_READ_POLICY=y -# CONFIG_IMA_APPRAISE is not set -CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS=y -CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS=y -# CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT is not set -# CONFIG_IMA_DISABLE_HTABLE is not set -# CONFIG_EVM is not set -CONFIG_DEFAULT_SECURITY_SELINUX=y -# CONFIG_DEFAULT_SECURITY_APPARMOR is not set -# CONFIG_DEFAULT_SECURITY_DAC is not set -CONFIG_LSM="lockdown,yama,loadpin,safesetid,integrity,selinux,apparmor,smack,tomoyo" - -# Kernel hardening options - -# Memory initialization -CONFIG_CC_HAS_AUTO_VAR_INIT_PATTERN=y -CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO_BARE=y -CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO=y -CONFIG_INIT_STACK_NONE=y -# CONFIG_INIT_STACK_ALL_PATTERN is not set -# CONFIG_INIT_STACK_ALL_ZERO is not set -# CONFIG_GCC_PLUGIN_STACKLEAK is not set -# CONFIG_INIT_ON_ALLOC_DEFAULT_ON is not set -# CONFIG_INIT_ON_FREE_DEFAULT_ON is not set -CONFIG_CC_HAS_ZERO_CALL_USED_REGS=y -# CONFIG_ZERO_CALL_USED_REGS is not set -# end of Memory initialization - -# Hardening of kernel data structures -# CONFIG_LIST_HARDENED is not set -# CONFIG_BUG_ON_DATA_CORRUPTION is not set -# end of Hardening of kernel data structures - -CONFIG_RANDSTRUCT_NONE=y -# CONFIG_RANDSTRUCT_FULL is not set -# CONFIG_RANDSTRUCT_PERFORMANCE is not set -# end of Kernel hardening options -# end of Security options - -CONFIG_XOR_BLOCKS=m -CONFIG_CRYPTO=y - -# Crypto core or helper -CONFIG_CRYPTO_FIPS=y -CONFIG_CRYPTO_FIPS_NAME="Linux Kernel Cryptographic API" -# CONFIG_CRYPTO_FIPS_CUSTOM_VERSION is not set -CONFIG_CRYPTO_ALGAPI=y -CONFIG_CRYPTO_ALGAPI2=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_SIG=y -CONFIG_CRYPTO_SIG2=y -CONFIG_CRYPTO_SKCIPHER=y -CONFIG_CRYPTO_SKCIPHER2=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_RNG_DEFAULT=y -CONFIG_CRYPTO_AKCIPHER2=y -CONFIG_CRYPTO_AKCIPHER=y -CONFIG_CRYPTO_KPP2=y -CONFIG_CRYPTO_KPP=y -CONFIG_CRYPTO_ACOMP2=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -# CONFIG_CRYPTO_USER is not set -# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set -# CONFIG_CRYPTO_MANAGER_EXTRA_TESTS is not set -CONFIG_CRYPTO_NULL=y -CONFIG_CRYPTO_NULL2=y -CONFIG_CRYPTO_PCRYPT=m -CONFIG_CRYPTO_CRYPTD=y -CONFIG_CRYPTO_AUTHENC=m -CONFIG_CRYPTO_TEST=m -CONFIG_CRYPTO_SIMD=y -# end of Crypto core or helper - -# Public-key cryptography -CONFIG_CRYPTO_RSA=y -# CONFIG_CRYPTO_DH is not set -CONFIG_CRYPTO_ECC=y -CONFIG_CRYPTO_ECDH=y -CONFIG_CRYPTO_ECDSA=y -# CONFIG_CRYPTO_ECRDSA is not set -# CONFIG_CRYPTO_CURVE25519 is not set -# end of Public-key cryptography - -# Block ciphers -CONFIG_CRYPTO_AES=y -# CONFIG_CRYPTO_AES_TI is not set -# CONFIG_CRYPTO_ANUBIS is not set -# CONFIG_CRYPTO_ARIA is not set -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -CONFIG_CRYPTO_DES=y -# CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SEED is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_SM4_GENERIC is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TWOFISH is not set -# end of Block ciphers - -# Length-preserving ciphers and modes -# CONFIG_CRYPTO_ADIANTUM is not set -CONFIG_CRYPTO_ARC4=m -# CONFIG_CRYPTO_CHACHA20 is not set -CONFIG_CRYPTO_CBC=y -CONFIG_CRYPTO_CTR=y -CONFIG_CRYPTO_CTS=y -CONFIG_CRYPTO_ECB=y -# CONFIG_CRYPTO_HCTR2 is not set -# CONFIG_CRYPTO_KEYWRAP is not set -# CONFIG_CRYPTO_LRW is not set -# CONFIG_CRYPTO_PCBC is not set -CONFIG_CRYPTO_XTS=y -# end of Length-preserving ciphers and modes - -# AEAD (authenticated encryption with associated data) ciphers -# CONFIG_CRYPTO_AEGIS128 is not set -# CONFIG_CRYPTO_CHACHA20POLY1305 is not set -CONFIG_CRYPTO_CCM=y -CONFIG_CRYPTO_GCM=y -CONFIG_CRYPTO_GENIV=y -CONFIG_CRYPTO_SEQIV=y -CONFIG_CRYPTO_ECHAINIV=m -CONFIG_CRYPTO_ESSIV=m -# end of AEAD (authenticated encryption with associated data) ciphers - -# Hashes, digests, and MACs -CONFIG_CRYPTO_BLAKE2B=m -CONFIG_CRYPTO_CMAC=y -CONFIG_CRYPTO_GHASH=y -CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_MD4=m -CONFIG_CRYPTO_MD5=y -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_POLY1305 is not set -# CONFIG_CRYPTO_RMD160 is not set -CONFIG_CRYPTO_SHA1=y -CONFIG_CRYPTO_SHA256=y -CONFIG_CRYPTO_SHA512=y -CONFIG_CRYPTO_SHA3=y -# CONFIG_CRYPTO_SM3_GENERIC is not set -# CONFIG_CRYPTO_STREEBOG is not set -# CONFIG_CRYPTO_VMAC is not set -# CONFIG_CRYPTO_WP512 is not set -# CONFIG_CRYPTO_XCBC is not set -CONFIG_CRYPTO_XXHASH=m -# end of Hashes, digests, and MACs - -# CRCs (cyclic redundancy checks) -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_CRC32=m -CONFIG_CRYPTO_CRCT10DIF=m -# CONFIG_CRYPTO_CRC64_ROCKSOFT is not set -# end of CRCs (cyclic redundancy checks) - -# Compression -CONFIG_CRYPTO_DEFLATE=m -# CONFIG_CRYPTO_LZO is not set -# CONFIG_CRYPTO_842 is not set -# CONFIG_CRYPTO_LZ4 is not set -# CONFIG_CRYPTO_LZ4HC is not set -# CONFIG_CRYPTO_ZSTD is not set -# end of Compression - -# Random number generation -CONFIG_CRYPTO_ANSI_CPRNG=m -CONFIG_CRYPTO_DRBG_MENU=y -CONFIG_CRYPTO_DRBG_HMAC=y -CONFIG_CRYPTO_DRBG_HASH=y -CONFIG_CRYPTO_DRBG_CTR=y -CONFIG_CRYPTO_DRBG=y -CONFIG_CRYPTO_JITTERENTROPY=y -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_2 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_8 is not set -CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_32=y -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_64 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_128 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_1024 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_8192 is not set -CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKS=128 -CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE=256 -CONFIG_CRYPTO_JITTERENTROPY_OSR=3 -# CONFIG_CRYPTO_JITTERENTROPY_TESTINTERFACE is not set -# end of Random number generation - -# Userspace interface -CONFIG_CRYPTO_USER_API=m -CONFIG_CRYPTO_USER_API_HASH=m -CONFIG_CRYPTO_USER_API_SKCIPHER=m -CONFIG_CRYPTO_USER_API_RNG=m -# CONFIG_CRYPTO_USER_API_RNG_CAVP is not set -# CONFIG_CRYPTO_USER_API_AEAD is not set -CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y -# end of Userspace interface - -CONFIG_CRYPTO_HASH_INFO=y - -# Accelerated Cryptographic Algorithms for CPU (x86) -CONFIG_CRYPTO_CURVE25519_X86=m -CONFIG_CRYPTO_AES_NI_INTEL=y -# CONFIG_CRYPTO_BLOWFISH_X86_64 is not set -# CONFIG_CRYPTO_CAMELLIA_X86_64 is not set -# CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64 is not set -# CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64 is not set -# CONFIG_CRYPTO_CAST5_AVX_X86_64 is not set -# CONFIG_CRYPTO_CAST6_AVX_X86_64 is not set -# CONFIG_CRYPTO_DES3_EDE_X86_64 is not set -# CONFIG_CRYPTO_SERPENT_SSE2_X86_64 is not set -# CONFIG_CRYPTO_SERPENT_AVX_X86_64 is not set -# CONFIG_CRYPTO_SERPENT_AVX2_X86_64 is not set -# CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64 is not set -# CONFIG_CRYPTO_SM4_AESNI_AVX2_X86_64 is not set -# CONFIG_CRYPTO_TWOFISH_X86_64 is not set -# CONFIG_CRYPTO_TWOFISH_X86_64_3WAY is not set -# CONFIG_CRYPTO_TWOFISH_AVX_X86_64 is not set -# CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64 is not set -# CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64 is not set -# CONFIG_CRYPTO_ARIA_GFNI_AVX512_X86_64 is not set -CONFIG_CRYPTO_CHACHA20_X86_64=m -# CONFIG_CRYPTO_AEGIS128_AESNI_SSE2 is not set -# CONFIG_CRYPTO_NHPOLY1305_SSE2 is not set -# CONFIG_CRYPTO_NHPOLY1305_AVX2 is not set -CONFIG_CRYPTO_BLAKE2S_X86=y -# CONFIG_CRYPTO_POLYVAL_CLMUL_NI is not set -CONFIG_CRYPTO_POLY1305_X86_64=m -# CONFIG_CRYPTO_SHA1_SSSE3 is not set -CONFIG_CRYPTO_SHA256_SSSE3=y -CONFIG_CRYPTO_SHA512_SSSE3=y -# CONFIG_CRYPTO_SM3_AVX_X86_64 is not set -CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=y -CONFIG_CRYPTO_CRC32C_INTEL=m -# CONFIG_CRYPTO_CRC32_PCLMUL is not set -# end of Accelerated Cryptographic Algorithms for CPU (x86) - -# CONFIG_CRYPTO_HW is not set -CONFIG_ASYMMETRIC_KEY_TYPE=y -CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y -CONFIG_X509_CERTIFICATE_PARSER=y -# CONFIG_PKCS8_PRIVATE_KEY_PARSER is not set -CONFIG_PKCS7_MESSAGE_PARSER=y -# CONFIG_PKCS7_TEST_KEY is not set -# CONFIG_SIGNED_PE_FILE_VERIFICATION is not set -# CONFIG_FIPS_SIGNATURE_SELFTEST is not set - -# Certificates for signature checking -CONFIG_MODULE_SIG_KEY="certs/signing_key.pem" -CONFIG_MODULE_SIG_KEY_TYPE_RSA=y -# CONFIG_MODULE_SIG_KEY_TYPE_ECDSA is not set -CONFIG_SYSTEM_TRUSTED_KEYRING=y -CONFIG_SYSTEM_TRUSTED_KEYS="photon-cert-bundle.pem" -# CONFIG_SYSTEM_EXTRA_CERTIFICATE is not set -# CONFIG_SECONDARY_TRUSTED_KEYRING is not set -# CONFIG_SYSTEM_BLACKLIST_KEYRING is not set -# end of Certificates for signature checking - -CONFIG_BINARY_PRINTF=y - -# Library routines -CONFIG_RAID6_PQ=m -# CONFIG_RAID6_PQ_BENCHMARK is not set -# CONFIG_PACKING is not set -CONFIG_BITREVERSE=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_NET_UTILS=y -# CONFIG_CORDIC is not set -# CONFIG_PRIME_NUMBERS is not set -CONFIG_RATIONAL=y -CONFIG_GENERIC_IOMAP=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -CONFIG_ARCH_HAS_FAST_MULTIPLIER=y -CONFIG_ARCH_USE_SYM_ANNOTATIONS=y - -# Crypto library routines -CONFIG_CRYPTO_LIB_UTILS=y -CONFIG_CRYPTO_LIB_AES=y -CONFIG_CRYPTO_LIB_AESCFB=y -CONFIG_CRYPTO_LIB_ARC4=m -CONFIG_CRYPTO_LIB_GF128MUL=y -CONFIG_CRYPTO_ARCH_HAVE_LIB_BLAKE2S=y -CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y -CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=y -CONFIG_CRYPTO_LIB_CHACHA_GENERIC=m -CONFIG_CRYPTO_LIB_CHACHA_INTERNAL=m -CONFIG_CRYPTO_LIB_CHACHA=m -CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519=y -CONFIG_CRYPTO_LIB_CURVE25519_GENERIC=m -CONFIG_CRYPTO_LIB_CURVE25519_INTERNAL=m -CONFIG_CRYPTO_LIB_CURVE25519=m -CONFIG_CRYPTO_LIB_DES=y -CONFIG_CRYPTO_LIB_POLY1305_RSIZE=11 -CONFIG_CRYPTO_ARCH_HAVE_LIB_POLY1305=y -CONFIG_CRYPTO_LIB_POLY1305_GENERIC=m -CONFIG_CRYPTO_LIB_POLY1305_INTERNAL=m -CONFIG_CRYPTO_LIB_POLY1305=m -CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m -CONFIG_CRYPTO_LIB_SHA1=y -CONFIG_CRYPTO_LIB_SHA256=y -# end of Crypto library routines - -# CONFIG_CRC_CCITT is not set -CONFIG_CRC16=y -# CONFIG_CRC_T10DIF is not set -# CONFIG_CRC64_ROCKSOFT is not set -CONFIG_CRC_ITU_T=m -CONFIG_CRC32=y -# CONFIG_CRC32_SELFTEST is not set -CONFIG_CRC32_SLICEBY8=y -# CONFIG_CRC32_SLICEBY4 is not set -# CONFIG_CRC32_SARWATE is not set -# CONFIG_CRC32_BIT is not set -CONFIG_CRC64=m -# CONFIG_CRC4 is not set -# CONFIG_CRC7 is not set -CONFIG_LIBCRC32C=y -# CONFIG_CRC8 is not set -CONFIG_XXHASH=y -# CONFIG_RANDOM32_SELFTEST is not set -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=m -CONFIG_LZO_COMPRESS=m -CONFIG_LZO_DECOMPRESS=y -CONFIG_LZ4_DECOMPRESS=y -CONFIG_ZSTD_COMMON=y -CONFIG_ZSTD_COMPRESS=y -CONFIG_ZSTD_DECOMPRESS=y -CONFIG_XZ_DEC=y -CONFIG_XZ_DEC_X86=y -CONFIG_XZ_DEC_POWERPC=y -CONFIG_XZ_DEC_ARM=y -CONFIG_XZ_DEC_ARMTHUMB=y -CONFIG_XZ_DEC_ARM64=y -CONFIG_XZ_DEC_SPARC=y -CONFIG_XZ_DEC_RISCV=y -# CONFIG_XZ_DEC_MICROLZMA is not set -CONFIG_XZ_DEC_BCJ=y -# CONFIG_XZ_DEC_TEST is not set -CONFIG_DECOMPRESS_GZIP=y -CONFIG_DECOMPRESS_BZIP2=y -CONFIG_DECOMPRESS_LZMA=y -CONFIG_DECOMPRESS_XZ=y -CONFIG_DECOMPRESS_LZO=y -CONFIG_DECOMPRESS_LZ4=y -CONFIG_DECOMPRESS_ZSTD=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_TEXTSEARCH=y -CONFIG_TEXTSEARCH_KMP=m -CONFIG_TEXTSEARCH_BM=m -CONFIG_TEXTSEARCH_FSM=m -CONFIG_INTERVAL_TREE=y -CONFIG_XARRAY_MULTI=y -CONFIG_ASSOCIATIVE_ARRAY=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAS_IOPORT_MAP=y -CONFIG_HAS_DMA=y -CONFIG_DMA_OPS_HELPERS=y -CONFIG_NEED_SG_DMA_FLAGS=y -CONFIG_NEED_SG_DMA_LENGTH=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_ARCH_DMA_ADDR_T_64BIT=y -CONFIG_ARCH_HAS_FORCE_DMA_UNENCRYPTED=y -CONFIG_SWIOTLB=y -# CONFIG_SWIOTLB_DYNAMIC is not set -CONFIG_DMA_NEED_SYNC=y -CONFIG_DMA_COHERENT_POOL=y -# CONFIG_DMA_API_DEBUG is not set -# CONFIG_DMA_MAP_BENCHMARK is not set -CONFIG_SGL_ALLOC=y -CONFIG_CPU_RMAP=y -CONFIG_DQL=y -CONFIG_GLOB=y -# CONFIG_GLOB_SELFTEST is not set -CONFIG_NLATTR=y -CONFIG_CLZ_TAB=y -CONFIG_IRQ_POLL=y -CONFIG_MPILIB=y -CONFIG_DIMLIB=y -CONFIG_OID_REGISTRY=y -CONFIG_UCS2_STRING=y -CONFIG_HAVE_GENERIC_VDSO=y -CONFIG_GENERIC_GETTIMEOFDAY=y -CONFIG_GENERIC_VDSO_TIME_NS=y -CONFIG_GENERIC_VDSO_OVERFLOW_PROTECT=y -CONFIG_VDSO_GETRANDOM=y -CONFIG_FONT_SUPPORT=y -# CONFIG_FONTS is not set -CONFIG_FONT_8x8=y -CONFIG_FONT_8x16=y -CONFIG_SG_POOL=y -CONFIG_ARCH_HAS_PMEM_API=y -CONFIG_MEMREGION=y -CONFIG_ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION=y -CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y -CONFIG_ARCH_HAS_COPY_MC=y -CONFIG_ARCH_STACKWALK=y -CONFIG_STACKDEPOT=y -CONFIG_STACKDEPOT_MAX_FRAMES=64 -CONFIG_SBITMAP=y -# CONFIG_LWQ_TEST is not set -# end of Library routines - -CONFIG_FIRMWARE_TABLE=y - -# Kernel hacking - -# printk and dmesg options -CONFIG_PRINTK_TIME=y -# CONFIG_PRINTK_CALLER is not set -# CONFIG_STACKTRACE_BUILD_ID is not set -CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 -CONFIG_CONSOLE_LOGLEVEL_QUIET=4 -CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 -# CONFIG_BOOT_PRINTK_DELAY is not set -CONFIG_DYNAMIC_DEBUG=y -CONFIG_DYNAMIC_DEBUG_CORE=y -CONFIG_SYMBOLIC_ERRNAME=y -CONFIG_DEBUG_BUGVERBOSE=y -# end of printk and dmesg options - -CONFIG_DEBUG_KERNEL=y -CONFIG_DEBUG_MISC=y - -# Compile-time checks and compiler options -CONFIG_DEBUG_INFO=y -CONFIG_AS_HAS_NON_CONST_ULEB128=y -# CONFIG_DEBUG_INFO_NONE is not set -CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y -# CONFIG_DEBUG_INFO_DWARF4 is not set -# CONFIG_DEBUG_INFO_DWARF5 is not set -# CONFIG_DEBUG_INFO_REDUCED is not set -CONFIG_DEBUG_INFO_COMPRESSED_NONE=y -# CONFIG_DEBUG_INFO_COMPRESSED_ZLIB is not set -# CONFIG_DEBUG_INFO_SPLIT is not set -# CONFIG_DEBUG_INFO_BTF is not set -CONFIG_PAHOLE_HAS_SPLIT_BTF=y -CONFIG_PAHOLE_HAS_LANG_EXCLUDE=y -# CONFIG_GDB_SCRIPTS is not set -CONFIG_FRAME_WARN=1024 -# CONFIG_STRIP_ASM_SYMS is not set -# CONFIG_READABLE_ASM is not set -# CONFIG_HEADERS_INSTALL is not set -CONFIG_DEBUG_SECTION_MISMATCH=y -CONFIG_SECTION_MISMATCH_WARN_ONLY=y -# CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B is not set -CONFIG_ARCH_WANT_FRAME_POINTERS=y -CONFIG_FRAME_POINTER=y -CONFIG_OBJTOOL=y -CONFIG_STACK_VALIDATION=y -# CONFIG_VMLINUX_MAP is not set -# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set -# end of Compile-time checks and compiler options - -# Generic Kernel Debugging Instruments -CONFIG_MAGIC_SYSRQ=y -CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x0 -# CONFIG_MAGIC_SYSRQ_SERIAL is not set -CONFIG_DEBUG_FS=y -CONFIG_DEBUG_FS_ALLOW_ALL=y -# CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set -# CONFIG_DEBUG_FS_ALLOW_NONE is not set -CONFIG_HAVE_ARCH_KGDB=y -# CONFIG_KGDB is not set -CONFIG_ARCH_HAS_UBSAN=y -# CONFIG_UBSAN is not set -CONFIG_HAVE_ARCH_KCSAN=y -CONFIG_HAVE_KCSAN_COMPILER=y -# CONFIG_KCSAN is not set -# end of Generic Kernel Debugging Instruments - -# Networking Debugging -# CONFIG_NET_DEV_REFCNT_TRACKER is not set -# CONFIG_NET_NS_REFCNT_TRACKER is not set -# CONFIG_DEBUG_NET is not set -# CONFIG_DEBUG_NET_SMALL_RTNL is not set -# end of Networking Debugging - -# Memory Debugging -# CONFIG_PAGE_EXTENSION is not set -# CONFIG_DEBUG_PAGEALLOC is not set -CONFIG_SLUB_DEBUG=y -# CONFIG_SLUB_DEBUG_ON is not set -# CONFIG_PAGE_OWNER is not set -# CONFIG_PAGE_TABLE_CHECK is not set -# CONFIG_PAGE_POISONING is not set -# CONFIG_DEBUG_RODATA_TEST is not set -CONFIG_ARCH_HAS_DEBUG_WX=y -# CONFIG_DEBUG_WX is not set -CONFIG_ARCH_HAS_PTDUMP=y -# CONFIG_PTDUMP_DEBUGFS is not set -CONFIG_HAVE_DEBUG_KMEMLEAK=y -# CONFIG_DEBUG_KMEMLEAK is not set -# CONFIG_PER_VMA_LOCK_STATS is not set -# CONFIG_DEBUG_OBJECTS is not set -# CONFIG_SHRINKER_DEBUG is not set -# CONFIG_DEBUG_STACK_USAGE is not set -# CONFIG_SCHED_STACK_END_CHECK is not set -CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE=y -# CONFIG_DEBUG_VM is not set -# CONFIG_DEBUG_VM_PGTABLE is not set -CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y -# CONFIG_DEBUG_VIRTUAL is not set -# CONFIG_DEBUG_MEMORY_INIT is not set -# CONFIG_DEBUG_PER_CPU_MAPS is not set -CONFIG_ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP=y -# CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP is not set -# CONFIG_MEM_ALLOC_PROFILING is not set -CONFIG_HAVE_ARCH_KASAN=y -CONFIG_HAVE_ARCH_KASAN_VMALLOC=y -CONFIG_CC_HAS_KASAN_GENERIC=y -CONFIG_CC_HAS_WORKING_NOSANITIZE_ADDRESS=y -# CONFIG_KASAN is not set -CONFIG_HAVE_ARCH_KFENCE=y -# CONFIG_KFENCE is not set -CONFIG_HAVE_ARCH_KMSAN=y -# end of Memory Debugging - -# CONFIG_DEBUG_SHIRQ is not set - -# Debug Oops, Lockups and Hangs -# CONFIG_PANIC_ON_OOPS is not set -CONFIG_PANIC_ON_OOPS_VALUE=0 -CONFIG_PANIC_TIMEOUT=0 -# CONFIG_SOFTLOCKUP_DETECTOR is not set -CONFIG_HAVE_HARDLOCKUP_DETECTOR_BUDDY=y -# CONFIG_HARDLOCKUP_DETECTOR is not set -CONFIG_HARDLOCKUP_CHECK_TIMESTAMP=y -# CONFIG_DETECT_HUNG_TASK is not set -# CONFIG_WQ_WATCHDOG is not set -# CONFIG_WQ_CPU_INTENSIVE_REPORT is not set -# CONFIG_TEST_LOCKUP is not set -# end of Debug Oops, Lockups and Hangs - -# Scheduler Debugging -CONFIG_SCHED_DEBUG=y -CONFIG_SCHED_INFO=y -CONFIG_SCHEDSTATS=y -# end of Scheduler Debugging - -# Lock Debugging (spinlocks, mutexes, etc...) -CONFIG_LOCK_DEBUGGING_SUPPORT=y -# CONFIG_PROVE_LOCKING is not set -# CONFIG_LOCK_STAT is not set -# CONFIG_DEBUG_RT_MUTEXES is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_MUTEXES is not set -# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set -# CONFIG_DEBUG_RWSEMS is not set -# CONFIG_DEBUG_LOCK_ALLOC is not set -# CONFIG_DEBUG_ATOMIC_SLEEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -# CONFIG_LOCK_TORTURE_TEST is not set -# CONFIG_WW_MUTEX_SELFTEST is not set -# CONFIG_SCF_TORTURE_TEST is not set -# CONFIG_CSD_LOCK_WAIT_DEBUG is not set -# end of Lock Debugging (spinlocks, mutexes, etc...) - -# CONFIG_NMI_CHECK_CPU is not set -# CONFIG_DEBUG_IRQFLAGS is not set -CONFIG_STACKTRACE=y -# CONFIG_DEBUG_KOBJECT is not set - -# Debug kernel data structures -# CONFIG_DEBUG_LIST is not set -# CONFIG_DEBUG_PLIST is not set -# CONFIG_DEBUG_SG is not set -# CONFIG_DEBUG_NOTIFIERS is not set -# CONFIG_DEBUG_MAPLE_TREE is not set -# end of Debug kernel data structures - -# RCU Debugging -# CONFIG_RCU_SCALE_TEST is not set -# CONFIG_RCU_TORTURE_TEST is not set -# CONFIG_RCU_REF_SCALE_TEST is not set -CONFIG_RCU_CPU_STALL_TIMEOUT=60 -CONFIG_RCU_EXP_CPU_STALL_TIMEOUT=0 -# CONFIG_RCU_CPU_STALL_CPUTIME is not set -# CONFIG_RCU_TRACE is not set -# CONFIG_RCU_EQS_DEBUG is not set -# end of RCU Debugging - -# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set -# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set -# CONFIG_LATENCYTOP is not set -CONFIG_USER_STACKTRACE_SUPPORT=y -CONFIG_HAVE_RETHOOK=y -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y -CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y -CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y -CONFIG_HAVE_DYNAMIC_FTRACE_NO_PATCHABLE=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_FENTRY=y -CONFIG_HAVE_OBJTOOL_MCOUNT=y -CONFIG_HAVE_OBJTOOL_NOP_MCOUNT=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_HAVE_BUILDTIME_MCOUNT_SORT=y -CONFIG_TRACING_SUPPORT=y -# CONFIG_FTRACE is not set -# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set -# CONFIG_SAMPLES is not set -CONFIG_HAVE_SAMPLE_FTRACE_DIRECT=y -CONFIG_HAVE_SAMPLE_FTRACE_DIRECT_MULTI=y -CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y -# CONFIG_STRICT_DEVMEM is not set - -# x86 Debugging -# CONFIG_X86_VERBOSE_BOOTUP is not set -CONFIG_EARLY_PRINTK=y -# CONFIG_EARLY_PRINTK_DBGP is not set -# CONFIG_EARLY_PRINTK_USB_XDBC is not set -# CONFIG_EFI_PGT_DUMP is not set -# CONFIG_DEBUG_TLBFLUSH is not set -CONFIG_HAVE_MMIOTRACE_SUPPORT=y -# CONFIG_X86_DECODER_SELFTEST is not set -# CONFIG_IO_DELAY_0X80 is not set -# CONFIG_IO_DELAY_0XED is not set -# CONFIG_IO_DELAY_UDELAY is not set -CONFIG_IO_DELAY_NONE=y -# CONFIG_DEBUG_BOOT_PARAMS is not set -# CONFIG_CPA_DEBUG is not set -# CONFIG_DEBUG_ENTRY is not set -# CONFIG_DEBUG_NMI_SELFTEST is not set -# CONFIG_X86_DEBUG_FPU is not set -# CONFIG_PUNIT_ATOM_DEBUG is not set -# CONFIG_UNWINDER_ORC is not set -CONFIG_UNWINDER_FRAME_POINTER=y -# end of x86 Debugging - -# Kernel Testing and Coverage -# CONFIG_KUNIT is not set -# CONFIG_NOTIFIER_ERROR_INJECTION is not set -# CONFIG_FAULT_INJECTION is not set -CONFIG_ARCH_HAS_KCOV=y -CONFIG_CC_HAS_SANCOV_TRACE_PC=y -# CONFIG_KCOV is not set -# CONFIG_RUNTIME_TESTING_MENU is not set -CONFIG_ARCH_USE_MEMTEST=y -# CONFIG_MEMTEST is not set -# end of Kernel Testing and Coverage - -# Rust hacking -# end of Rust hacking -# end of Kernel hacking diff --git a/SPECS/91/linux/config.yaml b/SPECS/91/linux/config.yaml deleted file mode 100644 index 7e9c58fb4f..0000000000 --- a/SPECS/91/linux/config.yaml +++ /dev/null @@ -1,206 +0,0 @@ -sources: -- archive: linux-6.12.111.tar.xz - archive_type: upstream - version: 6.12.111 - name: linux-6.12.111 - url: https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.12.111.tar.xz - repo_url: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git - commit_id: e2acc2211022246c77740d5df08265cc27eedcc5 - skip_list: [] - missing: [] - archive_sha512sum: - 9366fcea5bcdcd6294341da8dfbd1877ca9e2c4ae898eb86c0f1094ff881ec256908b2236c68e4d79b59492c91986ccf4f1f3818b151ce3a2721e3ce168974cf - skip_validation: false - license_manual_review: - # sspl/SSPL used as part of a variable name, falsely detected by scanner as a license - - file_paths: - - linux-6.12.111/drivers/pci/controller/pci-mvebu.c - sha256sum: c214d76c403debdf0f6151206eef31dc8e26239ba99b89bed6c83770c7840645 - spdx_exp: GPL-2.0-only - # CC-BY-SA-2.0 mentioned as license for external resource (Linux device drivers, 3rd edition) - - file_paths: - - linux-6.12.111/Documentation/process/kernel-docs.rst - sha256sum: 1a01c62a4ef537eb61f0fc47d5e7852f067af86203d7eaaf719befb102bb64b8 - spdx_exp: '' - spdx: - package: - detailed_description: The Linux package contains the Linux kernel. - home_page: http://www.kernel.org - license_concluded: (Apache-2.0 OR BSD-2-Clause) AND (Apache-2.0 OR CC0-1.0 - OR OpenSSL) AND (Apache-2.0 OR GPL-2.0-only) AND (Apache-2.0 OR MIT) AND - (Artistic-2.0 OR GPL-2.0-only) AND (BSD-2-Clause OR GPL-2.0-only OR - Linux-OpenIB) AND (BSD-2-Clause OR GPL-2.0-only WITH Linux-syscall-note) - AND (BSD-2-Clause OR GPL-2.0-only) AND (BSD-2-Clause OR - GPL-2.0-or-later) AND (BSD-2-Clause OR GPL-2.0-or-later) AND - (BSD-2-Clause OR LGPL-2.0-or-later) AND (BSD-2-Clause OR LGPL-2.1-only) - AND (BSD-3-Clause OR GPL-1.0-or-later OR OpenSSL) AND (BSD-3-Clause OR - GPL-1.0-or-later) AND (BSD-3-Clause OR GPL-1.0-or-later) AND - (BSD-3-Clause OR GPL-2.0-only WITH Linux-syscall-note) AND (BSD-3-Clause - OR GPL-2.0-only) AND (BSD-3-Clause OR GPL-2.0-only) AND (BSD-3-Clause OR - GPL-2.0-or-later WITH Linux-syscall-note) AND (BSD-3-Clause OR - GPL-2.0-or-later) AND (BSD-3-Clause OR GPL-2.0-or-later) AND - (BSD-3-Clause OR OpenSSL) AND (BSD-3-Clause-acpica OR GPL-2.0-only) AND - (CC-BY-4.0 OR GPL-2.0-or-later) AND (CDDL-1.0 OR GPL-2.0-only WITH - Linux-syscall-note) AND (CDDL-1.0 OR GPL-2.0-only) AND - (GFDL-1.1-no-invariants-only OR GPL-2.0-only) AND - (GFDL-1.1-no-invariants-or-later OR GPL-2.0-only) AND - (GFDL-1.1-no-invariants-or-later OR GPL-2.0-only) AND - (GFDL-1.2-no-invariants-only OR GPL-2.0-only) AND - (GFDL-1.2-no-invariants-or-later OR GPL-2.0-only) AND (GFDL-1.2-only OR - GPL-2.0-only) AND (GPL-1.0-only OR GPL-2.0-only) AND (GPL-1.0-or-later - OR MIT) AND (GPL-2.0-only OR GPL-3.0-only) AND (GPL-2.0-only OR - Linux-OpenIB) AND (GPL-2.0-only OR MIT) AND (GPL-2.0-only OR MIT) AND - (GPL-2.0-only OR MPL-1.1) AND (GPL-2.0-only OR MPL-1.1) AND - (GPL-2.0-only OR MPL-2.0) AND (GPL-2.0-only OR OSL-1.1) AND - (GPL-2.0-only OR X11) AND (GPL-2.0-only WITH Linux-syscall-note OR - Linux-OpenIB) AND (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND - (GPL-2.0-or-later OR LGPL-3.0-or-later) AND (GPL-2.0-or-later OR MIT) - AND (GPL-2.0-or-later OR MIT) AND (GPL-2.0-or-later OR X11) AND - (GPL-2.0-or-later OR copyleft-next-0.3.1) AND (GPL-2.0-or-later WITH - Linux-syscall-note OR MIT) AND (LGPL-2.1-only OR MIT) AND 0BSD AND - Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-Clear AND - BSD-3-Clause-acpica AND BSD-4-Clause-UC AND BSD-4.3TAHOE AND - BSD-Source-beginning-file AND CC-BY-3.0 AND CC-BY-4.0 AND CC0-1.0 AND - CDDL-1.0 AND CMU-Mach-nodoc AND FSFUL AND GFDL-1.1-no-invariants-only - AND GFDL-1.1-no-invariants-or-later AND GFDL-1.1-only AND - GFDL-1.1-or-later AND GFDL-1.2-no-invariants-only AND - GFDL-1.2-no-invariants-or-later AND GFDL-1.2-only AND GFDL-1.2-or-later - AND GPL-1.0-only AND GPL-1.0-or-later AND GPL-1.0-or-later WITH - Linux-syscall-note AND GPL-2.0-only AND GPL-2.0-only WITH - Linux-syscall-note AND GPL-2.0-only WITH mif-exception AND - GPL-2.0-or-later AND GPL-2.0-or-later WITH GCC-exception-2.0 AND - GPL-2.0-or-later WITH Linux-syscall-note AND GPL-2.0-or-later WITH - mif-exception AND GPL-3.0-only AND GPL-3.0-or-later AND HPND-Pbmplus AND - HPND-export-US-modify AND HPND-export2-US AND HPND-sell-variant AND ISC - AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.0-or-later WITH - Linux-syscall-note AND LGPL-2.1-only AND LGPL-2.1-only WITH - Linux-syscall-note AND LGPL-2.1-or-later AND LGPL-2.1-or-later WITH - Linux-syscall-note AND Linux-OpenIB AND Linux-man-pages-copyleft AND MIT - AND MPL-1.0 AND MPL-1.1 AND MS-LPL AND NTP AND NTP-0 AND OpenSSL AND - Parity-7.0.0 AND SSPL-1.0 AND Unicode-3.0 AND Unlicense AND X11 AND Zlib - AND copyleft-next-0.3.1 AND pkgconf - license_declared: (Apache-2.0 OR BSD-2-Clause) AND (Apache-2.0 OR CC0-1.0 - OR OpenSSL) AND (Apache-2.0 OR GPL-2.0-only) AND (Apache-2.0 OR MIT) AND - (Artistic-2.0 OR GPL-2.0-only) AND (BSD-2-Clause OR GPL-2.0-only OR - Linux-OpenIB) AND (BSD-2-Clause OR GPL-2.0-only WITH Linux-syscall-note) - AND (BSD-2-Clause OR GPL-2.0-only) AND (BSD-2-Clause OR - GPL-2.0-or-later) AND (BSD-2-Clause OR GPL-2.0-or-later) AND - (BSD-2-Clause OR LGPL-2.0-or-later) AND (BSD-2-Clause OR LGPL-2.1-only) - AND (BSD-3-Clause OR GPL-1.0-or-later OR OpenSSL) AND (BSD-3-Clause OR - GPL-1.0-or-later) AND (BSD-3-Clause OR GPL-1.0-or-later) AND - (BSD-3-Clause OR GPL-2.0-only WITH Linux-syscall-note) AND (BSD-3-Clause - OR GPL-2.0-only) AND (BSD-3-Clause OR GPL-2.0-only) AND (BSD-3-Clause OR - GPL-2.0-or-later WITH Linux-syscall-note) AND (BSD-3-Clause OR - GPL-2.0-or-later) AND (BSD-3-Clause OR GPL-2.0-or-later) AND - (BSD-3-Clause OR OpenSSL) AND (BSD-3-Clause-acpica OR GPL-2.0-only) AND - (CC-BY-4.0 OR GPL-2.0-or-later) AND (CDDL-1.0 OR GPL-2.0-only WITH - Linux-syscall-note) AND (CDDL-1.0 OR GPL-2.0-only) AND - (GFDL-1.1-no-invariants-only OR GPL-2.0-only) AND - (GFDL-1.1-no-invariants-or-later OR GPL-2.0-only) AND - (GFDL-1.1-no-invariants-or-later OR GPL-2.0-only) AND - (GFDL-1.2-no-invariants-only OR GPL-2.0-only) AND - (GFDL-1.2-no-invariants-or-later OR GPL-2.0-only) AND (GFDL-1.2-only OR - GPL-2.0-only) AND (GPL-1.0-only OR GPL-2.0-only) AND (GPL-1.0-or-later - OR MIT) AND (GPL-2.0-only OR GPL-3.0-only) AND (GPL-2.0-only OR - Linux-OpenIB) AND (GPL-2.0-only OR MIT) AND (GPL-2.0-only OR MIT) AND - (GPL-2.0-only OR MPL-1.1) AND (GPL-2.0-only OR MPL-1.1) AND - (GPL-2.0-only OR MPL-2.0) AND (GPL-2.0-only OR OSL-1.1) AND - (GPL-2.0-only OR X11) AND (GPL-2.0-only WITH Linux-syscall-note OR - Linux-OpenIB) AND (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND - (GPL-2.0-or-later OR LGPL-3.0-or-later) AND (GPL-2.0-or-later OR MIT) - AND (GPL-2.0-or-later OR MIT) AND (GPL-2.0-or-later OR X11) AND - (GPL-2.0-or-later OR copyleft-next-0.3.1) AND (GPL-2.0-or-later WITH - Linux-syscall-note OR MIT) AND (LGPL-2.1-only OR MIT) AND 0BSD AND - Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-Clear AND - BSD-3-Clause-acpica AND BSD-4-Clause-UC AND BSD-4.3TAHOE AND - BSD-Source-beginning-file AND CC-BY-3.0 AND CC-BY-4.0 AND CC0-1.0 AND - CDDL-1.0 AND CMU-Mach-nodoc AND FSFUL AND GFDL-1.1-no-invariants-only - AND GFDL-1.1-no-invariants-or-later AND GFDL-1.1-only AND - GFDL-1.1-or-later AND GFDL-1.2-no-invariants-only AND - GFDL-1.2-no-invariants-or-later AND GFDL-1.2-only AND GFDL-1.2-or-later - AND GPL-1.0-only AND GPL-1.0-or-later AND GPL-1.0-or-later WITH - Linux-syscall-note AND GPL-2.0-only AND GPL-2.0-only WITH - Linux-syscall-note AND GPL-2.0-only WITH mif-exception AND - GPL-2.0-or-later AND GPL-2.0-or-later WITH GCC-exception-2.0 AND - GPL-2.0-or-later WITH Linux-syscall-note AND GPL-2.0-or-later WITH - mif-exception AND GPL-3.0-only AND GPL-3.0-or-later AND HPND-Pbmplus AND - HPND-export-US-modify AND HPND-export2-US AND HPND-sell-variant AND ISC - AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.0-or-later WITH - Linux-syscall-note AND LGPL-2.1-only AND LGPL-2.1-only WITH - Linux-syscall-note AND LGPL-2.1-or-later AND LGPL-2.1-or-later WITH - Linux-syscall-note AND Linux-OpenIB AND Linux-man-pages-copyleft AND MIT - AND MPL-1.0 AND MPL-1.1 AND MS-LPL AND NTP AND NTP-0 AND OpenSSL AND - Parity-7.0.0 AND SSPL-1.0 AND Unicode-3.0 AND Unlicense AND X11 AND Zlib - AND copyleft-next-0.3.1 AND pkgconf - short_summary: Kernel - supplier: 'Organization: Broadcom, Inc.' -- archive: photon-jitterentropy-v6.12-3.tar.gz - archive_sha512sum: - 19d79f1b2706621a2de90781a76a5d4fa3f8689f41340828db30536e0dfabd026ead5762a46644fe2240391d518821b96ffe72d25ec46e404975119eaaa12368 - skip_validation: true - spdx: - package: - detailed_description: A JitterEntropy is a software-based random number - generator that derives entropy from the unpredictable fluctuations - (jitter) in a system's timing or clock signals. The RNG is based on a - high-resolution timer like the x86 RDTSC instruction. The generated - random bit stream does not show any statistical significant patterns. - The output of the random number generator passes all standard - statistical tools analyzing the quality of a random data stream. - home_page: https://github.com/vmware/photon - license_concluded: (BSD-3-Clause OR GPL-2.0-only) AND GPL-2.0-only AND - GPL-2.0-or-later - license_declared: (BSD-3-Clause OR GPL-2.0-only) AND GPL-2.0-only AND - GPL-2.0-or-later - short_summary: A JitterEntropy is a reliable, software based random number - generator that uses the randomness of CPU jitter to produce - cryptographically secure random numbers, ensuring robust security in - systems that rely on high-quality entropy for encryption and other - sensitive operations. - supplier: 'Organization: Broadcom, Inc.' -- archive: efa_linux_3.1.0.tar.gz - archive_sha512sum: - 0407d1cd62652831d557969e741537576ff8aef716d98c2a27e24c38359b27d7ece51f2033d99fbd30fdace89f2c4a2d4fb8756b26e98aeca1a1a3b41f9c13be - skip_validation: true - spdx: - package: - detailed_description: AWS Linux kernel drivers for Elastic Fabric - Adapter(EFA). Elastic Fabric Adapter (EFA) is a network device that - provides reliable userspace communication and kernel bypass - capabilities, targeting more consistent latency and higher throughput - than traditional TCP-based communication. - home_page: https://github.com/amzn/amzn-drivers - license_concluded: (BSD-2-Clause OR GPL-2.0-only WITH Linux-syscall-note) - AND (BSD-2-Clause OR GPL-2.0-only) AND (BSD-3-Clause OR GPL-2.0-only) - AND (GPL-2.0-only OR Linux-OpenIB) AND BSD-2-Clause AND BSD-3-Clause AND - GPL-2.0-only AND GPL-2.0-or-later AND Linux-OpenIB AND MIT - license_declared: (BSD-2-Clause OR GPL-2.0-only WITH Linux-syscall-note) - AND (BSD-2-Clause OR GPL-2.0-only) AND (BSD-3-Clause OR GPL-2.0-only) - AND (GPL-2.0-only OR Linux-OpenIB) AND BSD-2-Clause AND BSD-3-Clause AND - GPL-2.0-only AND GPL-2.0-or-later AND Linux-OpenIB AND MIT - short_summary: The open source linux kernel drivers for devices(EFA) used - on AWS platforms. - supplier: 'Organization: Broadcom, Inc.' -- archive: ena_linux_2.17.0.tar.gz - archive_sha512sum: - 5273dc9f92d554791d02362686c4cfd9898ec60b677d0168b73da369d956b391de4183292c42296bf8f7fa70ae1acb66d78842e9239037caf100a1bc9cd1ebeb - skip_validation: true - spdx: - package: - detailed_description: AWS Linux kernel drivers for Elastic Network - Adapter(ENA). ENA is a networking interface designed to make good use of - modern CPU features and system architectures. The ENA device exposes a - lightweight management interface with a minimal set of memory mapped - registers and extendible command set through an Admin Queue. - home_page: https://github.com/amzn/amzn-drivers - license_concluded: (BSD-2-Clause OR GPL-2.0-only WITH Linux-syscall-note) - AND (BSD-2-Clause OR GPL-2.0-only) AND (BSD-3-Clause OR GPL-2.0-only) - AND (GPL-2.0-only OR Linux-OpenIB) AND BSD-2-Clause AND BSD-3-Clause AND - GPL-2.0-only AND GPL-2.0-or-later AND Linux-OpenIB AND MIT - license_declared: (BSD-2-Clause OR GPL-2.0-only WITH Linux-syscall-note) - AND (BSD-2-Clause OR GPL-2.0-only) AND (BSD-3-Clause OR GPL-2.0-only) - AND (GPL-2.0-only OR Linux-OpenIB) AND BSD-2-Clause AND BSD-3-Clause AND - GPL-2.0-only AND GPL-2.0-or-later AND Linux-OpenIB AND MIT - short_summary: The open source linux kernel drivers for devices(ENA) used - on AWS platforms. - supplier: 'Organization: Broadcom, Inc.' diff --git a/SPECS/91/linux/config_aarch64 b/SPECS/91/linux/config_aarch64 deleted file mode 100644 index c88636534e..0000000000 --- a/SPECS/91/linux/config_aarch64 +++ /dev/null @@ -1,8076 +0,0 @@ -# -### Automatically generated file; DO NOT EDIT. -# -CONFIG_CC_VERSION_TEXT="gcc (GCC) 12.2.0" -CONFIG_CC_IS_GCC=y -CONFIG_GCC_VERSION=120200 -CONFIG_CLANG_VERSION=0 -CONFIG_AS_IS_GNU=y -CONFIG_AS_VERSION=23900 -CONFIG_LD_IS_BFD=y -CONFIG_LD_VERSION=23900 -CONFIG_LLD_VERSION=0 -CONFIG_RUSTC_VERSION=0 -CONFIG_RUSTC_LLVM_VERSION=0 -CONFIG_CC_CAN_LINK=y -CONFIG_CC_CAN_LINK_STATIC=y -CONFIG_GCC_ASM_GOTO_OUTPUT_BROKEN=y -CONFIG_CC_HAS_ASM_INLINE=y -CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y -CONFIG_LD_CAN_USE_KEEP_IN_OVERLAY=y -CONFIG_PAHOLE_VERSION=124 -CONFIG_IRQ_WORK=y -CONFIG_BUILDTIME_TABLE_SORT=y -CONFIG_THREAD_INFO_IN_TASK=y - -# General setup -CONFIG_INIT_ENV_ARG_LIMIT=32 -# CONFIG_COMPILE_TEST is not set -# CONFIG_WERROR is not set -CONFIG_LOCALVERSION="" -# CONFIG_LOCALVERSION_AUTO is not set -CONFIG_BUILD_SALT="" -CONFIG_DEFAULT_INIT="" -CONFIG_DEFAULT_HOSTNAME="" -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -CONFIG_SYSVIPC_COMPAT=y -CONFIG_POSIX_MQUEUE=y -CONFIG_POSIX_MQUEUE_SYSCTL=y -# CONFIG_WATCH_QUEUE is not set -CONFIG_CROSS_MEMORY_ATTACH=y -CONFIG_USELIB=y -CONFIG_AUDIT=y -CONFIG_HAVE_ARCH_AUDITSYSCALL=y -CONFIG_AUDITSYSCALL=y - -# IRQ subsystem -CONFIG_GENERIC_IRQ_PROBE=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y -CONFIG_GENERIC_IRQ_MIGRATION=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_GENERIC_IRQ_CHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_IRQ_FASTEOI_HIERARCHY_HANDLERS=y -CONFIG_GENERIC_IRQ_IPI=y -CONFIG_GENERIC_MSI_IRQ=y -CONFIG_IRQ_MSI_IOMMU=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_SPARSE_IRQ=y -# CONFIG_GENERIC_IRQ_DEBUGFS is not set -CONFIG_GENERIC_IRQ_KEXEC_CLEAR_VM_FORWARD=y -# end of IRQ subsystem - -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_ARCH_HAS_TICK_BROADCAST=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y -CONFIG_HAVE_POSIX_CPU_TIMERS_TASK_WORK=y -CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y -CONFIG_CONTEXT_TRACKING=y -CONFIG_CONTEXT_TRACKING_IDLE=y - -# Timers subsystem -CONFIG_TICK_ONESHOT=y -CONFIG_NO_HZ_COMMON=y -# CONFIG_HZ_PERIODIC is not set -CONFIG_NO_HZ_IDLE=y -# CONFIG_NO_HZ_FULL is not set -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y -# end of Timers subsystem - -CONFIG_BPF=y -CONFIG_HAVE_EBPF_JIT=y -CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y - -# BPF subsystem -CONFIG_BPF_SYSCALL=y -CONFIG_BPF_JIT=y -# CONFIG_BPF_JIT_ALWAYS_ON is not set -CONFIG_BPF_JIT_DEFAULT_ON=y -CONFIG_BPF_UNPRIV_DEFAULT_OFF=y -# CONFIG_BPF_PRELOAD is not set -# CONFIG_BPF_LSM is not set -# end of BPF subsystem - -CONFIG_PREEMPT_BUILD=y -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -# CONFIG_PREEMPT_RT is not set -CONFIG_PREEMPT_COUNT=y -CONFIG_PREEMPTION=y -CONFIG_PREEMPT_DYNAMIC=y -CONFIG_SCHED_CORE=y -# CONFIG_SCHED_CLASS_EXT is not set - -# CPU/Task time and stats accounting -CONFIG_TICK_CPU_ACCOUNTING=y -# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set -# CONFIG_IRQ_TIME_ACCOUNTING is not set -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_BSD_PROCESS_ACCT_V3=y -CONFIG_TASKSTATS=y -CONFIG_TASK_DELAY_ACCT=y -CONFIG_TASK_XACCT=y -CONFIG_TASK_IO_ACCOUNTING=y -CONFIG_PSI=y -CONFIG_PSI_DEFAULT_DISABLED=y -# end of CPU/Task time and stats accounting - -CONFIG_CPU_ISOLATION=y - -# RCU Subsystem -CONFIG_TREE_RCU=y -CONFIG_PREEMPT_RCU=y -# CONFIG_RCU_EXPERT is not set -CONFIG_TREE_SRCU=y -CONFIG_TASKS_RCU_GENERIC=y -CONFIG_NEED_TASKS_RCU=y -CONFIG_TASKS_RCU=y -CONFIG_TASKS_RUDE_RCU=y -CONFIG_TASKS_TRACE_RCU=y -CONFIG_RCU_STALL_COMMON=y -CONFIG_RCU_NEED_SEGCBLIST=y -# end of RCU Subsystem - -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_IKHEADERS=m -CONFIG_LOG_BUF_SHIFT=18 -CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 -CONFIG_PRINTK_INDEX=y -CONFIG_GENERIC_SCHED_CLOCK=y - -# Scheduler features -# end of Scheduler features - -CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y -CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y -CONFIG_CC_HAS_INT128=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_GCC10_NO_ARRAY_BOUNDS=y -CONFIG_CC_NO_ARRAY_BOUNDS=y -CONFIG_GCC_NO_STRINGOP_OVERFLOW=y -CONFIG_CC_NO_STRINGOP_OVERFLOW=y -CONFIG_ARCH_SUPPORTS_INT128=y -# CONFIG_NUMA_BALANCING is not set -CONFIG_SLAB_OBJ_EXT=y -CONFIG_CGROUPS=y -CONFIG_PAGE_COUNTER=y -# CONFIG_CGROUP_FAVOR_DYNMODS is not set -CONFIG_MEMCG=y -CONFIG_MEMCG_V1=y -CONFIG_BLK_CGROUP=y -CONFIG_CGROUP_WRITEBACK=y -CONFIG_CGROUP_SCHED=y -CONFIG_GROUP_SCHED_WEIGHT=y -CONFIG_FAIR_GROUP_SCHED=y -CONFIG_CFS_BANDWIDTH=y -# CONFIG_RT_GROUP_SCHED is not set -CONFIG_SCHED_MM_CID=y -CONFIG_CGROUP_PIDS=y -CONFIG_CGROUP_RDMA=y -CONFIG_CGROUP_FREEZER=y -CONFIG_CGROUP_HUGETLB=y -CONFIG_CPUSETS=y -CONFIG_CPUSETS_V1=y -CONFIG_PROC_PID_CPUSET=y -CONFIG_CGROUP_DEVICE=y -CONFIG_CGROUP_CPUACCT=y -CONFIG_CGROUP_PERF=y -CONFIG_CGROUP_BPF=y -CONFIG_CGROUP_MISC=y -# CONFIG_CGROUP_DEBUG is not set -CONFIG_SOCK_CGROUP_DATA=y -CONFIG_NAMESPACES=y -CONFIG_UTS_NS=y -CONFIG_TIME_NS=y -CONFIG_IPC_NS=y -CONFIG_USER_NS=y -CONFIG_PID_NS=y -CONFIG_NET_NS=y -# CONFIG_CHECKPOINT_RESTORE is not set -# CONFIG_SCHED_AUTOGROUP is not set -CONFIG_RELAY=y -CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_RD_GZIP=y -CONFIG_RD_BZIP2=y -CONFIG_RD_LZMA=y -CONFIG_RD_XZ=y -CONFIG_RD_LZO=y -CONFIG_RD_LZ4=y -CONFIG_RD_ZSTD=y -# CONFIG_BOOT_CONFIG is not set -CONFIG_INITRAMFS_PRESERVE_MTIME=y -CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_LD_ORPHAN_WARN=y -CONFIG_LD_ORPHAN_WARN_LEVEL="warn" -CONFIG_SYSCTL=y -CONFIG_HAVE_UID16=y -CONFIG_SYSCTL_EXCEPTION_TRACE=y -CONFIG_EXPERT=y -# CONFIG_UID16 is not set -CONFIG_MULTIUSER=y -CONFIG_SGETMASK_SYSCALL=y -CONFIG_SYSFS_SYSCALL=y -CONFIG_FHANDLE=y -CONFIG_POSIX_TIMERS=y -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -# CONFIG_BASE_SMALL is not set -CONFIG_FUTEX=y -CONFIG_FUTEX_PI=y -CONFIG_EPOLL=y -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -CONFIG_SHMEM=y -CONFIG_AIO=y -CONFIG_IO_URING=y -CONFIG_ADVISE_SYSCALLS=y -CONFIG_MEMBARRIER=y -CONFIG_KCMP=y -CONFIG_RSEQ=y -# CONFIG_DEBUG_RSEQ is not set -CONFIG_CACHESTAT_SYSCALL=y -# CONFIG_PC104 is not set -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_SELFTEST is not set -CONFIG_KALLSYMS_ALL=y -CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_GUEST_PERF_EVENTS=y - -# Kernel Performance Events And Counters -CONFIG_PERF_EVENTS=y -# CONFIG_DEBUG_PERF_USE_VMALLOC is not set -# end of Kernel Performance Events And Counters - -CONFIG_SYSTEM_DATA_VERIFICATION=y -CONFIG_PROFILING=y -CONFIG_TRACEPOINTS=y - -# Kexec and crash features -CONFIG_CRASH_RESERVE=y -CONFIG_VMCORE_INFO=y -CONFIG_KEXEC_CORE=y -CONFIG_HAVE_IMA_KEXEC=y -CONFIG_KEXEC=y -CONFIG_KEXEC_FILE=y -CONFIG_KEXEC_SIG=y -CONFIG_KEXEC_IMAGE_VERIFY_SIG=y -CONFIG_CRASH_DUMP=y -# end of Kexec and crash features -# end of General setup - -CONFIG_ARM64=y -CONFIG_RUSTC_SUPPORTS_ARM64=y -CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y -CONFIG_64BIT=y -CONFIG_MMU=y -CONFIG_ARM64_CONT_PTE_SHIFT=4 -CONFIG_ARM64_CONT_PMD_SHIFT=4 -CONFIG_ARCH_MMAP_RND_BITS_MIN=18 -CONFIG_ARCH_MMAP_RND_BITS_MAX=33 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CSUM=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_SMP=y -CONFIG_KERNEL_MODE_NEON=y -CONFIG_FIX_EARLYCON_MEM=y -CONFIG_PGTABLE_LEVELS=4 -CONFIG_ARCH_SUPPORTS_UPROBES=y -CONFIG_ARCH_PROC_KCORE_TEXT=y -CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y - -# Platform selection -# CONFIG_ARCH_ACTIONS is not set -# CONFIG_ARCH_AIROHA is not set -CONFIG_ARCH_SUNXI=y -# CONFIG_ARCH_ALPINE is not set -# CONFIG_ARCH_APPLE is not set -CONFIG_ARCH_BCM=y -CONFIG_ARCH_BCM2835=y -CONFIG_ARCH_BCM_IPROC=y -# CONFIG_ARCH_BCMBCA is not set -# CONFIG_ARCH_BRCMSTB is not set -CONFIG_ARCH_BERLIN=y -# CONFIG_ARCH_BITMAIN is not set -CONFIG_ARCH_EXYNOS=y -# CONFIG_ARCH_SPARX5 is not set -# CONFIG_ARCH_K3 is not set -CONFIG_ARCH_LG1K=y -CONFIG_ARCH_HISI=y -# CONFIG_ARCH_KEEMBAY is not set -CONFIG_ARCH_MEDIATEK=y -CONFIG_ARCH_MESON=y -CONFIG_ARCH_MVEBU=y -# CONFIG_ARCH_NXP is not set -# CONFIG_ARCH_MA35 is not set -# CONFIG_ARCH_NPCM is not set -# CONFIG_ARCH_PENSANDO is not set -CONFIG_ARCH_QCOM=y -# CONFIG_ARCH_REALTEK is not set -# CONFIG_ARCH_RENESAS is not set -CONFIG_ARCH_ROCKCHIP=y -CONFIG_ARCH_SEATTLE=y -# CONFIG_ARCH_INTEL_SOCFPGA is not set -# CONFIG_ARCH_STM32 is not set -# CONFIG_ARCH_SYNQUACER is not set -CONFIG_ARCH_TEGRA=y -# CONFIG_ARCH_TESLA_FSD is not set -CONFIG_ARCH_SPRD=y -CONFIG_ARCH_THUNDER=y -# CONFIG_ARCH_THUNDER2 is not set -# CONFIG_ARCH_UNIPHIER is not set -CONFIG_ARCH_VEXPRESS=y -# CONFIG_ARCH_VISCONTI is not set -CONFIG_ARCH_XGENE=y -CONFIG_ARCH_ZYNQMP=y -# end of Platform selection - -# Kernel Features - -# ARM errata workarounds via the alternatives framework -CONFIG_AMPERE_ERRATUM_AC03_CPU_38=y -CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y -CONFIG_ARM64_ERRATUM_826319=y -CONFIG_ARM64_ERRATUM_827319=y -CONFIG_ARM64_ERRATUM_824069=y -CONFIG_ARM64_ERRATUM_819472=y -CONFIG_ARM64_ERRATUM_832075=y -CONFIG_ARM64_ERRATUM_834220=y -CONFIG_ARM64_ERRATUM_1742098=y -CONFIG_ARM64_ERRATUM_845719=y -CONFIG_ARM64_ERRATUM_843419=y -CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y -CONFIG_ARM64_ERRATUM_1024718=y -CONFIG_ARM64_ERRATUM_1418040=y -CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT=y -CONFIG_ARM64_ERRATUM_1165522=y -CONFIG_ARM64_ERRATUM_1319367=y -CONFIG_ARM64_ERRATUM_1530923=y -CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y -CONFIG_ARM64_ERRATUM_2441007=y -CONFIG_ARM64_ERRATUM_1286807=y -CONFIG_ARM64_ERRATUM_1463225=y -CONFIG_ARM64_ERRATUM_1542419=y -CONFIG_ARM64_ERRATUM_1508412=y -CONFIG_ARM64_ERRATUM_2051678=y -CONFIG_ARM64_ERRATUM_2077057=y -CONFIG_ARM64_ERRATUM_2658417=y -CONFIG_ARM64_WORKAROUND_TSB_FLUSH_FAILURE=y -CONFIG_ARM64_ERRATUM_2054223=y -CONFIG_ARM64_ERRATUM_2067961=y -CONFIG_ARM64_ERRATUM_2441009=y -CONFIG_ARM64_ERRATUM_2457168=y -CONFIG_ARM64_ERRATUM_2645198=y -CONFIG_ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD=y -CONFIG_ARM64_ERRATUM_2966298=y -CONFIG_ARM64_ERRATUM_3117295=y -CONFIG_ARM64_ERRATUM_3194386=y -CONFIG_ARM64_ERRATUM_4118414=y -CONFIG_CAVIUM_ERRATUM_22375=y -CONFIG_CAVIUM_ERRATUM_23144=y -# CONFIG_CAVIUM_ERRATUM_23154 is not set -CONFIG_CAVIUM_ERRATUM_27456=y -CONFIG_CAVIUM_ERRATUM_30115=y -CONFIG_CAVIUM_TX2_ERRATUM_219=y -CONFIG_FUJITSU_ERRATUM_010001=y -CONFIG_HISILICON_ERRATUM_161600802=y -CONFIG_HISILICON_ERRATUM_162100801=y -CONFIG_QCOM_FALKOR_ERRATUM_1003=y -CONFIG_QCOM_FALKOR_ERRATUM_1009=y -CONFIG_QCOM_QDF2400_ERRATUM_0065=y -CONFIG_QCOM_FALKOR_ERRATUM_E1041=y -CONFIG_NVIDIA_CARMEL_CNP_ERRATUM=y -CONFIG_ROCKCHIP_ERRATUM_3588001=y -CONFIG_SOCIONEXT_SYNQUACER_PREITS=y -# end of ARM errata workarounds via the alternatives framework - -CONFIG_ARM64_4K_PAGES=y -# CONFIG_ARM64_16K_PAGES is not set -# CONFIG_ARM64_64K_PAGES is not set -# CONFIG_ARM64_VA_BITS_39 is not set -CONFIG_ARM64_VA_BITS_48=y -# CONFIG_ARM64_VA_BITS_52 is not set -CONFIG_ARM64_VA_BITS=48 -CONFIG_ARM64_PA_BITS_48=y -CONFIG_ARM64_PA_BITS=48 -# CONFIG_CPU_BIG_ENDIAN is not set -CONFIG_CPU_LITTLE_ENDIAN=y -CONFIG_SCHED_MC=y -# CONFIG_SCHED_CLUSTER is not set -CONFIG_SCHED_SMT=y -CONFIG_NR_CPUS=128 -CONFIG_HOTPLUG_CPU=y -CONFIG_NUMA=y -CONFIG_NODES_SHIFT=1 -# CONFIG_HZ_100 is not set -CONFIG_HZ_250=y -# CONFIG_HZ_300 is not set -# CONFIG_HZ_1000 is not set -CONFIG_HZ=250 -CONFIG_SCHED_HRTICK=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_HW_PERF_EVENTS=y -CONFIG_CC_HAVE_SHADOW_CALL_STACK=y -CONFIG_PARAVIRT=y -# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set -CONFIG_ARCH_SUPPORTS_KEXEC=y -CONFIG_ARCH_SUPPORTS_KEXEC_FILE=y -CONFIG_ARCH_SELECTS_KEXEC_FILE=y -CONFIG_ARCH_SUPPORTS_KEXEC_SIG=y -CONFIG_ARCH_SUPPORTS_KEXEC_IMAGE_VERIFY_SIG=y -CONFIG_ARCH_DEFAULT_KEXEC_IMAGE_VERIFY_SIG=y -CONFIG_ARCH_SUPPORTS_CRASH_DUMP=y -CONFIG_ARCH_DEFAULT_CRASH_DUMP=y -CONFIG_ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION=y -CONFIG_TRANS_TABLE=y -CONFIG_HYPERVISOR_GUEST=y -CONFIG_XEN_DOM0=y -CONFIG_XEN=y -CONFIG_ARCH_FORCE_MAX_ORDER=10 -CONFIG_UNMAP_KERNEL_AT_EL0=y -CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY=y -CONFIG_RODATA_FULL_DEFAULT_ENABLED=y -# CONFIG_ARM64_SW_TTBR0_PAN is not set -CONFIG_ARM64_TAGGED_ADDR_ABI=y -CONFIG_COMPAT=y -CONFIG_KUSER_HELPERS=y -# CONFIG_COMPAT_ALIGNMENT_FIXUPS is not set -CONFIG_ARMV8_DEPRECATED=y -CONFIG_SWP_EMULATION=y -CONFIG_CP15_BARRIER_EMULATION=y -CONFIG_SETEND_EMULATION=y - -# ARMv8.1 architectural features -CONFIG_ARM64_HW_AFDBM=y -CONFIG_ARM64_PAN=y -CONFIG_AS_HAS_LSE_ATOMICS=y -CONFIG_ARM64_LSE_ATOMICS=y -CONFIG_ARM64_USE_LSE_ATOMICS=y -# end of ARMv8.1 architectural features - -# ARMv8.2 architectural features -CONFIG_AS_HAS_ARMV8_2=y -CONFIG_AS_HAS_SHA3=y -CONFIG_ARM64_PMEM=y -CONFIG_ARM64_RAS_EXTN=y -CONFIG_ARM64_CNP=y -# end of ARMv8.2 architectural features - -# ARMv8.3 architectural features -CONFIG_ARM64_PTR_AUTH=y -CONFIG_ARM64_PTR_AUTH_KERNEL=y -CONFIG_CC_HAS_BRANCH_PROT_PAC_RET=y -CONFIG_CC_HAS_SIGN_RETURN_ADDRESS=y -CONFIG_AS_HAS_ARMV8_3=y -CONFIG_AS_HAS_CFI_NEGATE_RA_STATE=y -CONFIG_AS_HAS_LDAPR=y -# end of ARMv8.3 architectural features - -# ARMv8.4 architectural features -CONFIG_ARM64_AMU_EXTN=y -CONFIG_AS_HAS_ARMV8_4=y -CONFIG_ARM64_TLB_RANGE=y -# end of ARMv8.4 architectural features - -# ARMv8.5 architectural features -CONFIG_AS_HAS_ARMV8_5=y -CONFIG_ARM64_BTI=y -CONFIG_CC_HAS_BRANCH_PROT_PAC_RET_BTI=y -CONFIG_ARM64_E0PD=y -CONFIG_ARM64_AS_HAS_MTE=y -CONFIG_ARM64_MTE=y -# end of ARMv8.5 architectural features - -# ARMv8.7 architectural features -CONFIG_ARM64_EPAN=y -# end of ARMv8.7 architectural features - -# ARMv8.9 architectural features -CONFIG_ARM64_POE=y -CONFIG_ARCH_PKEY_BITS=3 -# end of ARMv8.9 architectural features - -CONFIG_ARM64_SVE=y -CONFIG_ARM64_PSEUDO_NMI=y -# CONFIG_ARM64_DEBUG_PRIORITY_MASKING is not set -CONFIG_RELOCATABLE=y -CONFIG_RANDOMIZE_BASE=y -CONFIG_RANDOMIZE_MODULE_REGION_FULL=y -CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_STACKPROTECTOR_PER_TASK=y -CONFIG_ARM64_CONTPTE=y -# end of Kernel Features - -# Boot options -CONFIG_ARM64_ACPI_PARKING_PROTOCOL=y -CONFIG_CMDLINE="" -CONFIG_EFI_STUB=y -CONFIG_EFI=y -# CONFIG_COMPRESSED_INSTALL is not set -CONFIG_DMI=y -# end of Boot options - -# Power management options -CONFIG_SUSPEND=y -CONFIG_SUSPEND_FREEZER=y -# CONFIG_SUSPEND_SKIP_SYNC is not set -CONFIG_HIBERNATE_CALLBACKS=y -CONFIG_HIBERNATION=y -CONFIG_HIBERNATION_SNAPSHOT_DEV=y -CONFIG_HIBERNATION_COMP_LZO=y -CONFIG_HIBERNATION_DEF_COMP="lzo" -CONFIG_PM_STD_PARTITION="" -CONFIG_PM_SLEEP=y -CONFIG_PM_SLEEP_SMP=y -# CONFIG_PM_AUTOSLEEP is not set -# CONFIG_PM_USERSPACE_AUTOSLEEP is not set -# CONFIG_PM_WAKELOCKS is not set -CONFIG_PM=y -# CONFIG_PM_DEBUG is not set -CONFIG_PM_CLK=y -CONFIG_PM_GENERIC_DOMAINS=y -# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set -CONFIG_PM_GENERIC_DOMAINS_SLEEP=y -CONFIG_PM_GENERIC_DOMAINS_OF=y -CONFIG_CPU_PM=y -CONFIG_ENERGY_MODEL=y -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_HIBERNATION_HEADER=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -# end of Power management options - -# CPU Power Management - -# CPU Idle -CONFIG_CPU_IDLE=y -CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y -CONFIG_CPU_IDLE_GOV_LADDER=y -CONFIG_CPU_IDLE_GOV_MENU=y -CONFIG_CPU_IDLE_GOV_TEO=y -CONFIG_DT_IDLE_STATES=y -CONFIG_DT_IDLE_GENPD=y - -# ARM CPU Idle Drivers -CONFIG_ARM_PSCI_CPUIDLE=y -CONFIG_ARM_PSCI_CPUIDLE_DOMAIN=y -# end of ARM CPU Idle Drivers -# end of CPU Idle - -# CPU Frequency scaling -CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_GOV_ATTR_SET=y -CONFIG_CPU_FREQ_GOV_COMMON=y -CONFIG_CPU_FREQ_STAT=y -CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set -CONFIG_CPU_FREQ_GOV_PERFORMANCE=y -CONFIG_CPU_FREQ_GOV_POWERSAVE=m -CONFIG_CPU_FREQ_GOV_USERSPACE=m -CONFIG_CPU_FREQ_GOV_ONDEMAND=m -CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m -# CONFIG_CPU_FREQ_GOV_SCHEDUTIL is not set - -## CPU frequency scaling drivers -CONFIG_CPUFREQ_DT=m -CONFIG_CPUFREQ_DT_PLATDEV=y -# CONFIG_ARM_ARMADA_37XX_CPUFREQ is not set -# CONFIG_ARM_ARMADA_8K_CPUFREQ is not set -# CONFIG_ARM_MEDIATEK_CPUFREQ is not set -CONFIG_ARM_MEDIATEK_CPUFREQ_HW=m -# CONFIG_ARM_QCOM_CPUFREQ_HW is not set -CONFIG_ARM_RASPBERRYPI_CPUFREQ=m -CONFIG_ARM_SCMI_CPUFREQ=m -CONFIG_ARM_TEGRA20_CPUFREQ=m -CONFIG_ARM_TEGRA124_CPUFREQ=y -CONFIG_ACPI_CPPC_CPUFREQ=m -CONFIG_ACPI_CPPC_CPUFREQ_FIE=y -# end of CPU Frequency scaling -# end of CPU Power Management - -CONFIG_ARCH_SUPPORTS_ACPI=y -CONFIG_ACPI=y -CONFIG_ACPI_GENERIC_GSI=y -CONFIG_ACPI_CCA_REQUIRED=y -CONFIG_ACPI_THERMAL_LIB=y -# CONFIG_ACPI_DEBUGGER is not set -CONFIG_ACPI_SPCR_TABLE=y -# CONFIG_ACPI_FPDT is not set -# CONFIG_ACPI_EC_DEBUGFS is not set -CONFIG_ACPI_AC=m -CONFIG_ACPI_BATTERY=m -CONFIG_ACPI_BUTTON=m -# CONFIG_ACPI_TINY_POWER_BUTTON is not set -# CONFIG_ACPI_VIDEO is not set -CONFIG_ACPI_FAN=m -# CONFIG_ACPI_TAD is not set -# CONFIG_ACPI_DOCK is not set -CONFIG_ACPI_PROCESSOR_IDLE=y -CONFIG_ACPI_MCFG=y -CONFIG_ACPI_CPPC_LIB=y -CONFIG_ACPI_PROCESSOR=y -CONFIG_ACPI_IPMI=m -CONFIG_ACPI_HOTPLUG_CPU=y -CONFIG_ACPI_THERMAL=m -CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y -CONFIG_ACPI_TABLE_UPGRADE=y -# CONFIG_ACPI_DEBUG is not set -CONFIG_ACPI_PCI_SLOT=y -CONFIG_ACPI_CONTAINER=y -CONFIG_ACPI_HED=y -# CONFIG_ACPI_BGRT is not set -CONFIG_ACPI_REDUCED_HARDWARE_ONLY=y -CONFIG_ACPI_NHLT=y -CONFIG_ACPI_NFIT=m -# CONFIG_NFIT_SECURITY_DEBUG is not set -CONFIG_ACPI_NUMA=y -# CONFIG_ACPI_HMAT is not set -CONFIG_HAVE_ACPI_APEI=y -# CONFIG_ACPI_APEI is not set -CONFIG_ACPI_CONFIGFS=m -# CONFIG_ACPI_PFRUT is not set -CONFIG_ACPI_IORT=y -CONFIG_ACPI_GTDT=y -CONFIG_ACPI_APMT=y -CONFIG_ACPI_PPTT=y -CONFIG_ACPI_PCC=y -# CONFIG_ACPI_FFH is not set -CONFIG_PMIC_OPREGION=y -CONFIG_ACPI_PRMT=y -CONFIG_KVM_COMMON=y -CONFIG_HAVE_KVM_IRQCHIP=y -CONFIG_HAVE_KVM_IRQ_ROUTING=y -CONFIG_HAVE_KVM_DIRTY_RING=y -CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL=y -CONFIG_NEED_KVM_DIRTY_RING_WITH_BITMAP=y -CONFIG_KVM_MMIO=y -CONFIG_HAVE_KVM_MSI=y -CONFIG_HAVE_KVM_READONLY_MEM=y -CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y -CONFIG_KVM_VFIO=y -CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y -CONFIG_HAVE_KVM_IRQ_BYPASS=y -CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE=y -CONFIG_KVM_XFER_TO_GUEST_WORK=y -CONFIG_KVM_GENERIC_HARDWARE_ENABLING=y -CONFIG_KVM_GENERIC_MMU_NOTIFIER=y -CONFIG_VIRTUALIZATION=y -CONFIG_KVM=y -# CONFIG_NVHE_EL2_DEBUG is not set -# CONFIG_PTDUMP_STAGE2_DEBUGFS is not set -CONFIG_CPU_MITIGATIONS=y -CONFIG_ARCH_HAS_DMA_OPS=y - -# General architecture-dependent options -CONFIG_ARCH_HAS_SUBPAGE_FAULTS=y -CONFIG_HOTPLUG_CORE_SYNC=y -CONFIG_HOTPLUG_CORE_SYNC_DEAD=y -CONFIG_KPROBES=y -CONFIG_JUMP_LABEL=y -# CONFIG_STATIC_KEYS_SELFTEST is not set -CONFIG_UPROBES=y -CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -CONFIG_KRETPROBES=y -CONFIG_HAVE_IOREMAP_PROT=y -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y -CONFIG_HAVE_FUNCTION_ERROR_INJECTION=y -CONFIG_HAVE_NMI=y -CONFIG_TRACE_IRQFLAGS_SUPPORT=y -CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_ARCH_HAS_FORTIFY_SOURCE=y -CONFIG_ARCH_HAS_KEEPINITRD=y -CONFIG_ARCH_HAS_SET_MEMORY=y -CONFIG_ARCH_HAS_SET_DIRECT_MAP=y -CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y -CONFIG_ARCH_WANTS_NO_INSTR=y -CONFIG_HAVE_ASM_MODVERSIONS=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_RSEQ=y -CONFIG_HAVE_RUST=y -CONFIG_HAVE_FUNCTION_ARG_ACCESS_API=y -CONFIG_HAVE_HW_BREAKPOINT=y -CONFIG_HAVE_PERF_EVENTS_NMI=y -CONFIG_HAVE_HARDLOCKUP_DETECTOR_PERF=y -CONFIG_HAVE_PERF_REGS=y -CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y -CONFIG_MMU_GATHER_TABLE_FREE=y -CONFIG_MMU_GATHER_RCU_TABLE_FREE=y -CONFIG_MMU_LAZY_TLB_REFCOUNT=y -CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y -CONFIG_ARCH_HAS_NMI_SAFE_THIS_CPU_OPS=y -CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y -CONFIG_HAVE_CMPXCHG_LOCAL=y -CONFIG_HAVE_CMPXCHG_DOUBLE=y -CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y -CONFIG_HAVE_ARCH_SECCOMP=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_SECCOMP=y -CONFIG_SECCOMP_FILTER=y -# CONFIG_SECCOMP_CACHE_DEBUG is not set -CONFIG_HAVE_ARCH_STACKLEAK=y -CONFIG_HAVE_STACKPROTECTOR=y -CONFIG_STACKPROTECTOR=y -# CONFIG_STACKPROTECTOR_STRONG is not set -CONFIG_ARCH_SUPPORTS_SHADOW_CALL_STACK=y -# CONFIG_SHADOW_CALL_STACK is not set -CONFIG_ARCH_SUPPORTS_LTO_CLANG=y -CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN=y -CONFIG_LTO_NONE=y -CONFIG_ARCH_SUPPORTS_CFI_CLANG=y -# CONFIG_CFI_CLANG is not set -CONFIG_HAVE_CONTEXT_TRACKING_USER=y -CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_MOVE_PUD=y -CONFIG_HAVE_MOVE_PMD=y -CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y -CONFIG_HAVE_ARCH_HUGE_VMAP=y -CONFIG_HAVE_ARCH_HUGE_VMALLOC=y -CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y -CONFIG_ARCH_WANT_PMD_MKWRITE=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_MODULES_USE_ELF_RELA=y -CONFIG_ARCH_WANTS_EXECMEM_LATE=y -CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK=y -CONFIG_SOFTIRQ_ON_OWN_STACK=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -CONFIG_HAVE_ARCH_MMAP_RND_BITS=y -CONFIG_ARCH_MMAP_RND_BITS=18 -CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y -CONFIG_ARCH_MMAP_RND_COMPAT_BITS=11 -CONFIG_HAVE_PAGE_SIZE_4KB=y -CONFIG_PAGE_SIZE_4KB=y -CONFIG_PAGE_SIZE_LESS_THAN_64KB=y -CONFIG_PAGE_SIZE_LESS_THAN_256KB=y -CONFIG_PAGE_SHIFT=12 -CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_OLD_SIGSUSPEND3=y -CONFIG_COMPAT_OLD_SIGACTION=y -CONFIG_COMPAT_32BIT_TIME=y -CONFIG_ARCH_SUPPORTS_RT=y -CONFIG_HAVE_ARCH_VMAP_STACK=y -CONFIG_VMAP_STACK=y -CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET=y -CONFIG_RANDOMIZE_KSTACK_OFFSET=y -# CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT is not set -CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y -CONFIG_STRICT_KERNEL_RWX=y -CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y -CONFIG_STRICT_MODULE_RWX=y -CONFIG_HAVE_ARCH_COMPILER_H=y -CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y -CONFIG_ARCH_USE_MEMREMAP_PROT=y -# CONFIG_LOCK_EVENT_COUNTS is not set -CONFIG_ARCH_HAS_RELR=y -CONFIG_ARCH_HAS_MEM_ENCRYPT=y -CONFIG_HAVE_PREEMPT_DYNAMIC=y -CONFIG_HAVE_PREEMPT_DYNAMIC_KEY=y -CONFIG_ARCH_WANT_LD_ORPHAN_WARN=y -CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y -CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK=y -CONFIG_ARCH_HAVE_TRACE_MMIO_ACCESS=y -CONFIG_ARCH_HAS_HW_PTE_YOUNG=y -CONFIG_ARCH_HAS_KERNEL_FPU_SUPPORT=y - -# GCOV-based kernel profiling -# CONFIG_GCOV_KERNEL is not set -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -# end of GCOV-based kernel profiling - -CONFIG_HAVE_GCC_PLUGINS=y -CONFIG_GCC_PLUGINS=y -# CONFIG_GCC_PLUGIN_LATENT_ENTROPY is not set -CONFIG_FUNCTION_ALIGNMENT_4B=y -CONFIG_FUNCTION_ALIGNMENT_8B=y -CONFIG_FUNCTION_ALIGNMENT=8 -CONFIG_HAVE_ARCH_GET_SECUREBOOT=y -# end of General architecture-dependent options - -CONFIG_RT_MUTEXES=y -CONFIG_MODULE_SIG_FORMAT=y -CONFIG_MODULES=y -# CONFIG_MODULE_DEBUG is not set -CONFIG_MODULE_FORCE_LOAD=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -# CONFIG_MODULE_UNLOAD_TAINT_TRACKING is not set -CONFIG_MODVERSIONS=y -CONFIG_ASM_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_MODULE_SIG=y -# CONFIG_MODULE_SIG_FORCE is not set -# CONFIG_MODULE_SIG_ALL is not set -# CONFIG_MODULE_SIG_SHA1 is not set -# CONFIG_MODULE_SIG_SHA256 is not set -# CONFIG_MODULE_SIG_SHA384 is not set -# CONFIG_MODULE_SIG_SHA512 is not set -# CONFIG_MODULE_SIG_SHA3_256 is not set -# CONFIG_MODULE_SIG_SHA3_384 is not set -CONFIG_MODULE_SIG_SHA3_512=y -CONFIG_MODULE_SIG_HASH="sha3-512" -# CONFIG_MODULE_COMPRESS is not set -# CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is not set -CONFIG_MODPROBE_PATH="/sbin/modprobe" -# CONFIG_TRIM_UNUSED_KSYMS is not set -CONFIG_MODULES_TREE_LOOKUP=y -CONFIG_BLOCK=y -CONFIG_BLOCK_LEGACY_AUTOLOAD=y -CONFIG_BLK_CGROUP_RWSTAT=y -CONFIG_BLK_CGROUP_PUNT_BIO=y -CONFIG_BLK_DEV_BSG_COMMON=y -CONFIG_BLK_ICQ=y -CONFIG_BLK_DEV_BSGLIB=y -CONFIG_BLK_DEV_INTEGRITY=y -CONFIG_BLK_DEV_WRITE_MOUNTED=y -CONFIG_BLK_DEV_ZONED=y -CONFIG_BLK_DEV_THROTTLING=y -# CONFIG_BLK_WBT is not set -# CONFIG_BLK_CGROUP_IOLATENCY is not set -# CONFIG_BLK_CGROUP_IOCOST is not set -# CONFIG_BLK_CGROUP_IOPRIO is not set -CONFIG_BLK_DEBUG_FS=y -# CONFIG_BLK_SED_OPAL is not set -# CONFIG_BLK_INLINE_ENCRYPTION is not set - -# Partition Types -CONFIG_PARTITION_ADVANCED=y -# CONFIG_ACORN_PARTITION is not set -# CONFIG_AIX_PARTITION is not set -# CONFIG_OSF_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set -# CONFIG_ATARI_PARTITION is not set -# CONFIG_MAC_PARTITION is not set -CONFIG_MSDOS_PARTITION=y -CONFIG_BSD_DISKLABEL=y -CONFIG_MINIX_SUBPARTITION=y -CONFIG_SOLARIS_X86_PARTITION=y -CONFIG_UNIXWARE_DISKLABEL=y -# CONFIG_LDM_PARTITION is not set -# CONFIG_SGI_PARTITION is not set -# CONFIG_ULTRIX_PARTITION is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_KARMA_PARTITION is not set -CONFIG_EFI_PARTITION=y -# CONFIG_SYSV68_PARTITION is not set -# CONFIG_CMDLINE_PARTITION is not set -# end of Partition Types - -CONFIG_BLK_MQ_PCI=y -CONFIG_BLK_MQ_VIRTIO=y -CONFIG_BLK_PM=y -CONFIG_BLOCK_HOLDER_DEPRECATED=y -CONFIG_BLK_MQ_STACKING=y - -# IO Schedulers -CONFIG_MQ_IOSCHED_DEADLINE=y -CONFIG_MQ_IOSCHED_KYBER=y -CONFIG_IOSCHED_BFQ=y -CONFIG_BFQ_GROUP_IOSCHED=y -# CONFIG_BFQ_CGROUP_DEBUG is not set -# end of IO Schedulers - -CONFIG_PREEMPT_NOTIFIERS=y -CONFIG_PADATA=y -CONFIG_ASN1=y -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -CONFIG_MUTEX_SPIN_ON_OWNER=y -CONFIG_RWSEM_SPIN_ON_OWNER=y -CONFIG_LOCK_SPIN_ON_OWNER=y -CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y -CONFIG_QUEUED_SPINLOCKS=y -CONFIG_ARCH_USE_QUEUED_RWLOCKS=y -CONFIG_QUEUED_RWLOCKS=y -CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE=y -CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y -CONFIG_FREEZER=y - -# Executable file formats -CONFIG_BINFMT_ELF=y -CONFIG_COMPAT_BINFMT_ELF=y -CONFIG_ARCH_BINFMT_ELF_STATE=y -CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y -CONFIG_ARCH_HAVE_ELF_PROT=y -CONFIG_ARCH_USE_GNU_PROPERTY=y -CONFIG_ELFCORE=y -CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y -CONFIG_BINFMT_SCRIPT=y -CONFIG_BINFMT_MISC=m -CONFIG_COREDUMP=y -# end of Executable file formats - -# Memory Management options -CONFIG_ZPOOL=y -CONFIG_SWAP=y -CONFIG_ZSWAP=y -# CONFIG_ZSWAP_DEFAULT_ON is not set -# CONFIG_ZSWAP_SHRINKER_DEFAULT_ON is not set -# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_DEFLATE is not set -CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZO=y -# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_842 is not set -# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4 is not set -# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4HC is not set -# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_ZSTD is not set -CONFIG_ZSWAP_COMPRESSOR_DEFAULT="lzo" -CONFIG_ZSWAP_ZPOOL_DEFAULT_ZBUD=y -# CONFIG_ZSWAP_ZPOOL_DEFAULT_Z3FOLD_DEPRECATED is not set -# CONFIG_ZSWAP_ZPOOL_DEFAULT_ZSMALLOC is not set -CONFIG_ZSWAP_ZPOOL_DEFAULT="zbud" -CONFIG_ZBUD=y -# CONFIG_Z3FOLD_DEPRECATED is not set -CONFIG_ZSMALLOC=m -# CONFIG_ZSMALLOC_STAT is not set -CONFIG_ZSMALLOC_CHAIN_SIZE=8 - -# Slab allocator options -CONFIG_SLUB=y -# CONFIG_SLUB_TINY is not set -CONFIG_SLAB_MERGE_DEFAULT=y -# CONFIG_SLAB_FREELIST_RANDOM is not set -# CONFIG_SLAB_FREELIST_HARDENED is not set -CONFIG_SLAB_BUCKETS=y -# CONFIG_SLUB_STATS is not set -CONFIG_SLUB_CPU_PARTIAL=y -# CONFIG_RANDOM_KMALLOC_CACHES is not set -# end of Slab allocator options - -CONFIG_SHUFFLE_PAGE_ALLOCATOR=y -CONFIG_COMPAT_BRK=y -CONFIG_SPARSEMEM=y -CONFIG_SPARSEMEM_EXTREME=y -CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y -CONFIG_SPARSEMEM_VMEMMAP=y -CONFIG_HAVE_GUP_FAST=y -CONFIG_ARCH_KEEP_MEMBLOCK=y -CONFIG_MEMORY_ISOLATION=y -CONFIG_EXCLUSIVE_SYSTEM_RAM=y -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y -CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y -# CONFIG_MEMORY_HOTPLUG is not set -CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y -CONFIG_SPLIT_PTE_PTLOCKS=y -CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y -CONFIG_SPLIT_PMD_PTLOCKS=y -CONFIG_MEMORY_BALLOON=y -CONFIG_BALLOON_COMPACTION=y -CONFIG_COMPACTION=y -CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 -CONFIG_PAGE_REPORTING=y -CONFIG_MIGRATION=y -CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y -CONFIG_ARCH_ENABLE_THP_MIGRATION=y -CONFIG_CONTIG_ALLOC=y -CONFIG_PCP_BATCH_SCALE_MAX=5 -CONFIG_PHYS_ADDR_T_64BIT=y -CONFIG_MMU_NOTIFIER=y -CONFIG_KSM=y -CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 -CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y -# CONFIG_MEMORY_FAILURE is not set -CONFIG_ARCH_WANTS_THP_SWAP=y -CONFIG_TRANSPARENT_HUGEPAGE=y -CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y -# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set -# CONFIG_TRANSPARENT_HUGEPAGE_NEVER is not set -CONFIG_THP_SWAP=y -# CONFIG_READ_ONLY_THP_FOR_FS is not set -CONFIG_PGTABLE_HAS_HUGE_LEAVES=y -CONFIG_ARCH_SUPPORTS_HUGE_PFNMAP=y -CONFIG_ARCH_SUPPORTS_PMD_PFNMAP=y -CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y -CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y -CONFIG_USE_PERCPU_NUMA_NODE_ID=y -CONFIG_HAVE_SETUP_PER_CPU_AREA=y -CONFIG_CMA=y -# CONFIG_CMA_DEBUGFS is not set -CONFIG_CMA_SYSFS=y -CONFIG_CMA_AREAS=7 -CONFIG_GENERIC_EARLY_IOREMAP=y -# CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set -CONFIG_PAGE_IDLE_FLAG=y -CONFIG_IDLE_PAGE_TRACKING=y -CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y -CONFIG_ARCH_HAS_CURRENT_STACK_POINTER=y -CONFIG_ARCH_HAS_PTE_DEVMAP=y -CONFIG_ARCH_HAS_ZONE_DMA_SET=y -CONFIG_ZONE_DMA=y -CONFIG_ZONE_DMA32=y -CONFIG_HMM_MIRROR=y -CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y -CONFIG_ARCH_HAS_PKEYS=y -CONFIG_ARCH_USES_PG_ARCH_2=y -CONFIG_ARCH_USES_PG_ARCH_3=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_PERCPU_STATS=y -# CONFIG_GUP_TEST is not set -# CONFIG_DMAPOOL_TEST is not set -CONFIG_ARCH_HAS_PTE_SPECIAL=y -CONFIG_MAPPING_DIRTY_HELPERS=y -CONFIG_MEMFD_CREATE=y -CONFIG_SECRETMEM=y -# CONFIG_ANON_VMA_NAME is not set -CONFIG_HAVE_ARCH_USERFAULTFD_WP=y -CONFIG_HAVE_ARCH_USERFAULTFD_MINOR=y -CONFIG_USERFAULTFD=y -CONFIG_PTE_MARKER_UFFD_WP=y -# CONFIG_LRU_GEN is not set -CONFIG_ARCH_SUPPORTS_PER_VMA_LOCK=y -CONFIG_PER_VMA_LOCK=y -CONFIG_LOCK_MM_AND_FIND_VMA=y -CONFIG_EXECMEM=y -CONFIG_NUMA_MEMBLKS=y -# CONFIG_NUMA_EMU is not set - -# Data Access Monitoring -# CONFIG_DAMON is not set -# end of Data Access Monitoring -# end of Memory Management options - -CONFIG_NET=y -CONFIG_COMPAT_NETLINK_MESSAGES=y -CONFIG_NET_INGRESS=y -CONFIG_NET_EGRESS=y -CONFIG_NET_XGRESS=y -CONFIG_NET_REDIRECT=y -CONFIG_SKB_DECRYPTED=y -CONFIG_SKB_EXTENSIONS=y -CONFIG_NET_DEVMEM=y - -# Networking options -CONFIG_PACKET=m -CONFIG_PACKET_DIAG=m -CONFIG_UNIX=y -CONFIG_AF_UNIX_OOB=y -CONFIG_UNIX_DIAG=m -CONFIG_TLS=m -CONFIG_TLS_DEVICE=y -CONFIG_TLS_TOE=y -CONFIG_XFRM=y -CONFIG_XFRM_ALGO=m -CONFIG_XFRM_USER=m -# CONFIG_XFRM_INTERFACE is not set -CONFIG_XFRM_SUB_POLICY=y -CONFIG_XFRM_MIGRATE=y -CONFIG_XFRM_STATISTICS=y -CONFIG_XFRM_AH=m -CONFIG_XFRM_ESP=m -CONFIG_XFRM_IPCOMP=m -CONFIG_NET_KEY=m -# CONFIG_NET_KEY_MIGRATE is not set -# CONFIG_SMC is not set -# CONFIG_XDP_SOCKETS is not set -CONFIG_NET_HANDSHAKE=y -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -CONFIG_IP_ADVANCED_ROUTER=y -CONFIG_IP_FIB_TRIE_STATS=y -CONFIG_IP_MULTIPLE_TABLES=y -CONFIG_IP_ROUTE_MULTIPATH=y -CONFIG_IP_ROUTE_VERBOSE=y -CONFIG_IP_ROUTE_CLASSID=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -CONFIG_IP_PNP_BOOTP=y -CONFIG_IP_PNP_RARP=y -CONFIG_NET_IPIP=m -CONFIG_NET_IPGRE_DEMUX=m -CONFIG_NET_IP_TUNNEL=m -CONFIG_NET_IPGRE=m -CONFIG_NET_IPGRE_BROADCAST=y -CONFIG_IP_MROUTE_COMMON=y -CONFIG_IP_MROUTE=y -CONFIG_IP_MROUTE_MULTIPLE_TABLES=y -CONFIG_IP_PIMSM_V1=y -CONFIG_IP_PIMSM_V2=y -CONFIG_SYN_COOKIES=y -CONFIG_NET_IPVTI=m -CONFIG_NET_UDP_TUNNEL=m -CONFIG_NET_FOU=m -CONFIG_NET_FOU_IP_TUNNELS=y -CONFIG_INET_AH=m -CONFIG_INET_ESP=m -# CONFIG_INET_ESP_OFFLOAD is not set -# CONFIG_INET_ESPINTCP is not set -CONFIG_INET_IPCOMP=m -CONFIG_INET_TABLE_PERTURB_ORDER=16 -CONFIG_INET_XFRM_TUNNEL=m -CONFIG_INET_TUNNEL=m -CONFIG_INET_DIAG=m -CONFIG_INET_TCP_DIAG=m -CONFIG_INET_UDP_DIAG=m -# CONFIG_INET_RAW_DIAG is not set -# CONFIG_INET_DIAG_DESTROY is not set -CONFIG_TCP_CONG_ADVANCED=y -# CONFIG_TCP_CONG_BIC is not set -CONFIG_TCP_CONG_CUBIC=y -# CONFIG_TCP_CONG_WESTWOOD is not set -# CONFIG_TCP_CONG_HTCP is not set -# CONFIG_TCP_CONG_HSTCP is not set -# CONFIG_TCP_CONG_HYBLA is not set -# CONFIG_TCP_CONG_VEGAS is not set -# CONFIG_TCP_CONG_NV is not set -# CONFIG_TCP_CONG_SCALABLE is not set -# CONFIG_TCP_CONG_LP is not set -# CONFIG_TCP_CONG_VENO is not set -# CONFIG_TCP_CONG_YEAH is not set -# CONFIG_TCP_CONG_ILLINOIS is not set -# CONFIG_TCP_CONG_DCTCP is not set -# CONFIG_TCP_CONG_CDG is not set -CONFIG_TCP_CONG_BBR=m -CONFIG_DEFAULT_CUBIC=y -# CONFIG_DEFAULT_RENO is not set -CONFIG_DEFAULT_TCP_CONG="cubic" -CONFIG_TCP_SIGPOOL=y -CONFIG_TCP_AO=y -CONFIG_TCP_MD5SIG=y -CONFIG_IPV6=y -CONFIG_IPV6_ROUTER_PREF=y -CONFIG_IPV6_ROUTE_INFO=y -CONFIG_IPV6_OPTIMISTIC_DAD=y -CONFIG_INET6_AH=m -CONFIG_INET6_ESP=m -# CONFIG_INET6_ESP_OFFLOAD is not set -# CONFIG_INET6_ESPINTCP is not set -CONFIG_INET6_IPCOMP=m -CONFIG_IPV6_MIP6=m -# CONFIG_IPV6_ILA is not set -CONFIG_INET6_XFRM_TUNNEL=m -CONFIG_INET6_TUNNEL=m -CONFIG_IPV6_VTI=m -CONFIG_IPV6_SIT=m -CONFIG_IPV6_SIT_6RD=y -CONFIG_IPV6_NDISC_NODETYPE=y -CONFIG_IPV6_TUNNEL=m -CONFIG_IPV6_GRE=m -CONFIG_IPV6_FOU=m -CONFIG_IPV6_FOU_TUNNEL=m -CONFIG_IPV6_MULTIPLE_TABLES=y -CONFIG_IPV6_SUBTREES=y -CONFIG_IPV6_MROUTE=y -CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y -CONFIG_IPV6_PIMSM_V2=y -# CONFIG_IPV6_SEG6_LWTUNNEL is not set -# CONFIG_IPV6_SEG6_HMAC is not set -# CONFIG_IPV6_RPL_LWTUNNEL is not set -# CONFIG_IPV6_IOAM6_LWTUNNEL is not set -CONFIG_NETLABEL=y -# CONFIG_MPTCP is not set -CONFIG_NETWORK_SECMARK=y -CONFIG_NET_PTP_CLASSIFY=y -CONFIG_NETWORK_PHY_TIMESTAMPING=y -CONFIG_NETFILTER=y -CONFIG_NETFILTER_ADVANCED=y -CONFIG_BRIDGE_NETFILTER=m - -# Core Netfilter Configuration -CONFIG_NETFILTER_INGRESS=y -CONFIG_NETFILTER_EGRESS=y -CONFIG_NETFILTER_SKIP_EGRESS=y -CONFIG_NETFILTER_NETLINK=m -CONFIG_NETFILTER_FAMILY_BRIDGE=y -CONFIG_NETFILTER_FAMILY_ARP=y -CONFIG_NETFILTER_BPF_LINK=y -# CONFIG_NETFILTER_NETLINK_HOOK is not set -CONFIG_NETFILTER_NETLINK_ACCT=m -CONFIG_NETFILTER_NETLINK_QUEUE=m -CONFIG_NETFILTER_NETLINK_LOG=m -CONFIG_NETFILTER_NETLINK_OSF=m -CONFIG_NF_CONNTRACK=m -CONFIG_NF_LOG_SYSLOG=m -CONFIG_NETFILTER_CONNCOUNT=m -CONFIG_NF_CONNTRACK_MARK=y -CONFIG_NF_CONNTRACK_SECMARK=y -CONFIG_NF_CONNTRACK_ZONES=y -CONFIG_NF_CONNTRACK_PROCFS=y -CONFIG_NF_CONNTRACK_EVENTS=y -CONFIG_NF_CONNTRACK_TIMEOUT=y -CONFIG_NF_CONNTRACK_TIMESTAMP=y -CONFIG_NF_CONNTRACK_LABELS=y -CONFIG_NF_CONNTRACK_OVS=y -CONFIG_NF_CT_PROTO_DCCP=y -CONFIG_NF_CT_PROTO_GRE=y -CONFIG_NF_CT_PROTO_SCTP=y -CONFIG_NF_CT_PROTO_UDPLITE=y -CONFIG_NF_CONNTRACK_AMANDA=m -CONFIG_NF_CONNTRACK_FTP=m -CONFIG_NF_CONNTRACK_H323=m -CONFIG_NF_CONNTRACK_IRC=m -CONFIG_NF_CONNTRACK_BROADCAST=m -CONFIG_NF_CONNTRACK_NETBIOS_NS=m -CONFIG_NF_CONNTRACK_SNMP=m -CONFIG_NF_CONNTRACK_PPTP=m -CONFIG_NF_CONNTRACK_SANE=m -CONFIG_NF_CONNTRACK_SIP=m -CONFIG_NF_CONNTRACK_TFTP=m -CONFIG_NF_CT_NETLINK=m -CONFIG_NF_CT_NETLINK_TIMEOUT=m -# CONFIG_NETFILTER_NETLINK_GLUE_CT is not set -CONFIG_NF_NAT=m -CONFIG_NF_NAT_AMANDA=m -CONFIG_NF_NAT_FTP=m -CONFIG_NF_NAT_IRC=m -CONFIG_NF_NAT_SIP=m -CONFIG_NF_NAT_TFTP=m -CONFIG_NF_NAT_REDIRECT=y -CONFIG_NF_NAT_MASQUERADE=y -CONFIG_NF_NAT_OVS=y -CONFIG_NETFILTER_SYNPROXY=m -CONFIG_NF_TABLES=m -CONFIG_NF_TABLES_INET=y -# CONFIG_NF_TABLES_NETDEV is not set -CONFIG_NFT_NUMGEN=m -CONFIG_NFT_CT=m -# CONFIG_NFT_CONNLIMIT is not set -CONFIG_NFT_LOG=m -CONFIG_NFT_LIMIT=m -CONFIG_NFT_MASQ=m -CONFIG_NFT_REDIR=m -CONFIG_NFT_NAT=m -CONFIG_NFT_TUNNEL=m -CONFIG_NFT_QUEUE=m -CONFIG_NFT_QUOTA=m -CONFIG_NFT_REJECT=m -CONFIG_NFT_REJECT_INET=m -CONFIG_NFT_COMPAT=m -CONFIG_NFT_HASH=m -CONFIG_NFT_FIB=m -# CONFIG_NFT_FIB_INET is not set -# CONFIG_NFT_XFRM is not set -# CONFIG_NFT_SOCKET is not set -# CONFIG_NFT_OSF is not set -CONFIG_NFT_TPROXY=m -# CONFIG_NFT_SYNPROXY is not set -# CONFIG_NF_FLOW_TABLE is not set -CONFIG_NETFILTER_XTABLES=y -CONFIG_NETFILTER_XTABLES_COMPAT=y - -## Xtables combined modules -CONFIG_NETFILTER_XT_MARK=m -CONFIG_NETFILTER_XT_CONNMARK=m -CONFIG_NETFILTER_XT_SET=m - -## Xtables targets -# CONFIG_NETFILTER_XT_TARGET_AUDIT is not set -CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m -CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m -CONFIG_NETFILTER_XT_TARGET_CONNMARK=m -CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m -CONFIG_NETFILTER_XT_TARGET_CT=m -CONFIG_NETFILTER_XT_TARGET_DSCP=m -CONFIG_NETFILTER_XT_TARGET_HL=m -CONFIG_NETFILTER_XT_TARGET_HMARK=m -CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m -# CONFIG_NETFILTER_XT_TARGET_LED is not set -CONFIG_NETFILTER_XT_TARGET_LOG=m -CONFIG_NETFILTER_XT_TARGET_MARK=m -CONFIG_NETFILTER_XT_NAT=m -CONFIG_NETFILTER_XT_TARGET_NETMAP=m -CONFIG_NETFILTER_XT_TARGET_NFLOG=m -CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m -# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set -CONFIG_NETFILTER_XT_TARGET_RATEEST=m -CONFIG_NETFILTER_XT_TARGET_REDIRECT=m -CONFIG_NETFILTER_XT_TARGET_MASQUERADE=m -CONFIG_NETFILTER_XT_TARGET_TEE=m -CONFIG_NETFILTER_XT_TARGET_TPROXY=m -# CONFIG_NETFILTER_XT_TARGET_TRACE is not set -CONFIG_NETFILTER_XT_TARGET_SECMARK=m -CONFIG_NETFILTER_XT_TARGET_TCPMSS=m -CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m - -## Xtables matches -CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m -CONFIG_NETFILTER_XT_MATCH_BPF=m -CONFIG_NETFILTER_XT_MATCH_CGROUP=m -CONFIG_NETFILTER_XT_MATCH_CLUSTER=m -CONFIG_NETFILTER_XT_MATCH_COMMENT=m -CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m -CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m -CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m -CONFIG_NETFILTER_XT_MATCH_CONNMARK=m -CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m -CONFIG_NETFILTER_XT_MATCH_CPU=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m -CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m -CONFIG_NETFILTER_XT_MATCH_DSCP=m -CONFIG_NETFILTER_XT_MATCH_ECN=m -CONFIG_NETFILTER_XT_MATCH_ESP=m -CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m -CONFIG_NETFILTER_XT_MATCH_HELPER=m -CONFIG_NETFILTER_XT_MATCH_HL=m -# CONFIG_NETFILTER_XT_MATCH_IPCOMP is not set -CONFIG_NETFILTER_XT_MATCH_IPRANGE=m -CONFIG_NETFILTER_XT_MATCH_IPVS=m -# CONFIG_NETFILTER_XT_MATCH_L2TP is not set -CONFIG_NETFILTER_XT_MATCH_LENGTH=m -CONFIG_NETFILTER_XT_MATCH_LIMIT=m -CONFIG_NETFILTER_XT_MATCH_MAC=m -CONFIG_NETFILTER_XT_MATCH_MARK=m -CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m -CONFIG_NETFILTER_XT_MATCH_NFACCT=m -CONFIG_NETFILTER_XT_MATCH_OSF=m -CONFIG_NETFILTER_XT_MATCH_OWNER=m -CONFIG_NETFILTER_XT_MATCH_POLICY=m -CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m -CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m -CONFIG_NETFILTER_XT_MATCH_QUOTA=m -CONFIG_NETFILTER_XT_MATCH_RATEEST=m -CONFIG_NETFILTER_XT_MATCH_REALM=m -CONFIG_NETFILTER_XT_MATCH_RECENT=m -CONFIG_NETFILTER_XT_MATCH_SCTP=m -CONFIG_NETFILTER_XT_MATCH_SOCKET=m -CONFIG_NETFILTER_XT_MATCH_STATE=m -CONFIG_NETFILTER_XT_MATCH_STATISTIC=m -CONFIG_NETFILTER_XT_MATCH_STRING=m -CONFIG_NETFILTER_XT_MATCH_TCPMSS=m -CONFIG_NETFILTER_XT_MATCH_TIME=m -CONFIG_NETFILTER_XT_MATCH_U32=m -# end of Core Netfilter Configuration - -CONFIG_IP_SET=m -CONFIG_IP_SET_MAX=256 -CONFIG_IP_SET_BITMAP_IP=m -CONFIG_IP_SET_BITMAP_IPMAC=m -CONFIG_IP_SET_BITMAP_PORT=m -CONFIG_IP_SET_HASH_IP=m -CONFIG_IP_SET_HASH_IPMARK=m -CONFIG_IP_SET_HASH_IPPORT=m -CONFIG_IP_SET_HASH_IPPORTIP=m -CONFIG_IP_SET_HASH_IPPORTNET=m -CONFIG_IP_SET_HASH_IPMAC=m -CONFIG_IP_SET_HASH_MAC=m -CONFIG_IP_SET_HASH_NETPORTNET=m -CONFIG_IP_SET_HASH_NET=m -CONFIG_IP_SET_HASH_NETNET=m -CONFIG_IP_SET_HASH_NETPORT=m -CONFIG_IP_SET_HASH_NETIFACE=m -CONFIG_IP_SET_LIST_SET=m -CONFIG_IP_VS=m -CONFIG_IP_VS_IPV6=y -# CONFIG_IP_VS_DEBUG is not set -CONFIG_IP_VS_TAB_BITS=12 - -## IPVS transport protocol load balancing support -CONFIG_IP_VS_PROTO_TCP=y -CONFIG_IP_VS_PROTO_UDP=y -CONFIG_IP_VS_PROTO_AH_ESP=y -CONFIG_IP_VS_PROTO_ESP=y -CONFIG_IP_VS_PROTO_AH=y -CONFIG_IP_VS_PROTO_SCTP=y - -## IPVS scheduler -CONFIG_IP_VS_RR=m -CONFIG_IP_VS_WRR=m -CONFIG_IP_VS_LC=m -CONFIG_IP_VS_WLC=m -# CONFIG_IP_VS_FO is not set -# CONFIG_IP_VS_OVF is not set -CONFIG_IP_VS_LBLC=m -CONFIG_IP_VS_LBLCR=m -CONFIG_IP_VS_DH=m -CONFIG_IP_VS_SH=m -# CONFIG_IP_VS_MH is not set -CONFIG_IP_VS_SED=m -CONFIG_IP_VS_NQ=m -CONFIG_IP_VS_TWOS=m - -## IPVS SH scheduler -CONFIG_IP_VS_SH_TAB_BITS=8 - -## IPVS MH scheduler -CONFIG_IP_VS_MH_TAB_INDEX=12 - -## IPVS application helper -CONFIG_IP_VS_FTP=m -CONFIG_IP_VS_NFCT=y -CONFIG_IP_VS_PE_SIP=m - -# IP: Netfilter Configuration -CONFIG_NF_DEFRAG_IPV4=m -CONFIG_IP_NF_IPTABLES_LEGACY=m -CONFIG_NF_SOCKET_IPV4=m -CONFIG_NF_TPROXY_IPV4=m -CONFIG_NF_TABLES_IPV4=y -CONFIG_NFT_REJECT_IPV4=m -CONFIG_NFT_DUP_IPV4=m -CONFIG_NFT_FIB_IPV4=m -# CONFIG_NF_TABLES_ARP is not set -CONFIG_NF_DUP_IPV4=m -# CONFIG_NF_LOG_ARP is not set -CONFIG_NF_LOG_IPV4=m -CONFIG_NF_REJECT_IPV4=m -CONFIG_NF_NAT_SNMP_BASIC=m -CONFIG_NF_NAT_PPTP=m -CONFIG_NF_NAT_H323=m -CONFIG_IP_NF_IPTABLES=m -CONFIG_IP_NF_MATCH_AH=m -CONFIG_IP_NF_MATCH_ECN=m -CONFIG_IP_NF_MATCH_RPFILTER=m -CONFIG_IP_NF_MATCH_TTL=m -CONFIG_IP_NF_FILTER=m -CONFIG_IP_NF_TARGET_REJECT=m -CONFIG_IP_NF_TARGET_SYNPROXY=m -CONFIG_IP_NF_NAT=m -CONFIG_IP_NF_TARGET_MASQUERADE=m -CONFIG_IP_NF_TARGET_NETMAP=m -CONFIG_IP_NF_TARGET_REDIRECT=m -CONFIG_IP_NF_MANGLE=m -CONFIG_IP_NF_TARGET_ECN=m -CONFIG_IP_NF_TARGET_TTL=m -CONFIG_IP_NF_RAW=m -CONFIG_IP_NF_SECURITY=m -CONFIG_IP_NF_ARPTABLES=m -CONFIG_IP_NF_ARPFILTER=m -CONFIG_IP_NF_ARP_MANGLE=m -# end of IP: Netfilter Configuration - -# IPv6: Netfilter Configuration -CONFIG_IP6_NF_IPTABLES_LEGACY=m -CONFIG_NF_SOCKET_IPV6=m -CONFIG_NF_TPROXY_IPV6=m -CONFIG_NF_TABLES_IPV6=y -CONFIG_NFT_REJECT_IPV6=m -CONFIG_NFT_DUP_IPV6=m -CONFIG_NFT_FIB_IPV6=m -CONFIG_NF_DUP_IPV6=m -CONFIG_NF_REJECT_IPV6=m -CONFIG_NF_LOG_IPV6=m -CONFIG_IP6_NF_IPTABLES=m -CONFIG_IP6_NF_MATCH_AH=m -CONFIG_IP6_NF_MATCH_EUI64=m -CONFIG_IP6_NF_MATCH_FRAG=m -CONFIG_IP6_NF_MATCH_OPTS=m -CONFIG_IP6_NF_MATCH_HL=m -CONFIG_IP6_NF_MATCH_IPV6HEADER=m -CONFIG_IP6_NF_MATCH_MH=m -CONFIG_IP6_NF_MATCH_RPFILTER=m -CONFIG_IP6_NF_MATCH_RT=m -# CONFIG_IP6_NF_MATCH_SRH is not set -CONFIG_IP6_NF_TARGET_HL=m -CONFIG_IP6_NF_FILTER=m -CONFIG_IP6_NF_TARGET_REJECT=m -CONFIG_IP6_NF_TARGET_SYNPROXY=m -CONFIG_IP6_NF_MANGLE=m -CONFIG_IP6_NF_RAW=m -CONFIG_IP6_NF_SECURITY=m -CONFIG_IP6_NF_NAT=m -CONFIG_IP6_NF_TARGET_MASQUERADE=m -CONFIG_IP6_NF_TARGET_NPT=m -# end of IPv6: Netfilter Configuration - -CONFIG_NF_DEFRAG_IPV6=m -# CONFIG_NF_TABLES_BRIDGE is not set -CONFIG_NF_CONNTRACK_BRIDGE=m -CONFIG_BRIDGE_NF_EBTABLES_LEGACY=m -CONFIG_BRIDGE_NF_EBTABLES=m -CONFIG_BRIDGE_EBT_BROUTE=m -CONFIG_BRIDGE_EBT_T_FILTER=m -CONFIG_BRIDGE_EBT_T_NAT=m -CONFIG_BRIDGE_EBT_802_3=m -CONFIG_BRIDGE_EBT_AMONG=m -CONFIG_BRIDGE_EBT_ARP=m -CONFIG_BRIDGE_EBT_IP=m -CONFIG_BRIDGE_EBT_IP6=m -CONFIG_BRIDGE_EBT_LIMIT=m -CONFIG_BRIDGE_EBT_MARK=m -CONFIG_BRIDGE_EBT_PKTTYPE=m -CONFIG_BRIDGE_EBT_STP=m -CONFIG_BRIDGE_EBT_VLAN=m -CONFIG_BRIDGE_EBT_ARPREPLY=m -CONFIG_BRIDGE_EBT_DNAT=m -CONFIG_BRIDGE_EBT_MARK_T=m -CONFIG_BRIDGE_EBT_REDIRECT=m -CONFIG_BRIDGE_EBT_SNAT=m -CONFIG_BRIDGE_EBT_LOG=m -CONFIG_BRIDGE_EBT_NFLOG=m -CONFIG_IP_DCCP=m -CONFIG_INET_DCCP_DIAG=m - -# DCCP CCIDs Configuration -# CONFIG_IP_DCCP_CCID2_DEBUG is not set -CONFIG_IP_DCCP_CCID3=y -# CONFIG_IP_DCCP_CCID3_DEBUG is not set -CONFIG_IP_DCCP_TFRC_LIB=y -# end of DCCP CCIDs Configuration - -# DCCP Kernel Hacking -# CONFIG_IP_DCCP_DEBUG is not set -# end of DCCP Kernel Hacking - -CONFIG_IP_SCTP=m -# CONFIG_SCTP_DBG_OBJCNT is not set -CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5=y -# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA1 is not set -# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE is not set -CONFIG_SCTP_COOKIE_HMAC_MD5=y -CONFIG_SCTP_COOKIE_HMAC_SHA1=y -CONFIG_INET_SCTP_DIAG=m -CONFIG_RDS=m -# CONFIG_RDS_RDMA is not set -CONFIG_RDS_TCP=m -# CONFIG_RDS_DEBUG is not set -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_L2TP is not set -CONFIG_STP=m -CONFIG_GARP=m -CONFIG_MRP=m -CONFIG_BRIDGE=m -CONFIG_BRIDGE_IGMP_SNOOPING=y -CONFIG_BRIDGE_VLAN_FILTERING=y -# CONFIG_BRIDGE_MRP is not set -# CONFIG_BRIDGE_CFM is not set -# CONFIG_NET_DSA is not set -CONFIG_VLAN_8021Q=m -CONFIG_VLAN_8021Q_GVRP=y -CONFIG_VLAN_8021Q_MVRP=y -CONFIG_LLC=m -# CONFIG_LLC2 is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_PHONET is not set -# CONFIG_6LOWPAN is not set -# CONFIG_IEEE802154 is not set -CONFIG_NET_SCHED=y - -## Queueing/Scheduling -CONFIG_NET_SCH_HTB=m -CONFIG_NET_SCH_HFSC=m -CONFIG_NET_SCH_PRIO=m -CONFIG_NET_SCH_MULTIQ=m -CONFIG_NET_SCH_RED=m -CONFIG_NET_SCH_SFB=m -CONFIG_NET_SCH_SFQ=m -CONFIG_NET_SCH_TEQL=m -CONFIG_NET_SCH_TBF=m -# CONFIG_NET_SCH_CBS is not set -CONFIG_NET_SCH_ETF=m -CONFIG_NET_SCH_MQPRIO_LIB=m -# CONFIG_NET_SCH_TAPRIO is not set -CONFIG_NET_SCH_GRED=m -CONFIG_NET_SCH_NETEM=m -CONFIG_NET_SCH_DRR=m -CONFIG_NET_SCH_MQPRIO=m -# CONFIG_NET_SCH_SKBPRIO is not set -CONFIG_NET_SCH_CHOKE=m -CONFIG_NET_SCH_QFQ=m -CONFIG_NET_SCH_CODEL=m -CONFIG_NET_SCH_FQ_CODEL=m -# CONFIG_NET_SCH_CAKE is not set -CONFIG_NET_SCH_FQ=m -# CONFIG_NET_SCH_HHF is not set -# CONFIG_NET_SCH_PIE is not set -CONFIG_NET_SCH_INGRESS=m -CONFIG_NET_SCH_PLUG=m -# CONFIG_NET_SCH_ETS is not set -# CONFIG_NET_SCH_DEFAULT is not set - -## Classification -CONFIG_NET_CLS=y -CONFIG_NET_CLS_BASIC=m -CONFIG_NET_CLS_ROUTE4=m -CONFIG_NET_CLS_FW=m -CONFIG_NET_CLS_U32=m -CONFIG_CLS_U32_PERF=y -CONFIG_CLS_U32_MARK=y -CONFIG_NET_CLS_FLOW=m -CONFIG_NET_CLS_CGROUP=m -CONFIG_NET_CLS_BPF=m -# CONFIG_NET_CLS_FLOWER is not set -CONFIG_NET_CLS_MATCHALL=m -CONFIG_NET_EMATCH=y -CONFIG_NET_EMATCH_STACK=32 -CONFIG_NET_EMATCH_CMP=m -CONFIG_NET_EMATCH_NBYTE=m -CONFIG_NET_EMATCH_U32=m -CONFIG_NET_EMATCH_META=m -CONFIG_NET_EMATCH_TEXT=m -CONFIG_NET_EMATCH_IPSET=m -# CONFIG_NET_EMATCH_IPT is not set -CONFIG_NET_CLS_ACT=y -CONFIG_NET_ACT_POLICE=m -CONFIG_NET_ACT_GACT=m -CONFIG_GACT_PROB=y -CONFIG_NET_ACT_MIRRED=m -# CONFIG_NET_ACT_SAMPLE is not set -CONFIG_NET_ACT_NAT=m -CONFIG_NET_ACT_PEDIT=m -CONFIG_NET_ACT_SIMP=m -CONFIG_NET_ACT_SKBEDIT=m -CONFIG_NET_ACT_CSUM=m -# CONFIG_NET_ACT_MPLS is not set -# CONFIG_NET_ACT_VLAN is not set -CONFIG_NET_ACT_BPF=m -# CONFIG_NET_ACT_CONNMARK is not set -# CONFIG_NET_ACT_CTINFO is not set -# CONFIG_NET_ACT_SKBMOD is not set -# CONFIG_NET_ACT_IFE is not set -CONFIG_NET_ACT_TUNNEL_KEY=m -# CONFIG_NET_ACT_GATE is not set -# CONFIG_NET_TC_SKB_EXT is not set -CONFIG_NET_SCH_FIFO=y -CONFIG_DCB=y -CONFIG_DNS_RESOLVER=m -# CONFIG_BATMAN_ADV is not set -CONFIG_OPENVSWITCH=m -CONFIG_OPENVSWITCH_GRE=m -CONFIG_OPENVSWITCH_VXLAN=m -CONFIG_OPENVSWITCH_GENEVE=m -CONFIG_VSOCKETS=m -CONFIG_VSOCKETS_DIAG=m -CONFIG_VSOCKETS_LOOPBACK=m -CONFIG_VMWARE_VMCI_VSOCKETS=m -CONFIG_VIRTIO_VSOCKETS=m -CONFIG_VIRTIO_VSOCKETS_COMMON=m -CONFIG_NETLINK_DIAG=m -CONFIG_MPLS=y -CONFIG_NET_MPLS_GSO=m -# CONFIG_MPLS_ROUTING is not set -CONFIG_NET_NSH=m -# CONFIG_HSR is not set -CONFIG_NET_SWITCHDEV=y -CONFIG_NET_L3_MASTER_DEV=y -# CONFIG_QRTR is not set -# CONFIG_NET_NCSI is not set -CONFIG_PCPU_DEV_REFCNT=y -CONFIG_MAX_SKB_FRAGS=17 -CONFIG_RPS=y -CONFIG_RFS_ACCEL=y -CONFIG_SOCK_RX_QUEUE_MAPPING=y -CONFIG_XPS=y -CONFIG_CGROUP_NET_PRIO=y -CONFIG_CGROUP_NET_CLASSID=y -CONFIG_NET_RX_BUSY_POLL=y -CONFIG_BQL=y -# CONFIG_BPF_STREAM_PARSER is not set -CONFIG_NET_FLOW_LIMIT=y - -# Network testing -# CONFIG_NET_PKTGEN is not set -CONFIG_NET_DROP_MONITOR=m -# end of Network testing -# end of Networking options - -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_BT is not set -# CONFIG_AF_RXRPC is not set -# CONFIG_AF_KCM is not set -CONFIG_STREAM_PARSER=y -# CONFIG_MCTP is not set -CONFIG_FIB_RULES=y -CONFIG_WIRELESS=y -CONFIG_WEXT_CORE=y -CONFIG_WEXT_PROC=y -CONFIG_CFG80211=m -# CONFIG_NL80211_TESTMODE is not set -# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set -# CONFIG_CFG80211_CERTIFICATION_ONUS is not set -CONFIG_CFG80211_REQUIRE_SIGNED_REGDB=y -CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS=y -CONFIG_CFG80211_DEFAULT_PS=y -# CONFIG_CFG80211_DEBUGFS is not set -CONFIG_CFG80211_CRDA_SUPPORT=y -CONFIG_CFG80211_WEXT=y -CONFIG_MAC80211=m -CONFIG_MAC80211_HAS_RC=y -CONFIG_MAC80211_RC_MINSTREL=y -CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y -CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" -# CONFIG_MAC80211_MESH is not set -CONFIG_MAC80211_LEDS=y -# CONFIG_MAC80211_MESSAGE_TRACING is not set -# CONFIG_MAC80211_DEBUG_MENU is not set -CONFIG_MAC80211_STA_HASH_MAX_SIZE=0 -# CONFIG_RFKILL is not set -CONFIG_NET_9P=m -CONFIG_NET_9P_FD=m -CONFIG_NET_9P_VIRTIO=m -CONFIG_NET_9P_XEN=m -# CONFIG_NET_9P_USBG is not set -# CONFIG_NET_9P_RDMA is not set -# CONFIG_NET_9P_DEBUG is not set -# CONFIG_CAIF is not set -CONFIG_CEPH_LIB=m -# CONFIG_CEPH_LIB_PRETTYDEBUG is not set -# CONFIG_CEPH_LIB_USE_DNS_RESOLVER is not set -# CONFIG_NFC is not set -# CONFIG_PSAMPLE is not set -# CONFIG_NET_IFE is not set -# CONFIG_LWTUNNEL is not set -CONFIG_DST_CACHE=y -CONFIG_GRO_CELLS=y -CONFIG_SOCK_VALIDATE_XMIT=y -CONFIG_NET_SELFTESTS=y -CONFIG_NET_SOCK_MSG=y -CONFIG_NET_DEVLINK=y -CONFIG_PAGE_POOL=y -# CONFIG_PAGE_POOL_STATS is not set -CONFIG_FAILOVER=y -CONFIG_ETHTOOL_NETLINK=y - -# Device Drivers -CONFIG_ARM_AMBA=y -CONFIG_TEGRA_AHB=y -CONFIG_HAVE_PCI=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_PCI=y -CONFIG_PCI_DOMAINS=y -CONFIG_PCI_DOMAINS_GENERIC=y -CONFIG_PCI_SYSCALL=y -CONFIG_PCIEPORTBUS=y -CONFIG_HOTPLUG_PCI_PCIE=y -CONFIG_PCIEAER=y -# CONFIG_PCIEAER_INJECT is not set -CONFIG_PCIE_ECRC=y -CONFIG_PCIEASPM=y -CONFIG_PCIEASPM_DEFAULT=y -# CONFIG_PCIEASPM_POWERSAVE is not set -# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set -# CONFIG_PCIEASPM_PERFORMANCE is not set -CONFIG_PCIE_PME=y -CONFIG_PCIE_DPC=y -CONFIG_PCIE_PTM=y -CONFIG_PCIE_EDR=y -CONFIG_PCI_MSI=y -CONFIG_PCI_QUIRKS=y -# CONFIG_PCI_DEBUG is not set -# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set -# CONFIG_PCI_STUB is not set -# CONFIG_PCI_PF_STUB is not set -CONFIG_PCI_ATS=y -CONFIG_PCI_ECAM=y -CONFIG_PCI_IOV=y -CONFIG_PCI_PRI=y -CONFIG_PCI_PASID=y -CONFIG_PCI_LABEL=y -# CONFIG_PCI_DYNAMIC_OF_NODES is not set -# CONFIG_PCIE_BUS_TUNE_OFF is not set -CONFIG_PCIE_BUS_DEFAULT=y -# CONFIG_PCIE_BUS_SAFE is not set -# CONFIG_PCIE_BUS_PERFORMANCE is not set -# CONFIG_PCIE_BUS_PEER2PEER is not set -CONFIG_VGA_ARB=y -CONFIG_VGA_ARB_MAX_GPUS=16 -CONFIG_HOTPLUG_PCI=y -CONFIG_HOTPLUG_PCI_ACPI=y -# CONFIG_HOTPLUG_PCI_ACPI_AMPERE_ALTRA is not set -CONFIG_HOTPLUG_PCI_ACPI_IBM=m -# CONFIG_HOTPLUG_PCI_CPCI is not set -# CONFIG_HOTPLUG_PCI_SHPC is not set - -# PCI controller drivers -# CONFIG_PCI_AARDVARK is not set -# CONFIG_PCIE_ALTERA is not set -CONFIG_PCIE_BRCMSTB=m -CONFIG_PCIE_IPROC=m -CONFIG_PCIE_IPROC_PLATFORM=m -CONFIG_PCIE_IPROC_MSI=y -CONFIG_PCI_HOST_THUNDER_PEM=y -CONFIG_PCI_HOST_THUNDER_ECAM=y -# CONFIG_PCI_FTPCI100 is not set -CONFIG_PCI_HOST_COMMON=y -CONFIG_PCI_HOST_GENERIC=y -# CONFIG_PCIE_MEDIATEK is not set -# CONFIG_PCIE_MEDIATEK_GEN3 is not set -# CONFIG_PCI_TEGRA is not set -# CONFIG_PCIE_ROCKCHIP_HOST is not set -CONFIG_PCI_XGENE=y -CONFIG_PCI_XGENE_MSI=y -# CONFIG_PCIE_XILINX is not set -# CONFIG_PCIE_XILINX_DMA_PL is not set -# CONFIG_PCIE_XILINX_NWL is not set -# CONFIG_PCIE_XILINX_CPM is not set - -# Cadence-based PCIe controllers -# CONFIG_PCIE_CADENCE_PLAT_HOST is not set -# end of Cadence-based PCIe controllers - -# DesignWare-based PCIe controllers -CONFIG_PCIE_DW=y -CONFIG_PCIE_DW_HOST=y -# CONFIG_PCIE_AL is not set -# CONFIG_PCI_MESON is not set -CONFIG_PCI_HISI=y -# CONFIG_PCIE_KIRIN is not set -# CONFIG_PCIE_HISI_STB is not set -CONFIG_PCIE_ARMADA_8K=y -# CONFIG_PCIE_DW_PLAT_HOST is not set -CONFIG_PCIE_QCOM_COMMON=y -CONFIG_PCIE_QCOM=y -# CONFIG_PCIE_ROCKCHIP_DW_HOST is not set -# CONFIG_PCI_EXYNOS is not set -# end of DesignWare-based PCIe controllers - -# Mobiveil-based PCIe controllers -# CONFIG_PCIE_MOBIVEIL_PLAT is not set -# end of Mobiveil-based PCIe controllers - -# PLDA-based PCIe controllers -# CONFIG_PCIE_MICROCHIP_HOST is not set -# end of PLDA-based PCIe controllers -# end of PCI controller drivers - -# PCI Endpoint -# CONFIG_PCI_ENDPOINT is not set -# end of PCI Endpoint - -# PCI switch controller drivers -# CONFIG_PCI_SW_SWITCHTEC is not set -# end of PCI switch controller drivers - -CONFIG_HAVE_PWRCTL=y -# CONFIG_CXL_BUS is not set -# CONFIG_PCCARD is not set -# CONFIG_RAPIDIO is not set - -# Generic Driver Options -CONFIG_AUXILIARY_BUS=y -CONFIG_UEVENT_HELPER=y -CONFIG_UEVENT_HELPER_PATH="" -CONFIG_DEVTMPFS=y -CONFIG_DEVTMPFS_MOUNT=y -# CONFIG_DEVTMPFS_SAFE is not set -CONFIG_STANDALONE=y -CONFIG_PREVENT_FIRMWARE_BUILD=y - -# Firmware loader -CONFIG_FW_LOADER=y -CONFIG_FW_LOADER_DEBUG=y -CONFIG_FW_LOADER_PAGED_BUF=y -CONFIG_FW_LOADER_SYSFS=y -CONFIG_EXTRA_FIRMWARE="" -# CONFIG_FW_LOADER_USER_HELPER is not set -CONFIG_FW_LOADER_COMPRESS=y -CONFIG_FW_LOADER_COMPRESS_XZ=y -# CONFIG_FW_LOADER_COMPRESS_ZSTD is not set -CONFIG_FW_CACHE=y -CONFIG_FW_UPLOAD=y -# end of Firmware loader - -CONFIG_WANT_DEV_COREDUMP=y -CONFIG_ALLOW_DEV_COREDUMP=y -CONFIG_DEV_COREDUMP=y -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set -# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set -CONFIG_SYS_HYPERVISOR=y -CONFIG_GENERIC_CPU_DEVICES=y -CONFIG_GENERIC_CPU_AUTOPROBE=y -CONFIG_GENERIC_CPU_VULNERABILITIES=y -CONFIG_SOC_BUS=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=m -CONFIG_REGMAP_SPI=m -CONFIG_REGMAP_MMIO=y -CONFIG_DMA_SHARED_BUFFER=y -# CONFIG_DMA_FENCE_TRACE is not set -CONFIG_GENERIC_ARCH_TOPOLOGY=y -CONFIG_GENERIC_ARCH_NUMA=y -# CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT is not set -# end of Generic Driver Options - -# Bus devices -CONFIG_ARM_CCI=y -CONFIG_ARM_CCI400_COMMON=y -# CONFIG_MOXTET is not set -# CONFIG_HISILICON_LPC is not set -CONFIG_QCOM_EBI2=y -# CONFIG_QCOM_SSC_BLOCK_BUS is not set -# CONFIG_SUN50I_DE2_BUS is not set -CONFIG_SUNXI_RSB=m -# CONFIG_TEGRA_ACONNECT is not set -# CONFIG_TEGRA_GMI is not set -CONFIG_VEXPRESS_CONFIG=y -# CONFIG_MHI_BUS is not set -# CONFIG_MHI_BUS_EP is not set -# end of Bus devices - -# Cache Drivers -# end of Cache Drivers - -CONFIG_CONNECTOR=m - -# Firmware Drivers - -# ARM System Control and Management Interface Protocol -CONFIG_ARM_SCMI_PROTOCOL=y -# CONFIG_ARM_SCMI_RAW_MODE_SUPPORT is not set -# CONFIG_ARM_SCMI_DEBUG_COUNTERS is not set - -# SCMI Transport Drivers -CONFIG_ARM_SCMI_HAVE_TRANSPORT=y -CONFIG_ARM_SCMI_HAVE_SHMEM=y -CONFIG_ARM_SCMI_TRANSPORT_MAILBOX=y -CONFIG_ARM_SCMI_TRANSPORT_SMC=y -# CONFIG_ARM_SCMI_TRANSPORT_SMC_ATOMIC_ENABLE is not set -# CONFIG_ARM_SCMI_TRANSPORT_VIRTIO is not set -# end of SCMI Transport Drivers - -# ARM SCMI NXP i.MX Vendor Protocols -# CONFIG_IMX_SCMI_BBM_EXT is not set -# end of ARM SCMI NXP i.MX Vendor Protocols - -# CONFIG_ARM_SCMI_POWER_CONTROL is not set -# end of ARM System Control and Management Interface Protocol - -CONFIG_ARM_SCPI_PROTOCOL=m -# CONFIG_ARM_SDE_INTERFACE is not set -CONFIG_FIRMWARE_MEMMAP=y -CONFIG_DMIID=y -CONFIG_DMI_SYSFS=m -# CONFIG_ISCSI_IBFT is not set -CONFIG_RASPBERRYPI_FIRMWARE=y -# CONFIG_FW_CFG_SYSFS is not set -CONFIG_SYSFB=y -# CONFIG_SYSFB_SIMPLEFB is not set -# CONFIG_TURRIS_MOX_RWTM is not set -# CONFIG_ARM_FFA_TRANSPORT is not set -# CONFIG_GOOGLE_FIRMWARE is not set - -# EFI (Extensible Firmware Interface) Support -CONFIG_EFI_ESRT=y -CONFIG_EFI_VARS_PSTORE=m -# CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE is not set -CONFIG_EFI_PARAMS_FROM_FDT=y -CONFIG_EFI_RUNTIME_WRAPPERS=y -CONFIG_EFI_GENERIC_STUB=y -# CONFIG_EFI_ZBOOT is not set -CONFIG_EFI_ARMSTUB_DTB_LOADER=y -CONFIG_EFI_BOOTLOADER_CONTROL=m -CONFIG_EFI_CAPSULE_LOADER=m -# CONFIG_EFI_TEST is not set -# CONFIG_RESET_ATTACK_MITIGATION is not set -# CONFIG_EFI_DISABLE_PCI_DMA is not set -CONFIG_EFI_EARLYCON=y -CONFIG_EFI_CUSTOM_SSDT_OVERLAYS=y -# CONFIG_EFI_DISABLE_RUNTIME is not set -# CONFIG_EFI_COCO_SECRET is not set -# end of EFI (Extensible Firmware Interface) Support - -CONFIG_MESON_SM=y -CONFIG_ARM_PSCI_FW=y -# CONFIG_ARM_PSCI_CHECKER is not set - -# Qualcomm firmware drivers -CONFIG_QCOM_SCM=m -CONFIG_QCOM_TZMEM=m -CONFIG_QCOM_TZMEM_MODE_GENERIC=y -# CONFIG_QCOM_TZMEM_MODE_SHMBRIDGE is not set -# end of Qualcomm firmware drivers - -CONFIG_HAVE_ARM_SMCCC=y -CONFIG_HAVE_ARM_SMCCC_DISCOVERY=y -CONFIG_ARM_SMCCC_SOC_ID=y - -# Tegra firmware driver -# end of Tegra firmware driver - -# Zynq MPSoC Firmware Drivers -# CONFIG_ZYNQMP_FIRMWARE is not set -# end of Zynq MPSoC Firmware Drivers -# end of Firmware Drivers - -# CONFIG_GNSS is not set -# CONFIG_MTD is not set -CONFIG_DTC=y -CONFIG_OF=y -# CONFIG_OF_UNITTEST is not set -CONFIG_OF_FLATTREE=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_KOBJ=y -CONFIG_OF_DYNAMIC=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_IRQ=y -CONFIG_OF_RESERVED_MEM=y -CONFIG_OF_RESOLVE=y -CONFIG_OF_OVERLAY=y -CONFIG_OF_NUMA=y -CONFIG_OF_CONFIGFS=y -# CONFIG_PARPORT is not set -CONFIG_PNP=y -# CONFIG_PNP_DEBUG_MESSAGES is not set - -## Protocols -CONFIG_PNPACPI=y -CONFIG_BLK_DEV=y -# CONFIG_BLK_DEV_NULL_BLK is not set -CONFIG_CDROM=y -# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set -CONFIG_ZRAM=m -# CONFIG_ZRAM_BACKEND_LZ4 is not set -# CONFIG_ZRAM_BACKEND_LZ4HC is not set -# CONFIG_ZRAM_BACKEND_ZSTD is not set -# CONFIG_ZRAM_BACKEND_DEFLATE is not set -# CONFIG_ZRAM_BACKEND_842 is not set -CONFIG_ZRAM_BACKEND_FORCE_LZO=y -CONFIG_ZRAM_BACKEND_LZO=y -CONFIG_ZRAM_DEF_COMP_LZORLE=y -# CONFIG_ZRAM_DEF_COMP_LZO is not set -CONFIG_ZRAM_DEF_COMP="lzo-rle" -# CONFIG_ZRAM_WRITEBACK is not set -# CONFIG_ZRAM_TRACK_ENTRY_ACTIME is not set -# CONFIG_ZRAM_MEMORY_TRACKING is not set -# CONFIG_ZRAM_MULTI_COMP is not set -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 -# CONFIG_BLK_DEV_DRBD is not set -# CONFIG_BLK_DEV_NBD is not set -CONFIG_BLK_DEV_RAM=m -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=4096 -# CONFIG_CDROM_PKTCDVD is not set -# CONFIG_ATA_OVER_ETH is not set -CONFIG_XEN_BLKDEV_FRONTEND=m -CONFIG_XEN_BLKDEV_BACKEND=m -CONFIG_VIRTIO_BLK=m -CONFIG_BLK_DEV_RBD=m -# CONFIG_BLK_DEV_UBLK is not set - -# NVME Support -CONFIG_NVME_CORE=m -CONFIG_BLK_DEV_NVME=m -# CONFIG_NVME_MULTIPATH is not set -# CONFIG_NVME_VERBOSE_ERRORS is not set -# CONFIG_NVME_HWMON is not set -CONFIG_NVME_FABRICS=m -# CONFIG_NVME_RDMA is not set -# CONFIG_NVME_FC is not set -# CONFIG_NVME_TCP is not set -# CONFIG_NVME_HOST_AUTH is not set -CONFIG_NVME_TARGET=m -# CONFIG_NVME_TARGET_DEBUGFS is not set -# CONFIG_NVME_TARGET_PASSTHRU is not set -CONFIG_NVME_TARGET_LOOP=m -# CONFIG_NVME_TARGET_RDMA is not set -# CONFIG_NVME_TARGET_FC is not set -# CONFIG_NVME_TARGET_TCP is not set -# CONFIG_NVME_TARGET_AUTH is not set -# end of NVME Support - -# Misc devices -# CONFIG_AD525X_DPOT is not set -# CONFIG_DUMMY_IRQ is not set -# CONFIG_PHANTOM is not set -# CONFIG_RPMB is not set -# CONFIG_TIFM_CORE is not set -# CONFIG_ICS932S401 is not set -# CONFIG_ENCLOSURE_SERVICES is not set -# CONFIG_HP_ILO is not set -# CONFIG_APDS9802ALS is not set -# CONFIG_ISL29003 is not set -# CONFIG_ISL29020 is not set -# CONFIG_SENSORS_TSL2550 is not set -# CONFIG_SENSORS_BH1770 is not set -# CONFIG_SENSORS_APDS990X is not set -# CONFIG_HMC6352 is not set -# CONFIG_DS1682 is not set -CONFIG_VMWARE_BALLOON=m -# CONFIG_LATTICE_ECP3_CONFIG is not set -# CONFIG_SRAM is not set -# CONFIG_DW_XDATA_PCIE is not set -# CONFIG_PCI_ENDPOINT_TEST is not set -# CONFIG_XILINX_SDFEC is not set -# CONFIG_HISI_HIKEY_USB is not set -# CONFIG_OPEN_DICE is not set -# CONFIG_VCPU_STALL_DETECTOR is not set -# CONFIG_NSM is not set -# CONFIG_MARVELL_CN10K_DPI is not set -# CONFIG_C2PORT is not set - -# EEPROM support -CONFIG_EEPROM_AT24=m -CONFIG_EEPROM_AT25=m -# CONFIG_EEPROM_MAX6875 is not set -CONFIG_EEPROM_93CX6=m -# CONFIG_EEPROM_93XX46 is not set -# CONFIG_EEPROM_IDT_89HPESX is not set -# CONFIG_EEPROM_EE1004 is not set -# end of EEPROM support - -# CONFIG_CB710_CORE is not set - -# Texas Instruments shared transport line discipline -# CONFIG_TI_ST is not set -# end of Texas Instruments shared transport line discipline - -# CONFIG_SENSORS_LIS3_I2C is not set -# CONFIG_ALTERA_STAPL is not set -CONFIG_VMWARE_VMCI=m -# CONFIG_GENWQE is not set -# CONFIG_ECHO is not set -# CONFIG_BCM_VK is not set -# CONFIG_MISC_ALCOR_PCI is not set -# CONFIG_MISC_RTSX_PCI is not set -# CONFIG_MISC_RTSX_USB is not set -# CONFIG_UACCE is not set -# CONFIG_PVPANIC is not set -# CONFIG_GP_PCI1XXXX is not set -# CONFIG_KEBA_CP500 is not set -# end of Misc devices - -# SCSI device support -CONFIG_SCSI_MOD=y -CONFIG_RAID_ATTRS=m -CONFIG_SCSI_COMMON=y -CONFIG_SCSI=y -CONFIG_SCSI_DMA=y -CONFIG_SCSI_NETLINK=y -CONFIG_SCSI_PROC_FS=y - -## SCSI support type (disk, tape, CD-ROM) -CONFIG_BLK_DEV_SD=y -# CONFIG_CHR_DEV_ST is not set -CONFIG_BLK_DEV_SR=y -CONFIG_CHR_DEV_SG=y -CONFIG_BLK_DEV_BSG=y -# CONFIG_CHR_DEV_SCH is not set -# CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_LOGGING is not set -CONFIG_SCSI_SCAN_ASYNC=y - -# SCSI Transports -CONFIG_SCSI_SPI_ATTRS=m -CONFIG_SCSI_FC_ATTRS=m -CONFIG_SCSI_ISCSI_ATTRS=m -CONFIG_SCSI_SAS_ATTRS=m -CONFIG_SCSI_SAS_LIBSAS=m -CONFIG_SCSI_SAS_ATA=y -CONFIG_SCSI_SAS_HOST_SMP=y -CONFIG_SCSI_SRP_ATTRS=m -# end of SCSI Transports - -CONFIG_SCSI_LOWLEVEL=y -CONFIG_ISCSI_TCP=m -CONFIG_ISCSI_BOOT_SYSFS=m -CONFIG_SCSI_CXGB3_ISCSI=m -CONFIG_SCSI_CXGB4_ISCSI=m -CONFIG_SCSI_BNX2_ISCSI=m -# CONFIG_SCSI_BNX2X_FCOE is not set -CONFIG_BE2ISCSI=m -CONFIG_BLK_DEV_3W_XXXX_RAID=m -CONFIG_SCSI_HPSA=m -CONFIG_SCSI_3W_9XXX=m -CONFIG_SCSI_3W_SAS=m -CONFIG_SCSI_ACARD=m -CONFIG_SCSI_AACRAID=m -CONFIG_SCSI_AIC7XXX=m -CONFIG_AIC7XXX_CMDS_PER_DEVICE=32 -CONFIG_AIC7XXX_RESET_DELAY_MS=5000 -# CONFIG_AIC7XXX_DEBUG_ENABLE is not set -CONFIG_AIC7XXX_DEBUG_MASK=0 -CONFIG_AIC7XXX_REG_PRETTY_PRINT=y -CONFIG_SCSI_AIC79XX=m -CONFIG_AIC79XX_CMDS_PER_DEVICE=32 -CONFIG_AIC79XX_RESET_DELAY_MS=5000 -# CONFIG_AIC79XX_DEBUG_ENABLE is not set -CONFIG_AIC79XX_DEBUG_MASK=0 -CONFIG_AIC79XX_REG_PRETTY_PRINT=y -CONFIG_SCSI_AIC94XX=m -# CONFIG_AIC94XX_DEBUG is not set -CONFIG_SCSI_HISI_SAS=m -# CONFIG_SCSI_HISI_SAS_PCI is not set -# CONFIG_SCSI_HISI_SAS_DEBUGFS_DEFAULT_ENABLE is not set -CONFIG_SCSI_MVSAS=m -# CONFIG_SCSI_MVSAS_DEBUG is not set -CONFIG_SCSI_MVSAS_TASKLET=y -CONFIG_SCSI_MVUMI=m -CONFIG_SCSI_ADVANSYS=m -CONFIG_SCSI_ARCMSR=m -CONFIG_SCSI_ESAS2R=m -CONFIG_MEGARAID_NEWGEN=y -CONFIG_MEGARAID_MM=m -CONFIG_MEGARAID_MAILBOX=m -CONFIG_MEGARAID_LEGACY=m -CONFIG_MEGARAID_SAS=m -CONFIG_SCSI_MPT3SAS=m -CONFIG_SCSI_MPT2SAS_MAX_SGE=128 -CONFIG_SCSI_MPT3SAS_MAX_SGE=128 -CONFIG_SCSI_MPT2SAS=m -# CONFIG_SCSI_MPI3MR is not set -# CONFIG_SCSI_SMARTPQI is not set -CONFIG_SCSI_HPTIOP=m -CONFIG_SCSI_BUSLOGIC=m -CONFIG_SCSI_FLASHPOINT=y -# CONFIG_SCSI_MYRB is not set -# CONFIG_SCSI_MYRS is not set -CONFIG_VMWARE_PVSCSI=m -CONFIG_XEN_SCSI_FRONTEND=m -CONFIG_LIBFC=m -CONFIG_LIBFCOE=m -CONFIG_FCOE=m -# CONFIG_SCSI_SNIC is not set -CONFIG_SCSI_DMX3191D=m -# CONFIG_SCSI_FDOMAIN_PCI is not set -CONFIG_SCSI_IPS=m -CONFIG_SCSI_INITIO=m -CONFIG_SCSI_INIA100=m -CONFIG_SCSI_STEX=m -CONFIG_SCSI_SYM53C8XX_2=m -CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 -CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 -CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 -CONFIG_SCSI_SYM53C8XX_MMIO=y -CONFIG_SCSI_IPR=m -CONFIG_SCSI_IPR_TRACE=y -CONFIG_SCSI_IPR_DUMP=y -CONFIG_SCSI_QLOGIC_1280=m -CONFIG_SCSI_QLA_FC=m -CONFIG_SCSI_QLA_ISCSI=m -CONFIG_SCSI_LPFC=m -CONFIG_SCSI_LPFC_DEBUG_FS=y -CONFIG_SCSI_DC395x=m -CONFIG_SCSI_AM53C974=m -CONFIG_SCSI_WD719X=m -CONFIG_SCSI_DEBUG=m -CONFIG_SCSI_PMCRAID=m -CONFIG_SCSI_PM8001=m -CONFIG_SCSI_BFA_FC=m -CONFIG_SCSI_VIRTIO=m -CONFIG_SCSI_CHELSIO_FCOE=m -CONFIG_SCSI_DH=y -CONFIG_SCSI_DH_RDAC=m -CONFIG_SCSI_DH_HP_SW=m -CONFIG_SCSI_DH_EMC=m -CONFIG_SCSI_DH_ALUA=m -# end of SCSI device support - -CONFIG_ATA=y -CONFIG_SATA_HOST=y -CONFIG_PATA_TIMINGS=y -CONFIG_ATA_VERBOSE_ERROR=y -CONFIG_ATA_FORCE=y -CONFIG_ATA_ACPI=y -# CONFIG_SATA_ZPODD is not set -CONFIG_SATA_PMP=y - -## Controllers with non-SFF native interface -CONFIG_SATA_AHCI=y -CONFIG_SATA_MOBILE_LPM_POLICY=0 -CONFIG_SATA_AHCI_PLATFORM=m -# CONFIG_AHCI_DWC is not set -# CONFIG_AHCI_CEVA is not set -# CONFIG_AHCI_MTK is not set -CONFIG_AHCI_MVEBU=m -CONFIG_AHCI_SUNXI=m -CONFIG_AHCI_TEGRA=m -CONFIG_SATA_AHCI_SEATTLE=m -# CONFIG_SATA_INIC162X is not set -# CONFIG_SATA_ACARD_AHCI is not set -CONFIG_SATA_SIL24=m -# CONFIG_ATA_SFF is not set -CONFIG_MD=y -CONFIG_BLK_DEV_MD=m -CONFIG_MD_BITMAP_FILE=y -# CONFIG_MD_LINEAR is not set -CONFIG_MD_RAID0=m -CONFIG_MD_RAID1=m -CONFIG_MD_RAID10=m -CONFIG_MD_RAID456=m -# CONFIG_MD_CLUSTER is not set -# CONFIG_BCACHE is not set -CONFIG_BLK_DEV_DM_BUILTIN=y -CONFIG_BLK_DEV_DM=m -# CONFIG_DM_DEBUG is not set -CONFIG_DM_BUFIO=m -# CONFIG_DM_DEBUG_BLOCK_MANAGER_LOCKING is not set -CONFIG_DM_BIO_PRISON=m -CONFIG_DM_PERSISTENT_DATA=m -# CONFIG_DM_UNSTRIPED is not set -CONFIG_DM_CRYPT=m -CONFIG_DM_SNAPSHOT=m -CONFIG_DM_THIN_PROVISIONING=m -# CONFIG_DM_CACHE is not set -# CONFIG_DM_WRITECACHE is not set -# CONFIG_DM_EBS is not set -# CONFIG_DM_ERA is not set -# CONFIG_DM_CLONE is not set -CONFIG_DM_MIRROR=m -# CONFIG_DM_LOG_USERSPACE is not set -CONFIG_DM_RAID=m -CONFIG_DM_ZERO=m -CONFIG_DM_MULTIPATH=m -# CONFIG_DM_MULTIPATH_QL is not set -# CONFIG_DM_MULTIPATH_ST is not set -# CONFIG_DM_MULTIPATH_HST is not set -# CONFIG_DM_MULTIPATH_IOA is not set -CONFIG_DM_DELAY=m -# CONFIG_DM_DUST is not set -CONFIG_DM_UEVENT=y -CONFIG_DM_FLAKEY=m -CONFIG_DM_VERITY=m -# CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG is not set -# CONFIG_DM_VERITY_FEC is not set -# CONFIG_DM_SWITCH is not set -# CONFIG_DM_LOG_WRITES is not set -# CONFIG_DM_INTEGRITY is not set -# CONFIG_DM_ZONED is not set -# CONFIG_DM_AUDIT is not set -# CONFIG_DM_VDO is not set -# CONFIG_TARGET_CORE is not set -CONFIG_FUSION=y -CONFIG_FUSION_SPI=m -CONFIG_FUSION_FC=m -CONFIG_FUSION_SAS=m -CONFIG_FUSION_MAX_SGE=128 -CONFIG_FUSION_CTL=m -CONFIG_FUSION_LOGGING=y - -# IEEE 1394 (FireWire) support -# CONFIG_FIREWIRE is not set -# CONFIG_FIREWIRE_NOSY is not set -# end of IEEE 1394 (FireWire) support - -CONFIG_NETDEVICES=y -CONFIG_MII=m -CONFIG_NET_CORE=y -CONFIG_BONDING=m -CONFIG_DUMMY=m -CONFIG_WIREGUARD=m -# CONFIG_WIREGUARD_DEBUG is not set -# CONFIG_EQUALIZER is not set -# CONFIG_NET_FC is not set -CONFIG_IFB=m -CONFIG_NET_TEAM=m -CONFIG_NET_TEAM_MODE_BROADCAST=m -CONFIG_NET_TEAM_MODE_ROUNDROBIN=m -CONFIG_NET_TEAM_MODE_RANDOM=m -CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m -CONFIG_NET_TEAM_MODE_LOADBALANCE=m -CONFIG_MACVLAN=m -CONFIG_MACVTAP=m -CONFIG_IPVLAN_L3S=y -CONFIG_IPVLAN=m -# CONFIG_IPVTAP is not set -CONFIG_VXLAN=m -CONFIG_GENEVE=m -# CONFIG_BAREUDP is not set -CONFIG_GTP=m -# CONFIG_PFCP is not set -# CONFIG_AMT is not set -# CONFIG_MACSEC is not set -CONFIG_NETCONSOLE=m -CONFIG_NETCONSOLE_DYNAMIC=y -# CONFIG_NETCONSOLE_EXTENDED_LOG is not set -CONFIG_NETPOLL=y -CONFIG_NET_POLL_CONTROLLER=y -CONFIG_TUN=m -CONFIG_TAP=m -# CONFIG_TUN_VNET_CROSS_LE is not set -CONFIG_VETH=y -CONFIG_VIRTIO_NET=m -# CONFIG_NLMON is not set -# CONFIG_NETKIT is not set -CONFIG_NET_VRF=m -CONFIG_VSOCKMON=m -# CONFIG_ARCNET is not set -CONFIG_ETHERNET=y -CONFIG_MDIO=m -# CONFIG_NET_VENDOR_3COM is not set -# CONFIG_NET_VENDOR_ADAPTEC is not set -CONFIG_NET_VENDOR_AGERE=y -# CONFIG_ET131X is not set -# CONFIG_NET_VENDOR_ALACRITECH is not set -CONFIG_NET_VENDOR_ALLWINNER=y -# CONFIG_SUN4I_EMAC is not set -CONFIG_NET_VENDOR_ALTEON=y -CONFIG_ACENIC=m -# CONFIG_ACENIC_OMIT_TIGON_I is not set -# CONFIG_ALTERA_TSE is not set -# CONFIG_NET_VENDOR_AMAZON is not set -CONFIG_NET_VENDOR_AMD=y -CONFIG_AMD8111_ETH=m -CONFIG_PCNET32=m -# CONFIG_AMD_XGBE is not set -# CONFIG_PDS_CORE is not set -# CONFIG_NET_XGENE is not set -# CONFIG_NET_XGENE_V2 is not set -# CONFIG_NET_VENDOR_AQUANTIA is not set -# CONFIG_NET_VENDOR_ARC is not set -CONFIG_NET_VENDOR_ASIX=y -# CONFIG_SPI_AX88796C is not set -CONFIG_NET_VENDOR_ATHEROS=y -CONFIG_ATL2=m -CONFIG_ATL1=m -CONFIG_ATL1E=m -CONFIG_ATL1C=m -CONFIG_ALX=m -CONFIG_NET_VENDOR_BROADCOM=y -CONFIG_B44=m -CONFIG_B44_PCI_AUTOSELECT=y -CONFIG_B44_PCICORE_AUTOSELECT=y -CONFIG_B44_PCI=y -CONFIG_BCMGENET=m -CONFIG_BNX2=m -CONFIG_CNIC=m -CONFIG_TIGON3=m -CONFIG_TIGON3_HWMON=y -CONFIG_BNX2X=m -CONFIG_BNX2X_SRIOV=y -CONFIG_BGMAC=m -CONFIG_BGMAC_PLATFORM=m -# CONFIG_SYSTEMPORT is not set -# CONFIG_BNXT is not set -CONFIG_NET_VENDOR_CADENCE=y -# CONFIG_MACB is not set -CONFIG_NET_VENDOR_CAVIUM=y -# CONFIG_THUNDER_NIC_PF is not set -# CONFIG_THUNDER_NIC_VF is not set -# CONFIG_THUNDER_NIC_BGX is not set -# CONFIG_THUNDER_NIC_RGX is not set -CONFIG_CAVIUM_PTP=m -# CONFIG_LIQUIDIO is not set -# CONFIG_LIQUIDIO_VF is not set -CONFIG_NET_VENDOR_CHELSIO=y -CONFIG_CHELSIO_T1=m -CONFIG_CHELSIO_T1_1G=y -CONFIG_CHELSIO_T3=m -CONFIG_CHELSIO_T4=m -# CONFIG_CHELSIO_T4_DCB is not set -CONFIG_CHELSIO_T4VF=m -CONFIG_CHELSIO_LIB=m -CONFIG_CHELSIO_INLINE_CRYPTO=y -# CONFIG_CRYPTO_DEV_CHELSIO_TLS is not set -CONFIG_CHELSIO_TLS_DEVICE=m -CONFIG_NET_VENDOR_CISCO=y -CONFIG_ENIC=m -CONFIG_NET_VENDOR_CORTINA=y -# CONFIG_GEMINI_ETHERNET is not set -CONFIG_NET_VENDOR_DAVICOM=y -# CONFIG_DM9051 is not set -# CONFIG_DNET is not set -CONFIG_NET_VENDOR_DEC=y -CONFIG_NET_TULIP=y -# CONFIG_DE2104X is not set -CONFIG_TULIP=m -# CONFIG_TULIP_MWI is not set -CONFIG_TULIP_MMIO=y -CONFIG_TULIP_NAPI=y -# CONFIG_TULIP_NAPI_HW_MITIGATION is not set -# CONFIG_WINBOND_840 is not set -# CONFIG_DM9102 is not set -# CONFIG_ULI526X is not set -CONFIG_NET_VENDOR_DLINK=y -CONFIG_DL2K=m -CONFIG_SUNDANCE=m -# CONFIG_SUNDANCE_MMIO is not set -CONFIG_NET_VENDOR_EMULEX=y -CONFIG_BE2NET=m -CONFIG_BE2NET_HWMON=y -CONFIG_BE2NET_BE2=y -CONFIG_BE2NET_BE3=y -CONFIG_BE2NET_LANCER=y -CONFIG_BE2NET_SKYHAWK=y -CONFIG_NET_VENDOR_ENGLEDER=y -# CONFIG_TSNEP is not set -CONFIG_NET_VENDOR_EZCHIP=y -# CONFIG_EZCHIP_NPS_MANAGEMENT_ENET is not set -CONFIG_NET_VENDOR_FUNGIBLE=y -# CONFIG_FUN_ETH is not set -CONFIG_NET_VENDOR_GOOGLE=y -# CONFIG_GVE is not set -CONFIG_NET_VENDOR_HISILICON=y -# CONFIG_HIX5HD2_GMAC is not set -# CONFIG_HISI_FEMAC is not set -# CONFIG_HIP04_ETH is not set -# CONFIG_HNS_DSAF is not set -# CONFIG_HNS_ENET is not set -# CONFIG_HNS3 is not set -# CONFIG_NET_VENDOR_HUAWEI is not set -CONFIG_NET_VENDOR_I825XX=y -CONFIG_NET_VENDOR_INTEL=y -CONFIG_LIBETH=m -CONFIG_LIBIE=m -CONFIG_E100=m -CONFIG_E1000=m -CONFIG_E1000E=m -CONFIG_IGB=m -CONFIG_IGB_HWMON=y -CONFIG_IGBVF=m -CONFIG_IXGBE=m -CONFIG_IXGBE_HWMON=y -CONFIG_IXGBE_DCB=y -CONFIG_IXGBEVF=m -CONFIG_I40E=m -CONFIG_I40E_DCB=y -CONFIG_IAVF=m -CONFIG_I40EVF=m -# CONFIG_ICE is not set -CONFIG_FM10K=m -CONFIG_IGC=m -# CONFIG_IDPF is not set -CONFIG_JME=m -CONFIG_NET_VENDOR_ADI=y -# CONFIG_ADIN1110 is not set -CONFIG_NET_VENDOR_LITEX=y -# CONFIG_LITEX_LITEETH is not set -CONFIG_NET_VENDOR_MARVELL=y -# CONFIG_MVMDIO is not set -# CONFIG_MVNETA is not set -# CONFIG_MVPP2 is not set -# CONFIG_PXA168_ETH is not set -CONFIG_SKGE=m -# CONFIG_SKGE_DEBUG is not set -# CONFIG_SKGE_GENESIS is not set -CONFIG_SKY2=m -# CONFIG_SKY2_DEBUG is not set -# CONFIG_OCTEONTX2_AF is not set -# CONFIG_OCTEONTX2_PF is not set -# CONFIG_OCTEON_EP is not set -# CONFIG_OCTEON_EP_VF is not set -# CONFIG_PRESTERA is not set -# CONFIG_NET_VENDOR_MEDIATEK is not set -CONFIG_NET_VENDOR_MELLANOX=y -CONFIG_MLX4_EN=m -CONFIG_MLX4_EN_DCB=y -CONFIG_MLX4_CORE=m -CONFIG_MLX4_DEBUG=y -CONFIG_MLX4_CORE_GEN2=y -# CONFIG_MLX5_CORE is not set -# CONFIG_MLXSW_CORE is not set -# CONFIG_MLXFW is not set -# CONFIG_MLXBF_GIGE is not set -# CONFIG_NET_VENDOR_META is not set -# CONFIG_NET_VENDOR_MICREL is not set -CONFIG_NET_VENDOR_MICROCHIP=y -# CONFIG_ENC28J60 is not set -# CONFIG_ENCX24J600 is not set -CONFIG_LAN743X=m -# CONFIG_LAN865X is not set -# CONFIG_LAN966X_SWITCH is not set -# CONFIG_VCAP is not set -CONFIG_NET_VENDOR_MICROSEMI=y -# CONFIG_MSCC_OCELOT_SWITCH is not set -CONFIG_NET_VENDOR_MICROSOFT=y -CONFIG_NET_VENDOR_MYRI=y -CONFIG_MYRI10GE=m -# CONFIG_FEALNX is not set -# CONFIG_NET_VENDOR_NI is not set -# CONFIG_NET_VENDOR_NATSEMI is not set -# CONFIG_NET_VENDOR_NETERION is not set -# CONFIG_NET_VENDOR_NETRONOME is not set -CONFIG_NET_VENDOR_NVIDIA=y -CONFIG_FORCEDETH=m -# CONFIG_NET_VENDOR_OKI is not set -# CONFIG_ETHOC is not set -# CONFIG_OA_TC6 is not set -# CONFIG_NET_VENDOR_PACKET_ENGINES is not set -# CONFIG_NET_VENDOR_PENSANDO is not set -CONFIG_NET_VENDOR_QLOGIC=y -# CONFIG_QLA3XXX is not set -# CONFIG_QLCNIC is not set -CONFIG_NETXEN_NIC=m -# CONFIG_QED is not set -CONFIG_NET_VENDOR_BROCADE=y -CONFIG_BNA=m -CONFIG_NET_VENDOR_QUALCOMM=y -# CONFIG_QCA7000_SPI is not set -# CONFIG_QCA7000_UART is not set -# CONFIG_QCOM_EMAC is not set -# CONFIG_RMNET is not set -# CONFIG_NET_VENDOR_RDC is not set -CONFIG_NET_VENDOR_REALTEK=y -CONFIG_8139CP=m -CONFIG_8139TOO=m -CONFIG_8139TOO_PIO=y -CONFIG_8139TOO_TUNE_TWISTER=y -CONFIG_8139TOO_8129=y -# CONFIG_8139_OLD_RX_RESET is not set -CONFIG_R8169=m -# CONFIG_RTASE is not set -CONFIG_NET_VENDOR_RENESAS=y -CONFIG_NET_VENDOR_ROCKER=y -# CONFIG_ROCKER is not set -CONFIG_NET_VENDOR_SAMSUNG=y -# CONFIG_SXGBE_ETH is not set -# CONFIG_NET_VENDOR_SEEQ is not set -# CONFIG_NET_VENDOR_SILAN is not set -# CONFIG_NET_VENDOR_SIS is not set -# CONFIG_NET_VENDOR_SOLARFLARE is not set -# CONFIG_NET_VENDOR_SMSC is not set -# CONFIG_NET_VENDOR_SOCIONEXT is not set -# CONFIG_NET_VENDOR_STMICRO is not set -# CONFIG_NET_VENDOR_SUN is not set -# CONFIG_NET_VENDOR_SYNOPSYS is not set -# CONFIG_NET_VENDOR_TEHUTI is not set -# CONFIG_NET_VENDOR_TI is not set -CONFIG_NET_VENDOR_VERTEXCOM=y -# CONFIG_MSE102X is not set -# CONFIG_NET_VENDOR_VIA is not set -CONFIG_NET_VENDOR_WANGXUN=y -# CONFIG_NGBE is not set -# CONFIG_NET_VENDOR_WIZNET is not set -CONFIG_NET_VENDOR_XILINX=y -# CONFIG_XILINX_EMACLITE is not set -# CONFIG_XILINX_LL_TEMAC is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -CONFIG_PHYLINK=m -CONFIG_PHYLIB=y -CONFIG_SWPHY=y -# CONFIG_LED_TRIGGER_PHY is not set -CONFIG_FIXED_PHY=y -# CONFIG_SFP is not set - -## MII PHY device drivers -# CONFIG_AIR_EN8811H_PHY is not set -CONFIG_AMD_PHY=m -# CONFIG_MESON_GXL_PHY is not set -# CONFIG_ADIN_PHY is not set -# CONFIG_ADIN1100_PHY is not set -# CONFIG_AQUANTIA_PHY is not set -CONFIG_AX88796B_PHY=m -CONFIG_BROADCOM_PHY=m -# CONFIG_BCM54140_PHY is not set -CONFIG_BCM7XXX_PHY=m -# CONFIG_BCM84881_PHY is not set -CONFIG_BCM87XX_PHY=m -# CONFIG_BCM_CYGNUS_PHY is not set -CONFIG_BCM_NET_PHYLIB=m -CONFIG_BCM_NET_PHYPTP=m -# CONFIG_CICADA_PHY is not set -# CONFIG_CORTINA_PHY is not set -# CONFIG_DAVICOM_PHY is not set -# CONFIG_ICPLUS_PHY is not set -CONFIG_LXT_PHY=m -# CONFIG_INTEL_XWAY_PHY is not set -CONFIG_LSI_ET1011C_PHY=m -CONFIG_MARVELL_PHY=m -# CONFIG_MARVELL_10G_PHY is not set -# CONFIG_MARVELL_88Q2XXX_PHY is not set -# CONFIG_MARVELL_88X2222_PHY is not set -# CONFIG_MAXLINEAR_GPHY is not set -# CONFIG_MEDIATEK_GE_PHY is not set -CONFIG_MICREL_PHY=m -# CONFIG_MICROCHIP_T1S_PHY is not set -CONFIG_MICROCHIP_PHY=m -CONFIG_MICROCHIP_T1_PHY=m -# CONFIG_MICROSEMI_PHY is not set -# CONFIG_MOTORCOMM_PHY is not set -CONFIG_NATIONAL_PHY=m -# CONFIG_NXP_CBTX_PHY is not set -# CONFIG_NXP_C45_TJA11XX_PHY is not set -# CONFIG_NXP_TJA11XX_PHY is not set -# CONFIG_NCN26000_PHY is not set -CONFIG_QCOM_NET_PHYLIB=m -CONFIG_AT803X_PHY=m -# CONFIG_QCA83XX_PHY is not set -# CONFIG_QCA808X_PHY is not set -# CONFIG_QCA807X_PHY is not set -# CONFIG_QSEMI_PHY is not set -CONFIG_REALTEK_PHY=m -# CONFIG_RENESAS_PHY is not set -# CONFIG_ROCKCHIP_PHY is not set -CONFIG_SMSC_PHY=m -CONFIG_STE10XP=m -# CONFIG_TERANETICS_PHY is not set -# CONFIG_DP83822_PHY is not set -# CONFIG_DP83TC811_PHY is not set -# CONFIG_DP83848_PHY is not set -# CONFIG_DP83867_PHY is not set -# CONFIG_DP83869_PHY is not set -# CONFIG_DP83TD510_PHY is not set -# CONFIG_DP83TG720_PHY is not set -# CONFIG_VITESSE_PHY is not set -# CONFIG_XILINX_GMII2RGMII is not set -# CONFIG_MICREL_KS8995MA is not set -# CONFIG_PSE_CONTROLLER is not set -CONFIG_MDIO_DEVICE=y -CONFIG_MDIO_BUS=y -CONFIG_FWNODE_MDIO=y -CONFIG_OF_MDIO=y -CONFIG_ACPI_MDIO=y -CONFIG_MDIO_DEVRES=y -# CONFIG_MDIO_SUN4I is not set -# CONFIG_MDIO_XGENE is not set -# CONFIG_MDIO_BITBANG is not set -CONFIG_MDIO_BCM_IPROC=m -CONFIG_MDIO_BCM_UNIMAC=y -# CONFIG_MDIO_HISI_FEMAC is not set -# CONFIG_MDIO_MVUSB is not set -# CONFIG_MDIO_MSCC_MIIM is not set -# CONFIG_MDIO_OCTEON is not set -# CONFIG_MDIO_IPQ4019 is not set -# CONFIG_MDIO_IPQ8064 is not set -# CONFIG_MDIO_THUNDER is not set - -## MDIO Multiplexers -CONFIG_MDIO_BUS_MUX=m -# CONFIG_MDIO_BUS_MUX_MESON_G12A is not set -CONFIG_MDIO_BUS_MUX_MESON_GXL=m -CONFIG_MDIO_BUS_MUX_BCM_IPROC=m -# CONFIG_MDIO_BUS_MUX_GPIO is not set -# CONFIG_MDIO_BUS_MUX_MULTIPLEXER is not set -# CONFIG_MDIO_BUS_MUX_MMIOREG is not set - -# PCS device drivers -# CONFIG_PCS_XPCS is not set -# end of PCS device drivers - -# CONFIG_PPP is not set -# CONFIG_SLIP is not set - -## Host-side USB support is needed for USB Network Adapter support -CONFIG_USB_NET_DRIVERS=m -# CONFIG_USB_CATC is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_RTL8150 is not set -# CONFIG_USB_RTL8152 is not set -CONFIG_USB_LAN78XX=m -CONFIG_USB_USBNET=m -# CONFIG_USB_NET_AX8817X is not set -# CONFIG_USB_NET_AX88179_178A is not set -# CONFIG_USB_NET_CDCETHER is not set -# CONFIG_USB_NET_CDC_EEM is not set -# CONFIG_USB_NET_CDC_NCM is not set -# CONFIG_USB_NET_HUAWEI_CDC_NCM is not set -# CONFIG_USB_NET_CDC_MBIM is not set -# CONFIG_USB_NET_DM9601 is not set -# CONFIG_USB_NET_SR9700 is not set -# CONFIG_USB_NET_SR9800 is not set -# CONFIG_USB_NET_SMSC75XX is not set -CONFIG_USB_NET_SMSC95XX=m -# CONFIG_USB_NET_GL620A is not set -# CONFIG_USB_NET_NET1080 is not set -# CONFIG_USB_NET_PLUSB is not set -# CONFIG_USB_NET_MCS7830 is not set -# CONFIG_USB_NET_RNDIS_HOST is not set -# CONFIG_USB_NET_CDC_SUBSET is not set -# CONFIG_USB_NET_ZAURUS is not set -# CONFIG_USB_NET_CX82310_ETH is not set -# CONFIG_USB_NET_KALMIA is not set -# CONFIG_USB_NET_QMI_WWAN is not set -# CONFIG_USB_NET_INT51X1 is not set -# CONFIG_USB_IPHETH is not set -# CONFIG_USB_SIERRA_NET is not set -# CONFIG_USB_NET_CH9200 is not set -# CONFIG_USB_NET_AQC111 is not set -CONFIG_WLAN=y -# CONFIG_WLAN_VENDOR_ADMTEK is not set -CONFIG_ATH_COMMON=m -CONFIG_WLAN_VENDOR_ATH=y -# CONFIG_ATH_DEBUG is not set -# CONFIG_ATH5K is not set -# CONFIG_ATH5K_PCI is not set -CONFIG_ATH9K_HW=m -CONFIG_ATH9K_COMMON=m -CONFIG_ATH9K_BTCOEX_SUPPORT=y -CONFIG_ATH9K=m -CONFIG_ATH9K_PCI=y -# CONFIG_ATH9K_AHB is not set -# CONFIG_ATH9K_DYNACK is not set -# CONFIG_ATH9K_WOW is not set -# CONFIG_ATH9K_CHANNEL_CONTEXT is not set -CONFIG_ATH9K_PCOEM=y -# CONFIG_ATH9K_PCI_NO_EEPROM is not set -# CONFIG_ATH9K_HTC is not set -# CONFIG_ATH9K_HWRNG is not set -# CONFIG_CARL9170 is not set -# CONFIG_ATH6KL is not set -# CONFIG_AR5523 is not set -# CONFIG_WIL6210 is not set -CONFIG_ATH10K=m -CONFIG_ATH10K_CE=y -CONFIG_ATH10K_PCI=m -# CONFIG_ATH10K_AHB is not set -# CONFIG_ATH10K_SDIO is not set -# CONFIG_ATH10K_USB is not set -# CONFIG_ATH10K_DEBUG is not set -# CONFIG_ATH10K_DEBUGFS is not set -CONFIG_ATH10K_LEDS=y -# CONFIG_ATH10K_TRACING is not set -# CONFIG_WCN36XX is not set -# CONFIG_ATH11K is not set -# CONFIG_ATH12K is not set -# CONFIG_WLAN_VENDOR_ATMEL is not set -CONFIG_WLAN_VENDOR_BROADCOM=y -CONFIG_B43=m -CONFIG_B43_BCMA=y -CONFIG_B43_SSB=y -CONFIG_B43_BUSES_BCMA_AND_SSB=y -# CONFIG_B43_BUSES_BCMA is not set -# CONFIG_B43_BUSES_SSB is not set -CONFIG_B43_PCI_AUTOSELECT=y -CONFIG_B43_PCICORE_AUTOSELECT=y -CONFIG_B43_SDIO=y -CONFIG_B43_BCMA_PIO=y -CONFIG_B43_PIO=y -CONFIG_B43_PHY_G=y -CONFIG_B43_PHY_N=y -CONFIG_B43_PHY_LP=y -CONFIG_B43_PHY_HT=y -CONFIG_B43_LEDS=y -CONFIG_B43_HWRNG=y -# CONFIG_B43_DEBUG is not set -# CONFIG_B43LEGACY is not set -CONFIG_BRCMUTIL=m -# CONFIG_BRCMSMAC is not set -CONFIG_BRCMFMAC=m -CONFIG_BRCMFMAC_PROTO_BCDC=y -CONFIG_BRCMFMAC_SDIO=y -CONFIG_BRCMFMAC_USB=y -# CONFIG_BRCMFMAC_PCIE is not set -# CONFIG_BRCM_TRACING is not set -# CONFIG_BRCMDBG is not set -# CONFIG_WLAN_VENDOR_INTEL is not set -# CONFIG_WLAN_VENDOR_INTERSIL is not set -# CONFIG_WLAN_VENDOR_MARVELL is not set -# CONFIG_WLAN_VENDOR_MEDIATEK is not set -# CONFIG_WLAN_VENDOR_MICROCHIP is not set -CONFIG_WLAN_VENDOR_PURELIFI=y -# CONFIG_PLFXLC is not set -# CONFIG_WLAN_VENDOR_RALINK is not set -# CONFIG_WLAN_VENDOR_REALTEK is not set -# CONFIG_WLAN_VENDOR_RSI is not set -CONFIG_WLAN_VENDOR_SILABS=y -# CONFIG_WFX is not set -# CONFIG_WLAN_VENDOR_ST is not set -# CONFIG_WLAN_VENDOR_TI is not set -# CONFIG_WLAN_VENDOR_ZYDAS is not set -# CONFIG_WLAN_VENDOR_QUANTENNA is not set -# CONFIG_MAC80211_HWSIM is not set -# CONFIG_VIRT_WIFI is not set -# CONFIG_WAN is not set - -# Wireless WAN -# CONFIG_WWAN is not set -# end of Wireless WAN - -CONFIG_XEN_NETDEV_FRONTEND=m -# CONFIG_XEN_NETDEV_BACKEND is not set -CONFIG_VMXNET3=y -# CONFIG_FUJITSU_ES is not set -# CONFIG_NETDEVSIM is not set -CONFIG_NET_FAILOVER=m -# CONFIG_ISDN is not set - -# Input device support -CONFIG_INPUT=y -CONFIG_INPUT_LEDS=m -CONFIG_INPUT_FF_MEMLESS=m -# CONFIG_INPUT_SPARSEKMAP is not set -# CONFIG_INPUT_MATRIXKMAP is not set -CONFIG_INPUT_VIVALDIFMAP=y - -## Userland interfaces -CONFIG_INPUT_MOUSEDEV=m -# CONFIG_INPUT_MOUSEDEV_PSAUX is not set -CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 -CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -# CONFIG_INPUT_JOYDEV is not set -CONFIG_INPUT_EVDEV=m -# CONFIG_INPUT_EVBUG is not set - -## Input Device Drivers -CONFIG_INPUT_KEYBOARD=y -# CONFIG_KEYBOARD_ADP5588 is not set -# CONFIG_KEYBOARD_ADP5589 is not set -CONFIG_KEYBOARD_ATKBD=y -# CONFIG_KEYBOARD_QT1050 is not set -# CONFIG_KEYBOARD_QT1070 is not set -# CONFIG_KEYBOARD_QT2160 is not set -# CONFIG_KEYBOARD_DLINK_DIR685 is not set -# CONFIG_KEYBOARD_LKKBD is not set -# CONFIG_KEYBOARD_GPIO is not set -# CONFIG_KEYBOARD_GPIO_POLLED is not set -# CONFIG_KEYBOARD_TCA6416 is not set -# CONFIG_KEYBOARD_TCA8418 is not set -# CONFIG_KEYBOARD_MATRIX is not set -# CONFIG_KEYBOARD_LM8323 is not set -# CONFIG_KEYBOARD_LM8333 is not set -# CONFIG_KEYBOARD_MAX7359 is not set -# CONFIG_KEYBOARD_MPR121 is not set -# CONFIG_KEYBOARD_NEWTON is not set -# CONFIG_KEYBOARD_TEGRA is not set -# CONFIG_KEYBOARD_OPENCORES is not set -# CONFIG_KEYBOARD_PINEPHONE is not set -# CONFIG_KEYBOARD_SAMSUNG is not set -# CONFIG_KEYBOARD_STOWAWAY is not set -# CONFIG_KEYBOARD_SUNKBD is not set -# CONFIG_KEYBOARD_SUN4I_LRADC is not set -# CONFIG_KEYBOARD_OMAP4 is not set -# CONFIG_KEYBOARD_TM2_TOUCHKEY is not set -# CONFIG_KEYBOARD_XTKBD is not set -# CONFIG_KEYBOARD_CAP11XX is not set -# CONFIG_KEYBOARD_BCM is not set -# CONFIG_KEYBOARD_MT6779 is not set -# CONFIG_KEYBOARD_CYPRESS_SF is not set -CONFIG_INPUT_MOUSE=y -CONFIG_MOUSE_PS2=m -CONFIG_MOUSE_PS2_ALPS=y -# CONFIG_MOUSE_PS2_BYD is not set -CONFIG_MOUSE_PS2_LOGIPS2PP=y -CONFIG_MOUSE_PS2_SYNAPTICS=y -# CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS is not set -CONFIG_MOUSE_PS2_CYPRESS=y -CONFIG_MOUSE_PS2_TRACKPOINT=y -# CONFIG_MOUSE_PS2_ELANTECH is not set -# CONFIG_MOUSE_PS2_SENTELIC is not set -# CONFIG_MOUSE_PS2_TOUCHKIT is not set -CONFIG_MOUSE_PS2_FOCALTECH=y -# CONFIG_MOUSE_SERIAL is not set -# CONFIG_MOUSE_APPLETOUCH is not set -# CONFIG_MOUSE_BCM5974 is not set -# CONFIG_MOUSE_CYAPA is not set -# CONFIG_MOUSE_ELAN_I2C is not set -# CONFIG_MOUSE_VSXXXAA is not set -# CONFIG_MOUSE_GPIO is not set -# CONFIG_MOUSE_SYNAPTICS_I2C is not set -# CONFIG_MOUSE_SYNAPTICS_USB is not set -# CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_TABLET is not set -# CONFIG_INPUT_TOUCHSCREEN is not set -CONFIG_INPUT_MISC=y -# CONFIG_INPUT_AD714X is not set -# CONFIG_INPUT_ATMEL_CAPTOUCH is not set -# CONFIG_INPUT_BMA150 is not set -# CONFIG_INPUT_E3X0_BUTTON is not set -# CONFIG_INPUT_MMA8450 is not set -# CONFIG_INPUT_GPIO_BEEPER is not set -# CONFIG_INPUT_GPIO_DECODER is not set -# CONFIG_INPUT_GPIO_VIBRA is not set -# CONFIG_INPUT_ATI_REMOTE2 is not set -# CONFIG_INPUT_KEYSPAN_REMOTE is not set -# CONFIG_INPUT_KXTJ9 is not set -# CONFIG_INPUT_POWERMATE is not set -# CONFIG_INPUT_YEALINK is not set -# CONFIG_INPUT_CM109 is not set -# CONFIG_INPUT_REGULATOR_HAPTIC is not set -# CONFIG_INPUT_UINPUT is not set -# CONFIG_INPUT_PCF8574 is not set -# CONFIG_INPUT_PWM_BEEPER is not set -# CONFIG_INPUT_PWM_VIBRA is not set -# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set -# CONFIG_INPUT_DA7280_HAPTICS is not set -# CONFIG_INPUT_ADXL34X is not set -# CONFIG_INPUT_IBM_PANEL is not set -# CONFIG_INPUT_IMS_PCU is not set -# CONFIG_INPUT_IQS269A is not set -# CONFIG_INPUT_IQS626A is not set -# CONFIG_INPUT_IQS7222 is not set -# CONFIG_INPUT_CMA3000 is not set -CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y -# CONFIG_INPUT_DRV260X_HAPTICS is not set -# CONFIG_INPUT_DRV2665_HAPTICS is not set -# CONFIG_INPUT_DRV2667_HAPTICS is not set -# CONFIG_INPUT_HISI_POWERKEY is not set -# CONFIG_RMI4_CORE is not set - -# Hardware I/O ports -CONFIG_SERIO=y -# CONFIG_SERIO_SERPORT is not set -# CONFIG_SERIO_AMBAKMI is not set -# CONFIG_SERIO_PCIPS2 is not set -CONFIG_SERIO_LIBPS2=y -# CONFIG_SERIO_RAW is not set -# CONFIG_SERIO_ALTERA_PS2 is not set -# CONFIG_SERIO_PS2MULT is not set -# CONFIG_SERIO_ARC_PS2 is not set -# CONFIG_SERIO_APBPS2 is not set -# CONFIG_SERIO_SUN4I_PS2 is not set -# CONFIG_SERIO_GPIO_PS2 is not set -# CONFIG_USERIO is not set -# CONFIG_GAMEPORT is not set -# end of Hardware I/O ports -# end of Input device support - -# Character devices -CONFIG_TTY=y -CONFIG_VT=y -CONFIG_CONSOLE_TRANSLATIONS=y -CONFIG_VT_CONSOLE=y -CONFIG_VT_CONSOLE_SLEEP=y -CONFIG_VT_HW_CONSOLE_BINDING=y -CONFIG_UNIX98_PTYS=y -# CONFIG_LEGACY_PTYS is not set -CONFIG_LEGACY_TIOCSTI=y -CONFIG_LDISC_AUTOLOAD=y - -# Serial drivers -CONFIG_SERIAL_EARLYCON=y -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y -CONFIG_SERIAL_8250_PNP=y -CONFIG_SERIAL_8250_16550A_VARIANTS=y -# CONFIG_SERIAL_8250_FINTEK is not set -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_DMA=y -CONFIG_SERIAL_8250_PCILIB=y -CONFIG_SERIAL_8250_PCI=y -# CONFIG_SERIAL_8250_EXAR is not set -CONFIG_SERIAL_8250_NR_UARTS=32 -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -CONFIG_SERIAL_8250_EXTENDED=y -CONFIG_SERIAL_8250_MANY_PORTS=y -# CONFIG_SERIAL_8250_PCI1XXXX is not set -CONFIG_SERIAL_8250_SHARE_IRQ=y -# CONFIG_SERIAL_8250_DETECT_IRQ is not set -CONFIG_SERIAL_8250_RSA=y -CONFIG_SERIAL_8250_DWLIB=y -CONFIG_SERIAL_8250_BCM2835AUX=m -CONFIG_SERIAL_8250_FSL=y -CONFIG_SERIAL_8250_DW=m -# CONFIG_SERIAL_8250_RT288X is not set -# CONFIG_SERIAL_8250_MT6577 is not set -CONFIG_SERIAL_8250_PERICOM=m -CONFIG_SERIAL_8250_TEGRA=m -CONFIG_SERIAL_OF_PLATFORM=y - -## Non-8250 serial port support -CONFIG_SERIAL_AMBA_PL010=y -CONFIG_SERIAL_AMBA_PL010_CONSOLE=y -CONFIG_SERIAL_AMBA_PL011=y -CONFIG_SERIAL_AMBA_PL011_CONSOLE=y -# CONFIG_SERIAL_EARLYCON_SEMIHOST is not set -# CONFIG_SERIAL_MESON is not set -# CONFIG_SERIAL_SAMSUNG is not set -# CONFIG_SERIAL_MAX3100 is not set -# CONFIG_SERIAL_MAX310X is not set -# CONFIG_SERIAL_UARTLITE is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_JSM is not set -# CONFIG_SERIAL_MSM is not set -# CONFIG_SERIAL_SIFIVE is not set -# CONFIG_SERIAL_SCCNXP is not set -CONFIG_SERIAL_SC16IS7XX=m -CONFIG_SERIAL_SC16IS7XX_I2C=m -CONFIG_SERIAL_SC16IS7XX_SPI=m -# CONFIG_SERIAL_ALTERA_JTAGUART is not set -# CONFIG_SERIAL_ALTERA_UART is not set -# CONFIG_SERIAL_XILINX_PS_UART is not set -# CONFIG_SERIAL_ARC is not set -# CONFIG_SERIAL_RP2 is not set -# CONFIG_SERIAL_FSL_LPUART is not set -# CONFIG_SERIAL_FSL_LINFLEXUART is not set -# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set -# CONFIG_SERIAL_SPRD is not set -# CONFIG_SERIAL_MVEBU_UART is not set -# end of Serial drivers - -CONFIG_SERIAL_MCTRL_GPIO=y -# CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_N_GSM is not set -# CONFIG_NOZOMI is not set -# CONFIG_NULL_TTY is not set -CONFIG_HVC_DRIVER=y -CONFIG_HVC_IRQ=y -CONFIG_HVC_XEN=y -CONFIG_HVC_XEN_FRONTEND=y -# CONFIG_HVC_DCC is not set -CONFIG_SERIAL_DEV_BUS=y -CONFIG_SERIAL_DEV_CTRL_TTYPORT=y -# CONFIG_TTY_PRINTK is not set -CONFIG_VIRTIO_CONSOLE=m -CONFIG_IPMI_HANDLER=m -CONFIG_IPMI_DMI_DECODE=y -CONFIG_IPMI_PLAT_DATA=y -CONFIG_IPMI_PANIC_EVENT=y -CONFIG_IPMI_PANIC_STRING=y -CONFIG_IPMI_DEVICE_INTERFACE=m -CONFIG_IPMI_SI=m -# CONFIG_IPMI_SSIF is not set -# CONFIG_IPMI_IPMB is not set -CONFIG_IPMI_WATCHDOG=m -CONFIG_IPMI_POWEROFF=m -# CONFIG_SSIF_IPMI_BMC is not set -# CONFIG_IPMB_DEVICE_INTERFACE is not set -CONFIG_HW_RANDOM=m -CONFIG_HW_RANDOM_TIMERIOMEM=m -# CONFIG_HW_RANDOM_BA431 is not set -CONFIG_HW_RANDOM_BCM2835=m -CONFIG_HW_RANDOM_IPROC_RNG200=m -# CONFIG_HW_RANDOM_OMAP is not set -CONFIG_HW_RANDOM_VIRTIO=m -CONFIG_HW_RANDOM_HISI=m -CONFIG_HW_RANDOM_HISTB=m -CONFIG_HW_RANDOM_XGENE=m -CONFIG_HW_RANDOM_MESON=m -CONFIG_HW_RANDOM_CAVIUM=m -# CONFIG_HW_RANDOM_MTK is not set -# CONFIG_HW_RANDOM_EXYNOS is not set -# CONFIG_HW_RANDOM_CCTRNG is not set -# CONFIG_HW_RANDOM_XIPHERA is not set -CONFIG_HW_RANDOM_ARM_SMCCC_TRNG=m -CONFIG_HW_RANDOM_CN10K=m -CONFIG_HW_RANDOM_ROCKCHIP=m -# CONFIG_APPLICOM is not set -CONFIG_DEVMEM=y -CONFIG_DEVPORT=y -CONFIG_TCG_TPM=y -CONFIG_TCG_TPM2_HMAC=y -CONFIG_TCG_TIS_CORE=m -CONFIG_TCG_TIS=m -CONFIG_TCG_TIS_SPI=m -CONFIG_TCG_TIS_SPI_CR50=y -CONFIG_TCG_TIS_I2C=m -CONFIG_TCG_TIS_I2C_CR50=m -CONFIG_TCG_TIS_I2C_ATMEL=m -CONFIG_TCG_TIS_I2C_INFINEON=m -CONFIG_TCG_TIS_I2C_NUVOTON=m -CONFIG_TCG_ATMEL=m -CONFIG_TCG_INFINEON=m -CONFIG_TCG_XEN=m -CONFIG_TCG_CRB=y -CONFIG_TCG_VTPM_PROXY=m -CONFIG_TCG_TIS_ST33ZP24=m -CONFIG_TCG_TIS_ST33ZP24_I2C=m -CONFIG_TCG_TIS_ST33ZP24_SPI=m -# CONFIG_XILLYBUS is not set -# CONFIG_XILLYUSB is not set -# end of Character devices - -# I2C support -CONFIG_I2C=y -CONFIG_ACPI_I2C_OPREGION=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=m -CONFIG_I2C_MUX=m - -# Multiplexer I2C Chip support -# CONFIG_I2C_ARB_GPIO_CHALLENGE is not set -# CONFIG_I2C_MUX_GPIO is not set -# CONFIG_I2C_MUX_GPMUX is not set -# CONFIG_I2C_MUX_LTC4306 is not set -# CONFIG_I2C_MUX_PCA9541 is not set -CONFIG_I2C_MUX_PCA954x=m -# CONFIG_I2C_MUX_PINCTRL is not set -# CONFIG_I2C_MUX_REG is not set -# CONFIG_I2C_DEMUX_PINCTRL is not set -# CONFIG_I2C_MUX_MLXCPLD is not set -# end of Multiplexer I2C Chip support - -CONFIG_I2C_HELPER_AUTO=y -CONFIG_I2C_SMBUS=m -CONFIG_I2C_ALGOBIT=m - -# I2C Hardware Bus support - -## PC SMBus host controller drivers -# CONFIG_I2C_ALI1535 is not set -# CONFIG_I2C_ALI1563 is not set -# CONFIG_I2C_ALI15X3 is not set -CONFIG_I2C_AMD756=m -CONFIG_I2C_AMD8111=m -# CONFIG_I2C_AMD_MP2 is not set -# CONFIG_I2C_HIX5HD2 is not set -CONFIG_I2C_I801=m -# CONFIG_I2C_ISCH is not set -CONFIG_I2C_PIIX4=m -# CONFIG_I2C_NFORCE2 is not set -# CONFIG_I2C_NVIDIA_GPU is not set -# CONFIG_I2C_SIS5595 is not set -# CONFIG_I2C_SIS630 is not set -# CONFIG_I2C_SIS96X is not set -# CONFIG_I2C_VIA is not set -# CONFIG_I2C_VIAPRO is not set -# CONFIG_I2C_ZHAOXIN is not set - -## ACPI drivers -# CONFIG_I2C_SCMI is not set - -## I2C system bus drivers (mostly embedded / system-on-chip) -CONFIG_I2C_BCM2835=m -CONFIG_I2C_BCM_IPROC=m -CONFIG_I2C_BRCMSTB=m -# CONFIG_I2C_CADENCE is not set -# CONFIG_I2C_CBUS_GPIO is not set -# CONFIG_I2C_DESIGNWARE_CORE is not set -# CONFIG_I2C_EMEV2 is not set -CONFIG_I2C_EXYNOS5=m -CONFIG_I2C_GPIO=m -# CONFIG_I2C_GPIO_FAULT_INJECTOR is not set -# CONFIG_I2C_HISI is not set -# CONFIG_I2C_MESON is not set -# CONFIG_I2C_MT65XX is not set -CONFIG_I2C_MV64XXX=m -# CONFIG_I2C_NOMADIK is not set -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PCA_PLATFORM is not set -# CONFIG_I2C_PXA is not set -# CONFIG_I2C_QCOM_CCI is not set -CONFIG_I2C_QUP=m -CONFIG_I2C_RK3X=m -# CONFIG_I2C_S3C2410 is not set -# CONFIG_I2C_SIMTEC is not set -# CONFIG_I2C_SPRD is not set -CONFIG_I2C_TEGRA=m -# CONFIG_I2C_VERSATILE is not set -CONFIG_I2C_THUNDERX=m -# CONFIG_I2C_XILINX is not set - -## External I2C/SMBus adapter drivers -# CONFIG_I2C_DIOLAN_U2C is not set -# CONFIG_I2C_CP2615 is not set -# CONFIG_I2C_PCI1XXXX is not set -# CONFIG_I2C_ROBOTFUZZ_OSIF is not set -# CONFIG_I2C_TAOS_EVM is not set -# CONFIG_I2C_TINY_USB is not set - -## Other I2C/SMBus bus drivers -# CONFIG_I2C_MLXCPLD is not set -CONFIG_I2C_XGENE_SLIMPRO=m -# CONFIG_I2C_VIRTIO is not set -# end of I2C Hardware Bus support - -# CONFIG_I2C_STUB is not set -CONFIG_I2C_SLAVE=y -# CONFIG_I2C_SLAVE_EEPROM is not set -# CONFIG_I2C_SLAVE_TESTUNIT is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# end of I2C support - -# CONFIG_I3C is not set -CONFIG_SPI=y -# CONFIG_SPI_DEBUG is not set -CONFIG_SPI_MASTER=y -CONFIG_SPI_MEM=y - -## SPI Master Controller Drivers -# CONFIG_SPI_ALTERA is not set -# CONFIG_SPI_AMLOGIC_SPIFC_A1 is not set -# CONFIG_SPI_ARMADA_3700 is not set -# CONFIG_SPI_AXI_SPI_ENGINE is not set -CONFIG_SPI_BCM2835=m -CONFIG_SPI_BCM2835AUX=m -CONFIG_SPI_BCM_QSPI=m -CONFIG_SPI_BITBANG=m -CONFIG_SPI_CADENCE=m -# CONFIG_SPI_CADENCE_QUADSPI is not set -# CONFIG_SPI_CADENCE_XSPI is not set -# CONFIG_SPI_CH341 is not set -# CONFIG_SPI_DESIGNWARE is not set -# CONFIG_SPI_HISI_KUNPENG is not set -# CONFIG_SPI_HISI_SFC_V3XX is not set -CONFIG_SPI_GPIO=m -CONFIG_SPI_FSL_LIB=m -CONFIG_SPI_FSL_SPI=m -# CONFIG_SPI_MESON_SPICC is not set -# CONFIG_SPI_MESON_SPIFC is not set -# CONFIG_SPI_MICROCHIP_CORE is not set -# CONFIG_SPI_MICROCHIP_CORE_QSPI is not set -# CONFIG_SPI_MT65XX is not set -# CONFIG_SPI_MTK_NOR is not set -# CONFIG_SPI_OC_TINY is not set -# CONFIG_SPI_ORION is not set -# CONFIG_SPI_PCI1XXXX is not set -# CONFIG_SPI_PL022 is not set -CONFIG_SPI_ROCKCHIP=m -# CONFIG_SPI_ROCKCHIP_SFC is not set -# CONFIG_SPI_QCOM_QSPI is not set -CONFIG_SPI_QUP=m -# CONFIG_SPI_S3C64XX is not set -# CONFIG_SPI_SC18IS602 is not set -# CONFIG_SPI_SIFIVE is not set -# CONFIG_SPI_SN_F_OSPI is not set -# CONFIG_SPI_SPRD is not set -# CONFIG_SPI_SUN4I is not set -# CONFIG_SPI_SUN6I is not set -# CONFIG_SPI_MXIC is not set -# CONFIG_SPI_TEGRA210_QUAD is not set -# CONFIG_SPI_TEGRA114 is not set -# CONFIG_SPI_TEGRA20_SFLASH is not set -CONFIG_SPI_THUNDERX=m -# CONFIG_SPI_XCOMM is not set -# CONFIG_SPI_XILINX is not set -# CONFIG_SPI_ZYNQMP_GQSPI is not set -# CONFIG_SPI_AMD is not set - -## SPI Multiplexer support -# CONFIG_SPI_MUX is not set - -## SPI Protocol Masters -CONFIG_SPI_SPIDEV=m -# CONFIG_SPI_LOOPBACK_TEST is not set -# CONFIG_SPI_TLE62X0 is not set -# CONFIG_SPI_SLAVE is not set -CONFIG_SPI_DYNAMIC=y -# CONFIG_SPMI is not set -# CONFIG_HSI is not set -CONFIG_PPS=y -# CONFIG_PPS_DEBUG is not set - -## PPS clients support -# CONFIG_PPS_CLIENT_KTIMER is not set -# CONFIG_PPS_CLIENT_LDISC is not set -# CONFIG_PPS_CLIENT_GPIO is not set - -## PPS generators support - -# PTP clock support -CONFIG_PTP_1588_CLOCK=y -CONFIG_PTP_1588_CLOCK_OPTIONAL=y -CONFIG_PTP_1588_CLOCK_DTE=m -# CONFIG_DP83640_PHY is not set -# CONFIG_PTP_1588_CLOCK_INES is not set -CONFIG_PTP_1588_CLOCK_KVM=m -# CONFIG_PTP_1588_CLOCK_IDT82P33 is not set -# CONFIG_PTP_1588_CLOCK_IDTCM is not set -# CONFIG_PTP_1588_CLOCK_FC3W is not set -# CONFIG_PTP_1588_CLOCK_MOCK is not set -# end of PTP clock support - -CONFIG_PINCTRL=y -CONFIG_GENERIC_PINCTRL_GROUPS=y -CONFIG_PINMUX=y -CONFIG_GENERIC_PINMUX_FUNCTIONS=y -CONFIG_PINCONF=y -CONFIG_GENERIC_PINCONF=y -# CONFIG_DEBUG_PINCTRL is not set -# CONFIG_PINCTRL_AMD is not set -# CONFIG_PINCTRL_AW9523 is not set -# CONFIG_PINCTRL_CY8C95X0 is not set -# CONFIG_PINCTRL_MCP23S08 is not set -# CONFIG_PINCTRL_MICROCHIP_SGPIO is not set -# CONFIG_PINCTRL_OCELOT is not set -CONFIG_PINCTRL_ROCKCHIP=y -# CONFIG_PINCTRL_SCMI is not set -# CONFIG_PINCTRL_SINGLE is not set -# CONFIG_PINCTRL_STMFX is not set -# CONFIG_PINCTRL_SX150X is not set -CONFIG_PINCTRL_BCM2835=y -CONFIG_PINCTRL_IPROC_GPIO=y -CONFIG_PINCTRL_NS2_MUX=y -# CONFIG_PINCTRL_AS370 is not set -# CONFIG_PINCTRL_BERLIN_BG4CT is not set -# CONFIG_PINCTRL_IMX_SCMI is not set - -# MediaTek pinctrl drivers -CONFIG_EINT_MTK=y -CONFIG_PINCTRL_MTK=y -CONFIG_PINCTRL_MTK_V2=y -CONFIG_PINCTRL_MTK_MOORE=y -CONFIG_PINCTRL_MTK_PARIS=y -# CONFIG_PINCTRL_MT2712 is not set -CONFIG_PINCTRL_MT6765=y -# CONFIG_PINCTRL_MT6779 is not set -CONFIG_PINCTRL_MT6795=y -# CONFIG_PINCTRL_MT6797 is not set -# CONFIG_PINCTRL_MT7622 is not set -# CONFIG_PINCTRL_MT7981 is not set -CONFIG_PINCTRL_MT7986=y -# CONFIG_PINCTRL_MT8167 is not set -# CONFIG_PINCTRL_MT8173 is not set -# CONFIG_PINCTRL_MT8183 is not set -CONFIG_PINCTRL_MT8186=y -# CONFIG_PINCTRL_MT8188 is not set -# CONFIG_PINCTRL_MT8192 is not set -# CONFIG_PINCTRL_MT8195 is not set -CONFIG_PINCTRL_MT8365=y -# CONFIG_PINCTRL_MT8516 is not set -# end of MediaTek pinctrl drivers - -CONFIG_PINCTRL_MESON=y -# CONFIG_PINCTRL_MESON_GXBB is not set -# CONFIG_PINCTRL_MESON_GXL is not set -# CONFIG_PINCTRL_MESON_AXG is not set -CONFIG_PINCTRL_MESON_AXG_PMX=y -# CONFIG_PINCTRL_MESON_G12A is not set -# CONFIG_PINCTRL_MESON_A1 is not set -CONFIG_PINCTRL_MESON_S4=y -CONFIG_PINCTRL_AMLOGIC_C3=y -CONFIG_PINCTRL_AMLOGIC_T7=y -CONFIG_PINCTRL_MVEBU=y -CONFIG_PINCTRL_ARMADA_AP806=y -CONFIG_PINCTRL_ARMADA_CP110=y -CONFIG_PINCTRL_AC5=y -CONFIG_PINCTRL_ARMADA_37XX=y -# CONFIG_PINCTRL_MSM is not set -# CONFIG_PINCTRL_QCOM_SSBI_PMIC is not set -# CONFIG_PINCTRL_LPASS_LPI is not set - -# Renesas pinctrl drivers -# end of Renesas pinctrl drivers - -CONFIG_PINCTRL_SAMSUNG=y -CONFIG_PINCTRL_EXYNOS=y -CONFIG_PINCTRL_EXYNOS_ARM64=y -# CONFIG_PINCTRL_SPRD_SC9860 is not set -CONFIG_PINCTRL_SUNXI=y -# CONFIG_PINCTRL_SUN4I_A10 is not set -# CONFIG_PINCTRL_SUN5I is not set -# CONFIG_PINCTRL_SUN6I_A31 is not set -# CONFIG_PINCTRL_SUN6I_A31_R is not set -# CONFIG_PINCTRL_SUN8I_A23 is not set -# CONFIG_PINCTRL_SUN8I_A33 is not set -# CONFIG_PINCTRL_SUN8I_A83T is not set -# CONFIG_PINCTRL_SUN8I_A83T_R is not set -# CONFIG_PINCTRL_SUN8I_A23_R is not set -# CONFIG_PINCTRL_SUN8I_H3 is not set -CONFIG_PINCTRL_SUN8I_H3_R=y -# CONFIG_PINCTRL_SUN8I_V3S is not set -# CONFIG_PINCTRL_SUN9I_A80 is not set -# CONFIG_PINCTRL_SUN9I_A80_R is not set -# CONFIG_PINCTRL_SUN20I_D1 is not set -CONFIG_PINCTRL_SUN50I_A64=y -CONFIG_PINCTRL_SUN50I_A64_R=y -# CONFIG_PINCTRL_SUN50I_A100 is not set -# CONFIG_PINCTRL_SUN50I_A100_R is not set -CONFIG_PINCTRL_SUN50I_H5=y -CONFIG_PINCTRL_SUN50I_H6=y -CONFIG_PINCTRL_SUN50I_H6_R=y -CONFIG_PINCTRL_SUN50I_H616=y -CONFIG_PINCTRL_SUN50I_H616_R=y -CONFIG_PINCTRL_TEGRA=y -CONFIG_PINCTRL_TEGRA124=y -CONFIG_PINCTRL_TEGRA210=y -CONFIG_PINCTRL_TEGRA_XUSB=y -CONFIG_GPIOLIB=y -CONFIG_GPIOLIB_FASTPATH_LIMIT=512 -CONFIG_OF_GPIO=y -CONFIG_GPIO_ACPI=y -CONFIG_GPIOLIB_IRQCHIP=y -# CONFIG_DEBUG_GPIO is not set -CONFIG_GPIO_SYSFS=y -CONFIG_GPIO_CDEV=y -CONFIG_GPIO_CDEV_V1=y -CONFIG_GPIO_GENERIC=m - -# Memory mapped GPIO drivers -# CONFIG_GPIO_74XX_MMIO is not set -# CONFIG_GPIO_ALTERA is not set -# CONFIG_GPIO_AMDPT is not set -CONFIG_GPIO_RASPBERRYPI_EXP=m -# CONFIG_GPIO_BCM_XGS_IPROC is not set -CONFIG_GPIO_BRCMSTB=m -# CONFIG_GPIO_CADENCE is not set -# CONFIG_GPIO_DWAPB is not set -# CONFIG_GPIO_EIC_SPRD is not set -# CONFIG_GPIO_FTGPIO010 is not set -CONFIG_GPIO_GENERIC_PLATFORM=m -# CONFIG_GPIO_GRGPIO is not set -# CONFIG_GPIO_HISI is not set -# CONFIG_GPIO_HLWD is not set -# CONFIG_GPIO_LOGICVC is not set -# CONFIG_GPIO_MB86S7X is not set -CONFIG_GPIO_MVEBU=y -# CONFIG_GPIO_PL061 is not set -CONFIG_GPIO_ROCKCHIP=y -# CONFIG_GPIO_SIFIVE is not set -# CONFIG_GPIO_SPRD is not set -# CONFIG_GPIO_SYSCON is not set -CONFIG_GPIO_TEGRA=y -# CONFIG_GPIO_THUNDERX is not set -# CONFIG_GPIO_XGENE is not set -# CONFIG_GPIO_XGENE_SB is not set -# CONFIG_GPIO_XILINX is not set -# CONFIG_GPIO_ZYNQ is not set -# CONFIG_GPIO_AMD_FCH is not set -# end of Memory mapped GPIO drivers - -# I2C GPIO expanders -# CONFIG_GPIO_ADNP is not set -# CONFIG_GPIO_FXL6408 is not set -# CONFIG_GPIO_DS4520 is not set -# CONFIG_GPIO_GW_PLD is not set -# CONFIG_GPIO_MAX7300 is not set -# CONFIG_GPIO_MAX732X is not set -# CONFIG_GPIO_PCA953X is not set -# CONFIG_GPIO_PCA9570 is not set -# CONFIG_GPIO_PCF857X is not set -# CONFIG_GPIO_TPIC2810 is not set -# end of I2C GPIO expanders - -# MFD GPIO expanders -# end of MFD GPIO expanders - -# PCI GPIO expanders -# CONFIG_GPIO_BT8XX is not set -# CONFIG_GPIO_PCI_IDIO_16 is not set -# CONFIG_GPIO_PCIE_IDIO_24 is not set -# CONFIG_GPIO_RDC321X is not set -# end of PCI GPIO expanders - -# SPI GPIO expanders -# CONFIG_GPIO_74X164 is not set -# CONFIG_GPIO_MAX3191X is not set -# CONFIG_GPIO_MAX7301 is not set -# CONFIG_GPIO_MC33880 is not set -# CONFIG_GPIO_PISOSR is not set -# CONFIG_GPIO_XRA1403 is not set -# end of SPI GPIO expanders - -# USB GPIO expanders -# end of USB GPIO expanders - -# Virtual GPIO drivers -# CONFIG_GPIO_AGGREGATOR is not set -# CONFIG_GPIO_LATCH is not set -# CONFIG_GPIO_MOCKUP is not set -# CONFIG_GPIO_VIRTIO is not set -# CONFIG_GPIO_SIM is not set -# end of Virtual GPIO drivers - -# GPIO Debugging utilities -# CONFIG_GPIO_SLOPPY_LOGIC_ANALYZER is not set -# CONFIG_GPIO_VIRTUSER is not set -# end of GPIO Debugging utilities - -# CONFIG_W1 is not set -CONFIG_POWER_RESET=y -# CONFIG_POWER_RESET_GPIO is not set -# CONFIG_POWER_RESET_GPIO_RESTART is not set -# CONFIG_POWER_RESET_HISI is not set -# CONFIG_POWER_RESET_LINKSTATION is not set -# CONFIG_POWER_RESET_MSM is not set -# CONFIG_POWER_RESET_ODROID_GO_ULTRA_POWEROFF is not set -# CONFIG_POWER_RESET_LTC2952 is not set -# CONFIG_POWER_RESET_REGULATOR is not set -# CONFIG_POWER_RESET_RESTART is not set -CONFIG_POWER_RESET_VEXPRESS=y -# CONFIG_POWER_RESET_XGENE is not set -# CONFIG_POWER_RESET_SYSCON is not set -# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set -# CONFIG_SYSCON_REBOOT_MODE is not set -# CONFIG_NVMEM_REBOOT_MODE is not set -# CONFIG_POWER_SEQUENCING is not set -CONFIG_POWER_SUPPLY=y -# CONFIG_POWER_SUPPLY_DEBUG is not set -# CONFIG_IP5XXX_POWER is not set -# CONFIG_TEST_POWER is not set -# CONFIG_CHARGER_ADP5061 is not set -# CONFIG_BATTERY_CW2015 is not set -# CONFIG_BATTERY_DS2780 is not set -# CONFIG_BATTERY_DS2781 is not set -# CONFIG_BATTERY_DS2782 is not set -# CONFIG_BATTERY_SAMSUNG_SDI is not set -# CONFIG_BATTERY_SBS is not set -# CONFIG_CHARGER_SBS is not set -# CONFIG_MANAGER_SBS is not set -# CONFIG_BATTERY_BQ27XXX is not set -# CONFIG_BATTERY_MAX17042 is not set -# CONFIG_BATTERY_MAX1720X is not set -# CONFIG_CHARGER_MAX8903 is not set -# CONFIG_CHARGER_LP8727 is not set -# CONFIG_CHARGER_GPIO is not set -# CONFIG_CHARGER_MANAGER is not set -# CONFIG_CHARGER_LT3651 is not set -# CONFIG_CHARGER_LTC4162L is not set -# CONFIG_CHARGER_DETECTOR_MAX14656 is not set -# CONFIG_CHARGER_MAX77976 is not set -# CONFIG_CHARGER_BQ2415X is not set -# CONFIG_CHARGER_BQ24257 is not set -# CONFIG_CHARGER_BQ24735 is not set -# CONFIG_CHARGER_BQ2515X is not set -# CONFIG_CHARGER_BQ25890 is not set -# CONFIG_CHARGER_BQ25980 is not set -# CONFIG_CHARGER_BQ256XX is not set -# CONFIG_CHARGER_SMB347 is not set -# CONFIG_BATTERY_GAUGE_LTC2941 is not set -# CONFIG_BATTERY_GOLDFISH is not set -# CONFIG_BATTERY_RT5033 is not set -# CONFIG_CHARGER_RT9455 is not set -# CONFIG_CHARGER_RT9467 is not set -# CONFIG_CHARGER_RT9471 is not set -# CONFIG_CHARGER_UCS1002 is not set -# CONFIG_CHARGER_BD99954 is not set -# CONFIG_BATTERY_UG3105 is not set -# CONFIG_FUEL_GAUGE_MM8013 is not set -CONFIG_HWMON=m -# CONFIG_HWMON_DEBUG_CHIP is not set - -## Native drivers -# CONFIG_SENSORS_AD7314 is not set -# CONFIG_SENSORS_AD7414 is not set -# CONFIG_SENSORS_AD7418 is not set -# CONFIG_SENSORS_ADM1025 is not set -# CONFIG_SENSORS_ADM1026 is not set -# CONFIG_SENSORS_ADM1029 is not set -# CONFIG_SENSORS_ADM1031 is not set -# CONFIG_SENSORS_ADM1177 is not set -# CONFIG_SENSORS_ADM9240 is not set -# CONFIG_SENSORS_ADT7310 is not set -# CONFIG_SENSORS_ADT7410 is not set -# CONFIG_SENSORS_ADT7411 is not set -# CONFIG_SENSORS_ADT7462 is not set -# CONFIG_SENSORS_ADT7470 is not set -# CONFIG_SENSORS_ADT7475 is not set -# CONFIG_SENSORS_AHT10 is not set -# CONFIG_SENSORS_AQUACOMPUTER_D5NEXT is not set -# CONFIG_SENSORS_AS370 is not set -# CONFIG_SENSORS_ASC7621 is not set -# CONFIG_SENSORS_ASUS_ROG_RYUJIN is not set -# CONFIG_SENSORS_AXI_FAN_CONTROL is not set -# CONFIG_SENSORS_ARM_SCMI is not set -# CONFIG_SENSORS_ARM_SCPI is not set -# CONFIG_SENSORS_ATXP1 is not set -# CONFIG_SENSORS_CHIPCAP2 is not set -# CONFIG_SENSORS_CORSAIR_CPRO is not set -# CONFIG_SENSORS_CORSAIR_PSU is not set -# CONFIG_SENSORS_DRIVETEMP is not set -# CONFIG_SENSORS_DS620 is not set -# CONFIG_SENSORS_DS1621 is not set -# CONFIG_SENSORS_I5K_AMB is not set -# CONFIG_SENSORS_F71805F is not set -# CONFIG_SENSORS_F71882FG is not set -# CONFIG_SENSORS_F75375S is not set -# CONFIG_SENSORS_FTSTEUTATES is not set -# CONFIG_SENSORS_GIGABYTE_WATERFORCE is not set -# CONFIG_SENSORS_GL518SM is not set -# CONFIG_SENSORS_GL520SM is not set -# CONFIG_SENSORS_G760A is not set -# CONFIG_SENSORS_G762 is not set -# CONFIG_SENSORS_GPIO_FAN is not set -# CONFIG_SENSORS_HIH6130 is not set -# CONFIG_SENSORS_HS3001 is not set -# CONFIG_SENSORS_IBMAEM is not set -# CONFIG_SENSORS_IBMPEX is not set -# CONFIG_SENSORS_IT87 is not set -# CONFIG_SENSORS_JC42 is not set -# CONFIG_SENSORS_POWERZ is not set -# CONFIG_SENSORS_POWR1220 is not set -# CONFIG_SENSORS_LINEAGE is not set -# CONFIG_SENSORS_LTC2945 is not set -# CONFIG_SENSORS_LTC2947_I2C is not set -# CONFIG_SENSORS_LTC2947_SPI is not set -# CONFIG_SENSORS_LTC2990 is not set -# CONFIG_SENSORS_LTC2991 is not set -# CONFIG_SENSORS_LTC2992 is not set -# CONFIG_SENSORS_LTC4151 is not set -# CONFIG_SENSORS_LTC4215 is not set -# CONFIG_SENSORS_LTC4222 is not set -# CONFIG_SENSORS_LTC4245 is not set -# CONFIG_SENSORS_LTC4260 is not set -# CONFIG_SENSORS_LTC4261 is not set -# CONFIG_SENSORS_LTC4282 is not set -# CONFIG_SENSORS_MAX1111 is not set -# CONFIG_SENSORS_MAX127 is not set -# CONFIG_SENSORS_MAX16065 is not set -# CONFIG_SENSORS_MAX1619 is not set -# CONFIG_SENSORS_MAX1668 is not set -# CONFIG_SENSORS_MAX197 is not set -# CONFIG_SENSORS_MAX31722 is not set -# CONFIG_SENSORS_MAX31730 is not set -# CONFIG_SENSORS_MAX31760 is not set -# CONFIG_MAX31827 is not set -# CONFIG_SENSORS_MAX6620 is not set -# CONFIG_SENSORS_MAX6621 is not set -# CONFIG_SENSORS_MAX6639 is not set -# CONFIG_SENSORS_MAX6650 is not set -# CONFIG_SENSORS_MAX6697 is not set -# CONFIG_SENSORS_MAX31790 is not set -# CONFIG_SENSORS_MC34VR500 is not set -# CONFIG_SENSORS_MCP3021 is not set -# CONFIG_SENSORS_TC654 is not set -# CONFIG_SENSORS_TPS23861 is not set -# CONFIG_SENSORS_MR75203 is not set -# CONFIG_SENSORS_ADCXX is not set -# CONFIG_SENSORS_LM63 is not set -# CONFIG_SENSORS_LM70 is not set -# CONFIG_SENSORS_LM73 is not set -# CONFIG_SENSORS_LM75 is not set -# CONFIG_SENSORS_LM77 is not set -# CONFIG_SENSORS_LM78 is not set -# CONFIG_SENSORS_LM80 is not set -# CONFIG_SENSORS_LM83 is not set -# CONFIG_SENSORS_LM85 is not set -# CONFIG_SENSORS_LM87 is not set -CONFIG_SENSORS_LM90=m -# CONFIG_SENSORS_LM92 is not set -# CONFIG_SENSORS_LM93 is not set -# CONFIG_SENSORS_LM95234 is not set -# CONFIG_SENSORS_LM95241 is not set -# CONFIG_SENSORS_LM95245 is not set -# CONFIG_SENSORS_PC87360 is not set -# CONFIG_SENSORS_PC87427 is not set -# CONFIG_SENSORS_NCT6683 is not set -# CONFIG_SENSORS_NCT6775 is not set -# CONFIG_SENSORS_NCT6775_I2C is not set -# CONFIG_SENSORS_NCT7802 is not set -# CONFIG_SENSORS_NCT7904 is not set -# CONFIG_SENSORS_NPCM7XX is not set -# CONFIG_SENSORS_NZXT_KRAKEN2 is not set -# CONFIG_SENSORS_NZXT_KRAKEN3 is not set -# CONFIG_SENSORS_NZXT_SMART2 is not set -# CONFIG_SENSORS_OCC_P8_I2C is not set -# CONFIG_SENSORS_PCF8591 is not set -# CONFIG_PMBUS is not set -# CONFIG_SENSORS_PT5161L is not set -# CONFIG_SENSORS_PWM_FAN is not set -CONFIG_SENSORS_RASPBERRYPI_HWMON=m -# CONFIG_SENSORS_SBTSI is not set -# CONFIG_SENSORS_SBRMI is not set -# CONFIG_SENSORS_SHT15 is not set -CONFIG_SENSORS_SHT21=m -# CONFIG_SENSORS_SHT3x is not set -# CONFIG_SENSORS_SHT4x is not set -# CONFIG_SENSORS_SHTC1 is not set -# CONFIG_SENSORS_SIS5595 is not set -# CONFIG_SENSORS_DME1737 is not set -# CONFIG_SENSORS_EMC1403 is not set -# CONFIG_SENSORS_EMC2103 is not set -# CONFIG_SENSORS_EMC2305 is not set -# CONFIG_SENSORS_EMC6W201 is not set -# CONFIG_SENSORS_SMSC47M1 is not set -# CONFIG_SENSORS_SMSC47M192 is not set -# CONFIG_SENSORS_SMSC47B397 is not set -# CONFIG_SENSORS_SCH5627 is not set -# CONFIG_SENSORS_SCH5636 is not set -# CONFIG_SENSORS_STTS751 is not set -# CONFIG_SENSORS_ADC128D818 is not set -# CONFIG_SENSORS_ADS7828 is not set -# CONFIG_SENSORS_ADS7871 is not set -# CONFIG_SENSORS_AMC6821 is not set -# CONFIG_SENSORS_INA209 is not set -CONFIG_SENSORS_INA2XX=m -# CONFIG_SENSORS_INA238 is not set -# CONFIG_SENSORS_INA3221 is not set -# CONFIG_SENSORS_SPD5118 is not set -# CONFIG_SENSORS_TC74 is not set -# CONFIG_SENSORS_THMC50 is not set -# CONFIG_SENSORS_TMP102 is not set -# CONFIG_SENSORS_TMP103 is not set -# CONFIG_SENSORS_TMP108 is not set -# CONFIG_SENSORS_TMP401 is not set -# CONFIG_SENSORS_TMP421 is not set -# CONFIG_SENSORS_TMP464 is not set -# CONFIG_SENSORS_TMP513 is not set -# CONFIG_SENSORS_VEXPRESS is not set -# CONFIG_SENSORS_VIA686A is not set -# CONFIG_SENSORS_VT1211 is not set -# CONFIG_SENSORS_VT8231 is not set -# CONFIG_SENSORS_W83773G is not set -# CONFIG_SENSORS_W83781D is not set -# CONFIG_SENSORS_W83791D is not set -# CONFIG_SENSORS_W83792D is not set -# CONFIG_SENSORS_W83793 is not set -# CONFIG_SENSORS_W83795 is not set -# CONFIG_SENSORS_W83L785TS is not set -# CONFIG_SENSORS_W83L786NG is not set -# CONFIG_SENSORS_W83627HF is not set -# CONFIG_SENSORS_W83627EHF is not set -# CONFIG_SENSORS_XGENE is not set - -## ACPI drivers -# CONFIG_SENSORS_ACPI_POWER is not set -CONFIG_THERMAL=y -# CONFIG_THERMAL_NETLINK is not set -# CONFIG_THERMAL_STATISTICS is not set -# CONFIG_THERMAL_DEBUGFS is not set -# CONFIG_THERMAL_CORE_TESTING is not set -CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 -CONFIG_THERMAL_OF=y -CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set -# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set -# CONFIG_THERMAL_GOV_FAIR_SHARE is not set -CONFIG_THERMAL_GOV_STEP_WISE=y -# CONFIG_THERMAL_GOV_BANG_BANG is not set -CONFIG_THERMAL_GOV_USER_SPACE=y -# CONFIG_THERMAL_GOV_POWER_ALLOCATOR is not set -# CONFIG_CPU_THERMAL is not set -# CONFIG_DEVFREQ_THERMAL is not set -# CONFIG_THERMAL_EMULATION is not set -# CONFIG_THERMAL_MMIO is not set -# CONFIG_HISI_THERMAL is not set -# CONFIG_SUN8I_THERMAL is not set -CONFIG_ROCKCHIP_THERMAL=m -# CONFIG_ARMADA_THERMAL is not set - -# Mediatek thermal drivers -CONFIG_MTK_THERMAL=m -# CONFIG_MTK_SOC_THERMAL is not set -# CONFIG_MTK_LVTS_THERMAL is not set -# end of Mediatek thermal drivers - -# CONFIG_AMLOGIC_THERMAL is not set - -# Broadcom thermal drivers -CONFIG_BCM2711_THERMAL=m -CONFIG_BCM2835_THERMAL=m -# CONFIG_BCM_NS_THERMAL is not set -# CONFIG_BCM_SR_THERMAL is not set -# end of Broadcom thermal drivers - -# Samsung thermal drivers -# CONFIG_EXYNOS_THERMAL is not set -# end of Samsung thermal drivers - -# NVIDIA Tegra thermal drivers -# CONFIG_TEGRA_SOCTHERM is not set -# end of NVIDIA Tegra thermal drivers - -# Qualcomm thermal drivers -# CONFIG_QCOM_LMH is not set -# end of Qualcomm thermal drivers - -# CONFIG_SPRD_THERMAL is not set -CONFIG_WATCHDOG=y -CONFIG_WATCHDOG_CORE=y -# CONFIG_WATCHDOG_NOWAYOUT is not set -CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y -CONFIG_WATCHDOG_OPEN_TIMEOUT=0 -CONFIG_WATCHDOG_SYSFS=y -# CONFIG_WATCHDOG_HRTIMER_PRETIMEOUT is not set - -## Watchdog Pretimeout Governors -# CONFIG_WATCHDOG_PRETIMEOUT_GOV is not set - -## Watchdog Device Drivers -CONFIG_SOFT_WATCHDOG=m -# CONFIG_GPIO_WATCHDOG is not set -# CONFIG_WDAT_WDT is not set -# CONFIG_XILINX_WATCHDOG is not set -# CONFIG_XILINX_WINDOW_WATCHDOG is not set -# CONFIG_ZIIRAVE_WATCHDOG is not set -# CONFIG_ARM_SP805_WATCHDOG is not set -# CONFIG_ARM_SBSA_WATCHDOG is not set -# CONFIG_ARMADA_37XX_WATCHDOG is not set -# CONFIG_CADENCE_WATCHDOG is not set -# CONFIG_S3C2410_WATCHDOG is not set -# CONFIG_DW_WATCHDOG is not set -# CONFIG_SUNXI_WATCHDOG is not set -# CONFIG_MAX63XX_WATCHDOG is not set -# CONFIG_TEGRA_WATCHDOG is not set -# CONFIG_QCOM_WDT is not set -# CONFIG_MESON_GXBB_WATCHDOG is not set -# CONFIG_MESON_WATCHDOG is not set -# CONFIG_MEDIATEK_WATCHDOG is not set -# CONFIG_ARM_SMC_WATCHDOG is not set -# CONFIG_SPRD_WATCHDOG is not set -# CONFIG_ALIM7101_WDT is not set -# CONFIG_I6300ESB_WDT is not set -# CONFIG_HP_WATCHDOG is not set -CONFIG_MARVELL_GTI_WDT=y -CONFIG_BCM2835_WDT=m -# CONFIG_MEN_A21_WDT is not set -# CONFIG_XEN_WDT is not set - -## PCI-based Watchdog Cards -# CONFIG_PCIPCWATCHDOG is not set -# CONFIG_WDTPCI is not set - -## USB-based Watchdog Cards -# CONFIG_USBPCWATCHDOG is not set -CONFIG_SSB_POSSIBLE=y -CONFIG_SSB=m -CONFIG_SSB_SPROM=y -CONFIG_SSB_BLOCKIO=y -CONFIG_SSB_PCIHOST_POSSIBLE=y -CONFIG_SSB_PCIHOST=y -CONFIG_SSB_B43_PCI_BRIDGE=y -CONFIG_SSB_SDIOHOST_POSSIBLE=y -CONFIG_SSB_SDIOHOST=y -CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y -CONFIG_SSB_DRIVER_PCICORE=y -# CONFIG_SSB_DRIVER_GPIO is not set -CONFIG_BCMA_POSSIBLE=y -CONFIG_BCMA=m -CONFIG_BCMA_BLOCKIO=y -CONFIG_BCMA_HOST_PCI_POSSIBLE=y -CONFIG_BCMA_HOST_PCI=y -CONFIG_BCMA_HOST_SOC=y -CONFIG_BCMA_DRIVER_PCI=y -CONFIG_BCMA_SFLASH=y -# CONFIG_BCMA_DRIVER_GMAC_CMN is not set -# CONFIG_BCMA_DRIVER_GPIO is not set -# CONFIG_BCMA_DEBUG is not set - -# Multifunction device drivers -CONFIG_MFD_CORE=y -# CONFIG_MFD_ADP5585 is not set -# CONFIG_MFD_ACT8945A is not set -# CONFIG_MFD_SUN4I_GPADC is not set -# CONFIG_MFD_AS3711 is not set -# CONFIG_MFD_SMPRO is not set -# CONFIG_MFD_AS3722 is not set -# CONFIG_PMIC_ADP5520 is not set -# CONFIG_MFD_AAT2870_CORE is not set -# CONFIG_MFD_ATMEL_FLEXCOM is not set -# CONFIG_MFD_ATMEL_HLCDC is not set -# CONFIG_MFD_BCM590XX is not set -# CONFIG_MFD_BD9571MWV is not set -# CONFIG_MFD_AC100 is not set -# CONFIG_MFD_AXP20X_I2C is not set -# CONFIG_MFD_AXP20X_RSB is not set -# CONFIG_MFD_CS42L43_I2C is not set -# CONFIG_MFD_MADERA is not set -# CONFIG_MFD_MAX5970 is not set -# CONFIG_MFD_TN48M_CPLD is not set -# CONFIG_PMIC_DA903X is not set -# CONFIG_MFD_DA9052_SPI is not set -# CONFIG_MFD_DA9052_I2C is not set -# CONFIG_MFD_DA9055 is not set -# CONFIG_MFD_DA9062 is not set -# CONFIG_MFD_DA9063 is not set -# CONFIG_MFD_DA9150 is not set -# CONFIG_MFD_DLN2 is not set -# CONFIG_MFD_EXYNOS_LPASS is not set -# CONFIG_MFD_GATEWORKS_GSC is not set -# CONFIG_MFD_MC13XXX_SPI is not set -# CONFIG_MFD_MC13XXX_I2C is not set -# CONFIG_MFD_MP2629 is not set -# CONFIG_MFD_HI6421_PMIC is not set -# CONFIG_MFD_HI655X_PMIC is not set -CONFIG_LPC_ICH=m -# CONFIG_LPC_SCH is not set -# CONFIG_MFD_IQS62X is not set -# CONFIG_MFD_JANZ_CMODIO is not set -# CONFIG_MFD_KEMPLD is not set -# CONFIG_MFD_88PM800 is not set -# CONFIG_MFD_88PM805 is not set -# CONFIG_MFD_88PM860X is not set -# CONFIG_MFD_88PM886_PMIC is not set -# CONFIG_MFD_MAX14577 is not set -# CONFIG_MFD_MAX77541 is not set -# CONFIG_MFD_MAX77620 is not set -# CONFIG_MFD_MAX77650 is not set -# CONFIG_MFD_MAX77686 is not set -# CONFIG_MFD_MAX77693 is not set -# CONFIG_MFD_MAX77714 is not set -# CONFIG_MFD_MAX77843 is not set -# CONFIG_MFD_MAX8907 is not set -# CONFIG_MFD_MAX8925 is not set -# CONFIG_MFD_MAX8997 is not set -# CONFIG_MFD_MAX8998 is not set -# CONFIG_MFD_MT6360 is not set -# CONFIG_MFD_MT6370 is not set -# CONFIG_MFD_MT6397 is not set -# CONFIG_MFD_MENF21BMC is not set -# CONFIG_MFD_OCELOT is not set -# CONFIG_EZX_PCAP is not set -# CONFIG_MFD_CPCAP is not set -# CONFIG_MFD_VIPERBOARD is not set -# CONFIG_MFD_NTXEC is not set -# CONFIG_MFD_RETU is not set -# CONFIG_MFD_PCF50633 is not set -# CONFIG_MFD_QCOM_RPM is not set -# CONFIG_MFD_SY7636A is not set -# CONFIG_MFD_RDC321X is not set -# CONFIG_MFD_RT4831 is not set -# CONFIG_MFD_RT5033 is not set -# CONFIG_MFD_RT5120 is not set -# CONFIG_MFD_RC5T583 is not set -# CONFIG_MFD_RK8XX_I2C is not set -# CONFIG_MFD_RK8XX_SPI is not set -# CONFIG_MFD_RN5T618 is not set -# CONFIG_MFD_SEC_CORE is not set -# CONFIG_MFD_SI476X_CORE is not set -# CONFIG_MFD_SM501 is not set -# CONFIG_MFD_SKY81452 is not set -# CONFIG_MFD_SC27XX_PMIC is not set -# CONFIG_MFD_STMPE is not set -CONFIG_MFD_SUN6I_PRCM=y -CONFIG_MFD_SYSCON=y -# CONFIG_MFD_LP3943 is not set -# CONFIG_MFD_LP8788 is not set -# CONFIG_MFD_TI_LMU is not set -# CONFIG_MFD_PALMAS is not set -# CONFIG_TPS6105X is not set -# CONFIG_TPS65010 is not set -# CONFIG_TPS6507X is not set -# CONFIG_MFD_TPS65086 is not set -# CONFIG_MFD_TPS65090 is not set -# CONFIG_MFD_TPS65217 is not set -# CONFIG_MFD_TI_LP873X is not set -# CONFIG_MFD_TI_LP87565 is not set -# CONFIG_MFD_TPS65218 is not set -# CONFIG_MFD_TPS65219 is not set -# CONFIG_MFD_TPS6586X is not set -# CONFIG_MFD_TPS65910 is not set -# CONFIG_MFD_TPS65912_I2C is not set -# CONFIG_MFD_TPS65912_SPI is not set -# CONFIG_MFD_TPS6594_I2C is not set -# CONFIG_MFD_TPS6594_SPI is not set -# CONFIG_TWL4030_CORE is not set -# CONFIG_TWL6040_CORE is not set -# CONFIG_MFD_WL1273_CORE is not set -# CONFIG_MFD_LM3533 is not set -# CONFIG_MFD_TC3589X is not set -# CONFIG_MFD_TQMX86 is not set -# CONFIG_MFD_VX855 is not set -# CONFIG_MFD_LOCHNAGAR is not set -# CONFIG_MFD_ARIZONA_I2C is not set -# CONFIG_MFD_ARIZONA_SPI is not set -# CONFIG_MFD_WM8400 is not set -# CONFIG_MFD_WM831X_I2C is not set -# CONFIG_MFD_WM831X_SPI is not set -# CONFIG_MFD_WM8350_I2C is not set -# CONFIG_MFD_WM8994 is not set -# CONFIG_MFD_ROHM_BD718XX is not set -# CONFIG_MFD_ROHM_BD71828 is not set -# CONFIG_MFD_ROHM_BD957XMUF is not set -# CONFIG_MFD_ROHM_BD96801 is not set -# CONFIG_MFD_STPMIC1 is not set -# CONFIG_MFD_STMFX is not set -# CONFIG_MFD_ATC260X_I2C is not set -# CONFIG_MFD_KHADAS_MCU is not set -# CONFIG_MFD_QCOM_PM8008 is not set -# CONFIG_MFD_CS40L50_I2C is not set -# CONFIG_MFD_CS40L50_SPI is not set -CONFIG_MFD_VEXPRESS_SYSREG=m -# CONFIG_RAVE_SP_CORE is not set -# CONFIG_MFD_INTEL_M10_BMC_SPI is not set -# CONFIG_MFD_RSMU_I2C is not set -# CONFIG_MFD_RSMU_SPI is not set -# end of Multifunction device drivers - -CONFIG_REGULATOR=y -# CONFIG_REGULATOR_DEBUG is not set -CONFIG_REGULATOR_FIXED_VOLTAGE=m -# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set -# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set -# CONFIG_REGULATOR_NETLINK_EVENTS is not set -# CONFIG_REGULATOR_88PG86X is not set -# CONFIG_REGULATOR_ACT8865 is not set -# CONFIG_REGULATOR_AD5398 is not set -# CONFIG_REGULATOR_ARM_SCMI is not set -# CONFIG_REGULATOR_AW37503 is not set -# CONFIG_REGULATOR_DA9121 is not set -# CONFIG_REGULATOR_DA9210 is not set -# CONFIG_REGULATOR_DA9211 is not set -# CONFIG_REGULATOR_FAN53555 is not set -# CONFIG_REGULATOR_FAN53880 is not set -CONFIG_REGULATOR_GPIO=m -# CONFIG_REGULATOR_ISL9305 is not set -# CONFIG_REGULATOR_ISL6271A is not set -# CONFIG_REGULATOR_LP3971 is not set -# CONFIG_REGULATOR_LP3972 is not set -# CONFIG_REGULATOR_LP872X is not set -# CONFIG_REGULATOR_LP8755 is not set -# CONFIG_REGULATOR_LTC3589 is not set -# CONFIG_REGULATOR_LTC3676 is not set -# CONFIG_REGULATOR_MAX1586 is not set -# CONFIG_REGULATOR_MAX77503 is not set -# CONFIG_REGULATOR_MAX77857 is not set -# CONFIG_REGULATOR_MAX8649 is not set -# CONFIG_REGULATOR_MAX8660 is not set -# CONFIG_REGULATOR_MAX8893 is not set -# CONFIG_REGULATOR_MAX8952 is not set -# CONFIG_REGULATOR_MAX8973 is not set -# CONFIG_REGULATOR_MAX20086 is not set -# CONFIG_REGULATOR_MAX20411 is not set -# CONFIG_REGULATOR_MAX77826 is not set -# CONFIG_REGULATOR_MCP16502 is not set -# CONFIG_REGULATOR_MP5416 is not set -# CONFIG_REGULATOR_MP8859 is not set -# CONFIG_REGULATOR_MP886X is not set -# CONFIG_REGULATOR_MPQ7920 is not set -# CONFIG_REGULATOR_MT6311 is not set -# CONFIG_REGULATOR_PCA9450 is not set -# CONFIG_REGULATOR_PF8X00 is not set -# CONFIG_REGULATOR_PFUZE100 is not set -# CONFIG_REGULATOR_PV88060 is not set -# CONFIG_REGULATOR_PV88080 is not set -# CONFIG_REGULATOR_PV88090 is not set -# CONFIG_REGULATOR_PWM is not set -# CONFIG_REGULATOR_QCOM_REFGEN is not set -# CONFIG_REGULATOR_RAA215300 is not set -# CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY is not set -# CONFIG_REGULATOR_RT4801 is not set -# CONFIG_REGULATOR_RT4803 is not set -# CONFIG_REGULATOR_RT5190A is not set -# CONFIG_REGULATOR_RT5739 is not set -# CONFIG_REGULATOR_RT5759 is not set -# CONFIG_REGULATOR_RT6160 is not set -# CONFIG_REGULATOR_RT6190 is not set -# CONFIG_REGULATOR_RT6245 is not set -# CONFIG_REGULATOR_RTQ2134 is not set -# CONFIG_REGULATOR_RTMV20 is not set -# CONFIG_REGULATOR_RTQ6752 is not set -# CONFIG_REGULATOR_RTQ2208 is not set -# CONFIG_REGULATOR_SLG51000 is not set -CONFIG_REGULATOR_SUN20I=y -# CONFIG_REGULATOR_SY8106A is not set -# CONFIG_REGULATOR_SY8824X is not set -# CONFIG_REGULATOR_SY8827N is not set -# CONFIG_REGULATOR_TPS51632 is not set -# CONFIG_REGULATOR_TPS62360 is not set -# CONFIG_REGULATOR_TPS6286X is not set -# CONFIG_REGULATOR_TPS6287X is not set -# CONFIG_REGULATOR_TPS65023 is not set -# CONFIG_REGULATOR_TPS6507X is not set -# CONFIG_REGULATOR_TPS65132 is not set -# CONFIG_REGULATOR_TPS6524X is not set -# CONFIG_REGULATOR_VCTRL is not set -# CONFIG_REGULATOR_VEXPRESS is not set -# CONFIG_REGULATOR_VQMMC_IPQ4019 is not set -# CONFIG_RC_CORE is not set -CONFIG_CEC_CORE=m - -# CEC support -# CONFIG_MEDIA_CEC_SUPPORT is not set -# end of CEC support - -CONFIG_MEDIA_SUPPORT=m -# CONFIG_MEDIA_SUPPORT_FILTER is not set -# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set - -# Media device types -CONFIG_MEDIA_CAMERA_SUPPORT=y -CONFIG_MEDIA_ANALOG_TV_SUPPORT=y -CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y -CONFIG_MEDIA_RADIO_SUPPORT=y -CONFIG_MEDIA_SDR_SUPPORT=y -CONFIG_MEDIA_PLATFORM_SUPPORT=y -CONFIG_MEDIA_TEST_SUPPORT=y -# end of Media device types - -# Media core support -CONFIG_VIDEO_DEV=m -CONFIG_MEDIA_CONTROLLER=y -# CONFIG_DVB_CORE is not set -# end of Media core support - -# Video4Linux options -CONFIG_VIDEO_V4L2_I2C=y -CONFIG_VIDEO_V4L2_SUBDEV_API=y -# CONFIG_VIDEO_ADV_DEBUG is not set -# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set -CONFIG_V4L2_FWNODE=m -CONFIG_V4L2_ASYNC=m -# end of Video4Linux options - -# Media controller options -# end of Media controller options - -# Media drivers - -## Media drivers -CONFIG_MEDIA_USB_SUPPORT=y - -## Webcam devices -CONFIG_USB_GSPCA=m -# CONFIG_USB_GSPCA_BENQ is not set -# CONFIG_USB_GSPCA_CONEX is not set -# CONFIG_USB_GSPCA_CPIA1 is not set -# CONFIG_USB_GSPCA_DTCS033 is not set -# CONFIG_USB_GSPCA_ETOMS is not set -# CONFIG_USB_GSPCA_FINEPIX is not set -# CONFIG_USB_GSPCA_JEILINJ is not set -# CONFIG_USB_GSPCA_JL2005BCD is not set -# CONFIG_USB_GSPCA_KINECT is not set -# CONFIG_USB_GSPCA_KONICA is not set -# CONFIG_USB_GSPCA_MARS is not set -# CONFIG_USB_GSPCA_MR97310A is not set -# CONFIG_USB_GSPCA_NW80X is not set -# CONFIG_USB_GSPCA_OV519 is not set -# CONFIG_USB_GSPCA_OV534 is not set -# CONFIG_USB_GSPCA_OV534_9 is not set -# CONFIG_USB_GSPCA_PAC207 is not set -# CONFIG_USB_GSPCA_PAC7302 is not set -# CONFIG_USB_GSPCA_PAC7311 is not set -# CONFIG_USB_GSPCA_SE401 is not set -# CONFIG_USB_GSPCA_SN9C2028 is not set -# CONFIG_USB_GSPCA_SN9C20X is not set -# CONFIG_USB_GSPCA_SONIXB is not set -# CONFIG_USB_GSPCA_SONIXJ is not set -# CONFIG_USB_GSPCA_SPCA1528 is not set -# CONFIG_USB_GSPCA_SPCA500 is not set -# CONFIG_USB_GSPCA_SPCA501 is not set -# CONFIG_USB_GSPCA_SPCA505 is not set -# CONFIG_USB_GSPCA_SPCA506 is not set -# CONFIG_USB_GSPCA_SPCA508 is not set -# CONFIG_USB_GSPCA_SPCA561 is not set -# CONFIG_USB_GSPCA_SQ905 is not set -# CONFIG_USB_GSPCA_SQ905C is not set -# CONFIG_USB_GSPCA_SQ930X is not set -# CONFIG_USB_GSPCA_STK014 is not set -# CONFIG_USB_GSPCA_STK1135 is not set -# CONFIG_USB_GSPCA_STV0680 is not set -# CONFIG_USB_GSPCA_SUNPLUS is not set -# CONFIG_USB_GSPCA_T613 is not set -# CONFIG_USB_GSPCA_TOPRO is not set -# CONFIG_USB_GSPCA_TOUPTEK is not set -# CONFIG_USB_GSPCA_TV8532 is not set -# CONFIG_USB_GSPCA_VC032X is not set -# CONFIG_USB_GSPCA_VICAM is not set -# CONFIG_USB_GSPCA_XIRLINK_CIT is not set -# CONFIG_USB_GSPCA_ZC3XX is not set -# CONFIG_USB_GL860 is not set -# CONFIG_USB_M5602 is not set -# CONFIG_USB_STV06XX is not set -# CONFIG_USB_PWC is not set -# CONFIG_USB_S2255 is not set -# CONFIG_VIDEO_USBTV is not set -CONFIG_USB_VIDEO_CLASS=m -CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y - -## Analog TV USB devices -# CONFIG_VIDEO_GO7007 is not set -# CONFIG_VIDEO_HDPVR is not set -# CONFIG_VIDEO_STK1160 is not set - -## Analog/digital TV USB devices -# CONFIG_VIDEO_CX231XX is not set - -## Digital TV USB devices - -## Webcam, TV (analog/digital) USB devices -# CONFIG_VIDEO_EM28XX is not set - -## Software defined radio USB devices -# CONFIG_USB_AIRSPY is not set -# CONFIG_USB_HACKRF is not set -# CONFIG_USB_MSI2500 is not set -# CONFIG_MEDIA_PCI_SUPPORT is not set -# CONFIG_RADIO_ADAPTERS is not set -CONFIG_MEDIA_PLATFORM_DRIVERS=y -# CONFIG_V4L_PLATFORM_DRIVERS is not set -# CONFIG_SDR_PLATFORM_DRIVERS is not set -# CONFIG_DVB_PLATFORM_DRIVERS is not set -# CONFIG_V4L_MEM2MEM_DRIVERS is not set - -## Allegro DVT media platform drivers - -## Amlogic media platform drivers - -## Amphion drivers - -## Aspeed media platform drivers - -## Atmel media platform drivers -# CONFIG_VIDEO_BCM2835_UNICAM is not set - -## Cadence media platform drivers -# CONFIG_VIDEO_CADENCE_CSI2RX is not set -# CONFIG_VIDEO_CADENCE_CSI2TX is not set - -## Chips&Media media platform drivers - -## Intel media platform drivers - -## Marvell media platform drivers - -## Mediatek media platform drivers - -## Microchip Technology, Inc. media platform drivers - -## Nuvoton media platform drivers - -## NVidia media platform drivers - -## NXP media platform drivers - -## Qualcomm media platform drivers - -## Raspberry Pi media platform drivers - -## Renesas media platform drivers - -## Rockchip media platform drivers - -## Samsung media platform drivers - -## STMicroelectronics media platform drivers - -## Sunxi media platform drivers - -## Texas Instruments drivers - -## Verisilicon media platform drivers - -## VIA media platform drivers - -## Xilinx media platform drivers -# CONFIG_V4L_TEST_DRIVERS is not set -CONFIG_UVC_COMMON=m -CONFIG_VIDEOBUF2_CORE=m -CONFIG_VIDEOBUF2_V4L2=m -CONFIG_VIDEOBUF2_MEMOPS=m -CONFIG_VIDEOBUF2_VMALLOC=m -# end of Media drivers - -# Media ancillary drivers -CONFIG_MEDIA_ATTACH=y -CONFIG_VIDEO_CAMERA_SENSOR=y -# CONFIG_VIDEO_ALVIUM_CSI2 is not set -# CONFIG_VIDEO_AR0521 is not set -# CONFIG_VIDEO_GC0308 is not set -# CONFIG_VIDEO_GC05A2 is not set -# CONFIG_VIDEO_GC08A3 is not set -# CONFIG_VIDEO_GC2145 is not set -# CONFIG_VIDEO_HI556 is not set -# CONFIG_VIDEO_HI846 is not set -# CONFIG_VIDEO_HI847 is not set -# CONFIG_VIDEO_IMX208 is not set -# CONFIG_VIDEO_IMX214 is not set -# CONFIG_VIDEO_IMX219 is not set -# CONFIG_VIDEO_IMX258 is not set -# CONFIG_VIDEO_IMX274 is not set -# CONFIG_VIDEO_IMX283 is not set -# CONFIG_VIDEO_IMX290 is not set -# CONFIG_VIDEO_IMX296 is not set -# CONFIG_VIDEO_IMX319 is not set -# CONFIG_VIDEO_IMX334 is not set -# CONFIG_VIDEO_IMX335 is not set -# CONFIG_VIDEO_IMX355 is not set -# CONFIG_VIDEO_IMX412 is not set -# CONFIG_VIDEO_IMX415 is not set -# CONFIG_VIDEO_MT9M001 is not set -# CONFIG_VIDEO_MT9M111 is not set -# CONFIG_VIDEO_MT9M114 is not set -# CONFIG_VIDEO_MT9P031 is not set -# CONFIG_VIDEO_MT9T112 is not set -# CONFIG_VIDEO_MT9V011 is not set -# CONFIG_VIDEO_MT9V032 is not set -# CONFIG_VIDEO_MT9V111 is not set -# CONFIG_VIDEO_OG01A1B is not set -# CONFIG_VIDEO_OV01A10 is not set -# CONFIG_VIDEO_OV02A10 is not set -# CONFIG_VIDEO_OV08D10 is not set -# CONFIG_VIDEO_OV08X40 is not set -# CONFIG_VIDEO_OV13858 is not set -# CONFIG_VIDEO_OV13B10 is not set -# CONFIG_VIDEO_OV2640 is not set -# CONFIG_VIDEO_OV2659 is not set -# CONFIG_VIDEO_OV2680 is not set -# CONFIG_VIDEO_OV2685 is not set -# CONFIG_VIDEO_OV2740 is not set -# CONFIG_VIDEO_OV4689 is not set -# CONFIG_VIDEO_OV5640 is not set -# CONFIG_VIDEO_OV5645 is not set -# CONFIG_VIDEO_OV5647 is not set -# CONFIG_VIDEO_OV5648 is not set -# CONFIG_VIDEO_OV5670 is not set -# CONFIG_VIDEO_OV5675 is not set -# CONFIG_VIDEO_OV5693 is not set -# CONFIG_VIDEO_OV5695 is not set -# CONFIG_VIDEO_OV64A40 is not set -# CONFIG_VIDEO_OV6650 is not set -# CONFIG_VIDEO_OV7251 is not set -# CONFIG_VIDEO_OV7640 is not set -# CONFIG_VIDEO_OV7670 is not set -# CONFIG_VIDEO_OV772X is not set -# CONFIG_VIDEO_OV7740 is not set -# CONFIG_VIDEO_OV8856 is not set -# CONFIG_VIDEO_OV8858 is not set -# CONFIG_VIDEO_OV8865 is not set -# CONFIG_VIDEO_OV9282 is not set -# CONFIG_VIDEO_OV9640 is not set -# CONFIG_VIDEO_OV9650 is not set -# CONFIG_VIDEO_OV9734 is not set -# CONFIG_VIDEO_RDACM20 is not set -# CONFIG_VIDEO_RDACM21 is not set -# CONFIG_VIDEO_RJ54N1 is not set -# CONFIG_VIDEO_S5C73M3 is not set -# CONFIG_VIDEO_S5K5BAF is not set -# CONFIG_VIDEO_S5K6A3 is not set -# CONFIG_VIDEO_VGXY61 is not set -# CONFIG_VIDEO_CCS is not set -# CONFIG_VIDEO_ET8EK8 is not set - -# Camera ISPs -# CONFIG_VIDEO_THP7312 is not set -# end of Camera ISPs - -# Lens drivers -# CONFIG_VIDEO_AD5820 is not set -# CONFIG_VIDEO_AK7375 is not set -# CONFIG_VIDEO_DW9714 is not set -# CONFIG_VIDEO_DW9719 is not set -# CONFIG_VIDEO_DW9768 is not set -# CONFIG_VIDEO_DW9807_VCM is not set -# end of Lens drivers - -# Flash devices -# CONFIG_VIDEO_ADP1653 is not set -# CONFIG_VIDEO_LM3560 is not set -# CONFIG_VIDEO_LM3646 is not set -# end of Flash devices - -# Audio decoders, processors and mixers -# CONFIG_VIDEO_CS3308 is not set -# CONFIG_VIDEO_CS5345 is not set -# CONFIG_VIDEO_CS53L32A is not set -# CONFIG_VIDEO_MSP3400 is not set -# CONFIG_VIDEO_SONY_BTF_MPX is not set -# CONFIG_VIDEO_TDA1997X is not set -# CONFIG_VIDEO_TDA7432 is not set -# CONFIG_VIDEO_TDA9840 is not set -# CONFIG_VIDEO_TEA6415C is not set -# CONFIG_VIDEO_TEA6420 is not set -# CONFIG_VIDEO_TLV320AIC23B is not set -# CONFIG_VIDEO_TVAUDIO is not set -# CONFIG_VIDEO_UDA1342 is not set -# CONFIG_VIDEO_VP27SMPX is not set -# CONFIG_VIDEO_WM8739 is not set -# CONFIG_VIDEO_WM8775 is not set -# end of Audio decoders, processors and mixers - -# RDS decoders -# CONFIG_VIDEO_SAA6588 is not set -# end of RDS decoders - -# Video decoders -# CONFIG_VIDEO_ADV7180 is not set -# CONFIG_VIDEO_ADV7183 is not set -# CONFIG_VIDEO_ADV748X is not set -# CONFIG_VIDEO_ADV7604 is not set -# CONFIG_VIDEO_ADV7842 is not set -# CONFIG_VIDEO_BT819 is not set -# CONFIG_VIDEO_BT856 is not set -# CONFIG_VIDEO_BT866 is not set -# CONFIG_VIDEO_ISL7998X is not set -# CONFIG_VIDEO_KS0127 is not set -# CONFIG_VIDEO_MAX9286 is not set -# CONFIG_VIDEO_ML86V7667 is not set -# CONFIG_VIDEO_SAA7110 is not set -# CONFIG_VIDEO_SAA711X is not set -# CONFIG_VIDEO_TC358743 is not set -# CONFIG_VIDEO_TC358746 is not set -# CONFIG_VIDEO_TVP514X is not set -# CONFIG_VIDEO_TVP5150 is not set -# CONFIG_VIDEO_TVP7002 is not set -# CONFIG_VIDEO_TW2804 is not set -# CONFIG_VIDEO_TW9900 is not set -# CONFIG_VIDEO_TW9903 is not set -# CONFIG_VIDEO_TW9906 is not set -# CONFIG_VIDEO_TW9910 is not set -# CONFIG_VIDEO_VPX3220 is not set - -## Video and audio decoders -# CONFIG_VIDEO_SAA717X is not set -# CONFIG_VIDEO_CX25840 is not set -# end of Video decoders - -# Video encoders -# CONFIG_VIDEO_ADV7170 is not set -# CONFIG_VIDEO_ADV7175 is not set -# CONFIG_VIDEO_ADV7343 is not set -# CONFIG_VIDEO_ADV7393 is not set -# CONFIG_VIDEO_ADV7511 is not set -# CONFIG_VIDEO_AK881X is not set -# CONFIG_VIDEO_SAA7127 is not set -# CONFIG_VIDEO_SAA7185 is not set -# CONFIG_VIDEO_THS8200 is not set -# end of Video encoders - -# Video improvement chips -# CONFIG_VIDEO_UPD64031A is not set -# CONFIG_VIDEO_UPD64083 is not set -# end of Video improvement chips - -# Audio/Video compression chips -# CONFIG_VIDEO_SAA6752HS is not set -# end of Audio/Video compression chips - -# SDR tuner chips -# CONFIG_SDR_MAX2175 is not set -# end of SDR tuner chips - -# Miscellaneous helper chips -# CONFIG_VIDEO_I2C is not set -# CONFIG_VIDEO_M52790 is not set -# CONFIG_VIDEO_ST_MIPID02 is not set -# CONFIG_VIDEO_THS7303 is not set -# end of Miscellaneous helper chips - -# Video serializers and deserializers -# CONFIG_VIDEO_DS90UB913 is not set -# CONFIG_VIDEO_DS90UB953 is not set -# CONFIG_VIDEO_DS90UB960 is not set -# CONFIG_VIDEO_MAX96714 is not set -# CONFIG_VIDEO_MAX96717 is not set -# end of Video serializers and deserializers - -# Media SPI Adapters -# CONFIG_VIDEO_GS1662 is not set -# end of Media SPI Adapters - -CONFIG_MEDIA_TUNER=m - -# Customize TV tuners -CONFIG_MEDIA_TUNER_E4000=m -CONFIG_MEDIA_TUNER_FC0011=m -CONFIG_MEDIA_TUNER_FC0012=m -CONFIG_MEDIA_TUNER_FC0013=m -CONFIG_MEDIA_TUNER_FC2580=m -CONFIG_MEDIA_TUNER_IT913X=m -CONFIG_MEDIA_TUNER_M88RS6000T=m -CONFIG_MEDIA_TUNER_MAX2165=m -CONFIG_MEDIA_TUNER_MC44S803=m -CONFIG_MEDIA_TUNER_MSI001=m -CONFIG_MEDIA_TUNER_MT2060=m -CONFIG_MEDIA_TUNER_MT2063=m -CONFIG_MEDIA_TUNER_MT20XX=m -CONFIG_MEDIA_TUNER_MT2131=m -CONFIG_MEDIA_TUNER_MT2266=m -CONFIG_MEDIA_TUNER_MXL301RF=m -CONFIG_MEDIA_TUNER_MXL5005S=m -CONFIG_MEDIA_TUNER_MXL5007T=m -CONFIG_MEDIA_TUNER_QM1D1B0004=m -CONFIG_MEDIA_TUNER_QM1D1C0042=m -CONFIG_MEDIA_TUNER_QT1010=m -CONFIG_MEDIA_TUNER_R820T=m -CONFIG_MEDIA_TUNER_SI2157=m -CONFIG_MEDIA_TUNER_SIMPLE=m -CONFIG_MEDIA_TUNER_TDA18212=m -CONFIG_MEDIA_TUNER_TDA18218=m -CONFIG_MEDIA_TUNER_TDA18250=m -CONFIG_MEDIA_TUNER_TDA18271=m -CONFIG_MEDIA_TUNER_TDA827X=m -CONFIG_MEDIA_TUNER_TDA8290=m -CONFIG_MEDIA_TUNER_TDA9887=m -CONFIG_MEDIA_TUNER_TEA5761=m -CONFIG_MEDIA_TUNER_TEA5767=m -CONFIG_MEDIA_TUNER_TUA9001=m -CONFIG_MEDIA_TUNER_XC2028=m -CONFIG_MEDIA_TUNER_XC4000=m -CONFIG_MEDIA_TUNER_XC5000=m -# end of Customize TV tuners - -# Customise DVB Frontends -# end of Customise DVB Frontends - -## Tools to develop new frontends -# end of Media ancillary drivers - -# Graphics support -CONFIG_APERTURE_HELPERS=y -CONFIG_SCREEN_INFO=y -CONFIG_VIDEO=y -# CONFIG_AUXDISPLAY is not set -# CONFIG_TEGRA_HOST1X is not set -CONFIG_DRM=m -CONFIG_DRM_MIPI_DSI=y -# CONFIG_DRM_DEBUG_MM is not set -CONFIG_DRM_KMS_HELPER=m -CONFIG_DRM_DRAW=y -CONFIG_DRM_PANIC=y -CONFIG_DRM_PANIC_FOREGROUND_COLOR=0xffffff -CONFIG_DRM_PANIC_BACKGROUND_COLOR=0x000000 -# CONFIG_DRM_PANIC_DEBUG is not set -CONFIG_DRM_PANIC_SCREEN="user" -# CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS is not set -# CONFIG_DRM_DEBUG_MODESET_LOCK is not set -CONFIG_DRM_FBDEV_EMULATION=y -CONFIG_DRM_FBDEV_OVERALLOC=100 -# CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM is not set -# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set -CONFIG_DRM_DISPLAY_HELPER=m -# CONFIG_DRM_DISPLAY_DP_AUX_CEC is not set -# CONFIG_DRM_DISPLAY_DP_AUX_CHARDEV is not set -CONFIG_DRM_DISPLAY_HDMI_HELPER=y -CONFIG_DRM_DISPLAY_HDMI_STATE_HELPER=y -CONFIG_DRM_TTM=m -CONFIG_DRM_TTM_HELPER=m -CONFIG_DRM_GEM_DMA_HELPER=m -CONFIG_DRM_GEM_SHMEM_HELPER=m - -# I2C encoder or helper chips -# CONFIG_DRM_I2C_CH7006 is not set -# CONFIG_DRM_I2C_SIL164 is not set -# CONFIG_DRM_I2C_NXP_TDA998X is not set -# CONFIG_DRM_I2C_NXP_TDA9950 is not set -# end of I2C encoder or helper chips - -# ARM devices -# CONFIG_DRM_HDLCD is not set -# CONFIG_DRM_MALI_DISPLAY is not set -# CONFIG_DRM_KOMEDA is not set -# end of ARM devices - -# CONFIG_DRM_RADEON is not set -# CONFIG_DRM_AMDGPU is not set -# CONFIG_DRM_NOUVEAU is not set -# CONFIG_DRM_XE is not set -# CONFIG_DRM_VGEM is not set -# CONFIG_DRM_VKMS is not set -# CONFIG_DRM_EXYNOS is not set -CONFIG_DRM_VMWGFX=m -# CONFIG_DRM_UDL is not set -# CONFIG_DRM_AST is not set -# CONFIG_DRM_MGAG200 is not set -# CONFIG_DRM_SUN4I is not set -# CONFIG_DRM_QXL is not set -# CONFIG_DRM_VIRTIO_GPU is not set -# CONFIG_DRM_MSM is not set -# CONFIG_DRM_TEGRA is not set -CONFIG_DRM_PANEL=y - -# Display Panels -# CONFIG_DRM_PANEL_ABT_Y030XX067A is not set -# CONFIG_DRM_PANEL_ARM_VERSATILE is not set -# CONFIG_DRM_PANEL_ASUS_Z00T_TM5P5_NT35596 is not set -# CONFIG_DRM_PANEL_AUO_A030JTN01 is not set -# CONFIG_DRM_PANEL_BOE_BF060Y8M_AJ0 is not set -# CONFIG_DRM_PANEL_BOE_HIMAX8279D is not set -# CONFIG_DRM_PANEL_BOE_TH101MB31UIG002_28A is not set -# CONFIG_DRM_PANEL_BOE_TV101WUM_NL6 is not set -# CONFIG_DRM_PANEL_BOE_TV101WUM_LL2 is not set -# CONFIG_DRM_PANEL_EBBG_FT8719 is not set -# CONFIG_DRM_PANEL_ELIDA_KD35T133 is not set -# CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02 is not set -# CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D is not set -# CONFIG_DRM_PANEL_DSI_CM is not set -# CONFIG_DRM_PANEL_LVDS is not set -# CONFIG_DRM_PANEL_HIMAX_HX83102 is not set -# CONFIG_DRM_PANEL_HIMAX_HX83112A is not set -# CONFIG_DRM_PANEL_HIMAX_HX8394 is not set -# CONFIG_DRM_PANEL_ILITEK_IL9322 is not set -# CONFIG_DRM_PANEL_ILITEK_ILI9341 is not set -# CONFIG_DRM_PANEL_ILITEK_ILI9805 is not set -# CONFIG_DRM_PANEL_ILITEK_ILI9806E is not set -# CONFIG_DRM_PANEL_ILITEK_ILI9881C is not set -# CONFIG_DRM_PANEL_ILITEK_ILI9882T is not set -# CONFIG_DRM_PANEL_INNOLUX_EJ030NA is not set -# CONFIG_DRM_PANEL_INNOLUX_P079ZCA is not set -# CONFIG_DRM_PANEL_JADARD_JD9365DA_H3 is not set -# CONFIG_DRM_PANEL_JDI_LPM102A188A is not set -# CONFIG_DRM_PANEL_JDI_LT070ME05000 is not set -# CONFIG_DRM_PANEL_JDI_R63452 is not set -# CONFIG_DRM_PANEL_KHADAS_TS050 is not set -# CONFIG_DRM_PANEL_KINGDISPLAY_KD097D04 is not set -# CONFIG_DRM_PANEL_LEADTEK_LTK050H3146W is not set -# CONFIG_DRM_PANEL_LEADTEK_LTK500HD1829 is not set -# CONFIG_DRM_PANEL_LINCOLNTECH_LCD197 is not set -# CONFIG_DRM_PANEL_LG_LB035Q02 is not set -# CONFIG_DRM_PANEL_LG_LG4573 is not set -# CONFIG_DRM_PANEL_LG_SW43408 is not set -# CONFIG_DRM_PANEL_MAGNACHIP_D53E6EA8966 is not set -# CONFIG_DRM_PANEL_MANTIX_MLAF057WE51 is not set -# CONFIG_DRM_PANEL_NEC_NL8048HL11 is not set -# CONFIG_DRM_PANEL_NEWVISION_NV3051D is not set -# CONFIG_DRM_PANEL_NEWVISION_NV3052C is not set -# CONFIG_DRM_PANEL_NOVATEK_NT35510 is not set -# CONFIG_DRM_PANEL_NOVATEK_NT35560 is not set -# CONFIG_DRM_PANEL_NOVATEK_NT35950 is not set -# CONFIG_DRM_PANEL_NOVATEK_NT36523 is not set -# CONFIG_DRM_PANEL_NOVATEK_NT36672A is not set -# CONFIG_DRM_PANEL_NOVATEK_NT36672E is not set -# CONFIG_DRM_PANEL_NOVATEK_NT39016 is not set -# CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO is not set -# CONFIG_DRM_PANEL_ORISETECH_OTA5601A is not set -# CONFIG_DRM_PANEL_ORISETECH_OTM8009A is not set -# CONFIG_DRM_PANEL_OSD_OSD101T2587_53TS is not set -# CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00 is not set -CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m -# CONFIG_DRM_PANEL_RAYDIUM_RM67191 is not set -# CONFIG_DRM_PANEL_RAYDIUM_RM68200 is not set -# CONFIG_DRM_PANEL_RAYDIUM_RM692E5 is not set -# CONFIG_DRM_PANEL_RAYDIUM_RM69380 is not set -# CONFIG_DRM_PANEL_RONBO_RB070D30 is not set -# CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01 is not set -# CONFIG_DRM_PANEL_SAMSUNG_ATNA33XC20 is not set -# CONFIG_DRM_PANEL_SAMSUNG_DB7430 is not set -# CONFIG_DRM_PANEL_SAMSUNG_LD9040 is not set -# CONFIG_DRM_PANEL_SAMSUNG_S6E3FA7 is not set -# CONFIG_DRM_PANEL_SAMSUNG_S6D16D0 is not set -# CONFIG_DRM_PANEL_SAMSUNG_S6D27A1 is not set -# CONFIG_DRM_PANEL_SAMSUNG_S6D7AA0 is not set -# CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2 is not set -# CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03 is not set -# CONFIG_DRM_PANEL_SAMSUNG_S6E63M0 is not set -# CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0 is not set -# CONFIG_DRM_PANEL_SAMSUNG_SOFEF00 is not set -# CONFIG_DRM_PANEL_SEIKO_43WVF1G is not set -# CONFIG_DRM_PANEL_SHARP_LQ101R1SX01 is not set -# CONFIG_DRM_PANEL_SHARP_LS037V7DW01 is not set -# CONFIG_DRM_PANEL_SHARP_LS043T1LE01 is not set -# CONFIG_DRM_PANEL_SHARP_LS060T1SX01 is not set -# CONFIG_DRM_PANEL_SITRONIX_ST7701 is not set -# CONFIG_DRM_PANEL_SITRONIX_ST7703 is not set -# CONFIG_DRM_PANEL_SITRONIX_ST7789V is not set -# CONFIG_DRM_PANEL_SONY_ACX565AKM is not set -# CONFIG_DRM_PANEL_SONY_TD4353_JDI is not set -# CONFIG_DRM_PANEL_SONY_TULIP_TRULY_NT35521 is not set -# CONFIG_DRM_PANEL_STARTEK_KD070FHFID015 is not set -# CONFIG_DRM_PANEL_EDP is not set -# CONFIG_DRM_PANEL_SIMPLE is not set -# CONFIG_DRM_PANEL_SYNAPTICS_R63353 is not set -# CONFIG_DRM_PANEL_TDO_TL070WSH30 is not set -# CONFIG_DRM_PANEL_TPO_TD028TTEC1 is not set -# CONFIG_DRM_PANEL_TPO_TD043MTEA1 is not set -# CONFIG_DRM_PANEL_TPO_TPG110 is not set -# CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA is not set -# CONFIG_DRM_PANEL_VISIONOX_R66451 is not set -# CONFIG_DRM_PANEL_VISIONOX_RM69299 is not set -# CONFIG_DRM_PANEL_VISIONOX_VTDR6130 is not set -# CONFIG_DRM_PANEL_WIDECHIPS_WS2401 is not set -# CONFIG_DRM_PANEL_XINPENG_XPP055C272 is not set -# end of Display Panels - -CONFIG_DRM_BRIDGE=y -CONFIG_DRM_PANEL_BRIDGE=y - -# Display Interface Bridges -# CONFIG_DRM_CHIPONE_ICN6211 is not set -# CONFIG_DRM_CHRONTEL_CH7033 is not set -# CONFIG_DRM_DISPLAY_CONNECTOR is not set -# CONFIG_DRM_ITE_IT6505 is not set -# CONFIG_DRM_LONTIUM_LT8912B is not set -# CONFIG_DRM_LONTIUM_LT9211 is not set -# CONFIG_DRM_LONTIUM_LT9611 is not set -# CONFIG_DRM_LONTIUM_LT9611UXC is not set -# CONFIG_DRM_ITE_IT66121 is not set -# CONFIG_DRM_LVDS_CODEC is not set -# CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW is not set -# CONFIG_DRM_NWL_MIPI_DSI is not set -# CONFIG_DRM_NXP_PTN3460 is not set -# CONFIG_DRM_PARADE_PS8622 is not set -# CONFIG_DRM_PARADE_PS8640 is not set -# CONFIG_DRM_SAMSUNG_DSIM is not set -# CONFIG_DRM_SIL_SII8620 is not set -# CONFIG_DRM_SII902X is not set -# CONFIG_DRM_SII9234 is not set -# CONFIG_DRM_SIMPLE_BRIDGE is not set -# CONFIG_DRM_THINE_THC63LVD1024 is not set -# CONFIG_DRM_TOSHIBA_TC358762 is not set -# CONFIG_DRM_TOSHIBA_TC358764 is not set -# CONFIG_DRM_TOSHIBA_TC358767 is not set -# CONFIG_DRM_TOSHIBA_TC358768 is not set -# CONFIG_DRM_TOSHIBA_TC358775 is not set -# CONFIG_DRM_TI_DLPC3433 is not set -# CONFIG_DRM_TI_TFP410 is not set -# CONFIG_DRM_TI_SN65DSI83 is not set -# CONFIG_DRM_TI_SN65DSI86 is not set -# CONFIG_DRM_TI_TPD12S015 is not set -# CONFIG_DRM_ANALOGIX_ANX6345 is not set -# CONFIG_DRM_ANALOGIX_ANX78XX is not set -# CONFIG_DRM_ANALOGIX_ANX7625 is not set -# CONFIG_DRM_I2C_ADV7511 is not set -# CONFIG_DRM_CDNS_DSI is not set -# CONFIG_DRM_CDNS_MHDP8546 is not set -# end of Display Interface Bridges - -# CONFIG_DRM_V3D is not set -CONFIG_DRM_VC4=m -CONFIG_DRM_VC4_HDMI_CEC=y -# CONFIG_DRM_ETNAVIV is not set -# CONFIG_DRM_HISI_HIBMC is not set -# CONFIG_DRM_HISI_KIRIN is not set -# CONFIG_DRM_LOGICVC is not set -# CONFIG_DRM_MEDIATEK is not set -# CONFIG_DRM_MESON is not set -# CONFIG_DRM_ARCPGU is not set -# CONFIG_DRM_BOCHS is not set -CONFIG_DRM_CIRRUS_QEMU=m -# CONFIG_DRM_GM12U320 is not set -# CONFIG_DRM_PANEL_MIPI_DBI is not set -# CONFIG_DRM_SIMPLEDRM is not set -# CONFIG_TINYDRM_HX8357D is not set -# CONFIG_TINYDRM_ILI9163 is not set -# CONFIG_TINYDRM_ILI9225 is not set -# CONFIG_TINYDRM_ILI9341 is not set -# CONFIG_TINYDRM_ILI9486 is not set -# CONFIG_TINYDRM_MI0283QT is not set -# CONFIG_TINYDRM_REPAPER is not set -# CONFIG_TINYDRM_ST7586 is not set -# CONFIG_TINYDRM_ST7735R is not set -# CONFIG_DRM_PL111 is not set -# CONFIG_DRM_XEN_FRONTEND is not set -# CONFIG_DRM_LIMA is not set -# CONFIG_DRM_PANFROST is not set -# CONFIG_DRM_PANTHOR is not set -# CONFIG_DRM_TIDSS is not set -# CONFIG_DRM_GUD is not set -# CONFIG_DRM_SSD130X is not set -# CONFIG_DRM_SPRD is not set -# CONFIG_DRM_POWERVR is not set -# CONFIG_DRM_WERROR is not set -CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y - -# Frame buffer Devices -CONFIG_FB=y -CONFIG_FB_CIRRUS=m -# CONFIG_FB_PM2 is not set -# CONFIG_FB_CYBER2000 is not set -# CONFIG_FB_ASILIANT is not set -# CONFIG_FB_IMSTT is not set -# CONFIG_FB_UVESA is not set -CONFIG_FB_EFI=y -# CONFIG_FB_OPENCORES is not set -# CONFIG_FB_S1D13XXX is not set -CONFIG_FB_NVIDIA=m -# CONFIG_FB_NVIDIA_I2C is not set -# CONFIG_FB_NVIDIA_DEBUG is not set -CONFIG_FB_NVIDIA_BACKLIGHT=y -# CONFIG_FB_RIVA is not set -CONFIG_FB_I740=m -# CONFIG_FB_MATROX is not set -CONFIG_FB_RADEON=m -CONFIG_FB_RADEON_I2C=y -CONFIG_FB_RADEON_BACKLIGHT=y -# CONFIG_FB_RADEON_DEBUG is not set -# CONFIG_FB_ATY128 is not set -# CONFIG_FB_ATY is not set -# CONFIG_FB_S3 is not set -# CONFIG_FB_SAVAGE is not set -# CONFIG_FB_SIS is not set -# CONFIG_FB_NEOMAGIC is not set -# CONFIG_FB_KYRO is not set -# CONFIG_FB_3DFX is not set -# CONFIG_FB_VOODOO1 is not set -# CONFIG_FB_VT8623 is not set -# CONFIG_FB_TRIDENT is not set -# CONFIG_FB_ARK is not set -# CONFIG_FB_PM3 is not set -# CONFIG_FB_CARMINE is not set -# CONFIG_FB_SMSCUFX is not set -# CONFIG_FB_UDL is not set -# CONFIG_FB_IBM_GXT4500 is not set -# CONFIG_FB_XILINX is not set -# CONFIG_FB_VIRTUAL is not set -CONFIG_XEN_FBDEV_FRONTEND=m -# CONFIG_FB_METRONOME is not set -# CONFIG_FB_MB862XX is not set -# CONFIG_FB_SIMPLE is not set -# CONFIG_FB_SSD1307 is not set -# CONFIG_FB_SM712 is not set -CONFIG_FB_CORE=y -CONFIG_FB_NOTIFY=y -# CONFIG_FIRMWARE_EDID is not set -CONFIG_FB_DEVICE=y -CONFIG_FB_DDC=m -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_IMAGEBLIT=y -CONFIG_FB_SYS_FILLRECT=y -CONFIG_FB_SYS_COPYAREA=y -CONFIG_FB_SYS_IMAGEBLIT=y -# CONFIG_FB_FOREIGN_ENDIAN is not set -CONFIG_FB_SYSMEM_FOPS=y -CONFIG_FB_DEFERRED_IO=y -CONFIG_FB_DMAMEM_HELPERS=y -CONFIG_FB_DMAMEM_HELPERS_DEFERRED=y -CONFIG_FB_IOMEM_FOPS=y -CONFIG_FB_IOMEM_HELPERS=y -CONFIG_FB_SYSMEM_HELPERS=y -CONFIG_FB_SYSMEM_HELPERS_DEFERRED=y -CONFIG_FB_BACKLIGHT=m -CONFIG_FB_MODE_HELPERS=y -# CONFIG_FB_TILEBLITTING is not set -# end of Frame buffer Devices - -# Backlight & LCD device support -# CONFIG_LCD_CLASS_DEVICE is not set -CONFIG_BACKLIGHT_CLASS_DEVICE=y -# CONFIG_BACKLIGHT_KTD253 is not set -# CONFIG_BACKLIGHT_KTD2801 is not set -# CONFIG_BACKLIGHT_KTZ8866 is not set -# CONFIG_BACKLIGHT_PWM is not set -# CONFIG_BACKLIGHT_QCOM_WLED is not set -# CONFIG_BACKLIGHT_ADP8860 is not set -# CONFIG_BACKLIGHT_ADP8870 is not set -# CONFIG_BACKLIGHT_LM3509 is not set -# CONFIG_BACKLIGHT_LM3630A is not set -# CONFIG_BACKLIGHT_LM3639 is not set -# CONFIG_BACKLIGHT_LP855X is not set -# CONFIG_BACKLIGHT_MP3309C is not set -# CONFIG_BACKLIGHT_GPIO is not set -# CONFIG_BACKLIGHT_LV5207LP is not set -# CONFIG_BACKLIGHT_BD6107 is not set -# CONFIG_BACKLIGHT_ARCXCNN is not set -# CONFIG_BACKLIGHT_LED is not set -# end of Backlight & LCD device support - -CONFIG_VGASTATE=m -CONFIG_HDMI=y - -# Console display driver support -CONFIG_DUMMY_CONSOLE=y -CONFIG_DUMMY_CONSOLE_COLUMNS=80 -CONFIG_DUMMY_CONSOLE_ROWS=25 -CONFIG_FRAMEBUFFER_CONSOLE=y -# CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is not set -CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y -CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y -# CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is not set -# end of Console display driver support - -# CONFIG_LOGO is not set -# end of Graphics support - -# CONFIG_DRM_ACCEL is not set -CONFIG_SOUND=m -CONFIG_SND=m -CONFIG_SND_TIMER=m -CONFIG_SND_PCM=m -CONFIG_SND_PCM_ELD=y -CONFIG_SND_PCM_IEC958=y -CONFIG_SND_DMAENGINE_PCM=m -CONFIG_SND_RAWMIDI=m -CONFIG_SND_JACK=y -CONFIG_SND_JACK_INPUT_DEV=y -# CONFIG_SND_OSSEMUL is not set -CONFIG_SND_PCM_TIMER=y -# CONFIG_SND_HRTIMER is not set -# CONFIG_SND_DYNAMIC_MINORS is not set -CONFIG_SND_SUPPORT_OLD_API=y -CONFIG_SND_PROC_FS=y -CONFIG_SND_VERBOSE_PROCFS=y -CONFIG_SND_CTL_FAST_LOOKUP=y -# CONFIG_SND_DEBUG is not set -# CONFIG_SND_CTL_INPUT_VALIDATION is not set -# CONFIG_SND_UTIMER is not set -CONFIG_SND_VMASTER=y -# CONFIG_SND_SEQUENCER is not set -CONFIG_SND_AC97_CODEC=m -CONFIG_SND_DRIVERS=y -# CONFIG_SND_DUMMY is not set -# CONFIG_SND_ALOOP is not set -# CONFIG_SND_PCMTEST is not set -# CONFIG_SND_MTPAV is not set -# CONFIG_SND_SERIAL_U16550 is not set -# CONFIG_SND_SERIAL_GENERIC is not set -# CONFIG_SND_MPU401 is not set -# CONFIG_SND_AC97_POWER_SAVE is not set -CONFIG_SND_PCI=y -# CONFIG_SND_AD1889 is not set -# CONFIG_SND_ALS300 is not set -# CONFIG_SND_ALI5451 is not set -# CONFIG_SND_ATIIXP is not set -# CONFIG_SND_ATIIXP_MODEM is not set -# CONFIG_SND_AU8810 is not set -# CONFIG_SND_AU8820 is not set -# CONFIG_SND_AU8830 is not set -# CONFIG_SND_AW2 is not set -# CONFIG_SND_AZT3328 is not set -# CONFIG_SND_BT87X is not set -# CONFIG_SND_CA0106 is not set -# CONFIG_SND_CMIPCI is not set -# CONFIG_SND_OXYGEN is not set -# CONFIG_SND_CS4281 is not set -# CONFIG_SND_CS46XX is not set -# CONFIG_SND_CTXFI is not set -# CONFIG_SND_DARLA20 is not set -# CONFIG_SND_GINA20 is not set -# CONFIG_SND_LAYLA20 is not set -# CONFIG_SND_DARLA24 is not set -# CONFIG_SND_GINA24 is not set -# CONFIG_SND_LAYLA24 is not set -# CONFIG_SND_MONA is not set -# CONFIG_SND_MIA is not set -# CONFIG_SND_ECHO3G is not set -# CONFIG_SND_INDIGO is not set -# CONFIG_SND_INDIGOIO is not set -# CONFIG_SND_INDIGODJ is not set -# CONFIG_SND_INDIGOIOX is not set -# CONFIG_SND_INDIGODJX is not set -# CONFIG_SND_EMU10K1 is not set -# CONFIG_SND_EMU10K1X is not set -# CONFIG_SND_ENS1370 is not set -CONFIG_SND_ENS1371=m -# CONFIG_SND_ES1938 is not set -# CONFIG_SND_ES1968 is not set -# CONFIG_SND_FM801 is not set -# CONFIG_SND_HDSP is not set -# CONFIG_SND_HDSPM is not set -# CONFIG_SND_ICE1712 is not set -# CONFIG_SND_ICE1724 is not set -# CONFIG_SND_INTEL8X0 is not set -# CONFIG_SND_INTEL8X0M is not set -# CONFIG_SND_KORG1212 is not set -# CONFIG_SND_LOLA is not set -# CONFIG_SND_LX6464ES is not set -# CONFIG_SND_MAESTRO3 is not set -# CONFIG_SND_MIXART is not set -# CONFIG_SND_NM256 is not set -# CONFIG_SND_PCXHR is not set -# CONFIG_SND_RIPTIDE is not set -# CONFIG_SND_RME32 is not set -# CONFIG_SND_RME96 is not set -# CONFIG_SND_RME9652 is not set -# CONFIG_SND_SE6X is not set -# CONFIG_SND_SONICVIBES is not set -# CONFIG_SND_TRIDENT is not set -# CONFIG_SND_VIA82XX is not set -# CONFIG_SND_VIA82XX_MODEM is not set -# CONFIG_SND_VIRTUOSO is not set -# CONFIG_SND_VX222 is not set -# CONFIG_SND_YMFPCI is not set - -# HD-Audio -CONFIG_SND_HDA=m -CONFIG_SND_HDA_INTEL=m -# CONFIG_SND_HDA_TEGRA is not set -# CONFIG_SND_HDA_HWDEP is not set -# CONFIG_SND_HDA_RECONFIG is not set -# CONFIG_SND_HDA_INPUT_BEEP is not set -# CONFIG_SND_HDA_PATCH_LOADER is not set -# CONFIG_SND_HDA_SCODEC_CS35L41_I2C is not set -# CONFIG_SND_HDA_SCODEC_CS35L41_SPI is not set -# CONFIG_SND_HDA_SCODEC_CS35L56_I2C is not set -# CONFIG_SND_HDA_SCODEC_CS35L56_SPI is not set -# CONFIG_SND_HDA_SCODEC_TAS2781_I2C is not set -# CONFIG_SND_HDA_CODEC_REALTEK is not set -# CONFIG_SND_HDA_CODEC_ANALOG is not set -# CONFIG_SND_HDA_CODEC_SIGMATEL is not set -# CONFIG_SND_HDA_CODEC_VIA is not set -# CONFIG_SND_HDA_CODEC_HDMI is not set -# CONFIG_SND_HDA_CODEC_CIRRUS is not set -# CONFIG_SND_HDA_CODEC_CS8409 is not set -# CONFIG_SND_HDA_CODEC_CONEXANT is not set -# CONFIG_SND_HDA_CODEC_SENARYTECH is not set -# CONFIG_SND_HDA_CODEC_CA0110 is not set -# CONFIG_SND_HDA_CODEC_CA0132 is not set -# CONFIG_SND_HDA_CODEC_CMEDIA is not set -# CONFIG_SND_HDA_CODEC_SI3054 is not set -# CONFIG_SND_HDA_GENERIC is not set -CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 -# CONFIG_SND_HDA_INTEL_HDMI_SILENT_STREAM is not set -# CONFIG_SND_HDA_CTL_DEV_ID is not set -# end of HD-Audio - -CONFIG_SND_HDA_CORE=m -CONFIG_SND_HDA_PREALLOC_SIZE=64 -CONFIG_SND_INTEL_NHLT=y -CONFIG_SND_INTEL_DSP_CONFIG=m -CONFIG_SND_INTEL_SOUNDWIRE_ACPI=m -CONFIG_SND_SPI=y -CONFIG_SND_USB=y -# CONFIG_SND_USB_AUDIO is not set -# CONFIG_SND_USB_UA101 is not set -# CONFIG_SND_USB_CAIAQ is not set -# CONFIG_SND_USB_6FIRE is not set -# CONFIG_SND_USB_HIFACE is not set -# CONFIG_SND_BCD2000 is not set -# CONFIG_SND_USB_POD is not set -# CONFIG_SND_USB_PODHD is not set -# CONFIG_SND_USB_TONEPORT is not set -# CONFIG_SND_USB_VARIAX is not set -CONFIG_SND_SOC=m -CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y -# CONFIG_SND_SOC_ADI is not set -# CONFIG_SND_SOC_AMD_ACP is not set -# CONFIG_SND_AMD_ACP_CONFIG is not set -# CONFIG_SND_ATMEL_SOC is not set -CONFIG_SND_BCM2835_SOC_I2S=m -# CONFIG_SND_BCM63XX_I2S_WHISTLER is not set -# CONFIG_SND_DESIGNWARE_I2S is not set - -# SoC Audio for Freescale CPUs - -## Common SoC Audio options for Freescale CPUs: -# CONFIG_SND_SOC_FSL_ASRC is not set -CONFIG_SND_SOC_FSL_SAI=m -# CONFIG_SND_SOC_FSL_MQS is not set -# CONFIG_SND_SOC_FSL_AUDMIX is not set -# CONFIG_SND_SOC_FSL_SSI is not set -# CONFIG_SND_SOC_FSL_SPDIF is not set -# CONFIG_SND_SOC_FSL_ESAI is not set -# CONFIG_SND_SOC_FSL_MICFIL is not set -# CONFIG_SND_SOC_FSL_XCVR is not set -CONFIG_SND_SOC_FSL_UTILS=m -# CONFIG_SND_SOC_IMX_AUDMUX is not set -# end of SoC Audio for Freescale CPUs - -# CONFIG_SND_SOC_CHV3_I2S is not set -# CONFIG_SND_I2S_HI6210_I2S is not set -# CONFIG_SND_KIRKWOOD_SOC is not set -# CONFIG_SND_SOC_IMG is not set -# CONFIG_SND_SOC_MT2701 is not set -# CONFIG_SND_SOC_MT6797 is not set -# CONFIG_SND_SOC_MT7986 is not set -# CONFIG_SND_SOC_MT8173 is not set -# CONFIG_SND_SOC_MT8183 is not set -# CONFIG_SND_SOC_MT8186 is not set -# CONFIG_SND_SOC_MTK_BTCVSD is not set -# CONFIG_SND_SOC_MT8188 is not set -# CONFIG_SND_SOC_MT8192 is not set -# CONFIG_SND_SOC_MT8195 is not set -# CONFIG_SND_SOC_MT8365 is not set - -# ASoC support for Amlogic platforms -# CONFIG_SND_MESON_AIU is not set -# CONFIG_SND_MESON_AXG_FRDDR is not set -# CONFIG_SND_MESON_AXG_TODDR is not set -# CONFIG_SND_MESON_AXG_TDMIN is not set -# CONFIG_SND_MESON_AXG_TDMOUT is not set -# CONFIG_SND_MESON_AXG_SOUND_CARD is not set -# CONFIG_SND_MESON_AXG_SPDIFOUT is not set -# CONFIG_SND_MESON_AXG_SPDIFIN is not set -# CONFIG_SND_MESON_AXG_PDM is not set -# CONFIG_SND_MESON_GX_SOUND_CARD is not set -# CONFIG_SND_MESON_G12A_TOACODEC is not set -# CONFIG_SND_MESON_G12A_TOHDMITX is not set -# CONFIG_SND_SOC_MESON_T9015 is not set -# end of ASoC support for Amlogic platforms - -# CONFIG_SND_SOC_QCOM is not set -# CONFIG_SND_SOC_ROCKCHIP is not set -# CONFIG_SND_SOC_SAMSUNG is not set -# CONFIG_SND_SOC_SOF_TOPLEVEL is not set -# CONFIG_SND_SOC_SPRD is not set - -# STMicroelectronics STM32 SOC audio support -# end of STMicroelectronics STM32 SOC audio support - -# Allwinner SoC Audio support -# CONFIG_SND_SUN4I_CODEC is not set -# CONFIG_SND_SUN8I_CODEC is not set -# CONFIG_SND_SUN8I_CODEC_ANALOG is not set -# CONFIG_SND_SUN50I_CODEC_ANALOG is not set -# CONFIG_SND_SUN4I_I2S is not set -# CONFIG_SND_SUN4I_SPDIF is not set -# CONFIG_SND_SUN50I_DMIC is not set -# end of Allwinner SoC Audio support - -# CONFIG_SND_SOC_XILINX_I2S is not set -# CONFIG_SND_SOC_XILINX_AUDIO_FORMATTER is not set -# CONFIG_SND_SOC_XILINX_SPDIF is not set -# CONFIG_SND_SOC_XTFPGA_I2S is not set -CONFIG_SND_SOC_I2C_AND_SPI=m - -# CODEC drivers -# CONFIG_SND_SOC_AC97_CODEC is not set -# CONFIG_SND_SOC_ADAU1372_I2C is not set -# CONFIG_SND_SOC_ADAU1372_SPI is not set -# CONFIG_SND_SOC_ADAU1701 is not set -# CONFIG_SND_SOC_ADAU1761_I2C is not set -# CONFIG_SND_SOC_ADAU1761_SPI is not set -# CONFIG_SND_SOC_ADAU7002 is not set -# CONFIG_SND_SOC_ADAU7118_HW is not set -# CONFIG_SND_SOC_ADAU7118_I2C is not set -# CONFIG_SND_SOC_AK4104 is not set -# CONFIG_SND_SOC_AK4118 is not set -# CONFIG_SND_SOC_AK4375 is not set -# CONFIG_SND_SOC_AK4458 is not set -# CONFIG_SND_SOC_AK4554 is not set -# CONFIG_SND_SOC_AK4613 is not set -# CONFIG_SND_SOC_AK4619 is not set -# CONFIG_SND_SOC_AK4642 is not set -# CONFIG_SND_SOC_AK5386 is not set -# CONFIG_SND_SOC_AK5558 is not set -# CONFIG_SND_SOC_ALC5623 is not set -# CONFIG_SND_SOC_AW8738 is not set -# CONFIG_SND_SOC_AW88395 is not set -# CONFIG_SND_SOC_AW88261 is not set -# CONFIG_SND_SOC_AW87390 is not set -# CONFIG_SND_SOC_AW88399 is not set -# CONFIG_SND_SOC_BD28623 is not set -# CONFIG_SND_SOC_BT_SCO is not set -# CONFIG_SND_SOC_CHV3_CODEC is not set -# CONFIG_SND_SOC_CS35L32 is not set -# CONFIG_SND_SOC_CS35L33 is not set -# CONFIG_SND_SOC_CS35L34 is not set -# CONFIG_SND_SOC_CS35L35 is not set -# CONFIG_SND_SOC_CS35L36 is not set -# CONFIG_SND_SOC_CS35L41_SPI is not set -# CONFIG_SND_SOC_CS35L41_I2C is not set -# CONFIG_SND_SOC_CS35L45_SPI is not set -# CONFIG_SND_SOC_CS35L45_I2C is not set -# CONFIG_SND_SOC_CS35L56_I2C is not set -# CONFIG_SND_SOC_CS35L56_SPI is not set -# CONFIG_SND_SOC_CS42L42 is not set -# CONFIG_SND_SOC_CS42L51_I2C is not set -# CONFIG_SND_SOC_CS42L52 is not set -# CONFIG_SND_SOC_CS42L56 is not set -# CONFIG_SND_SOC_CS42L73 is not set -# CONFIG_SND_SOC_CS42L83 is not set -# CONFIG_SND_SOC_CS4234 is not set -# CONFIG_SND_SOC_CS4265 is not set -# CONFIG_SND_SOC_CS4270 is not set -# CONFIG_SND_SOC_CS4271_I2C is not set -# CONFIG_SND_SOC_CS4271_SPI is not set -# CONFIG_SND_SOC_CS42XX8_I2C is not set -# CONFIG_SND_SOC_CS43130 is not set -# CONFIG_SND_SOC_CS4341 is not set -# CONFIG_SND_SOC_CS4349 is not set -# CONFIG_SND_SOC_CS53L30 is not set -# CONFIG_SND_SOC_CS530X_I2C is not set -# CONFIG_SND_SOC_CX2072X is not set -# CONFIG_SND_SOC_DA7213 is not set -# CONFIG_SND_SOC_DMIC is not set -CONFIG_SND_SOC_HDMI_CODEC=m -# CONFIG_SND_SOC_ES7134 is not set -# CONFIG_SND_SOC_ES7241 is not set -# CONFIG_SND_SOC_ES8311 is not set -# CONFIG_SND_SOC_ES8316 is not set -# CONFIG_SND_SOC_ES8326 is not set -# CONFIG_SND_SOC_ES8328_I2C is not set -# CONFIG_SND_SOC_ES8328_SPI is not set -# CONFIG_SND_SOC_GTM601 is not set -# CONFIG_SND_SOC_HDA is not set -# CONFIG_SND_SOC_ICS43432 is not set -# CONFIG_SND_SOC_IDT821034 is not set -# CONFIG_SND_SOC_INNO_RK3036 is not set -# CONFIG_SND_SOC_MAX98088 is not set -# CONFIG_SND_SOC_MAX98090 is not set -# CONFIG_SND_SOC_MAX98357A is not set -# CONFIG_SND_SOC_MAX98504 is not set -# CONFIG_SND_SOC_MAX9867 is not set -# CONFIG_SND_SOC_MAX98927 is not set -# CONFIG_SND_SOC_MAX98520 is not set -# CONFIG_SND_SOC_MAX98373_I2C is not set -# CONFIG_SND_SOC_MAX98388 is not set -# CONFIG_SND_SOC_MAX98390 is not set -# CONFIG_SND_SOC_MAX98396 is not set -# CONFIG_SND_SOC_MAX9860 is not set -# CONFIG_SND_SOC_MSM8916_WCD_DIGITAL is not set -# CONFIG_SND_SOC_PCM1681 is not set -# CONFIG_SND_SOC_PCM1789_I2C is not set -# CONFIG_SND_SOC_PCM179X_I2C is not set -# CONFIG_SND_SOC_PCM179X_SPI is not set -# CONFIG_SND_SOC_PCM186X_I2C is not set -# CONFIG_SND_SOC_PCM186X_SPI is not set -# CONFIG_SND_SOC_PCM3060_I2C is not set -# CONFIG_SND_SOC_PCM3060_SPI is not set -# CONFIG_SND_SOC_PCM3168A_I2C is not set -# CONFIG_SND_SOC_PCM3168A_SPI is not set -# CONFIG_SND_SOC_PCM5102A is not set -# CONFIG_SND_SOC_PCM512x_I2C is not set -# CONFIG_SND_SOC_PCM512x_SPI is not set -# CONFIG_SND_SOC_PCM6240 is not set -# CONFIG_SND_SOC_PEB2466 is not set -# CONFIG_SND_SOC_RK3308 is not set -# CONFIG_SND_SOC_RK3328 is not set -# CONFIG_SND_SOC_RT5616 is not set -# CONFIG_SND_SOC_RT5631 is not set -# CONFIG_SND_SOC_RT5640 is not set -# CONFIG_SND_SOC_RT5659 is not set -# CONFIG_SND_SOC_RT9120 is not set -# CONFIG_SND_SOC_RTQ9128 is not set -CONFIG_SND_SOC_SGTL5000=m -# CONFIG_SND_SOC_SIMPLE_AMPLIFIER is not set -# CONFIG_SND_SOC_SIMPLE_MUX is not set -# CONFIG_SND_SOC_SMA1303 is not set -# CONFIG_SND_SOC_SPDIF is not set -# CONFIG_SND_SOC_SRC4XXX_I2C is not set -# CONFIG_SND_SOC_SSM2305 is not set -# CONFIG_SND_SOC_SSM2518 is not set -# CONFIG_SND_SOC_SSM2602_SPI is not set -# CONFIG_SND_SOC_SSM2602_I2C is not set -# CONFIG_SND_SOC_SSM3515 is not set -# CONFIG_SND_SOC_SSM4567 is not set -# CONFIG_SND_SOC_STA32X is not set -# CONFIG_SND_SOC_STA350 is not set -# CONFIG_SND_SOC_STI_SAS is not set -# CONFIG_SND_SOC_TAS2552 is not set -# CONFIG_SND_SOC_TAS2562 is not set -# CONFIG_SND_SOC_TAS2764 is not set -# CONFIG_SND_SOC_TAS2770 is not set -# CONFIG_SND_SOC_TAS2780 is not set -# CONFIG_SND_SOC_TAS2781_I2C is not set -# CONFIG_SND_SOC_TAS5086 is not set -# CONFIG_SND_SOC_TAS571X is not set -# CONFIG_SND_SOC_TAS5720 is not set -# CONFIG_SND_SOC_TAS5805M is not set -# CONFIG_SND_SOC_TAS6424 is not set -# CONFIG_SND_SOC_TDA7419 is not set -# CONFIG_SND_SOC_TFA9879 is not set -# CONFIG_SND_SOC_TFA989X is not set -# CONFIG_SND_SOC_TLV320ADC3XXX is not set -# CONFIG_SND_SOC_TLV320AIC23_I2C is not set -# CONFIG_SND_SOC_TLV320AIC23_SPI is not set -# CONFIG_SND_SOC_TLV320AIC31XX is not set -# CONFIG_SND_SOC_TLV320AIC32X4_I2C is not set -# CONFIG_SND_SOC_TLV320AIC32X4_SPI is not set -# CONFIG_SND_SOC_TLV320AIC3X_I2C is not set -# CONFIG_SND_SOC_TLV320AIC3X_SPI is not set -# CONFIG_SND_SOC_TLV320ADCX140 is not set -# CONFIG_SND_SOC_TS3A227E is not set -# CONFIG_SND_SOC_TSCS42XX is not set -# CONFIG_SND_SOC_TSCS454 is not set -# CONFIG_SND_SOC_UDA1334 is not set -# CONFIG_SND_SOC_WM8510 is not set -# CONFIG_SND_SOC_WM8523 is not set -# CONFIG_SND_SOC_WM8524 is not set -# CONFIG_SND_SOC_WM8580 is not set -# CONFIG_SND_SOC_WM8711 is not set -# CONFIG_SND_SOC_WM8728 is not set -# CONFIG_SND_SOC_WM8731_I2C is not set -# CONFIG_SND_SOC_WM8731_SPI is not set -# CONFIG_SND_SOC_WM8737 is not set -# CONFIG_SND_SOC_WM8741 is not set -# CONFIG_SND_SOC_WM8750 is not set -# CONFIG_SND_SOC_WM8753 is not set -# CONFIG_SND_SOC_WM8770 is not set -# CONFIG_SND_SOC_WM8776 is not set -# CONFIG_SND_SOC_WM8782 is not set -# CONFIG_SND_SOC_WM8804_I2C is not set -# CONFIG_SND_SOC_WM8804_SPI is not set -# CONFIG_SND_SOC_WM8903 is not set -# CONFIG_SND_SOC_WM8904 is not set -# CONFIG_SND_SOC_WM8940 is not set -# CONFIG_SND_SOC_WM8960 is not set -# CONFIG_SND_SOC_WM8961 is not set -# CONFIG_SND_SOC_WM8962 is not set -# CONFIG_SND_SOC_WM8974 is not set -# CONFIG_SND_SOC_WM8978 is not set -# CONFIG_SND_SOC_WM8985 is not set -# CONFIG_SND_SOC_ZL38060 is not set -# CONFIG_SND_SOC_MAX9759 is not set -# CONFIG_SND_SOC_MT6351 is not set -# CONFIG_SND_SOC_MT6357 is not set -# CONFIG_SND_SOC_MT6358 is not set -# CONFIG_SND_SOC_MT6660 is not set -# CONFIG_SND_SOC_NAU8315 is not set -# CONFIG_SND_SOC_NAU8325 is not set -# CONFIG_SND_SOC_NAU8540 is not set -# CONFIG_SND_SOC_NAU8810 is not set -# CONFIG_SND_SOC_NAU8821 is not set -# CONFIG_SND_SOC_NAU8822 is not set -# CONFIG_SND_SOC_NAU8824 is not set -# CONFIG_SND_SOC_TPA6130A2 is not set -# CONFIG_SND_SOC_LPASS_WSA_MACRO is not set -# CONFIG_SND_SOC_LPASS_VA_MACRO is not set -# CONFIG_SND_SOC_LPASS_RX_MACRO is not set -# CONFIG_SND_SOC_LPASS_TX_MACRO is not set -# end of CODEC drivers - -CONFIG_SND_SIMPLE_CARD_UTILS=m -CONFIG_SND_SIMPLE_CARD=m -# CONFIG_SND_AUDIO_GRAPH_CARD is not set -# CONFIG_SND_AUDIO_GRAPH_CARD2 is not set -# CONFIG_SND_TEST_COMPONENT is not set -# CONFIG_SND_XEN_FRONTEND is not set -# CONFIG_SND_VIRTIO is not set -CONFIG_AC97_BUS=m -CONFIG_HID_SUPPORT=y -CONFIG_HID=m -# CONFIG_HID_BATTERY_STRENGTH is not set -# CONFIG_HIDRAW is not set -# CONFIG_UHID is not set -CONFIG_HID_GENERIC=m - -# Special HID drivers -CONFIG_HID_A4TECH=m -# CONFIG_HID_ACCUTOUCH is not set -# CONFIG_HID_ACRUX is not set -CONFIG_HID_APPLE=m -# CONFIG_HID_APPLEIR is not set -# CONFIG_HID_ASUS is not set -# CONFIG_HID_AUREAL is not set -CONFIG_HID_BELKIN=m -# CONFIG_HID_BETOP_FF is not set -# CONFIG_HID_BIGBEN_FF is not set -CONFIG_HID_CHERRY=m -# CONFIG_HID_CHICONY is not set -# CONFIG_HID_CORSAIR is not set -# CONFIG_HID_COUGAR is not set -# CONFIG_HID_MACALLY is not set -# CONFIG_HID_PRODIKEYS is not set -# CONFIG_HID_CMEDIA is not set -# CONFIG_HID_CREATIVE_SB0540 is not set -# CONFIG_HID_CYPRESS is not set -# CONFIG_HID_DRAGONRISE is not set -# CONFIG_HID_EMS_FF is not set -# CONFIG_HID_ELAN is not set -# CONFIG_HID_ELECOM is not set -# CONFIG_HID_ELO is not set -# CONFIG_HID_EVISION is not set -CONFIG_HID_EZKEY=m -# CONFIG_HID_GEMBIRD is not set -# CONFIG_HID_GFRM is not set -# CONFIG_HID_GLORIOUS is not set -# CONFIG_HID_HOLTEK is not set -# CONFIG_HID_GOODIX_SPI is not set -# CONFIG_HID_GOOGLE_STADIA_FF is not set -# CONFIG_HID_VIVALDI is not set -# CONFIG_HID_GT683R is not set -# CONFIG_HID_KEYTOUCH is not set -# CONFIG_HID_KYE is not set -# CONFIG_HID_UCLOGIC is not set -# CONFIG_HID_WALTOP is not set -# CONFIG_HID_VIEWSONIC is not set -# CONFIG_HID_VRC2 is not set -# CONFIG_HID_XIAOMI is not set -# CONFIG_HID_GYRATION is not set -# CONFIG_HID_ICADE is not set -# CONFIG_HID_ITE is not set -# CONFIG_HID_JABRA is not set -# CONFIG_HID_TWINHAN is not set -# CONFIG_HID_KENSINGTON is not set -# CONFIG_HID_LCPOWER is not set -# CONFIG_HID_LED is not set -# CONFIG_HID_LENOVO is not set -# CONFIG_HID_LETSKETCH is not set -CONFIG_HID_LOGITECH=m -# CONFIG_HID_LOGITECH_HIDPP is not set -# CONFIG_LOGITECH_FF is not set -# CONFIG_LOGIRUMBLEPAD2_FF is not set -# CONFIG_LOGIG940_FF is not set -# CONFIG_LOGIWHEELS_FF is not set -# CONFIG_HID_MAGICMOUSE is not set -# CONFIG_HID_MALTRON is not set -# CONFIG_HID_MAYFLASH is not set -# CONFIG_HID_MEGAWORLD_FF is not set -# CONFIG_HID_REDRAGON is not set -CONFIG_HID_MICROSOFT=m -CONFIG_HID_MONTEREY=m -# CONFIG_HID_MULTITOUCH is not set -# CONFIG_HID_NINTENDO is not set -# CONFIG_HID_NTI is not set -# CONFIG_HID_NTRIG is not set -# CONFIG_HID_ORTEK is not set -# CONFIG_HID_PANTHERLORD is not set -# CONFIG_HID_PENMOUNT is not set -# CONFIG_HID_PETALYNX is not set -# CONFIG_HID_PICOLCD is not set -# CONFIG_HID_PLANTRONICS is not set -# CONFIG_HID_PXRC is not set -# CONFIG_HID_RAZER is not set -# CONFIG_HID_PRIMAX is not set -# CONFIG_HID_RETRODE is not set -# CONFIG_HID_ROCCAT is not set -# CONFIG_HID_SAITEK is not set -# CONFIG_HID_SAMSUNG is not set -# CONFIG_HID_SEMITEK is not set -# CONFIG_HID_SIGMAMICRO is not set -# CONFIG_HID_SONY is not set -# CONFIG_HID_SPEEDLINK is not set -# CONFIG_HID_STEAM is not set -# CONFIG_HID_STEELSERIES is not set -# CONFIG_HID_SUNPLUS is not set -# CONFIG_HID_RMI is not set -# CONFIG_HID_GREENASIA is not set -# CONFIG_HID_SMARTJOYPLUS is not set -# CONFIG_HID_TIVO is not set -# CONFIG_HID_TOPSEED is not set -# CONFIG_HID_TOPRE is not set -# CONFIG_HID_THINGM is not set -# CONFIG_HID_THRUSTMASTER is not set -# CONFIG_HID_UDRAW_PS3 is not set -# CONFIG_HID_U2FZERO is not set -# CONFIG_HID_WACOM is not set -# CONFIG_HID_WIIMOTE is not set -# CONFIG_HID_WINWING is not set -# CONFIG_HID_XINMO is not set -# CONFIG_HID_ZEROPLUS is not set -# CONFIG_HID_ZYDACRON is not set -# CONFIG_HID_SENSOR_HUB is not set -# CONFIG_HID_ALPS is not set -# CONFIG_HID_MCP2200 is not set -# CONFIG_HID_MCP2221 is not set -# end of Special HID drivers - -# HID-BPF support -# CONFIG_HID_BPF is not set -# end of HID-BPF support - -# USB HID support -CONFIG_USB_HID=m -# CONFIG_HID_PID is not set -# CONFIG_USB_HIDDEV is not set - -# USB HID Boot Protocol drivers -# CONFIG_USB_KBD is not set -# CONFIG_USB_MOUSE is not set -# end of USB HID Boot Protocol drivers -# end of USB HID support - -CONFIG_I2C_HID=m -# CONFIG_I2C_HID_ACPI is not set -# CONFIG_I2C_HID_OF is not set -# CONFIG_I2C_HID_OF_ELAN is not set -# CONFIG_I2C_HID_OF_GOODIX is not set -CONFIG_USB_OHCI_LITTLE_ENDIAN=y -CONFIG_USB_SUPPORT=y -CONFIG_USB_COMMON=m -# CONFIG_USB_LED_TRIG is not set -# CONFIG_USB_ULPI_BUS is not set -# CONFIG_USB_CONN_GPIO is not set -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB=m -CONFIG_USB_PCI=y -# CONFIG_USB_PCI_AMD is not set -CONFIG_USB_ANNOUNCE_NEW_DEVICES=y - -## Miscellaneous USB options -CONFIG_USB_DEFAULT_PERSIST=y -# CONFIG_USB_FEW_INIT_RETRIES is not set -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_OTG is not set -# CONFIG_USB_OTG_PRODUCTLIST is not set -# CONFIG_USB_OTG_DISABLE_EXTERNAL_HUB is not set -# CONFIG_USB_LEDS_TRIGGER_USBPORT is not set -CONFIG_USB_AUTOSUSPEND_DELAY=2 -CONFIG_USB_DEFAULT_AUTHORIZATION_MODE=1 -# CONFIG_USB_MON is not set - -## USB Host Controller Drivers -# CONFIG_USB_C67X00_HCD is not set -CONFIG_USB_XHCI_HCD=m -# CONFIG_USB_XHCI_DBGCAP is not set -CONFIG_USB_XHCI_PCI=m -# CONFIG_USB_XHCI_PCI_RENESAS is not set -CONFIG_USB_XHCI_PLATFORM=m -# CONFIG_USB_XHCI_HISTB is not set -# CONFIG_USB_XHCI_MTK is not set -# CONFIG_USB_XHCI_MVEBU is not set -CONFIG_USB_EHCI_HCD=m -# CONFIG_USB_EHCI_ROOT_HUB_TT is not set -CONFIG_USB_EHCI_TT_NEWSCHED=y -CONFIG_USB_EHCI_PCI=m -# CONFIG_USB_EHCI_FSL is not set -# CONFIG_USB_EHCI_HCD_ORION is not set -# CONFIG_USB_EHCI_TEGRA is not set -# CONFIG_USB_EHCI_EXYNOS is not set -CONFIG_USB_EHCI_HCD_PLATFORM=m -# CONFIG_USB_OXU210HP_HCD is not set -# CONFIG_USB_ISP116X_HCD is not set -# CONFIG_USB_MAX3421_HCD is not set -CONFIG_USB_OHCI_HCD=m -CONFIG_USB_OHCI_HCD_PCI=m -CONFIG_USB_OHCI_HCD_SSB=y -# CONFIG_USB_OHCI_EXYNOS is not set -CONFIG_USB_OHCI_HCD_PLATFORM=m -CONFIG_USB_UHCI_HCD=m -# CONFIG_USB_SL811_HCD is not set -# CONFIG_USB_R8A66597_HCD is not set -# CONFIG_USB_HCD_BCMA is not set -CONFIG_USB_HCD_SSB=m -# CONFIG_USB_HCD_TEST_MODE is not set -# CONFIG_USB_XEN_HCD is not set - -## USB Device Class drivers -# CONFIG_USB_ACM is not set -# CONFIG_USB_PRINTER is not set -# CONFIG_USB_WDM is not set -# CONFIG_USB_TMC is not set - -## NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may - -## also be needed; see USB_STORAGE Help for more info -CONFIG_USB_STORAGE=m -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_STORAGE_REALTEK is not set -# CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set -# CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_USBAT is not set -# CONFIG_USB_STORAGE_SDDR09 is not set -# CONFIG_USB_STORAGE_SDDR55 is not set -# CONFIG_USB_STORAGE_JUMPSHOT is not set -# CONFIG_USB_STORAGE_ALAUDA is not set -# CONFIG_USB_STORAGE_ONETOUCH is not set -# CONFIG_USB_STORAGE_KARMA is not set -# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set -# CONFIG_USB_STORAGE_ENE_UB6250 is not set -CONFIG_USB_UAS=m - -## USB Imaging devices -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set -# CONFIG_USBIP_CORE is not set - -## USB dual-mode controller drivers -# CONFIG_USB_CDNS_SUPPORT is not set -# CONFIG_USB_MTU3 is not set -# CONFIG_USB_MUSB_HDRC is not set -CONFIG_USB_DWC3=m -CONFIG_USB_DWC3_HOST=y -# CONFIG_USB_DWC3_GADGET is not set -# CONFIG_USB_DWC3_DUAL_ROLE is not set - -## Platform Glue Driver Support -CONFIG_USB_DWC3_EXYNOS=m -CONFIG_USB_DWC3_PCI=m -CONFIG_USB_DWC3_HAPS=m -CONFIG_USB_DWC3_MESON_G12A=m -CONFIG_USB_DWC3_OF_SIMPLE=m -CONFIG_USB_DWC3_QCOM=m -CONFIG_USB_DWC3_XILINX=m -CONFIG_USB_DWC2=m -# CONFIG_USB_DWC2_HOST is not set - -## Gadget/Dual-role mode requires USB Gadget support to be enabled -# CONFIG_USB_DWC2_PERIPHERAL is not set -CONFIG_USB_DWC2_DUAL_ROLE=y -# CONFIG_USB_DWC2_PCI is not set -# CONFIG_USB_DWC2_DEBUG is not set -# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set -# CONFIG_USB_CHIPIDEA is not set -# CONFIG_USB_ISP1760 is not set - -## USB port drivers -CONFIG_USB_SERIAL=m -CONFIG_USB_SERIAL_GENERIC=y -# CONFIG_USB_SERIAL_SIMPLE is not set -# CONFIG_USB_SERIAL_AIRCABLE is not set -# CONFIG_USB_SERIAL_ARK3116 is not set -# CONFIG_USB_SERIAL_BELKIN is not set -# CONFIG_USB_SERIAL_CH341 is not set -# CONFIG_USB_SERIAL_WHITEHEAT is not set -# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set -CONFIG_USB_SERIAL_CP210X=m -# CONFIG_USB_SERIAL_CYPRESS_M8 is not set -# CONFIG_USB_SERIAL_EMPEG is not set -CONFIG_USB_SERIAL_FTDI_SIO=m -# CONFIG_USB_SERIAL_VISOR is not set -# CONFIG_USB_SERIAL_IPAQ is not set -# CONFIG_USB_SERIAL_IR is not set -# CONFIG_USB_SERIAL_EDGEPORT is not set -# CONFIG_USB_SERIAL_EDGEPORT_TI is not set -# CONFIG_USB_SERIAL_F81232 is not set -# CONFIG_USB_SERIAL_F8153X is not set -# CONFIG_USB_SERIAL_GARMIN is not set -# CONFIG_USB_SERIAL_IPW is not set -# CONFIG_USB_SERIAL_IUU is not set -# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set -# CONFIG_USB_SERIAL_KEYSPAN is not set -# CONFIG_USB_SERIAL_KLSI is not set -# CONFIG_USB_SERIAL_KOBIL_SCT is not set -# CONFIG_USB_SERIAL_MCT_U232 is not set -# CONFIG_USB_SERIAL_METRO is not set -# CONFIG_USB_SERIAL_MOS7720 is not set -# CONFIG_USB_SERIAL_MOS7840 is not set -# CONFIG_USB_SERIAL_MXUPORT is not set -# CONFIG_USB_SERIAL_NAVMAN is not set -CONFIG_USB_SERIAL_PL2303=m -# CONFIG_USB_SERIAL_OTI6858 is not set -# CONFIG_USB_SERIAL_QCAUX is not set -# CONFIG_USB_SERIAL_QUALCOMM is not set -# CONFIG_USB_SERIAL_SPCP8X5 is not set -# CONFIG_USB_SERIAL_SAFE is not set -# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set -# CONFIG_USB_SERIAL_SYMBOL is not set -# CONFIG_USB_SERIAL_TI is not set -# CONFIG_USB_SERIAL_CYBERJACK is not set -# CONFIG_USB_SERIAL_OPTION is not set -# CONFIG_USB_SERIAL_OMNINET is not set -# CONFIG_USB_SERIAL_OPTICON is not set -# CONFIG_USB_SERIAL_XSENS_MT is not set -# CONFIG_USB_SERIAL_WISHBONE is not set -# CONFIG_USB_SERIAL_SSU100 is not set -# CONFIG_USB_SERIAL_QT2 is not set -# CONFIG_USB_SERIAL_UPD78F0730 is not set -# CONFIG_USB_SERIAL_XR is not set -# CONFIG_USB_SERIAL_DEBUG is not set - -## USB Miscellaneous drivers -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_ADUTUX is not set -# CONFIG_USB_SEVSEG is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_CYPRESS_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_APPLEDISPLAY is not set -# CONFIG_USB_QCOM_EUD is not set -# CONFIG_APPLE_MFI_FASTCHARGE is not set -# CONFIG_USB_LJCA is not set -# CONFIG_USB_SISUSBVGA is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_TRANCEVIBRATOR is not set -# CONFIG_USB_IOWARRIOR is not set -# CONFIG_USB_TEST is not set -# CONFIG_USB_EHSET_TEST_FIXTURE is not set -# CONFIG_USB_ISIGHTFW is not set -# CONFIG_USB_YUREX is not set -# CONFIG_USB_EZUSB_FX2 is not set -# CONFIG_USB_HUB_USB251XB is not set -# CONFIG_USB_HSIC_USB3503 is not set -# CONFIG_USB_HSIC_USB4604 is not set -# CONFIG_USB_LINK_LAYER_TEST is not set -# CONFIG_USB_CHAOSKEY is not set -# CONFIG_USB_ONBOARD_DEV is not set - -# USB Physical Layer drivers -# CONFIG_NOP_USB_XCEIV is not set -# CONFIG_USB_GPIO_VBUS is not set -# CONFIG_USB_ISP1301 is not set -# CONFIG_USB_TEGRA_PHY is not set -# CONFIG_USB_ULPI is not set -# end of USB Physical Layer drivers - -CONFIG_USB_GADGET=m -# CONFIG_USB_GADGET_DEBUG is not set -# CONFIG_USB_GADGET_DEBUG_FILES is not set -# CONFIG_USB_GADGET_DEBUG_FS is not set -CONFIG_USB_GADGET_VBUS_DRAW=2 -CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 - -# USB Peripheral Controller -# CONFIG_USB_GR_UDC is not set -# CONFIG_USB_R8A66597 is not set -# CONFIG_USB_PXA27X is not set -# CONFIG_USB_MV_UDC is not set -# CONFIG_USB_MV_U3D is not set -# CONFIG_USB_SNP_UDC_PLAT is not set -# CONFIG_USB_M66592 is not set -# CONFIG_USB_BDC_UDC is not set -# CONFIG_USB_AMD5536UDC is not set -# CONFIG_USB_NET2272 is not set -# CONFIG_USB_NET2280 is not set -# CONFIG_USB_GOKU is not set -# CONFIG_USB_EG20T is not set -# CONFIG_USB_GADGET_XILINX is not set -# CONFIG_USB_MAX3420_UDC is not set -# CONFIG_USB_CDNS2_UDC is not set -# CONFIG_USB_DUMMY_HCD is not set -# end of USB Peripheral Controller - -# CONFIG_USB_CONFIGFS is not set - -# USB Gadget precomposed configurations -# CONFIG_USB_ZERO is not set -# CONFIG_USB_AUDIO is not set -# CONFIG_USB_ETH is not set -# CONFIG_USB_G_NCM is not set -# CONFIG_USB_GADGETFS is not set -# CONFIG_USB_FUNCTIONFS is not set -# CONFIG_USB_MASS_STORAGE is not set -# CONFIG_USB_G_SERIAL is not set -# CONFIG_USB_MIDI_GADGET is not set -# CONFIG_USB_G_PRINTER is not set -# CONFIG_USB_CDC_COMPOSITE is not set -# CONFIG_USB_G_ACM_MS is not set -# CONFIG_USB_G_MULTI is not set -# CONFIG_USB_G_HID is not set -# CONFIG_USB_G_DBGP is not set -# CONFIG_USB_G_WEBCAM is not set -# CONFIG_USB_RAW_GADGET is not set -# end of USB Gadget precomposed configurations - -CONFIG_TYPEC=m -# CONFIG_TYPEC_TCPM is not set -# CONFIG_TYPEC_UCSI is not set -# CONFIG_TYPEC_TPS6598X is not set -# CONFIG_TYPEC_ANX7411 is not set -# CONFIG_TYPEC_RT1719 is not set -# CONFIG_TYPEC_HD3SS3220 is not set -# CONFIG_TYPEC_STUSB160X is not set -# CONFIG_TYPEC_WUSB3801 is not set - -# USB Type-C Multiplexer/DeMultiplexer Switch support -# CONFIG_TYPEC_MUX_FSA4480 is not set -# CONFIG_TYPEC_MUX_GPIO_SBU is not set -# CONFIG_TYPEC_MUX_PI3USB30532 is not set -# CONFIG_TYPEC_MUX_IT5205 is not set -# CONFIG_TYPEC_MUX_NB7VPQ904M is not set -# CONFIG_TYPEC_MUX_PTN36502 is not set -# CONFIG_TYPEC_MUX_WCD939X_USBSS is not set -# end of USB Type-C Multiplexer/DeMultiplexer Switch support - -# USB Type-C Alternate Mode drivers -# CONFIG_TYPEC_DP_ALTMODE is not set -# end of USB Type-C Alternate Mode drivers - -CONFIG_USB_ROLE_SWITCH=m -CONFIG_MMC=m -CONFIG_PWRSEQ_EMMC=m -CONFIG_PWRSEQ_SIMPLE=m -CONFIG_MMC_BLOCK=m -CONFIG_MMC_BLOCK_MINORS=16 -# CONFIG_SDIO_UART is not set -# CONFIG_MMC_TEST is not set - -## MMC/SD/SDIO Host Controller Drivers -# CONFIG_MMC_DEBUG is not set -CONFIG_MMC_ARMMMCI=m -CONFIG_MMC_QCOM_DML=y -CONFIG_MMC_STM32_SDMMC=y -CONFIG_MMC_SDHCI=m -CONFIG_MMC_SDHCI_IO_ACCESSORS=y -CONFIG_MMC_SDHCI_PCI=m -CONFIG_MMC_RICOH_MMC=y -CONFIG_MMC_SDHCI_ACPI=m -CONFIG_MMC_SDHCI_PLTFM=m -# CONFIG_MMC_SDHCI_OF_ARASAN is not set -# CONFIG_MMC_SDHCI_OF_AT91 is not set -# CONFIG_MMC_SDHCI_OF_DWCMSHC is not set -# CONFIG_MMC_SDHCI_CADENCE is not set -# CONFIG_MMC_SDHCI_TEGRA is not set -# CONFIG_MMC_SDHCI_S3C is not set -# CONFIG_MMC_SDHCI_PXAV3 is not set -# CONFIG_MMC_SDHCI_F_SDH30 is not set -# CONFIG_MMC_SDHCI_MILBEAUT is not set -CONFIG_MMC_SDHCI_IPROC=m -# CONFIG_MMC_MESON_GX is not set -# CONFIG_MMC_MESON_MX_SDIO is not set -CONFIG_MMC_SDHCI_MSM=m -# CONFIG_MMC_TIFM_SD is not set -CONFIG_MMC_SPI=m -# CONFIG_MMC_SDHCI_SPRD is not set -# CONFIG_MMC_CB710 is not set -# CONFIG_MMC_VIA_SDMMC is not set -# CONFIG_MMC_DW is not set -# CONFIG_MMC_VUB300 is not set -# CONFIG_MMC_USHC is not set -# CONFIG_MMC_USDHI6ROL0 is not set -# CONFIG_MMC_SUNXI is not set -CONFIG_MMC_CQHCI=m -# CONFIG_MMC_HSQ is not set -# CONFIG_MMC_TOSHIBA_PCI is not set -CONFIG_MMC_BCM2835=m -# CONFIG_MMC_MTK is not set -CONFIG_MMC_SDHCI_BRCMSTB=m -# CONFIG_MMC_SDHCI_XENON is not set -CONFIG_SCSI_UFSHCD=m -# CONFIG_SCSI_UFS_BSG is not set -# CONFIG_SCSI_UFS_HWMON is not set -CONFIG_SCSI_UFSHCD_PCI=m -# CONFIG_SCSI_UFS_DWC_TC_PCI is not set -CONFIG_SCSI_UFSHCD_PLATFORM=m -# CONFIG_SCSI_UFS_CDNS_PLATFORM is not set -# CONFIG_SCSI_UFS_DWC_TC_PLATFORM is not set -# CONFIG_SCSI_UFS_QCOM is not set -# CONFIG_SCSI_UFS_MEDIATEK is not set -# CONFIG_SCSI_UFS_HISI is not set -# CONFIG_SCSI_UFS_EXYNOS is not set -# CONFIG_SCSI_UFS_SPRD is not set -# CONFIG_MEMSTICK is not set -CONFIG_NEW_LEDS=y -CONFIG_LEDS_CLASS=m -# CONFIG_LEDS_CLASS_FLASH is not set -# CONFIG_LEDS_CLASS_MULTICOLOR is not set -# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set - -## LED drivers -# CONFIG_LEDS_AN30259A is not set -# CONFIG_LEDS_AW200XX is not set -# CONFIG_LEDS_AW2013 is not set -# CONFIG_LEDS_BCM6328 is not set -# CONFIG_LEDS_BCM6358 is not set -# CONFIG_LEDS_CR0014114 is not set -# CONFIG_LEDS_EL15203000 is not set -# CONFIG_LEDS_LM3530 is not set -# CONFIG_LEDS_LM3532 is not set -# CONFIG_LEDS_LM3642 is not set -# CONFIG_LEDS_LM3692X is not set -# CONFIG_LEDS_PCA9532 is not set -CONFIG_LEDS_GPIO=m -# CONFIG_LEDS_LP3944 is not set -# CONFIG_LEDS_LP3952 is not set -# CONFIG_LEDS_LP8860 is not set -# CONFIG_LEDS_PCA955X is not set -# CONFIG_LEDS_PCA963X is not set -# CONFIG_LEDS_PCA995X is not set -# CONFIG_LEDS_DAC124S085 is not set -# CONFIG_LEDS_PWM is not set -# CONFIG_LEDS_REGULATOR is not set -# CONFIG_LEDS_BD2606MVV is not set -# CONFIG_LEDS_BD2802 is not set -# CONFIG_LEDS_LT3593 is not set -# CONFIG_LEDS_TCA6507 is not set -# CONFIG_LEDS_TLC591XX is not set -# CONFIG_LEDS_LM355x is not set -# CONFIG_LEDS_IS31FL319X is not set -# CONFIG_LEDS_IS31FL32XX is not set - -## LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM) -# CONFIG_LEDS_BLINKM is not set -# CONFIG_LEDS_MLXREG is not set -# CONFIG_LEDS_USER is not set -# CONFIG_LEDS_SPI_BYTE is not set -# CONFIG_LEDS_LM3697 is not set - -## Flash and Torch LED drivers - -## RGB LED drivers - -## LED Triggers -CONFIG_LEDS_TRIGGERS=y -# CONFIG_LEDS_TRIGGER_TIMER is not set -# CONFIG_LEDS_TRIGGER_ONESHOT is not set -# CONFIG_LEDS_TRIGGER_DISK is not set -# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set -# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set -# CONFIG_LEDS_TRIGGER_CPU is not set -# CONFIG_LEDS_TRIGGER_ACTIVITY is not set -# CONFIG_LEDS_TRIGGER_GPIO is not set -# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set - -## iptables trigger is under Netfilter config (LED target) -# CONFIG_LEDS_TRIGGER_TRANSIENT is not set -# CONFIG_LEDS_TRIGGER_CAMERA is not set -# CONFIG_LEDS_TRIGGER_PANIC is not set -# CONFIG_LEDS_TRIGGER_NETDEV is not set -# CONFIG_LEDS_TRIGGER_PATTERN is not set -# CONFIG_LEDS_TRIGGER_TTY is not set -# CONFIG_LEDS_TRIGGER_INPUT_EVENTS is not set - -## Simple LED drivers -# CONFIG_ACCESSIBILITY is not set -CONFIG_INFINIBAND=m -CONFIG_INFINIBAND_USER_MAD=m -CONFIG_INFINIBAND_USER_ACCESS=m -CONFIG_INFINIBAND_USER_MEM=y -CONFIG_INFINIBAND_ON_DEMAND_PAGING=y -CONFIG_INFINIBAND_ADDR_TRANS=y -CONFIG_INFINIBAND_ADDR_TRANS_CONFIGFS=y -CONFIG_INFINIBAND_VIRT_DMA=y -# CONFIG_INFINIBAND_CXGB4 is not set -# CONFIG_INFINIBAND_EFA is not set -# CONFIG_INFINIBAND_ERDMA is not set -# CONFIG_MLX4_INFINIBAND is not set -# CONFIG_INFINIBAND_MTHCA is not set -# CONFIG_INFINIBAND_OCRDMA is not set -CONFIG_INFINIBAND_VMWARE_PVRDMA=m -# CONFIG_RDMA_RXE is not set -# CONFIG_RDMA_SIW is not set -# CONFIG_INFINIBAND_IPOIB is not set -# CONFIG_INFINIBAND_SRP is not set -# CONFIG_INFINIBAND_ISER is not set -# CONFIG_INFINIBAND_RTRS_CLIENT is not set -# CONFIG_INFINIBAND_RTRS_SERVER is not set -CONFIG_EDAC_SUPPORT=y -CONFIG_EDAC=y -# CONFIG_EDAC_LEGACY_SYSFS is not set -# CONFIG_EDAC_DEBUG is not set -CONFIG_EDAC_THUNDERX=m -CONFIG_EDAC_SYNOPSYS=m -CONFIG_EDAC_XGENE=m -CONFIG_EDAC_DMC520=m -# CONFIG_EDAC_ZYNQMP is not set -# CONFIG_EDAC_VERSAL is not set -CONFIG_RTC_LIB=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_HCTOSYS=y -CONFIG_RTC_HCTOSYS_DEVICE="rtc0" -CONFIG_RTC_SYSTOHC=y -CONFIG_RTC_SYSTOHC_DEVICE="rtc0" -# CONFIG_RTC_DEBUG is not set -# CONFIG_RTC_NVMEM is not set - -## RTC interfaces -CONFIG_RTC_INTF_SYSFS=y -CONFIG_RTC_INTF_PROC=y -CONFIG_RTC_INTF_DEV=y -# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set -# CONFIG_RTC_DRV_TEST is not set - -## I2C RTC drivers -# CONFIG_RTC_DRV_ABB5ZES3 is not set -# CONFIG_RTC_DRV_ABEOZ9 is not set -# CONFIG_RTC_DRV_ABX80X is not set -# CONFIG_RTC_DRV_DS1307 is not set -# CONFIG_RTC_DRV_DS1374 is not set -# CONFIG_RTC_DRV_DS1672 is not set -# CONFIG_RTC_DRV_HYM8563 is not set -# CONFIG_RTC_DRV_MAX6900 is not set -# CONFIG_RTC_DRV_MAX31335 is not set -# CONFIG_RTC_DRV_NCT3018Y is not set -# CONFIG_RTC_DRV_RS5C372 is not set -# CONFIG_RTC_DRV_ISL1208 is not set -# CONFIG_RTC_DRV_ISL12022 is not set -# CONFIG_RTC_DRV_ISL12026 is not set -# CONFIG_RTC_DRV_X1205 is not set -# CONFIG_RTC_DRV_PCF8523 is not set -# CONFIG_RTC_DRV_PCF85063 is not set -# CONFIG_RTC_DRV_PCF85363 is not set -# CONFIG_RTC_DRV_PCF8563 is not set -# CONFIG_RTC_DRV_PCF8583 is not set -# CONFIG_RTC_DRV_M41T80 is not set -# CONFIG_RTC_DRV_BQ32K is not set -# CONFIG_RTC_DRV_S35390A is not set -# CONFIG_RTC_DRV_FM3130 is not set -# CONFIG_RTC_DRV_RX8010 is not set -# CONFIG_RTC_DRV_RX8111 is not set -# CONFIG_RTC_DRV_RX8581 is not set -# CONFIG_RTC_DRV_RX8025 is not set -# CONFIG_RTC_DRV_EM3027 is not set -# CONFIG_RTC_DRV_RV3028 is not set -# CONFIG_RTC_DRV_RV3032 is not set -# CONFIG_RTC_DRV_RV8803 is not set -# CONFIG_RTC_DRV_SD2405AL is not set -# CONFIG_RTC_DRV_SD3078 is not set - -## SPI RTC drivers -# CONFIG_RTC_DRV_M41T93 is not set -# CONFIG_RTC_DRV_M41T94 is not set -# CONFIG_RTC_DRV_DS1302 is not set -# CONFIG_RTC_DRV_DS1305 is not set -# CONFIG_RTC_DRV_DS1343 is not set -# CONFIG_RTC_DRV_DS1347 is not set -# CONFIG_RTC_DRV_DS1390 is not set -# CONFIG_RTC_DRV_MAX6916 is not set -# CONFIG_RTC_DRV_R9701 is not set -# CONFIG_RTC_DRV_RX4581 is not set -# CONFIG_RTC_DRV_RS5C348 is not set -# CONFIG_RTC_DRV_MAX6902 is not set -# CONFIG_RTC_DRV_PCF2123 is not set -# CONFIG_RTC_DRV_MCP795 is not set -CONFIG_RTC_I2C_AND_SPI=y - -## SPI and I2C RTC drivers -# CONFIG_RTC_DRV_DS3232 is not set -# CONFIG_RTC_DRV_PCF2127 is not set -# CONFIG_RTC_DRV_RV3029C2 is not set -# CONFIG_RTC_DRV_RX6110 is not set - -## Platform RTC drivers -# CONFIG_RTC_DRV_DS1286 is not set -# CONFIG_RTC_DRV_DS1511 is not set -# CONFIG_RTC_DRV_DS1553 is not set -# CONFIG_RTC_DRV_DS1685_FAMILY is not set -# CONFIG_RTC_DRV_DS1742 is not set -# CONFIG_RTC_DRV_DS2404 is not set -CONFIG_RTC_DRV_EFI=m -# CONFIG_RTC_DRV_STK17TA8 is not set -# CONFIG_RTC_DRV_M48T86 is not set -# CONFIG_RTC_DRV_M48T35 is not set -# CONFIG_RTC_DRV_M48T59 is not set -# CONFIG_RTC_DRV_MSM6242 is not set -# CONFIG_RTC_DRV_RP5C01 is not set -# CONFIG_RTC_DRV_ZYNQMP is not set - -## on-CPU RTC drivers -CONFIG_RTC_DRV_MESON_VRTC=m -# CONFIG_RTC_DRV_S3C is not set -CONFIG_RTC_DRV_PL030=m -CONFIG_RTC_DRV_PL031=m -# CONFIG_RTC_DRV_SUN6I is not set -# CONFIG_RTC_DRV_MV is not set -# CONFIG_RTC_DRV_ARMADA38X is not set -# CONFIG_RTC_DRV_CADENCE is not set -# CONFIG_RTC_DRV_FTRTC010 is not set -# CONFIG_RTC_DRV_TEGRA is not set -# CONFIG_RTC_DRV_MT2712 is not set -CONFIG_RTC_DRV_MT7622=m -# CONFIG_RTC_DRV_XGENE is not set -# CONFIG_RTC_DRV_R7301 is not set - -## HID Sensor RTC drivers -# CONFIG_RTC_DRV_GOLDFISH is not set -CONFIG_DMADEVICES=y -# CONFIG_DMADEVICES_DEBUG is not set - -## DMA Devices -CONFIG_DMA_ENGINE=y -CONFIG_DMA_VIRTUAL_CHANNELS=m -CONFIG_DMA_ACPI=y -CONFIG_DMA_OF=y -# CONFIG_ALTERA_MSGDMA is not set -# CONFIG_AMBA_PL08X is not set -# CONFIG_AXI_DMAC is not set -# CONFIG_BCM_SBA_RAID is not set -CONFIG_DMA_BCM2835=m -# CONFIG_DMA_SUN6I is not set -# CONFIG_DW_AXI_DMAC is not set -CONFIG_FSL_EDMA=m -# CONFIG_FSL_QDMA is not set -# CONFIG_HISI_DMA is not set -# CONFIG_INTEL_IDMA64 is not set -# CONFIG_K3_DMA is not set -# CONFIG_MV_XOR is not set -# CONFIG_MV_XOR_V2 is not set -# CONFIG_PL330_DMA is not set -# CONFIG_PLX_DMA is not set -# CONFIG_SPRD_DMA is not set -# CONFIG_TEGRA186_GPC_DMA is not set -# CONFIG_TEGRA20_APB_DMA is not set -# CONFIG_TEGRA210_ADMA is not set -# CONFIG_XGENE_DMA is not set -# CONFIG_XILINX_DMA is not set -# CONFIG_XILINX_XDMA is not set -# CONFIG_XILINX_ZYNQMP_DMA is not set -# CONFIG_XILINX_ZYNQMP_DPDMA is not set -# CONFIG_AMD_QDMA is not set -# CONFIG_MTK_HSDMA is not set -# CONFIG_MTK_CQDMA is not set -CONFIG_QCOM_BAM_DMA=m -# CONFIG_QCOM_GPI_DMA is not set -# CONFIG_QCOM_HIDMA_MGMT is not set -# CONFIG_QCOM_HIDMA is not set -# CONFIG_DW_DMAC is not set -# CONFIG_DW_DMAC_PCI is not set -# CONFIG_DW_EDMA is not set -# CONFIG_SF_PDMA is not set - -## DMA Clients -# CONFIG_ASYNC_TX_DMA is not set -# CONFIG_DMATEST is not set - -# DMABUF options -CONFIG_SYNC_FILE=y -# CONFIG_SW_SYNC is not set -# CONFIG_UDMABUF is not set -# CONFIG_DMABUF_MOVE_NOTIFY is not set -# CONFIG_DMABUF_DEBUG is not set -# CONFIG_DMABUF_SELFTESTS is not set -# CONFIG_DMABUF_HEAPS is not set -# CONFIG_DMABUF_SYSFS_STATS is not set -# end of DMABUF options - -CONFIG_UIO=m -# CONFIG_UIO_CIF is not set -# CONFIG_UIO_PDRV_GENIRQ is not set -# CONFIG_UIO_DMEM_GENIRQ is not set -# CONFIG_UIO_AEC is not set -# CONFIG_UIO_SERCOS3 is not set -CONFIG_UIO_PCI_GENERIC=m -# CONFIG_UIO_NETX is not set -# CONFIG_UIO_MF624 is not set -CONFIG_VFIO=m -CONFIG_VFIO_GROUP=y -CONFIG_VFIO_CONTAINER=y -CONFIG_VFIO_IOMMU_TYPE1=m -CONFIG_VFIO_NOIOMMU=y -CONFIG_VFIO_VIRQFD=y -# CONFIG_VFIO_DEBUGFS is not set - -# VFIO support for PCI devices -CONFIG_VFIO_PCI_CORE=m -CONFIG_VFIO_PCI_MMAP=y -CONFIG_VFIO_PCI_INTX=y -CONFIG_VFIO_PCI=m -# CONFIG_NVGRACE_GPU_VFIO_PCI is not set -# end of VFIO support for PCI devices - -# VFIO support for platform devices -# CONFIG_VFIO_PLATFORM is not set -# CONFIG_VFIO_AMBA is not set -# end of VFIO support for platform devices - -CONFIG_IRQ_BYPASS_MANAGER=y -CONFIG_VIRT_DRIVERS=y -CONFIG_VMGENID=y -# CONFIG_NITRO_ENCLAVES is not set -# CONFIG_ARM_PKVM_GUEST is not set -CONFIG_VIRTIO_ANCHOR=y -CONFIG_VIRTIO=y -CONFIG_VIRTIO_PCI_LIB=y -CONFIG_VIRTIO_PCI_LIB_LEGACY=y -CONFIG_VIRTIO_MENU=y -CONFIG_VIRTIO_PCI=y -CONFIG_VIRTIO_PCI_LEGACY=y -# CONFIG_VIRTIO_PMEM is not set -CONFIG_VIRTIO_BALLOON=m -# CONFIG_VIRTIO_INPUT is not set -CONFIG_VIRTIO_MMIO=m -# CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES is not set -# CONFIG_VIRTIO_DEBUG is not set -# CONFIG_VDPA is not set -CONFIG_VHOST_IOTLB=m -CONFIG_VHOST_TASK=y -CONFIG_VHOST=m -CONFIG_VHOST_MENU=y -CONFIG_VHOST_NET=m -CONFIG_VHOST_VSOCK=m -# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set -CONFIG_VHOST_ENABLE_FORK_OWNER_CONTROL=y - -# Microsoft Hyper-V guest support -# CONFIG_HYPERV is not set -# end of Microsoft Hyper-V guest support - -# Xen driver support -CONFIG_XEN_BALLOON=y -CONFIG_XEN_SCRUB_PAGES_DEFAULT=y -CONFIG_XEN_DEV_EVTCHN=m -CONFIG_XEN_BACKEND=y -CONFIG_XENFS=m -CONFIG_XEN_COMPAT_XENFS=y -CONFIG_XEN_SYS_HYPERVISOR=y -CONFIG_XEN_XENBUS_FRONTEND=y -CONFIG_XEN_GNTDEV=m -CONFIG_XEN_GRANT_DEV_ALLOC=m -# CONFIG_XEN_GRANT_DMA_ALLOC is not set -CONFIG_SWIOTLB_XEN=y -CONFIG_XEN_PCI_STUB=y -CONFIG_XEN_PCIDEV_STUB=m -# CONFIG_XEN_PVCALLS_FRONTEND is not set -# CONFIG_XEN_PVCALLS_BACKEND is not set -CONFIG_XEN_PRIVCMD=m -CONFIG_XEN_EFI=y -CONFIG_XEN_AUTO_XLATE=y -# CONFIG_XEN_VIRTIO is not set -# end of Xen driver support - -# CONFIG_GREYBUS is not set -# CONFIG_COMEDI is not set -CONFIG_STAGING=y -# CONFIG_RTLLIB is not set -# CONFIG_RTL8723BS is not set -# CONFIG_RTS5208 is not set -# CONFIG_VT6655 is not set -# CONFIG_VT6656 is not set -# CONFIG_FB_SM750 is not set -# CONFIG_MFD_NVEC is not set -# CONFIG_STAGING_MEDIA is not set -# CONFIG_LTE_GDM724X is not set -# CONFIG_FB_TFT is not set -CONFIG_BCM_VIDEOCORE=m -CONFIG_BCM2835_VCHIQ=m -CONFIG_VCHIQ_CDEV=y -CONFIG_SND_BCM2835=m -CONFIG_VIDEO_BCM2835=m -CONFIG_BCM2835_VCHIQ_MMAL=m -# CONFIG_XIL_AXIS_FIFO is not set -# CONFIG_FIELDBUS_DEV is not set -# CONFIG_VME_BUS is not set -# CONFIG_GOLDFISH is not set -# CONFIG_CHROME_PLATFORMS is not set -# CONFIG_CZNIC_PLATFORMS is not set -# CONFIG_MELLANOX_PLATFORM is not set -# CONFIG_SURFACE_PLATFORMS is not set -CONFIG_ARM64_PLATFORM_DEVICES=y -# CONFIG_EC_ACER_ASPIRE1 is not set -# CONFIG_EC_LENOVO_YOGA_C630 is not set -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_COMMON_CLK=y - -# Clock driver for ARM Reference designs -# CONFIG_CLK_ICST is not set -CONFIG_CLK_SP810=y -CONFIG_CLK_VEXPRESS_OSC=y -# end of Clock driver for ARM Reference designs - -# CONFIG_LMK04832 is not set -# CONFIG_COMMON_CLK_MAX9485 is not set -# CONFIG_COMMON_CLK_SCMI is not set -# CONFIG_COMMON_CLK_SCPI is not set -# CONFIG_COMMON_CLK_SI5341 is not set -# CONFIG_COMMON_CLK_SI5351 is not set -# CONFIG_COMMON_CLK_SI514 is not set -# CONFIG_COMMON_CLK_SI544 is not set -# CONFIG_COMMON_CLK_SI570 is not set -# CONFIG_COMMON_CLK_CDCE706 is not set -# CONFIG_COMMON_CLK_CDCE925 is not set -# CONFIG_COMMON_CLK_CS2000_CP is not set -# CONFIG_COMMON_CLK_AXI_CLKGEN is not set -CONFIG_COMMON_CLK_XGENE=y -# CONFIG_COMMON_CLK_PWM is not set -# CONFIG_COMMON_CLK_RS9_PCIE is not set -# CONFIG_COMMON_CLK_SI521XX is not set -# CONFIG_COMMON_CLK_VC3 is not set -# CONFIG_COMMON_CLK_VC5 is not set -# CONFIG_COMMON_CLK_VC7 is not set -# CONFIG_COMMON_CLK_FIXED_MMIO is not set -CONFIG_CLK_BCM2711_DVP=y -CONFIG_CLK_BCM2835=y -CONFIG_COMMON_CLK_IPROC=y -CONFIG_CLK_BCM_NS2=y -# CONFIG_CLK_BCM_SR is not set -CONFIG_CLK_RASPBERRYPI=y -# CONFIG_COMMON_CLK_HI3516CV300 is not set -CONFIG_COMMON_CLK_HI3519=y -CONFIG_COMMON_CLK_HI3559A=y -# CONFIG_COMMON_CLK_HI3660 is not set -CONFIG_COMMON_CLK_HI3670=y -# CONFIG_COMMON_CLK_HI3798CV200 is not set -CONFIG_COMMON_CLK_HI6220=y -CONFIG_RESET_HISI=y -# CONFIG_STUB_CLK_HI6220 is not set - -# Clock driver for MediaTek SoC -CONFIG_COMMON_CLK_MEDIATEK=y -CONFIG_COMMON_CLK_MEDIATEK_FHCTL=y -# CONFIG_COMMON_CLK_MT2712 is not set -CONFIG_COMMON_CLK_MT6765=y -# CONFIG_COMMON_CLK_MT6765_AUDIOSYS is not set -# CONFIG_COMMON_CLK_MT6765_CAMSYS is not set -# CONFIG_COMMON_CLK_MT6765_GCESYS is not set -# CONFIG_COMMON_CLK_MT6765_MMSYS is not set -# CONFIG_COMMON_CLK_MT6765_IMGSYS is not set -# CONFIG_COMMON_CLK_MT6765_VCODECSYS is not set -# CONFIG_COMMON_CLK_MT6765_MFGSYS is not set -# CONFIG_COMMON_CLK_MT6765_MIPI0ASYS is not set -# CONFIG_COMMON_CLK_MT6765_MIPI0BSYS is not set -# CONFIG_COMMON_CLK_MT6765_MIPI1ASYS is not set -# CONFIG_COMMON_CLK_MT6765_MIPI1BSYS is not set -# CONFIG_COMMON_CLK_MT6765_MIPI2ASYS is not set -# CONFIG_COMMON_CLK_MT6765_MIPI2BSYS is not set -CONFIG_COMMON_CLK_MT6779=y -# CONFIG_COMMON_CLK_MT6779_MMSYS is not set -# CONFIG_COMMON_CLK_MT6779_IMGSYS is not set -# CONFIG_COMMON_CLK_MT6779_IPESYS is not set -# CONFIG_COMMON_CLK_MT6779_CAMSYS is not set -# CONFIG_COMMON_CLK_MT6779_VDECSYS is not set -# CONFIG_COMMON_CLK_MT6779_VENCSYS is not set -# CONFIG_COMMON_CLK_MT6779_MFGCFG is not set -# CONFIG_COMMON_CLK_MT6779_AUDSYS is not set -# CONFIG_COMMON_CLK_MT6795 is not set -# CONFIG_COMMON_CLK_MT6797 is not set -# CONFIG_COMMON_CLK_MT7622 is not set -# CONFIG_COMMON_CLK_MT7981 is not set -CONFIG_COMMON_CLK_MT7986=y -CONFIG_COMMON_CLK_MT7986_ETHSYS=y -# CONFIG_COMMON_CLK_MT7988 is not set -# CONFIG_COMMON_CLK_MT8167 is not set -# CONFIG_COMMON_CLK_MT8173 is not set -CONFIG_COMMON_CLK_MT8183=y -# CONFIG_COMMON_CLK_MT8183_AUDIOSYS is not set -# CONFIG_COMMON_CLK_MT8183_CAMSYS is not set -# CONFIG_COMMON_CLK_MT8183_IMGSYS is not set -# CONFIG_COMMON_CLK_MT8183_IPU_CORE0 is not set -# CONFIG_COMMON_CLK_MT8183_IPU_CORE1 is not set -# CONFIG_COMMON_CLK_MT8183_IPU_ADL is not set -# CONFIG_COMMON_CLK_MT8183_IPU_CONN is not set -# CONFIG_COMMON_CLK_MT8183_MFGCFG is not set -# CONFIG_COMMON_CLK_MT8183_MMSYS is not set -# CONFIG_COMMON_CLK_MT8183_VDECSYS is not set -# CONFIG_COMMON_CLK_MT8183_VENCSYS is not set -# CONFIG_COMMON_CLK_MT8186 is not set -# CONFIG_COMMON_CLK_MT8188 is not set -CONFIG_COMMON_CLK_MT8192=y -# CONFIG_COMMON_CLK_MT8192_AUDSYS is not set -# CONFIG_COMMON_CLK_MT8192_CAMSYS is not set -# CONFIG_COMMON_CLK_MT8192_IMGSYS is not set -# CONFIG_COMMON_CLK_MT8192_IMP_IIC_WRAP is not set -# CONFIG_COMMON_CLK_MT8192_IPESYS is not set -# CONFIG_COMMON_CLK_MT8192_MDPSYS is not set -# CONFIG_COMMON_CLK_MT8192_MFGCFG is not set -# CONFIG_COMMON_CLK_MT8192_MMSYS is not set -# CONFIG_COMMON_CLK_MT8192_MSDC is not set -# CONFIG_COMMON_CLK_MT8192_SCP_ADSP is not set -# CONFIG_COMMON_CLK_MT8192_VDECSYS is not set -# CONFIG_COMMON_CLK_MT8192_VENCSYS is not set -# CONFIG_COMMON_CLK_MT8195 is not set -# CONFIG_COMMON_CLK_MT8365 is not set -CONFIG_COMMON_CLK_MT8516=y -# CONFIG_COMMON_CLK_MT8516_AUDSYS is not set -# end of Clock driver for MediaTek SoC - -# Clock support for Amlogic platforms -CONFIG_COMMON_CLK_MESON_REGMAP=y -CONFIG_COMMON_CLK_MESON_DUALDIV=y -CONFIG_COMMON_CLK_MESON_MPLL=y -CONFIG_COMMON_CLK_MESON_PLL=y -CONFIG_COMMON_CLK_MESON_VID_PLL_DIV=y -CONFIG_COMMON_CLK_MESON_VCLK=y -CONFIG_COMMON_CLK_MESON_CLKC_UTILS=y -CONFIG_COMMON_CLK_MESON_AO_CLKC=y -CONFIG_COMMON_CLK_MESON_EE_CLKC=y -CONFIG_COMMON_CLK_MESON_CPU_DYNDIV=y -CONFIG_COMMON_CLK_GXBB=y -CONFIG_COMMON_CLK_AXG=y -# CONFIG_COMMON_CLK_AXG_AUDIO is not set -# CONFIG_COMMON_CLK_A1_PLL is not set -# CONFIG_COMMON_CLK_A1_PERIPHERALS is not set -# CONFIG_COMMON_CLK_C3_PLL is not set -# CONFIG_COMMON_CLK_C3_PERIPHERALS is not set -CONFIG_COMMON_CLK_G12A=y -# CONFIG_COMMON_CLK_S4_PLL is not set -# CONFIG_COMMON_CLK_S4_PERIPHERALS is not set -# end of Clock support for Amlogic platforms - -CONFIG_ARMADA_AP_CP_HELPER=y -CONFIG_ARMADA_37XX_CLK=y -CONFIG_ARMADA_AP806_SYSCON=y -CONFIG_ARMADA_CP110_SYSCON=y -# CONFIG_COMMON_CLK_QCOM is not set -# CONFIG_COMMON_CLK_ROCKCHIP is not set -CONFIG_COMMON_CLK_SAMSUNG=y -CONFIG_EXYNOS_ARM64_COMMON_CLK=y -CONFIG_EXYNOS_AUDSS_CLK_CON=y -CONFIG_EXYNOS_CLKOUT=y -# CONFIG_SPRD_COMMON_CLK is not set -CONFIG_SUNXI_CCU=y -# CONFIG_SUN50I_A64_CCU is not set -# CONFIG_SUN50I_A100_CCU is not set -# CONFIG_SUN50I_A100_R_CCU is not set -# CONFIG_SUN50I_H6_CCU is not set -CONFIG_SUN50I_H616_CCU=y -# CONFIG_SUN50I_H6_R_CCU is not set -CONFIG_SUN6I_RTC_CCU=y -# CONFIG_SUN8I_H3_CCU is not set -# CONFIG_SUN8I_DE2_CCU is not set -# CONFIG_SUN8I_R_CCU is not set -CONFIG_TEGRA_CLK_DFLL=y -# CONFIG_XILINX_VCU is not set -# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set -# CONFIG_HWSPINLOCK is not set - -# Clock Source drivers -CONFIG_TIMER_OF=y -CONFIG_TIMER_ACPI=y -CONFIG_TIMER_PROBE=y -CONFIG_CLKSRC_MMIO=y -CONFIG_DW_APB_TIMER=y -CONFIG_DW_APB_TIMER_OF=y -CONFIG_ROCKCHIP_TIMER=y -CONFIG_SUN4I_TIMER=y -CONFIG_TEGRA_TIMER=y -# CONFIG_TEGRA186_TIMER is not set -CONFIG_ARM_ARCH_TIMER=y -CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y -CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND=y -CONFIG_FSL_ERRATUM_A008585=y -# CONFIG_HISILICON_ERRATUM_161010101 is not set -CONFIG_ARM64_ERRATUM_858921=y -CONFIG_SUN50I_ERRATUM_UNKNOWN1=y -CONFIG_ARM_TIMER_SP804=y -CONFIG_CLKSRC_EXYNOS_MCT=y -CONFIG_MTK_TIMER=y -CONFIG_MTK_CPUX_TIMER=y -# CONFIG_SPRD_TIMER is not set -# end of Clock Source drivers - -CONFIG_MAILBOX=y -# CONFIG_ARM_MHU is not set -# CONFIG_ARM_MHU_V2 is not set -# CONFIG_ARM_MHU_V3 is not set -# CONFIG_PLATFORM_MHU is not set -# CONFIG_PL320_MBOX is not set -# CONFIG_ARMADA_37XX_RWTM_MBOX is not set -CONFIG_ROCKCHIP_MBOX=y -CONFIG_PCC=y -# CONFIG_ALTERA_MBOX is not set -CONFIG_BCM2835_MBOX=y -# CONFIG_HI3660_MBOX is not set -# CONFIG_HI6220_MBOX is not set -# CONFIG_MAILBOX_TEST is not set -# CONFIG_QCOM_APCS_IPC is not set -# CONFIG_TEGRA_HSP_MBOX is not set -CONFIG_XGENE_SLIMPRO_MBOX=m -CONFIG_BCM_PDC_MBOX=m -CONFIG_BCM_FLEXRM_MBOX=m -# CONFIG_MTK_ADSP_MBOX is not set -# CONFIG_MTK_CMDQ_MBOX is not set -# CONFIG_ZYNQMP_IPI_MBOX is not set -CONFIG_SUN6I_MSGBOX=m -# CONFIG_SPRD_MBOX is not set -# CONFIG_QCOM_CPUCP_MBOX is not set -# CONFIG_QCOM_IPCC is not set -CONFIG_IOMMU_IOVA=y -CONFIG_IOMMU_API=y -CONFIG_IOMMU_SUPPORT=y - -# Generic IOMMU Pagetable Support -CONFIG_IOMMU_IO_PGTABLE=y -CONFIG_IOMMU_IO_PGTABLE_LPAE=y -# CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set -# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set -# CONFIG_IOMMU_IO_PGTABLE_DART is not set -# end of Generic IOMMU Pagetable Support - -# CONFIG_IOMMU_DEBUGFS is not set -# CONFIG_IOMMU_DEFAULT_DMA_STRICT is not set -CONFIG_IOMMU_DEFAULT_DMA_LAZY=y -# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set -CONFIG_OF_IOMMU=y -CONFIG_IOMMU_DMA=y -# CONFIG_IOMMUFD is not set -# CONFIG_ROCKCHIP_IOMMU is not set -# CONFIG_SUN50I_IOMMU is not set -# CONFIG_EXYNOS_IOMMU is not set -CONFIG_ARM_SMMU=m -CONFIG_ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT=y -CONFIG_ARM_SMMU_QCOM=m -CONFIG_ARM_SMMU_V3=m -# CONFIG_ARM_SMMU_V3_SVA is not set -# CONFIG_TEGRA241_CMDQV is not set -# CONFIG_MTK_IOMMU is not set -# CONFIG_QCOM_IOMMU is not set -# CONFIG_VIRTIO_IOMMU is not set -# CONFIG_SPRD_IOMMU is not set - -# Remoteproc drivers -# CONFIG_REMOTEPROC is not set -# end of Remoteproc drivers - -# Rpmsg drivers -# CONFIG_RPMSG_QCOM_GLINK_RPM is not set -# CONFIG_RPMSG_VIRTIO is not set -# end of Rpmsg drivers - -# CONFIG_SOUNDWIRE is not set - -# SOC (System On Chip) specific Drivers - -# Amlogic SoC drivers -# CONFIG_MESON_CANVAS is not set -CONFIG_MESON_CLK_MEASURE=y -# CONFIG_MESON_GX_SOCINFO is not set -# end of Amlogic SoC drivers - -# Broadcom SoC drivers -# end of Broadcom SoC drivers - -# NXP/Freescale QorIQ SoC drivers -# CONFIG_QUICC_ENGINE is not set -# CONFIG_FSL_RCPM is not set -# end of NXP/Freescale QorIQ SoC drivers - -# fujitsu SoC drivers -# CONFIG_A64FX_DIAG is not set -# end of fujitsu SoC drivers - -# Hisilicon SoC drivers -# CONFIG_KUNPENG_HCCS is not set -# end of Hisilicon SoC drivers - -# i.MX SoC drivers -# end of i.MX SoC drivers - -# Enable LiteX SoC Builder specific drivers -# CONFIG_LITEX_SOC_CONTROLLER is not set -# end of Enable LiteX SoC Builder specific drivers - -# MediaTek SoC drivers -# CONFIG_MTK_CMDQ is not set -# CONFIG_MTK_DEVAPC is not set -CONFIG_MTK_INFRACFG=y -# CONFIG_MTK_PMIC_WRAP is not set -CONFIG_MTK_REGULATOR_COUPLER=y -CONFIG_MTK_MMSYS=y -# end of MediaTek SoC drivers - -# CONFIG_WPCM450_SOC is not set - -# Qualcomm SoC drivers -# CONFIG_QCOM_AOSS_QMP is not set -CONFIG_QCOM_COMMAND_DB=y -# CONFIG_QCOM_GENI_SE is not set -CONFIG_QCOM_GSBI=y -# CONFIG_QCOM_LLCC is not set -# CONFIG_QCOM_OCMEM is not set -# CONFIG_QCOM_RAMP_CTRL is not set -# CONFIG_QCOM_RMTFS_MEM is not set -# CONFIG_QCOM_RPM_MASTER_STATS is not set -# CONFIG_QCOM_RPMH is not set -# CONFIG_QCOM_SPM is not set -# CONFIG_QCOM_ICC_BWMON is not set -# end of Qualcomm SoC drivers - -CONFIG_ROCKCHIP_GRF=y -# CONFIG_ROCKCHIP_IODOMAIN is not set -CONFIG_SOC_SAMSUNG=y -CONFIG_EXYNOS_CHIPID=y -CONFIG_EXYNOS_USI=y -CONFIG_EXYNOS_PMU=y -CONFIG_SUNXI_MBUS=y -CONFIG_SUNXI_SRAM=y -CONFIG_ARCH_TEGRA_132_SOC=y -CONFIG_ARCH_TEGRA_210_SOC=y -# CONFIG_ARCH_TEGRA_186_SOC is not set -# CONFIG_ARCH_TEGRA_194_SOC is not set -# CONFIG_ARCH_TEGRA_234_SOC is not set -# CONFIG_ARCH_TEGRA_241_SOC is not set -CONFIG_SOC_TEGRA_FUSE=y -CONFIG_SOC_TEGRA_FLOWCTRL=y -CONFIG_SOC_TEGRA_PMC=y -# CONFIG_SOC_TI is not set - -# Xilinx SoC drivers -# end of Xilinx SoC drivers -# end of SOC (System On Chip) specific Drivers - -# PM Domains - -# Amlogic PM Domains -CONFIG_MESON_EE_PM_DOMAINS=y -CONFIG_MESON_SECURE_PM_DOMAINS=y -# end of Amlogic PM Domains - -CONFIG_ARM_SCMI_PERF_DOMAIN=y -CONFIG_ARM_SCMI_POWER_DOMAIN=m -CONFIG_ARM_SCPI_POWER_DOMAIN=m - -# Broadcom PM Domains -CONFIG_BCM2835_POWER=y -CONFIG_RASPBERRYPI_POWER=y -# end of Broadcom PM Domains - -# i.MX PM Domains -# end of i.MX PM Domains - -# MediaTek PM Domains -# CONFIG_MTK_SCPSYS is not set -CONFIG_MTK_SCPSYS_PM_DOMAINS=y -# end of MediaTek PM Domains - -# Qualcomm PM Domains -# CONFIG_QCOM_CPR is not set -# end of Qualcomm PM Domains - -CONFIG_ROCKCHIP_PM_DOMAINS=y -CONFIG_EXYNOS_PM_DOMAINS=y -# CONFIG_SUN20I_PPU is not set -# end of PM Domains - -CONFIG_PM_DEVFREQ=y - -## DEVFREQ Governors -CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=m -# CONFIG_DEVFREQ_GOV_PERFORMANCE is not set -# CONFIG_DEVFREQ_GOV_POWERSAVE is not set -# CONFIG_DEVFREQ_GOV_USERSPACE is not set -# CONFIG_DEVFREQ_GOV_PASSIVE is not set - -## DEVFREQ Drivers -# CONFIG_ARM_EXYNOS_BUS_DEVFREQ is not set -# CONFIG_ARM_TEGRA_DEVFREQ is not set -# CONFIG_ARM_RK3399_DMC_DEVFREQ is not set -# CONFIG_ARM_SUN8I_A33_MBUS_DEVFREQ is not set -# CONFIG_PM_DEVFREQ_EVENT is not set -# CONFIG_EXTCON is not set -# CONFIG_MEMORY is not set -# CONFIG_IIO is not set -# CONFIG_NTB is not set -CONFIG_PWM=y -# CONFIG_PWM_DEBUG is not set -# CONFIG_PWM_ATMEL_TCB is not set -# CONFIG_PWM_AXI_PWMGEN is not set -CONFIG_PWM_BCM_IPROC=m -CONFIG_PWM_BCM2835=m -# CONFIG_PWM_BERLIN is not set -# CONFIG_PWM_CLK is not set -# CONFIG_PWM_DWC is not set -# CONFIG_PWM_FSL_FTM is not set -# CONFIG_PWM_GPIO is not set -# CONFIG_PWM_HIBVT is not set -# CONFIG_PWM_MESON is not set -# CONFIG_PWM_MTK_DISP is not set -# CONFIG_PWM_MEDIATEK is not set -# CONFIG_PWM_PCA9685 is not set -# CONFIG_PWM_RASPBERRYPI_POE is not set -CONFIG_PWM_ROCKCHIP=m -# CONFIG_PWM_SAMSUNG is not set -# CONFIG_PWM_SPRD is not set -# CONFIG_PWM_SUN4I is not set -# CONFIG_PWM_TEGRA is not set -# CONFIG_PWM_XILINX is not set - -# IRQ chip support -CONFIG_IRQCHIP=y -CONFIG_ARM_GIC=y -CONFIG_ARM_GIC_PM=y -CONFIG_ARM_GIC_MAX_NR=1 -CONFIG_ARM_GIC_V2M=y -CONFIG_ARM_GIC_V3=y -CONFIG_ARM_GIC_V3_ITS=y -CONFIG_IRQ_MSI_LIB=y -# CONFIG_AL_FIC is not set -CONFIG_BRCMSTB_L2_IRQ=y -CONFIG_DW_APB_ICTL=y -CONFIG_HISILICON_IRQ_MBIGEN=y -CONFIG_SUN6I_R_INTC=y -CONFIG_SUNXI_NMI_INTC=y -# CONFIG_XILINX_INTC is not set -CONFIG_MVEBU_GICP=y -CONFIG_MVEBU_ICU=y -CONFIG_MVEBU_ODMI=y -CONFIG_MVEBU_PIC=y -CONFIG_MVEBU_SEI=y -CONFIG_PARTITION_PERCPU=y -# CONFIG_QCOM_IRQ_COMBINER is not set -CONFIG_MESON_IRQ_GPIO=y -# CONFIG_QCOM_PDC is not set -# CONFIG_QCOM_MPM is not set -# CONFIG_MST_IRQ is not set -# end of IRQ chip support - -# CONFIG_IPACK_BUS is not set -CONFIG_ARCH_HAS_RESET_CONTROLLER=y -CONFIG_RESET_CONTROLLER=y -CONFIG_RESET_BERLIN=y -CONFIG_RESET_BRCMSTB=y -CONFIG_RESET_BRCMSTB_RESCAL=y -# CONFIG_RESET_GPIO is not set -CONFIG_RESET_MESON=y -# CONFIG_RESET_MESON_AUDIO_ARB is not set -# CONFIG_RESET_QCOM_AOSS is not set -# CONFIG_RESET_QCOM_PDC is not set -CONFIG_RESET_RASPBERRYPI=m -CONFIG_RESET_SCMI=y -CONFIG_RESET_SIMPLE=y -CONFIG_RESET_SUNXI=y -# CONFIG_RESET_TI_SYSCON is not set -# CONFIG_RESET_TI_TPS380X is not set -CONFIG_RESET_ZYNQMP=y -# CONFIG_COMMON_RESET_HI3660 is not set -CONFIG_COMMON_RESET_HI6220=y - -# PHY Subsystem -CONFIG_GENERIC_PHY=y -CONFIG_GENERIC_PHY_MIPI_DPHY=y -# CONFIG_PHY_XGENE is not set -# CONFIG_PHY_CAN_TRANSCEIVER is not set -# CONFIG_PHY_SUN6I_MIPI_DPHY is not set -# CONFIG_PHY_SUN9I_USB is not set -# CONFIG_PHY_SUN50I_USB3 is not set -# CONFIG_PHY_MESON8B_USB2 is not set -# CONFIG_PHY_MESON_GXL_USB2 is not set -CONFIG_PHY_MESON_G12A_MIPI_DPHY_ANALOG=m -CONFIG_PHY_MESON_G12A_USB2=m -CONFIG_PHY_MESON_G12A_USB3_PCIE=m -CONFIG_PHY_MESON_AXG_PCIE=m -CONFIG_PHY_MESON_AXG_MIPI_PCIE_ANALOG=m -CONFIG_PHY_MESON_AXG_MIPI_DPHY=m - -# PHY drivers for Broadcom platforms -CONFIG_PHY_BCM_SR_USB=m -# CONFIG_BCM_KONA_USB2_PHY is not set -# CONFIG_PHY_BCM_NS_USB2 is not set -# CONFIG_PHY_BCM_NS_USB3 is not set -CONFIG_PHY_NS2_PCIE=m -# CONFIG_PHY_NS2_USB_DRD is not set -CONFIG_PHY_BRCM_SATA=m -CONFIG_PHY_BCM_SR_PCIE=m -# end of PHY drivers for Broadcom platforms - -# CONFIG_PHY_CADENCE_TORRENT is not set -# CONFIG_PHY_CADENCE_DPHY is not set -# CONFIG_PHY_CADENCE_DPHY_RX is not set -# CONFIG_PHY_CADENCE_SIERRA is not set -# CONFIG_PHY_CADENCE_SALVO is not set -# CONFIG_PHY_HI6220_USB is not set -# CONFIG_PHY_HI3660_USB is not set -# CONFIG_PHY_HI3670_USB is not set -# CONFIG_PHY_HI3670_PCIE is not set -# CONFIG_PHY_HISTB_COMBPHY is not set -# CONFIG_PHY_HISI_INNO_USB2 is not set -# CONFIG_PHY_BERLIN_SATA is not set -# CONFIG_PHY_BERLIN_USB is not set -CONFIG_PHY_MVEBU_A3700_COMPHY=m -CONFIG_PHY_MVEBU_A3700_UTMI=m -# CONFIG_PHY_MVEBU_A38X_COMPHY is not set -# CONFIG_PHY_MVEBU_CP110_COMPHY is not set -# CONFIG_PHY_MVEBU_CP110_UTMI is not set -# CONFIG_PHY_PXA_28NM_HSIC is not set -# CONFIG_PHY_PXA_28NM_USB2 is not set -# CONFIG_PHY_MTK_PCIE is not set -# CONFIG_PHY_MTK_XFI_TPHY is not set -# CONFIG_PHY_MTK_TPHY is not set -# CONFIG_PHY_MTK_UFS is not set -# CONFIG_PHY_MTK_XSPHY is not set -# CONFIG_PHY_MTK_HDMI is not set -# CONFIG_PHY_MTK_MIPI_CSI_0_5 is not set -# CONFIG_PHY_MTK_MIPI_DSI is not set -# CONFIG_PHY_MTK_DP is not set -# CONFIG_PHY_LAN966X_SERDES is not set -# CONFIG_PHY_MAPPHONE_MDM6600 is not set -# CONFIG_PHY_OCELOT_SERDES is not set -# CONFIG_PHY_QCOM_APQ8064_SATA is not set -# CONFIG_PHY_QCOM_EDP is not set -# CONFIG_PHY_QCOM_IPQ4019_USB is not set -# CONFIG_PHY_QCOM_IPQ806X_SATA is not set -# CONFIG_PHY_QCOM_PCIE2 is not set -# CONFIG_PHY_QCOM_QMP is not set -# CONFIG_PHY_QCOM_QUSB2 is not set -# CONFIG_PHY_QCOM_SNPS_EUSB2 is not set -# CONFIG_PHY_QCOM_EUSB2_REPEATER is not set -# CONFIG_PHY_QCOM_M31_USB is not set -# CONFIG_PHY_QCOM_USB_SNPS_FEMTO_V2 is not set -# CONFIG_PHY_QCOM_USB_HS_28NM is not set -# CONFIG_PHY_QCOM_USB_SS is not set -# CONFIG_PHY_QCOM_IPQ806X_USB is not set -# CONFIG_PHY_QCOM_SGMII_ETH is not set -# CONFIG_PHY_ROCKCHIP_DP is not set -# CONFIG_PHY_ROCKCHIP_DPHY_RX0 is not set -# CONFIG_PHY_ROCKCHIP_EMMC is not set -# CONFIG_PHY_ROCKCHIP_INNO_HDMI is not set -# CONFIG_PHY_ROCKCHIP_INNO_CSIDPHY is not set -# CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY is not set -# CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY is not set -# CONFIG_PHY_ROCKCHIP_PCIE is not set -# CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX is not set -# CONFIG_PHY_ROCKCHIP_SNPS_PCIE3 is not set -# CONFIG_PHY_ROCKCHIP_TYPEC is not set -# CONFIG_PHY_ROCKCHIP_USB is not set -# CONFIG_PHY_ROCKCHIP_USBDP is not set -CONFIG_PHY_EXYNOS_DP_VIDEO=m -CONFIG_PHY_EXYNOS_MIPI_VIDEO=m -# CONFIG_PHY_EXYNOS_PCIE is not set -# CONFIG_PHY_SAMSUNG_UFS is not set -CONFIG_PHY_SAMSUNG_USB2=m -CONFIG_PHY_EXYNOS5_USBDRD=m -# CONFIG_PHY_TEGRA_XUSB is not set -# CONFIG_PHY_XILINX_ZYNQMP is not set -# end of PHY Subsystem - -# CONFIG_POWERCAP is not set -# CONFIG_MCB is not set - -# Performance monitor support -CONFIG_ARM_CCI_PMU=y -CONFIG_ARM_CCI400_PMU=y -CONFIG_ARM_CCI5xx_PMU=y -CONFIG_ARM_CCN=y -# CONFIG_ARM_CMN is not set -# CONFIG_ARM_NI is not set -CONFIG_ARM_PMU=y -CONFIG_ARM_PMU_ACPI=y -# CONFIG_ARM_SMMU_V3_PMU is not set -CONFIG_ARM_PMUV3=y -# CONFIG_ARM_DSU_PMU is not set -# CONFIG_QCOM_L2_PMU is not set -# CONFIG_QCOM_L3_PMU is not set -# CONFIG_XGENE_PMU is not set -# CONFIG_ARM_SPE_PMU is not set -# CONFIG_ARM_DMC620_PMU is not set -# CONFIG_MARVELL_CN10K_TAD_PMU is not set -# CONFIG_ALIBABA_UNCORE_DRW_PMU is not set -# CONFIG_HISI_PMU is not set -# CONFIG_HISI_PCIE_PMU is not set -# CONFIG_HNS3_PMU is not set -# CONFIG_MARVELL_CN10K_DDR_PMU is not set -# CONFIG_DWC_PCIE_PMU is not set -# CONFIG_ARM_CORESIGHT_PMU_ARCH_SYSTEM_PMU is not set -# CONFIG_MESON_DDR_PMU is not set -# end of Performance monitor support - -CONFIG_RAS=y -# CONFIG_USB4 is not set - -# Android -# CONFIG_ANDROID_BINDER_IPC is not set -# end of Android - -CONFIG_LIBNVDIMM=m -CONFIG_BLK_DEV_PMEM=m -CONFIG_ND_CLAIM=y -CONFIG_ND_BTT=m -CONFIG_BTT=y -CONFIG_OF_PMEM=m -CONFIG_NVDIMM_KEYS=y -# CONFIG_NVDIMM_SECURITY_TEST is not set -CONFIG_DAX=y -CONFIG_DEV_DAX=m -CONFIG_NVMEM=y -CONFIG_NVMEM_SYSFS=y -CONFIG_NVMEM_LAYOUTS=y - -# Layout Types -# CONFIG_NVMEM_LAYOUT_SL28_VPD is not set -# CONFIG_NVMEM_LAYOUT_ONIE_TLV is not set -# CONFIG_NVMEM_LAYOUT_U_BOOT_ENV is not set -# end of Layout Types - -CONFIG_NVMEM_BCM_OCOTP=m -# CONFIG_NVMEM_MESON_EFUSE is not set -# CONFIG_NVMEM_MESON_MX_EFUSE is not set -# CONFIG_NVMEM_MTK_EFUSE is not set -# CONFIG_NVMEM_QCOM_QFPROM is not set -# CONFIG_NVMEM_QCOM_SEC_QFPROM is not set -# CONFIG_NVMEM_RMEM is not set -# CONFIG_NVMEM_ROCKCHIP_EFUSE is not set -# CONFIG_NVMEM_ROCKCHIP_OTP is not set -# CONFIG_NVMEM_SPRD_EFUSE is not set -# CONFIG_NVMEM_SUNXI_SID is not set -# CONFIG_NVMEM_ZYNQMP is not set - -# HW tracing support -# CONFIG_STM is not set -# CONFIG_INTEL_TH is not set -# CONFIG_HISI_PTT is not set -# end of HW tracing support - -# CONFIG_FPGA is not set -# CONFIG_FSI is not set -# CONFIG_TEE is not set -CONFIG_PM_OPP=y -# CONFIG_SIOX is not set -# CONFIG_SLIMBUS is not set -# CONFIG_INTERCONNECT is not set -# CONFIG_COUNTER is not set -# CONFIG_MOST is not set -# CONFIG_PECI is not set -# CONFIG_HTE is not set -# CONFIG_CDX_BUS is not set -# end of Device Drivers - -# File systems -CONFIG_DCACHE_WORD_ACCESS=y -CONFIG_VALIDATE_FS_PARSER=y -CONFIG_FS_IOMAP=y -CONFIG_FS_STACK=y -CONFIG_BUFFER_HEAD=y -CONFIG_LEGACY_DIRECT_IO=y -CONFIG_EXT2_FS=y -CONFIG_EXT2_FS_XATTR=y -CONFIG_EXT2_FS_POSIX_ACL=y -CONFIG_EXT2_FS_SECURITY=y -# CONFIG_EXT3_FS is not set -CONFIG_EXT4_FS=y -CONFIG_EXT4_FS_POSIX_ACL=y -CONFIG_EXT4_FS_SECURITY=y -# CONFIG_EXT4_DEBUG is not set -CONFIG_JBD2=y -# CONFIG_JBD2_DEBUG is not set -CONFIG_FS_MBCACHE=y -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -CONFIG_XFS_FS=y -CONFIG_XFS_SUPPORT_V4=y -CONFIG_XFS_SUPPORT_ASCII_CI=y -CONFIG_XFS_QUOTA=y -CONFIG_XFS_POSIX_ACL=y -CONFIG_XFS_RT=y -# CONFIG_XFS_ONLINE_SCRUB is not set -CONFIG_XFS_WARN=y -# CONFIG_XFS_DEBUG is not set -# CONFIG_GFS2_FS is not set -# CONFIG_OCFS2_FS is not set -CONFIG_BTRFS_FS=m -CONFIG_BTRFS_FS_POSIX_ACL=y -# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set -# CONFIG_BTRFS_DEBUG is not set -# CONFIG_BTRFS_ASSERT is not set -# CONFIG_BTRFS_FS_REF_VERIFY is not set -# CONFIG_NILFS2_FS is not set -# CONFIG_F2FS_FS is not set -# CONFIG_BCACHEFS_FS is not set -# CONFIG_ZONEFS_FS is not set -CONFIG_FS_POSIX_ACL=y -CONFIG_EXPORTFS=y -CONFIG_EXPORTFS_BLOCK_OPS=y -CONFIG_FILE_LOCKING=y -# CONFIG_FS_ENCRYPTION is not set -# CONFIG_FS_VERITY is not set -CONFIG_FSNOTIFY=y -CONFIG_DNOTIFY=y -CONFIG_INOTIFY_USER=y -CONFIG_FANOTIFY=y -CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y -CONFIG_QUOTA=y -CONFIG_QUOTA_NETLINK_INTERFACE=y -# CONFIG_QUOTA_DEBUG is not set -CONFIG_QUOTA_TREE=m -# CONFIG_QFMT_V1 is not set -CONFIG_QFMT_V2=m -CONFIG_QUOTACTL=y -CONFIG_AUTOFS_FS=m -CONFIG_FUSE_FS=m -# CONFIG_CUSE is not set -CONFIG_VIRTIO_FS=m -CONFIG_FUSE_PASSTHROUGH=y -CONFIG_OVERLAY_FS=m -# CONFIG_OVERLAY_FS_REDIRECT_DIR is not set -CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW=y -# CONFIG_OVERLAY_FS_INDEX is not set -# CONFIG_OVERLAY_FS_XINO_AUTO is not set -# CONFIG_OVERLAY_FS_METACOPY is not set -# CONFIG_OVERLAY_FS_DEBUG is not set - -# Caches -CONFIG_NETFS_SUPPORT=m -# CONFIG_NETFS_STATS is not set -# CONFIG_NETFS_DEBUG is not set -CONFIG_FSCACHE=y -# CONFIG_FSCACHE_STATS is not set -# CONFIG_CACHEFILES is not set -# end of Caches - -# CD-ROM/DVD Filesystems -CONFIG_ISO9660_FS=y -CONFIG_JOLIET=y -CONFIG_ZISOFS=y -CONFIG_UDF_FS=y -# end of CD-ROM/DVD Filesystems - -# DOS/FAT/EXFAT/NT Filesystems -CONFIG_FAT_FS=m -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m -CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="ascii" -# CONFIG_FAT_DEFAULT_UTF8 is not set -# CONFIG_EXFAT_FS is not set -# CONFIG_NTFS3_FS is not set -# CONFIG_NTFS_FS is not set -# end of DOS/FAT/EXFAT/NT Filesystems - -# Pseudo filesystems -CONFIG_PROC_FS=y -CONFIG_PROC_KCORE=y -CONFIG_PROC_VMCORE=y -# CONFIG_PROC_VMCORE_DEVICE_DUMP is not set -CONFIG_PROC_SYSCTL=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_PROC_CHILDREN=y -CONFIG_KERNFS=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -CONFIG_TMPFS_POSIX_ACL=y -CONFIG_TMPFS_XATTR=y -# CONFIG_TMPFS_INODE64 is not set -# CONFIG_TMPFS_QUOTA is not set -CONFIG_ARCH_SUPPORTS_HUGETLBFS=y -CONFIG_HUGETLBFS=y -CONFIG_HUGETLB_PAGE=y -CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING=y -CONFIG_ARCH_HAS_GIGANTIC_PAGE=y -CONFIG_CONFIGFS_FS=y -CONFIG_EFIVAR_FS=y -# end of Pseudo filesystems - -CONFIG_MISC_FILESYSTEMS=y -# CONFIG_ORANGEFS_FS is not set -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_ECRYPT_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -CONFIG_CRAMFS=m -CONFIG_CRAMFS_BLOCKDEV=y -CONFIG_SQUASHFS=m -CONFIG_SQUASHFS_FILE_CACHE=y -# CONFIG_SQUASHFS_FILE_DIRECT is not set -CONFIG_SQUASHFS_DECOMP_SINGLE=y -# CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set -CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE=y -# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is not set -# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set -# CONFIG_SQUASHFS_XATTR is not set -CONFIG_SQUASHFS_ZLIB=y -# CONFIG_SQUASHFS_LZ4 is not set -CONFIG_SQUASHFS_LZO=y -CONFIG_SQUASHFS_XZ=y -CONFIG_SQUASHFS_ZSTD=y -# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set -# CONFIG_SQUASHFS_EMBEDDED is not set -CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 -# CONFIG_VXFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_OMFS_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_QNX6FS_FS is not set -# CONFIG_ROMFS_FS is not set -CONFIG_PSTORE=y -CONFIG_PSTORE_DEFAULT_KMSG_BYTES=10240 -CONFIG_PSTORE_COMPRESS=y -# CONFIG_PSTORE_CONSOLE is not set -# CONFIG_PSTORE_PMSG is not set -# CONFIG_PSTORE_FTRACE is not set -# CONFIG_PSTORE_RAM is not set -# CONFIG_PSTORE_BLK is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set -CONFIG_EROFS_FS=m -# CONFIG_EROFS_FS_DEBUG is not set -CONFIG_EROFS_FS_XATTR=y -CONFIG_EROFS_FS_POSIX_ACL=y -CONFIG_EROFS_FS_SECURITY=y -CONFIG_EROFS_FS_BACKED_BY_FILE=y -CONFIG_EROFS_FS_ZIP=y -# CONFIG_EROFS_FS_ZIP_LZMA is not set -# CONFIG_EROFS_FS_ZIP_DEFLATE is not set -CONFIG_EROFS_FS_ZIP_ZSTD=y -# CONFIG_EROFS_FS_ONDEMAND is not set -# CONFIG_EROFS_FS_PCPU_KTHREAD is not set -CONFIG_NETWORK_FILESYSTEMS=y -CONFIG_NFS_FS=m -CONFIG_NFS_V2=m -CONFIG_NFS_V3=m -CONFIG_NFS_V3_ACL=y -CONFIG_NFS_V4=m -# CONFIG_NFS_SWAP is not set -CONFIG_NFS_V4_1=y -CONFIG_NFS_V4_2=y -CONFIG_PNFS_FILE_LAYOUT=m -CONFIG_PNFS_BLOCK=m -CONFIG_PNFS_FLEXFILE_LAYOUT=m -CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org" -# CONFIG_NFS_V4_1_MIGRATION is not set -CONFIG_NFS_V4_SECURITY_LABEL=y -CONFIG_NFS_FSCACHE=y -# CONFIG_NFS_USE_LEGACY_DNS is not set -CONFIG_NFS_USE_KERNEL_DNS=y -CONFIG_NFS_DEBUG=y -CONFIG_NFS_DISABLE_UDP_SUPPORT=y -# CONFIG_NFS_V4_2_READ_PLUS is not set -CONFIG_NFSD=m -# CONFIG_NFSD_V2 is not set -CONFIG_NFSD_V3_ACL=y -CONFIG_NFSD_V4=y -CONFIG_NFSD_PNFS=y -CONFIG_NFSD_BLOCKLAYOUT=y -CONFIG_NFSD_SCSILAYOUT=y -CONFIG_NFSD_FLEXFILELAYOUT=y -# CONFIG_NFSD_V4_2_INTER_SSC is not set -# CONFIG_NFSD_V4_SECURITY_LABEL is not set -# CONFIG_NFSD_LEGACY_CLIENT_TRACKING is not set -CONFIG_GRACE_PERIOD=m -CONFIG_LOCKD=m -CONFIG_LOCKD_V4=y -CONFIG_NFS_ACL_SUPPORT=m -CONFIG_NFS_COMMON=y -# CONFIG_NFS_LOCALIO is not set -CONFIG_NFS_V4_2_SSC_HELPER=y -CONFIG_SUNRPC=m -CONFIG_SUNRPC_GSS=m -CONFIG_SUNRPC_BACKCHANNEL=y -CONFIG_RPCSEC_GSS_KRB5=m -CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_AES_SHA1=y -# CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_AES_SHA2 is not set -CONFIG_SUNRPC_DEBUG=y -CONFIG_SUNRPC_XPRT_RDMA=m -CONFIG_CEPH_FS=m -CONFIG_CEPH_FSCACHE=y -CONFIG_CEPH_FS_POSIX_ACL=y -# CONFIG_CEPH_FS_SECURITY_LABEL is not set -CONFIG_CIFS=m -CONFIG_CIFS_STATS2=y -# CONFIG_CIFS_ALLOW_INSECURE_LEGACY is not set -CONFIG_CIFS_UPCALL=y -CONFIG_CIFS_XATTR=y -CONFIG_CIFS_DEBUG=y -# CONFIG_CIFS_DEBUG2 is not set -# CONFIG_CIFS_DEBUG_DUMP_KEYS is not set -CONFIG_CIFS_DFS_UPCALL=y -# CONFIG_CIFS_SWN_UPCALL is not set -# CONFIG_CIFS_SMB_DIRECT is not set -# CONFIG_CIFS_FSCACHE is not set -# CONFIG_CIFS_COMPRESSION is not set -# CONFIG_SMB_SERVER is not set -CONFIG_SMBFS=m -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set -CONFIG_9P_FS=m -# CONFIG_9P_FSCACHE is not set -CONFIG_9P_FS_POSIX_ACL=y -CONFIG_9P_FS_SECURITY=y -CONFIG_NLS=y -CONFIG_NLS_DEFAULT="utf8" -CONFIG_NLS_CODEPAGE_437=y -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -CONFIG_NLS_ASCII=y -CONFIG_NLS_ISO8859_1=m -CONFIG_NLS_ISO8859_2=m -CONFIG_NLS_ISO8859_3=m -CONFIG_NLS_ISO8859_4=m -CONFIG_NLS_ISO8859_5=m -CONFIG_NLS_ISO8859_6=m -CONFIG_NLS_ISO8859_7=m -CONFIG_NLS_ISO8859_9=m -CONFIG_NLS_ISO8859_13=m -CONFIG_NLS_ISO8859_14=m -CONFIG_NLS_ISO8859_15=m -CONFIG_NLS_KOI8_R=m -CONFIG_NLS_KOI8_U=m -# CONFIG_NLS_MAC_ROMAN is not set -# CONFIG_NLS_MAC_CELTIC is not set -# CONFIG_NLS_MAC_CENTEURO is not set -# CONFIG_NLS_MAC_CROATIAN is not set -# CONFIG_NLS_MAC_CYRILLIC is not set -# CONFIG_NLS_MAC_GAELIC is not set -# CONFIG_NLS_MAC_GREEK is not set -# CONFIG_NLS_MAC_ICELAND is not set -# CONFIG_NLS_MAC_INUIT is not set -# CONFIG_NLS_MAC_ROMANIAN is not set -# CONFIG_NLS_MAC_TURKISH is not set -CONFIG_NLS_UTF8=y -CONFIG_NLS_UCS2_UTILS=m -CONFIG_DLM=m -# CONFIG_DLM_DEBUG is not set -# CONFIG_UNICODE is not set -CONFIG_IO_WQ=y -# end of File systems - -# Security options -CONFIG_KEYS=y -# CONFIG_KEYS_REQUEST_CACHE is not set -# CONFIG_PERSISTENT_KEYRINGS is not set -CONFIG_TRUSTED_KEYS=m -CONFIG_HAVE_TRUSTED_KEYS=y -CONFIG_TRUSTED_KEYS_TPM=y -CONFIG_ENCRYPTED_KEYS=m -# CONFIG_USER_DECRYPTED_DATA is not set -# CONFIG_KEY_DH_OPERATIONS is not set -# CONFIG_SECURITY_DMESG_RESTRICT is not set -CONFIG_PROC_MEM_ALWAYS_FORCE=y -# CONFIG_PROC_MEM_FORCE_PTRACE is not set -# CONFIG_PROC_MEM_NO_FORCE is not set -CONFIG_SECURITY=y -CONFIG_SECURITYFS=y -CONFIG_SECURITY_NETWORK=y -# CONFIG_SECURITY_INFINIBAND is not set -CONFIG_SECURITY_NETWORK_XFRM=y -CONFIG_SECURITY_PATH=y -CONFIG_LSM_MMAP_MIN_ADDR=65536 -CONFIG_HARDENED_USERCOPY=y -# CONFIG_FORTIFY_SOURCE is not set -# CONFIG_STATIC_USERMODEHELPER is not set -CONFIG_SECURITY_SELINUX=y -CONFIG_SECURITY_SELINUX_BOOTPARAM=y -CONFIG_SECURITY_SELINUX_DEVELOP=y -CONFIG_SECURITY_SELINUX_AVC_STATS=y -CONFIG_SECURITY_SELINUX_SIDTAB_HASH_BITS=9 -CONFIG_SECURITY_SELINUX_SID2STR_CACHE_SIZE=256 -# CONFIG_SECURITY_SELINUX_DEBUG is not set -CONFIG_SECURITY_SMACK=y -# CONFIG_SECURITY_SMACK_BRINGUP is not set -# CONFIG_SECURITY_SMACK_NETFILTER is not set -# CONFIG_SECURITY_SMACK_APPEND_SIGNALS is not set -# CONFIG_SECURITY_TOMOYO is not set -CONFIG_SECURITY_APPARMOR=y -# CONFIG_SECURITY_APPARMOR_DEBUG is not set -CONFIG_SECURITY_APPARMOR_INTROSPECT_POLICY=y -CONFIG_SECURITY_APPARMOR_HASH=y -CONFIG_SECURITY_APPARMOR_HASH_DEFAULT=y -CONFIG_SECURITY_APPARMOR_EXPORT_BINARY=y -CONFIG_SECURITY_APPARMOR_PARANOID_LOAD=y -# CONFIG_SECURITY_LOADPIN is not set -CONFIG_SECURITY_YAMA=y -# CONFIG_SECURITY_SAFESETID is not set -CONFIG_SECURITY_LOCKDOWN_LSM=y -CONFIG_SECURITY_LOCKDOWN_LSM_EARLY=y -CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE=y -# CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY is not set -# CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY is not set -# CONFIG_SECURITY_LANDLOCK is not set -# CONFIG_SECURITY_IPE is not set -CONFIG_INTEGRITY=y -CONFIG_INTEGRITY_SIGNATURE=y -CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y -# CONFIG_INTEGRITY_TRUSTED_KEYRING is not set -CONFIG_INTEGRITY_PLATFORM_KEYRING=y -CONFIG_LOAD_UEFI_KEYS=y -CONFIG_INTEGRITY_AUDIT=y -CONFIG_IMA=y -# CONFIG_IMA_KEXEC is not set -CONFIG_IMA_MEASURE_PCR_IDX=10 -CONFIG_IMA_LSM_RULES=y -CONFIG_IMA_NG_TEMPLATE=y -# CONFIG_IMA_SIG_TEMPLATE is not set -CONFIG_IMA_DEFAULT_TEMPLATE="ima-ng" -# CONFIG_IMA_DEFAULT_HASH_SHA1 is not set -CONFIG_IMA_DEFAULT_HASH_SHA256=y -# CONFIG_IMA_DEFAULT_HASH_SHA512 is not set -CONFIG_IMA_DEFAULT_HASH="sha256" -# CONFIG_IMA_WRITE_POLICY is not set -CONFIG_IMA_READ_POLICY=y -# CONFIG_IMA_APPRAISE is not set -# CONFIG_IMA_ARCH_POLICY is not set -CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS=y -CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS=y -# CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT is not set -# CONFIG_IMA_DISABLE_HTABLE is not set -# CONFIG_EVM is not set -CONFIG_DEFAULT_SECURITY_SELINUX=y -# CONFIG_DEFAULT_SECURITY_SMACK is not set -# CONFIG_DEFAULT_SECURITY_APPARMOR is not set -# CONFIG_DEFAULT_SECURITY_DAC is not set -CONFIG_LSM="lockdown,yama,loadpin,safesetid,integrity,selinux,apparmor,smack,tomoyo" - -# Kernel hardening options - -# Memory initialization -CONFIG_CC_HAS_AUTO_VAR_INIT_PATTERN=y -CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO_BARE=y -CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO=y -CONFIG_INIT_STACK_NONE=y -# CONFIG_INIT_STACK_ALL_PATTERN is not set -# CONFIG_INIT_STACK_ALL_ZERO is not set -# CONFIG_GCC_PLUGIN_STACKLEAK is not set -# CONFIG_INIT_ON_ALLOC_DEFAULT_ON is not set -# CONFIG_INIT_ON_FREE_DEFAULT_ON is not set -CONFIG_CC_HAS_ZERO_CALL_USED_REGS=y -# CONFIG_ZERO_CALL_USED_REGS is not set -# end of Memory initialization - -# Hardening of kernel data structures -# CONFIG_LIST_HARDENED is not set -# CONFIG_BUG_ON_DATA_CORRUPTION is not set -# end of Hardening of kernel data structures - -CONFIG_RANDSTRUCT_NONE=y -# CONFIG_RANDSTRUCT_FULL is not set -# CONFIG_RANDSTRUCT_PERFORMANCE is not set -# end of Kernel hardening options -# end of Security options - -CONFIG_XOR_BLOCKS=m -CONFIG_ASYNC_CORE=m -CONFIG_ASYNC_MEMCPY=m -CONFIG_ASYNC_XOR=m -CONFIG_ASYNC_PQ=m -CONFIG_ASYNC_RAID6_RECOV=m -CONFIG_CRYPTO=y - -# Crypto core or helper -CONFIG_CRYPTO_FIPS=y -CONFIG_CRYPTO_FIPS_NAME="Linux Kernel Cryptographic API" -# CONFIG_CRYPTO_FIPS_CUSTOM_VERSION is not set -CONFIG_CRYPTO_ALGAPI=y -CONFIG_CRYPTO_ALGAPI2=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_SIG=y -CONFIG_CRYPTO_SIG2=y -CONFIG_CRYPTO_SKCIPHER=y -CONFIG_CRYPTO_SKCIPHER2=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_RNG_DEFAULT=y -CONFIG_CRYPTO_AKCIPHER2=y -CONFIG_CRYPTO_AKCIPHER=y -CONFIG_CRYPTO_KPP2=y -CONFIG_CRYPTO_KPP=y -CONFIG_CRYPTO_ACOMP2=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -# CONFIG_CRYPTO_USER is not set -# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set -# CONFIG_CRYPTO_MANAGER_EXTRA_TESTS is not set -CONFIG_CRYPTO_NULL=y -CONFIG_CRYPTO_NULL2=y -# CONFIG_CRYPTO_PCRYPT is not set -CONFIG_CRYPTO_CRYPTD=y -CONFIG_CRYPTO_AUTHENC=m -CONFIG_CRYPTO_TEST=m -CONFIG_CRYPTO_ENGINE=m -# end of Crypto core or helper - -# Public-key cryptography -CONFIG_CRYPTO_RSA=y -# CONFIG_CRYPTO_DH is not set -CONFIG_CRYPTO_ECC=y -CONFIG_CRYPTO_ECDH=y -CONFIG_CRYPTO_ECDSA=y -# CONFIG_CRYPTO_ECRDSA is not set -# CONFIG_CRYPTO_CURVE25519 is not set -# end of Public-key cryptography - -# Block ciphers -CONFIG_CRYPTO_AES=y -# CONFIG_CRYPTO_AES_TI is not set -# CONFIG_CRYPTO_ANUBIS is not set -# CONFIG_CRYPTO_ARIA is not set -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -CONFIG_CRYPTO_DES=y -# CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SEED is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_SM4_GENERIC is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TWOFISH is not set -# end of Block ciphers - -# Length-preserving ciphers and modes -# CONFIG_CRYPTO_ADIANTUM is not set -CONFIG_CRYPTO_ARC4=m -# CONFIG_CRYPTO_CHACHA20 is not set -CONFIG_CRYPTO_CBC=y -CONFIG_CRYPTO_CTR=y -CONFIG_CRYPTO_CTS=y -CONFIG_CRYPTO_ECB=y -# CONFIG_CRYPTO_HCTR2 is not set -# CONFIG_CRYPTO_KEYWRAP is not set -CONFIG_CRYPTO_LRW=m -# CONFIG_CRYPTO_PCBC is not set -CONFIG_CRYPTO_XTS=y -CONFIG_CRYPTO_NHPOLY1305=m -# end of Length-preserving ciphers and modes - -# AEAD (authenticated encryption with associated data) ciphers -# CONFIG_CRYPTO_AEGIS128 is not set -# CONFIG_CRYPTO_CHACHA20POLY1305 is not set -CONFIG_CRYPTO_CCM=y -CONFIG_CRYPTO_GCM=y -CONFIG_CRYPTO_GENIV=y -CONFIG_CRYPTO_SEQIV=y -CONFIG_CRYPTO_ECHAINIV=m -CONFIG_CRYPTO_ESSIV=m -# end of AEAD (authenticated encryption with associated data) ciphers - -# Hashes, digests, and MACs -CONFIG_CRYPTO_BLAKE2B=m -CONFIG_CRYPTO_CMAC=y -CONFIG_CRYPTO_GHASH=y -CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_MD4=m -CONFIG_CRYPTO_MD5=y -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_POLY1305 is not set -# CONFIG_CRYPTO_RMD160 is not set -CONFIG_CRYPTO_SHA1=y -CONFIG_CRYPTO_SHA256=y -CONFIG_CRYPTO_SHA512=y -CONFIG_CRYPTO_SHA3=y -# CONFIG_CRYPTO_SM3_GENERIC is not set -# CONFIG_CRYPTO_STREEBOG is not set -# CONFIG_CRYPTO_VMAC is not set -# CONFIG_CRYPTO_WP512 is not set -# CONFIG_CRYPTO_XCBC is not set -CONFIG_CRYPTO_XXHASH=m -# end of Hashes, digests, and MACs - -# CRCs (cyclic redundancy checks) -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_CRC32=m -CONFIG_CRYPTO_CRCT10DIF=y -CONFIG_CRYPTO_CRC64_ROCKSOFT=y -# end of CRCs (cyclic redundancy checks) - -# Compression -CONFIG_CRYPTO_DEFLATE=y -CONFIG_CRYPTO_LZO=y -# CONFIG_CRYPTO_842 is not set -# CONFIG_CRYPTO_LZ4 is not set -# CONFIG_CRYPTO_LZ4HC is not set -# CONFIG_CRYPTO_ZSTD is not set -# end of Compression - -# Random number generation -CONFIG_CRYPTO_ANSI_CPRNG=m -CONFIG_CRYPTO_DRBG_MENU=y -CONFIG_CRYPTO_DRBG_HMAC=y -CONFIG_CRYPTO_DRBG_HASH=y -CONFIG_CRYPTO_DRBG_CTR=y -CONFIG_CRYPTO_DRBG=y -CONFIG_CRYPTO_JITTERENTROPY=y -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_2 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_8 is not set -CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_32=y -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_64 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_128 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_1024 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_8192 is not set -CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKS=128 -CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE=256 -CONFIG_CRYPTO_JITTERENTROPY_OSR=3 -# CONFIG_CRYPTO_JITTERENTROPY_TESTINTERFACE is not set -# end of Random number generation - -# Userspace interface -CONFIG_CRYPTO_USER_API=m -CONFIG_CRYPTO_USER_API_HASH=m -CONFIG_CRYPTO_USER_API_SKCIPHER=m -CONFIG_CRYPTO_USER_API_RNG=m -# CONFIG_CRYPTO_USER_API_RNG_CAVP is not set -# CONFIG_CRYPTO_USER_API_AEAD is not set -CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y -# end of Userspace interface - -CONFIG_CRYPTO_HASH_INFO=y -CONFIG_CRYPTO_NHPOLY1305_NEON=m -CONFIG_CRYPTO_CHACHA20_NEON=m - -# Accelerated Cryptographic Algorithms for CPU (arm64) -CONFIG_CRYPTO_GHASH_ARM64_CE=m -CONFIG_CRYPTO_POLY1305_NEON=m -CONFIG_CRYPTO_SHA1_ARM64_CE=m -CONFIG_CRYPTO_SHA256_ARM64=m -CONFIG_CRYPTO_SHA2_ARM64_CE=m -CONFIG_CRYPTO_SHA512_ARM64=m -CONFIG_CRYPTO_SHA512_ARM64_CE=m -# CONFIG_CRYPTO_SHA3_ARM64 is not set -# CONFIG_CRYPTO_SM3_NEON is not set -# CONFIG_CRYPTO_SM3_ARM64_CE is not set -# CONFIG_CRYPTO_POLYVAL_ARM64_CE is not set -CONFIG_CRYPTO_AES_ARM64=y -CONFIG_CRYPTO_AES_ARM64_CE=y -CONFIG_CRYPTO_AES_ARM64_CE_BLK=y -CONFIG_CRYPTO_AES_ARM64_NEON_BLK=m -CONFIG_CRYPTO_AES_ARM64_BS=m -# CONFIG_CRYPTO_SM4_ARM64_CE is not set -# CONFIG_CRYPTO_SM4_ARM64_CE_BLK is not set -# CONFIG_CRYPTO_SM4_ARM64_NEON_BLK is not set -CONFIG_CRYPTO_AES_ARM64_CE_CCM=m -# CONFIG_CRYPTO_SM4_ARM64_CE_CCM is not set -# CONFIG_CRYPTO_SM4_ARM64_CE_GCM is not set -CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=m -# end of Accelerated Cryptographic Algorithms for CPU (arm64) - -CONFIG_CRYPTO_HW=y -CONFIG_CRYPTO_DEV_ALLWINNER=y -# CONFIG_CRYPTO_DEV_SUN4I_SS is not set -# CONFIG_CRYPTO_DEV_SUN8I_CE is not set -# CONFIG_CRYPTO_DEV_SUN8I_SS is not set -# CONFIG_CRYPTO_DEV_EXYNOS_RNG is not set -# CONFIG_CRYPTO_DEV_S5P is not set -# CONFIG_CRYPTO_DEV_ATMEL_ECC is not set -# CONFIG_CRYPTO_DEV_ATMEL_SHA204A is not set -# CONFIG_CRYPTO_DEV_CCP is not set -CONFIG_CRYPTO_DEV_CPT=m -CONFIG_CAVIUM_CPT=m -# CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set -# CONFIG_CRYPTO_DEV_MARVELL_CESA is not set -# CONFIG_CRYPTO_DEV_OCTEONTX_CPT is not set -# CONFIG_CRYPTO_DEV_QAT_DH895xCC is not set -# CONFIG_CRYPTO_DEV_QAT_C3XXX is not set -# CONFIG_CRYPTO_DEV_QAT_C62X is not set -# CONFIG_CRYPTO_DEV_QAT_4XXX is not set -# CONFIG_CRYPTO_DEV_QAT_420XX is not set -# CONFIG_CRYPTO_DEV_QAT_DH895xCCVF is not set -# CONFIG_CRYPTO_DEV_QAT_C3XXXVF is not set -# CONFIG_CRYPTO_DEV_QAT_C62XVF is not set -CONFIG_CRYPTO_DEV_CAVIUM_ZIP=m -# CONFIG_CRYPTO_DEV_QCE is not set -# CONFIG_CRYPTO_DEV_QCOM_RNG is not set -# CONFIG_CRYPTO_DEV_ROCKCHIP is not set -CONFIG_CRYPTO_DEV_CHELSIO=m -CONFIG_CRYPTO_DEV_VIRTIO=m -# CONFIG_CRYPTO_DEV_BCM_SPU is not set -# CONFIG_CRYPTO_DEV_SAFEXCEL is not set -# CONFIG_CRYPTO_DEV_CCREE is not set -# CONFIG_CRYPTO_DEV_HISI_SEC is not set -# CONFIG_CRYPTO_DEV_HISI_SEC2 is not set -# CONFIG_CRYPTO_DEV_HISI_ZIP is not set -# CONFIG_CRYPTO_DEV_HISI_HPRE is not set -# CONFIG_CRYPTO_DEV_HISI_TRNG is not set -CONFIG_CRYPTO_DEV_AMLOGIC_GXL=m -# CONFIG_CRYPTO_DEV_AMLOGIC_GXL_DEBUG is not set -CONFIG_ASYMMETRIC_KEY_TYPE=y -CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y -CONFIG_X509_CERTIFICATE_PARSER=y -# CONFIG_PKCS8_PRIVATE_KEY_PARSER is not set -CONFIG_PKCS7_MESSAGE_PARSER=y -# CONFIG_PKCS7_TEST_KEY is not set -CONFIG_SIGNED_PE_FILE_VERIFICATION=y -# CONFIG_FIPS_SIGNATURE_SELFTEST is not set - -# Certificates for signature checking -CONFIG_MODULE_SIG_KEY="certs/signing_key.pem" -CONFIG_MODULE_SIG_KEY_TYPE_RSA=y -# CONFIG_MODULE_SIG_KEY_TYPE_ECDSA is not set -CONFIG_SYSTEM_TRUSTED_KEYRING=y -CONFIG_SYSTEM_TRUSTED_KEYS="photon-cert-bundle.pem" -# CONFIG_SYSTEM_EXTRA_CERTIFICATE is not set -# CONFIG_SECONDARY_TRUSTED_KEYRING is not set -CONFIG_SYSTEM_BLACKLIST_KEYRING=y -CONFIG_SYSTEM_BLACKLIST_HASH_LIST="" -# CONFIG_SYSTEM_REVOCATION_LIST is not set -# CONFIG_SYSTEM_BLACKLIST_AUTH_UPDATE is not set -# end of Certificates for signature checking - -CONFIG_BINARY_PRINTF=y - -# Library routines -CONFIG_RAID6_PQ=m -# CONFIG_RAID6_PQ_BENCHMARK is not set -CONFIG_LINEAR_RANGES=y -# CONFIG_PACKING is not set -CONFIG_BITREVERSE=y -CONFIG_HAVE_ARCH_BITREVERSE=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_NET_UTILS=y -CONFIG_CORDIC=m -# CONFIG_PRIME_NUMBERS is not set -CONFIG_RATIONAL=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -CONFIG_ARCH_HAS_FAST_MULTIPLIER=y -CONFIG_ARCH_USE_SYM_ANNOTATIONS=y -# CONFIG_INDIRECT_PIO is not set -# CONFIG_TRACE_MMIO_ACCESS is not set - -# Crypto library routines -CONFIG_CRYPTO_LIB_UTILS=y -CONFIG_CRYPTO_LIB_AES=y -CONFIG_CRYPTO_LIB_AESCFB=y -CONFIG_CRYPTO_LIB_ARC4=m -CONFIG_CRYPTO_LIB_GF128MUL=y -CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y -CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=y -CONFIG_CRYPTO_LIB_CHACHA_GENERIC=m -CONFIG_CRYPTO_LIB_CHACHA_INTERNAL=m -CONFIG_CRYPTO_LIB_CHACHA=m -CONFIG_CRYPTO_LIB_CURVE25519_GENERIC=m -CONFIG_CRYPTO_LIB_CURVE25519_INTERNAL=m -CONFIG_CRYPTO_LIB_CURVE25519=m -CONFIG_CRYPTO_LIB_DES=y -CONFIG_CRYPTO_LIB_POLY1305_RSIZE=9 -CONFIG_CRYPTO_ARCH_HAVE_LIB_POLY1305=y -CONFIG_CRYPTO_LIB_POLY1305_GENERIC=m -CONFIG_CRYPTO_LIB_POLY1305_INTERNAL=m -CONFIG_CRYPTO_LIB_POLY1305=m -CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m -CONFIG_CRYPTO_LIB_SHA1=y -CONFIG_CRYPTO_LIB_SHA256=y -# end of Crypto library routines - -CONFIG_CRC_CCITT=y -CONFIG_CRC16=y -CONFIG_CRC_T10DIF=y -CONFIG_CRC64_ROCKSOFT=y -CONFIG_CRC_ITU_T=y -CONFIG_CRC32=y -# CONFIG_CRC32_SELFTEST is not set -CONFIG_CRC32_SLICEBY8=y -# CONFIG_CRC32_SLICEBY4 is not set -# CONFIG_CRC32_SARWATE is not set -# CONFIG_CRC32_BIT is not set -CONFIG_CRC64=y -# CONFIG_CRC4 is not set -CONFIG_CRC7=m -CONFIG_LIBCRC32C=y -CONFIG_CRC8=y -CONFIG_XXHASH=y -CONFIG_AUDIT_GENERIC=y -CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y -CONFIG_AUDIT_COMPAT_GENERIC=y -# CONFIG_RANDOM32_SELFTEST is not set -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=y -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y -CONFIG_LZ4_DECOMPRESS=y -CONFIG_ZSTD_COMMON=y -CONFIG_ZSTD_COMPRESS=y -CONFIG_ZSTD_DECOMPRESS=y -CONFIG_XZ_DEC=y -# CONFIG_XZ_DEC_X86 is not set -# CONFIG_XZ_DEC_POWERPC is not set -CONFIG_XZ_DEC_ARM=y -CONFIG_XZ_DEC_ARMTHUMB=y -CONFIG_XZ_DEC_ARM64=y -# CONFIG_XZ_DEC_SPARC is not set -# CONFIG_XZ_DEC_RISCV is not set -# CONFIG_XZ_DEC_MICROLZMA is not set -CONFIG_XZ_DEC_BCJ=y -# CONFIG_XZ_DEC_TEST is not set -CONFIG_DECOMPRESS_GZIP=y -CONFIG_DECOMPRESS_BZIP2=y -CONFIG_DECOMPRESS_LZMA=y -CONFIG_DECOMPRESS_XZ=y -CONFIG_DECOMPRESS_LZO=y -CONFIG_DECOMPRESS_LZ4=y -CONFIG_DECOMPRESS_ZSTD=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_TEXTSEARCH=y -CONFIG_TEXTSEARCH_KMP=m -CONFIG_TEXTSEARCH_BM=m -CONFIG_TEXTSEARCH_FSM=m -CONFIG_BTREE=y -CONFIG_INTERVAL_TREE=y -CONFIG_XARRAY_MULTI=y -CONFIG_ASSOCIATIVE_ARRAY=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAS_IOPORT_MAP=y -CONFIG_HAS_DMA=y -CONFIG_DMA_OPS_HELPERS=y -CONFIG_NEED_SG_DMA_FLAGS=y -CONFIG_NEED_SG_DMA_LENGTH=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_ARCH_DMA_ADDR_T_64BIT=y -CONFIG_DMA_DECLARE_COHERENT=y -CONFIG_ARCH_HAS_SETUP_DMA_OPS=y -CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y -CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU=y -CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y -CONFIG_SWIOTLB=y -# CONFIG_SWIOTLB_DYNAMIC is not set -CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC=y -CONFIG_DMA_NEED_SYNC=y -# CONFIG_DMA_RESTRICTED_POOL is not set -CONFIG_DMA_NONCOHERENT_MMAP=y -CONFIG_DMA_COHERENT_POOL=y -CONFIG_DMA_DIRECT_REMAP=y -CONFIG_DMA_CMA=y -# CONFIG_DMA_NUMA_CMA is not set - -## Default contiguous memory area size: -CONFIG_CMA_SIZE_MBYTES=0 -CONFIG_CMA_SIZE_SEL_MBYTES=y -# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set -# CONFIG_CMA_SIZE_SEL_MIN is not set -# CONFIG_CMA_SIZE_SEL_MAX is not set -CONFIG_CMA_ALIGNMENT=8 -# CONFIG_DMA_API_DEBUG is not set -# CONFIG_DMA_MAP_BENCHMARK is not set -CONFIG_SGL_ALLOC=y -CONFIG_CHECK_SIGNATURE=y -CONFIG_CPU_RMAP=y -CONFIG_DQL=y -CONFIG_GLOB=y -# CONFIG_GLOB_SELFTEST is not set -CONFIG_NLATTR=y -CONFIG_CLZ_TAB=y -CONFIG_IRQ_POLL=y -CONFIG_MPILIB=y -CONFIG_SIGNATURE=y -CONFIG_DIMLIB=y -CONFIG_LIBFDT=y -CONFIG_OID_REGISTRY=y -CONFIG_UCS2_STRING=y -CONFIG_HAVE_GENERIC_VDSO=y -CONFIG_GENERIC_GETTIMEOFDAY=y -CONFIG_GENERIC_VDSO_TIME_NS=y -CONFIG_VDSO_GETRANDOM=y -CONFIG_FONT_SUPPORT=y -# CONFIG_FONTS is not set -CONFIG_FONT_8x8=y -CONFIG_FONT_8x16=y -CONFIG_SG_POOL=y -CONFIG_ARCH_HAS_PMEM_API=y -CONFIG_MEMREGION=y -CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y -CONFIG_ARCH_STACKWALK=y -CONFIG_STACKDEPOT=y -CONFIG_STACKDEPOT_MAX_FRAMES=64 -CONFIG_SBITMAP=y -# CONFIG_LWQ_TEST is not set -# end of Library routines - -CONFIG_GENERIC_IOREMAP=y -CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y -CONFIG_ASN1_ENCODER=m -CONFIG_FIRMWARE_TABLE=y - -# Kernel hacking - -# printk and dmesg options -CONFIG_PRINTK_TIME=y -# CONFIG_PRINTK_CALLER is not set -# CONFIG_STACKTRACE_BUILD_ID is not set -CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 -CONFIG_CONSOLE_LOGLEVEL_QUIET=4 -CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 -# CONFIG_BOOT_PRINTK_DELAY is not set -CONFIG_DYNAMIC_DEBUG=y -CONFIG_DYNAMIC_DEBUG_CORE=y -CONFIG_SYMBOLIC_ERRNAME=y -CONFIG_DEBUG_BUGVERBOSE=y -# end of printk and dmesg options - -CONFIG_DEBUG_KERNEL=y -CONFIG_DEBUG_MISC=y - -# Compile-time checks and compiler options -CONFIG_DEBUG_INFO=y -CONFIG_AS_HAS_NON_CONST_ULEB128=y -# CONFIG_DEBUG_INFO_NONE is not set -CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y -# CONFIG_DEBUG_INFO_DWARF4 is not set -# CONFIG_DEBUG_INFO_DWARF5 is not set -# CONFIG_DEBUG_INFO_REDUCED is not set -CONFIG_DEBUG_INFO_COMPRESSED_NONE=y -# CONFIG_DEBUG_INFO_COMPRESSED_ZLIB is not set -# CONFIG_DEBUG_INFO_SPLIT is not set -CONFIG_DEBUG_INFO_BTF=y -CONFIG_PAHOLE_HAS_SPLIT_BTF=y -CONFIG_PAHOLE_HAS_LANG_EXCLUDE=y -CONFIG_DEBUG_INFO_BTF_MODULES=y -# CONFIG_MODULE_ALLOW_BTF_MISMATCH is not set -# CONFIG_GDB_SCRIPTS is not set -CONFIG_FRAME_WARN=2048 -CONFIG_STRIP_ASM_SYMS=y -# CONFIG_READABLE_ASM is not set -# CONFIG_HEADERS_INSTALL is not set -# CONFIG_DEBUG_SECTION_MISMATCH is not set -CONFIG_SECTION_MISMATCH_WARN_ONLY=y -# CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B is not set -CONFIG_ARCH_WANT_FRAME_POINTERS=y -CONFIG_FRAME_POINTER=y -# CONFIG_VMLINUX_MAP is not set -# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set -# end of Compile-time checks and compiler options - -# Generic Kernel Debugging Instruments -CONFIG_MAGIC_SYSRQ=y -CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1 -CONFIG_MAGIC_SYSRQ_SERIAL=y -CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE="" -CONFIG_DEBUG_FS=y -CONFIG_DEBUG_FS_ALLOW_ALL=y -# CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set -# CONFIG_DEBUG_FS_ALLOW_NONE is not set -CONFIG_HAVE_ARCH_KGDB=y -# CONFIG_KGDB is not set -CONFIG_ARCH_HAS_UBSAN=y -# CONFIG_UBSAN is not set -CONFIG_HAVE_ARCH_KCSAN=y -CONFIG_HAVE_KCSAN_COMPILER=y -# CONFIG_KCSAN is not set -# end of Generic Kernel Debugging Instruments - -# Networking Debugging -# CONFIG_NET_DEV_REFCNT_TRACKER is not set -# CONFIG_NET_NS_REFCNT_TRACKER is not set -# CONFIG_DEBUG_NET is not set -# CONFIG_DEBUG_NET_SMALL_RTNL is not set -# end of Networking Debugging - -# Memory Debugging -# CONFIG_PAGE_EXTENSION is not set -# CONFIG_DEBUG_PAGEALLOC is not set -CONFIG_SLUB_DEBUG=y -# CONFIG_SLUB_DEBUG_ON is not set -# CONFIG_PAGE_OWNER is not set -# CONFIG_PAGE_TABLE_CHECK is not set -# CONFIG_PAGE_POISONING is not set -# CONFIG_DEBUG_PAGE_REF is not set -# CONFIG_DEBUG_RODATA_TEST is not set -CONFIG_ARCH_HAS_DEBUG_WX=y -# CONFIG_DEBUG_WX is not set -CONFIG_ARCH_HAS_PTDUMP=y -# CONFIG_PTDUMP_DEBUGFS is not set -CONFIG_HAVE_DEBUG_KMEMLEAK=y -# CONFIG_DEBUG_KMEMLEAK is not set -# CONFIG_PER_VMA_LOCK_STATS is not set -# CONFIG_DEBUG_OBJECTS is not set -# CONFIG_SHRINKER_DEBUG is not set -# CONFIG_DEBUG_STACK_USAGE is not set -# CONFIG_SCHED_STACK_END_CHECK is not set -CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE=y -# CONFIG_DEBUG_VM is not set -# CONFIG_DEBUG_VM_PGTABLE is not set -CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y -# CONFIG_DEBUG_VIRTUAL is not set -# CONFIG_DEBUG_MEMORY_INIT is not set -# CONFIG_DEBUG_PER_CPU_MAPS is not set -# CONFIG_MEM_ALLOC_PROFILING is not set -CONFIG_HAVE_ARCH_KASAN=y -CONFIG_HAVE_ARCH_KASAN_SW_TAGS=y -CONFIG_HAVE_ARCH_KASAN_HW_TAGS=y -CONFIG_HAVE_ARCH_KASAN_VMALLOC=y -CONFIG_CC_HAS_KASAN_GENERIC=y -CONFIG_CC_HAS_KASAN_SW_TAGS=y -CONFIG_CC_HAS_WORKING_NOSANITIZE_ADDRESS=y -# CONFIG_KASAN is not set -CONFIG_HAVE_ARCH_KFENCE=y -CONFIG_KFENCE=y -CONFIG_KFENCE_SAMPLE_INTERVAL=100 -CONFIG_KFENCE_NUM_OBJECTS=255 -# CONFIG_KFENCE_DEFERRABLE is not set -# CONFIG_KFENCE_STATIC_KEYS is not set -CONFIG_KFENCE_STRESS_TEST_FAULTS=0 -# end of Memory Debugging - -# CONFIG_DEBUG_SHIRQ is not set - -# Debug Oops, Lockups and Hangs -# CONFIG_PANIC_ON_OOPS is not set -CONFIG_PANIC_ON_OOPS_VALUE=0 -CONFIG_PANIC_TIMEOUT=0 -CONFIG_LOCKUP_DETECTOR=y -CONFIG_SOFTLOCKUP_DETECTOR=y -# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set -CONFIG_HAVE_HARDLOCKUP_DETECTOR_BUDDY=y -CONFIG_HARDLOCKUP_DETECTOR=y -# CONFIG_HARDLOCKUP_DETECTOR_PREFER_BUDDY is not set -CONFIG_HARDLOCKUP_DETECTOR_PERF=y -# CONFIG_HARDLOCKUP_DETECTOR_BUDDY is not set -# CONFIG_HARDLOCKUP_DETECTOR_ARCH is not set -CONFIG_HARDLOCKUP_DETECTOR_COUNTS_HRTIMER=y -CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y -CONFIG_DETECT_HUNG_TASK=y -CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=0 -# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set -# CONFIG_WQ_WATCHDOG is not set -# CONFIG_WQ_CPU_INTENSIVE_REPORT is not set -# CONFIG_TEST_LOCKUP is not set -# end of Debug Oops, Lockups and Hangs - -# Scheduler Debugging -CONFIG_SCHED_DEBUG=y -CONFIG_SCHED_INFO=y -CONFIG_SCHEDSTATS=y -# end of Scheduler Debugging - -# CONFIG_DEBUG_PREEMPT is not set - -# Lock Debugging (spinlocks, mutexes, etc...) -CONFIG_LOCK_DEBUGGING_SUPPORT=y -# CONFIG_PROVE_LOCKING is not set -# CONFIG_LOCK_STAT is not set -# CONFIG_DEBUG_RT_MUTEXES is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_MUTEXES is not set -# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set -# CONFIG_DEBUG_RWSEMS is not set -# CONFIG_DEBUG_LOCK_ALLOC is not set -# CONFIG_DEBUG_ATOMIC_SLEEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -# CONFIG_LOCK_TORTURE_TEST is not set -# CONFIG_WW_MUTEX_SELFTEST is not set -# CONFIG_SCF_TORTURE_TEST is not set -# CONFIG_CSD_LOCK_WAIT_DEBUG is not set -# end of Lock Debugging (spinlocks, mutexes, etc...) - -# CONFIG_DEBUG_IRQFLAGS is not set -CONFIG_STACKTRACE=y -# CONFIG_DEBUG_KOBJECT is not set - -# Debug kernel data structures -# CONFIG_DEBUG_LIST is not set -# CONFIG_DEBUG_PLIST is not set -# CONFIG_DEBUG_SG is not set -# CONFIG_DEBUG_NOTIFIERS is not set -# CONFIG_DEBUG_MAPLE_TREE is not set -# end of Debug kernel data structures - -# RCU Debugging -# CONFIG_RCU_SCALE_TEST is not set -# CONFIG_RCU_TORTURE_TEST is not set -# CONFIG_RCU_REF_SCALE_TEST is not set -CONFIG_RCU_CPU_STALL_TIMEOUT=60 -CONFIG_RCU_EXP_CPU_STALL_TIMEOUT=0 -# CONFIG_RCU_CPU_STALL_CPUTIME is not set -# CONFIG_RCU_TRACE is not set -# CONFIG_RCU_EQS_DEBUG is not set -# end of RCU Debugging - -# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set -# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set -CONFIG_LATENCYTOP=y -# CONFIG_DEBUG_CGROUP_REF is not set -CONFIG_USER_STACKTRACE_SUPPORT=y -CONFIG_NOP_TRACER=y -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_GRAPH_FREGS=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y -CONFIG_HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS=y -CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_HAVE_BUILDTIME_MCOUNT_SORT=y -CONFIG_BUILDTIME_MCOUNT_SORT=y -CONFIG_TRACE_CLOCK=y -CONFIG_RING_BUFFER=y -CONFIG_EVENT_TRACING=y -CONFIG_CONTEXT_SWITCH_TRACER=y -CONFIG_TRACING=y -CONFIG_GENERIC_TRACER=y -CONFIG_TRACING_SUPPORT=y -CONFIG_FTRACE=y -# CONFIG_BOOTTIME_TRACING is not set -CONFIG_FUNCTION_TRACER=y -CONFIG_FUNCTION_GRAPH_TRACER=y -CONFIG_FUNCTION_GRAPH_RETVAL=y -CONFIG_DYNAMIC_FTRACE=y -CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y -CONFIG_DYNAMIC_FTRACE_WITH_CALL_OPS=y -CONFIG_DYNAMIC_FTRACE_WITH_ARGS=y -# CONFIG_FUNCTION_PROFILER is not set -# CONFIG_STACK_TRACER is not set -# CONFIG_IRQSOFF_TRACER is not set -# CONFIG_PREEMPT_TRACER is not set -# CONFIG_SCHED_TRACER is not set -# CONFIG_HWLAT_TRACER is not set -# CONFIG_OSNOISE_TRACER is not set -# CONFIG_TIMERLAT_TRACER is not set -CONFIG_FTRACE_SYSCALLS=y -# CONFIG_TRACER_SNAPSHOT is not set -CONFIG_BRANCH_PROFILE_NONE=y -# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set -# CONFIG_PROFILE_ALL_BRANCHES is not set -CONFIG_BLK_DEV_IO_TRACE=y -CONFIG_PROBE_EVENTS_BTF_ARGS=y -CONFIG_KPROBE_EVENTS=y -# CONFIG_KPROBE_EVENTS_ON_NOTRACE is not set -CONFIG_UPROBE_EVENTS=y -CONFIG_BPF_EVENTS=y -CONFIG_DYNAMIC_EVENTS=y -CONFIG_PROBE_EVENTS=y -# CONFIG_BPF_KPROBE_OVERRIDE is not set -CONFIG_FTRACE_MCOUNT_RECORD=y -CONFIG_FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY=y -# CONFIG_SYNTH_EVENTS is not set -CONFIG_USER_EVENTS=y -# CONFIG_HIST_TRIGGERS is not set -# CONFIG_TRACE_EVENT_INJECT is not set -# CONFIG_TRACEPOINT_BENCHMARK is not set -# CONFIG_RING_BUFFER_BENCHMARK is not set -# CONFIG_TRACE_EVAL_MAP_FILE is not set -# CONFIG_FTRACE_RECORD_RECURSION is not set -# CONFIG_FTRACE_VALIDATE_RCU_IS_WATCHING is not set -# CONFIG_FTRACE_STARTUP_TEST is not set -# CONFIG_FTRACE_SORT_STARTUP_TEST is not set -# CONFIG_RING_BUFFER_STARTUP_TEST is not set -# CONFIG_RING_BUFFER_VALIDATE_TIME_DELTAS is not set -# CONFIG_PREEMPTIRQ_DELAY_TEST is not set -# CONFIG_KPROBE_EVENT_GEN_TEST is not set -# CONFIG_RV is not set -# CONFIG_SAMPLES is not set -CONFIG_HAVE_SAMPLE_FTRACE_DIRECT=y -CONFIG_HAVE_SAMPLE_FTRACE_DIRECT_MULTI=y -CONFIG_STRICT_DEVMEM=y -# CONFIG_IO_STRICT_DEVMEM is not set - -# arm64 Debugging -# CONFIG_PID_IN_CONTEXTIDR is not set -# CONFIG_DEBUG_EFI is not set -# CONFIG_ARM64_RELOC_TEST is not set -# CONFIG_CORESIGHT is not set -# end of arm64 Debugging - -# Kernel Testing and Coverage -# CONFIG_KUNIT is not set -# CONFIG_NOTIFIER_ERROR_INJECTION is not set -CONFIG_FUNCTION_ERROR_INJECTION=y -# CONFIG_FAULT_INJECTION is not set -CONFIG_ARCH_HAS_KCOV=y -CONFIG_CC_HAS_SANCOV_TRACE_PC=y -# CONFIG_KCOV is not set -CONFIG_RUNTIME_TESTING_MENU=y -# CONFIG_TEST_DHRY is not set -# CONFIG_LKDTM is not set -# CONFIG_TEST_MIN_HEAP is not set -# CONFIG_TEST_DIV64 is not set -# CONFIG_TEST_MULDIV64 is not set -# CONFIG_BACKTRACE_SELF_TEST is not set -# CONFIG_TEST_REF_TRACKER is not set -# CONFIG_RBTREE_TEST is not set -# CONFIG_REED_SOLOMON_TEST is not set -# CONFIG_INTERVAL_TREE_TEST is not set -# CONFIG_PERCPU_TEST is not set -# CONFIG_ATOMIC64_SELFTEST is not set -# CONFIG_ASYNC_RAID6_TEST is not set -# CONFIG_TEST_HEXDUMP is not set -# CONFIG_TEST_KSTRTOX is not set -# CONFIG_TEST_PRINTF is not set -# CONFIG_TEST_SCANF is not set -# CONFIG_TEST_BITMAP is not set -# CONFIG_TEST_UUID is not set -# CONFIG_TEST_XARRAY is not set -# CONFIG_TEST_MAPLE_TREE is not set -# CONFIG_TEST_RHASHTABLE is not set -# CONFIG_TEST_IDA is not set -# CONFIG_TEST_LKM is not set -# CONFIG_TEST_BITOPS is not set -# CONFIG_TEST_VMALLOC is not set -# CONFIG_TEST_BPF is not set -# CONFIG_TEST_BLACKHOLE_DEV is not set -# CONFIG_FIND_BIT_BENCHMARK is not set -# CONFIG_TEST_FIRMWARE is not set -# CONFIG_TEST_SYSCTL is not set -# CONFIG_TEST_UDELAY is not set -# CONFIG_TEST_STATIC_KEYS is not set -# CONFIG_TEST_DYNAMIC_DEBUG is not set -# CONFIG_TEST_KMOD is not set -# CONFIG_TEST_MEMCAT_P is not set -# CONFIG_TEST_MEMINIT is not set -# CONFIG_TEST_FREE_PAGES is not set -# CONFIG_TEST_FPU is not set -# CONFIG_TEST_OBJPOOL is not set -CONFIG_ARCH_USE_MEMTEST=y -CONFIG_MEMTEST=y -# end of Kernel Testing and Coverage - -# Rust hacking -# end of Rust hacking -# end of Kernel hacking diff --git a/SPECS/91/linux/config_x86_64 b/SPECS/91/linux/config_x86_64 deleted file mode 100644 index fab1bffe16..0000000000 --- a/SPECS/91/linux/config_x86_64 +++ /dev/null @@ -1,7105 +0,0 @@ -# -### Automatically generated file; DO NOT EDIT. -# -CONFIG_CC_VERSION_TEXT="gcc (GCC) 12.2.0" -CONFIG_CC_IS_GCC=y -CONFIG_GCC_VERSION=120200 -CONFIG_CLANG_VERSION=0 -CONFIG_AS_IS_GNU=y -CONFIG_AS_VERSION=23900 -CONFIG_LD_IS_BFD=y -CONFIG_LD_VERSION=23900 -CONFIG_LLD_VERSION=0 -CONFIG_RUSTC_VERSION=0 -CONFIG_RUSTC_LLVM_VERSION=0 -CONFIG_CC_CAN_LINK=y -CONFIG_CC_CAN_LINK_STATIC=y -CONFIG_GCC_ASM_GOTO_OUTPUT_BROKEN=y -CONFIG_TOOLS_SUPPORT_RELR=y -CONFIG_CC_HAS_ASM_INLINE=y -CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y -CONFIG_LD_CAN_USE_KEEP_IN_OVERLAY=y -CONFIG_PAHOLE_VERSION=124 -CONFIG_IRQ_WORK=y -CONFIG_BUILDTIME_TABLE_SORT=y -CONFIG_THREAD_INFO_IN_TASK=y - -# General setup -CONFIG_INIT_ENV_ARG_LIMIT=32 -# CONFIG_COMPILE_TEST is not set -CONFIG_WERROR=y -CONFIG_LOCALVERSION="" -# CONFIG_LOCALVERSION_AUTO is not set -CONFIG_BUILD_SALT="" -CONFIG_HAVE_KERNEL_GZIP=y -CONFIG_HAVE_KERNEL_BZIP2=y -CONFIG_HAVE_KERNEL_LZMA=y -CONFIG_HAVE_KERNEL_XZ=y -CONFIG_HAVE_KERNEL_LZO=y -CONFIG_HAVE_KERNEL_LZ4=y -CONFIG_HAVE_KERNEL_ZSTD=y -CONFIG_KERNEL_GZIP=y -# CONFIG_KERNEL_BZIP2 is not set -# CONFIG_KERNEL_LZMA is not set -# CONFIG_KERNEL_XZ is not set -# CONFIG_KERNEL_LZO is not set -# CONFIG_KERNEL_LZ4 is not set -# CONFIG_KERNEL_ZSTD is not set -CONFIG_DEFAULT_INIT="" -CONFIG_DEFAULT_HOSTNAME="" -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -CONFIG_SYSVIPC_COMPAT=y -CONFIG_POSIX_MQUEUE=y -CONFIG_POSIX_MQUEUE_SYSCTL=y -# CONFIG_WATCH_QUEUE is not set -CONFIG_CROSS_MEMORY_ATTACH=y -CONFIG_USELIB=y -CONFIG_AUDIT=y -CONFIG_HAVE_ARCH_AUDITSYSCALL=y -CONFIG_AUDITSYSCALL=y - -# IRQ subsystem -CONFIG_GENERIC_IRQ_PROBE=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y -CONFIG_GENERIC_PENDING_IRQ=y -CONFIG_GENERIC_IRQ_MIGRATION=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_GENERIC_MSI_IRQ=y -CONFIG_IRQ_MSI_IOMMU=y -CONFIG_GENERIC_IRQ_MATRIX_ALLOCATOR=y -CONFIG_GENERIC_IRQ_RESERVATION_MODE=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_SPARSE_IRQ=y -# CONFIG_GENERIC_IRQ_DEBUGFS is not set -# end of IRQ subsystem - -CONFIG_CLOCKSOURCE_WATCHDOG=y -CONFIG_ARCH_CLOCKSOURCE_INIT=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST_IDLE=y -CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y -CONFIG_GENERIC_CMOS_UPDATE=y -CONFIG_HAVE_POSIX_CPU_TIMERS_TASK_WORK=y -CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y -CONFIG_CONTEXT_TRACKING=y -CONFIG_CONTEXT_TRACKING_IDLE=y - -# Timers subsystem -CONFIG_TICK_ONESHOT=y -CONFIG_NO_HZ_COMMON=y -# CONFIG_HZ_PERIODIC is not set -CONFIG_NO_HZ_IDLE=y -# CONFIG_NO_HZ_FULL is not set -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y -CONFIG_CLOCKSOURCE_WATCHDOG_MAX_SKEW_US=100 -# end of Timers subsystem - -CONFIG_BPF=y -CONFIG_HAVE_EBPF_JIT=y -CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y - -# BPF subsystem -CONFIG_BPF_SYSCALL=y -CONFIG_BPF_JIT=y -# CONFIG_BPF_JIT_ALWAYS_ON is not set -CONFIG_BPF_JIT_DEFAULT_ON=y -CONFIG_BPF_UNPRIV_DEFAULT_OFF=y -# CONFIG_BPF_PRELOAD is not set -# CONFIG_BPF_LSM is not set -# end of BPF subsystem - -CONFIG_PREEMPT_NONE_BUILD=y -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -# CONFIG_PREEMPT_RT is not set -# CONFIG_PREEMPT_DYNAMIC is not set -CONFIG_SCHED_CORE=y -# CONFIG_SCHED_CLASS_EXT is not set - -# CPU/Task time and stats accounting -CONFIG_TICK_CPU_ACCOUNTING=y -# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set -# CONFIG_IRQ_TIME_ACCOUNTING is not set -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_BSD_PROCESS_ACCT_V3=y -CONFIG_TASKSTATS=y -CONFIG_TASK_DELAY_ACCT=y -CONFIG_TASK_XACCT=y -CONFIG_TASK_IO_ACCOUNTING=y -CONFIG_PSI=y -CONFIG_PSI_DEFAULT_DISABLED=y -# end of CPU/Task time and stats accounting - -CONFIG_CPU_ISOLATION=y - -# RCU Subsystem -CONFIG_TREE_RCU=y -# CONFIG_RCU_EXPERT is not set -CONFIG_TREE_SRCU=y -CONFIG_TASKS_RCU_GENERIC=y -CONFIG_NEED_TASKS_RCU=y -CONFIG_TASKS_RUDE_RCU=y -CONFIG_TASKS_TRACE_RCU=y -CONFIG_RCU_STALL_COMMON=y -CONFIG_RCU_NEED_SEGCBLIST=y -# end of RCU Subsystem - -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_IKHEADERS=m -CONFIG_LOG_BUF_SHIFT=18 -CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 -CONFIG_PRINTK_INDEX=y -CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y - -# Scheduler features -# CONFIG_UCLAMP_TASK is not set -# end of Scheduler features - -CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y -CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y -CONFIG_CC_HAS_INT128=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_GCC10_NO_ARRAY_BOUNDS=y -CONFIG_CC_NO_ARRAY_BOUNDS=y -CONFIG_GCC_NO_STRINGOP_OVERFLOW=y -CONFIG_CC_NO_STRINGOP_OVERFLOW=y -CONFIG_ARCH_SUPPORTS_INT128=y -# CONFIG_NUMA_BALANCING is not set -CONFIG_SLAB_OBJ_EXT=y -CONFIG_CGROUPS=y -CONFIG_PAGE_COUNTER=y -# CONFIG_CGROUP_FAVOR_DYNMODS is not set -CONFIG_MEMCG=y -CONFIG_MEMCG_V1=y -CONFIG_BLK_CGROUP=y -CONFIG_CGROUP_WRITEBACK=y -CONFIG_CGROUP_SCHED=y -CONFIG_GROUP_SCHED_WEIGHT=y -CONFIG_FAIR_GROUP_SCHED=y -CONFIG_CFS_BANDWIDTH=y -# CONFIG_RT_GROUP_SCHED is not set -CONFIG_SCHED_MM_CID=y -CONFIG_CGROUP_PIDS=y -CONFIG_CGROUP_RDMA=y -CONFIG_CGROUP_FREEZER=y -CONFIG_CGROUP_HUGETLB=y -CONFIG_CPUSETS=y -CONFIG_CPUSETS_V1=y -CONFIG_PROC_PID_CPUSET=y -CONFIG_CGROUP_DEVICE=y -CONFIG_CGROUP_CPUACCT=y -CONFIG_CGROUP_PERF=y -CONFIG_CGROUP_BPF=y -CONFIG_CGROUP_MISC=y -# CONFIG_CGROUP_DEBUG is not set -CONFIG_SOCK_CGROUP_DATA=y -CONFIG_NAMESPACES=y -CONFIG_UTS_NS=y -CONFIG_TIME_NS=y -CONFIG_IPC_NS=y -CONFIG_USER_NS=y -CONFIG_PID_NS=y -CONFIG_NET_NS=y -# CONFIG_CHECKPOINT_RESTORE is not set -# CONFIG_SCHED_AUTOGROUP is not set -CONFIG_RELAY=y -CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_RD_GZIP=y -CONFIG_RD_BZIP2=y -CONFIG_RD_LZMA=y -CONFIG_RD_XZ=y -CONFIG_RD_LZO=y -CONFIG_RD_LZ4=y -CONFIG_RD_ZSTD=y -# CONFIG_BOOT_CONFIG is not set -CONFIG_INITRAMFS_PRESERVE_MTIME=y -CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_LD_ORPHAN_WARN=y -CONFIG_LD_ORPHAN_WARN_LEVEL="error" -CONFIG_SYSCTL=y -CONFIG_HAVE_UID16=y -CONFIG_SYSCTL_EXCEPTION_TRACE=y -CONFIG_HAVE_PCSPKR_PLATFORM=y -CONFIG_EXPERT=y -# CONFIG_UID16 is not set -CONFIG_MULTIUSER=y -CONFIG_SGETMASK_SYSCALL=y -CONFIG_SYSFS_SYSCALL=y -CONFIG_FHANDLE=y -CONFIG_POSIX_TIMERS=y -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -# CONFIG_PCSPKR_PLATFORM is not set -# CONFIG_BASE_SMALL is not set -CONFIG_FUTEX=y -CONFIG_FUTEX_PI=y -CONFIG_EPOLL=y -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -CONFIG_SHMEM=y -CONFIG_AIO=y -CONFIG_IO_URING=y -CONFIG_ADVISE_SYSCALLS=y -CONFIG_MEMBARRIER=y -CONFIG_KCMP=y -CONFIG_RSEQ=y -# CONFIG_DEBUG_RSEQ is not set -CONFIG_CACHESTAT_SYSCALL=y -# CONFIG_PC104 is not set -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_SELFTEST is not set -CONFIG_KALLSYMS_ALL=y -CONFIG_KALLSYMS_ABSOLUTE_PERCPU=y -CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_GUEST_PERF_EVENTS=y - -# Kernel Performance Events And Counters -CONFIG_PERF_EVENTS=y -# CONFIG_DEBUG_PERF_USE_VMALLOC is not set -# end of Kernel Performance Events And Counters - -CONFIG_SYSTEM_DATA_VERIFICATION=y -CONFIG_PROFILING=y -CONFIG_TRACEPOINTS=y - -# Kexec and crash features -CONFIG_CRASH_RESERVE=y -CONFIG_VMCORE_INFO=y -CONFIG_KEXEC_CORE=y -CONFIG_HAVE_IMA_KEXEC=y -CONFIG_KEXEC=y -CONFIG_KEXEC_FILE=y -CONFIG_KEXEC_SIG=y -CONFIG_KEXEC_SIG_FORCE=y -CONFIG_KEXEC_BZIMAGE_VERIFY_SIG=y -CONFIG_CRASH_DUMP=y -CONFIG_CRASH_HOTPLUG=y -CONFIG_CRASH_MAX_MEMORY_RANGES=8192 -# end of Kexec and crash features -# end of General setup - -CONFIG_64BIT=y -CONFIG_X86_64=y -CONFIG_X86=y -CONFIG_INSTRUCTION_DECODER=y -CONFIG_OUTPUT_FORMAT="elf64-x86-64" -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_MMU=y -CONFIG_ARCH_MMAP_RND_BITS_MIN=28 -CONFIG_ARCH_MMAP_RND_BITS_MAX=32 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 -CONFIG_GENERIC_ISA_DMA=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y -CONFIG_ARCH_MAY_HAVE_PC_FDC=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_ARCH_HAS_CPU_RELAX=y -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_AUDIT_ARCH=y -CONFIG_HAVE_INTEL_TXT=y -CONFIG_X86_64_SMP=y -CONFIG_ARCH_SUPPORTS_UPROBES=y -CONFIG_FIX_EARLYCON_MEM=y -CONFIG_DYNAMIC_PHYSICAL_MASK=y -CONFIG_PGTABLE_LEVELS=5 -CONFIG_CC_HAS_SANE_STACKPROTECTOR=y - -# Processor type and features -CONFIG_SMP=y -CONFIG_X86_X2APIC=y -# CONFIG_X86_POSTED_MSI is not set -CONFIG_X86_MPPARSE=y -CONFIG_X86_CPU_RESCTRL=y -# CONFIG_X86_FRED is not set -CONFIG_X86_EXTENDED_PLATFORM=y -# CONFIG_X86_NUMACHIP is not set -# CONFIG_X86_VSMP is not set -# CONFIG_X86_UV is not set -# CONFIG_X86_GOLDFISH is not set -CONFIG_X86_INTEL_MID=y -CONFIG_X86_INTEL_LPSS=y -# CONFIG_X86_AMD_PLATFORM_DEVICE is not set -CONFIG_IOSF_MBI=y -# CONFIG_IOSF_MBI_DEBUG is not set -CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y -CONFIG_SCHED_OMIT_FRAME_POINTER=y -CONFIG_HYPERVISOR_GUEST=y -CONFIG_PARAVIRT=y -CONFIG_PARAVIRT_XXL=y -# CONFIG_PARAVIRT_DEBUG is not set -# CONFIG_PARAVIRT_SPINLOCKS is not set -CONFIG_X86_HV_CALLBACK_VECTOR=y -CONFIG_XEN=y -CONFIG_XEN_PV=y -CONFIG_XEN_512GB=y -CONFIG_XEN_PV_SMP=y -CONFIG_XEN_PV_DOM0=y -CONFIG_XEN_PVHVM=y -CONFIG_XEN_PVHVM_SMP=y -CONFIG_XEN_PVHVM_GUEST=y -CONFIG_XEN_SAVE_RESTORE=y -CONFIG_XEN_DEBUG_FS=y -# CONFIG_XEN_PVH is not set -CONFIG_XEN_DOM0=y -CONFIG_XEN_PV_MSR_SAFE=y -CONFIG_KVM_GUEST=y -CONFIG_ARCH_CPUIDLE_HALTPOLL=y -CONFIG_PVH=y -# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set -CONFIG_PARAVIRT_CLOCK=y -# CONFIG_JAILHOUSE_GUEST is not set -# CONFIG_ACRN_GUEST is not set -CONFIG_INTEL_TDX_GUEST=y -# CONFIG_MK8 is not set -# CONFIG_MPSC is not set -# CONFIG_MCORE2 is not set -# CONFIG_MATOM is not set -CONFIG_GENERIC_CPU=y -CONFIG_X86_INTERNODE_CACHE_SHIFT=6 -CONFIG_X86_L1_CACHE_SHIFT=6 -CONFIG_X86_TSC=y -CONFIG_X86_HAVE_PAE=y -CONFIG_X86_CMPXCHG64=y -CONFIG_X86_CMOV=y -CONFIG_X86_MINIMUM_CPU_FAMILY=64 -CONFIG_X86_DEBUGCTLMSR=y -CONFIG_IA32_FEAT_CTL=y -CONFIG_X86_VMX_FEATURE_NAMES=y -# CONFIG_PROCESSOR_SELECT is not set -CONFIG_CPU_SUP_INTEL=y -CONFIG_CPU_SUP_AMD=y -CONFIG_CPU_SUP_HYGON=y -CONFIG_CPU_SUP_CENTAUR=y -CONFIG_CPU_SUP_ZHAOXIN=y -CONFIG_HPET_TIMER=y -CONFIG_HPET_EMULATE_RTC=y -CONFIG_DMI=y -CONFIG_GART_IOMMU=y -CONFIG_BOOT_VESA_SUPPORT=y -CONFIG_MAXSMP=y -CONFIG_NR_CPUS_RANGE_BEGIN=8192 -CONFIG_NR_CPUS_RANGE_END=8192 -CONFIG_NR_CPUS_DEFAULT=8192 -CONFIG_NR_CPUS=8192 -CONFIG_SCHED_CLUSTER=y -CONFIG_SCHED_SMT=y -CONFIG_SCHED_MC=y -CONFIG_SCHED_MC_PRIO=y -CONFIG_X86_LOCAL_APIC=y -CONFIG_ACPI_MADT_WAKEUP=y -CONFIG_X86_IO_APIC=y -CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y -CONFIG_X86_MCE=y -# CONFIG_X86_MCELOG_LEGACY is not set -CONFIG_X86_MCE_INTEL=y -CONFIG_X86_MCE_AMD=y -CONFIG_X86_MCE_THRESHOLD=y -# CONFIG_X86_MCE_INJECT is not set - -# Performance monitoring -CONFIG_PERF_EVENTS_INTEL_UNCORE=y -CONFIG_PERF_EVENTS_INTEL_RAPL=y -CONFIG_PERF_EVENTS_INTEL_CSTATE=y -# CONFIG_PERF_EVENTS_AMD_POWER is not set -CONFIG_PERF_EVENTS_AMD_UNCORE=y -# CONFIG_PERF_EVENTS_AMD_BRS is not set -# end of Performance monitoring - -CONFIG_X86_VSYSCALL_EMULATION=y -CONFIG_X86_IOPL_IOPERM=y -CONFIG_MICROCODE=y -# CONFIG_MICROCODE_LATE_LOADING is not set -CONFIG_X86_MSR=m -CONFIG_X86_CPUID=m -CONFIG_X86_5LEVEL=y -CONFIG_X86_DIRECT_GBPAGES=y -# CONFIG_X86_CPA_STATISTICS is not set -CONFIG_X86_MEM_ENCRYPT=y -CONFIG_AMD_MEM_ENCRYPT=y -CONFIG_NUMA=y -CONFIG_AMD_NUMA=y -CONFIG_X86_64_ACPI_NUMA=y -CONFIG_NODES_SHIFT=10 -CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_ARCH_SPARSEMEM_DEFAULT=y -CONFIG_ARCH_MEMORY_PROBE=y -CONFIG_ARCH_PROC_KCORE_TEXT=y -CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 -CONFIG_X86_PMEM_LEGACY_DEVICE=y -CONFIG_X86_PMEM_LEGACY=y -CONFIG_X86_CHECK_BIOS_CORRUPTION=y -CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y -CONFIG_MTRR=y -CONFIG_MTRR_SANITIZER=y -CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0 -CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1 -CONFIG_X86_PAT=y -CONFIG_X86_UMIP=y -CONFIG_CC_HAS_IBT=y -# CONFIG_X86_KERNEL_IBT is not set -CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=y -CONFIG_ARCH_PKEY_BITS=4 -# CONFIG_X86_INTEL_TSX_MODE_OFF is not set -# CONFIG_X86_INTEL_TSX_MODE_ON is not set -CONFIG_X86_INTEL_TSX_MODE_AUTO=y -CONFIG_X86_SGX=y -# CONFIG_X86_USER_SHADOW_STACK is not set -CONFIG_EFI=y -CONFIG_EFI_STUB=y -CONFIG_EFI_HANDOVER_PROTOCOL=y -# CONFIG_EFI_MIXED is not set -CONFIG_EFI_RUNTIME_MAP=y -# CONFIG_HZ_100 is not set -CONFIG_HZ_250=y -# CONFIG_HZ_300 is not set -# CONFIG_HZ_1000 is not set -CONFIG_HZ=250 -CONFIG_SCHED_HRTICK=y -CONFIG_ARCH_SUPPORTS_KEXEC=y -CONFIG_ARCH_SUPPORTS_KEXEC_FILE=y -CONFIG_ARCH_SELECTS_KEXEC_FILE=y -CONFIG_ARCH_SUPPORTS_KEXEC_PURGATORY=y -CONFIG_ARCH_SUPPORTS_KEXEC_SIG=y -CONFIG_ARCH_SUPPORTS_KEXEC_SIG_FORCE=y -CONFIG_ARCH_SUPPORTS_KEXEC_BZIMAGE_VERIFY_SIG=y -CONFIG_ARCH_SUPPORTS_KEXEC_JUMP=y -CONFIG_ARCH_SUPPORTS_CRASH_DUMP=y -CONFIG_ARCH_DEFAULT_CRASH_DUMP=y -CONFIG_ARCH_SUPPORTS_CRASH_HOTPLUG=y -CONFIG_ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION=y -CONFIG_PHYSICAL_START=0x1000000 -CONFIG_RELOCATABLE=y -CONFIG_RANDOMIZE_BASE=y -CONFIG_X86_NEED_RELOCS=y -CONFIG_PHYSICAL_ALIGN=0x1000000 -CONFIG_DYNAMIC_MEMORY_LAYOUT=y -CONFIG_RANDOMIZE_MEMORY=y -CONFIG_RANDOMIZE_MEMORY_PHYSICAL_PADDING=0xa -CONFIG_HOTPLUG_CPU=y -# CONFIG_COMPAT_VDSO is not set -CONFIG_LEGACY_VSYSCALL_XONLY=y -# CONFIG_LEGACY_VSYSCALL_NONE is not set -# CONFIG_CMDLINE_BOOL is not set -# CONFIG_MODIFY_LDT_SYSCALL is not set -# CONFIG_STRICT_SIGALTSTACK_SIZE is not set -CONFIG_HAVE_LIVEPATCH=y -CONFIG_LIVEPATCH=y -# end of Processor type and features - -CONFIG_CC_HAS_NAMED_AS=y -CONFIG_CC_HAS_NAMED_AS_FIXED_SANITIZERS=y -CONFIG_USE_X86_SEG_SUPPORT=y -CONFIG_CC_HAS_SLS=y -CONFIG_CC_HAS_RETURN_THUNK=y -CONFIG_CC_HAS_ENTRY_PADDING=y -CONFIG_FUNCTION_PADDING_CFI=11 -CONFIG_FUNCTION_PADDING_BYTES=11 -CONFIG_CALL_PADDING=y -CONFIG_HAVE_CALL_THUNKS=y -CONFIG_CALL_THUNKS=y -CONFIG_CPU_MITIGATIONS=y -CONFIG_MITIGATION_PAGE_TABLE_ISOLATION=y -CONFIG_MITIGATION_RETPOLINE=y -CONFIG_MITIGATION_RETHUNK=y -CONFIG_MITIGATION_UNRET_ENTRY=y -CONFIG_MITIGATION_CALL_DEPTH_TRACKING=y -# CONFIG_CALL_THUNKS_DEBUG is not set -CONFIG_MITIGATION_IBPB_ENTRY=y -CONFIG_MITIGATION_IBRS_ENTRY=y -CONFIG_MITIGATION_SRSO=y -CONFIG_MITIGATION_SLS=y -CONFIG_MITIGATION_GDS=y -CONFIG_MITIGATION_RFDS=y -CONFIG_MITIGATION_SPECTRE_BHI=y -CONFIG_MITIGATION_MDS=y -CONFIG_MITIGATION_TAA=y -CONFIG_MITIGATION_MMIO_STALE_DATA=y -CONFIG_MITIGATION_L1TF=y -CONFIG_MITIGATION_RETBLEED=y -CONFIG_MITIGATION_SPECTRE_V1=y -CONFIG_MITIGATION_SPECTRE_V2=y -CONFIG_MITIGATION_SRBDS=y -CONFIG_MITIGATION_SSB=y -CONFIG_MITIGATION_ITS=y -CONFIG_MITIGATION_TSA=y -CONFIG_MITIGATION_VMSCAPE=y -CONFIG_ARCH_HAS_ADD_PAGES=y - -# Power management and ACPI options -CONFIG_SUSPEND=y -CONFIG_SUSPEND_FREEZER=y -# CONFIG_SUSPEND_SKIP_SYNC is not set -CONFIG_HIBERNATE_CALLBACKS=y -# CONFIG_HIBERNATION is not set -CONFIG_PM_SLEEP=y -CONFIG_PM_SLEEP_SMP=y -# CONFIG_PM_AUTOSLEEP is not set -# CONFIG_PM_USERSPACE_AUTOSLEEP is not set -# CONFIG_PM_WAKELOCKS is not set -CONFIG_PM=y -# CONFIG_PM_DEBUG is not set -CONFIG_PM_CLK=y -# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set -CONFIG_ENERGY_MODEL=y -CONFIG_ARCH_SUPPORTS_ACPI=y -CONFIG_ACPI=y -CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y -CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y -CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y -CONFIG_ACPI_THERMAL_LIB=y -# CONFIG_ACPI_DEBUGGER is not set -CONFIG_ACPI_SPCR_TABLE=y -# CONFIG_ACPI_FPDT is not set -CONFIG_ACPI_LPIT=y -CONFIG_ACPI_SLEEP=y -CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y -# CONFIG_ACPI_EC_DEBUGFS is not set -CONFIG_ACPI_AC=m -CONFIG_ACPI_BATTERY=m -CONFIG_ACPI_BUTTON=m -# CONFIG_ACPI_TINY_POWER_BUTTON is not set -CONFIG_ACPI_VIDEO=m -CONFIG_ACPI_FAN=m -# CONFIG_ACPI_TAD is not set -# CONFIG_ACPI_DOCK is not set -CONFIG_ACPI_CPU_FREQ_PSS=y -CONFIG_ACPI_PROCESSOR_CSTATE=y -CONFIG_ACPI_PROCESSOR_IDLE=y -CONFIG_ACPI_CPPC_LIB=y -CONFIG_ACPI_PROCESSOR=y -CONFIG_ACPI_IPMI=m -CONFIG_ACPI_HOTPLUG_CPU=y -CONFIG_ACPI_PROCESSOR_AGGREGATOR=m -CONFIG_ACPI_THERMAL=m -CONFIG_ACPI_PLATFORM_PROFILE=m -CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y -CONFIG_ACPI_TABLE_UPGRADE=y -# CONFIG_ACPI_DEBUG is not set -CONFIG_ACPI_PCI_SLOT=y -CONFIG_ACPI_CONTAINER=y -CONFIG_ACPI_HOTPLUG_MEMORY=y -CONFIG_ACPI_HOTPLUG_IOAPIC=y -# CONFIG_ACPI_SBS is not set -CONFIG_ACPI_HED=y -# CONFIG_ACPI_BGRT is not set -# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set -CONFIG_ACPI_NHLT=y -CONFIG_ACPI_NFIT=m -# CONFIG_NFIT_SECURITY_DEBUG is not set -CONFIG_ACPI_NUMA=y -# CONFIG_ACPI_HMAT is not set -CONFIG_HAVE_ACPI_APEI=y -CONFIG_HAVE_ACPI_APEI_NMI=y -CONFIG_ACPI_APEI=y -CONFIG_ACPI_APEI_GHES=y -CONFIG_ACPI_APEI_PCIEAER=y -CONFIG_ACPI_APEI_MEMORY_FAILURE=y -# CONFIG_ACPI_APEI_EINJ is not set -CONFIG_ACPI_APEI_ERST_DEBUG=m -CONFIG_ACPI_DPTF=y -# CONFIG_DPTF_POWER is not set -CONFIG_DPTF_PCH_FIVR=m -CONFIG_ACPI_WATCHDOG=y -# CONFIG_ACPI_EXTLOG is not set -CONFIG_ACPI_ADXL=y -CONFIG_ACPI_CONFIGFS=m -# CONFIG_ACPI_PFRUT is not set -CONFIG_ACPI_PCC=y -# CONFIG_ACPI_FFH is not set -CONFIG_PMIC_OPREGION=y -CONFIG_ACPI_PRMT=y -CONFIG_X86_PM_TIMER=y - -# CPU Frequency scaling -CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_GOV_ATTR_SET=y -CONFIG_CPU_FREQ_GOV_COMMON=y -CONFIG_CPU_FREQ_STAT=y -CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set -CONFIG_CPU_FREQ_GOV_PERFORMANCE=y -CONFIG_CPU_FREQ_GOV_POWERSAVE=m -CONFIG_CPU_FREQ_GOV_USERSPACE=m -CONFIG_CPU_FREQ_GOV_ONDEMAND=m -CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m -CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y - -## CPU frequency scaling drivers -CONFIG_X86_INTEL_PSTATE=y -CONFIG_X86_PCC_CPUFREQ=m -CONFIG_X86_AMD_PSTATE=y -CONFIG_X86_AMD_PSTATE_DEFAULT_MODE=3 -# CONFIG_X86_AMD_PSTATE_UT is not set -CONFIG_X86_ACPI_CPUFREQ=m -# CONFIG_X86_ACPI_CPUFREQ_CPB is not set -# CONFIG_X86_POWERNOW_K8 is not set -CONFIG_X86_AMD_FREQ_SENSITIVITY=m -# CONFIG_X86_SPEEDSTEP_CENTRINO is not set -# CONFIG_X86_P4_CLOCKMOD is not set - -## shared options -# end of CPU Frequency scaling - -# CPU Idle -CONFIG_CPU_IDLE=y -CONFIG_CPU_IDLE_GOV_LADDER=y -CONFIG_CPU_IDLE_GOV_MENU=y -CONFIG_CPU_IDLE_GOV_TEO=y -CONFIG_CPU_IDLE_GOV_HALTPOLL=y -CONFIG_HALTPOLL_CPUIDLE=m -# end of CPU Idle - -CONFIG_INTEL_IDLE=y -# end of Power management and ACPI options - -# Bus options (PCI etc.) -CONFIG_PCI_DIRECT=y -CONFIG_PCI_MMCONFIG=y -CONFIG_PCI_XEN=y -CONFIG_MMCONF_FAM10H=y -# CONFIG_PCI_CNB20LE_QUIRK is not set -# CONFIG_ISA_BUS is not set -CONFIG_ISA_DMA_API=y -CONFIG_AMD_NB=y -# end of Bus options (PCI etc.) - -# Binary Emulations -CONFIG_IA32_EMULATION=y -# CONFIG_IA32_EMULATION_DEFAULT_DISABLED is not set -# CONFIG_X86_X32_ABI is not set -CONFIG_COMPAT_32=y -CONFIG_COMPAT=y -CONFIG_COMPAT_FOR_U64_ALIGNMENT=y -# end of Binary Emulations - -CONFIG_KVM_COMMON=y -CONFIG_HAVE_KVM_PFNCACHE=y -CONFIG_HAVE_KVM_IRQCHIP=y -CONFIG_HAVE_KVM_IRQ_ROUTING=y -CONFIG_HAVE_KVM_DIRTY_RING=y -CONFIG_HAVE_KVM_DIRTY_RING_TSO=y -CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL=y -CONFIG_KVM_MMIO=y -CONFIG_KVM_ASYNC_PF=y -CONFIG_HAVE_KVM_MSI=y -CONFIG_HAVE_KVM_READONLY_MEM=y -CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y -CONFIG_KVM_VFIO=y -CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y -CONFIG_KVM_GENERIC_PRE_FAULT_MEMORY=y -CONFIG_KVM_COMPAT=y -CONFIG_HAVE_KVM_IRQ_BYPASS=m -CONFIG_HAVE_KVM_NO_POLL=y -CONFIG_KVM_XFER_TO_GUEST_WORK=y -CONFIG_HAVE_KVM_PM_NOTIFIER=y -CONFIG_KVM_GENERIC_HARDWARE_ENABLING=y -CONFIG_KVM_GENERIC_MMU_NOTIFIER=y -CONFIG_VIRTUALIZATION=y -CONFIG_KVM_X86=m -CONFIG_KVM=m -CONFIG_KVM_WERROR=y -# CONFIG_KVM_SW_PROTECTED_VM is not set -CONFIG_KVM_INTEL=m -# CONFIG_KVM_INTEL_PROVE_VE is not set -# CONFIG_X86_SGX_KVM is not set -CONFIG_KVM_AMD=m -CONFIG_KVM_SMM=y -CONFIG_KVM_HYPERV=y -# CONFIG_KVM_XEN is not set -# CONFIG_KVM_PROVE_MMU is not set -CONFIG_KVM_MAX_NR_VCPUS=4096 -CONFIG_AS_AVX512=y -CONFIG_AS_SHA1_NI=y -CONFIG_AS_SHA256_NI=y -CONFIG_AS_TPAUSE=y -CONFIG_AS_GFNI=y -CONFIG_AS_VAES=y -CONFIG_AS_VPCLMULQDQ=y -CONFIG_AS_WRUSS=y -CONFIG_ARCH_CONFIGURES_CPU_MITIGATIONS=y -CONFIG_ARCH_HAS_DMA_OPS=y - -# General architecture-dependent options -CONFIG_HOTPLUG_SMT=y -CONFIG_HOTPLUG_CORE_SYNC=y -CONFIG_HOTPLUG_CORE_SYNC_DEAD=y -CONFIG_HOTPLUG_CORE_SYNC_FULL=y -CONFIG_HOTPLUG_SPLIT_STARTUP=y -CONFIG_HOTPLUG_PARALLEL=y -CONFIG_GENERIC_ENTRY=y -CONFIG_KPROBES=y -CONFIG_JUMP_LABEL=y -# CONFIG_STATIC_KEYS_SELFTEST is not set -# CONFIG_STATIC_CALL_SELFTEST is not set -CONFIG_OPTPROBES=y -CONFIG_KPROBES_ON_FTRACE=y -CONFIG_UPROBES=y -CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_KRETPROBES=y -CONFIG_KRETPROBE_ON_RETHOOK=y -CONFIG_USER_RETURN_NOTIFIER=y -CONFIG_HAVE_IOREMAP_PROT=y -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_HAVE_OPTPROBES=y -CONFIG_HAVE_KPROBES_ON_FTRACE=y -CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y -CONFIG_HAVE_FUNCTION_ERROR_INJECTION=y -CONFIG_HAVE_NMI=y -CONFIG_TRACE_IRQFLAGS_SUPPORT=y -CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_ARCH_HAS_FORTIFY_SOURCE=y -CONFIG_ARCH_HAS_SET_MEMORY=y -CONFIG_ARCH_HAS_SET_DIRECT_MAP=y -CONFIG_ARCH_HAS_CPU_FINALIZE_INIT=y -CONFIG_ARCH_HAS_CPU_PASID=y -CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y -CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y -CONFIG_ARCH_WANTS_NO_INSTR=y -CONFIG_HAVE_ASM_MODVERSIONS=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_RSEQ=y -CONFIG_HAVE_RUST=y -CONFIG_HAVE_FUNCTION_ARG_ACCESS_API=y -CONFIG_HAVE_HW_BREAKPOINT=y -CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y -CONFIG_HAVE_USER_RETURN_NOTIFIER=y -CONFIG_HAVE_PERF_EVENTS_NMI=y -CONFIG_HAVE_HARDLOCKUP_DETECTOR_PERF=y -CONFIG_HAVE_PERF_REGS=y -CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y -CONFIG_MMU_GATHER_TABLE_FREE=y -CONFIG_MMU_GATHER_RCU_TABLE_FREE=y -CONFIG_MMU_GATHER_MERGE_VMAS=y -CONFIG_MMU_LAZY_TLB_REFCOUNT=y -CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y -CONFIG_ARCH_HAVE_EXTRA_ELF_NOTES=y -CONFIG_ARCH_HAS_NMI_SAFE_THIS_CPU_OPS=y -CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y -CONFIG_HAVE_CMPXCHG_LOCAL=y -CONFIG_HAVE_CMPXCHG_DOUBLE=y -CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y -CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y -CONFIG_HAVE_ARCH_SECCOMP=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_SECCOMP=y -CONFIG_SECCOMP_FILTER=y -# CONFIG_SECCOMP_CACHE_DEBUG is not set -CONFIG_HAVE_ARCH_STACKLEAK=y -CONFIG_HAVE_STACKPROTECTOR=y -CONFIG_STACKPROTECTOR=y -CONFIG_STACKPROTECTOR_STRONG=y -CONFIG_ARCH_SUPPORTS_LTO_CLANG=y -CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN=y -CONFIG_LTO_NONE=y -CONFIG_ARCH_SUPPORTS_CFI_CLANG=y -CONFIG_ARCH_USES_CFI_TRAPS=y -CONFIG_CFI_CLANG=y -# CONFIG_CFI_PERMISSIVE is not set -CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES=y -CONFIG_HAVE_CONTEXT_TRACKING_USER=y -CONFIG_HAVE_CONTEXT_TRACKING_USER_OFFSTACK=y -CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_MOVE_PUD=y -CONFIG_HAVE_MOVE_PMD=y -CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y -CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y -CONFIG_HAVE_ARCH_HUGE_VMAP=y -CONFIG_HAVE_ARCH_HUGE_VMALLOC=y -CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y -CONFIG_ARCH_WANT_PMD_MKWRITE=y -CONFIG_HAVE_ARCH_SOFT_DIRTY=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_MODULES_USE_ELF_RELA=y -CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y -CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK=y -CONFIG_SOFTIRQ_ON_OWN_STACK=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -CONFIG_HAVE_ARCH_MMAP_RND_BITS=y -CONFIG_HAVE_EXIT_THREAD=y -CONFIG_ARCH_MMAP_RND_BITS=28 -CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y -CONFIG_ARCH_MMAP_RND_COMPAT_BITS=8 -CONFIG_HAVE_ARCH_COMPAT_MMAP_BASES=y -CONFIG_HAVE_PAGE_SIZE_4KB=y -CONFIG_PAGE_SIZE_4KB=y -CONFIG_PAGE_SIZE_LESS_THAN_64KB=y -CONFIG_PAGE_SIZE_LESS_THAN_256KB=y -CONFIG_PAGE_SHIFT=12 -CONFIG_HAVE_OBJTOOL=y -CONFIG_HAVE_JUMP_LABEL_HACK=y -CONFIG_HAVE_NOINSTR_HACK=y -CONFIG_HAVE_NOINSTR_VALIDATION=y -CONFIG_HAVE_UACCESS_VALIDATION=y -CONFIG_HAVE_STACK_VALIDATION=y -CONFIG_HAVE_RELIABLE_STACKTRACE=y -CONFIG_OLD_SIGSUSPEND3=y -CONFIG_COMPAT_OLD_SIGACTION=y -CONFIG_COMPAT_32BIT_TIME=y -CONFIG_ARCH_SUPPORTS_RT=y -CONFIG_HAVE_ARCH_VMAP_STACK=y -CONFIG_VMAP_STACK=y -CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET=y -CONFIG_RANDOMIZE_KSTACK_OFFSET=y -CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT=y -CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y -CONFIG_STRICT_KERNEL_RWX=y -CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y -CONFIG_STRICT_MODULE_RWX=y -CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y -CONFIG_ARCH_USE_MEMREMAP_PROT=y -# CONFIG_LOCK_EVENT_COUNTS is not set -CONFIG_ARCH_HAS_MEM_ENCRYPT=y -CONFIG_ARCH_HAS_CC_PLATFORM=y -CONFIG_HAVE_STATIC_CALL=y -CONFIG_HAVE_STATIC_CALL_INLINE=y -CONFIG_HAVE_PREEMPT_DYNAMIC=y -CONFIG_HAVE_PREEMPT_DYNAMIC_CALL=y -CONFIG_ARCH_WANT_LD_ORPHAN_WARN=y -CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y -CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK=y -CONFIG_ARCH_HAS_ELFCORE_COMPAT=y -CONFIG_ARCH_HAS_PARANOID_L1D_FLUSH=y -CONFIG_DYNAMIC_SIGFRAME=y -CONFIG_HAVE_ARCH_NODE_DEV_GROUP=y -CONFIG_ARCH_HAS_HW_PTE_YOUNG=y -CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG=y -CONFIG_ARCH_HAS_KERNEL_FPU_SUPPORT=y - -# GCOV-based kernel profiling -# CONFIG_GCOV_KERNEL is not set -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -# end of GCOV-based kernel profiling - -CONFIG_HAVE_GCC_PLUGINS=y -CONFIG_GCC_PLUGINS=y -# CONFIG_GCC_PLUGIN_LATENT_ENTROPY is not set -# CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS is not set -# CONFIG_GCC_PLUGIN_PAD_CANISTER_STRUCTS is not set -CONFIG_FUNCTION_ALIGNMENT_4B=y -CONFIG_FUNCTION_ALIGNMENT_16B=y -CONFIG_FUNCTION_ALIGNMENT=16 -CONFIG_HAVE_ARCH_GET_SECUREBOOT=y -# end of General architecture-dependent options - -CONFIG_RT_MUTEXES=y -CONFIG_MODULE_SIG_FORMAT=y -CONFIG_MODULES=y -# CONFIG_MODULE_DEBUG is not set -CONFIG_MODULE_FORCE_LOAD=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -# CONFIG_MODULE_UNLOAD_TAINT_TRACKING is not set -CONFIG_MODVERSIONS=y -CONFIG_ASM_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -CONFIG_MODULE_SIG=y -# CONFIG_MODULE_SIG_FORCE is not set -# CONFIG_MODULE_SIG_ALL is not set -# CONFIG_MODULE_SIG_SHA1 is not set -# CONFIG_MODULE_SIG_SHA256 is not set -# CONFIG_MODULE_SIG_SHA384 is not set -# CONFIG_MODULE_SIG_SHA512 is not set -# CONFIG_MODULE_SIG_SHA3_256 is not set -# CONFIG_MODULE_SIG_SHA3_384 is not set -CONFIG_MODULE_SIG_SHA3_512=y -CONFIG_MODULE_SIG_HASH="sha3-512" -# CONFIG_MODULE_COMPRESS is not set -# CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is not set -CONFIG_MODPROBE_PATH="/sbin/modprobe" -# CONFIG_TRIM_UNUSED_KSYMS is not set -CONFIG_MODULES_TREE_LOOKUP=y -CONFIG_BLOCK=y -CONFIG_BLOCK_LEGACY_AUTOLOAD=y -CONFIG_BLK_CGROUP_RWSTAT=y -CONFIG_BLK_CGROUP_PUNT_BIO=y -CONFIG_BLK_DEV_BSG_COMMON=y -CONFIG_BLK_ICQ=y -CONFIG_BLK_DEV_BSGLIB=y -CONFIG_BLK_DEV_INTEGRITY=y -CONFIG_BLK_DEV_WRITE_MOUNTED=y -CONFIG_BLK_DEV_ZONED=y -CONFIG_BLK_DEV_THROTTLING=y -# CONFIG_BLK_WBT is not set -# CONFIG_BLK_CGROUP_IOLATENCY is not set -# CONFIG_BLK_CGROUP_IOCOST is not set -# CONFIG_BLK_CGROUP_IOPRIO is not set -CONFIG_BLK_DEBUG_FS=y -# CONFIG_BLK_SED_OPAL is not set -# CONFIG_BLK_INLINE_ENCRYPTION is not set - -# Partition Types -CONFIG_PARTITION_ADVANCED=y -# CONFIG_ACORN_PARTITION is not set -# CONFIG_AIX_PARTITION is not set -# CONFIG_OSF_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set -# CONFIG_ATARI_PARTITION is not set -# CONFIG_MAC_PARTITION is not set -CONFIG_MSDOS_PARTITION=y -CONFIG_BSD_DISKLABEL=y -CONFIG_MINIX_SUBPARTITION=y -CONFIG_SOLARIS_X86_PARTITION=y -CONFIG_UNIXWARE_DISKLABEL=y -# CONFIG_LDM_PARTITION is not set -# CONFIG_SGI_PARTITION is not set -# CONFIG_ULTRIX_PARTITION is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_KARMA_PARTITION is not set -CONFIG_EFI_PARTITION=y -# CONFIG_SYSV68_PARTITION is not set -# CONFIG_CMDLINE_PARTITION is not set -# end of Partition Types - -CONFIG_BLK_MQ_PCI=y -CONFIG_BLK_MQ_VIRTIO=y -CONFIG_BLK_PM=y -CONFIG_BLOCK_HOLDER_DEPRECATED=y -CONFIG_BLK_MQ_STACKING=y - -# IO Schedulers -CONFIG_MQ_IOSCHED_DEADLINE=y -CONFIG_MQ_IOSCHED_KYBER=y -CONFIG_IOSCHED_BFQ=y -CONFIG_BFQ_GROUP_IOSCHED=y -# CONFIG_BFQ_CGROUP_DEBUG is not set -# end of IO Schedulers - -CONFIG_PREEMPT_NOTIFIERS=y -CONFIG_PADATA=y -CONFIG_ASN1=y -CONFIG_INLINE_SPIN_UNLOCK_IRQ=y -CONFIG_INLINE_READ_UNLOCK=y -CONFIG_INLINE_READ_UNLOCK_IRQ=y -CONFIG_INLINE_WRITE_UNLOCK=y -CONFIG_INLINE_WRITE_UNLOCK_IRQ=y -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -CONFIG_MUTEX_SPIN_ON_OWNER=y -CONFIG_RWSEM_SPIN_ON_OWNER=y -CONFIG_LOCK_SPIN_ON_OWNER=y -CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y -CONFIG_QUEUED_SPINLOCKS=y -CONFIG_ARCH_USE_QUEUED_RWLOCKS=y -CONFIG_QUEUED_RWLOCKS=y -CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE=y -CONFIG_ARCH_HAS_SYNC_CORE_BEFORE_USERMODE=y -CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y -CONFIG_FREEZER=y - -# Executable file formats -CONFIG_BINFMT_ELF=y -CONFIG_COMPAT_BINFMT_ELF=y -CONFIG_ELFCORE=y -CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y -CONFIG_BINFMT_SCRIPT=y -CONFIG_BINFMT_MISC=m -CONFIG_COREDUMP=y -# end of Executable file formats - -# Memory Management options -CONFIG_ZPOOL=y -CONFIG_SWAP=y -CONFIG_ZSWAP=y -# CONFIG_ZSWAP_DEFAULT_ON is not set -# CONFIG_ZSWAP_SHRINKER_DEFAULT_ON is not set -# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_DEFLATE is not set -CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZO=y -# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_842 is not set -# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4 is not set -# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4HC is not set -# CONFIG_ZSWAP_COMPRESSOR_DEFAULT_ZSTD is not set -CONFIG_ZSWAP_COMPRESSOR_DEFAULT="lzo" -CONFIG_ZSWAP_ZPOOL_DEFAULT_ZBUD=y -# CONFIG_ZSWAP_ZPOOL_DEFAULT_Z3FOLD_DEPRECATED is not set -# CONFIG_ZSWAP_ZPOOL_DEFAULT_ZSMALLOC is not set -CONFIG_ZSWAP_ZPOOL_DEFAULT="zbud" -CONFIG_ZBUD=y -# CONFIG_Z3FOLD_DEPRECATED is not set -CONFIG_ZSMALLOC=m -# CONFIG_ZSMALLOC_STAT is not set -CONFIG_ZSMALLOC_CHAIN_SIZE=8 - -# Slab allocator options -CONFIG_SLUB=y -# CONFIG_SLUB_TINY is not set -# CONFIG_SLAB_MERGE_DEFAULT is not set -CONFIG_SLAB_FREELIST_RANDOM=y -CONFIG_SLAB_FREELIST_HARDENED=y -CONFIG_SLAB_BUCKETS=y -# CONFIG_SLUB_STATS is not set -CONFIG_SLUB_CPU_PARTIAL=y -# CONFIG_RANDOM_KMALLOC_CACHES is not set -# end of Slab allocator options - -CONFIG_SHUFFLE_PAGE_ALLOCATOR=y -# CONFIG_COMPAT_BRK is not set -CONFIG_SPARSEMEM=y -CONFIG_SPARSEMEM_EXTREME=y -CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y -CONFIG_SPARSEMEM_VMEMMAP=y -CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP=y -CONFIG_ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP=y -CONFIG_HAVE_GUP_FAST=y -CONFIG_NUMA_KEEP_MEMINFO=y -CONFIG_MEMORY_ISOLATION=y -CONFIG_EXCLUSIVE_SYSTEM_RAM=y -CONFIG_HAVE_BOOTMEM_INFO_NODE=y -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y -CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y -CONFIG_MEMORY_HOTPLUG=y -# CONFIG_MHP_DEFAULT_ONLINE_TYPE_OFFLINE is not set -CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_AUTO=y -# CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_KERNEL is not set -# CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_MOVABLE is not set -CONFIG_MEMORY_HOTREMOVE=y -CONFIG_MHP_MEMMAP_ON_MEMORY=y -CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y -CONFIG_SPLIT_PTE_PTLOCKS=y -CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y -CONFIG_SPLIT_PMD_PTLOCKS=y -CONFIG_MEMORY_BALLOON=y -CONFIG_BALLOON_COMPACTION=y -CONFIG_COMPACTION=y -CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 -CONFIG_PAGE_REPORTING=y -CONFIG_MIGRATION=y -CONFIG_DEVICE_MIGRATION=y -CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y -CONFIG_ARCH_ENABLE_THP_MIGRATION=y -CONFIG_CONTIG_ALLOC=y -CONFIG_PCP_BATCH_SCALE_MAX=5 -CONFIG_PHYS_ADDR_T_64BIT=y -CONFIG_MMU_NOTIFIER=y -CONFIG_KSM=y -CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 -CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y -CONFIG_MEMORY_FAILURE=y -# CONFIG_HWPOISON_INJECT is not set -CONFIG_ARCH_WANT_GENERAL_HUGETLB=y -CONFIG_ARCH_WANTS_THP_SWAP=y -CONFIG_TRANSPARENT_HUGEPAGE=y -CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y -# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set -# CONFIG_TRANSPARENT_HUGEPAGE_NEVER is not set -CONFIG_THP_SWAP=y -# CONFIG_READ_ONLY_THP_FOR_FS is not set -CONFIG_PGTABLE_HAS_HUGE_LEAVES=y -CONFIG_ARCH_SUPPORTS_HUGE_PFNMAP=y -CONFIG_ARCH_SUPPORTS_PMD_PFNMAP=y -CONFIG_ARCH_SUPPORTS_PUD_PFNMAP=y -CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y -CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y -CONFIG_USE_PERCPU_NUMA_NODE_ID=y -CONFIG_HAVE_SETUP_PER_CPU_AREA=y -# CONFIG_CMA is not set -CONFIG_GENERIC_EARLY_IOREMAP=y -# CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set -CONFIG_PAGE_IDLE_FLAG=y -CONFIG_IDLE_PAGE_TRACKING=y -CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y -CONFIG_ARCH_HAS_CURRENT_STACK_POINTER=y -CONFIG_ARCH_HAS_PTE_DEVMAP=y -CONFIG_ARCH_HAS_ZONE_DMA_SET=y -CONFIG_ZONE_DMA=y -CONFIG_ZONE_DMA32=y -CONFIG_ZONE_DEVICE=y -CONFIG_HMM_MIRROR=y -# CONFIG_DEVICE_PRIVATE is not set -CONFIG_VMAP_PFN=y -CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y -CONFIG_ARCH_HAS_PKEYS=y -CONFIG_ARCH_USES_PG_ARCH_2=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_PERCPU_STATS=y -# CONFIG_GUP_TEST is not set -# CONFIG_DMAPOOL_TEST is not set -CONFIG_ARCH_HAS_PTE_SPECIAL=y -CONFIG_MAPPING_DIRTY_HELPERS=y -CONFIG_MEMFD_CREATE=y -CONFIG_SECRETMEM=y -# CONFIG_ANON_VMA_NAME is not set -CONFIG_HAVE_ARCH_USERFAULTFD_WP=y -CONFIG_HAVE_ARCH_USERFAULTFD_MINOR=y -CONFIG_USERFAULTFD=y -CONFIG_PTE_MARKER_UFFD_WP=y -CONFIG_LRU_GEN=y -# CONFIG_LRU_GEN_ENABLED is not set -# CONFIG_LRU_GEN_STATS is not set -CONFIG_LRU_GEN_WALKS_MMU=y -CONFIG_LOCK_MM_AND_FIND_VMA=y -CONFIG_IOMMU_MM_DATA=y -CONFIG_EXECMEM=y -CONFIG_NUMA_MEMBLKS=y -# CONFIG_NUMA_EMU is not set - -# Data Access Monitoring -# CONFIG_DAMON is not set -# end of Data Access Monitoring -# end of Memory Management options - -CONFIG_NET=y -CONFIG_COMPAT_NETLINK_MESSAGES=y -CONFIG_NET_INGRESS=y -CONFIG_NET_EGRESS=y -CONFIG_NET_XGRESS=y -CONFIG_NET_REDIRECT=y -CONFIG_SKB_DECRYPTED=y -CONFIG_SKB_EXTENSIONS=y -CONFIG_NET_DEVMEM=y - -# Networking options -CONFIG_PACKET=m -CONFIG_PACKET_DIAG=m -CONFIG_UNIX=y -CONFIG_AF_UNIX_OOB=y -CONFIG_UNIX_DIAG=m -CONFIG_TLS=m -CONFIG_TLS_DEVICE=y -CONFIG_TLS_TOE=y -CONFIG_XFRM=y -CONFIG_XFRM_ALGO=m -CONFIG_XFRM_USER=m -# CONFIG_XFRM_USER_COMPAT is not set -# CONFIG_XFRM_INTERFACE is not set -CONFIG_XFRM_SUB_POLICY=y -CONFIG_XFRM_MIGRATE=y -CONFIG_XFRM_STATISTICS=y -CONFIG_XFRM_AH=m -CONFIG_XFRM_ESP=m -CONFIG_XFRM_IPCOMP=m -CONFIG_NET_KEY=m -# CONFIG_NET_KEY_MIGRATE is not set -# CONFIG_SMC is not set -# CONFIG_XDP_SOCKETS is not set -CONFIG_NET_HANDSHAKE=y -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -CONFIG_IP_ADVANCED_ROUTER=y -CONFIG_IP_FIB_TRIE_STATS=y -CONFIG_IP_MULTIPLE_TABLES=y -CONFIG_IP_ROUTE_MULTIPATH=y -CONFIG_IP_ROUTE_VERBOSE=y -CONFIG_IP_ROUTE_CLASSID=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -CONFIG_IP_PNP_BOOTP=y -CONFIG_IP_PNP_RARP=y -CONFIG_NET_IPIP=m -CONFIG_NET_IPGRE_DEMUX=m -CONFIG_NET_IP_TUNNEL=m -CONFIG_NET_IPGRE=m -CONFIG_NET_IPGRE_BROADCAST=y -CONFIG_IP_MROUTE_COMMON=y -CONFIG_IP_MROUTE=y -CONFIG_IP_MROUTE_MULTIPLE_TABLES=y -CONFIG_IP_PIMSM_V1=y -CONFIG_IP_PIMSM_V2=y -CONFIG_SYN_COOKIES=y -CONFIG_NET_IPVTI=m -CONFIG_NET_UDP_TUNNEL=m -CONFIG_NET_FOU=m -CONFIG_NET_FOU_IP_TUNNELS=y -CONFIG_INET_AH=m -CONFIG_INET_ESP=m -# CONFIG_INET_ESP_OFFLOAD is not set -# CONFIG_INET_ESPINTCP is not set -CONFIG_INET_IPCOMP=m -CONFIG_INET_TABLE_PERTURB_ORDER=16 -CONFIG_INET_XFRM_TUNNEL=m -CONFIG_INET_TUNNEL=m -CONFIG_INET_DIAG=m -CONFIG_INET_TCP_DIAG=m -CONFIG_INET_UDP_DIAG=m -# CONFIG_INET_RAW_DIAG is not set -# CONFIG_INET_DIAG_DESTROY is not set -CONFIG_TCP_CONG_ADVANCED=y -# CONFIG_TCP_CONG_BIC is not set -CONFIG_TCP_CONG_CUBIC=y -# CONFIG_TCP_CONG_WESTWOOD is not set -# CONFIG_TCP_CONG_HTCP is not set -# CONFIG_TCP_CONG_HSTCP is not set -# CONFIG_TCP_CONG_HYBLA is not set -# CONFIG_TCP_CONG_VEGAS is not set -# CONFIG_TCP_CONG_NV is not set -# CONFIG_TCP_CONG_SCALABLE is not set -# CONFIG_TCP_CONG_LP is not set -# CONFIG_TCP_CONG_VENO is not set -# CONFIG_TCP_CONG_YEAH is not set -# CONFIG_TCP_CONG_ILLINOIS is not set -# CONFIG_TCP_CONG_DCTCP is not set -# CONFIG_TCP_CONG_CDG is not set -CONFIG_TCP_CONG_BBR=m -CONFIG_DEFAULT_CUBIC=y -# CONFIG_DEFAULT_RENO is not set -CONFIG_DEFAULT_TCP_CONG="cubic" -CONFIG_TCP_SIGPOOL=y -CONFIG_TCP_AO=y -CONFIG_TCP_MD5SIG=y -CONFIG_IPV6=y -CONFIG_IPV6_ROUTER_PREF=y -CONFIG_IPV6_ROUTE_INFO=y -CONFIG_IPV6_OPTIMISTIC_DAD=y -CONFIG_INET6_AH=m -CONFIG_INET6_ESP=m -# CONFIG_INET6_ESP_OFFLOAD is not set -# CONFIG_INET6_ESPINTCP is not set -CONFIG_INET6_IPCOMP=m -CONFIG_IPV6_MIP6=m -# CONFIG_IPV6_ILA is not set -CONFIG_INET6_XFRM_TUNNEL=m -CONFIG_INET6_TUNNEL=m -CONFIG_IPV6_VTI=m -CONFIG_IPV6_SIT=m -CONFIG_IPV6_SIT_6RD=y -CONFIG_IPV6_NDISC_NODETYPE=y -CONFIG_IPV6_TUNNEL=m -CONFIG_IPV6_GRE=m -CONFIG_IPV6_FOU=m -CONFIG_IPV6_FOU_TUNNEL=m -CONFIG_IPV6_MULTIPLE_TABLES=y -CONFIG_IPV6_SUBTREES=y -CONFIG_IPV6_MROUTE=y -CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y -CONFIG_IPV6_PIMSM_V2=y -# CONFIG_IPV6_SEG6_LWTUNNEL is not set -# CONFIG_IPV6_SEG6_HMAC is not set -# CONFIG_IPV6_RPL_LWTUNNEL is not set -# CONFIG_IPV6_IOAM6_LWTUNNEL is not set -CONFIG_NETLABEL=y -# CONFIG_MPTCP is not set -CONFIG_NETWORK_SECMARK=y -CONFIG_NET_PTP_CLASSIFY=y -CONFIG_NETWORK_PHY_TIMESTAMPING=y -CONFIG_NETFILTER=y -CONFIG_NETFILTER_ADVANCED=y -CONFIG_BRIDGE_NETFILTER=m - -# Core Netfilter Configuration -CONFIG_NETFILTER_INGRESS=y -CONFIG_NETFILTER_EGRESS=y -CONFIG_NETFILTER_SKIP_EGRESS=y -CONFIG_NETFILTER_NETLINK=m -CONFIG_NETFILTER_FAMILY_BRIDGE=y -CONFIG_NETFILTER_FAMILY_ARP=y -CONFIG_NETFILTER_BPF_LINK=y -# CONFIG_NETFILTER_NETLINK_HOOK is not set -CONFIG_NETFILTER_NETLINK_ACCT=m -CONFIG_NETFILTER_NETLINK_QUEUE=m -CONFIG_NETFILTER_NETLINK_LOG=m -CONFIG_NETFILTER_NETLINK_OSF=m -CONFIG_NF_CONNTRACK=m -CONFIG_NF_LOG_SYSLOG=m -CONFIG_NETFILTER_CONNCOUNT=m -CONFIG_NF_CONNTRACK_MARK=y -CONFIG_NF_CONNTRACK_SECMARK=y -CONFIG_NF_CONNTRACK_ZONES=y -CONFIG_NF_CONNTRACK_PROCFS=y -CONFIG_NF_CONNTRACK_EVENTS=y -CONFIG_NF_CONNTRACK_TIMEOUT=y -CONFIG_NF_CONNTRACK_TIMESTAMP=y -CONFIG_NF_CONNTRACK_LABELS=y -CONFIG_NF_CONNTRACK_OVS=y -CONFIG_NF_CT_PROTO_DCCP=y -CONFIG_NF_CT_PROTO_GRE=y -CONFIG_NF_CT_PROTO_SCTP=y -CONFIG_NF_CT_PROTO_UDPLITE=y -CONFIG_NF_CONNTRACK_AMANDA=m -CONFIG_NF_CONNTRACK_FTP=m -CONFIG_NF_CONNTRACK_H323=m -CONFIG_NF_CONNTRACK_IRC=m -CONFIG_NF_CONNTRACK_BROADCAST=m -CONFIG_NF_CONNTRACK_NETBIOS_NS=m -CONFIG_NF_CONNTRACK_SNMP=m -CONFIG_NF_CONNTRACK_PPTP=m -CONFIG_NF_CONNTRACK_SANE=m -CONFIG_NF_CONNTRACK_SIP=m -CONFIG_NF_CONNTRACK_TFTP=m -CONFIG_NF_CT_NETLINK=m -CONFIG_NF_CT_NETLINK_TIMEOUT=m -# CONFIG_NETFILTER_NETLINK_GLUE_CT is not set -CONFIG_NF_NAT=m -CONFIG_NF_NAT_AMANDA=m -CONFIG_NF_NAT_FTP=m -CONFIG_NF_NAT_IRC=m -CONFIG_NF_NAT_SIP=m -CONFIG_NF_NAT_TFTP=m -CONFIG_NF_NAT_REDIRECT=y -CONFIG_NF_NAT_MASQUERADE=y -CONFIG_NF_NAT_OVS=y -CONFIG_NETFILTER_SYNPROXY=m -CONFIG_NF_TABLES=m -CONFIG_NF_TABLES_INET=y -# CONFIG_NF_TABLES_NETDEV is not set -CONFIG_NFT_NUMGEN=m -CONFIG_NFT_CT=m -CONFIG_NFT_FLOW_OFFLOAD=m -# CONFIG_NFT_CONNLIMIT is not set -CONFIG_NFT_LOG=m -CONFIG_NFT_LIMIT=m -CONFIG_NFT_MASQ=m -CONFIG_NFT_REDIR=m -CONFIG_NFT_NAT=m -CONFIG_NFT_TUNNEL=m -CONFIG_NFT_QUEUE=m -CONFIG_NFT_QUOTA=m -CONFIG_NFT_REJECT=m -CONFIG_NFT_REJECT_INET=m -CONFIG_NFT_COMPAT=m -CONFIG_NFT_HASH=m -CONFIG_NFT_FIB=m -# CONFIG_NFT_FIB_INET is not set -# CONFIG_NFT_XFRM is not set -# CONFIG_NFT_SOCKET is not set -# CONFIG_NFT_OSF is not set -CONFIG_NFT_TPROXY=m -# CONFIG_NFT_SYNPROXY is not set -CONFIG_NF_FLOW_TABLE_INET=m -CONFIG_NF_FLOW_TABLE=m -# CONFIG_NF_FLOW_TABLE_PROCFS is not set -CONFIG_NETFILTER_XTABLES=y -CONFIG_NETFILTER_XTABLES_COMPAT=y - -## Xtables combined modules -CONFIG_NETFILTER_XT_MARK=m -CONFIG_NETFILTER_XT_CONNMARK=m -CONFIG_NETFILTER_XT_SET=m - -## Xtables targets -# CONFIG_NETFILTER_XT_TARGET_AUDIT is not set -CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m -CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m -CONFIG_NETFILTER_XT_TARGET_CONNMARK=m -CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m -CONFIG_NETFILTER_XT_TARGET_CT=m -CONFIG_NETFILTER_XT_TARGET_DSCP=m -CONFIG_NETFILTER_XT_TARGET_HL=m -CONFIG_NETFILTER_XT_TARGET_HMARK=m -CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m -# CONFIG_NETFILTER_XT_TARGET_LED is not set -CONFIG_NETFILTER_XT_TARGET_LOG=m -CONFIG_NETFILTER_XT_TARGET_MARK=m -CONFIG_NETFILTER_XT_NAT=m -CONFIG_NETFILTER_XT_TARGET_NETMAP=m -CONFIG_NETFILTER_XT_TARGET_NFLOG=m -CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m -# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set -CONFIG_NETFILTER_XT_TARGET_RATEEST=m -CONFIG_NETFILTER_XT_TARGET_REDIRECT=m -CONFIG_NETFILTER_XT_TARGET_MASQUERADE=m -CONFIG_NETFILTER_XT_TARGET_TEE=m -CONFIG_NETFILTER_XT_TARGET_TPROXY=m -# CONFIG_NETFILTER_XT_TARGET_TRACE is not set -CONFIG_NETFILTER_XT_TARGET_SECMARK=m -CONFIG_NETFILTER_XT_TARGET_TCPMSS=m -CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m - -## Xtables matches -CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m -CONFIG_NETFILTER_XT_MATCH_BPF=m -CONFIG_NETFILTER_XT_MATCH_CGROUP=m -CONFIG_NETFILTER_XT_MATCH_CLUSTER=m -CONFIG_NETFILTER_XT_MATCH_COMMENT=m -CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m -CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m -CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m -CONFIG_NETFILTER_XT_MATCH_CONNMARK=m -CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m -CONFIG_NETFILTER_XT_MATCH_CPU=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m -CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m -CONFIG_NETFILTER_XT_MATCH_DSCP=m -CONFIG_NETFILTER_XT_MATCH_ECN=m -CONFIG_NETFILTER_XT_MATCH_ESP=m -CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m -CONFIG_NETFILTER_XT_MATCH_HELPER=m -CONFIG_NETFILTER_XT_MATCH_HL=m -# CONFIG_NETFILTER_XT_MATCH_IPCOMP is not set -CONFIG_NETFILTER_XT_MATCH_IPRANGE=m -CONFIG_NETFILTER_XT_MATCH_IPVS=m -# CONFIG_NETFILTER_XT_MATCH_L2TP is not set -CONFIG_NETFILTER_XT_MATCH_LENGTH=m -CONFIG_NETFILTER_XT_MATCH_LIMIT=m -CONFIG_NETFILTER_XT_MATCH_MAC=m -CONFIG_NETFILTER_XT_MATCH_MARK=m -CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m -CONFIG_NETFILTER_XT_MATCH_NFACCT=m -CONFIG_NETFILTER_XT_MATCH_OSF=m -CONFIG_NETFILTER_XT_MATCH_OWNER=m -CONFIG_NETFILTER_XT_MATCH_POLICY=m -CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m -CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m -CONFIG_NETFILTER_XT_MATCH_QUOTA=m -CONFIG_NETFILTER_XT_MATCH_RATEEST=m -CONFIG_NETFILTER_XT_MATCH_REALM=m -CONFIG_NETFILTER_XT_MATCH_RECENT=m -CONFIG_NETFILTER_XT_MATCH_SCTP=m -CONFIG_NETFILTER_XT_MATCH_SOCKET=m -CONFIG_NETFILTER_XT_MATCH_STATE=m -CONFIG_NETFILTER_XT_MATCH_STATISTIC=m -CONFIG_NETFILTER_XT_MATCH_STRING=m -CONFIG_NETFILTER_XT_MATCH_TCPMSS=m -CONFIG_NETFILTER_XT_MATCH_TIME=m -CONFIG_NETFILTER_XT_MATCH_U32=m -# end of Core Netfilter Configuration - -CONFIG_IP_SET=m -CONFIG_IP_SET_MAX=256 -CONFIG_IP_SET_BITMAP_IP=m -CONFIG_IP_SET_BITMAP_IPMAC=m -CONFIG_IP_SET_BITMAP_PORT=m -CONFIG_IP_SET_HASH_IP=m -CONFIG_IP_SET_HASH_IPMARK=m -CONFIG_IP_SET_HASH_IPPORT=m -CONFIG_IP_SET_HASH_IPPORTIP=m -CONFIG_IP_SET_HASH_IPPORTNET=m -CONFIG_IP_SET_HASH_IPMAC=m -CONFIG_IP_SET_HASH_MAC=m -CONFIG_IP_SET_HASH_NETPORTNET=m -CONFIG_IP_SET_HASH_NET=m -CONFIG_IP_SET_HASH_NETNET=m -CONFIG_IP_SET_HASH_NETPORT=m -CONFIG_IP_SET_HASH_NETIFACE=m -CONFIG_IP_SET_LIST_SET=m -CONFIG_IP_VS=m -CONFIG_IP_VS_IPV6=y -# CONFIG_IP_VS_DEBUG is not set -CONFIG_IP_VS_TAB_BITS=12 - -## IPVS transport protocol load balancing support -CONFIG_IP_VS_PROTO_TCP=y -CONFIG_IP_VS_PROTO_UDP=y -CONFIG_IP_VS_PROTO_AH_ESP=y -CONFIG_IP_VS_PROTO_ESP=y -CONFIG_IP_VS_PROTO_AH=y -CONFIG_IP_VS_PROTO_SCTP=y - -## IPVS scheduler -CONFIG_IP_VS_RR=m -CONFIG_IP_VS_WRR=m -CONFIG_IP_VS_LC=m -CONFIG_IP_VS_WLC=m -# CONFIG_IP_VS_FO is not set -# CONFIG_IP_VS_OVF is not set -CONFIG_IP_VS_LBLC=m -CONFIG_IP_VS_LBLCR=m -CONFIG_IP_VS_DH=m -CONFIG_IP_VS_SH=m -# CONFIG_IP_VS_MH is not set -CONFIG_IP_VS_SED=m -CONFIG_IP_VS_NQ=m -CONFIG_IP_VS_TWOS=m - -## IPVS SH scheduler -CONFIG_IP_VS_SH_TAB_BITS=8 - -## IPVS MH scheduler -CONFIG_IP_VS_MH_TAB_INDEX=12 - -## IPVS application helper -CONFIG_IP_VS_FTP=m -CONFIG_IP_VS_NFCT=y -CONFIG_IP_VS_PE_SIP=m - -# IP: Netfilter Configuration -CONFIG_NF_DEFRAG_IPV4=m -CONFIG_IP_NF_IPTABLES_LEGACY=m -CONFIG_NF_SOCKET_IPV4=m -CONFIG_NF_TPROXY_IPV4=m -CONFIG_NF_TABLES_IPV4=y -CONFIG_NFT_REJECT_IPV4=m -CONFIG_NFT_DUP_IPV4=m -CONFIG_NFT_FIB_IPV4=m -# CONFIG_NF_TABLES_ARP is not set -CONFIG_NF_DUP_IPV4=m -# CONFIG_NF_LOG_ARP is not set -CONFIG_NF_LOG_IPV4=m -CONFIG_NF_REJECT_IPV4=m -CONFIG_NF_NAT_SNMP_BASIC=m -CONFIG_NF_NAT_PPTP=m -CONFIG_NF_NAT_H323=m -CONFIG_IP_NF_IPTABLES=m -CONFIG_IP_NF_MATCH_AH=m -CONFIG_IP_NF_MATCH_ECN=m -CONFIG_IP_NF_MATCH_RPFILTER=m -CONFIG_IP_NF_MATCH_TTL=m -CONFIG_IP_NF_FILTER=m -CONFIG_IP_NF_TARGET_REJECT=m -CONFIG_IP_NF_TARGET_SYNPROXY=m -CONFIG_IP_NF_NAT=m -CONFIG_IP_NF_TARGET_MASQUERADE=m -CONFIG_IP_NF_TARGET_NETMAP=m -CONFIG_IP_NF_TARGET_REDIRECT=m -CONFIG_IP_NF_MANGLE=m -CONFIG_IP_NF_TARGET_ECN=m -CONFIG_IP_NF_TARGET_TTL=m -CONFIG_IP_NF_RAW=m -CONFIG_IP_NF_SECURITY=m -CONFIG_IP_NF_ARPTABLES=m -CONFIG_IP_NF_ARPFILTER=m -CONFIG_IP_NF_ARP_MANGLE=m -# end of IP: Netfilter Configuration - -# IPv6: Netfilter Configuration -CONFIG_IP6_NF_IPTABLES_LEGACY=m -CONFIG_NF_SOCKET_IPV6=m -CONFIG_NF_TPROXY_IPV6=m -CONFIG_NF_TABLES_IPV6=y -CONFIG_NFT_REJECT_IPV6=m -CONFIG_NFT_DUP_IPV6=m -CONFIG_NFT_FIB_IPV6=m -CONFIG_NF_DUP_IPV6=m -CONFIG_NF_REJECT_IPV6=m -CONFIG_NF_LOG_IPV6=m -CONFIG_IP6_NF_IPTABLES=m -CONFIG_IP6_NF_MATCH_AH=m -CONFIG_IP6_NF_MATCH_EUI64=m -CONFIG_IP6_NF_MATCH_FRAG=m -CONFIG_IP6_NF_MATCH_OPTS=m -CONFIG_IP6_NF_MATCH_HL=m -CONFIG_IP6_NF_MATCH_IPV6HEADER=m -CONFIG_IP6_NF_MATCH_MH=m -CONFIG_IP6_NF_MATCH_RPFILTER=m -CONFIG_IP6_NF_MATCH_RT=m -# CONFIG_IP6_NF_MATCH_SRH is not set -CONFIG_IP6_NF_TARGET_HL=m -CONFIG_IP6_NF_FILTER=m -CONFIG_IP6_NF_TARGET_REJECT=m -CONFIG_IP6_NF_TARGET_SYNPROXY=m -CONFIG_IP6_NF_MANGLE=m -CONFIG_IP6_NF_RAW=m -CONFIG_IP6_NF_SECURITY=m -CONFIG_IP6_NF_NAT=m -CONFIG_IP6_NF_TARGET_MASQUERADE=m -CONFIG_IP6_NF_TARGET_NPT=m -# end of IPv6: Netfilter Configuration - -CONFIG_NF_DEFRAG_IPV6=m -# CONFIG_NF_TABLES_BRIDGE is not set -CONFIG_NF_CONNTRACK_BRIDGE=m -CONFIG_BRIDGE_NF_EBTABLES_LEGACY=m -CONFIG_BRIDGE_NF_EBTABLES=m -CONFIG_BRIDGE_EBT_BROUTE=m -CONFIG_BRIDGE_EBT_T_FILTER=m -CONFIG_BRIDGE_EBT_T_NAT=m -CONFIG_BRIDGE_EBT_802_3=m -CONFIG_BRIDGE_EBT_AMONG=m -CONFIG_BRIDGE_EBT_ARP=m -CONFIG_BRIDGE_EBT_IP=m -CONFIG_BRIDGE_EBT_IP6=m -CONFIG_BRIDGE_EBT_LIMIT=m -CONFIG_BRIDGE_EBT_MARK=m -CONFIG_BRIDGE_EBT_PKTTYPE=m -CONFIG_BRIDGE_EBT_STP=m -CONFIG_BRIDGE_EBT_VLAN=m -CONFIG_BRIDGE_EBT_ARPREPLY=m -CONFIG_BRIDGE_EBT_DNAT=m -CONFIG_BRIDGE_EBT_MARK_T=m -CONFIG_BRIDGE_EBT_REDIRECT=m -CONFIG_BRIDGE_EBT_SNAT=m -CONFIG_BRIDGE_EBT_LOG=m -CONFIG_BRIDGE_EBT_NFLOG=m -CONFIG_IP_DCCP=m -CONFIG_INET_DCCP_DIAG=m - -# DCCP CCIDs Configuration -# CONFIG_IP_DCCP_CCID2_DEBUG is not set -CONFIG_IP_DCCP_CCID3=y -# CONFIG_IP_DCCP_CCID3_DEBUG is not set -CONFIG_IP_DCCP_TFRC_LIB=y -# end of DCCP CCIDs Configuration - -# DCCP Kernel Hacking -# CONFIG_IP_DCCP_DEBUG is not set -# end of DCCP Kernel Hacking - -CONFIG_IP_SCTP=m -# CONFIG_SCTP_DBG_OBJCNT is not set -CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5=y -# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA1 is not set -# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE is not set -CONFIG_SCTP_COOKIE_HMAC_MD5=y -CONFIG_SCTP_COOKIE_HMAC_SHA1=y -CONFIG_INET_SCTP_DIAG=m -CONFIG_RDS=m -# CONFIG_RDS_RDMA is not set -CONFIG_RDS_TCP=m -# CONFIG_RDS_DEBUG is not set -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_L2TP is not set -CONFIG_STP=m -CONFIG_GARP=m -CONFIG_MRP=m -CONFIG_BRIDGE=m -CONFIG_BRIDGE_IGMP_SNOOPING=y -CONFIG_BRIDGE_VLAN_FILTERING=y -# CONFIG_BRIDGE_MRP is not set -# CONFIG_BRIDGE_CFM is not set -# CONFIG_NET_DSA is not set -CONFIG_VLAN_8021Q=m -CONFIG_VLAN_8021Q_GVRP=y -CONFIG_VLAN_8021Q_MVRP=y -CONFIG_LLC=m -# CONFIG_LLC2 is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_PHONET is not set -# CONFIG_6LOWPAN is not set -# CONFIG_IEEE802154 is not set -CONFIG_NET_SCHED=y - -## Queueing/Scheduling -CONFIG_NET_SCH_HTB=m -CONFIG_NET_SCH_HFSC=m -CONFIG_NET_SCH_PRIO=m -CONFIG_NET_SCH_MULTIQ=m -CONFIG_NET_SCH_RED=m -CONFIG_NET_SCH_SFB=m -CONFIG_NET_SCH_SFQ=m -CONFIG_NET_SCH_TEQL=m -CONFIG_NET_SCH_TBF=m -# CONFIG_NET_SCH_CBS is not set -CONFIG_NET_SCH_ETF=m -CONFIG_NET_SCH_MQPRIO_LIB=m -# CONFIG_NET_SCH_TAPRIO is not set -CONFIG_NET_SCH_GRED=m -CONFIG_NET_SCH_NETEM=m -CONFIG_NET_SCH_DRR=m -CONFIG_NET_SCH_MQPRIO=m -# CONFIG_NET_SCH_SKBPRIO is not set -CONFIG_NET_SCH_CHOKE=m -CONFIG_NET_SCH_QFQ=m -CONFIG_NET_SCH_CODEL=m -CONFIG_NET_SCH_FQ_CODEL=m -# CONFIG_NET_SCH_CAKE is not set -CONFIG_NET_SCH_FQ=m -# CONFIG_NET_SCH_HHF is not set -# CONFIG_NET_SCH_PIE is not set -CONFIG_NET_SCH_INGRESS=m -CONFIG_NET_SCH_PLUG=m -# CONFIG_NET_SCH_ETS is not set -# CONFIG_NET_SCH_DEFAULT is not set - -## Classification -CONFIG_NET_CLS=y -CONFIG_NET_CLS_BASIC=m -CONFIG_NET_CLS_ROUTE4=m -CONFIG_NET_CLS_FW=m -CONFIG_NET_CLS_U32=m -CONFIG_CLS_U32_PERF=y -CONFIG_CLS_U32_MARK=y -CONFIG_NET_CLS_FLOW=m -CONFIG_NET_CLS_CGROUP=m -CONFIG_NET_CLS_BPF=m -# CONFIG_NET_CLS_FLOWER is not set -CONFIG_NET_CLS_MATCHALL=m -CONFIG_NET_EMATCH=y -CONFIG_NET_EMATCH_STACK=32 -CONFIG_NET_EMATCH_CMP=m -CONFIG_NET_EMATCH_NBYTE=m -CONFIG_NET_EMATCH_U32=m -CONFIG_NET_EMATCH_META=m -CONFIG_NET_EMATCH_TEXT=m -CONFIG_NET_EMATCH_IPSET=m -# CONFIG_NET_EMATCH_IPT is not set -CONFIG_NET_CLS_ACT=y -CONFIG_NET_ACT_POLICE=m -CONFIG_NET_ACT_GACT=m -CONFIG_GACT_PROB=y -CONFIG_NET_ACT_MIRRED=m -# CONFIG_NET_ACT_SAMPLE is not set -CONFIG_NET_ACT_NAT=m -CONFIG_NET_ACT_PEDIT=m -CONFIG_NET_ACT_SIMP=m -CONFIG_NET_ACT_SKBEDIT=m -CONFIG_NET_ACT_CSUM=m -# CONFIG_NET_ACT_MPLS is not set -# CONFIG_NET_ACT_VLAN is not set -CONFIG_NET_ACT_BPF=m -# CONFIG_NET_ACT_CONNMARK is not set -# CONFIG_NET_ACT_CTINFO is not set -# CONFIG_NET_ACT_SKBMOD is not set -# CONFIG_NET_ACT_IFE is not set -CONFIG_NET_ACT_TUNNEL_KEY=m -# CONFIG_NET_ACT_CT is not set -# CONFIG_NET_ACT_GATE is not set -CONFIG_NET_TC_SKB_EXT=y -CONFIG_NET_SCH_FIFO=y -CONFIG_DCB=y -CONFIG_DNS_RESOLVER=m -# CONFIG_BATMAN_ADV is not set -CONFIG_OPENVSWITCH=m -CONFIG_OPENVSWITCH_GRE=m -CONFIG_OPENVSWITCH_VXLAN=m -CONFIG_OPENVSWITCH_GENEVE=m -CONFIG_VSOCKETS=m -CONFIG_VSOCKETS_DIAG=m -CONFIG_VSOCKETS_LOOPBACK=m -CONFIG_VMWARE_VMCI_VSOCKETS=m -CONFIG_VIRTIO_VSOCKETS=m -CONFIG_VIRTIO_VSOCKETS_COMMON=m -CONFIG_HYPERV_VSOCKETS=m -CONFIG_NETLINK_DIAG=m -CONFIG_MPLS=y -CONFIG_NET_MPLS_GSO=m -# CONFIG_MPLS_ROUTING is not set -CONFIG_NET_NSH=m -# CONFIG_HSR is not set -CONFIG_NET_SWITCHDEV=y -CONFIG_NET_L3_MASTER_DEV=y -# CONFIG_QRTR is not set -# CONFIG_NET_NCSI is not set -CONFIG_PCPU_DEV_REFCNT=y -CONFIG_MAX_SKB_FRAGS=17 -CONFIG_RPS=y -CONFIG_RFS_ACCEL=y -CONFIG_SOCK_RX_QUEUE_MAPPING=y -CONFIG_XPS=y -CONFIG_CGROUP_NET_PRIO=y -CONFIG_CGROUP_NET_CLASSID=y -CONFIG_NET_RX_BUSY_POLL=y -CONFIG_BQL=y -# CONFIG_BPF_STREAM_PARSER is not set -CONFIG_NET_FLOW_LIMIT=y - -# Network testing -# CONFIG_NET_PKTGEN is not set -CONFIG_NET_DROP_MONITOR=m -# end of Network testing -# end of Networking options - -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_BT is not set -# CONFIG_AF_RXRPC is not set -# CONFIG_AF_KCM is not set -CONFIG_STREAM_PARSER=y -# CONFIG_MCTP is not set -CONFIG_FIB_RULES=y -CONFIG_WIRELESS=y -CONFIG_WEXT_CORE=y -CONFIG_WEXT_PROC=y -CONFIG_CFG80211=m -# CONFIG_NL80211_TESTMODE is not set -# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set -# CONFIG_CFG80211_CERTIFICATION_ONUS is not set -CONFIG_CFG80211_REQUIRE_SIGNED_REGDB=y -CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS=y -CONFIG_CFG80211_DEFAULT_PS=y -# CONFIG_CFG80211_DEBUGFS is not set -CONFIG_CFG80211_CRDA_SUPPORT=y -CONFIG_CFG80211_WEXT=y -CONFIG_MAC80211=m -CONFIG_MAC80211_HAS_RC=y -CONFIG_MAC80211_RC_MINSTREL=y -CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y -CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" -# CONFIG_MAC80211_MESH is not set -CONFIG_MAC80211_LEDS=y -# CONFIG_MAC80211_MESSAGE_TRACING is not set -# CONFIG_MAC80211_DEBUG_MENU is not set -CONFIG_MAC80211_STA_HASH_MAX_SIZE=0 -# CONFIG_RFKILL is not set -CONFIG_NET_9P=m -CONFIG_NET_9P_FD=m -CONFIG_NET_9P_VIRTIO=m -CONFIG_NET_9P_XEN=m -# CONFIG_NET_9P_RDMA is not set -# CONFIG_NET_9P_DEBUG is not set -# CONFIG_CAIF is not set -CONFIG_CEPH_LIB=m -# CONFIG_CEPH_LIB_PRETTYDEBUG is not set -# CONFIG_CEPH_LIB_USE_DNS_RESOLVER is not set -# CONFIG_NFC is not set -# CONFIG_PSAMPLE is not set -# CONFIG_NET_IFE is not set -# CONFIG_LWTUNNEL is not set -CONFIG_DST_CACHE=y -CONFIG_GRO_CELLS=y -CONFIG_SOCK_VALIDATE_XMIT=y -CONFIG_NET_SELFTESTS=m -CONFIG_NET_SOCK_MSG=y -CONFIG_NET_DEVLINK=y -CONFIG_PAGE_POOL=y -# CONFIG_PAGE_POOL_STATS is not set -CONFIG_FAILOVER=y -CONFIG_ETHTOOL_NETLINK=y - -# Device Drivers -CONFIG_HAVE_PCI=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_PCI=y -CONFIG_PCI_DOMAINS=y -CONFIG_PCIEPORTBUS=y -CONFIG_HOTPLUG_PCI_PCIE=y -CONFIG_PCIEAER=y -# CONFIG_PCIEAER_INJECT is not set -CONFIG_PCIE_ECRC=y -CONFIG_PCIEASPM=y -CONFIG_PCIEASPM_DEFAULT=y -# CONFIG_PCIEASPM_POWERSAVE is not set -# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set -# CONFIG_PCIEASPM_PERFORMANCE is not set -CONFIG_PCIE_PME=y -CONFIG_PCIE_DPC=y -CONFIG_PCIE_PTM=y -CONFIG_PCIE_EDR=y -CONFIG_PCI_MSI=y -CONFIG_PCI_QUIRKS=y -# CONFIG_PCI_DEBUG is not set -# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set -# CONFIG_PCI_STUB is not set -CONFIG_PCI_PF_STUB=m -CONFIG_XEN_PCIDEV_FRONTEND=m -CONFIG_PCI_ATS=y -CONFIG_PCI_LOCKLESS_CONFIG=y -CONFIG_PCI_IOV=y -CONFIG_PCI_PRI=y -CONFIG_PCI_PASID=y -# CONFIG_PCI_P2PDMA is not set -CONFIG_PCI_LABEL=y -CONFIG_PCI_HYPERV=m -# CONFIG_PCIE_BUS_TUNE_OFF is not set -CONFIG_PCIE_BUS_DEFAULT=y -# CONFIG_PCIE_BUS_SAFE is not set -# CONFIG_PCIE_BUS_PERFORMANCE is not set -# CONFIG_PCIE_BUS_PEER2PEER is not set -CONFIG_VGA_ARB=y -CONFIG_VGA_ARB_MAX_GPUS=16 -CONFIG_HOTPLUG_PCI=y -CONFIG_HOTPLUG_PCI_ACPI=y -CONFIG_HOTPLUG_PCI_ACPI_IBM=m -# CONFIG_HOTPLUG_PCI_CPCI is not set -# CONFIG_HOTPLUG_PCI_SHPC is not set - -# PCI controller drivers -CONFIG_VMD=m -CONFIG_PCI_HYPERV_INTERFACE=m - -# Cadence-based PCIe controllers -# end of Cadence-based PCIe controllers - -# DesignWare-based PCIe controllers -# CONFIG_PCI_MESON is not set -# CONFIG_PCIE_DW_PLAT_HOST is not set -# end of DesignWare-based PCIe controllers - -# Mobiveil-based PCIe controllers -# end of Mobiveil-based PCIe controllers - -# PLDA-based PCIe controllers -# end of PLDA-based PCIe controllers -# end of PCI controller drivers - -# PCI Endpoint -# CONFIG_PCI_ENDPOINT is not set -# end of PCI Endpoint - -# PCI switch controller drivers -# CONFIG_PCI_SW_SWITCHTEC is not set -# end of PCI switch controller drivers - -# CONFIG_CXL_BUS is not set -# CONFIG_PCCARD is not set -# CONFIG_RAPIDIO is not set - -# Generic Driver Options -CONFIG_AUXILIARY_BUS=y -CONFIG_UEVENT_HELPER=y -CONFIG_UEVENT_HELPER_PATH="" -CONFIG_DEVTMPFS=y -CONFIG_DEVTMPFS_MOUNT=y -# CONFIG_DEVTMPFS_SAFE is not set -CONFIG_STANDALONE=y -CONFIG_PREVENT_FIRMWARE_BUILD=y - -# Firmware loader -CONFIG_FW_LOADER=y -CONFIG_FW_LOADER_DEBUG=y -CONFIG_FW_LOADER_PAGED_BUF=y -CONFIG_FW_LOADER_SYSFS=y -CONFIG_EXTRA_FIRMWARE="" -CONFIG_FW_LOADER_USER_HELPER=y -# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set -CONFIG_FW_LOADER_COMPRESS=y -CONFIG_FW_LOADER_COMPRESS_XZ=y -# CONFIG_FW_LOADER_COMPRESS_ZSTD is not set -CONFIG_FW_CACHE=y -# CONFIG_FW_UPLOAD is not set -# end of Firmware loader - -CONFIG_WANT_DEV_COREDUMP=y -CONFIG_ALLOW_DEV_COREDUMP=y -CONFIG_DEV_COREDUMP=y -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set -# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set -CONFIG_SYS_HYPERVISOR=y -CONFIG_GENERIC_CPU_DEVICES=y -CONFIG_GENERIC_CPU_AUTOPROBE=y -CONFIG_GENERIC_CPU_VULNERABILITIES=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=m -CONFIG_DMA_SHARED_BUFFER=y -# CONFIG_DMA_FENCE_TRACE is not set -# CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT is not set -# end of Generic Driver Options - -# Bus devices -# CONFIG_MHI_BUS is not set -# CONFIG_MHI_BUS_EP is not set -# end of Bus devices - -# Cache Drivers -# end of Cache Drivers - -CONFIG_CONNECTOR=y -CONFIG_PROC_EVENTS=y - -# Firmware Drivers - -# ARM System Control and Management Interface Protocol -# end of ARM System Control and Management Interface Protocol - -# CONFIG_EDD is not set -CONFIG_FIRMWARE_MEMMAP=y -CONFIG_DMIID=y -CONFIG_DMI_SYSFS=m -CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y -# CONFIG_ISCSI_IBFT is not set -# CONFIG_FW_CFG_SYSFS is not set -CONFIG_SYSFB=y -# CONFIG_SYSFB_SIMPLEFB is not set -# CONFIG_GOOGLE_FIRMWARE is not set - -# EFI (Extensible Firmware Interface) Support -CONFIG_EFI_ESRT=y -CONFIG_EFI_VARS_PSTORE=m -# CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE is not set -CONFIG_EFI_DXE_MEM_ATTRIBUTES=y -CONFIG_EFI_RUNTIME_WRAPPERS=y -# CONFIG_EFI_BOOTLOADER_CONTROL is not set -# CONFIG_EFI_CAPSULE_LOADER is not set -# CONFIG_EFI_TEST is not set -# CONFIG_APPLE_PROPERTIES is not set -CONFIG_RESET_ATTACK_MITIGATION=y -# CONFIG_EFI_RCI2_TABLE is not set -# CONFIG_EFI_DISABLE_PCI_DMA is not set -CONFIG_EFI_EARLYCON=y -CONFIG_EFI_CUSTOM_SSDT_OVERLAYS=y -# CONFIG_EFI_DISABLE_RUNTIME is not set -# CONFIG_EFI_COCO_SECRET is not set -CONFIG_UNACCEPTED_MEMORY=y -# end of EFI (Extensible Firmware Interface) Support - -CONFIG_UEFI_CPER=y -CONFIG_UEFI_CPER_X86=y - -# Qualcomm firmware drivers -# end of Qualcomm firmware drivers - -# Tegra firmware driver -# end of Tegra firmware driver -# end of Firmware Drivers - -# CONFIG_GNSS is not set -# CONFIG_MTD is not set -# CONFIG_OF is not set -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -# CONFIG_PARPORT is not set -CONFIG_PNP=y -# CONFIG_PNP_DEBUG_MESSAGES is not set - -## Protocols -CONFIG_PNPACPI=y -CONFIG_BLK_DEV=y -# CONFIG_BLK_DEV_NULL_BLK is not set -CONFIG_BLK_DEV_FD=m -# CONFIG_BLK_DEV_FD_RAWCMD is not set -CONFIG_CDROM=y -# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set -CONFIG_ZRAM=m -# CONFIG_ZRAM_BACKEND_LZ4 is not set -# CONFIG_ZRAM_BACKEND_LZ4HC is not set -# CONFIG_ZRAM_BACKEND_ZSTD is not set -# CONFIG_ZRAM_BACKEND_DEFLATE is not set -# CONFIG_ZRAM_BACKEND_842 is not set -CONFIG_ZRAM_BACKEND_FORCE_LZO=y -CONFIG_ZRAM_BACKEND_LZO=y -CONFIG_ZRAM_DEF_COMP_LZORLE=y -# CONFIG_ZRAM_DEF_COMP_LZO is not set -CONFIG_ZRAM_DEF_COMP="lzo-rle" -# CONFIG_ZRAM_WRITEBACK is not set -# CONFIG_ZRAM_TRACK_ENTRY_ACTIME is not set -# CONFIG_ZRAM_MEMORY_TRACKING is not set -# CONFIG_ZRAM_MULTI_COMP is not set -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 -# CONFIG_BLK_DEV_DRBD is not set -# CONFIG_BLK_DEV_NBD is not set -CONFIG_BLK_DEV_RAM=m -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=4096 -# CONFIG_CDROM_PKTCDVD is not set -# CONFIG_ATA_OVER_ETH is not set -CONFIG_XEN_BLKDEV_FRONTEND=m -CONFIG_XEN_BLKDEV_BACKEND=m -CONFIG_VIRTIO_BLK=m -CONFIG_BLK_DEV_RBD=m -# CONFIG_BLK_DEV_UBLK is not set - -# NVME Support -CONFIG_NVME_CORE=m -CONFIG_BLK_DEV_NVME=m -# CONFIG_NVME_MULTIPATH is not set -# CONFIG_NVME_VERBOSE_ERRORS is not set -# CONFIG_NVME_HWMON is not set -CONFIG_NVME_FABRICS=m -# CONFIG_NVME_RDMA is not set -# CONFIG_NVME_FC is not set -# CONFIG_NVME_TCP is not set -# CONFIG_NVME_HOST_AUTH is not set -CONFIG_NVME_TARGET=m -# CONFIG_NVME_TARGET_DEBUGFS is not set -# CONFIG_NVME_TARGET_PASSTHRU is not set -CONFIG_NVME_TARGET_LOOP=m -# CONFIG_NVME_TARGET_RDMA is not set -# CONFIG_NVME_TARGET_FC is not set -# CONFIG_NVME_TARGET_TCP is not set -# CONFIG_NVME_TARGET_AUTH is not set -# end of NVME Support - -# Misc devices -# CONFIG_AD525X_DPOT is not set -# CONFIG_DUMMY_IRQ is not set -# CONFIG_IBM_ASM is not set -# CONFIG_PHANTOM is not set -# CONFIG_RPMB is not set -# CONFIG_TIFM_CORE is not set -# CONFIG_ICS932S401 is not set -# CONFIG_ENCLOSURE_SERVICES is not set -# CONFIG_HP_ILO is not set -# CONFIG_APDS9802ALS is not set -# CONFIG_ISL29003 is not set -# CONFIG_ISL29020 is not set -# CONFIG_SENSORS_TSL2550 is not set -# CONFIG_SENSORS_BH1770 is not set -# CONFIG_SENSORS_APDS990X is not set -# CONFIG_HMC6352 is not set -# CONFIG_DS1682 is not set -CONFIG_VMWARE_BALLOON=m -# CONFIG_SRAM is not set -# CONFIG_DW_XDATA_PCIE is not set -# CONFIG_PCI_ENDPOINT_TEST is not set -# CONFIG_XILINX_SDFEC is not set -# CONFIG_NSM is not set -# CONFIG_C2PORT is not set - -# EEPROM support -# CONFIG_EEPROM_AT24 is not set -# CONFIG_EEPROM_MAX6875 is not set -CONFIG_EEPROM_93CX6=m -# CONFIG_EEPROM_IDT_89HPESX is not set -# CONFIG_EEPROM_EE1004 is not set -# end of EEPROM support - -# CONFIG_CB710_CORE is not set - -# Texas Instruments shared transport line discipline -# CONFIG_TI_ST is not set -# end of Texas Instruments shared transport line discipline - -# CONFIG_SENSORS_LIS3_I2C is not set -# CONFIG_ALTERA_STAPL is not set -CONFIG_INTEL_MEI=m -CONFIG_INTEL_MEI_ME=m -# CONFIG_INTEL_MEI_TXE is not set -# CONFIG_INTEL_MEI_GSC is not set -# CONFIG_INTEL_MEI_HDCP is not set -# CONFIG_INTEL_MEI_PXP is not set -# CONFIG_INTEL_MEI_GSC_PROXY is not set -CONFIG_VMWARE_VMCI=m -# CONFIG_GENWQE is not set -# CONFIG_ECHO is not set -# CONFIG_BCM_VK is not set -# CONFIG_MISC_ALCOR_PCI is not set -# CONFIG_MISC_RTSX_PCI is not set -# CONFIG_MISC_RTSX_USB is not set -# CONFIG_UACCE is not set -# CONFIG_PVPANIC is not set -# CONFIG_GP_PCI1XXXX is not set -# CONFIG_KEBA_CP500 is not set -# end of Misc devices - -# SCSI device support -CONFIG_SCSI_MOD=y -CONFIG_RAID_ATTRS=m -CONFIG_SCSI_COMMON=y -CONFIG_SCSI=y -CONFIG_SCSI_DMA=y -CONFIG_SCSI_NETLINK=y -CONFIG_SCSI_PROC_FS=y - -## SCSI support type (disk, tape, CD-ROM) -CONFIG_BLK_DEV_SD=y -# CONFIG_CHR_DEV_ST is not set -CONFIG_BLK_DEV_SR=y -CONFIG_CHR_DEV_SG=y -CONFIG_BLK_DEV_BSG=y -# CONFIG_CHR_DEV_SCH is not set -# CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_LOGGING is not set -CONFIG_SCSI_SCAN_ASYNC=y - -# SCSI Transports -CONFIG_SCSI_SPI_ATTRS=m -CONFIG_SCSI_FC_ATTRS=m -CONFIG_SCSI_ISCSI_ATTRS=m -CONFIG_SCSI_SAS_ATTRS=m -CONFIG_SCSI_SAS_LIBSAS=m -CONFIG_SCSI_SAS_ATA=y -CONFIG_SCSI_SAS_HOST_SMP=y -CONFIG_SCSI_SRP_ATTRS=m -# end of SCSI Transports - -CONFIG_SCSI_LOWLEVEL=y -CONFIG_ISCSI_TCP=m -CONFIG_ISCSI_BOOT_SYSFS=m -CONFIG_SCSI_CXGB3_ISCSI=m -CONFIG_SCSI_CXGB4_ISCSI=m -CONFIG_SCSI_BNX2_ISCSI=m -# CONFIG_SCSI_BNX2X_FCOE is not set -CONFIG_BE2ISCSI=m -CONFIG_BLK_DEV_3W_XXXX_RAID=m -CONFIG_SCSI_HPSA=m -CONFIG_SCSI_3W_9XXX=m -CONFIG_SCSI_3W_SAS=m -CONFIG_SCSI_ACARD=m -CONFIG_SCSI_AACRAID=m -CONFIG_SCSI_AIC7XXX=m -CONFIG_AIC7XXX_CMDS_PER_DEVICE=32 -CONFIG_AIC7XXX_RESET_DELAY_MS=5000 -CONFIG_AIC7XXX_DEBUG_ENABLE=y -CONFIG_AIC7XXX_DEBUG_MASK=0 -CONFIG_AIC7XXX_REG_PRETTY_PRINT=y -CONFIG_SCSI_AIC79XX=m -CONFIG_AIC79XX_CMDS_PER_DEVICE=32 -CONFIG_AIC79XX_RESET_DELAY_MS=5000 -CONFIG_AIC79XX_DEBUG_ENABLE=y -CONFIG_AIC79XX_DEBUG_MASK=0 -CONFIG_AIC79XX_REG_PRETTY_PRINT=y -CONFIG_SCSI_AIC94XX=m -CONFIG_AIC94XX_DEBUG=y -CONFIG_SCSI_MVSAS=m -CONFIG_SCSI_MVSAS_DEBUG=y -CONFIG_SCSI_MVSAS_TASKLET=y -CONFIG_SCSI_MVUMI=m -CONFIG_SCSI_ADVANSYS=m -CONFIG_SCSI_ARCMSR=m -CONFIG_SCSI_ESAS2R=m -CONFIG_MEGARAID_NEWGEN=y -CONFIG_MEGARAID_MM=m -CONFIG_MEGARAID_MAILBOX=m -CONFIG_MEGARAID_LEGACY=m -CONFIG_MEGARAID_SAS=m -CONFIG_SCSI_MPT3SAS=m -CONFIG_SCSI_MPT2SAS_MAX_SGE=128 -CONFIG_SCSI_MPT3SAS_MAX_SGE=128 -CONFIG_SCSI_MPT2SAS=m -# CONFIG_SCSI_MPI3MR is not set -# CONFIG_SCSI_SMARTPQI is not set -CONFIG_SCSI_HPTIOP=m -CONFIG_SCSI_BUSLOGIC=m -CONFIG_SCSI_FLASHPOINT=y -# CONFIG_SCSI_MYRB is not set -# CONFIG_SCSI_MYRS is not set -CONFIG_VMWARE_PVSCSI=y -CONFIG_XEN_SCSI_FRONTEND=m -CONFIG_HYPERV_STORAGE=m -CONFIG_LIBFC=m -CONFIG_LIBFCOE=m -CONFIG_FCOE=m -CONFIG_FCOE_FNIC=m -# CONFIG_SCSI_SNIC is not set -CONFIG_SCSI_DMX3191D=m -# CONFIG_SCSI_FDOMAIN_PCI is not set -CONFIG_SCSI_ISCI=m -CONFIG_SCSI_IPS=m -CONFIG_SCSI_INITIO=m -CONFIG_SCSI_INIA100=m -CONFIG_SCSI_STEX=m -CONFIG_SCSI_SYM53C8XX_2=m -CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 -CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 -CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 -CONFIG_SCSI_SYM53C8XX_MMIO=y -CONFIG_SCSI_IPR=m -CONFIG_SCSI_IPR_TRACE=y -CONFIG_SCSI_IPR_DUMP=y -CONFIG_SCSI_QLOGIC_1280=m -CONFIG_SCSI_QLA_FC=m -CONFIG_SCSI_QLA_ISCSI=m -CONFIG_SCSI_LPFC=m -CONFIG_SCSI_LPFC_DEBUG_FS=y -CONFIG_SCSI_DC395x=m -CONFIG_SCSI_AM53C974=m -CONFIG_SCSI_WD719X=m -CONFIG_SCSI_DEBUG=m -CONFIG_SCSI_PMCRAID=m -CONFIG_SCSI_PM8001=m -CONFIG_SCSI_BFA_FC=m -CONFIG_SCSI_VIRTIO=m -CONFIG_SCSI_CHELSIO_FCOE=m -CONFIG_SCSI_DH=y -CONFIG_SCSI_DH_RDAC=y -CONFIG_SCSI_DH_HP_SW=m -CONFIG_SCSI_DH_EMC=m -CONFIG_SCSI_DH_ALUA=m -# end of SCSI device support - -CONFIG_ATA=y -CONFIG_SATA_HOST=y -CONFIG_PATA_TIMINGS=y -CONFIG_ATA_VERBOSE_ERROR=y -CONFIG_ATA_FORCE=y -CONFIG_ATA_ACPI=y -# CONFIG_SATA_ZPODD is not set -CONFIG_SATA_PMP=y - -## Controllers with non-SFF native interface -CONFIG_SATA_AHCI=y -CONFIG_SATA_MOBILE_LPM_POLICY=0 -# CONFIG_SATA_AHCI_PLATFORM is not set -# CONFIG_AHCI_DWC is not set -# CONFIG_SATA_INIC162X is not set -# CONFIG_SATA_ACARD_AHCI is not set -CONFIG_SATA_SIL24=m -CONFIG_ATA_SFF=y - -## SFF controllers with custom DMA interface -# CONFIG_PDC_ADMA is not set -# CONFIG_SATA_QSTOR is not set -# CONFIG_SATA_SX4 is not set -CONFIG_ATA_BMDMA=y - -## SATA SFF controllers with BMDMA -CONFIG_ATA_PIIX=y -# CONFIG_SATA_DWC is not set -# CONFIG_SATA_MV is not set -# CONFIG_SATA_NV is not set -# CONFIG_SATA_PROMISE is not set -# CONFIG_SATA_SIL is not set -# CONFIG_SATA_SIS is not set -# CONFIG_SATA_SVW is not set -# CONFIG_SATA_ULI is not set -# CONFIG_SATA_VIA is not set -# CONFIG_SATA_VITESSE is not set - -## PATA SFF controllers with BMDMA -# CONFIG_PATA_ALI is not set -# CONFIG_PATA_AMD is not set -# CONFIG_PATA_ARTOP is not set -# CONFIG_PATA_ATIIXP is not set -# CONFIG_PATA_ATP867X is not set -# CONFIG_PATA_CMD64X is not set -# CONFIG_PATA_CYPRESS is not set -# CONFIG_PATA_EFAR is not set -# CONFIG_PATA_HPT366 is not set -# CONFIG_PATA_HPT37X is not set -# CONFIG_PATA_HPT3X2N is not set -# CONFIG_PATA_HPT3X3 is not set -# CONFIG_PATA_IT8213 is not set -# CONFIG_PATA_IT821X is not set -# CONFIG_PATA_JMICRON is not set -# CONFIG_PATA_MARVELL is not set -# CONFIG_PATA_NETCELL is not set -# CONFIG_PATA_NINJA32 is not set -# CONFIG_PATA_NS87415 is not set -# CONFIG_PATA_OLDPIIX is not set -# CONFIG_PATA_OPTIDMA is not set -# CONFIG_PATA_PDC2027X is not set -# CONFIG_PATA_PDC_OLD is not set -# CONFIG_PATA_RADISYS is not set -# CONFIG_PATA_RDC is not set -# CONFIG_PATA_SCH is not set -# CONFIG_PATA_SERVERWORKS is not set -# CONFIG_PATA_SIL680 is not set -# CONFIG_PATA_SIS is not set -# CONFIG_PATA_TOSHIBA is not set -# CONFIG_PATA_TRIFLEX is not set -# CONFIG_PATA_VIA is not set -# CONFIG_PATA_WINBOND is not set - -## PIO-only SFF controllers -# CONFIG_PATA_CMD640_PCI is not set -# CONFIG_PATA_MPIIX is not set -# CONFIG_PATA_NS87410 is not set -# CONFIG_PATA_OPTI is not set -# CONFIG_PATA_RZ1000 is not set - -## Generic fallback / legacy drivers -# CONFIG_PATA_ACPI is not set -# CONFIG_ATA_GENERIC is not set -# CONFIG_PATA_LEGACY is not set -CONFIG_MD=y -CONFIG_BLK_DEV_MD=m -CONFIG_MD_BITMAP_FILE=y -# CONFIG_MD_LINEAR is not set -CONFIG_MD_RAID0=m -CONFIG_MD_RAID1=m -CONFIG_MD_RAID10=m -CONFIG_MD_RAID456=m -# CONFIG_MD_CLUSTER is not set -# CONFIG_BCACHE is not set -CONFIG_BLK_DEV_DM_BUILTIN=y -CONFIG_BLK_DEV_DM=m -# CONFIG_DM_DEBUG is not set -CONFIG_DM_BUFIO=m -# CONFIG_DM_DEBUG_BLOCK_MANAGER_LOCKING is not set -CONFIG_DM_BIO_PRISON=m -CONFIG_DM_PERSISTENT_DATA=m -# CONFIG_DM_UNSTRIPED is not set -CONFIG_DM_CRYPT=m -CONFIG_DM_SNAPSHOT=m -CONFIG_DM_THIN_PROVISIONING=m -# CONFIG_DM_CACHE is not set -# CONFIG_DM_WRITECACHE is not set -# CONFIG_DM_EBS is not set -# CONFIG_DM_ERA is not set -# CONFIG_DM_CLONE is not set -CONFIG_DM_MIRROR=m -# CONFIG_DM_LOG_USERSPACE is not set -CONFIG_DM_RAID=m -CONFIG_DM_ZERO=m -CONFIG_DM_MULTIPATH=m -# CONFIG_DM_MULTIPATH_QL is not set -# CONFIG_DM_MULTIPATH_ST is not set -# CONFIG_DM_MULTIPATH_HST is not set -# CONFIG_DM_MULTIPATH_IOA is not set -CONFIG_DM_DELAY=m -# CONFIG_DM_DUST is not set -CONFIG_DM_UEVENT=y -CONFIG_DM_FLAKEY=m -CONFIG_DM_VERITY=m -# CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG is not set -# CONFIG_DM_VERITY_FEC is not set -# CONFIG_DM_SWITCH is not set -# CONFIG_DM_LOG_WRITES is not set -# CONFIG_DM_INTEGRITY is not set -# CONFIG_DM_ZONED is not set -# CONFIG_DM_AUDIT is not set -# CONFIG_DM_VDO is not set -# CONFIG_TARGET_CORE is not set -CONFIG_FUSION=y -CONFIG_FUSION_SPI=m -CONFIG_FUSION_FC=m -CONFIG_FUSION_SAS=m -CONFIG_FUSION_MAX_SGE=128 -CONFIG_FUSION_CTL=m -CONFIG_FUSION_LOGGING=y - -# IEEE 1394 (FireWire) support -# CONFIG_FIREWIRE is not set -# CONFIG_FIREWIRE_NOSY is not set -# end of IEEE 1394 (FireWire) support - -# CONFIG_MACINTOSH_DRIVERS is not set -CONFIG_NETDEVICES=y -CONFIG_MII=m -CONFIG_NET_CORE=y -CONFIG_BONDING=m -CONFIG_DUMMY=m -CONFIG_WIREGUARD=m -# CONFIG_WIREGUARD_DEBUG is not set -# CONFIG_EQUALIZER is not set -# CONFIG_NET_FC is not set -CONFIG_IFB=m -CONFIG_NET_TEAM=m -CONFIG_NET_TEAM_MODE_BROADCAST=m -CONFIG_NET_TEAM_MODE_ROUNDROBIN=m -CONFIG_NET_TEAM_MODE_RANDOM=m -CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m -CONFIG_NET_TEAM_MODE_LOADBALANCE=m -CONFIG_MACVLAN=m -CONFIG_MACVTAP=m -CONFIG_IPVLAN_L3S=y -CONFIG_IPVLAN=m -# CONFIG_IPVTAP is not set -CONFIG_VXLAN=m -CONFIG_GENEVE=m -# CONFIG_BAREUDP is not set -CONFIG_GTP=m -# CONFIG_PFCP is not set -# CONFIG_AMT is not set -# CONFIG_MACSEC is not set -CONFIG_NETCONSOLE=m -CONFIG_NETCONSOLE_DYNAMIC=y -# CONFIG_NETCONSOLE_EXTENDED_LOG is not set -CONFIG_NETPOLL=y -CONFIG_NET_POLL_CONTROLLER=y -CONFIG_TUN=m -CONFIG_TAP=m -# CONFIG_TUN_VNET_CROSS_LE is not set -CONFIG_VETH=y -CONFIG_VIRTIO_NET=m -# CONFIG_NLMON is not set -# CONFIG_NETKIT is not set -CONFIG_NET_VRF=m -CONFIG_VSOCKMON=m -# CONFIG_ARCNET is not set -CONFIG_ETHERNET=y -CONFIG_MDIO=m -# CONFIG_NET_VENDOR_3COM is not set -# CONFIG_NET_VENDOR_ADAPTEC is not set -CONFIG_NET_VENDOR_AGERE=y -# CONFIG_ET131X is not set -CONFIG_NET_VENDOR_ALACRITECH=y -# CONFIG_SLICOSS is not set -CONFIG_NET_VENDOR_ALTEON=y -CONFIG_ACENIC=m -# CONFIG_ACENIC_OMIT_TIGON_I is not set -# CONFIG_ALTERA_TSE is not set -# CONFIG_NET_VENDOR_AMAZON is not set -CONFIG_NET_VENDOR_AMD=y -CONFIG_AMD8111_ETH=m -CONFIG_PCNET32=m -# CONFIG_AMD_XGBE is not set -# CONFIG_PDS_CORE is not set -# CONFIG_NET_VENDOR_AQUANTIA is not set -# CONFIG_NET_VENDOR_ARC is not set -CONFIG_NET_VENDOR_ASIX=y -CONFIG_NET_VENDOR_ATHEROS=y -CONFIG_ATL2=m -CONFIG_ATL1=m -CONFIG_ATL1E=m -CONFIG_ATL1C=m -CONFIG_ALX=m -# CONFIG_CX_ECAT is not set -CONFIG_NET_VENDOR_BROADCOM=y -CONFIG_B44=m -CONFIG_B44_PCI_AUTOSELECT=y -CONFIG_B44_PCICORE_AUTOSELECT=y -CONFIG_B44_PCI=y -# CONFIG_BCMGENET is not set -CONFIG_BNX2=m -CONFIG_CNIC=m -CONFIG_TIGON3=m -CONFIG_TIGON3_HWMON=y -CONFIG_BNX2X=m -CONFIG_BNX2X_SRIOV=y -# CONFIG_SYSTEMPORT is not set -CONFIG_BNXT=m -CONFIG_BNXT_SRIOV=y -# CONFIG_BNXT_FLOWER_OFFLOAD is not set -# CONFIG_BNXT_DCB is not set -# CONFIG_BNXT_HWMON is not set -CONFIG_NET_VENDOR_CADENCE=y -# CONFIG_MACB is not set -CONFIG_NET_VENDOR_CAVIUM=y -# CONFIG_THUNDER_NIC_PF is not set -# CONFIG_THUNDER_NIC_VF is not set -# CONFIG_THUNDER_NIC_BGX is not set -# CONFIG_THUNDER_NIC_RGX is not set -CONFIG_CAVIUM_PTP=m -# CONFIG_LIQUIDIO is not set -# CONFIG_LIQUIDIO_VF is not set -CONFIG_NET_VENDOR_CHELSIO=y -CONFIG_CHELSIO_T1=m -CONFIG_CHELSIO_T1_1G=y -CONFIG_CHELSIO_T3=m -CONFIG_CHELSIO_T4=m -# CONFIG_CHELSIO_T4_DCB is not set -CONFIG_CHELSIO_T4VF=m -CONFIG_CHELSIO_LIB=m -CONFIG_CHELSIO_INLINE_CRYPTO=y -# CONFIG_CRYPTO_DEV_CHELSIO_TLS is not set -CONFIG_CHELSIO_TLS_DEVICE=m -CONFIG_NET_VENDOR_CISCO=y -CONFIG_ENIC=m -# CONFIG_NET_VENDOR_CORTINA is not set -CONFIG_NET_VENDOR_DAVICOM=y -# CONFIG_DNET is not set -CONFIG_NET_VENDOR_DEC=y -CONFIG_NET_TULIP=y -# CONFIG_DE2104X is not set -CONFIG_TULIP=m -# CONFIG_TULIP_MWI is not set -CONFIG_TULIP_MMIO=y -CONFIG_TULIP_NAPI=y -# CONFIG_TULIP_NAPI_HW_MITIGATION is not set -# CONFIG_WINBOND_840 is not set -# CONFIG_DM9102 is not set -# CONFIG_ULI526X is not set -CONFIG_NET_VENDOR_DLINK=y -CONFIG_DL2K=m -CONFIG_SUNDANCE=m -# CONFIG_SUNDANCE_MMIO is not set -CONFIG_NET_VENDOR_EMULEX=y -CONFIG_BE2NET=m -CONFIG_BE2NET_HWMON=y -# CONFIG_BE2NET_BE2 is not set -# CONFIG_BE2NET_BE3 is not set -# CONFIG_BE2NET_LANCER is not set -# CONFIG_BE2NET_SKYHAWK is not set - -## WARNING: be2net is useless without any enabled chip -CONFIG_NET_VENDOR_ENGLEDER=y -# CONFIG_TSNEP is not set -CONFIG_NET_VENDOR_EZCHIP=y -CONFIG_NET_VENDOR_FUNGIBLE=y -# CONFIG_FUN_ETH is not set -CONFIG_NET_VENDOR_GOOGLE=y -CONFIG_GVE=m -# CONFIG_NET_VENDOR_HUAWEI is not set -CONFIG_NET_VENDOR_I825XX=y -CONFIG_NET_VENDOR_INTEL=y -CONFIG_E100=m -CONFIG_E1000=m -CONFIG_E1000E=m -CONFIG_E1000E_HWTS=y -CONFIG_IGB=m -CONFIG_IGB_HWMON=y -CONFIG_IGB_DCA=y -CONFIG_IGBVF=m -CONFIG_IXGBE=m -CONFIG_IXGBE_HWMON=y -CONFIG_IXGBE_DCA=y -CONFIG_IXGBE_DCB=y -CONFIG_IXGBEVF=m -# CONFIG_I40E is not set -# CONFIG_I40EVF is not set -# CONFIG_ICE is not set -CONFIG_FM10K=m -# CONFIG_IGC is not set -# CONFIG_IDPF is not set -CONFIG_JME=m -CONFIG_NET_VENDOR_LITEX=y -CONFIG_NET_VENDOR_MARVELL=y -# CONFIG_MVMDIO is not set -CONFIG_SKGE=m -# CONFIG_SKGE_DEBUG is not set -# CONFIG_SKGE_GENESIS is not set -CONFIG_SKY2=m -# CONFIG_SKY2_DEBUG is not set -# CONFIG_OCTEON_EP is not set -# CONFIG_OCTEON_EP_VF is not set -# CONFIG_PRESTERA is not set -CONFIG_NET_VENDOR_MELLANOX=y -CONFIG_MLX4_EN=m -CONFIG_MLX4_EN_DCB=y -CONFIG_MLX4_CORE=m -CONFIG_MLX4_DEBUG=y -# CONFIG_MLX4_CORE_GEN2 is not set -CONFIG_MLX5_CORE=m -# CONFIG_MLX5_FPGA is not set -CONFIG_MLX5_CORE_EN=y -# CONFIG_MLX5_EN_ARFS is not set -# CONFIG_MLX5_EN_RXNFC is not set -# CONFIG_MLX5_MPFS is not set -CONFIG_MLX5_ESWITCH=y -CONFIG_MLX5_BRIDGE=y -CONFIG_MLX5_CLS_ACT=y -CONFIG_MLX5_TC_SAMPLE=y -# CONFIG_MLX5_CORE_EN_DCB is not set -# CONFIG_MLX5_CORE_IPOIB is not set -# CONFIG_MLX5_EN_TLS is not set -CONFIG_MLX5_SW_STEERING=y -CONFIG_MLX5_HW_STEERING=y -# CONFIG_MLX5_SF is not set -# CONFIG_MLX5_DPLL is not set -# CONFIG_MLXSW_CORE is not set -# CONFIG_MLXFW is not set -# CONFIG_NET_VENDOR_META is not set -# CONFIG_NET_VENDOR_MICREL is not set -CONFIG_NET_VENDOR_MICROCHIP=y -# CONFIG_LAN743X is not set -# CONFIG_VCAP is not set -# CONFIG_NET_VENDOR_MICROSEMI is not set -CONFIG_NET_VENDOR_MICROSOFT=y -# CONFIG_MICROSOFT_MANA is not set -CONFIG_NET_VENDOR_MYRI=y -CONFIG_MYRI10GE=m -CONFIG_MYRI10GE_DCA=y -# CONFIG_FEALNX is not set -# CONFIG_NET_VENDOR_NI is not set -# CONFIG_NET_VENDOR_NATSEMI is not set -# CONFIG_NET_VENDOR_NETERION is not set -# CONFIG_NET_VENDOR_NETRONOME is not set -CONFIG_NET_VENDOR_NVIDIA=y -CONFIG_FORCEDETH=m -# CONFIG_NET_VENDOR_OKI is not set -# CONFIG_ETHOC is not set -# CONFIG_NET_VENDOR_PACKET_ENGINES is not set -CONFIG_NET_VENDOR_PENSANDO=y -# CONFIG_IONIC is not set -CONFIG_NET_VENDOR_QLOGIC=y -# CONFIG_QLA3XXX is not set -# CONFIG_QLCNIC is not set -CONFIG_NETXEN_NIC=m -# CONFIG_QED is not set -CONFIG_NET_VENDOR_BROCADE=y -CONFIG_BNA=m -CONFIG_NET_VENDOR_QUALCOMM=y -# CONFIG_QCOM_EMAC is not set -# CONFIG_RMNET is not set -# CONFIG_NET_VENDOR_RDC is not set -CONFIG_NET_VENDOR_REALTEK=y -CONFIG_8139CP=m -CONFIG_8139TOO=m -CONFIG_8139TOO_PIO=y -CONFIG_8139TOO_TUNE_TWISTER=y -CONFIG_8139TOO_8129=y -# CONFIG_8139_OLD_RX_RESET is not set -CONFIG_R8169=m -# CONFIG_RTASE is not set -CONFIG_NET_VENDOR_RENESAS=y -CONFIG_NET_VENDOR_ROCKER=y -# CONFIG_ROCKER is not set -CONFIG_NET_VENDOR_SAMSUNG=y -# CONFIG_SXGBE_ETH is not set -# CONFIG_NET_VENDOR_SEEQ is not set -# CONFIG_NET_VENDOR_SILAN is not set -# CONFIG_NET_VENDOR_SIS is not set -# CONFIG_NET_VENDOR_SOLARFLARE is not set -# CONFIG_NET_VENDOR_SMSC is not set -# CONFIG_NET_VENDOR_SOCIONEXT is not set -# CONFIG_NET_VENDOR_STMICRO is not set -# CONFIG_NET_VENDOR_SUN is not set -# CONFIG_NET_VENDOR_SYNOPSYS is not set -# CONFIG_NET_VENDOR_TEHUTI is not set -# CONFIG_NET_VENDOR_TI is not set -CONFIG_NET_VENDOR_VERTEXCOM=y -# CONFIG_NET_VENDOR_VIA is not set -CONFIG_NET_VENDOR_WANGXUN=y -# CONFIG_NGBE is not set -# CONFIG_TXGBE is not set -# CONFIG_NET_VENDOR_WIZNET is not set -CONFIG_NET_VENDOR_XILINX=y -# CONFIG_XILINX_EMACLITE is not set -# CONFIG_XILINX_LL_TEMAC is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -CONFIG_PHYLINK=m -CONFIG_PHYLIB=m -CONFIG_SWPHY=y -# CONFIG_LED_TRIGGER_PHY is not set -CONFIG_FIXED_PHY=m -# CONFIG_SFP is not set - -## MII PHY device drivers -# CONFIG_AIR_EN8811H_PHY is not set -CONFIG_AMD_PHY=m -# CONFIG_ADIN_PHY is not set -# CONFIG_ADIN1100_PHY is not set -# CONFIG_AQUANTIA_PHY is not set -CONFIG_AX88796B_PHY=m -CONFIG_BROADCOM_PHY=m -# CONFIG_BCM54140_PHY is not set -CONFIG_BCM7XXX_PHY=m -# CONFIG_BCM84881_PHY is not set -CONFIG_BCM87XX_PHY=m -CONFIG_BCM_NET_PHYLIB=m -CONFIG_BCM_NET_PHYPTP=m -# CONFIG_CICADA_PHY is not set -# CONFIG_CORTINA_PHY is not set -# CONFIG_DAVICOM_PHY is not set -# CONFIG_ICPLUS_PHY is not set -CONFIG_LXT_PHY=m -# CONFIG_INTEL_XWAY_PHY is not set -CONFIG_LSI_ET1011C_PHY=m -CONFIG_MARVELL_PHY=m -# CONFIG_MARVELL_10G_PHY is not set -# CONFIG_MARVELL_88Q2XXX_PHY is not set -# CONFIG_MARVELL_88X2222_PHY is not set -# CONFIG_MAXLINEAR_GPHY is not set -# CONFIG_MEDIATEK_GE_PHY is not set -CONFIG_MICREL_PHY=m -# CONFIG_MICROCHIP_T1S_PHY is not set -CONFIG_MICROCHIP_PHY=m -# CONFIG_MICROCHIP_T1_PHY is not set -# CONFIG_MICROSEMI_PHY is not set -# CONFIG_MOTORCOMM_PHY is not set -CONFIG_NATIONAL_PHY=m -# CONFIG_NXP_CBTX_PHY is not set -# CONFIG_NXP_C45_TJA11XX_PHY is not set -# CONFIG_NXP_TJA11XX_PHY is not set -# CONFIG_NCN26000_PHY is not set -# CONFIG_QCA83XX_PHY is not set -# CONFIG_QCA808X_PHY is not set -# CONFIG_QSEMI_PHY is not set -CONFIG_REALTEK_PHY=m -# CONFIG_RENESAS_PHY is not set -# CONFIG_ROCKCHIP_PHY is not set -# CONFIG_SMSC_PHY is not set -CONFIG_STE10XP=m -# CONFIG_TERANETICS_PHY is not set -# CONFIG_DP83822_PHY is not set -# CONFIG_DP83TC811_PHY is not set -# CONFIG_DP83848_PHY is not set -# CONFIG_DP83867_PHY is not set -# CONFIG_DP83869_PHY is not set -# CONFIG_DP83TD510_PHY is not set -# CONFIG_DP83TG720_PHY is not set -# CONFIG_VITESSE_PHY is not set -# CONFIG_XILINX_GMII2RGMII is not set -CONFIG_MDIO_DEVICE=m -CONFIG_MDIO_BUS=m -CONFIG_FWNODE_MDIO=m -CONFIG_ACPI_MDIO=m -CONFIG_MDIO_DEVRES=m -# CONFIG_MDIO_BITBANG is not set -# CONFIG_MDIO_BCM_UNIMAC is not set -# CONFIG_MDIO_MVUSB is not set -# CONFIG_MDIO_THUNDER is not set - -## MDIO Multiplexers - -# PCS device drivers -# CONFIG_PCS_XPCS is not set -# end of PCS device drivers - -# CONFIG_PPP is not set -# CONFIG_SLIP is not set - -## Host-side USB support is needed for USB Network Adapter support -CONFIG_USB_NET_DRIVERS=m -# CONFIG_USB_CATC is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_RTL8150 is not set -# CONFIG_USB_RTL8152 is not set -CONFIG_USB_LAN78XX=m -CONFIG_USB_USBNET=m -CONFIG_USB_NET_AX8817X=m -CONFIG_USB_NET_AX88179_178A=m -CONFIG_USB_NET_CDCETHER=m -# CONFIG_USB_NET_CDC_EEM is not set -CONFIG_USB_NET_CDC_NCM=m -# CONFIG_USB_NET_HUAWEI_CDC_NCM is not set -CONFIG_USB_NET_CDC_MBIM=m -# CONFIG_USB_NET_DM9601 is not set -# CONFIG_USB_NET_SR9700 is not set -# CONFIG_USB_NET_SR9800 is not set -# CONFIG_USB_NET_SMSC75XX is not set -# CONFIG_USB_NET_SMSC95XX is not set -# CONFIG_USB_NET_GL620A is not set -CONFIG_USB_NET_NET1080=m -# CONFIG_USB_NET_PLUSB is not set -# CONFIG_USB_NET_MCS7830 is not set -# CONFIG_USB_NET_RNDIS_HOST is not set -CONFIG_USB_NET_CDC_SUBSET_ENABLE=m -CONFIG_USB_NET_CDC_SUBSET=m -# CONFIG_USB_ALI_M5632 is not set -# CONFIG_USB_AN2720 is not set -CONFIG_USB_BELKIN=y -CONFIG_USB_ARMLINUX=y -# CONFIG_USB_EPSON2888 is not set -# CONFIG_USB_KC2190 is not set -CONFIG_USB_NET_ZAURUS=m -# CONFIG_USB_NET_CX82310_ETH is not set -# CONFIG_USB_NET_KALMIA is not set -CONFIG_USB_NET_QMI_WWAN=m -# CONFIG_USB_NET_INT51X1 is not set -# CONFIG_USB_IPHETH is not set -# CONFIG_USB_SIERRA_NET is not set -# CONFIG_USB_VL600 is not set -# CONFIG_USB_NET_CH9200 is not set -# CONFIG_USB_NET_AQC111 is not set -CONFIG_USB_RTL8153_ECM=m -CONFIG_WLAN=y -CONFIG_WLAN_VENDOR_ADMTEK=y -# CONFIG_ADM8211 is not set -CONFIG_WLAN_VENDOR_ATH=y -# CONFIG_ATH_DEBUG is not set -# CONFIG_ATH5K is not set -# CONFIG_ATH5K_PCI is not set -# CONFIG_ATH9K is not set -# CONFIG_ATH9K_HTC is not set -# CONFIG_CARL9170 is not set -# CONFIG_ATH6KL is not set -# CONFIG_AR5523 is not set -# CONFIG_WIL6210 is not set -# CONFIG_ATH10K is not set -# CONFIG_WCN36XX is not set -# CONFIG_ATH11K is not set -# CONFIG_ATH12K is not set -CONFIG_WLAN_VENDOR_ATMEL=y -# CONFIG_AT76C50X_USB is not set -CONFIG_WLAN_VENDOR_BROADCOM=y -# CONFIG_B43 is not set -# CONFIG_B43LEGACY is not set -# CONFIG_BRCMSMAC is not set -# CONFIG_BRCMFMAC is not set -CONFIG_WLAN_VENDOR_INTEL=y -# CONFIG_IPW2100 is not set -# CONFIG_IPW2200 is not set -# CONFIG_IWL4965 is not set -# CONFIG_IWL3945 is not set -CONFIG_IWLWIFI=m -CONFIG_IWLWIFI_LEDS=y -# CONFIG_IWLDVM is not set -CONFIG_IWLMVM=m -CONFIG_IWLWIFI_OPMODE_MODULAR=y - -# Debugging Options -# CONFIG_IWLWIFI_DEBUG is not set -CONFIG_IWLWIFI_DEVICE_TRACING=y -# end of Debugging Options - -CONFIG_WLAN_VENDOR_INTERSIL=y -# CONFIG_P54_COMMON is not set -CONFIG_WLAN_VENDOR_MARVELL=y -# CONFIG_LIBERTAS is not set -# CONFIG_LIBERTAS_THINFIRM is not set -CONFIG_MWIFIEX=m -CONFIG_MWIFIEX_SDIO=m -CONFIG_MWIFIEX_PCIE=m -CONFIG_MWIFIEX_USB=m -CONFIG_MWL8K=m -CONFIG_WLAN_VENDOR_MEDIATEK=y -# CONFIG_MT7601U is not set -# CONFIG_MT76x0U is not set -# CONFIG_MT76x0E is not set -# CONFIG_MT76x2E is not set -# CONFIG_MT76x2U is not set -# CONFIG_MT7603E is not set -# CONFIG_MT7615E is not set -# CONFIG_MT7663U is not set -# CONFIG_MT7663S is not set -# CONFIG_MT7915E is not set -# CONFIG_MT7921E is not set -# CONFIG_MT7921S is not set -# CONFIG_MT7921U is not set -# CONFIG_MT7996E is not set -# CONFIG_MT7925E is not set -# CONFIG_MT7925U is not set -CONFIG_WLAN_VENDOR_MICROCHIP=y -# CONFIG_WILC1000_SDIO is not set -CONFIG_WLAN_VENDOR_PURELIFI=y -# CONFIG_PLFXLC is not set -CONFIG_WLAN_VENDOR_RALINK=y -# CONFIG_RT2X00 is not set -CONFIG_WLAN_VENDOR_REALTEK=y -# CONFIG_RTL8180 is not set -# CONFIG_RTL8187 is not set -CONFIG_RTL_CARDS=m -# CONFIG_RTL8192CE is not set -# CONFIG_RTL8192SE is not set -# CONFIG_RTL8192DE is not set -# CONFIG_RTL8723AE is not set -# CONFIG_RTL8723BE is not set -# CONFIG_RTL8188EE is not set -# CONFIG_RTL8192EE is not set -# CONFIG_RTL8821AE is not set -# CONFIG_RTL8192CU is not set -# CONFIG_RTL8192DU is not set -# CONFIG_RTL8XXXU is not set -# CONFIG_RTW88 is not set -# CONFIG_RTW89 is not set -CONFIG_WLAN_VENDOR_RSI=y -CONFIG_RSI_91X=m -CONFIG_RSI_DEBUGFS=y -CONFIG_RSI_SDIO=m -CONFIG_RSI_USB=m -CONFIG_WLAN_VENDOR_SILABS=y -# CONFIG_WFX is not set -CONFIG_WLAN_VENDOR_ST=y -# CONFIG_CW1200 is not set -CONFIG_WLAN_VENDOR_TI=y -# CONFIG_WL1251 is not set -# CONFIG_WL12XX is not set -# CONFIG_WL18XX is not set -# CONFIG_WLCORE is not set -CONFIG_WLAN_VENDOR_ZYDAS=y -# CONFIG_ZD1211RW is not set -CONFIG_WLAN_VENDOR_QUANTENNA=y -# CONFIG_QTNFMAC_PCIE is not set -# CONFIG_MAC80211_HWSIM is not set -# CONFIG_VIRT_WIFI is not set -# CONFIG_WAN is not set - -# Wireless WAN -# CONFIG_WWAN is not set -# end of Wireless WAN - -CONFIG_XEN_NETDEV_FRONTEND=m -# CONFIG_XEN_NETDEV_BACKEND is not set -CONFIG_VMXNET3=y -# CONFIG_FUJITSU_ES is not set -CONFIG_HYPERV_NET=m -# CONFIG_NETDEVSIM is not set -CONFIG_NET_FAILOVER=m -# CONFIG_ISDN is not set - -# Input device support -CONFIG_INPUT=y -CONFIG_INPUT_LEDS=m -CONFIG_INPUT_FF_MEMLESS=m -CONFIG_INPUT_SPARSEKMAP=m -# CONFIG_INPUT_MATRIXKMAP is not set -CONFIG_INPUT_VIVALDIFMAP=y - -## Userland interfaces -CONFIG_INPUT_MOUSEDEV=m -# CONFIG_INPUT_MOUSEDEV_PSAUX is not set -CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 -CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -# CONFIG_INPUT_JOYDEV is not set -CONFIG_INPUT_EVDEV=m -# CONFIG_INPUT_EVBUG is not set - -## Input Device Drivers -CONFIG_INPUT_KEYBOARD=y -# CONFIG_KEYBOARD_ADC is not set -# CONFIG_KEYBOARD_ADP5588 is not set -# CONFIG_KEYBOARD_ADP5589 is not set -CONFIG_KEYBOARD_ATKBD=y -# CONFIG_KEYBOARD_QT1050 is not set -# CONFIG_KEYBOARD_QT1070 is not set -# CONFIG_KEYBOARD_QT2160 is not set -# CONFIG_KEYBOARD_DLINK_DIR685 is not set -# CONFIG_KEYBOARD_LKKBD is not set -# CONFIG_KEYBOARD_GPIO is not set -# CONFIG_KEYBOARD_GPIO_POLLED is not set -# CONFIG_KEYBOARD_TCA6416 is not set -# CONFIG_KEYBOARD_TCA8418 is not set -# CONFIG_KEYBOARD_MATRIX is not set -# CONFIG_KEYBOARD_LM8323 is not set -# CONFIG_KEYBOARD_LM8333 is not set -# CONFIG_KEYBOARD_MAX7359 is not set -# CONFIG_KEYBOARD_MPR121 is not set -# CONFIG_KEYBOARD_NEWTON is not set -# CONFIG_KEYBOARD_OPENCORES is not set -# CONFIG_KEYBOARD_SAMSUNG is not set -# CONFIG_KEYBOARD_STOWAWAY is not set -# CONFIG_KEYBOARD_SUNKBD is not set -# CONFIG_KEYBOARD_TM2_TOUCHKEY is not set -# CONFIG_KEYBOARD_XTKBD is not set -# CONFIG_KEYBOARD_CYPRESS_SF is not set -CONFIG_INPUT_MOUSE=y -CONFIG_MOUSE_PS2=m -CONFIG_MOUSE_PS2_ALPS=y -# CONFIG_MOUSE_PS2_BYD is not set -CONFIG_MOUSE_PS2_LOGIPS2PP=y -CONFIG_MOUSE_PS2_SYNAPTICS=y -# CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS is not set -CONFIG_MOUSE_PS2_CYPRESS=y -CONFIG_MOUSE_PS2_LIFEBOOK=y -CONFIG_MOUSE_PS2_TRACKPOINT=y -# CONFIG_MOUSE_PS2_ELANTECH is not set -# CONFIG_MOUSE_PS2_SENTELIC is not set -# CONFIG_MOUSE_PS2_TOUCHKIT is not set -CONFIG_MOUSE_PS2_FOCALTECH=y -CONFIG_MOUSE_PS2_VMMOUSE=y -# CONFIG_MOUSE_SERIAL is not set -# CONFIG_MOUSE_APPLETOUCH is not set -# CONFIG_MOUSE_BCM5974 is not set -# CONFIG_MOUSE_CYAPA is not set -# CONFIG_MOUSE_ELAN_I2C is not set -# CONFIG_MOUSE_VSXXXAA is not set -# CONFIG_MOUSE_GPIO is not set -# CONFIG_MOUSE_SYNAPTICS_I2C is not set -# CONFIG_MOUSE_SYNAPTICS_USB is not set -# CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_TABLET is not set -# CONFIG_INPUT_TOUCHSCREEN is not set -CONFIG_INPUT_MISC=y -# CONFIG_INPUT_AD714X is not set -# CONFIG_INPUT_BMA150 is not set -# CONFIG_INPUT_E3X0_BUTTON is not set -# CONFIG_INPUT_MMA8450 is not set -# CONFIG_INPUT_APANEL is not set -# CONFIG_INPUT_GPIO_BEEPER is not set -# CONFIG_INPUT_GPIO_DECODER is not set -# CONFIG_INPUT_GPIO_VIBRA is not set -# CONFIG_INPUT_ATLAS_BTNS is not set -# CONFIG_INPUT_ATI_REMOTE2 is not set -# CONFIG_INPUT_KEYSPAN_REMOTE is not set -# CONFIG_INPUT_KXTJ9 is not set -# CONFIG_INPUT_POWERMATE is not set -# CONFIG_INPUT_YEALINK is not set -# CONFIG_INPUT_CM109 is not set -CONFIG_INPUT_UINPUT=m -# CONFIG_INPUT_PCF8574 is not set -# CONFIG_INPUT_PWM_BEEPER is not set -# CONFIG_INPUT_PWM_VIBRA is not set -# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set -# CONFIG_INPUT_DA7280_HAPTICS is not set -# CONFIG_INPUT_ADXL34X is not set -# CONFIG_INPUT_IMS_PCU is not set -# CONFIG_INPUT_IQS269A is not set -# CONFIG_INPUT_IQS626A is not set -# CONFIG_INPUT_IQS7222 is not set -# CONFIG_INPUT_CMA3000 is not set -CONFIG_INPUT_XEN_KBDDEV_FRONTEND=m -# CONFIG_INPUT_IDEAPAD_SLIDEBAR is not set -# CONFIG_INPUT_DRV260X_HAPTICS is not set -# CONFIG_INPUT_DRV2665_HAPTICS is not set -# CONFIG_INPUT_DRV2667_HAPTICS is not set -# CONFIG_RMI4_CORE is not set - -# Hardware I/O ports -CONFIG_SERIO=y -CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y -CONFIG_SERIO_I8042=y -# CONFIG_SERIO_SERPORT is not set -# CONFIG_SERIO_CT82C710 is not set -# CONFIG_SERIO_PCIPS2 is not set -CONFIG_SERIO_LIBPS2=y -# CONFIG_SERIO_RAW is not set -# CONFIG_SERIO_ALTERA_PS2 is not set -# CONFIG_SERIO_PS2MULT is not set -# CONFIG_SERIO_ARC_PS2 is not set -CONFIG_HYPERV_KEYBOARD=m -# CONFIG_SERIO_GPIO_PS2 is not set -# CONFIG_USERIO is not set -# CONFIG_GAMEPORT is not set -# end of Hardware I/O ports -# end of Input device support - -# Character devices -CONFIG_TTY=y -CONFIG_VT=y -CONFIG_CONSOLE_TRANSLATIONS=y -CONFIG_VT_CONSOLE=y -CONFIG_VT_CONSOLE_SLEEP=y -CONFIG_VT_HW_CONSOLE_BINDING=y -CONFIG_UNIX98_PTYS=y -# CONFIG_LEGACY_PTYS is not set -# CONFIG_LEGACY_TIOCSTI is not set -# CONFIG_LDISC_AUTOLOAD is not set - -# Serial drivers -CONFIG_SERIAL_EARLYCON=y -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y -CONFIG_SERIAL_8250_PNP=y -# CONFIG_SERIAL_8250_16550A_VARIANTS is not set -# CONFIG_SERIAL_8250_FINTEK is not set -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_DMA=y -CONFIG_SERIAL_8250_PCILIB=y -CONFIG_SERIAL_8250_PCI=y -# CONFIG_SERIAL_8250_EXAR is not set -CONFIG_SERIAL_8250_NR_UARTS=32 -CONFIG_SERIAL_8250_RUNTIME_UARTS=8 -CONFIG_SERIAL_8250_EXTENDED=y -CONFIG_SERIAL_8250_MANY_PORTS=y -# CONFIG_SERIAL_8250_PCI1XXXX is not set -CONFIG_SERIAL_8250_SHARE_IRQ=y -# CONFIG_SERIAL_8250_DETECT_IRQ is not set -CONFIG_SERIAL_8250_RSA=y -CONFIG_SERIAL_8250_DWLIB=y -CONFIG_SERIAL_8250_DW=m -# CONFIG_SERIAL_8250_RT288X is not set -CONFIG_SERIAL_8250_LPSS=m -CONFIG_SERIAL_8250_MID=m -CONFIG_SERIAL_8250_PERICOM=y - -## Non-8250 serial port support -# CONFIG_SERIAL_UARTLITE is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_JSM is not set -# CONFIG_SERIAL_LANTIQ is not set -# CONFIG_SERIAL_SCCNXP is not set -# CONFIG_SERIAL_SC16IS7XX is not set -# CONFIG_SERIAL_ALTERA_JTAGUART is not set -# CONFIG_SERIAL_ALTERA_UART is not set -# CONFIG_SERIAL_ARC is not set -# CONFIG_SERIAL_RP2 is not set -# CONFIG_SERIAL_FSL_LPUART is not set -# CONFIG_SERIAL_FSL_LINFLEXUART is not set -# CONFIG_SERIAL_SPRD is not set -# end of Serial drivers - -CONFIG_SERIAL_MCTRL_GPIO=y -# CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_N_GSM is not set -# CONFIG_NOZOMI is not set -# CONFIG_NULL_TTY is not set -CONFIG_HVC_DRIVER=y -CONFIG_HVC_IRQ=y -CONFIG_HVC_XEN=y -CONFIG_HVC_XEN_FRONTEND=y -CONFIG_SERIAL_DEV_BUS=y -CONFIG_SERIAL_DEV_CTRL_TTYPORT=y -# CONFIG_TTY_PRINTK is not set -CONFIG_VIRTIO_CONSOLE=m -CONFIG_IPMI_HANDLER=m -CONFIG_IPMI_DMI_DECODE=y -CONFIG_IPMI_PLAT_DATA=y -CONFIG_IPMI_PANIC_EVENT=y -CONFIG_IPMI_PANIC_STRING=y -CONFIG_IPMI_DEVICE_INTERFACE=m -CONFIG_IPMI_SI=m -# CONFIG_IPMI_SSIF is not set -CONFIG_IPMI_WATCHDOG=m -CONFIG_IPMI_POWEROFF=m -CONFIG_HW_RANDOM=y -CONFIG_HW_RANDOM_TIMERIOMEM=m -CONFIG_HW_RANDOM_INTEL=m -CONFIG_HW_RANDOM_AMD=m -CONFIG_HW_RANDOM_RDRAND=m -# CONFIG_HW_RANDOM_BA431 is not set -CONFIG_HW_RANDOM_VIA=m -CONFIG_HW_RANDOM_VIRTIO=m -# CONFIG_HW_RANDOM_XIPHERA is not set -# CONFIG_APPLICOM is not set -# CONFIG_MWAVE is not set -CONFIG_DEVMEM=y -CONFIG_NVRAM=m -CONFIG_DEVPORT=y -CONFIG_HPET=y -CONFIG_HPET_MMAP=y -CONFIG_HPET_MMAP_DEFAULT=y -CONFIG_HANGCHECK_TIMER=m -CONFIG_TCG_TPM=y -CONFIG_TCG_TPM2_HMAC=y -# CONFIG_HW_RANDOM_TPM is not set -CONFIG_TCG_TIS_CORE=y -CONFIG_TCG_TIS=y -# CONFIG_TCG_TIS_I2C is not set -# CONFIG_TCG_TIS_I2C_CR50 is not set -CONFIG_TCG_TIS_I2C_ATMEL=m -CONFIG_TCG_TIS_I2C_INFINEON=m -CONFIG_TCG_TIS_I2C_NUVOTON=m -CONFIG_TCG_NSC=m -CONFIG_TCG_ATMEL=m -CONFIG_TCG_INFINEON=m -CONFIG_TCG_XEN=m -CONFIG_TCG_CRB=y -# CONFIG_TCG_VTPM_PROXY is not set -# CONFIG_TCG_TIS_ST33ZP24_I2C is not set -# CONFIG_TELCLOCK is not set -# CONFIG_XILLYBUS is not set -# CONFIG_XILLYUSB is not set -# end of Character devices - -# I2C support -CONFIG_I2C=y -CONFIG_ACPI_I2C_OPREGION=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=m -# CONFIG_I2C_MUX is not set -CONFIG_I2C_HELPER_AUTO=y -CONFIG_I2C_SMBUS=m -CONFIG_I2C_ALGOBIT=m - -# I2C Hardware Bus support - -## PC SMBus host controller drivers -# CONFIG_I2C_ALI1535 is not set -# CONFIG_I2C_ALI1563 is not set -# CONFIG_I2C_ALI15X3 is not set -CONFIG_I2C_AMD756=m -# CONFIG_I2C_AMD756_S4882 is not set -CONFIG_I2C_AMD8111=m -# CONFIG_I2C_AMD_MP2 is not set -CONFIG_I2C_I801=m -# CONFIG_I2C_ISCH is not set -# CONFIG_I2C_ISMT is not set -CONFIG_I2C_PIIX4=m -# CONFIG_I2C_NFORCE2 is not set -# CONFIG_I2C_NVIDIA_GPU is not set -# CONFIG_I2C_SIS5595 is not set -# CONFIG_I2C_SIS630 is not set -# CONFIG_I2C_SIS96X is not set -# CONFIG_I2C_VIA is not set -# CONFIG_I2C_VIAPRO is not set -# CONFIG_I2C_ZHAOXIN is not set - -## ACPI drivers -# CONFIG_I2C_SCMI is not set - -## I2C system bus drivers (mostly embedded / system-on-chip) -# CONFIG_I2C_CBUS_GPIO is not set -CONFIG_I2C_DESIGNWARE_CORE=m -# CONFIG_I2C_DESIGNWARE_SLAVE is not set -CONFIG_I2C_DESIGNWARE_PLATFORM=m -CONFIG_I2C_DESIGNWARE_BAYTRAIL=y -# CONFIG_I2C_DESIGNWARE_PCI is not set -# CONFIG_I2C_EMEV2 is not set -# CONFIG_I2C_GPIO is not set -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PCA_PLATFORM is not set -# CONFIG_I2C_SIMTEC is not set -# CONFIG_I2C_XILINX is not set - -## External I2C/SMBus adapter drivers -# CONFIG_I2C_DIOLAN_U2C is not set -# CONFIG_I2C_CP2615 is not set -# CONFIG_I2C_PCI1XXXX is not set -# CONFIG_I2C_ROBOTFUZZ_OSIF is not set -# CONFIG_I2C_TAOS_EVM is not set -# CONFIG_I2C_TINY_USB is not set - -## Other I2C/SMBus bus drivers -# CONFIG_I2C_MLXCPLD is not set -# CONFIG_I2C_VIRTIO is not set -# end of I2C Hardware Bus support - -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_SLAVE is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# end of I2C support - -# CONFIG_I3C is not set -# CONFIG_SPI is not set -# CONFIG_SPMI is not set -# CONFIG_HSI is not set -CONFIG_PPS=y -# CONFIG_PPS_DEBUG is not set - -## PPS clients support -# CONFIG_PPS_CLIENT_KTIMER is not set -# CONFIG_PPS_CLIENT_LDISC is not set -# CONFIG_PPS_CLIENT_GPIO is not set - -## PPS generators support - -# PTP clock support -CONFIG_PTP_1588_CLOCK=y -CONFIG_PTP_1588_CLOCK_OPTIONAL=y -# CONFIG_DP83640_PHY is not set -# CONFIG_PTP_1588_CLOCK_INES is not set -CONFIG_PTP_1588_CLOCK_KVM=m -# CONFIG_PTP_1588_CLOCK_IDT82P33 is not set -# CONFIG_PTP_1588_CLOCK_IDTCM is not set -# CONFIG_PTP_1588_CLOCK_FC3W is not set -# CONFIG_PTP_1588_CLOCK_MOCK is not set -CONFIG_PTP_1588_CLOCK_VMW=y -# end of PTP clock support - -CONFIG_PINCTRL=y -CONFIG_PINMUX=y -CONFIG_PINCONF=y -CONFIG_GENERIC_PINCONF=y -# CONFIG_DEBUG_PINCTRL is not set -# CONFIG_PINCTRL_AMD is not set -# CONFIG_PINCTRL_CY8C95X0 is not set -# CONFIG_PINCTRL_MCP23S08 is not set -# CONFIG_PINCTRL_SX150X is not set - -# Intel pinctrl drivers -CONFIG_PINCTRL_BAYTRAIL=y -# CONFIG_PINCTRL_CHERRYVIEW is not set -# CONFIG_PINCTRL_LYNXPOINT is not set -CONFIG_PINCTRL_INTEL=y -# CONFIG_PINCTRL_INTEL_PLATFORM is not set -# CONFIG_PINCTRL_ALDERLAKE is not set -CONFIG_PINCTRL_BROXTON=m -# CONFIG_PINCTRL_CANNONLAKE is not set -# CONFIG_PINCTRL_CEDARFORK is not set -# CONFIG_PINCTRL_DENVERTON is not set -# CONFIG_PINCTRL_ELKHARTLAKE is not set -# CONFIG_PINCTRL_EMMITSBURG is not set -# CONFIG_PINCTRL_GEMINILAKE is not set -# CONFIG_PINCTRL_ICELAKE is not set -# CONFIG_PINCTRL_JASPERLAKE is not set -# CONFIG_PINCTRL_LAKEFIELD is not set -# CONFIG_PINCTRL_LEWISBURG is not set -# CONFIG_PINCTRL_METEORLAKE is not set -# CONFIG_PINCTRL_METEORPOINT is not set -# CONFIG_PINCTRL_SUNRISEPOINT is not set -# CONFIG_PINCTRL_TIGERLAKE is not set -# CONFIG_PINCTRL_MERRIFIELD is not set -# CONFIG_PINCTRL_MOOREFIELD is not set -# end of Intel pinctrl drivers - -# Renesas pinctrl drivers -# end of Renesas pinctrl drivers - -CONFIG_GPIOLIB=y -CONFIG_GPIOLIB_FASTPATH_LIMIT=512 -CONFIG_GPIO_ACPI=y -CONFIG_GPIOLIB_IRQCHIP=y -# CONFIG_DEBUG_GPIO is not set -CONFIG_GPIO_SYSFS=y -CONFIG_GPIO_CDEV=y -CONFIG_GPIO_CDEV_V1=y -CONFIG_GPIO_GENERIC=m - -# Memory mapped GPIO drivers -# CONFIG_GPIO_AMDPT is not set -# CONFIG_GPIO_DWAPB is not set -CONFIG_GPIO_GENERIC_PLATFORM=m -# CONFIG_GPIO_GRANITERAPIDS is not set -CONFIG_GPIO_ICH=m -# CONFIG_GPIO_MB86S7X is not set -# CONFIG_GPIO_AMD_FCH is not set -# end of Memory mapped GPIO drivers - -# Port-mapped I/O GPIO drivers -# CONFIG_GPIO_VX855 is not set -# CONFIG_GPIO_F7188X is not set -# CONFIG_GPIO_IT87 is not set -CONFIG_GPIO_SCH=m -# CONFIG_GPIO_SCH311X is not set -# CONFIG_GPIO_WINBOND is not set -# CONFIG_GPIO_WS16C48 is not set -# end of Port-mapped I/O GPIO drivers - -# I2C GPIO expanders -# CONFIG_GPIO_FXL6408 is not set -# CONFIG_GPIO_DS4520 is not set -# CONFIG_GPIO_MAX7300 is not set -# CONFIG_GPIO_MAX732X is not set -# CONFIG_GPIO_PCA953X is not set -# CONFIG_GPIO_PCA9570 is not set -# CONFIG_GPIO_PCF857X is not set -# CONFIG_GPIO_TPIC2810 is not set -# end of I2C GPIO expanders - -# MFD GPIO expanders -# CONFIG_GPIO_ELKHARTLAKE is not set -# end of MFD GPIO expanders - -# PCI GPIO expanders -# CONFIG_GPIO_AMD8111 is not set -# CONFIG_GPIO_BT8XX is not set -# CONFIG_GPIO_MERRIFIELD is not set -# CONFIG_GPIO_ML_IOH is not set -# CONFIG_GPIO_PCI_IDIO_16 is not set -# CONFIG_GPIO_PCIE_IDIO_24 is not set -# CONFIG_GPIO_RDC321X is not set -# end of PCI GPIO expanders - -# USB GPIO expanders -# end of USB GPIO expanders - -# Virtual GPIO drivers -# CONFIG_GPIO_AGGREGATOR is not set -# CONFIG_GPIO_LATCH is not set -# CONFIG_GPIO_MOCKUP is not set -# CONFIG_GPIO_VIRTIO is not set -# CONFIG_GPIO_SIM is not set -# end of Virtual GPIO drivers - -# GPIO Debugging utilities -# CONFIG_GPIO_SLOPPY_LOGIC_ANALYZER is not set -# CONFIG_GPIO_VIRTUSER is not set -# end of GPIO Debugging utilities - -# CONFIG_W1 is not set -# CONFIG_POWER_RESET is not set -# CONFIG_POWER_SEQUENCING is not set -CONFIG_POWER_SUPPLY=y -# CONFIG_POWER_SUPPLY_DEBUG is not set -# CONFIG_GENERIC_ADC_BATTERY is not set -# CONFIG_IP5XXX_POWER is not set -# CONFIG_TEST_POWER is not set -# CONFIG_CHARGER_ADP5061 is not set -# CONFIG_BATTERY_CW2015 is not set -# CONFIG_BATTERY_DS2780 is not set -# CONFIG_BATTERY_DS2781 is not set -# CONFIG_BATTERY_DS2782 is not set -# CONFIG_BATTERY_SAMSUNG_SDI is not set -# CONFIG_BATTERY_SBS is not set -# CONFIG_CHARGER_SBS is not set -# CONFIG_BATTERY_BQ27XXX is not set -# CONFIG_BATTERY_MAX17040 is not set -# CONFIG_BATTERY_MAX17042 is not set -# CONFIG_BATTERY_MAX1720X is not set -# CONFIG_CHARGER_MAX8903 is not set -# CONFIG_CHARGER_LP8727 is not set -# CONFIG_CHARGER_GPIO is not set -# CONFIG_CHARGER_LT3651 is not set -# CONFIG_CHARGER_LTC4162L is not set -# CONFIG_CHARGER_MAX77976 is not set -# CONFIG_CHARGER_BQ2415X is not set -# CONFIG_CHARGER_BQ24257 is not set -# CONFIG_CHARGER_BQ24735 is not set -# CONFIG_CHARGER_BQ2515X is not set -# CONFIG_CHARGER_BQ25890 is not set -# CONFIG_CHARGER_BQ25980 is not set -# CONFIG_CHARGER_BQ256XX is not set -# CONFIG_BATTERY_GAUGE_LTC2941 is not set -# CONFIG_BATTERY_GOLDFISH is not set -# CONFIG_BATTERY_RT5033 is not set -# CONFIG_CHARGER_RT9455 is not set -# CONFIG_CHARGER_BD99954 is not set -# CONFIG_BATTERY_UG3105 is not set -# CONFIG_FUEL_GAUGE_MM8013 is not set -CONFIG_HWMON=m -# CONFIG_HWMON_DEBUG_CHIP is not set - -## Native drivers -# CONFIG_SENSORS_ABITUGURU is not set -# CONFIG_SENSORS_ABITUGURU3 is not set -# CONFIG_SENSORS_AD7414 is not set -# CONFIG_SENSORS_AD7418 is not set -# CONFIG_SENSORS_ADM1025 is not set -# CONFIG_SENSORS_ADM1026 is not set -# CONFIG_SENSORS_ADM1029 is not set -# CONFIG_SENSORS_ADM1031 is not set -# CONFIG_SENSORS_ADM1177 is not set -# CONFIG_SENSORS_ADM9240 is not set -# CONFIG_SENSORS_ADT7410 is not set -# CONFIG_SENSORS_ADT7411 is not set -# CONFIG_SENSORS_ADT7462 is not set -# CONFIG_SENSORS_ADT7470 is not set -# CONFIG_SENSORS_ADT7475 is not set -# CONFIG_SENSORS_AHT10 is not set -# CONFIG_SENSORS_AQUACOMPUTER_D5NEXT is not set -# CONFIG_SENSORS_AS370 is not set -# CONFIG_SENSORS_ASC7621 is not set -# CONFIG_SENSORS_ASUS_ROG_RYUJIN is not set -# CONFIG_SENSORS_AXI_FAN_CONTROL is not set -CONFIG_SENSORS_K8TEMP=m -CONFIG_SENSORS_K10TEMP=m -CONFIG_SENSORS_FAM15H_POWER=m -# CONFIG_SENSORS_APPLESMC is not set -# CONFIG_SENSORS_ASB100 is not set -# CONFIG_SENSORS_ATXP1 is not set -# CONFIG_SENSORS_CHIPCAP2 is not set -# CONFIG_SENSORS_CORSAIR_CPRO is not set -# CONFIG_SENSORS_CORSAIR_PSU is not set -# CONFIG_SENSORS_DRIVETEMP is not set -# CONFIG_SENSORS_DS620 is not set -# CONFIG_SENSORS_DS1621 is not set -# CONFIG_SENSORS_DELL_SMM is not set -# CONFIG_SENSORS_I5K_AMB is not set -# CONFIG_SENSORS_F71805F is not set -# CONFIG_SENSORS_F71882FG is not set -# CONFIG_SENSORS_F75375S is not set -# CONFIG_SENSORS_FSCHMD is not set -# CONFIG_SENSORS_FTSTEUTATES is not set -# CONFIG_SENSORS_GIGABYTE_WATERFORCE is not set -# CONFIG_SENSORS_GL518SM is not set -# CONFIG_SENSORS_GL520SM is not set -# CONFIG_SENSORS_G760A is not set -# CONFIG_SENSORS_G762 is not set -# CONFIG_SENSORS_HIH6130 is not set -# CONFIG_SENSORS_HS3001 is not set -# CONFIG_SENSORS_IBMAEM is not set -# CONFIG_SENSORS_IBMPEX is not set -# CONFIG_SENSORS_IIO_HWMON is not set -# CONFIG_SENSORS_I5500 is not set -CONFIG_SENSORS_CORETEMP=m -# CONFIG_SENSORS_IT87 is not set -# CONFIG_SENSORS_JC42 is not set -# CONFIG_SENSORS_POWERZ is not set -# CONFIG_SENSORS_POWR1220 is not set -# CONFIG_SENSORS_LENOVO_EC is not set -# CONFIG_SENSORS_LINEAGE is not set -# CONFIG_SENSORS_LTC2945 is not set -# CONFIG_SENSORS_LTC2947_I2C is not set -# CONFIG_SENSORS_LTC2990 is not set -# CONFIG_SENSORS_LTC2991 is not set -# CONFIG_SENSORS_LTC2992 is not set -# CONFIG_SENSORS_LTC4151 is not set -# CONFIG_SENSORS_LTC4215 is not set -# CONFIG_SENSORS_LTC4222 is not set -# CONFIG_SENSORS_LTC4245 is not set -# CONFIG_SENSORS_LTC4260 is not set -# CONFIG_SENSORS_LTC4261 is not set -# CONFIG_SENSORS_LTC4282 is not set -# CONFIG_SENSORS_MAX127 is not set -# CONFIG_SENSORS_MAX16065 is not set -# CONFIG_SENSORS_MAX1619 is not set -# CONFIG_SENSORS_MAX1668 is not set -# CONFIG_SENSORS_MAX197 is not set -# CONFIG_SENSORS_MAX31730 is not set -# CONFIG_SENSORS_MAX31760 is not set -# CONFIG_MAX31827 is not set -# CONFIG_SENSORS_MAX6620 is not set -# CONFIG_SENSORS_MAX6621 is not set -# CONFIG_SENSORS_MAX6639 is not set -# CONFIG_SENSORS_MAX6650 is not set -# CONFIG_SENSORS_MAX6697 is not set -# CONFIG_SENSORS_MAX31790 is not set -# CONFIG_SENSORS_MC34VR500 is not set -# CONFIG_SENSORS_MCP3021 is not set -# CONFIG_SENSORS_TC654 is not set -# CONFIG_SENSORS_TPS23861 is not set -# CONFIG_SENSORS_MR75203 is not set -# CONFIG_SENSORS_LM63 is not set -# CONFIG_SENSORS_LM73 is not set -# CONFIG_SENSORS_LM75 is not set -# CONFIG_SENSORS_LM77 is not set -# CONFIG_SENSORS_LM78 is not set -# CONFIG_SENSORS_LM80 is not set -# CONFIG_SENSORS_LM83 is not set -# CONFIG_SENSORS_LM85 is not set -# CONFIG_SENSORS_LM87 is not set -# CONFIG_SENSORS_LM90 is not set -# CONFIG_SENSORS_LM92 is not set -# CONFIG_SENSORS_LM93 is not set -# CONFIG_SENSORS_LM95234 is not set -# CONFIG_SENSORS_LM95241 is not set -# CONFIG_SENSORS_LM95245 is not set -# CONFIG_SENSORS_PC87360 is not set -# CONFIG_SENSORS_PC87427 is not set -# CONFIG_SENSORS_NTC_THERMISTOR is not set -# CONFIG_SENSORS_NCT6683 is not set -# CONFIG_SENSORS_NCT6775 is not set -# CONFIG_SENSORS_NCT6775_I2C is not set -# CONFIG_SENSORS_NCT7802 is not set -# CONFIG_SENSORS_NCT7904 is not set -# CONFIG_SENSORS_NPCM7XX is not set -# CONFIG_SENSORS_NZXT_KRAKEN2 is not set -# CONFIG_SENSORS_NZXT_KRAKEN3 is not set -# CONFIG_SENSORS_NZXT_SMART2 is not set -# CONFIG_SENSORS_OCC_P8_I2C is not set -# CONFIG_SENSORS_OXP is not set -# CONFIG_SENSORS_PCF8591 is not set -# CONFIG_PMBUS is not set -# CONFIG_SENSORS_PT5161L is not set -# CONFIG_SENSORS_PWM_FAN is not set -# CONFIG_SENSORS_SBTSI is not set -# CONFIG_SENSORS_SBRMI is not set -# CONFIG_SENSORS_SHT15 is not set -# CONFIG_SENSORS_SHT21 is not set -# CONFIG_SENSORS_SHT3x is not set -# CONFIG_SENSORS_SHT4x is not set -# CONFIG_SENSORS_SHTC1 is not set -# CONFIG_SENSORS_SIS5595 is not set -# CONFIG_SENSORS_DME1737 is not set -# CONFIG_SENSORS_EMC1403 is not set -# CONFIG_SENSORS_EMC2103 is not set -# CONFIG_SENSORS_EMC2305 is not set -# CONFIG_SENSORS_EMC6W201 is not set -# CONFIG_SENSORS_SMSC47M1 is not set -# CONFIG_SENSORS_SMSC47M192 is not set -# CONFIG_SENSORS_SMSC47B397 is not set -# CONFIG_SENSORS_SCH5627 is not set -# CONFIG_SENSORS_SCH5636 is not set -# CONFIG_SENSORS_STTS751 is not set -# CONFIG_SENSORS_ADC128D818 is not set -# CONFIG_SENSORS_ADS7828 is not set -# CONFIG_SENSORS_AMC6821 is not set -# CONFIG_SENSORS_INA209 is not set -# CONFIG_SENSORS_INA2XX is not set -# CONFIG_SENSORS_INA238 is not set -# CONFIG_SENSORS_INA3221 is not set -# CONFIG_SENSORS_SPD5118 is not set -# CONFIG_SENSORS_TC74 is not set -# CONFIG_SENSORS_THMC50 is not set -# CONFIG_SENSORS_TMP102 is not set -# CONFIG_SENSORS_TMP103 is not set -# CONFIG_SENSORS_TMP108 is not set -# CONFIG_SENSORS_TMP401 is not set -# CONFIG_SENSORS_TMP421 is not set -# CONFIG_SENSORS_TMP464 is not set -# CONFIG_SENSORS_TMP513 is not set -# CONFIG_SENSORS_VIA_CPUTEMP is not set -# CONFIG_SENSORS_VIA686A is not set -# CONFIG_SENSORS_VT1211 is not set -# CONFIG_SENSORS_VT8231 is not set -# CONFIG_SENSORS_W83773G is not set -# CONFIG_SENSORS_W83781D is not set -# CONFIG_SENSORS_W83791D is not set -# CONFIG_SENSORS_W83792D is not set -# CONFIG_SENSORS_W83793 is not set -# CONFIG_SENSORS_W83795 is not set -# CONFIG_SENSORS_W83L785TS is not set -# CONFIG_SENSORS_W83L786NG is not set -# CONFIG_SENSORS_W83627HF is not set -# CONFIG_SENSORS_W83627EHF is not set -# CONFIG_SENSORS_XGENE is not set - -## ACPI drivers -# CONFIG_SENSORS_ACPI_POWER is not set -# CONFIG_SENSORS_ATK0110 is not set -# CONFIG_SENSORS_ASUS_WMI is not set -# CONFIG_SENSORS_ASUS_EC is not set -# CONFIG_SENSORS_HP_WMI is not set -CONFIG_THERMAL=y -# CONFIG_THERMAL_NETLINK is not set -# CONFIG_THERMAL_STATISTICS is not set -# CONFIG_THERMAL_DEBUGFS is not set -# CONFIG_THERMAL_CORE_TESTING is not set -CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 -CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set -# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set -# CONFIG_THERMAL_GOV_FAIR_SHARE is not set -CONFIG_THERMAL_GOV_STEP_WISE=y -# CONFIG_THERMAL_GOV_BANG_BANG is not set -CONFIG_THERMAL_GOV_USER_SPACE=y -# CONFIG_THERMAL_GOV_POWER_ALLOCATOR is not set -# CONFIG_DEVFREQ_THERMAL is not set -# CONFIG_THERMAL_EMULATION is not set - -# Intel thermal drivers -# CONFIG_INTEL_POWERCLAMP is not set -CONFIG_X86_THERMAL_VECTOR=y -CONFIG_INTEL_TCC=y -CONFIG_X86_PKG_TEMP_THERMAL=m -# CONFIG_INTEL_SOC_DTS_THERMAL is not set - -# ACPI INT340X thermal drivers -# CONFIG_INT340X_THERMAL is not set -# end of ACPI INT340X thermal drivers - -# CONFIG_INTEL_PCH_THERMAL is not set -# CONFIG_INTEL_TCC_COOLING is not set -# CONFIG_INTEL_HFI_THERMAL is not set -# end of Intel thermal drivers - -# CONFIG_GENERIC_ADC_THERMAL is not set -CONFIG_WATCHDOG=y -CONFIG_WATCHDOG_CORE=y -# CONFIG_WATCHDOG_NOWAYOUT is not set -CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y -CONFIG_WATCHDOG_OPEN_TIMEOUT=0 -CONFIG_WATCHDOG_SYSFS=y -# CONFIG_WATCHDOG_HRTIMER_PRETIMEOUT is not set - -## Watchdog Pretimeout Governors -# CONFIG_WATCHDOG_PRETIMEOUT_GOV is not set - -## Watchdog Device Drivers -CONFIG_SOFT_WATCHDOG=m -# CONFIG_LENOVO_SE10_WDT is not set -CONFIG_WDAT_WDT=m -# CONFIG_XILINX_WATCHDOG is not set -# CONFIG_ZIIRAVE_WATCHDOG is not set -# CONFIG_CADENCE_WATCHDOG is not set -# CONFIG_DW_WATCHDOG is not set -# CONFIG_MAX63XX_WATCHDOG is not set -# CONFIG_ACQUIRE_WDT is not set -# CONFIG_ADVANTECH_WDT is not set -# CONFIG_ADVANTECH_EC_WDT is not set -# CONFIG_ALIM1535_WDT is not set -# CONFIG_ALIM7101_WDT is not set -# CONFIG_EBC_C384_WDT is not set -# CONFIG_EXAR_WDT is not set -# CONFIG_F71808E_WDT is not set -# CONFIG_SP5100_TCO is not set -# CONFIG_SBC_FITPC2_WATCHDOG is not set -# CONFIG_EUROTECH_WDT is not set -# CONFIG_IB700_WDT is not set -# CONFIG_IBMASR is not set -# CONFIG_WAFER_WDT is not set -# CONFIG_I6300ESB_WDT is not set -# CONFIG_IE6XX_WDT is not set -# CONFIG_INTEL_MID_WATCHDOG is not set -CONFIG_ITCO_WDT=m -CONFIG_ITCO_VENDOR_SUPPORT=y -# CONFIG_IT8712F_WDT is not set -# CONFIG_IT87_WDT is not set -# CONFIG_HP_WATCHDOG is not set -# CONFIG_SC1200_WDT is not set -# CONFIG_PC87413_WDT is not set -# CONFIG_NV_TCO is not set -# CONFIG_60XX_WDT is not set -# CONFIG_CPU5_WDT is not set -# CONFIG_SMSC_SCH311X_WDT is not set -# CONFIG_SMSC37B787_WDT is not set -# CONFIG_TQMX86_WDT is not set -# CONFIG_VIA_WDT is not set -# CONFIG_W83627HF_WDT is not set -# CONFIG_W83877F_WDT is not set -# CONFIG_W83977F_WDT is not set -# CONFIG_MACHZ_WDT is not set -# CONFIG_SBC_EPX_C3_WATCHDOG is not set -# CONFIG_INTEL_MEI_WDT is not set -# CONFIG_NI903X_WDT is not set -# CONFIG_NIC7018_WDT is not set -# CONFIG_MEN_A21_WDT is not set -# CONFIG_XEN_WDT is not set - -## PCI-based Watchdog Cards -# CONFIG_PCIPCWATCHDOG is not set -# CONFIG_WDTPCI is not set - -## USB-based Watchdog Cards -# CONFIG_USBPCWATCHDOG is not set -CONFIG_SSB_POSSIBLE=y -CONFIG_SSB=m -CONFIG_SSB_SPROM=y -CONFIG_SSB_PCIHOST_POSSIBLE=y -CONFIG_SSB_PCIHOST=y -CONFIG_SSB_SDIOHOST_POSSIBLE=y -# CONFIG_SSB_SDIOHOST is not set -CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y -CONFIG_SSB_DRIVER_PCICORE=y -# CONFIG_SSB_DRIVER_GPIO is not set -CONFIG_BCMA_POSSIBLE=y -# CONFIG_BCMA is not set - -# Multifunction device drivers -CONFIG_MFD_CORE=m -# CONFIG_MFD_AS3711 is not set -# CONFIG_MFD_SMPRO is not set -# CONFIG_PMIC_ADP5520 is not set -# CONFIG_MFD_AAT2870_CORE is not set -# CONFIG_MFD_BCM590XX is not set -# CONFIG_MFD_BD9571MWV is not set -# CONFIG_MFD_AXP20X_I2C is not set -# CONFIG_MFD_CS42L43_I2C is not set -# CONFIG_MFD_MADERA is not set -# CONFIG_PMIC_DA903X is not set -# CONFIG_MFD_DA9052_I2C is not set -# CONFIG_MFD_DA9055 is not set -# CONFIG_MFD_DA9062 is not set -# CONFIG_MFD_DA9063 is not set -# CONFIG_MFD_DA9150 is not set -# CONFIG_MFD_DLN2 is not set -# CONFIG_MFD_MC13XXX_I2C is not set -# CONFIG_MFD_MP2629 is not set -# CONFIG_MFD_INTEL_QUARK_I2C_GPIO is not set -CONFIG_LPC_ICH=m -CONFIG_LPC_SCH=m -# CONFIG_INTEL_SOC_PMIC_MRFLD is not set -CONFIG_MFD_INTEL_LPSS=m -CONFIG_MFD_INTEL_LPSS_ACPI=m -CONFIG_MFD_INTEL_LPSS_PCI=m -# CONFIG_MFD_INTEL_PMC_BXT is not set -# CONFIG_MFD_IQS62X is not set -# CONFIG_MFD_JANZ_CMODIO is not set -# CONFIG_MFD_KEMPLD is not set -# CONFIG_MFD_88PM800 is not set -# CONFIG_MFD_88PM805 is not set -# CONFIG_MFD_88PM860X is not set -# CONFIG_MFD_MAX14577 is not set -# CONFIG_MFD_MAX77541 is not set -# CONFIG_MFD_MAX77693 is not set -# CONFIG_MFD_MAX77843 is not set -# CONFIG_MFD_MAX8907 is not set -# CONFIG_MFD_MAX8925 is not set -# CONFIG_MFD_MAX8997 is not set -# CONFIG_MFD_MAX8998 is not set -# CONFIG_MFD_MT6360 is not set -# CONFIG_MFD_MT6370 is not set -# CONFIG_MFD_MT6397 is not set -# CONFIG_MFD_MENF21BMC is not set -# CONFIG_MFD_VIPERBOARD is not set -# CONFIG_MFD_RETU is not set -# CONFIG_MFD_PCF50633 is not set -# CONFIG_MFD_SY7636A is not set -# CONFIG_MFD_RDC321X is not set -# CONFIG_MFD_RT4831 is not set -# CONFIG_MFD_RT5033 is not set -# CONFIG_MFD_RT5120 is not set -# CONFIG_MFD_RC5T583 is not set -# CONFIG_MFD_SI476X_CORE is not set -# CONFIG_MFD_SM501 is not set -# CONFIG_MFD_SKY81452 is not set -# CONFIG_MFD_SYSCON is not set -# CONFIG_MFD_LP3943 is not set -# CONFIG_MFD_LP8788 is not set -# CONFIG_MFD_TI_LMU is not set -# CONFIG_MFD_PALMAS is not set -# CONFIG_TPS6105X is not set -# CONFIG_TPS65010 is not set -# CONFIG_TPS6507X is not set -# CONFIG_MFD_TPS65086 is not set -# CONFIG_MFD_TPS65090 is not set -# CONFIG_MFD_TI_LP873X is not set -# CONFIG_MFD_TPS6586X is not set -# CONFIG_MFD_TPS65910 is not set -# CONFIG_MFD_TPS65912_I2C is not set -# CONFIG_MFD_TPS6594_I2C is not set -# CONFIG_TWL4030_CORE is not set -# CONFIG_TWL6040_CORE is not set -# CONFIG_MFD_WL1273_CORE is not set -# CONFIG_MFD_LM3533 is not set -# CONFIG_MFD_TQMX86 is not set -# CONFIG_MFD_VX855 is not set -# CONFIG_MFD_ARIZONA_I2C is not set -# CONFIG_MFD_WM8400 is not set -# CONFIG_MFD_WM831X_I2C is not set -# CONFIG_MFD_WM8350_I2C is not set -# CONFIG_MFD_WM8994 is not set -# CONFIG_MFD_ATC260X_I2C is not set -# CONFIG_MFD_CS40L50_I2C is not set -# CONFIG_RAVE_SP_CORE is not set -# end of Multifunction device drivers - -# CONFIG_REGULATOR is not set -# CONFIG_RC_CORE is not set - -# CEC support -# CONFIG_MEDIA_CEC_SUPPORT is not set -# end of CEC support - -# CONFIG_MEDIA_SUPPORT is not set - -# Graphics support -CONFIG_APERTURE_HELPERS=y -CONFIG_SCREEN_INFO=y -CONFIG_VIDEO=y -# CONFIG_AUXDISPLAY is not set -CONFIG_AGP=y -# CONFIG_AGP_AMD64 is not set -CONFIG_AGP_INTEL=m -# CONFIG_AGP_SIS is not set -# CONFIG_AGP_VIA is not set -CONFIG_INTEL_GTT=m -# CONFIG_VGA_SWITCHEROO is not set -CONFIG_GPU_BUDDY=y -CONFIG_DRM=m -CONFIG_DRM_MIPI_DSI=y -# CONFIG_DRM_DEBUG_MM is not set -CONFIG_DRM_KMS_HELPER=m -CONFIG_DRM_DRAW=y -CONFIG_DRM_PANIC=y -CONFIG_DRM_PANIC_FOREGROUND_COLOR=0xffffff -CONFIG_DRM_PANIC_BACKGROUND_COLOR=0x000000 -CONFIG_DRM_PANIC_DEBUG=y -CONFIG_DRM_PANIC_SCREEN="user" -# CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS is not set -# CONFIG_DRM_DEBUG_MODESET_LOCK is not set -CONFIG_DRM_CLIENT_SELECTION=y -CONFIG_DRM_CLIENT_SETUP=y -CONFIG_DRM_FBDEV_EMULATION=y -CONFIG_DRM_FBDEV_OVERALLOC=100 -# CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM is not set -# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set -CONFIG_DRM_DISPLAY_HELPER=m -# CONFIG_DRM_DISPLAY_DP_AUX_CEC is not set -# CONFIG_DRM_DISPLAY_DP_AUX_CHARDEV is not set -CONFIG_DRM_DISPLAY_DP_HELPER=y -CONFIG_DRM_DISPLAY_HDCP_HELPER=y -CONFIG_DRM_DISPLAY_HDMI_HELPER=y -CONFIG_DRM_TTM=m -CONFIG_DRM_EXEC=m -CONFIG_DRM_GPUVM=m -CONFIG_DRM_BUDDY=m -CONFIG_DRM_TTM_HELPER=m -CONFIG_DRM_GEM_SHMEM_HELPER=m -CONFIG_DRM_SUBALLOC_HELPER=m -CONFIG_DRM_SCHED=m - -# I2C encoder or helper chips -# CONFIG_DRM_I2C_CH7006 is not set -# CONFIG_DRM_I2C_SIL164 is not set -# CONFIG_DRM_I2C_NXP_TDA998X is not set -# CONFIG_DRM_I2C_NXP_TDA9950 is not set -# end of I2C encoder or helper chips - -# ARM devices -# end of ARM devices - -CONFIG_DRM_RADEON=m -CONFIG_DRM_RADEON_USERPTR=y -CONFIG_DRM_AMDGPU=m -CONFIG_DRM_AMDGPU_SI=y -CONFIG_DRM_AMDGPU_CIK=y -CONFIG_DRM_AMDGPU_USERPTR=y -# CONFIG_DRM_AMD_ISP is not set -# CONFIG_DRM_AMDGPU_WERROR is not set - -# ACP (Audio CoProcessor) Configuration -# CONFIG_DRM_AMD_ACP is not set -# end of ACP (Audio CoProcessor) Configuration - -# Display Engine Configuration -CONFIG_DRM_AMD_DC=y -CONFIG_DRM_AMD_DC_FP=y -# CONFIG_DRM_AMD_DC_SI is not set -# CONFIG_DRM_AMD_SECURE_DISPLAY is not set -# end of Display Engine Configuration - -CONFIG_HSA_AMD=y -CONFIG_DRM_NOUVEAU=m -CONFIG_NOUVEAU_DEBUG=5 -CONFIG_NOUVEAU_DEBUG_DEFAULT=3 -# CONFIG_NOUVEAU_DEBUG_MMU is not set -# CONFIG_NOUVEAU_DEBUG_PUSH is not set -CONFIG_DRM_NOUVEAU_BACKLIGHT=y -# CONFIG_DRM_NOUVEAU_GSP_DEFAULT is not set -CONFIG_DRM_I915=m -CONFIG_DRM_I915_FORCE_PROBE="" -# CONFIG_DRM_I915_CAPTURE_ERROR is not set -CONFIG_DRM_I915_USERPTR=y -# CONFIG_DRM_I915_GVT_KVMGT is not set - -# drm/i915 Debugging -# CONFIG_DRM_I915_WERROR is not set -# CONFIG_DRM_I915_REPLAY_GPU_HANGS_API is not set -# CONFIG_DRM_I915_DEBUG is not set -# CONFIG_DRM_I915_DEBUG_MMIO is not set -# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set -# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set -# CONFIG_DRM_I915_DEBUG_GUC is not set -# CONFIG_DRM_I915_SELFTEST is not set -# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set -# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set -# CONFIG_DRM_I915_DEBUG_RUNTIME_PM is not set -# CONFIG_DRM_I915_DEBUG_WAKEREF is not set -# end of drm/i915 Debugging - -# drm/i915 Profile Guided Optimisation -CONFIG_DRM_I915_REQUEST_TIMEOUT=20000 -CONFIG_DRM_I915_FENCE_TIMEOUT=10000 -CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250 -CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500 -CONFIG_DRM_I915_PREEMPT_TIMEOUT=640 -CONFIG_DRM_I915_PREEMPT_TIMEOUT_COMPUTE=7500 -CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000 -CONFIG_DRM_I915_STOP_TIMEOUT=100 -CONFIG_DRM_I915_TIMESLICE_DURATION=1 -# end of drm/i915 Profile Guided Optimisation - -# CONFIG_DRM_XE is not set -# CONFIG_DRM_VGEM is not set -# CONFIG_DRM_VKMS is not set -CONFIG_DRM_VMWGFX=m -# CONFIG_DRM_VMWGFX_MKSSTATS is not set -# CONFIG_DRM_GMA500 is not set -# CONFIG_DRM_UDL is not set -# CONFIG_DRM_AST is not set -# CONFIG_DRM_MGAG200 is not set -# CONFIG_DRM_QXL is not set -# CONFIG_DRM_VIRTIO_GPU is not set -CONFIG_DRM_PANEL=y - -# Display Panels -# CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN is not set -# end of Display Panels - -CONFIG_DRM_BRIDGE=y -CONFIG_DRM_PANEL_BRIDGE=y - -# Display Interface Bridges -# CONFIG_DRM_ANALOGIX_ANX78XX is not set -# end of Display Interface Bridges - -# CONFIG_DRM_ETNAVIV is not set -# CONFIG_DRM_BOCHS is not set -CONFIG_DRM_CIRRUS_QEMU=m -# CONFIG_DRM_GM12U320 is not set -# CONFIG_DRM_SIMPLEDRM is not set -# CONFIG_DRM_XEN_FRONTEND is not set -# CONFIG_DRM_VBOXVIDEO is not set -# CONFIG_DRM_GUD is not set -# CONFIG_DRM_SSD130X is not set -# CONFIG_DRM_HYPERV is not set -CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y - -# Frame buffer Devices -CONFIG_FB=y -CONFIG_FB_CIRRUS=m -# CONFIG_FB_PM2 is not set -# CONFIG_FB_CYBER2000 is not set -# CONFIG_FB_ARC is not set -# CONFIG_FB_ASILIANT is not set -# CONFIG_FB_IMSTT is not set -# CONFIG_FB_VGA16 is not set -# CONFIG_FB_UVESA is not set -CONFIG_FB_VESA=y -CONFIG_FB_EFI=y -# CONFIG_FB_N411 is not set -# CONFIG_FB_HGA is not set -# CONFIG_FB_OPENCORES is not set -# CONFIG_FB_S1D13XXX is not set -CONFIG_FB_NVIDIA=m -# CONFIG_FB_NVIDIA_I2C is not set -# CONFIG_FB_NVIDIA_DEBUG is not set -CONFIG_FB_NVIDIA_BACKLIGHT=y -# CONFIG_FB_RIVA is not set -CONFIG_FB_I740=m -# CONFIG_FB_MATROX is not set -CONFIG_FB_RADEON=m -CONFIG_FB_RADEON_I2C=y -CONFIG_FB_RADEON_BACKLIGHT=y -# CONFIG_FB_RADEON_DEBUG is not set -# CONFIG_FB_ATY128 is not set -# CONFIG_FB_ATY is not set -# CONFIG_FB_S3 is not set -# CONFIG_FB_SAVAGE is not set -# CONFIG_FB_SIS is not set -# CONFIG_FB_VIA is not set -# CONFIG_FB_NEOMAGIC is not set -# CONFIG_FB_KYRO is not set -# CONFIG_FB_3DFX is not set -# CONFIG_FB_VOODOO1 is not set -# CONFIG_FB_VT8623 is not set -# CONFIG_FB_TRIDENT is not set -# CONFIG_FB_ARK is not set -# CONFIG_FB_PM3 is not set -# CONFIG_FB_CARMINE is not set -# CONFIG_FB_SMSCUFX is not set -# CONFIG_FB_UDL is not set -# CONFIG_FB_IBM_GXT4500 is not set -# CONFIG_FB_VIRTUAL is not set -CONFIG_XEN_FBDEV_FRONTEND=m -# CONFIG_FB_METRONOME is not set -# CONFIG_FB_MB862XX is not set -CONFIG_FB_HYPERV=m -# CONFIG_FB_SIMPLE is not set -# CONFIG_FB_SSD1307 is not set -# CONFIG_FB_SM712 is not set -CONFIG_FB_CORE=y -CONFIG_FB_NOTIFY=y -# CONFIG_FIRMWARE_EDID is not set -CONFIG_FB_DEVICE=y -CONFIG_FB_DDC=m -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_IMAGEBLIT=y -CONFIG_FB_SYS_FILLRECT=y -CONFIG_FB_SYS_COPYAREA=y -CONFIG_FB_SYS_IMAGEBLIT=y -# CONFIG_FB_FOREIGN_ENDIAN is not set -CONFIG_FB_SYSMEM_FOPS=y -CONFIG_FB_DEFERRED_IO=y -CONFIG_FB_IOMEM_FOPS=y -CONFIG_FB_IOMEM_HELPERS=y -CONFIG_FB_IOMEM_HELPERS_DEFERRED=y -CONFIG_FB_SYSMEM_HELPERS=y -CONFIG_FB_SYSMEM_HELPERS_DEFERRED=y -CONFIG_FB_BACKLIGHT=m -CONFIG_FB_MODE_HELPERS=y -# CONFIG_FB_TILEBLITTING is not set -# end of Frame buffer Devices - -# Backlight & LCD device support -# CONFIG_LCD_CLASS_DEVICE is not set -CONFIG_BACKLIGHT_CLASS_DEVICE=y -# CONFIG_BACKLIGHT_KTD253 is not set -# CONFIG_BACKLIGHT_KTD2801 is not set -# CONFIG_BACKLIGHT_KTZ8866 is not set -# CONFIG_BACKLIGHT_PWM is not set -# CONFIG_BACKLIGHT_APPLE is not set -# CONFIG_BACKLIGHT_QCOM_WLED is not set -# CONFIG_BACKLIGHT_SAHARA is not set -# CONFIG_BACKLIGHT_ADP8860 is not set -# CONFIG_BACKLIGHT_ADP8870 is not set -# CONFIG_BACKLIGHT_LM3509 is not set -# CONFIG_BACKLIGHT_LM3630A is not set -# CONFIG_BACKLIGHT_LM3639 is not set -# CONFIG_BACKLIGHT_LP855X is not set -# CONFIG_BACKLIGHT_MP3309C is not set -# CONFIG_BACKLIGHT_GPIO is not set -# CONFIG_BACKLIGHT_LV5207LP is not set -# CONFIG_BACKLIGHT_BD6107 is not set -# CONFIG_BACKLIGHT_ARCXCNN is not set -# end of Backlight & LCD device support - -CONFIG_VGASTATE=m -CONFIG_HDMI=y - -# Console display driver support -CONFIG_VGA_CONSOLE=y -CONFIG_DUMMY_CONSOLE=y -CONFIG_DUMMY_CONSOLE_COLUMNS=80 -CONFIG_DUMMY_CONSOLE_ROWS=25 -CONFIG_FRAMEBUFFER_CONSOLE=y -# CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is not set -CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y -CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y -# CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is not set -# end of Console display driver support - -# CONFIG_LOGO is not set -# end of Graphics support - -# CONFIG_DRM_ACCEL is not set -CONFIG_SOUND=m -CONFIG_SND=m -CONFIG_SND_TIMER=m -CONFIG_SND_PCM=m -CONFIG_SND_RAWMIDI=m -CONFIG_SND_COMPRESS_OFFLOAD=m -CONFIG_SND_JACK=y -CONFIG_SND_JACK_INPUT_DEV=y -# CONFIG_SND_OSSEMUL is not set -CONFIG_SND_PCM_TIMER=y -# CONFIG_SND_HRTIMER is not set -CONFIG_SND_DYNAMIC_MINORS=y -CONFIG_SND_MAX_CARDS=4 -CONFIG_SND_SUPPORT_OLD_API=y -CONFIG_SND_PROC_FS=y -CONFIG_SND_VERBOSE_PROCFS=y -CONFIG_SND_CTL_FAST_LOOKUP=y -# CONFIG_SND_DEBUG is not set -# CONFIG_SND_CTL_INPUT_VALIDATION is not set -# CONFIG_SND_UTIMER is not set -CONFIG_SND_VMASTER=y -CONFIG_SND_DMA_SGBUF=y -CONFIG_SND_CTL_LED=m -# CONFIG_SND_SEQUENCER is not set -CONFIG_SND_AC97_CODEC=m -CONFIG_SND_DRIVERS=y -# CONFIG_SND_DUMMY is not set -# CONFIG_SND_ALOOP is not set -# CONFIG_SND_PCMTEST is not set -# CONFIG_SND_MTPAV is not set -# CONFIG_SND_SERIAL_U16550 is not set -# CONFIG_SND_MPU401 is not set -# CONFIG_SND_AC97_POWER_SAVE is not set -CONFIG_SND_PCI=y -# CONFIG_SND_AD1889 is not set -# CONFIG_SND_ALS300 is not set -# CONFIG_SND_ALS4000 is not set -# CONFIG_SND_ALI5451 is not set -# CONFIG_SND_ASIHPI is not set -# CONFIG_SND_ATIIXP is not set -# CONFIG_SND_ATIIXP_MODEM is not set -# CONFIG_SND_AU8810 is not set -# CONFIG_SND_AU8820 is not set -# CONFIG_SND_AU8830 is not set -# CONFIG_SND_AW2 is not set -# CONFIG_SND_AZT3328 is not set -# CONFIG_SND_BT87X is not set -# CONFIG_SND_CA0106 is not set -# CONFIG_SND_CMIPCI is not set -# CONFIG_SND_OXYGEN is not set -# CONFIG_SND_CS4281 is not set -# CONFIG_SND_CS46XX is not set -# CONFIG_SND_CTXFI is not set -# CONFIG_SND_DARLA20 is not set -# CONFIG_SND_GINA20 is not set -# CONFIG_SND_LAYLA20 is not set -# CONFIG_SND_DARLA24 is not set -# CONFIG_SND_GINA24 is not set -# CONFIG_SND_LAYLA24 is not set -# CONFIG_SND_MONA is not set -# CONFIG_SND_MIA is not set -# CONFIG_SND_ECHO3G is not set -# CONFIG_SND_INDIGO is not set -# CONFIG_SND_INDIGOIO is not set -# CONFIG_SND_INDIGODJ is not set -# CONFIG_SND_INDIGOIOX is not set -# CONFIG_SND_INDIGODJX is not set -# CONFIG_SND_EMU10K1 is not set -# CONFIG_SND_EMU10K1X is not set -# CONFIG_SND_ENS1370 is not set -CONFIG_SND_ENS1371=m -# CONFIG_SND_ES1938 is not set -# CONFIG_SND_ES1968 is not set -# CONFIG_SND_FM801 is not set -# CONFIG_SND_HDSP is not set -# CONFIG_SND_HDSPM is not set -# CONFIG_SND_ICE1712 is not set -# CONFIG_SND_ICE1724 is not set -# CONFIG_SND_INTEL8X0 is not set -# CONFIG_SND_INTEL8X0M is not set -# CONFIG_SND_KORG1212 is not set -# CONFIG_SND_LOLA is not set -# CONFIG_SND_LX6464ES is not set -# CONFIG_SND_MAESTRO3 is not set -# CONFIG_SND_MIXART is not set -# CONFIG_SND_NM256 is not set -# CONFIG_SND_PCXHR is not set -# CONFIG_SND_RIPTIDE is not set -# CONFIG_SND_RME32 is not set -# CONFIG_SND_RME96 is not set -# CONFIG_SND_RME9652 is not set -# CONFIG_SND_SE6X is not set -# CONFIG_SND_SONICVIBES is not set -# CONFIG_SND_TRIDENT is not set -# CONFIG_SND_VIA82XX is not set -# CONFIG_SND_VIA82XX_MODEM is not set -# CONFIG_SND_VIRTUOSO is not set -# CONFIG_SND_VX222 is not set -# CONFIG_SND_YMFPCI is not set - -# HD-Audio -CONFIG_SND_HDA=m -CONFIG_SND_HDA_GENERIC_LEDS=y -CONFIG_SND_HDA_INTEL=m -# CONFIG_SND_HDA_HWDEP is not set -# CONFIG_SND_HDA_RECONFIG is not set -# CONFIG_SND_HDA_INPUT_BEEP is not set -# CONFIG_SND_HDA_PATCH_LOADER is not set -CONFIG_SND_HDA_SCODEC_COMPONENT=m -# CONFIG_SND_HDA_SCODEC_CS35L41_I2C is not set -# CONFIG_SND_HDA_SCODEC_CS35L56_I2C is not set -# CONFIG_SND_HDA_SCODEC_TAS2781_I2C is not set -CONFIG_SND_HDA_CODEC_REALTEK=m -# CONFIG_SND_HDA_CODEC_ANALOG is not set -# CONFIG_SND_HDA_CODEC_SIGMATEL is not set -# CONFIG_SND_HDA_CODEC_VIA is not set -CONFIG_SND_HDA_CODEC_HDMI=m -# CONFIG_SND_HDA_CODEC_CIRRUS is not set -# CONFIG_SND_HDA_CODEC_CS8409 is not set -# CONFIG_SND_HDA_CODEC_CONEXANT is not set -# CONFIG_SND_HDA_CODEC_SENARYTECH is not set -# CONFIG_SND_HDA_CODEC_CA0110 is not set -# CONFIG_SND_HDA_CODEC_CA0132 is not set -# CONFIG_SND_HDA_CODEC_CMEDIA is not set -# CONFIG_SND_HDA_CODEC_SI3054 is not set -CONFIG_SND_HDA_GENERIC=m -CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 -# CONFIG_SND_HDA_INTEL_HDMI_SILENT_STREAM is not set -# CONFIG_SND_HDA_CTL_DEV_ID is not set -# end of HD-Audio - -CONFIG_SND_HDA_CORE=m -CONFIG_SND_HDA_COMPONENT=y -CONFIG_SND_HDA_I915=y -CONFIG_SND_HDA_PREALLOC_SIZE=0 -CONFIG_SND_INTEL_NHLT=y -CONFIG_SND_INTEL_DSP_CONFIG=m -CONFIG_SND_INTEL_SOUNDWIRE_ACPI=m -CONFIG_SND_USB=y -# CONFIG_SND_USB_AUDIO is not set -# CONFIG_SND_USB_UA101 is not set -# CONFIG_SND_USB_USX2Y is not set -# CONFIG_SND_USB_CAIAQ is not set -# CONFIG_SND_USB_US122L is not set -# CONFIG_SND_USB_6FIRE is not set -# CONFIG_SND_USB_HIFACE is not set -# CONFIG_SND_BCD2000 is not set -# CONFIG_SND_USB_POD is not set -# CONFIG_SND_USB_PODHD is not set -# CONFIG_SND_USB_TONEPORT is not set -# CONFIG_SND_USB_VARIAX is not set -CONFIG_SND_SOC=m -CONFIG_SND_SOC_COMPRESS=y -CONFIG_SND_SOC_ACPI=m -# CONFIG_SND_SOC_ADI is not set -# CONFIG_SND_SOC_AMD_ACP is not set -# CONFIG_SND_SOC_AMD_ACP3x is not set -# CONFIG_SND_SOC_AMD_RENOIR is not set -# CONFIG_SND_SOC_AMD_ACP5x is not set -# CONFIG_SND_SOC_AMD_ACP6x is not set -# CONFIG_SND_AMD_ACP_CONFIG is not set -# CONFIG_SND_SOC_AMD_ACP_COMMON is not set -# CONFIG_SND_SOC_AMD_RPL_ACP6x is not set -# CONFIG_SND_ATMEL_SOC is not set -# CONFIG_SND_BCM63XX_I2S_WHISTLER is not set -# CONFIG_SND_DESIGNWARE_I2S is not set - -# SoC Audio for Freescale CPUs - -## Common SoC Audio options for Freescale CPUs: -# CONFIG_SND_SOC_FSL_ASRC is not set -# CONFIG_SND_SOC_FSL_SAI is not set -# CONFIG_SND_SOC_FSL_AUDMIX is not set -# CONFIG_SND_SOC_FSL_SSI is not set -# CONFIG_SND_SOC_FSL_SPDIF is not set -# CONFIG_SND_SOC_FSL_ESAI is not set -# CONFIG_SND_SOC_FSL_MICFIL is not set -# CONFIG_SND_SOC_FSL_XCVR is not set -# CONFIG_SND_SOC_IMX_AUDMUX is not set -# end of SoC Audio for Freescale CPUs - -# CONFIG_SND_SOC_CHV3_I2S is not set -# CONFIG_SND_I2S_HI6210_I2S is not set -# CONFIG_SND_SOC_IMG is not set -CONFIG_SND_SOC_INTEL_SST_TOPLEVEL=y -# CONFIG_SND_SOC_INTEL_CATPT is not set -CONFIG_SND_SST_ATOM_HIFI2_PLATFORM=m -# CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_PCI is not set -CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI=m -CONFIG_SND_SOC_ACPI_INTEL_MATCH=m -# CONFIG_SND_SOC_INTEL_AVS is not set -CONFIG_SND_SOC_INTEL_MACH=y -# CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES is not set -# CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH is not set -# CONFIG_SND_SOC_INTEL_BYTCR_RT5651_MACH is not set -# CONFIG_SND_SOC_INTEL_CHT_BSW_RT5672_MACH is not set -# CONFIG_SND_SOC_INTEL_CHT_BSW_RT5645_MACH is not set -# CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH is not set -# CONFIG_SND_SOC_INTEL_CHT_BSW_NAU8824_MACH is not set -# CONFIG_SND_SOC_INTEL_BYT_CHT_CX2072X_MACH is not set -# CONFIG_SND_SOC_INTEL_BYT_CHT_DA7213_MACH is not set -# CONFIG_SND_SOC_INTEL_BYT_CHT_ES8316_MACH is not set -# CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH is not set -# CONFIG_SND_SOC_MTK_BTCVSD is not set -# CONFIG_SND_SOC_SOF_TOPLEVEL is not set - -# STMicroelectronics STM32 SOC audio support -# end of STMicroelectronics STM32 SOC audio support - -# CONFIG_SND_SOC_XILINX_I2S is not set -# CONFIG_SND_SOC_XILINX_AUDIO_FORMATTER is not set -# CONFIG_SND_SOC_XILINX_SPDIF is not set -# CONFIG_SND_SOC_XTFPGA_I2S is not set -CONFIG_SND_SOC_I2C_AND_SPI=m - -# CODEC drivers -# CONFIG_SND_SOC_AC97_CODEC is not set -# CONFIG_SND_SOC_ADAU1372_I2C is not set -# CONFIG_SND_SOC_ADAU1701 is not set -# CONFIG_SND_SOC_ADAU1761_I2C is not set -# CONFIG_SND_SOC_ADAU7002 is not set -# CONFIG_SND_SOC_ADAU7118_HW is not set -# CONFIG_SND_SOC_ADAU7118_I2C is not set -# CONFIG_SND_SOC_AK4118 is not set -# CONFIG_SND_SOC_AK4375 is not set -# CONFIG_SND_SOC_AK4458 is not set -# CONFIG_SND_SOC_AK4554 is not set -# CONFIG_SND_SOC_AK4613 is not set -# CONFIG_SND_SOC_AK4619 is not set -# CONFIG_SND_SOC_AK4642 is not set -# CONFIG_SND_SOC_AK5386 is not set -# CONFIG_SND_SOC_AK5558 is not set -# CONFIG_SND_SOC_ALC5623 is not set -# CONFIG_SND_SOC_AUDIO_IIO_AUX is not set -# CONFIG_SND_SOC_AW8738 is not set -# CONFIG_SND_SOC_AW88395 is not set -# CONFIG_SND_SOC_AW88261 is not set -# CONFIG_SND_SOC_AW87390 is not set -# CONFIG_SND_SOC_AW88399 is not set -# CONFIG_SND_SOC_BD28623 is not set -# CONFIG_SND_SOC_BT_SCO is not set -# CONFIG_SND_SOC_CHV3_CODEC is not set -# CONFIG_SND_SOC_CS35L32 is not set -# CONFIG_SND_SOC_CS35L33 is not set -# CONFIG_SND_SOC_CS35L34 is not set -# CONFIG_SND_SOC_CS35L35 is not set -# CONFIG_SND_SOC_CS35L36 is not set -# CONFIG_SND_SOC_CS35L41_I2C is not set -# CONFIG_SND_SOC_CS35L45_I2C is not set -# CONFIG_SND_SOC_CS35L56_I2C is not set -# CONFIG_SND_SOC_CS42L42 is not set -# CONFIG_SND_SOC_CS42L51_I2C is not set -# CONFIG_SND_SOC_CS42L52 is not set -# CONFIG_SND_SOC_CS42L56 is not set -# CONFIG_SND_SOC_CS42L73 is not set -# CONFIG_SND_SOC_CS42L83 is not set -# CONFIG_SND_SOC_CS4234 is not set -# CONFIG_SND_SOC_CS4265 is not set -# CONFIG_SND_SOC_CS4270 is not set -# CONFIG_SND_SOC_CS4271_I2C is not set -# CONFIG_SND_SOC_CS42XX8_I2C is not set -# CONFIG_SND_SOC_CS43130 is not set -# CONFIG_SND_SOC_CS4341 is not set -# CONFIG_SND_SOC_CS4349 is not set -# CONFIG_SND_SOC_CS53L30 is not set -# CONFIG_SND_SOC_CS530X_I2C is not set -# CONFIG_SND_SOC_CX2072X is not set -# CONFIG_SND_SOC_DA7213 is not set -# CONFIG_SND_SOC_DMIC is not set -# CONFIG_SND_SOC_ES7134 is not set -# CONFIG_SND_SOC_ES7241 is not set -# CONFIG_SND_SOC_ES8311 is not set -# CONFIG_SND_SOC_ES8316 is not set -# CONFIG_SND_SOC_ES8326 is not set -# CONFIG_SND_SOC_ES8328_I2C is not set -# CONFIG_SND_SOC_GTM601 is not set -# CONFIG_SND_SOC_HDA is not set -# CONFIG_SND_SOC_ICS43432 is not set -# CONFIG_SND_SOC_MAX98088 is not set -# CONFIG_SND_SOC_MAX98090 is not set -# CONFIG_SND_SOC_MAX98357A is not set -# CONFIG_SND_SOC_MAX98504 is not set -# CONFIG_SND_SOC_MAX9867 is not set -# CONFIG_SND_SOC_MAX98927 is not set -# CONFIG_SND_SOC_MAX98520 is not set -# CONFIG_SND_SOC_MAX98373_I2C is not set -# CONFIG_SND_SOC_MAX98388 is not set -# CONFIG_SND_SOC_MAX98390 is not set -# CONFIG_SND_SOC_MAX98396 is not set -# CONFIG_SND_SOC_MAX9860 is not set -# CONFIG_SND_SOC_MSM8916_WCD_DIGITAL is not set -# CONFIG_SND_SOC_PCM1681 is not set -# CONFIG_SND_SOC_PCM1789_I2C is not set -# CONFIG_SND_SOC_PCM179X_I2C is not set -# CONFIG_SND_SOC_PCM186X_I2C is not set -# CONFIG_SND_SOC_PCM3060_I2C is not set -# CONFIG_SND_SOC_PCM3168A_I2C is not set -# CONFIG_SND_SOC_PCM5102A is not set -# CONFIG_SND_SOC_PCM512x_I2C is not set -# CONFIG_SND_SOC_PCM6240 is not set -# CONFIG_SND_SOC_RT5616 is not set -# CONFIG_SND_SOC_RT5631 is not set -# CONFIG_SND_SOC_RT5640 is not set -# CONFIG_SND_SOC_RT5659 is not set -# CONFIG_SND_SOC_RT9120 is not set -# CONFIG_SND_SOC_RTQ9128 is not set -# CONFIG_SND_SOC_SGTL5000 is not set -# CONFIG_SND_SOC_SIMPLE_AMPLIFIER is not set -# CONFIG_SND_SOC_SIMPLE_MUX is not set -# CONFIG_SND_SOC_SMA1303 is not set -# CONFIG_SND_SOC_SPDIF is not set -# CONFIG_SND_SOC_SRC4XXX_I2C is not set -# CONFIG_SND_SOC_SSM2305 is not set -# CONFIG_SND_SOC_SSM2518 is not set -# CONFIG_SND_SOC_SSM2602_I2C is not set -# CONFIG_SND_SOC_SSM4567 is not set -# CONFIG_SND_SOC_STA32X is not set -# CONFIG_SND_SOC_STA350 is not set -# CONFIG_SND_SOC_STI_SAS is not set -# CONFIG_SND_SOC_TAS2552 is not set -# CONFIG_SND_SOC_TAS2562 is not set -# CONFIG_SND_SOC_TAS2764 is not set -# CONFIG_SND_SOC_TAS2770 is not set -# CONFIG_SND_SOC_TAS2780 is not set -# CONFIG_SND_SOC_TAS2781_I2C is not set -# CONFIG_SND_SOC_TAS5086 is not set -# CONFIG_SND_SOC_TAS571X is not set -# CONFIG_SND_SOC_TAS5720 is not set -# CONFIG_SND_SOC_TAS5805M is not set -# CONFIG_SND_SOC_TAS6424 is not set -# CONFIG_SND_SOC_TDA7419 is not set -# CONFIG_SND_SOC_TFA9879 is not set -# CONFIG_SND_SOC_TFA989X is not set -# CONFIG_SND_SOC_TLV320ADC3XXX is not set -# CONFIG_SND_SOC_TLV320AIC23_I2C is not set -# CONFIG_SND_SOC_TLV320AIC31XX is not set -# CONFIG_SND_SOC_TLV320AIC32X4_I2C is not set -# CONFIG_SND_SOC_TLV320AIC3X_I2C is not set -# CONFIG_SND_SOC_TLV320ADCX140 is not set -# CONFIG_SND_SOC_TS3A227E is not set -# CONFIG_SND_SOC_TSCS42XX is not set -# CONFIG_SND_SOC_TSCS454 is not set -# CONFIG_SND_SOC_UDA1334 is not set -# CONFIG_SND_SOC_WM8510 is not set -# CONFIG_SND_SOC_WM8523 is not set -# CONFIG_SND_SOC_WM8524 is not set -# CONFIG_SND_SOC_WM8580 is not set -# CONFIG_SND_SOC_WM8711 is not set -# CONFIG_SND_SOC_WM8728 is not set -# CONFIG_SND_SOC_WM8731_I2C is not set -# CONFIG_SND_SOC_WM8737 is not set -# CONFIG_SND_SOC_WM8741 is not set -# CONFIG_SND_SOC_WM8750 is not set -# CONFIG_SND_SOC_WM8753 is not set -# CONFIG_SND_SOC_WM8776 is not set -# CONFIG_SND_SOC_WM8782 is not set -# CONFIG_SND_SOC_WM8804_I2C is not set -# CONFIG_SND_SOC_WM8903 is not set -# CONFIG_SND_SOC_WM8904 is not set -# CONFIG_SND_SOC_WM8940 is not set -# CONFIG_SND_SOC_WM8960 is not set -# CONFIG_SND_SOC_WM8961 is not set -# CONFIG_SND_SOC_WM8962 is not set -# CONFIG_SND_SOC_WM8974 is not set -# CONFIG_SND_SOC_WM8978 is not set -# CONFIG_SND_SOC_WM8985 is not set -# CONFIG_SND_SOC_MAX9759 is not set -# CONFIG_SND_SOC_MT6351 is not set -# CONFIG_SND_SOC_MT6357 is not set -# CONFIG_SND_SOC_MT6358 is not set -# CONFIG_SND_SOC_MT6660 is not set -# CONFIG_SND_SOC_NAU8315 is not set -# CONFIG_SND_SOC_NAU8325 is not set -# CONFIG_SND_SOC_NAU8540 is not set -# CONFIG_SND_SOC_NAU8810 is not set -# CONFIG_SND_SOC_NAU8821 is not set -# CONFIG_SND_SOC_NAU8822 is not set -# CONFIG_SND_SOC_NAU8824 is not set -# CONFIG_SND_SOC_TPA6130A2 is not set -# CONFIG_SND_SOC_LPASS_WSA_MACRO is not set -# CONFIG_SND_SOC_LPASS_VA_MACRO is not set -# CONFIG_SND_SOC_LPASS_RX_MACRO is not set -# CONFIG_SND_SOC_LPASS_TX_MACRO is not set -# end of CODEC drivers - -# CONFIG_SND_SIMPLE_CARD is not set -# CONFIG_SND_X86 is not set -# CONFIG_SND_XEN_FRONTEND is not set -# CONFIG_SND_VIRTIO is not set -CONFIG_AC97_BUS=m -CONFIG_HID_SUPPORT=y -CONFIG_HID=m -# CONFIG_HID_BATTERY_STRENGTH is not set -# CONFIG_HIDRAW is not set -# CONFIG_UHID is not set -CONFIG_HID_GENERIC=m - -# Special HID drivers -CONFIG_HID_A4TECH=m -# CONFIG_HID_ACCUTOUCH is not set -# CONFIG_HID_ACRUX is not set -CONFIG_HID_APPLE=m -# CONFIG_HID_APPLEIR is not set -# CONFIG_HID_ASUS is not set -# CONFIG_HID_AUREAL is not set -CONFIG_HID_BELKIN=m -# CONFIG_HID_BETOP_FF is not set -# CONFIG_HID_BIGBEN_FF is not set -CONFIG_HID_CHERRY=m -# CONFIG_HID_CHICONY is not set -# CONFIG_HID_CORSAIR is not set -# CONFIG_HID_COUGAR is not set -# CONFIG_HID_MACALLY is not set -# CONFIG_HID_PRODIKEYS is not set -# CONFIG_HID_CMEDIA is not set -# CONFIG_HID_CREATIVE_SB0540 is not set -# CONFIG_HID_CYPRESS is not set -# CONFIG_HID_DRAGONRISE is not set -# CONFIG_HID_EMS_FF is not set -# CONFIG_HID_ELAN is not set -# CONFIG_HID_ELECOM is not set -# CONFIG_HID_ELO is not set -# CONFIG_HID_EVISION is not set -CONFIG_HID_EZKEY=m -# CONFIG_HID_GEMBIRD is not set -# CONFIG_HID_GFRM is not set -# CONFIG_HID_GLORIOUS is not set -# CONFIG_HID_HOLTEK is not set -# CONFIG_HID_GOOGLE_STADIA_FF is not set -# CONFIG_HID_VIVALDI is not set -# CONFIG_HID_GT683R is not set -# CONFIG_HID_KEYTOUCH is not set -# CONFIG_HID_KYE is not set -# CONFIG_HID_UCLOGIC is not set -# CONFIG_HID_WALTOP is not set -# CONFIG_HID_VIEWSONIC is not set -# CONFIG_HID_VRC2 is not set -# CONFIG_HID_XIAOMI is not set -# CONFIG_HID_GYRATION is not set -# CONFIG_HID_ICADE is not set -# CONFIG_HID_ITE is not set -# CONFIG_HID_JABRA is not set -# CONFIG_HID_TWINHAN is not set -# CONFIG_HID_KENSINGTON is not set -# CONFIG_HID_LCPOWER is not set -# CONFIG_HID_LED is not set -# CONFIG_HID_LENOVO is not set -# CONFIG_HID_LETSKETCH is not set -CONFIG_HID_LOGITECH=m -# CONFIG_HID_LOGITECH_HIDPP is not set -# CONFIG_LOGITECH_FF is not set -# CONFIG_LOGIRUMBLEPAD2_FF is not set -# CONFIG_LOGIG940_FF is not set -# CONFIG_LOGIWHEELS_FF is not set -# CONFIG_HID_MAGICMOUSE is not set -# CONFIG_HID_MALTRON is not set -# CONFIG_HID_MAYFLASH is not set -# CONFIG_HID_MEGAWORLD_FF is not set -# CONFIG_HID_REDRAGON is not set -CONFIG_HID_MICROSOFT=m -CONFIG_HID_MONTEREY=m -# CONFIG_HID_MULTITOUCH is not set -# CONFIG_HID_NINTENDO is not set -# CONFIG_HID_NTI is not set -# CONFIG_HID_NTRIG is not set -# CONFIG_HID_ORTEK is not set -# CONFIG_HID_PANTHERLORD is not set -# CONFIG_HID_PENMOUNT is not set -# CONFIG_HID_PETALYNX is not set -# CONFIG_HID_PICOLCD is not set -# CONFIG_HID_PLANTRONICS is not set -# CONFIG_HID_PXRC is not set -# CONFIG_HID_RAZER is not set -# CONFIG_HID_PRIMAX is not set -# CONFIG_HID_RETRODE is not set -# CONFIG_HID_ROCCAT is not set -# CONFIG_HID_SAITEK is not set -# CONFIG_HID_SAMSUNG is not set -# CONFIG_HID_SEMITEK is not set -# CONFIG_HID_SIGMAMICRO is not set -# CONFIG_HID_SONY is not set -# CONFIG_HID_SPEEDLINK is not set -# CONFIG_HID_STEAM is not set -# CONFIG_HID_STEELSERIES is not set -# CONFIG_HID_SUNPLUS is not set -# CONFIG_HID_RMI is not set -# CONFIG_HID_GREENASIA is not set -CONFIG_HID_HYPERV_MOUSE=m -# CONFIG_HID_SMARTJOYPLUS is not set -# CONFIG_HID_TIVO is not set -# CONFIG_HID_TOPSEED is not set -# CONFIG_HID_TOPRE is not set -# CONFIG_HID_THINGM is not set -# CONFIG_HID_THRUSTMASTER is not set -# CONFIG_HID_UDRAW_PS3 is not set -# CONFIG_HID_U2FZERO is not set -# CONFIG_HID_WACOM is not set -# CONFIG_HID_WIIMOTE is not set -# CONFIG_HID_WINWING is not set -# CONFIG_HID_XINMO is not set -# CONFIG_HID_ZEROPLUS is not set -# CONFIG_HID_ZYDACRON is not set -# CONFIG_HID_SENSOR_HUB is not set -# CONFIG_HID_ALPS is not set -# CONFIG_HID_MCP2200 is not set -# CONFIG_HID_MCP2221 is not set -# end of Special HID drivers - -# HID-BPF support -# CONFIG_HID_BPF is not set -# end of HID-BPF support - -# USB HID support -CONFIG_USB_HID=m -# CONFIG_HID_PID is not set -# CONFIG_USB_HIDDEV is not set - -# USB HID Boot Protocol drivers -# CONFIG_USB_KBD is not set -# CONFIG_USB_MOUSE is not set -# end of USB HID Boot Protocol drivers -# end of USB HID support - -CONFIG_I2C_HID=m -# CONFIG_I2C_HID_ACPI is not set -# CONFIG_I2C_HID_OF is not set - -# Intel ISH HID support -# CONFIG_INTEL_ISH_HID is not set -# end of Intel ISH HID support - -# AMD SFH HID Support -# CONFIG_AMD_SFH_HID is not set -# end of AMD SFH HID Support - -CONFIG_USB_OHCI_LITTLE_ENDIAN=y -CONFIG_USB_SUPPORT=y -CONFIG_USB_COMMON=m -# CONFIG_USB_LED_TRIG is not set -# CONFIG_USB_ULPI_BUS is not set -# CONFIG_USB_CONN_GPIO is not set -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB=m -CONFIG_USB_PCI=y -CONFIG_USB_PCI_AMD=y -# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set - -## Miscellaneous USB options -CONFIG_USB_DEFAULT_PERSIST=y -# CONFIG_USB_FEW_INIT_RETRIES is not set -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_OTG is not set -# CONFIG_USB_OTG_PRODUCTLIST is not set -# CONFIG_USB_OTG_DISABLE_EXTERNAL_HUB is not set -# CONFIG_USB_LEDS_TRIGGER_USBPORT is not set -CONFIG_USB_AUTOSUSPEND_DELAY=2 -CONFIG_USB_DEFAULT_AUTHORIZATION_MODE=1 -# CONFIG_USB_MON is not set - -## USB Host Controller Drivers -# CONFIG_USB_C67X00_HCD is not set -CONFIG_USB_XHCI_HCD=m -# CONFIG_USB_XHCI_DBGCAP is not set -CONFIG_USB_XHCI_PCI=m -# CONFIG_USB_XHCI_PCI_RENESAS is not set -# CONFIG_USB_XHCI_PLATFORM is not set -CONFIG_USB_EHCI_HCD=m -# CONFIG_USB_EHCI_ROOT_HUB_TT is not set -CONFIG_USB_EHCI_TT_NEWSCHED=y -CONFIG_USB_EHCI_PCI=m -# CONFIG_USB_EHCI_FSL is not set -CONFIG_USB_EHCI_HCD_PLATFORM=m -# CONFIG_USB_OXU210HP_HCD is not set -# CONFIG_USB_ISP116X_HCD is not set -CONFIG_USB_OHCI_HCD=m -CONFIG_USB_OHCI_HCD_PCI=m -CONFIG_USB_OHCI_HCD_SSB=y -CONFIG_USB_OHCI_HCD_PLATFORM=m -CONFIG_USB_UHCI_HCD=m -# CONFIG_USB_SL811_HCD is not set -# CONFIG_USB_R8A66597_HCD is not set -CONFIG_USB_HCD_SSB=m -# CONFIG_USB_HCD_TEST_MODE is not set -# CONFIG_USB_XEN_HCD is not set - -## USB Device Class drivers -CONFIG_USB_ACM=m -# CONFIG_USB_PRINTER is not set -CONFIG_USB_WDM=m -# CONFIG_USB_TMC is not set - -## NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may - -## also be needed; see USB_STORAGE Help for more info -CONFIG_USB_STORAGE=m -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_STORAGE_REALTEK is not set -# CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set -# CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_USBAT is not set -# CONFIG_USB_STORAGE_SDDR09 is not set -# CONFIG_USB_STORAGE_SDDR55 is not set -# CONFIG_USB_STORAGE_JUMPSHOT is not set -# CONFIG_USB_STORAGE_ALAUDA is not set -# CONFIG_USB_STORAGE_ONETOUCH is not set -# CONFIG_USB_STORAGE_KARMA is not set -# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set -# CONFIG_USB_STORAGE_ENE_UB6250 is not set -CONFIG_USB_UAS=m - -## USB Imaging devices -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set -# CONFIG_USBIP_CORE is not set - -## USB dual-mode controller drivers -# CONFIG_USB_CDNS_SUPPORT is not set -# CONFIG_USB_MUSB_HDRC is not set -# CONFIG_USB_DWC3 is not set -# CONFIG_USB_DWC2 is not set -# CONFIG_USB_CHIPIDEA is not set -# CONFIG_USB_ISP1760 is not set - -## USB port drivers -CONFIG_USB_SERIAL=m -CONFIG_USB_SERIAL_GENERIC=y -# CONFIG_USB_SERIAL_SIMPLE is not set -# CONFIG_USB_SERIAL_AIRCABLE is not set -# CONFIG_USB_SERIAL_ARK3116 is not set -# CONFIG_USB_SERIAL_BELKIN is not set -CONFIG_USB_SERIAL_CH341=m -# CONFIG_USB_SERIAL_WHITEHEAT is not set -# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set -CONFIG_USB_SERIAL_CP210X=m -# CONFIG_USB_SERIAL_CYPRESS_M8 is not set -# CONFIG_USB_SERIAL_EMPEG is not set -CONFIG_USB_SERIAL_FTDI_SIO=m -# CONFIG_USB_SERIAL_VISOR is not set -# CONFIG_USB_SERIAL_IPAQ is not set -# CONFIG_USB_SERIAL_IR is not set -# CONFIG_USB_SERIAL_EDGEPORT is not set -# CONFIG_USB_SERIAL_EDGEPORT_TI is not set -# CONFIG_USB_SERIAL_F81232 is not set -# CONFIG_USB_SERIAL_F8153X is not set -# CONFIG_USB_SERIAL_GARMIN is not set -# CONFIG_USB_SERIAL_IPW is not set -# CONFIG_USB_SERIAL_IUU is not set -# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set -# CONFIG_USB_SERIAL_KEYSPAN is not set -# CONFIG_USB_SERIAL_KLSI is not set -# CONFIG_USB_SERIAL_KOBIL_SCT is not set -# CONFIG_USB_SERIAL_MCT_U232 is not set -# CONFIG_USB_SERIAL_METRO is not set -# CONFIG_USB_SERIAL_MOS7720 is not set -# CONFIG_USB_SERIAL_MOS7840 is not set -# CONFIG_USB_SERIAL_MXUPORT is not set -# CONFIG_USB_SERIAL_NAVMAN is not set -CONFIG_USB_SERIAL_PL2303=m -# CONFIG_USB_SERIAL_OTI6858 is not set -# CONFIG_USB_SERIAL_QCAUX is not set -# CONFIG_USB_SERIAL_QUALCOMM is not set -# CONFIG_USB_SERIAL_SPCP8X5 is not set -# CONFIG_USB_SERIAL_SAFE is not set -# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set -# CONFIG_USB_SERIAL_SYMBOL is not set -# CONFIG_USB_SERIAL_TI is not set -# CONFIG_USB_SERIAL_CYBERJACK is not set -CONFIG_USB_SERIAL_WWAN=m -CONFIG_USB_SERIAL_OPTION=m -# CONFIG_USB_SERIAL_OMNINET is not set -# CONFIG_USB_SERIAL_OPTICON is not set -# CONFIG_USB_SERIAL_XSENS_MT is not set -# CONFIG_USB_SERIAL_WISHBONE is not set -# CONFIG_USB_SERIAL_SSU100 is not set -# CONFIG_USB_SERIAL_QT2 is not set -# CONFIG_USB_SERIAL_UPD78F0730 is not set -# CONFIG_USB_SERIAL_XR is not set -# CONFIG_USB_SERIAL_DEBUG is not set - -## USB Miscellaneous drivers -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_ADUTUX is not set -# CONFIG_USB_SEVSEG is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_CYPRESS_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_APPLEDISPLAY is not set -# CONFIG_APPLE_MFI_FASTCHARGE is not set -# CONFIG_USB_LJCA is not set -# CONFIG_USB_SISUSBVGA is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_TRANCEVIBRATOR is not set -# CONFIG_USB_IOWARRIOR is not set -# CONFIG_USB_TEST is not set -# CONFIG_USB_EHSET_TEST_FIXTURE is not set -# CONFIG_USB_ISIGHTFW is not set -# CONFIG_USB_YUREX is not set -# CONFIG_USB_EZUSB_FX2 is not set -# CONFIG_USB_HUB_USB251XB is not set -# CONFIG_USB_HSIC_USB3503 is not set -# CONFIG_USB_HSIC_USB4604 is not set -# CONFIG_USB_LINK_LAYER_TEST is not set -# CONFIG_USB_CHAOSKEY is not set - -# USB Physical Layer drivers -# CONFIG_NOP_USB_XCEIV is not set -# CONFIG_USB_GPIO_VBUS is not set -# CONFIG_USB_ISP1301 is not set -# end of USB Physical Layer drivers - -# CONFIG_USB_GADGET is not set -# CONFIG_TYPEC is not set -# CONFIG_USB_ROLE_SWITCH is not set -CONFIG_MMC=m -CONFIG_MMC_BLOCK=m -CONFIG_MMC_BLOCK_MINORS=16 -# CONFIG_SDIO_UART is not set -# CONFIG_MMC_TEST is not set - -## MMC/SD/SDIO Host Controller Drivers -# CONFIG_MMC_DEBUG is not set -CONFIG_MMC_SDHCI=m -CONFIG_MMC_SDHCI_IO_ACCESSORS=y -CONFIG_MMC_SDHCI_PCI=m -# CONFIG_MMC_RICOH_MMC is not set -CONFIG_MMC_SDHCI_ACPI=m -# CONFIG_MMC_SDHCI_PLTFM is not set -# CONFIG_MMC_WBSD is not set -# CONFIG_MMC_TIFM_SD is not set -# CONFIG_MMC_CB710 is not set -# CONFIG_MMC_VIA_SDMMC is not set -# CONFIG_MMC_VUB300 is not set -# CONFIG_MMC_USHC is not set -# CONFIG_MMC_USDHI6ROL0 is not set -CONFIG_MMC_CQHCI=m -# CONFIG_MMC_HSQ is not set -# CONFIG_MMC_TOSHIBA_PCI is not set -# CONFIG_MMC_MTK is not set -CONFIG_SCSI_UFSHCD=m -# CONFIG_SCSI_UFS_BSG is not set -# CONFIG_SCSI_UFS_HWMON is not set -CONFIG_SCSI_UFSHCD_PCI=m -# CONFIG_SCSI_UFS_DWC_TC_PCI is not set -CONFIG_SCSI_UFSHCD_PLATFORM=m -# CONFIG_SCSI_UFS_CDNS_PLATFORM is not set -# CONFIG_MEMSTICK is not set -CONFIG_NEW_LEDS=y -CONFIG_LEDS_CLASS=m -# CONFIG_LEDS_CLASS_FLASH is not set -# CONFIG_LEDS_CLASS_MULTICOLOR is not set -# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set - -## LED drivers -# CONFIG_LEDS_APU is not set -# CONFIG_LEDS_AW200XX is not set -# CONFIG_LEDS_LM3530 is not set -# CONFIG_LEDS_LM3532 is not set -# CONFIG_LEDS_LM3642 is not set -# CONFIG_LEDS_PCA9532 is not set -# CONFIG_LEDS_GPIO is not set -# CONFIG_LEDS_LP3944 is not set -# CONFIG_LEDS_LP3952 is not set -# CONFIG_LEDS_PCA955X is not set -# CONFIG_LEDS_PCA963X is not set -# CONFIG_LEDS_PCA995X is not set -# CONFIG_LEDS_PWM is not set -# CONFIG_LEDS_BD2606MVV is not set -# CONFIG_LEDS_BD2802 is not set -# CONFIG_LEDS_INTEL_SS4200 is not set -# CONFIG_LEDS_LT3593 is not set -# CONFIG_LEDS_TCA6507 is not set -# CONFIG_LEDS_TLC591XX is not set -# CONFIG_LEDS_LM355x is not set -# CONFIG_LEDS_IS31FL319X is not set - -## LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM) -# CONFIG_LEDS_BLINKM is not set -# CONFIG_LEDS_MLXCPLD is not set -# CONFIG_LEDS_MLXREG is not set -# CONFIG_LEDS_USER is not set -# CONFIG_LEDS_NIC78BX is not set - -## Flash and Torch LED drivers - -## RGB LED drivers - -## LED Triggers -CONFIG_LEDS_TRIGGERS=y -# CONFIG_LEDS_TRIGGER_TIMER is not set -# CONFIG_LEDS_TRIGGER_ONESHOT is not set -# CONFIG_LEDS_TRIGGER_DISK is not set -# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set -# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set -# CONFIG_LEDS_TRIGGER_CPU is not set -# CONFIG_LEDS_TRIGGER_ACTIVITY is not set -# CONFIG_LEDS_TRIGGER_GPIO is not set -# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set - -## iptables trigger is under Netfilter config (LED target) -# CONFIG_LEDS_TRIGGER_TRANSIENT is not set -# CONFIG_LEDS_TRIGGER_CAMERA is not set -# CONFIG_LEDS_TRIGGER_PANIC is not set -# CONFIG_LEDS_TRIGGER_NETDEV is not set -# CONFIG_LEDS_TRIGGER_PATTERN is not set -# CONFIG_LEDS_TRIGGER_TTY is not set -# CONFIG_LEDS_TRIGGER_INPUT_EVENTS is not set - -## Simple LED drivers -# CONFIG_ACCESSIBILITY is not set -CONFIG_INFINIBAND=m -CONFIG_INFINIBAND_USER_MAD=m -CONFIG_INFINIBAND_USER_ACCESS=m -CONFIG_INFINIBAND_USER_MEM=y -CONFIG_INFINIBAND_ON_DEMAND_PAGING=y -CONFIG_INFINIBAND_ADDR_TRANS=y -CONFIG_INFINIBAND_ADDR_TRANS_CONFIGFS=y -CONFIG_INFINIBAND_VIRT_DMA=y -# CONFIG_INFINIBAND_BNXT_RE is not set -# CONFIG_INFINIBAND_CXGB4 is not set -# CONFIG_INFINIBAND_EFA is not set -# CONFIG_INFINIBAND_ERDMA is not set -# CONFIG_MLX4_INFINIBAND is not set -CONFIG_MLX5_INFINIBAND=m -# CONFIG_INFINIBAND_MTHCA is not set -# CONFIG_INFINIBAND_OCRDMA is not set -# CONFIG_INFINIBAND_USNIC is not set -CONFIG_INFINIBAND_VMWARE_PVRDMA=m -# CONFIG_INFINIBAND_RDMAVT is not set -CONFIG_RDMA_RXE=m -# CONFIG_RDMA_SIW is not set -# CONFIG_INFINIBAND_IPOIB is not set -# CONFIG_INFINIBAND_SRP is not set -# CONFIG_INFINIBAND_ISER is not set -# CONFIG_INFINIBAND_RTRS_CLIENT is not set -# CONFIG_INFINIBAND_RTRS_SERVER is not set -# CONFIG_INFINIBAND_OPA_VNIC is not set -CONFIG_EDAC_ATOMIC_SCRUB=y -CONFIG_EDAC_SUPPORT=y -CONFIG_EDAC=y -# CONFIG_EDAC_LEGACY_SYSFS is not set -# CONFIG_EDAC_DEBUG is not set -CONFIG_EDAC_DECODE_MCE=m -# CONFIG_EDAC_GHES is not set -CONFIG_EDAC_AMD64=m -CONFIG_EDAC_E752X=m -CONFIG_EDAC_I82975X=m -CONFIG_EDAC_I3000=m -CONFIG_EDAC_I3200=m -# CONFIG_EDAC_IE31200 is not set -CONFIG_EDAC_X38=m -CONFIG_EDAC_I5400=m -CONFIG_EDAC_I7CORE=m -CONFIG_EDAC_I5100=m -CONFIG_EDAC_I7300=m -CONFIG_EDAC_SBRIDGE=m -CONFIG_EDAC_SKX=m -CONFIG_EDAC_I10NM=m -# CONFIG_EDAC_PND2 is not set -# CONFIG_EDAC_IGEN6 is not set -CONFIG_RTC_LIB=y -CONFIG_RTC_MC146818_LIB=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_HCTOSYS=y -CONFIG_RTC_HCTOSYS_DEVICE="rtc0" -CONFIG_RTC_SYSTOHC=y -CONFIG_RTC_SYSTOHC_DEVICE="rtc0" -# CONFIG_RTC_DEBUG is not set -CONFIG_RTC_NVMEM=y - -## RTC interfaces -CONFIG_RTC_INTF_SYSFS=y -CONFIG_RTC_INTF_PROC=y -CONFIG_RTC_INTF_DEV=y -# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set -# CONFIG_RTC_DRV_TEST is not set - -## I2C RTC drivers -# CONFIG_RTC_DRV_ABB5ZES3 is not set -# CONFIG_RTC_DRV_ABEOZ9 is not set -# CONFIG_RTC_DRV_ABX80X is not set -# CONFIG_RTC_DRV_DS1307 is not set -# CONFIG_RTC_DRV_DS1374 is not set -# CONFIG_RTC_DRV_DS1672 is not set -# CONFIG_RTC_DRV_MAX6900 is not set -# CONFIG_RTC_DRV_MAX31335 is not set -# CONFIG_RTC_DRV_RS5C372 is not set -# CONFIG_RTC_DRV_ISL1208 is not set -# CONFIG_RTC_DRV_ISL12022 is not set -# CONFIG_RTC_DRV_X1205 is not set -# CONFIG_RTC_DRV_PCF8523 is not set -# CONFIG_RTC_DRV_PCF85063 is not set -# CONFIG_RTC_DRV_PCF85363 is not set -# CONFIG_RTC_DRV_PCF8563 is not set -# CONFIG_RTC_DRV_PCF8583 is not set -# CONFIG_RTC_DRV_M41T80 is not set -# CONFIG_RTC_DRV_BQ32K is not set -# CONFIG_RTC_DRV_S35390A is not set -# CONFIG_RTC_DRV_FM3130 is not set -# CONFIG_RTC_DRV_RX8010 is not set -# CONFIG_RTC_DRV_RX8111 is not set -# CONFIG_RTC_DRV_RX8581 is not set -# CONFIG_RTC_DRV_RX8025 is not set -# CONFIG_RTC_DRV_EM3027 is not set -# CONFIG_RTC_DRV_RV3028 is not set -# CONFIG_RTC_DRV_RV3032 is not set -# CONFIG_RTC_DRV_RV8803 is not set -# CONFIG_RTC_DRV_SD2405AL is not set -# CONFIG_RTC_DRV_SD3078 is not set - -## SPI RTC drivers -CONFIG_RTC_I2C_AND_SPI=y - -## SPI and I2C RTC drivers -# CONFIG_RTC_DRV_DS3232 is not set -# CONFIG_RTC_DRV_PCF2127 is not set -# CONFIG_RTC_DRV_RV3029C2 is not set -# CONFIG_RTC_DRV_RX6110 is not set - -## Platform RTC drivers -CONFIG_RTC_DRV_CMOS=y -# CONFIG_RTC_DRV_DS1286 is not set -# CONFIG_RTC_DRV_DS1511 is not set -# CONFIG_RTC_DRV_DS1553 is not set -# CONFIG_RTC_DRV_DS1685_FAMILY is not set -# CONFIG_RTC_DRV_DS1742 is not set -# CONFIG_RTC_DRV_DS2404 is not set -# CONFIG_RTC_DRV_STK17TA8 is not set -# CONFIG_RTC_DRV_M48T86 is not set -# CONFIG_RTC_DRV_M48T35 is not set -# CONFIG_RTC_DRV_M48T59 is not set -# CONFIG_RTC_DRV_MSM6242 is not set -# CONFIG_RTC_DRV_RP5C01 is not set - -## on-CPU RTC drivers -# CONFIG_RTC_DRV_FTRTC010 is not set - -## HID Sensor RTC drivers -# CONFIG_RTC_DRV_GOLDFISH is not set -CONFIG_DMADEVICES=y -# CONFIG_DMADEVICES_DEBUG is not set - -## DMA Devices -CONFIG_DMA_ENGINE=y -CONFIG_DMA_VIRTUAL_CHANNELS=m -CONFIG_DMA_ACPI=y -# CONFIG_ALTERA_MSGDMA is not set -CONFIG_INTEL_IDMA64=m -# CONFIG_INTEL_IDXD is not set -# CONFIG_INTEL_IDXD_COMPAT is not set -CONFIG_INTEL_IOATDMA=m -# CONFIG_PLX_DMA is not set -# CONFIG_XILINX_DMA is not set -# CONFIG_XILINX_XDMA is not set -# CONFIG_AMD_QDMA is not set -# CONFIG_AMD_PTDMA is not set -# CONFIG_QCOM_HIDMA_MGMT is not set -# CONFIG_QCOM_HIDMA is not set -CONFIG_DW_DMAC_CORE=m -# CONFIG_DW_DMAC is not set -CONFIG_DW_DMAC_PCI=m -# CONFIG_DW_EDMA is not set -CONFIG_HSU_DMA=m -CONFIG_HSU_DMA_PCI=m -# CONFIG_SF_PDMA is not set -# CONFIG_INTEL_LDMA is not set - -## DMA Clients -# CONFIG_ASYNC_TX_DMA is not set -# CONFIG_DMATEST is not set -CONFIG_DMA_ENGINE_RAID=y - -# DMABUF options -CONFIG_SYNC_FILE=y -# CONFIG_SW_SYNC is not set -# CONFIG_UDMABUF is not set -# CONFIG_DMABUF_MOVE_NOTIFY is not set -# CONFIG_DMABUF_DEBUG is not set -# CONFIG_DMABUF_SELFTESTS is not set -# CONFIG_DMABUF_HEAPS is not set -# CONFIG_DMABUF_SYSFS_STATS is not set -# end of DMABUF options - -CONFIG_DCA=m -CONFIG_UIO=m -# CONFIG_UIO_CIF is not set -# CONFIG_UIO_PDRV_GENIRQ is not set -# CONFIG_UIO_DMEM_GENIRQ is not set -# CONFIG_UIO_AEC is not set -# CONFIG_UIO_SERCOS3 is not set -CONFIG_UIO_PCI_GENERIC=m -# CONFIG_UIO_NETX is not set -# CONFIG_UIO_MF624 is not set -CONFIG_UIO_HV_GENERIC=m -CONFIG_VFIO=m -CONFIG_VFIO_GROUP=y -CONFIG_VFIO_CONTAINER=y -CONFIG_VFIO_IOMMU_TYPE1=m -CONFIG_VFIO_NOIOMMU=y -CONFIG_VFIO_VIRQFD=y -# CONFIG_VFIO_DEBUGFS is not set - -# VFIO support for PCI devices -CONFIG_VFIO_PCI_CORE=m -CONFIG_VFIO_PCI_MMAP=y -CONFIG_VFIO_PCI_INTX=y -CONFIG_VFIO_PCI=m -CONFIG_VFIO_PCI_VGA=y -CONFIG_VFIO_PCI_IGD=y -# CONFIG_MLX5_VFIO_PCI is not set -# CONFIG_VIRTIO_VFIO_PCI is not set -# end of VFIO support for PCI devices - -CONFIG_IRQ_BYPASS_MANAGER=m -CONFIG_VIRT_DRIVERS=y -CONFIG_VMGENID=y -# CONFIG_VBOXGUEST is not set -# CONFIG_NITRO_ENCLAVES is not set -CONFIG_TSM_REPORTS=m -# CONFIG_EFI_SECRET is not set -CONFIG_SEV_GUEST=m -CONFIG_TDX_GUEST_DRIVER=m -CONFIG_VIRTIO_ANCHOR=y -CONFIG_VIRTIO=y -CONFIG_VIRTIO_PCI_LIB=y -CONFIG_VIRTIO_PCI_LIB_LEGACY=y -CONFIG_VIRTIO_MENU=y -CONFIG_VIRTIO_PCI=y -CONFIG_VIRTIO_PCI_ADMIN_LEGACY=y -CONFIG_VIRTIO_PCI_LEGACY=y -# CONFIG_VIRTIO_PMEM is not set -CONFIG_VIRTIO_BALLOON=m -CONFIG_VIRTIO_MEM=m -# CONFIG_VIRTIO_INPUT is not set -CONFIG_VIRTIO_MMIO=m -# CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES is not set -# CONFIG_VIRTIO_DEBUG is not set -# CONFIG_VDPA is not set -CONFIG_VHOST_IOTLB=m -CONFIG_VHOST_TASK=y -CONFIG_VHOST=m -CONFIG_VHOST_MENU=y -CONFIG_VHOST_NET=m -CONFIG_VHOST_VSOCK=m -# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set -CONFIG_VHOST_ENABLE_FORK_OWNER_CONTROL=y - -# Microsoft Hyper-V guest support -CONFIG_HYPERV=m -# CONFIG_HYPERV_VTL_MODE is not set -CONFIG_HYPERV_TIMER=y -CONFIG_HYPERV_UTILS=m -CONFIG_HYPERV_BALLOON=m -# end of Microsoft Hyper-V guest support - -# Xen driver support -CONFIG_XEN_BALLOON=y -CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y -CONFIG_XEN_MEMORY_HOTPLUG_LIMIT=512 -CONFIG_XEN_SCRUB_PAGES_DEFAULT=y -CONFIG_XEN_DEV_EVTCHN=m -CONFIG_XEN_BACKEND=y -CONFIG_XENFS=m -CONFIG_XEN_COMPAT_XENFS=y -CONFIG_XEN_SYS_HYPERVISOR=y -CONFIG_XEN_XENBUS_FRONTEND=y -CONFIG_XEN_GNTDEV=m -CONFIG_XEN_GRANT_DEV_ALLOC=m -# CONFIG_XEN_GRANT_DMA_ALLOC is not set -CONFIG_SWIOTLB_XEN=y -CONFIG_XEN_PCI_STUB=y -CONFIG_XEN_PCIDEV_BACKEND=m -# CONFIG_XEN_PVCALLS_FRONTEND is not set -# CONFIG_XEN_PVCALLS_BACKEND is not set -CONFIG_XEN_PRIVCMD=m -CONFIG_XEN_ACPI_PROCESSOR=m -CONFIG_XEN_MCE_LOG=y -CONFIG_XEN_HAVE_PVMMU=y -CONFIG_XEN_EFI=y -CONFIG_XEN_AUTO_XLATE=y -CONFIG_XEN_ACPI=y -# CONFIG_XEN_SYMS is not set -CONFIG_XEN_HAVE_VPMU=y -CONFIG_XEN_UNPOPULATED_ALLOC=y -# CONFIG_XEN_VIRTIO is not set -# end of Xen driver support - -# CONFIG_GREYBUS is not set -# CONFIG_COMEDI is not set -# CONFIG_STAGING is not set -# CONFIG_GOLDFISH is not set -# CONFIG_CHROME_PLATFORMS is not set -# CONFIG_MELLANOX_PLATFORM is not set -# CONFIG_SURFACE_PLATFORMS is not set -CONFIG_X86_PLATFORM_DEVICES=y -CONFIG_ACPI_WMI=m -CONFIG_WMI_BMOF=m -# CONFIG_HUAWEI_WMI is not set -CONFIG_MXM_WMI=m -# CONFIG_NVIDIA_WMI_EC_BACKLIGHT is not set -# CONFIG_XIAOMI_WMI is not set -# CONFIG_GIGABYTE_WMI is not set -# CONFIG_YOGABOOK is not set -# CONFIG_ACERHDF is not set -# CONFIG_ACER_WIRELESS is not set -# CONFIG_ACER_WMI is not set -# CONFIG_AMD_PMC is not set -# CONFIG_AMD_HSMP is not set -# CONFIG_AMD_WBRF is not set -# CONFIG_ADV_SWBUTTON is not set -# CONFIG_APPLE_GMUX is not set -# CONFIG_ASUS_LAPTOP is not set -# CONFIG_ASUS_WIRELESS is not set -# CONFIG_ASUS_WMI is not set -# CONFIG_ASUS_TF103C_DOCK is not set -# CONFIG_MERAKI_MX100 is not set -# CONFIG_EEEPC_LAPTOP is not set -CONFIG_X86_PLATFORM_DRIVERS_DELL=y -# CONFIG_ALIENWARE_WMI is not set -CONFIG_DCDBAS=m -CONFIG_DELL_LAPTOP=m -CONFIG_DELL_RBU=m -CONFIG_DELL_PC=m -CONFIG_DELL_SMBIOS=m -CONFIG_DELL_SMBIOS_WMI=y -CONFIG_DELL_SMBIOS_SMM=y -CONFIG_DELL_SMO8800=m -# CONFIG_DELL_UART_BACKLIGHT is not set -CONFIG_DELL_WMI=m -# CONFIG_DELL_WMI_PRIVACY is not set -CONFIG_DELL_WMI_AIO=m -CONFIG_DELL_WMI_DESCRIPTOR=m -CONFIG_DELL_WMI_DDV=m -CONFIG_DELL_WMI_LED=m -CONFIG_DELL_WMI_SYSMAN=m -# CONFIG_FUJITSU_LAPTOP is not set -# CONFIG_FUJITSU_TABLET is not set -# CONFIG_GPD_POCKET_FAN is not set -# CONFIG_X86_PLATFORM_DRIVERS_HP is not set -# CONFIG_WIRELESS_HOTKEY is not set -# CONFIG_IBM_RTL is not set -# CONFIG_SENSORS_HDAPS is not set -# CONFIG_THINKPAD_ACPI is not set -# CONFIG_THINKPAD_LMI is not set -# CONFIG_INTEL_ATOMISP2_PM is not set -CONFIG_INTEL_IFS=m -# CONFIG_INTEL_SAR_INT1092 is not set - -# Intel Speed Select Technology interface support -# CONFIG_INTEL_SPEED_SELECT_INTERFACE is not set -# end of Intel Speed Select Technology interface support - -# CONFIG_INTEL_WMI_SBL_FW_UPDATE is not set -# CONFIG_INTEL_WMI_THUNDERBOLT is not set - -# Intel Uncore Frequency Control -# CONFIG_INTEL_UNCORE_FREQ_CONTROL is not set -# end of Intel Uncore Frequency Control - -# CONFIG_INTEL_HID_EVENT is not set -# CONFIG_INTEL_VBTN is not set -# CONFIG_INTEL_INT0002_VGPIO is not set -CONFIG_INTEL_PUNIT_IPC=m -# CONFIG_INTEL_RST is not set -# CONFIG_INTEL_SMARTCONNECT is not set -# CONFIG_INTEL_TURBO_MAX_3 is not set -# CONFIG_INTEL_VSEC is not set -# CONFIG_ACPI_QUICKSTART is not set -# CONFIG_MEEGOPAD_ANX7428 is not set -# CONFIG_MSI_EC is not set -# CONFIG_MSI_WMI is not set -# CONFIG_MSI_WMI_PLATFORM is not set -# CONFIG_PCENGINES_APU2 is not set -# CONFIG_BARCO_P50_GPIO is not set -# CONFIG_SAMSUNG_LAPTOP is not set -# CONFIG_SAMSUNG_Q10 is not set -# CONFIG_ACPI_TOSHIBA is not set -# CONFIG_TOSHIBA_BT_RFKILL is not set -# CONFIG_TOSHIBA_HAPS is not set -# CONFIG_TOSHIBA_WMI is not set -# CONFIG_ACPI_CMPC is not set -# CONFIG_LG_LAPTOP is not set -# CONFIG_PANASONIC_LAPTOP is not set -# CONFIG_SYSTEM76_ACPI is not set -# CONFIG_TOPSTAR_LAPTOP is not set -# CONFIG_SERIAL_MULTI_INSTANTIATE is not set -# CONFIG_MLX_PLATFORM is not set -# CONFIG_INSPUR_PLATFORM_PROFILE is not set -# CONFIG_LENOVO_WMI_CAMERA is not set -CONFIG_FW_ATTR_CLASS=m -# CONFIG_INTEL_IPS is not set -CONFIG_INTEL_SCU_IPC=y -CONFIG_INTEL_SCU=y -CONFIG_INTEL_SCU_PCI=y -# CONFIG_INTEL_SCU_PLATFORM is not set -CONFIG_INTEL_SCU_IPC_UTIL=m -# CONFIG_SIEMENS_SIMATIC_IPC is not set -# CONFIG_WINMATE_FM07_KEYS is not set -# CONFIG_SEL3350_PLATFORM is not set -CONFIG_P2SB=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_COMMON_CLK=y -# CONFIG_COMMON_CLK_MAX9485 is not set -# CONFIG_COMMON_CLK_SI5341 is not set -# CONFIG_COMMON_CLK_SI5351 is not set -# CONFIG_COMMON_CLK_SI544 is not set -# CONFIG_COMMON_CLK_CDCE706 is not set -# CONFIG_COMMON_CLK_CS2000_CP is not set -# CONFIG_COMMON_CLK_PWM is not set -# CONFIG_XILINX_VCU is not set -# CONFIG_HWSPINLOCK is not set - -# Clock Source drivers -CONFIG_CLKEVT_I8253=y -CONFIG_CLKBLD_I8253=y -CONFIG_DW_APB_TIMER=y -# end of Clock Source drivers - -CONFIG_MAILBOX=y -CONFIG_PCC=y -# CONFIG_ALTERA_MBOX is not set -CONFIG_IOMMU_IOVA=y -CONFIG_IOMMU_API=y -CONFIG_IOMMU_SUPPORT=y - -# Generic IOMMU Pagetable Support -CONFIG_IOMMU_IO_PGTABLE=y -# end of Generic IOMMU Pagetable Support - -# CONFIG_IOMMU_DEBUGFS is not set -# CONFIG_IOMMU_DEFAULT_DMA_STRICT is not set -CONFIG_IOMMU_DEFAULT_DMA_LAZY=y -# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set -CONFIG_IOMMU_DMA=y -CONFIG_IOMMU_SVA=y -CONFIG_IOMMU_IOPF=y -CONFIG_AMD_IOMMU=y -CONFIG_DMAR_TABLE=y -CONFIG_INTEL_IOMMU=y -CONFIG_INTEL_IOMMU_SVM=y -CONFIG_INTEL_IOMMU_DEFAULT_ON=y -CONFIG_INTEL_IOMMU_FLOPPY_WA=y -# CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON is not set -CONFIG_INTEL_IOMMU_PERF_EVENTS=y -# CONFIG_IOMMUFD is not set -CONFIG_IRQ_REMAP=y -CONFIG_HYPERV_IOMMU=y -# CONFIG_VIRTIO_IOMMU is not set - -# Remoteproc drivers -# CONFIG_REMOTEPROC is not set -# end of Remoteproc drivers - -# Rpmsg drivers -# CONFIG_RPMSG_QCOM_GLINK_RPM is not set -# CONFIG_RPMSG_VIRTIO is not set -# end of Rpmsg drivers - -# CONFIG_SOUNDWIRE is not set - -# SOC (System On Chip) specific Drivers - -# Amlogic SoC drivers -# end of Amlogic SoC drivers - -# Broadcom SoC drivers -# end of Broadcom SoC drivers - -# NXP/Freescale QorIQ SoC drivers -# end of NXP/Freescale QorIQ SoC drivers - -# fujitsu SoC drivers -# end of fujitsu SoC drivers - -# i.MX SoC drivers -# end of i.MX SoC drivers - -# Enable LiteX SoC Builder specific drivers -# end of Enable LiteX SoC Builder specific drivers - -# CONFIG_WPCM450_SOC is not set - -# Qualcomm SoC drivers -# end of Qualcomm SoC drivers - -# CONFIG_SOC_TI is not set - -# Xilinx SoC drivers -# end of Xilinx SoC drivers -# end of SOC (System On Chip) specific Drivers - -# PM Domains - -# Amlogic PM Domains -# end of Amlogic PM Domains - -# Broadcom PM Domains -# end of Broadcom PM Domains - -# i.MX PM Domains -# end of i.MX PM Domains - -# Qualcomm PM Domains -# end of Qualcomm PM Domains -# end of PM Domains - -CONFIG_PM_DEVFREQ=y - -## DEVFREQ Governors -CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=m -# CONFIG_DEVFREQ_GOV_PERFORMANCE is not set -# CONFIG_DEVFREQ_GOV_POWERSAVE is not set -# CONFIG_DEVFREQ_GOV_USERSPACE is not set -# CONFIG_DEVFREQ_GOV_PASSIVE is not set - -## DEVFREQ Drivers -# CONFIG_PM_DEVFREQ_EVENT is not set -# CONFIG_EXTCON is not set -# CONFIG_MEMORY is not set -CONFIG_IIO=m -CONFIG_IIO_BUFFER=y -CONFIG_IIO_BUFFER_CB=m -# CONFIG_IIO_BUFFER_DMA is not set -# CONFIG_IIO_BUFFER_DMAENGINE is not set -# CONFIG_IIO_BUFFER_HW_CONSUMER is not set -CONFIG_IIO_KFIFO_BUF=m -CONFIG_IIO_TRIGGERED_BUFFER=m -# CONFIG_IIO_CONFIGFS is not set -CONFIG_IIO_TRIGGER=y -CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 -# CONFIG_IIO_SW_DEVICE is not set -# CONFIG_IIO_SW_TRIGGER is not set -# CONFIG_IIO_TRIGGERED_EVENT is not set - -# Accelerometers -# CONFIG_ADXL313_I2C is not set -# CONFIG_ADXL345_I2C is not set -# CONFIG_ADXL355_I2C is not set -# CONFIG_ADXL367_I2C is not set -# CONFIG_ADXL372_I2C is not set -# CONFIG_ADXL380_I2C is not set -# CONFIG_BMA180 is not set -# CONFIG_BMA400 is not set -# CONFIG_BMC150_ACCEL is not set -# CONFIG_BMI088_ACCEL is not set -# CONFIG_DA280 is not set -# CONFIG_DA311 is not set -# CONFIG_DMARD06 is not set -# CONFIG_DMARD09 is not set -# CONFIG_DMARD10 is not set -# CONFIG_FXLS8962AF_I2C is not set -CONFIG_IIO_ST_ACCEL_3AXIS=m -CONFIG_IIO_ST_ACCEL_I2C_3AXIS=m -# CONFIG_IIO_KX022A_I2C is not set -# CONFIG_KXSD9 is not set -# CONFIG_KXCJK1013 is not set -# CONFIG_MC3230 is not set -# CONFIG_MMA7455_I2C is not set -# CONFIG_MMA7660 is not set -# CONFIG_MMA8452 is not set -# CONFIG_MMA9551 is not set -# CONFIG_MMA9553 is not set -# CONFIG_MSA311 is not set -# CONFIG_MXC4005 is not set -# CONFIG_MXC6255 is not set -# CONFIG_STK8312 is not set -# CONFIG_STK8BA50 is not set -# end of Accelerometers - -# Analog to digital converters -# CONFIG_AD7091R5 is not set -# CONFIG_AD7291 is not set -# CONFIG_AD7606_IFACE_PARALLEL is not set -# CONFIG_AD799X is not set -# CONFIG_ENVELOPE_DETECTOR is not set -# CONFIG_HX711 is not set -# CONFIG_INA2XX_ADC is not set -# CONFIG_LTC2309 is not set -# CONFIG_LTC2471 is not set -# CONFIG_LTC2485 is not set -# CONFIG_LTC2497 is not set -# CONFIG_MAX1363 is not set -# CONFIG_MAX34408 is not set -# CONFIG_MAX9611 is not set -# CONFIG_MCP3422 is not set -# CONFIG_NAU7802 is not set -# CONFIG_PAC1921 is not set -# CONFIG_PAC1934 is not set -# CONFIG_RICHTEK_RTQ6056 is not set -# CONFIG_SD_ADC_MODULATOR is not set -# CONFIG_TI_ADC081C is not set -# CONFIG_TI_ADS1015 is not set -# CONFIG_TI_ADS1119 is not set -# CONFIG_TI_ADS7924 is not set -# CONFIG_TI_ADS1100 is not set -# CONFIG_VF610_ADC is not set -# CONFIG_XILINX_XADC is not set -# end of Analog to digital converters - -# Analog to digital and digital to analog converters -# end of Analog to digital and digital to analog converters - -# Analog Front Ends -# CONFIG_IIO_RESCALE is not set -# end of Analog Front Ends - -# Amplifiers -# CONFIG_HMC425 is not set -# end of Amplifiers - -# Capacitance to digital converters -# CONFIG_AD7150 is not set -# CONFIG_AD7746 is not set -# end of Capacitance to digital converters - -# Chemical Sensors -# CONFIG_AOSONG_AGS02MA is not set -# CONFIG_ATLAS_PH_SENSOR is not set -# CONFIG_ATLAS_EZO_SENSOR is not set -# CONFIG_BME680 is not set -# CONFIG_CCS811 is not set -# CONFIG_ENS160 is not set -# CONFIG_IAQCORE is not set -# CONFIG_PMS7003 is not set -# CONFIG_SCD30_CORE is not set -# CONFIG_SCD4X is not set -# CONFIG_SENSIRION_SGP30 is not set -# CONFIG_SENSIRION_SGP40 is not set -# CONFIG_SPS30_I2C is not set -# CONFIG_SPS30_SERIAL is not set -# CONFIG_SENSEAIR_SUNRISE_CO2 is not set -# CONFIG_VZ89X is not set -# end of Chemical Sensors - -# Hid Sensor IIO Common -# end of Hid Sensor IIO Common - -# IIO SCMI Sensors -# end of IIO SCMI Sensors - -# SSP Sensor Common -# end of SSP Sensor Common - -CONFIG_IIO_ST_SENSORS_I2C=m -CONFIG_IIO_ST_SENSORS_CORE=m - -# Digital to analog converters -# CONFIG_AD5064 is not set -# CONFIG_AD5380 is not set -# CONFIG_AD5446 is not set -# CONFIG_AD5593R is not set -# CONFIG_AD5696_I2C is not set -# CONFIG_DPOT_DAC is not set -# CONFIG_DS4424 is not set -# CONFIG_M62332 is not set -# CONFIG_MAX517 is not set -# CONFIG_MAX5821 is not set -# CONFIG_MCP4725 is not set -# CONFIG_MCP4728 is not set -# CONFIG_TI_DAC5571 is not set -# CONFIG_VF610_DAC is not set -# end of Digital to analog converters - -# IIO dummy driver -# end of IIO dummy driver - -# Filters -# end of Filters - -# Frequency Synthesizers DDS/PLL - -# Clock Generator/Distribution -# end of Clock Generator/Distribution - -# Phase-Locked Loop (PLL) frequency synthesizers -# CONFIG_ADMFM2000 is not set -# end of Phase-Locked Loop (PLL) frequency synthesizers -# end of Frequency Synthesizers DDS/PLL - -# Digital gyroscope sensors -# CONFIG_BMG160 is not set -# CONFIG_FXAS21002C is not set -# CONFIG_MPU3050_I2C is not set -# CONFIG_IIO_ST_GYRO_3AXIS is not set -# CONFIG_ITG3200 is not set -# end of Digital gyroscope sensors - -# Health Sensors - -# Heart Rate Monitors -# CONFIG_AFE4404 is not set -# CONFIG_MAX30100 is not set -# CONFIG_MAX30102 is not set -# end of Heart Rate Monitors -# end of Health Sensors - -# Humidity sensors -# CONFIG_AM2315 is not set -# CONFIG_DHT11 is not set -# CONFIG_ENS210 is not set -# CONFIG_HDC100X is not set -# CONFIG_HDC2010 is not set -# CONFIG_HDC3020 is not set -CONFIG_HTS221=m -CONFIG_HTS221_I2C=m -# CONFIG_HTU21 is not set -# CONFIG_SI7005 is not set -# CONFIG_SI7020 is not set -# end of Humidity sensors - -# Inertial measurement units -# CONFIG_BMI160_I2C is not set -# CONFIG_BMI323_I2C is not set -# CONFIG_BOSCH_BNO055_SERIAL is not set -# CONFIG_BOSCH_BNO055_I2C is not set -# CONFIG_FXOS8700_I2C is not set -# CONFIG_KMX61 is not set -# CONFIG_INV_ICM42600_I2C is not set -# CONFIG_INV_MPU6050_I2C is not set -# CONFIG_IIO_ST_LSM6DSX is not set -# CONFIG_IIO_ST_LSM9DS0 is not set -# end of Inertial measurement units - -# Light sensors -# CONFIG_ACPI_ALS is not set -# CONFIG_ADJD_S311 is not set -# CONFIG_ADUX1020 is not set -# CONFIG_AL3010 is not set -# CONFIG_AL3320A is not set -# CONFIG_APDS9300 is not set -# CONFIG_APDS9306 is not set -# CONFIG_APDS9960 is not set -# CONFIG_AS73211 is not set -# CONFIG_BH1745 is not set -# CONFIG_BH1750 is not set -# CONFIG_BH1780 is not set -# CONFIG_CM32181 is not set -# CONFIG_CM3232 is not set -# CONFIG_CM3323 is not set -# CONFIG_CM3605 is not set -# CONFIG_CM36651 is not set -# CONFIG_GP2AP002 is not set -# CONFIG_GP2AP020A00F is not set -# CONFIG_SENSORS_ISL29018 is not set -# CONFIG_SENSORS_ISL29028 is not set -# CONFIG_ISL29125 is not set -# CONFIG_ISL76682 is not set -# CONFIG_JSA1212 is not set -# CONFIG_ROHM_BU27008 is not set -# CONFIG_ROHM_BU27034 is not set -# CONFIG_RPR0521 is not set -# CONFIG_LTR390 is not set -# CONFIG_LTR501 is not set -# CONFIG_LTRF216A is not set -# CONFIG_LV0104CS is not set -# CONFIG_MAX44000 is not set -# CONFIG_MAX44009 is not set -# CONFIG_NOA1305 is not set -# CONFIG_OPT3001 is not set -# CONFIG_OPT4001 is not set -# CONFIG_PA12203001 is not set -# CONFIG_SI1133 is not set -# CONFIG_SI1145 is not set -# CONFIG_STK3310 is not set -# CONFIG_ST_UVIS25 is not set -# CONFIG_TCS3414 is not set -# CONFIG_TCS3472 is not set -# CONFIG_SENSORS_TSL2563 is not set -# CONFIG_TSL2583 is not set -# CONFIG_TSL2591 is not set -# CONFIG_TSL2772 is not set -# CONFIG_TSL4531 is not set -# CONFIG_US5182D is not set -# CONFIG_VCNL4000 is not set -# CONFIG_VCNL4035 is not set -# CONFIG_VEML6030 is not set -# CONFIG_VEML6040 is not set -# CONFIG_VEML6070 is not set -# CONFIG_VEML6075 is not set -# CONFIG_VL6180 is not set -# CONFIG_ZOPT2201 is not set -# end of Light sensors - -# Magnetometer sensors -# CONFIG_AK8974 is not set -# CONFIG_AK8975 is not set -# CONFIG_AK09911 is not set -# CONFIG_BMC150_MAGN_I2C is not set -# CONFIG_MAG3110 is not set -# CONFIG_MMC35240 is not set -# CONFIG_IIO_ST_MAGN_3AXIS is not set -# CONFIG_SENSORS_HMC5843_I2C is not set -# CONFIG_SENSORS_RM3100_I2C is not set -# CONFIG_TI_TMAG5273 is not set -# CONFIG_YAMAHA_YAS530 is not set -# end of Magnetometer sensors - -# Multiplexers -# CONFIG_IIO_MUX is not set -# end of Multiplexers - -# Inclinometer sensors -# end of Inclinometer sensors - -# Triggers - standalone -# CONFIG_IIO_INTERRUPT_TRIGGER is not set -# CONFIG_IIO_SYSFS_TRIGGER is not set -# end of Triggers - standalone - -# Linear and angular position sensors -# end of Linear and angular position sensors - -# Digital potentiometers -# CONFIG_AD5110 is not set -# CONFIG_AD5272 is not set -# CONFIG_DS1803 is not set -# CONFIG_MAX5432 is not set -# CONFIG_MCP4018 is not set -# CONFIG_MCP4531 is not set -# CONFIG_TPL0102 is not set -# end of Digital potentiometers - -# Digital potentiostats -# CONFIG_LMP91000 is not set -# end of Digital potentiostats - -# Pressure sensors -# CONFIG_ABP060MG is not set -# CONFIG_ROHM_BM1390 is not set -# CONFIG_BMP280 is not set -# CONFIG_DLHL60D is not set -# CONFIG_DPS310 is not set -# CONFIG_HP03 is not set -# CONFIG_HSC030PA is not set -# CONFIG_ICP10100 is not set -# CONFIG_MPL115_I2C is not set -# CONFIG_MPL3115 is not set -# CONFIG_MPRLS0025PA is not set -# CONFIG_MS5611 is not set -# CONFIG_MS5637 is not set -# CONFIG_SDP500 is not set -CONFIG_IIO_ST_PRESS=m -CONFIG_IIO_ST_PRESS_I2C=m -# CONFIG_T5403 is not set -# CONFIG_HP206C is not set -# CONFIG_ZPA2326 is not set -# end of Pressure sensors - -# Lightning sensors -# end of Lightning sensors - -# Proximity and distance sensors -# CONFIG_HX9023S is not set -# CONFIG_IRSD200 is not set -# CONFIG_ISL29501 is not set -# CONFIG_LIDAR_LITE_V2 is not set -# CONFIG_MB1232 is not set -# CONFIG_PING is not set -# CONFIG_RFD77402 is not set -# CONFIG_SRF04 is not set -# CONFIG_SX9310 is not set -# CONFIG_SX9324 is not set -# CONFIG_SX9360 is not set -# CONFIG_SX9500 is not set -# CONFIG_SRF08 is not set -# CONFIG_VCNL3020 is not set -# CONFIG_VL53L0X_I2C is not set -# CONFIG_AW96103 is not set -# end of Proximity and distance sensors - -# Resolver to digital converters -# end of Resolver to digital converters - -# Temperature sensors -# CONFIG_MLX90614 is not set -# CONFIG_MLX90632 is not set -# CONFIG_MLX90635 is not set -# CONFIG_TMP006 is not set -# CONFIG_TMP007 is not set -# CONFIG_TMP117 is not set -# CONFIG_TSYS01 is not set -# CONFIG_TSYS02D is not set -# CONFIG_MAX30208 is not set -# CONFIG_MCP9600 is not set -# end of Temperature sensors - -# CONFIG_NTB is not set -CONFIG_PWM=y -# CONFIG_PWM_DEBUG is not set -# CONFIG_PWM_CLK is not set -# CONFIG_PWM_DWC is not set -# CONFIG_PWM_GPIO is not set -CONFIG_PWM_LPSS=m -CONFIG_PWM_LPSS_PCI=m -CONFIG_PWM_LPSS_PLATFORM=m -# CONFIG_PWM_PCA9685 is not set - -# IRQ chip support -# end of IRQ chip support - -# CONFIG_IPACK_BUS is not set -# CONFIG_RESET_CONTROLLER is not set - -# PHY Subsystem -CONFIG_GENERIC_PHY=y -# CONFIG_USB_LGM_PHY is not set -# CONFIG_PHY_CAN_TRANSCEIVER is not set - -# PHY drivers for Broadcom platforms -# CONFIG_BCM_KONA_USB2_PHY is not set -# end of PHY drivers for Broadcom platforms - -# CONFIG_PHY_PXA_28NM_HSIC is not set -# CONFIG_PHY_PXA_28NM_USB2 is not set -# CONFIG_PHY_CPCAP_USB is not set -# CONFIG_PHY_INTEL_LGM_EMMC is not set -# end of PHY Subsystem - -CONFIG_POWERCAP=y -CONFIG_INTEL_RAPL_CORE=m -CONFIG_INTEL_RAPL=m -# CONFIG_IDLE_INJECT is not set -# CONFIG_MCB is not set - -# Performance monitor support -# CONFIG_DWC_PCIE_PMU is not set -# end of Performance monitor support - -CONFIG_RAS=y -# CONFIG_RAS_CEC is not set -# CONFIG_AMD_ATL is not set -# CONFIG_USB4 is not set - -# Android -# CONFIG_ANDROID_BINDER_IPC is not set -# end of Android - -CONFIG_LIBNVDIMM=y -CONFIG_BLK_DEV_PMEM=m -CONFIG_ND_CLAIM=y -CONFIG_ND_BTT=m -CONFIG_BTT=y -CONFIG_ND_PFN=m -CONFIG_NVDIMM_PFN=y -CONFIG_NVDIMM_DAX=y -CONFIG_DAX=y -CONFIG_DEV_DAX=m -CONFIG_DEV_DAX_PMEM=m -CONFIG_DEV_DAX_KMEM=m -CONFIG_NVMEM=y -CONFIG_NVMEM_SYSFS=y -# CONFIG_NVMEM_LAYOUTS is not set -# CONFIG_NVMEM_RMEM is not set - -# HW tracing support -# CONFIG_STM is not set -# CONFIG_INTEL_TH is not set -# end of HW tracing support - -# CONFIG_FPGA is not set -# CONFIG_TEE is not set -CONFIG_PM_OPP=y -# CONFIG_SIOX is not set -# CONFIG_SLIMBUS is not set -# CONFIG_INTERCONNECT is not set -# CONFIG_COUNTER is not set -# CONFIG_MOST is not set -# CONFIG_PECI is not set -# CONFIG_HTE is not set -# end of Device Drivers - -# File systems -CONFIG_DCACHE_WORD_ACCESS=y -CONFIG_VALIDATE_FS_PARSER=y -CONFIG_FS_IOMAP=y -CONFIG_FS_STACK=y -CONFIG_BUFFER_HEAD=y -CONFIG_LEGACY_DIRECT_IO=y -CONFIG_EXT2_FS=y -CONFIG_EXT2_FS_XATTR=y -CONFIG_EXT2_FS_POSIX_ACL=y -CONFIG_EXT2_FS_SECURITY=y -# CONFIG_EXT3_FS is not set -CONFIG_EXT4_FS=y -CONFIG_EXT4_FS_POSIX_ACL=y -CONFIG_EXT4_FS_SECURITY=y -# CONFIG_EXT4_DEBUG is not set -CONFIG_JBD2=y -# CONFIG_JBD2_DEBUG is not set -CONFIG_FS_MBCACHE=y -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -CONFIG_XFS_FS=y -CONFIG_XFS_SUPPORT_V4=y -CONFIG_XFS_SUPPORT_ASCII_CI=y -CONFIG_XFS_QUOTA=y -CONFIG_XFS_POSIX_ACL=y -CONFIG_XFS_RT=y -# CONFIG_XFS_ONLINE_SCRUB is not set -CONFIG_XFS_WARN=y -# CONFIG_XFS_DEBUG is not set -# CONFIG_GFS2_FS is not set -# CONFIG_OCFS2_FS is not set -CONFIG_BTRFS_FS=m -CONFIG_BTRFS_FS_POSIX_ACL=y -# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set -# CONFIG_BTRFS_DEBUG is not set -# CONFIG_BTRFS_ASSERT is not set -# CONFIG_BTRFS_FS_REF_VERIFY is not set -# CONFIG_NILFS2_FS is not set -# CONFIG_F2FS_FS is not set -# CONFIG_BCACHEFS_FS is not set -# CONFIG_ZONEFS_FS is not set -CONFIG_FS_DAX=y -CONFIG_FS_DAX_PMD=y -CONFIG_FS_POSIX_ACL=y -CONFIG_EXPORTFS=y -CONFIG_EXPORTFS_BLOCK_OPS=y -CONFIG_FILE_LOCKING=y -# CONFIG_FS_ENCRYPTION is not set -# CONFIG_FS_VERITY is not set -CONFIG_FSNOTIFY=y -CONFIG_DNOTIFY=y -CONFIG_INOTIFY_USER=y -CONFIG_FANOTIFY=y -CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y -CONFIG_QUOTA=y -CONFIG_QUOTA_NETLINK_INTERFACE=y -# CONFIG_QUOTA_DEBUG is not set -CONFIG_QUOTA_TREE=m -# CONFIG_QFMT_V1 is not set -CONFIG_QFMT_V2=m -CONFIG_QUOTACTL=y -CONFIG_AUTOFS_FS=m -CONFIG_FUSE_FS=m -# CONFIG_CUSE is not set -CONFIG_VIRTIO_FS=m -CONFIG_FUSE_DAX=y -CONFIG_FUSE_PASSTHROUGH=y -CONFIG_OVERLAY_FS=m -# CONFIG_OVERLAY_FS_REDIRECT_DIR is not set -CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW=y -# CONFIG_OVERLAY_FS_INDEX is not set -# CONFIG_OVERLAY_FS_XINO_AUTO is not set -# CONFIG_OVERLAY_FS_METACOPY is not set -# CONFIG_OVERLAY_FS_DEBUG is not set - -# Caches -CONFIG_NETFS_SUPPORT=m -# CONFIG_NETFS_STATS is not set -# CONFIG_NETFS_DEBUG is not set -CONFIG_FSCACHE=y -# CONFIG_FSCACHE_STATS is not set -# CONFIG_CACHEFILES is not set -# end of Caches - -# CD-ROM/DVD Filesystems -CONFIG_ISO9660_FS=y -CONFIG_JOLIET=y -CONFIG_ZISOFS=y -CONFIG_UDF_FS=y -# end of CD-ROM/DVD Filesystems - -# DOS/FAT/EXFAT/NT Filesystems -CONFIG_FAT_FS=m -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m -CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="ascii" -# CONFIG_FAT_DEFAULT_UTF8 is not set -# CONFIG_EXFAT_FS is not set -# CONFIG_NTFS3_FS is not set -# CONFIG_NTFS_FS is not set -# end of DOS/FAT/EXFAT/NT Filesystems - -# Pseudo filesystems -CONFIG_PROC_FS=y -CONFIG_PROC_KCORE=y -CONFIG_PROC_VMCORE=y -# CONFIG_PROC_VMCORE_DEVICE_DUMP is not set -CONFIG_PROC_SYSCTL=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_PROC_CHILDREN=y -CONFIG_PROC_PID_ARCH_STATUS=y -CONFIG_PROC_CPU_RESCTRL=y -CONFIG_KERNFS=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -CONFIG_TMPFS_POSIX_ACL=y -CONFIG_TMPFS_XATTR=y -# CONFIG_TMPFS_INODE64 is not set -# CONFIG_TMPFS_QUOTA is not set -CONFIG_HUGETLBFS=y -# CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON is not set -CONFIG_HUGETLB_PAGE=y -CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP=y -CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING=y -CONFIG_ARCH_HAS_GIGANTIC_PAGE=y -CONFIG_CONFIGFS_FS=m -CONFIG_EFIVAR_FS=y -# end of Pseudo filesystems - -CONFIG_MISC_FILESYSTEMS=y -# CONFIG_ORANGEFS_FS is not set -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_ECRYPT_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -CONFIG_CRAMFS=m -CONFIG_CRAMFS_BLOCKDEV=y -CONFIG_SQUASHFS=m -CONFIG_SQUASHFS_FILE_CACHE=y -# CONFIG_SQUASHFS_FILE_DIRECT is not set -CONFIG_SQUASHFS_DECOMP_SINGLE=y -# CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set -CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE=y -# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is not set -# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set -CONFIG_SQUASHFS_XATTR=y -CONFIG_SQUASHFS_ZLIB=y -# CONFIG_SQUASHFS_LZ4 is not set -CONFIG_SQUASHFS_LZO=y -CONFIG_SQUASHFS_XZ=y -CONFIG_SQUASHFS_ZSTD=y -# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set -# CONFIG_SQUASHFS_EMBEDDED is not set -CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 -# CONFIG_VXFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_OMFS_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_QNX6FS_FS is not set -# CONFIG_ROMFS_FS is not set -CONFIG_PSTORE=y -CONFIG_PSTORE_DEFAULT_KMSG_BYTES=10240 -CONFIG_PSTORE_COMPRESS=y -# CONFIG_PSTORE_CONSOLE is not set -# CONFIG_PSTORE_PMSG is not set -# CONFIG_PSTORE_FTRACE is not set -# CONFIG_PSTORE_RAM is not set -# CONFIG_PSTORE_BLK is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set -CONFIG_EROFS_FS=m -# CONFIG_EROFS_FS_DEBUG is not set -CONFIG_EROFS_FS_XATTR=y -CONFIG_EROFS_FS_POSIX_ACL=y -CONFIG_EROFS_FS_SECURITY=y -CONFIG_EROFS_FS_BACKED_BY_FILE=y -CONFIG_EROFS_FS_ZIP=y -# CONFIG_EROFS_FS_ZIP_LZMA is not set -# CONFIG_EROFS_FS_ZIP_DEFLATE is not set -CONFIG_EROFS_FS_ZIP_ZSTD=y -# CONFIG_EROFS_FS_ONDEMAND is not set -# CONFIG_EROFS_FS_PCPU_KTHREAD is not set -CONFIG_NETWORK_FILESYSTEMS=y -CONFIG_NFS_FS=m -CONFIG_NFS_V2=m -CONFIG_NFS_V3=m -CONFIG_NFS_V3_ACL=y -CONFIG_NFS_V4=m -# CONFIG_NFS_SWAP is not set -CONFIG_NFS_V4_1=y -CONFIG_NFS_V4_2=y -CONFIG_PNFS_FILE_LAYOUT=m -CONFIG_PNFS_BLOCK=m -CONFIG_PNFS_FLEXFILE_LAYOUT=m -CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org" -# CONFIG_NFS_V4_1_MIGRATION is not set -CONFIG_NFS_V4_SECURITY_LABEL=y -CONFIG_NFS_FSCACHE=y -# CONFIG_NFS_USE_LEGACY_DNS is not set -CONFIG_NFS_USE_KERNEL_DNS=y -CONFIG_NFS_DEBUG=y -CONFIG_NFS_DISABLE_UDP_SUPPORT=y -# CONFIG_NFS_V4_2_READ_PLUS is not set -CONFIG_NFSD=m -# CONFIG_NFSD_V2 is not set -CONFIG_NFSD_V3_ACL=y -CONFIG_NFSD_V4=y -CONFIG_NFSD_PNFS=y -CONFIG_NFSD_BLOCKLAYOUT=y -CONFIG_NFSD_SCSILAYOUT=y -CONFIG_NFSD_FLEXFILELAYOUT=y -# CONFIG_NFSD_V4_2_INTER_SSC is not set -# CONFIG_NFSD_V4_SECURITY_LABEL is not set -# CONFIG_NFSD_LEGACY_CLIENT_TRACKING is not set -CONFIG_GRACE_PERIOD=m -CONFIG_LOCKD=m -CONFIG_LOCKD_V4=y -CONFIG_NFS_ACL_SUPPORT=m -CONFIG_NFS_COMMON=y -# CONFIG_NFS_LOCALIO is not set -CONFIG_NFS_V4_2_SSC_HELPER=y -CONFIG_SUNRPC=m -CONFIG_SUNRPC_GSS=m -CONFIG_SUNRPC_BACKCHANNEL=y -CONFIG_RPCSEC_GSS_KRB5=m -CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_AES_SHA1=y -# CONFIG_RPCSEC_GSS_KRB5_ENCTYPES_AES_SHA2 is not set -CONFIG_SUNRPC_DEBUG=y -CONFIG_SUNRPC_XPRT_RDMA=m -CONFIG_CEPH_FS=m -CONFIG_CEPH_FSCACHE=y -CONFIG_CEPH_FS_POSIX_ACL=y -# CONFIG_CEPH_FS_SECURITY_LABEL is not set -CONFIG_CIFS=m -CONFIG_CIFS_STATS2=y -# CONFIG_CIFS_ALLOW_INSECURE_LEGACY is not set -CONFIG_CIFS_UPCALL=y -CONFIG_CIFS_XATTR=y -CONFIG_CIFS_DEBUG=y -# CONFIG_CIFS_DEBUG2 is not set -# CONFIG_CIFS_DEBUG_DUMP_KEYS is not set -CONFIG_CIFS_DFS_UPCALL=y -# CONFIG_CIFS_SWN_UPCALL is not set -# CONFIG_CIFS_SMB_DIRECT is not set -# CONFIG_CIFS_FSCACHE is not set -# CONFIG_CIFS_COMPRESSION is not set -# CONFIG_SMB_SERVER is not set -CONFIG_SMBFS=m -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set -CONFIG_9P_FS=m -# CONFIG_9P_FSCACHE is not set -CONFIG_9P_FS_POSIX_ACL=y -CONFIG_9P_FS_SECURITY=y -CONFIG_NLS=y -CONFIG_NLS_DEFAULT="utf8" -CONFIG_NLS_CODEPAGE_437=y -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -CONFIG_NLS_ASCII=y -CONFIG_NLS_ISO8859_1=m -CONFIG_NLS_ISO8859_2=m -CONFIG_NLS_ISO8859_3=m -CONFIG_NLS_ISO8859_4=m -CONFIG_NLS_ISO8859_5=m -CONFIG_NLS_ISO8859_6=m -CONFIG_NLS_ISO8859_7=m -CONFIG_NLS_ISO8859_9=m -CONFIG_NLS_ISO8859_13=m -CONFIG_NLS_ISO8859_14=m -CONFIG_NLS_ISO8859_15=m -CONFIG_NLS_KOI8_R=m -CONFIG_NLS_KOI8_U=m -# CONFIG_NLS_MAC_ROMAN is not set -# CONFIG_NLS_MAC_CELTIC is not set -# CONFIG_NLS_MAC_CENTEURO is not set -# CONFIG_NLS_MAC_CROATIAN is not set -# CONFIG_NLS_MAC_CYRILLIC is not set -# CONFIG_NLS_MAC_GAELIC is not set -# CONFIG_NLS_MAC_GREEK is not set -# CONFIG_NLS_MAC_ICELAND is not set -# CONFIG_NLS_MAC_INUIT is not set -# CONFIG_NLS_MAC_ROMANIAN is not set -# CONFIG_NLS_MAC_TURKISH is not set -CONFIG_NLS_UTF8=y -CONFIG_NLS_UCS2_UTILS=m -CONFIG_DLM=m -# CONFIG_DLM_DEBUG is not set -# CONFIG_UNICODE is not set -CONFIG_IO_WQ=y -# end of File systems - -# Security options -CONFIG_PAX=y -CONFIG_PAX_RAP=y -CONFIG_KEYS=y -# CONFIG_KEYS_REQUEST_CACHE is not set -# CONFIG_PERSISTENT_KEYRINGS is not set -CONFIG_TRUSTED_KEYS=m -CONFIG_HAVE_TRUSTED_KEYS=y -CONFIG_TRUSTED_KEYS_TPM=y -CONFIG_ENCRYPTED_KEYS=m -# CONFIG_USER_DECRYPTED_DATA is not set -# CONFIG_KEY_DH_OPERATIONS is not set -CONFIG_SECURITY_DMESG_RESTRICT=y -# CONFIG_PROC_MEM_ALWAYS_FORCE is not set -# CONFIG_PROC_MEM_FORCE_PTRACE is not set -CONFIG_PROC_MEM_NO_FORCE=y -CONFIG_SECURITY=y -CONFIG_SECURITYFS=y -CONFIG_SECURITY_NETWORK=y -# CONFIG_SECURITY_INFINIBAND is not set -CONFIG_SECURITY_NETWORK_XFRM=y -CONFIG_SECURITY_PATH=y -CONFIG_INTEL_TXT=y -CONFIG_LSM_MMAP_MIN_ADDR=65536 -CONFIG_HARDENED_USERCOPY=y -CONFIG_FORTIFY_SOURCE=y -# CONFIG_STATIC_USERMODEHELPER is not set -CONFIG_SECURITY_SELINUX=y -CONFIG_SECURITY_SELINUX_BOOTPARAM=y -CONFIG_SECURITY_SELINUX_DEVELOP=y -CONFIG_SECURITY_SELINUX_AVC_STATS=y -CONFIG_SECURITY_SELINUX_SIDTAB_HASH_BITS=9 -CONFIG_SECURITY_SELINUX_SID2STR_CACHE_SIZE=256 -# CONFIG_SECURITY_SELINUX_DEBUG is not set -CONFIG_SECURITY_SMACK=y -# CONFIG_SECURITY_SMACK_BRINGUP is not set -# CONFIG_SECURITY_SMACK_NETFILTER is not set -# CONFIG_SECURITY_SMACK_APPEND_SIGNALS is not set -# CONFIG_SECURITY_TOMOYO is not set -CONFIG_SECURITY_APPARMOR=y -# CONFIG_SECURITY_APPARMOR_DEBUG is not set -CONFIG_SECURITY_APPARMOR_INTROSPECT_POLICY=y -CONFIG_SECURITY_APPARMOR_HASH=y -CONFIG_SECURITY_APPARMOR_HASH_DEFAULT=y -CONFIG_SECURITY_APPARMOR_EXPORT_BINARY=y -CONFIG_SECURITY_APPARMOR_PARANOID_LOAD=y -# CONFIG_SECURITY_LOADPIN is not set -CONFIG_SECURITY_YAMA=y -# CONFIG_SECURITY_SAFESETID is not set -CONFIG_SECURITY_LOCKDOWN_LSM=y -CONFIG_SECURITY_LOCKDOWN_LSM_EARLY=y -CONFIG_LOCK_DOWN_KERNEL_IN_SECUREBOOT=y -CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE=y -# CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY is not set -# CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY is not set -CONFIG_SECURITY_SBAT="linux-sbat.csv" -CONFIG_SECURITY_SBAT_VERIFY=y -# CONFIG_SECURITY_LANDLOCK is not set -# CONFIG_SECURITY_IPE is not set -CONFIG_INTEGRITY=y -CONFIG_INTEGRITY_SIGNATURE=y -CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y -# CONFIG_INTEGRITY_TRUSTED_KEYRING is not set -CONFIG_INTEGRITY_PLATFORM_KEYRING=y -CONFIG_LOAD_UEFI_KEYS=y -CONFIG_INTEGRITY_AUDIT=y -CONFIG_IMA=y -# CONFIG_IMA_KEXEC is not set -CONFIG_IMA_MEASURE_PCR_IDX=10 -CONFIG_IMA_LSM_RULES=y -CONFIG_IMA_NG_TEMPLATE=y -# CONFIG_IMA_SIG_TEMPLATE is not set -CONFIG_IMA_DEFAULT_TEMPLATE="ima-ng" -# CONFIG_IMA_DEFAULT_HASH_SHA1 is not set -CONFIG_IMA_DEFAULT_HASH_SHA256=y -# CONFIG_IMA_DEFAULT_HASH_SHA512 is not set -CONFIG_IMA_DEFAULT_HASH="sha256" -# CONFIG_IMA_WRITE_POLICY is not set -CONFIG_IMA_READ_POLICY=y -# CONFIG_IMA_APPRAISE is not set -# CONFIG_IMA_ARCH_POLICY is not set -CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS=y -CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS=y -# CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT is not set -# CONFIG_IMA_DISABLE_HTABLE is not set -# CONFIG_EVM is not set -CONFIG_DEFAULT_SECURITY_SELINUX=y -# CONFIG_DEFAULT_SECURITY_SMACK is not set -# CONFIG_DEFAULT_SECURITY_APPARMOR is not set -# CONFIG_DEFAULT_SECURITY_DAC is not set -CONFIG_LSM="lockdown,yama,loadpin,safesetid,integrity,selinux,apparmor,smack,tomoyo" - -# Kernel hardening options - -# Memory initialization -CONFIG_CC_HAS_AUTO_VAR_INIT_PATTERN=y -CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO_BARE=y -CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO=y -CONFIG_INIT_STACK_NONE=y -# CONFIG_INIT_STACK_ALL_PATTERN is not set -# CONFIG_INIT_STACK_ALL_ZERO is not set -# CONFIG_GCC_PLUGIN_STACKLEAK is not set -# CONFIG_INIT_ON_ALLOC_DEFAULT_ON is not set -# CONFIG_INIT_ON_FREE_DEFAULT_ON is not set -CONFIG_CC_HAS_ZERO_CALL_USED_REGS=y -# CONFIG_ZERO_CALL_USED_REGS is not set -# end of Memory initialization - -# Hardening of kernel data structures -# CONFIG_LIST_HARDENED is not set -# CONFIG_BUG_ON_DATA_CORRUPTION is not set -# end of Hardening of kernel data structures - -CONFIG_RANDSTRUCT_NONE=y -# CONFIG_RANDSTRUCT_FULL is not set -# CONFIG_RANDSTRUCT_PERFORMANCE is not set -# end of Kernel hardening options -# end of Security options - -CONFIG_XOR_BLOCKS=m -CONFIG_ASYNC_CORE=m -CONFIG_ASYNC_MEMCPY=m -CONFIG_ASYNC_XOR=m -CONFIG_ASYNC_PQ=m -CONFIG_ASYNC_RAID6_RECOV=m -CONFIG_CRYPTO=y - -# Crypto core or helper -CONFIG_CRYPTO_FIPS=y -CONFIG_CRYPTO_FIPS_NAME="Linux Kernel Cryptographic API" -# CONFIG_CRYPTO_FIPS_CUSTOM_VERSION is not set -CONFIG_CRYPTO_ALGAPI=y -CONFIG_CRYPTO_ALGAPI2=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_SIG=y -CONFIG_CRYPTO_SIG2=y -CONFIG_CRYPTO_SKCIPHER=y -CONFIG_CRYPTO_SKCIPHER2=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_RNG_DEFAULT=y -CONFIG_CRYPTO_AKCIPHER2=y -CONFIG_CRYPTO_AKCIPHER=y -CONFIG_CRYPTO_KPP2=y -CONFIG_CRYPTO_KPP=y -CONFIG_CRYPTO_ACOMP2=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -# CONFIG_CRYPTO_USER is not set -# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set -# CONFIG_CRYPTO_MANAGER_EXTRA_TESTS is not set -CONFIG_CRYPTO_NULL=y -CONFIG_CRYPTO_NULL2=y -# CONFIG_CRYPTO_PCRYPT is not set -CONFIG_CRYPTO_CRYPTD=y -CONFIG_CRYPTO_AUTHENC=m -CONFIG_CRYPTO_TEST=m -CONFIG_CRYPTO_SIMD=y -CONFIG_CRYPTO_ENGINE=m -# end of Crypto core or helper - -# Public-key cryptography -CONFIG_CRYPTO_RSA=y -# CONFIG_CRYPTO_DH is not set -CONFIG_CRYPTO_ECC=y -CONFIG_CRYPTO_ECDH=y -CONFIG_CRYPTO_ECDSA=y -# CONFIG_CRYPTO_ECRDSA is not set -# CONFIG_CRYPTO_CURVE25519 is not set -# end of Public-key cryptography - -# Block ciphers -CONFIG_CRYPTO_AES=y -# CONFIG_CRYPTO_AES_TI is not set -# CONFIG_CRYPTO_ANUBIS is not set -# CONFIG_CRYPTO_ARIA is not set -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -CONFIG_CRYPTO_DES=y -# CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SEED is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_SM4_GENERIC is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TWOFISH is not set -# end of Block ciphers - -# Length-preserving ciphers and modes -# CONFIG_CRYPTO_ADIANTUM is not set -CONFIG_CRYPTO_ARC4=m -# CONFIG_CRYPTO_CHACHA20 is not set -CONFIG_CRYPTO_CBC=y -CONFIG_CRYPTO_CTR=y -CONFIG_CRYPTO_CTS=y -CONFIG_CRYPTO_ECB=y -# CONFIG_CRYPTO_HCTR2 is not set -# CONFIG_CRYPTO_KEYWRAP is not set -CONFIG_CRYPTO_LRW=m -# CONFIG_CRYPTO_PCBC is not set -CONFIG_CRYPTO_XTS=y -# end of Length-preserving ciphers and modes - -# AEAD (authenticated encryption with associated data) ciphers -# CONFIG_CRYPTO_AEGIS128 is not set -# CONFIG_CRYPTO_CHACHA20POLY1305 is not set -CONFIG_CRYPTO_CCM=y -CONFIG_CRYPTO_GCM=y -CONFIG_CRYPTO_GENIV=y -CONFIG_CRYPTO_SEQIV=y -CONFIG_CRYPTO_ECHAINIV=m -CONFIG_CRYPTO_ESSIV=m -# end of AEAD (authenticated encryption with associated data) ciphers - -# Hashes, digests, and MACs -CONFIG_CRYPTO_BLAKE2B=m -CONFIG_CRYPTO_CMAC=y -CONFIG_CRYPTO_GHASH=y -CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_MD4=m -CONFIG_CRYPTO_MD5=y -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_POLY1305 is not set -# CONFIG_CRYPTO_RMD160 is not set -CONFIG_CRYPTO_SHA1=y -CONFIG_CRYPTO_SHA256=y -CONFIG_CRYPTO_SHA512=y -CONFIG_CRYPTO_SHA3=y -# CONFIG_CRYPTO_SM3_GENERIC is not set -# CONFIG_CRYPTO_STREEBOG is not set -# CONFIG_CRYPTO_VMAC is not set -# CONFIG_CRYPTO_WP512 is not set -# CONFIG_CRYPTO_XCBC is not set -CONFIG_CRYPTO_XXHASH=m -# end of Hashes, digests, and MACs - -# CRCs (cyclic redundancy checks) -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_CRC32=m -CONFIG_CRYPTO_CRCT10DIF=y -CONFIG_CRYPTO_CRC64_ROCKSOFT=y -# end of CRCs (cyclic redundancy checks) - -# Compression -CONFIG_CRYPTO_DEFLATE=y -CONFIG_CRYPTO_LZO=y -# CONFIG_CRYPTO_842 is not set -# CONFIG_CRYPTO_LZ4 is not set -# CONFIG_CRYPTO_LZ4HC is not set -# CONFIG_CRYPTO_ZSTD is not set -# end of Compression - -# Random number generation -CONFIG_CRYPTO_ANSI_CPRNG=m -CONFIG_CRYPTO_DRBG_MENU=y -CONFIG_CRYPTO_DRBG_HMAC=y -CONFIG_CRYPTO_DRBG_HASH=y -CONFIG_CRYPTO_DRBG_CTR=y -CONFIG_CRYPTO_DRBG=y -CONFIG_CRYPTO_JITTERENTROPY=y -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_2 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_8 is not set -CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_32=y -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_64 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_128 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_1024 is not set -# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_8192 is not set -CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKS=128 -CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE=256 -CONFIG_CRYPTO_JITTERENTROPY_OSR=3 -# CONFIG_CRYPTO_JITTERENTROPY_TESTINTERFACE is not set -# end of Random number generation - -# Userspace interface -CONFIG_CRYPTO_USER_API=m -CONFIG_CRYPTO_USER_API_HASH=m -CONFIG_CRYPTO_USER_API_SKCIPHER=m -CONFIG_CRYPTO_USER_API_RNG=m -# CONFIG_CRYPTO_USER_API_RNG_CAVP is not set -# CONFIG_CRYPTO_USER_API_AEAD is not set -CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y -# end of Userspace interface - -CONFIG_CRYPTO_HASH_INFO=y - -# Accelerated Cryptographic Algorithms for CPU (x86) -CONFIG_CRYPTO_CURVE25519_X86=m -CONFIG_CRYPTO_AES_NI_INTEL=y -# CONFIG_CRYPTO_BLOWFISH_X86_64 is not set -# CONFIG_CRYPTO_CAMELLIA_X86_64 is not set -# CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64 is not set -# CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64 is not set -# CONFIG_CRYPTO_CAST5_AVX_X86_64 is not set -# CONFIG_CRYPTO_CAST6_AVX_X86_64 is not set -# CONFIG_CRYPTO_DES3_EDE_X86_64 is not set -# CONFIG_CRYPTO_SERPENT_SSE2_X86_64 is not set -# CONFIG_CRYPTO_SERPENT_AVX_X86_64 is not set -# CONFIG_CRYPTO_SERPENT_AVX2_X86_64 is not set -# CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64 is not set -# CONFIG_CRYPTO_SM4_AESNI_AVX2_X86_64 is not set -# CONFIG_CRYPTO_TWOFISH_X86_64 is not set -# CONFIG_CRYPTO_TWOFISH_X86_64_3WAY is not set -# CONFIG_CRYPTO_TWOFISH_AVX_X86_64 is not set -# CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64 is not set -# CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64 is not set -# CONFIG_CRYPTO_ARIA_GFNI_AVX512_X86_64 is not set -CONFIG_CRYPTO_CHACHA20_X86_64=m -# CONFIG_CRYPTO_AEGIS128_AESNI_SSE2 is not set -# CONFIG_CRYPTO_NHPOLY1305_SSE2 is not set -# CONFIG_CRYPTO_NHPOLY1305_AVX2 is not set -CONFIG_CRYPTO_BLAKE2S_X86=y -# CONFIG_CRYPTO_POLYVAL_CLMUL_NI is not set -CONFIG_CRYPTO_POLY1305_X86_64=m -# CONFIG_CRYPTO_SHA1_SSSE3 is not set -CONFIG_CRYPTO_SHA256_SSSE3=y -CONFIG_CRYPTO_SHA512_SSSE3=y -# CONFIG_CRYPTO_SM3_AVX_X86_64 is not set -CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=y -CONFIG_CRYPTO_CRC32C_INTEL=m -# CONFIG_CRYPTO_CRC32_PCLMUL is not set -# CONFIG_CRYPTO_CRCT10DIF_PCLMUL is not set -# end of Accelerated Cryptographic Algorithms for CPU (x86) - -CONFIG_CRYPTO_HW=y -# CONFIG_CRYPTO_DEV_PADLOCK is not set -# CONFIG_CRYPTO_DEV_ATMEL_ECC is not set -# CONFIG_CRYPTO_DEV_ATMEL_SHA204A is not set -# CONFIG_CRYPTO_DEV_CCP is not set -# CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set -# CONFIG_CRYPTO_DEV_QAT_DH895xCC is not set -# CONFIG_CRYPTO_DEV_QAT_C3XXX is not set -# CONFIG_CRYPTO_DEV_QAT_C62X is not set -# CONFIG_CRYPTO_DEV_QAT_4XXX is not set -# CONFIG_CRYPTO_DEV_QAT_420XX is not set -# CONFIG_CRYPTO_DEV_QAT_DH895xCCVF is not set -# CONFIG_CRYPTO_DEV_QAT_C3XXXVF is not set -# CONFIG_CRYPTO_DEV_QAT_C62XVF is not set -CONFIG_CRYPTO_DEV_CHELSIO=m -CONFIG_CRYPTO_DEV_VIRTIO=m -# CONFIG_CRYPTO_DEV_SAFEXCEL is not set -# CONFIG_CRYPTO_DEV_AMLOGIC_GXL is not set -CONFIG_ASYMMETRIC_KEY_TYPE=y -CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y -CONFIG_X509_CERTIFICATE_PARSER=y -# CONFIG_PKCS8_PRIVATE_KEY_PARSER is not set -CONFIG_PKCS7_MESSAGE_PARSER=y -# CONFIG_PKCS7_TEST_KEY is not set -CONFIG_SIGNED_PE_FILE_VERIFICATION=y -# CONFIG_FIPS_SIGNATURE_SELFTEST is not set - -# Certificates for signature checking -CONFIG_MODULE_SIG_KEY="certs/signing_key.pem" -CONFIG_MODULE_SIG_KEY_TYPE_RSA=y -# CONFIG_MODULE_SIG_KEY_TYPE_ECDSA is not set -CONFIG_SYSTEM_TRUSTED_KEYRING=y -CONFIG_SYSTEM_TRUSTED_KEYS="photon-cert-bundle.pem" -# CONFIG_SYSTEM_EXTRA_CERTIFICATE is not set -# CONFIG_SECONDARY_TRUSTED_KEYRING is not set -CONFIG_SYSTEM_BLACKLIST_KEYRING=y -CONFIG_SYSTEM_BLACKLIST_HASH_LIST="" -# CONFIG_SYSTEM_REVOCATION_LIST is not set -# CONFIG_SYSTEM_BLACKLIST_AUTH_UPDATE is not set -# end of Certificates for signature checking - -CONFIG_BINARY_PRINTF=y - -# Library routines -CONFIG_RAID6_PQ=m -# CONFIG_RAID6_PQ_BENCHMARK is not set -# CONFIG_PACKING is not set -CONFIG_BITREVERSE=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_NET_UTILS=y -# CONFIG_CORDIC is not set -# CONFIG_PRIME_NUMBERS is not set -CONFIG_RATIONAL=y -CONFIG_GENERIC_IOMAP=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -CONFIG_ARCH_HAS_FAST_MULTIPLIER=y -CONFIG_ARCH_USE_SYM_ANNOTATIONS=y - -# Crypto library routines -CONFIG_CRYPTO_LIB_UTILS=y -CONFIG_CRYPTO_LIB_AES=y -CONFIG_CRYPTO_LIB_AESCFB=y -CONFIG_CRYPTO_LIB_ARC4=m -CONFIG_CRYPTO_LIB_GF128MUL=y -CONFIG_CRYPTO_ARCH_HAVE_LIB_BLAKE2S=y -CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y -CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=y -CONFIG_CRYPTO_LIB_CHACHA_GENERIC=m -CONFIG_CRYPTO_LIB_CHACHA_INTERNAL=m -CONFIG_CRYPTO_LIB_CHACHA=m -CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519=y -CONFIG_CRYPTO_LIB_CURVE25519_GENERIC=m -CONFIG_CRYPTO_LIB_CURVE25519_INTERNAL=m -CONFIG_CRYPTO_LIB_CURVE25519=m -CONFIG_CRYPTO_LIB_DES=y -CONFIG_CRYPTO_LIB_POLY1305_RSIZE=11 -CONFIG_CRYPTO_ARCH_HAVE_LIB_POLY1305=y -CONFIG_CRYPTO_LIB_POLY1305_GENERIC=m -CONFIG_CRYPTO_LIB_POLY1305_INTERNAL=m -CONFIG_CRYPTO_LIB_POLY1305=m -CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m -CONFIG_CRYPTO_LIB_SHA1=y -CONFIG_CRYPTO_LIB_SHA256=y -# end of Crypto library routines - -CONFIG_CRC_CCITT=y -CONFIG_CRC16=y -CONFIG_CRC_T10DIF=y -CONFIG_CRC64_ROCKSOFT=y -CONFIG_CRC_ITU_T=y -CONFIG_CRC32=y -# CONFIG_CRC32_SELFTEST is not set -CONFIG_CRC32_SLICEBY8=y -# CONFIG_CRC32_SLICEBY4 is not set -# CONFIG_CRC32_SARWATE is not set -# CONFIG_CRC32_BIT is not set -CONFIG_CRC64=y -# CONFIG_CRC4 is not set -# CONFIG_CRC7 is not set -CONFIG_LIBCRC32C=y -# CONFIG_CRC8 is not set -CONFIG_XXHASH=y -# CONFIG_RANDOM32_SELFTEST is not set -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=y -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y -CONFIG_LZ4_DECOMPRESS=y -CONFIG_ZSTD_COMMON=y -CONFIG_ZSTD_COMPRESS=y -CONFIG_ZSTD_DECOMPRESS=y -CONFIG_XZ_DEC=y -CONFIG_XZ_DEC_X86=y -CONFIG_XZ_DEC_POWERPC=y -CONFIG_XZ_DEC_ARM=y -CONFIG_XZ_DEC_ARMTHUMB=y -# CONFIG_XZ_DEC_ARM64 is not set -CONFIG_XZ_DEC_SPARC=y -# CONFIG_XZ_DEC_RISCV is not set -# CONFIG_XZ_DEC_MICROLZMA is not set -CONFIG_XZ_DEC_BCJ=y -# CONFIG_XZ_DEC_TEST is not set -CONFIG_DECOMPRESS_GZIP=y -CONFIG_DECOMPRESS_BZIP2=y -CONFIG_DECOMPRESS_LZMA=y -CONFIG_DECOMPRESS_XZ=y -CONFIG_DECOMPRESS_LZO=y -CONFIG_DECOMPRESS_LZ4=y -CONFIG_DECOMPRESS_ZSTD=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_TEXTSEARCH=y -CONFIG_TEXTSEARCH_KMP=m -CONFIG_TEXTSEARCH_BM=m -CONFIG_TEXTSEARCH_FSM=m -CONFIG_BTREE=y -CONFIG_INTERVAL_TREE=y -CONFIG_XARRAY_MULTI=y -CONFIG_ASSOCIATIVE_ARRAY=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAS_IOPORT_MAP=y -CONFIG_HAS_DMA=y -CONFIG_DMA_OPS_HELPERS=y -# CONFIG_DMA_PAGE_TOUCHING is not set -CONFIG_NEED_SG_DMA_FLAGS=y -CONFIG_NEED_SG_DMA_LENGTH=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_ARCH_DMA_ADDR_T_64BIT=y -CONFIG_ARCH_HAS_FORCE_DMA_UNENCRYPTED=y -CONFIG_SWIOTLB=y -# CONFIG_SWIOTLB_DYNAMIC is not set -CONFIG_DMA_NEED_SYNC=y -CONFIG_DMA_COHERENT_POOL=y -# CONFIG_DMA_API_DEBUG is not set -# CONFIG_DMA_MAP_BENCHMARK is not set -CONFIG_SGL_ALLOC=y -CONFIG_IOMMU_HELPER=y -CONFIG_CHECK_SIGNATURE=y -CONFIG_CPUMASK_OFFSTACK=y -CONFIG_CPU_RMAP=y -CONFIG_DQL=y -CONFIG_GLOB=y -# CONFIG_GLOB_SELFTEST is not set -CONFIG_NLATTR=y -CONFIG_CLZ_TAB=y -CONFIG_IRQ_POLL=y -CONFIG_MPILIB=y -CONFIG_SIGNATURE=y -CONFIG_DIMLIB=y -CONFIG_OID_REGISTRY=y -CONFIG_UCS2_STRING=y -CONFIG_HAVE_GENERIC_VDSO=y -CONFIG_GENERIC_GETTIMEOFDAY=y -CONFIG_GENERIC_VDSO_TIME_NS=y -CONFIG_GENERIC_VDSO_OVERFLOW_PROTECT=y -CONFIG_VDSO_GETRANDOM=y -CONFIG_FONT_SUPPORT=y -# CONFIG_FONTS is not set -CONFIG_FONT_8x8=y -CONFIG_FONT_8x16=y -CONFIG_SG_POOL=y -CONFIG_ARCH_HAS_PMEM_API=y -CONFIG_MEMREGION=y -CONFIG_ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION=y -CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y -CONFIG_ARCH_HAS_COPY_MC=y -CONFIG_ARCH_STACKWALK=y -CONFIG_STACKDEPOT=y -CONFIG_STACKDEPOT_MAX_FRAMES=64 -CONFIG_SBITMAP=y -# CONFIG_LWQ_TEST is not set -# end of Library routines - -CONFIG_ASN1_ENCODER=m -CONFIG_FIRMWARE_TABLE=y - -# Kernel hacking - -# printk and dmesg options -CONFIG_PRINTK_TIME=y -# CONFIG_PRINTK_CALLER is not set -# CONFIG_STACKTRACE_BUILD_ID is not set -CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 -CONFIG_CONSOLE_LOGLEVEL_QUIET=4 -CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 -# CONFIG_BOOT_PRINTK_DELAY is not set -CONFIG_DYNAMIC_DEBUG=y -CONFIG_DYNAMIC_DEBUG_CORE=y -CONFIG_SYMBOLIC_ERRNAME=y -CONFIG_DEBUG_BUGVERBOSE=y -# end of printk and dmesg options - -CONFIG_DEBUG_KERNEL=y -CONFIG_DEBUG_MISC=y - -# Compile-time checks and compiler options -CONFIG_DEBUG_INFO=y -CONFIG_AS_HAS_NON_CONST_ULEB128=y -# CONFIG_DEBUG_INFO_NONE is not set -CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y -# CONFIG_DEBUG_INFO_DWARF4 is not set -# CONFIG_DEBUG_INFO_DWARF5 is not set -# CONFIG_DEBUG_INFO_REDUCED is not set -CONFIG_DEBUG_INFO_COMPRESSED_NONE=y -# CONFIG_DEBUG_INFO_COMPRESSED_ZLIB is not set -# CONFIG_DEBUG_INFO_SPLIT is not set -CONFIG_DEBUG_INFO_BTF=y -CONFIG_PAHOLE_HAS_SPLIT_BTF=y -CONFIG_PAHOLE_HAS_LANG_EXCLUDE=y -CONFIG_DEBUG_INFO_BTF_MODULES=y -# CONFIG_MODULE_ALLOW_BTF_MISMATCH is not set -# CONFIG_GDB_SCRIPTS is not set -CONFIG_FRAME_WARN=2048 -CONFIG_STRIP_ASM_SYMS=y -# CONFIG_READABLE_ASM is not set -# CONFIG_HEADERS_INSTALL is not set -# CONFIG_DEBUG_SECTION_MISMATCH is not set -CONFIG_SECTION_MISMATCH_WARN_ONLY=y -# CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B is not set -CONFIG_ARCH_WANT_FRAME_POINTERS=y -CONFIG_FRAME_POINTER=y -CONFIG_OBJTOOL=y -CONFIG_STACK_VALIDATION=y -# CONFIG_VMLINUX_MAP is not set -# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set -# end of Compile-time checks and compiler options - -# Generic Kernel Debugging Instruments -CONFIG_MAGIC_SYSRQ=y -CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0xb0 -CONFIG_MAGIC_SYSRQ_SERIAL=y -CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE="" -CONFIG_DEBUG_FS=y -CONFIG_DEBUG_FS_ALLOW_ALL=y -# CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set -# CONFIG_DEBUG_FS_ALLOW_NONE is not set -CONFIG_HAVE_ARCH_KGDB=y -# CONFIG_KGDB is not set -CONFIG_ARCH_HAS_UBSAN=y -# CONFIG_UBSAN is not set -CONFIG_HAVE_ARCH_KCSAN=y -CONFIG_HAVE_KCSAN_COMPILER=y -# CONFIG_KCSAN is not set -# end of Generic Kernel Debugging Instruments - -# Networking Debugging -# CONFIG_NET_DEV_REFCNT_TRACKER is not set -# CONFIG_NET_NS_REFCNT_TRACKER is not set -# CONFIG_DEBUG_NET is not set -# CONFIG_DEBUG_NET_SMALL_RTNL is not set -# end of Networking Debugging - -# Memory Debugging -# CONFIG_PAGE_EXTENSION is not set -# CONFIG_DEBUG_PAGEALLOC is not set -CONFIG_SLUB_DEBUG=y -# CONFIG_SLUB_DEBUG_ON is not set -# CONFIG_PAGE_OWNER is not set -# CONFIG_PAGE_TABLE_CHECK is not set -CONFIG_PAGE_POISONING=y -# CONFIG_DEBUG_PAGE_REF is not set -CONFIG_DEBUG_RODATA_TEST=y -CONFIG_ARCH_HAS_DEBUG_WX=y -CONFIG_DEBUG_WX=y -CONFIG_ARCH_HAS_PTDUMP=y -CONFIG_PTDUMP=y -# CONFIG_PTDUMP_DEBUGFS is not set -CONFIG_HAVE_DEBUG_KMEMLEAK=y -# CONFIG_DEBUG_KMEMLEAK is not set -# CONFIG_DEBUG_OBJECTS is not set -# CONFIG_SHRINKER_DEBUG is not set -# CONFIG_DEBUG_STACK_USAGE is not set -CONFIG_SCHED_STACK_END_CHECK=y -CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE=y -# CONFIG_DEBUG_VM is not set -# CONFIG_DEBUG_VM_PGTABLE is not set -CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y -# CONFIG_DEBUG_VIRTUAL is not set -# CONFIG_DEBUG_MEMORY_INIT is not set -# CONFIG_DEBUG_PER_CPU_MAPS is not set -# CONFIG_MEM_ALLOC_PROFILING is not set -CONFIG_HAVE_ARCH_KASAN=y -CONFIG_HAVE_ARCH_KASAN_VMALLOC=y -CONFIG_CC_HAS_KASAN_GENERIC=y -CONFIG_CC_HAS_WORKING_NOSANITIZE_ADDRESS=y -# CONFIG_KASAN is not set -CONFIG_HAVE_ARCH_KFENCE=y -CONFIG_KFENCE=y -CONFIG_KFENCE_SAMPLE_INTERVAL=100 -CONFIG_KFENCE_NUM_OBJECTS=255 -# CONFIG_KFENCE_DEFERRABLE is not set -# CONFIG_KFENCE_STATIC_KEYS is not set -CONFIG_KFENCE_STRESS_TEST_FAULTS=0 -CONFIG_HAVE_ARCH_KMSAN=y -# end of Memory Debugging - -# CONFIG_DEBUG_SHIRQ is not set - -# Debug Oops, Lockups and Hangs -# CONFIG_PANIC_ON_OOPS is not set -CONFIG_PANIC_ON_OOPS_VALUE=0 -CONFIG_PANIC_TIMEOUT=0 -CONFIG_LOCKUP_DETECTOR=y -CONFIG_SOFTLOCKUP_DETECTOR=y -# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set -CONFIG_HAVE_HARDLOCKUP_DETECTOR_BUDDY=y -CONFIG_HARDLOCKUP_DETECTOR=y -# CONFIG_HARDLOCKUP_DETECTOR_PREFER_BUDDY is not set -CONFIG_HARDLOCKUP_DETECTOR_PERF=y -# CONFIG_HARDLOCKUP_DETECTOR_BUDDY is not set -# CONFIG_HARDLOCKUP_DETECTOR_ARCH is not set -CONFIG_HARDLOCKUP_DETECTOR_COUNTS_HRTIMER=y -CONFIG_HARDLOCKUP_CHECK_TIMESTAMP=y -CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y -CONFIG_DETECT_HUNG_TASK=y -CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=0 -# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set -# CONFIG_WQ_WATCHDOG is not set -# CONFIG_WQ_CPU_INTENSIVE_REPORT is not set -# CONFIG_TEST_LOCKUP is not set -# end of Debug Oops, Lockups and Hangs - -# Scheduler Debugging -CONFIG_SCHED_DEBUG=y -CONFIG_SCHED_INFO=y -CONFIG_SCHEDSTATS=y -# end of Scheduler Debugging - -# Lock Debugging (spinlocks, mutexes, etc...) -CONFIG_LOCK_DEBUGGING_SUPPORT=y -# CONFIG_PROVE_LOCKING is not set -# CONFIG_LOCK_STAT is not set -# CONFIG_DEBUG_RT_MUTEXES is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_MUTEXES is not set -# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set -# CONFIG_DEBUG_RWSEMS is not set -# CONFIG_DEBUG_LOCK_ALLOC is not set -# CONFIG_DEBUG_ATOMIC_SLEEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -# CONFIG_LOCK_TORTURE_TEST is not set -# CONFIG_WW_MUTEX_SELFTEST is not set -# CONFIG_SCF_TORTURE_TEST is not set -# CONFIG_CSD_LOCK_WAIT_DEBUG is not set -# end of Lock Debugging (spinlocks, mutexes, etc...) - -# CONFIG_NMI_CHECK_CPU is not set -# CONFIG_DEBUG_IRQFLAGS is not set -CONFIG_STACKTRACE=y -# CONFIG_DEBUG_KOBJECT is not set - -# Debug kernel data structures -# CONFIG_DEBUG_LIST is not set -# CONFIG_DEBUG_PLIST is not set -CONFIG_DEBUG_SG=y -CONFIG_DEBUG_NOTIFIERS=y -# CONFIG_DEBUG_MAPLE_TREE is not set -# end of Debug kernel data structures - -# RCU Debugging -# CONFIG_RCU_SCALE_TEST is not set -# CONFIG_RCU_TORTURE_TEST is not set -# CONFIG_RCU_REF_SCALE_TEST is not set -CONFIG_RCU_CPU_STALL_TIMEOUT=60 -CONFIG_RCU_EXP_CPU_STALL_TIMEOUT=0 -# CONFIG_RCU_CPU_STALL_CPUTIME is not set -# CONFIG_RCU_TRACE is not set -# CONFIG_RCU_EQS_DEBUG is not set -# end of RCU Debugging - -# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set -# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set -CONFIG_LATENCYTOP=y -# CONFIG_DEBUG_CGROUP_REF is not set -CONFIG_USER_STACKTRACE_SUPPORT=y -CONFIG_NOP_TRACER=y -CONFIG_HAVE_RETHOOK=y -CONFIG_RETHOOK=y -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_GRAPH_FREGS=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y -CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y -CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y -CONFIG_HAVE_DYNAMIC_FTRACE_NO_PATCHABLE=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_FENTRY=y -CONFIG_HAVE_OBJTOOL_MCOUNT=y -CONFIG_HAVE_OBJTOOL_NOP_MCOUNT=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_HAVE_BUILDTIME_MCOUNT_SORT=y -CONFIG_BUILDTIME_MCOUNT_SORT=y -CONFIG_TRACE_CLOCK=y -CONFIG_RING_BUFFER=y -CONFIG_EVENT_TRACING=y -CONFIG_CONTEXT_SWITCH_TRACER=y -CONFIG_TRACING=y -CONFIG_GENERIC_TRACER=y -CONFIG_TRACING_SUPPORT=y -CONFIG_FTRACE=y -# CONFIG_BOOTTIME_TRACING is not set -CONFIG_FUNCTION_TRACER=y -CONFIG_FUNCTION_GRAPH_TRACER=y -CONFIG_FUNCTION_GRAPH_RETVAL=y -CONFIG_DYNAMIC_FTRACE=y -CONFIG_DYNAMIC_FTRACE_WITH_REGS=y -CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y -CONFIG_DYNAMIC_FTRACE_WITH_ARGS=y -# CONFIG_FPROBE is not set -# CONFIG_FUNCTION_PROFILER is not set -# CONFIG_STACK_TRACER is not set -# CONFIG_IRQSOFF_TRACER is not set -# CONFIG_SCHED_TRACER is not set -# CONFIG_HWLAT_TRACER is not set -# CONFIG_OSNOISE_TRACER is not set -# CONFIG_TIMERLAT_TRACER is not set -# CONFIG_MMIOTRACE is not set -CONFIG_FTRACE_SYSCALLS=y -# CONFIG_TRACER_SNAPSHOT is not set -CONFIG_BRANCH_PROFILE_NONE=y -# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set -CONFIG_BLK_DEV_IO_TRACE=y -CONFIG_PROBE_EVENTS_BTF_ARGS=y -CONFIG_KPROBE_EVENTS=y -# CONFIG_KPROBE_EVENTS_ON_NOTRACE is not set -CONFIG_UPROBE_EVENTS=y -CONFIG_BPF_EVENTS=y -CONFIG_DYNAMIC_EVENTS=y -CONFIG_PROBE_EVENTS=y -# CONFIG_BPF_KPROBE_OVERRIDE is not set -CONFIG_FTRACE_MCOUNT_RECORD=y -CONFIG_FTRACE_MCOUNT_USE_CC=y -# CONFIG_SYNTH_EVENTS is not set -CONFIG_USER_EVENTS=y -# CONFIG_HIST_TRIGGERS is not set -# CONFIG_TRACE_EVENT_INJECT is not set -# CONFIG_TRACEPOINT_BENCHMARK is not set -# CONFIG_RING_BUFFER_BENCHMARK is not set -# CONFIG_TRACE_EVAL_MAP_FILE is not set -# CONFIG_FTRACE_RECORD_RECURSION is not set -# CONFIG_FTRACE_VALIDATE_RCU_IS_WATCHING is not set -# CONFIG_FTRACE_STARTUP_TEST is not set -# CONFIG_FTRACE_SORT_STARTUP_TEST is not set -# CONFIG_RING_BUFFER_STARTUP_TEST is not set -# CONFIG_RING_BUFFER_VALIDATE_TIME_DELTAS is not set -# CONFIG_PREEMPTIRQ_DELAY_TEST is not set -# CONFIG_KPROBE_EVENT_GEN_TEST is not set -# CONFIG_RV is not set -# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set -# CONFIG_SAMPLES is not set -CONFIG_HAVE_SAMPLE_FTRACE_DIRECT=y -CONFIG_HAVE_SAMPLE_FTRACE_DIRECT_MULTI=y -CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y -CONFIG_STRICT_DEVMEM=y -# CONFIG_IO_STRICT_DEVMEM is not set - -# x86 Debugging -# CONFIG_X86_VERBOSE_BOOTUP is not set -CONFIG_EARLY_PRINTK=y -# CONFIG_EARLY_PRINTK_DBGP is not set -# CONFIG_EARLY_PRINTK_USB_XDBC is not set -# CONFIG_EFI_PGT_DUMP is not set -# CONFIG_DEBUG_TLBFLUSH is not set -# CONFIG_IOMMU_DEBUG is not set -CONFIG_HAVE_MMIOTRACE_SUPPORT=y -# CONFIG_X86_DECODER_SELFTEST is not set -CONFIG_IO_DELAY_0X80=y -# CONFIG_IO_DELAY_0XED is not set -# CONFIG_IO_DELAY_UDELAY is not set -# CONFIG_IO_DELAY_NONE is not set -# CONFIG_DEBUG_BOOT_PARAMS is not set -# CONFIG_CPA_DEBUG is not set -# CONFIG_DEBUG_ENTRY is not set -# CONFIG_DEBUG_NMI_SELFTEST is not set -# CONFIG_X86_DEBUG_FPU is not set -# CONFIG_PUNIT_ATOM_DEBUG is not set -# CONFIG_UNWINDER_ORC is not set -CONFIG_UNWINDER_FRAME_POINTER=y -# end of x86 Debugging - -# Kernel Testing and Coverage -# CONFIG_KUNIT is not set -# CONFIG_NOTIFIER_ERROR_INJECTION is not set -CONFIG_FUNCTION_ERROR_INJECTION=y -# CONFIG_FAULT_INJECTION is not set -CONFIG_ARCH_HAS_KCOV=y -CONFIG_CC_HAS_SANCOV_TRACE_PC=y -# CONFIG_KCOV is not set -CONFIG_RUNTIME_TESTING_MENU=y -# CONFIG_TEST_DHRY is not set -# CONFIG_LKDTM is not set -# CONFIG_TEST_MIN_HEAP is not set -# CONFIG_TEST_DIV64 is not set -# CONFIG_TEST_MULDIV64 is not set -# CONFIG_BACKTRACE_SELF_TEST is not set -# CONFIG_TEST_REF_TRACKER is not set -# CONFIG_RBTREE_TEST is not set -# CONFIG_REED_SOLOMON_TEST is not set -# CONFIG_INTERVAL_TREE_TEST is not set -# CONFIG_PERCPU_TEST is not set -# CONFIG_ATOMIC64_SELFTEST is not set -# CONFIG_ASYNC_RAID6_TEST is not set -# CONFIG_TEST_HEXDUMP is not set -# CONFIG_TEST_KSTRTOX is not set -# CONFIG_TEST_PRINTF is not set -# CONFIG_TEST_SCANF is not set -# CONFIG_TEST_BITMAP is not set -# CONFIG_TEST_UUID is not set -# CONFIG_TEST_XARRAY is not set -# CONFIG_TEST_MAPLE_TREE is not set -# CONFIG_TEST_RHASHTABLE is not set -# CONFIG_TEST_IDA is not set -# CONFIG_TEST_LKM is not set -# CONFIG_TEST_BITOPS is not set -# CONFIG_TEST_VMALLOC is not set -# CONFIG_TEST_BPF is not set -# CONFIG_TEST_BLACKHOLE_DEV is not set -# CONFIG_FIND_BIT_BENCHMARK is not set -# CONFIG_TEST_FIRMWARE is not set -# CONFIG_TEST_SYSCTL is not set -# CONFIG_TEST_UDELAY is not set -# CONFIG_TEST_STATIC_KEYS is not set -# CONFIG_TEST_DYNAMIC_DEBUG is not set -# CONFIG_TEST_KMOD is not set -# CONFIG_TEST_MEMCAT_P is not set -# CONFIG_TEST_MEMINIT is not set -# CONFIG_TEST_FREE_PAGES is not set -# CONFIG_TEST_FPU is not set -# CONFIG_TEST_CLOCKSOURCE_WATCHDOG is not set -# CONFIG_TEST_OBJPOOL is not set -CONFIG_ARCH_USE_MEMTEST=y -CONFIG_MEMTEST=y -# CONFIG_HYPERV_TESTING is not set -# end of Kernel Testing and Coverage - -# Rust hacking -# end of Rust hacking -# end of Kernel hacking diff --git a/SPECS/91/linux/config_x86_64_acvp b/SPECS/91/linux/config_x86_64_acvp deleted file mode 100644 index 4852cee057..0000000000 --- a/SPECS/91/linux/config_x86_64_acvp +++ /dev/null @@ -1,11 +0,0 @@ -CONFIG_CRYPTO_USER=y -CONFIG_CRYPTO_DH=y -CONFIG_CRYPTO_USER_API=y -CONFIG_CRYPTO_USER_API_HASH=y -CONFIG_CRYPTO_USER_API_SKCIPHER=y -CONFIG_CRYPTO_USER_API_RNG=y -CONFIG_CRYPTO_USER_API_RNG_CAVP=y -CONFIG_CRYPTO_USER_API_AEAD=y -CONFIG_CRYPTO_USER_API_AKCIPHER=y -CONFIG_CRYPTO_USER_API_KPP=y -CONFIG_CRYPTO_USER_API_ECC=y diff --git a/SPECS/91/linux/crypto/0001-crypto-sha1_generic-Renaming-sha1_final.patch b/SPECS/91/linux/crypto/0001-crypto-sha1_generic-Renaming-sha1_final.patch deleted file mode 100644 index 49018a3fc2..0000000000 --- a/SPECS/91/linux/crypto/0001-crypto-sha1_generic-Renaming-sha1_final.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 1a2d8b2e9b4acbe2a7ea9a1c389712f94c14a0f3 Mon Sep 17 00:00:00 2001 -From: Ankit Jain -Date: Fri, 7 Nov 2025 10:30:28 +0000 -Subject: [PATCH] crypto/sha1_generic: Renaming sha1_final - -- Renaming to crypto_sha1_final to prevent conflict - with sha1 lib's sha1_final [1] - -[1]: https://github.com/torvalds/linux/commit/90860aef630c5c9e58d05044f2866fcbfa7aa4d9 - -Signed-off-by: Ankit Jain ---- - crypto/sha1_generic.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/crypto/sha1_generic.c b/crypto/sha1_generic.c -index 24ab7da36..2a0da71bb 100644 ---- a/crypto/sha1_generic.c -+++ b/crypto/sha1_generic.c -@@ -47,7 +47,7 @@ int crypto_sha1_update(struct shash_desc *desc, const u8 *data, - } - EXPORT_SYMBOL(crypto_sha1_update); - --static int sha1_final(struct shash_desc *desc, u8 *out) -+static int crypto_sha1_final(struct shash_desc *desc, u8 *out) - { - sha1_base_do_finalize(desc, sha1_generic_block_fn); - return sha1_base_finish(desc, out); -@@ -57,7 +57,7 @@ int crypto_sha1_finup(struct shash_desc *desc, const u8 *data, - unsigned int len, u8 *out) - { - sha1_base_do_update(desc, data, len, sha1_generic_block_fn); -- return sha1_final(desc, out); -+ return crypto_sha1_final(desc, out); - } - EXPORT_SYMBOL(crypto_sha1_finup); - -@@ -65,7 +65,7 @@ static struct shash_alg alg = { - .digestsize = SHA1_DIGEST_SIZE, - .init = sha1_base_init, - .update = crypto_sha1_update, -- .final = sha1_final, -+ .final = crypto_sha1_final, - .finup = crypto_sha1_finup, - .descsize = sizeof(struct sha1_state), - .base = { --- -2.40.4 - diff --git a/SPECS/91/linux/crypto/0001-crypto-track-external-requests-to-jitterentropy_rng.patch b/SPECS/91/linux/crypto/0001-crypto-track-external-requests-to-jitterentropy_rng.patch deleted file mode 100644 index 9020ecd42d..0000000000 --- a/SPECS/91/linux/crypto/0001-crypto-track-external-requests-to-jitterentropy_rng.patch +++ /dev/null @@ -1,157 +0,0 @@ -From 1b0b061348d9b84abae0b01d3af544631daf4f13 Mon Sep 17 00:00:00 2001 -From: Brennan Lamoreaux -Date: Fri, 23 Jan 2026 16:19:04 -0800 -Subject: [PATCH] crypto: track external requests to jitterentropy_rng - -Add a variable to crypto_tfm, which is used to denote -if a request is originating inside or outside of the kernel. -Pass it through where necessary, e.g for drbg/stdrng, we need -to pass it through to the underlying jitterentropy_rng tfm. - -In future, this can be used to prioritize certain requests -in the proxy. - -Signed-off-by: Brennan Lamoreaux ---- - crypto/algif_rng.c | 2 ++ - crypto/drbg.c | 7 +++++++ - crypto/rng.c | 9 +++++++-- - include/crypto/drbg.h | 1 + - include/linux/crypto.h | 11 +++++++---- - 5 files changed, 24 insertions(+), 6 deletions(-) - -diff --git a/crypto/algif_rng.c b/crypto/algif_rng.c -index 1a86e40c8..4e9054bd1 100644 ---- a/crypto/algif_rng.c -+++ b/crypto/algif_rng.c -@@ -212,6 +212,8 @@ static void *rng_bind(const char *name, u32 type, u32 mask) - return ERR_CAST(rng); - } - -+ rng->base.external = true; -+ - pctx->drng = rng; - return pctx; - } -diff --git a/crypto/drbg.c b/crypto/drbg.c -index 3addce909..f6198fcbe 100644 ---- a/crypto/drbg.c -+++ b/crypto/drbg.c -@@ -1535,6 +1535,8 @@ static int drbg_prepare_hrng(struct drbg_state *drbg) - pr_info("DRBG: Continuing without Jitter RNG\n"); - } - -+ drbg->jent->base.external = drbg->external; -+ - return 0; - } - -@@ -1936,6 +1938,9 @@ static int drbg_kcapi_random(struct crypto_rng *tfm, - struct drbg_state *drbg = crypto_rng_ctx(tfm); - struct drbg_string *addtl = NULL; - struct drbg_string string; -+ struct crypto_tfm *tfm_base = crypto_rng_tfm(tfm); -+ -+ drbg->external = tfm_base->external; - - if (slen) { - /* linked list variable is now local to allow modification */ -@@ -1959,6 +1964,8 @@ static int drbg_kcapi_seed(struct crypto_rng *tfm, - struct drbg_string *seed_string = NULL; - int coreref = 0; - -+ drbg->external = tfm_base->external; -+ - drbg_convert_tfm_core(crypto_tfm_alg_driver_name(tfm_base), &coreref, - &pr); - if (0 < slen) { -diff --git a/crypto/rng.c b/crypto/rng.c -index b8092fef2..5873ea4fe 100644 ---- a/crypto/rng.c -+++ b/crypto/rng.c -@@ -29,7 +29,7 @@ struct crypto_rng *crypto_default_rng; - EXPORT_SYMBOL_GPL(crypto_default_rng); - static int crypto_default_rng_refcnt; - --static int get_jent_random_bytes(u8 * buf, unsigned int slen) -+static int get_jent_random_bytes(u8 * buf, unsigned int slen, bool external) - { - struct crypto_rng *jitter_entropy = - crypto_alloc_rng("jitterentropy_rng", 0, 0); -@@ -39,6 +39,8 @@ static int get_jent_random_bytes(u8 * buf, unsigned int slen) - pr_err("RNG: Failed to allocated Jitter entropy RNG\n"); - return -ENOENT; - } -+ -+ jitter_entropy->base.external = external; - ret = crypto_rng_get_bytes(jitter_entropy, buf, slen); - if (ret) { - pr_err("RNG: Failed to read from Jitter entropy RNG\n"); -@@ -51,6 +53,7 @@ static int get_jent_random_bytes(u8 * buf, unsigned int slen) - int crypto_rng_reset(struct crypto_rng *tfm, const u8 *seed, unsigned int slen) - { - u8 *buf = NULL; -+ struct crypto_tfm *tfm_base; - int err; - - if (!seed && slen) { -@@ -59,7 +62,9 @@ int crypto_rng_reset(struct crypto_rng *tfm, const u8 *seed, unsigned int slen) - return -ENOMEM; - - if (fips_enabled) { -- err = get_jent_random_bytes(buf, slen); -+ tfm_base = crypto_rng_tfm(tfm); -+ err = get_jent_random_bytes(buf, slen, -+ tfm_base->external); - } else { - err = get_random_bytes_wait(buf, slen); - } -diff --git a/include/crypto/drbg.h b/include/crypto/drbg.h -index af5ad51d3..10150f653 100644 ---- a/include/crypto/drbg.h -+++ b/include/crypto/drbg.h -@@ -142,6 +142,7 @@ struct drbg_state { - const struct drbg_state_ops *d_ops; - const struct drbg_core *core; - struct drbg_string test_data; -+ bool external; - }; - - static inline __u8 drbg_statelen(struct drbg_state *drbg) -diff --git a/include/linux/crypto.h b/include/linux/crypto.h -index b164da5e1..d6a78fde6 100644 ---- a/include/linux/crypto.h -+++ b/include/linux/crypto.h -@@ -425,11 +425,14 @@ struct crypto_tfm { - u32 crt_flags; - - int node; -- -+ - void (*exit)(struct crypto_tfm *tfm); -- -+ - struct crypto_alg *__crt_alg; - -+ /* Is this owned by a userspace process? */ -+ bool external; -+ - void *__crt_ctx[] CRYPTO_MINALIGN_ATTR; - }; - -@@ -437,10 +440,10 @@ struct crypto_comp { - struct crypto_tfm base; - }; - --/* -+/* - * Transform user interface. - */ -- -+ - struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask); - void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm); - --- -2.43.7 - diff --git a/SPECS/91/linux/crypto/0001-crypto-x86-sha1-Rename-conflicting-symbol.patch b/SPECS/91/linux/crypto/0001-crypto-x86-sha1-Rename-conflicting-symbol.patch deleted file mode 100644 index d38517b208..0000000000 --- a/SPECS/91/linux/crypto/0001-crypto-x86-sha1-Rename-conflicting-symbol.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 433a77d2fe6cfb8b2e670bbb75ff49df500663b6 Mon Sep 17 00:00:00 2001 -From: Eric Biggers -Date: Sat, 12 Jul 2025 16:22:52 -0700 -Subject: [PATCH 1/3] crypto: x86/sha1 - Rename conflicting symbol - -[Upstream commit 56119446f89fbab40f3a160e9c3de33687cd85cf] - -Rename x86's sha1_update() to sha1_update_x86(), since it conflicts with -the upcoming sha1_update() library function. - -Note: the affected code will be superseded by later commits that migrate -the arch-optimized SHA-1 code into the library. This commit simply -keeps the kernel building for the initial introduction of the library. - -Reviewed-by: Ard Biesheuvel -Link: https://lore.kernel.org/r/20250712232329.818226-2-ebiggers@kernel.org -Signed-off-by: Eric Biggers -[Ankit: Backported for v6.12] -Signed-off-by: Ankit Jain ---- - arch/x86/crypto/sha1_ssse3_glue.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/arch/x86/crypto/sha1_ssse3_glue.c b/arch/x86/crypto/sha1_ssse3_glue.c -index ab8bc54f2..6d7e20ca8 100644 ---- a/arch/x86/crypto/sha1_ssse3_glue.c -+++ b/arch/x86/crypto/sha1_ssse3_glue.c -@@ -38,7 +38,7 @@ static const struct x86_cpu_id module_cpu_ids[] = { - }; - MODULE_DEVICE_TABLE(x86cpu, module_cpu_ids); - --static int sha1_update(struct shash_desc *desc, const u8 *data, -+static int sha1_update_x86(struct shash_desc *desc, const u8 *data, - unsigned int len, sha1_block_fn *sha1_xform) - { - struct sha1_state *sctx = shash_desc_ctx(desc); -@@ -81,7 +81,7 @@ asmlinkage void sha1_transform_ssse3(struct sha1_state *state, - static int sha1_ssse3_update(struct shash_desc *desc, const u8 *data, - unsigned int len) - { -- return sha1_update(desc, data, len, sha1_transform_ssse3); -+ return sha1_update_x86(desc, data, len, sha1_transform_ssse3); - } - - static int sha1_ssse3_finup(struct shash_desc *desc, const u8 *data, -@@ -131,7 +131,7 @@ asmlinkage void sha1_transform_avx(struct sha1_state *state, - static int sha1_avx_update(struct shash_desc *desc, const u8 *data, - unsigned int len) - { -- return sha1_update(desc, data, len, sha1_transform_avx); -+ return sha1_update_x86(desc, data, len, sha1_transform_avx); - } - - static int sha1_avx_finup(struct shash_desc *desc, const u8 *data, -@@ -213,7 +213,7 @@ static void sha1_apply_transform_avx2(struct sha1_state *state, - static int sha1_avx2_update(struct shash_desc *desc, const u8 *data, - unsigned int len) - { -- return sha1_update(desc, data, len, sha1_apply_transform_avx2); -+ return sha1_update_x86(desc, data, len, sha1_apply_transform_avx2); - } - - static int sha1_avx2_finup(struct shash_desc *desc, const u8 *data, -@@ -263,7 +263,7 @@ asmlinkage void sha1_ni_transform(struct sha1_state *digest, const u8 *data, - static int sha1_ni_update(struct shash_desc *desc, const u8 *data, - unsigned int len) - { -- return sha1_update(desc, data, len, sha1_ni_transform); -+ return sha1_update_x86(desc, data, len, sha1_ni_transform); - } - - static int sha1_ni_finup(struct shash_desc *desc, const u8 *data, --- -2.40.4 - diff --git a/SPECS/91/linux/crypto/0001-lib-digsig-Use-SHA-1-library-instead-of-crypto_shash.patch b/SPECS/91/linux/crypto/0001-lib-digsig-Use-SHA-1-library-instead-of-crypto_shash.patch deleted file mode 100644 index 2139edeb6c..0000000000 --- a/SPECS/91/linux/crypto/0001-lib-digsig-Use-SHA-1-library-instead-of-crypto_shash.patch +++ /dev/null @@ -1,127 +0,0 @@ -From 760516c250fdadf547b4b705d678368cc67fee98 Mon Sep 17 00:00:00 2001 -From: Eric Biggers -Date: Thu, 14 Aug 2025 19:17:33 -0700 -Subject: [PATCH] lib/digsig: Use SHA-1 library instead of crypto_shash - -[ Upstream commit 191cac349c8eeeb6d64453b8db194d3ad42ca9dc ] - -Now that a SHA-1 library API is available, use it instead of -crypto_shash. This is simpler and faster. - -Signed-off-by: Eric Biggers -Reviewed-by: Paul Menzel -Signed-off-by: Mimi Zohar - -[Srinidhi Rao Backported this patch to v6.12.x] -Signed-off-by: srinidhira0 ---- - lib/Kconfig | 3 +-- - lib/digsig.c | 46 ++++++---------------------------------------- - 2 files changed, 7 insertions(+), 42 deletions(-) - -diff --git a/lib/Kconfig b/lib/Kconfig -index b893c9288c14..e058a1cc8be5 100644 ---- a/lib/Kconfig -+++ b/lib/Kconfig -@@ -614,8 +614,7 @@ config MPILIB - config SIGNATURE - tristate - depends on KEYS -- select CRYPTO -- select CRYPTO_SHA1 -+ select CRYPTO_LIB_SHA1 - select MPILIB - help - Digital signature verification. Currently only RSA is supported. -diff --git a/lib/digsig.c b/lib/digsig.c -index 04b5e55ed95f..5ddcc52f7686 100644 ---- a/lib/digsig.c -+++ b/lib/digsig.c -@@ -18,15 +18,11 @@ - #include - #include - #include --#include --#include - #include - #include - #include - #include - --static struct crypto_shash *shash; -- - static const char *pkcs_1_v1_5_decode_emsa(const unsigned char *msg, - unsigned long msglen, - unsigned long modulus_bitlen, -@@ -199,12 +195,12 @@ static int digsig_verify_rsa(struct key *key, - int digsig_verify(struct key *keyring, const char *sig, int siglen, - const char *data, int datalen) - { -- int err = -ENOMEM; - struct signature_hdr *sh = (struct signature_hdr *)sig; -- struct shash_desc *desc = NULL; -+ struct sha1_ctx ctx; - unsigned char hash[SHA1_DIGEST_SIZE]; - struct key *key; - char name[20]; -+ int err; - - if (siglen < sizeof(*sh) + 2) - return -EINVAL; -@@ -231,49 +227,19 @@ int digsig_verify(struct key *keyring, const char *sig, int siglen, - return PTR_ERR(key); - } - -- desc = kzalloc(sizeof(*desc) + crypto_shash_descsize(shash), -- GFP_KERNEL); -- if (!desc) -- goto err; -- -- desc->tfm = shash; -- -- crypto_shash_init(desc); -- crypto_shash_update(desc, data, datalen); -- crypto_shash_update(desc, sig, sizeof(*sh)); -- crypto_shash_final(desc, hash); -- -- kfree(desc); -+ sha1_init(&ctx); -+ sha1_update(&ctx, data, datalen); -+ sha1_update(&ctx, sig, sizeof(*sh)); -+ sha1_final(&ctx, hash); - - /* pass signature mpis address */ - err = digsig_verify_rsa(key, sig + sizeof(*sh), siglen - sizeof(*sh), - hash, sizeof(hash)); - --err: - key_put(key); - - return err ? -EINVAL : 0; - } - EXPORT_SYMBOL_GPL(digsig_verify); - --static int __init digsig_init(void) --{ -- shash = crypto_alloc_shash("sha1", 0, 0); -- if (IS_ERR(shash)) { -- pr_err("shash allocation failed\n"); -- return PTR_ERR(shash); -- } -- -- return 0; -- --} -- --static void __exit digsig_cleanup(void) --{ -- crypto_free_shash(shash); --} -- --module_init(digsig_init); --module_exit(digsig_cleanup); -- - MODULE_LICENSE("GPL"); --- -2.35.6 - diff --git a/SPECS/91/linux/crypto/0001-linux-ima-Use-lib-sha1-instead-of-crypto-shash.patch b/SPECS/91/linux/crypto/0001-linux-ima-Use-lib-sha1-instead-of-crypto-shash.patch deleted file mode 100644 index 56735a94cb..0000000000 --- a/SPECS/91/linux/crypto/0001-linux-ima-Use-lib-sha1-instead-of-crypto-shash.patch +++ /dev/null @@ -1,277 +0,0 @@ -From d73b1ab12b14073d8dc82d7be12300d563b5ca1c Mon Sep 17 00:00:00 2001 -From: srinidhira0 -Date: Sun, 16 Aug 2026 14:57:34 +0000 -Subject: [PATCH] linux:ima: Use lib sha1 instead of crypto shash - - - IMA module unconditionally computes a SHA-1 digest for every -measurement-log entry since legacy TPMv1.2. TPM2, uses SHA-256 as its primary -algorithm and TPMv1.2 is largely deprecated. However, due to mandatory SHA-1 -digest usage, IMA init fails in FIPS mode as crypto shash alloc for SHA-1 -returns error. -This change is intended to make IMA module to utilize lib sha-1 which is -outside crypto boundary for the mandatory SHA-1 slot. -Note: This change only supports lib sha1 for internal mandatory sha-1 digest -path. Attempt to use SHA-1 as primary algorithm or a setxattr naming sha1 -fails as SHA-1 should not be used for FIPS compliance. - -Signed-off-by: Srinidhi Rao ---- - security/integrity/ima/ima_crypto.c | 172 +++++++++++++++++++++------- - 1 file changed, 130 insertions(+), 42 deletions(-) - -diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima/ima_crypto.c -index 8ae7821a65c2..e6f0217db735 100644 ---- a/security/integrity/ima/ima_crypto.c -+++ b/security/integrity/ima/ima_crypto.c -@@ -158,29 +158,34 @@ int __init ima_init_crypto(void) - continue; - } - -- ima_algo_array[i].tfm = ima_alloc_tfm(algo); -- if (IS_ERR(ima_algo_array[i].tfm)) { -- if (algo == HASH_ALGO_SHA1) { -- rc = PTR_ERR(ima_algo_array[i].tfm); -- ima_algo_array[i].tfm = NULL; -- goto out_array; -- } -- -+ /* -+ * The SHA1 digest is mandatory for legacy (TPM 1.2 / -+ * pre-agile) verifiers and is always computed directly via -+ * the SHA-1 library, not the crypto API (see -+ * ima_calc_field_array_hash()). Skip allocating a shash -+ * transform for it here, since "sha1" may not be registered -+ * with the crypto API at all (e.g. disabled in FIPS mode). -+ */ -+ if (algo == HASH_ALGO_SHA1) { - ima_algo_array[i].tfm = NULL; -+ continue; - } -+ -+ ima_algo_array[i].tfm = ima_alloc_tfm(algo); -+ if (IS_ERR(ima_algo_array[i].tfm)) -+ ima_algo_array[i].tfm = NULL; - } - - if (ima_sha1_idx >= NR_BANKS(ima_tpm_chip)) { -- if (ima_hash_algo == HASH_ALGO_SHA1) { -+ /* -+ * No allocated TPM bank already covers SHA1; reserve the -+ * extra slot for it. As above, no shash transform is -+ * allocated - the digest is computed via the SHA-1 library. -+ */ -+ if (ima_hash_algo == HASH_ALGO_SHA1) - ima_algo_array[ima_sha1_idx].tfm = ima_shash_tfm; -- } else { -- ima_algo_array[ima_sha1_idx].tfm = -- ima_alloc_tfm(HASH_ALGO_SHA1); -- if (IS_ERR(ima_algo_array[ima_sha1_idx].tfm)) { -- rc = PTR_ERR(ima_algo_array[ima_sha1_idx].tfm); -- goto out_array; -- } -- } -+ else -+ ima_algo_array[ima_sha1_idx].tfm = NULL; - - ima_algo_array[ima_sha1_idx].algo = HASH_ALGO_SHA1; - } -@@ -192,15 +197,6 @@ int __init ima_init_crypto(void) - } - - return 0; --out_array: -- for (i = 0; i < NR_BANKS(ima_tpm_chip) + ima_extra_slots; i++) { -- if (!ima_algo_array[i].tfm || -- ima_algo_array[i].tfm == ima_shash_tfm) -- continue; -- -- crypto_free_shash(ima_algo_array[i].tfm); -- } -- kfree(ima_algo_array); - out: - crypto_free_shash(ima_shash_tfm); - return rc; -@@ -572,23 +568,35 @@ int ima_calc_file_hash(struct file *file, struct ima_digest_data *hash) - return rc; - } - -+/* -+ * Incremental-hash callback used by ima_calc_field_array_hash_walk() so the -+ * same field-walking logic can drive either a crypto_shash context or a -+ * plain SHA-1 library context. -+ */ -+typedef int (*ima_hash_update_fn)(void *ctx, const void *data, unsigned int len); -+ -+static int ima_shash_update_cb(void *ctx, const void *data, unsigned int len) -+{ -+ return crypto_shash_update(ctx, data, len); -+} -+ -+static int ima_sha1_lib_update_cb(void *ctx, const void *data, unsigned int len) -+{ -+ sha1_update(ctx, data, len); -+ return 0; -+} -+ - /* - * Calculate the hash of template data - */ --static int ima_calc_field_array_hash_tfm(struct ima_field_data *field_data, -- struct ima_template_entry *entry, -- int tfm_idx) -+static int ima_calc_field_array_hash_walk(struct ima_field_data *field_data, -+ struct ima_template_entry *entry, -+ void *hash_ctx, -+ ima_hash_update_fn update) - { -- SHASH_DESC_ON_STACK(shash, ima_algo_array[tfm_idx].tfm); - struct ima_template_desc *td = entry->template_desc; - int num_fields = entry->template_desc->num_fields; -- int rc, i; -- -- shash->tfm = ima_algo_array[tfm_idx].tfm; -- -- rc = crypto_shash_init(shash); -- if (rc != 0) -- return rc; -+ int rc = 0, i; - - for (i = 0; i < num_fields; i++) { - u8 buffer[IMA_EVENT_NAME_LEN_MAX + 1] = { 0 }; -@@ -598,9 +606,8 @@ static int ima_calc_field_array_hash_tfm(struct ima_field_data *field_data, - datalen : (__force u32)cpu_to_le32(datalen); - - if (strcmp(td->name, IMA_TEMPLATE_IMA_NAME) != 0) { -- rc = crypto_shash_update(shash, -- (const u8 *) &datalen_to_hash, -- sizeof(datalen_to_hash)); -+ rc = update(hash_ctx, &datalen_to_hash, -+ sizeof(datalen_to_hash)); - if (rc) - break; - } else if (strcmp(td->fields[i]->field_id, "n") == 0) { -@@ -608,24 +615,67 @@ static int ima_calc_field_array_hash_tfm(struct ima_field_data *field_data, - data_to_hash = buffer; - datalen = IMA_EVENT_NAME_LEN_MAX + 1; - } -- rc = crypto_shash_update(shash, data_to_hash, datalen); -+ rc = update(hash_ctx, data_to_hash, datalen); - if (rc) - break; - } - -+ return rc; -+} -+ -+static int ima_calc_field_array_hash_tfm(struct ima_field_data *field_data, -+ struct ima_template_entry *entry, -+ int tfm_idx) -+{ -+ SHASH_DESC_ON_STACK(shash, ima_algo_array[tfm_idx].tfm); -+ int rc; -+ -+ shash->tfm = ima_algo_array[tfm_idx].tfm; -+ -+ rc = crypto_shash_init(shash); -+ if (rc != 0) -+ return rc; -+ -+ rc = ima_calc_field_array_hash_walk(field_data, entry, shash, -+ ima_shash_update_cb); - if (!rc) - rc = crypto_shash_final(shash, entry->digests[tfm_idx].digest); - - return rc; - } - -+/* -+ * The measurement list always carries a SHA1 digest for legacy (TPM 1.2 / -+ * pre-agile) verifiers, regardless of the algorithm configured for IMA's -+ * own hashing. "sha1" may not be registered with the crypto API at all -+ * (e.g. disabled system-wide in FIPS mode), so this mandatory digest is -+ * computed directly via the SHA-1 library instead of a shash transform. -+ */ -+static int ima_calc_field_array_hash_sha1_lib(struct ima_field_data *field_data, -+ struct ima_template_entry *entry) -+{ -+ struct sha1_ctx ctx; -+ int rc; -+ -+ sha1_init(&ctx); -+ rc = ima_calc_field_array_hash_walk(field_data, entry, &ctx, -+ ima_sha1_lib_update_cb); -+ sha1_final(&ctx, entry->digests[ima_sha1_idx].digest); -+ -+ return rc; -+} -+ - int ima_calc_field_array_hash(struct ima_field_data *field_data, - struct ima_template_entry *entry) - { - u16 alg_id; - int rc, i; - -- rc = ima_calc_field_array_hash_tfm(field_data, entry, ima_sha1_idx); -+ if (ima_algo_array[ima_sha1_idx].tfm) -+ rc = ima_calc_field_array_hash_tfm(field_data, entry, -+ ima_sha1_idx); -+ else -+ rc = ima_calc_field_array_hash_sha1_lib(field_data, entry); - if (rc) - return rc; - -@@ -836,6 +886,33 @@ static int ima_calc_boot_aggregate_tfm(char *digest, u16 alg_id, - return rc; - } - -+/* -+ * Same as ima_calc_boot_aggregate_tfm(), for the case where the only -+ * suitable TPM bank is SHA1 and "sha1" is not registered with the crypto -+ * API (e.g. disabled in FIPS mode). Computed directly via the SHA-1 -+ * library instead of a shash transform. -+ */ -+static int ima_calc_boot_aggregate_sha1_lib(char *digest) -+{ -+ struct tpm_digest d = { .alg_id = TPM_ALG_SHA1, .digest = {0} }; -+ struct sha1_ctx ctx; -+ u32 i; -+ -+ pr_devel("calculating the boot-aggregate based on TPM bank: %04x\n", -+ d.alg_id); -+ -+ sha1_init(&ctx); -+ -+ /* cumulative digest over TPM registers 0-7 */ -+ for (i = TPM_PCR0; i < TPM_PCR8; i++) { -+ ima_pcrread(i, &d); -+ sha1_update(&ctx, d.digest, SHA1_DIGEST_SIZE); -+ } -+ -+ sha1_final(&ctx, digest); -+ return 0; -+} -+ - int ima_calc_boot_aggregate(struct ima_digest_data *hash) - { - struct crypto_shash *tfm; -@@ -863,6 +940,17 @@ int ima_calc_boot_aggregate(struct ima_digest_data *hash) - - hash->algo = ima_tpm_chip->allocated_banks[bank_idx].crypto_id; - -+ /* -+ * A TPM bank is only ever picked as a last resort (see above), so -+ * this only triggers when no other algorithm is usable. In that -+ * case, avoid depending on "sha1" being registered with the crypto -+ * API. -+ */ -+ if (hash->algo == HASH_ALGO_SHA1 && hash->algo != ima_hash_algo) { -+ hash->length = SHA1_DIGEST_SIZE; -+ return ima_calc_boot_aggregate_sha1_lib(hash->digest); -+ } -+ - tfm = ima_alloc_tfm(hash->algo); - if (IS_ERR(tfm)) - return PTR_ERR(tfm); --- -2.53.0 - diff --git a/SPECS/91/linux/crypto/0002-lib-crypto-sha1-Rename-sha1_init-to-sha1_init_raw.patch b/SPECS/91/linux/crypto/0002-lib-crypto-sha1-Rename-sha1_init-to-sha1_init_raw.patch deleted file mode 100644 index c6d800d3ef..0000000000 --- a/SPECS/91/linux/crypto/0002-lib-crypto-sha1-Rename-sha1_init-to-sha1_init_raw.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 53e39abd0cb4379bcc3981c9765032e5e9859c32 Mon Sep 17 00:00:00 2001 -From: Eric Biggers -Date: Sat, 12 Jul 2025 16:22:53 -0700 -Subject: [PATCH 2/3] lib/crypto: sha1: Rename sha1_init() to sha1_init_raw() - -[Upstream commit 9503ca2ccafec51ee9e533d6f3aef14a589fc106] - -Rename the existing sha1_init() to sha1_init_raw(), since it conflicts -with the upcoming library function. This will later be removed, but -this keeps the kernel building for the introduction of the library. - -Reviewed-by: Ard Biesheuvel -Link: https://lore.kernel.org/r/20250712232329.818226-3-ebiggers@kernel.org -Signed-off-by: Eric Biggers -[Ankit: Backported for v6.12] -Signed-off-by: Ankit Jain ---- - include/crypto/sha1.h | 2 +- - kernel/bpf/core.c | 2 +- - lib/crypto/sha1.c | 6 +++--- - net/ipv6/addrconf.c | 2 +- - 4 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/include/crypto/sha1.h b/include/crypto/sha1.h -index 044ecea60..1e85d0974 100644 ---- a/include/crypto/sha1.h -+++ b/include/crypto/sha1.h -@@ -40,7 +40,7 @@ extern int crypto_sha1_finup(struct shash_desc *desc, const u8 *data, - */ - #define SHA1_DIGEST_WORDS (SHA1_DIGEST_SIZE / 4) - #define SHA1_WORKSPACE_WORDS 16 --void sha1_init(__u32 *buf); -+void sha1_init_raw(__u32 *buf); - void sha1_transform(__u32 *digest, const char *data, __u32 *W); - - #endif /* _CRYPTO_SHA1_H */ -diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c -index 5f2ad479e..f56bc453f 100644 ---- a/kernel/bpf/core.c -+++ b/kernel/bpf/core.c -@@ -304,7 +304,7 @@ int bpf_prog_calc_tag(struct bpf_prog *fp) - if (!raw) - return -ENOMEM; - -- sha1_init(digest); -+ sha1_init_raw(digest); - memset(ws, 0, sizeof(ws)); - - /* We need to take out the map fd for the digest calculation -diff --git a/lib/crypto/sha1.c b/lib/crypto/sha1.c -index ebb60519a..f117a7610 100644 ---- a/lib/crypto/sha1.c -+++ b/lib/crypto/sha1.c -@@ -124,10 +124,10 @@ void sha1_transform(__u32 *digest, const char *data, __u32 *array) - EXPORT_SYMBOL(sha1_transform); - - /** -- * sha1_init - initialize the vectors for a SHA1 digest -+ * sha1_init_raw - initialize the vectors for a SHA1 digest - * @buf: vector to initialize - */ --void sha1_init(__u32 *buf) -+void sha1_init_raw(__u32 *buf) - { - buf[0] = 0x67452301; - buf[1] = 0xefcdab89; -@@ -135,7 +135,7 @@ void sha1_init(__u32 *buf) - buf[3] = 0x10325476; - buf[4] = 0xc3d2e1f0; - } --EXPORT_SYMBOL(sha1_init); -+EXPORT_SYMBOL(sha1_init_raw); - - MODULE_DESCRIPTION("SHA-1 Algorithm"); - MODULE_LICENSE("GPL"); -diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c -index be51b8792..1104d69c0 100644 ---- a/net/ipv6/addrconf.c -+++ b/net/ipv6/addrconf.c -@@ -3390,7 +3390,7 @@ static int ipv6_generate_stable_address(struct in6_addr *address, - retry: - spin_lock_bh(&lock); - -- sha1_init(digest); -+ sha1_init_raw(digest); - memset(&data, 0, sizeof(data)); - memset(workspace, 0, sizeof(workspace)); - memcpy(data.hwaddr, idev->dev->perm_addr, idev->dev->addr_len); --- -2.40.4 - diff --git a/SPECS/91/linux/crypto/0003-lib-crypto-sha1-Add-SHA-1-library-functions.patch b/SPECS/91/linux/crypto/0003-lib-crypto-sha1-Add-SHA-1-library-functions.patch deleted file mode 100644 index e69b8812d7..0000000000 --- a/SPECS/91/linux/crypto/0003-lib-crypto-sha1-Add-SHA-1-library-functions.patch +++ /dev/null @@ -1,268 +0,0 @@ -From eea4ce500a8f8b6418f98420175b7386bf0a1bfb Mon Sep 17 00:00:00 2001 -From: Eric Biggers -Date: Sat, 12 Jul 2025 16:22:54 -0700 -Subject: [PATCH 3/3] lib/crypto: sha1: Add SHA-1 library functions - -[Upstream commit 90860aef630c5c9e58d05044f2866fcbfa7aa4d9] - -Add a library interface for SHA-1, following the SHA-2 one. As was the -case with SHA-2, this will be useful for various in-kernel users. The -crypto_shash interface will be reimplemented on top of it as well. - -Reviewed-by: Ard Biesheuvel -Link: https://lore.kernel.org/r/20250712232329.818226-4-ebiggers@kernel.org -Signed-off-by: Eric Biggers -[Ankit: Backported for v6.12] -Signed-off-by: Ankit Jain ---- - include/crypto/sha1.h | 60 ++++++++++++++++++++++ - lib/crypto/Kconfig | 7 +++ - lib/crypto/Makefile | 7 ++- - lib/crypto/sha1.c | 115 ++++++++++++++++++++++++++++++++++++++++-- - 4 files changed, 182 insertions(+), 7 deletions(-) - -diff --git a/include/crypto/sha1.h b/include/crypto/sha1.h -index 1e85d0974..3f4596b99 100644 ---- a/include/crypto/sha1.h -+++ b/include/crypto/sha1.h -@@ -43,4 +43,64 @@ extern int crypto_sha1_finup(struct shash_desc *desc, const u8 *data, - void sha1_init_raw(__u32 *buf); - void sha1_transform(__u32 *digest, const char *data, __u32 *W); - -+/* State for the SHA-1 compression function */ -+struct sha1_block_state { -+ u32 h[SHA1_DIGEST_SIZE / 4]; -+}; -+ -+/** -+ * struct sha1_ctx - Context for hashing a message with SHA-1 -+ * @state: the compression function state -+ * @bytecount: number of bytes processed so far -+ * @buf: partial block buffer; bytecount % SHA1_BLOCK_SIZE bytes are valid -+ */ -+struct sha1_ctx { -+ struct sha1_block_state state; -+ u64 bytecount; -+ u8 buf[SHA1_BLOCK_SIZE]; -+}; -+ -+/** -+ * sha1_init() - Initialize a SHA-1 context for a new message -+ * @ctx: the context to initialize -+ * -+ * If you don't need incremental computation, consider sha1() instead. -+ * -+ * Context: Any context. -+ */ -+void sha1_init(struct sha1_ctx *ctx); -+ -+/** -+ * sha1_update() - Update a SHA-1 context with message data -+ * @ctx: the context to update; must have been initialized -+ * @data: the message data -+ * @len: the data length in bytes -+ * -+ * This can be called any number of times. -+ * -+ * Context: Any context. -+ */ -+void sha1_update(struct sha1_ctx *ctx, const u8 *data, size_t len); -+ -+/** -+ * sha1_final() - Finish computing a SHA-1 message digest -+ * @ctx: the context to finalize; must have been initialized -+ * @out: (output) the resulting SHA-1 message digest -+ * -+ * After finishing, this zeroizes @ctx. So the caller does not need to do it. -+ * -+ * Context: Any context. -+ */ -+void sha1_final(struct sha1_ctx *ctx, u8 out[SHA1_DIGEST_SIZE]); -+ -+/** -+ * sha1() - Compute SHA-1 message digest in one shot -+ * @data: the message data -+ * @len: the data length in bytes -+ * @out: (output) the resulting SHA-1 message digest -+ * -+ * Context: Any context. -+ */ -+void sha1(const u8 *data, size_t len, u8 out[SHA1_DIGEST_SIZE]); -+ - #endif /* _CRYPTO_SHA1_H */ -diff --git a/lib/crypto/Kconfig b/lib/crypto/Kconfig -index b09e78da9..0891d9962 100644 ---- a/lib/crypto/Kconfig -+++ b/lib/crypto/Kconfig -@@ -150,6 +150,13 @@ config CRYPTO_LIB_CHACHA20POLY1305 - - config CRYPTO_LIB_SHA1 - tristate -+ help -+ The SHA-1 library functions. Select this if your module uses any of -+ the functions from . -+ -+config CRYPTO_LIB_SHA1_ARCH -+ bool -+ depends on CRYPTO_LIB_SHA1 && !UML - - config CRYPTO_LIB_SHA256 - tristate -diff --git a/lib/crypto/Makefile b/lib/crypto/Makefile -index 83c600776..5d4d6b34c 100644 ---- a/lib/crypto/Makefile -+++ b/lib/crypto/Makefile -@@ -37,8 +37,11 @@ libpoly1305-y := poly1305-donna32.o - libpoly1305-$(CONFIG_ARCH_SUPPORTS_INT128) := poly1305-donna64.o - libpoly1305-y += poly1305.o - --obj-$(CONFIG_CRYPTO_LIB_SHA1) += libsha1.o --libsha1-y := sha1.o -+obj-$(CONFIG_CRYPTO_LIB_SHA1) += libsha1.o -+libsha1-y := sha1.o -+ifeq ($(CONFIG_CRYPTO_LIB_SHA1_ARCH),y) -+CFLAGS_sha1.o += -I$(src)/$(SRCARCH) -+endif # CONFIG_CRYPTO_LIB_SHA1_ARCH - - ifneq ($(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS),y) - libblake2s-y += blake2s-selftest.o -diff --git a/lib/crypto/sha1.c b/lib/crypto/sha1.c -index f117a7610..796b08a8b 100644 ---- a/lib/crypto/sha1.c -+++ b/lib/crypto/sha1.c -@@ -1,9 +1,6 @@ - // SPDX-License-Identifier: GPL-2.0 - /* -- * SHA1 routine optimized to do word accesses rather than byte accesses, -- * and to avoid unnecessary copies into the context array. -- * -- * This was based on the git SHA1 implementation. -+ * SHA-1 library functions - */ - - #include -@@ -14,6 +11,10 @@ - #include - #include - -+static const struct sha1_block_state sha1_iv = { -+ .h = { SHA1_H0, SHA1_H1, SHA1_H2, SHA1_H3, SHA1_H4 }, -+}; -+ - /* - * If you have 32 registers or more, the compiler can (and should) - * try to change the array[] accesses into registers. However, on -@@ -137,5 +138,109 @@ void sha1_init_raw(__u32 *buf) - } - EXPORT_SYMBOL(sha1_init_raw); - --MODULE_DESCRIPTION("SHA-1 Algorithm"); -+static void __maybe_unused sha1_blocks_generic(struct sha1_block_state *state, -+ const u8 *data, size_t nblocks) -+{ -+ u32 workspace[SHA1_WORKSPACE_WORDS]; -+ -+ do { -+ sha1_transform(state->h, data, workspace); -+ data += SHA1_BLOCK_SIZE; -+ } while (--nblocks); -+ -+ memzero_explicit(workspace, sizeof(workspace)); -+} -+ -+#ifdef CONFIG_CRYPTO_LIB_SHA1_ARCH -+#include "sha1.h" /* $(SRCARCH)/sha1.h */ -+#else -+#define sha1_blocks sha1_blocks_generic -+#endif -+ -+void sha1_init(struct sha1_ctx *ctx) -+{ -+ ctx->state = sha1_iv; -+ ctx->bytecount = 0; -+} -+EXPORT_SYMBOL_GPL(sha1_init); -+ -+void sha1_update(struct sha1_ctx *ctx, const u8 *data, size_t len) -+{ -+ size_t partial = ctx->bytecount % SHA1_BLOCK_SIZE; -+ -+ ctx->bytecount += len; -+ -+ if (partial + len >= SHA1_BLOCK_SIZE) { -+ size_t nblocks; -+ -+ if (partial) { -+ size_t l = SHA1_BLOCK_SIZE - partial; -+ -+ memcpy(&ctx->buf[partial], data, l); -+ data += l; -+ len -= l; -+ -+ sha1_blocks(&ctx->state, ctx->buf, 1); -+ } -+ -+ nblocks = len / SHA1_BLOCK_SIZE; -+ len %= SHA1_BLOCK_SIZE; -+ -+ if (nblocks) { -+ sha1_blocks(&ctx->state, data, nblocks); -+ data += nblocks * SHA1_BLOCK_SIZE; -+ } -+ partial = 0; -+ } -+ if (len) -+ memcpy(&ctx->buf[partial], data, len); -+} -+EXPORT_SYMBOL_GPL(sha1_update); -+ -+void sha1_final(struct sha1_ctx *ctx, u8 out[SHA1_DIGEST_SIZE]) -+{ -+ u64 bitcount = ctx->bytecount << 3; -+ size_t partial = ctx->bytecount % SHA1_BLOCK_SIZE; -+ -+ ctx->buf[partial++] = 0x80; -+ if (partial > SHA1_BLOCK_SIZE - 8) { -+ memset(&ctx->buf[partial], 0, SHA1_BLOCK_SIZE - partial); -+ sha1_blocks(&ctx->state, ctx->buf, 1); -+ partial = 0; -+ } -+ memset(&ctx->buf[partial], 0, SHA1_BLOCK_SIZE - 8 - partial); -+ *(__be64 *)&ctx->buf[SHA1_BLOCK_SIZE - 8] = cpu_to_be64(bitcount); -+ sha1_blocks(&ctx->state, ctx->buf, 1); -+ -+ for (size_t i = 0; i < SHA1_DIGEST_SIZE; i += 4) -+ put_unaligned_be32(ctx->state.h[i / 4], out + i); -+ memzero_explicit(ctx, sizeof(*ctx)); -+} -+EXPORT_SYMBOL_GPL(sha1_final); -+ -+void sha1(const u8 *data, size_t len, u8 out[SHA1_DIGEST_SIZE]) -+{ -+ struct sha1_ctx ctx; -+ -+ sha1_init(&ctx); -+ sha1_update(&ctx, data, len); -+ sha1_final(&ctx, out); -+} -+EXPORT_SYMBOL_GPL(sha1); -+ -+#ifdef sha1_mod_init_arch -+static int __init sha1_mod_init(void) -+{ -+ sha1_mod_init_arch(); -+ return 0; -+} -+subsys_initcall(sha1_mod_init); -+ -+static void __exit sha1_mod_exit(void) -+{ -+} -+module_exit(sha1_mod_exit); -+#endif -+ -+MODULE_DESCRIPTION("SHA-1 library functions"); - MODULE_LICENSE("GPL"); --- -2.40.4 - diff --git a/SPECS/91/linux/esx/0001-Adding-SBX-kernel-driver.patch b/SPECS/91/linux/esx/0001-Adding-SBX-kernel-driver.patch deleted file mode 100644 index c7530e0ec2..0000000000 --- a/SPECS/91/linux/esx/0001-Adding-SBX-kernel-driver.patch +++ /dev/null @@ -1,1550 +0,0 @@ -From 5300250ae04e694e67010865e893bf1c95cf0796 Mon Sep 17 00:00:00 2001 -From: Garrett Goble -Date: Tue, 4 Aug 2026 12:29:15 -0500 -Subject: [PATCH] Adding SBX kernel driver - -This patch adds a kernel driver for the SBX Virtual Device on ESXi. -The driver facilitates communication between the graphics processes -in the guest and the shared memory on the host. This driver should -only be used for the graphics DriverVM project. ---- - drivers/misc/Kconfig | 1 + - drivers/misc/Makefile | 1 + - drivers/misc/vmw_sbx/Kconfig | 11 + - drivers/misc/vmw_sbx/Makefile | 6 + - drivers/misc/vmw_sbx/sbx.c | 1356 ++++++++++++++++++++++++++++++ - drivers/misc/vmw_sbx/sbx_ioctl.h | 43 + - drivers/misc/vmw_sbx/sbx_reg.h | 55 ++ - 7 files changed, 1473 insertions(+) - create mode 100644 drivers/misc/vmw_sbx/Kconfig - create mode 100644 drivers/misc/vmw_sbx/Makefile - create mode 100644 drivers/misc/vmw_sbx/sbx.c - create mode 100644 drivers/misc/vmw_sbx/sbx_ioctl.h - create mode 100644 drivers/misc/vmw_sbx/sbx_reg.h - -diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig -index db96ceeb7059..83b2a4b18b08 100644 ---- a/drivers/misc/Kconfig -+++ b/drivers/misc/Kconfig -@@ -629,4 +629,5 @@ source "drivers/misc/pvpanic/Kconfig" - source "drivers/misc/mchp_pci1xxxx/Kconfig" - source "drivers/misc/keba/Kconfig" - source "drivers/misc/vmw_extcfg/Kconfig" -+source "drivers/misc/vmw_sbx/Kconfig" - endmenu -diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile -index bcdb52acbae8..9ed76f7faa39 100644 ---- a/drivers/misc/Makefile -+++ b/drivers/misc/Makefile -@@ -70,6 +70,7 @@ obj-$(CONFIG_TMR_INJECT) += xilinx_tmr_inject.o - obj-$(CONFIG_TPS6594_ESM) += tps6594-esm.o - obj-$(CONFIG_TPS6594_PFSM) += tps6594-pfsm.o - obj-$(CONFIG_VMWARE_EXTCFG) += vmw_extcfg/ -+obj-$(CONFIG_SBX) += vmw_sbx/ - obj-$(CONFIG_NSM) += nsm.o - obj-$(CONFIG_MARVELL_CN10K_DPI) += mrvl_cn10k_dpi.o - obj-y += keba/ -diff --git a/drivers/misc/vmw_sbx/Kconfig b/drivers/misc/vmw_sbx/Kconfig -new file mode 100644 -index 000000000000..1a4e7096467f ---- /dev/null -+++ b/drivers/misc/vmw_sbx/Kconfig -@@ -0,0 +1,11 @@ -+# SPDX-License-Identifier: GPL-2.0-or-later -+menuconfig SBX -+ tristate "VMware SBX Virtual Device Support" -+ help -+ VMware SBX Virtual Device Support. -+ -+ Enable the driver for the VMware SBX Virtual Device. This driver -+ handles communication and memory sharing for graphics workloads -+ on ESXi. -+ -+ If unsure, say no. -diff --git a/drivers/misc/vmw_sbx/Makefile b/drivers/misc/vmw_sbx/Makefile -new file mode 100644 -index 000000000000..ce1e01f1b935 ---- /dev/null -+++ b/drivers/misc/vmw_sbx/Makefile -@@ -0,0 +1,6 @@ -+# SPDX-License-Identifier: GPL-2.0-or-later -+# -+# Makefile for the VMware sbx virtual device driver -+# -+ -+obj-$(CONFIG_SBX) += sbx.o -diff --git a/drivers/misc/vmw_sbx/sbx.c b/drivers/misc/vmw_sbx/sbx.c -new file mode 100644 -index 000000000000..8c6e0991cf01 ---- /dev/null -+++ b/drivers/misc/vmw_sbx/sbx.c -@@ -0,0 +1,1356 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later -+/* -+ * Copyright (c) 2020-2026 Broadcom. All Rights Reserved. The term -+ * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "sbx_reg.h" -+#include "sbx_ioctl.h" -+ -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Broadcom"); -+MODULE_DESCRIPTION("SBX device driver"); -+ -+#define SBX_DEVICE_VERSION 1 -+#define SBX_DEVICE_GUEST_PROTOCOL 1 -+ -+#define SBX_NAME "sbx" -+#define SBX_MINOR_FIRST 0 -+#define SBX_MINOR_COUNT (SBX_CMD_BAR_MAX_CONNECTIONS) -+ -+#define SBX_MGR_NAME "sbx-mgr" -+#define SBX_MGR_MINOR_FIRST 0 -+#define SBX_MGR_MINOR_COUNT 1 -+ -+#define SBX_CMD_BAR 0 -+#define SBX_SHM_BAR 2 -+ -+#define SBX_IOCTL_TIMEOUT_MS 50 -+ -+struct sbx_minor_info { -+ unsigned long minor_index; -+ unsigned int waiting; -+}; -+ -+struct sbx_dev_minor { -+ atomic_t avail; -+ atomic_t incoming_signal_count; -+ wait_queue_head_t waitq; -+ /* -+ * This mutex serializes wait/signal state and the chunks -+ * enumeration protocol for a given sbx minor device. -+ */ -+ struct mutex lock; -+}; -+ -+struct sbx_dev { -+ struct cdev sbx_cdev; -+ struct cdev sbx_mgr_cdev; -+ char *cmd_remap; -+ char *cmd_global_addr; -+ char *cmd_caps_addr; -+ char *shm_remap; -+ unsigned int irq; -+ struct page *stats_desc_page; -+ -+ /* -+ * This mutex locks the sbx mgr device. -+ */ -+ struct mutex sbx_mgr_lock; -+ unsigned int sbx_mgr_open; -+ -+ resource_size_t shm_addr; -+ resource_size_t shm_len; -+ wait_queue_head_t launch_waitq; -+ atomic_t launch_ready; -+ -+ unsigned long pending_signals; -+ struct sbx_dev_minor minor_device[SBX_MINOR_COUNT]; -+}; -+ -+static struct sbx_dev *sbx_device; -+static int sbx_major; -+static int sbx_mgr_major; -+static struct class *sbx_class; -+ -+static int sbx_mgr_unpin_stats_file(void); -+ -+static unsigned long long sbx_read_connection_reg(unsigned long minor_index, -+ unsigned long reg) -+{ -+ char *addr; -+ -+ addr = sbx_device->cmd_remap + minor_index * SBX_CMD_BAR_CONNECT_LEN; -+ return readq(addr + (reg * 8)); -+} -+ -+static void sbx_write_connection_reg(unsigned long minor_index, -+ unsigned long reg, -+ unsigned long long value) -+{ -+ char *addr; -+ -+ addr = sbx_device->cmd_remap + minor_index * SBX_CMD_BAR_CONNECT_LEN; -+ writeq(value, addr + (reg * 8)); -+} -+ -+static unsigned long long sbx_read_global_reg(unsigned long reg) -+{ -+ char *addr; -+ -+ addr = sbx_device->cmd_global_addr; -+ return readq(addr + (reg * 8)); -+} -+ -+static void sbx_write_global_reg(unsigned long reg, unsigned long long value) -+{ -+ char *addr; -+ -+ addr = sbx_device->cmd_global_addr; -+ writeq(value, addr + (reg * 8)); -+} -+ -+static int sbx_open(struct inode *inode, struct file *filp) -+{ -+ unsigned long minor_index = iminor(inode); -+ struct sbx_minor_info *minor_info; -+ struct sbx_dev_minor *minor_device; -+ -+ if (minor_index >= SBX_MINOR_COUNT) { -+ pr_err("sbx open: pid %i (%s) invalid minor(%lu) file\n", -+ current->pid, current->comm, minor_index); -+ return -ENODEV; -+ } -+ minor_device = &sbx_device->minor_device[minor_index]; -+ -+ if (atomic_cmpxchg(&minor_device->avail, 1, 0) != 1) { -+ pr_err("sbx open: pid %i (%s) minor(%lu) busy fail\n", -+ current->pid, current->comm, minor_index); -+ return -EBUSY; -+ } -+ -+ pr_info("sbx open: pid %i (%s) minor(%lu)\n", current->pid, -+ current->comm, minor_index); -+ -+ minor_info = kzalloc(sizeof(*minor_info), GFP_KERNEL); -+ if (!minor_info) { -+ atomic_set(&minor_device->avail, 1); -+ return -ENOMEM; -+ } -+ minor_info->minor_index = minor_index; -+ atomic_set(&minor_device->incoming_signal_count, 0); -+ clear_bit(minor_index, &sbx_device->pending_signals); -+ -+ filp->private_data = minor_info; -+ -+ return 0; -+} -+ -+static int sbx_release(struct inode *inode, struct file *filp) -+{ -+ unsigned int minor_index = iminor(inode); -+ struct sbx_minor_info *minor_info; -+ struct sbx_dev_minor *minor_device; -+ -+ if (minor_index >= SBX_MINOR_COUNT) { -+ pr_err("sbx release: pid %i (%s) invalid minor(%u) file\n", -+ current->pid, current->comm, minor_index); -+ return -ENODEV; -+ } -+ minor_device = &sbx_device->minor_device[minor_index]; -+ -+ sbx_write_connection_reg(minor_index, SBX_CONNECTION_REG_RESET, 1); -+ -+ pr_info("sbx release: pid %i (%s) minor(%u)\n", current->pid, -+ current->comm, minor_index); -+ -+ minor_info = (struct sbx_minor_info *)filp->private_data; -+ kfree(minor_info); -+ atomic_set(&minor_device->avail, 1); -+ return 0; -+} -+ -+static int sbx_ioctl_size(struct sbx_minor_info *minor_info, -+ unsigned long arg) -+{ -+ int result = 0; -+ unsigned long num_mpn; -+ unsigned long size; -+ unsigned long *user_space_ulong_ptr = (void *)arg; -+ unsigned long minor_index = minor_info->minor_index; -+ -+ num_mpn = sbx_read_connection_reg(minor_index, SBX_CONNECTION_REG_MPNS); -+ -+ size = num_mpn * PAGE_SIZE; -+ -+ if (put_user(size, user_space_ulong_ptr) != 0) { -+ pr_err("sbx size ioctl: pid %i (%s) minor(%lu) put_user fail\n", -+ current->pid, current->comm, minor_index); -+ result = -EFAULT; -+ } -+ -+ return result; -+} -+ -+static int sbx_ioctl_signal(struct sbx_minor_info *minor_info) -+{ -+ int result; -+ unsigned long minor_index = minor_info->minor_index; -+ -+ /* -+ * This returns 0 on success or a positive ERRNO, so it is safe -+ * to convert to a -ERRNO. -+ */ -+ result = sbx_read_connection_reg(minor_index, -+ SBX_CONNECTION_REG_SIGNAL); -+ -+ if (result != 0) { -+ pr_info("sbx signal ioctl: pid %i (%s) minor(%lu) fail\n", -+ current->pid, current->comm, minor_index); -+ result = -result; -+ } -+ -+ return result; -+} -+ -+static int sbx_wait(struct sbx_minor_info *minor_info, -+ struct sbx_dev_minor *minor_device, -+ long signal_count, -+ unsigned int ms) -+{ -+ int result; -+ unsigned long minor_index = minor_info->minor_index; -+ unsigned long *pending = &sbx_device->pending_signals; -+ -+ if (signal_count > 0) { -+ result = 0; -+ } else { -+ int rc; -+ unsigned long timeout = msecs_to_jiffies(ms); -+ -+ minor_info->waiting = 1; -+ mutex_unlock(&minor_device->lock); -+ -+ rc = wait_event_interruptible_timeout(minor_device->waitq, -+ test_bit(minor_index, -+ pending), -+ timeout); -+ mutex_lock(&minor_device->lock); -+ if (rc > 0) -+ result = 0; -+ else if (rc == 0) -+ result = -ETIME; -+ else -+ result = -EINTR; -+ } -+ -+ if (result == 0) { -+ if (!atomic_add_unless(&minor_device->incoming_signal_count, -1, 0)) { -+ pr_err("sbx wait ioctl: pid %i (%s) minor(%lu) add unless fail\n", -+ current->pid, current->comm, minor_index); -+ } -+ if (!test_and_clear_bit(minor_index, pending)) { -+ pr_err("sbx wait ioctl: pid %i (%s) minor(%lu) clear bit fail\n", -+ current->pid, current->comm, minor_index); -+ } -+ if (atomic_read(&minor_device->incoming_signal_count) > 0) -+ set_bit(minor_index, pending); -+ } -+ -+ if (minor_info->waiting == 1) -+ minor_info->waiting = 0; -+ -+ return result; -+} -+ -+static int sbx_ioctl_wait(struct sbx_minor_info *minor_info, unsigned long arg) -+{ -+ int result; -+ unsigned long minor_index = minor_info->minor_index; -+ unsigned int ms = (unsigned int)arg; -+ struct sbx_dev_minor *minor_device; -+ long signal_count; -+ -+ minor_device = &sbx_device->minor_device[minor_index]; -+ -+ mutex_lock(&minor_device->lock); -+ -+ signal_count = atomic_read(&minor_device->incoming_signal_count); -+ -+ if (ms > SBX_IOCTL_TIMEOUT_MS) { -+ pr_err("sbx wait ioctl: pid %i (%s) minor(%lu) ms max=50 fail\n", -+ current->pid, current->comm, minor_index); -+ result = -EINVAL; -+ } else if (minor_info->waiting) { -+ pr_err("sbx wait ioctl: pid %i (%s) minor(%lu) already waiting fail\n", -+ current->pid, current->comm, minor_index); -+ result = -EBUSY; -+ } else if (signal_count > 1) { -+ atomic_dec(&minor_device->incoming_signal_count); -+ result = 0; -+ } else { -+ result = sbx_wait(minor_info, minor_device, signal_count, ms); -+ } -+ -+ mutex_unlock(&minor_device->lock); -+ -+ return result; -+} -+ -+static int sbx_ioctl_mem(struct sbx_minor_info *minor_info, -+ unsigned long arg) -+{ -+ int result = 0; -+ unsigned long long *user_space_ptr = (void *)arg; -+ unsigned long minor_index = minor_info->minor_index; -+ unsigned long long mem_kb; -+ -+ mem_kb = sbx_read_connection_reg(minor_index, SBX_CONNECTION_REG_MEM_KB); -+ -+ if (put_user(mem_kb, user_space_ptr) != 0) { -+ pr_err("sbx mem ioctl: pid %i (%s) minor(%lu) put_user fail\n", -+ current->pid, current->comm, minor_index); -+ result = -EFAULT; -+ } -+ -+ return result; -+} -+ -+static int sbx_get_chunks(struct sbx_chunks_msg *msg, -+ struct sbx_dev_minor *minor_device, -+ unsigned long minor_index) -+{ -+ int result = 0; -+ unsigned long *chunk_ids; -+ unsigned long total = 0; -+ unsigned long chunk_id; -+ -+ chunk_ids = kmalloc_array(msg->chunk_size, sizeof(*chunk_ids), GFP_KERNEL); -+ if (!chunk_ids) -+ return -ENOMEM; -+ -+ mutex_lock(&minor_device->lock); -+ -+ sbx_write_connection_reg(minor_index, SBX_CONNECTION_REG_CHUNKS, 1); -+ -+ /* The device will always eventually return SBX_INVALID_CHUNK. */ -+ while (1) { -+ chunk_id = sbx_read_connection_reg(minor_index, -+ SBX_CONNECTION_REG_CHUNKS); -+ if (chunk_id == SBX_INVALID_CHUNK) -+ break; -+ -+ if (total >= msg->chunk_size) { -+ pr_err("sbx chunk_size too small\n"); -+ result = -EFAULT; -+ break; -+ } -+ -+ chunk_ids[total++] = chunk_id; -+ } -+ -+ mutex_unlock(&minor_device->lock); -+ -+ if (total && copy_to_user(msg->chunks, chunk_ids, -+ total * sizeof(*chunk_ids)) != 0) -+ result = -EFAULT; -+ -+ if (copy_to_user(msg->num_chunks, &total, sizeof(total)) != 0) -+ result = -EFAULT; -+ -+ kfree(chunk_ids); -+ -+ return result; -+} -+ -+static int sbx_ioctl_chunks(struct sbx_minor_info *minor_info, -+ struct sbx_dev_minor *minor_device, -+ unsigned long arg) -+{ -+ int result = 0; -+ struct sbx_chunks_msg msg; -+ unsigned long minor_index = minor_info->minor_index; -+ -+ if (copy_from_user(&msg, (void *)arg, sizeof(msg)) == 0) { -+ result = sbx_get_chunks(&msg, minor_device, minor_index); -+ } else { -+ pr_err("sbx chunks ioctl: failed to copy msg\n"); -+ result = -EFAULT; -+ } -+ -+ return result; -+} -+ -+static long sbx_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) -+{ -+ int result; -+ struct sbx_minor_info *minor_info = (struct sbx_minor_info *)filp->private_data; -+ unsigned long minor_index = minor_info->minor_index; -+ struct sbx_dev_minor *minor_device; -+ -+ if (minor_index >= SBX_MINOR_COUNT) { -+ pr_err("sbx ioctl: pid %i (%s) invalid minor(%lu) file\n", -+ current->pid, current->comm, minor_index); -+ return -ENODEV; -+ } -+ minor_device = &sbx_device->minor_device[minor_index]; -+ -+ switch (cmd) { -+ case SBX_IOCTL_SIZE: -+ result = sbx_ioctl_size(minor_info, arg); -+ break; -+ case SBX_IOCTL_SIGNAL: -+ result = sbx_ioctl_signal(minor_info); -+ break; -+ case SBX_IOCTL_WAIT: -+ result = sbx_ioctl_wait(minor_info, arg); -+ break; -+ case SBX_IOCTL_MEM: -+ result = sbx_ioctl_mem(minor_info, arg); -+ break; -+ case SBX_IOCTL_CHUNKS: -+ result = sbx_ioctl_chunks(minor_info, minor_device, arg); -+ break; -+ default: -+ pr_err("sbx ioctl: pid %i (%s) minor(%lu) invalid cmd(%u)\n", -+ current->pid, current->comm, minor_index, cmd); -+ result = -EINVAL; -+ break; -+ } -+ -+ return result; -+} -+ -+static int sbx_mmap(struct file *filp, struct vm_area_struct *vma) -+{ -+ struct sbx_minor_info *minor_info; -+ unsigned long minor_index; -+ unsigned long len = vma->vm_end - vma->vm_start; -+ unsigned long pfn = (sbx_device->shm_addr >> PAGE_SHIFT) + vma->vm_pgoff; -+ -+ minor_info = (struct sbx_minor_info *)filp->private_data; -+ minor_index = minor_info->minor_index; -+ -+ if (minor_index >= SBX_MINOR_COUNT) { -+ pr_err("sbx mmap: invalid minor(%lu) file\n", minor_index); -+ return -ENODEV; -+ } -+ -+ pr_info("sbx mmap: vm_start=%#lx vm_end=%#lx vm_pgoff=%#lx pfn=%#lx\n", -+ vma->vm_start, vma->vm_end, vma->vm_pgoff, pfn); -+ -+ if (vma->vm_pgoff > (sbx_device->shm_len >> PAGE_SHIFT) || -+ len > sbx_device->shm_len - (vma->vm_pgoff << PAGE_SHIFT)) { -+ pr_err("sbx mmap: invalid range\n"); -+ return -EINVAL; -+ } -+ -+#if KERNEL_VERSION(6, 3, 0) <= LINUX_VERSION_CODE -+ vm_flags_set(vma, VM_IO | VM_DONTEXPAND | VM_DONTDUMP); -+#else -+ vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP; -+#endif -+ -+ if (remap_pfn_range(vma, vma->vm_start, pfn, len, vma->vm_page_prot)) { -+ pr_err("sbx mmap: minor(%lu) remap_pfn_range fail\n", -+ minor_index); -+ return -EAGAIN; -+ } -+ -+ pr_info("sbx mmap: pid %i (%s) minor(%lu)\n", current->pid, -+ current->comm, minor_index); -+ -+ return 0; -+} -+ -+static irqreturn_t sbx_irq_handler(int irq, void *dev_id) -+{ -+ struct sbx_dev *sbx = (struct sbx_dev *)dev_id; -+ unsigned long mask = (unsigned long)-1; -+ unsigned long new_signals; -+ int launch_ready; -+ int minor_index; -+ -+ launch_ready = sbx_read_global_reg(SBX_GLOBAL_REG_LAUNCH); -+ new_signals = sbx_read_global_reg(SBX_GLOBAL_REG_SIGNAL) & mask; -+ while (new_signals != 0) { -+ struct sbx_dev_minor *minor_device; -+ -+ minor_index = __ffs(new_signals); -+ minor_device = &sbx->minor_device[minor_index]; -+ -+ atomic_inc(&minor_device->incoming_signal_count); -+ -+ if (test_and_set_bit_lock(minor_index, -+ &sbx->pending_signals) == 0) { -+ wake_up_interruptible(&minor_device->waitq); -+ } -+ -+ clear_bit(minor_index, &new_signals); -+ } -+ -+ if (launch_ready) { -+ atomic_set(&sbx->launch_ready, 1); -+ wake_up_interruptible(&sbx->launch_waitq); -+ } -+ -+ return IRQ_HANDLED; -+} -+ -+/* 64-bit-only driver: no .compat_ioctl, 32-bit callers get -ENOTTY. */ -+static const struct file_operations sbx_fops = { -+ .owner = THIS_MODULE, -+ .open = sbx_open, -+ .mmap = sbx_mmap, -+ .release = sbx_release, -+ .unlocked_ioctl = sbx_ioctl, -+}; -+ -+static int sbx_mgr_open(struct inode *inode, struct file *filp) -+{ -+ int result; -+ -+ mutex_lock(&sbx_device->sbx_mgr_lock); -+ if (sbx_device->sbx_mgr_open) { -+ pr_err("sbx mgr open: pid %i (%s) busy fail\n", current->pid, -+ current->comm); -+ result = -EBUSY; -+ goto unlock_end; -+ } -+ -+ sbx_device->sbx_mgr_open = 1; -+ pr_info("sbx mgr open: pid %i (%s)\n", current->pid, current->comm); -+ -+ result = 0; -+ -+unlock_end: -+ mutex_unlock(&sbx_device->sbx_mgr_lock); -+ return result; -+} -+ -+static int sbx_mgr_release(struct inode *inode, struct file *filp) -+{ -+ mutex_lock(&sbx_device->sbx_mgr_lock); -+ sbx_mgr_unpin_stats_file(); -+ sbx_device->sbx_mgr_open = 0; -+ mutex_unlock(&sbx_device->sbx_mgr_lock); -+ -+ pr_info("sbx mgr release: pid %i (%s)\n", current->pid, current->comm); -+ -+ return 0; -+} -+ -+static unsigned int sbx_mgr_poll(struct file *filp, -+ struct poll_table_struct *wait) -+{ -+ __poll_t mask = 0; -+ -+ poll_wait(filp, &sbx_device->launch_waitq, wait); -+ -+ if (atomic_read(&sbx_device->launch_ready)) { -+ atomic_set(&sbx_device->launch_ready, 0); -+ mask |= POLLIN; -+ } -+ -+ return mask; -+} -+ -+static int sbx_mgr_ioctl_listen(void) -+{ -+ int i; -+ -+ for (i = SBX_MINOR_FIRST; i < SBX_MINOR_FIRST + SBX_MINOR_COUNT; i++) { -+ int launch = sbx_read_connection_reg(i, -+ SBX_CONNECTION_REG_LAUNCH); -+ -+ if (launch) { -+ int value = i; -+ -+ if ((launch & SBX_MGR_BUILD_STATS) != 0) -+ value |= SBX_BUILD_STATS; -+ if ((launch & SBX_MGR_BUILD_DEBUG) != 0) -+ value |= SBX_BUILD_DEBUG; -+ return value; -+ } -+ } -+ return -EAGAIN; -+} -+ -+static int sbx_mgr_copy_caps(struct sbx_mgr_caps_msg *msg) -+{ -+ int result = 0; -+ char *caps = NULL; -+ -+ if (msg->caps_size > SBX_GLOBAL_CAPS_SIZE) { -+ pr_err("sbx mgr caps ioctl: caps size too large\n"); -+ result = -EINVAL; -+ goto error; -+ } -+ -+ caps = kmalloc(msg->caps_size, GFP_KERNEL); -+ if (!caps) { -+ result = -ENOMEM; -+ goto error; -+ } -+ -+ if (copy_from_user(caps, msg->caps, msg->caps_size) != 0) { -+ pr_err("sbx mgr caps ioctl: failed to copy caps\n"); -+ result = -EFAULT; -+ goto error; -+ } -+ -+ memcpy_toio(sbx_device->cmd_caps_addr, caps, -+ msg->caps_size); -+ sbx_write_global_reg(SBX_GLOBAL_REG_CAPS, 1); -+ -+error: -+ kfree(caps); -+ return result; -+} -+ -+static int sbx_mgr_ioctl_caps(unsigned long arg) -+{ -+ int result = 0; -+ struct sbx_mgr_caps_msg msg; -+ -+ if (copy_from_user(&msg, (void *)arg, sizeof(msg)) == 0) { -+ result = sbx_mgr_copy_caps(&msg); -+ } else { -+ pr_err("sbx mgr caps ioctl: failed to copy msg\n"); -+ result = -EFAULT; -+ } -+ -+ return result; -+} -+ -+static int sbx_mgr_pin_stats_file(struct sbx_mgr_map_stats_msg *msg) -+{ -+ struct page *pvec[SBX_STATS_MAX_PAGES]; -+ struct page *desc_page = NULL; -+ struct sbx_guest_stats_desc *desc = NULL; -+ struct vm_area_struct *vma = NULL; -+ u64 end_bytes; -+ u64 start; -+ u64 end; -+ int npages; -+ int pinned = 0; -+ int ret_err = -ENOMEM; -+ int i = 0; -+ -+ pr_info("sbx mgr pinning stats file\n"); -+ -+ if (check_add_overflow(msg->data, msg->size, &end_bytes)) { -+ pr_err("sbx mgr map stats ioctl: size overflow\n"); -+ return -EINVAL; -+ } -+ -+ if (msg->size > (u64)SBX_STATS_MAX_PAGES * PAGE_SIZE) { -+ pr_err("sbx mgr map stats ioctl: size too large\n"); -+ return -EINVAL; -+ } -+ -+ start = msg->data & PAGE_MASK; -+ end = PAGE_ALIGN(end_bytes); -+ npages = (end - start) >> PAGE_SHIFT; -+ -+ if (sbx_device->stats_desc_page) { -+ pr_err("sbx mgr map stats ioctl: cannot map multiple stats files\n"); -+ return -EINVAL; -+ } -+ -+ if (msg->data % PAGE_SIZE != 0) { -+ pr_err("sbx mgr map stats ioctl: data not page aligned\n"); -+ return -EINVAL; -+ } -+ -+ if (npages < 1 || npages > SBX_STATS_MAX_PAGES) { -+ pr_err("sbx mgr map stats ioctl: invalid number of pages requested\n"); -+ return -EINVAL; -+ } -+ -+ desc_page = alloc_page(GFP_KERNEL | __GFP_ZERO); -+ if (!desc_page) { -+ ret_err = -ENOMEM; -+ pr_err("sbx mgr map stats ioctl: failed to allocate page vector\n"); -+ goto alloc_page_err; -+ } -+ -+ desc = page_address(desc_page); -+ desc->size = msg->size; -+ desc->format = msg->format; -+ -+ mmap_read_lock(current->mm); -+ -+ vma = find_vma(current->mm, start); -+ if (!vma || vma->vm_start > start || vma->vm_end < end) { -+ ret_err = -EINVAL; -+ pr_err("sbx mgr map stats ioctl: invalid mmap vma\n"); -+ goto pin_err; -+ } -+ -+ if (!(vma->vm_flags & VM_SHARED) || !vma->vm_file) { -+ ret_err = -EINVAL; -+ pr_err("sbx mgr map stats ioctl: invalid mmap vma flags\n"); -+ goto pin_err; -+ } -+ -+#if KERNEL_VERSION(6, 5, 0) <= LINUX_VERSION_CODE -+ pinned = pin_user_pages(start, npages, FOLL_LONGTERM, pvec); -+#else -+ pinned = pin_user_pages(start, npages, FOLL_LONGTERM, pvec, NULL); -+#endif -+ if (pinned != npages) { -+ ret_err = -ENOMEM; -+ pr_err("sbx mgr map stats ioctl: failed to pin pages\n"); -+ goto pin_err; -+ } -+ -+ for (i = 0; i < npages; i++) -+ desc->pas[i] = page_to_phys(pvec[i]); -+ -+ for (i = npages; i < ARRAY_SIZE(desc->pas); i++) -+ desc->pas[i] = SBX_INVALID_PA; -+ -+ sbx_device->stats_desc_page = desc_page; -+ sbx_write_global_reg(SBX_GLOBAL_REG_GUEST_STATS, -+ page_to_phys(desc_page)); -+ -+ mmap_read_unlock(current->mm); -+ -+ return 0; -+ -+pin_err: -+ if (pinned > 0) -+ unpin_user_pages(pvec, pinned); -+ -+ mmap_read_unlock(current->mm); -+ -+alloc_page_err: -+ if (desc_page) -+ __free_page(desc_page); -+ -+ return ret_err; -+} -+ -+static int sbx_mgr_unpin_stats_file(void) -+{ -+ struct sbx_guest_stats_desc *desc = NULL; -+ struct page *page = NULL; -+ int i = 0; -+ -+ if (!sbx_device->stats_desc_page) -+ return -EINVAL; -+ -+ sbx_write_global_reg(SBX_GLOBAL_REG_GUEST_STATS, SBX_INVALID_PA); -+ -+ desc = page_address(sbx_device->stats_desc_page); -+ -+ for (i = 0; i < ARRAY_SIZE(desc->pas); i++) { -+ if (desc->pas[i] != SBX_INVALID_PA) { -+ page = pfn_to_page(__phys_to_pfn(desc->pas[i])); -+ unpin_user_page(page); -+ } -+ } -+ -+ __free_page(sbx_device->stats_desc_page); -+ sbx_device->stats_desc_page = NULL; -+ -+ return 0; -+} -+ -+static int sbx_mgr_ioctl_map_stats(unsigned long arg) -+{ -+ int result = 0; -+ struct sbx_mgr_map_stats_msg msg; -+ -+ if (copy_from_user(&msg, (void *)arg, sizeof(msg)) == 0) { -+ result = sbx_mgr_pin_stats_file(&msg); -+ } else { -+ pr_err("sbx mgr stats ioctl: failed to copy msg\n"); -+ result = -EFAULT; -+ } -+ -+ return result; -+} -+ -+static int sbx_mgr_ioctl_unmap_stats(void) -+{ -+ return sbx_mgr_unpin_stats_file(); -+} -+ -+static long sbx_mgr_ioctl(struct file *filp, unsigned int cmd, -+ unsigned long arg) -+{ -+ int result; -+ -+ mutex_lock(&sbx_device->sbx_mgr_lock); -+ -+ switch (cmd) { -+ case SBX_MGR_IOCTL_LISTEN: -+ result = sbx_mgr_ioctl_listen(); -+ break; -+ case SBX_MGR_IOCTL_CAPS: -+ result = sbx_mgr_ioctl_caps(arg); -+ break; -+ case SBX_MGR_IOCTL_MAP_STATS: -+ result = sbx_mgr_ioctl_map_stats(arg); -+ break; -+ case SBX_MGR_IOCTL_UNMAP_STATS: -+ result = sbx_mgr_ioctl_unmap_stats(); -+ break; -+ default: -+ pr_err("sbx mgr ioctl: pid %i (%s) invalid cmd(%u)\n", -+ current->pid, current->comm, cmd); -+ result = -EINVAL; -+ break; -+ } -+ -+ mutex_unlock(&sbx_device->sbx_mgr_lock); -+ return result; -+} -+ -+/* 64-bit-only driver: no .compat_ioctl, 32-bit callers get -ENOTTY. */ -+static const struct file_operations sbx_mgr_fops = { -+ .owner = THIS_MODULE, -+ .open = sbx_mgr_open, -+ .release = sbx_mgr_release, -+ .poll = sbx_mgr_poll, -+ .unlocked_ioctl = sbx_mgr_ioctl, -+}; -+ -+#if KERNEL_VERSION(6, 2, 0) <= LINUX_VERSION_CODE -+static char *sbx_devnode(const struct device *dev, umode_t *mode) -+#else -+static char *sbx_devnode(struct device *dev, umode_t *mode) -+#endif -+{ -+ if (mode) -+ *mode = 0600; -+ return NULL; -+} -+ -+static int sbx_alloc_chrdev(struct device *dev, dev_t *devno_sbx) -+{ -+ int result; -+ -+ result = alloc_chrdev_region(devno_sbx, SBX_MINOR_FIRST, -+ SBX_MINOR_COUNT, SBX_NAME); -+ if (result != 0) { -+ dev_err(dev, "sbx probe: alloc major number with minor numbers %d-%d fail error=%d\n", -+ SBX_MINOR_FIRST, SBX_MINOR_COUNT - 1, result); -+ return result; -+ } -+ -+ sbx_major = MAJOR(*devno_sbx); -+ dev_info(dev, "sbx probe: alloc major number %d with minor numbers %d-%d success\n", -+ sbx_major, SBX_MINOR_FIRST, SBX_MINOR_COUNT - 1); -+ return 0; -+} -+ -+static void sbx_free_chrdev(void) -+{ -+ unregister_chrdev_region(MKDEV(sbx_major, SBX_MINOR_FIRST), -+ SBX_MINOR_COUNT); -+} -+ -+static int sbx_mgr_alloc_chrdev(struct device *dev, dev_t *devno_sbx_mgr) -+{ -+ int result; -+ -+ result = alloc_chrdev_region(devno_sbx_mgr, SBX_MGR_MINOR_FIRST, -+ SBX_MGR_MINOR_COUNT, SBX_MGR_NAME); -+ if (result != 0) { -+ dev_err(dev, "sbx probe: alloc major number fail error=%d\n", -+ result); -+ return result; -+ } -+ -+ sbx_mgr_major = MAJOR(*devno_sbx_mgr); -+ dev_info(dev, "sbx probe: alloc major number %d success\n", -+ sbx_mgr_major); -+ return 0; -+} -+ -+static void sbx_mgr_free_chrdev(void) -+{ -+ unregister_chrdev_region(MKDEV(sbx_mgr_major, SBX_MGR_MINOR_FIRST), -+ SBX_MGR_MINOR_COUNT); -+} -+ -+static int sbx_alloc_device(void) -+{ -+ unsigned int i; -+ -+ sbx_device = kzalloc(sizeof(*sbx_device), GFP_KERNEL); -+ if (!sbx_device) -+ return -ENOMEM; -+ -+ for (i = 0; i < SBX_MINOR_COUNT; i++) -+ mutex_init(&sbx_device->minor_device[i].lock); -+ mutex_init(&sbx_device->sbx_mgr_lock); -+ return 0; -+} -+ -+static int sbx_init_pci(struct pci_dev *pdev, resource_size_t *cmd_addr, -+ resource_size_t *cmd_len) -+{ -+ struct device *dev = &pdev->dev; -+ unsigned long flags; -+ unsigned long cmd_flags; -+ unsigned long shm_flags; -+ int result; -+ -+ result = pci_enable_device(pdev); -+ if (result != 0) { -+ dev_err(dev, "sbx probe: pci enable device fail error=%d\n", -+ result); -+ return result; -+ } -+ -+ pci_set_master(pdev); -+ -+ result = pci_request_region(pdev, SBX_CMD_BAR, "sbx-cmd-bar"); -+ if (result != 0) { -+ dev_err(dev, "sbx probe: cmd bar request fail error=%d\n", -+ result); -+ goto fail_disable; -+ } -+ *cmd_addr = pci_resource_start(pdev, SBX_CMD_BAR); -+ *cmd_len = pci_resource_len(pdev, SBX_CMD_BAR); -+ cmd_flags = pci_resource_flags(pdev, SBX_CMD_BAR); -+ dev_info(dev, "sbx probe: cmd bar start=%pa len=%pa flags=%#lx\n", -+ cmd_addr, cmd_len, cmd_flags); -+ flags = IORESOURCE_MEM; -+ if ((cmd_flags & flags) != flags) { -+ dev_err(dev, "sbx probe: cmd bar flags must be %#lx fail\n", -+ flags); -+ result = -EINVAL; -+ goto fail_release_cmd; -+ } -+ -+ result = pci_request_region(pdev, SBX_SHM_BAR, "sbx-shm-bar"); -+ if (result != 0) { -+ dev_err(dev, "sbx probe: shm bar request fail error=%d\n", -+ result); -+ goto fail_release_cmd; -+ } -+ sbx_device->shm_addr = pci_resource_start(pdev, SBX_SHM_BAR); -+ sbx_device->shm_len = pci_resource_len(pdev, SBX_SHM_BAR); -+ shm_flags = pci_resource_flags(pdev, SBX_SHM_BAR); -+ dev_info(dev, "sbx probe: shm bar start=%pa len=%pa flags=%#lx\n", -+ &sbx_device->shm_addr, &sbx_device->shm_len, shm_flags); -+ flags = IORESOURCE_MEM | IORESOURCE_PREFETCH; -+ if ((shm_flags & flags) != flags) { -+ dev_err(dev, "sbx probe: shm bar flags must be %#lx fail\n", -+ flags); -+ result = -EINVAL; -+ goto fail_release_shm; -+ } -+ -+ result = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI); -+ if (result < 1) { -+ dev_err(dev, "sbx probe: pci alloc irq vectors fail error=%d\n", -+ result); -+ goto fail_release_shm; -+ } -+ return 0; -+ -+fail_release_shm: -+ pci_release_region(pdev, SBX_SHM_BAR); -+ -+fail_release_cmd: -+ pci_release_region(pdev, SBX_CMD_BAR); -+ -+fail_disable: -+ pci_disable_device(pdev); -+ return result; -+} -+ -+static void sbx_cleanup_pci(struct pci_dev *pdev) -+{ -+ pci_free_irq_vectors(pdev); -+ pci_release_region(pdev, SBX_SHM_BAR); -+ pci_release_region(pdev, SBX_CMD_BAR); -+ pci_disable_device(pdev); -+} -+ -+static int sbx_init_hw(struct pci_dev *pdev, resource_size_t cmd_addr, -+ resource_size_t cmd_len) -+{ -+ struct device *dev = &pdev->dev; -+ unsigned int i; -+ int irq; -+ int result; -+ -+ for (i = 0; i < SBX_MINOR_COUNT; i++) -+ init_waitqueue_head(&sbx_device->minor_device[i].waitq); -+ init_waitqueue_head(&sbx_device->launch_waitq); -+ -+ sbx_device->cmd_remap = ioremap(cmd_addr, cmd_len); -+ if (!sbx_device->cmd_remap) { -+ dev_err(dev, "sbx probe: cmd ioremap failed\n"); -+ return -ENOMEM; -+ } -+ -+ sbx_device->shm_remap = ioremap(sbx_device->shm_addr, sbx_device->shm_len); -+ if (!sbx_device->shm_remap) { -+ dev_err(dev, "sbx probe: shm ioremap failed\n"); -+ result = -ENOMEM; -+ goto fail_unmap_cmd; -+ } -+ -+ sbx_device->cmd_global_addr = sbx_device->cmd_remap + SBX_MINOR_COUNT * SBX_CMD_BAR_CONNECT_LEN; -+ sbx_device->cmd_caps_addr = sbx_device->cmd_remap + (SBX_MINOR_COUNT + 1) * SBX_CMD_BAR_CONNECT_LEN; -+ -+ irq = pci_irq_vector(pdev, 0); -+ result = request_irq(irq, sbx_irq_handler, 0, SBX_NAME, sbx_device); -+ if (result != 0) { -+ dev_err(dev, "sbx probe: request irq fail irq=%d error=%d\n", -+ irq, result); -+ goto fail_unmap_shm; -+ } -+ sbx_device->irq = irq; -+ -+ sbx_write_global_reg(SBX_GLOBAL_REG_VERSION, SBX_DEVICE_VERSION); -+ if (sbx_read_global_reg(SBX_GLOBAL_REG_VERSION) != SBX_DEVICE_VERSION) { -+ result = -ENODEV; -+ goto fail_free_irq; -+ } -+ -+ sbx_write_global_reg(SBX_GLOBAL_REG_GUEST_PROTOCOL, -+ SBX_DEVICE_GUEST_PROTOCOL); -+ dev_info(dev, "SBX Host Protocol: %lld\n", -+ sbx_read_global_reg(SBX_GLOBAL_REG_HOST_PROTOCOL)); -+ dev_info(dev, "SBX Guest Protocol: %d\n", SBX_DEVICE_GUEST_PROTOCOL); -+ -+ for (i = 0; i < SBX_MINOR_COUNT; i++) -+ atomic_set(&sbx_device->minor_device[i].avail, 1); -+ -+ dev_info(dev, "sbx probe: irq=%u\n", irq); -+ return 0; -+ -+fail_free_irq: -+ free_irq(sbx_device->irq, sbx_device); -+ -+fail_unmap_shm: -+ iounmap(sbx_device->shm_remap); -+ -+fail_unmap_cmd: -+ iounmap(sbx_device->cmd_remap); -+ return result; -+} -+ -+static void sbx_cleanup_hw(void) -+{ -+ free_irq(sbx_device->irq, sbx_device); -+ iounmap(sbx_device->shm_remap); -+ iounmap(sbx_device->cmd_remap); -+} -+ -+static int sbx_create_class(struct device *dev) -+{ -+ int result; -+ -+#if KERNEL_VERSION(6, 4, 0) <= LINUX_VERSION_CODE -+ sbx_class = class_create(SBX_NAME "drv"); -+#else -+ sbx_class = class_create(THIS_MODULE, SBX_NAME "drv"); -+#endif -+ if (IS_ERR(sbx_class)) { -+ result = PTR_ERR(sbx_class); -+ dev_err(dev, "sbx probe: class create fail error=%d\n", result); -+ sbx_class = NULL; -+ return result; -+ } -+ -+ sbx_class->devnode = sbx_devnode; -+ return 0; -+} -+ -+static void sbx_destroy_class(void) -+{ -+ class_destroy(sbx_class); -+ sbx_class = NULL; -+} -+ -+static void sbx_destroy_devices_range(unsigned int end) -+{ -+ unsigned int i; -+ -+ for (i = SBX_MINOR_FIRST; i < end; i++) -+ device_destroy(sbx_class, MKDEV(sbx_major, MINOR(i))); -+} -+ -+static int sbx_create_devices(struct device *dev) -+{ -+ unsigned int i; -+ struct device *d; -+ int result; -+ -+ for (i = SBX_MINOR_FIRST; i < SBX_MINOR_FIRST + SBX_MINOR_COUNT; i++) { -+ d = device_create(sbx_class, NULL, MKDEV(sbx_major, MINOR(i)), -+ NULL, SBX_NAME "%d", i); -+ if (IS_ERR(d)) { -+ result = PTR_ERR(d); -+ dev_err(dev, "sbx probe: sbx device create %d fail error=%d\n", -+ i, result); -+ sbx_destroy_devices_range(i); -+ return result; -+ } -+ } -+ return 0; -+} -+ -+static void sbx_destroy_devices(void) -+{ -+ sbx_destroy_devices_range(SBX_MINOR_FIRST + SBX_MINOR_COUNT); -+} -+ -+static void sbx_mgr_destroy_devices_range(unsigned int end) -+{ -+ unsigned int i; -+ -+ for (i = SBX_MGR_MINOR_FIRST; i < end; i++) -+ device_destroy(sbx_class, MKDEV(sbx_mgr_major, MINOR(i))); -+} -+ -+static int sbx_mgr_create_devices(struct device *dev) -+{ -+ unsigned int i; -+ struct device *d; -+ int result; -+ -+ for (i = SBX_MGR_MINOR_FIRST; -+ i < SBX_MGR_MINOR_FIRST + SBX_MGR_MINOR_COUNT; -+ i++) { -+ d = device_create(sbx_class, NULL, MKDEV(sbx_mgr_major, MINOR(i)), -+ NULL, SBX_MGR_NAME "%d", i); -+ if (IS_ERR(d)) { -+ result = PTR_ERR(d); -+ dev_err(dev, "sbx probe: sbx mgr device create %d fail error=%d\n", -+ i, result); -+ sbx_mgr_destroy_devices_range(i); -+ return result; -+ } -+ } -+ return 0; -+} -+ -+static void sbx_mgr_destroy_devices(void) -+{ -+ sbx_mgr_destroy_devices_range(SBX_MGR_MINOR_FIRST + SBX_MGR_MINOR_COUNT); -+} -+ -+static int sbx_add_cdev(struct device *dev, dev_t devno_sbx) -+{ -+ int result; -+ -+ cdev_init(&sbx_device->sbx_cdev, &sbx_fops); -+ sbx_device->sbx_cdev.owner = THIS_MODULE; -+ result = cdev_add(&sbx_device->sbx_cdev, devno_sbx, SBX_MINOR_COUNT); -+ if (result != 0) -+ dev_err(dev, "sbx probe: add sbx fail error=%d\n", result); -+ return result; -+} -+ -+static void sbx_del_cdev(void) -+{ -+ cdev_del(&sbx_device->sbx_cdev); -+} -+ -+static int sbx_mgr_add_cdev(struct device *dev, dev_t devno_sbx_mgr) -+{ -+ int result; -+ -+ cdev_init(&sbx_device->sbx_mgr_cdev, &sbx_mgr_fops); -+ sbx_device->sbx_mgr_cdev.owner = THIS_MODULE; -+ result = cdev_add(&sbx_device->sbx_mgr_cdev, devno_sbx_mgr, -+ SBX_MGR_MINOR_COUNT); -+ if (result != 0) -+ dev_err(dev, "sbx probe: add sbx mgr fail error=%d\n", result); -+ return result; -+} -+ -+static void sbx_mgr_del_cdev(void) -+{ -+ cdev_del(&sbx_device->sbx_mgr_cdev); -+} -+ -+static int sbx_probe(struct pci_dev *pdev, const struct pci_device_id *id) -+{ -+ struct device *dev = &pdev->dev; -+ dev_t devno_sbx; -+ dev_t devno_sbx_mgr; -+ resource_size_t cmd_addr; -+ resource_size_t cmd_len; -+ int result; -+ -+ if (sbx_device) { -+ dev_err(dev, "sbx: unexpected probe\n"); -+ return -EPERM; -+ } -+ -+ result = sbx_alloc_chrdev(dev, &devno_sbx); -+ if (result != 0) -+ return result; -+ -+ result = sbx_mgr_alloc_chrdev(dev, &devno_sbx_mgr); -+ if (result != 0) -+ goto fail_chrdev; -+ -+ result = sbx_alloc_device(); -+ if (result != 0) -+ goto fail_mgr_chrdev; -+ -+ result = sbx_init_pci(pdev, &cmd_addr, &cmd_len); -+ if (result != 0) -+ goto fail_device_struct; -+ -+ result = sbx_init_hw(pdev, cmd_addr, cmd_len); -+ if (result != 0) -+ goto fail_pci; -+ -+ result = sbx_create_class(dev); -+ if (result != 0) -+ goto fail_hw; -+ -+ result = sbx_create_devices(dev); -+ if (result != 0) -+ goto fail_class; -+ -+ result = sbx_mgr_create_devices(dev); -+ if (result != 0) -+ goto fail_devices; -+ -+ result = sbx_add_cdev(dev, devno_sbx); -+ if (result != 0) -+ goto fail_mgr_devices; -+ -+ result = sbx_mgr_add_cdev(dev, devno_sbx_mgr); -+ if (result != 0) -+ goto fail_cdev; -+ -+ return 0; -+ -+fail_cdev: -+ sbx_del_cdev(); -+ -+fail_mgr_devices: -+ sbx_mgr_destroy_devices(); -+ -+fail_devices: -+ sbx_destroy_devices(); -+ -+fail_class: -+ sbx_destroy_class(); -+ -+fail_hw: -+ sbx_cleanup_hw(); -+ -+fail_pci: -+ sbx_cleanup_pci(pdev); -+ -+fail_device_struct: -+ kfree(sbx_device); -+ sbx_device = NULL; -+ -+fail_mgr_chrdev: -+ sbx_mgr_free_chrdev(); -+ -+fail_chrdev: -+ sbx_free_chrdev(); -+ dev_info(dev, "sbx probe: fail\n"); -+ -+ return result; -+} -+ -+static void sbx_remove(struct pci_dev *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ -+ if (sbx_device) { -+ sbx_mgr_del_cdev(); -+ -+ mutex_lock(&sbx_device->sbx_mgr_lock); -+ sbx_mgr_unpin_stats_file(); -+ mutex_unlock(&sbx_device->sbx_mgr_lock); -+ -+ sbx_del_cdev(); -+ sbx_mgr_destroy_devices(); -+ sbx_destroy_devices(); -+ sbx_destroy_class(); -+ sbx_cleanup_hw(); -+ sbx_cleanup_pci(pdev); -+ kfree(sbx_device); -+ sbx_device = NULL; -+ sbx_mgr_free_chrdev(); -+ sbx_free_chrdev(); -+ -+ pci_clear_master(pdev); -+ } -+ -+ dev_info(dev, "sbx remove: major %d\n", sbx_mgr_major); -+ sbx_mgr_major = 0; -+ -+ dev_info(dev, "sbx remove: major %d with minors %d-%d\n", sbx_major, -+ SBX_MINOR_FIRST, SBX_MINOR_COUNT - 1); -+ sbx_major = 0; -+} -+ -+static struct pci_device_id sbx_ids[] = { -+ { PCI_DEVICE(PCI_VENDOR_ID_VMWARE, 0x420), }, -+ { 0, } -+}; -+ -+static struct pci_driver sbx_driver = { -+ .name = SBX_NAME, -+ .probe = sbx_probe, -+ .remove = sbx_remove, -+ .id_table = sbx_ids, -+}; -+ -+MODULE_DEVICE_TABLE(pci, sbx_ids); -+ -+static int __init sbx_init_module(void) -+{ -+ int ret = pci_register_driver(&sbx_driver); -+ -+ if (ret < 0) { -+ pr_err("sbx init module: pci_register_driver fail\n"); -+ return ret; -+ } -+ -+ if (!sbx_device) { -+ pr_err("sbx init module: sbx_probe fail\n"); -+ pci_unregister_driver(&sbx_driver); -+ return -ENODEV; -+ } -+ -+ pr_info("sbx init module: success\n"); -+ return 0; -+} -+ -+static void __exit sbx_exit_module(void) -+{ -+ pci_unregister_driver(&sbx_driver); -+ pr_info("sbx exit module: executed\n"); -+} -+ -+module_init(sbx_init_module); -+module_exit(sbx_exit_module); -diff --git a/drivers/misc/vmw_sbx/sbx_ioctl.h b/drivers/misc/vmw_sbx/sbx_ioctl.h -new file mode 100644 -index 000000000000..85e7f486d545 ---- /dev/null -+++ b/drivers/misc/vmw_sbx/sbx_ioctl.h -@@ -0,0 +1,43 @@ -+/* SPDX-License-Identifier: GPL-2.0-or-later */ -+/* -+ * Copyright (c) 2025 Broadcom. All Rights Reserved. The term -+ * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. -+ */ -+ -+#ifndef _SBX_IOCTL_H_ -+#define _SBX_IOCTL_H_ -+ -+#define SBX_MAGIC 0xb2 -+ -+struct sbx_mgr_caps_msg { -+ char *caps; -+ unsigned int caps_size; -+}; -+ -+struct sbx_chunks_msg { -+ unsigned long *chunks; -+ unsigned long chunk_size; -+ unsigned long *num_chunks; -+}; -+ -+struct sbx_mgr_map_stats_msg { -+ __u64 data; -+ __u64 size; -+ __u32 format; -+}; -+ -+#define SBX_MGR_IOCTL_LISTEN _IO(SBX_MAGIC, 0) -+#define SBX_MGR_IOCTL_CAPS _IOW(SBX_MAGIC, 1, struct sbx_mgr_caps_msg) -+#define SBX_MGR_IOCTL_MAP_STATS _IOW(SBX_MAGIC, 2, struct sbx_mgr_map_stats_msg) -+#define SBX_MGR_IOCTL_UNMAP_STATS _IO(SBX_MAGIC, 3) -+ -+#define SBX_IOCTL_SIZE _IOR(SBX_MAGIC, 10, unsigned long) -+#define SBX_IOCTL_SIGNAL _IO(SBX_MAGIC, 11) -+#define SBX_IOCTL_WAIT _IO(SBX_MAGIC, 12) -+#define SBX_IOCTL_MEM _IOR(SBX_MAGIC, 13, unsigned long long) -+#define SBX_IOCTL_CHUNKS _IOWR(SBX_MAGIC, 14, struct sbx_chunks_msg) -+ -+#define SBX_BUILD_STATS (1 << 30) -+#define SBX_BUILD_DEBUG (1 << 31) -+ -+#endif -diff --git a/drivers/misc/vmw_sbx/sbx_reg.h b/drivers/misc/vmw_sbx/sbx_reg.h -new file mode 100644 -index 000000000000..1106985ef55c ---- /dev/null -+++ b/drivers/misc/vmw_sbx/sbx_reg.h -@@ -0,0 +1,55 @@ -+/* SPDX-License-Identifier: GPL-2.0-or-later */ -+/* -+ * Copyright (c) 2023-2025 Broadcom. All Rights Reserved. The term -+ * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. -+ */ -+ -+#ifndef _SBX_REG_H_ -+#define _SBX_REG_H_ -+ -+#define SBX_CONNECTION_REG_MEM_KB 0 -+#define SBX_CONNECTION_REG_SIGNAL 1 -+#define SBX_CONNECTION_REG_MPNS 2 -+#define SBX_CONNECTION_REG_LAUNCH 3 -+#define SBX_CONNECTION_REG_RESET 4 -+#define SBX_CONNECTION_REG_CHUNKS 5 -+#define SBX_CONNECTION_REG_MAX 50 -+ -+#define SBX_GLOBAL_REG_SIGNAL 0 -+#define SBX_GLOBAL_REG_LAUNCH 1 -+#define SBX_GLOBAL_REG_CAPS 2 -+#define SBX_GLOBAL_REG_VERSION 3 -+#define SBX_GLOBAL_REG_HOST_PROTOCOL 4 -+#define SBX_GLOBAL_REG_GUEST_PROTOCOL 5 -+#define SBX_GLOBAL_REG_DEVEL 6 -+#define SBX_GLOBAL_REG_GUEST_STATS 7 -+#define SBX_GLOBAL_REG_MAX 50 -+ -+#define SBX_GLOBAL_CAPS_SIZE 2048 -+ -+#define SBX_CMD_BAR_MAX_CONNECTIONS 64 -+#define SBX_CMD_BAR_CONNECT_LEN (SBX_CONNECTION_REG_MAX * 8) -+ -+#define SBX_OFFSET_CONNECTION_REGS 0 -+#define SBX_OFFSET_GLOBAL_REGS (SBX_CMD_BAR_MAX_CONNECTIONS * \ -+ SBX_CMD_BAR_CONNECT_LEN) -+#define SBX_OFFSET_CAPS ((SBX_CMD_BAR_MAX_CONNECTIONS + 1) * \ -+ SBX_CMD_BAR_CONNECT_LEN) -+ -+#define SBX_INVALID_CHUNK -1 -+#define SBX_INVALID_PA -1 -+ -+#define SBX_MGR_BUILD_STATS (1 << 1) -+#define SBX_MGR_BUILD_DEBUG (1 << 2) -+ -+#define SBX_STATS_FORMAT_STATSFILE 0 -+ -+#define SBX_STATS_MAX_PAGES 5 -+ -+struct sbx_guest_stats_desc { -+ __u64 size; -+ __u32 format; -+ __u64 pas[SBX_STATS_MAX_PAGES]; -+}; -+ -+#endif --- -2.43.0 - diff --git a/SPECS/91/linux/esx/0001-Avoid-extra-scanning-for-peer-host-bridges.patch b/SPECS/91/linux/esx/0001-Avoid-extra-scanning-for-peer-host-bridges.patch deleted file mode 100644 index 58a3354345..0000000000 --- a/SPECS/91/linux/esx/0001-Avoid-extra-scanning-for-peer-host-bridges.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 24693f58ed55300199255b1dcccc698a80a95f4e Mon Sep 17 00:00:00 2001 -From: Ashwin Dayanand Kamat -Date: Thu, 14 Jul 2022 15:36:20 +0000 -Subject: [PATCH] Avoid extra scanning for peer host bridges - -VMware hypervisor doesn't support multiple host bridges. - -pcibios_scan_specific_bus() calls scanning for all buses for peer host bridges. -When mmconfig is initialised pcibios_last_bus is a non zero positive value (0x7f). -Due to which there is increased raw_pci_read() calls when mm_config is initialised. -But VMware hypervisor doesn't support multiple host bridges and for the single host bridge, -the information is provided by ACPI tables. -So avoid extra scanning. - -Signed-off-by: Ashwin Dayanand Kamat ---- - arch/x86/pci/legacy.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/arch/x86/pci/legacy.c b/arch/x86/pci/legacy.c -index 467311b1..1e27fc6a 100644 ---- a/arch/x86/pci/legacy.c -+++ b/arch/x86/pci/legacy.c -@@ -7,6 +7,7 @@ - #include - #include - #include -+#include - - /* - * Discover remaining PCI buses in case there are peer host bridges. -@@ -68,7 +69,12 @@ static int __init pci_subsys_init(void) - } - } - -- pcibios_fixup_peer_bridges(); -+ /* -+ * Multiple peer host bridges are not supported. -+ * Avoid extra scanning. -+ */ -+ if (x86_hyper_type != X86_HYPER_VMWARE) -+ pcibios_fixup_peer_bridges(); - x86_init.pci.init_irq(); - pcibios_init(); - --- -2.30.0 - diff --git a/SPECS/91/linux/esx/0001-MMIO_should_have_more_priority_then_IO.patch b/SPECS/91/linux/esx/0001-MMIO_should_have_more_priority_then_IO.patch deleted file mode 100644 index c375dcd7a4..0000000000 --- a/SPECS/91/linux/esx/0001-MMIO_should_have_more_priority_then_IO.patch +++ /dev/null @@ -1,45 +0,0 @@ -From e35239d8e8b64f64f6874c250d346afad99939a8 Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Fri, 29 Apr 2022 10:23:29 +0000 -Subject: [PATCH] MMIO should have more priority then IO - -If MMIO region is accessible then more priority should be given to -MMIO over IO. - -Signed-off-by: Ajay Kaher ---- - arch/x86/pci/common.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c -index ddb798603..c408059d5 100644 ---- a/arch/x86/pci/common.c -+++ b/arch/x86/pci/common.c -@@ -40,20 +40,20 @@ const struct pci_raw_ops *__read_mostly raw_pci_ext_ops; - int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, - int reg, int len, u32 *val) - { -- if (domain == 0 && reg < 256 && raw_pci_ops) -- return raw_pci_ops->read(domain, bus, devfn, reg, len, val); - if (raw_pci_ext_ops) - return raw_pci_ext_ops->read(domain, bus, devfn, reg, len, val); -+ if (domain == 0 && reg < 256 && raw_pci_ops) -+ return raw_pci_ops->read(domain, bus, devfn, reg, len, val); - return -EINVAL; - } - - int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, - int reg, int len, u32 val) - { -- if (domain == 0 && reg < 256 && raw_pci_ops) -- return raw_pci_ops->write(domain, bus, devfn, reg, len, val); - if (raw_pci_ext_ops) - return raw_pci_ext_ops->write(domain, bus, devfn, reg, len, val); -+ if (domain == 0 && reg < 256 && raw_pci_ops) -+ return raw_pci_ops->write(domain, bus, devfn, reg, len, val); - return -EINVAL; - } - --- -2.39.4 - diff --git a/SPECS/91/linux/esx/0001-NEWCA-make-initrd-pages-immutable.patch b/SPECS/91/linux/esx/0001-NEWCA-make-initrd-pages-immutable.patch deleted file mode 100644 index 518df7c779..0000000000 --- a/SPECS/91/linux/esx/0001-NEWCA-make-initrd-pages-immutable.patch +++ /dev/null @@ -1,75 +0,0 @@ -From d817eec46ac212a245f28ea787973710affc0c29 Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Mon, 01 Jun 2026 15:52:00 +0530 -Subject: [PATCH] NEWCA: make initrd pages immutable - -NEWCA initrd images can be shared across CRX instances. And there are no -cases where initrd files can be modified. From other side, accidental -modifications can lead to expensive COWs from the hypervisor side. -Seal these files to make corresponding NEWCA initrd pages immutable. - -Hardlinks sealing is different. Perform sealing only when we see -non 0 sized file. - -Signed-off-by: Alexey Makhalov -[Guru: Ported to 6.12 kernel] -Signed-off-by: Guruswamy Basavaiah ---- - init/initramfs.c | 11 +++++++++++ - mm/shmem.c | 4 +++- - 2 files changed, 14 insertions(+), 1 deletion(-) - -diff --git a/init/initramfs.c b/init/initramfs.c -index b2f7583bb1f5..6fbeebdd1741 100644 ---- a/init/initramfs.c -+++ b/init/initramfs.c -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -390,6 +391,23 @@ static int __init do_name(void) - vfs_fchmod(wfile, mode); - if (body_len) - vfs_truncate(&wfile->f_path, body_len); -+ /* -+ * Disallow modifications of NEWCA pages. -+ * For hardlinked files (nlink >= 2), body_len is 0 for -+ * all CPIO entries but the last one. Defer sealing until -+ * the entry that carries actual data so that the -+ * vfs_truncate() call above can set i_size correctly -+ * before F_SEAL_GROW prevents it. -+ */ -+ if (page_aligned_fmt && (nlink < 2 || body_len)) { -+ long err; -+ err = memfd_fcntl(wfile, F_ADD_SEALS, -+ F_SEAL_SEAL | F_SEAL_SHRINK | -+ F_SEAL_GROW | F_SEAL_WRITE); -+ if (err) -+ panic("Sealing failed: %s (%ld)", -+ collected, err); -+ } - state = CopyFile; - } - } else if (S_ISDIR(mode)) { -diff --git a/mm/shmem.c b/mm/shmem.c -index 88fd6e2a2dcf..6233cf63175f 100644 ---- a/mm/shmem.c -+++ b/mm/shmem.c -@@ -2813,7 +2813,9 @@ static struct inode *__shmem_get_inode(struct mnt_idmap *idmap, - memset(info, 0, (char *)inode - (char *)info); - spin_lock_init(&info->lock); - atomic_set(&info->stop_eviction, 0); -- info->seals = F_SEAL_SEAL; -+ /* Allow sealing while extracting initrd. */ -+ if (system_state >= SYSTEM_FREEING_INITMEM) -+ info->seals = F_SEAL_SEAL; - info->flags = flags & VM_NORESERVE; - info->i_crtime = inode_get_mtime(inode); - info->fsflags = (dir == NULL) ? 0 : --- -2.43.0 - diff --git a/SPECS/91/linux/esx/0001-Remove-OOM_SCORE_ADJ_MAX-limit-check.patch b/SPECS/91/linux/esx/0001-Remove-OOM_SCORE_ADJ_MAX-limit-check.patch deleted file mode 100644 index d08df19ab0..0000000000 --- a/SPECS/91/linux/esx/0001-Remove-OOM_SCORE_ADJ_MAX-limit-check.patch +++ /dev/null @@ -1,36 +0,0 @@ -From a666b331d08a524f6caaf41f57342311e91c5610 Mon Sep 17 00:00:00 2001 -From: Daniel Mueller -Date: Thu, 25 Jul 2019 10:15:06 -0700 -Subject: [PATCH] Remove OOM_SCORE_ADJ_MAX limit check - -This patch removes the OOM_SCORE_ADJ_MAX limit check. By removing this -check we are able to adjust the OOM score beyond OOM_SCORE_ADJ_MAX -(1000), which provides us with more confidence that the OOM killer will -actually choose the target process to be killed before interfering with -others. That is useful in certain Photon VM based setups where we want -to have a "canary" process that, upon being killed by the OOM, would -inform an agent in the VM that we are under memory pressure, and trigger -a clean shut down of the VM. -With the check in place, the kernel would still favor processes that had -a high score (1000 and above) based on actual memory consumption, -rendering our approach useless. ---- - fs/proc/base.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/fs/proc/base.c b/fs/proc/base.c -index f999e8..089ec0 100644 ---- a/fs/proc/base.c -+++ b/fs/proc/base.c -@@ -1188,7 +1188,7 @@ static ssize_t oom_score_adj_write(struct file *file, const char __user *buf, - if (err) - goto out; - if (oom_score_adj < OOM_SCORE_ADJ_MIN || -- oom_score_adj > OOM_SCORE_ADJ_MAX) { -+ oom_score_adj > SHRT_MAX) { - err = -EINVAL; - goto out; - } --- -2.21.0 - diff --git a/SPECS/91/linux/esx/0001-external_entropy-Enable-External-Entropy-support.patch b/SPECS/91/linux/esx/0001-external_entropy-Enable-External-Entropy-support.patch deleted file mode 100644 index fbda2435a3..0000000000 --- a/SPECS/91/linux/esx/0001-external_entropy-Enable-External-Entropy-support.patch +++ /dev/null @@ -1,2206 +0,0 @@ -From f110796754f315586314ab811d8b4da056e79c4c Mon Sep 17 00:00:00 2001 -From: srinidhira0 -Date: Wed, 13 Nov 2024 12:36:26 +0000 -Subject: [PATCH] external_entropy: Enable External Entropy support - - - VMWare ESXi hypervisor can provide true random numbers - through ESXi port read call. The external_entropy driver is - intended to provide kernel side implementation to read the - random numbers from hypervisor though port command and add - it to an internal pool which can be read by user space apps. - -Signed-off-by: srinidhira0 ---- - drivers/char/hw_random/Kconfig | 12 + - drivers/char/hw_random/Makefile | 1 + - .../char/hw_random/external_entropy/Makefile | 11 + - .../external_entropy/external-rng-io.c | 81 +++ - .../external_ent_config_params.c | 204 ++++++ - .../external_ent_config_params.h | 36 + - .../external_entropy/external_ent_sysfs.c | 420 ++++++++++++ - .../external_entropy/external_ent_sysfs.h | 28 + - .../external_entropy/external_entropy.c | 618 ++++++++++++++++++ - .../external_entropy/external_entropy.h | 211 ++++++ - .../external_entropy_threaded_work.c | 443 +++++++++++++ - .../external_entropy_threaded_work.h | 22 + - 12 files changed, 2087 insertions(+) - create mode 100644 drivers/char/hw_random/external_entropy/Makefile - create mode 100644 drivers/char/hw_random/external_entropy/external-rng-io.c - create mode 100644 drivers/char/hw_random/external_entropy/external_ent_config_params.c - create mode 100644 drivers/char/hw_random/external_entropy/external_ent_config_params.h - create mode 100644 drivers/char/hw_random/external_entropy/external_ent_sysfs.c - create mode 100644 drivers/char/hw_random/external_entropy/external_ent_sysfs.h - create mode 100644 drivers/char/hw_random/external_entropy/external_entropy.c - create mode 100644 drivers/char/hw_random/external_entropy/external_entropy.h - create mode 100644 drivers/char/hw_random/external_entropy/external_entropy_threaded_work.c - create mode 100644 drivers/char/hw_random/external_entropy/external_entropy_threaded_work.h - -diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig -index b6259033e..5062a98c6 100644 ---- a/drivers/char/hw_random/Kconfig -+++ b/drivers/char/hw_random/Kconfig -@@ -601,6 +601,18 @@ config HW_RANDOM_ROCKCHIP - - If unsure, say Y. - -+config HW_EXTERNAL_ENTROPY -+ tristate "VMWare ESXi based True Random Number Generator support" -+ depends on HW_RANDOM -+ default m -+ help -+ This driver provides kernel-side support for VMWare ESXi hypervisor -+ Random Number Generator. -+ This driver obtains true random numbers through a call to VMWARE -+ Hypervisor port on x86_64 architecture. -+ To compile this driver as a module, choose M here: the -+ module will be called external_entropy. -+ - endif # HW_RANDOM - - config UML_RANDOM -diff --git a/drivers/char/hw_random/Makefile b/drivers/char/hw_random/Makefile -index ef65b5876..2bbebacb6 100644 ---- a/drivers/char/hw_random/Makefile -+++ b/drivers/char/hw_random/Makefile -@@ -51,3 +51,4 @@ obj-$(CONFIG_HW_RANDOM_CN10K) += cn10k-rng.o - obj-$(CONFIG_HW_RANDOM_POLARFIRE_SOC) += mpfs-rng.o - obj-$(CONFIG_HW_RANDOM_ROCKCHIP) += rockchip-rng.o - obj-$(CONFIG_HW_RANDOM_JH7110) += jh7110-trng.o -+obj-$(CONFIG_HW_EXTERNAL_ENTROPY) += external_entropy/ -diff --git a/drivers/char/hw_random/external_entropy/Makefile b/drivers/char/hw_random/external_entropy/Makefile -new file mode 100644 -index 000000000..cb37dff9a ---- /dev/null -+++ b/drivers/char/hw_random/external_entropy/Makefile -@@ -0,0 +1,11 @@ -+# -+# Makefile for the external-entropy routines. -+# -+ -+obj-$(CONFIG_HW_EXTERNAL_ENTROPY) += external-entropy.o -+ -+external-entropy-$(CONFIG_HW_EXTERNAL_ENTROPY) := external-rng-io.o \ -+ external_entropy_threaded_work.o \ -+ external_ent_sysfs.o \ -+ external_ent_config_params.o \ -+ external_entropy.o -diff --git a/drivers/char/hw_random/external_entropy/external-rng-io.c b/drivers/char/hw_random/external_entropy/external-rng-io.c -new file mode 100644 -index 000000000..284b8459a ---- /dev/null -+++ b/drivers/char/hw_random/external_entropy/external-rng-io.c -@@ -0,0 +1,81 @@ -+// SPDX-License-Identifier: GPL v2.0 -+/* -+ * Copyright 2023 VMware, Inc. All Rights Reserved. -+ * -+ * Licensed under the GNU Lesser General Public License version 2 -+ * (the "License"); -+ * you may not use this file except in compliance with the License. The terms -+ * of the License are located in the LICENSE file of this distribution. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "external_entropy.h" -+ -+#define VMWARE_HYPERVISOR_MAGIC 0x564D5868 -+#define VMWARE_CMD_GETENTROPY 101 -+ -+#define VMWARE_HYPERVISOR_PORT 0x5658 -+ -+#define VMWARE_PORT(cmd, eax, ebx, ecx, edx) \ -+ __asm__("inl (%%dx), %%eax" : \ -+ "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \ -+ "a"(VMWARE_HYPERVISOR_MAGIC), \ -+ "c"(VMWARE_CMD_##cmd), \ -+ "d"(VMWARE_HYPERVISOR_PORT), "b"(UINT_MAX) : \ -+ "memory") -+ -+#define VMWARE_CMD(cmd, eax, ebx, ecx, edx) do { \ -+ VMWARE_PORT(cmd, eax, ebx, ecx, edx); \ -+ } while (0) -+ -+/* -+ * If the GETENTROPY Call is a SUCCESS, it return size of U32 as return code -+ * as we can only request 4 bytes of in one Hypercall. Hence, -+ * The return code will be 0x20. -+ */ -+#define GETENTROPY_SUCCESS 0x20 -+#define GETENTROPY_FAIL 0x00 -+ -+int rng_read_hypercall(struct ext_ent_t *data, u8 *buf, size_t max_bytes, -+ bool wait) -+{ -+ int err = -EIO; -+ u32 eax, ebx, ecx, edx, status_code; -+ -+ if (!buf) { -+ entropy_err("Hypercall read buffer not allocated\n"); -+ return -ENOMEM; -+ } -+ -+ VMWARE_CMD(GETENTROPY, eax, ebx, ecx, edx); -+ status_code = eax & 0x000000FF; -+ if (status_code == GETENTROPY_SUCCESS) { -+ memcpy(buf, &ebx, sizeof(u32)); -+ err = 0; -+ } else if (status_code == GETENTROPY_FAIL) -+ return -EAGAIN; -+ else { -+ /* Should never be here */ -+ entropy_err("VMWARE_CMD GETENTROPY abnormal status 0x%X\n", -+ status_code); -+ WARN_TAINT(1, TAINT_WARN, -+ "VMWARE_CMD GETENTROPY abnormal status"); -+ return -EIO; -+ } -+ -+ return err; -+} -+ -+MODULE_AUTHOR("Srinidhi Rao "); -+MODULE_DESCRIPTION("RNG driver for external Hypercall based RNG"); -+MODULE_LICENSE("GPL"); -diff --git a/drivers/char/hw_random/external_entropy/external_ent_config_params.c b/drivers/char/hw_random/external_entropy/external_ent_config_params.c -new file mode 100644 -index 000000000..6c5d8b91e ---- /dev/null -+++ b/drivers/char/hw_random/external_entropy/external_ent_config_params.c -@@ -0,0 +1,204 @@ -+// SPDX-License-Identifier: GPL v2.0 -+/* -+ * Copyright 2023 VMware, Inc. All Rights Reserved. -+ * -+ * Licensed under the GNU Lesser General Public License version 2 -+ * (the "License"); -+ * you may not use this file except in compliance with the License. The terms -+ * of the License are located in the LICENSE file of this distribution. -+ */ -+ -+#include "external_entropy.h" -+#include "external_ent_sysfs.h" -+#include "external_ent_config_params.h" -+ -+#define EXTENT_BLOCKING_STR "block" -+#define EXTENT_ERROR_STR "error" -+ -+/* -+ * MODULE PARAMETERS : no_avail and fallback_auto_switch -+ */ -+/* -+ * The parameter burst_bits configures the number of bits external entropy -+ * can emit in one shot. -+ */ -+static unsigned short total_burst_bits = DEFAULT_TOTAL_BURST_BITS; -+module_param(total_burst_bits, ushort, 0644); -+MODULE_PARM_DESC(total_burst_bits, -+ "Total number of burst bits in burst mode.power of 2 and max is 8192"); -+ -+/* -+ * The parameter ms_per_bit configures the time taken to emit 1 bit of -+ * random data in replenish mode after the burst mode has elapsed. -+ */ -+static unsigned short ms_per_bit = DEFAULT_MS_PER_BIT; -+module_param(ms_per_bit, ushort, 0644); -+MODULE_PARM_DESC(ms_per_bit, -+ "the time taken to emit 1 bit of random data in replenish mode"); -+ -+static char no_avail[10] = EXTENT_BLOCKING_STR; -+module_param_string(no_avail, no_avail, sizeof(no_avail), 0644); -+MODULE_PARM_DESC(no_avail, "When entropy is not available(default=BLOCKING)"); -+ -+/* -+ * This parameter will configure fallback automatic switching. When fallback -+ * source is set and if external entropy encounters any error or is exhausted, -+ * the dev_read will fetch bytes from fallback source till external_entropy -+ * becomes available. Once external entropy is able to give bytes either -+ * in burst mode or replenish mode, this fallback will be removed and dev_read -+ * will start to fill from external_entropy output. -+ */ -+static char fallback_auto_switch[8] = {0}; -+module_param_string(fallback_auto_switch, fallback_auto_switch, -+ sizeof(fallback_auto_switch), 0644); -+MODULE_PARM_DESC(fallback_auto_switch, -+ "switch to available source(default=none)"); -+ -+static char jent_src_name[32] = "jitterentropy_rng"; -+module_param_string(jent_src_name, jent_src_name, -+ sizeof(jent_src_name), 0644); -+MODULE_PARM_DESC(jent_src_name, -+ "jitterentropy source name(default=jitterentropy_rng)"); -+ -+/* -+ * This parameter will configure the pool size of the circular buffer which -+ * will be filled from the extract entropy thread. This needs to be a -+ * configuration parameter and cannot be same as BURST Size because, each -+ * VM or Pod which runs the external entropy driver will have to share -+ * the hypervisor's external entropy stream. Hence it will be good to -+ * configure pool size less than BURST size if multiple VMs or PODs are going -+ * be spawned at the same time on a single hypervisor. -+ */ -+static unsigned short config_pool_size = (DEFAULT_TOTAL_BURST_BITS / BITS_PER_BYTE); -+module_param(config_pool_size, ushort, 0644); -+MODULE_PARM_DESC(config_pool_size, -+ "MAX Pool (default=1024). power of 2 and max is 1024"); -+ -+void get_burst_bits(unsigned short *val) -+{ -+ *val = total_burst_bits; -+} -+ -+void get_ms_per_bit(unsigned short *val) -+{ -+ *val = ms_per_bit; -+} -+ -+void get_pool_size(int *val) -+{ -+ *val = config_pool_size; -+} -+ -+static inline bool is_power_of_two(unsigned short x) -+{ -+ return x && (!(x & (x - 1))); -+} -+ -+/* Get and Set functions for the config parameters */ -+ -+int get_no_avail_config(enum no_avail_def *val) -+{ -+ if (!strncasecmp(no_avail, EXTENT_ERROR_STR, -+ strlen(EXTENT_ERROR_STR))) { -+ entropy_debug("No Avail RETURN_ERROR set\n"); -+ *val = EXT_ENT_RETURN_AVAIL; -+ return -EAGAIN; -+ } -+ entropy_debug("No Avail BLOCKING set\n"); -+ *val = EXT_ENT_BLOCKING; /* Default behaviour */ -+ return 0; -+} -+ -+int set_no_avail_config(enum no_avail_def val) -+{ -+ switch (val) { -+ -+ case EXT_ENT_RETURN_AVAIL: -+ strncpy(no_avail, EXTENT_ERROR_STR, strlen(EXTENT_ERROR_STR)); -+ break; -+ case EXT_ENT_BLOCKING: -+ strncpy(no_avail, EXTENT_BLOCKING_STR, -+ strlen(EXTENT_BLOCKING_STR)); -+ break; -+ default: -+ strncpy(no_avail, EXTENT_BLOCKING_STR, -+ strlen(EXTENT_BLOCKING_STR)); -+ break; -+ } -+ return 0; -+} -+ -+int get_fallback_auto_switch_config(enum entropy_src_t *val) -+{ -+ if (!strncasecmp(fallback_auto_switch, "none", strlen("none"))) -+ *val = EXTERNAL; -+ else if (!strncasecmp(fallback_auto_switch, "rd_rnd", -+ strlen("rd_rnd"))) -+ *val = RD_RND; -+ else if (!strncasecmp(fallback_auto_switch, "jent", strlen("jent"))) -+ *val = JENT; -+ else if (!strncasecmp(fallback_auto_switch, "random", -+ strlen("random"))) -+ *val = RANDOM; -+ else /* Default case */ -+ *val = EXTERNAL; -+ -+ return 0; -+} -+ -+int set_fallback_auto_switch_config(enum entropy_src_t val) -+{ -+ -+ entropy_debug(" In %s, setting config to %s\n", __func__, -+ fallback_opt_def[val]); -+ strncpy(fallback_auto_switch, fallback_opt_def[val], -+ strlen(fallback_opt_def[val])); -+ return 0; -+} -+ -+const char *get_jent_src_name(void) -+{ -+ entropy_debug("User set jitterentropy rng name '%s'\n", -+ jent_src_name); -+ -+ return jent_src_name; -+} -+ -+static struct ctl_table external_entropy_table[] = { -+ { -+ .procname = "fallback_auto_switch", -+ .data = fallback_auto_switch, -+ .maxlen = sizeof(fallback_auto_switch), -+ .mode = 0644, -+ .proc_handler = proc_dostring, -+ }, -+ { -+ .procname = "no_avail", -+ .data = no_avail, -+ .maxlen = sizeof(no_avail), -+ .mode = 0644, -+ .proc_handler = proc_dostring, -+ }, -+ {} -+}; -+ -+/*static struct ctl_table external_entropy_dir_table[] = { -+ { -+ .procname = "external_entropy", -+ .mode = 0555, -+ .child = external_entropy_table -+ }, -+ {} -+};*/ -+ -+static struct ctl_table_header *external_entropy_sysctls; -+ -+void external_entropy_proc_init(void) -+{ -+ external_entropy_sysctls = register_sysctl("external_entropy", external_entropy_table); -+} -+ -+void external_entropy_proc_exit(void) -+{ -+ unregister_sysctl_table(external_entropy_sysctls); -+} -diff --git a/drivers/char/hw_random/external_entropy/external_ent_config_params.h b/drivers/char/hw_random/external_entropy/external_ent_config_params.h -new file mode 100644 -index 000000000..e0f2733e8 ---- /dev/null -+++ b/drivers/char/hw_random/external_entropy/external_ent_config_params.h -@@ -0,0 +1,36 @@ -+/* SPDX-License-Identifier: GPL v2.0 -+ * -+ * Copyright 2023 VMware, Inc. All Rights Reserved. -+ * -+ * Licensed under the GNU Lesser General Public License version 2 -+ * (the "License"); -+ * you may not use this file except in compliance with the License. The terms -+ * of the License are located in the LICENSE file of this distribution. -+ */ -+ -+#ifndef EXTERNAL_ENTROPY_CONFIG_PARAMS_H -+#define EXTERNAL_ENTROPY_CONFIG_PARAMS_H -+ -+/* Function Prototype Forward declaration */ -+ -+int get_no_avail_config(enum no_avail_def *val); -+ -+int set_no_avail_config(enum no_avail_def val); -+ -+int get_fallback_auto_switch_config(enum entropy_src_t *val); -+ -+int set_fallback_auto_switch_config(enum entropy_src_t val); -+ -+const char *get_jent_src_name(void); -+ -+void external_entropy_proc_init(void); -+ -+void external_entropy_proc_exit(void); -+ -+void get_burst_bits(unsigned short *val); -+ -+void get_ms_per_bit(unsigned short *val); -+ -+void get_pool_size(int *val); -+ -+#endif -diff --git a/drivers/char/hw_random/external_entropy/external_ent_sysfs.c b/drivers/char/hw_random/external_entropy/external_ent_sysfs.c -new file mode 100644 -index 000000000..609f805bc ---- /dev/null -+++ b/drivers/char/hw_random/external_entropy/external_ent_sysfs.c -@@ -0,0 +1,420 @@ -+// SPDX-License-Identifier: GPL v2.0 -+/* -+ * Copyright 2023 VMware, Inc. All Rights Reserved. -+ * -+ * Licensed under the GNU Lesser General Public License version 2 -+ * (the "License"); -+ * you may not use this file except in compliance with the License. The terms -+ * of the License are located in the LICENSE file of this distribution. -+ */ -+ -+#include "external_entropy.h" -+#include "external_ent_sysfs.h" -+#include "external_ent_config_params.h" -+ -+#define no_avail_block_str "block" -+#define no_avail_error_str "error" -+static const char * const no_avail_block[] = { -+ "block", -+ NULL -+}; -+ -+static const char * const no_avail_error[] = { -+ "error", -+ NULL -+}; -+ -+static ssize_t ext_ent_attr_fallback_opt_show(struct device *dev, -+ struct device_attribute *attr, char *buf); -+static ssize_t ext_ent_attr_fallback_opt_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t len); -+static ssize_t ext_ent_attr_ent_src_show(struct device *dev, -+ struct device_attribute *attr, char *buf); -+static ssize_t ext_ent_attr_ent_src_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t len); -+static ssize_t ext_ent_attr_op_state_show(struct device *dev, -+ struct device_attribute *attr, char *buf); -+static ssize_t ext_ent_attr_thread_op_show(struct device *dev, -+ struct device_attribute *attr, char *buf); -+static ssize_t ext_ent_attr_status_show(struct device *dev, -+ struct device_attribute *attr, char *buf); -+static ssize_t ext_ent_attr_available_entropy_show(struct device *dev, -+ struct device_attribute *attr, char *buf); -+ -+static ssize_t ext_ent_attr_noavail_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t len); -+static ssize_t ext_ent_attr_noavail_show(struct device *dev, -+ struct device_attribute *attr, char *buf); -+ -+static DEVICE_ATTR(ext_ent_attr_fallback_opt, 0644, -+ ext_ent_attr_fallback_opt_show, ext_ent_attr_fallback_opt_store); -+static DEVICE_ATTR(ext_ent_attr_ent_src, 0644, -+ ext_ent_attr_ent_src_show, ext_ent_attr_ent_src_store); -+static DEVICE_ATTR(ext_ent_attr_noavail, 0644, -+ ext_ent_attr_noavail_show, ext_ent_attr_noavail_store); -+static DEVICE_ATTR(ext_ent_attr_op_state, 0644, -+ ext_ent_attr_op_state_show, NULL); -+static DEVICE_ATTR(ext_ent_attr_thread_op, 0644, -+ ext_ent_attr_thread_op_show, NULL); -+static DEVICE_ATTR(ext_ent_attr_status, 0644, -+ ext_ent_attr_status_show, NULL); -+static DEVICE_ATTR(ext_ent_attr_available_entropy, 0644, -+ ext_ent_attr_available_entropy_show, NULL); -+ -+static struct attribute *ext_ent_attributes[] = { -+ &dev_attr_ext_ent_attr_fallback_opt.attr, -+ &dev_attr_ext_ent_attr_ent_src.attr, -+ &dev_attr_ext_ent_attr_noavail.attr, -+ &dev_attr_ext_ent_attr_op_state.attr, -+ &dev_attr_ext_ent_attr_thread_op.attr, -+ &dev_attr_ext_ent_attr_status.attr, -+ &dev_attr_ext_ent_attr_available_entropy.attr, -+ NULL, -+}; -+ -+static const struct attribute_group ext_ent_attr_sysfs_attr_group = { -+ .attrs = ext_ent_attributes, -+}; -+ -+int ext_ent_attr_sysfs_init(struct ent_sysfs_info_t *info) -+{ -+ int ret; -+ -+ info->ent_misc.minor = MISC_DYNAMIC_MINOR; -+ info->ent_misc.name = "ext_ent_attr"; -+ info->ent_misc.mode = 0644; -+ ret = misc_register(&info->ent_misc); -+ if (ret) { -+ dev_err(info->dev, -+ "Err %d in registering misc class\n", ret); -+ return ret; -+ } -+ entropy_debug("Created MISC DRIVER\n"); -+ ret = sysfs_create_group( -+ &info->ent_misc.this_device->kobj, -+ &ext_ent_attr_sysfs_attr_group); -+ if (ret) { -+ dev_err(info->dev, "Err in creating sysfs grp\n"); -+ misc_deregister(&info->ent_misc); -+ } -+ -+ return ret; -+} -+ -+void ext_ent_attr_sysfs_exit(struct ent_sysfs_info_t *info) -+{ -+ sysfs_remove_group( -+ &info->ent_misc.this_device->kobj, -+ &ext_ent_attr_sysfs_attr_group); -+ -+ if (info->ent_misc.this_device) -+ misc_deregister(&info->ent_misc); -+} -+ -+static ssize_t ext_ent_attr_fallback_opt_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct ext_ent_t *ext_ent_data = NULL; -+ ssize_t ret = 0; -+ -+ entropy_debug("In sysfs get fallback opt\n"); -+ -+ get_external_entropy_handle(&ext_ent_data); -+ get_fallback_auto_switch_config(&ext_ent_data->fb_src); -+ switch (ext_ent_data->fb_src) { -+ -+ case EXTERNAL: -+ ret = strlen("external"); -+ strncpy(buf, "external", ret); -+ break; -+ -+ case RD_RND: -+ ret = strlen("rd_rnd"); -+ strncpy(buf, "rd_rnd", ret); -+ break; -+ -+ case RANDOM: -+ ret = strlen("random"); -+ strncpy(buf, "random", ret); -+ break; -+ -+ case JENT: -+ ret = strlen("jent"); -+ strncpy(buf, "jent", ret); -+ break; -+ -+ default: -+ ret = strlen("external"); -+ strncpy(buf, "external", ret); -+ break; -+ } -+ return ret; -+} -+ -+static ssize_t ext_ent_attr_fallback_opt_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t len) -+{ -+ struct ext_ent_t *ext_ent_data = NULL; -+ -+ entropy_debug("In sysfs set fallback opt\n"); -+ -+ get_external_entropy_handle(&ext_ent_data); -+ -+ if (!strncasecmp(buf, fallback_opt_def[EXTERNAL], -+ strlen(fallback_opt_def[EXTERNAL]))) -+ set_fallback_auto_switch_config(EXTERNAL); -+ else if (!strncasecmp(buf, fallback_opt_def[JENT], -+ strlen(fallback_opt_def[JENT]))) -+ set_fallback_auto_switch_config(JENT); -+ else if (!strncasecmp(buf, fallback_opt_def[RD_RND], -+ strlen(fallback_opt_def[RD_RND]))) -+ set_fallback_auto_switch_config(RD_RND); -+ else if (!strncasecmp(buf, fallback_opt_def[RANDOM], -+ strlen(fallback_opt_def[RANDOM]))) -+ set_fallback_auto_switch_config(RANDOM); -+ else /* Default behavior */ -+ set_fallback_auto_switch_config(EXTERNAL); -+ -+ return len; -+} -+ -+static ssize_t ext_ent_attr_ent_src_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct ext_ent_t *ext_ent_data = NULL; -+ ssize_t ret = 0; -+ -+ entropy_debug("In sysfs get_entropy_src\n"); -+ -+ get_external_entropy_handle(&ext_ent_data); -+ switch (ext_ent_data->ent_src) { -+ -+ case EXTERNAL: -+ ret = strlen("external"); -+ strncpy(buf, "external", ret); -+ break; -+ -+ case RD_RND: -+ ret = strlen("rd_rnd"); -+ strncpy(buf, "rd_rnd", ret); -+ break; -+ -+ case JENT: -+ ret = strlen("jent"); -+ strncpy(buf, "jent", ret); -+ break; -+ -+ case RANDOM: -+ ret = strlen("random"); -+ strncpy(buf, "random", ret); -+ break; -+ -+ default: -+ ret = strlen("external"); -+ strncpy(buf, "external", ret); -+ break; -+ } -+ return ret; -+} -+ -+static ssize_t ext_ent_attr_ent_src_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t len) -+{ -+ struct ext_ent_t *ext_ent_data = NULL; -+ -+ entropy_debug("In sysfs set_entropy_src\n"); -+ -+ get_external_entropy_handle(&ext_ent_data); -+ if (!strncmp(buf, "external", strlen("external"))) -+ ext_ent_data->ent_src = EXTERNAL; -+ else if (!strncmp(buf, "none", strlen("none"))) -+ ext_ent_data->ent_src = EXTERNAL; -+ else if (!strncmp(buf, "rd_rnd", strlen("rd_rnd"))) -+ ext_ent_data->ent_src = RD_RND; -+ else if (!strncmp(buf, "jent", strlen("jent"))) { -+ entropy_debug("Setting the source as JENT\n"); -+ ext_ent_data->ent_src = JENT; -+ } else if (!strncmp(buf, "random", strlen("random"))) -+ ext_ent_data->ent_src = RANDOM; -+ else -+ ext_ent_data->ent_src = EXTERNAL; -+ -+ return len; -+} -+ -+static ssize_t ext_ent_attr_noavail_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct ext_ent_t *ext_ent_data = NULL; -+ enum no_avail_def get_val; -+ ssize_t ret = 0; -+ -+ entropy_debug("In sysfs noavail show\n"); -+ -+ get_external_entropy_handle(&ext_ent_data); -+ get_no_avail_config(&get_val); -+ switch (get_val) { -+ -+ case EXT_ENT_RETURN_AVAIL: -+ ret = strlen(no_avail_error[0]); -+ strncpy(buf, no_avail_error[0], ret); -+ break; -+ -+ case EXT_ENT_BLOCKING: -+ ret = strlen(no_avail_block[0]); -+ strncpy(buf, no_avail_block[0], ret); -+ break; -+ -+ default: -+ ret = strlen(no_avail_block[0]); -+ strncpy(buf, no_avail_block[0], ret); -+ break; -+ } -+ return ret; -+} -+ -+static ssize_t ext_ent_attr_noavail_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t len) -+{ -+ enum no_avail_def set_val; -+ struct ext_ent_t *ext_ent_data = NULL; -+ -+ entropy_debug("In sysfs noavail_store\n"); -+ -+ get_external_entropy_handle(&ext_ent_data); -+ if (strncmp(no_avail_error_str, buf, strlen(no_avail_error_str)) >= 0) -+ set_val = EXT_ENT_RETURN_AVAIL; -+ else if (strncmp(no_avail_block_str, buf, -+ strlen(no_avail_block_str)) >= 0) -+ set_val = EXT_ENT_BLOCKING; -+ else /* Default Behavior */ -+ set_val = EXT_ENT_BLOCKING; -+ -+ set_no_avail_config(set_val); -+ -+ return len; -+} -+ -+static ssize_t ext_ent_attr_op_state_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct ext_ent_t *ext_ent_data = NULL; -+ ssize_t ret = 0; -+ -+ entropy_debug("In sysfs get error status\n"); -+ -+ get_external_entropy_handle(&ext_ent_data); -+ switch (ext_ent_data->err_status) { -+ -+ case ALL_OK: -+ ret = strlen("all_ok"); -+ strncpy(buf, "all_ok", ret); -+ break; -+ -+ case ERROR: -+ ret = strlen("error"); -+ strncpy(buf, "error", ret); -+ break; -+ -+ case EXT_HYPERCALL_ERR: -+ ret = strlen("ext_hypercall_err"); -+ strncpy(buf, "ext_hypercall_err", ret); -+ break; -+ -+ default: -+ ret = strlen("all_ok"); -+ strncpy(buf, "all_ok", ret); -+ break; -+ } -+ return ret; -+} -+ -+static ssize_t ext_ent_attr_status_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ -+ struct ext_ent_t *ext_ent_data = NULL; -+ ssize_t ret = 0; -+ -+ entropy_debug("In sysfs get status\n"); -+ -+ get_external_entropy_handle(&ext_ent_data); -+ switch (atomic_read(&ext_ent_data->thread_state)) { -+ -+ case FILLING: -+ ret = strlen("filling"); -+ strncpy(buf, "fillling", ret); -+ break; -+ -+ case FULL: -+ ret = strlen("full"); -+ strncpy(buf, "full", ret); -+ break; -+ -+ default: -+ ret = strlen("filling"); -+ strncpy(buf, "filling", ret); -+ break; -+ } -+ return ret; -+} -+ -+static ssize_t ext_ent_attr_available_entropy_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct ext_ent_t *ext_ent_data = NULL; -+ ssize_t ret = 0, avail_cnt; -+ char bytes_str[32] = {0}; -+ -+ entropy_debug("In sysfs get available entropy\n"); -+ -+ get_external_entropy_handle(&ext_ent_data); -+ if (ext_ent_data->err_status == ALL_OK) -+ avail_cnt = get_avail_bytes(ext_ent_data); -+ -+ snprintf(bytes_str, sizeof(bytes_str)-1, "%lu bytes", avail_cnt); -+ ret = strlen(bytes_str); -+ strncpy(buf, bytes_str, ret+1); -+ -+ return ret; -+} -+ -+static ssize_t ext_ent_attr_thread_op_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct ext_ent_t *ext_ent_data = NULL; -+ ssize_t ret = 0; -+ -+ entropy_debug("In sysfs thread op show\n"); -+ -+ get_external_entropy_handle(&ext_ent_data); -+ switch (ext_ent_data->thread_op) { -+ -+ case EXT_ENT_INTERRUPTIBLE: -+ ret = strlen("interruptible"); -+ strncpy(buf, "interruptible", ret); -+ break; -+ -+ case EXT_ENT_RUNNING: -+ ret = strlen("running"); -+ strncpy(buf, "running", ret); -+ break; -+ -+ case EXT_ENT_THREAD_ERROR: -+ ret = strlen("error_or_uninitialized"); -+ strncpy(buf, "error_or_uninitialized", ret); -+ break; -+ -+ default: -+ ret = strlen("interruptible"); -+ strncpy(buf, "interruptible", ret); -+ break; -+ } -+ return ret; -+} -diff --git a/drivers/char/hw_random/external_entropy/external_ent_sysfs.h b/drivers/char/hw_random/external_entropy/external_ent_sysfs.h -new file mode 100644 -index 000000000..404ca53d9 ---- /dev/null -+++ b/drivers/char/hw_random/external_entropy/external_ent_sysfs.h -@@ -0,0 +1,28 @@ -+/* SPDX-License-Identifier: GPL v2.0 -+ * -+ * Copyright 2023 VMware, Inc. All Rights Reserved. -+ * -+ * Licensed under the GNU Lesser General Public License version 2 -+ * (the "License"); -+ * you may not use this file except in compliance with the License. The terms -+ * of the License are located in the LICENSE file of this distribution. -+ */ -+ -+#ifndef EXTERNAL_ENT_SYSFS_H -+#define EXTERNAL_ENT_SYSFS_H -+ -+static const char * const fallback_opt_def[] = { -+ "external", -+ "jent", -+ "rd_rnd", -+ "random", -+ NULL -+}; -+ -+/* Function Prototype Forward declaration */ -+int get_avail_bytes(struct ext_ent_t *data); -+ -+int ext_ent_attr_sysfs_init(struct ent_sysfs_info_t *info); -+void ext_ent_attr_sysfs_exit(struct ent_sysfs_info_t *info); -+ -+#endif -diff --git a/drivers/char/hw_random/external_entropy/external_entropy.c b/drivers/char/hw_random/external_entropy/external_entropy.c -new file mode 100644 -index 000000000..0928a9820 ---- /dev/null -+++ b/drivers/char/hw_random/external_entropy/external_entropy.c -@@ -0,0 +1,618 @@ -+// SPDX-License-Identifier: GPL v2.0 -+/* -+ * Copyright 2023 VMware, Inc. All Rights Reserved. -+ * -+ * Licensed under the GNU Lesser General Public License version 2 -+ * (the "License"); -+ * you may not use this file except in compliance with the License. -+ * The terms of the License are located in the LICENSE file of this -+ * distribution. -+ */ -+ -+#include "external_entropy.h" -+#include "external_ent_sysfs.h" -+#include "external_entropy_threaded_work.h" -+#include "external_ent_config_params.h" -+ -+#define DEVICE_NAME "entropy" -+ -+#define EXTENT_BLOCKING "block" -+#define EXTENT_ERROR "error" -+ -+static struct class *ext_ent_class; -+static struct device *ext_ent_device; -+static int major_num; -+static struct ext_ent_t *entropy_data; -+ -+static int entropy_get_rdrnd(struct ext_ent_t *data, u8 *read_buf, -+ size_t len); -+static int ext_ent_get_jent_read_bytes(struct crypto_rng *jent_handle, -+ u8 *buf, int len); -+static ssize_t ext_ent_get_external_read_bytes(struct ext_ent_t *ext_ent_data, -+ struct ext_ent_wait_info_t *wait_info, -+ u8 *read_buf, size_t len); -+ -+static void ext_ent_free_jent(struct crypto_rng *jent_handle); -+ -+int rng_read_hypercall(struct ext_ent_t *data, u8 *buf, -+ size_t max_bytes, bool wait); -+ -+static void calc_blocked_duration(struct work_struct *work); -+ -+/** -+ * @brief Get the handle of allocated entropy_data. -+ * @param data: Pointer to store external entropy information object. -+ * @return 0 on success, -ENOENT for failure. -+ */ -+int get_external_entropy_handle(struct ext_ent_t **data) -+{ -+ int ret = -ENOENT; -+ -+ if (entropy_data) { -+ *data = (struct ext_ent_t *)entropy_data; -+ ret = 0; -+ } else -+ *data = NULL; -+ -+ return ret; -+} -+ -+/** -+ * @brief Opens the external entropy dev node -+ * @param inode: the underlying inode associated with dev node. -+ * filep: file pointer for the open call. -+ * @return 0 on success. -+ */ -+static int dev_open(struct inode *inod, struct file *filep) -+{ -+ int ret = 0; -+ struct ext_ent_wait_info_t *wait_info = NULL; -+ -+ entropy_debug("%s device opened", DEVICE_NAME); -+ -+ if (!entropy_data) { -+ entropy_err("Entropy data not initialized in dev open\n"); -+ ret = -EINVAL; -+ goto dev_open_exit; -+ } else { -+ wait_info = devm_kzalloc(ext_ent_device, -+ sizeof(struct ext_ent_wait_info_t), GFP_KERNEL); -+ if (IS_ERR_OR_NULL(wait_info)) { -+ entropy_err("Fail to allocate mem for wait_info\n"); -+ ret = -ENOMEM; -+ } -+ filep->private_data = wait_info; -+ } -+ -+dev_open_exit: -+ return ret; -+} -+ -+/** -+ * @brief Read handle of external entropy device interface. -+ * @param filep : file pointer associated with read operation. -+ * buf: user buffer pointer for read. -+ * len: requested length of bytes -+ * off: offset pointer -+ * @return number of bytes read on success, error code on failure. -+ */ -+static ssize_t dev_read(struct file *filep, char __user *buf, -+ size_t len, loff_t *off) -+{ -+ int ret = -EINVAL; -+ struct ext_ent_t *ext_ent_data = NULL; -+ struct ext_ent_wait_info_t *wait_info = NULL; -+ u8 *read_buf = NULL; -+ size_t avl_cnt; -+ -+ if (!filep || !filep->private_data || !buf || !off) { -+ entropy_err("Read device called with null buffer/file ptr\n"); -+ return ret; -+ } -+ get_external_entropy_handle(&ext_ent_data); -+ avl_cnt = min_t(size_t, ext_ent_data->burst_bits, len); -+ -+ read_buf = devm_kzalloc(ext_ent_device, -+ avl_cnt * sizeof(u8), GFP_KERNEL); -+ if (IS_ERR_OR_NULL(read_buf)) { -+ entropy_err("Error in allocating memory for read_buf\n"); -+ return -ENOMEM; -+ } -+ /* Check whether entropy source has been changed or not */ -+ entropy_debug("\n Source of entropy is %d\n", ext_ent_data->ent_src); -+ switch (ext_ent_data->ent_src) { -+ case RD_RND: -+ case RANDOM: -+ entropy_debug("Entropy SRC has changed to RD_RND\n"); -+ ret = entropy_get_rdrnd(ext_ent_data, read_buf, -+ avl_cnt); -+ break; -+ case JENT: -+ entropy_debug("Entropy SRC has changed to JENT\n"); -+ ret = ext_ent_get_jent_read_bytes( -+ ext_ent_data->jent_handle, (u8 *)read_buf, avl_cnt); -+ break; -+ case EXTERNAL: -+ default: -+ wait_info = (struct ext_ent_wait_info_t *)filep->private_data; -+ if (IS_ERR_OR_NULL(wait_info)) { -+ entropy_err("Err in %s, wait_info is NULL\n", __func__); -+ if (read_buf) -+ devm_kfree(ext_ent_device, read_buf); -+ -+ return -EFAULT; -+ } -+ memzero_explicit(wait_info, sizeof(struct ext_ent_wait_info_t)); -+ init_waitqueue_head(&wait_info->blk_q); -+ INIT_WORK(&wait_info->comp_work, calc_blocked_duration); -+ ret = ext_ent_get_external_read_bytes(ext_ent_data, -+ wait_info, (u8 *)read_buf, avl_cnt); -+ break; -+ } -+ if (ret < 0) { -+ entropy_err("Failed to read from ent src %d\n", -+ ext_ent_data->ent_src); -+ ext_ent_data->err_status = ERROR; -+ if (read_buf) -+ devm_kfree(ext_ent_device, read_buf); -+ return ret; -+ } -+ if (copy_to_user(buf, read_buf, ret)) { -+ entropy_err("Failed to copy rng output to user\n"); -+ if (read_buf) -+ devm_kfree(ext_ent_device, read_buf); -+ return -EFAULT; -+ } -+ *off += ret; -+ -+ if (read_buf) -+ devm_kfree(ext_ent_device, read_buf); -+ return ret; -+} -+ -+/* -+ * @brief write handle of external entropy device interface. -+ * @param filep : file pointer associated with read operation. -+ * buf: user buffer pointer for wrte. -+ * len: length of bytes to be written. -+ * off: offset pointer -+ * @return EINVAL error code as write operation is not supported. -+ */ -+static ssize_t dev_write(struct file *filep, const char *buf, size_t len, -+ loff_t *off) -+{ -+ return -EINVAL; -+} -+ -+/** -+ * @brief release handle of external entropy device interface. -+ * @param filep : file pointer associated with read operation. -+ * inode: underlying inode of external entropy device. -+ * @return 0 on success, error code on failure. -+ */ -+static int dev_release(struct inode *inod, struct file *filep) -+{ -+ struct ext_ent_wait_info_t *wait_info = NULL; -+ -+ if (!filep->private_data) { -+ entropy_err("External Entropy device is NULL\n"); -+ return -EINVAL; -+ } -+ wait_info = (struct ext_ent_wait_info_t *)filep->private_data; -+ if (wait_info) { -+ if (work_busy(&wait_info->comp_work)) -+ flush_work(&wait_info->comp_work); -+ cancel_work_sync(&wait_info->comp_work); -+ devm_kfree(ext_ent_device, wait_info); -+ filep->private_data = NULL; -+ } -+ entropy_debug("device closed\n"); -+ return 0; -+} -+ -+static const struct file_operations fops = { -+ .read = dev_read, -+ .write = dev_write, -+ .open = dev_open, -+ .release = dev_release, -+ }; -+ -+/** -+ * @brief Module initialization function of external entropy device. -+ * @param None. -+ * @return 0 on success, error code on failure. -+ */ -+static int __init ext_ent_init(void) -+{ -+ int err = 0; -+ struct ext_ent_t *ext_ent_data = NULL; -+ -+ major_num = register_chrdev(0, DEVICE_NAME, &fops); -+ if (major_num < 0) -+ entropy_err("device registration failed%d\n", major_num); -+ -+ entropy_debug("Device %s registration success with major num %d\n", -+ DEVICE_NAME, major_num); -+ -+ ext_ent_class = class_create("vmware_external_entropy"); -+ if (IS_ERR(ext_ent_class)) { -+ entropy_err("Failed to register device class\n"); -+ err = PTR_ERR(ext_ent_class); -+ goto error; -+ } -+ -+ ext_ent_device = device_create(ext_ent_class, NULL, -+ MKDEV(major_num, 0), NULL, DEVICE_NAME); -+ if (IS_ERR(ext_ent_class)) { -+ class_destroy(ext_ent_class); -+ err = PTR_ERR(ext_ent_class); -+ goto error; -+ } -+ entropy_data = devm_kzalloc(ext_ent_device, -+ sizeof(struct ext_ent_t), GFP_KERNEL); -+ if (IS_ERR_OR_NULL(entropy_data)) { -+ entropy_err("Failed to allocate mem for Ext ent data\n"); -+ err = -ENOMEM; -+ goto error_priv_data; -+ } -+ ext_ent_data = (struct ext_ent_t *)entropy_data; -+ rwlock_init(&ext_ent_data->sync_rw); -+ ext_ent_data->sch.sched_priority = 50; -+ ext_ent_data->hypcall_rd_siz = DEF_HYPCALL_RD_SIZE; -+ -+ get_burst_bits(&ext_ent_data->burst_bits); -+ get_ms_per_bit(&ext_ent_data->ms_per_bit); -+ get_pool_size(&ext_ent_data->pool_size); -+ -+ ext_ent_data->pool.buf = devm_kzalloc(ext_ent_device, -+ ((ext_ent_data->pool_size) * sizeof(u8)), GFP_KERNEL); -+ if (IS_ERR_OR_NULL(ext_ent_data->pool.buf)) { -+ entropy_err("Fail to allocate mem for entropy pool\n"); -+ err = -ENOMEM; -+ goto error_pool; -+ } -+ mutex_init(&ext_ent_data->avail_lock); -+ -+ ext_ent_data->ent_sysfs_info.dev = ext_ent_device; -+ ext_ent_attr_sysfs_init(&ext_ent_data->ent_sysfs_info); -+ -+ ext_ent_data->jent_handle = crypto_alloc_rng(get_jent_src_name(), -+ 0, 0); -+ if (IS_ERR_OR_NULL(ext_ent_data->jent_handle)) { -+ /*Failed to allocate jent. set dafualt src to none */ -+ entropy_err("Failed to allocate Jitter entropy RNG\n"); -+ ext_ent_data->jent_handle = NULL; -+ } -+ /* Initialize the /proc entries */ -+ external_entropy_proc_init(); -+ ext_ent_data->extract_work = kthread_create(entropy_work, ext_ent_data, -+ "external_entropy"); -+ if (!ext_ent_data->extract_work) { -+ err = PTR_ERR(ext_ent_data->extract_work); -+ entropy_err("Failed to initialize kthread %d\n", err); -+ goto error_kthread; -+ } else { -+ /* -+ * set the collector state to SEEDING & wakeup the -+ * extract worker kthread. -+ */ -+ ext_ent_data->thread_op = EXT_ENT_THREAD_ERROR; /* Initial state */ -+ atomic_set(&ext_ent_data->collec_state, EXT_ENT_SEEDING); -+ wake_up_process(ext_ent_data->extract_work); -+ } -+ -+ return err; -+ -+error_kthread: -+ if (ext_ent_data->pool.buf) -+ devm_kfree(ext_ent_device, ext_ent_data->pool.buf); -+error_pool: -+ if (entropy_data) -+ devm_kfree(ext_ent_device, entropy_data); -+error_priv_data: -+ device_destroy(ext_ent_class, MKDEV(major_num, 0)); -+ class_destroy(ext_ent_class); -+error: -+ unregister_chrdev(major_num, DEVICE_NAME); -+ return err; -+} -+ -+/** -+ * @brief Module exit function of external entropy device. -+ * @param None. -+ * @return void -+ */ -+static void __exit ext_ent_exit(void) -+{ -+ struct ext_ent_t *ext_ent_data = NULL; -+ -+ entropy_debug("Exiting ext_en\n"); -+ get_external_entropy_handle(&ext_ent_data); -+ if (ext_ent_data->extract_work) -+ kthread_stop(ext_ent_data->extract_work); -+ -+ ext_ent_free_jent(ext_ent_data->jent_handle); -+ ext_ent_data->jent_handle = NULL; -+ ext_ent_attr_sysfs_exit(&ext_ent_data->ent_sysfs_info); -+ external_entropy_proc_exit(); -+ mutex_destroy(&ext_ent_data->avail_lock); -+ if (ext_ent_data->pool.buf) -+ devm_kfree(ext_ent_device, ext_ent_data->pool.buf); -+ if (ext_ent_data) -+ devm_kfree(ext_ent_device, ext_ent_data); -+ device_destroy(ext_ent_class, MKDEV(major_num, 0)); -+ class_destroy(ext_ent_class); -+ unregister_chrdev(major_num, DEVICE_NAME); -+} -+ -+/* -+ * @brief This function updates the wait_info object with the current -+ * number of bytes limited by max pool size required from the -+ * pool. -+ * @param wait_info: pointer to wait_info data. -+ * pool_size: max pool size of the allocated pool -+ * len: Number of bytes read from the pool. -+ * @return void. -+ */ -+static void update_pre_wait_info(struct ext_ent_wait_info_t *info, -+ size_t pool_size, size_t len) -+{ -+ if (info->remaining_req <= pool_size) -+ info->curr_req = info->remaining_req; -+ else -+ info->curr_req = pool_size; -+ -+ entropy_debug("In %s, curr_req = %ld, remainig = %ld\n", __func__, -+ info->curr_req, info->remaining_req); -+} -+ -+/* -+ * @brief This function updates the wait_info data object with the -+ * number of bytes read from the pool and updates the remaining -+ * bytes required to complete the read operation. -+ * @param wait_info: pointer to wait_info data. -+ * len: Number of bytes read from the pool. -+ * @return void. -+ */ -+static void update_post_wait_info(struct ext_ent_wait_info_t *info, size_t len) -+{ -+ info->read_len += len; -+ info->remaining_req = info->total_req - info->read_len; -+ entropy_debug("In %s, read_len = %ld, remaining = %ld\n", __func__, -+ info->read_len, info->remaining_req); -+} -+ -+/* -+ * @brief When the read() operation is in progress and dev_read, -+ * was waiting for the extract worker to fill the pool, this -+ * function will calculate whether the pool has been by worker, -+ * & if bytes are ready, it will wakeup the wait event of read(). -+ * @param data: work structure which has been queued by -+ * ext_ent_get_external_read_bytes. -+ * @return void. -+ */ -+static void calc_blocked_duration(struct work_struct *work) -+{ -+ struct ext_ent_t *ent_data; -+ struct ext_ent_wait_info_t *winfo = container_of(work, -+ struct ext_ent_wait_info_t, comp_work); -+ u64 timeout; -+ -+ get_external_entropy_handle(&ent_data); -+ timeout = msecs_to_jiffies(get_replenish_time(ent_data, -+ ent_data->hypcall_rd_siz)); -+ winfo->complete = false; -+ while (ent_data->thread_op != EXT_ENT_THREAD_ERROR) { -+ if (atomic_read(&winfo->wait)) { -+ if (atomic_read(&ent_data->collec_state) -+ == EXT_ENT_FULL) { -+ winfo->complete = true; -+ break; -+ } else if (get_avail_bytes(ent_data) >= -+ winfo->curr_req) { -+ winfo->complete = true; -+ break; -+ } else if (winfo->remaining_req <= 0) { -+ winfo->complete = true; -+ break; -+ } -+ } -+ if (ent_data->mode == EXT_ENT_REPLENISH) -+ schedule_timeout(timeout); -+ } -+ atomic_set(&winfo->wait, false); -+ if (winfo->complete) -+ wake_up_interruptible(&winfo->blk_q); -+} -+ -+/* -+ * @brief Once, the wakeup of extract worker thread has been invoked, -+ * it takes few miliseconds for the thread to be scheduled -+ * & moved into running state. This function will wait till -+ * event FILLING or FULL becomes true. -+ * @param data: external entropy information object. -+ * wrk_state: state of the event that needs to be verified, -+ * passed by func ext_ent_get_external_read_bytes. -+ * @return 0 if the even became true & -ERESTARTSYS timeout occurred. -+ */ -+static int wait_for_worker_state_change(struct ext_ent_t *data) -+{ -+ int ret = 0; -+ -+ if (atomic_read(&data->thread_state) == FULL && -+ get_avail_bytes(data) >= data->pool_size) -+ return ret; -+ -+ ret = wait_event_interruptible_timeout(thrd_state_change, -+ atomic_read(&data->thread_state) == FILLING, -+ msecs_to_jiffies(10)); -+ return ret <= 0 ? -ETIMEDOUT : 0; -+} -+ -+/* -+ * @brief Fetches data from EXTERNAL Entropy's circular buffer into -+ * buffer handle. -+ * @param data: external entropy information object. -+ * readbuf: read buffer to fetch from pool. This buffer is -+ * passed by dev_read. -+ * wait_info: pointer to wait_info data structure -+ * total: to hold length of the random bytes copied. -+ * @return number of copied bytes on success, Error code on failure. -+ */ -+static int read_from_entropy_pool(struct ext_ent_t *ext_ent_data, -+ u8 *read_buf, struct ext_ent_wait_info_t *wait_info, -+ ssize_t *total) -+{ -+ int ret; -+ -+ read_lock(&ext_ent_data->sync_rw); -+ ret = entropy_get_bytes(ext_ent_data, -+ read_buf + wait_info->read_len, -+ wait_info->curr_req, total); -+ if (*total < 0) { -+ entropy_err("Fail to copy ext_ent data %zd\n", *total); -+ ext_ent_data->err_status = EXT_HYPERCALL_ERR; -+ read_unlock(&ext_ent_data->sync_rw); -+ return -EFAULT; -+ } -+ read_unlock(&ext_ent_data->sync_rw); -+ -+ return ret; -+} -+ -+/* -+ * @brief Fetches data from EXTERNAL Entropy's circular buffer into -+ * buffer handle. -+ * @param data: external entropy information object. -+ * readbuf: read buffer to fetch from RD RND. This buffer is -+ * passed by dev_read. -+ * len: length of the random bytes that needs to be copied. -+ * @return number of copied bytes on success, Error code on failure. -+ */ -+static ssize_t ext_ent_get_external_read_bytes(struct ext_ent_t *ext_ent_data, -+ struct ext_ent_wait_info_t *wait_info, -+ u8 *read_buf, size_t len) -+{ -+ size_t avl_cnt; -+ ssize_t total = 0; -+ int ret = -EINVAL; -+ -+ entropy_debug("ext ent read,avl_cnt = %d, len = %zu\n", -+ get_avail_bytes(ext_ent_data), len); -+ wait_info->total_req = len; -+ wait_info->remaining_req = wait_info->total_req; -+ while (wait_info->remaining_req > 0) { -+ -+ avl_cnt = get_avail_bytes(ext_ent_data); -+ if (unlikely(avl_cnt < 0)) -+ return avl_cnt; -+ /* -+ * If pool doesn't have sufficent requested bytes available, -+ * wait till requested len is pooled or return err based upon -+ * user configuration. -+ */ -+ get_no_avail_config(&ext_ent_data->no_avail); -+ if (ext_ent_data->no_avail == EXT_ENT_RETURN_AVAIL) { -+ if (!avl_cnt) { -+ entropy_debug("Insufficient & RET_ERROR set\n"); -+ return -EAGAIN; -+ } else { -+ /* Set curr_req = avl for No Wait */ -+ wait_info->curr_req = avl_cnt; -+ ret = read_from_entropy_pool(ext_ent_data, -+ read_buf, -+ wait_info, &total); -+ atomic_set(&ext_ent_data->collec_state, -+ EXT_ENT_SEEDING); -+ wake_up_process(ext_ent_data->extract_work); -+ entropy_debug("Returning with avl %d\n", ret); -+ return wait_info->read_len + ret; -+ } -+ } -+ /* -+ * When avl_cnt is zero or state is changing from FULL to -+ * SEEDING,extract work thread should be scheduled. -+ * It might take few mili-secs & hence we need to wait. -+ */ -+ ret = wait_for_worker_state_change(ext_ent_data); -+ if (ret) { -+ entropy_err("Seeding not in progress or FULL %d %d\n", -+ atomic_read(&ext_ent_data->thread_state), -+ ext_ent_data->thread_op); -+ return -EAGAIN; -+ } -+ update_pre_wait_info(wait_info, ext_ent_data->pool_size, avl_cnt); -+ atomic_cmpxchg(&wait_info->wait, false, true); -+ queue_work(system_unbound_wq, &wait_info->comp_work); -+ ret = wait_event_interruptible_timeout(wait_info->blk_q, -+ wait_info->complete == true, -+ msecs_to_jiffies(ext_ent_data->burst_bits * -+ ext_ent_data->ms_per_bit * BITS_PER_BYTE)); -+ if (ret <= 0) { -+ entropy_err("err wait for complete %d\n", ret); -+ return ret; -+ } -+ ret = read_from_entropy_pool(ext_ent_data, read_buf, -+ wait_info, &total); -+ update_post_wait_info(wait_info, ret); -+ flush_work(&wait_info->comp_work); -+ -+ ext_ent_data->err_status = ALL_OK; -+ atomic_set(&ext_ent_data->collec_state, EXT_ENT_SEEDING); -+ wake_up_process(ext_ent_data->extract_work); -+ } -+ -+ return wait_info->read_len; -+} -+ -+/** -+ * @brief Fetches data from RD RND into buffer handle. -+ * @param data: external entropy information object. -+ * readbuf: tentative read buffer to fetch from RD RND. -+ * buf: read operation's buffer handle. -+ * len: length of the random bytes that needs to be copied. -+ * @return number of copied bytes on success, Error code on failure. -+ */ -+static int entropy_get_rdrnd(struct ext_ent_t *data, u8 *read_buf, size_t len) -+{ -+ size_t avl_cnt; -+ -+ if (rng_is_initialized()) { -+ avl_cnt = min_t(size_t, data->pool_size, len); -+ get_random_bytes(read_buf, avl_cnt); -+ } else { -+ entropy_err("RD_RND not yet ready. return err\n"); -+ data->err_status = ERROR; -+ return -ERESTARTSYS; -+ } -+ return avl_cnt; -+} -+ -+static int ext_ent_get_jent_read_bytes(struct crypto_rng *jent_handle, -+ u8 *buf, int len) -+{ -+ int ret = 0; -+ -+ entropy_debug("In sysfs jent_read_bytes %d\n", len); -+ if (!jent_handle) { -+ entropy_err("Jitter entropy RNG handle is NULL\n"); -+ return -ENOENT; -+ } -+ ret = crypto_rng_get_bytes(jent_handle, buf, len); -+ if (ret < 0) { -+ entropy_err("Failed to read from Jitter entropy RNG\n"); -+ return -EAGAIN; -+ } -+ return len; -+} -+ -+static void ext_ent_free_jent(struct crypto_rng *jent_handle) -+{ -+ if (jent_handle) -+ crypto_free_rng(jent_handle); -+} -+ -+module_init(ext_ent_init); -+module_exit(ext_ent_exit); -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("VMware Photon OS : Srinidhi Rao"); -diff --git a/drivers/char/hw_random/external_entropy/external_entropy.h b/drivers/char/hw_random/external_entropy/external_entropy.h -new file mode 100644 -index 000000000..ca7604523 ---- /dev/null -+++ b/drivers/char/hw_random/external_entropy/external_entropy.h -@@ -0,0 +1,211 @@ -+/* SPDX-License-Identifier: GPL v2.0 -+ * -+ * Copyright 2023 VMware, Inc. All Rights Reserved. -+ * -+ * Licensed under the GNU Lesser General Public License version 2 -+ * (the "License"); -+ * you may not use this file except in compliance with the License. The terms -+ * of the License are located in the LICENSE file of this distribution. -+ */ -+ -+#ifndef EXTERNAL_ENTROPY -+#define EXTERNAL_ENTROPY -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+ -+#define DEFAULT_TOTAL_BURST_BITS 8192 -+#define DEFAULT_MS_PER_BIT 100 -+ -+#define DEF_HYPCALL_RD_SIZE sizeof(u32) -+ -+#define DEBUG_PRINT -+#ifdef DEBUG_PRINT -+#define entropy_debug(fmt, args...) do { \ -+ pr_debug("[ext_ent][%s:]" fmt, __func__, ##args); \ -+} while (0); -+#else -+#define entropy_debug(fmt, args...) -+#endif -+#define entropy_info(fmt, args...) do { \ -+ pr_info("[ext_ent][%s:]" fmt, __func__, ##args); \ -+} while (0); -+#define entropy_err(fmt, args...) do { \ -+ pr_err("[ext_ent][%s:]" fmt, __func__, ##args); \ -+} while (0); -+#define entropy_donotprint(fmt, args...) -+ -+static DECLARE_WAIT_QUEUE_HEAD(thrd_state_change); -+ -+struct ent_sysfs_info_t { -+ struct device *dev; -+ struct miscdevice ent_misc; -+}; -+ -+enum no_avail_def { -+ EXT_ENT_BLOCKING = 0, -+ EXT_ENT_RETURN_AVAIL, -+}; -+ -+enum entropy_src_t { -+ EXTERNAL = 0, -+ JENT, -+ RD_RND, -+ RANDOM, -+}; -+ -+enum entropy_err_status_t { -+ ALL_OK = 0, -+ ERROR, -+ EXT_HYPERCALL_ERR, -+}; -+ -+enum entropy_status_t { -+ FILLING = 0, -+ FULL, -+ UNKNOWN, -+}; -+ -+enum ext_ent_collector_state { -+ EXT_ENT_SEEDING, /* Maps it to FILLING of pool buf */ -+ EXT_ENT_FULL, -+}; -+ -+enum ext_ent_thread_state { -+ EXT_ENT_INTERRUPTIBLE = 0, /* FOR FULL, READY */ -+ EXT_ENT_RUNNING, /* FOR INIT, EMPTY, RESEED & SEEDING */ -+ EXT_ENT_THREAD_ERROR, -+}; -+ -+enum ext_ent_collector_mode { -+ EXT_ENT_BURST = 0, -+ EXT_ENT_REPLENISH, -+ EXT_ENT_MODE_ERROR, -+}; -+ -+struct ext_ent_wait_info_t { -+ atomic_t wait; -+ ssize_t total_req; -+ ssize_t remaining_req; -+ ssize_t curr_req; -+ ssize_t read_len; -+ struct work_struct comp_work; /* Initialize this in dev_open */ -+ wait_queue_head_t blk_q; -+ bool complete; -+}; -+ -+struct ext_ent_t { -+ /* Total burst bits and mili secs per bit in replenish mode */ -+ unsigned short burst_bits; -+ unsigned short ms_per_bit; -+ -+ int pool_size; /* Total num of random bytes to be stored */ -+ struct circ_buf pool; -+ /* maximum bytes that can be read per 1 hypercall*/ -+ int hypcall_rd_siz; -+ -+ /* kthread */ -+ struct task_struct *extract_work; -+ /* kthread scheduler*/ -+ struct sched_param sch; -+ /* Synchronization mutex for get_avail */ -+ struct mutex avail_lock; -+ rwlock_t sync_rw; -+ -+ ktime_t prev_ts; -+ ktime_t new_ts; -+ int prev_ret_val; -+ /* Reserved for future use to calculate variable timeout -+ * in an exponential manner -+ */ -+ int retry_count; -+ -+ /* sysfs control */ -+ struct ent_sysfs_info_t ent_sysfs_info; -+ -+ enum no_avail_def no_avail; -+ bool fallback_state; -+ enum entropy_src_t ent_src; -+ /* To handle the Fallback option */ -+ enum entropy_src_t fb_src; -+ struct crypto_rng *jent_handle; -+ -+ enum entropy_err_status_t err_status; -+ /* Thread state */ -+ atomic_t thread_state; -+ enum ext_ent_thread_state thread_op; -+ atomic_t collec_state; -+ -+ enum ext_ent_collector_mode mode; -+ /* buffer (length=32bits) used to collect data from hypercall*/ -+ u8 buf[DEF_HYPCALL_RD_SIZE]; -+}; -+ -+int get_external_entropy_handle(struct ext_ent_t **data); -+int rng_read_hypercall(struct ext_ent_t *data, u8 *buf, size_t max_bytes, -+ bool wait); -+ -+static inline void pool_read_update(struct ext_ent_t *data, int bytes) -+{ -+ int idx = 0; -+ -+ idx += data->pool.tail+bytes; -+ idx &= (data->pool_size - 1); -+ data->pool.tail = idx; -+} -+static inline void pool_write_update(struct ext_ent_t *data, int bytes) -+{ -+ int idx = 0; -+ -+ idx += data->pool.head+bytes; -+ idx &= (data->pool_size - 1); -+ data->pool.head = idx; -+} -+static inline size_t pool_space(struct ext_ent_t *data) -+{ -+ return CIRC_SPACE(data->pool.head, -+ data->pool.tail, data->pool_size); -+} -+static inline size_t pool_cnt_to_end(struct ext_ent_t *data) -+{ -+ return CIRC_CNT_TO_END(data->pool.head, -+ data->pool.tail, data->pool_size); -+} -+static inline size_t pool_space_to_end(struct ext_ent_t *data) -+{ -+ return CIRC_SPACE_TO_END(data->pool.head, -+ data->pool.tail, data->pool_size); -+} -+static inline size_t pool_cnt(struct ext_ent_t *data) -+{ -+ return CIRC_CNT(data->pool.head, -+ data->pool.tail, data->pool_size); -+} -+ -+#endif -diff --git a/drivers/char/hw_random/external_entropy/external_entropy_threaded_work.c b/drivers/char/hw_random/external_entropy/external_entropy_threaded_work.c -new file mode 100644 -index 000000000..d5bbe0c92 ---- /dev/null -+++ b/drivers/char/hw_random/external_entropy/external_entropy_threaded_work.c -@@ -0,0 +1,443 @@ -+// SPDX-License-Identifier: GPL v2.0 -+/* -+ * Copyright 2023 VMware, Inc. All Rights Reserved. -+ * -+ * Licensed under the GNU Lesser General Public License version 2 -+ * (the "License"); -+ * you may not use this file except in compliance with the License. The terms -+ * of the License are located in the LICENSE file of this distribution. -+ */ -+ -+#include "external_entropy.h" -+#include "external_entropy_threaded_work.h" -+#include "external_ent_config_params.h" -+ -+/* -+ * External Entropy replenishes at a reate of 10bits/sec. Hence, -+ * Total Time to replenish pool size of 8192bits = (8192)/10 = 820s. -+ * Time taken to replenish 4bytes = (4 * 8 * ms_per_bit) = 3200ms -+ * The IO operation to fetch 4 bytes from hypercall needs 10ms -+ * delay. -+ */ -+#define HYPERCALL_IO_DELAY 10 -+ -+static int -+hypercall_timing_update(struct ext_ent_t *ent_data, int ret_code); -+ -+/** -+ * @brief Gets total recovery time for external entropy to move back to -+ * BURST mode. -+ * @param data: external entropy information object. -+ * @return time required. -+ */ -+static int get_total_replenish_time(struct ext_ent_t *ent_data) -+{ -+ int total; -+ -+ total = ((ent_data->burst_bits * ent_data->ms_per_bit) / -+ MSEC_PER_SEC); -+ -+ return total; -+} -+ -+/** -+ * @brief Gets time required to read 'n' bytes in REPLENISH mode. -+ * @param data: external entropy information object. -+ * @return time required. -+ */ -+int get_replenish_time(struct ext_ent_t *ent_data, int len) -+{ -+ int replenish; -+ -+ replenish = (len * BITS_PER_BYTE * ent_data->ms_per_bit); -+ /* Add a cusion of 2 bits to allow the recovery of external entropy */ -+ replenish += (2 * ent_data->ms_per_bit); -+ -+ return replenish; -+} -+ -+/** -+ * @brief Gets total available random bytes stored in pool. -+ * @param data: external entropy information object. -+ * @return number of available bytes for read. -+ */ -+int get_avail_bytes(struct ext_ent_t *data) -+{ -+ int num_avail = 0; -+ -+ if (unlikely(mutex_lock_interruptible(&data->avail_lock))) -+ return -EINTR; -+ num_avail = pool_cnt(data); -+ mutex_unlock(&data->avail_lock); -+ /* -+ * pool_cnt returns value from 0 to n-1 for a pool of n size. -+ * Hence need to adjust by 1 byte. -+ */ -+ return num_avail + 1; /*Adjust for the pool size count*/ -+} -+ -+/** -+ * @brief Copies random data from pool to read buffer. -+ * @param data: external entropy information object. -+ * buf: read buffer handle -+ * len: length of the random bytes that needs to be copied. -+ * @return number of copied bytes. -+ */ -+static size_t entropy_get_bytes_from_buf(struct ext_ent_t *data, void *buf, -+ size_t len) -+{ -+ int ret = 0; -+ size_t copied, cnt, size, left, indx; -+ u8 *pool = (u8 *)data->pool.buf; -+ -+ cnt = pool_cnt_to_end(data); -+ size = min_t(size_t, cnt, len); -+ -+ memcpy(buf, &pool[data->pool.tail], size*sizeof(u8)); -+ copied = size; -+ pool_read_update(data, size); -+ /*copy rest of the data into buf*/ -+ left = len - copied; -+ -+ if (left > 1 && pool_cnt(data)) { -+ cnt = pool_cnt(data); -+ size = min_t(size_t, cnt, left); -+ indx = pool_cnt_to_end(data); -+ memcpy(buf+copied, &pool[data->pool.tail], size*sizeof(u8)); -+ copied += size; -+ pool_read_update(data, size); -+ } -+ -+ ret = copied; -+ return ret; -+} -+ -+/** -+ * @brief Fetches data stored in pool into read buffer handle. -+ * @param data: external entropy information object. -+ * buf: read buffer handle -+ * len: length of the random bytes that needs to be copied. -+ * @return number of copied bytes -+ */ -+int entropy_get_bytes(struct ext_ent_t *data, void *buf, size_t len, -+ ssize_t *total) -+{ -+ size_t num_copied = 0; -+ u8 *buffer_cp = (u8 *)buf; -+ -+ if (!pool_cnt(data)) -+ goto get_pool_exit; -+ -+ num_copied = entropy_get_bytes_from_buf(data, -+ buffer_cp, len); -+get_pool_exit: -+ return num_copied; -+} -+ -+/** -+ * @brief Copies random data from write buffer to pool. -+ * @param data: external entropy information object. -+ * buf: write buffer handle -+ * len: length of the random bytes that needs to be written. -+ * @return number of written bytes. -+ */ -+static size_t entropy_set_bytes_to_buf(struct ext_ent_t *data, void *buf, -+ size_t len) -+{ -+ int ret = 0; -+ size_t copied, cnt, size, left, indx; -+ u8 *pool = (u8 *)data->pool.buf; -+ -+ cnt = pool_space_to_end(data); -+ size = min_t(size_t, cnt, len); -+ -+ memcpy(&pool[data->pool.head], buf, size*sizeof(u8)); -+ copied = size; -+ pool_write_update(data, size); -+ /*copy rest of the data into buf*/ -+ left = len - size; -+ -+ if (left > 1 && pool_space(data)) { -+ cnt = pool_space(data); -+ size = min_t(size_t, cnt, left); -+ indx = pool_space_to_end(data); -+ memcpy(&pool[data->pool.head], buf+copied, size*sizeof(u8)); -+ copied += size; -+ pool_write_update(data, size); -+ } -+ -+ ret = copied; -+ return ret; -+} -+ -+/** -+ * @brief Copies random data from write buffer handle to pool. -+ * @param data: external entropy information object. -+ * buf: write buffer handle -+ * len: length of the random bytes that needs to be stored. -+ * @return number of stored bytes -+ */ -+static size_t entropy_set_bytes(struct ext_ent_t *data, void *buf, size_t len) -+{ -+ u8 *buffer_cp = (u8 *)buf; -+ size_t num_copied = 0; -+ -+ if (pool_space(data)) { -+ num_copied = entropy_set_bytes_to_buf(data, -+ buffer_cp, len); -+ } -+ return num_copied; -+} -+ -+/** -+ * @brief Updates whether the pool is FULL or still needs seeding. -+ * @param ent_data: external entropy data information object. -+ * @return 0 on success, negetive error code on failure. -+ */ -+static int update_status(struct ext_ent_t *ent_data) -+{ -+ int ret = 0; -+ size_t avl_cnt; -+ enum ext_ent_collector_state coll_st; -+ -+ coll_st = atomic_read(&ent_data->collec_state); -+ avl_cnt = get_avail_bytes(ent_data); -+ if (avl_cnt >= ent_data->pool_size) { -+ /* Call print_avail_bytes(ent_data) to debug */ -+ entropy_debug("Setting collector state to FULL\n"); -+ atomic_set(&ent_data->collec_state, EXT_ENT_FULL); -+ } -+ if (ent_data->mode != EXT_ENT_MODE_ERROR) { -+ /* -+ * Reset the fallback state to EXTERNAL if it was using -+ * any other source upon encountering any error. -+ */ -+ get_fallback_auto_switch_config(&ent_data->fb_src); -+ if (ent_data->fallback_state == true && -+ ent_data->fb_src != EXTERNAL) { -+ ent_data->ent_src = EXTERNAL; -+ ent_data->fallback_state = false; -+ } -+ } -+ return ret; -+} -+/** -+ * @brief Updates thread state and scheduling related info -+ * @param ent_data: external entropy data information object. -+ * @return 0 on success, negetive error code on failure. -+ */ -+static int update_op_info(struct ext_ent_t *ent_data) -+{ -+ int ret = 0; -+ enum ext_ent_collector_state coll_st; -+ -+ coll_st = atomic_read(&ent_data->collec_state); -+ switch (coll_st) { -+ -+ case EXT_ENT_SEEDING: -+ atomic_set(&ent_data->thread_state, FILLING); -+ ent_data->thread_op = EXT_ENT_RUNNING; -+ sched_set_fifo_low(ent_data->extract_work); -+ break; -+ -+ case EXT_ENT_FULL: -+ sched_set_normal(ent_data->extract_work, 0); -+ set_current_state(TASK_INTERRUPTIBLE); -+ ent_data->thread_op = EXT_ENT_INTERRUPTIBLE; -+ atomic_set(&ent_data->thread_state, FULL); -+ break; -+ -+ default: -+ sched_set_normal(ent_data->extract_work, 0); -+ set_current_state(TASK_INTERRUPTIBLE); -+ ent_data->thread_op = EXT_ENT_THREAD_ERROR; -+ atomic_set(&ent_data->thread_state, UNKNOWN); -+ break; -+ } -+ return ret; -+} -+/** -+ * @brief Collects entropy data by reading from external entropy hypercall. -+ * @param ent_data: external entropy data information object. -+ * @return 0 on success, negetive error code on failure. -+ */ -+static int entropy_collector_func(struct ext_ent_t *ent_data) -+{ -+ /* -+ * This function will be scheduled by work queue -+ * It reads u32 bytes and adds it to the buffer. -+ */ -+ -+ int ret = -EINVAL; -+ -+ /* Hold the synchronization spin lock */ -+ if (!write_trylock(&ent_data->sync_rw)) { -+ entropy_debug("writer lock is busy in collector"); -+ ret = -EAGAIN; -+ return ret; -+ } -+ memzero_explicit(ent_data->buf, ent_data->hypcall_rd_siz); -+ ret = rng_read_hypercall(ent_data, ent_data->buf, sizeof(u8), true); -+ hypercall_timing_update(ent_data, ret); -+ if (ret) { -+ memzero_explicit(ent_data->buf, ent_data->hypcall_rd_siz); -+ write_unlock(&ent_data->sync_rw); -+ return ret; -+ } -+ /* Add it to the buffer pool */ -+ entropy_set_bytes(ent_data, ent_data->buf, ent_data->hypcall_rd_siz); -+ /* Wait for Hypercall timeout */ -+ mdelay(HYPERCALL_IO_DELAY); -+ /*release the lock */ -+ write_unlock(&ent_data->sync_rw); -+ return ret; -+} -+ -+/** -+ * @brief Updates time stamps based on return value of rng_read. -+ * @param ent_data: external entropy data information object. -+ * @return 0 on success, negetive error code on failure. -+ */ -+static int -+hypercall_timing_calc(struct ext_ent_t *ent_data, u64 *timeout) -+{ -+ /* -+ * based on the timestamps and status code, calculate the timeout -+ * required to wait for the next hypercall. -+ */ -+ int ret = 0; -+ u64 new_ts, delta; -+ -+ new_ts = ktime_get_boottime(); -+ delta = ktime_ms_delta(new_ts, ent_data->prev_ts); -+ -+ if (delta > get_total_replenish_time(ent_data)) -+ *timeout = 0; -+ else if (delta < get_total_replenish_time(ent_data)) { -+ -+ switch (ent_data->mode) { -+ -+ case EXT_ENT_BURST: -+ *timeout = 0; -+ break; -+ -+ case EXT_ENT_REPLENISH: -+ *timeout = -+ msecs_to_jiffies(get_replenish_time(ent_data, -+ ent_data->hypcall_rd_siz)); -+ break; -+ -+ case EXT_ENT_MODE_ERROR: -+ entropy_err(" Unknown Hypercall err\n"); -+ *timeout = -+ msecs_to_jiffies(get_total_replenish_time(ent_data) * -+ MSEC_PER_SEC); -+ ret = -EIO; -+ break; -+ -+ } -+ } -+ ent_data->prev_ts = new_ts; -+ return ret; -+} -+ -+/** -+ * @brief Updates time stamps based on return value of rng_read. -+ * @param ent_data: external entropy data information object. -+ * @st_code : status code of the previous rng_read_hypercall. -+ * @ret_code : return value of the previous rng_read_hypercall. -+ * @return 0 on success, negetive error code on failure. -+ */ -+static int -+hypercall_timing_update(struct ext_ent_t *ent_data, int ret_code) -+{ -+ /* -+ * Read the ktime_boot_get and store it in prev_ts timestamp. -+ * clear new_ts timestamp. -+ * based on the status code and return code, adjust mode based -+ * on ret_code -+ */ -+ int ret = 0; -+ -+ ent_data->prev_ret_val = ret_code; -+ -+ ent_data->new_ts = ktime_get_boottime(); -+ -+ if (!ret_code) -+ ent_data->mode = EXT_ENT_BURST; -+ else if (ret_code == -EAGAIN) -+ ent_data->mode = EXT_ENT_REPLENISH; -+ else if (ret_code == -EIO) { -+ ent_data->mode = EXT_ENT_MODE_ERROR; -+ get_fallback_auto_switch_config(&ent_data->fb_src); -+ if (ent_data->fb_src != EXTERNAL) { -+ ent_data->fallback_state = true; -+ ent_data->ent_src = ent_data->fb_src; -+ } -+ } else { -+ entropy_err("Unknown error mode %d\n", ret_code); -+ ent_data->mode = EXT_ENT_MODE_ERROR; -+ WARN(1, "External Entropy Collector in Undefined Mode"); -+ } -+ -+ return ret; -+} -+ -+/** -+ * @brief Worker thread function to trigger entropy collector. -+ * This worked thread, waits for the wake_up signal either -+ * during module initialization or after a dev read() call -+ * and reads from EXTERNAL ENTROPY through entropy_collector function & adds -+ * it to the entropy pool. -+ * This kthread initialy will have a normal priority. However, when the pool -+ * needs to be refilled, this thread will set the scheduler fifo to low i.e, -+ * HIGH PRIORITY till the bytes are added & set the kthread back to normal -+ * priority once pool has been added. -+ * -+ * @param data: external entropy information object. -+ * @return 0 on success, error code on failure. -+ */ -+int entropy_work(void *data) -+{ -+ struct ext_ent_t *ent_data = (struct ext_ent_t *)data; -+ int ret = 0; -+ u64 timeout; -+ -+ allow_signal(SIGKILL); -+ while (!kthread_should_stop()) { -+ if (signal_pending(ent_data->extract_work)) -+ break; -+ -+ switch (atomic_read(&ent_data->collec_state)) { -+ -+ case EXT_ENT_FULL: -+ /* Pool is full, unblock and send notifications */ -+ update_op_info(ent_data); -+ schedule(); -+ break; -+ -+ case EXT_ENT_SEEDING: -+ /* Read u32 and save in the pool */ -+ update_op_info(ent_data); -+ ret = entropy_collector_func(ent_data); -+ sched_set_normal(ent_data->extract_work, 0); -+ update_status(ent_data); -+ -+ /* Put it into seeding mode */ -+ hypercall_timing_calc(ent_data, &timeout); -+ wake_up_interruptible(&thrd_state_change); -+ set_current_state(TASK_INTERRUPTIBLE); -+ schedule_timeout(timeout); -+ break; -+ -+ default: -+ entropy_err("Undefined collector state %d\n", -+ atomic_read(&ent_data->collec_state)); -+ ent_data->thread_op = EXT_ENT_THREAD_ERROR; -+ schedule(); -+ break; -+ } -+ } -+ kthread_complete_and_exit(NULL, 0); -+ return ret; -+} -diff --git a/drivers/char/hw_random/external_entropy/external_entropy_threaded_work.h b/drivers/char/hw_random/external_entropy/external_entropy_threaded_work.h -new file mode 100644 -index 000000000..1b84f2387 ---- /dev/null -+++ b/drivers/char/hw_random/external_entropy/external_entropy_threaded_work.h -@@ -0,0 +1,22 @@ -+/* SPDX-License-Identifier: GPL v2.0 -+ * -+ * Copyright 2023 VMware, Inc. All Rights Reserved. -+ * -+ * Licensed under the GNU Lesser General Public License version 2 -+ * (the "License"); -+ * you may not use this file except in compliance with the License. The terms -+ * of the License are located in the LICENSE file of this distribution. -+ */ -+ -+#ifndef EXTERNAL_ENTROPY_THREADED_WORK_H -+#define EXTERNAL_ENTROPY_THREADED_WORK_H -+ -+/* Function Prototype Forward declaration */ -+int entropy_work(void *data); -+int get_avail_bytes(struct ext_ent_t *data); -+int get_filled(struct ext_ent_t *data); -+int entropy_get_bytes(struct ext_ent_t *data, void *buf, size_t len, -+ ssize_t *total); -+int get_replenish_time(struct ext_ent_t *ent_data, int len); -+ -+#endif --- -2.39.4 - diff --git a/SPECS/91/linux/esx/0001-fs-A-new-VTARFS-file-system-to-mount-VTAR-archive.patch b/SPECS/91/linux/esx/0001-fs-A-new-VTARFS-file-system-to-mount-VTAR-archive.patch deleted file mode 100644 index 83bcf186a6..0000000000 --- a/SPECS/91/linux/esx/0001-fs-A-new-VTARFS-file-system-to-mount-VTAR-archive.patch +++ /dev/null @@ -1,1557 +0,0 @@ -From 2e319f74f185adbaf048ff09b6872929f8082dbe Mon Sep 17 00:00:00 2001 -From: srinidhira0 -Date: Wed, 13 Nov 2024 11:29:35 +0000 -Subject: [PATCH] fs: A new VTARFS file system to mount VTAR archive - -- GNU TAR Archieve consists of header with information of the -files and directories. This GNU TAR format can be extended to VTAR -format by ensuring that each file content data starts from a -PAGE ALIGNED address. This start address of the file can be stored -in a field in the header itself which will help to navigate to the -file content. - -- Such an archive image (VTAR) when stored in RAMFS can be easily -mounted instead of extraction using VTARFS. -- VTARFS only creates and maintains metadata, inodes and dentries -of files & directries. For a file, the entry for that particular -file will point to the start address offset of the VTAR archive -image whenever the file is read or executed. -- Unlike VTAR Extractor which creates files and directory using -syscalls, In VTARFS, inodes and dentries are created and maintained. -Also, file operations like read_iter, mmap and others are defined -and implemented. - -- Mounting operation is very quick and avoids additional memory -allocation for file content data. - -Signed-off-by: srinidhira0 -Signed-off-by: Ankit Jain -Signed-off-by: Bo Gan ---- - fs/Kconfig | 1 + - fs/Makefile | 1 + - fs/vtarfs/Kconfig | 21 + - fs/vtarfs/Makefile | 9 + - fs/vtarfs/README.md | 3 + - fs/vtarfs/vtarfs.h | 171 +++++++ - fs/vtarfs/vtarfs_file_dir_ops.c | 472 +++++++++++++++++++ - fs/vtarfs/vtarfs_inode.c | 773 ++++++++++++++++++++++++++++++++ - 8 files changed, 1451 insertions(+) - create mode 100644 fs/vtarfs/Kconfig - create mode 100644 fs/vtarfs/Makefile - create mode 100644 fs/vtarfs/README.md - create mode 100644 fs/vtarfs/vtarfs.h - create mode 100644 fs/vtarfs/vtarfs_file_dir_ops.c - create mode 100644 fs/vtarfs/vtarfs_inode.c - -diff --git a/fs/Kconfig b/fs/Kconfig -index 570f8f00c..4dadee4bf 100644 ---- a/fs/Kconfig -+++ b/fs/Kconfig -@@ -342,6 +342,7 @@ source "fs/ufs/Kconfig" - source "fs/erofs/Kconfig" - source "fs/vboxsf/Kconfig" - source "fs/vtar/Kconfig" -+source "fs/vtarfs/Kconfig" - - endif # MISC_FILESYSTEMS - -diff --git a/fs/Makefile b/fs/Makefile -index a0f4c8544..032d95a78 100644 ---- a/fs/Makefile -+++ b/fs/Makefile -@@ -130,4 +130,5 @@ obj-$(CONFIG_EROFS_FS) += erofs/ - obj-$(CONFIG_VBOXSF_FS) += vboxsf/ - obj-$(CONFIG_ZONEFS_FS) += zonefs/ - obj-$(CONFIG_VTAR) += vtar/ -+obj-$(CONFIG_VTARFS) += vtarfs/ - obj-$(CONFIG_BPF_LSM) += bpf_fs_kfuncs.o -diff --git a/fs/vtarfs/Kconfig b/fs/vtarfs/Kconfig -new file mode 100644 -index 000000000..872a3a8df ---- /dev/null -+++ b/fs/vtarfs/Kconfig -@@ -0,0 +1,21 @@ -+config VTARFS -+ tristate "Virtual TARFS file system support" -+ depends on TMPFS -+ help -+ The GNU TAR archive format can be modified into Virtual TAR archive -+ format by ensuring that each file starts from a PAGE ALIGNED address. -+ This start address of each file is stored as an offset in the VTAR -+ Header itself which helps to navigate to the start of file content. -+ VTARFS will mount such an archive and extracting such archive will -+ no longer be necessary. The files will appear virtually in the mounted -+ directory path. The actual file inode mapping will point to the file -+ offset of the VTAR archive image. -+ -+ This file system will mount the VTAR archive as READ ONLY. -+ -+ Usually container base images are stored as VTAR archive. -+ -+ Say Y or M if you want to read files from VTAR archive image. -+ -+ To compile this file system support as a module, choose M here: the -+ module will be called vtarfs. If unsure, say N. -diff --git a/fs/vtarfs/Makefile b/fs/vtarfs/Makefile -new file mode 100644 -index 000000000..988edc7d7 ---- /dev/null -+++ b/fs/vtarfs/Makefile -@@ -0,0 +1,9 @@ -+# -+# Makefile for the vtarfs routines. -+# -+ -+obj-$(CONFIG_VTARFS) += vtarfs.o -+ -+CFLAGS_vtarfs_file_dir_ops.o := -I$(src) -+CFLAGS_vtarfs_inode.o := -I$(src) -+vtarfs-objs := vtarfs_file_dir_ops.o vtarfs_inode.o -diff --git a/fs/vtarfs/README.md b/fs/vtarfs/README.md -new file mode 100644 -index 000000000..fe38b05c5 ---- /dev/null -+++ b/fs/vtarfs/README.md -@@ -0,0 +1,3 @@ -+# vmware_tarfs -+ -+This projects provides a way to mount the vmware format tar ball to a directory -\ No newline at end of file -diff --git a/fs/vtarfs/vtarfs.h b/fs/vtarfs/vtarfs.h -new file mode 100644 -index 000000000..1bcfce0ee ---- /dev/null -+++ b/fs/vtarfs/vtarfs.h -@@ -0,0 +1,171 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+/* -+ * Filesystem to directly mount vtar archive. -+ * -+ * Copyright 2020 VMware, Inc. All Rights Reserved. -+ * -+ * Licensed under the GNU Lesser General Public License version 2 (the "License"); -+ * you may not use this file except in compliance with the License. The terms -+ * of the License are located in the LICENSE file of this distribution. -+ * -+ */ -+ -+#ifndef vtarfs -+#define vtarfs -+ -+#include -+#include -+ -+#define MAX_PAGES_PER_FILE (MAX_LFS_FILESIZE/PAGE_SIZE) -+#define MAX_FILE_NAME_SIZE 100 -+#define DEBUG_PRINT -+#ifdef DEBUG_PRINT -+#define tarfs_debug(fmt, args...) \ -+pr_debug("[%s:]" fmt, __func__, ##args) -+#else -+#define tarfs_debug(fmt, args...) -+#endif -+ -+/* Values used in typeflag field. */ -+#define REGTYPE '0' /* regular file */ -+#define AREGTYPE '\0' /* regular file */ -+#define LNKTYPE '1' /* link */ -+#define SYMTYPE '2' /* reserved */ -+#define CHRTYPE '3' /* character special */ -+#define BLKTYPE '4' /* block special */ -+#define DIRTYPE '5' /* directory */ -+#define FIFOTYPE '6' /* FIFO special */ -+#define TAR_TYPE_SHAREDFILE '7' /* VMWare custom file type for marking shared files */ -+#define TAR_TYPE_GNU_LONGLINK 'K' /* GNU LongLink extension (long link name) */ -+#define TAR_TYPE_GNU_LONGNAME 'L' /* GNU LongLink extension (long file name) */ -+ -+#define vtarfs_MAGIC "visor " /* 8 chars and NULL */ -+#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -+ -+struct vtarfs_img_map_t { -+ struct file *fp; -+ struct address_space *tarfs_img_map; -+ struct inode *inode; -+}; -+ -+struct vtarfs_mount_opts { -+ umode_t mode; -+}; -+ -+struct vtarfs_header_type { /* byte offset */ -+ char name[MAX_FILE_NAME_SIZE]; /* 0 */ -+ char mode[8]; /* 100 */ -+ char uid[8]; /* 108 */ -+ char gid[8]; /* 116 */ -+ char size[12]; /* 124 */ -+ char mtime[12]; /* 136 */ -+ char chksum[8]; /* 148 */ -+ char typeflag; /* 156 */ -+ char linkname[MAX_FILE_NAME_SIZE]; /* 157 */ -+ char magic[6]; /* 257 */ -+ char version[2]; /* 263 */ -+ char uname[32]; /* 265 */ -+ char gname[32]; /* 297 */ -+ char devmajor[8]; /* 329 */ -+ char devminor[8]; /* 337 */ -+ char prefix[151]; /* 345 */ -+ unsigned int offset; /* 496 Offset of the file in the archive */ -+ unsigned int textOffset; /* 500 Offset of the text section in the file */ -+ unsigned int textSize; /* 504 Size of text section */ -+ unsigned int numFixupPgs; /* 508 Number of pages affected by relocation */ -+ /* 512 */ -+}; -+ -+#define VTARFS_HDR_SIZE (sizeof(struct vtarfs_header_type)) -+static_assert(VTARFS_HDR_SIZE == 512); -+ -+struct vtarfs_entry { -+ struct vtarfs_header_type header; -+ char *dir_name; -+ char *base_name; -+ char *link_name; -+ unsigned int offset; -+ unsigned int data_offset; -+ unsigned int num_pages; -+ struct page **pages; -+ size_t data_size; -+ unsigned long inode; -+ struct inode *ptr_inode; -+ umode_t mode; -+ uid_t uid; -+ gid_t gid; -+ struct timespec64 atime; -+ struct timespec64 mtime; -+ struct timespec64 ctime; -+ unsigned int fileoffset; // Offset of the file in the archive -+ unsigned int textOffset; // Offset of the text section in the file -+ unsigned int textSize; // Size of text section -+ unsigned int numFixupPgs; // Number of pages affected by relocation -+ struct vtarfs_entry *next; -+ struct radix_tree_root root_tree; -+ unsigned long radix_root_key; -+}; -+ -+struct vtarfs_fs_info { -+ struct vtarfs_entry *fs_entry; -+ struct vtarfs_img_map_t vtarfs_img_map; -+ struct vtarfs_mount_opts mount_opts; -+ unsigned long root_ino; -+}; -+ -+static inline struct vtarfs_fs_info *VTARFS_SB(struct super_block *sb) -+{ -+ return sb->s_fs_info; -+} -+extern int vtarfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool excl); -+extern int vtarfs_file_release(struct inode *inode, struct file *file); -+extern int vtarfs_getattr(struct mnt_idmap *idmap, const struct path *path, -+ struct kstat *stat, u32 request_mask, unsigned int flags); -+extern int vtarfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode); -+extern int vtarfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev); -+extern int vtarfs_physmem_mmap(struct file *file, struct vm_area_struct *vma); -+extern int vtarfs_read_dir(struct file *file, struct dir_context *ctx); -+extern mode_t vtarfs_entry_mode(struct vtarfs_entry *entry); -+extern ssize_t vtarfs_file_read_iter(struct kiocb *iocb, struct iov_iter *to); -+extern struct dentry *vtarfs_lookup(struct inode *inode, -+ struct dentry *dentry, unsigned int flags); -+extern vm_fault_t vtarfs_fault_handler(struct vm_fault *vmf); -+extern struct vtarfs_entry *vtarfs_find(struct vtarfs_entry *entry, -+ const char *dir_name, const char *base_name); -+ -+static const struct file_operations vtarfs_file_operations = { -+ .llseek = generic_file_llseek, -+ .read_iter = vtarfs_file_read_iter, -+ .mmap = vtarfs_physmem_mmap, -+ .open = generic_file_open, -+ .release = vtarfs_file_release, -+}; -+ -+static const struct inode_operations vtarfs_file_inode_operations = { -+ .getattr = vtarfs_getattr, -+}; -+ -+static const struct inode_operations vtarfs_dir_inode_operations = { -+ .lookup = vtarfs_lookup, -+ .getattr = vtarfs_getattr, -+}; -+ -+static const struct inode_operations vtarfs_symlink_inode_operations = { -+ .get_link = simple_get_link, -+ .getattr = vtarfs_getattr, -+}; -+ -+static const struct file_operations vtarfs_dir_operations = { -+ .open = dcache_dir_open, -+ .release = dcache_dir_close, -+ .llseek = dcache_dir_lseek, -+ .read = generic_read_dir, -+ .iterate_shared = vtarfs_read_dir, -+ .fsync = noop_fsync, -+}; -+ -+static const struct vm_operations_struct vtarfs_ops = { -+ .fault = vtarfs_fault_handler, -+}; -+ -+#endif -diff --git a/fs/vtarfs/vtarfs_file_dir_ops.c b/fs/vtarfs/vtarfs_file_dir_ops.c -new file mode 100644 -index 000000000..191b5b84d ---- /dev/null -+++ b/fs/vtarfs/vtarfs_file_dir_ops.c -@@ -0,0 +1,472 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* -+ * Filesystem to directly mount vtar archive. -+ * -+ * Copyright 2020 VMware, Inc. All Rights Reserved. -+ * -+ * Licensed under the GNU Lesser General Public License version 2 (the "License"); -+ * you may not use this file except in compliance with the License. The terms -+ * of the License are located in the LICENSE file of this distribution. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "vtarfs.h" -+ -+#define WRITE_MASK (0222) -+ -+mode_t tar_type_to_posix(int typeflag) -+{ -+ switch (typeflag) { -+ case REGTYPE: -+ case AREGTYPE: -+ case TAR_TYPE_SHAREDFILE: -+ return S_IFREG; -+ case DIRTYPE: -+ return S_IFDIR; -+ case SYMTYPE: -+ return S_IFLNK; -+ case CHRTYPE: -+ return S_IFCHR; -+ case BLKTYPE: -+ return S_IFBLK; -+ case FIFOTYPE: -+ return S_IFIFO; -+ -+ default: -+ return 0; -+ } -+} -+ -+/** -+ * @brief Returns the POSIX file mode of \a entry. -+ * @param entry the entry to get the file mode from -+ * @return the file mode -+ */ -+mode_t vtarfs_entry_mode(struct vtarfs_entry *entry) -+{ -+ mode_t mode = entry->mode & ~WRITE_MASK; -+ -+ mode |= tar_type_to_posix(entry->header.typeflag); -+ return mode; -+} -+EXPORT_SYMBOL(vtarfs_entry_mode); -+ -+/** -+ * @brief Returns the vtarfs entry by searching based on inode number. -+ * @param entry: Pointer to the ROOT entry of vtarfs -+ inode: inode number which is mapped to the entry to be found. -+ * @return the vtarfs entry containing the inode number. -+ */ -+static struct -+vtarfs_entry *vtarfs_find_by_inode(struct vtarfs_entry *entry, -+ unsigned long inode) -+{ -+ struct vtarfs_entry *entry_node = NULL; -+ struct radix_tree_iter iter; -+ void **slot = NULL; -+ -+ tarfs_debug("In vtarfs_find_by_node, inode = %ld", inode); -+ -+ radix_tree_for_each_slot(slot, &entry->root_tree, &iter, 0) { -+ entry_node = radix_tree_deref_slot(slot); -+ if (unlikely(!entry_node)) -+ continue; -+ -+ if (radix_tree_exception(entry_node)) { -+ if (radix_tree_deref_retry(entry_node)) -+ slot = radix_tree_iter_retry(&iter); -+ continue; -+ } -+ -+ if (inode == entry_node->inode) { -+ tarfs_debug("\n FOUND %ld\n", entry_node->inode); -+ return entry_node; -+ } -+ } -+ return NULL; -+} -+ -+/** -+ * @brief Returns the vtarfs entry by searching based on name of the file. -+ * @param entry: Pointer to the ROOT entry of vtarfs -+ dir_name: Directory name/path in which the file resides. -+ base_name: Name of the file. -+ * @return the vtarfs entry containing the name. -+ */ -+struct -+vtarfs_entry *vtarfs_find(struct vtarfs_entry *entry, -+ const char *dir_name, const char *base_name) -+{ -+ struct vtarfs_entry *entry_node = NULL; -+ struct radix_tree_iter iter; -+ void **slot = NULL; -+ -+ radix_tree_for_each_slot(slot, &entry->root_tree, &iter, 0) { -+ -+ entry_node = radix_tree_deref_slot(slot); -+ if (unlikely(!entry_node)) -+ continue; -+ -+ if (radix_tree_exception(entry_node)) { -+ if (radix_tree_deref_retry(entry_node)) -+ slot = radix_tree_iter_retry(&iter); -+ -+ continue; -+ } -+ -+ if (!strcmp(entry_node->base_name, base_name) && -+ !strcmp(entry_node->dir_name, dir_name)) { -+ return entry_node; -+ } -+ -+ } -+ return NULL; -+} -+ -+/* -+ * @brief Returns the Full name of a file by combining path and file name. -+ * @param entry: Pointer to the entry of vtarfs file -+ * @return the full name. -+ */ -+static char *vtarfs_full_name(struct vtarfs_entry *entry) -+{ -+ size_t dir_len = strlen(entry->dir_name); -+ size_t base_len = strlen(entry->base_name); -+ size_t len = dir_len + base_len + 2; -+ char *name = kzalloc(len, GFP_KERNEL); -+ -+ if (!name) { -+ pr_err("\n Error in allocating memory for name %ld\n", -+ PTR_ERR(name)); -+ return NULL; -+ } -+ -+ /* Ignore the first / for a top level directory */ -+ if (dir_len < 1) -+ strncpy(name, entry->base_name, base_len); -+ else if (dir_len == 1) -+ strncpy(name, entry->dir_name, dir_len); -+ else -+ snprintf(name, len, "%s/%s", entry->dir_name, entry->base_name); -+ -+ tarfs_debug("found name = %s", name); -+ -+ return name; -+} -+ -+/* -+ * @brief Returns the Full name of a file based on inode number. -+ * @param root_entry: Pointer to the ROOT entry of vtarfs file -+ * inode: inode pointer of the vtarfs file. -+ * @return the full name. -+ */ -+static char *build_lookup_path(struct inode *inode, struct vtarfs_entry *root_entry) -+{ -+ struct vtarfs_entry *entry = NULL; -+ struct vtarfs_fs_info *info = VTARFS_SB(root_entry->ptr_inode->i_sb); -+ -+ tarfs_debug("i_ino = %ld", inode->i_ino); -+ if (inode->i_ino == info->root_ino) -+ return kzalloc(1, GFP_KERNEL); -+ -+ entry = vtarfs_find_by_inode(root_entry, inode->i_ino); -+ if (!entry) { -+ pr_err("\n Failed to find inode by entry, root->entry = %s\n", -+ root_entry->base_name); -+ return NULL; -+ } -+ -+ tarfs_debug("full_name = %s%s ", entry->dir_name, entry->base_name); -+ return vtarfs_full_name(entry); -+} -+ -+/* -+ * @brief Ignore all pos beyond file size -+ * @pararm inode: Pointer to inode of the directory -+ * ctx_pos: requested pos to check -+ * @return non-zero if requested pos is less than the size of inode -+ * else zero -+ */ -+static int beyond_eof(struct inode *inode, loff_t ctx_pos) -+{ -+ loff_t pos = ctx_pos << inode->i_sb->s_blocksize_bits; -+ -+ return pos >= i_size_read(inode); -+} -+ -+/* -+ * @brief Emits the contents of a directory. -+ * @param file: file pointer of a directory -+ * ctx: context of fs on how dir entries will be filled. -+ * @return 0 on SUCCESS negetive errno on failure. -+ */ -+int vtarfs_read_dir(struct file *file, struct dir_context *ctx) -+{ -+ struct inode *inode = file_inode(file); -+ struct vtarfs_fs_info *info = VTARFS_SB(inode->i_sb); -+ struct vtarfs_entry *entry = info->fs_entry; -+ char *dir_path; -+ int namelen = 0; -+ -+ if (beyond_eof(inode, ctx->pos)) -+ return 0; -+ /* Loop through the entry to find matching entry node with inode */ -+ if (!dir_emit_dots(file, ctx)) { -+ pr_err("%s: %lld", __func__, ctx->pos); -+ return 0; -+ } -+ tarfs_debug("[%lld] [%d] [%lld]", ctx->pos, -+ inode->i_sb->s_blocksize_bits, inode->i_size); -+ dir_path = build_lookup_path(inode, entry); -+ if (!dir_path) { -+ pr_err("%s: Failed to get dir path %ld", __func__, PTR_ERR(dir_path)); -+ return -ENOENT; -+ } -+ tarfs_debug("dir_path=%s", dir_path); -+ -+ while (entry) { -+ tarfs_debug("dir_path=%s entry->dir_name = %s base_name=%s", -+ dir_path, entry->dir_name, entry->base_name); -+ if (!strcmp(dir_path, entry->dir_name)) { -+ /* Print all sub dirs by iterating through entry */ -+ namelen = strlen(entry->base_name); -+ if (!dir_emit(ctx, entry->base_name, namelen, -+ entry->inode, (entry->mode >> 12))) { -+ break; -+ } -+ ctx->pos++; -+ } -+ entry = entry->next; -+ } -+ tarfs_debug("return dir_path=%s", dir_path); -+ kfree(dir_path); -+ return 0; -+} -+EXPORT_SYMBOL(vtarfs_read_dir); -+ -+/* -+ * @brief lookup function to iterate through the contents of a directory. -+ * @param dir: inode pointer of a directory -+ * dentry: dentry information of the entry of a file or sub dir. -+ * flags: Currently unused. -+ * @return dentry of the file or sub dir. -+ */ -+struct dentry -+*vtarfs_lookup(struct inode *dir, struct dentry *dentry, -+ unsigned int flags) -+{ -+ struct vtarfs_entry *found_entry = NULL; -+ char *dir_path = NULL; -+ struct inode *build_inode = NULL; -+ struct vtarfs_fs_info *info; -+ struct vtarfs_entry *entry; -+ -+ tarfs_debug("entry"); -+ -+ if (!dir->i_sb) { -+ pr_err("%s: Error Missing superblock", __func__); -+ return NULL; -+ } -+ -+ info = VTARFS_SB(dir->i_sb); -+ entry = info->fs_entry; -+ dir_path = build_lookup_path(dir, entry); -+ -+ found_entry = vtarfs_find(entry, dir_path, dentry->d_name.name); -+ -+ if (found_entry) { -+ build_inode = found_entry->ptr_inode; -+ tarfs_debug("found entry->name = %s%s & entry->inode = %ld", -+ found_entry->dir_name, found_entry->base_name, -+ found_entry->inode); -+ } else { -+ tarfs_debug("Dir entry not found %s", dir_path); -+ } -+ kfree(dir_path); -+ -+ tarfs_debug("ends dir_path=%s", dir_path); -+ return d_splice_alias(build_inode, dentry); -+} -+EXPORT_SYMBOL(vtarfs_lookup); -+ -+/* -+ * @brief Get attributes of a file or dir. -+ * @param path: real path of the file or directory. -+ * stat: pointer to stat structure to be filled. -+ * request_mask: Currently unused. -+ * flags: Currently unused. -+ * @return dentry of the file or sub dir. -+ */ -+int vtarfs_getattr(struct mnt_idmap *idmap, const struct path *path, -+ struct kstat *stat, u32 request_mask, unsigned int flags) -+{ -+ -+ struct inode *inode = d_inode(path->dentry); -+ -+ generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat); -+ if (stat->blocks == 0) -+ stat->blocks = inode->i_mapping->nrpages << (PAGE_SHIFT - 9); -+ -+ return 0; -+} -+EXPORT_SYMBOL(vtarfs_getattr); -+ -+/* -+ * @brief Iteratively read a file using IO Vectors.. -+ * @param iocb: iov object. -+ * to: info about the stage of iteration. -+ * @return number of bytes read. -+ */ -+ssize_t vtarfs_file_read_iter(struct kiocb *iocb, struct iov_iter *to) -+{ -+ struct file *file = iocb->ki_filp; -+ struct inode *inode = file_inode(file); -+ struct vtarfs_fs_info *info = VTARFS_SB(inode->i_sb); -+ struct vtarfs_entry *root_entry = info->fs_entry; -+ struct vtarfs_entry *entry; -+ ssize_t count; -+ loff_t pos = iocb->ki_pos; -+ ssize_t res = 0, copy = 0; -+ off_t pg_off; -+ int size = 0, i = 0, start = 0, end = 0; -+ -+ entry = vtarfs_find_by_inode(root_entry, inode->i_ino); -+ if (!entry) { -+ pr_err("%s: No entry found for the file ", __func__); -+ return -ENOENT; -+ } -+ count = min_t(size_t, iov_iter_count(to), entry->data_size - pos); -+ if (pos < 0) -+ return -EINVAL; -+ if (pos >= entry->data_size || !count) { -+ tarfs_debug("File read complete pos=%llu size=%ld\n", -+ pos, entry->data_size); -+ return 0; -+ } -+ if (count > (entry->data_size - pos)) -+ count = entry->data_size - pos; -+ -+ size = count; -+ start = pos >> PAGE_SHIFT; -+ end = ((pos + count) >> PAGE_SHIFT); -+ -+ tarfs_debug("count = %ld, page[%d] = %p\n", count, start, -+ entry->pages[start]); -+ -+ for (i = start; i <= end && size > 0; i++) { -+ pg_off = pos % PAGE_SIZE; -+ copy = min_t(size_t, size, PAGE_SIZE - pg_off); -+ tarfs_debug("pg_off = %ld, copy = %ld, page[%d]=%p", -+ pg_off, copy, i, entry->pages[i]); -+ res = copy_page_to_iter(entry->pages[i], pg_off, copy, to); -+ pos += res; -+ size -= res; -+ } -+ if (count == size) -+ pr_err("%s: Failed to read any bytes %d\n", __func__, size); -+ -+ iocb->ki_pos += (count - size); -+ tarfs_debug("Return count=%ld res=%d", count, size); -+ return (count - size); -+} -+EXPORT_SYMBOL_GPL(vtarfs_file_read_iter); -+ -+/* -+ * @brief Handle page fault for executables. -+ * @param vmf: fault info -+ * @return FAULT state. -+ */ -+vm_fault_t vtarfs_fault_handler(struct vm_fault *vmf) -+{ -+ struct inode *inode = file_inode(vmf->vma->vm_file); -+ struct vtarfs_fs_info *info = VTARFS_SB(inode->i_sb); -+ struct vtarfs_entry *entry, *root_entry = info->fs_entry; -+ -+ entry = vtarfs_find_by_inode(root_entry, inode->i_ino); -+ if (!entry) { -+ pr_err("%s: No entry found for the file ", __func__); -+ return -ENOENT; -+ } -+ -+ tarfs_debug("[%s][%s][%ld][%lu][%u][%lu]", -+ entry->dir_name, entry->base_name, inode->i_ino, -+ inode->i_mapping->nrpages, entry->fileoffset, vmf->vma->vm_pgoff); -+ -+ if (vmf->pgoff > inode->i_mapping->nrpages) { -+ pr_err("%s: Exceed number of pages %ld > %ld", __func__, -+ vmf->pgoff, inode->i_mapping->nrpages); -+ return -EFAULT; -+ } -+ -+ vmf->page = pagecache_get_page(info->vtarfs_img_map.tarfs_img_map, -+ (entry->fileoffset >> PAGE_SHIFT) + vmf->pgoff, 0, 0); -+ -+ return VM_FAULT_LOCKED; -+} -+EXPORT_SYMBOL(vtarfs_fault_handler); -+ -+/* -+ * @brief mmap handler of vtarfs. -+ * @param file: file pointer of the file which needs to be mmapped -+ * vma: vma_area info -+ * @return 0 on SUCCESS, negetive errno on FAILURE. -+ */ -+int vtarfs_physmem_mmap(struct file *file, struct vm_area_struct *vma) -+{ -+ struct inode *inode = file_inode(file); -+ int ret = 0; -+ -+ tarfs_debug("[%ld] [%ld] [%lu]", inode->i_ino, -+ inode->i_mapping->nrpages, vma->vm_pgoff); -+ -+ if (vma->vm_pgoff > inode->i_mapping->nrpages) { -+ tarfs_debug("num_pages=%ld > pgoff=%lu", -+ inode->i_mapping->nrpages, vma->vm_pgoff); -+ return 0; -+ } -+ -+ file->f_mapping->a_ops = &ram_aops; -+ ret = generic_file_readonly_mmap(file, vma); -+ if (ret) -+ pr_err("%s: Failed to do generic mmap %d\n", __func__, ret); -+ -+ vma->vm_ops = &vtarfs_ops; -+ tarfs_debug("[%p]", vma->vm_file); -+ return 0; -+} -+EXPORT_SYMBOL(vtarfs_physmem_mmap); -+ -+/* -+ * @brief close call handler for a file. -+ * @param inode: inode pointer of the file -+ * file: file pointer of the file -+ * @return 0 on SUCCESS, negetive errno on FAILURE. -+ */ -+int vtarfs_file_release(struct inode *inode, struct file *file) -+{ -+ -+ /* TODO: do kfree of cache and other data here */ -+ -+ return 0; -+ -+} -+EXPORT_SYMBOL(vtarfs_file_release); -diff --git a/fs/vtarfs/vtarfs_inode.c b/fs/vtarfs/vtarfs_inode.c -new file mode 100644 -index 000000000..206d12ed7 ---- /dev/null -+++ b/fs/vtarfs/vtarfs_inode.c -@@ -0,0 +1,773 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* -+ * Filesystem to directly mount vtar archive. -+ * -+ * Copyright 2020 VMware, Inc. All Rights Reserved. -+ * -+ * Licensed under the GNU Lesser General Public License version 2 (the "License"); -+ * you may not use this file except in compliance with the License. The terms -+ * of the License are located in the LICENSE file of this distribution. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "vtarfs.h" -+ -+/* ALIGNS of a 512 byte boundary */ -+#define ALIGN_SECTOR(x) (((x) % 512 > 0) ? 512 - ((x) % 512) : 0) -+ -+ -+/* TODO: implement show_options */ -+static struct super_operations vtarfs_super_ops = { -+ .statfs = simple_statfs, -+ //.show_options = vtarfs_show_options, -+}; -+ -+/* -+ * vtarfs_get_inode : Allocate inode for ROOT Node -+ * sb : Superblock of the file system -+ * dir : inode of directory of ROOT -+ * mode : Permissions -+ * dev : nodev (NON BLOCK based device) -+ */ -+struct inode *vtarfs_get_inode(struct super_block *sb, -+ const struct inode *dir, umode_t mode, dev_t dev) -+{ -+ -+ struct inode *inode = new_inode(sb); -+ struct vtarfs_fs_info *info = VTARFS_SB(sb); -+ struct timespec64 ts; -+ -+ if (inode) { -+ INIT_HLIST_NODE(&inode->i_hash); -+ pr_debug("%s inode created !!", __func__); -+ inode->i_ino = get_next_ino(); -+ info->root_ino = inode->i_ino; -+ inode->i_mode = mode; -+ inode->i_uid = current_fsuid(); -+ inode->i_gid = current_fsgid(); -+ ts = current_time(inode); -+ inode_set_atime_to_ts(inode, ts); -+ inode_set_mtime_to_ts(inode, ts); -+ inode_set_ctime_to_ts(inode, ts); -+ inode->i_mapping->a_ops = &ram_aops; -+ mapping_set_gfp_mask(inode->i_mapping, GFP_HIGHUSER); -+ mapping_set_unevictable(inode->i_mapping); -+ inode->i_sb = sb; -+ inode->i_size = sb->s_blocksize; -+ inode->i_blocks = (inode->i_size + (1 << 9) - 1) >> 9; -+ -+ inode->i_op = &vtarfs_dir_inode_operations; -+ inode->i_fop = &vtarfs_dir_operations; -+ inode_init_owner(&nop_mnt_idmap, inode, NULL, S_IFDIR | 0555); -+ -+ /*directory inodes start off with i_nlink=2(for "." entry)*/ -+ inc_nlink(inode); -+ inc_nlink(inode); -+ } -+ tarfs_debug("returning inode !!\n"); -+ return inode; -+ -+} -+ -+static char *build_dir_path(const char *link_path, char **link_name) -+{ -+ char *dir_path; -+ char *name; -+ int len; -+ -+ name = strrchr(link_path, '/'); -+ name = (name) ? (name + 1) : (char *)(link_path); -+ *link_name = name; -+ len = strlen(link_path) - strlen(name); -+ len = (len > 0) ? (len) : (1); -+ dir_path = kzalloc(len, GFP_KERNEL); -+ if (!dir_path) { -+ pr_err("%s: Error in allocating memory for dir_path %ld", -+ __func__, PTR_ERR(dir_path)); -+ return NULL; -+ } -+ memcpy(dir_path, link_path, len - 1); -+ tarfs_debug("dir_path=[%s]", dir_path); -+ return dir_path; -+} -+ -+/* -+ * vtarfs_create_inode : Allocate inode for file, dir and symlinks -+ * sb : Superblock of the file system -+ * entry : vtarfs entry of ROOT -+ * mode : Permissions -+ */ -+struct inode *vtarfs_create_inode(struct super_block *sb, -+ struct vtarfs_entry *entry, umode_t mode) -+{ -+ -+ struct inode *inode = NULL; -+ struct inode *dentry_inode = d_inode(sb->s_root); -+ struct vtarfs_entry *link_entry = NULL; -+ char *link_name = NULL; -+ char *link_dir_path = NULL; -+ -+ inode = new_inode(sb); -+ if (!inode) { -+ pr_err("%s: Failed to allocate new inode\n", __func__); -+ return NULL; -+ } -+ INIT_HLIST_NODE(&inode->i_hash); -+ tarfs_debug("entry"); -+ -+ inode->i_ino = get_next_ino(); -+ entry->inode = inode->i_ino; -+ tarfs_debug("inode create = %ld", entry->inode); -+ inode->i_mode = vtarfs_entry_mode(entry); -+ i_uid_write(inode, entry->uid); -+ i_gid_write(inode, entry->gid); -+ inode->i_size = entry->data_size; -+ inode_set_atime_to_ts(inode, entry->atime); -+ inode_set_mtime_to_ts(inode, entry->mtime); -+ inode_set_ctime_to_ts(inode, entry->ctime); -+ inode->i_sb = sb; -+ inode->i_mapping->a_ops = &ram_aops; -+ mapping_set_gfp_mask(inode->i_mapping, GFP_HIGHUSER); -+ mapping_set_unevictable(inode->i_mapping); -+ inode->i_mapping->nrpages = entry->num_pages; -+ /* measure inode.i_blocks as the generic filesystem */ -+ inode->i_blocks = (inode->i_size + (1 << 9) - 1) >> 9; -+ __insert_inode_hash(inode, dentry_inode->i_ino); -+ entry->ptr_inode = inode; -+ switch (entry->header.typeflag) { -+ case DIRTYPE: -+ inode->i_op = &vtarfs_dir_inode_operations; -+ inode->i_fop = &vtarfs_dir_operations; -+ if (inode->i_size == 0) -+ inode->i_size = sb->s_blocksize; -+ inode->i_blocks = (inode->i_size + (1 << 9) - 1) >> 9; -+ inc_nlink(inode); -+ break; -+ case LNKTYPE: -+ link_dir_path = build_dir_path(entry->link_name, &link_name); -+ if (link_dir_path) { -+ link_entry = vtarfs_find(VTARFS_SB(sb)->fs_entry, link_dir_path, link_name); -+ kfree(link_dir_path); -+ } -+ tarfs_debug("HARDLINK: [%s] [%s] [%s]", -+ entry->link_name, link_dir_path, link_name); -+ if (link_entry) { -+ tarfs_debug("HARDLINK: [%s]->[%ld]", -+ link_entry->base_name, link_entry->inode); -+ entry->inode = link_entry->inode; -+ entry->ptr_inode = link_entry->ptr_inode; -+ } else { -+ pr_err("%s: HARDLINK: Fail to find the linked file entry!! [%s] [%s] [%s]", -+ __func__, entry->link_name, link_dir_path, link_name); -+ } -+ break; -+ case SYMTYPE: -+ inode->i_op = &vtarfs_symlink_inode_operations; -+ inode->i_link = entry->link_name; -+ inode->i_size = strlen(inode->i_link); -+ inode_nohighmem(inode); -+ break; -+ default: -+ inode->i_op = &vtarfs_file_inode_operations; -+ inode->i_fop = &vtarfs_file_operations; -+ break; -+ } -+ tarfs_debug("Returing"); -+ return inode; -+} -+ -+static char *build_name(struct vtarfs_header_type *header, char *longname, char type) -+{ -+ char *name = longname; -+ char *src = header->name; -+ char *prefix_end = memchr(header->prefix, 0, sizeof(header->prefix)); -+ size_t prefix_len; -+ size_t name_len; -+ char *name_end = NULL; -+ -+ if (!prefix_end) { -+ pr_err("%s : Header name is not proper, prefix_end is NULL!!", __func__); -+ return NULL; -+ } -+ -+ prefix_len = prefix_end - header->prefix; -+ if (type == TAR_TYPE_GNU_LONGNAME) { -+ name_len = strlen(longname); -+ src = longname; -+ tarfs_debug("[%ld] [%ld] [%c] [%s] [%s]", -+ prefix_len, name_len, type, header->prefix, longname); -+ } else { -+ name_end = memchr(header->name, 0, sizeof(header->name)); -+ if (!name_end) { -+ pr_err("%s: Header name is not proper [%s][%ld][%ld], name_end is NULL!!", -+ __func__, header->name, sizeof(header->name), strlen(header->name)); -+ /* -+ * Handle the case where header->name is exact 100 bytes long and -+ * thus there is no '\0' char and mode bytes gets appended to header->name -+ */ -+ if (strlen(header->name) > sizeof(header->name) && -+ !memcmp(header->name + sizeof(header->name), -+ header->mode, sizeof(header->mode))) { -+ pr_info("%s: Header name is exact 100 bytes long!! Handling it properly!!", -+ __func__); -+ name_end = header->name + sizeof(header->name); -+ } else { -+ return NULL; -+ } -+ } -+ name_len = name_end - header->name; -+ tarfs_debug("[%ld] [%ld] [%c] [%s] [%s]", -+ prefix_len, name_len, header->typeflag, header->prefix, header->name); -+ } -+ if (prefix_len != 0 || type != TAR_TYPE_GNU_LONGNAME) { -+ name = kzalloc(prefix_len + name_len + 1, GFP_KERNEL); -+ if (!name) { -+ pr_err("%s: Unable to allocate memory for full name\n", __func__); -+ return NULL; -+ } -+ memcpy(name, header->prefix, prefix_len); -+ memcpy(name + prefix_len, src, name_len); -+ if (type == TAR_TYPE_GNU_LONGNAME) -+ kfree(longname); -+ name[prefix_len + name_len] = 0x0; -+ } -+ -+ -+ // The path name ends with a slash if the entry is a directory -+ if (name[prefix_len + name_len - 1] == '/') -+ name[prefix_len + name_len - 1] = 0x0; -+ -+ return name; -+ -+} -+ -+/** -+ * @brief Reads a tar header at the \a offset. -+ * @param info the fs_iinfo to read from -+ * @param offset the 512-byte aligned offset -+ * @param header the 512 bytes buffer to fill -+ * @return 0 on success, else 1 -+ */ -+static int vtarfs_read_header(struct vtarfs_fs_info *info, off_t offset, -+ struct vtarfs_header_type *header) -+{ -+ struct page *page = NULL; -+ void *k_mapped_page = NULL; -+ -+ page = read_mapping_page(info->vtarfs_img_map.tarfs_img_map, -+ offset >> PAGE_SHIFT, NULL); -+ if (IS_ERR(page)) { -+ pr_err("%s: page map failure %ld", __func__, PTR_ERR(page)); -+ return 1; -+ } -+ -+ k_mapped_page = kmap(page); -+ if (!k_mapped_page) { -+ pr_err("%s: kmap failure %ld", __func__, PTR_ERR(k_mapped_page)); -+ goto error; -+ } -+ if (memcpy(header, k_mapped_page + (offset % PAGE_SIZE), -+ sizeof(struct vtarfs_header_type)) == NULL) { -+ pr_err("%s: read failure", __func__); -+ kunmap(k_mapped_page); -+ goto error; -+ } -+ kunmap(k_mapped_page); -+ put_page(page); -+ return 0; -+ -+error: -+ put_page(page); -+ return 1; -+} -+ -+/** -+ * @brief Reads a tar header at the \a offset. -+ * @param sb the superblock to read from -+ * @param offset the 512-byte aligned offset -+ * @return the entry on success, else \c NULL -+ */ -+struct -+vtarfs_entry *vtarfs_read_entry(struct super_block *sb, -+ off_t offset) -+{ -+ struct vtarfs_fs_info *info = VTARFS_SB(sb); -+ struct vtarfs_header_type header; -+ struct vtarfs_entry *entry = NULL; -+ char *full_name = NULL, *basename = NULL, *longname = NULL; -+ size_t namelen = 0; -+ size_t curlen = 0; -+ char typeflag = 0; -+ struct timespec64 mtime; -+ int i = 0; -+ -+ tarfs_debug("offset = %ld and img_map = %p", offset, -+ info->vtarfs_img_map.tarfs_img_map); -+ -+ if (vtarfs_read_header(info, offset, &header) != 0) { -+ pr_err("%s: Header data reading fails!!", __func__); -+ return NULL; -+ } -+ tarfs_debug("Header Data:\n" -+ "header.name = [%s]\n" -+ "header.mode = [%s]\n" -+ "header.uid = [%s]\n" -+ "header.gid = [%s]\n" -+ "header.size = [%s]\n" -+ "header.mtime = [%s]\n" -+ "header.chksum = [%s]\n" -+ "header.typeflag = [%c]\n" -+ "header.linkname = [%s]\n" -+ "header.magic = [%s]\n" -+ "header.version = [%s]\n" -+ "header.uname = [%s]\n" -+ "header.gname = [%s]\n" -+ "header.devmajor = [%s]\n" -+ "header.devminor = [%s]\n" -+ "header.prefix = [%s]\n" -+ "header.offset = [%u]\n" -+ "header.textOffset = [%u]\n" -+ "header.textSize = [%u]\n" -+ "header.numFixupPgs = [%u]\n", -+ header.name, header.mode, header.uid, header.gid, header.size, -+ header.mtime, header.chksum, header.typeflag, header.linkname, -+ header.magic, header.version, header.uname, header.gname, -+ header.devmajor, header.devminor, header.prefix, header.offset, -+ header.textOffset, header.textSize, header.numFixupPgs); -+ if (header.typeflag == TAR_TYPE_GNU_LONGLINK || header.typeflag == TAR_TYPE_GNU_LONGNAME) { -+ /** -+ * 512-byte header.... [@LongLink/LongName] -+ * typeflag=K/L hdr.size=strlen(LongName/LongLink) -+ * 512-byte header.... [Read LongName/LongLink] -+ * ... [Read again 512-bytes header if Name more than 512-bytes ] -+ * 512-byte header.... [Actual header data, replace hdr.name with @LongName if [L] -+ * else replace hdr.linkname with @LongLink if [K]] -+ **/ -+ if (kstrtouint(header.size, 8, (unsigned int *)&namelen) != -+ 0) { -+ pr_err("%s: failed to read size", __func__); -+ return NULL; -+ } -+ typeflag = header.typeflag; -+ longname = kzalloc(namelen + 1, GFP_KERNEL); -+ if (IS_ERR_OR_NULL(longname)) { -+ pr_err("%s:Error in allocating mem for longname %ld\n", -+ __func__, PTR_ERR(longname)); -+ return NULL; -+ } -+ while (curlen < namelen) { -+ offset = offset + VTARFS_HDR_SIZE + -+ ALIGN_SECTOR(VTARFS_HDR_SIZE); -+ if (vtarfs_read_header(info, offset, &header) != 0) { -+ pr_err("%s: Header data reading fails!!", __func__); -+ goto err_lvl1; -+ } -+ memcpy(longname + curlen, &header, MIN(namelen - curlen, VTARFS_HDR_SIZE)); -+ curlen += VTARFS_HDR_SIZE; -+ tarfs_debug("longname=[%s] len=[%lu] type=[%c]", -+ longname, namelen, typeflag); -+ } -+ offset = offset + VTARFS_HDR_SIZE + -+ ALIGN_SECTOR(VTARFS_HDR_SIZE); -+ if (vtarfs_read_header(info, offset, &header) != 0) { -+ pr_err("%s: Header data reading fails!!", __func__); -+ goto err_lvl1; -+ } -+ } -+ -+ // Check for the header magic value -+ if (memcmp(header.magic, vtarfs_MAGIC, -+ sizeof(header.magic)) != 0) { -+ pr_err("%s: magic=%s", __func__, header.magic); -+ goto err_lvl1; -+ } -+ entry = kzalloc(sizeof(struct vtarfs_entry), GFP_KERNEL); -+ if (IS_ERR_OR_NULL(entry)) { -+ pr_err("%s: Error in allocating mem for entry %ld\n", -+ __func__, PTR_ERR(entry)); -+ goto err_lvl1; -+ } -+ // Parse the data length from the header -+ if (kstrtouint(header.size, 8, (unsigned int *)&entry->data_size) != 0) { -+ pr_err("%s: failed to read size", __func__); -+ goto err_lvl2; -+ } -+ if (kstrtouint(header.mode, 8, (unsigned int *)&entry->mode) != 0) { -+ pr_err("%s: failed to read mode, mode=%s", __func__, header.mode); -+ // Setting default mode as r+w+x for all user -+ entry->mode = 0777; -+ } -+ if (kstrtouint(header.uid, 8, (unsigned int *)&entry->uid) != 0) { -+ pr_err("%s: failed to read uid, uid=%s", __func__, header.uid); -+ // Setting default uid as nobody -+ entry->uid = 0xfffe; -+ } -+ if (kstrtouint(header.gid, 8, (unsigned int *)&entry->gid) != 0) { -+ pr_err("%s: failed to read gid, gid=%s", __func__, header.gid); -+ // Setting default gid as nobody -+ entry->uid = 0xfffd; -+ } -+ if (kstrtoul(header.mtime, 8, (unsigned long *)&mtime.tv_sec) != 0) { -+ mtime.tv_sec = 0; -+ mtime.tv_nsec = 0; -+ } -+ entry->mtime = mtime; -+ entry->atime = mtime; -+ entry->ctime = mtime; -+ entry->fileoffset = header.offset; -+ entry->textOffset = header.textOffset; -+ entry->textSize = header.textSize; -+ entry->numFixupPgs = header.numFixupPgs; -+ -+ entry->num_pages = entry->data_size >> PAGE_SHIFT; -+ if (entry->data_size % PAGE_SIZE) -+ entry->num_pages++; -+ -+ entry->pages = kzalloc((sizeof(struct page *) * (entry->num_pages)), -+ GFP_KERNEL); -+ if (IS_ERR_OR_NULL(entry->pages)) { -+ pr_err("%s:Error in allocating mem for pages %ld\n", -+ __func__, PTR_ERR(entry->pages)); -+ goto err_lvl2; -+ } -+ pr_debug("%s: After getting page maps, num = %d, fileoffset = %d ", -+ __func__, entry->num_pages, entry->fileoffset); -+ for (i = 0; i < entry->num_pages; i++) { -+ entry->pages[i] = read_mapping_page( -+ info->vtarfs_img_map.tarfs_img_map, -+ (entry->fileoffset >> PAGE_SHIFT) + i, NULL); -+ if (IS_ERR(entry->pages[i])) { -+ pr_err("%s: page map failure %ld", -+ __func__, PTR_ERR(entry->pages[i])); -+ goto err_lvl3; -+ } -+ } -+ -+ full_name = build_name(&header, longname, typeflag); -+ if (!full_name) { -+ pr_err("%s: name allocation error", __func__); -+ goto err_lvl3; -+ } -+ basename = strrchr(full_name, '/'); -+ if (basename) { -+ *basename = 0x0; -+ basename++; -+ } else { -+ basename = full_name; -+ full_name = basename + strlen(basename); -+ } -+ entry->dir_name = full_name; -+ entry->base_name = basename; -+ entry->header = header; -+ entry->link_name = (typeflag == TAR_TYPE_GNU_LONGLINK) ? longname : entry->header.linkname; -+ tarfs_debug("full_name = [%s] [%s] linkname=[%s]", -+ entry->dir_name, entry->base_name, entry->link_name); -+ entry->offset = offset; -+ entry->data_offset = offset + VTARFS_HDR_SIZE + ALIGN_SECTOR(VTARFS_HDR_SIZE); -+ tarfs_debug("%s: Returning entry", __func__); -+ return entry; -+ -+err_lvl3: -+ for (; i; i--) -+ put_page(entry->pages[i - 1]); -+ kfree(entry->pages); -+err_lvl2: -+ kfree(entry); -+err_lvl1: -+ kfree(longname); -+ return NULL; -+} -+ -+static int -+vtarfs_parse_mount_ops(char *data, struct vtarfs_mount_opts *opts) -+{ -+ /*TODO: Hardcode it to Read Only mode */ -+ opts->mode = S_IRUGO | S_IXUGO; -+ return 0; -+} -+ -+/* -+ * vtarfs_open_first_entry : Allocate inode for first entry -+ * sb : Superblock of the file system -+ */ -+static struct vtarfs_entry *vtarfs_open_first_entry(struct super_block *sb) -+{ -+ struct vtarfs_entry *first = vtarfs_read_entry(sb, 0); -+ struct inode *alloc_inode = NULL; -+ -+ if (first) { -+ alloc_inode = vtarfs_create_inode(sb, first, first->mode); -+ if (alloc_inode == NULL) { -+ pr_err("%s: alloc_inode failed !!", __func__); -+ first->inode = 2; -+ } -+ } -+ return first; -+} -+ -+/** -+ * @brief Reads all file headers from the \a sb -+ * @param sb the underlying super block -+ * @return the first entry, pointing at all other entries -+ */ -+struct vtarfs_entry *vtarfs_open(struct super_block *sb, struct vtarfs_entry *first) -+{ -+ struct vtarfs_entry *parent = first; -+ struct vtarfs_entry *next; -+ struct inode *alloc_inode = NULL; -+ int err = 0; -+ -+ do { -+ next = vtarfs_read_entry(sb, parent->data_offset); -+ parent->next = next; -+ parent = next; -+ if (IS_ERR_OR_NULL(parent)) -+ break; -+ -+ alloc_inode = vtarfs_create_inode(sb, parent, parent->mode); -+ if (alloc_inode == NULL) { -+ pr_err("%s: alloc_inode failed !!", __func__); -+ parent->inode = 2; -+ break; -+ } -+ radix_tree_preload(GFP_NOIO); -+ err = radix_tree_insert(&first->root_tree, -+ (unsigned long)parent->ptr_inode->i_ino, parent); -+ if (err) -+ pr_err("%s:Radix tree insert err=%d, inode %ld\n", -+ __func__, err, parent->ptr_inode->i_ino); -+ -+ radix_tree_preload_end(); -+ first->radix_root_key = parent->inode; -+ if (parent->header.typeflag == LNKTYPE) -+ iput(alloc_inode); -+ -+ } while (parent); -+ -+ return first; -+} -+ -+static DEFINE_MUTEX(img_map); -+static struct vtarfs_img_map_t vtarfs_img_map; -+ -+/* -+ * vtarfs_fill_super : Fill the super block structure -+ * sb : Superblock of the file system -+ * data : Options passed by user through mount command -+ * silent : unused. -+ */ -+static int -+vtarfs_fill_super(struct super_block *sb, void *data, int silent) -+{ -+ struct vtarfs_fs_info *info = NULL; -+ struct vtarfs_entry *entry = NULL; -+ struct inode *inode = NULL; -+ int err = -EINVAL; -+ -+ tarfs_debug("data = %p", data); -+ -+ info = kzalloc(sizeof(struct vtarfs_fs_info), GFP_KERNEL); -+ if (IS_ERR(info)) { -+ pr_err("%s: Error in allocating memory for info %ld", -+ __func__, PTR_ERR(info)); -+ err = -ENOMEM; -+ return PTR_ERR(info); -+ } -+ err = vtarfs_parse_mount_ops(data, &info->mount_opts); -+ if (err) { -+ pr_err("%s: Error in reading mount options for vtarfs", __func__); -+ goto err_fill_super; -+ } -+ mutex_lock(&img_map); -+ info->vtarfs_img_map.tarfs_img_map = vtarfs_img_map.tarfs_img_map; -+ info->vtarfs_img_map.inode = vtarfs_img_map.inode; -+ info->vtarfs_img_map.fp = vtarfs_img_map.fp; -+ mutex_unlock(&img_map); -+ -+ sb->s_maxbytes = MAX_LFS_FILESIZE; -+ sb->s_blocksize = PAGE_SIZE; -+ sb->s_blocksize_bits = PAGE_SHIFT; -+ sb->s_op = &vtarfs_super_ops; -+ sb->s_d_op = &simple_dentry_operations; -+ sb->s_time_gran = 1; -+ sb->s_flags |= SB_RDONLY | SB_NOATIME; /*Read only file system*/ -+ sb->s_magic = (unsigned long)vtarfs_MAGIC; -+ -+ sb->s_fs_info = info; -+ inode = vtarfs_get_inode(sb, NULL, S_IFDIR | -+ info->mount_opts.mode, 0); -+ sb->s_root = d_make_root(inode); -+ if (!sb->s_root) { -+ pr_err("%s: Error in creating root point for vtarfs", __func__); -+ err = -ENOMEM; -+ goto err_fill_super; -+ } -+ tarfs_debug("populate_first_entry"); -+ __insert_inode_hash(inode, inode->i_ino); -+ entry = vtarfs_open_first_entry(sb); -+ if (!entry) { -+ pr_err("%s: Failed to read first entry", __func__); -+ goto err_fill_super; -+ } -+ radix_tree_preload(GFP_NOIO); -+ INIT_RADIX_TREE(&entry->root_tree, GFP_NOIO); -+ err = radix_tree_insert(&entry->root_tree, (unsigned long)inode->i_ino, -+ entry); -+ if (err) -+ pr_err("%s: Radix tree insert err - inode %ld, err = %d", -+ __func__, inode->i_ino, err); -+ -+ radix_tree_preload_end(); -+ entry->radix_root_key = inode->i_ino; -+ info->fs_entry = entry; -+ tarfs_debug("first allocated root inode num = %ld and sb = %p", -+ inode->i_ino, sb); -+ -+ entry = vtarfs_open(sb, entry); -+ if (!entry) { -+ pr_err("%s: failed to read tar index", __func__); -+ goto err_fill_super; -+ } -+ return 0; -+ -+err_fill_super: -+ kfree(info); -+ return err; -+} -+ -+/* -+ * vtarfs_mount : Mount call for the vtarfs filesystem -+ * fs_type : file system type, name etc. -+ * flags :for special options -+ * dev_name : binary image format of the file system. -+ * data : options passed by user through mount command -+ */ -+static struct -+dentry *vtarfs_mount(struct file_system_type *fs_type, int flags, -+ const char *dev_name, void *data) -+{ -+ struct file *fp = NULL; -+ -+ tarfs_debug("dev_name = %s", dev_name); -+ -+ fp = filp_open(dev_name, O_RDONLY, 0); -+ if (IS_ERR(fp)) { -+ pr_err("Failed to open the file %s for mount %ld\n", -+ dev_name, PTR_ERR(fp)); -+ return NULL; -+ } -+ mutex_lock(&img_map); -+ vtarfs_img_map.tarfs_img_map = (void *)fp->f_mapping; -+ vtarfs_img_map.inode = vtarfs_img_map.tarfs_img_map->host; -+ vtarfs_img_map.fp = fp; -+ mutex_unlock(&img_map); -+ -+ return mount_nodev(fs_type, flags, data, &vtarfs_fill_super); -+} -+ -+/* -+ * vtarfs_kill_super : Destroy the super block of vtarfs -+ * sb : super block structure -+ */ -+static void vtarfs_kill_super(struct super_block *sb) -+{ -+ struct vtarfs_fs_info *info = VTARFS_SB(sb); -+ struct vtarfs_entry *entry = info->fs_entry; -+ int i; -+ -+ tarfs_debug("Kill super"); -+ while (entry) { -+ struct vtarfs_entry *next = entry->next; -+ -+ entry->ptr_inode->i_mapping->nrpages = 0; -+ tarfs_debug("basename=%s dirn=%s", -+ entry->base_name, entry->dir_name); -+ -+ if (entry->dir_name < entry->base_name) -+ kfree(entry->dir_name); -+ else -+ kfree(entry->base_name); -+ -+ if (strlen(entry->link_name) > MAX_FILE_NAME_SIZE) -+ kfree(entry->link_name); -+ -+ for (i = 0; i < entry->num_pages; i++) -+ put_page(entry->pages[i]); -+ -+ if (entry->header.typeflag != LNKTYPE) -+ iput(entry->ptr_inode); -+ kfree(entry->pages); -+ kfree(entry); -+ entry = next; -+ } -+ if (info) { -+ filp_close(info->vtarfs_img_map.fp, NULL); -+ kfree(info); -+ } -+ kill_litter_super(sb); -+} -+ -+static struct file_system_type vtarfs_type = { -+ .owner = THIS_MODULE, -+ .name = "vtarfs", -+ .mount = vtarfs_mount, -+ .kill_sb = vtarfs_kill_super, -+ .fs_flags = FS_USERNS_MOUNT | FS_BINARY_MOUNTDATA, -+}; -+ -+static int __init vtarfs_init(void) -+{ -+ int err = 0; -+ -+ pr_info("%s: filesystem module load start", __func__); -+ -+ err = register_filesystem(&vtarfs_type); -+ if (unlikely(err)) { -+ pr_err("Failed to register vtarfs type %d. Exiting\n", err); -+ goto err; -+ } -+ tarfs_debug("filesystem module registered"); -+ -+ return 0; -+err: -+ return err; -+} -+ -+static void __exit vtarfs_exit(void) -+{ -+ int err = 0; -+ -+ pr_info("%s: filesystem module unload", __func__); -+ -+ err = unregister_filesystem(&vtarfs_type); -+ -+ if (unlikely(err)) -+ pr_err("\n Failed to unregister vtarfs filesystem %d\n", err); -+ -+ -+} -+ -+module_init(vtarfs_init); -+module_exit(vtarfs_exit); -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("VMware Photon OS : Srinidhi Rao "); -+MODULE_AUTHOR("VMware Photon OS : Ankit Jain "); --- -2.39.4 - diff --git a/SPECS/91/linux/esx/0001-fs-TARFS-file-system-to-mount-TAR-archive.patch b/SPECS/91/linux/esx/0001-fs-TARFS-file-system-to-mount-TAR-archive.patch deleted file mode 100644 index b181c4367f..0000000000 --- a/SPECS/91/linux/esx/0001-fs-TARFS-file-system-to-mount-TAR-archive.patch +++ /dev/null @@ -1,1694 +0,0 @@ -From e62081b2b3cc15a52d114b4c85c1affaabbb46ad Mon Sep 17 00:00:00 2001 -From: Ankit Jain -Date: Thu, 21 Nov 2024 09:21:20 +0000 -Subject: [PATCH] fs: TARFS file system to mount TAR archive - -- GNU/POSIX TAR Archive consists of header with information of the -files and directories. The start address of the file stored in a -field in the header itself which help to navigate to the file content. - -- Tar archive can be attach to loop device and passed as input -that can be easily mounted instead of extraction using tarfs. -Tarfs does block device mount. -- TARFS only creates and maintains metadata, inodes and dentries -of files & directries. For a file, the entry for that particular -file will point to the start address offset of the TAR archive -whenever the file is read or executed. - -- Mounting operation is very quick and avoids additional memory -allocation for file content data. - -Signed-off-by: Srinidhi Rao -Signed-off-by: Alexey Makhalov -Signed-off-by: Ashwin Dayanand Kamat -Signed-off-by: Bo Gan -Signed-off-by: Ankit Jain -[Ajay: - fix inode count - - fix -EBUSY issue whiling mounting tarfs] -Signed-off-by: Ajay Kaher ---- - fs/Kconfig | 1 + - fs/Makefile | 1 + - fs/tarfs/Kconfig | 18 + - fs/tarfs/Makefile | 15 + - fs/tarfs/README.md | 64 +++ - fs/tarfs/tarfs.h | 183 +++++++++ - fs/tarfs/tarfs_file_dir_ops.c | 588 +++++++++++++++++++++++++++ - fs/tarfs/tarfs_inode.c | 720 ++++++++++++++++++++++++++++++++++ - 8 files changed, 1590 insertions(+) - create mode 100644 fs/tarfs/Kconfig - create mode 100644 fs/tarfs/Makefile - create mode 100644 fs/tarfs/README.md - create mode 100644 fs/tarfs/tarfs.h - create mode 100644 fs/tarfs/tarfs_file_dir_ops.c - create mode 100644 fs/tarfs/tarfs_inode.c - -diff --git a/fs/Kconfig b/fs/Kconfig -index 4dadee4..72c4272 100644 ---- a/fs/Kconfig -+++ b/fs/Kconfig -@@ -343,6 +343,7 @@ source "fs/erofs/Kconfig" - source "fs/vboxsf/Kconfig" - source "fs/vtar/Kconfig" - source "fs/vtarfs/Kconfig" -+source "fs/tarfs/Kconfig" - - endif # MISC_FILESYSTEMS - -diff --git a/fs/Makefile b/fs/Makefile -index 032d95a..1437f9b 100644 ---- a/fs/Makefile -+++ b/fs/Makefile -@@ -131,4 +131,5 @@ obj-$(CONFIG_VBOXSF_FS) += vboxsf/ - obj-$(CONFIG_ZONEFS_FS) += zonefs/ - obj-$(CONFIG_VTAR) += vtar/ - obj-$(CONFIG_VTARFS) += vtarfs/ -+obj-$(CONFIG_TARFS) += tarfs/ - obj-$(CONFIG_BPF_LSM) += bpf_fs_kfuncs.o -diff --git a/fs/tarfs/Kconfig b/fs/tarfs/Kconfig -new file mode 100644 -index 0000000..ff60b7e ---- /dev/null -+++ b/fs/tarfs/Kconfig -@@ -0,0 +1,18 @@ -+config TARFS -+ tristate "TARFS file system support" -+ depends on TMPFS -+ help -+ TARFS is a read-only filesystem use to mount the GNU/POSIX format -+ tar archive as block device so that extracting such archive will -+ no longer be necessary. The files will appear in the mounted directory -+ path. The start address of each file is stored as an offset in the -+ TAR Header itself which helps to navigate to the start of file content. -+ -+ This file system will mount the TAR archive as READ ONLY. -+ -+ Usually container base images are stored as TAR archive. -+ -+ Say Y or M if you want to mount files from TAR archive. -+ -+ To compile this file system support as a module, choose M here: the -+ module will be called tarfs. If unsure, say N. -diff --git a/fs/tarfs/Makefile b/fs/tarfs/Makefile -new file mode 100644 -index 0000000..592e207 ---- /dev/null -+++ b/fs/tarfs/Makefile -@@ -0,0 +1,15 @@ -+# -+# Makefile for the tarfs routines. -+# -+ -+obj-m += tarfs.o -+ -+#CFLAGS_tarfs_file_dir_ops.o := -I$(src) -+#CFLAGS_tarfs_inode.o := -I$(src) -+tarfs-objs := tarfs_file_dir_ops.o tarfs_inode.o -+ -+all: -+ make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules -+ -+clean: -+ make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean -diff --git a/fs/tarfs/README.md b/fs/tarfs/README.md -new file mode 100644 -index 0000000..2a816e9 ---- /dev/null -+++ b/fs/tarfs/README.md -@@ -0,0 +1,64 @@ -+# tarfs -+ -+tarfs is implemented as Linux kernel module filesystem driver. -+ -+## Features -+ -+* Supports GNU and POSIX format tar files -+* Regular files, directories and symlinks -+* UID, GID, access/modification/creation time -+* Read-only access to files and directories -+ -+## Compiling -+ -+You'll require the linux development files. For ArchLinux, you need the -+`linux-headers` packet. -+ -+After that, just run `make` to build the `tarfs.ko`, which is a loadable -+kernel module. -+ -+**Note**: The module was tested with Linux `5.10.xxx`, on a `x64 ArchLinux` -+ computer. -+ -+## Usage -+ -+```sh -+# If not already done, build the module -+make -+ -+# Now you can load the module: -+sudo insmod tarfs.ko -+ -+# You need a mount directory -+mkdir mnt -+ -+# Mount some tar archive. A test one is included: -+sudo mount test.tar -o loop -t tarfs mnt -+ -+# Discover the archives content -+ls mnt -R -+cat mnt/hello.c -+ -+# Unmount -+sudo umount mnt -+ -+# And unload the kernel module -+sudo rmmod tarfs.ko -+``` -+ -+## File overview -+ -+* **tarfs_inode.c** Code to read the underlying block device and creates metadata -+* **tarfs_file_dir_ops.c** Code for file and directory operations -+* **tarfs.h** Header definition for tar files, taken from -+ https://www.gnu.org/software/tar/manual/html_node/Standard.html -+ -+## Implementation -+ -+This project focuses on the interaction part with Linux. That's why the -+implementation of the Tar reading code is kept really simple: On mount, all -+file entries are read from the tar file, and stored as a radix tree. -+ -+File system operations are quite faster as they are implemented -+as radix tree (A trie data structure) -+ -diff --git a/fs/tarfs/tarfs.h b/fs/tarfs/tarfs.h -new file mode 100644 -index 0000000..ca739c9 ---- /dev/null -+++ b/fs/tarfs/tarfs.h -@@ -0,0 +1,183 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+/* -+ * Filesystem to directly mount tar archive. -+ * -+ * Copyright 2021 VMware, Inc. All Rights Reserved. -+ * -+ * Licensed under the GNU Lesser General Public License version 2 (the "License"); -+ * you may not use this file except in compliance with the License. The terms -+ * of the License are located in the LICENSE file of this distribution. -+ * -+ */ -+ -+#ifndef tarfs -+#define tarfs -+ -+#include -+#include -+ -+#define MAX_FILE_NAME_SIZE 100 -+#define TARFS_BLOCK_SIZE_BITS (9) -+#define TARFS_BLOCK_SIZE (1U << TARFS_BLOCK_SIZE_BITS) -+#define DEBUG_PRINT -+#ifdef DEBUG_PRINT -+#define tarfs_debug(fmt, args...) pr_debug("[tarfs][%s:]" fmt, __func__, ##args) -+#else -+#define tarfs_debug(fmt, args...) -+#endif -+#define tarfs_info(fmt, args...) pr_info("[tarfs][%s:]" fmt, __func__, ##args) -+#define tarfs_err(fmt, args...) pr_err("[tarfs][%s:]" fmt, __func__, ##args) -+#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -+ -+/* Following is based on -+ * https://www.gnu.org/software/tar/manual/html_node/Standard.html -+ * which in turn references `src/tar.h` from the GNU tar project. -+ */ -+#define REGTYPE '0' /* regular file */ -+#define AREGTYPE '\0' /* regular file */ -+#define LNKTYPE '1' /* link */ -+#define SYMTYPE '2' /* reserved */ -+#define CHRTYPE '3' /* character special */ -+#define BLKTYPE '4' /* block special */ -+#define DIRTYPE '5' /* directory */ -+#define FIFOTYPE '6' /* FIFO special */ -+#define CONTTYPE '7' /* reserved */ -+/* Identifies the *next* file on the tape as having a long linkname. */ -+#define GNUTYPE_LONGLINK 'K' -+ -+/* Identifies the *next* file on the tape as having a long name. */ -+#define GNUTYPE_LONGNAME 'L' -+ -+/* OLDGNU_MAGIC uses both magic and version fields, which are contiguous. -+ * Found in an archive, it indicates an old GNU header format, which will be -+ * hopefully become obsolescent. With OLDGNU_MAGIC, uname and gname are -+ * valid, though the header is not truly POSIX conforming. -+ */ -+#define OLDGNU_MAGIC "ustar " /* 7 chars and a null */ -+#define TMAGIC "ustar" /* ustar and a null */ -+ -+struct star_header { /* byte offset */ -+ char name[100]; /* 0 */ -+ char mode[8]; /* 100 */ -+ char uid[8]; /* 108 */ -+ char gid[8]; /* 116 */ -+ char size[12]; /* 124 */ -+ char mtime[12]; /* 136 */ -+ char chksum[8]; /* 148 */ -+ char typeflag; /* 156 */ -+ char linkname[100]; /* 157 */ -+ char magic[6]; /* 257 */ -+ char version[2]; /* 263 */ -+ char uname[32]; /* 265 */ -+ char gname[32]; /* 297 */ -+ char devmajor[8]; /* 329 */ -+ char devminor[8]; /* 337 */ -+ char prefix[131]; /* 345 */ -+ char atime[12]; /* 476 */ -+ char ctime[12]; /* 488 */ -+ /* 500 */ -+}; -+ -+#define TARFS_HDR_SIZE (sizeof(struct star_header)) -+static_assert(TARFS_HDR_SIZE == 500); -+ -+struct tarfs_entry { -+ struct star_header header; -+ char *dir_name; -+ char *base_name; -+ char *link_name; -+ loff_t offset; -+ loff_t data_offset; -+ size_t data_size; -+ unsigned long inode; -+ struct inode *ptr_inode; -+ umode_t mode; -+ uid_t uid; -+ gid_t gid; -+ struct timespec64 atime; -+ struct timespec64 mtime; -+ struct timespec64 ctime; -+ struct tarfs_entry *next; -+ spinlock_t lock; -+ struct radix_tree_root root_tree; -+ unsigned long radix_root_key; -+}; -+ -+struct tarfs_mount_opts { -+ umode_t mode; -+}; -+ -+struct tarfs_sbi { -+ struct tarfs_entry *first; -+ u64 blocks; -+ u64 files; -+}; -+ -+static inline struct tarfs_sbi *TARFS_SB(struct super_block *sb) -+{ -+ return sb->s_fs_info; -+} -+ -+static inline struct tarfs_entry *tarfs_get_first_entry(struct super_block *sb) -+{ -+ return TARFS_SB(sb)->first; -+} -+ -+extern int tarfs_getattr(struct mnt_idmap *idmap, const struct path *path, -+ struct kstat *stat, u32 request_mask, unsigned int flags); -+extern int tarfs_read_dir(struct file *file, struct dir_context *ctx); -+extern mode_t tarfs_entry_mode(struct tarfs_entry *entry); -+extern ssize_t tarfs_file_read_iter(struct kiocb *iocb, struct iov_iter *to); -+extern struct dentry *tarfs_lookup(struct inode *inode, struct dentry *dentry, -+ unsigned int flags); -+extern int tarfs_statfs(struct dentry *d, struct kstatfs *ks); -+extern struct tarfs_entry *tarfs_find(struct tarfs_entry *entry, -+ const char *dir_name, const char *base_name); -+extern sector_t tarfs_bmap(struct address_space *mapping, sector_t block); -+extern int tarfs_read_folio(struct file *file, struct folio *folio); -+extern void tarfs_readahead(struct readahead_control *rac); -+extern struct inode *tarfs_create_inode(struct super_block *sb, -+ struct tarfs_entry *entry, umode_t mode); -+ -+static const struct file_operations tarfs_file_operations = { -+ .llseek = generic_file_llseek, -+ .read_iter = tarfs_file_read_iter, -+ .mmap = generic_file_readonly_mmap, -+ .fsync = generic_file_fsync, -+ .open = generic_file_open, -+ .splice_read = filemap_splice_read, -+}; -+ -+static const struct inode_operations tarfs_file_inode_operations = { -+ .getattr = tarfs_getattr, -+}; -+ -+static const struct inode_operations tarfs_dir_inode_operations = { -+ .lookup = tarfs_lookup, -+ .getattr = tarfs_getattr, -+}; -+ -+static const struct inode_operations tarfs_symlink_inode_operations = { -+ .get_link = simple_get_link, -+ .getattr = tarfs_getattr, -+}; -+ -+static const struct file_operations tarfs_dir_operations = { -+ .llseek = generic_file_llseek, -+ .read = generic_read_dir, -+ .iterate_shared = tarfs_read_dir, -+ .fsync = generic_file_fsync, -+}; -+ -+ -+static const struct super_operations tarfs_super_ops = { -+ .statfs = tarfs_statfs, -+}; -+ -+static const struct address_space_operations tarfs_ram_addr_ops = { -+ .read_folio = tarfs_read_folio, -+ .readahead = tarfs_readahead, -+ .bmap = tarfs_bmap, -+}; -+ -+#endif -diff --git a/fs/tarfs/tarfs_file_dir_ops.c b/fs/tarfs/tarfs_file_dir_ops.c -new file mode 100644 -index 0000000..8846bb1 ---- /dev/null -+++ b/fs/tarfs/tarfs_file_dir_ops.c -@@ -0,0 +1,588 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* -+ * Filesystem to directly mount tar archive. -+ * -+ * Copyright 2021 VMware, Inc. All Rights Reserved. -+ * -+ * Licensed under the GNU Lesser General Public License version 2 (the "License"); -+ * you may not use this file except in compliance with the License. The terms -+ * of the License are located in the LICENSE file of this distribution. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "tarfs.h" -+ -+#define WRITE_MASK (0222) -+ -+mode_t tar_type_to_posix(int typeflag) -+{ -+ switch (typeflag) { -+ case REGTYPE: -+ case AREGTYPE: -+ case CONTTYPE: -+ return S_IFREG; -+ case DIRTYPE: -+ return S_IFDIR; -+ case SYMTYPE: -+ return S_IFLNK; -+ case CHRTYPE: -+ return S_IFCHR; -+ case BLKTYPE: -+ return S_IFBLK; -+ case FIFOTYPE: -+ return S_IFIFO; -+ default: -+ return 0; -+ } -+} -+ -+/** -+ * @brief Returns the POSIX file mode of \a entry. -+ * @param entry the entry to get the file mode from -+ * @return the file mode -+ */ -+mode_t tarfs_entry_mode(struct tarfs_entry *entry) -+{ -+ mode_t mode = entry->mode & ~WRITE_MASK; -+ -+ mode |= tar_type_to_posix(entry->header.typeflag); -+ return mode; -+} -+EXPORT_SYMBOL(tarfs_entry_mode); -+ -+/** -+ * @brief Returns the tarfs entry by searching based on inode number. -+ * @param entry: Pointer to the ROOT entry of tarfs -+ * inode: inode number which is mapped to the entry to be found. -+ * @return the tarfs entry containing the inode number. -+ */ -+static struct tarfs_entry *tarfs_find_by_inode(struct tarfs_entry *entry, unsigned long inode) -+{ -+ struct tarfs_entry *f_entry = NULL; -+ -+ if (entry) { -+ rcu_read_lock(); -+ f_entry = radix_tree_lookup(&entry->root_tree, inode); -+ rcu_read_unlock(); -+ } -+ return f_entry; -+} -+ -+/** -+ * @brief Returns the tarfs entry by searching based on name of the file. -+ * @param entry: Pointer to the ROOT entry of tarfs -+ * dir_name: Directory name/path in which the file resides. -+ * base_name: Name of the file. -+ * @return the tarfs entry containing the name. -+ */ -+struct tarfs_entry *tarfs_find(struct tarfs_entry *entry, -+ const char *dir_name, const char *base_name) -+{ -+ struct tarfs_entry *entry_node = NULL; -+ struct radix_tree_iter iter; -+ void **slot = NULL; -+ -+ if (!entry) { -+ tarfs_err("Invalid Entry!!"); -+ return NULL; -+ } -+ radix_tree_for_each_slot(slot, &entry->root_tree, &iter, 0) { -+ entry_node = radix_tree_deref_slot(slot); -+ -+ if (unlikely(!entry_node)) -+ continue; -+ -+ if (radix_tree_exception(entry_node)) { -+ if (radix_tree_deref_retry(entry_node)) -+ slot = radix_tree_iter_retry(&iter); -+ continue; -+ } -+ -+ if (!strcmp(entry_node->base_name, base_name) && -+ !strcmp(entry_node->dir_name, dir_name)) { -+ return entry_node; -+ } -+ } -+ return NULL; -+} -+ -+/* -+ * @brief Returns the Full name of a file by combining path and file name. -+ * @param entry: Pointer to the entry of tarfs file -+ * @return the full name. -+ */ -+static char *tarfs_full_name(struct tarfs_entry *entry) -+{ -+ size_t dir_len = strlen(entry->dir_name); -+ size_t base_len = strlen(entry->base_name); -+ size_t len = dir_len + base_len + 2; -+ char *name = kzalloc(len, GFP_KERNEL); -+ -+ if (!name) { -+ tarfs_err("Error in allocating memory for name %ld", PTR_ERR(name)); -+ return NULL; -+ } -+ -+ /* Ignore the first / for a top level directory */ -+ if (dir_len < 1) -+ strncpy(name, entry->base_name, base_len); -+ else if (dir_len == 1) -+ strncpy(name, entry->dir_name, dir_len); -+ else -+ snprintf(name, len, "%s/%s", entry->dir_name, entry->base_name); -+ -+ return name; -+ -+} -+ -+/* -+ * @brief Returns the Full name of a file based on inode number. -+ * @param root_entry: Pointer to the ROOT entry of tarfs file -+ * inode: inode pointer of the tarfs file. -+ * @return the full name. -+ */ -+static char *build_lookup_path(struct inode *inode, struct tarfs_entry *root_entry) -+{ -+ struct tarfs_entry *entry; -+ -+ if (!inode || !root_entry) { -+ tarfs_err("Invalid inode or root_entry!!"); -+ return NULL; -+ } -+ -+ if (inode->i_ino == root_entry->radix_root_key) -+ return kzalloc(1, GFP_KERNEL); -+ -+ entry = tarfs_find_by_inode(root_entry, inode->i_ino); -+ if (!entry) { -+ tarfs_err("Failed to find inode by entry, root->entry=%s inode=%p ino=%ld", -+ root_entry->base_name, inode, inode->i_ino); -+ return NULL; -+ } -+ return tarfs_full_name(entry); -+} -+ -+/* -+ * @brief Get attributes of a file or dir. -+ * @param path: real path of the file or directory. -+ * stat: pointer to stat structure to be filled. -+ * request_mask: Currently unused. -+ * flags: Currently unused. -+ * @return dentry of the file or sub dir. -+ */ -+int tarfs_getattr(struct mnt_idmap *idmap, const struct path *path, -+ struct kstat *stat, u32 request_mask, unsigned int flags) -+{ -+ struct inode *inode = d_inode(path->dentry); -+ -+ generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat); -+ if (stat->blocks == 0) -+ stat->blocks = inode->i_mapping->nrpages << (PAGE_SHIFT - TARFS_BLOCK_SIZE_BITS); -+ -+ return 0; -+} -+EXPORT_SYMBOL(tarfs_getattr); -+ -+ -+static struct inode *tarfs_revalidate_entry(struct super_block *sb, struct tarfs_entry *found_entry) -+{ -+ struct tarfs_entry *entry; -+ struct inode *build_inode = NULL; -+ struct tarfs_entry *rentry = tarfs_get_first_entry(sb); -+ int err = 0; -+ -+ if (!found_entry->ptr_inode || (found_entry->ptr_inode->i_state & (I_FREEING | I_CLEAR)) -+ || found_entry->ptr_inode->i_ino != found_entry->inode) { -+ tarfs_debug("inode in freeing state [%px]!!", found_entry->ptr_inode); -+ spin_lock(&found_entry->lock); -+ entry = radix_tree_delete(&rentry->root_tree, found_entry->inode); -+ if (!entry) -+ tarfs_err("Radix tree delete fails [%ld]!!", found_entry->inode); -+ -+ tarfs_debug("entry[%px] %s/%s [%ld]", -+ entry, entry->dir_name, entry->base_name, entry->inode); -+ build_inode = tarfs_create_inode(sb, found_entry, found_entry->mode); -+ if (!build_inode) { -+ spin_unlock(&found_entry->lock); -+ tarfs_err("new inode doesn't get created[%s/%s]", -+ found_entry->dir_name, found_entry->base_name); -+ goto out; -+ } -+ radix_tree_preload(GFP_NOIO); -+ err = radix_tree_insert(&rentry->root_tree, -+ (unsigned long)build_inode->i_ino, found_entry); -+ if (err) { -+ spin_unlock(&found_entry->lock); -+ tarfs_err("Radix tree insert fails err=%d, inode %ld", -+ err, build_inode->i_ino); -+ goto out1; -+ } -+ radix_tree_preload_end(); -+ spin_unlock(&found_entry->lock); -+ tarfs_debug("entry[%px] %s/%s (%ld == %ld) state=%ld inserted into radix tree!!", -+ entry, entry->dir_name, entry->base_name, -+ entry->inode, entry->ptr_inode->i_ino, -+ entry->ptr_inode->i_state); -+ if (entry != radix_tree_lookup(&rentry->root_tree, build_inode->i_ino)) { -+ tarfs_err("Dynamic Inode creation unsuccessful err=%d, inode %ld", -+ err, build_inode->i_ino); -+ goto out1; -+ } -+ tarfs_debug("found entry->name = %s/%s & entry->inode = (%ld == %ld) inode=%px state=%lu pages=%lu", -+ found_entry->dir_name, found_entry->base_name, -+ found_entry->inode, build_inode->i_ino, build_inode, -+ build_inode->i_state, build_inode->i_mapping->nrpages); -+ } else { -+ build_inode = found_entry->ptr_inode; -+ if (!build_inode) { -+ tarfs_err("inode doesn't exist[%s/%s]", -+ found_entry->dir_name, found_entry->base_name); -+ return NULL; -+ } -+ } -+ return build_inode; -+out1: -+ iput(build_inode); -+out: -+ found_entry->ptr_inode = NULL; -+ found_entry->inode = 0; -+ return NULL; -+} -+ -+/* -+ * @brief Ignore all pos beyond file size -+ * @pararm inode: Pointer to inode of the directory -+ * ctx_pos: requested pos to check -+ * @return non-zero if requested pos is less than the size of inode -+ * else zero -+ */ -+static int beyond_eof(struct inode *inode, loff_t ctx_pos) -+{ -+ loff_t pos = ctx_pos << inode->i_sb->s_blocksize_bits; -+ -+ return pos >= i_size_read(inode); -+} -+ -+/* -+ * @brief Emits the contents of a directory. -+ * @param file: file pointer of a directory -+ * ctx: context of fs on how dir entries will be filled. -+ * @return 0 on SUCCESS negetive errno on failure. -+ */ -+int tarfs_read_dir(struct file *file, struct dir_context *ctx) -+{ -+ struct inode *inode = file_inode(file); -+ struct tarfs_entry *entry = tarfs_get_first_entry(inode->i_sb); -+ char *dir_path; -+ int namelen = 0; -+ struct tarfs_entry *entry_node = NULL; -+ struct radix_tree_iter iter; -+ void **slot = NULL; -+ -+ if (beyond_eof(inode, ctx->pos)) -+ return 0; -+ -+ /* Loop through the entry to find matching entry node with inode */ -+ if (!dir_emit_dots(file, ctx)) { -+ tarfs_err("dir_emit_dots err=%lld", ctx->pos); -+ return 0; -+ } -+ tarfs_debug("[%lld] [%d] [%lld] [%lu] [%lu]", -+ ctx->pos, inode->i_sb->s_blocksize_bits, -+ inode->i_size, inode->i_state, inode->i_ino); -+ if (!entry) -+ return 0; -+ -+ dir_path = build_lookup_path(inode, entry); -+ if (!dir_path) { -+ tarfs_err("Failed to get dir path %ld", PTR_ERR(dir_path)); -+ return PTR_ERR(dir_path); -+ } -+ tarfs_debug("dir_path=%s", dir_path); -+ -+ radix_tree_for_each_slot(slot, &entry->root_tree, &iter, 0) { -+ entry_node = radix_tree_deref_slot(slot); -+ -+ if (unlikely(!entry_node)) -+ continue; -+ -+ if (radix_tree_exception(entry_node)) { -+ if (radix_tree_deref_retry(entry_node)) -+ slot = radix_tree_iter_retry(&iter); -+ continue; -+ } -+ if (!strcmp(entry_node->dir_name, dir_path)) { -+ // Print all sub dirs by iterating through entry -+ tarfs_debug("dir_path=%s entry->dir_name = %s base_name=%s ino=%ld state=%lu sz=%lu", -+ dir_path, entry_node->dir_name, entry_node->base_name, -+ entry_node->inode, entry_node->ptr_inode->i_state, -+ entry->data_size); -+ if (!tarfs_revalidate_entry(inode->i_sb, entry_node)) { -+ kfree(dir_path); -+ tarfs_err("entry revalidation failed!!"); -+ return PTR_ERR(NULL); -+ } -+ namelen = strlen(entry_node->base_name); -+ if (!dir_emit(ctx, entry_node->base_name, namelen, -+ entry_node->inode, (entry_node->mode >> 12))) { -+ tarfs_err("dir emit fails!!"); -+ break; -+ } -+ ctx->pos++; -+ } -+ } -+ kfree(dir_path); -+ return 0; -+} -+EXPORT_SYMBOL(tarfs_read_dir); -+ -+/* -+ * @brief get statfs info related to super block. -+ * @param dentry: dentry information of the superblock -+ * buf: pointer to kstatfs -+ * @return NULL -+ */ -+int tarfs_statfs(struct dentry *dentry, struct kstatfs *buf) -+{ -+ struct super_block *sb = dentry->d_sb; -+ struct tarfs_sbi *sb_info = TARFS_SB(sb); -+ -+ buf->f_type = sb->s_magic; -+ buf->f_bsize = sb->s_blocksize; -+ buf->f_blocks = sb_info->blocks; -+ buf->f_files = sb_info->files; -+ buf->f_namelen = MAX_FILE_NAME_SIZE; -+ buf->f_bfree = buf->f_ffree = 0; -+ return 0; -+} -+EXPORT_SYMBOL(tarfs_statfs); -+ -+/* -+ * @brief lookup function to iterate through the contents of a directory. -+ * @param dir: inode pointer of a directory -+ * dentry: dentry information of the entry of a file or sub dir. -+ * flags: Currently unused. -+ * @return dentry of the file or sub dir. -+ */ -+struct dentry *tarfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) -+{ -+ struct tarfs_entry *found_entry = NULL; -+ char *dir_path = NULL; -+ struct inode *build_inode = NULL; -+ struct tarfs_entry *rentry; -+ -+ if (!dir || !dentry) { -+ tarfs_err("Error: Null pointer occur"); -+ return ERR_PTR(-ENOENT); -+ } -+ if (!dir->i_sb) { -+ tarfs_err("Error Missing superblock"); -+ return ERR_PTR(-ENOENT); -+ } -+ tarfs_debug("inode=%px[ino=%ld] and dentry=%px name=%s [%u]", -+ dir, dir->i_ino, dentry, dentry->d_name.name, dentry->d_name.len); -+ -+ if (simple_positive(dentry)) { -+ tarfs_err("dentry is positive [%px][%px][%px=%s]", -+ dentry->d_inode, dir, dentry, dentry->d_name.name); -+ d_invalidate(dentry); -+ return ERR_PTR(-ENOENT); -+ } -+ -+ rentry = tarfs_get_first_entry(dir->i_sb); -+ dir_path = build_lookup_path(dir, rentry); -+ tarfs_debug("ends dir_path=%s", dir_path); -+ found_entry = tarfs_find(rentry, dir_path, dentry->d_name.name); -+ kfree(dir_path); -+ -+ if (found_entry) { -+ build_inode = tarfs_revalidate_entry(dir->i_sb, found_entry); -+ if (!build_inode) { -+ tarfs_err("entry revalidation failed found entry->name = %s/%s!!", -+ found_entry->dir_name, found_entry->base_name); -+ return NULL; -+ } -+ tarfs_debug("found entry->name = %s/%s & entry->inode = (%ld == %ld) inode=%px state=%lu pages=%lu", -+ found_entry->dir_name, found_entry->base_name, -+ found_entry->inode, build_inode->i_ino, build_inode, -+ build_inode->i_state, build_inode->i_mapping->nrpages); -+ } else { -+ tarfs_err("Dir entry not found [%px][%px=%s]!!", dir, dentry, dentry->d_name.name); -+ return ERR_PTR(-ENOENT); -+ } -+ return d_splice_alias(build_inode, dentry); -+} -+EXPORT_SYMBOL(tarfs_lookup); -+ -+/* -+ * @brief Iteratively read a file using IO Vectors.. -+ * @param iocb: iov object. -+ * to: info about the stage of iteration. -+ * @return number of bytes read. -+ */ -+ssize_t tarfs_file_read_iter(struct kiocb *iocb, struct iov_iter *to) -+{ -+ struct file *file = iocb->ki_filp; -+ struct inode *inode = file_inode(file); -+ struct tarfs_entry *root_entry = tarfs_get_first_entry(inode->i_sb); -+ struct tarfs_entry *entry; -+ size_t count, to_read, inner_size, copied; -+ loff_t pos = iocb->ki_pos, inner_off; -+ sector_t block; -+ struct buffer_head *bh; -+ -+ entry = tarfs_find_by_inode(root_entry, inode->i_ino); -+ if (!entry) { -+ tarfs_err("No entry found for the file "); -+ return -ENOENT; -+ } -+ if (pos < 0) -+ return -EINVAL; -+ -+ count = min_t(size_t, iov_iter_count(to), entry->data_size - pos); -+ if (pos >= entry->data_size || !count) { -+ tarfs_debug("File read complete[%s/%s][%px] pos=%llu size=%ld nrpages=%lu", -+ entry->dir_name, entry->base_name, entry->ptr_inode, pos, -+ entry->data_size, inode->i_mapping->nrpages); -+ return 0; -+ } -+ -+ to_read = count; -+ while (to_read > 0) { -+ block = (entry->data_offset + pos) / inode->i_sb->s_blocksize; -+ inner_off = (entry->data_offset + pos) % inode->i_sb->s_blocksize; -+ inner_size = min_t(size_t, inode->i_sb->s_blocksize - inner_off, to_read); -+ -+ bh = sb_bread(inode->i_sb, block); -+ -+ if (!bh) { -+ tarfs_err("Failed to read block %llu", block); -+ return -EINVAL; -+ } -+ -+ if (bh->b_size != inode->i_sb->s_blocksize) { -+ tarfs_err("Wanted %lu byte block, but got %lu", -+ inode->i_sb->s_blocksize, bh->b_size); -+ break; -+ } -+ -+ copied = copy_to_iter(bh->b_data + inner_off, inner_size, to); -+ brelse(bh); -+ -+ pos += copied; -+ to_read -= copied; -+ } -+ -+ if (count == to_read) -+ tarfs_err("Failed to read any bytes %ld", to_read); -+ -+ iocb->ki_pos += (count - to_read); -+ return (count - to_read); -+} -+EXPORT_SYMBOL_GPL(tarfs_file_read_iter); -+ -+/** -+ * tarfs_get_block - locate buffer for given inode,block tuple -+ * @ip: inode -+ * @block: phy block -+ * @bp: buffer skeleton -+ * @create: %TRUE if blocks may be newly allocated. -+ * -+ * Description: -+ * The tarfs_get_block function fills @bp with the right physical -+ * block and device number to perform a lowlevel read/write on -+ * it. -+ * -+ * Returns: -+ * Zero on success, else a negativ error code (-EIO). -+ */ -+static int tarfs_getblk(struct inode *inode, sector_t block, struct buffer_head *bp, int create) -+{ -+ struct tarfs_entry *root; -+ struct tarfs_entry *entry; -+ sector_t blk_offset; -+ -+ if (!inode) { -+ tarfs_err("Null Inode!!"); -+ return -EIO; -+ } -+ root = tarfs_get_first_entry(inode->i_sb); -+ entry = tarfs_find_by_inode(root, inode->i_ino); -+ if (!entry) { -+ tarfs_err("Entry Not Found [%px][%ld]!!", inode, inode->i_ino); -+ return -EIO; -+ } -+ blk_offset = entry->data_offset / inode->i_sb->s_blocksize; -+ map_bh(bp, inode->i_sb, block + blk_offset); -+ return 0; -+} -+ -+/** -+ * tarfs_read_folio - read one page synchronously into the pagecache -+ * @file: file context (unused) -+ * @folio: folio to fill in. -+ * -+ * Description: -+ * The tarfs_readpage routine reads @folio synchronously into the -+ * pagecache. -+ * -+ * Returns: -+ * Zero on success, else a negative error code. -+ * -+ * Locking status: -+ * @folio is locked and will be unlocked. -+ */ -+int tarfs_read_folio(struct file *file, struct folio *folio) -+{ -+ tarfs_debug("Read folio"); -+ return block_read_full_folio(folio, tarfs_getblk); -+} -+EXPORT_SYMBOL_GPL(tarfs_read_folio); -+ -+/** -+ * tarfs_readahead - start reads against pages -+ * @rac: Describes which pages to read. -+ * @get_block: The filesystem's block mapper function. -+ * -+ * This function walks the pages and the blocks within each page, building and -+ * emitting large BIOs. -+ */ -+void tarfs_readahead(struct readahead_control *rac) -+{ -+ tarfs_debug("Readahead [%px]", rac); -+ mpage_readahead(rac, tarfs_getblk); -+} -+EXPORT_SYMBOL_GPL(tarfs_readahead); -+ -+/** -+ * tarfs_bmap - perform logical to physical block mapping -+ * @mapping: logical to physical mapping to use -+ * @block: logical block (relative to @mapping). -+ * -+ * Description: -+ * tarfs_bmap find out the corresponding phsical block to the -+ * @mapping, @block pair. -+ * -+ * Returns: -+ * Physical block number on success, else Zero. -+ * -+ * Locking status: -+ * We are under the bkl. -+ */ -+sector_t tarfs_bmap(struct address_space *mapping, sector_t block) -+{ -+ tarfs_debug("block=[%llu]", block); -+ return generic_block_bmap(mapping, block, tarfs_getblk); -+} -+EXPORT_SYMBOL_GPL(tarfs_bmap); -diff --git a/fs/tarfs/tarfs_inode.c b/fs/tarfs/tarfs_inode.c -new file mode 100644 -index 0000000..bc5d110 ---- /dev/null -+++ b/fs/tarfs/tarfs_inode.c -@@ -0,0 +1,720 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* -+ * Filesystem to directly mount tar archive. -+ * -+ * Copyright 2021 VMware, Inc. All Rights Reserved. -+ * -+ * Licensed under the GNU Lesser General Public License version 2 (the "License"); -+ * you may not use this file except in compliance with the License. The terms -+ * of the License are located in the LICENSE file of this distribution. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "tarfs.h" -+ -+#define ROOT_INO_MODE (S_IFDIR | 0555) -+#define ALIGN_SECTOR(x) \ -+ (((x) % TARFS_BLOCK_SIZE > 0) ? TARFS_BLOCK_SIZE - ((x) % TARFS_BLOCK_SIZE) : 0) -+#define OCTAL (8) -+ -+static void tarfs_kill_super(struct super_block *sb); -+ -+/* -+ * tarfs_get_inode : Allocate inode -+ * sb : Superblock of the file system -+ * mode : Permissions -+ **/ -+struct inode *tarfs_get_inode(struct super_block *sb, umode_t mode) -+{ -+ struct inode *inode = new_inode(sb); -+ -+ if (inode) { -+ INIT_HLIST_NODE(&inode->i_hash); -+ inode->i_ino = get_next_ino(); -+ inode->i_mode = mode; -+ inode->i_mapping->a_ops = &tarfs_ram_addr_ops; -+ mapping_set_gfp_mask(inode->i_mapping, GFP_HIGHUSER); -+ mapping_set_unevictable(inode->i_mapping); -+ inode->i_sb = sb; -+ tarfs_debug("inode created [%px][%ld]!!", inode, inode->i_ino); -+ } -+ return inode; -+} -+ -+static char *build_dir_path(const char *link_path, char **link_name) -+{ -+ char *dir_path; -+ char *name; -+ int len; -+ -+ name = strrchr(link_path, '/'); -+ name = (name) ? (name + 1) : (char *)(link_path); -+ *link_name = name; -+ len = strlen(link_path) - strlen(name); -+ len = (len > 0) ? (len) : (1); -+ dir_path = kzalloc(len, GFP_KERNEL); -+ if (!dir_path) { -+ tarfs_err("Error in allocating memory for dir_path %ld", PTR_ERR(dir_path)); -+ return NULL; -+ } -+ memcpy(dir_path, link_path, len - 1); -+ tarfs_debug("dir_path=[%s]", dir_path); -+ return dir_path; -+} -+ -+/* -+ * tarfs_create_inode : Allocate inode for file, dir and symlinks -+ * sb : Superblock of the file system -+ * entry : tarfs entry of ROOT -+ * mode : Permissions -+ **/ -+struct inode *tarfs_create_inode(struct super_block *sb, -+ struct tarfs_entry *entry, umode_t mode) -+{ -+ struct inode *inode = NULL; -+ struct inode *dentry_inode = d_inode(sb->s_root); -+ struct tarfs_sbi *sb_info = TARFS_SB(sb); -+ struct tarfs_entry *link_entry = NULL; -+ char *link_name = NULL; -+ char *link_dir_path = NULL; -+ -+ inode = tarfs_get_inode(sb, tarfs_entry_mode(entry)); -+ if (!inode) { -+ tarfs_err("Failed to allocate new inode"); -+ return NULL; -+ } -+ i_uid_write(inode, entry->uid); -+ i_gid_write(inode, entry->gid); -+ inode->i_size = entry->data_size; -+ inode->i_blocks = -+ (inode->i_size + sb->s_blocksize - 1) >> sb->s_blocksize_bits; -+ inode_set_atime_to_ts(inode, entry->atime); -+ inode_set_mtime_to_ts(inode, entry->mtime); -+ inode_set_ctime_to_ts(inode, entry->ctime); -+ __insert_inode_hash(inode, dentry_inode->i_ino); -+ entry->inode = inode->i_ino; -+ entry->ptr_inode = inode; -+ switch (entry->header.typeflag) { -+ case DIRTYPE: -+ inode->i_op = &tarfs_dir_inode_operations; -+ inode->i_fop = &tarfs_dir_operations; -+ if (inode->i_size == 0) -+ inode->i_size = sb->s_blocksize; -+ inode->i_blocks = (inode->i_size + sb->s_blocksize - 1) >> sb->s_blocksize_bits; -+ inc_nlink(inode); -+ break; -+ case LNKTYPE: -+ link_dir_path = build_dir_path(entry->link_name, &link_name); -+ if (link_dir_path) { -+ link_entry = tarfs_find(sb_info->first, link_dir_path, link_name); -+ kfree(link_dir_path); -+ } -+ tarfs_debug("HARDLINK: [%s] [%s] [%s]", entry->link_name, link_dir_path, link_name); -+ if (link_entry) { -+ tarfs_debug("HARDLINK: [%s]->[%ld]", -+ link_entry->base_name, link_entry->inode); -+ entry->inode = link_entry->inode; -+ entry->ptr_inode = link_entry->ptr_inode; -+ } else { -+ tarfs_err("HARDLINK: Fail to find the linked file entry!! [%s] [%s] [%s]", -+ entry->link_name, link_dir_path, link_name); -+ } -+ break; -+ case SYMTYPE: -+ inode->i_op = &tarfs_symlink_inode_operations; -+ inode->i_link = entry->link_name; -+ inode->i_size = strlen(inode->i_link); -+ inode_nohighmem(inode); -+ break; -+ default: -+ inode->i_op = &tarfs_file_inode_operations; -+ inode->i_fop = &tarfs_file_operations; -+ break; -+ } -+ tarfs_debug("inode created = %ld", entry->inode); -+ return inode; -+} -+ -+static char *build_name(struct star_header *header, char *longname, char type) -+{ -+ char *name = longname; -+ char *src = header->name; -+ char *prefix_end = memchr(header->prefix, 0, sizeof(header->prefix)); -+ size_t prefix_len; -+ size_t name_len; -+ char *name_end = NULL; -+ -+ if (!prefix_end) { -+ tarfs_err("Header name is not proper, prefix_end is NULL!!"); -+ return NULL; -+ } -+ -+ prefix_len = prefix_end - header->prefix; -+ if (type == GNUTYPE_LONGNAME) { -+ name_len = strlen(longname); -+ src = longname; -+ tarfs_debug("[%ld] [%ld] [%c] [%s] [%s]", -+ prefix_len, name_len, type, header->prefix, longname); -+ } else { -+ name_end = memchr(header->name, 0, sizeof(header->name)); -+ if (!name_end) { -+ /* -+ * Handle the case where header->name is exact 100 bytes long or more -+ */ -+ if (strnlen(header->name, sizeof(header->name)) == sizeof(header->name)) { -+ tarfs_info("Header name is exact 100 bytes long!! Handling it properly!!"); -+ name_end = header->name + sizeof(header->name); -+ } else { -+ tarfs_err("Header name is not proper [%s][%ld][%ld], name_end is NULL!!", -+ header->name, sizeof(header->name), strnlen(header->name, sizeof(header->name))); -+ return NULL; -+ } -+ } -+ name_len = name_end - header->name; -+ tarfs_debug("[%ld] [%ld] [%c] [%s] [%s]", prefix_len, name_len, -+ header->typeflag, header->prefix, header->name); -+ } -+ if (prefix_len != 0 || type != GNUTYPE_LONGNAME) { -+ name = kzalloc(prefix_len + name_len + 1, GFP_KERNEL); -+ if (!name) { -+ tarfs_err("Unable to allocate memory for full name"); -+ return NULL; -+ } -+ memcpy(name, header->prefix, prefix_len); -+ memcpy(name + prefix_len, src, name_len); -+ if (type == GNUTYPE_LONGNAME) { -+ kfree(longname); -+ longname = NULL; -+ } -+ } -+ -+ /* The path name ends with a slash if the entry is a directory */ -+ if (name[prefix_len + name_len - 1] == '/') -+ name[prefix_len + name_len - 1] = 0x0; -+ -+ return name; -+} -+ -+/* Returns the checksum for the given ustar format HEADER. */ -+static unsigned int calculate_chksum(const struct star_header *h) -+{ -+ const uint8_t *header = (const uint8_t *) h; -+ const size_t chksum_start = offsetof(struct star_header, chksum); -+ const size_t chksum_end = chksum_start + sizeof(h->chksum); -+ unsigned int chksum = 0; -+ size_t i; -+ -+ for (i = 0; i < TARFS_HDR_SIZE; i++) { -+ /* The star checksum is calculated as if the chksum field -+ * were all spaces. -+ */ -+ chksum += (i >= chksum_start && i < chksum_end) ? ' ' : header[i]; -+ } -+ return chksum; -+} -+ -+static bool is_chksum_match(const struct star_header *h) -+{ -+ unsigned int chksum, cal_chksum; -+ -+ if (kstrtouint(h->chksum, OCTAL, (unsigned int *)&chksum) != 0) { -+ /* Reached EOF */ -+ if (h->chksum[0] == 0) -+ return false; -+ tarfs_err("failed to read chksum"); -+ return false; -+ } -+ cal_chksum = calculate_chksum(h); -+ if (cal_chksum != chksum) { -+ tarfs_err("Chksum Mismatch!! Calculated chksum=%d , stored chksum=%d", -+ cal_chksum, chksum); -+ return false; -+ } -+ return true; -+} -+ -+size_t tarfs_read(void *buffer, size_t size, loff_t offset, struct super_block *sb) -+{ -+ struct buffer_head *bh; -+ size_t pos = 0; -+ sector_t block; -+ loff_t inner_off; -+ size_t inner_size; -+ -+ while (size > 0) { -+ block = (offset + pos) / sb->s_blocksize; -+ inner_off = (offset + pos) % sb->s_blocksize; -+ inner_size = min_t(size_t, sb->s_blocksize - inner_off, size); -+ -+ tarfs_debug("blk=[%llu] offset=[%lld] pos=[%ld] inneroff=[%lld] innersize=[%ld] blksize=[%ld] size=[%ld]", -+ block, offset, pos, inner_off, -+ inner_size, sb->s_blocksize, size); -+ bh = sb_bread(sb, block); -+ if (!bh) { -+ tarfs_err("Failed to read block %llu Err=%ld", block, PTR_ERR(bh)); -+ break; -+ } -+ -+ if (bh->b_size != sb->s_blocksize) { -+ tarfs_err("Wanted %lu byte block, but got %lu", -+ sb->s_blocksize, bh->b_size); -+ break; -+ } -+ -+ memcpy(buffer, bh->b_data + inner_off, inner_size); -+ brelse(bh); -+ -+ pos += inner_size; -+ size -= inner_size; -+ buffer += inner_size; -+ } -+ -+ return pos; -+} -+ -+/** -+ * @brief Reads a tar header at the \a offset. -+ * @param sb the superblock to read from -+ * @param offset the 512-byte aligned offset -+ * @return the entry on success, else \c NULL -+ */ -+struct tarfs_entry *tarfs_read_entry(struct super_block *sb, loff_t offset) -+{ -+ struct star_header header; -+ struct tarfs_entry *entry = NULL; -+ char *full_name = NULL, *basename = NULL, *longname = NULL; -+ size_t namelen = 0; -+ size_t curlen = 0; -+ char typeflag = 0; -+ size_t length = 0; -+ unsigned int mode = 0; -+ uid_t uid = 0; -+ gid_t gid = 0; -+ struct timespec64 atime, mtime, ctime; -+ bool gnutar = true; -+ -+ if (tarfs_read(&header, sizeof(header), offset, sb) != sizeof(header)) { -+ tarfs_err("Header data reading fails!!"); -+ return NULL; -+ } -+ tarfs_debug("Header Data:\n" -+ "header.name = [%s]\n" -+ "header.mode = [%s]\n" -+ "header.uid = [%s]\n" -+ "header.gid = [%s]\n" -+ "header.size = [%s]\n" -+ "header.mtime = [%s]\n" -+ "header.chksum = [%s]\n" -+ "header.typeflag = [%c]\n" -+ "header.linkname = [%s]\n" -+ "header.magic = [%s]\n" -+ "header.version = [%s]\n" -+ "header.uname = [%s]\n" -+ "header.gname = [%s]\n" -+ "header.devmajor = [%s]\n" -+ "header.devminor = [%s]\n" -+ "header.prefix = [%s]\n", -+ header.name, header.mode, header.uid, header.gid, header.size, -+ header.mtime, header.chksum, header.typeflag, header.linkname, -+ header.magic, header.version, header.uname, header.gname, -+ header.devmajor, header.devminor, header.prefix); -+ if (!is_chksum_match(&header)) -+ return NULL; -+ -+ if ((header.typeflag == GNUTYPE_LONGLINK) || (header.typeflag == GNUTYPE_LONGNAME)) { -+ /** -+ * 512-byte header.... [@LongLink/LongName] -+ * typeflag=K/L hdr.size=strlen(LongName/LongLink) -+ * 512-byte header.... [Read LongName/LongLink] -+ * ... [Read again 512-bytes header if Name more than 512-bytes ] -+ * 512-byte header.... [Actual header data, replace hdr.name with @LongName if [L] -+ * else replace hdr.linkname with @LongLink if [K]] -+ **/ -+ if (kstrtoul(header.size, OCTAL, (size_t *)&namelen) != 0) { -+ tarfs_err("failed to read size"); -+ return NULL; -+ } -+ typeflag = header.typeflag; -+ longname = kzalloc(namelen + 1, GFP_KERNEL); -+ if (IS_ERR_OR_NULL(longname)) { -+ tarfs_err("Error in allocating mem for longname %ld", PTR_ERR(longname)); -+ return NULL; -+ } -+ while (curlen < namelen) { -+ offset = offset + TARFS_HDR_SIZE + ALIGN_SECTOR(TARFS_HDR_SIZE); -+ if (tarfs_read(&header, sizeof(header), offset, sb) != sizeof(header)) { -+ tarfs_err("Header data reading fails!!"); -+ goto err_lvl1; -+ } -+ memcpy(longname + curlen, &header, MIN(namelen - curlen, TARFS_HDR_SIZE)); -+ curlen += TARFS_HDR_SIZE; -+ } -+ tarfs_debug("longname=[%s] len=[%lu] type=[%c]", longname, namelen, typeflag); -+ offset = offset + TARFS_HDR_SIZE + ALIGN_SECTOR(TARFS_HDR_SIZE); -+ if (tarfs_read(&header, sizeof(header), offset, sb) != sizeof(header)) { -+ tarfs_err("Header data reading fails!!"); -+ goto err_lvl1; -+ } -+ } -+ if (!is_chksum_match(&header)) -+ goto err_lvl1; -+ -+ /** -+ * Check for the header magic value -+ * Supported Formats: -+ * GNU -+ * POSIX -+ **/ -+ gnutar = !memcmp(header.magic, OLDGNU_MAGIC, sizeof(header.magic)) || -+ !memcmp(header.magic, TMAGIC, sizeof(header.magic)); -+ if (!gnutar) { -+ tarfs_err("magic=%.8s", header.magic); -+ goto err_lvl1; -+ } -+ // Parse the data length from the header -+ if (kstrtoul(header.size, OCTAL, (size_t *)&length) != 0) { -+ tarfs_err("failed to read size"); -+ goto err_lvl1; -+ } -+ if (kstrtouint(header.mode, OCTAL, (unsigned int *)&mode) != 0) { -+ tarfs_err("failed to read mode, mode=%s", header.mode); -+ /* set default mode as r+w+x for all user */ -+ mode = 0777; -+ } -+ if (kstrtouint(header.uid, OCTAL, (unsigned int *)&uid) != 0) { -+ tarfs_err("failed to read uid, uid=%s", header.uid); -+ /* set default uid as nobody */ -+ uid = 0xfffe; -+ } -+ if (kstrtouint(header.gid, OCTAL, (unsigned int *)&gid) != 0) { -+ tarfs_err("failed to read gid, gid=%s", header.gid); -+ /* set default gid as nobody */ -+ gid = 0xfffd; -+ } -+ if (kstrtoul(header.mtime, OCTAL, (unsigned long *)&mtime.tv_sec) != 0) { -+ mtime.tv_sec = 0; -+ mtime.tv_nsec = 0; -+ } -+ if (gnutar && kstrtoul(header.atime, OCTAL, (unsigned long *)&atime.tv_sec) != 0) -+ atime = mtime; -+ -+ if (gnutar && kstrtoul(header.ctime, OCTAL, (unsigned long *)&ctime.tv_sec) != 0) -+ ctime = mtime; -+ -+ if (!gnutar) { -+ atime = mtime; -+ ctime = mtime; -+ } -+ full_name = build_name(&header, longname, typeflag); -+ if (!full_name) { -+ tarfs_err("name allocation error"); -+ goto err_lvl1; -+ } -+ basename = strrchr(full_name, '/'); -+ if (basename) { -+ *basename = 0x0; -+ basename++; -+ } else { -+ basename = full_name; -+ full_name = basename + strlen(basename); -+ } -+ -+ entry = kzalloc(sizeof(struct tarfs_entry), GFP_KERNEL); -+ if (IS_ERR_OR_NULL(entry)) { -+ tarfs_err("Error in allocating mem for entry %ld", PTR_ERR(entry)); -+ goto err_lvl1; -+ } -+ entry->header = header; -+ entry->dir_name = full_name; -+ entry->base_name = basename; -+ entry->data_size = length; -+ entry->mode = mode; -+ entry->uid = uid; -+ entry->gid = gid; -+ entry->mtime = mtime; -+ entry->atime = atime; -+ entry->ctime = ctime; -+ entry->offset = offset; -+ entry->data_offset = offset + TARFS_HDR_SIZE + ALIGN_SECTOR(TARFS_HDR_SIZE); -+ entry->link_name = (typeflag == GNUTYPE_LONGLINK) ? (longname) : (entry->header.linkname); -+ tarfs_debug("full_name = [%s] [%s] linkname=[%s]", -+ entry->dir_name, entry->base_name, entry->link_name); -+ return entry; -+ -+err_lvl1: -+ kfree(longname); -+ return NULL; -+} -+ -+ -+ -+ -+/** -+ * @brief Reads all file headers from the \a sb -+ * @param sb the underlying super block -+ * @return the first entry, pointing at all other entries -+ */ -+struct tarfs_entry *tarfs_open(struct super_block *sb) -+{ -+ struct tarfs_entry *first = tarfs_read_entry(sb, 0); -+ struct tarfs_entry *parent = first; -+ struct tarfs_sbi *sb_info = TARFS_SB(sb); -+ struct tarfs_entry *next; -+ struct inode *alloc_inode; -+ loff_t length; -+ int err; -+ -+ if (first) { -+ sb_info->files++; -+ sb_info->first = first; -+ alloc_inode = tarfs_create_inode(sb, parent, parent->mode); -+ if (IS_ERR_OR_NULL(alloc_inode)) { -+ tarfs_err("alloc_inode failed !!"); -+ return NULL; -+ } -+ sb_info->blocks += first->ptr_inode->i_blocks; -+ radix_tree_preload(GFP_NOIO); -+ INIT_RADIX_TREE(&first->root_tree, GFP_NOIO); -+ err = radix_tree_insert(&first->root_tree, -+ (unsigned long)first->ptr_inode->i_ino, first); -+ if (err) { -+ tarfs_err("Radix tree insert first err=%d, inode %ld", -+ err, first->ptr_inode->i_ino); -+ radix_tree_preload_end(); -+ return NULL; -+ } -+ radix_tree_preload_end(); -+ } -+ while (parent) { -+ sb_info->files++; -+ /* Skipping the data of previous entry */ -+ length = parent->data_offset + parent->data_size; -+ next = tarfs_read_entry(sb, length + ALIGN_SECTOR(length)); -+ parent->next = next; -+ if (IS_ERR_OR_NULL(next)) -+ break; -+ parent->next->radix_root_key = parent->inode; -+ parent = next; -+ alloc_inode = tarfs_create_inode(sb, parent, parent->mode); -+ if (IS_ERR_OR_NULL(alloc_inode)) { -+ tarfs_err("alloc_inode failed !!"); -+ parent->inode = 2; -+ break; -+ } -+ sb_info->blocks += parent->ptr_inode->i_blocks; -+ radix_tree_preload(GFP_NOIO); -+ err = radix_tree_insert(&first->root_tree, -+ (unsigned long)alloc_inode->i_ino, parent); -+ if (err) { -+ tarfs_err("Radix tree insert err=%d, inode %ld", err, alloc_inode->i_ino); -+ radix_tree_preload_end(); -+ break; -+ } -+ radix_tree_preload_end(); -+ if (parent->header.typeflag == LNKTYPE) -+ iput(alloc_inode); -+ } -+ return first; -+} -+ -+static int tarfs_parse_mount_ops(char *data, struct tarfs_mount_opts *opts) -+{ -+ /*TODO: Hardcode it to Read Only mode */ -+ opts->mode = S_IRUGO | S_IXUGO; -+ return 0; -+} -+ -+/** -+ * @brief Sets up the \a sb. -+ * @param sb the super block -+ * @param data -+ * @param silent if messages shall be suppressed -+ * @return an error code -+ */ -+static int tarfs_fill_sb(struct super_block *sb, void *data, int silent) -+{ -+ struct tarfs_entry *entry = NULL; -+ struct inode *inode = NULL; -+ struct tarfs_mount_opts mount_opts; -+ int err = -EINVAL; -+ struct tarfs_sbi *sb_info; -+ struct timespec64 ts; -+ -+ sb_info = kzalloc(sizeof(struct tarfs_sbi), GFP_KERNEL); -+ if (IS_ERR_OR_NULL(sb_info)) { -+ tarfs_err("Error in allocating mem for sb_info! Err: %ld", PTR_ERR(sb_info)); -+ return -ENOMEM; -+ } -+ sb->s_fs_info = sb_info; -+ -+ err = tarfs_parse_mount_ops(data, &mount_opts); -+ if (err) { -+ tarfs_err("Error in reading mount options for tarfs"); -+ goto error; -+ } -+ sb->s_op = &tarfs_super_ops; -+ sb->s_time_gran = 1; -+ sb->s_flags |= SB_RDONLY | SB_NOATIME | SB_ACTIVE; /*Read only file system*/ -+ sb->s_maxbytes = MAX_LFS_FILESIZE; -+ if (!sb_set_blocksize(sb, TARFS_BLOCK_SIZE)) { -+ tarfs_err("device does not support %d byte blocks", TARFS_BLOCK_SIZE); -+ err = -EINVAL; -+ goto error; -+ } -+ -+ inode = tarfs_get_inode(sb, S_IFDIR | mount_opts.mode); -+ if (!inode) { -+ tarfs_err("Failed to create new inode!!"); -+ err = -ENOMEM; -+ goto error; -+ } -+ inode->i_uid = current_fsuid(); -+ inode->i_gid = current_fsgid(); -+ ts = current_time(inode); -+ inode_set_atime_to_ts(inode, ts); -+ inode_set_mtime_to_ts(inode, ts); -+ inode_set_ctime_to_ts(inode, ts); -+ inode->i_size = sb->s_blocksize; -+ inode->i_blocks = (inode->i_size + sb->s_blocksize - 1) >> sb->s_blocksize_bits; -+ inode->i_op = &tarfs_dir_inode_operations; -+ inode->i_fop = &tarfs_dir_operations; -+ inode_init_owner(&nop_mnt_idmap, inode, NULL, ROOT_INO_MODE); -+ /*directory inodes start off with i_nlink=2(for "." entry)*/ -+ inc_nlink(inode); -+ inc_nlink(inode); -+ -+ sb_info->blocks = inode->i_blocks; -+ sb->s_root = d_make_root(inode); -+ if (!sb->s_root) { -+ iput(inode); -+ tarfs_err("Error in creating root point for tarfs"); -+ err = -ENOMEM; -+ goto error; -+ } -+ -+ tarfs_debug("populate_first_entry"); -+ __insert_inode_hash(inode, inode->i_ino); -+ entry = tarfs_open(sb); -+ if (!entry) { -+ tarfs_err("Failed to read first entry!!"); -+ sb->s_magic = (unsigned long)OLDGNU_MAGIC; -+ } else { -+ entry->radix_root_key = inode->i_ino; -+ sb->s_magic = (unsigned long)entry->header.magic; -+ } -+ tarfs_debug("first allocated root inode num = %ld and sb = %p magic=[%s]", -+ inode->i_ino, sb, (char *)sb->s_magic); -+ return 0; -+ -+error: -+ kfree(sb_info); -+ sb->s_fs_info = NULL; -+ return err; -+} -+ -+/** -+ * @brief Called by linux to mount \a dev. -+ * @param type our file system type -+ * @param flags mount flags -+ * @param dev the device path to mount -+ * @param data -+ * @return the root directory entry -+ */ -+static struct dentry *tarfs_mount(struct file_system_type *type, int flags, -+ char const *dev, void *data) -+{ -+ return mount_bdev(type, SB_RDONLY | flags, dev, data, tarfs_fill_sb); -+} -+ -+/** -+ * @brief Called by linux to unmount \a sb. -+ * @param sb the super block of the instance to unmount -+ */ -+static void tarfs_kill_super(struct super_block *sb) -+{ -+ struct tarfs_sbi *sb_info = TARFS_SB(sb); -+ struct tarfs_entry *entry = sb_info ? (sb_info->first) : NULL; -+ struct tarfs_entry *next; -+ -+ tarfs_debug("Kill super"); -+ while (entry) { -+ next = entry->next; -+ tarfs_debug("basename=%s dirn=%s", entry->base_name, entry->dir_name); -+ -+ if(entry->ptr_inode) -+ iput(entry->ptr_inode); -+ -+ if (entry->dir_name < entry->base_name) -+ kfree(entry->dir_name); -+ else -+ kfree(entry->base_name); -+ if (strlen(entry->link_name) > MAX_FILE_NAME_SIZE) -+ kfree(entry->link_name); -+ kfree(entry); -+ entry = next; -+ } -+ if (sb->s_root) -+ kfree(sb->s_root->d_fsdata); -+ -+ kfree(sb_info); -+ kill_block_super(sb); -+} -+ -+static struct file_system_type tarfs_type = { -+ .owner = THIS_MODULE, -+ .name = "tarfs", -+ .mount = tarfs_mount, -+ .kill_sb = tarfs_kill_super, -+ .fs_flags = FS_REQUIRES_DEV, -+}; -+ -+/** @brief Called by linux to initialize the module. */ -+static int __init tarfs_init(void) -+{ -+ int err = 0; -+ -+ tarfs_info("filesystem module load start"); -+ -+ err = register_filesystem(&tarfs_type); -+ if (unlikely(err)) { -+ tarfs_err("Failed to register tarfs type %d. Exiting!!", err); -+ goto err; -+ } -+ tarfs_debug("filesystem module registered"); -+ -+ return 0; -+err: -+ return err; -+} -+ -+/** @brief Called by linux to unload the module. */ -+static void __exit tarfs_exit(void) -+{ -+ int err = 0; -+ -+ tarfs_info("filesystem module unload"); -+ err = unregister_filesystem(&tarfs_type); -+ if (unlikely(err)) -+ tarfs_err("Failed to unregister tarfs filesystem %d", err); -+} -+ -+module_init(tarfs_init); -+module_exit(tarfs_exit); -+ -+MODULE_LICENSE("GPL"); -+MODULE_DESCRIPTION("A tar filesystem driver"); -+MODULE_AUTHOR("VMware Photon OS : Srinidhi Rao "); -+MODULE_AUTHOR("VMware Photon OS : Alexey Makhalov "); -+MODULE_AUTHOR("VMware Photon OS : Ankit Jain "); -+MODULE_AUTHOR("VMware Photon OS : Ashwin Dayanand Kamat "); --- -2.39.4 - diff --git a/SPECS/91/linux/esx/0001-fs-VTAR-archive-to-TPMFS-extractor.patch b/SPECS/91/linux/esx/0001-fs-VTAR-archive-to-TPMFS-extractor.patch deleted file mode 100644 index 53675d2ccb..0000000000 --- a/SPECS/91/linux/esx/0001-fs-VTAR-archive-to-TPMFS-extractor.patch +++ /dev/null @@ -1,771 +0,0 @@ -From 3440e3fbd8d1e83c59338864ed56d24aa77e9c5d Mon Sep 17 00:00:00 2001 -From: Ankit Jain -Date: Wed, 13 Nov 2024 08:19:20 +0000 -Subject: [PATCH] fs: VTAR archive to TPMFS extractor - -- GNU TAR Archieve consists of header with information of the -files and directories. This GNU TAR format can be extended to VTAR -format by ensuring that each file contenet data starts from a -PAGE ALIGNED address. This start address of the file can be stored -in a field in the header itself which will help to navigate to the -file content. - -- Such an archive image (VTAR) when stored in RAMFS can be easily -mounted using VTAR. VTAR only creates and maintains metadata, -inodes and dentries of files & directries, But for a file, -the entry for that particular file will point to the start -address offset of the VTAR archive image whenever the file is read -or executed. - -- Mounting operation is very quick and avoids additional memory -allocation for file content data. - -Signed-off-by: Ankit Jain -Signed-off-by: srinidhira0 ---- - fs/Kconfig | 1 + - fs/Makefile | 1 + - fs/vtar/Kconfig | 21 ++ - fs/vtar/Makefile | 7 + - fs/vtar/README.md | 33 +++ - fs/vtar/vtar.h | 80 +++++++ - fs/vtar/vtarfs.c | 536 ++++++++++++++++++++++++++++++++++++++++++++++ - 7 files changed, 679 insertions(+) - create mode 100644 fs/vtar/Kconfig - create mode 100644 fs/vtar/Makefile - create mode 100644 fs/vtar/README.md - create mode 100644 fs/vtar/vtar.h - create mode 100644 fs/vtar/vtarfs.c - -diff --git a/fs/Kconfig b/fs/Kconfig -index aae170fc2..570f8f00c 100644 ---- a/fs/Kconfig -+++ b/fs/Kconfig -@@ -341,6 +341,7 @@ source "fs/sysv/Kconfig" - source "fs/ufs/Kconfig" - source "fs/erofs/Kconfig" - source "fs/vboxsf/Kconfig" -+source "fs/vtar/Kconfig" - - endif # MISC_FILESYSTEMS - -diff --git a/fs/Makefile b/fs/Makefile -index 61679fd58..a0f4c8544 100644 ---- a/fs/Makefile -+++ b/fs/Makefile -@@ -129,4 +129,5 @@ obj-$(CONFIG_EFIVAR_FS) += efivarfs/ - obj-$(CONFIG_EROFS_FS) += erofs/ - obj-$(CONFIG_VBOXSF_FS) += vboxsf/ - obj-$(CONFIG_ZONEFS_FS) += zonefs/ -+obj-$(CONFIG_VTAR) += vtar/ - obj-$(CONFIG_BPF_LSM) += bpf_fs_kfuncs.o -diff --git a/fs/vtar/Kconfig b/fs/vtar/Kconfig -new file mode 100644 -index 000000000..e9628c8c8 ---- /dev/null -+++ b/fs/vtar/Kconfig -@@ -0,0 +1,21 @@ -+config VTAR -+ tristate "Virtual TAR file system support" -+ depends on TMPFS -+ help -+ The GNU TAR archive format can be modified into Virtual TAR archive -+ format by ensuring that each file starts from a PAGE ALIGNED address. -+ This start address of each file is stored as an offset in the VTAR -+ Header itself which helps to navigate to the start of file content. -+ VTAR will mount such an archive and extracting such archive will -+ no longer be necessary. The files will appear virtually in the mounted -+ directory path. The actual file inode mapping will point to the file -+ offset of the VTAR archive image. -+ -+ This file system will mount the VTAR archive as READ ONLY. -+ -+ Usually container base images are stored as VTAR archive. -+ -+ Say Y or M if you want to read files from VTAR archive image. -+ -+ To compile this file system support as a module, choose M here: the -+ module will be called vtarfs. If unsure, say N. -diff --git a/fs/vtar/Makefile b/fs/vtar/Makefile -new file mode 100644 -index 000000000..1a81f51c1 ---- /dev/null -+++ b/fs/vtar/Makefile -@@ -0,0 +1,7 @@ -+# -+# Makefile for the vtar routines. -+# -+ -+obj-$(CONFIG_VTAR) += vtar.o -+ -+vtar-objs := vtarfs.o -diff --git a/fs/vtar/README.md b/fs/vtar/README.md -new file mode 100644 -index 000000000..5b3b8b6a0 ---- /dev/null -+++ b/fs/vtar/README.md -@@ -0,0 +1,33 @@ -+# vtar -+ -+Summary: -+-------- -+vTar Un-Compresser, mounts the vmtar into the tmpfs with zero copy. -+ -+Prerequisite: -+------------ -+Following are the prerequisite: -+1) Input vmtar format tar file should be present in tmpfs -+2) -o option should be used to provide tmpfs-mountpath directory -+ -+Description: -+----------- -+a) vTar first creates the tmpfs of size of tar ball in the -+ tmpfs-mountpath given by user using -o option. -+b) It extract all the files in the tmpfs-mountpath provided by user. -+c) It creates the symlink named "vtarfslink" in mountpoint provided by user. -+d) "vtarfslink" points to tmpfs-mountpath. -+ -+Usage: -+----- -+Mount: -+$ mount /tmp/vmtar.tar -t vtar -o /path/to/tmpfs-mountpath /path/to/mountpoint -+ -+This creates two mount entry: -+1) /path/to/tmpfs-mountpath as tmpfs which has all the files -+2) /path/to/mountpoint as vtar which has "vtarfslink" symlink to tmpfs-mountpath -+ -+Umount: -+$ umount /path/to/mountpoint -+ -+This will unmount both the mount entry. -diff --git a/fs/vtar/vtar.h b/fs/vtar/vtar.h -new file mode 100644 -index 000000000..c7d06b56b ---- /dev/null -+++ b/fs/vtar/vtar.h -@@ -0,0 +1,80 @@ -+/* -+ * Filesystem to directly mount tar archive. -+ * -+ * Copyright 2020 VMware, Inc. All Rights Reserved. -+ * SPDX-License-Identifier: GPL-2.0 -+ * -+ * Licensed under the GNU Lesser General Public License version 2 (the "License"); -+ * you may not use this file except in compliance with the License. The terms -+ * of the License are located in the LICENSE file of this distribution. -+ * -+ */ -+ -+#ifndef VTAR -+#define VTAR -+ -+#include -+ -+struct vtar_img_map_t { -+ struct file *fp; -+ struct address_space *tarfs_img_map; -+ void *data; -+}; -+ -+/* Values used in typeflag field. */ -+#define REGTYPE '0' /* regular file */ -+#define AREGTYPE '\0' /* regular file */ -+#define LNKTYPE '1' /* link */ -+#define SYMTYPE '2' /* reserved */ -+#define CHRTYPE '3' /* character special */ -+#define BLKTYPE '4' /* block special */ -+#define DIRTYPE '5' /* directory */ -+#define FIFOTYPE '6' /* FIFO special */ -+#define CONTTYPE '7' /* reserved */ -+ -+#define VTAR_MAGIC "visor " /* 8 chars and NULL */ -+ -+#define MAX_PAGES_PER_FILE (MAX_LFS_FILESIZE/PAGE_SIZE) -+ -+struct vtar_header_type -+{ /* byte offset */ -+ char name[100]; /* 0 */ -+ char mode[8]; /* 100 */ -+ char uid[8]; /* 108 */ -+ char gid[8]; /* 116 */ -+ char size[12]; /* 124 */ -+ char mtime[12]; /* 136 */ -+ char chksum[8]; /* 148 */ -+ char typeflag; /* 156 */ -+ char linkname[100]; /* 157 */ -+ char magic[6]; /* 257 */ -+ char version[2]; /* 263 */ -+ char uname[32]; /* 265 */ -+ char gname[32]; /* 297 */ -+ char devmajor[8]; /* 329 */ -+ char devminor[8]; /* 337 */ -+ char prefix[151]; /* 345 */ -+ unsigned int offset; /* 496 */ // Offset of the file in the archive -+ unsigned int textOffset; /* 500 */ // Offset of the text section in the file -+ unsigned int textSize; /* 504 */ // Size of text section -+ unsigned int numFixupPgs; /* 508 */ // Number of pages affected by relocation -+ /* 512 */ -+}; -+ -+static const struct inode_operations vtar_dir_inode_operations = { -+ .lookup = simple_lookup, -+}; -+ -+static struct super_operations vtar_super_ops = { -+ .statfs = simple_statfs, -+}; -+ -+struct vtar_mount_opts { -+ umode_t mode; -+}; -+ -+struct vtar_fs_info { -+ struct vtar_mount_opts mount_opts; -+}; -+ -+#endif -diff --git a/fs/vtar/vtarfs.c b/fs/vtar/vtarfs.c -new file mode 100644 -index 000000000..40b27bf25 ---- /dev/null -+++ b/fs/vtar/vtarfs.c -@@ -0,0 +1,536 @@ -+/* -+ * Filesystem to directly mount tar archive. -+ * -+ * Copyright 2020 VMware, Inc. All Rights Reserved. -+ * SPDX-License-Identifier: GPL-2.0 -+ * -+ * Licensed under the GNU Lesser General Public License version 2 (the "License"); -+ * you may not use this file except in compliance with the License. The terms -+ * of the License are located in the LICENSE file of this distribution. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "vtar.h" -+#include "../internal.h" -+ -+static struct vtar_img_map_t vtar_img_map; -+ -+static int vtar_do_mount(const char *dev_name, const char *dir_name, -+ const char *type_page, unsigned long flags, void *data_page) -+{ -+ struct path path; -+ int ret; -+ -+ ret = kern_path(dir_name, LOOKUP_FOLLOW, &path); -+ if (ret) -+ return ret; -+ ret = path_mount(dev_name, &path, type_page, flags, data_page); -+ path_put(&path); -+ return ret; -+} -+ -+static int vtar_umount(const char *name, int flags) -+{ -+ int lookup_flags = LOOKUP_MOUNTPOINT; -+ struct path path; -+ int ret; -+ -+ if (!(flags & UMOUNT_NOFOLLOW)) -+ lookup_flags |= LOOKUP_FOLLOW; -+ ret = kern_path(name, lookup_flags, &path); -+ if (ret) -+ return ret; -+ return path_umount(&path, flags); -+} -+ -+static int vtar_chdir(const char *filename) -+{ -+ struct path path; -+ int error; -+ -+ error = kern_path(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &path); -+ if (error) -+ return error; -+ error = inode_permission(&nop_mnt_idmap, path.dentry->d_inode, -+ MAY_EXEC | MAY_CHDIR); -+ if (!error) -+ set_fs_pwd(current->fs, &path); -+ path_put(&path); -+ return error; -+} -+ -+static int vtar_chown(const char *filename, uid_t user, gid_t group, int flags) -+{ -+ int lookup_flags = (flags & AT_SYMLINK_NOFOLLOW) ? 0 : LOOKUP_FOLLOW; -+ struct path path; -+ int error; -+ -+ error = kern_path(filename, lookup_flags, &path); -+ if (error) -+ return error; -+ error = mnt_want_write(path.mnt); -+ if (!error) { -+ error = chown_common(&path, user, group); -+ mnt_drop_write(path.mnt); -+ } -+ path_put(&path); -+ return error; -+} -+ -+static int vtar_chmod(const char *filename, umode_t mode) -+{ -+ struct path path; -+ int error; -+ -+ error = kern_path(filename, LOOKUP_FOLLOW, &path); -+ if (error) -+ return error; -+ error = chmod_common(&path, mode); -+ path_put(&path); -+ return error; -+} -+ -+static int vtar_symlink(const char *oldname, const char *newname) -+{ -+ struct dentry *dentry; -+ struct path path; -+ int error; -+ -+ dentry = kern_path_create(AT_FDCWD, newname, &path, 0); -+ if (IS_ERR(dentry)) -+ return PTR_ERR(dentry); -+ error = security_path_symlink(&path, dentry, oldname); -+ if (!error) -+ error = vfs_symlink(&nop_mnt_idmap, path.dentry->d_inode, -+ dentry, oldname); -+ done_path_create(&path, dentry); -+ return error; -+} -+ -+static int vtar_mkdir(const char *pathname, umode_t mode) -+{ -+ struct dentry *dentry; -+ struct path path; -+ int error; -+ -+ dentry = kern_path_create(AT_FDCWD, pathname, &path, LOOKUP_DIRECTORY); -+ if (IS_ERR(dentry)) -+ return PTR_ERR(dentry); -+ if (!IS_POSIXACL(path.dentry->d_inode)) -+ mode &= ~current_umask(); -+ error = security_path_mkdir(&path, dentry, mode); -+ if (!error) -+ error = vfs_mkdir(&nop_mnt_idmap,path.dentry->d_inode, -+ dentry, mode); -+ done_path_create(&path, dentry); -+ return error; -+} -+ -+ -+static char *build_name(struct vtar_header_type *header) -+{ -+ char *name; -+ size_t prefix_len = 0; -+ size_t name_len = 0; -+ char *prefix_end = memchr(header->prefix, '\0', sizeof(header->prefix)); -+ char *name_end = memchr(header->name, '\0', sizeof(header->name)); -+ -+ if (!prefix_end || !name_end) { -+ pr_err("%s : Header name is not proper!!", __func__); -+ return NULL; -+ } -+ prefix_len = prefix_end - header->prefix; -+ name_len = name_end - header->name; -+ -+ name = kzalloc(prefix_len + name_len + 1, GFP_KERNEL); -+ if (!name) { -+ pr_err("%s: Unable to allocate memory for full name!!, error=%ld ", __func__, PTR_ERR(name)); -+ return NULL; -+ } -+ -+ memcpy(name, header->prefix, prefix_len); -+ memcpy(name + prefix_len, header->name, name_len); -+ name[prefix_len + name_len] = 0x0; -+ -+ /* -+ * the entry is a directory, if path name ends with '/' -+ */ -+ if (name[prefix_len + name_len - 1] == '/') -+ name[prefix_len + name_len - 1] = 0x0; -+ -+ return name; -+ -+} -+ -+static ssize_t xadd_pages(struct file *wfile, struct vtar_header_type *header) -+{ -+ ssize_t ret = 0; -+ struct page *page; -+ size_t count = 0; -+ int pn; -+ int pages; -+ struct address_space *mapping; -+ gfp_t gfp_mask; -+ -+ if (kstrtouint(header->size, 8, (unsigned int *)&count) != 0) { -+ pr_err("%s: failed to read size", __func__); -+ return ret; -+ } -+ pages = (count + PAGE_SIZE - 1) >> PAGE_SHIFT; -+ mapping = wfile->f_mapping; -+ gfp_mask = mapping->gfp_mask | __GFP_WRITE; -+ -+ for (pn = 0; pn < pages; pn++) { -+ page = read_mapping_page(vtar_img_map.tarfs_img_map, (header->offset >> PAGE_SHIFT) + pn, NULL); -+ if (IS_ERR(page)) { -+ pr_err("%s: read_mapping_page failed ret=%lu", __func__, PTR_ERR(page)); -+ return PTR_ERR(page); -+ } -+ ret = add_to_page_cache_lru(page, mapping, pn, gfp_mask); -+ if (ret) { -+ pr_err("%s: failed add_to_page_cache_lru ret=%lu", __func__, ret); -+ put_page(page); -+ goto out; -+ } -+ SetPageUptodate(page); -+ set_page_dirty(page); -+ unlock_page(page); -+ put_page(page); -+ } -+ ret = count; -+ mapping->host->i_size = count; -+out: -+ return ret; -+} -+ -+static int vtar_read_entry(off_t offset) -+{ -+ struct vtar_header_type header; -+ struct page *page = NULL; -+ void *k_mapped_page = NULL; -+ int openflags; -+ struct file *wfile; -+ char *dir_name; -+ char *base_name = NULL; -+ char *full_name = NULL; -+ umode_t mode; -+ uid_t uid; -+ gid_t gid; -+ -+ page = read_mapping_page(vtar_img_map.tarfs_img_map, offset >> PAGE_SHIFT, NULL); -+ if (IS_ERR(page)) { -+ pr_err("%s: page map failure %ld",__func__, PTR_ERR(page)); -+ return -EINVAL; -+ } -+ k_mapped_page = kmap(page); -+ if (!k_mapped_page) { -+ pr_err("%s: kmap failure %ld",__func__, PTR_ERR(k_mapped_page)); -+ return -EINVAL; -+ } -+ memcpy(&header, k_mapped_page + (offset % PAGE_SIZE), sizeof(struct vtar_header_type)); -+ kunmap(k_mapped_page); -+ -+ /* Check for the header magic value */ -+ if (memcmp(header.magic, VTAR_MAGIC, sizeof(header.magic)) != 0) { -+ pr_debug("%s: magic=%s",__func__,header.magic); -+ return -EINVAL; -+ } -+ -+ /* Parse the data length from the header */ -+ if (kstrtouint(header.mode, 8, (unsigned int *)&mode) != 0) { -+ pr_err("%s: failed to read mode",__func__); -+ return -EINVAL; -+ } -+ if (kstrtouint(header.uid, 8, (unsigned int *)&uid) != 0) { -+ pr_err("%s: failed to read uid",__func__); -+ return -EINVAL; -+ } -+ if (kstrtouint(header.gid, 8, (unsigned int *)&gid) !=0) { -+ pr_err("%s: failed to read gid",__func__); -+ return -EINVAL; -+ } -+ full_name = build_name(&header); -+ if (!full_name) { -+ pr_err("%s: name allocation error",__func__); -+ return -EINVAL; -+ } -+ base_name = strrchr(full_name, '/'); -+ if (base_name) { -+ *base_name = 0x0; -+ base_name++; -+ } else { -+ base_name = full_name; -+ full_name = base_name + strlen(base_name); -+ } -+ dir_name = full_name; -+ if (header.typeflag == DIRTYPE) { -+ vtar_mkdir(base_name, mode); -+ vtar_chown(base_name, uid, gid, 0); -+ vtar_chmod(base_name, mode); -+ } else if (header.typeflag == SYMTYPE) { -+ if (strlen(dir_name) != 0) { -+ vtar_chdir(dir_name); -+ } -+ vtar_symlink(header.linkname, base_name); -+ vtar_chown(base_name, uid, gid, 0); -+ vtar_chmod(base_name, mode); -+ } else { -+ openflags = O_WRONLY|O_CREAT; -+ if (strlen(dir_name) != 0) { -+ vtar_chdir(dir_name); -+ } -+ wfile = filp_open(base_name, openflags, mode); -+ if (IS_ERR(wfile)) -+ goto out; -+ vfs_fchown(wfile, uid, gid); -+ vfs_fchmod(wfile, mode); -+ xadd_pages(wfile, &header); -+ fput(wfile); -+ } -+ -+out: -+ if (dir_name < base_name) -+ kfree(dir_name); -+ else -+ kfree(base_name); -+ -+ return 0; -+} -+ -+static int vtar_parse_mount_ops(char *data, struct vtar_mount_opts *opts) -+{ -+ -+ /*TODO: Hardcode it to Read Only mode */ -+ opts->mode = S_IRUGO | S_IXUGO; -+ -+ return 0; -+} -+ -+static int vtar_open(void) -+{ -+ unsigned int offset = 0; -+ int ret=0, first=0; -+ -+ ret = vtar_read_entry(offset); -+ first = ret; -+ -+ while (!ret) { -+ /* Read next header */ -+ offset += sizeof(struct vtar_header_type); -+ ret = vtar_read_entry(offset); -+ } -+ return first; -+} -+ -+struct inode *vtar_create_inode(struct super_block *sb, umode_t mode) -+{ -+ struct timespec64 ts; -+ struct inode * inode = new_inode(sb); -+ -+ if ( !inode ) { -+ pr_err("%s: Failed to allocate new inode %ld", __func__, PTR_ERR(inode)); -+ return NULL; -+ } -+ -+ ts = current_time(inode); -+ inode->i_ino = get_next_ino(); -+ inode->i_mode = mode; -+ inode->i_uid = current_fsuid(); -+ inode->i_gid = current_fsgid(); -+ inode_set_atime_to_ts(inode, ts); -+ inode_set_mtime_to_ts(inode, ts); -+ inode_set_ctime_to_ts(inode, ts); -+ inode->i_sb = sb; -+ inode->i_fop = &simple_dir_operations; -+ -+ return inode; -+} -+ -+static int vtar_fill_super(struct super_block *sb, void *data, int silent) -+{ -+ struct vtar_fs_info * info = NULL; -+ struct inode *inode = NULL; -+ struct dentry *dentry = NULL; -+ int err = -EINVAL; -+ -+ info = kzalloc(sizeof(struct vtar_fs_info), GFP_KERNEL); -+ if ( IS_ERR(info) ) { -+ pr_err("%s: Error in allocating memore for vtar_fs_info %ld", __func__, PTR_ERR(info)); -+ return PTR_ERR(info); -+ } -+ sb->s_fs_info = info; -+ /* TODO : Hard code the mount ops to read only mode */ -+ err = vtar_parse_mount_ops( data, &info->mount_opts); -+ if ( err ) { -+ pr_err("%s: Error in reading mount options for vmware tarfs! error:%d", __func__, err); -+ goto err_fill_super; -+ } -+ sb->s_maxbytes = MAX_LFS_FILESIZE; -+ sb->s_blocksize = PAGE_SIZE; -+ sb->s_blocksize_bits = PAGE_SHIFT; -+ if (kstrtoul(VTAR_MAGIC,8,&sb->s_magic) != 0) { -+ pr_debug("%s: failed to read magic number %s",__func__,VTAR_MAGIC); -+ } -+ sb->s_op = &vtar_super_ops; -+ sb->s_time_gran = 1; -+ sb->s_flags |= MS_RDONLY | MS_NOATIME; /* Read only file system */ -+ -+ vtar_chdir(data); -+ if ((err = vtar_open()) < 0) { -+ pr_err("%s:failed to read tar index, error:%d", __func__, err); -+ goto err_fill_super; -+ } -+ inode = new_inode(sb); -+ if (!inode) { -+ pr_err("%s: Failed to allocate new inode!", __func__); -+ err = PTR_ERR(inode); -+ goto err_fill_super; -+ } -+ inode = vtar_create_inode(sb, S_IFDIR | info->mount_opts.mode); -+ inode->i_mapping->a_ops = &ram_aops; -+ mapping_set_gfp_mask(inode->i_mapping, GFP_HIGHUSER); -+ mapping_set_unevictable(inode->i_mapping); -+ inode->i_op = &vtar_dir_inode_operations; -+ inode_init_owner(&nop_mnt_idmap, inode, NULL, -+ (S_IFDIR | info->mount_opts.mode)); -+ inc_nlink(inode); -+ sb->s_root = d_make_root(inode); -+ if ( !sb->s_root ) { -+ pr_err("%s: Error in creating root point for vmware tarfs!", __func__); -+ iput(inode); -+ err = PTR_ERR(sb->s_root); -+ goto err_fill_super; -+ } -+ dentry = d_alloc_name(sb->s_root, "vtarfslink"); -+ if (!dentry) { -+ pr_err("%s: Error in creating symlink dentry %ld!", __func__, PTR_ERR(dentry)); -+ dput(sb->s_root); -+ err = PTR_ERR(dentry); -+ goto err_fill_super; -+ } -+ inode = vtar_create_inode(sb, S_IFLNK | MS_RDONLY | MS_NOATIME); -+ if (IS_ERR(inode)) { -+ pr_err("%s: Error in creating symlink inode %ld!", __func__, PTR_ERR(inode)); -+ dput(sb->s_root); -+ dput(dentry); -+ err = PTR_ERR(inode); -+ goto err_fill_super; -+ } -+ inode->i_op = &page_symlink_inode_operations; -+ inode->i_link = data; -+ d_add(dentry, inode); -+ return 0; -+ -+err_fill_super: -+ kfree(info); -+ return err; -+} -+ -+static struct dentry *vtar_mount(struct file_system_type *fs_type, int flags, -+ const char *dev_name, void *data) -+{ -+ struct file *fp = NULL; -+ int ret = 0; -+ -+ pr_debug("%s: dev_name = %s, data=%s",__func__, dev_name, (char *)data); -+ fp = filp_open(dev_name, O_RDONLY, 0); -+ if (IS_ERR(fp)) { -+ pr_err("\n Failed to open the file %s for mount %ld\n", -+ dev_name, PTR_ERR(fp)); -+ return NULL; -+ } -+ vtar_img_map.tarfs_img_map = (void *)fp->f_mapping; -+ vtar_img_map.fp = fp; -+ -+ pr_debug("%s: Size of mapping img file is %lld , map_ptr = %p", __func__, vtar_img_map.tarfs_img_map->host->i_size, vtar_img_map.tarfs_img_map); -+ if (memcmp(vtar_img_map.tarfs_img_map->host->i_sb->s_type->name, "tmpfs", 5) != 0) { -+ pr_err("%s: Error: Input tar file = %s not found in 'tmpfs'",__func__, dev_name); -+ filp_close(fp, NULL); -+ return NULL; -+ } -+ vtar_img_map.data = kstrdup(data, GFP_KERNEL); -+ vtar_mkdir(vtar_img_map.data, 0755); -+ ret = vtar_do_mount("tmpfs", vtar_img_map.data, "tmpfs", MS_SILENT, NULL); -+ if (ret) { -+ pr_err("%s: Failed to mount %s as tmpfs! Error:%d",__func__, (char *)vtar_img_map.data, ret); -+ do_rmdir(AT_FDCWD, getname_kernel(vtar_img_map.data)); -+ kfree(vtar_img_map.data); -+ filp_close(fp, NULL); -+ return NULL; -+ } -+ return mount_nodev(fs_type, flags, vtar_img_map.data, &vtar_fill_super); -+} -+ -+static void vtar_kill_super(struct super_block *sb) -+{ -+ pr_info("%s: Kill super", __func__); -+ -+ evict_inodes(sb); -+ kfree(sb->s_fs_info); -+ sb->s_fs_info = NULL; -+ kill_litter_super(sb); -+ vtar_chdir("/"); -+ vtar_umount(vtar_img_map.data, MNT_FORCE); -+ do_rmdir(AT_FDCWD, getname_kernel(vtar_img_map.data)); -+ kfree(vtar_img_map.data); -+ filp_close(vtar_img_map.fp, NULL); -+} -+ -+static struct file_system_type vtar_type = { -+ -+ .owner = THIS_MODULE, -+ -+ .name = "vtar", -+ -+ .mount = vtar_mount, -+ -+ .kill_sb = vtar_kill_super, -+ -+ .fs_flags = FS_USERNS_MOUNT | FS_BINARY_MOUNTDATA, -+ -+}; -+ -+static int __init vtar_init(void) -+{ -+ int err = 0; -+ -+ pr_info("%s: filesystem module load start", __func__); -+ err = register_filesystem(&vtar_type); -+ if (unlikely(err)) { -+ pr_err("%s: Failed to register vmware tarfs type %d. Exiting\n", __func__, err); -+ goto err; -+ } -+ pr_debug("%s: filesystem module registered", __func__); -+ return 0; -+err: -+ return err; -+} -+ -+static void __exit vtar_exit(void) -+{ -+ int err = 0; -+ -+ pr_info("%s: filesystem module unload", __func__); -+ err = unregister_filesystem(&vtar_type); -+ -+ if (unlikely(err)) -+ pr_err("%s: Failed to unregister vmware tarfs filesystem %d", __func__, err); -+} -+ -+module_init(vtar_init); -+module_exit(vtar_exit); -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("VMware Photon OS : Srinidhi Rao "); -+MODULE_AUTHOR("VMware Photon OS : Ankit Jain "); --- -2.39.4 - diff --git a/SPECS/91/linux/esx/0001-init-main.c-drain-per-CPU-page-caches-after-boot-tim.patch b/SPECS/91/linux/esx/0001-init-main.c-drain-per-CPU-page-caches-after-boot-tim.patch deleted file mode 100644 index 1bb1d9544d..0000000000 --- a/SPECS/91/linux/esx/0001-init-main.c-drain-per-CPU-page-caches-after-boot-tim.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 7c7bb854dc4f4a8e0961e7211dba8d353b790522 Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Tue, 25 Aug 2026 20:41:28 +0000 -Subject: [PATCH] init/main.c: drain per-CPU page caches after boot-time memory - frees - -free_initmem()/mark_readonly() release several MB of memory back to -the allocator during boot (unused kernel image, decrypted memory, -initrd, text/rodata and rodata/data alignment gaps). These frees can -leave a large burst of pages sitting in the per-CPU pagevec (pcp) -caches instead of the zone's shared free list, because -NR_FREE_PAGES/MemFree is only updated when a page lands on the shared -free list, not merely when cached per-CPU. - -mm/page_alloc.c's adaptive pcp->high heuristic grows the per-CPU cache -watermark in response to bursts of consecutive same-CPU frees with no -intervening allocation, and does not shrink back down until enough -allocation activity happens afterward (or memory pressure/compaction -forces a drain). On a canister-enabled build, whose larger/differently -structured __init section causes a bigger such burst than a -non-canister build, this was observed to strand ~7MB in the boot CPU's -pcp list: - - # before this patch (canister build) - pagesets - cpu: 0 - count: 1891 - high: 2310 - Mem: total=107 used=15 free=90 (MB) - - # after this patch - pagesets - cpu: 0 - count: 16 - high: 2310 - Mem: total=107 used=8 free=98 (MB) - -This memory was never lost or leaked -- it is fully usable and gets -reclaimed into MemFree the moment normal allocation activity occurs -- -but the delay makes any memory-overhead measurement taken shortly -after boot non-deterministic and dependent on exactly how the boot-time -free bursts interact with this heuristic. Explicitly drain all pcp -lists once the boot-time frees are done and before userspace starts, so -/proc/meminfo reflects real, settled numbers from the first read. - -Signed-off-by: Alexey Makhalov ---- - init/main.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/init/main.c b/init/main.c -index 73ebd2dcb..c17b4c770 100644 ---- a/init/main.c -+++ b/init/main.c -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -1455,6 +1456,17 @@ static int __ref kernel_init(void *unused) - free_initmem(); - mark_readonly(); - -+ /* -+ * The various free_*_mem() calls above can leave a large burst of -+ * freed pages stranded in the per-CPU pagevec caches (pcp lists), -+ * since NR_FREE_PAGES/MemFree is only updated when a page actually -+ * lands on the zone's shared free list, not when it is cached -+ * per-CPU. Drain explicitly here so boot-time memory accounting is -+ * deterministic instead of depending on when the adaptive pcp->high -+ * heuristic happens to shrink back down. -+ */ -+ drain_all_pages(NULL); -+ - /* - * Kernel mappings are now finalized - update the userspace page-table - * to finalize PTI. --- -2.43.7 - diff --git a/SPECS/91/linux/esx/0001-initialize-MMCONFIG-if-already-not-initialized.patch b/SPECS/91/linux/esx/0001-initialize-MMCONFIG-if-already-not-initialized.patch deleted file mode 100644 index 50cc38043a..0000000000 --- a/SPECS/91/linux/esx/0001-initialize-MMCONFIG-if-already-not-initialized.patch +++ /dev/null @@ -1,82 +0,0 @@ -From c774b5b0a28147771ed7a24d5cc0d38d7cf6ec9a Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Wed, 13 Nov 2024 16:18:22 +0000 -Subject: [PATCH] initialize MMCONFIG, if already not initialized - -For CRX, guest needs to initialize MMCONFIG. - -Signed-off-by: Ajay Kaher -Signed-off-by: Bo Gan ---- - arch/x86/pci/mmconfig-shared.c | 41 ++++++++++++++++++++++++++++++++++ - 1 file changed, 41 insertions(+) - -diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c -index 39255f0..5c2f7df 100644 ---- a/arch/x86/pci/mmconfig-shared.c -+++ b/arch/x86/pci/mmconfig-shared.c -@@ -25,6 +25,7 @@ - #include - #include - #include -+#include - - /* Indicate if the ECAM resources have been placed into the resource table */ - static bool pci_mmcfg_running_state; -@@ -572,6 +573,9 @@ static bool __ref pci_mmcfg_reserved(struct device *dev, - } - } - -+ if(cfg->res.flags & IORESOURCE_BUSY) -+ return true; -+ - /* - * e820__mapped_all() is marked as __init. - * All entries from ACPI MCFG table have been checked at boot time. -@@ -711,6 +715,43 @@ static void __init __pci_mmcfg_init(int early) - - static int __initdata known_bridge; - -+#define PCI_REG_MMCONFIG 0xc4 -+#define VMW_EXTCFG_MMCFG_SIZE (128 << 20) -+ -+int __init pci_mmcfg_self_init(void) -+{ -+ u32 mm_config = 0x0; -+ struct pci_mmcfg_region *cfg; -+ -+ if (x86_hyper_type != X86_HYPER_VMWARE) -+ return 0; -+ -+ /* Read current MMCONFIG address from chipset */ -+ if (pci_direct_conf1.read(0, 0, 0, PCI_REG_MMCONFIG, 4, -+ &mm_config) < 0) -+ return -EINVAL; -+ -+ if(!mm_config) { -+ mm_config = 0xe0000000; -+ -+ if (pci_direct_conf1.write(0, 0, 0, PCI_REG_MMCONFIG, 4, -+ mm_config | 0x3 ) < 0) { -+ return -EINVAL; -+ } -+ -+ cfg = pci_mmconfig_add(0, 0x0, 0x7f, mm_config); -+ if (cfg == NULL) { -+ return -ENOMEM; -+ } -+ __pci_mmcfg_init(0); -+ -+ if (!cfg->res.parent) -+ insert_resource(&iomem_resource, &cfg->res); -+ } -+ return 0; -+} -+subsys_initcall(pci_mmcfg_self_init); -+ - void __init pci_mmcfg_early_init(void) - { - pr_debug("%s() pci_probe %#x\n", __func__, pci_probe); --- -2.39.0 - diff --git a/SPECS/91/linux/esx/0001-initramfs-support-for-page-aligned-format-newca.patch b/SPECS/91/linux/esx/0001-initramfs-support-for-page-aligned-format-newca.patch deleted file mode 100644 index e3ff703139..0000000000 --- a/SPECS/91/linux/esx/0001-initramfs-support-for-page-aligned-format-newca.patch +++ /dev/null @@ -1,406 +0,0 @@ -From db755b4f964fa301ec305625911db7c4b910a617 Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Wed, 13 Nov 2024 11:54:05 +0000 -Subject: [PATCH] initramfs: support for page aligned format "newca" - - NEWCA format - -"newca" archive format (header 0707ca) is similar to "newc" -format (header 070701) but with page aligned regular files -data. - -Generated "newca" file is bigger than "newc", but advantage -is that pages with files content can be used by page cache -as is without copying. It allows 1) to speed up the boot -process (zero copy), and 2) to share initrd memory provided -by hypervisor between VMs to get better memory density. - -Introduces new function: xadd_pages to put file content -pages to its page cache mapping. Initramfs extraction -logic will use xadd_pages instead of xwrite for "newca" -archive format. - -In addition, initrd memory will not be freed for "newca" as -it is used by page caches. - - Page sharing - -"newca" format actively used by CRX. For shared images it may -map initrds from host visorfs to the guest physical address space -to avoid copying (known as a page sharing). In this case guest -should not free and reuse those pages. - - Multi image - -CRX often use concatenation of initrds, so introduce support -of multiple image extraction support - -If there is a mix of newc and newca images in initramfs, -we blindly retain the entire initramfs. -We track the start and end offsets of each individual newc image, -while combining adjacent images into larger blobs. -We can then free these newc encoded sections of the initramfs - - Large files - -ASCII cpio format (070701/070702) header uses 32bit field to store the -size of the file. It limits maximum file size incide cpio to 4GB. -NEWCA format (0707ca) inherited the same limitation. - -There is a last field in ascii cpio header - checksum. It is used -only in 070702 (newc with checksum). This field is not used and always -zero in 070701 and 0707ca. - -Checksum field can be used in NEWCA format to store high 4 bytes of the -filesize. No header change required. This will support previously -created images. - - New cmdline parameters - -* mlock_initrd - lock zero copied newca pages. It must be set if these -pages are mapped by the host. -* panic_on_initramfs_error - panic one initrd layer overwrites file(s) of -previous layer(s). - -Signed-off-by: Alexey Makhalov -Signed-off-by: Bo Gan -Signed-off-by: Him Kalyan Bordoloi ---- - init/initramfs.c | 193 ++++++++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 183 insertions(+), 10 deletions(-) - -diff --git a/init/initramfs.c b/init/initramfs.c -index b2f7583bb..b47d3abbd 100644 ---- a/init/initramfs.c -+++ b/init/initramfs.c -@@ -20,6 +20,79 @@ - #include - - #include "do_mounts.h" -+#include -+#include -+ -+static bool page_aligned_fmt __initdata; -+ -+static int __initdata do_retain_initrd; -+ -+static __initdata bool mlock_initrd = false; -+ -+static __initdata bool panic_on_initramfs_error = false; -+ -+static __initdata bool end_of_image = false; -+ -+static __initdata LIST_HEAD(initramfs_image_list); -+ -+struct initramfs_image { -+ struct list_head list; -+ loff_t start_offset; -+ loff_t end_offset; -+}; -+ -+/* -+ * NEWCA pages must be mlocked if they were shared by the host. -+ * As we do not want them to be swapped or moved. -+ */ -+static int __init mlock_initrd_setup(char *__unused) -+{ -+ mlock_initrd = true; -+ return 1; -+} -+__setup("mlock_initrd", mlock_initrd_setup); -+ -+static int __init panic_on_initramfs_error_setup(char *__unused) -+{ -+ panic_on_initramfs_error = true; -+ return 1; -+} -+__setup("panic_on_initramfs_error", panic_on_initramfs_error_setup); -+ -+/* -+ * Add file pages directly to fd's page cache. -+ */ -+static int __init xadd_pages(struct file *file, const char *p, size_t count, -+ loff_t *pos) -+{ -+ struct page *page; -+ size_t pages = (count + PAGE_SIZE - 1) >> PAGE_SHIFT; -+ struct address_space *mapping = file->f_mapping; -+ gfp_t gfp_mask = mapping->gfp_mask | __GFP_WRITE; -+ pgoff_t pgoff = *pos >> PAGE_SHIFT; -+ struct folio *folio; -+ int err = 0; -+ -+ for (; pages--; ++pgoff, p += PAGE_SIZE) { -+ page = virt_to_page(p); -+ -+ -+ err = add_to_page_cache_lru(page, mapping, pgoff, gfp_mask); -+ if (err) -+ goto out; -+ -+ folio = page_folio(page); -+ folio_mark_uptodate(folio); -+ folio_mark_dirty(folio); -+ if (mlock_initrd) -+ folio_set_mlocked(folio); -+ folio_unlock(folio); -+ *pos += PAGE_SIZE; -+ } -+ err = count; -+out: -+ return err; -+} - - static __initdata bool csum_present; - static __initdata u32 io_csum; -@@ -29,6 +102,15 @@ static ssize_t __init xwrite(struct file *file, const unsigned char *p, - { - ssize_t out = 0; - -+ /* Do zero copy for not compressed NEWCA */ -+ if (page_aligned_fmt && p >= (unsigned char *)initrd_start && -+ p < (unsigned char *)initrd_end) { -+ BUG_ON(*pos & ~PAGE_MASK); -+ BUG_ON((uintptr_t)p & ~PAGE_MASK); -+ -+ return xadd_pages(file, p, count, pos); -+ } -+ - /* sys_write only can write MAX_RW_COUNT aka 2G-4K bytes at most */ - while (count) { - ssize_t rv = kernel_write(file, p, count, pos); -@@ -208,6 +290,8 @@ static void __init parse_header(char *s) - rdev = new_encode_dev(MKDEV(parsed[9], parsed[10])); - name_len = parsed[11]; - hdr_csum = parsed[12]; -+ if (page_aligned_fmt) -+ body_len |= parsed[12] << 32; - } - - /* FSM */ -@@ -227,7 +311,7 @@ static __initdata char *victim; - static unsigned long byte_count __initdata; - static __initdata loff_t this_header, next_header; - --static inline void __init eat(unsigned n) -+static inline void __init eat(unsigned long n) - { - victim += n; - this_header += n; -@@ -276,10 +360,20 @@ static int __init do_collect(void) - - static int __init do_header(void) - { -+ static bool newca_found = 0; - if (!memcmp(collected, "070701", 6)) { - csum_present = false; -+ page_aligned_fmt = false; - } else if (!memcmp(collected, "070702", 6)) { - csum_present = true; -+ page_aligned_fmt = false; -+ } else if (!memcmp(collected, "0707ca", 6)) { -+ if (!newca_found) { -+ printk(KERN_INFO "Page aligned format detected\n"); -+ newca_found = 1; -+ } -+ csum_present = false; -+ page_aligned_fmt = true; - } else { - if (memcmp(collected, "070707", 6) == 0) - error("incorrect cpio method used: use -H newc option"); -@@ -288,7 +382,17 @@ static int __init do_header(void) - return 1; - } - parse_header(collected); -- next_header = this_header + N_ALIGN(name_len) + body_len; -+ next_header = this_header + N_ALIGN(name_len); -+ /* -+ * If regular file has 0 size, old cpio tool will include empty -+ * alignment page but new cpio tool does not do that and puts -+ * next header right after. Handle both cases here. */ -+ if (page_aligned_fmt && S_ISREG(mode)) -+ if (body_len || (body_len == 0 && -+ memcmp(collected + 110 + N_ALIGN(name_len), -+ "\0\0\0\0", 4) == 0)) -+ next_header = PAGE_ALIGN(next_header); -+ next_header += body_len; - next_header = (next_header + 3) & ~3; - state = SkipIt; - if (name_len <= 0 || name_len > PATH_MAX) -@@ -353,6 +457,16 @@ static int __init maybe_link(void) - return 0; - } - -+static int __init is_overwrite(char *path) -+{ -+ struct kstat st; -+ -+ if (!init_stat(path, &st, AT_SYMLINK_NOFOLLOW) && S_ISREG(st.mode)) { -+ return 1; -+ } -+ return 0; -+} -+ - static __initdata struct file *wfile; - static __initdata loff_t wfile_pos; - -@@ -370,6 +484,7 @@ static int __init do_name(void) - } - - if (strcmp(collected, "TRAILER!!!") == 0) { -+ end_of_image = true; - free_hash(); - return 0; - } -@@ -378,8 +493,13 @@ static int __init do_name(void) - int ml = maybe_link(); - if (ml >= 0) { - int openflags = O_WRONLY|O_CREAT|O_LARGEFILE; -- if (ml != 1) -+ if (ml != 1) { -+ if (panic_on_initramfs_error && -+ is_overwrite(collected)) -+ panic("initramfs: file already " -+ "exists %s", collected); - openflags |= O_TRUNC; -+ } - wfile = filp_open(collected, openflags, mode); - if (IS_ERR(wfile)) - return 0; -@@ -411,6 +531,10 @@ static int __init do_name(void) - - static int __init do_copy(void) - { -+ if (page_aligned_fmt && !PAGE_ALIGNED(victim)) -+ /* Align file start to the next page boundary */ -+ eat(PAGE_ALIGN((loff_t)victim) - (loff_t)victim); -+ - if (byte_count >= body_len) { - if (xwrite(wfile, victim, body_len, &wfile_pos) != body_len) - error("write error"); -@@ -503,6 +627,8 @@ static char * __init unpack_to_rootfs(char *buf, unsigned long len) - decompress_fn decompress; - const char *compress_name; - static __initdata char msg_buf[64]; -+ char *buf_start = buf; -+ static loff_t current_image_offset = 0; - - header_buf = kmalloc(110, GFP_KERNEL); - symlink_buf = kmalloc(PATH_MAX + N_ALIGN(PATH_MAX) + 1, GFP_KERNEL); -@@ -515,19 +641,20 @@ static char * __init unpack_to_rootfs(char *buf, unsigned long len) - this_header = 0; - message = NULL; - while (!message && len) { -+ struct initramfs_image *image = NULL; - loff_t saved_offset = this_header; - if (*buf == '0' && !(this_header & 3)) { - state = Start; - written = write_buffer(buf, len); - buf += written; - len -= written; -- continue; -+ goto loopend; - } - if (!*buf) { - buf++; - len--; - this_header++; -- continue; -+ goto loopend; - } - this_header = 0; - decompress = decompress_method(buf, len, &compress_name); -@@ -551,6 +678,46 @@ static char * __init unpack_to_rootfs(char *buf, unsigned long len) - this_header = saved_offset + my_inptr; - buf += my_inptr; - len -= my_inptr; -+ loopend: -+ if (!end_of_image) -+ continue; -+ -+ end_of_image = false; -+ -+ /* We don't need to track this image if: -+ * it's not a bootloader supplied initramfs -+ * retain_initrd parameter is set in cmdline -+ * the image is in page aligned format -+ */ -+ if ((char *)initrd_start != buf_start) -+ continue; -+ if (do_retain_initrd) -+ continue; -+ if (page_aligned_fmt) { -+ current_image_offset = this_header; -+ continue; -+ } -+ -+ /* Get last added image */ -+ if (!list_empty(&initramfs_image_list)) -+ image = list_last_entry(&initramfs_image_list, -+ struct initramfs_image, list); -+ -+ /* -+ * Check if we can avoid creating a new element by extending -+ * adjacent one -+ */ -+ if (!image || image->end_offset + 1 != current_image_offset) { -+ image = kmalloc(sizeof(struct initramfs_image), -+ GFP_KERNEL); -+ if (!image) -+ panic("Can't allocate memory to track " -+ "initramfs image"); -+ image->start_offset = current_image_offset; -+ list_add_tail(&image->list, &initramfs_image_list); -+ } -+ image->end_offset = this_header - 1; -+ current_image_offset = this_header; - } - dir_utime(); - kfree(name_buf); -@@ -559,8 +726,6 @@ static char * __init unpack_to_rootfs(char *buf, unsigned long len) - return message; - } - --static int __initdata do_retain_initrd; -- - static int __init retain_initrd_param(char *str) - { - if (*str) -@@ -588,7 +753,6 @@ __setup("initramfs_async=", initramfs_async_setup); - - extern char __initramfs_start[]; - extern unsigned long __initramfs_size; --#include - #include - - static BIN_ATTR(initrd, 0440, sysfs_bin_attr_simple_read, NULL, 0); -@@ -723,6 +887,8 @@ static void __init do_populate_rootfs(void *unused, async_cookie_t cookie) - #ifdef CONFIG_BLK_DEV_RAM - populate_initrd_image(err); - #else -+ if (panic_on_initramfs_error) -+ panic("Initramfs unpacking failed: %s", err); - printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err); - #endif - } -@@ -735,8 +901,15 @@ static void __init do_populate_rootfs(void *unused, async_cookie_t cookie) - * free only memory that is not part of crashkernel region. - */ - if (!do_retain_initrd && initrd_start && !kexec_free_initrd()) { -- free_initrd_mem(initrd_start, initrd_end); -- } else if (do_retain_initrd && initrd_start) { -+ struct initramfs_image *image, *tmp; -+ list_for_each_entry_safe(image, tmp, &initramfs_image_list, -+ list) { -+ free_initrd_mem(initrd_start + image->start_offset, -+ initrd_start + image->end_offset); -+ list_del(&image->list); -+ kfree(image); -+ } -+ } else if (do_retain_initrd && initrd_start) { - bin_attr_initrd.size = initrd_end - initrd_start; - bin_attr_initrd.private = (void *)initrd_start; - if (sysfs_create_bin_file(firmware_kobj, &bin_attr_initrd)) --- -2.35.6 - diff --git a/SPECS/91/linux/esx/0001-linux-esx-Add-SBX-DTLS-kernel-module.patch b/SPECS/91/linux/esx/0001-linux-esx-Add-SBX-DTLS-kernel-module.patch deleted file mode 100644 index e4b14b8769..0000000000 --- a/SPECS/91/linux/esx/0001-linux-esx-Add-SBX-DTLS-kernel-module.patch +++ /dev/null @@ -1,937 +0,0 @@ -From cff726abfe875f94a2ec9c2be00289d3461467e6 Mon Sep 17 00:00:00 2001 -From: Satish Ramachandran -Date: Thu, 15 Jan 2026 17:31:06 -0800 -Subject: [PATCH 01/12] linux-esx: Add SBX DTLS kernel module. - -This kernel driver is for the SBX DTLS virtual device. This driver -helps the userspace applications (like SDP) to communicate with the -SBX device which facilitates the sharing of memory between the workload -VMs and the SCRX. - -Signed-off-by: Satish Ramachandran ---- - drivers/misc/Kconfig | 1 + - drivers/misc/Makefile | 1 + - drivers/misc/vmw_sbx_dtls/Kconfig | 12 + - drivers/misc/vmw_sbx_dtls/Makefile | 6 + - drivers/misc/vmw_sbx_dtls/sbx_dtls.c | 611 +++++++++++++++++++++ - drivers/misc/vmw_sbx_dtls/sbx_dtls_ioctl.h | 79 +++ - drivers/misc/vmw_sbx_dtls/sbx_dtls_reg.h | 148 +++++ - 7 files changed, 858 insertions(+) - create mode 100644 drivers/misc/vmw_sbx_dtls/Kconfig - create mode 100644 drivers/misc/vmw_sbx_dtls/Makefile - create mode 100644 drivers/misc/vmw_sbx_dtls/sbx_dtls.c - create mode 100644 drivers/misc/vmw_sbx_dtls/sbx_dtls_ioctl.h - create mode 100644 drivers/misc/vmw_sbx_dtls/sbx_dtls_reg.h - -diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig -index 83b2a4b18..dcfe77b30 100644 ---- a/drivers/misc/Kconfig -+++ b/drivers/misc/Kconfig -@@ -630,4 +630,5 @@ source "drivers/misc/mchp_pci1xxxx/Kconfig" - source "drivers/misc/keba/Kconfig" - source "drivers/misc/vmw_extcfg/Kconfig" - source "drivers/misc/vmw_sbx/Kconfig" -+source "drivers/misc/vmw_sbx_dtls/Kconfig" - endmenu -diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile -index 9ed76f7fa..e4f21eccc 100644 ---- a/drivers/misc/Makefile -+++ b/drivers/misc/Makefile -@@ -71,6 +71,7 @@ obj-$(CONFIG_TPS6594_ESM) += tps6594-esm.o - obj-$(CONFIG_TPS6594_PFSM) += tps6594-pfsm.o - obj-$(CONFIG_VMWARE_EXTCFG) += vmw_extcfg/ - obj-$(CONFIG_SBX) += vmw_sbx/ -+obj-$(CONFIG_SBX_DTLS) += vmw_sbx_dtls/ - obj-$(CONFIG_NSM) += nsm.o - obj-$(CONFIG_MARVELL_CN10K_DPI) += mrvl_cn10k_dpi.o - obj-y += keba/ -diff --git a/drivers/misc/vmw_sbx_dtls/Kconfig b/drivers/misc/vmw_sbx_dtls/Kconfig -new file mode 100644 -index 000000000..29498c8aa ---- /dev/null -+++ b/drivers/misc/vmw_sbx_dtls/Kconfig -@@ -0,0 +1,12 @@ -+# SPDX-License-Identifier: GPL-2.0-or-later -+menuconfig SBX_DTLS -+ tristate "VMware SBX DTLS Virtual Device Support" -+ help -+ VMware SBX DTLS Virtual Device Support. -+ -+ Enable the driver for the VMware SBX Virtual Device for DTLS. This -+ driver handles communication between the user space DBX device that -+ facilitates memory sharing between the SCRX and customer workload VMs -+ on ESXi. -+ -+ If unsure, say no. -diff --git a/drivers/misc/vmw_sbx_dtls/Makefile b/drivers/misc/vmw_sbx_dtls/Makefile -new file mode 100644 -index 000000000..7c586305b ---- /dev/null -+++ b/drivers/misc/vmw_sbx_dtls/Makefile -@@ -0,0 +1,6 @@ -+# SPDX-License-Identifier: GPL-2.0-or-later -+# -+# Makefile for the VMware sbx dtls virtual device driver -+# -+ -+obj-$(CONFIG_SBX_DTLS) += sbx_dtls.o -diff --git a/drivers/misc/vmw_sbx_dtls/sbx_dtls.c b/drivers/misc/vmw_sbx_dtls/sbx_dtls.c -new file mode 100644 -index 000000000..f17157556 ---- /dev/null -+++ b/drivers/misc/vmw_sbx_dtls/sbx_dtls.c -@@ -0,0 +1,611 @@ -+/* SPDX-License-Identifier: GPL-2.0-or-later */ -+/* -+ * Copyright (c) 2026 Broadcom. All Rights Reserved. The term -+ * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sub license, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the -+ * next paragraph) shall be included in all copies or substantial portions -+ * of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, -+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -+ * USE OR OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "sbx_dtls_reg.h" -+#include "sbx_dtls_ioctl.h" -+ -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Broadcom, Inc."); -+MODULE_DESCRIPTION("SBX DTLS driver"); -+ -+#define SBX_DEVICE_VERSION 1 -+ -+#define SBX_NAME "sbxdtls" -+#define SBX_MINOR 0 -+ -+#define SBX_CMD_BAR 0 -+#define SBX_SHM_BAR 2 -+ -+struct sbx_dev { -+ struct cdev sbx_cdev; -+ dev_t devno; -+ struct class *class; -+ char *cmd_remap; -+ char *cmd_dbg_ctrs_addr; -+ char *cmd_connection_map_addr; -+ char *shm_remap; -+ unsigned int irq; -+ resource_size_t shm_addr; -+ wait_queue_head_t launch_waitq; -+ atomic_t launch_ready; -+ -+ bool avail; -+ /* This spinlock locks the sbx device. */ -+ spinlock_t lock; -+}; -+ -+static struct sbx_dev *sbx_device; -+ -+static unsigned long long sbx_read_reg(unsigned long reg) -+{ -+ char *addr; -+ -+ addr = sbx_device->cmd_remap; -+ return readq(addr + (reg * 8)); -+} -+ -+static void sbx_write_reg(unsigned long reg, unsigned long long value) -+{ -+ char *addr; -+ -+ addr = sbx_device->cmd_remap; -+ writeq(value, addr + (reg * 8)); -+} -+ -+static int sbx_open(struct inode *inode, struct file *filp) -+{ -+ int result; -+ -+ spin_lock(&sbx_device->lock); -+ -+ if (!sbx_device->avail) { -+ result = -EBUSY; -+ spin_unlock(&sbx_device->lock); -+ pr_err("sbx open: pid %i (%s) busy fail\n", -+ current->pid, current->comm); -+ return result; -+ } -+ -+ sbx_device->avail = false; -+ spin_unlock(&sbx_device->lock); -+ -+ pr_debug("sbx open: pid %i (%s)\n", current->pid, current->comm); -+ -+ return 0; -+} -+ -+static int sbx_release(struct inode *inode, struct file *filp) -+{ -+ spin_lock(&sbx_device->lock); -+ -+ WARN_ON(sbx_device->avail); -+ -+ sbx_device->avail = true; -+ spin_unlock(&sbx_device->lock); -+ -+ pr_debug("sbx release: pid %i (%s)\n", current->pid, current->comm); -+ -+ return 0; -+} -+ -+static int sbx_ioctl_connection_info(unsigned long arg) -+{ -+ sbx_connection_info_msg_t msg; -+ u64 connection_chunk; -+ u64 connection_mpns; -+ u64 connection_uuid_low8; -+ u64 connection_uuid_high8; -+ -+ if (copy_from_user(&msg, (void *)arg, sizeof(msg)) != 0) { -+ pr_err("sbx connection info ioctl: failed to copy msg\n"); -+ return -EFAULT; -+ } -+ -+ pr_debug("sbx get connection info: connection_id=%lu\n", msg.connection_id); -+ -+ spin_lock(&sbx_device->lock); -+ /* Write the connection ID to the connection register */ -+ sbx_write_reg(SBX_DTLS_REG_CONNECTION_ID, msg.connection_id); -+ /* Read the data from the chunk and MPNs registers */ -+ connection_chunk = sbx_read_reg(SBX_DTLS_REG_CONNECTION_CHUNK); -+ connection_mpns = sbx_read_reg(SBX_DTLS_REG_CONNECTION_MPNS); -+ connection_uuid_low8 = sbx_read_reg(SBX_DTLS_REG_CONNECTION_UUID_LOW8); -+ connection_uuid_high8 = sbx_read_reg(SBX_DTLS_REG_CONNECTION_UUID_HIGH8); -+ spin_unlock(&sbx_device->lock); -+ -+ /* Pack the two 64-bit register reads into the 16-byte UUID byte array. -+ * Low 8 bytes occupy uuid[0..7], high 8 bytes occupy uuid[8..15], matching -+ * the layout: low8 == *(u64 *)uuid, high8 == *(u64 *)(uuid + 8). -+ */ -+ memcpy(&msg.workload_vm_uuid[0], &connection_uuid_low8, sizeof(connection_uuid_low8)); -+ memcpy(&msg.workload_vm_uuid[8], &connection_uuid_high8, sizeof(connection_uuid_high8)); -+ -+ pr_debug("sbx get connection info: connection_chunk=%llu connection_mpns=%llu workload_vm_uuid=%*phN\n", -+ connection_chunk, connection_mpns, UUID_LEN, msg.workload_vm_uuid); -+ -+ msg.connection_chunk = connection_chunk; -+ msg.connection_mpns = connection_mpns; -+ -+ if (copy_to_user((void *)arg, &msg, sizeof(msg)) != 0) { -+ pr_err("sbx connection info ioctl: failed to copy msg back to user\n"); -+ return -EFAULT; -+ } -+ -+ return 0; -+} -+ -+static int sbx_ioctl_connection_map(unsigned long arg) -+{ -+ sbx_connection_map_t connection_map; -+ char __user *user_ptr; -+ -+ spin_lock(&sbx_device->lock); -+ /* Read from mapped connection map space */ -+ memcpy_fromio(&connection_map, sbx_device->cmd_connection_map_addr, -+ sizeof(connection_map)); -+ spin_unlock(&sbx_device->lock); -+ -+ /* Calculate the address of the connection_map field in the user structure */ -+ user_ptr = (char __user *)arg + -+ offsetof(sbx_connection_map_msg_t, connection_map); -+ -+ /* Copy the connection map to the connection_map field in user structure */ -+ if (copy_to_user(user_ptr, &connection_map, sizeof(connection_map)) != 0) { -+ pr_err("sbx connection map ioctl: failed to copy connection map back to user\n"); -+ return -EFAULT; -+ } -+ -+ return 0; -+} -+ -+static int sbx_ioctl_dbg_ctrs(unsigned long arg) -+{ -+ sbx_dbg_ctrs_t dbg_ctrs; -+ char __user *user_ptr; -+ -+ spin_lock(&sbx_device->lock); -+ /* Read from mapped debug counters space */ -+ memcpy_fromio(&dbg_ctrs, sbx_device->cmd_dbg_ctrs_addr, sizeof(dbg_ctrs)); -+ spin_unlock(&sbx_device->lock); -+ -+ /* Calculate the address of the dbg_ctrs field in the user structure */ -+ user_ptr = (char __user *)arg + offsetof(sbx_dbg_ctrs_msg_t, dbg_ctrs); -+ -+ /* Copy the debug counters to the dbg_ctrs field in the user structure */ -+ if (copy_to_user(user_ptr, &dbg_ctrs, sizeof(dbg_ctrs)) != 0) { -+ pr_err("sbx dbg ctrs ioctl: failed to copy debug counters back to user\n"); -+ return -EFAULT; -+ } -+ -+ return 0; -+} -+ -+static int sbx_ioctl_clear_connection(unsigned long arg) -+{ -+ sbx_connection_clear_msg_t msg; -+ -+ if (copy_from_user(&msg, (void *)arg, sizeof(msg)) != 0) { -+ pr_err("sbx clear connection ioctl: failed to copy msg\n"); -+ return -EFAULT; -+ } -+ -+ pr_debug("sbx clear connection: connection_id=%lu\n", msg.connection_id); -+ -+ spin_lock(&sbx_device->lock); -+ /* Write the connection ID to the clear connection register */ -+ sbx_write_reg(SBX_DTLS_REG_CLEAR_CONNECTION, msg.connection_id); -+ spin_unlock(&sbx_device->lock); -+ -+ return 0; -+} -+ -+static int sbx_ioctl_accept_connections(unsigned long arg) -+{ -+ sbx_accept_connections_msg_t msg; -+ -+ if (copy_from_user(&msg, (void *)arg, sizeof(msg)) != 0) { -+ pr_err("sbx accept connections ioctl: failed to copy msg\n"); -+ return -EFAULT; -+ } -+ -+ /* Ensure the value is only 0 or 1 */ -+ if (msg.accept > 1) { -+ pr_err("sbx accept connections ioctl: invalid value %u (must be 0 or 1)\n", -+ msg.accept); -+ return -EINVAL; -+ } -+ -+ pr_debug("sbx accept connections: %s\n", -+ msg.accept ? "enabled" : "disabled"); -+ -+ spin_lock(&sbx_device->lock); -+ /* Write the accept connections value to the register */ -+ sbx_write_reg(SBX_DTLS_REG_ACCEPT_CONNECTIONS, msg.accept); -+ spin_unlock(&sbx_device->lock); -+ -+ return 0; -+} -+ -+static long sbx_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) -+{ -+ switch (cmd) { -+ case SBX_DTLS_IOCTL_CONNECTION_INFO: -+ return sbx_ioctl_connection_info(arg); -+ case SBX_DTLS_IOCTL_CONNECTION_MAP: -+ return sbx_ioctl_connection_map(arg); -+ case SBX_DTLS_IOCTL_CLEAR_CONNECTION: -+ return sbx_ioctl_clear_connection(arg); -+ case SBX_DTLS_IOCTL_ACCEPT_CONNECTIONS: -+ return sbx_ioctl_accept_connections(arg); -+ case SBX_DTLS_IOCTL_FETCH_DEBUG_CTRS: -+ return sbx_ioctl_dbg_ctrs(arg); -+ default: -+ pr_err("sbx ioctl: pid %i (%s) invalid cmd(%u)\n", -+ current->pid, current->comm, cmd); -+ return -EINVAL; -+ } -+} -+ -+static int sbx_mmap(struct file *filp, struct vm_area_struct *vma) -+{ -+ unsigned long len = vma->vm_end - vma->vm_start; -+ unsigned long pfn = (sbx_device->shm_addr >> PAGE_SHIFT) + vma->vm_pgoff; -+ -+ if (remap_pfn_range(vma, vma->vm_start, pfn, len, vma->vm_page_prot)) { -+ pr_err("sbx mmap: remap_pfn_range fail\n"); -+ return -EAGAIN; -+ } -+ -+ pr_debug("sbx mmap: pid %i (%s)\n", current->pid, current->comm); -+ -+ return 0; -+} -+ -+static irqreturn_t sbx_irq_handler(int irq, void *dev_id) -+{ -+ struct sbx_dev *sbx = (struct sbx_dev *)dev_id; -+ -+ atomic_inc(&sbx->launch_ready); -+ wake_up_interruptible(&sbx->launch_waitq); -+ -+ return IRQ_HANDLED; -+} -+ -+static __poll_t sbx_poll(struct file *filp, struct poll_table_struct *wait) -+{ -+ __poll_t mask = 0; -+ int pending; -+ -+ poll_wait(filp, &sbx_device->launch_waitq, wait); -+ -+ pending = atomic_xchg(&sbx_device->launch_ready, 0); -+ pr_debug("sbx poll: launch_ready=%d\n", pending); -+ -+ if (pending > 0) -+ mask |= POLLIN; -+ -+ return mask; -+} -+ -+static const struct file_operations sbx_fops = { -+ .owner = THIS_MODULE, -+ .open = sbx_open, -+ .mmap = sbx_mmap, -+ .release = sbx_release, -+ .unlocked_ioctl = sbx_ioctl, -+ .poll = sbx_poll, -+}; -+ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0) -+static char *sbx_devnode(const struct device *dev, umode_t *mode) -+#else -+static char *sbx_devnode(struct device *dev, umode_t *mode) -+#endif -+{ -+ if (mode) -+ *mode = 0600; -+ return NULL; -+} -+ -+static int sbx_probe(struct pci_dev *pdev, const struct pci_device_id *id) -+{ -+ int irq; -+ int result; -+ char *addr; -+ dev_t devno_sbx; -+ unsigned long flags; -+ unsigned int dword = 0; -+ const unsigned int BUS_MASTER = 0x4; -+ const unsigned int CMD_REG_OFFSET = 4; -+ resource_size_t cmd_addr; -+ resource_size_t cmd_len; -+ unsigned long cmd_flags; -+ resource_size_t shm_len; -+ unsigned long shm_flags; -+ struct device *d; -+ -+ if (sbx_device) { -+ pr_err("sbx: unexpected probe\n"); -+ return -EPERM; -+ } -+ -+ pci_read_config_dword(pdev, CMD_REG_OFFSET, &dword); -+ if (!(dword & BUS_MASTER)) { -+ pci_write_config_dword(pdev, CMD_REG_OFFSET, dword | BUS_MASTER); -+ pci_read_config_dword(pdev, CMD_REG_OFFSET, &dword); -+ if (dword & BUS_MASTER) { -+ pr_debug("sbx probe: bus master enabled\n"); -+ } else { -+ pr_err("sbx probe: bus master enable fail\n"); -+ return -EPERM; -+ } -+ } -+ -+ result = alloc_chrdev_region(&devno_sbx, SBX_MINOR, 1, SBX_NAME); -+ if (result != 0) { -+ pr_err("sbx probe: alloc major number with minor %d fail error=%d\n", -+ SBX_MINOR, result); -+ return result; -+ } -+ -+ sbx_device = kzalloc(sizeof(*sbx_device), GFP_KERNEL); -+ if (!sbx_device) { -+ result = -ENOMEM; -+ pr_err("sbx probe: kzalloc fail error=%d\n", result); -+ goto fail_kzalloc_sbx; -+ } -+ spin_lock_init(&sbx_device->lock); -+ sbx_device->devno = devno_sbx; -+ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) -+ sbx_device->class = class_create(SBX_NAME "drv"); -+#else -+ sbx_device->class = class_create(THIS_MODULE, SBX_NAME "drv"); -+#endif -+ if (IS_ERR(sbx_device->class)) { -+ result = PTR_ERR(sbx_device->class); -+ pr_err("sbx probe: class create fail error=%d\n", result); -+ goto fail_class_create; -+ } -+ -+ sbx_device->class->devnode = sbx_devnode; -+ d = device_create(sbx_device->class, NULL, devno_sbx, -+ NULL, SBX_NAME "0"); -+ if (IS_ERR(d)) { -+ result = PTR_ERR(d); -+ pr_err("sbx probe: sbx device create fail error=%d\n", result); -+ goto fail_device_create_sbx; -+ } -+ -+ cdev_init(&sbx_device->sbx_cdev, &sbx_fops); -+ sbx_device->sbx_cdev.owner = THIS_MODULE; -+ result = cdev_add(&sbx_device->sbx_cdev, devno_sbx, 1); -+ if (result != 0) { -+ pr_err("sbx probe: add sbx fail error=%d\n", result); -+ goto fail_cdev_add_sbx; -+ } -+ -+ result = pci_enable_device(pdev); -+ if (result != 0) { -+ pr_err("sbx probe: pci enable device fail error=%d\n", result); -+ goto fail_pci_enable_device; -+ } -+ -+ result = pci_request_region(pdev, SBX_CMD_BAR, "sbx-cmd-bar"); -+ if (result != 0) { -+ pr_err("sbx probe: cmd bar request fail error=%d\n", result); -+ goto fail_pci_request_region_cmd; -+ } -+ cmd_addr = pci_resource_start(pdev, SBX_CMD_BAR); -+ cmd_len = pci_resource_len(pdev, SBX_CMD_BAR); -+ cmd_flags = pci_resource_flags(pdev, SBX_CMD_BAR); -+ pr_debug("sbx probe: cmd bar start=%pa len=%pa flags=%#lx\n", -+ &cmd_addr, &cmd_len, cmd_flags); -+ flags = IORESOURCE_MEM; -+ if ((cmd_flags & flags) != flags) { -+ pr_err("sbx probe: cmd bar flags must be %#lx fail\n", flags); -+ result = -EINVAL; -+ goto fail_pci_request_region_cmd_resource; -+ } -+ -+ result = pci_request_region(pdev, SBX_SHM_BAR, "sbx-shm-bar"); -+ if (result != 0) { -+ pr_err("sbx probe: shm bar request fail error=%d\n", result); -+ goto fail_pci_request_region_cmd_resource; -+ } -+ sbx_device->shm_addr = pci_resource_start(pdev, SBX_SHM_BAR); -+ shm_len = pci_resource_len(pdev, SBX_SHM_BAR); -+ shm_flags = pci_resource_flags(pdev, SBX_SHM_BAR); -+ pr_debug("sbx probe: shm bar start=%pa len=%pa flags=%#lx\n", -+ &sbx_device->shm_addr, &shm_len, shm_flags); -+ flags = IORESOURCE_MEM | IORESOURCE_PREFETCH; -+ if ((shm_flags & flags) != flags) { -+ pr_err("sbx probe: shm bar flags must be %#lx fail\n", flags); -+ result = -EINVAL; -+ goto fail_pci_request_region_shm_resource; -+ } -+ -+ result = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI); -+ if (result < 1) { -+ pr_err("sbx probe: pci alloc irq vectors fail error=%d\n", -+ result); -+ goto fail_pci_request_region_shm_resource; -+ } -+ -+ init_waitqueue_head(&sbx_device->launch_waitq); -+ irq = pci_irq_vector(pdev, 0); -+ result = request_irq(irq, sbx_irq_handler, 0, SBX_NAME, sbx_device); -+ if (result != 0) { -+ pr_err("sbx probe: request irq fail irq=%d error=%d\n", -+ irq, result); -+ goto fail_request_irq; -+ } -+ sbx_device->irq = irq; -+ -+ sbx_device->cmd_remap = ioremap(cmd_addr, cmd_len); -+ if (!sbx_device->cmd_remap) { -+ pr_err("sbx probe: ioremap cmd bar fail\n"); -+ result = -ENOMEM; -+ goto fail_ioremap_cmd; -+ } -+ -+ sbx_device->shm_remap = ioremap(sbx_device->shm_addr, shm_len); -+ if (!sbx_device->shm_remap) { -+ pr_err("sbx probe: ioremap shm bar fail\n"); -+ result = -ENOMEM; -+ goto fail_ioremap_shm; -+ } -+ -+ addr = sbx_device->cmd_remap; -+ sbx_device->cmd_dbg_ctrs_addr = addr + SBX_DTLS_OFFSET_DBG_CTRS; -+ sbx_device->cmd_connection_map_addr = -+ addr + SBX_DTLS_OFFSET_CONNECTION_MAP; -+ -+ sbx_device->avail = true; -+ -+ sbx_write_reg(SBX_DTLS_REG_VERSION, SBX_DEVICE_VERSION); -+ if (sbx_read_reg(SBX_DTLS_REG_VERSION) != SBX_DEVICE_VERSION) { -+ pr_err("sbx probe: version check failed\n"); -+ result = -EINVAL; -+ goto fail_version_check; -+ } -+ -+ return 0; -+ -+fail_version_check: -+ iounmap(sbx_device->shm_remap); -+ -+fail_ioremap_shm: -+ iounmap(sbx_device->cmd_remap); -+ -+fail_ioremap_cmd: -+ free_irq(sbx_device->irq, sbx_device); -+ -+fail_request_irq: -+ pci_free_irq_vectors(pdev); -+ -+fail_pci_request_region_shm_resource: -+ pci_release_region(pdev, SBX_SHM_BAR); -+ -+fail_pci_request_region_cmd_resource: -+ pci_release_region(pdev, SBX_CMD_BAR); -+ -+fail_pci_request_region_cmd: -+ pci_disable_device(pdev); -+ -+fail_pci_enable_device: -+ cdev_del(&sbx_device->sbx_cdev); -+ -+fail_cdev_add_sbx: -+ device_destroy(sbx_device->class, sbx_device->devno); -+ -+fail_device_create_sbx: -+ class_destroy(sbx_device->class); -+ -+fail_class_create: -+ kfree(sbx_device); -+ sbx_device = NULL; -+ -+fail_kzalloc_sbx: -+ unregister_chrdev_region(devno_sbx, 1); -+ -+ return result; -+} -+ -+static void sbx_remove(struct pci_dev *pdev) -+{ -+ if (sbx_device) { -+ iounmap(sbx_device->cmd_remap); -+ iounmap(sbx_device->shm_remap); -+ free_irq(sbx_device->irq, sbx_device); -+ pci_free_irq_vectors(pdev); -+ pci_release_region(pdev, SBX_SHM_BAR); -+ pci_release_region(pdev, SBX_CMD_BAR); -+ pci_disable_device(pdev); -+ cdev_del(&sbx_device->sbx_cdev); -+ device_destroy(sbx_device->class, sbx_device->devno); -+ class_destroy(sbx_device->class); -+ unregister_chrdev_region(sbx_device->devno, 1); -+ kfree(sbx_device); -+ sbx_device = NULL; -+ } -+} -+ -+static struct pci_device_id sbx_ids[] = { -+ { PCI_DEVICE(PCI_VENDOR_ID_VMWARE, 0x420), }, -+ { 0, } -+}; -+ -+static struct pci_driver sbx_driver = { -+ .name = SBX_NAME, -+ .probe = sbx_probe, -+ .remove = sbx_remove, -+ .id_table = sbx_ids, -+}; -+ -+MODULE_DEVICE_TABLE(pci, sbx_ids); -+ -+static int __init sbx_init_module(void) -+{ -+ int ret = pci_register_driver(&sbx_driver); -+ -+ if (ret < 0) { -+ pr_err("sbx init module: pci_register_driver fail\n"); -+ return ret; -+ } -+ -+ if (!sbx_device) { -+ pr_err("sbx init module: sbx_probe fail\n"); -+ return -ENODEV; -+ } -+ -+ return 0; -+} -+ -+static void __exit sbx_exit_module(void) -+{ -+ pci_unregister_driver(&sbx_driver); -+} -+ -+module_init(sbx_init_module); -+module_exit(sbx_exit_module); -diff --git a/drivers/misc/vmw_sbx_dtls/sbx_dtls_ioctl.h b/drivers/misc/vmw_sbx_dtls/sbx_dtls_ioctl.h -new file mode 100644 -index 000000000..1eb452f60 ---- /dev/null -+++ b/drivers/misc/vmw_sbx_dtls/sbx_dtls_ioctl.h -@@ -0,0 +1,79 @@ -+/* SPDX-License-Identifier: GPL-2.0-or-later */ -+/* -+ * Copyright (c) 2026 Broadcom. All Rights Reserved. The term -+ * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sub license, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the -+ * next paragraph) shall be included in all copies or substantial portions -+ * of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, -+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -+ * USE OR OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#ifndef _SBX_DTLS_IOCTL_H_ -+#define _SBX_DTLS_IOCTL_H_ -+ -+#define SBX_DTLS_MAGIC 0xb3 -+ -+/* Include register definitions for connection map size */ -+#include "sbx_dtls_reg.h" -+ -+#define UUID_LEN 16 -+ -+typedef unsigned long long sbx_connection_map_t[SBX_DTLS_CONNECTION_MAP_WORDS]; -+typedef unsigned long long sbx_dbg_ctrs_t[SBX_DTLS_DBG_CTRS_COUNT]; -+ -+/* SBX Connection Info message */ -+typedef struct sbx_connection_info_msg { -+ unsigned long connection_id; -+ unsigned long connection_chunk; -+ unsigned long connection_mpns; -+ unsigned char workload_vm_uuid[UUID_LEN]; -+} sbx_connection_info_msg_t; -+ -+/* Connection map response message */ -+typedef struct sbx_connection_map_msg { -+ sbx_connection_map_t connection_map; -+} sbx_connection_map_msg_t; -+ -+/* Debug counters response message */ -+typedef struct sbx_dbg_ctrs_msg { -+ sbx_dbg_ctrs_t dbg_ctrs; -+} sbx_dbg_ctrs_msg_t; -+ -+/* Clear connection message */ -+typedef struct sbx_connection_clear_msg { -+ unsigned long connection_id; -+} sbx_connection_clear_msg_t; -+ -+/* Accept connections message */ -+typedef struct sbx_accept_connections_msg { -+ unsigned int accept; -+} sbx_accept_connections_msg_t; -+ -+#define SBX_DTLS_IOCTL_CONNECTION_INFO \ -+ _IOWR(SBX_DTLS_MAGIC, 20, struct sbx_connection_info_msg) -+#define SBX_DTLS_IOCTL_CONNECTION_MAP \ -+ _IOWR(SBX_DTLS_MAGIC, 21, struct sbx_connection_map_msg) -+#define SBX_DTLS_IOCTL_CLEAR_CONNECTION \ -+ _IOW(SBX_DTLS_MAGIC, 22, struct sbx_connection_clear_msg) -+#define SBX_DTLS_IOCTL_ACCEPT_CONNECTIONS \ -+ _IOW(SBX_DTLS_MAGIC, 23, struct sbx_accept_connections_msg) -+#define SBX_DTLS_IOCTL_FETCH_DEBUG_CTRS \ -+ _IOR(SBX_DTLS_MAGIC, 24, struct sbx_dbg_ctrs_msg) -+ -+#endif -diff --git a/drivers/misc/vmw_sbx_dtls/sbx_dtls_reg.h b/drivers/misc/vmw_sbx_dtls/sbx_dtls_reg.h -new file mode 100644 -index 000000000..5cb7d8ceb ---- /dev/null -+++ b/drivers/misc/vmw_sbx_dtls/sbx_dtls_reg.h -@@ -0,0 +1,148 @@ -+/* SPDX-License-Identifier: GPL-2.0-or-later */ -+/* -+ * Copyright (c) 2026 Broadcom. All Rights Reserved. The term -+ * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sub license, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the -+ * next paragraph) shall be included in all copies or substantial portions -+ * of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, -+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -+ * USE OR OTHER DEALINGS IN THE SOFTWARE. -+ */ -+/* -+ * sbx_dtls_reg.h -- -+ * Register definitions for the SBX DTLS device. -+ */ -+ -+ #ifndef _SBX_DTLS_REG_H_ -+ #define _SBX_DTLS_REG_H_ -+ -+/* -+ * SBX_DTLS_CONNECTION_ID - -+ * Written by the kernel driver, to set the connection context in the SBX code. -+ */ -+#define SBX_DTLS_REG_CONNECTION_ID 0 -+ -+/* -+ * SBX_DTLS_CONNECTION_CHUNK - -+ * Written by the SBX code, read by the kernel driver. This has the starting -+ * chunk number for the connection in the context. -+ */ -+#define SBX_DTLS_REG_CONNECTION_CHUNK 1 -+ -+/* -+ * SBX_DTLS_CONNECTION_MPNS -+ * Written by the SBX code, read by the kernel driver. This has the number of -+ * MPNs setup for this connection. -+ */ -+#define SBX_DTLS_REG_CONNECTION_MPNS 2 -+ -+/* -+ * SBX_DTLS_REG_VERSION -+ * SBX version -+ */ -+#define SBX_DTLS_REG_VERSION 3 -+ -+/* -+ * SBX_DTLS_REG_CLEAR_CONNECTION -+ * Set by the userspace to indicate the SBX code to cleanup a connection -+ */ -+#define SBX_DTLS_REG_CLEAR_CONNECTION 4 -+ -+/* -+ * SBX_DTLS_REG_ACCEPT_CONNECTIONS -+ * Set by the userspace to indicate to the SBX device to accept workload -+ * connections. -+ */ -+#define SBX_DTLS_REG_ACCEPT_CONNECTIONS 5 -+ -+/* -+ * SBX_DTLS_REG_CONNECTION_UUID_LOW8 -+ * Written by the SBX code, read by the kernel driver. This has the low 8 bytes -+ * of the VM UUID for the connection in the context. -+ */ -+#define SBX_DTLS_REG_CONNECTION_UUID_LOW8 6 -+ -+/* -+ * SBX_DTLS_REG_CONNECTION_UUID_HIGH8 -+ * Written by the SBX code, read by the kernel driver. This has the high 8 bytes -+ * of the VM UUID for the connection in the context. -+ */ -+#define SBX_DTLS_REG_CONNECTION_UUID_HIGH8 7 -+ -+#define SBX_DTLS_REGISTERS_MAX 32 -+/* -+ * SBX_DTLS_CONNECTION_MAP_SIZE -+ * The size of the connection bitmap. This space is sufficient to maintain -+ * 2048 connections. -+ * 256 Bytes -+ */ -+#define SBX_DTLS_CONNECTION_MAP_SIZE 256 -+ -+#define SBX_DTLS_CONNECTION_MAP_WORDS (SBX_DTLS_CONNECTION_MAP_SIZE / 8) -+ -+ -+/* -+ * SBX_DTLS_DBG_CTRS_COUNT -+ * A set of counters for debuggability -+ */ -+#define SBX_DTLS_DBG_CTRS_COUNT 64 -+ -+/* -+ * SBX_DTLS_CMD_BAR_LEN -+ * Size of the command BAR length. Needs to be a power of 2. -+ */ -+#define SBX_DTLS_CMD_BAR_LEN 32768 -+ -+/* -+ * Command BAR Memory Layout: -+ * -+ * Offset Range (end exclusive) Region -+ * +-------------------+---------------------------+ -+ * | [0x000 - 0x100) | Command Registers (32x8B) | -+ * +-------------------+---------------------------+ -+ * | [0x100 - 0x300) | Debug Counters (64x8B) | -+ * +-------------------+---------------------------+ -+ * | [0x300 - 0x400) | Connection Map (256B) | -+ * +-------------------+---------------------------+ -+ * | [0x400 - 0x8000) | Reserved | -+ * +-------------------+---------------------------+ -+ */ -+ -+/* Command Registers: offset 0x000 - 0x100 (exclusive) */ -+#define SBX_DTLS_OFFSET_CMD_REGS 0 -+#define SBX_DTLS_OFFSET_CMD_REGS_END (SBX_DTLS_REGISTERS_MAX * 8) -+ -+/* Debug Counters: offset 0x100 - 0x300 (exclusive) */ -+#define SBX_DTLS_OFFSET_DBG_CTRS SBX_DTLS_OFFSET_CMD_REGS_END -+#define SBX_DTLS_OFFSET_DBG_CTRS_END (SBX_DTLS_OFFSET_DBG_CTRS + SBX_DTLS_DBG_CTRS_COUNT * 8) -+ -+/* Connection Map: offset 0x300 - 0x400 (exclusive) */ -+#define SBX_DTLS_OFFSET_CONNECTION_MAP SBX_DTLS_OFFSET_DBG_CTRS_END -+#define SBX_DTLS_OFFSET_CONNECTION_MAP_END (SBX_DTLS_OFFSET_CONNECTION_MAP + SBX_DTLS_CONNECTION_MAP_SIZE) -+ -+/* Offset range check macros */ -+#define OFFSET_IS_CMD_REG(offset) \ -+ ((offset) >= SBX_DTLS_OFFSET_CMD_REGS && (offset) < SBX_DTLS_OFFSET_CMD_REGS_END) -+ -+#define OFFSET_IS_DBG_CTR(offset) \ -+ ((offset) >= SBX_DTLS_OFFSET_DBG_CTRS && (offset) < SBX_DTLS_OFFSET_DBG_CTRS_END) -+ -+#define OFFSET_IS_CONNECTION_MAP(offset) \ -+ (offset >= SBX_DTLS_OFFSET_CONNECTION_MAP && offset < SBX_DTLS_OFFSET_CONNECTION_MAP_END) -+ -+#endif --- -2.51.0 - diff --git a/SPECS/91/linux/esx/0001-vmw_extcfg-hotplug-without-firmware-support.patch b/SPECS/91/linux/esx/0001-vmw_extcfg-hotplug-without-firmware-support.patch deleted file mode 100644 index 482eea0065..0000000000 --- a/SPECS/91/linux/esx/0001-vmw_extcfg-hotplug-without-firmware-support.patch +++ /dev/null @@ -1,491 +0,0 @@ -From dc2368611461038e31393341ab9a2d1a19056044 Mon Sep 17 00:00:00 2001 -From: Vamsi Krishna Brahmajosyula -Date: Wed, 13 Nov 2024 16:25:39 +0000 -Subject: [PATCH] 0001-vmw_extcfg: Prepare for Non-ACPI Hotplug support - -Provide a way to receive hotplug events when ACPI is disabled. - -VMX provides a way to register and access cpu, memory and device -information via Extended Config space of PCI root. This is helpful -when the guest is booted with ACPI turned off, CRX/directBoot. -There is no access to chipset when the kernel is booted with out -ACPI. - -Summary of method used to achieve hotplug without ACPI - -* When ACPI is disabled, reserve IO, MMIO addresses -* Let root PCI device know about these addresses -* Register a PnP device that responds on IRQ 9 -* When the Interrupt handler is invoked, read from Ext Config space - and figure out the exact device that was hot added/removed. -* Add/remove the resource to the OS similar to the ACPI handler. - -Signed-off-by: Vamsi Krishna Brahmajosyula -Signed-off-by: Him Kalyan Bordoloi -Signed-off-by: Alex Upshaw ---- - arch/x86/include/asm/io_apic.h | 2 + - arch/x86/kernel/acpi/boot.c | 6 + - drivers/misc/Kconfig | 1 + - drivers/misc/Makefile | 1 + - drivers/misc/vmw_extcfg/Kconfig | 15 +++ - drivers/misc/vmw_extcfg/Makefile | 3 + - drivers/misc/vmw_extcfg/extcfg_device.c | 67 ++++++++++ - drivers/misc/vmw_extcfg/extcfg_device.h | 74 +++++++++++ - drivers/misc/vmw_extcfg/extcfg_driver.c | 170 ++++++++++++++++++++++++ - drivers/misc/vmw_extcfg/extcfg_driver.h | 26 ++++ - 10 files changed, 365 insertions(+) - create mode 100644 drivers/misc/vmw_extcfg/Kconfig - create mode 100644 drivers/misc/vmw_extcfg/Makefile - create mode 100644 drivers/misc/vmw_extcfg/extcfg_device.c - create mode 100644 drivers/misc/vmw_extcfg/extcfg_device.h - create mode 100644 drivers/misc/vmw_extcfg/extcfg_driver.c - create mode 100644 drivers/misc/vmw_extcfg/extcfg_driver.h - -diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h -index 0d806513c..8ba13899d 100644 ---- a/arch/x86/include/asm/io_apic.h -+++ b/arch/x86/include/asm/io_apic.h -@@ -148,6 +148,8 @@ extern int mp_map_gsi_to_irq(u32 gsi, unsigned int flags, - extern void mp_unmap_irq(int irq); - extern int mp_register_ioapic(int id, u32 address, u32 gsi_base, - struct ioapic_domain_cfg *cfg); -+extern int ext_mp_register_ioapic_irq(u8 bus_irq, u8 polarity, -+ u8 trigger, u32 gsi); - extern int mp_unregister_ioapic(u32 gsi_base); - extern int mp_ioapic_registered(u32 gsi_base); - -diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c -index 4efecac49..7c98c6265 100644 ---- a/arch/x86/kernel/acpi/boot.c -+++ b/arch/x86/kernel/acpi/boot.c -@@ -436,6 +436,12 @@ static int __init mp_register_ioapic_irq(u8 bus_irq, u8 polarity, - return 0; - } - -+int __init ext_mp_register_ioapic_irq(u8 bus_irq, u8 polarity, -+ u8 trigger, u32 gsi) -+{ -+ return mp_register_ioapic_irq(bus_irq, polarity, trigger, gsi); -+} -+ - static int __init - acpi_parse_ioapic(union acpi_subtable_headers * header, const unsigned long end) - { -diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig -index 3fe7e2a9b..db96ceeb7 100644 ---- a/drivers/misc/Kconfig -+++ b/drivers/misc/Kconfig -@@ -628,4 +628,5 @@ source "drivers/misc/uacce/Kconfig" - source "drivers/misc/pvpanic/Kconfig" - source "drivers/misc/mchp_pci1xxxx/Kconfig" - source "drivers/misc/keba/Kconfig" -+source "drivers/misc/vmw_extcfg/Kconfig" - endmenu -diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile -index a9f94525e..bcdb52acb 100644 ---- a/drivers/misc/Makefile -+++ b/drivers/misc/Makefile -@@ -69,6 +69,7 @@ obj-$(CONFIG_TMR_MANAGER) += xilinx_tmr_manager.o - obj-$(CONFIG_TMR_INJECT) += xilinx_tmr_inject.o - obj-$(CONFIG_TPS6594_ESM) += tps6594-esm.o - obj-$(CONFIG_TPS6594_PFSM) += tps6594-pfsm.o -+obj-$(CONFIG_VMWARE_EXTCFG) += vmw_extcfg/ - obj-$(CONFIG_NSM) += nsm.o - obj-$(CONFIG_MARVELL_CN10K_DPI) += mrvl_cn10k_dpi.o - obj-y += keba/ -diff --git a/drivers/misc/vmw_extcfg/Kconfig b/drivers/misc/vmw_extcfg/Kconfig -new file mode 100644 -index 000000000..ab063665e ---- /dev/null -+++ b/drivers/misc/vmw_extcfg/Kconfig -@@ -0,0 +1,15 @@ -+# SPDX-License-Identifier: Dual BSD/GPL -+# -+# VMware EXTCFG device -+# -+ -+config VMWARE_EXTCFG -+ bool "VMware Extended Configuration Driver" -+ depends on X86 && PCI -+ help -+ This is VMware's Extended Configuration Driver. It enables -+ cpu, memory hotplug for guest in a virtual -+ environment when ACPI is unavailable. -+ -+ If unsure, say N. -+ -diff --git a/drivers/misc/vmw_extcfg/Makefile b/drivers/misc/vmw_extcfg/Makefile -new file mode 100644 -index 000000000..909b41339 ---- /dev/null -+++ b/drivers/misc/vmw_extcfg/Makefile -@@ -0,0 +1,3 @@ -+# SPDX-License-Identifier: Dual BSD/GPL -+obj-$(CONFIG_VMWARE_EXTCFG) += vmw_extcfg.o -+vmw_extcfg-$(CONFIG_VMWARE_EXTCFG) += extcfg_device.o extcfg_driver.o -\ No newline at end of file -diff --git a/drivers/misc/vmw_extcfg/extcfg_device.c b/drivers/misc/vmw_extcfg/extcfg_device.c -new file mode 100644 -index 000000000..af13d6fd7 ---- /dev/null -+++ b/drivers/misc/vmw_extcfg/extcfg_device.c -@@ -0,0 +1,67 @@ -+// SPDX-License-Identifier: Dual BSD/GPL -+/* -+ * VMware Virtual Chipset Extended Configuration Driver -+ * -+ * Copyright (C) 2022 VMware, Inc. All rights reserved. -+ */ -+ -+#include -+#include -+#include "extcfg_device.h" -+ -+static struct extcfg cfg; -+ -+struct extcfg *get_extcfg(void) -+{ -+ return &cfg; -+} -+ -+u8 extconf_read_8(unsigned long offset) -+{ -+ outl(offset, cfg.io_bar + INDEX_REG_OFF); -+ return inb(cfg.io_bar + DATA_REG_OFF); -+} -+ -+u64 extconf_read_64(unsigned long offset) -+{ -+ u64 ret; -+ -+ outl(offset + 4, cfg.io_bar + INDEX_REG_OFF); -+ ret = inl(cfg.io_bar + DATA_REG_OFF); -+ ret <<= 32; -+ outl(offset, cfg.io_bar + INDEX_REG_OFF); -+ ret |= inl(cfg.io_bar + DATA_REG_OFF); -+ -+ return ret; -+} -+ -+void extconf_write_64_mmio(unsigned long offset, u64 data) -+{ -+ writeq(data, (void *) ((u8 *)cfg.mmio_addr + offset)); -+} -+ -+u32 read_acpi_notification_queue(u32 offset) -+{ -+ outl(offset, cfg.io_bar + INDEX_REG_OFF); -+ return inl(cfg.io_bar + DATA_REG_OFF); -+} -+ -+void write_acpi_notification_queue(u32 offset, u32 status) -+{ -+ outl(offset, cfg.io_bar + INDEX_REG_OFF); -+ outl(status, cfg.io_bar + DATA_REG_OFF); -+} -+ -+void post_process_acpi_event(int gpeMask) -+{ -+ /* write notify status done */ -+ u32 offset = gpeMask == GPE_2_MASK ? ANQ_STATUS_OFF : DEV_HP_QUEUE_BASE; -+ -+ write_acpi_notification_queue(offset, ANQ_STATUS_DONE); -+ -+ /* update status reg */ -+ outb((gpeMask | inl(GPE_STATUS_REG)), GPE_STATUS_REG); -+ -+ /* reenable interrupt */ -+ outl((gpeMask | inl(GPE_ENABLE_REG)), GPE_ENABLE_REG); -+} -diff --git a/drivers/misc/vmw_extcfg/extcfg_device.h b/drivers/misc/vmw_extcfg/extcfg_device.h -new file mode 100644 -index 000000000..936d773fe ---- /dev/null -+++ b/drivers/misc/vmw_extcfg/extcfg_device.h -@@ -0,0 +1,74 @@ -+/* SPDX-License-Identifier: Dual BSD/GPL */ -+/* -+ * VMware Virtual Chipset Extended Configuration Driver -+ * -+ * Copyright (C) 2022 VMware, Inc. All rights reserved. -+ */ -+ -+#ifndef _EXTCFG_DEVICE_H_ -+#define _EXTCFG_DEVICE_H_ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+enum anq_commands { -+ NO_COMMAND, -+ MEM_HOTPLUG_COMMAND, -+ CPU_HOTPLUG_COMMAND, -+ HOT_BUTTON_COMMAND, -+ VMGEN_COMMAND, -+ NVDIMM_COMMAND -+}; -+ -+enum devhp_commands { HOTADD_COMMAND = 1, HOTREMOVE_COMMAND = 2 }; -+ -+#define VMW_EXTCFG "vmw_extcfg" -+#define INDEX_REG_OFF 0 -+#define DATA_REG_OFF 4 -+ -+#define SCI_EN_MASK 0x0001 -+#define SMI_DIS_MASK 0xFFFE -+#define GPE_2_MASK 0x04 -+#define GPE_1_MASK 0x02 -+#define BIOS_MODE_REG 0x00b2 -+#define GPE_STATUS_REG 0x100c -+#define GPE_STATUS2_REG 0x100d -+#define GPE_ENABLE_REG 0x100e -+#define PMCTL_REG 0x1004 -+#define PMGLOBCTL_REG 0x1028 -+ -+#define ANQ_STATUS_OFF 0x100 -+ -+#define ANQ_STATUS_DONE 0 -+#define BIOS_ACPI_MODE 0xF0 -+#define SCI_IRQ_NO 9 -+#define APIC_POLARITY_ACTIVE_LOW 3 -+ -+#define DEV_HP_QUEUE_BASE (0xA0 + 0x10) -+ -+struct extcfg { -+ resource_size_t io_bar; -+ resource_size_t mmio_bar; -+ void *mmio_addr; -+}; -+ -+struct extcfg *get_extcfg(void); -+ -+u8 extconf_read_8(unsigned long offset); -+ -+u64 extconf_read_64(unsigned long offset); -+ -+void extconf_write_64_mmio(unsigned long offset, u64 data); -+ -+u32 read_acpi_notification_queue(u32 offset); -+ -+void write_acpi_notification_queue(u32 offset, u32 status); -+ -+void post_process_acpi_event(int gpeMask); -+ -+#endif /* _EXTCFG_DEVICE_H_ */ -diff --git a/drivers/misc/vmw_extcfg/extcfg_driver.c b/drivers/misc/vmw_extcfg/extcfg_driver.c -new file mode 100644 -index 000000000..881cd1fcd ---- /dev/null -+++ b/drivers/misc/vmw_extcfg/extcfg_driver.c -@@ -0,0 +1,170 @@ -+// SPDX-License-Identifier: Dual BSD/GPL -+/* -+ * VMware Virtual Chipset Extended Configuration Driver -+ * -+ * Copyright (C) 2022 VMware, Inc. All rights reserved. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "../../pnp/base.h" -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "extcfg_device.h" -+#include "extcfg_driver.h" -+ -+static struct work_struct hotplug_work; -+static unsigned int irq; -+ -+irqreturn_t sci_interrupt_handler(int irq, void *dev_id) -+{ -+ /*disable interrupt*/ -+ outl(~inl(GPE_STATUS_REG) & inl(GPE_ENABLE_REG), GPE_ENABLE_REG); -+ return IRQ_HANDLED; -+} -+ -+static int __init extcfg_drv_init(void) -+{ -+ u32 gsi = SCI_IRQ_NO; -+ struct irq_alloc_info info; -+ int ret = 0; -+ /* -+ * SCI source must be enabled to receive SCI interrupt. The following -+ * needs to be done to enable SCI source -+ * Check PMCTL_SCI_EN bit in PMCTL register. If it is 0, you are using -+ * legacy BIOS. Write value 0xF0 to port 0xB2 to transition to ACPI mode. -+ * Check bit again. If it is still 0, then BIOS does not want to support -+ * ACPI. Or you are not using any firmware at all: then just simply write -+ * SCI_EN bit (plus disable SMI by clearing PMGLOBCTL_SMIEN bit in -+ * PMGLOBCTL register). -+ */ -+ if ((inw(PMCTL_REG) & SCI_EN_MASK) == 0) { -+ outb(BIOS_ACPI_MODE, BIOS_MODE_REG); -+ -+ if ((inw(PMCTL_REG) & SCI_EN_MASK) == 0) { -+ outw(inw(PMCTL_REG) | SCI_EN_MASK, PMCTL_REG); -+ outw(inw(PMGLOBCTL_REG) & SMI_DIS_MASK, PMGLOBCTL_REG); -+ } -+ outw((GPE_2_MASK | GPE_1_MASK | inl(GPE_ENABLE_REG)), -+ GPE_ENABLE_REG); -+ } -+ -+ ioapic_set_alloc_attr(&info, NUMA_NO_NODE, ACPI_LEVEL_SENSITIVE, -+ ACPI_ACTIVE_LOW); -+ irq = mp_map_gsi_to_irq(gsi, IOAPIC_MAP_ALLOC, &info); -+ ret = request_irq(irq, sci_interrupt_handler, IRQF_SHARED, VMW_EXTCFG, -+ sci_interrupt_handler); -+ return ret; -+} -+module_init(extcfg_drv_init); -+ -+static void __exit extcfg_drv_exit(void) -+{ -+ free_irq(irq, sci_interrupt_handler); -+} -+module_exit(extcfg_drv_exit); -+ -+static int __init extcfg_dev_init(void) -+{ -+ int ret; -+ struct pnp_dev *dev; -+ struct extcfg *cfg; -+ const char pnpid[sizeof(VMW_EXTCFG)] = VMW_EXTCFG; -+ -+ /* Do nothing if ACPI is enabled */ -+ if (!acpi_disabled) -+ return -ENODEV; -+ -+ ret = pnp_register_protocol(&pnpacpi_protocol); -+ if (ret) -+ return ret; -+ dev = pnp_alloc_dev(&pnpacpi_protocol, 0, &pnpid[0]); -+ if (!dev) -+ return -ENOMEM; -+ -+ dev->capabilities |= (PNP_CONFIGURABLE | PNP_READ | PNP_WRITE); -+ -+ /* Register IO Ports */ -+ if (pnp_register_port_resource(dev, 0, VMW_EXTCFG_IO_MIN, VMW_EXTCFG_IO_MAX, -+ VMW_EXTCFG_IO_ALIGN, VMW_EXTCFG_IO_SIZE, 0) < 0) -+ return -ENOMEM; -+ /* Register MM IO region */ -+ if (pnp_register_mem_resource(dev, 0, VMW_EXTCFG_MMIO_MIN, -+ VMW_EXTCFG_MMIO_MAX, VMW_EXTCFG_MMIO_ALIGN, -+ VMW_EXTCFG_MMIO_SIZE, 0) < 0) -+ return -ENOMEM; -+ -+ if (pnp_device_attach(dev) < 0) -+ return -ENODEV; -+ -+ /* ensure resources are allocated */ -+ if (pnp_auto_config_dev(dev)) { -+ pnp_device_detach(dev); -+ return -EBUSY; -+ } -+ -+ dev->active = 1; -+ -+ ret = pnp_add_device(dev); -+ if (ret) { -+ put_device(&dev->dev); -+ pnp_device_detach(dev); -+ return ret; -+ } -+ -+ cfg = get_extcfg(); -+ -+ cfg->io_bar = pnp_port_start(dev, 0); -+ cfg->mmio_bar = pnp_mem_start(dev, 0); -+ cfg->mmio_addr = ioremap(cfg->mmio_bar, VMW_EXTCFG_MMIO_SIZE); -+ -+ pnp_set_drvdata(dev, &cfg); -+ -+ pr_notice("VMware Ext Config-> IO: 0x%016llX MMIO: 0x%016llX\n", -+ cfg->io_bar, cfg->mmio_bar); -+ -+ /* -+ * PCI Configuration Changes for Extended Configuration Device -+ * Changes are in PCI Device 00:00.0 -+ * Refer wiki: https://wiki.eng.vmware.com/VirtualHardware/Chipset for details -+ */ -+ if (pci_direct_conf1.write(0, 0, 0, PCI_REG_EXT_CONF_IO_BAR, 4, -+ (u32)cfg->io_bar) < 0) -+ return -EINVAL; -+ if (pci_direct_conf1.write(0, 0, 0, PCI_REG_EXT_CONF_MMIO_BAR, 4, -+ (u32)cfg->mmio_bar) < 0) -+ return -EINVAL; -+ -+ return 0; -+} -+fs_initcall(extcfg_dev_init); -+ -+static int __init initialize_ioapic_sci(void) -+{ -+ if (acpi_disabled) { -+ return ext_mp_register_ioapic_irq(SCI_IRQ_NO, -+ APIC_POLARITY_ACTIVE_LOW, -+ APIC_POLARITY_ACTIVE_LOW, -+ SCI_IRQ_NO); -+ } -+ return 0; -+} -+core_initcall(initialize_ioapic_sci); -+ -+MODULE_AUTHOR("VMware, Inc."); -+MODULE_DESCRIPTION("VMware Virtual Chipset Extended Configuration Driver."); -+MODULE_VERSION("1.0"); -+MODULE_LICENSE("Dual BSD/GPL"); -diff --git a/drivers/misc/vmw_extcfg/extcfg_driver.h b/drivers/misc/vmw_extcfg/extcfg_driver.h -new file mode 100644 -index 000000000..ca20e97d3 ---- /dev/null -+++ b/drivers/misc/vmw_extcfg/extcfg_driver.h -@@ -0,0 +1,26 @@ -+/* SPDX-License-Identifier: Dual BSD/GPL */ -+/* -+ * VMware Virtual Chipset Extended Configuration Driver -+ * -+ * Copyright (C) 2022 VMware, Inc. All rights reserved. -+ */ -+ -+#ifndef _EXTCFG_DRIVER_H_ -+#define _EXTCFG_DRIVER_H_ -+ -+#include -+ -+#define PCI_REG_EXT_CONF_IO_BAR 0x40 -+#define PCI_REG_EXT_CONF_MMIO_BAR 0x44 -+ -+#define VMW_EXTCFG_IO_MIN 0xf000 -+#define VMW_EXTCFG_IO_MAX 0xffff -+#define VMW_EXTCFG_IO_ALIGN 0x1000 -+#define VMW_EXTCFG_IO_SIZE 32 -+ -+#define VMW_EXTCFG_MMIO_MIN 0xf0000000 -+#define VMW_EXTCFG_MMIO_MAX 0xffffffff -+#define VMW_EXTCFG_MMIO_ALIGN 0x200000 -+#define VMW_EXTCFG_MMIO_SIZE (18 << 20) -+ -+#endif /* _EXTCFG_DRIVER_H_ */ --- -2.39.4 - diff --git a/SPECS/91/linux/esx/0002-vmw_extcfg-hotplug-without-firmware-support.patch b/SPECS/91/linux/esx/0002-vmw_extcfg-hotplug-without-firmware-support.patch deleted file mode 100644 index 44c81a144c..0000000000 --- a/SPECS/91/linux/esx/0002-vmw_extcfg-hotplug-without-firmware-support.patch +++ /dev/null @@ -1,430 +0,0 @@ -From 2e728d95d3ba90c364db3b2cbc594fb5700068ba Mon Sep 17 00:00:00 2001 -From: Vamsi Krishna Brahmajosyula -Date: Mon, 28 Feb 2022 22:48:48 +0530 -Subject: [PATCH] 0002-vmw_extcfg: Introduce Memory hotplug via Ext - Config - -Detects available memory regions during device init. -Add a handler to detect IRQ 9 which can handle memory -hotplug. - -When the interrupt handler is invoked - -* Find the Memory device attached and reserve the region. -* Add memory device to guest OS -* Acknowledge the event - -Signed-off-by: Vamsi Krishna Brahmajosyula -Signed-off-by: Him Kalyan Bordoloi -Signed-off-by: Alex Upshaw ---- - drivers/misc/vmw_extcfg/Makefile | 2 +- - drivers/misc/vmw_extcfg/extcfg_device.h | 40 ++++ - drivers/misc/vmw_extcfg/extcfg_driver.c | 6 + - drivers/misc/vmw_extcfg/extcfg_hotplug.c | 189 ++++++++++++++++++ - .../misc/vmw_extcfg/extcfg_memory_hotplug.c | 91 +++++++++ - 5 files changed, 327 insertions(+), 1 deletion(-) - create mode 100644 drivers/misc/vmw_extcfg/extcfg_hotplug.c - create mode 100644 drivers/misc/vmw_extcfg/extcfg_memory_hotplug.c - -diff --git a/drivers/misc/vmw_extcfg/Makefile b/drivers/misc/vmw_extcfg/Makefile -index 909b41339..8f86fbd4d 100644 ---- a/drivers/misc/vmw_extcfg/Makefile -+++ b/drivers/misc/vmw_extcfg/Makefile -@@ -1,3 +1,3 @@ - # SPDX-License-Identifier: Dual BSD/GPL - obj-$(CONFIG_VMWARE_EXTCFG) += vmw_extcfg.o --vmw_extcfg-$(CONFIG_VMWARE_EXTCFG) += extcfg_device.o extcfg_driver.o -\ No newline at end of file -+vmw_extcfg-$(CONFIG_VMWARE_EXTCFG) += extcfg_device.o extcfg_hotplug.o extcfg_memory_hotplug.o extcfg_driver.o -\ No newline at end of file -diff --git a/drivers/misc/vmw_extcfg/extcfg_device.h b/drivers/misc/vmw_extcfg/extcfg_device.h -index 936d773fe..b289ea0fc 100644 ---- a/drivers/misc/vmw_extcfg/extcfg_device.h -+++ b/drivers/misc/vmw_extcfg/extcfg_device.h -@@ -43,6 +43,11 @@ enum devhp_commands { HOTADD_COMMAND = 1, HOTREMOVE_COMMAND = 2 }; - #define PMGLOBCTL_REG 0x1028 - - #define ANQ_STATUS_OFF 0x100 -+#define ANQ_COMMAND_OFF (ANQ_STATUS_OFF + 4) -+ -+#define ANQ_MEMHP_SUBCODE_ADD 1 -+#define ANQ_MEMHP_SUBCODE_OFF (ANQ_STATUS_OFF + 8) -+#define ANQ_MEMHP_MEM_DEV_NO_OFF (ANQ_STATUS_OFF + 12) - - #define ANQ_STATUS_DONE 0 - #define BIOS_ACPI_MODE 0xF0 -@@ -51,12 +56,47 @@ enum devhp_commands { HOTADD_COMMAND = 1, HOTREMOVE_COMMAND = 2 }; - - #define DEV_HP_QUEUE_BASE (0xA0 + 0x10) - -+#define NUM_MEM_DEVS 512 -+#define MEM_DEVS_BASE_OFFSET 0x1000 -+#define MEM_DEV_SIZE 16 -+#define MEM_DEV_OFFSET_STATUS 0x00 -+#define MEM_DEV_OFFSET_NODE 0x01 -+#define MEM_DEV_OFFSET_BASE 0x00 -+#define MEM_DEV_OFFSET_END 0x08 -+#define MEM_DEV_MASK_BASE 0xFFFFFFFFFFF00000 -+#define MEM_DEV_MASK_END 0xFFFFFFFFFFFF0000 -+ -+#define MEM_STATUS_SUPPORTED 0x80 -+#define MEM_STATUS_REMOVABLE 0x40 -+#define MEM_STATUS_PRESENT 0x20 -+ -+struct hotplug_mem_data { -+ struct list_head list; -+ struct resource mem_resource; -+}; -+ -+struct mem_device { -+ u8 status; -+ u32 dev_id; -+ unsigned long offset; -+ u64 base; -+ u64 end; -+}; -+ - struct extcfg { - resource_size_t io_bar; - resource_size_t mmio_bar; - void *mmio_addr; - }; - -+void process_acpi_notification(struct work_struct *data); -+ -+int detect_hotpluggable_mem(void); -+ -+int process_memory_hotplug(void); -+ -+struct list_head *get_hotplug_mem_data_head(void); -+ - struct extcfg *get_extcfg(void); - - u8 extconf_read_8(unsigned long offset); -diff --git a/drivers/misc/vmw_extcfg/extcfg_driver.c b/drivers/misc/vmw_extcfg/extcfg_driver.c -index 881cd1fcd..f7d791ca4 100644 ---- a/drivers/misc/vmw_extcfg/extcfg_driver.c -+++ b/drivers/misc/vmw_extcfg/extcfg_driver.c -@@ -33,6 +33,7 @@ irqreturn_t sci_interrupt_handler(int irq, void *dev_id) - { - /*disable interrupt*/ - outl(~inl(GPE_STATUS_REG) & inl(GPE_ENABLE_REG), GPE_ENABLE_REG); -+ schedule_work(&hotplug_work); - return IRQ_HANDLED; - } - -@@ -62,6 +63,7 @@ static int __init extcfg_drv_init(void) - GPE_ENABLE_REG); - } - -+ INIT_WORK(&hotplug_work, process_acpi_notification); - ioapic_set_alloc_attr(&info, NUMA_NO_NODE, ACPI_LEVEL_SENSITIVE, - ACPI_ACTIVE_LOW); - irq = mp_map_gsi_to_irq(gsi, IOAPIC_MAP_ALLOC, &info); -@@ -148,6 +150,10 @@ static int __init extcfg_dev_init(void) - (u32)cfg->mmio_bar) < 0) - return -EINVAL; - -+ ret = detect_hotpluggable_mem(); -+ if (ret < 0) -+ return ret; -+ - return 0; - } - fs_initcall(extcfg_dev_init); -diff --git a/drivers/misc/vmw_extcfg/extcfg_hotplug.c b/drivers/misc/vmw_extcfg/extcfg_hotplug.c -new file mode 100644 -index 000000000..2c2dea365 ---- /dev/null -+++ b/drivers/misc/vmw_extcfg/extcfg_hotplug.c -@@ -0,0 +1,189 @@ -+// SPDX-License-Identifier: Dual BSD/GPL -+/* -+ * VMware Virtual Chipset Extended Configuration Driver -+ * -+ * Copyright (C) 2022 VMware, Inc. All rights reserved. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "extcfg_device.h" -+ -+static bool hotadd_mem_enabled; -+struct list_head hotplug_mem_data_head; -+ -+struct list_head *get_hotplug_mem_data_head(void) -+{ -+ return &hotplug_mem_data_head; -+} -+ -+int __init process_memory_hotplug_region(struct hotplug_mem_data *data) -+{ -+ int ret = 0; -+ -+ pr_notice("Hot addable memory detected in range 0x%016llX to 0x%016llX.\n", -+ data->mem_resource.start, data->mem_resource.end); -+ -+ ret = request_resource(&iomem_resource, &data->mem_resource); -+ -+ if (ret < 0) { -+ hotadd_mem_enabled = false; -+ pr_err("Failed to reserve physical address-space resource for hot addable memory;" -+ " memory hot adds will be ignored.\n"); -+ } else { -+ hotadd_mem_enabled = true; -+ } -+ -+ return ret; -+} -+ -+/* Scan the memory-related entries in the extended configuration device to -+ * determine the physical address range of hot-addable memory and create a -+ * list of resources to reserve it. Handle memory hole (say pci hole) by -+ * creating a buckets of ranges to reserve. -+ */ -+int __init detect_hotpluggable_mem(void) -+{ -+ unsigned long i; -+ int ret = 0; -+ struct hotplug_mem_data *current_data = NULL; -+ struct list_head *position = NULL; -+ struct mem_device mem; -+ -+ hotadd_mem_enabled = false; -+ INIT_LIST_HEAD(&hotplug_mem_data_head); -+ -+ for (i = 0; i < NUM_MEM_DEVS; i++) { -+ mem.offset = MEM_DEVS_BASE_OFFSET + MEM_DEV_SIZE * i; -+ mem.status = extconf_read_8(mem.offset + MEM_DEV_OFFSET_STATUS); -+ -+ if ((mem.status & MEM_STATUS_SUPPORTED) && -+ !(mem.status & MEM_STATUS_PRESENT)) { -+ mem.base = extconf_read_64(mem.offset + -+ MEM_DEV_OFFSET_BASE); -+ mem.base &= MEM_DEV_MASK_BASE; -+ mem.end = extconf_read_64(mem.offset + -+ MEM_DEV_OFFSET_END); -+ mem.end &= MEM_DEV_MASK_END; -+ -+ /* Convert from the exclusive end offsets used in the -+ * extended configuration memory device entries to -+ * the inclusive offsets used for kernel resources. -+ */ -+ mem.end--; -+ -+ if (current_data) { -+ if (current_data->mem_resource.end + 1 != -+ mem.base) { -+ /* We have detected a hole */ -+ current_data = NULL; -+ } else { -+ /* Expand the current resource */ -+ current_data->mem_resource.end = -+ mem.end; -+ } -+ } -+ -+ if (!current_data) { -+ current_data = -+ kzalloc(sizeof(struct hotplug_mem_data), -+ GFP_KERNEL); -+ if (!current_data) { -+ pr_err("Failed to allocate memory to create a kernel resource for detected hot added memory.\n"); -+ return -ENOMEM; -+ } -+ -+ INIT_LIST_HEAD(¤t_data->list); -+ -+ current_data->mem_resource.start = mem.base; -+ current_data->mem_resource.end = mem.end; -+ current_data->mem_resource.flags = -+ IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY; -+ current_data->mem_resource.name = -+ "Hot Pluggable RAM"; -+ -+ list_add_tail(¤t_data->list, -+ &hotplug_mem_data_head); -+ -+ hotadd_mem_enabled = true; -+ } -+ } -+ } -+ -+ /* This call must occur before anything tries to -+ * dynamically allocate resources from the physical address -+ * space (i.e. iomem_resource), or those dynamic -+ * allocations might conflict with newly added memory in -+ * the event of a hot add. -+ */ -+ list_for_each(position, &hotplug_mem_data_head) { -+ current_data = -+ list_entry(position, struct hotplug_mem_data, list); -+ ret = process_memory_hotplug_region(current_data); -+ if (ret < 0) -+ return ret; -+ } -+ -+ if (!hotadd_mem_enabled) -+ pr_notice("No hot addable memory detected.\n"); -+ -+ return ret; -+} -+ -+void process_acpi_system_event(void) -+{ -+ int ret; -+ int command; -+ -+ /* Read command(type of event) */ -+ command = read_acpi_notification_queue(ANQ_COMMAND_OFF); -+ -+ switch (command) { -+ case MEM_HOTPLUG_COMMAND: -+ if (!hotadd_mem_enabled) { -+ pr_err("Mem Hotplug can not be processed. No hot addable memory found."); -+ break; -+ } -+ ret = process_memory_hotplug(); -+ if (ret < 0) -+ pr_err("Mem Hotplug request failed with %d", -+ ret); -+ break; -+ case CPU_HOTPLUG_COMMAND: -+ break; -+ default: -+ pr_err("Unknown/Unsupported Hotplug request %d", command); -+ break; -+ } -+} -+ -+void process_acpi_notification(struct work_struct *data) -+{ -+ u32 status; -+ -+ status = inl(GPE_STATUS_REG); -+ -+ /* GPE bit is 1 for Device Hotplug and 2 for General */ -+ switch (status) { -+ case GPE_1_MASK: -+ pr_warn("Device Hotplug not available."); -+ break; -+ case GPE_2_MASK: -+ process_acpi_system_event(); -+ break; -+ default: -+ pr_err("Unknown Hotplug request GPE %d", status); -+ break; -+ } -+ -+ post_process_acpi_event(status); -+} -diff --git a/drivers/misc/vmw_extcfg/extcfg_memory_hotplug.c b/drivers/misc/vmw_extcfg/extcfg_memory_hotplug.c -new file mode 100644 -index 000000000..380450aec ---- /dev/null -+++ b/drivers/misc/vmw_extcfg/extcfg_memory_hotplug.c -@@ -0,0 +1,91 @@ -+// SPDX-License-Identifier: Dual BSD/GPL -+/* -+ * VMware Virtual Chipset Extended Configuration Driver -+ * -+ * Copyright (C) 2022 VMware, Inc. All rights reserved. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "extcfg_device.h" -+ -+int process_memory_hotplug(void) -+{ -+ struct resource *res; -+ int ret; -+ u8 numa_node; -+ struct list_head *position = NULL; -+ struct list_head *hotplug_mem_data_head = NULL; -+ struct hotplug_mem_data *current_data = NULL; -+ struct mem_device mem; -+ -+ if (read_acpi_notification_queue(ANQ_MEMHP_SUBCODE_OFF) != -+ ANQ_MEMHP_SUBCODE_ADD) { -+ return -ENODEV; -+ } -+ -+ mem.dev_id = read_acpi_notification_queue(ANQ_MEMHP_MEM_DEV_NO_OFF); -+ mem.offset = MEM_DEVS_BASE_OFFSET + MEM_DEV_SIZE * mem.dev_id; -+ mem.status = extconf_read_8(mem.offset + MEM_DEV_OFFSET_STATUS); -+ if (!((mem.status & MEM_STATUS_SUPPORTED) && -+ (mem.status & MEM_STATUS_PRESENT))) { -+ /* We expect the hot added memory to be marked as -+ * supported and present. -+ */ -+ return -ENODEV; -+ } -+ numa_node = extconf_read_8(mem.offset + MEM_DEV_OFFSET_NODE); -+ mem.base = extconf_read_64(mem.offset + MEM_DEV_OFFSET_BASE); -+ mem.base &= MEM_DEV_MASK_BASE; -+ mem.end = extconf_read_64(mem.offset + MEM_DEV_OFFSET_END); -+ mem.end &= MEM_DEV_MASK_END; -+ -+ /* Convert from the exclusive end offsets used in the extended -+ * configuration memory device entries to the inclusive -+ * offsets used for kernel resources. -+ */ -+ mem.end--; -+ -+ res = kzalloc(sizeof(struct resource), GFP_KERNEL); -+ if (!res) -+ return -ENOMEM; -+ -+ res->name = "System RAM"; -+ res->start = mem.base; -+ res->end = mem.end; -+ res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY; -+ -+ hotplug_mem_data_head = get_hotplug_mem_data_head(); -+ -+ list_for_each(position, hotplug_mem_data_head) { -+ current_data = -+ list_entry(position, struct hotplug_mem_data, list); -+ ret = request_resource(¤t_data->mem_resource, res); -+ if (ret == 0) -+ break; -+ } -+ -+ if (ret < 0) { -+ pr_err("Failed to reserve resource for hot added memory.\n"); -+ kfree(res); -+ return ret; -+ } -+ -+ /* Add the memory to the memory manager. */ -+ ret = add_memory_resource(numa_node, res, MHP_MERGE_RESOURCE); -+ if (ret < 0) { -+ pr_err("Failed to add hot added memory to the memory manager.\n"); -+ release_resource(res); -+ kfree(res); -+ return ret; -+ } -+ -+ pr_notice("Successfully hot addedd memory in range 0x%016llX to 0x%016llX to node 0x%02X\n", -+ mem.base, mem.end, numa_node); -+ return ret; -+} --- -2.39.4 - diff --git a/SPECS/91/linux/esx/0003-vmw_extcfg-hotplug-without-firmware-support.patch b/SPECS/91/linux/esx/0003-vmw_extcfg-hotplug-without-firmware-support.patch deleted file mode 100644 index 5cc887e55f..0000000000 --- a/SPECS/91/linux/esx/0003-vmw_extcfg-hotplug-without-firmware-support.patch +++ /dev/null @@ -1,219 +0,0 @@ -From 1374c5ede53d70564276c68e79c567ec8f6d5b8f Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Mon, 17 Mar 2025 06:31:04 +0000 -Subject: [PATCH] 0003-vmw_extcfg: Introduce CPU hotplug via Ext Config - -When the interrupt handler is invoked - -* Find the CPU attached or removed. -* Add or Remove CPU to the guest OS -* Expect the userspace to online/offile the cpu -* Acknowledge the event - -Signed-off-by: Vamsi Krishna Brahmajosyula -Signed-off-by: Him Kalyan Bordoloi -Signed-off-by: Alex Upshaw -Signed-off-by: Ajay Kaher ---- - arch/x86/include/asm/apic.h | 1 + - arch/x86/kernel/cpu/topology.c | 2 +- - drivers/misc/vmw_extcfg/Makefile | 2 +- - drivers/misc/vmw_extcfg/extcfg_cpu_hotplug.c | 93 ++++++++++++++++++++ - drivers/misc/vmw_extcfg/extcfg_device.h | 18 ++++ - drivers/misc/vmw_extcfg/extcfg_hotplug.c | 4 + - 6 files changed, 118 insertions(+), 2 deletions(-) - create mode 100644 drivers/misc/vmw_extcfg/extcfg_cpu_hotplug.c - -diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h -index f21ff1932..492481b9a 100644 ---- a/arch/x86/include/asm/apic.h -+++ b/arch/x86/include/asm/apic.h -@@ -183,6 +183,7 @@ extern void topology_hotunplug_apic(unsigned int cpu); - extern void topology_apply_cmdline_limits_early(void); - extern void topology_init_possible_cpus(void); - extern void topology_reset_possible_cpus_up(void); -+extern int topo_lookup_cpuid(u32 apic_id); - - #else /* !CONFIG_X86_LOCAL_APIC */ - static inline void lapic_shutdown(void) { } -diff --git a/arch/x86/kernel/cpu/topology.c b/arch/x86/kernel/cpu/topology.c -index 621a151cc..054d1b430 100644 ---- a/arch/x86/kernel/cpu/topology.c -+++ b/arch/x86/kernel/cpu/topology.c -@@ -95,7 +95,7 @@ static inline u32 topo_apicid(u32 apicid, enum x86_topology_domains dom) - return apicid & (UINT_MAX << x86_topo_system.dom_shifts[dom - 1]); - } - --static int topo_lookup_cpuid(u32 apic_id) -+int topo_lookup_cpuid(u32 apic_id) - { - int i; - -diff --git a/drivers/misc/vmw_extcfg/Makefile b/drivers/misc/vmw_extcfg/Makefile -index 8f86fbd4d..3f69112a1 100644 ---- a/drivers/misc/vmw_extcfg/Makefile -+++ b/drivers/misc/vmw_extcfg/Makefile -@@ -1,3 +1,3 @@ - # SPDX-License-Identifier: Dual BSD/GPL - obj-$(CONFIG_VMWARE_EXTCFG) += vmw_extcfg.o --vmw_extcfg-$(CONFIG_VMWARE_EXTCFG) += extcfg_device.o extcfg_hotplug.o extcfg_memory_hotplug.o extcfg_driver.o -\ No newline at end of file -+vmw_extcfg-$(CONFIG_VMWARE_EXTCFG) += extcfg_device.o extcfg_hotplug.o extcfg_memory_hotplug.o extcfg_cpu_hotplug.o extcfg_driver.o -\ No newline at end of file -diff --git a/drivers/misc/vmw_extcfg/extcfg_cpu_hotplug.c b/drivers/misc/vmw_extcfg/extcfg_cpu_hotplug.c -new file mode 100644 -index 000000000..05c6b97ff ---- /dev/null -+++ b/drivers/misc/vmw_extcfg/extcfg_cpu_hotplug.c -@@ -0,0 +1,93 @@ -+// SPDX-License-Identifier: Dual BSD/GPL -+/* -+ * VMware Virtual Chipset Extended Configuration Driver -+ * -+ * Copyright (C) 2022 VMware, Inc. All rights reserved. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "extcfg_device.h" -+ -+int process_cpu_hotadd(u32 processor_id, u32 apicid) -+{ -+ int ret; -+ -+ ret = arch_register_cpu(processor_id); -+ if (ret) -+ return ret; -+ -+ ret = topology_hotplug_apic(apicid, processor_id); -+ -+ pr_info("CPU%d added successfully", processor_id); -+ -+ return ret; -+} -+ -+int process_cpu_hotremove(u32 processor_id, u32 apicid) -+{ -+ int cpu; -+ unsigned long offset; -+ -+ if (cpu_online(processor_id)) { -+ /* -+ * the cpu pointed by processor_id is online. Do not do anything. -+ */ -+ return -EBUSY; -+ } -+ -+ offset = ANQ_CPUHP_BASE; -+ -+ /* Remove the CPU. */ -+ cpu = topo_lookup_cpuid(apicid); -+ topology_hotunplug_apic(cpu); -+ arch_unregister_cpu(processor_id); -+ -+ /* Notify eject is complete */ -+ -+ if (processor_id <= 128) { -+ offset += VCPUHP_NOTIFY_REMOVED_OFF | -+ VCS_VCPUID_SUBSET_IDX(processor_id); -+ -+ extconf_write_64_mmio(offset, -+ VCS_VCPUID_SUBSET_BIT(processor_id)); -+ } else { -+ write_acpi_notification_queue(CPU_EJECT2_BASE, processor_id); -+ } -+ -+ pr_info("CPU%d removed successfully", processor_id); -+ return 0; -+} -+ -+int process_cpu_hotplug(void) -+{ -+ u32 processor_id; -+ u32 apicid; -+ int ret; -+ int subcode; -+ -+ subcode = read_acpi_notification_queue(ANQ_CPUHP_SUBCODE_OFF); -+ if (subcode != ANQ_CPUHP_SUBCODE_ADD && -+ subcode != ANQ_CPUHP_SUBCODE_REMOVE) { -+ pr_warn("Subcode %d received, not supported", -+ subcode); -+ return -ENODEV; -+ } -+ -+ processor_id = read_acpi_notification_queue(ANQ_VCPU_NO_OFF); -+ -+ apicid = extconf_read_8(CPU_APICID_BASE + processor_id); -+ -+ if (subcode == ANQ_CPUHP_SUBCODE_ADD) -+ ret = process_cpu_hotadd(processor_id, apicid); -+ else -+ ret = process_cpu_hotremove(processor_id, apicid); -+ -+ return ret; -+} -diff --git a/drivers/misc/vmw_extcfg/extcfg_device.h b/drivers/misc/vmw_extcfg/extcfg_device.h -index b289ea0fc..f6140614b 100644 ---- a/drivers/misc/vmw_extcfg/extcfg_device.h -+++ b/drivers/misc/vmw_extcfg/extcfg_device.h -@@ -49,10 +49,26 @@ enum devhp_commands { HOTADD_COMMAND = 1, HOTREMOVE_COMMAND = 2 }; - #define ANQ_MEMHP_SUBCODE_OFF (ANQ_STATUS_OFF + 8) - #define ANQ_MEMHP_MEM_DEV_NO_OFF (ANQ_STATUS_OFF + 12) - -+#define ANQ_CPUHP_SUBCODE_ADD 0 -+#define ANQ_CPUHP_SUBCODE_REMOVE 3 -+#define ANQ_COMMAND_OFF (ANQ_STATUS_OFF + 4) -+#define ANQ_CPUHP_SUBCODE_OFF (ANQ_STATUS_OFF + 8) -+#define ANQ_VCPU_NO_OFF (ANQ_STATUS_OFF + 12) -+ - #define ANQ_STATUS_DONE 0 - #define BIOS_ACPI_MODE 0xF0 - #define SCI_IRQ_NO 9 - #define APIC_POLARITY_ACTIVE_LOW 3 -+#define CPU_APICID_BASE 0x03200 -+#define ANQ_CPUHP_BASE 0x00040 -+#define CPU_EJECT2_BASE 0x00450 -+#define VCPUHP_NOTIFY_REMOVED_OFF 32 -+ -+#define VCS_SUBSET_SHIFT 6 -+#define CONST64U(c) c##uLL -+#define VCS_SUBSET_MASK ((CONST64U(1) << VCS_SUBSET_SHIFT) - 1) -+#define VCS_VCPUID_SUBSET_IDX(v) ((v) >> VCS_SUBSET_SHIFT) -+#define VCS_VCPUID_SUBSET_BIT(v) (CONST64U(1) << ((v)&VCS_SUBSET_MASK)) - - #define DEV_HP_QUEUE_BASE (0xA0 + 0x10) - -@@ -95,6 +111,8 @@ int detect_hotpluggable_mem(void); - - int process_memory_hotplug(void); - -+int process_cpu_hotplug(void); -+ - struct list_head *get_hotplug_mem_data_head(void); - - struct extcfg *get_extcfg(void); -diff --git a/drivers/misc/vmw_extcfg/extcfg_hotplug.c b/drivers/misc/vmw_extcfg/extcfg_hotplug.c -index 2c2dea365..dc5a9b8d7 100644 ---- a/drivers/misc/vmw_extcfg/extcfg_hotplug.c -+++ b/drivers/misc/vmw_extcfg/extcfg_hotplug.c -@@ -159,6 +159,10 @@ void process_acpi_system_event(void) - ret); - break; - case CPU_HOTPLUG_COMMAND: -+ ret = process_cpu_hotplug(); -+ if (ret < 0) -+ pr_err("CPU Hotplug request failed with %d", -+ ret); - break; - default: - pr_err("Unknown/Unsupported Hotplug request %d", command); --- -2.39.4 - diff --git a/SPECS/91/linux/esx/01-clear-linux.patch b/SPECS/91/linux/esx/01-clear-linux.patch deleted file mode 100644 index cb387641e4..0000000000 --- a/SPECS/91/linux/esx/01-clear-linux.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 7d80ae3e4f1dd73fb61010e5a84135d3e92ba47e Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Tue, 9 May 2017 12:26:58 -0700 -Subject: [PATCH] Patch from Clear Linux - -Signed-off-by: Bo Gan ---- - drivers/video/fbdev/core/fbcon.c | 2 +- - include/linux/blk-mq.h | 2 +- - init/do_mounts.c | 2 +- - mm/vmstat.c | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c -index c910e74..59e1c7c 100644 ---- a/drivers/video/fbdev/core/fbcon.c -+++ b/drivers/video/fbdev/core/fbcon.c -@@ -148,7 +148,7 @@ static const struct consw fb_con; - - #define advance_row(p, delta) (unsigned short *)((unsigned long)(p) + (delta) * vc->vc_size_row) - --static int fbcon_cursor_noblink; -+static int fbcon_cursor_noblink = 1; - - #define divides(a, b) ((!(a) || (b)%(a)) ? 0 : 1) - -diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h -index 1532cd07a597..01ef715ad1a8 100644 ---- a/include/linux/blk-mq.h -+++ b/include/linux/blk-mq.h -@@ -12,7 +12,7 @@ struct blk_mq_tags; - struct blk_flush_queue; - - #define BLKDEV_MIN_RQ 4 --#define BLKDEV_DEFAULT_RQ 128 -+#define BLKDEV_DEFAULT_RQ 4096 - - enum rq_end_io_ret { - RQ_END_IO_NONE, -diff --git a/init/do_mounts.c b/init/do_mounts.c -index e083d54fa167..3ad54972f2c2 100644 ---- a/init/do_mounts.c -+++ b/init/do_mounts.c -@@ -614,7 +614,7 @@ void __init prepare_namespace(void) - * For example, it is not atypical to wait 5 seconds here - * for the touchpad of a laptop to initialize. - */ -- wait_for_device_probe(); -+ async_synchronize_full(); - - md_run_setup(); - -diff --git a/mm/vmstat.c b/mm/vmstat.c -index 90af9a8572f5..9ede6a77f2b2 100644 ---- a/mm/vmstat.c -+++ b/mm/vmstat.c -@@ -1874,7 +1874,7 @@ static const struct seq_operations vmstat_op = { - - #ifdef CONFIG_SMP - static DEFINE_PER_CPU(struct delayed_work, vmstat_work); --int sysctl_stat_interval __read_mostly = HZ; -+int sysctl_stat_interval __read_mostly = 8 * HZ; - - #ifdef CONFIG_PROC_FS - static void refresh_vm_stats(struct work_struct *work) diff --git a/SPECS/91/linux/esx/02-pci-probe.patch b/SPECS/91/linux/esx/02-pci-probe.patch deleted file mode 100644 index 4a33bf38fe..0000000000 --- a/SPECS/91/linux/esx/02-pci-probe.patch +++ /dev/null @@ -1,437 +0,0 @@ -From f3d9399aa4400e0765bf995b23e728d1c1f6711f Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Wed, 13 Nov 2024 12:48:50 +0000 -Subject: [PATCH] pci/probe.c: Hardcodded pci probe. - -PCI probing takes a long time to scan resources for all devices -on PCI bus. Idea of this patch is to hardcode known resources -for known devices. In VMware hypervisor we do not have much -virtual PCI devices. - -is_known_device() has list of known devices and available -resources (BARs) for them. - -Added pci=scan_all cmdline parameter verifies hardcodded pci -values at runtime. - -Signed-off-by: Alexey Makhalov -Signed-off-by: Vikash Bansal -Signed-off-by: Bo Gan ---- - drivers/pci/iov.c | 3 +- - drivers/pci/pci.c | 2 + - drivers/pci/pci.h | 4 +- - drivers/pci/probe.c | 275 ++++++++++++++++++++++++++++++++++++++++++-- - 4 files changed, 275 insertions(+), 9 deletions(-) - -diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c -index aaa33e8dc..24677ccf7 100644 ---- a/drivers/pci/iov.c -+++ b/drivers/pci/iov.c -@@ -796,7 +796,8 @@ static int sriov_init(struct pci_dev *dev, int pos) - bar64 = (res->flags & IORESOURCE_MEM_64) ? 1 : 0; - else - bar64 = __pci_read_base(dev, pci_bar_unknown, res, -- pos + PCI_SRIOV_BAR + i * 4); -+ pos + PCI_SRIOV_BAR + i * 4, -+ PCI_ERROR_RESPONSE, 0); - if (!res->flags) - continue; - if (resource_size(res) & (PAGE_SIZE - 1)) { -diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c -index 225a6cd2e..8e02b7154 100644 ---- a/drivers/pci/pci.c -+++ b/drivers/pci/pci.c -@@ -6934,6 +6934,8 @@ static int __init pci_setup(char *str) - pci_add_flags(PCI_SCAN_ALL_PCIE_DEVS); - } else if (!strncmp(str, "disable_acs_redir=", 18)) { - disable_acs_redir_param = str + 18; -+ } else if (!strncmp(str, "scan_all", 8)) { -+ pci_scan_all(); - } else if (!strncmp(str, "config_acs=", 11)) { - config_acs_param = str + 11; - } else { -diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h -index 14d00ce45..df1d9ebae 100644 ---- a/drivers/pci/pci.h -+++ b/drivers/pci/pci.h -@@ -231,6 +231,7 @@ void pci_no_msi(void); - static inline void pci_no_msi(void) { } - #endif - -+void pci_scan_all(void); - void pci_realloc_get_opt(char *); - - static inline int pci_no_d1d2(struct pci_dev *dev) -@@ -315,7 +316,8 @@ int pci_idt_bus_quirk(struct pci_bus *bus, int devfn, u32 *pl, int rrs_timeout); - - int pci_setup_device(struct pci_dev *dev); - int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, -- struct resource *res, unsigned int reg); -+ struct resource *res, unsigned int reg, -+ u32 sz_known, u32 sz2_known); - void pci_configure_ari(struct pci_dev *dev); - void __pci_bus_size_bridges(struct pci_bus *bus, - struct list_head *realloc_head); -diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c -index f1615805f..124675f9d 100644 ---- a/drivers/pci/probe.c -+++ b/drivers/pci/probe.c -@@ -31,6 +31,159 @@ static struct resource busn_resource = { - .flags = IORESOURCE_BUS, - }; - -+/** -+ *pci_dev_bar_info : Representation of BARs for PCI device -+ *@vid: Vendor ID of PCI device -+ *@did: Device ID of PCI device -+ *@nbar: Numbers of bars to be read for PCI device -+ *@rom[2]: Known Values of ROM bars (rom1 for type1 (bridge) device) -+ *@bar[6]: Known Values of Bars 0-5 -+ * -+ * bar[i]/rom = 0: no BAR at this position. -+ * bar[i]/rom = 0xffffffff: BAR has to be scanned, -+ * applicable for variable size BAR (such as video memory). -+ * any other value: size in PCI BAR format. -+ */ -+ -+struct pci_dev_bar_info { -+ u16 did; -+ u8 nbar; -+ u32 rom[2]; -+ u32 bar[6]; -+}; -+ -+struct pci_vendor_bar_info { -+ u16 vid; -+ u32 ndev; -+ const struct pci_dev_bar_info *dev; -+}; -+ -+/* List of LSI Logic devices */ -+static const struct pci_dev_bar_info lsi_devs[] = { -+ { 0x0030, /* 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI */ -+ 4, /* Number of bars */ -+ { 0xffffc000 }, /* ROM */ -+ /* Bars */ -+ { 0xff01, 0xfffe0004, 0, 0xfffe0004 } }, -+ -+ { 0x0054, /* LSI Logic : SAS1068 PCI-X Fusion-MPT SAS */ -+ 4, /* Number of bars */ -+ { 0xffffc000 }, /* ROM */ -+ /* Bars */ -+ { 0xff01, 0xffffc004, 0, 0xffff0004 } }, -+}; -+ -+ -+/* List of Intel Devices */ -+static const struct pci_dev_bar_info intel_devs[] = { -+ { 0x100f, /* Eth controller[e1000]: Intel 82545EM Gigabit NIC */ -+ 5, /* Number of bars */ -+ { 0xffff0000 }, /* ROM */ -+ /* Bars */ -+ { 0xfffe0004, 0, 0xffff0004, 0, 0xffffffc1 } }, -+ -+ { 0x10d3, /* Eth controller[e1000e]: Intel 82574L Gigabit NIC */ -+ 4, /* Number of bars */ -+ { 0xffff0000 }, /* ROM */ -+ /* Bars */ -+ { 0xfffe0000, 0xfffe0000, 0xffffffe1, 0xffffc000 } }, -+ -+ { 0x7110, /* ISA bridge: 82371AB/EB/MB PIIX4 ISA */ -+ 0, /* Number of bars */ -+ { 0 }, /* ROM */ -+ { 0 } }, /* Bars */ -+ -+ { 0x7111, /* IDE interface: 82371AB/EB/MB PIIX4 IDE */ -+ 5, /* Number of bars */ -+ { 0 }, /* ROM */ -+ /* Bars */ -+ { 0, 0, 0, 0, 0xfffffff1 } }, -+ -+ { 0x7113, /* Bridge: 82371AB/EB/MB PIIX4 ACPI */ -+ 0, /* Number of bars */ -+ { 0 }, /* ROM */ -+ { 0 } }, /* Bars */ -+ -+ { 0x7190, /* Bridge: 82443BX/ZX/DX Host bridge */ -+ 0, /* Number of bars */ -+ { 0 }, /* ROM */ -+ { 0 } }, /* Bars */ -+ -+ { 0x7191, /* PCI Bridge: Intel 440BX/ZX/DX - 82443BX/ZX/DX AGP */ -+ 0, /* Number of bars */ -+ { 0 }, /* ROM */ -+ { 0 } }, /* Bars */ -+}; -+ -+/* List of VMware Devices */ -+static const struct pci_dev_bar_info vmw_devs[] = { -+ { 0x0405, /* VMware SVGA II Adapter */ -+ 3, /* Number of bars */ -+ { 0xffff8000 }, /* ROM */ -+ /* Bars */ -+ {0xfffffff1, 0xffffffff, 0xff800000 } }, -+ -+ { 0x0740, /* VMware Virtual Machine Communication Interface */ -+ 2, /* Number of bars */ -+ { 0 }, /* ROM */ -+ /* Bars */ -+ {0xffffffc1, 0xffffffff } }, -+ -+ { 0x0790, /* VMware PCI bridge */ -+ 0, /* Number of bars */ -+ { 0 }, /* ROM */ -+ { 0 } }, /* Bars */ -+ -+ { 0x07a0, /* VMware PCI Express Root Port */ -+ 0, /* Number of bars */ -+ { 0 }, /* ROM */ -+ { 0 } }, /* Bars */ -+ -+ { 0x07b0, /* VMware VMXNET3 Ethernet Controller */ -+ 4, /* Number of bars */ -+ { 0xffff0000 }, /* ROM */ -+ /* Bars */ -+ { 0xffffffff, 0xfffff000, 0xffffe000, 0xfffffff1 } }, -+ -+ { 0x07c0, /* VMware PVSCSI SCSI Controller */ -+ 2, /* Number of bars */ -+ { 0xffff0000 }, /* ROM */ -+ /* Bars (64-bit addressing for BAR 1) */ -+ { 0xfffffff9, 0xffff8004, 0xffffffff } }, -+ -+ { 0x07e0, /* VMware SATA AHCI controller */ -+ 6, /* Number of bars */ -+ { 0xffff0000 }, /* ROM */ -+ /* Bars */ -+ { 0, 0, 0, 0, 0, 0xfffff000 } }, -+ -+ { 0x0770, /* VMware USB2 EHCI Controller */ -+ 1, /* Number of bars */ -+ { 0 }, /* ROM */ -+ /* Bars */ -+ { 0xfffff000 } }, -+ -+ { 0x0774, /* VMware USB1.1 UHCI Controller */ -+ 5, /* Number of bars */ -+ { 0 }, /* ROM */ -+ /* Bars */ -+ { 0, 0, 0, 0, 0xffffffe1 } }, -+ -+ { 0x0779, /* VMware USB3 xHCI 1.0 Controller */ -+ 1, /* Number of bars */ -+ { 0 }, /* ROM */ -+ /* Bars */ -+ { 0xfffe0004 } }, -+}; -+ -+static const struct pci_vendor_bar_info vendors_bar_table[] = { -+ { 0x1000 /* LSI Logic */, ARRAY_SIZE(lsi_devs), lsi_devs }, -+ { 0x15ad /* VMware */, ARRAY_SIZE(vmw_devs), vmw_devs }, -+ { 0x8086 /* Intel */, ARRAY_SIZE(intel_devs), intel_devs }, -+}; -+ -+static int pci_scan_and_verify; -+ - /* Ugh. Need to stop exporting this to modules. */ - LIST_HEAD(pci_root_buses); - EXPORT_SYMBOL(pci_root_buses); -@@ -162,6 +315,79 @@ static inline unsigned long decode_bar(struct pci_dev *dev, u32 bar) - return flags; - } - -+void pci_scan_all(void) -+{ -+ pci_scan_and_verify = 1; -+} -+ -+/** -+ * __check_known_bars_sz - Provide data for known PCI device BAR sizes -+ * @dev: the PCI device -+ * @reg: PCI register in the config space -+ * @sz_out: (out) -+ * For known BARs, The data read from the BAR register after -+ * a write of all 1's to it. -+ * For non-existent Bars, 0 -+ * For BARs that do need probing, 0xffffffff (PCI_ERROR_RESPONSE) -+ * @sz2_out: (out) -+ * Only when sz_out is sane (not 0 or PCI_ERROR_RESPONSE), it returns -+ * the BAR+1 response for 64-bit memory probing -+ */ -+static void __check_known_bars(struct pci_dev *dev, unsigned int reg, -+ u32 *sz_out, u32 *sz2_out) -+{ -+ u16 vid = dev->vendor; -+ u16 did = dev->device; -+ const struct pci_dev_bar_info *bar_info = NULL; -+ int i, j; -+ -+ BUG_ON( -+ reg != PCI_BASE_ADDRESS_0 && -+ reg != PCI_BASE_ADDRESS_1 && -+ reg != PCI_BASE_ADDRESS_2 && -+ reg != PCI_BASE_ADDRESS_3 && -+ reg != PCI_BASE_ADDRESS_4 && -+ reg != PCI_BASE_ADDRESS_5 && -+ reg != PCI_ROM_ADDRESS && -+ reg != PCI_ROM_ADDRESS1); -+ -+ for (i = 0; i < ARRAY_SIZE(vendors_bar_table); i++) { -+ if (vendors_bar_table[i].vid != vid) -+ continue; -+ -+ for (j = 0; j < vendors_bar_table[i].ndev; j++) { -+ if (vendors_bar_table[i].dev[j].did == did) { -+ bar_info = &vendors_bar_table[i].dev[j]; -+ goto loop_out; -+ } -+ } -+ break; /* Matched table for vendor not having dev, so break */ -+ } -+loop_out: -+ if (!bar_info) { -+ PCI_SET_ERROR_RESPONSE(sz_out); -+ return; -+ } -+ *sz2_out = 0; -+ switch (reg) { -+ case PCI_ROM_ADDRESS: -+ *sz_out = bar_info->rom[(reg - PCI_ROM_ADDRESS) >> 2]; -+ break; -+ case PCI_ROM_ADDRESS1: -+ *sz_out = bar_info->rom[(reg - PCI_ROM_ADDRESS1) >> 2]; -+ break; -+ default: -+ *sz_out = bar_info->bar[(reg - PCI_BASE_ADDRESS_0) >> 2]; -+ break; -+ } -+ if ((*sz_out & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == -+ PCI_BASE_ADDRESS_MEM_TYPE_64) { -+ /* Check 64-bit sizing, if so, respond with bar+1 */ -+ BUG_ON(reg > PCI_BASE_ADDRESS_4); -+ *sz2_out = bar_info->bar[((reg - PCI_BASE_ADDRESS_0) >> 2) + 1]; -+ } -+} -+ - #define PCI_COMMAND_DECODE_ENABLE (PCI_COMMAND_MEMORY | PCI_COMMAND_IO) - - /** -@@ -174,18 +400,27 @@ static inline unsigned long decode_bar(struct pci_dev *dev, u32 bar) - * Returns 1 if the BAR is 64-bit, or 0 if 32-bit. - */ - int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, -- struct resource *res, unsigned int pos) -+ struct resource *res, unsigned int pos, -+ const u32 sz_known, const u32 sz2_known) - { - u32 l = 0, sz = 0, mask; - u64 l64, sz64, mask64; - u16 orig_cmd; - struct pci_bus_region region, inverted_region; - const char *res_name = pci_resource_name(dev, res - dev->resource); -+ const bool known = !PCI_POSSIBLE_ERROR(sz_known); -+ const bool noprobe = known && !pci_scan_and_verify; -+ const bool validate = known && pci_scan_and_verify; - - mask = type ? PCI_ROM_ADDRESS_MASK : ~0; - -+ if (noprobe && !sz_known) { -+ /* BAR doesn't exist */ -+ goto fail; -+ } -+ - /* No printks while decoding is disabled! */ -- if (!dev->mmio_always_on) { -+ if (!noprobe && !dev->mmio_always_on) { - pci_read_config_word(dev, PCI_COMMAND, &orig_cmd); - if (orig_cmd & PCI_COMMAND_DECODE_ENABLE) { - pci_write_config_word(dev, PCI_COMMAND, -@@ -196,9 +431,17 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, - res->name = pci_name(dev); - - pci_read_config_dword(dev, pos, &l); -+ if (noprobe) { -+ sz = sz_known; -+ goto skip_size_probe0; -+ } - pci_write_config_dword(dev, pos, l | mask); - pci_read_config_dword(dev, pos, &sz); - pci_write_config_dword(dev, pos, l); -+skip_size_probe0: -+ if (validate && sz != sz_known) -+ dev_err(&dev->dev, "reg 0x%x: wrong known bar size: %x vs %x\n", -+ pos, sz_known, sz); - - /* - * All bits set in sz means the device isn't working properly. -@@ -238,16 +481,24 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, - - if (res->flags & IORESOURCE_MEM_64) { - pci_read_config_dword(dev, pos + 4, &l); -+ if (noprobe) { -+ sz = sz2_known; -+ goto skip_size_probe1; -+ } - pci_write_config_dword(dev, pos + 4, ~0); - pci_read_config_dword(dev, pos + 4, &sz); - pci_write_config_dword(dev, pos + 4, l); -+skip_size_probe1: -+ if (validate && sz != sz2_known) -+ dev_err(&dev->dev, "reg 0x%x: wrong known bar+1 size: %x vs %x\n", -+ pos, sz2_known, sz); - - l64 |= ((u64)l << 32); - sz64 |= ((u64)sz << 32); - mask64 |= ((u64)~0 << 32); - } - -- if (!dev->mmio_always_on && (orig_cmd & PCI_COMMAND_DECODE_ENABLE)) -+ if (!noprobe && !dev->mmio_always_on && (orig_cmd & PCI_COMMAND_DECODE_ENABLE)) - pci_write_config_word(dev, PCI_COMMAND, orig_cmd); - - if (!sz64) -@@ -312,9 +563,11 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, - fail: - res->flags = 0; - out: -- if (res->flags) -+ if (res->flags) { - pci_info(dev, "%s %pR\n", res_name, res); -- -+ if (validate && !sz_known) -+ dev_err(&dev->dev, "reg 0x%x: Not in known BAR list\n", pos); -+ } - return (res->flags & IORESOURCE_MEM_64) ? 1 : 0; - } - -@@ -331,16 +584,24 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom) - - for (pos = 0; pos < howmany; pos++) { - struct resource *res = &dev->resource[pos]; -+ u32 sz_known = 0, sz2_known = 0; -+ - reg = PCI_BASE_ADDRESS_0 + (pos << 2); -- pos += __pci_read_base(dev, pci_bar_unknown, res, reg); -+ __check_known_bars(dev, reg, &sz_known, &sz2_known); -+ pos += __pci_read_base(dev, pci_bar_unknown, res, reg, -+ sz_known, sz2_known); - } - - if (rom) { - struct resource *res = &dev->resource[PCI_ROM_RESOURCE]; -+ u32 sz_known = 0, sz2_known = 0; -+ - dev->rom_base_reg = rom; - res->flags = IORESOURCE_MEM | IORESOURCE_PREFETCH | - IORESOURCE_READONLY | IORESOURCE_SIZEALIGN; -- __pci_read_base(dev, pci_bar_mem32, res, rom); -+ __check_known_bars(dev, rom, &sz_known, &sz2_known); -+ __pci_read_base(dev, pci_bar_mem32, res, rom, -+ sz_known, sz2_known); - } - } - --- -2.39.4 - diff --git a/SPECS/91/linux/esx/04-quiet-boot.patch b/SPECS/91/linux/esx/04-quiet-boot.patch deleted file mode 100644 index c0484684bb..0000000000 --- a/SPECS/91/linux/esx/04-quiet-boot.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 721dc6e6bc3473ecdc96dede6d02d0520bb78d2b Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Tue, 29 Sep 2015 16:02:20 -0700 -Subject: [PATCH] scsi/sd.c: Lower log level for "Assuming drive cache..." - message. - ---- - drivers/scsi/sd.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c -index 4e08d1c..2fe5106 100644 ---- a/drivers/scsi/sd.c -+++ b/drivers/scsi/sd.c -@@ -2590,7 +2590,7 @@ defaults: - "Assuming drive cache: write back\n"); - sdkp->WCE = 1; - } else { -- sd_first_printk(KERN_WARNING, sdkp, -+ sd_first_printk(KERN_NOTICE, sdkp, - "Assuming drive cache: write through\n"); - sdkp->WCE = 0; - } --- -1.9.1 - diff --git a/SPECS/91/linux/esx/05-pv-ops-clocksource.patch b/SPECS/91/linux/esx/05-pv-ops-clocksource.patch deleted file mode 100644 index 407aef1358..0000000000 --- a/SPECS/91/linux/esx/05-pv-ops-clocksource.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 725ac7c54935bbff858092e2db302afe88062162 Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Tue, 9 May 2017 12:39:18 -0700 -Subject: [PATCH] x86/vmware: pv-ops clocksource - ---- - arch/x86/kernel/cpu/vmware.c | 21 +++++++++++++++++++++ - 1 file changed, 21 insertions(+) - -diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c -index 1f22ed3..1eb5631 100644 ---- a/arch/x86/kernel/cpu/vmware.c -+++ b/arch/x86/kernel/cpu/vmware.c -@@ -134,6 +134,27 @@ static DEFINE_PER_CPU_DECRYPTED(struct vmware_steal_time, vmw_steal_time) __alig - static bool has_steal_clock; - static bool steal_acc __initdata = true; /* steal time accounting */ - -+static u64 vmware_clock_get_cycles(struct clocksource *cs) -+{ -+ return (u64)rdtsc_ordered(); -+} -+ -+static struct clocksource clocksource_vmware = { -+ .name = "vmware-clock", -+ .read = vmware_clock_get_cycles, -+ .rating = 400, -+ .mask = CLOCKSOURCE_MASK(64), -+ .flags = CLOCK_SOURCE_IS_CONTINUOUS, -+ .vdso_clock_mode = VDSO_CLOCKMODE_TSC, -+}; -+ -+/* We want to use clocksource_vmware from the beginning to avoid drifting in -+ monotonic clock */ -+struct clocksource * __init clocksource_default_clock(void) -+{ -+ return &clocksource_vmware; -+} -+ - static __init int setup_vmw_sched_clock(char *s) - { - vmw_sched_clock = false; -@@ -378,6 +399,7 @@ static void __init vmware_paravirt_ops_setup(void) - vmware_guest_cpu_init(); - #endif - } -+ clocksource_register_khz(&clocksource_vmware, vmware_tsc_khz); - } - #else - #define vmware_paravirt_ops_setup() do {} while (0) diff --git a/SPECS/91/linux/esx/07-vmware-only.patch b/SPECS/91/linux/esx/07-vmware-only.patch deleted file mode 100644 index b753a548e3..0000000000 --- a/SPECS/91/linux/esx/07-vmware-only.patch +++ /dev/null @@ -1,72 +0,0 @@ -From bccf15015c4506a0fe0a8de16feae81385ca04ef Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Thu, 23 Jan 2025 10:37:56 +0000 -Subject: [PATCH] vmware only - -skip rdrand if CONFIG_HYPERVISOR_GUEST enabled. - -Signed-off-by: Bo Gan ---- - arch/x86/kernel/cpu/Makefile | 5 +++++ - arch/x86/kernel/cpu/common.c | 3 +++ - arch/x86/kernel/cpu/vmware.c | 5 +++++ - 3 files changed, 13 insertions(+) - -diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile -index 5857a0f5d..0541a2be7 100644 ---- a/arch/x86/kernel/cpu/Makefile -+++ b/arch/x86/kernel/cpu/Makefile -@@ -20,7 +20,12 @@ KCSAN_SANITIZE_common.o := n - obj-y := cacheinfo.o scattered.o - obj-y += topology_common.o topology_ext.o topology_amd.o - obj-y += common.o -+ -+# Trust rdrand on VMware platform -+ifndef CONFIG_HYPERVISOR_GUEST - obj-y += rdrand.o -+endif -+ - obj-y += match.o - obj-y += bugs.o - obj-y += aperfmperf.o -diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c -index b54717e6f..bd5be59c8 100644 ---- a/arch/x86/kernel/cpu/common.c -+++ b/arch/x86/kernel/cpu/common.c -@@ -1964,7 +1964,10 @@ static void identify_cpu(struct cpuinfo_x86 *c) - c->x86, c->x86_model); - } - -+ /* Trust rdrand on VMware platform */ -+#ifndef CONFIG_HYPERVISOR_GUEST - x86_init_rdrand(c); -+#endif - setup_pku(c); - setup_cet(c); - -diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c -index 889bb8619..1565cd2d5 100644 ---- a/arch/x86/kernel/cpu/vmware.c -+++ b/arch/x86/kernel/cpu/vmware.c -@@ -31,6 +31,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -534,6 +535,10 @@ static void __init vmware_platform_setup(void) - kmsg_dump_register(&kmsg_dumper); - - register_guest_crash_reporter(); -+#ifdef CONFIG_PCI -+ /* PCI BIOS service won't work from a PV guest. */ -+ pci_probe &= ~PCI_PROBE_BIOS; -+#endif - } - - static u8 __init vmware_select_hypercall(void) --- -2.43.7 - diff --git a/SPECS/91/linux/esx/halt-on-panic.patch b/SPECS/91/linux/esx/halt-on-panic.patch deleted file mode 100644 index 3162062905..0000000000 --- a/SPECS/91/linux/esx/halt-on-panic.patch +++ /dev/null @@ -1,45 +0,0 @@ -From ee01cf21f18f0bfd41842a7cbeead88a726389cf Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Wed, 13 Nov 2024 12:50:55 +0000 -Subject: [PATCH] kernel/panic: halt on panic implementation - -Can be used by CRX to collect guest dump on panic. -Guest dump can be trigerred by triple fault (in debug -builds) or by cli;hlt event in the guest for directly -booted VM (debug and release builds). ---- - kernel/panic.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/kernel/panic.c b/kernel/panic.c -index fbc59b3b6..b2f39d7ae 100644 ---- a/kernel/panic.c -+++ b/kernel/panic.c -@@ -59,6 +59,7 @@ static int pause_on_oops; - static int pause_on_oops_flag; - static DEFINE_SPINLOCK(pause_on_oops_lock); - bool crash_kexec_post_notifiers; -+bool halt_on_panic; - int panic_on_warn __read_mostly; - unsigned long panic_on_taint; - bool panic_on_taint_nousertaint = false; -@@ -468,6 +469,8 @@ void panic(const char *fmt, ...) - nbcon_atomic_flush_unsafe(); - - local_irq_enable(); -+ if (halt_on_panic) -+ machine_halt(); - for (i = 0; ; i += PANIC_TIMER_STEP) { - touch_softlockup_watchdog(); - if (i >= i_next) { -@@ -846,6 +849,7 @@ core_param(panic_print, panic_print, ulong, 0644); - core_param(pause_on_oops, pause_on_oops, int, 0644); - core_param(panic_on_warn, panic_on_warn, int, 0644); - core_param(crash_kexec_post_notifiers, crash_kexec_post_notifiers, bool, 0644); -+core_param(halt_on_panic, halt_on_panic, bool, 0644); - - static int __init oops_setup(char *s) - { --- -2.39.4 - diff --git a/SPECS/91/linux/esx/init-do_mounts-recreate-dev-root.patch b/SPECS/91/linux/esx/init-do_mounts-recreate-dev-root.patch deleted file mode 100644 index 6237d69d0e..0000000000 --- a/SPECS/91/linux/esx/init-do_mounts-recreate-dev-root.patch +++ /dev/null @@ -1,43 +0,0 @@ -From fe52a1d246edc822e796d9c7890551e6a4049a27 Mon Sep 17 00:00:00 2001 -From: Miguel Bernal Marin -Date: Fri, 20 Nov 2015 14:01:26 -0600 -Subject: [PATCH 102/127] init: do_mounts: recreate /dev/root - -Rootfs shows as is mounted in /dev/root, but this devices is not present in -/dev directory. - -Signed-off-by: Miguel Bernal Marin ---- - init/do_mounts.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/init/do_mounts.c b/init/do_mounts.c -index b5f9604..e7dddd3 100644 ---- a/init/do_mounts.c -+++ b/init/do_mounts.c -@@ -583,6 +583,8 @@ void __init mount_root(void) - */ - void __init prepare_namespace(void) - { -+ int err; -+ - if (root_delay) { - printk(KERN_INFO "Waiting %d sec before mounting root device...\n", - root_delay); -@@ -630,6 +632,13 @@ void __init prepare_namespace(void) - devtmpfs_mount(); - init_mount(".", "/", NULL, MS_MOVE, NULL); - init_chroot("."); -+#ifdef CONFIG_BLOCK -+ /* recreate the /dev/root */ -+ err = create_dev("/dev/root", ROOT_DEV); -+ -+ if (err < 0) -+ pr_emerg("Failed to create /dev/root: %d\n", err); -+#endif - } - - static bool is_tmpfs; --- -2.14.1 - diff --git a/SPECS/91/linux/esx/poweroff-without-firmware.patch b/SPECS/91/linux/esx/poweroff-without-firmware.patch deleted file mode 100644 index 9182f6b7fc..0000000000 --- a/SPECS/91/linux/esx/poweroff-without-firmware.patch +++ /dev/null @@ -1,90 +0,0 @@ -From e6ea9bbd823adfe717a2bffa5da8793072e4b1e3 Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Tue, 20 Oct 2020 17:22:12 -0700 -Subject: [PATCH] vmware: poweroff support for no firmware case - -This commit consists of 2 parts: -1) Chipset PM initialization. -2) PM usage to perform "poweroff". - -Poweroff in VMware VM works through Intel PIIX4 Power -Management. BIOS or EFI firmware is responsible to -initialize it. Initialization means: assigning PM IO base -and enabling PM IO. In case of no firmware boot such as -direct boot, PM remains uninitialized. - -Use quirk_piix4_acpi() to check whether PM is initialized -and if not - initialize it. - -pm_power_off is a pointer to the function which performs -machine poweroff (see native_machine_power_off()). In -VMware VM, ACPI subsystem provides pm_power_off handler. - -If ACPI is not available (direct boot or 'noacpi' kernel -parameter) pm_power_off is not set, and poweroff request -will perform halt (see 'reboot' syscall implementation). -Luckily, Linux kernel has native driver for PIIX4 Power -Management drivers/power/reset/piix4-poweroff.c developed -for MIPS architecture. So, reuse it iff pm_power_off is -not set. ---- - drivers/pci/quirks.c | 12 ++++++++++++ - drivers/power/reset/Kconfig | 2 +- - drivers/power/reset/piix4-poweroff.c | 4 ++++ - 3 files changed, 17 insertions(+), 1 deletion(-) - -diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c -index b3976dcb7..bd13e0b28 100644 ---- a/drivers/pci/quirks.c -+++ b/drivers/pci/quirks.c -@@ -818,7 +818,19 @@ static void piix4_mem_quirk(struct pci_dev *dev, const char *name, unsigned int - static void quirk_piix4_acpi(struct pci_dev *dev) - { - u32 res_a; -+ u16 pm_io_enabled; - -+ pci_read_config_word(dev, 0x80, &pm_io_enabled); -+ if ((pm_io_enabled & 1) == 0) { -+ /* -+ * No firmware case, such as direct boot. -+ * Set PM IO Base to 0x1000 and enable it. -+ */ -+ pci_write_config_word(dev, 0x40, 0x1000); -+ pci_write_config_word(dev, 0x80, pm_io_enabled | 1); -+ quirk_io_region(dev, 0x40, 64, PCI_BRIDGE_RESOURCES, "PIIX4 PM"); -+ return; -+ } - quirk_io_region(dev, 0x40, 64, PCI_BRIDGE_RESOURCES, "PIIX4 ACPI"); - quirk_io_region(dev, 0x90, 16, PCI_BRIDGE_RESOURCES+1, "PIIX4 SMB"); - -diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig -index 411e00b25..6dbffc8bd 100644 ---- a/drivers/power/reset/Kconfig -+++ b/drivers/power/reset/Kconfig -@@ -152,7 +152,7 @@ config POWER_RESET_PIIX4_POWEROFF - tristate "Intel PIIX4 power-off driver" - depends on PCI - depends on HAS_IOPORT -- depends on MIPS || COMPILE_TEST -+ depends on X86 || MIPS || COMPILE_TEST - help - This driver supports powering off a system using the Intel PIIX4 - southbridge, for example the MIPS Malta development board. The -diff --git a/drivers/power/reset/piix4-poweroff.c b/drivers/power/reset/piix4-poweroff.c -index 7f308292d..76cc7f398 100644 ---- a/drivers/power/reset/piix4-poweroff.c -+++ b/drivers/power/reset/piix4-poweroff.c -@@ -64,6 +64,10 @@ static int piix4_poweroff_probe(struct pci_dev *dev, - { - int res; - -+ /* Do not overwrite default (ACPI) handler */ -+ if (pm_power_off) -+ return -EBUSY; -+ - if (pm_dev) - return -EINVAL; - --- -2.35.6 - diff --git a/SPECS/91/linux/esx/revert-x86-entry-Align-entry-text-section-to-PMD-boundary.patch b/SPECS/91/linux/esx/revert-x86-entry-Align-entry-text-section-to-PMD-boundary.patch deleted file mode 100644 index b9045ed087..0000000000 --- a/SPECS/91/linux/esx/revert-x86-entry-Align-entry-text-section-to-PMD-boundary.patch +++ /dev/null @@ -1,80 +0,0 @@ -From f0e4fa5978a571c9eb1ac346b18ecd9c6bb2aa9e Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Thu, 23 Jan 2025 10:45:40 +0000 -Subject: [PATCH] x86/entry: Align entry text section to PMD boundary - -The (irq)entry text must be visible in the user space page tables. To allow -simple PMD based sharing, make the entry text PMD aligned. - -[Alexey] Reverting this commit. -Idea of original commit is related to KPTI, with intention to -map with userspace minimal possible .text section, when hardware -allowes it (for example, if hardware does not support PCID, entire -.text will be mapped). -By reverting in, we stil do not map data/rodata to use userspace, -but little increase "visible" .text area in addition to just entry -code. There is no security risk of doing that. As a bonus, we reduce -kernel size by 40%. 2MB aligning increases kernel .text size from -6MB to 10MB, by adding padding between and after entry text. - -[Ajay] Reverting only ALIGN_ENTRY_TEXT_END, ALIGN_ENTRY_TEXT_BEGIN -requires for SRSO (Speculative Return Stack Overflow). - -Signed-off-by: Roye Eshed -Signed-off-by: Alexey Makhalov -Signed-off-by: Thomas Gleixner -Cc: Andy Lutomirski -Cc: Boris Ostrovsky -Cc: Borislav Petkov -Cc: Brian Gerst -Cc: Dave Hansen -Cc: David Laight -Cc: Denys Vlasenko -Cc: Eduardo Valentin -Cc: Greg KH -Cc: H. Peter Anvin -Cc: Josh Poimboeuf -Cc: Juergen Gross -Cc: Linus Torvalds -Cc: Peter Zijlstra -Cc: Will Deacon -Cc: aliguori@amazon.com -Cc: daniel.gruss@iaik.tugraz.at -Cc: hughd@google.com -Cc: keescook@google.com -Signed-off-by: Ingo Molnar ---- - arch/x86/kernel/vmlinux.lds.S | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S -index feb8102a9..cc461c48a 100644 ---- a/arch/x86/kernel/vmlinux.lds.S -+++ b/arch/x86/kernel/vmlinux.lds.S -@@ -64,7 +64,6 @@ const_pcpu_hot = pcpu_hot; - __end_rodata_aligned = .; - - #define ALIGN_ENTRY_TEXT_BEGIN . = ALIGN(PMD_SIZE); --#define ALIGN_ENTRY_TEXT_END . = ALIGN(PMD_SIZE); - - /* - * This section contains data which will be mapped as decrypted. Memory -@@ -91,7 +90,6 @@ const_pcpu_hot = pcpu_hot; - __end_rodata_aligned = .; - - #define ALIGN_ENTRY_TEXT_BEGIN --#define ALIGN_ENTRY_TEXT_END - #define BSS_DECRYPTED - - #endif -@@ -146,7 +144,6 @@ SECTIONS - . = srso_alias_untrain_ret | (1 << 2) | (1 << 8) | (1 << 14) | (1 << 20); - *(.text..__x86.rethunk_safe) - #endif -- ALIGN_ENTRY_TEXT_END - *(.gnu.warning) - - } :text = 0xcccccccc --- -2.39.4 - diff --git a/SPECS/91/linux/esx/serial-8250-do-not-probe-U6-16550A-fifo-size.patch b/SPECS/91/linux/esx/serial-8250-do-not-probe-U6-16550A-fifo-size.patch deleted file mode 100644 index d0688880f8..0000000000 --- a/SPECS/91/linux/esx/serial-8250-do-not-probe-U6-16550A-fifo-size.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 3f0069a352b7a55db73b522918116cd6d6a4dcfd Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Tue, 9 May 2017 12:38:15 -0700 -Subject: [PATCH] serial 8250 do not probe U6 16550A fifo size - ---- - drivers/tty/serial/8250/8250_port.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c -index 080d5a59d0a7..67d5cf07346e 100644 ---- a/drivers/tty/serial/8250/8250_port.c -+++ b/drivers/tty/serial/8250/8250_port.c -@@ -1148,10 +1148,12 @@ static void autoconfig_16550a(struct uart_8250_port *up) - * We distinguish between 16550A and U6 16550A by counting - * how many bytes are in the FIFO. - */ -+#if 0 - if (up->port.type == PORT_16550A && size_fifo(up) == 64) { - up->port.type = PORT_U6_16550A; - up->capabilities |= UART_CAP_AFE; - } -+#endif - } - - /* --- -2.11.0 - diff --git a/SPECS/91/linux/fips_canister_plugins/0001-Canister-GCC-Plugins-Implement-type-check.patch b/SPECS/91/linux/fips_canister_plugins/0001-Canister-GCC-Plugins-Implement-type-check.patch deleted file mode 100644 index 9485f5c6c7..0000000000 --- a/SPECS/91/linux/fips_canister_plugins/0001-Canister-GCC-Plugins-Implement-type-check.patch +++ /dev/null @@ -1,3842 +0,0 @@ -From a4290eca7262e8966ccdd75b3d5b457f7e051f1a Mon Sep 17 00:00:00 2001 -From: Brennan Lamoreaux -Date: Wed, 27 Aug 2025 17:47:14 +0000 -Subject: [PATCH] Canister GCC Plugins: Implement type check - -Normalize the type name strings that are obtained -from either the GCC representation or the DWARF debuginfo -so that they match up and can be used for comparison. - -Implement the type comparison check as a recursive loop -for each structure, following the chain of data structures. -Throws error if the type doesn't match between kernel and -canister versions. - -To account for unions, changed the structures to be more generic -data structures and data members. - -Added a new structure field which can point to definitions of other -data structures, either internal or external structs/unions. This -can be traversed recursively to fully compare structure definitions. - -Generally have an exception for "void *", where we allow replacing -any other pointer with "void *". - -To specify accepted/vetted differences between the kernel and -canister fields, added a new attribute "canister_mismatch", -which can be specified like: -__attribute__((canister_mismatch(KERN_TYPE, CANISTER_TYPE))) - -Other enhancements: -1. make clean - removes canister_structures.db -2. Ignore canister_structures.db from git index -3. Changed size of padding field in matching plugin to match - only to the end of the last canister field, instead of - padding to match the entire canister structure size. -4. Implement iterators on both canister debuginfo and GCC - sides for stepping through data structures. -5. Shrink cache by 3-4x by properly remapping data structures, - and keeping only unique. - -Signed-off-by: Brennan Lamoreaux ---- - Makefile | 1 + - scripts/Makefile.gcc-plugins | 2 + - scripts/gcc-plugins/.gitignore | 1 + - .../fips_canister_plugins/constants.h | 1 + - .../fips_canister_common.c | 171 +++++-- - .../fips_canister_common.h | 2 + - .../fips_canister_plugins/kernel_iterator.c | 184 +++++++ - .../fips_canister_plugins/kernel_iterator.h | 28 + - .../gcc-plugins/fips_canister_plugins/list.h | 188 +++++++ - .../data_struct_iterator.c | 291 +++++++++++ - .../data_struct_iterator.h | 33 ++ - .../dwarf_debuginfo_parser.c | 416 +++++++++++++-- - .../match_canister_structs/hash_table.c | 33 ++ - .../match_canister_structs/hash_table.h | 3 + - .../match_canister_structs.c | 390 ++++++++++++-- - .../match_canister_structs/structure_db.c | 482 ++++++++++++++++-- - .../match_canister_structs/structure_db.h | 48 +- - .../match_canister/add-multiple-new-fields.c | 6 +- - .../add-multiple-new-fields.expected | 15 +- - .../self_tests/match_canister/add-new-field.c | 6 +- - .../match_canister/add-new-field.expected | 13 +- - .../match_canister/add-too-many-fields.c | 6 +- - .../add-too-many-fields.expected | 4 +- - .../match_canister/attr-mismatch-fail.c | 38 ++ - .../attr-mismatch-fail.expected | 8 + - .../match_canister/attr-mismatch-fail2.c | 40 ++ - .../attr-mismatch-fail2.expected | 8 + - .../self_tests/match_canister/attr-mismatch.c | 36 ++ - .../match_canister/attr-mismatch.expected | 39 ++ - .../match_canister/bad-cast.expected | 3 +- - .../match_canister/field-size-change.c | 12 +- - .../match_canister/field-size-change.expected | 16 +- - .../self_tests/match_canister/flexible-init.c | 21 +- - .../match_canister/flexible-init.expected | 12 +- - .../match_canister/follow-pointer.c | 74 +++ - .../match_canister/follow-pointer.expected | 14 + - .../match_canister/functional-flexible.c | 13 +- - .../functional-flexible.expected | 2 +- - .../self_tests/match_canister/no-change.c | 5 +- - .../match_canister/no-change.expected | 13 +- - .../self_tests/match_canister/remove-field.c | 8 +- - .../match_canister/remove-field.expected | 4 +- - .../self_tests/match_canister/self-test.sh | 7 +- - .../match_canister/typedef-struct.c | 15 + - .../match_canister/typedef-struct.expected | 5 + - .../self_tests/match_canister/types.h | 16 + - .../self_tests/self-test-lib.sh | 6 +- - 47 files changed, 2507 insertions(+), 232 deletions(-) - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/kernel_iterator.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/kernel_iterator.h - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/list.h - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/data_struct_iterator.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/data_struct_iterator.h - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch-fail.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch-fail.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch-fail2.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch-fail2.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/follow-pointer.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/follow-pointer.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/typedef-struct.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/typedef-struct.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/types.h - -diff --git a/Makefile b/Makefile -index 6c7ab4c83..a6fb06bbb 100644 ---- a/Makefile -+++ b/Makefile -@@ -1995,6 +1995,7 @@ clean: $(clean-dirs) - -o -name '*.c.[012]*.*' \ - -o -name '*.ll' \ - -o -name '*.gcno' \ -+ -o -name '*.db' \ - \) -type f -print \ - -o -name '.tmp_*' -print \ - | xargs rm -rf -diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins -index 8c1effd30..38fbaf990 100644 ---- a/scripts/Makefile.gcc-plugins -+++ b/scripts/Makefile.gcc-plugins -@@ -51,6 +51,8 @@ endif - export DISABLE_ARM_SSP_PER_TASK_PLUGIN - - gcc-plugin-$(CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS) += match_canister_structs.so -+gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS) \ -+ += -DMATCH_CANISTER_STRUCTS - gcc-plugin-$(CONFIG_GCC_PLUGIN_PAD_CANISTER_STRUCTS) += pad_canister_structs.so - - # All the plugin CFLAGS are collected here in case a build target needs to -diff --git a/scripts/gcc-plugins/.gitignore b/scripts/gcc-plugins/.gitignore -index 5cc385b9e..67e7cf01e 100644 ---- a/scripts/gcc-plugins/.gitignore -+++ b/scripts/gcc-plugins/.gitignore -@@ -1,2 +1,3 @@ - # SPDX-License-Identifier: GPL-2.0-only - /randomize_layout_seed.h -+/canister_structures.db -diff --git a/scripts/gcc-plugins/fips_canister_plugins/constants.h b/scripts/gcc-plugins/fips_canister_plugins/constants.h -index a071f0bcf..908dff6e2 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/constants.h -+++ b/scripts/gcc-plugins/fips_canister_plugins/constants.h -@@ -7,5 +7,6 @@ - - #define PADDING_ADDED_ATTR "padding_added" - #define CANISTER_MATCHED_ATTR "canister_matched" -+#define CANISTER_MISMATCH_ATTR "canister_mismatch" - - #define UNKWN_TYPE "" -diff --git a/scripts/gcc-plugins/fips_canister_plugins/fips_canister_common.c b/scripts/gcc-plugins/fips_canister_plugins/fips_canister_common.c -index db836e43d..f4cefa27d 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/fips_canister_common.c -+++ b/scripts/gcc-plugins/fips_canister_plugins/fips_canister_common.c -@@ -9,7 +9,6 @@ - #include "fips_canister_common.h" - #include "constants.h" - --static const int nr_pad_structs = 44; - const char *pad_struct_list[] = { - "crypto_async_request", - "crypto_tfm", -@@ -51,7 +50,6 @@ const char *pad_struct_list[] = { - "acomp_req", - "crypto_acomp", - "crypto_cipher", -- "sha1_state", - "sha512_state", - "sha3_state", - "ecdh" -@@ -60,6 +58,7 @@ const char *pad_struct_list[] = { - /* TODO, future work: This is slow. Make it faster. */ - bool struct_in_pad_list(const char *name) - { -+ int nr_pad_structs = sizeof(pad_struct_list) / sizeof(char*); - for (int i = 0; i < nr_pad_structs; i++) { - if (!strcmp(name, pad_struct_list[i])) - return true; -@@ -165,49 +164,125 @@ const char *get_field_name(tree field) - return field_name; - } - --/* TODO: Future work: improve this function, use it for variable type check */ --int get_field_type_str(tree field, char *type_str, int len) -+/* Print the name of the data structure, ex) struct cipher_alg, etc. */ -+void print_data_structure_type_name(tree type, char *buffer, int buf_len) - { -- const char *type_name = NULL; -+ const char* prefix = ""; -+ char postfix[16] = {0}; -+ const char* orig_name; - -- FILE *tmp_fp; -- char* buf; -- size_t length; -+ if(TREE_CODE(type) == FIELD_DECL) -+ type = TREE_TYPE(type); - -- tree type; -- tree type_name_node; -+ while(TREE_CODE(type) == POINTER_TYPE) { -+ type = TREE_TYPE(type); -+ strncat(postfix, " *", sizeof(postfix) - 1); -+ } - -- type = TREE_TYPE(field); -+ if(TREE_CODE(type) == RECORD_TYPE) -+ prefix = "struct "; -+ else if(TREE_CODE(type) == UNION_TYPE) -+ prefix = "union "; - -- if (!type) -- return 0; -+ snprintf(buffer, buf_len, "%s%s%s", prefix, ORIG_TYPE_NAME(type), postfix); -+} -+ -+/* Taken from gcc/tree-pretty-print.cc */ -+static void dump_function_declaration(pretty_printer *pp, tree node, int spc, -+ dump_flags_t flags) -+{ -+ bool wrote_arg = false; -+ tree arg; - -- type_name_node = TYPE_NAME(type); -+ pp_left_paren(pp); - -- if (type_name_node && TREE_CODE(type_name_node) == TYPE_DECL) { -- type_name = IDENTIFIER_POINTER(DECL_NAME(type_name_node)); -- } else if (type_name_node && -- TREE_CODE(type_name_node) == IDENTIFIER_NODE) { -- type_name = get_name(type_name_node); -+ /* Print the argument types. */ -+ arg = TYPE_ARG_TYPES(node); -+ while (arg && arg != void_list_node && arg != error_mark_node) { -+ if (wrote_arg) { -+ pp_comma(pp); -+ pp_space(pp); -+ } -+ wrote_arg = true; -+ dump_generic_node(pp, TREE_VALUE(arg), spc, flags, false); -+ arg = TREE_CHAIN(arg); - } - -- if(type_name) { -- strncpy(type_str, type_name, len); -+ /* Drop the trailing void_type_node if we had any previous argument. */ -+ if (arg == void_list_node && !wrote_arg) -+ pp_string(pp, "void"); -+ /* Properly dump vararg function types. */ -+ else if (!arg && wrote_arg) -+ pp_string(pp, ", ..."); -+ /* Avoid printing any arg for unprototyped functions. */ -+ -+ pp_right_paren(pp); -+} -+ -+/* TREE_CODE(type) == FUNCTION_TYPE */ -+static char *print_func_to_str(tree type) -+{ -+ tree ret_type = TREE_TYPE(type); -+ pretty_printer pp; -+ int spc = 1; -+ dump_flags_t flags = TDF_SLIM; -+ -+ dump_generic_node(&pp, ret_type, spc, flags, false); -+ pp_space(&pp); -+ pp_left_paren(&pp); -+ pp_right_paren(&pp); -+ dump_function_declaration(&pp, type, spc, flags); -+ -+ return xstrdup(pp_formatted_text(&pp)); -+} -+ -+int get_field_type_str(tree field, char *type_str, int len) -+{ -+ char *type_name = NULL; -+ char type_name_buf[256]; -+ tree type, base_type; -+ -+ if (!field) - return 0; -+ -+ type = field; -+ -+ /* Dereference FIELD_DECL */ -+ if(TREE_CODE(type) == FIELD_DECL) -+ type = TREE_TYPE(type); -+ -+ /* Follow pointer chain to the bitter end */ -+ base_type = type; -+ while(TREE_CODE(base_type) == POINTER_TYPE) { -+ if(!TREE_TYPE(base_type)) -+ break; -+ -+ base_type = TREE_TYPE(base_type); - } - -- tmp_fp = open_memstream(&buf, &length); -- if(tmp_fp) { -- print_generic_expr(tmp_fp, type, TDF_SLIM); -- fflush(tmp_fp); -- fclose(tmp_fp); -- strncpy(type_str, buf, len); -- free(buf); -- return 0; -+ if (TREE_CODE(base_type) == FUNCTION_TYPE){ -+ type_name = print_func_to_str(base_type); -+ strncpy(type_name_buf, type_name, sizeof(type_name_buf) - 1); -+ free(type_name); -+ } else if (TREE_CODE(base_type) == RECORD_TYPE && !TYPE_NAME(base_type)) -+ strncpy(type_name_buf, "struct", sizeof(type_name_buf) - 1); -+ else if (TREE_CODE(base_type) == UNION_TYPE && !TYPE_NAME(base_type)) -+ strncpy(type_name_buf, "union", sizeof(type_name_buf) - 1); -+ else { -+ type_name = print_generic_expr_to_str(type); -+ strncpy(type_name_buf, type_name, sizeof(type_name_buf) - 1); -+ free(type_name); - } - -- type_name = UNKWN_TYPE; -- strncpy(type_str, type_name, len); -+ if(TREE_CODE(type) == ENUMERAL_TYPE && strncmp(type_name_buf, "enum", 4)) -+ snprintf(type_str, len, "enum %s", type_name_buf); -+ else if(TREE_CODE(type) == RECORD_TYPE && strncmp(type_name_buf, "struct", 6)) -+ snprintf(type_str, len, "struct %s", type_name_buf); -+ else if (TREE_CODE(base_type) == FUNCTION_TYPE) -+ /* Struct field function type must be a function pointer */ -+ snprintf(type_str, len, "%s *", type_name_buf); -+ else -+ snprintf(type_str, len, "%s", type_name_buf); - - return 0; - } -@@ -234,10 +309,14 @@ int insert_pad_field(tree type, tree pad_field) - if (!strcmp(get_field_name(last_field), PAD_FIELD_NAME)) - return 0; - -- /* Add padding before flexible array member, as this must be the last member */ -+ /* -+ * Add padding before flexible array member, as this must be -+ * the last member -+ */ - if (is_flexible_array(last_field)) { - if (!penultimate_field) { -- error("must have at least 2 members when a flexible array member is present"); -+ error("must have at least 2 members when a flexible" -+ "array member is present"); - return -1; - } - -@@ -257,7 +336,8 @@ void relayout_canister_struct(tree type, const char *identifier) - - /* Relayout all variants in the same way */ - main_variant = TYPE_MAIN_VARIANT(type); -- for (variant = main_variant; variant; variant = TYPE_NEXT_VARIANT(variant)) { -+ for (variant = main_variant; variant; -+ variant = TYPE_NEXT_VARIANT(variant)) { - TYPE_FIELDS(variant) = TYPE_FIELDS(type); - - TYPE_ATTRIBUTES(variant) = copy_list(TYPE_ATTRIBUTES(variant)); -@@ -291,11 +371,11 @@ bool type_is_struct(tree type) - return 1; - } - --bool lang_check(const char* plugin_name, const char* lang_name) { -+bool lang_check(const char *plugin_name, const char *lang_name) -+{ - if (strncmp(lang_name, "GNU C", 5)) { - inform(UNKNOWN_LOCATION, G_("%s supports C only, not %s"), -- plugin_name, -- lang_name); -+ plugin_name, lang_name); - return false; - } - -@@ -364,7 +444,20 @@ void validate_decl_flex_size(void *event_data, void *data) - type_size = TREE_INT_CST_LOW(TYPE_SIZE_UNIT(type)); - - if (decl_size <= type_size) -- error("struct '%s': declaration size (%ld) for a struct with a " \ -- "flexible array member must be > basic definition size (%ld)", -+ error("struct '%s': declaration size (%ld) for a struct with a " -+ "flexible array member must be > basic definition size (%ld)", - ORIG_TYPE_NAME(type), decl_size, type_size); - } -+ -+tree get_field_base_type(tree field) -+{ -+ /* Dereference FIELD_DECL */ -+ field = TREE_TYPE(field); -+ -+ /* Dereference pointer(s)/array(s) to get the base type */ -+ while(TREE_CODE(field) == POINTER_TYPE || -+ TREE_CODE(field) == ARRAY_TYPE) -+ field = TREE_TYPE(field); -+ -+ return TYPE_MAIN_VARIANT(field); -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/fips_canister_common.h b/scripts/gcc-plugins/fips_canister_plugins/fips_canister_common.h -index f51cc37e0..cd0438f7d 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/fips_canister_common.h -+++ b/scripts/gcc-plugins/fips_canister_plugins/fips_canister_common.h -@@ -21,3 +21,5 @@ void register_bad_casts_pass(const char* plugin_name); - void validate_decl_flex_size(void *event_data, void *data); - location_t get_type_location(tree type); - bool lang_check(const char* plugin_name, const char* lang_name); -+void print_data_structure_type_name(tree type, char *buffer, int buf_len); -+tree get_field_base_type(tree member); -diff --git a/scripts/gcc-plugins/fips_canister_plugins/kernel_iterator.c b/scripts/gcc-plugins/fips_canister_plugins/kernel_iterator.c -new file mode 100644 -index 000000000..6c59d527e ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/kernel_iterator.c -@@ -0,0 +1,184 @@ -+/* -+ * Implements an iterator for stepping through GCC representation of data structures. -+ * Iterator keeps the current state, as well as the historical stack/path. Handles loop -+ * detection, while traversing essentially a directed graph of data structures. -+ * -+ * Copyright (C) 2025 Broadcom, Inc. -+ */ -+#include -+#include -+#include -+#include -+#include "kernel_iterator.h" -+#include "fips_canister_common.h" -+ -+void kern_iter_init(struct kern_iter *kern_iter, tree def) -+{ -+ struct kernel_stack_entry *entry; -+ -+ entry = (struct kernel_stack_entry *) xcalloc(1, sizeof(struct kernel_stack_entry)); -+ -+ INIT_LIST_HEAD(&kern_iter->stack_head); -+ -+ entry->type = TYPE_MAIN_VARIANT(def); -+ entry->member = TYPE_FIELDS(def); -+ entry->member_base_type = get_field_base_type(entry->member); -+ -+ list_add_tail(&entry->l_entry, &kern_iter->stack_head); -+} -+ -+void kern_iter_init_member(struct kern_iter *kern_iter, tree member) -+{ -+ struct kernel_stack_entry *entry; -+ -+ entry = (struct kernel_stack_entry *) xcalloc(1, sizeof(struct kernel_stack_entry)); -+ -+ INIT_LIST_HEAD(&kern_iter->stack_head); -+ -+ entry->type = TYPE_MAIN_VARIANT(DECL_CONTEXT(member)); -+ entry->member = member; -+ entry->member_base_type = get_field_base_type(member); -+ -+ list_add_tail(&entry->l_entry, &kern_iter->stack_head); -+} -+ -+static bool is_cycle(tree next, struct kern_iter *kern_iter) -+{ -+ struct kernel_stack_entry *pos; -+ -+ list_for_each_entry(pos, &kern_iter->stack_head, l_entry) { -+ if(pos->type == next) -+ return true; -+ } -+ -+ return false; -+} -+ -+tree kern_iter_top(struct kern_iter *kern_iter) -+{ -+ if(list_empty(&kern_iter->stack_head)) -+ return NULL; -+ -+ return list_last_entry(&kern_iter->stack_head, kernel_stack_entry, l_entry)->type; -+} -+ -+tree kern_iter_next_field(struct kern_iter *kern_iter) -+{ -+ int idx = 0; -+ struct kernel_stack_entry *cur_entry; -+ -+ if(list_empty(&kern_iter->stack_head)) -+ return NULL; -+ -+ cur_entry = list_last_entry(&kern_iter->stack_head, kernel_stack_entry, l_entry); -+ cur_entry->member = cur_entry->member ? TREE_CHAIN(cur_entry->member) : NULL; -+ -+ if(!cur_entry->member) -+ return NULL; -+ -+ cur_entry->member_base_type = get_field_base_type(cur_entry->member); -+ -+ return cur_entry->member; -+} -+ -+tree kern_iter_cur_memb(struct kern_iter *kern_iter) -+{ -+ int idx = 0; -+ struct kernel_stack_entry *cur_entry; -+ tree type, member; -+ -+ if(list_empty(&kern_iter->stack_head)) -+ return NULL; -+ -+ cur_entry = list_last_entry(&kern_iter->stack_head, kernel_stack_entry, l_entry); -+ return cur_entry->member; -+} -+ -+/* -+ * If the current struct member has a definition, "step" into it by adding it to the end of the -+ * stack. Returns NULL if no definition for this member, or if member is not a struct, or if member -+ * is a struct with no fields (member of itself, for example). -+ */ -+tree kern_iter_push(struct kern_iter *kern_iter, bool allow_loops) -+{ -+ struct kernel_stack_entry *entry, *cur_entry; -+ tree type, memb; -+ int idx = 0; -+ -+ if(list_empty(&kern_iter->stack_head)) -+ return NULL; -+ -+ type = kern_iter_field_base_type(kern_iter); -+ if (!type || -+ (TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE) || -+ !TYPE_FIELDS(type)) -+ type = NULL; -+ -+ /* xcalloc never returns NULL */ -+ entry = (struct kernel_stack_entry *) xcalloc(1, sizeof(struct kernel_stack_entry)); -+ -+ if(type && (!is_cycle(type, kern_iter) || allow_loops)) { -+ entry->type = type; -+ entry->member = TYPE_FIELDS(type); -+ entry->member_base_type = get_field_base_type(entry->member); -+ } -+ -+ list_add_tail(&entry->l_entry, &kern_iter->stack_head); -+ -+ return entry->type; -+} -+ -+/* Step back to the parent definition */ -+tree kern_iter_pop(struct kern_iter *kern_iter) -+{ -+ struct kernel_stack_entry *cur_entry; -+ -+ if(list_empty(&kern_iter->stack_head)) -+ return NULL; -+ -+ cur_entry = list_last_entry(&kern_iter->stack_head, kernel_stack_entry, l_entry); -+ list_del(&cur_entry->l_entry); -+ free(cur_entry); -+ -+ if(list_empty(&kern_iter->stack_head)) -+ return NULL; -+ -+ return list_last_entry(&kern_iter->stack_head, kernel_stack_entry, l_entry)->type; -+} -+ -+void kern_iter_destroy(struct kern_iter *kern_iter) -+{ -+ struct kernel_stack_entry *pos, *n; -+ -+ list_for_each_entry_safe(pos, n, &kern_iter->stack_head, l_entry) { -+ list_del(&pos->l_entry); -+ free(pos); -+ } -+} -+ -+tree kern_iter_field_base_type(struct kern_iter *kern_iter) -+{ -+ struct kernel_stack_entry *cur_entry; -+ -+ if(list_empty(&kern_iter->stack_head)) -+ return NULL; -+ -+ cur_entry = list_last_entry(&kern_iter->stack_head, kernel_stack_entry, l_entry); -+ return cur_entry->member_base_type; -+} -+ -+/* Check if we've hit a cycle in the type graph */ -+bool kern_iter_is_loop(struct kern_iter *kern_iter) -+{ -+ struct kernel_stack_entry *cur_entry; -+ tree cur_type; -+ -+ if(list_empty(&kern_iter->stack_head)) -+ return false; -+ -+ cur_entry = list_entry(kern_iter->stack_head.prev->prev, struct kernel_stack_entry, l_entry); -+ cur_type = TYPE_MAIN_VARIANT(cur_entry->member_base_type); -+ -+ /* Check if we've seen this type before in our stack */ -+ return is_cycle(cur_type, kern_iter); -+} -\ No newline at end of file -diff --git a/scripts/gcc-plugins/fips_canister_plugins/kernel_iterator.h b/scripts/gcc-plugins/fips_canister_plugins/kernel_iterator.h -new file mode 100644 -index 000000000..375267649 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/kernel_iterator.h -@@ -0,0 +1,28 @@ -+/* Copyright (C) 2025 Broadcom, Inc. */ -+#include "../gcc-common.h" -+#include "list.h" -+ -+struct kernel_stack_entry { -+ /* Parent structure */ -+ tree type; -+ /* Struct member (FIELD_DECL) */ -+ tree member; -+ /* Base member type */ -+ tree member_base_type; -+ struct list_head l_entry; -+}; -+ -+struct kern_iter { -+ struct list_head stack_head; -+}; -+ -+void kern_iter_init(struct kern_iter *kern_iter, tree def); -+void kern_iter_init_member(struct kern_iter *kern_iter, tree base_type); -+tree kern_iter_field_base_type(struct kern_iter *kern_iter); -+tree kern_iter_top(struct kern_iter *kern_iter); -+tree kern_iter_next_field(struct kern_iter *kern_iter); -+tree kern_iter_cur_memb(struct kern_iter *kern_iter); -+tree kern_iter_push(struct kern_iter *kern_iter, bool allow_loops); -+tree kern_iter_pop(struct kern_iter *kern_iter); -+void kern_iter_destroy(struct kern_iter *kern_iter); -+bool kern_iter_is_loop(struct kern_iter *ds_iter); -\ No newline at end of file -diff --git a/scripts/gcc-plugins/fips_canister_plugins/list.h b/scripts/gcc-plugins/fips_canister_plugins/list.h -new file mode 100644 -index 000000000..cc166e34b ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/list.h -@@ -0,0 +1,188 @@ -+/* Minimal list utilities for the iterator. Copied/edited from include/linux/list.h for C++ */ -+#ifndef _LINUX_LIST_H -+#define _LINUX_LIST_H -+ -+struct list_head { -+ struct list_head *next, *prev; -+}; -+ -+#define LIST_POISON1 ((struct list_head *) 0x100) -+#define LIST_POISON2 ((struct list_head *) 0x122) -+ -+/** -+ * container_of - cast a member of a structure out to the containing structure -+ * @ptr: the pointer to the member. -+ * @type: the type of the container struct this is embedded in. -+ * @member: the name of the member within the struct. -+ * -+ */ -+#define container_of(ptr, type, member) ({ \ -+ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ -+ (type *)( (char *)__mptr - offsetof(type,member) );}) -+ -+/** -+ * INIT_LIST_HEAD - Initialize a list_head structure -+ * @list: list_head structure to be initialized. -+ * -+ * Initializes the list_head to point to itself. If it is a list header, -+ * the result is an empty list. -+ */ -+static inline void INIT_LIST_HEAD(struct list_head *list) -+{ -+ list->next = list; -+ list->prev = list; -+} -+ -+/** -+ * list_entry_is_head - test if the entry points to the head of the list -+ * @pos: the type * to cursor -+ * @head: the head for your list. -+ * @member: the name of the list_head within the struct. -+ */ -+#define list_entry_is_head(pos, head, member) \ -+ list_is_head(&pos->member, (head)) -+ -+/** -+ * list_is_head - tests whether @list is the list @head -+ * @list: the entry to test -+ * @head: the head of the list -+ */ -+static inline int list_is_head(const struct list_head *list, const struct list_head *head) -+{ -+ return list == head; -+} -+ -+/* -+ * Insert a new entry between two known consecutive entries. -+ * -+ * This is only for internal list manipulation where we know -+ * the prev/next entries already! -+ */ -+static inline void __list_add(struct list_head *new_entry, -+ struct list_head *prev, -+ struct list_head *next) -+{ -+ next->prev = new_entry; -+ new_entry->next = next; -+ new_entry->prev = prev; -+ prev->next = new_entry; -+} -+ -+/** -+ * list_add_tail - add a new entry -+ * @new: new entry to be added -+ * @head: list head to add it before -+ * -+ * Insert a new entry before the specified head. -+ * This is useful for implementing queues. -+ */ -+static inline void list_add_tail(struct list_head *new_entry, struct list_head *head) -+{ -+ __list_add(new_entry, head->prev, head); -+} -+ -+/* -+ * Delete a list entry by making the prev/next entries -+ * point to each other. -+ * -+ * This is only for internal list manipulation where we know -+ * the prev/next entries already! -+ */ -+static inline void __list_del(struct list_head * prev, struct list_head * next) -+{ -+ next->prev = prev; -+ prev->next = next; -+} -+ -+static inline void __list_del_entry(struct list_head *entry) -+{ -+ __list_del(entry->prev, entry->next); -+} -+ -+/** -+ * list_del - deletes entry from list. -+ * @entry: the element to delete from the list. -+ * Note: list_empty() on entry does not return true after this, the entry is -+ * in an undefined state. -+ */ -+static inline void list_del(struct list_head *entry) -+{ -+ __list_del_entry(entry); -+ entry->next = LIST_POISON1; -+ entry->prev = LIST_POISON2; -+} -+ -+/** -+ * list_empty - tests whether a list is empty -+ * @head: the list to test. -+ */ -+static inline int list_empty(const struct list_head *head) -+{ -+ return head->next == head; -+} -+ -+/** -+ * list_entry - get the struct for this entry -+ * @ptr: the &struct list_head pointer. -+ * @type: the type of the struct this is embedded in. -+ * @member: the name of the list_head within the struct. -+ */ -+#define list_entry(ptr, type, member) \ -+ container_of(ptr, type, member) -+ -+/** -+ * list_first_entry - get the first element from a list -+ * @ptr: the list head to take the element from. -+ * @type: the type of the struct this is embedded in. -+ * @member: the name of the list_head within the struct. -+ * -+ * Note, that list is expected to be not empty. -+ */ -+#define list_first_entry(ptr, type, member) \ -+ list_entry((ptr)->next, type, member) -+ -+/** -+ * list_last_entry - get the last element from a list -+ * @ptr: the list head to take the element from. -+ * @type: the type of the struct this is embedded in. -+ * @member: the name of the list_head within the struct. -+ * -+ * Note, that list is expected to be not empty. -+ */ -+#define list_last_entry(ptr, type, member) \ -+ list_entry((ptr)->prev, type, member) -+ -+/** -+ * list_next_entry - get the next element in list -+ * @pos: the type * to cursor -+ * @member: the name of the list_head within the struct. -+ */ -+#define list_next_entry(pos, member) \ -+ list_entry((pos)->member.next, typeof(*(pos)), member) -+ -+/** -+ * list_for_each_entry - iterate over list of given type -+ * @pos: the type * to use as a loop cursor. -+ * @head: the head for your list. -+ * @member: the name of the list_head within the struct. -+ */ -+#define list_for_each_entry(pos, head, member) \ -+ for (pos = list_first_entry(head, typeof(*pos), member); \ -+ !list_entry_is_head(pos, head, member); \ -+ pos = list_next_entry(pos, member)) -+ -+/** -+ * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry -+ * @pos: the type * to use as a loop cursor. -+ * @n: another type * to use as temporary storage -+ * @head: the head for your list. -+ * @member: the name of the list_head within the struct. -+ */ -+#define list_for_each_entry_safe(pos, n, head, member) \ -+ for (pos = list_first_entry(head, typeof(*pos), member), \ -+ n = list_next_entry(pos, member); \ -+ !list_entry_is_head(pos, head, member); \ -+ pos = n, n = list_next_entry(n, member)) -+ -+ -+#endif /* _LINUX_LIST_H */ -\ No newline at end of file -diff --git a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/data_struct_iterator.c b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/data_struct_iterator.c -new file mode 100644 -index 000000000..cc860763a ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/data_struct_iterator.c -@@ -0,0 +1,291 @@ -+/* -+ * Implements iterator for stepping through debuginfo parsed data structures. -+ * The data structures are essentially a directed graph. Iterator keeps stack/path -+ * context to handle loop detection and current state. -+ * -+ * Copyright (C) 2025 Broadcom, Inc. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include "../../../include/xalloc.h" -+ -+#include "structure_db.h" -+#include "data_struct_iterator.h" -+ -+/** -+ * list_last_entry - get the last element from a list -+ * @ptr: the list head to take the element from. -+ * @type: the type of the struct this is embedded in. -+ * @member: the name of the list_struct within the struct. -+ * -+ * Note, that list is expected to be not empty. -+ */ -+#define list_last_entry(ptr, type, member) \ -+ list_entry((ptr)->prev, type, member) -+ -+struct struct_stack_entry { -+ struct data_structure *def; -+ int memb_idx; -+ struct data_member *parent_member; -+ struct list_head l_entry; -+}; -+ -+void ds_iter_init(struct ds_iter *ds_iter, struct data_structure *def) -+{ -+ struct struct_stack_entry *entry; -+ -+ entry = xcalloc(1, sizeof(struct struct_stack_entry)); -+ -+ INIT_LIST_HEAD(&ds_iter->stack_head); -+ -+ entry->def = def; -+ entry->memb_idx = 0; -+ entry->parent_member = NULL; -+ list_add_tail(&entry->l_entry, &ds_iter->stack_head); -+} -+ -+void ds_iter_init_member(struct ds_iter *ds_iter, struct data_member *memb) -+{ -+ struct struct_stack_entry *entry; -+ -+ entry = xcalloc(1, sizeof(struct struct_stack_entry)); -+ -+ INIT_LIST_HEAD(&ds_iter->stack_head); -+ -+ entry->def = get_struct_def_from_member(memb); -+ entry->memb_idx = memb->__idx; -+ entry->parent_member = NULL; -+ list_add_tail(&entry->l_entry, &ds_iter->stack_head); -+} -+ -+static bool is_cycle(struct data_structure *ds, struct ds_iter *ds_iter) -+{ -+ struct struct_stack_entry *pos; -+ -+ list_for_each_entry(pos, &ds_iter->stack_head, l_entry) { -+ if(pos->def == ds) -+ return true; -+ } -+ -+ return false; -+} -+ -+struct data_structure* ds_iter_top(struct ds_iter *ds_iter) -+{ -+ if(list_empty(&ds_iter->stack_head)) -+ return NULL; -+ -+ return list_last_entry(&ds_iter->stack_head, struct struct_stack_entry, l_entry)->def; -+} -+ -+struct data_member *ds_iter_next_member(struct ds_iter *ds_iter) -+{ -+ int idx = 0; -+ struct data_structure *cur_def; -+ struct struct_stack_entry *cur_entry; -+ struct data_member *memb; -+ -+ if(list_empty(&ds_iter->stack_head)) -+ return NULL; -+ -+ cur_entry = list_last_entry(&ds_iter->stack_head, struct struct_stack_entry, l_entry); -+ cur_def = cur_entry->def; -+ -+ if(!cur_def) -+ return NULL; -+ -+ cur_entry->memb_idx++; -+ if(cur_entry->memb_idx >= cur_def->nr_members) -+ return NULL; -+ -+ return &cur_def->members[cur_entry->memb_idx]; -+} -+ -+struct data_member *ds_iter_cur_memb(struct ds_iter *ds_iter) -+{ -+ int idx = 0; -+ struct data_structure *cur_def; -+ struct struct_stack_entry *cur_entry; -+ struct data_member *memb; -+ -+ if(list_empty(&ds_iter->stack_head)) -+ return NULL; -+ -+ cur_entry = list_last_entry(&ds_iter->stack_head, struct struct_stack_entry, l_entry); -+ cur_def = cur_entry->def; -+ -+ if(!cur_def) -+ return NULL; -+ -+ if(cur_entry->memb_idx > cur_def->nr_members) -+ return NULL; -+ -+ return &cur_def->members[cur_entry->memb_idx]; -+} -+ -+/* -+ * If the current struct member has a definition, "step" into it by adding it to the end of the -+ * stack. Returns NULL if no definition for this member. -+ */ -+struct data_structure* ds_iter_push(struct ds_iter *ds_iter, bool allow_loops) -+{ -+ struct struct_stack_entry *entry, *cur_entry; -+ struct data_structure *cur_def, *memb_def = NULL; -+ struct data_member *memb; -+ int idx = 0; -+ -+ if(list_empty(&ds_iter->stack_head)) -+ return NULL; -+ -+ memb = ds_iter_cur_memb(ds_iter); -+ -+ if(memb) -+ memb_def = get_nested_structure_def(memb); -+ -+ /* xcalloc will never return NULL */ -+ entry = xcalloc(1, sizeof(struct struct_stack_entry)); -+ -+ /* Step into NULL entry if cycle */ -+ if(memb_def && (!is_cycle(memb_def, ds_iter) || allow_loops)) { -+ entry->def = memb_def; -+ entry->parent_member = memb; -+ entry->memb_idx = 0; -+ } -+ -+ list_add_tail(&entry->l_entry, &ds_iter->stack_head); -+ -+ return entry->def; -+} -+ -+/* Return true if loop, false if not loop or false if the end of the chain (no more defs) */ -+bool ds_iter_is_loop(struct ds_iter *ds_iter) -+{ -+ struct data_member *cur_memb; -+ struct data_structure *cur_def; -+ struct struct_stack_entry *entry; -+ -+ if(list_empty(&ds_iter->stack_head)) -+ return false; -+ -+ cur_def = ds_iter_top(ds_iter); -+ if(cur_def) -+ return false; -+ -+ /* Get the last valid entry */ -+ entry = list_entry(ds_iter->stack_head.prev->prev, struct struct_stack_entry, l_entry); -+ cur_def = entry->def; -+ cur_memb = &entry->def->members[entry->memb_idx]; -+ -+ /* -+ * If there is a nested definition, and we started in a NULL entry, -+ * this must be a loop -+ */ -+ if(get_nested_structure_def(cur_memb)) -+ return true; -+ -+ return false; -+} -+ -+/* Step back to the parent definition */ -+struct data_structure* ds_iter_pop(struct ds_iter *ds_iter) -+{ -+ struct struct_stack_entry *cur_entry; -+ -+ if(list_empty(&ds_iter->stack_head)) -+ return NULL; -+ -+ cur_entry = list_last_entry(&ds_iter->stack_head, struct struct_stack_entry, l_entry); -+ list_del(&cur_entry->l_entry); -+ free(cur_entry); -+ -+ if(list_empty(&ds_iter->stack_head)) -+ return NULL; -+ -+ return list_last_entry(&ds_iter->stack_head, struct struct_stack_entry, l_entry)->def; -+} -+ -+void ds_iter_destroy(struct ds_iter *ds_iter) -+{ -+ struct struct_stack_entry *pos, *n; -+ -+ if(list_empty(&ds_iter->stack_head)) -+ return; -+ -+ list_for_each_entry_safe(pos, n, &ds_iter->stack_head, l_entry) { -+ list_del(&pos->l_entry); -+ free(pos); -+ } -+} -+ -+struct data_member *ds_iter_parent_member(struct ds_iter *ds_iter) -+{ -+ struct struct_stack_entry *entry; -+ -+ if(list_empty(&ds_iter->stack_head)) -+ return NULL; -+ -+ entry = list_last_entry(&ds_iter->stack_head, struct struct_stack_entry, l_entry); -+ return entry->parent_member; -+} -+ -+int ds_iter_print_stack(struct ds_iter *ds_iter, char* stack, int stack_len) -+{ -+ struct struct_stack_entry *pos; -+ struct data_member *cur_memb; -+ int depth = 0; -+ char indent[32] = {0}; -+ char append[426] = {0}; -+ -+ memset(stack, 0, stack_len); -+ -+ if(list_empty(&ds_iter->stack_head)) { -+ snprintf(stack, stack_len, "Empty data structure iterator stack"); -+ return 0; -+ } -+ -+ list_for_each_entry(pos, &ds_iter->stack_head, l_entry) { -+ if(depth >= sizeof(indent)) { -+ fprintf(stderr, "Data structure iterator: stack overflow!\n"); -+ return -1; -+ } -+ -+ /* End of the stack */ -+ if(!pos->def && !pos->parent_member && pos->memb_idx == 0) -+ return 0; -+ -+ indent[depth] = '\t'; -+ -+ /* Find the current member */ -+ if(pos->def){ -+ /* This is a definition, get the current member by index */ -+ cur_memb = &pos->def->members[pos->memb_idx]; -+ if(depth == 0) -+ snprintf(stack, stack_len, "struct %s", pos->def->name); -+ } else { -+ /* -+ * This is not a definition, must be a base type. Thus parent_member is the -+ * actual current member. This is a corner case where we called -+ * ds_iter_init_member() with a member that has no definition. -+ */ -+ cur_memb = pos->parent_member; -+ if(depth == 0) -+ strncpy(stack, "struct ", stack_len); -+ } -+ -+ snprintf(append, sizeof(append), "\n%s->(%s) %s", -+ indent, cur_memb->type_name, cur_memb->name); -+ -+ if(strlen(stack) + strlen(append) >= stack_len) { -+ fprintf(stderr, "Data structure iterator: stack overflow!\n"); -+ return -1; -+ } -+ strncat(stack, append, stack_len); -+ depth++; -+ } -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/data_struct_iterator.h b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/data_struct_iterator.h -new file mode 100644 -index 000000000..2ee5aa45f ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/data_struct_iterator.h -@@ -0,0 +1,33 @@ -+/* Copyright (C) 2025 Broadcom, Inc. */ -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+#include "structure_db.h" -+ -+#ifndef _LINUX_LIST_H -+struct list_head { -+ struct list_head *next, *prev; -+}; -+#endif -+ -+struct ds_iter { -+ struct list_head stack_head; -+}; -+ -+void ds_iter_init(struct ds_iter *ds_iter, struct data_structure *def); -+void ds_iter_init_member(struct ds_iter *ds_iter, struct data_member *def); -+struct data_structure* ds_iter_top(struct ds_iter *ds_iter); -+struct data_structure* ds_iter_push(struct ds_iter *ds_iter, bool allow_loops); -+struct data_structure* ds_iter_pop(struct ds_iter *ds_iter); -+void ds_iter_destroy(struct ds_iter *ds_iter); -+struct data_member *ds_iter_parent_member(struct ds_iter *ds_iter); -+struct data_member *ds_iter_next_member(struct ds_iter *ds_iter); -+struct data_member *ds_iter_cur_memb(struct ds_iter *ds_iter); -+int ds_iter_print_stack(struct ds_iter *ds_iter, char* stack, int stack_len); -+bool ds_iter_is_loop(struct ds_iter *ds_iter); -+ -+#if defined(__cplusplus) -+} -+#endif -\ No newline at end of file -diff --git a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/dwarf_debuginfo_parser.c b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/dwarf_debuginfo_parser.c -index 79bb93302..cb6a6f5a9 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/dwarf_debuginfo_parser.c -+++ b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/dwarf_debuginfo_parser.c -@@ -9,9 +9,11 @@ - #include - #include - #include -+#include - - #include "hash_table.h" - #include "structure_db.h" -+#include "data_struct_iterator.h" - #include "../constants.h" - - #define CANISTER_LOC "crypto/fips_canister.o" -@@ -21,7 +23,14 @@ static struct conf_fprintf conf = { - }; - - struct struct_def_entry { -- struct struct_def *s_def; -+ struct data_structure *s_def; -+ struct list_head l_entry; -+}; -+ -+/* Used for cycle detection while parsing data structures */ -+struct tag_stack_entry { -+ struct data_structure *s_def; -+ struct tag *tag; - struct list_head l_entry; - }; - -@@ -30,31 +39,174 @@ static struct list_head struct_list_head; - static int returncode = 0; - static int nr_structs; - --static void get_base_type_name(struct class_member *cls_member, struct cu *cu, -+/* Replace multiple spaces with single space */ -+static void normalize_type_name(char *type_name, int len) -+{ -+ int start; -+ char tmp[len]; -+ -+ for(int i = 1; i < len; i++) { -+ start = 0; -+ while(isspace(type_name[i]) && -+ isspace(type_name[i-1]) && i < len) { -+ if(!start) -+ start = i; -+ i++; -+ } -+ -+ if(start) { -+ strncpy(tmp, &type_name[i], len - 1); -+ strcpy(&type_name[start], tmp); -+ } -+ } -+ -+ /* Strip trailing spaces */ -+ for(int i = len - 1; i >= 0 && (isspace(type_name[i]) || type_name[i] == 0); i--) -+ type_name[i] = '\0'; -+} -+ -+static void get_typedef_name(struct tag *tag, struct cu *cu, -+ char *buf, int buf_len) { -+ struct tag *base; -+ char typedef_name[32]; -+ -+ if(!tag__is_typedef(tag)) -+ return; -+ -+ tag__name(tag, cu, typedef_name, sizeof(typedef_name), &conf); -+ base = tag__follow_typedef(tag, cu); -+ tag__name(base, cu, buf, buf_len, &conf); -+ -+ /* Typedef of struct may not have another name, ex) be128 */ -+ if(tag__is_struct(base) && !strcmp(buf, "struct ")) { -+ snprintf(buf, buf_len - 1, "struct %s", typedef_name); -+ return; -+ /* Always prepend "struct" to typedef to match GCC kernel compilation version */ -+ } else if (tag__is_struct(base) && strncmp(typedef_name, "struct", 6)){ -+ snprintf(buf, buf_len - 1, "struct %s", typedef_name); -+ return; -+ } -+ -+ strncpy(buf, typedef_name, buf_len); -+} -+ -+static void print_array_dimensions(const struct array_type *at, -+ char *array_dims, int len) { -+ int i; -+ char dims[16]; -+ -+ for(i = 0; i < at->dimensions; ++i) { -+ if(at->nr_entries[i] == 0) -+ snprintf(dims, sizeof(dims), "%s[%d:]", array_dims, -+ at->nr_entries[i]); -+ else -+ snprintf(dims, sizeof(dims), "%s[%d]", array_dims, -+ at->nr_entries[i]); -+ strncpy(array_dims, dims, len); -+ } -+} -+ -+static void get_base_type_name(struct tag *tag, struct cu *cu, - char *buffer, int buf_len) - { -- char tmp_buf[64]; -+ char tmp_buf[128]; - const char *tag_name; -- struct tag *member_type = cu__type(cu, cls_member->tag.type); -- struct base_type *bt = tag__base_type(member_type); -+ struct tag *type; -+ char array_dims[16] = {0}; -+ bool member_is_arr = false; - -- tag_name = tag__name(member_type, cu, tmp_buf, sizeof(tmp_buf), &conf); -+ if(tag__is_class_member(tag)) -+ type = cu__type(cu, tag->type); -+ else -+ type = tag; -+ -+ /*ptr_type = cu__type(cu, type->type); -+ if(ptr_type && tag__is_const(ptr_type)) -+ ptr_type = cu__type(cu, ptr_type->type); - -- if (tag_name) -- strncpy(buffer, tag_name, buf_len); -+ if(ptr_type && tag__is_typedef(ptr_type)) -+ ptr_type = tag__follow_typedef(ptr_type, cu); */ -+ -+ if(tag__is_array(type, cu)) { -+ print_array_dimensions(tag__array_type(type), array_dims, -+ sizeof(array_dims)); -+ type = cu__type(cu, type->type); -+ member_is_arr = true; -+ } -+ -+ if(tag__is_typedef(type)) -+ get_typedef_name(type, cu, tmp_buf, sizeof(tmp_buf)); -+ else -+ tag__name(type, cu, tmp_buf, sizeof(tmp_buf), &conf); -+ -+ if(member_is_arr) -+ snprintf(buffer, buf_len, "%s%s", tmp_buf, array_dims); -+ else if(tag__is_struct(type) && strncmp("struct", tmp_buf, 6)) -+ snprintf(buffer, buf_len, "struct %s", tmp_buf); -+ else if(tag__is_union(type) && strncmp("union", tmp_buf, 5)) -+ snprintf(buffer, buf_len, "union %s", tmp_buf); - else -- strncpy(buffer, UNKWN_TYPE, buf_len); -+ strncpy(buffer, tmp_buf, buf_len); -+ -+ normalize_type_name(buffer, buf_len); - } - -+/* -+ * Drill down to absolute base type, check if at any point this type is a pointer. -+ * Safer than checks which rely on layer ordering, e.g typedef coming after pointer tag, etc. -+ */ -+static bool tag_is_pointer(struct tag *tag, struct cu *cu) -+{ -+ struct tag *prev = NULL; -+ while(prev != tag) { -+ prev = tag; -+ if(tag__is_modifier(tag) || tag__is_pointer(tag) || tag__is_array(tag, cu) || tag__is_class_member(tag)) { -+ if(tag__is_pointer(tag)) -+ return true; -+ tag = cu__type(cu, tag->type); -+ } else if (tag__is_typedef(tag)) -+ tag = tag__follow_typedef(tag, cu); -+ -+ if(!tag) -+ return false; -+ } -+ -+ return false; -+} -+ -+static struct tag* get_absolute_base_type(struct tag *tag, struct cu *cu) -+{ -+ struct tag *prev = NULL; -+ while(prev != tag) { -+ prev = tag; -+ if(tag__is_modifier(tag) || tag__is_pointer(tag) || tag__is_array(tag, cu) || tag__is_class_member(tag)) -+ tag = cu__type(cu, tag->type); -+ else if (tag__is_typedef(tag)) -+ tag = tag__follow_typedef(tag, cu); -+ -+ if(!tag) -+ return prev; -+ } -+ -+ return tag; -+} -+ -+static struct data_structure *__parse_tag(struct tag *tag, struct cu *cu, -+ bool nested, struct list_head *tag_stack_head); -+ - static int parse_struct_member_tag(struct tag *tag, - struct cu *cu, -- struct struct_member *new_member) -+ struct data_member *new_member, -+ struct list_head *tag_stack_head) - { - struct class_member *cls_member; - char *tag_name; - struct base_type *base_type; -- struct type *type; -+ struct tag *type; - struct tag *tag_pos; -+ struct tag *ptr_type; -+ struct data_structure *ds; -+ char prefix[9] = {0}; - - cls_member = tag__class_member(tag); - -@@ -67,49 +219,96 @@ static int parse_struct_member_tag(struct tag *tag, - - new_member->byte_size = cls_member->byte_size; - new_member->byte_offset = cls_member->byte_offset; -- get_base_type_name(cls_member, cu, new_member->type_name, -- sizeof(new_member->type_name) - 1); -+ -+ if(tag_is_pointer(tag, cu)) -+ new_member->is_ptr = true; -+ -+ type = get_absolute_base_type(tag, cu); -+ -+ if(tag__is_struct(type) || tag__is_union(type)) -+ new_member->definition = __parse_tag(type, cu, true, tag_stack_head); -+ -+ /* -+ * To match the kernel type string for typedef function pointers, we need to print the -+ * function definition. See: struct asn1_decoder->actions -+ */ -+ if(tag__is_function(type) || type->tag == DW_TAG_subroutine_type) { -+ get_base_type_name(type, cu, new_member->type_name, -+ sizeof(new_member->type_name) - 1); -+ -+ /* -+ * If the base type of a structure member is a function, the member must be a -+ * function pointer. -+ */ -+ strncat(new_member->type_name, " *", sizeof(new_member->type_name) - 1); -+ } -+ else -+ get_base_type_name(&cls_member->tag, cu, new_member->type_name, -+ sizeof(new_member->type_name) - 1); - - return 0; - } - - /* If tag is a struct, parse it. Based off of __class__fprintf() */ --static struct struct_def *parse_tag(struct tag *tag, struct cu *cu) -+static struct data_structure *__parse_tag(struct tag *tag, struct cu *cu, -+ bool nested, struct list_head *tag_stack_head) - { - struct class *class; - struct type *type; - char name[64]; -- struct struct_def *new_struct; -- struct struct_member *s_member; -+ struct data_structure *new_struct; -+ struct data_member *s_member; - struct tag *tag_pos; - const char *type_name; - int i; - size_t new_struct_sz; -+ struct tag_stack_entry entry; -+ struct tag_stack_entry *pos; - -- if (!tag__is_struct(tag)) -+ if (!tag__is_struct(tag) && !tag__is_union(tag)) - return NULL; - -+ /* Check for loops/recursive structure definitions */ -+ list_for_each_entry(pos, tag_stack_head, l_entry) { -+ if(pos->tag == tag) -+ return pos->s_def; -+ } -+ - class = tag__class(tag); - type = &class->type; - type_name = type__name(type); - -- /* Don't bother with anonymous structures */ -- if (!type_name) -+ /* Don't bother with anonymous structures or ones which are not defined here */ -+ if (!type_name && !nested) - return NULL; - -- new_struct_sz = sizeof(struct struct_def) + -- (type->nr_members * sizeof(struct struct_member)); -+ new_struct_sz = sizeof(struct data_structure) + -+ (type->nr_members * sizeof(struct data_member)); - new_struct = calloc(1, new_struct_sz); - if (!new_struct) { -- perror("Failed to allocate memory for new struct!"); -+ perror("Failed to allocate memory for new struct"); - return NULL; - } - -- strncpy(new_struct->name, type_name, sizeof(new_struct->name) - 1); -+ if(type_name) -+ strncpy(new_struct->name, type_name, -+ sizeof(new_struct->name) - 1); -+ else -+ strncpy(new_struct->name, ANON_NAME, -+ sizeof(new_struct->name) - 1); -+ - new_struct->byte_size = type->size; - new_struct->nr_members = type->nr_members; - new_struct->__sz = new_struct_sz; - -+ /* External definition */ -+ if(type->declaration) -+ return new_struct; -+ -+ entry.s_def = new_struct; -+ entry.tag = tag; -+ list_add_tail(&entry.l_entry, tag_stack_head); -+ - /* - * Get the struct members. - * According to DWARF format, the members of the struct should be -@@ -119,30 +318,38 @@ static struct struct_def *parse_tag(struct tag *tag, struct cu *cu) - i = 0; - type__for_each_tag(type, tag_pos) - { -- if (parse_struct_member_tag(tag_pos, cu, &new_struct->members[i]) < 0) { -+ if (parse_struct_member_tag(tag_pos, cu, -+ &new_struct->members[i], -+ tag_stack_head) < 0) { - fprintf(stderr, -- "struct %s: Failed to parse tag for struct member\n", -+ "struct %s: Failed to parse tag for struct" -+ "member\n", - new_struct->name); - free(new_struct); - return NULL; - } - -+ new_struct->members[i].__idx = i; -+ - i++; - } - -- /* -- * Debuginfo can contain some structs with no member info. Don't add -- * these to the DB. -- */ -- if(i == 0) { -- free(new_struct); -- return NULL; -- } -+ list_del(&entry.l_entry); - - return new_struct; - } - -+static struct data_structure *parse_tag(struct tag *tag, struct cu *cu) { -+ struct list_head tag_stack_head; - -+ /* -+ * ds_iter is not used here for two reasons: -+ * 1. This is the parse/populate step so there's nothing for the iterator to traverse yet. -+ * 2. Keeping track of the tags is more useful for cycle detection -+ */ -+ INIT_LIST_HEAD(&tag_stack_head); -+ return __parse_tag(tag, cu, false, &tag_stack_head); -+} - - static void free_struct_def_list(void) { - struct struct_def_entry *pos, *tmp; -@@ -159,23 +366,28 @@ static int cu__parse_structs(struct cu *cu) - struct class *class; - const char *type_name; - struct struct_def_entry *pos, *new_entry; -+ struct tag_stack_entry *a, *b; - bool unique; -- struct struct_def *def; -+ struct data_structure *def; - - cu__for_each_type(cu, i, tag) { - def = parse_tag(tag, cu); -- if(!def) -+ if(!def || def->nr_members == 0) - continue; - -+ /* -+ * TODO: This check can happen within parse tag, so we don't have -+ * duplicates of sub-tags -+ */ - unique = true; - list_for_each_entry(pos, &struct_list_head, l_entry) { -- if(!strcmp(pos->s_def->name, def->name)) { -+ if(data_struct_eq(pos->s_def, def)) { - unique = false; - break; - } - } - -- if(!unique) -+ if(!unique || def->nr_members == 0) - continue; - - new_entry = calloc(1, sizeof(struct struct_def_entry)); -@@ -208,6 +420,118 @@ struct conf_load dwarf_conf_parser = { - .conf_fprintf = &conf, - }; - -+static struct data_structure *get_struct_in_list_by_name(const char *name) -+{ -+ struct struct_def_entry *pos; -+ -+ list_for_each_entry(pos, &struct_list_head, l_entry) { -+ if(!strcmp(pos->s_def->name, name) && pos->s_def->nr_members > 0) { -+ return pos->s_def; -+ } -+ } -+ -+ return NULL; -+} -+ -+static bool multiple_defs_in_list(const char *name) -+{ -+ struct struct_def_entry *pos; -+ struct data_structure *complete_def = NULL; -+ -+ list_for_each_entry(pos, &struct_list_head, l_entry) { -+ if(pos->s_def->nr_members == 0 || strcmp(pos->s_def->name, name)) -+ continue; -+ -+ if(!complete_def) -+ complete_def = pos->s_def; -+ else if(complete_def && !data_struct_eq(complete_def, pos->s_def)) -+ return true; -+ } -+ -+ return false; -+} -+ -+static int remap_member_def(struct data_member *memb) -+{ -+ struct data_structure *cached_def; -+ int idx = 0; -+ -+ if(!memb || !memb->definition) -+ return 0; -+ -+ cached_def = get_struct_in_list_by_name(memb->definition->name); -+ -+ if(cached_def == memb->definition) -+ return 0; -+ -+ /* -+ * If this is an external definition, e.g not a full definition, -+ * point it to the full definition. In the unlikely event that there are multiple -+ * different structure definitions with the same name, we must throw an error, as -+ * we don't know which one is correct. -+ */ -+ if(memb->definition->nr_members == 0) { -+ free_struct_def(memb->definition); -+ memb->definition = cached_def; -+ -+ /* Only unique entries are added to the DB */ -+ if(multiple_defs_in_list(memb->definition->name)) { -+ fprintf(stderr, -+ "ERROR: Multiple structure definitions detected for struct " -+ "%s. Unsure of which to assign to struct %s->%s\n", -+ memb->definition->name, memb->definition->name, memb->name -+ ); -+ -+ return -1; -+ } -+ /* Reassign duplicate definition */ -+ } else if(data_struct_eq(cached_def, memb->definition)) { -+ free_struct_def(memb->definition); -+ memb->definition = cached_def; -+ } -+ -+ if(memb->definition->nr_members == 0) { -+ fprintf(stderr, "Failed to properly remap\n"); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+static int remap_member_defs(struct ds_iter *ds_iter) -+{ -+ struct data_member *memb = NULL; -+ struct data_structure *next; -+ struct tag_stack_entry entry, *pos; -+ int ret = 0; -+ -+ if(!ds_iter) -+ return -1; -+ -+ next = ds_iter_top(ds_iter); -+ if(!next) -+ return 0; -+ -+ memb = ds_iter_cur_memb(ds_iter); -+ if(!memb) -+ return 0; -+ -+ do { -+ ret += remap_member_def(memb); -+ -+ /* Step into the member definition */ -+ next = ds_iter_push(ds_iter, false); -+ if(next) { -+ ret += remap_member_defs(ds_iter); -+ ds_iter_pop(ds_iter); -+ } -+ -+ memb = ds_iter_next_member(ds_iter); -+ } while(memb); -+ -+ return ret; -+} -+ - /* - * API call to initialize the database with the structure info. - */ -@@ -216,6 +540,7 @@ int init_db_from_canister(void) - struct cus *cus = NULL; - int ret = 0; - struct struct_def_entry *pos; -+ struct ds_iter ds_iter; - - if(get_cached_db() == 0) - return 0; -@@ -245,6 +570,18 @@ int init_db_from_canister(void) - if(ret < 0) - goto exit; - -+ list_for_each_entry(pos, &struct_list_head, l_entry) { -+ ds_iter_init(&ds_iter, pos->s_def); -+ returncode = remap_member_defs(&ds_iter); -+ ds_iter_destroy(&ds_iter); -+ if(returncode != 0) -+ goto exit; -+ } -+ -+ /* -+ * For proper comparisons, add_struct_def should happen after we remap/populate the -+ * incomplete structure definitions -+ */ - list_for_each_entry(pos, &struct_list_head, l_entry) - add_struct_def(pos->s_def); - -@@ -256,9 +593,12 @@ int init_db_from_canister(void) - if(ret < 0) - fprintf(stderr, - "Failed to read debuginfo from " CANISTER_LOC " : %s\n", -- errno ? strerror(errno) : "No debugging information found"); -+ errno ? strerror(errno) : -+ "No debugging information found"); - - if (ret < 0 || returncode < 0) { -+ fprintf(stderr, -+ "Failed to initialize structure database from canister debuginfo\n"); - free_structure_db(); - return -1; - } -diff --git a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/hash_table.c b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/hash_table.c -index 8eea90a8b..8d669c6c2 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/hash_table.c -+++ b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/hash_table.c -@@ -109,6 +109,39 @@ struct hash_table_entry *hash_table_get(struct hash_table *htable, - return NULL; - } - -+/* -+ * For entries with the same key, return the entry at the specified index -+ */ -+struct hash_table_entry *hash_table_get_index(struct hash_table *htable, -+ const char *key, int key_len, -+ int offset) -+{ -+ int index, start_index; -+ int offset_idx = 0; -+ struct hash_table_entry *htable_entry; -+ -+ index = hash_string(key, key_len) % htable->num_entries; -+ start_index = index; -+ -+ do { -+ htable_entry = &htable->entries[index]; -+ if (!strcmp(key, htable_entry->key)) { -+ if(offset_idx == offset) -+ return htable_entry; -+ -+ offset_idx++; -+ } -+ -+ if (index >= htable->num_entries - 1) -+ index = 0; -+ else -+ index++; -+ -+ } while (index != start_index); -+ -+ return NULL; -+} -+ - void hash_table_free(struct hash_table *hash_table, void (*free_entry)(void *)) - { - if (!hash_table) -diff --git a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/hash_table.h b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/hash_table.h -index 3acc4aa56..b8fca4c4f 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/hash_table.h -+++ b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/hash_table.h -@@ -24,5 +24,8 @@ int hash_table_insert(struct hash_table *htable, void *entry, const char *key, - int key_len); - struct hash_table_entry *hash_table_get(struct hash_table *htable, const char *key, - int key_len); -+struct hash_table_entry *hash_table_get_index(struct hash_table *htable, -+ const char *key, int key_len, -+ int offset); - struct hash_table *alloc_hash_table(int num_entries); - void hash_table_free(struct hash_table *hash_table, void (*free_entry)(void *)); -diff --git a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/match_canister_structs.c b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/match_canister_structs.c -index c333f04d6..5a2b4b8b6 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/match_canister_structs.c -+++ b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/match_canister_structs.c -@@ -10,6 +10,9 @@ - #include "../fips_canister_common.h" - #include "../constants.h" - -+#include "../kernel_iterator.h" -+#include "data_struct_iterator.h" -+ - __visible int plugin_is_GPL_compatible; - - static tree get_field_by_name(tree type, char *name) -@@ -53,21 +56,20 @@ static size_t calculate_struct_size(tree type) - } - - /* Validate offset of each field matches between kernel and canister */ --static int validate_offsets(tree type, struct struct_def *canister_def) -+static int validate_offsets(tree type, struct data_structure *canister_def) - { - size_t cur_offset = 0; - size_t total_size; - size_t last_fld_size = 0, field_alignment = 0; -- struct struct_member *member; -+ struct data_member *member; - tree field; - const char *field_name; - int padding_remaining = 0; - int i = 0; - - for (member = first_member(canister_def), field = TYPE_FIELDS(type); -- field && i < canister_def->nr_members; -- field = TREE_CHAIN(field), member = &canister_def->members[++i]) { -- -+ field && i < canister_def->nr_members; -+ field = TREE_CHAIN(field), member = &canister_def->members[++i]) { - field_alignment = DECL_ALIGN_UNIT(field); - if (!field_alignment) - field_alignment = 1; -@@ -88,29 +90,293 @@ static int validate_offsets(tree type, struct struct_def *canister_def) - - if (!strcmp(member->name, field_name) && - cur_offset != (size_t)member->byte_offset) { -- error("struct '%s': field '%s', kernel offset %ld != canister offset %d\n", -+ error("struct '%s': field '%s'," -+ "kernel offset %ld != canister offset %d\n", - canister_def->name, field_name, cur_offset, - member->byte_offset); - return -1; - } -- - } - - return 0; - } - -+static bool tree_is_void_ptr(tree type) -+{ -+ return TREE_CODE(type) == POINTER_TYPE && -+ TREE_CODE(TREE_TYPE(type)) == VOID_TYPE; -+} -+ -+static bool canister_type_is_void_ptr(struct data_member *type) -+{ -+ return (type->is_ptr && !strcmp(type->type_name, "void *")); -+} -+ -+static bool is_data_structure(tree type) -+{ -+ return (TREE_CODE(type) == RECORD_TYPE || TREE_CODE(type) == UNION_TYPE); -+} -+ -+/* -+ * Returns true if type of kernel structure field matches type of canister -+ * structure field -+ */ -+#define TYPE_STACK_MAX_LEN 2048 -+static bool __type_comparison(struct kern_iter *kern_iter, struct ds_iter *ds_iter, -+ char *err_msg, int msg_len) -+{ -+ struct data_structure *canister_member_def; -+ struct data_structure *loop_end; -+ struct data_member *canister_member; -+ struct ds_iter *ds_iter_loc; -+ struct data_member *member; -+ tree field; -+ tree kernel_field, kernel_field_base_type; -+ tree kernel_def; -+ char kernel_type_str[256]; -+ bool ret = true; -+ tree attr_arg; -+ tree allowed_mismatch_attr; -+ const char *mismatch_kernel_type, *mismatch_canister_type; -+ char stack[TYPE_STACK_MAX_LEN]; -+ size_t field_size; -+ -+ canister_member = ds_iter_cur_memb(ds_iter); -+ kernel_field = kern_iter_cur_memb(kern_iter); -+ kernel_field_base_type = kern_iter_field_base_type(kern_iter); -+ allowed_mismatch_attr = lookup_attribute(CANISTER_MISMATCH_ATTR, -+ DECL_ATTRIBUTES(kernel_field)); -+ -+ field_size = get_field_size(kernel_field); -+ -+ /* Dereference FIELD_DECL */ -+ kernel_field = TREE_TYPE(kernel_field); -+ -+ ds_iter_print_stack(ds_iter, stack, TYPE_STACK_MAX_LEN); -+ -+ get_field_type_str(kernel_field, kernel_type_str, sizeof(kernel_type_str)); -+ -+ /* Check if allowed type is specified first - this should match correctly */ -+ if(allowed_mismatch_attr) { -+ attr_arg = TREE_VALUE(allowed_mismatch_attr); -+ mismatch_kernel_type = TREE_STRING_POINTER(TREE_VALUE(attr_arg)); -+ /* -+ * This should never be null, because we require two arguments when we register -+ * the attribute. It will be caught earlier. -+ */ -+ attr_arg = TREE_CHAIN(attr_arg); -+ mismatch_canister_type = TREE_STRING_POINTER(TREE_VALUE(attr_arg)); -+ -+ /* Types should match the type specified in the attribute tag */ -+ if(strcmp(kernel_type_str, mismatch_kernel_type)) { -+ snprintf( -+ err_msg, msg_len, -+ "Mismatch attribute:\n%s:\nKernel type doesn't match attribute " -+ "argument:\n(kernel) %s != %s (attribute specified)\n" -+ "Note: Found '__attribute__((" CANISTER_MISMATCH_ATTR -+ "('%s', '%s')));'", -+ stack, kernel_type_str, mismatch_kernel_type, -+ mismatch_kernel_type, mismatch_canister_type -+ ); -+ return false; -+ } -+ -+ -+ if(strcmp(canister_member->type_name, mismatch_canister_type)) { -+ snprintf( -+ err_msg, msg_len, -+ "Mismatch attribute:\n%s:\nCanister type doesn't match attribute " -+ "argument:\n(canister) %s != %s (attribute specified)\n" -+ "Note: Found '__attribute__((" CANISTER_MISMATCH_ATTR -+ "('%s', '%s')));'", -+ stack, canister_member->type_name, mismatch_canister_type, -+ mismatch_kernel_type, mismatch_canister_type -+ ); -+ return false; -+ } -+ return true; -+ } -+ -+ /* Type string matches? */ -+ if (strcmp(kernel_type_str, canister_member->type_name)) { -+ /* Allow conversions between 'void *' and other pointers */ -+ if (tree_is_void_ptr(kernel_field) && canister_member->is_ptr) -+ return true; -+ else if (canister_type_is_void_ptr(canister_member) && -+ TREE_CODE(kernel_field) == POINTER_TYPE) -+ return true; -+ -+ snprintf(err_msg, msg_len, "Type mismatch:\n%s:\n(kernel) '%s' != '%s' (canister)", -+ stack, kernel_type_str, canister_member->type_name); -+ return false; -+ } -+ -+ /* Size matches? */ -+ if(field_size != canister_member->byte_size) { -+ snprintf(err_msg, msg_len, -+ "Type/size mismatch:\n%s:\n(kernel) %ld bytes != %ld bytes (canister)", -+ stack, field_size, canister_member->byte_size); -+ return false; -+ } -+ -+ canister_member_def = get_nested_structure_def(canister_member); -+ -+ /* -+ * If canister member has no definition, but kernel does, throw an error. -+ * This catches cases where the name matches, but one is a struct and the other -+ * is a basic type. If marked to allow mismatches, skip this check. -+ */ -+ if (!canister_member_def && -+ (TREE_CODE(kernel_field_base_type) == RECORD_TYPE || -+ TREE_CODE(kernel_field_base_type) == UNION_TYPE)) { -+ snprintf(err_msg, msg_len, -+ "\n%s:\nReference chain mismatch: end of canister chain, kernel continues.", -+ stack); -+ return false; -+ /* Vice versa */ -+ } else if (canister_member_def && -+ (TREE_CODE(kernel_field_base_type) != RECORD_TYPE && -+ TREE_CODE(kernel_field_base_type) != UNION_TYPE)) { -+ snprintf(err_msg, msg_len, -+ "\n%s:\nReference chain mismatch: end of kernel chain, canister continues.", -+ stack); -+ return false; -+ } -+ -+ /* Validate type matches, at least structure vs not-structure types */ -+ if(!canister_member_def && is_data_structure(kernel_field_base_type)) { -+ snprintf(err_msg, msg_len, -+ "Canister type '(%s) %s' has no definition, but kernel type '%s' is a " -+ "data structure.", -+ canister_member->type_name, canister_member->name, kernel_type_str); -+ return false; -+ } else if (canister_member_def && !is_data_structure(kernel_field_base_type)) { -+ snprintf(err_msg, msg_len, -+ "Canister type '(%s) %s' has a structure definition, but kernel type " -+ "'%s' is not a data structure.", -+ canister_member->type_name, canister_member->name, kernel_type_str); -+ return false; -+ } -+ -+ /* -+ * If no canister member definition, and we've checked above, it means that it's a base type -+ * and we can jump back (no members to compare). If no fields, and we've checked above, -+ * it means that the kernel type is either a base type or incomplete - i.e structure with -+ * no members yet. For example, referring to a structure which will be parsed later, or a -+ * structure which contains itself as a member. -+ * In either case, we have no members so there's nothing to loop through below. -+ */ -+ if(!canister_member_def || !TYPE_FIELDS(kernel_field_base_type)) -+ return true; -+ -+ /* Step into the next member definition */ -+ canister_member_def = ds_iter_push(ds_iter, false); -+ kernel_def = kern_iter_push(kern_iter, false); -+ -+ /* -+ * Loop check. We know that both of these are data structures, so if we get a NULL from -+ * stepping into the next definition, it means that we've hit a loop. In this case where -+ * we hit a loop in one member but not the other, we can allow step into the next -+ * definition continue the type comparison from there. At some point, we will either hit -+ * a loop in both definitions, or we will have a difference and error out earlier. -+ */ -+ if(canister_member_def && !kernel_def) { -+ kern_iter_pop(kern_iter); -+ kernel_def = kern_iter_push(kern_iter, true); -+ if(!kernel_def) { -+ snprintf( -+ err_msg, msg_len, -+ "\n%s:\nUnable to step into next kernel definition! " -+ "This is a loop case.", -+ stack -+ ); -+ return false; -+ } -+ } else if (!canister_member_def && kernel_def) { -+ ds_iter_pop(ds_iter); -+ canister_member_def = ds_iter_push(ds_iter, true); -+ if(!canister_member_def) { -+ snprintf( -+ err_msg, msg_len, -+ "\n%s:\nUnable to step into next canister definition! " -+ "This is a loop case.", -+ stack -+ ); -+ return false; -+ } -+ } else if(!canister_member_def && !kernel_def) -+ return true; -+ -+ /* Compare each member of the data structures */ -+ for (field = kern_iter_cur_memb(kern_iter), member = ds_iter_cur_memb(ds_iter); -+ field && member; -+ field = kern_iter_next_field(kern_iter), member = ds_iter_next_member(ds_iter)) { -+ -+ ret = __type_comparison(kern_iter, ds_iter, err_msg, msg_len); -+ -+ if (!ret) -+ break; -+ } -+ -+ if(field && !member) { -+ ds_iter_print_stack(ds_iter, stack, TYPE_STACK_MAX_LEN); -+ snprintf( -+ err_msg, msg_len, -+ "\n%s:\nKernel has more members than canister! Extra member: %s", -+ stack, get_field_name(field) -+ ); -+ ret = false; -+ } -+ else if(!field && member) { -+ ds_iter_print_stack(ds_iter, stack, TYPE_STACK_MAX_LEN); -+ snprintf( -+ err_msg, msg_len, -+ "\n%s:\nCanister has more members than kernel! Extra member: %s", -+ stack, member->name -+ ); -+ ret = false; -+ } -+ -+ kern_iter_pop(kern_iter); -+ ds_iter_pop(ds_iter); -+ -+ return ret; -+} -+ -+/* Compares types between kernel FIELD_DECL and struct data_member, basically structure members */ -+static bool type_comparison(tree kernel_type, struct data_member *canister_type, -+ char *err_msg, int msg_len) -+{ -+ struct ds_iter ds_iter; -+ struct data_structure *nested_structure_def; -+ struct kern_iter kern_iter; -+ bool ret; -+ -+ kern_iter_init_member(&kern_iter, kernel_type); -+ ds_iter_init_member(&ds_iter, canister_type); -+ -+ ret = __type_comparison(&kern_iter, &ds_iter, err_msg, msg_len); -+ -+ ds_iter_destroy(&ds_iter); -+ kern_iter_destroy(&kern_iter); -+ -+ return ret; -+} -+ - /* Match field order between kernel and canister. Moves any new fields to end of the struct */ --static int order_fields(struct struct_def *canister_struct_def, tree type, -+static int order_fields(struct data_structure *canister_struct_def, tree type, - tree *new_field_order, int num_fields) - { - size_t field_size; -- struct struct_member *member; -+ struct data_member *member; - tree field, flexible_array = NULL_TREE; - tree divergence_point = NULL_TREE; - int nr_anon = 0; - const char *field_name; - int nf_index = 0; - char field_type[64]; -+ char err_msg[4096]; -+ tree canister_mismatch_attr; - - if (!first_member(canister_struct_def)) { - error("struct '%s': Found no members in canister version", -@@ -125,7 +391,8 @@ static int order_fields(struct struct_def *canister_struct_def, tree type, - * parsing all the canister members. - */ - field = TYPE_FIELDS(type); -- for_all_members(canister_struct_def, member) { -+ for_all_members(canister_struct_def, member) -+ { - if (!strcmp(member->name, PAD_FIELD_NAME)) - continue; - -@@ -164,9 +431,14 @@ static int order_fields(struct struct_def *canister_struct_def, tree type, - else - new_field_order[nf_index++] = field; - -- // TODO: Future development can also add a type check here. -+ if (!type_comparison(field, member, err_msg, sizeof(err_msg))) { -+ error(err_msg); -+ return -1; -+ } - -- if (field_size != member->byte_size) { -+ canister_mismatch_attr = lookup_attribute(CANISTER_MISMATCH_ATTR, -+ DECL_ATTRIBUTES(field)); -+ if (field_size != member->byte_size && !canister_mismatch_attr) { - inform(DECL_SOURCE_LOCATION(field), - "struct '%s': field '%s' size mismatch: " - "kernel: (%s) %ld != canister: (%s) %ld\n", -@@ -215,50 +487,69 @@ static int order_fields(struct struct_def *canister_struct_def, tree type, - return 0; - } - --static int pad_struct(struct struct_def *canister_struct_def, tree type, -+static int pad_struct(struct data_structure *canister_struct_def, tree type, - int kernel_size) - { -- size_t padding_size; -+ size_t padding_size, canister_size; -+ size_t byte_size, byte_offset; -+ struct data_member *final_member; - tree pad_field = NULL_TREE; - -- padding_size = canister_struct_def->byte_size - kernel_size; -+ /* Only add padding up to the end of the last canister structure field. */ -+ final_member = &canister_struct_def->members[canister_struct_def->nr_members - 1]; -+ canister_size = final_member->byte_offset + final_member->byte_size; -+ -+ padding_size = canister_size - kernel_size; - if ((int)padding_size > 0) - pad_field = create_padding_field(type, padding_size); - - return insert_pad_field(type, pad_field); - } - --static bool needs_matching(tree type, struct struct_def *canister_def) -+static bool needs_matching(tree type, struct data_structure *canister_def) - { -- struct struct_member *member; -+ struct data_member *member; - const char *field_name; -- size_t field_size; - tree field; -- int i = 0; -+ tree canister_mismatch_attr; -+ bool ret = false; -+ struct ds_iter ds_iter; -+ struct kern_iter kern_iter; -+ char err_msg[4096]; - -- if(get_type_size(type) != canister_def->byte_size) -+ if (get_type_size(type) != canister_def->byte_size) - return true; - -- for (member = first_member(canister_def), field = TYPE_FIELDS(type); -- field && i < canister_def->nr_members; -- field = TREE_CHAIN(field), member = &canister_def->members[++i]) { -+ ds_iter_init(&ds_iter, canister_def); -+ kern_iter_init(&kern_iter, type); -+ -+ for(member = ds_iter_cur_memb(&ds_iter), field = kern_iter_cur_memb(&kern_iter); -+ field && member; -+ member = ds_iter_next_member(&ds_iter), field = kern_iter_next_field(&kern_iter)) { - - field_name = get_field_name(field); -- field_size = get_field_size(field); - -- /* Needs processing if fields/field order differs, or size/type has changed */ -- if (strcmp(field_name, member->name) || -- field_size != member->byte_size) -- return true; -+ /* Needs processing if fields/field order differs */ -+ if (strcmp(field_name, member->name)) -+ ret = true; -+ -+ /* Check if type or type size has changed/doesn't match */ -+ if(!__type_comparison(&kern_iter, &ds_iter, err_msg, sizeof(err_msg))) -+ ret = true; - } - -- if (!strcmp(member->name, PAD_FIELD_NAME)) -- return true; -+ /* Mismatch in struct length */ -+ if (field || member) -+ ret = true; - -- if (field || i < canister_def->nr_members) -- return true; -+ /* If last field is padding */ -+ if(member && !strcmp(member->name, PAD_FIELD_NAME)) -+ ret = true; -+ -+ ds_iter_destroy(&ds_iter); -+ kern_iter_destroy(&kern_iter); - -- return false; -+ return ret; - } - - /* Match kernel structures to canister structures */ -@@ -266,9 +557,10 @@ static void match_struct(tree type) - { - tree *new_field_order; - int num_fields = 0; -- struct struct_def *canister_struct_def; -+ struct data_structure *canister_struct_def; - const char *type_name; - size_t struct_size; -+ int canister_def_idx = 0; - - type_name = ORIG_TYPE_NAME(type); - if (!type_name || !strcmp(type_name, ANON_NAME)) -@@ -284,13 +576,14 @@ static void match_struct(tree type) - * would make sense to sync the two definitions so that we can run the - * compatibility checks in this plugin. But for now, skip it entirely. - */ -- if(!strcmp(type_name, "hmac_ctx")) -+ if (!strcmp(type_name, "hmac_ctx")) - return; - - /* Calculate alignments and sizes for all fields */ - layout_type(type); - -- canister_struct_def = get_struct_def_by_name(type_name, strlen(type_name)); -+ canister_struct_def = get_struct_def_by_name_idx(type_name, strlen(type_name), -+ canister_def_idx); - if (!canister_struct_def) { - if (struct_in_pad_list(type_name)) - error("struct '%s': in padding list but not found in canister debuginfo", -@@ -312,7 +605,7 @@ static void match_struct(tree type) - num_fields++; - - /* Note: Can't use m/calloc in GCC */ -- new_field_order = (tree *) xcalloc(sizeof(tree), num_fields); -+ new_field_order = (tree *) xcalloc(num_fields, sizeof(tree)); - if (!new_field_order) { - perror("Couldn't allocate memory for new field order array!"); - return; -@@ -378,7 +671,17 @@ static tree handle_canister_matched_attr(tree *node, tree name, tree args, - return NULL_TREE; - } - -+static tree handle_allowed_mismatch_attr(tree *node, tree name, tree args, -+ int flags, bool *no_add_attrs) -+{ -+ -+ *no_add_attrs = false; -+ -+ return NULL_TREE; -+} -+ - static struct attribute_spec canister_matched_attr = {}; -+static struct attribute_spec allowed_mismatch_attr = {}; - - static void register_attributes(void *event_data, void *data) - { -@@ -387,7 +690,17 @@ static void register_attributes(void *event_data, void *data) - canister_matched_attr.handler = handle_canister_matched_attr; - canister_matched_attr.affects_type_identity = true; - -+ allowed_mismatch_attr.name = CANISTER_MISMATCH_ATTR; -+ allowed_mismatch_attr.type_required = true; -+ allowed_mismatch_attr.min_length = 2; -+ allowed_mismatch_attr.max_length = 2; -+ allowed_mismatch_attr.decl_required = 1; -+ allowed_mismatch_attr.type_required = 0; -+ allowed_mismatch_attr.handler = handle_allowed_mismatch_attr; -+ allowed_mismatch_attr.affects_type_identity = true; -+ - register_attribute(&canister_matched_attr); -+ register_attribute(&allowed_mismatch_attr); - } - - static void destroy_canister_struct_db(void *event_data, void *data) -@@ -399,7 +712,7 @@ static void destroy_canister_struct_db(void *event_data, void *data) - int plugin_init(struct plugin_name_args *plugin_info, - struct plugin_gcc_version *version) - { -- if(!lang_check(plugin_info->base_name, lang_hooks.name)) -+ if (!lang_check(plugin_info->base_name, lang_hooks.name)) - return -1; - - if (init_db_from_canister() < 0) -@@ -415,6 +728,5 @@ int plugin_init(struct plugin_name_args *plugin_info, - validate_decl_flex_size, NULL); - register_bad_casts_pass(plugin_info->base_name); - -- - return 0; - } -diff --git a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/structure_db.c b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/structure_db.c -index 95e88686a..dc723153f 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/structure_db.c -+++ b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/structure_db.c -@@ -7,6 +7,7 @@ - #include "hash_table.h" - #include "structure_db.h" - #include -+#include "data_struct_iterator.h" - #include - #include - #include -@@ -24,33 +25,73 @@ static struct struct_db { - struct hash_table *htable; - unsigned char *cache; - size_t cache_sz; --} struct_table = {0}; -+} struct_table = { 0 }; - --struct struct_def *get_struct_def_by_name(const char *name, int name_len) -+ -+struct stack_entry { -+ void* ptr; -+ struct list_head l_entry; -+}; -+ -+struct comp_stack { -+ struct data_structure *a, *b; -+ struct list_head l_entry; -+}; -+ -+struct data_structure *get_struct_def_by_name(const char *name, int name_len) - { - struct hash_table_entry *entry; - - entry = hash_table_get(struct_table.htable, name, name_len); - -- if(!entry) -+ if (!entry) - return NULL; - -- if(struct_table.cached) { -- return (struct struct_def *) (struct_table.cache + entry->cache_ptr); -+ if (struct_table.cached) { -+ return (struct data_structure *) (struct_table.cache + -+ entry->cache_ptr); - } - -- return (struct struct_def *) entry->entry; -+ return (struct data_structure *) entry->entry; - } - --struct struct_member *get_member_by_name(struct struct_def *def, -- const char *name) -+struct data_structure *get_struct_def_from_member(struct data_member *member) - { -- struct struct_member *member; -+ if (!member) -+ return NULL; -+ -+ size_t memb_addr = (size_t) member; -+ size_t arr_off = (sizeof(struct data_member) * member->__idx); -+ size_t base_addr = memb_addr - arr_off - sizeof(struct data_structure); -+ return (struct data_structure *) base_addr; -+} -+ -+struct data_structure *get_struct_def_by_name_idx(const char *name, -+ int name_len, int idx) -+{ -+ struct hash_table_entry *entry; -+ -+ entry = hash_table_get_index(struct_table.htable, name, name_len, idx); -+ -+ if (!entry) -+ return NULL; -+ -+ if (struct_table.cached) -+ return (struct data_structure *) (struct_table.cache + entry->cache_ptr); -+ -+ return (struct data_structure *) entry->entry; -+} -+ -+struct data_member *get_member_by_name(struct data_structure *def, -+ const char *name) -+{ -+ struct data_member *member; - - if (!name) - return NULL; - -- for_all_members(def, member) { -+ for_all_members(def, member) -+ { - if (!strcmp(name, member->name)) - return member; - } -@@ -58,20 +99,65 @@ struct struct_member *get_member_by_name(struct struct_def *def, - return NULL; - } - --static void free_struct_def(void *def) -+static void __free_struct_def(void *def, struct list_head *stack_head) - { -+ struct data_member *member; -+ struct data_structure *ds; -+ struct stack_entry entry, *pos; -+ - if (!def) - return; - -+ list_for_each_entry(pos, stack_head, l_entry) { -+ if(pos->ptr == def) -+ return; -+ } -+ -+ for_all_members(((struct data_structure *)def), member) -+ { -+ if (!member->definition || member->definition->nr_members == 0) -+ continue; -+ -+ entry.ptr = def; -+ list_add_tail(&entry.l_entry, stack_head); -+ -+ __free_struct_def(def, stack_head); -+ -+ list_del(&entry.l_entry); -+ } -+ - free(def); - } - --int add_struct_def(struct struct_def *new_struct) -+void free_struct_def(void *ds) -+{ -+ struct list_head stack_head; -+ -+ INIT_LIST_HEAD(&stack_head); -+ -+ __free_struct_def(ds, &stack_head); -+} -+ -+int add_struct_def(struct data_structure *new_struct) - { - int ret; -+ int idx = 0; -+ struct data_structure *cached_def; -+ -+ /* Ignore duplicates */ -+ do { -+ cached_def = get_struct_def_by_name_idx(new_struct->name, -+ sizeof(new_struct->name), -+ idx); -+ -+ if (data_struct_eq(cached_def, new_struct)) -+ return 0; -+ -+ idx++; -+ } while (cached_def); - - ret = hash_table_insert(struct_table.htable, (void *)new_struct, -- new_struct->name, strlen(new_struct->name)); -+ new_struct->name, strlen(new_struct->name)); - if (ret < 0) - fprintf(stderr, - "Failed to insert new entry for %s into " -@@ -84,16 +170,31 @@ int add_struct_def(struct struct_def *new_struct) - int get_cached_db(void) - { - int fd; -+ struct flock lock; - unsigned char *mem_block; - struct stat cache_stat; - - fd = open(CACHE_LOC, O_RDONLY); -- if(fd < 0) { -+ if (fd < 0) { - fprintf(stderr, "Cache not yet present at: %s\n", CACHE_LOC); - return -1; - } - -- if(fstat(fd, &cache_stat) < 0) { -+ lock.l_whence = SEEK_SET; -+ lock.l_len = 0; -+ lock.l_type = F_RDLCK; -+ lock.l_start = 0; -+ -+ /* Try to acquire a read lock - just check if another process is still working on writing */ -+ if(fcntl(fd, F_SETLK, &lock) < 0) { -+ close(fd); -+ return 0; -+ } -+ -+ /* Unlock, don't need to hold it for mmap. No writes will happen once file is created */ -+ fcntl(fd, F_SETLK, &lock); -+ -+ if (fstat(fd, &cache_stat) < 0) { - close(fd); - return -1; - } -@@ -101,13 +202,13 @@ int get_cached_db(void) - mem_block = mmap(NULL, cache_stat.st_size, PROT_READ, MAP_SHARED, fd, 0); - close(fd); - -- if(mem_block == MAP_FAILED) { -+ if (mem_block == MAP_FAILED) { - perror("Cache present but failed to load"); - return -1; - } - - struct_table.cached = true; -- struct_table.htable = (struct hash_table*) mem_block; -+ struct_table.htable = (struct hash_table *)mem_block; - struct_table.cache = mem_block; - struct_table.cache_sz = cache_stat.st_size; - -@@ -128,14 +229,265 @@ int init_struct_db(int nr_structs) - - void free_structure_db(void) - { -- if(struct_table.cached) { -- if(munmap(struct_table.cache, struct_table.cache_sz) < 0) -+ if (struct_table.cached) { -+ if (munmap(struct_table.cache, struct_table.cache_sz) < 0) - perror("Failed to unmap cached structure db"); -- } -- else -+ } else - hash_table_free(struct_table.htable, free_struct_def); - } - -+/* Return true if equal */ -+static bool __data_struct_eq(struct ds_iter *ds_iter_a, struct ds_iter *ds_iter_b); -+ -+static bool data_mem_eq(struct ds_iter *ds_iter_a, struct ds_iter *ds_iter_b) -+{ -+ unsigned int ret = 0; -+ struct data_structure *def_a, *def_b; -+ struct data_member *a, *b; -+ -+ a = ds_iter_cur_memb(ds_iter_a); -+ b = ds_iter_cur_memb(ds_iter_b); -+ -+ ret += (strcmp(a->name, b->name) != 0); -+ ret += (strcmp(a->type_name, b->type_name) != 0); -+ ret += (a->byte_size != b->byte_size); -+ ret += (a->byte_offset != b->byte_offset); -+ ret += (a->is_ptr != b->is_ptr); -+ -+ def_a = ds_iter_push(ds_iter_a, false); -+ def_b = ds_iter_push(ds_iter_b, false); -+ -+ if(ds_iter_is_loop(ds_iter_a) && ds_iter_is_loop(ds_iter_b)) -+ return ret == 0; -+ else if(!def_a && !def_b) -+ return ret == 0; -+ -+ /* Allow loops, eventually will either be unequal or both hit loop at the same time */ -+ if(!def_a && ds_iter_is_loop(ds_iter_a)) { -+ ds_iter_pop(ds_iter_a); -+ ds_iter_push(ds_iter_a, true); -+ } -+ -+ if(!def_b && ds_iter_is_loop(ds_iter_b)) { -+ ds_iter_pop(ds_iter_b); -+ ds_iter_push(ds_iter_b, true); -+ } -+ -+ ret += !__data_struct_eq(ds_iter_a, ds_iter_b); -+ -+ return ret == 0; -+} -+ -+/* Return true if equal, false if not equal. */ -+static bool __data_struct_eq(struct ds_iter *ds_iter_a, struct ds_iter *ds_iter_b) -+{ -+ struct data_structure *a, *b; -+ unsigned int ret = 0; -+ int i = 0; -+ -+ -+ a = ds_iter_top(ds_iter_a); -+ b = ds_iter_top(ds_iter_b); -+ -+ if (!a && !b) -+ return true; -+ else if (!a || !b) -+ return false; -+ -+ ret += (strcmp(a->name, b->name) != 0); -+ ret += (a->byte_size != b->byte_size); -+ ret += (a->nr_members != b->nr_members); -+ -+ if (ret) -+ return false; -+ -+ while(ds_iter_next_member(ds_iter_a) && ds_iter_next_member(ds_iter_b)) { -+ if (!data_mem_eq(ds_iter_a, ds_iter_b)) -+ return false; -+ } -+ -+ return ret == 0; -+} -+ -+/* Return true if equal, false if not equal. */ -+bool data_struct_eq(struct data_structure *a, struct data_structure *b) -+{ -+ struct ds_iter ds_iter_a, ds_iter_b; -+ bool ret; -+ -+ ds_iter_init(&ds_iter_a, a); -+ ds_iter_init(&ds_iter_b, b); -+ -+ ret = __data_struct_eq(&ds_iter_a, &ds_iter_b); -+ -+ ds_iter_destroy(&ds_iter_a); -+ ds_iter_destroy(&ds_iter_b); -+ -+ return ret; -+} -+ -+struct data_structure *get_nested_structure_def(struct data_member *member) -+{ -+ if (struct_table.cached && !member->definition_cptr) -+ return NULL; -+ -+ if (struct_table.cached) -+ return (struct data_structure *)(struct_table.cache + -+ member->definition_cptr); -+ -+ return member->definition; -+} -+ -+struct data_structure *def_from_cptr(size_t def_cptr) -+{ -+ if(!struct_table.cached || !def_cptr) -+ return NULL; -+ -+ return (struct data_structure *)(struct_table.cache + def_cptr); -+} -+ -+/* -+ * Calculate the total size needed for all dynamically allocated nested data -+ * containers (structs/unions). -+ */ -+static size_t __calc_nested_member_size(struct data_structure *def, struct list_head *stack_head) -+{ -+ struct data_structure *nested; -+ struct data_member *member; -+ struct stack_entry *entry, *pos; -+ bool touched = false; -+ size_t sz = 0; -+ -+ for_all_members(def, member) -+ { -+ nested = member->definition; -+ if(!nested) -+ continue; -+ -+ list_for_each_entry(pos, stack_head, l_entry) { -+ if(data_struct_eq(pos->ptr, nested)) -+ touched = true; -+ } -+ -+ if(touched) -+ continue; -+ -+ entry = calloc(1, sizeof(struct stack_entry)); -+ if(!entry) { -+ fprintf(stderr, "Memory allocation error\n"); -+ return -1; -+ } -+ -+ entry->ptr = nested; -+ list_add_tail(&entry->l_entry, stack_head); -+ -+ sz += nested->__sz; -+ sz += __calc_nested_member_size(nested, stack_head); -+ } -+ -+ return sz; -+} -+ -+static size_t calc_heap_sz(void) -+{ -+ struct list_head stack_head; -+ struct data_structure *def; -+ struct stack_entry *entry, *pos, *n; -+ size_t heap_sz = 0; -+ size_t ret = 0; -+ -+ INIT_LIST_HEAD(&stack_head); -+ -+ for (int i = 0; i < struct_table.htable->num_entries; i++) { -+ if (entry_is_empty(&struct_table.htable->entries[i])) -+ continue; -+ -+ def = (struct data_structure *) struct_table.htable->entries[i].entry; -+ -+ entry = calloc(1, sizeof(struct stack_entry)); -+ if(!entry) { -+ fprintf(stderr, "Memory allocation error\n"); -+ return -1; -+ } -+ -+ entry->ptr = def; -+ list_add_tail(&entry->l_entry, &stack_head); -+ -+ heap_sz += def->__sz; -+ ret = __calc_nested_member_size(def, &stack_head); -+ if(ret < 0) -+ break; -+ heap_sz += ret; -+ } -+ -+ list_for_each_entry_safe(pos, n, &stack_head, l_entry) { -+ list_del(&pos->l_entry); -+ free(pos); -+ } -+ -+ if(ret < 0) -+ return ret; -+ -+ return heap_sz; -+} -+ -+/* Step through all definitions in the cache. Returns offset of cached definition if match is found */ -+static size_t find_definition_in_cache(struct data_structure *target, -+ unsigned char *cache, size_t table_sz, size_t cache_sz) { -+ -+ /* Structure definitions start at cache + table_sz (after hash table) */ -+ size_t offset = table_sz; -+ struct data_structure *candidate; -+ -+ while(offset < cache_sz) { -+ candidate = (struct data_structure *) (cache + offset); -+ -+ if(data_struct_eq(candidate, target)) -+ return offset; -+ -+ offset += candidate->__sz; -+ } -+ -+ return 0; -+} -+ -+/* For each member of the data structure, add it to the cache and re-point the pointers. */ -+static size_t add_nested_members_to_cache(unsigned char *cache, size_t cur_ptr, -+ struct data_structure *def, -+ size_t table_sz) -+{ -+ struct data_structure *nested, *cached; -+ struct data_member *member; -+ size_t cached_offset = 0; -+ size_t sz = 0; -+ int i = 0; -+ -+ for_all_members(def, member) -+ { -+ nested = member->definition; -+ if(!nested) -+ continue; -+ -+ /* If already in the cache, we can point to the already cached version and return immediately */ -+ cached_offset = find_definition_in_cache(nested, cache, table_sz, cur_ptr); -+ if(cached_offset > 0) { -+ cached = (struct data_structure *) (cache + cached_offset); -+ member->definition_cptr = (long int) cached - (long int) cache; -+ continue; -+ } -+ -+ memcpy(cache + cur_ptr, nested, nested->__sz); -+ member->definition_cptr = cur_ptr; -+ cur_ptr += nested->__sz; -+ -+ /* Get the cached version */ -+ nested = (struct data_structure*) (cache + member->definition_cptr); -+ cur_ptr = add_nested_members_to_cache(cache, cur_ptr, nested, table_sz); -+ } -+ -+ return cur_ptr; -+} -+ - /* - * Convert the initial hash table and all structure defintions into a memory - * block which can be stored as a cache and mapped directly in to other plugin -@@ -153,35 +505,60 @@ void free_structure_db(void) - int cache_structure_db(void) - { - FILE *cache; -+ struct flock lock; - size_t ret; -+ size_t cached_offset = 0; - unsigned char *mem_block; - size_t cur_ptr = 0; - size_t table_sz = 0, heap_sz = 0; -- struct struct_def *def; -+ struct data_structure *def; - struct hash_table *cached_table; -+ struct data_member *member; -+ /* List of all definitions which have been added to the cache already */ -+ struct list_head struct_list_head; -+ struct stack_entry *entry, *tmp, *tmp1; -+ -+ if (struct_table.cached) -+ return 0; -+ -+ cache = fopen(CACHE_LOC, "wb"); -+ if (!cache) { -+ perror("Failed to open cache location"); -+ return -1; -+ } -+ -+ lock.l_whence = SEEK_SET; -+ lock.l_len = 0; -+ lock.l_type = F_WRLCK; -+ lock.l_start = 0; - -- if(struct_table.cached) -+ /* Acquire exclusive lock or return if someone already locked it */ -+ if(fcntl(fileno(cache), F_SETLK, &lock) < 0) { -+ fclose(cache); - return 0; -+ } - - /* Measure size needed for memory block */ - table_sz = sizeof(struct hash_table) + -- (struct_table.htable->num_entries * sizeof(struct hash_table_entry)); -- -- for(int i = 0; i < struct_table.htable->num_entries; i++) { -- if(entry_is_empty(&struct_table.htable->entries[i])) -- continue; -+ (struct_table.htable->num_entries * sizeof(struct hash_table_entry)); - -- def = (struct struct_def *) struct_table.htable->entries[i].entry; -- heap_sz += def->__sz; -+ heap_sz = calc_heap_sz(); -+ if(heap_sz < 0) { -+ ret = -1; -+ goto finish; - } - - /* Allocate new memory block */ - mem_block = calloc(1, table_sz + heap_sz); -- if(!mem_block) { -+ if (!mem_block) { - perror("Failed to allocate memory block for cache"); -- return -1; -+ ret = -1; -+ goto finish; - } - -+ struct_table.cache = mem_block; -+ struct_table.cache_sz = table_sz + heap_sz; -+ - /* Populate new memory block */ - /* Copy hash table into the first bytes */ - memcpy(mem_block, struct_table.htable, table_sz); -@@ -193,39 +570,50 @@ int cache_structure_db(void) - * For each structure definition entry, copy into the "heap" space and - * save the ptr as the offset to the beginning of the memory block - */ -- for(int i = 0; i < struct_table.htable->num_entries; i++) { -- def = (struct struct_def *) struct_table.htable->entries[i].entry; -- if(!def) -+ for (int i = 0; i < struct_table.htable->num_entries; i++) { -+ def = (struct data_structure *) struct_table.htable->entries[i].entry; -+ if (!def) -+ continue; -+ -+ cached_offset = find_definition_in_cache(def, mem_block, table_sz, cur_ptr); -+ if(cached_offset > 0) { -+ cached_table->entries[i].cache_ptr = cached_offset; - continue; -+ } - - cached_table->entries[i].cache_ptr = cur_ptr; - memcpy(mem_block + cur_ptr, def, def->__sz); - cur_ptr += def->__sz; -- } - -- if(cur_ptr > table_sz + heap_sz) { -- fprintf(stderr, "Memory error: Cache overflow\n"); -- ret = -1; -- goto finish; -+ cur_ptr = add_nested_members_to_cache( -+ mem_block, cur_ptr, -+ (struct data_structure *)(mem_block + cur_ptr - def->__sz), -+ table_sz -+ ); - } - -- cache = fopen(CACHE_LOC, "wb"); -- if(!cache) { -- perror("Failed to open cache location"); -+ if (cur_ptr > table_sz + heap_sz) { -+ fprintf(stderr, "Memory error: Cache overflow\n"); - ret = -1; - goto finish; - } - - ret = fwrite(mem_block, table_sz + heap_sz, 1, cache); -- if(ret <= 0) { -+ if (ret <= 0) { - perror("Failed to write structure DB to cache"); - ret = -1; - } - -- fclose(cache); - finish: -+ lock.l_type = F_UNLCK; -+ fcntl(fileno(cache), F_SETLK, &lock); -+ fclose(cache); -+ -+ /* Delete file on error - outside of lock... */ -+ if(ret < 0) -+ remove(CACHE_LOC); -+ - free(mem_block); - -- return (int) ret; -+ return (int)ret; - } -- -diff --git a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/structure_db.h b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/structure_db.h -index f6021ba94..14df6485e 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/structure_db.h -+++ b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/structure_db.h -@@ -1,26 +1,40 @@ - /* Copyright (C) 2025 Broadcom, Inc. */ -+#ifndef _FIPS_CANISTER_COMMON_H -+#define _FIPS_CANISTER_COMMON_H - - #if defined(__cplusplus) - extern "C" { - #endif -+#include - --/* Structure member definition */ --struct struct_member { -+/* Structure/union member definition */ -+struct data_member { - char name[64]; -- /* Type, e.g int, char, enum, etc */ -- char type_name[64]; -+ /* Type, e.g int, char, etc. */ -+ char type_name[256]; - size_t byte_size; - int byte_offset; -+ /* 0 if ptr, 1 otherwise */ -+ char is_ptr; -+ -+ /* Handle nested unions/structures */ -+ struct data_structure *definition; -+ size_t definition_cptr; -+ -+ /* Help to determine parent structure address */ -+ short int __idx; - }; - --/* Structure definition */ --struct struct_def { -+/* Structure/union definition */ -+struct data_structure { - char name[64]; - size_t byte_size; - int nr_members; -- /* Internal total size of the struct, including all struct members */ -+ /* Internal total size of this data_structure, including all members */ - size_t __sz; -- struct struct_member members[]; -+ /* Internal: set during graph traversal to indicate we've already touched this structure */ -+ int __flag; -+ struct data_member members[]; - }; - - #define first_member(_def) &_def->members[0] -@@ -29,18 +43,24 @@ struct struct_def { - int _i = 0; \ - for (_mbr = first_member(_def); _i < _def->nr_members; _mbr = &_def->members[++_i]) \ - -- - int init_db_from_canister(void); - void free_structure_db(void); --struct struct_def *get_struct_def_by_name(const char *name, int name_len); --struct struct_member *get_first_member(struct struct_def *def); --struct struct_member *get_member_by_name(struct struct_def *def, const char *name); --int add_struct_def(struct struct_def *new_struct); --struct struct_def *get_struct_def_by_name(const char *name, int name_len); -+struct data_structure *get_struct_def_by_name(const char *name, int name_len); -+struct data_structure *get_struct_def_by_name_idx(const char* name, int name_len, int idx); -+struct data_member *get_first_member(struct data_structure *def); -+struct data_member *get_member_by_name(struct data_structure *def, const char *name); -+int add_struct_def(struct data_structure *new_struct); -+struct data_structure *get_struct_def_by_name(const char *name, int name_len); - int init_struct_db(int nr_structs); - int cache_structure_db(void); - int get_cached_db(void); -+struct data_structure *get_nested_structure_def(struct data_member *member); -+bool data_struct_eq(struct data_structure *a, struct data_structure *b); -+void free_struct_def(void *def); -+struct data_structure *def_from_cptr(size_t def_cptr); -+struct data_structure *get_struct_def_from_member(struct data_member *member); - - #if defined(__cplusplus) - } - #endif -+#endif /* _FIPS_CANISTER_COMMON_H */ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-multiple-new-fields.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-multiple-new-fields.c -index e4b970b8b..f378be55f 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-multiple-new-fields.c -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-multiple-new-fields.c -@@ -1,8 +1,10 @@ -+#include "types.h" -+ - /* Add new_field to crypto_tfm */ - struct crypto_tfm { -- char refcnt[4]; -+ refcount_t refcnt; - -- int crt_flags; -+ u32 crt_flags; - - int new_field; - -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-multiple-new-fields.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-multiple-new-fields.expected -index 573a7cada..aa54e2575 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-multiple-new-fields.expected -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-multiple-new-fields.expected -@@ -1,6 +1,12 @@ -+struct refcount_struct { -+ atomic_t refs; /* 0 4 */ -+ -+ /* size: 4, cachelines: 1, members: 1 */ -+ /* last cacheline: 4 bytes */ -+}; - struct crypto_tfm { -- char refcnt[4]; /* 0 4 */ -- int crt_flags; /* 4 4 */ -+ refcount_t refcnt; /* 0 4 */ -+ u32 crt_flags; /* 4 4 */ - int node; /* 8 4 */ - - /* XXX 4 bytes hole, try to pack */ -@@ -20,9 +26,10 @@ struct ecdh { - char * key; /* 0 8 */ - short unsigned int key_size; /* 8 2 */ - char new_field[3]; /* 10 3 */ -- char __fips_canister_padding[11]; /* 13 11 */ -- char new_flexible_array[]; /* 24 0 */ -+ char __fips_canister_padding[5]; /* 13 5 */ -+ char new_flexible_array[]; /* 18 0 */ - - /* size: 24, cachelines: 1, members: 5 */ -+ /* padding: 6 */ - /* last cacheline: 24 bytes */ - }; -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-new-field.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-new-field.c -index 198206c42..3238a261b 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-new-field.c -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-new-field.c -@@ -1,8 +1,10 @@ -+#include "types.h" -+ - /* Add new_field to crypto_tfm */ - struct crypto_tfm { -- char refcnt[4]; -+ refcount_t refcnt; - -- int crt_flags; -+ u32 crt_flags; - - long int new_field; - -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-new-field.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-new-field.expected -index 6b00439d3..f89e56184 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-new-field.expected -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-new-field.expected -@@ -1,6 +1,12 @@ -+struct refcount_struct { -+ atomic_t refs; /* 0 4 */ -+ -+ /* size: 4, cachelines: 1, members: 1 */ -+ /* last cacheline: 4 bytes */ -+}; - struct crypto_tfm { -- char refcnt[4]; /* 0 4 */ -- int crt_flags; /* 4 4 */ -+ refcount_t refcnt; /* 0 4 */ -+ u32 crt_flags; /* 4 4 */ - int node; /* 8 4 */ - - /* XXX 4 bytes hole, try to pack */ -@@ -19,8 +25,9 @@ struct ecdh { - char * key; /* 0 8 */ - short unsigned int key_size; /* 8 2 */ - char new_field[5]; /* 10 5 */ -- char __fips_canister_padding[9]; /* 15 9 */ -+ char __fips_canister_padding[3]; /* 15 3 */ - - /* size: 24, cachelines: 1, members: 4 */ -+ /* padding: 6 */ - /* last cacheline: 24 bytes */ - }; -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-too-many-fields.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-too-many-fields.c -index 8cbe70647..43363ad85 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-too-many-fields.c -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-too-many-fields.c -@@ -1,8 +1,10 @@ -+#include "types.h" -+ - /* Expected failure: Overflowing padding before flexible array member */ - struct crypto_tfm { -- char refcnt[4]; -+ refcount_t refcnt; - -- int crt_flags; -+ u32 crt_flags; - - int new_field; - -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-too-many-fields.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-too-many-fields.expected -index 7a690ca1d..d23da4386 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-too-many-fields.expected -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-too-many-fields.expected -@@ -1,4 +1,4 @@ --add-too-many-fields.c:20:1: error: struct 'crypto_tfm': kernel size 48 != canister size 40 -+add-too-many-fields.c:22:1: error: struct 'crypto_tfm': kernel size 48 != canister size 40 - -- 20 | }; -+ 22 | }; - | ^ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch-fail.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch-fail.c -new file mode 100644 -index 000000000..39d34b49e ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch-fail.c -@@ -0,0 +1,38 @@ -+#include "types.h" -+ -+/* This should be a struct which is padded in the canister */ -+struct ecdh { -+ char *key; -+ unsigned short key_size; -+}; -+ -+/* Struct padded in canster, with flexible array member */ -+struct crypto_tfm { -+ refcount_t refcnt; -+ -+ /* Attribute: kernel type doesn't match */ -+ int crt_flags __attribute__((canister_mismatch("char[4]", "u32"))); -+ -+ int node; -+ -+ void (*exit)(struct crypto_tfm *tfm); -+ -+ /* Used to be "void *" - should be an incorrect type */ -+ long int __crt_alg; -+ -+ void *__crt_ctx[] __attribute__((__aligned__(8))); -+}; -+ -+ -+/* This can be a struct which is not padded in the canister */ -+struct list_head { -+ struct list_head *next, *prev; -+}; -+ -+int main() { -+ struct ecdh ecdh; -+ struct list_head list; -+ struct crypto_tfm tfm; -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch-fail.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch-fail.expected -new file mode 100644 -index 000000000..30ccab0ac ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch-fail.expected -@@ -0,0 +1,8 @@ -+attr-mismatch-fail.c:24:1: error: Mismatch attribute: -+struct crypto_tfm -+ ->(u32) crt_flags: -+Kernel type doesn't match attribute argument: -+(kernel) int != char[4] (attribute specified) -+Note: Found '__attribute__((canister_mismatch('char[4]', 'u32')));' -+ 24 | }; -+ | ^ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch-fail2.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch-fail2.c -new file mode 100644 -index 000000000..c72baa39b ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch-fail2.c -@@ -0,0 +1,40 @@ -+#include "types.h" -+ -+/* This should be a struct which is padded in the canister */ -+struct ecdh { -+ char *key; -+ unsigned short key_size; -+}; -+ -+/* Struct padded in canster, with flexible array member */ -+struct crypto_tfm { -+ refcount_t refcnt; -+ -+ u32 crt_flags; -+ -+ /* Attribute: canister type doesn't match */ -+ char node[4] __attribute__((canister_mismatch("char[4]", "void *"))); -+ -+ void (*exit)(struct crypto_tfm *tfm); -+ -+ /* Used to be "void *" - should be an incorrect type */ -+ long int __crt_alg; -+ -+ void *__crt_ctx[] __attribute__((__aligned__(8))); -+}; -+ -+ -+/* This can be a struct which is not padded in the canister */ -+struct list_head { -+ struct list_head *next, *prev; -+}; -+ -+int main() { -+ struct ecdh ecdh; -+ struct list_head list; -+ struct crypto_tfm tfm; -+ -+ return 0; -+} -+ -+ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch-fail2.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch-fail2.expected -new file mode 100644 -index 000000000..8c1ed355f ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch-fail2.expected -@@ -0,0 +1,8 @@ -+attr-mismatch-fail2.c:24:1: error: Mismatch attribute: -+struct crypto_tfm -+ ->(int) node: -+Canister type doesn't match attribute argument: -+(canister) int != void * (attribute specified) -+Note: Found '__attribute__((canister_mismatch('char[4]', 'void *')));' -+ 24 | }; -+ | ^ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch.c -new file mode 100644 -index 000000000..cc9195439 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch.c -@@ -0,0 +1,36 @@ -+#include "types.h" -+ -+/* This should be a struct which is padded in the canister */ -+struct ecdh { -+ char *key; -+ unsigned short key_size; -+}; -+ -+/* Struct padded in canster, with flexible array member */ -+struct crypto_tfm { -+ refcount_t refcnt; -+ -+ u32 crt_flags; -+ -+ char node[4] __attribute__((canister_mismatch("char[4]", "int"))); -+ -+ void (*exit)(struct crypto_tfm *tfm); -+ -+ void *__crt_alg; -+ -+ void *__crt_ctx[] __attribute__((__aligned__(8))); -+}; -+ -+ -+/* This can be a struct which is not padded in the canister */ -+struct list_head { -+ struct list_head *next, *prev; -+}; -+ -+int main() { -+ struct ecdh ecdh; -+ struct list_head list; -+ struct crypto_tfm tfm; -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch.expected -new file mode 100644 -index 000000000..3eeaa4f2c ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/attr-mismatch.expected -@@ -0,0 +1,39 @@ -+struct refcount_struct { -+ atomic_t refs; /* 0 4 */ -+ -+ /* size: 4, cachelines: 1, members: 1 */ -+ /* last cacheline: 4 bytes */ -+}; -+struct ecdh { -+ char * key; /* 0 8 */ -+ short unsigned int key_size; /* 8 2 */ -+ char __fips_canister_padding[8]; /* 10 8 */ -+ -+ /* size: 24, cachelines: 1, members: 3 */ -+ /* padding: 6 */ -+ /* last cacheline: 24 bytes */ -+}; -+struct crypto_tfm { -+ refcount_t refcnt; /* 0 4 */ -+ u32 crt_flags; /* 4 4 */ -+ char node[4]; /* 8 4 */ -+ -+ /* XXX 4 bytes hole, try to pack */ -+ -+ void (*exit)(struct crypto_tfm *); /* 16 8 */ -+ void * __crt_alg; /* 24 8 */ -+ char __fips_canister_padding[8]; /* 32 8 */ -+ void * __crt_ctx[] __attribute__((__aligned__(8))); /* 40 0 */ -+ -+ /* size: 40, cachelines: 1, members: 7 */ -+ /* sum members: 36, holes: 1, sum holes: 4 */ -+ /* forced alignments: 1 */ -+ /* last cacheline: 40 bytes */ -+} __attribute__((__aligned__(8))); -+struct list_head { -+ struct list_head * next; /* 0 8 */ -+ struct list_head * prev; /* 8 8 */ -+ -+ /* size: 16, cachelines: 1, members: 2 */ -+ /* last cacheline: 16 bytes */ -+}; -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/bad-cast.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/bad-cast.expected -index 0d813b0e0..7f235c032 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/bad-cast.expected -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/bad-cast.expected -@@ -1,8 +1,9 @@ - struct ecdh { - char * key; /* 0 8 */ - short unsigned int key_size; /* 8 2 */ -- char __fips_canister_padding[14]; /* 10 14 */ -+ char __fips_canister_padding[8]; /* 10 8 */ - - /* size: 24, cachelines: 1, members: 3 */ -+ /* padding: 6 */ - /* last cacheline: 24 bytes */ - }; -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/field-size-change.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/field-size-change.c -index f08f54a72..c78da2463 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/field-size-change.c -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/field-size-change.c -@@ -1,10 +1,16 @@ -+#define DEF_U32 -+typedef long int u32; -+ -+#include "types.h" -+ - /* Field size change */ - struct crypto_tfm { -- char refcnt[24]; -+ refcount_t refcnt; - -- int crt_flags; -+ /* Same type name but different size */ -+ u32 crt_flags; - -- long int node; -+ int node; - - void (*exit)(struct crypto_tfm *tfm); - -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/field-size-change.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/field-size-change.expected -index 55499de81..82230221e 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/field-size-change.expected -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/field-size-change.expected -@@ -1,12 +1,6 @@ --field-size-change.c:3:14: note: struct 'crypto_tfm': field 'refcnt' size mismatch: kernel: (char[24]) 24 != canister: (refcount_t) 4 -- -- 3 | char refcnt[24]; -- | ^~~~~~ --field-size-change.c:7:18: note: struct 'crypto_tfm': field 'node' size mismatch: kernel: (long int) 8 != canister: (int) 4 -- -- 7 | long int node; -- | ^~~~ --field-size-change.c:14:1: error: struct 'crypto_tfm': field 'crt_flags', kernel offset 24 != canister offset 4 -- -- 14 | }; -+field-size-change.c:20:1: error: Type/size mismatch: -+struct crypto_tfm -+ ->(u32) crt_flags: -+(kernel) 8 bytes != 4 bytes (canister) -+ 20 | }; - | ^ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/flexible-init.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/flexible-init.c -index 74061f8fd..0f905f78b 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/flexible-init.c -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/flexible-init.c -@@ -1,8 +1,10 @@ -+#include "types.h" -+ - /* Struct padded in canister, with flexible array member */ - struct crypto_tfm { -- char refcnt[4]; -+ refcount_t refcnt; - -- int crt_flags; -+ u32 crt_flags; - - int node; - -@@ -10,7 +12,7 @@ struct crypto_tfm { - - void *__crt_alg; - -- char __crt_ctx[]; -+ void *__crt_ctx[]; - }; - - const struct crypto_tfm tfm_var = { -@@ -19,8 +21,17 @@ const struct crypto_tfm tfm_var = { - .node = 2, - .exit = 0, - .__crt_alg = 0, -- // Alloc 8 bytes for the flexible array size -- .__crt_ctx = {0, 1, 2, 3, 4, 5, 6, 7} -+ // Alloc 64 bytes for the flexible array size -+ .__crt_ctx = { -+ (void*) 0, -+ (void*) 1, -+ (void*) 2, -+ (void*) 3, -+ (void*) 4, -+ (void*) 5, -+ (void*) 6, -+ (void*) 7 -+ } - }; - - int main() { -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/flexible-init.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/flexible-init.expected -index d5875707d..7ed87bd74 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/flexible-init.expected -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/flexible-init.expected -@@ -1,6 +1,12 @@ -+struct refcount_struct { -+ atomic_t refs; /* 0 4 */ -+ -+ /* size: 4, cachelines: 1, members: 1 */ -+ /* last cacheline: 4 bytes */ -+}; - struct crypto_tfm { -- char refcnt[4]; /* 0 4 */ -- int crt_flags; /* 4 4 */ -+ refcount_t refcnt; /* 0 4 */ -+ u32 crt_flags; /* 4 4 */ - int node; /* 8 4 */ - - /* XXX 4 bytes hole, try to pack */ -@@ -8,7 +14,7 @@ struct crypto_tfm { - void (*exit)(struct crypto_tfm *); /* 16 8 */ - void * __crt_alg; /* 24 8 */ - char __fips_canister_padding[8]; /* 32 8 */ -- char __crt_ctx[]; /* 40 0 */ -+ void * __crt_ctx[]; /* 40 0 */ - - /* size: 40, cachelines: 1, members: 7 */ - /* sum members: 36, holes: 1, sum holes: 4 */ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/follow-pointer.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/follow-pointer.c -new file mode 100644 -index 000000000..7262763f8 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/follow-pointer.c -@@ -0,0 +1,74 @@ -+#include "types.h" -+ -+struct list_head { -+ struct list_head *next, *prev; -+}; -+struct crypto_tfm; -+struct crypto_alg; -+ -+struct cipher_alg { -+ /* Sneaky change - three layers down from crypto_alg, 4 layers from crypto_tfm */ -+ long int cia_min_keysize; -+ unsigned int cia_max_keysize; -+ int (*cia_setkey)(struct crypto_tfm *tfm, const u8 *key, -+ unsigned int keylen); -+ void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); -+ void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); -+}; -+ -+struct compress_alg { -+ int (*coa_compress)(struct crypto_tfm *tfm, const u8 *src, -+ unsigned int slen, u8 *dst, unsigned int *dlen); -+ int (*coa_decompress)(struct crypto_tfm *tfm, const u8 *src, -+ unsigned int slen, u8 *dst, unsigned int *dlen); -+}; -+ -+struct crypto_tfm { -+ refcount_t refcnt; -+ -+ u32 crt_flags; -+ -+ int node; -+ -+ void (*exit)(struct crypto_tfm *tfm); -+ -+ /* -+ * This is incomplete because crypto_alg is not yet defined, so no error here -+ * (type name matches). -+ */ -+ struct crypto_alg *__crt_alg; -+ -+ void *__crt_ctx[]; -+}; -+ -+struct crypto_alg { -+ struct list_head cra_list; -+ struct list_head cra_users; -+ -+ u32 cra_flags; -+ unsigned int cra_blocksize; -+ unsigned int cra_ctxsize; -+ unsigned int cra_alignmask; -+ -+ int cra_priority; -+ refcount_t cra_refcnt; -+ -+ char cra_name[128]; -+ char cra_driver_name[128]; -+ -+ /* Convert to void * to avoid errors */ -+ void *cra_type; -+ -+ union { -+ struct cipher_alg cipher; -+ struct compress_alg compress; -+ } cra_u; -+ -+ int (*cra_init)(struct crypto_tfm *tfm); -+ void (*cra_exit)(struct crypto_tfm *tfm); -+ void (*cra_destroy)(struct crypto_alg *alg); -+ -+ void *cra_module; -+}; -+ -+ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/follow-pointer.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/follow-pointer.expected -new file mode 100644 -index 000000000..55ab03a2f ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/follow-pointer.expected -@@ -0,0 +1,14 @@ -+follow-pointer.c:17:1: error: Type mismatch: -+struct cipher_alg -+ ->(unsigned int) cia_min_keysize: -+(kernel) 'long int' != 'unsigned int' (canister) -+ 17 | }; -+ | ^ -+follow-pointer.c:72:1: error: Type mismatch: -+struct crypto_alg -+ ->(union) cra_u -+ ->(struct cipher_alg) cipher -+ ->(unsigned int) cia_min_keysize: -+(kernel) 'long int' != 'unsigned int' (canister) -+ 72 | }; -+ | ^ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional-flexible.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional-flexible.c -index a1a64d504..101692346 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional-flexible.c -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional-flexible.c -@@ -2,11 +2,12 @@ - #include - #include - #include -+#include "types.h" - - struct crypto_tfm { -- char refcnt[4]; -+ refcount_t refcnt; - -- int crt_flags; -+ u32 crt_flags; - - long int new_field; - -@@ -26,7 +27,13 @@ int main() { - return -1; - } - -- char bytes[8] = "8 bytes."; -+ /* -+ * Add a NUL terminator to the string to avoid heap overflow -+ * (printf will attempt to read till the NUL terminator, which will be beyond the -+ * string bounds) -+ */ -+ char bytes[8] = "8 bytes"; -+ bytes[7] = '\0'; - - strncpy((char *) func_tfm->__crt_ctx, bytes, sizeof(bytes)); - -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional-flexible.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional-flexible.expected -index 9ae2783db..60b2d5a8d 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional-flexible.expected -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional-flexible.expected -@@ -1,4 +1,4 @@ --__crt_ctx: 8 bytes. -+__crt_ctx: 8 bytes - - new_field offset: 32 - refcnt offset: 0 -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/no-change.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/no-change.c -index 09964b512..e59115397 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/no-change.c -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/no-change.c -@@ -1,3 +1,4 @@ -+#include "types.h" - - /* This should be a struct which is padded in the canister */ - struct ecdh { -@@ -7,9 +8,9 @@ struct ecdh { - - /* Struct padded in canster, with flexible array member */ - struct crypto_tfm { -- char refcnt[4]; -+ refcount_t refcnt; - -- int crt_flags; -+ u32 crt_flags; - - int node; - -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/no-change.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/no-change.expected -index 814dcb7a9..7b96cf157 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/no-change.expected -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/no-change.expected -@@ -1,14 +1,21 @@ -+struct refcount_struct { -+ atomic_t refs; /* 0 4 */ -+ -+ /* size: 4, cachelines: 1, members: 1 */ -+ /* last cacheline: 4 bytes */ -+}; - struct ecdh { - char * key; /* 0 8 */ - short unsigned int key_size; /* 8 2 */ -- char __fips_canister_padding[14]; /* 10 14 */ -+ char __fips_canister_padding[8]; /* 10 8 */ - - /* size: 24, cachelines: 1, members: 3 */ -+ /* padding: 6 */ - /* last cacheline: 24 bytes */ - }; - struct crypto_tfm { -- char refcnt[4]; /* 0 4 */ -- int crt_flags; /* 4 4 */ -+ refcount_t refcnt; /* 0 4 */ -+ u32 crt_flags; /* 4 4 */ - int node; /* 8 4 */ - - /* XXX 4 bytes hole, try to pack */ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/remove-field.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/remove-field.c -index f7f435d58..bc2aeafce 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/remove-field.c -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/remove-field.c -@@ -1,8 +1,10 @@ -+#include "types.h" -+ - /* Remove field from crypto_tfm */ - struct crypto_tfm { -- char refcnt[4]; -+ refcount_t refcnt; - -- int crt_flags; -+ u32 crt_flags; - - void (*exit)(struct crypto_tfm *tfm); - -@@ -16,4 +18,4 @@ int main() - struct crypto_tfm tfm; - - return 0; --} -\ No newline at end of file -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/remove-field.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/remove-field.expected -index 4ca5ba886..332677397 100644 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/remove-field.expected -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/remove-field.expected -@@ -1,3 +1,3 @@ --remove-field.c:12:1: error: struct crypto_tfm: found canister member 'node' which is not present in kernel -- 12 | }; -+remove-field.c:14:1: error: struct crypto_tfm: found canister member 'node' which is not present in kernel -+ 14 | }; - | ^ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/self-test.sh b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/self-test.sh -index 2a765a24e..502e1d55f 100755 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/self-test.sh -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/self-test.sh -@@ -5,13 +5,18 @@ test_case "no-change" "$match_canister_plugin_path" - test_case "add-new-field" "$match_canister_plugin_path" - test_case "add-multiple-new-fields" "$match_canister_plugin_path" - test_case "struct-assignment" "$match_canister_plugin_path" -+test_case "attr-mismatch" "$match_canister_plugin_path" -+test_case "typedef-struct" "$match_canister_plugin_path" - test_case_expect_gcc_failure "remove-field" "$match_canister_plugin_path" - test_case_expect_gcc_failure "field-size-change" "$match_canister_plugin_path" - test_case_expect_gcc_failure "add-too-many-fields" "$match_canister_plugin_path" - test_case_expect_gcc_failure "designated-init" "$match_canister_plugin_path" - test_case_expect_gcc_failure "unnamed-struct-init" "$match_canister_plugin_path" -+test_case_expect_gcc_failure "attr-mismatch-fail" "$match_canister_plugin_path" -+test_case_expect_gcc_failure "attr-mismatch-fail2" "$match_canister_plugin_path" -+test_case_expect_gcc_failure "follow-pointer" "$match_canister_plugin_path" - test_case_gcc_warning "bad-cast" "$match_canister_plugin_path" --test_flexible_array_init "flexible-init" "$match_canister_plugin_path" 8 "tfm_var" -+test_flexible_array_init "flexible-init" "$match_canister_plugin_path" 64 "tfm_var" - test_case_functional "functional" "$match_canister_plugin_path" - test_case_functional "functional-flexible" "$match_canister_plugin_path" - exit_return_code -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/typedef-struct.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/typedef-struct.c -new file mode 100644 -index 000000000..8dd14c6d2 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/typedef-struct.c -@@ -0,0 +1,15 @@ -+typedef long int __be64; -+typedef struct { -+ __be64 a, b; -+} be128; -+ -+struct gf128mul_4k { -+ be128 t[256]; -+}; -+ -+int main() { -+ be128 b; -+ struct gf128mul_4k k; -+ -+ return 0; -+} -\ No newline at end of file -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/typedef-struct.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/typedef-struct.expected -new file mode 100644 -index 000000000..2479c6e9d ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/typedef-struct.expected -@@ -0,0 +1,5 @@ -+struct gf128mul_4k { -+ be128 t[256]; /* 0 4096 */ -+ -+ /* size: 4096, cachelines: 64, members: 1 */ -+}; -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/types.h b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/types.h -new file mode 100644 -index 000000000..2cabc9b6d ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/types.h -@@ -0,0 +1,16 @@ -+#ifndef DEF_U32 -+#define DEF_U32 -+typedef int u32; -+#endif -+ -+typedef char u8; -+ -+typedef struct { -+ int counter; -+} atomic_t; -+ -+typedef struct refcount_struct { -+ atomic_t refs; -+} refcount_t; -+ -+ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/self-test-lib.sh b/scripts/gcc-plugins/fips_canister_plugins/self_tests/self-test-lib.sh -index e596a4287..f5285fef4 100755 ---- a/scripts/gcc-plugins/fips_canister_plugins/self_tests/self-test-lib.sh -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/self-test-lib.sh -@@ -74,14 +74,16 @@ test_flexible_array_init() { - return - fi - -- base_size=$(grep -Eo "size: [0-9]+" "${test_name}.output") -+ # Two structures in pahole output for this test - we only want the size of -+ # the last one. If other structures added in the future, update this line. -+ base_size=$(grep -Eo "size: [0-9]+" "${test_name}.output" | tail -1) - base_size=$(cut -d " " -f 2 <<< "$base_size") - - var_size=$(readelf -s "${test_name}.o" | grep "$struct_var_name" | awk '{print $3}') - - cleanup_files "$test_name" - -- if [[ $var_size -ne $((base_size + flex_array_size)) ]]; then -+ if [[ "$var_size" -ne $((base_size + flex_array_size)) ]]; then - echo -e "\n********************** TEST FAIL: $test_name ************************" - echo "Expected variable size for $struct_var_name: $((base_size + flex_array_size))" - echo "Found variable size: $var_size instead" --- -2.40.4 - diff --git a/SPECS/91/linux/fips_canister_plugins/0001-Compile-GCC-plugins-for-FIPS-canister.patch b/SPECS/91/linux/fips_canister_plugins/0001-Compile-GCC-plugins-for-FIPS-canister.patch deleted file mode 100644 index e02717b162..0000000000 --- a/SPECS/91/linux/fips_canister_plugins/0001-Compile-GCC-plugins-for-FIPS-canister.patch +++ /dev/null @@ -1,138 +0,0 @@ -From 7fdff36b69fea4b2c66d93f51a7dee8ac1c4279e Mon Sep 17 00:00:00 2001 -From: Brennan Lamoreaux -Date: Wed, 7 May 2025 19:56:42 +0000 -Subject: [PATCH] Compile GCC plugins for FIPS canister - -Makefile/kbuild modifications for compiling GCC plugins, -which come in a subsequent patch. - -Signed-off-by: Brennan Lamoreaux ---- - Makefile | 8 ++++++++ - scripts/Makefile.gcc-plugins | 3 ++++ - scripts/gcc-plugins/Kconfig | 21 +++++++++++++++++++++ - scripts/gcc-plugins/Makefile | 27 +++++++++++++++++++++++++++- - 4 files changed, 59 insertions(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index 17a0807e3..91051d3a7 100644 ---- a/Makefile -+++ b/Makefile -@@ -1016,6 +1016,14 @@ KBUILD_CFLAGS += -fno-builtin-wcslen - # Ensure compilers do not transform certain loops into calls to wcslen() - KBUILD_CFLAGS += -fno-builtin-wcslen - -+ifdef CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS -+KBUILD_CFLAGS += -Werror=designated-init -+endif -+ -+ifdef CONFIG_GCC_PLUGIN_PAD_CANISTER_STRUCTS -+KBUILD_CFLAGS += -Werror=designated-init -+endif -+ - # change __FILE__ to the relative path from the srctree - KBUILD_CPPFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) - -diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins -index 7acd78f9d..318a8c2cf 100644 ---- a/scripts/Makefile.gcc-plugins -+++ b/scripts/Makefile.gcc-plugins -@@ -42,6 +42,9 @@ ifdef CONFIG_PAX_RAP - endif - export DISABLE_ARM_SSP_PER_TASK_PLUGIN - -+gcc-plugin-$(CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS) += match_canister_structs.so -+gcc-plugin-$(CONFIG_GCC_PLUGIN_PAD_CANISTER_STRUCTS) += pad_canister_structs.so -+ - # All the plugin CFLAGS are collected here in case a build target needs to - # filter them out of the KBUILD_CFLAGS. - GCC_PLUGINS_CFLAGS := $(strip $(addprefix -fplugin=$(objtree)/scripts/gcc-plugins/, $(gcc-plugin-y)) $(gcc-plugin-cflags-y)) -diff --git a/scripts/gcc-plugins/Kconfig b/scripts/gcc-plugins/Kconfig -index e383cda05..3495361cf 100644 ---- a/scripts/gcc-plugins/Kconfig -+++ b/scripts/gcc-plugins/Kconfig -@@ -50,4 +50,25 @@ config GCC_PLUGIN_ARM_SSP_PER_TASK - bool - depends on GCC_PLUGINS && ARM - -+config GCC_PLUGIN_MATCH_CANISTER_STRUCTS -+ bool "Match kernel structs to FIPS canister structs" -+ depends on !GCC_PLUGIN_PAD_CANISTER_STRUCTS -+ default n -+ -+ help -+ When building the kernel, structures will -+ either be modified to match the structures used -+ in the FIPS canister, or if not possible, the -+ kernel will fail to compile. -+ -+config GCC_PLUGIN_PAD_CANISTER_STRUCTS -+ bool "Add 8 bytes of padding to specific structures" -+ default n -+ -+ help -+ When building the kernel, certain structures will -+ be implicitly padded with 8 extra bytes. The list -+ of such structures can be found in the plugin -+ itself. -+ - endif -diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile -index 0d3c8bdec..74a775556 100644 ---- a/scripts/gcc-plugins/Makefile -+++ b/scripts/gcc-plugins/Makefile -@@ -26,6 +26,14 @@ always-y += $(GCC_PLUGIN) - - GCC_PLUGINS_DIR = $(shell $(CC) -print-file-name=plugin) - -+plugin_cflags = -Wp,-MMD,$(depfile) $(KBUILD_HOSTCFLAGS) -fPIC \ -+ -include $(srctree)/include/linux/compiler-version.h \ -+ -DPLUGIN_VERSION=$(call stringify,$(KERNELVERSION)) \ -+ -I $(GCC_PLUGINS_DIR)/include -I $(obj) \ -+ -fno-exceptions -fasynchronous-unwind-tables \ -+ -ggdb -Wno-narrowing -Wno-unused-variable \ -+ -Wno-format-diag -+ - plugin_cxxflags = -Wp,-MMD,$(depfile) $(KBUILD_HOSTCXXFLAGS) -fPIC \ - -include $(srctree)/include/linux/compiler-version.h \ - -DPLUGIN_VERSION=$(call stringify,$(KERNELVERSION)) \ -@@ -42,6 +50,16 @@ - - plugin_ldflags = -shared - -+fips_canister_common-objs := $(patsubst $(srctree)/$(src)/fips_canister_plugins/%.c,fips_canister_plugins/%.o,$(wildcard $(srctree)/$(src)/fips_canister_plugins/*.c)) -+ -+match_canister_structs-cobjs := $(patsubst $(srctree)/$(src)/fips_canister_plugins/match_canister_structs/%.c,fips_canister_plugins/match_canister_structs/%.o,$(wildcard $(srctree)/$(src)/fips_canister_plugins/match_canister_structs/*.c)) -+match_canister_structs-cobjs := $(patsubst %match_canister_structs.o,,$(match_canister_structs-cobjs)) -+match_canister_structs-objs := fips_canister_plugins/match_canister_structs/match_canister_structs.o $(match_canister_structs-cobjs) $(fips_canister_common-objs) -+HOSTLDLIBS_match_canister_structs = -ldwarves -+ -+pad_canister_structs-objs := $(patsubst $(srctree)/$(src)/fips_canister_plugins/pad_canister_structs/%.c,fips_canister_plugins/pad_canister_structs/%.o,$(wildcard $(srctree)/$(src)/fips_canister_plugins/pad_canister_structs/*.c)) -+pad_canister_structs-objs := $(pad_canister_structs-objs) $(fips_canister_common-objs) -+ - plugin-single := $(foreach m, $(GCC_PLUGIN), $(if $($(m:%.so=%-objs)),,$(m))) - plugin-multi := $(filter-out $(plugin-single), $(GCC_PLUGIN)) - plugin-objs := $(sort $(foreach m, $(plugin-multi), $($(m:%.so=%-objs)))) -@@ -61,7 +79,7 @@ $(plugin-single): $(obj)/%.so: $(src)/%.c FORCE - - quiet_cmd_plugin_ld_so_o = HOSTLD $@ - cmd_plugin_ld_so_o = $(HOSTCXX) $(plugin_ldflags) -o $@ \ -- $(addprefix $(obj)/, $($(target-stem)-objs)) -+ $(addprefix $(obj)/, $($(target-stem)-objs)) $(HOSTLDLIBS_$(target-stem)) - - $(plugin-multi): FORCE - $(call if_changed,plugin_ld_so_o) -@@ -72,3 +90,10 @@ quiet_cmd_plugin_cxx_o_c = HOSTCXX $@ - - $(plugin-objs): $(obj)/%.o: $(src)/%.c FORCE - $(call if_changed_dep,plugin_cxx_o_c) -+ -+quiet_cmd_plugin_cc_o_c = HOSTCC $@ -+ cmd_plugin_cc_o_c = $(HOSTCC) $(plugin_cflags) -c -o $@ $< -+ -+match_canister_structs-cobjs := $(addprefix $(obj)/, $(match_canister_structs-cobjs)) -+$(match_canister_structs-cobjs): $(obj)/%.o: $(src)/%.c FORCE -+ $(call if_changed_dep,plugin_cc_o_c) --- -2.35.6 - diff --git a/SPECS/91/linux/fips_canister_plugins/0002-Build-with-FIPS-Canister-GCC-plugins.patch b/SPECS/91/linux/fips_canister_plugins/0002-Build-with-FIPS-Canister-GCC-plugins.patch deleted file mode 100644 index 75e35a8404..0000000000 --- a/SPECS/91/linux/fips_canister_plugins/0002-Build-with-FIPS-Canister-GCC-plugins.patch +++ /dev/null @@ -1,139 +0,0 @@ -From ee0140650441332bd3ff5490f33bac5ecb827252 Mon Sep 17 00:00:00 2001 -From: Brennan Lamoreaux -Date: Wed, 7 May 2025 19:58:31 +0000 -Subject: [PATCH] Build with FIPS Canister GCC plugins - -GCC plugins for FIPS canister requires certain conditions -for structures, such as designated initializers. -Ensure these conditions are satisfied. - -Signed-off-by: Brennan Lamoreaux ---- - crypto/rsa.c | 8 ++++++-- - drivers/char/tpm/tpm2-sessions.c | 2 +- - drivers/crypto/virtio/virtio_crypto_akcipher_algs.c | 4 +++- - include/crypto/hash.h | 2 +- - include/crypto/internal/ecc.h | 2 +- - include/linux/crypto.h | 4 +++- - net/bluetooth/ecdh_helper.c | 2 +- - 7 files changed, 16 insertions(+), 8 deletions(-) - -diff --git a/crypto/rsa.c b/crypto/rsa.c -index 78b28d14c..d5e4d994e 100644 ---- a/crypto/rsa.c -+++ b/crypto/rsa.c -@@ -270,9 +270,11 @@ static int rsa_set_pub_key(struct crypto_akcipher *tfm, const void *key, - unsigned int keylen) - { - struct rsa_mpi_key *mpi_key = akcipher_tfm_ctx(tfm); -- struct rsa_key raw_key = {0}; -+ struct rsa_key raw_key; - int ret; - -+ memset(&raw_key, 0, sizeof(struct rsa_key)); -+ - /* Free the old MPI key if any */ - rsa_free_mpi_key(mpi_key); - -@@ -309,9 +311,11 @@ static int rsa_set_priv_key(struct crypto_akcipher *tfm, const void *key, - unsigned int keylen) - { - struct rsa_mpi_key *mpi_key = akcipher_tfm_ctx(tfm); -- struct rsa_key raw_key = {0}; -+ struct rsa_key raw_key; - int ret; - -+ memset(&raw_key, 0, sizeof(struct rsa_key)); -+ - /* Free the old MPI key if any */ - rsa_free_mpi_key(mpi_key); - -diff --git a/drivers/char/tpm/tpm2-sessions.c b/drivers/char/tpm/tpm2-sessions.c -index 5a28d7c38..32a6e2275 100644 ---- a/drivers/char/tpm/tpm2-sessions.c -+++ b/drivers/char/tpm/tpm2-sessions.c -@@ -541,7 +541,7 @@ static int tpm_buf_append_salt(struct tpm_buf *buf, struct tpm_chip *chip, - struct kpp_request *req; - DECLARE_CRYPTO_WAIT(wait); - struct scatterlist s[2], d[1]; -- struct ecdh p = {0}; -+ struct ecdh p = {.key = 0, .key_size = 0}; - u8 encoded_key[EC_PT_SZ], *x, *y; - unsigned int buf_len; - int rc; -diff --git a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c -index cb92b7fa9..885152fbb 100644 ---- a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c -+++ b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c -@@ -374,11 +374,13 @@ static int virtio_crypto_rsa_set_key(struct crypto_akcipher *tfm, - struct virtio_crypto *vcrypto; - struct virtio_crypto_ctrl_header header; - struct virtio_crypto_akcipher_session_para para; -- struct rsa_key rsa_key = {0}; -+ struct rsa_key rsa_key; - int node = virtio_crypto_get_current_node(); - uint32_t keytype; - int ret; - -+ memset(&rsa_key, 0, sizeof(struct rsa_key)); -+ - /* mpi_free will test n, just free it. */ - mpi_free(rsa_ctx->n); - rsa_ctx->n = NULL; -diff --git a/include/crypto/hash.h b/include/crypto/hash.h -index 6692253f0..63d33d351 100644 ---- a/include/crypto/hash.h -+++ b/include/crypto/hash.h -@@ -165,7 +165,7 @@ struct shash_desc { - * Worst case is hmac(sha3-224-generic). Its context is a nested 'shash_desc' - * containing a 'struct sha3_state'. - */ --#define HASH_MAX_DESCSIZE (sizeof(struct shash_desc) + 360) -+#define HASH_MAX_DESCSIZE (sizeof(struct shash_desc) + 368) - - #define SHASH_DESC_ON_STACK(shash, ctx) \ - char __##shash##_desc[sizeof(struct shash_desc) + HASH_MAX_DESCSIZE] \ -diff --git a/include/crypto/internal/ecc.h b/include/crypto/internal/ecc.h -index 065f00e4b..fc14ada03 100644 ---- a/include/crypto/internal/ecc.h -+++ b/include/crypto/internal/ecc.h -@@ -40,7 +40,7 @@ - - #define ECC_MAX_BYTES (ECC_MAX_DIGITS << ECC_DIGITS_TO_BYTES_SHIFT) - --#define ECC_POINT_INIT(x, y, ndigits) (struct ecc_point) { x, y, ndigits } -+#define ECC_POINT_INIT(_x, _y, _ndigits) (struct ecc_point) { .x = _x, .y = _y, .ndigits = _ndigits } - - /** - * ecc_swap_digits() - Copy ndigits from big endian array to native array -diff --git a/include/linux/crypto.h b/include/linux/crypto.h -index d6a78fde6..4e0ac13c7 100644 ---- a/include/linux/crypto.h -+++ b/include/linux/crypto.h -@@ -382,7 +382,9 @@ struct crypto_wait { - */ - #define DECLARE_CRYPTO_WAIT(_wait) \ - struct crypto_wait _wait = { \ -- COMPLETION_INITIALIZER_ONSTACK((_wait).completion), 0 } -+ .completion = COMPLETION_INITIALIZER_ONSTACK((_wait).completion), \ -+ .err = 0 \ -+ } - - /* - * Async ops completion helper functioons -diff --git a/net/bluetooth/ecdh_helper.c b/net/bluetooth/ecdh_helper.c -index 0efc93fda..daaa12f32 100644 ---- a/net/bluetooth/ecdh_helper.c -+++ b/net/bluetooth/ecdh_helper.c -@@ -103,7 +103,7 @@ int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 private_key[32]) - u8 *buf, *tmp = NULL; - unsigned int buf_len; - int err; -- struct ecdh p = {0}; -+ struct ecdh p = {.key = 0, .key_size = 0}; - - if (private_key) { - tmp = kmalloc(32, GFP_KERNEL); --- -2.53.0 - diff --git a/SPECS/91/linux/fips_canister_plugins/0003-Introduce-FIPS-canister-plugins.patch b/SPECS/91/linux/fips_canister_plugins/0003-Introduce-FIPS-canister-plugins.patch deleted file mode 100644 index 389d9ce713..0000000000 --- a/SPECS/91/linux/fips_canister_plugins/0003-Introduce-FIPS-canister-plugins.patch +++ /dev/null @@ -1,2078 +0,0 @@ -From 9a68fdadf2d981a40078c1b28122c5ced0289156 Mon Sep 17 00:00:00 2001 -From: Brennan Lamoreaux -Date: Thu, 8 May 2025 21:38:42 +0000 -Subject: [PATCH 3/4] Introduce FIPS canister plugins - -Introduces two GCC plugins to facilitate the interface -between FIPS canister binary and the Linux kernel. - -pad_canister_structs: Pads each whitelisted structure -with 8 bytes of padding, to save space for new fields -in the future. Only executed during canister building. - -match_canister_structs: Matches layout of structures -in the kernel with the master versions in the FIPS canister. -This consists of matching the order and inserting padding -to match the size. Also can run safeguarding checks -against structure member offsets, size, type, etc. -Not executed during canister building. - -Signed-off-by: Brennan Lamoreaux ---- - scripts/gcc-plugins/Makefile | 2 +- - .../fips_canister_plugins/constants.h | 11 + - .../fips_canister_plugins/find_bad_casts.c | 360 +++++++++++++++ - .../fips_canister_common.c | 370 +++++++++++++++ - .../fips_canister_common.h | 23 + - .../dwarf_debuginfo_parser.c | 267 +++++++++++ - .../match_canister_structs/hash_table.c | 125 ++++++ - .../match_canister_structs/hash_table.h | 28 ++ - .../match_canister_structs.c | 420 ++++++++++++++++++ - .../match_canister_structs/structure_db.c | 231 ++++++++++ - .../match_canister_structs/structure_db.h | 46 ++ - .../pad_canister_structs.c | 69 +++ - 12 files changed, 1951 insertions(+), 1 deletion(-) - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/constants.h - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/find_bad_casts.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/fips_canister_common.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/fips_canister_common.h - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/dwarf_debuginfo_parser.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/hash_table.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/hash_table.h - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/match_canister_structs.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/structure_db.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/structure_db.h - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/pad_canister_structs/pad_canister_structs.c - -diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile -index 74a775556..5703628d5 100644 ---- a/scripts/gcc-plugins/Makefile -+++ b/scripts/gcc-plugins/Makefile -@@ -67,7 +67,7 @@ plugin-multi := $(filter-out $(plugin-single), $(GCC_PLUGIN)) - plugin-objs := $(sort $(foreach m, $(plugin-multi), $($(m:%.so=%-objs)))) - - targets += $(plugin-single) $(plugin-multi) $(plugin-objs) --clean-files += *.so -+clean-files += *.so *.db - - plugin-single := $(addprefix $(obj)/, $(plugin-single)) - plugin-multi := $(addprefix $(obj)/, $(plugin-multi)) -diff --git a/scripts/gcc-plugins/fips_canister_plugins/constants.h b/scripts/gcc-plugins/fips_canister_plugins/constants.h -new file mode 100644 -index 000000000..a071f0bcf ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/constants.h -@@ -0,0 +1,11 @@ -+/* Copyright (C) 2025 Broadcom, Inc. */ -+ -+/* Used for struct members which have no name */ -+#define ANON_NAME "anonymous" -+ -+#define PAD_FIELD_NAME "__fips_canister_padding" -+ -+#define PADDING_ADDED_ATTR "padding_added" -+#define CANISTER_MATCHED_ATTR "canister_matched" -+ -+#define UNKWN_TYPE "" -diff --git a/scripts/gcc-plugins/fips_canister_plugins/find_bad_casts.c b/scripts/gcc-plugins/fips_canister_plugins/find_bad_casts.c -new file mode 100644 -index 000000000..6114752d9 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/find_bad_casts.c -@@ -0,0 +1,360 @@ -+/* -+ * Following code is taken/modified from randomize_layout_plugin.c. Much thanks to -+ * all developers of randomize_layout_plugin.c, who have already implemented this -+ * functionality in that plugin. There's no need to reinvent the wheel here. -+ * -+ * Adds a safety layer, to find bad casts between structures. This is important, -+ * because we are possibly reordering structures or adding new -+ * padding fields. And so, "bad" casts between different structure types -+ * may not line up in the way that they'd originally been written. -+ * -+ * -+ * One addition to randomize_layout_plugin: check_global_var_decl(). This is -+ * needed to check global variable assignments. -+ * -+ * Copyright (C) 2025 Broadcom, Inc. -+ */ -+ -+#include "constants.h" -+#include "../gcc-common.h" -+ -+#define INFORM(loc, msg, ...) inform(loc, "fips canister plugin: " msg, ##__VA_ARGS__) -+#define MISMATCH(loc, how, ...) INFORM(loc, "casting modified canister structure pointer type (" how "): %qT and %qT\n", __VA_ARGS__) -+ -+static bool canister_modified(tree type_attrs) -+{ -+ return lookup_attribute(PADDING_ADDED_ATTR, type_attrs) || -+ lookup_attribute(CANISTER_MATCHED_ATTR, type_attrs); -+ -+} -+ -+static void check_bad_casts_in_constructor(tree var, tree init) -+{ -+ unsigned HOST_WIDE_INT idx; -+ tree field, val; -+ tree field_type, val_type; -+ -+ FOR_EACH_CONSTRUCTOR_ELT(CONSTRUCTOR_ELTS(init), idx, field, val) { -+ if (TREE_CODE(val) == CONSTRUCTOR) { -+ check_bad_casts_in_constructor(var, val); -+ continue; -+ } -+ -+ /* pipacs' plugin creates franken-arrays that differ from those produced by -+ normal code which all have valid 'field' trees. work around this */ -+ if (field == NULL_TREE) -+ continue; -+ field_type = TREE_TYPE(field); -+ val_type = TREE_TYPE(val); -+ -+ if (TREE_CODE(field_type) != POINTER_TYPE || TREE_CODE(val_type) != POINTER_TYPE) -+ continue; -+ -+ if (field_type == val_type) -+ continue; -+ -+ field_type = TYPE_MAIN_VARIANT(strip_array_types(TYPE_MAIN_VARIANT(TREE_TYPE(field_type)))); -+ val_type = TYPE_MAIN_VARIANT(strip_array_types(TYPE_MAIN_VARIANT(TREE_TYPE(val_type)))); -+ -+ if (field_type == void_type_node) -+ continue; -+ if (field_type == val_type) -+ continue; -+ -+ if(!canister_modified(TYPE_ATTRIBUTES(val_type)) && -+ !canister_modified(TYPE_ATTRIBUTES(field_type))) -+ continue; -+ -+ MISMATCH(DECL_SOURCE_LOCATION(var), "constructor\n", TYPE_MAIN_VARIANT(field_type), -+ TYPE_MAIN_VARIANT(val_type)); -+ } -+} -+ -+static void check_global_var_decl(tree var) { -+ tree init; -+ tree var_type, init_type; -+ -+ init = DECL_INITIAL(var); -+ -+ if(init == NULL_TREE) -+ return; -+ -+ init_type = TREE_TYPE(init); -+ var_type = TREE_TYPE(var); -+ -+ if (TREE_CODE(init_type) != POINTER_TYPE || TREE_CODE(var_type) != POINTER_TYPE) -+ return; -+ -+ init_type = TYPE_MAIN_VARIANT(strip_array_types(TYPE_MAIN_VARIANT(TREE_TYPE(init_type)))); -+ var_type = TYPE_MAIN_VARIANT(strip_array_types(TYPE_MAIN_VARIANT(TREE_TYPE(var_type)))); -+ -+ if(!canister_modified(TYPE_ATTRIBUTES(var_type)) && -+ !canister_modified(TYPE_ATTRIBUTES(init_type))) -+ return; -+ -+ if(TREE_CODE(var_type) != RECORD_TYPE) -+ return; -+ -+ if(TREE_CODE(init_type) == TREE_CODE(var_type)) -+ return; -+ -+ MISMATCH(DECL_SOURCE_LOCATION(var), "global declaration", TYPE_MAIN_VARIANT(var_type), -+ TYPE_MAIN_VARIANT(init_type)); -+} -+ -+/* derived from the constify plugin */ -+static void check_global_variables(void *event_data, void *data) -+{ -+ struct varpool_node *node; -+ tree init; -+ -+ FOR_EACH_VARIABLE(node) { -+ tree var = NODE_DECL(node); -+ -+ if(TREE_CODE(var) == VAR_DECL){ -+ check_global_var_decl(var); -+ continue; -+ } -+ -+ init = DECL_INITIAL(var); -+ if (init == NULL_TREE) -+ continue; -+ -+ if (TREE_CODE(init) != CONSTRUCTOR) -+ continue; -+ -+ check_bad_casts_in_constructor(var, init); -+ } -+} -+ -+/* Copied from gcc/dominance.cc */ -+static inline unsigned int dom_convert_dir_to_idx (cdi_direction dir) -+{ -+ gcc_checking_assert (dir == CDI_DOMINATORS || dir == CDI_POST_DOMINATORS); -+ return dir - 1; -+} -+ -+static bool has_dominator(enum cdi_direction dir, basic_block bb) { -+ unsigned int dir_index = dom_convert_dir_to_idx (dir); -+ if(dir_index > 1 || !bb->dom[dir_index]) -+ return false; -+ -+ return true; -+} -+ -+static bool dominated_by_is_err(const_tree rhs, basic_block bb) -+{ -+ basic_block dom; -+ gimple dom_stmt; -+ gimple call_stmt; -+ const_tree dom_lhs; -+ const_tree poss_is_err_cond; -+ const_tree poss_is_err_func; -+ const_tree is_err_arg; -+ -+ /* -+ * Attempting to get the dominator without first checking if it exists -+ * is causing SEGFAULT in some GCC test cases, for example -+ * gcc.dg/gimplefe-49.c. -+ * -+ * Add our own function to check if the dominator exists first. Skip -+ * out if it doesn't exist. -+ */ -+ if(!has_dominator(CDI_DOMINATORS, bb)) -+ return false; -+ -+ dom = get_immediate_dominator(CDI_DOMINATORS, bb); -+ if (!dom) -+ return false; -+ -+ dom_stmt = last_stmt(dom); -+ if (!dom_stmt) -+ return false; -+ -+ if (gimple_code(dom_stmt) != GIMPLE_COND) -+ return false; -+ -+ if (gimple_cond_code(dom_stmt) != NE_EXPR) -+ return false; -+ -+ if (!integer_zerop(gimple_cond_rhs(dom_stmt))) -+ return false; -+ -+ poss_is_err_cond = gimple_cond_lhs(dom_stmt); -+ -+ if (TREE_CODE(poss_is_err_cond) != SSA_NAME) -+ return false; -+ -+ call_stmt = SSA_NAME_DEF_STMT(poss_is_err_cond); -+ -+ if (gimple_code(call_stmt) != GIMPLE_CALL) -+ return false; -+ -+ dom_lhs = gimple_get_lhs(call_stmt); -+ poss_is_err_func = gimple_call_fndecl(call_stmt); -+ if (!poss_is_err_func) -+ return false; -+ if (dom_lhs != poss_is_err_cond) -+ return false; -+ if (strcmp(DECL_NAME_POINTER(poss_is_err_func), "IS_ERR")) -+ return false; -+ -+ is_err_arg = gimple_call_arg(call_stmt, 0); -+ if (!is_err_arg) -+ return false; -+ -+ if (is_err_arg != rhs) -+ return false; -+ -+ return true; -+} -+ -+static void handle_local_var_initializers(void) -+{ -+ tree var; -+ unsigned int i; -+ -+ FOR_EACH_LOCAL_DECL(cfun, i, var) { -+ tree init = DECL_INITIAL(var); -+ if (!init) -+ continue; -+ if (TREE_CODE(init) != CONSTRUCTOR) -+ continue; -+ check_bad_casts_in_constructor(var, init); -+ } -+} -+ -+/* -+ * iterate over all statements to find "bad" casts: -+ * those where the address of the start of a structure is cast -+ * to a pointer of a structure of a different type, or a -+ * structure pointer type is cast to a different structure pointer type -+ */ -+static unsigned int find_bad_casts_execute(void) -+{ -+ basic_block bb; -+ -+ handle_local_var_initializers(); -+ -+ FOR_EACH_BB_FN(bb, cfun) { -+ gimple_stmt_iterator gsi; -+ -+ for (gsi = gsi_start_bb(bb); !gsi_end_p(gsi); gsi_next(&gsi)) { -+ gimple stmt; -+ const_tree lhs; -+ const_tree lhs_type; -+ const_tree rhs1; -+ const_tree rhs_type; -+ const_tree ptr_lhs_type; -+ const_tree ptr_rhs_type; -+ const_tree op0; -+ const_tree op0_type; -+ enum tree_code rhs_code; -+ -+ stmt = gsi_stmt(gsi); -+ -+#ifdef __DEBUG_PLUGIN -+#ifdef __DEBUG_VERBOSE -+ debug_gimple_stmt(stmt); -+ debug_tree(gimple_get_lhs(stmt)); -+#endif -+#endif -+ -+ if (gimple_code(stmt) != GIMPLE_ASSIGN) -+ continue; -+ -+#ifdef __DEBUG_PLUGIN -+#ifdef __DEBUG_VERBOSE -+ debug_tree(gimple_assign_rhs1(stmt)); -+#endif -+#endif -+ rhs_code = gimple_assign_rhs_code(stmt); -+ -+ if (rhs_code != ADDR_EXPR && rhs_code != SSA_NAME) -+ continue; -+ -+ lhs = gimple_get_lhs(stmt); -+ lhs_type = TREE_TYPE(lhs); -+ rhs1 = gimple_assign_rhs1(stmt); -+ rhs_type = TREE_TYPE(rhs1); -+ -+ if (TREE_CODE(rhs_type) != POINTER_TYPE || -+ TREE_CODE(lhs_type) != POINTER_TYPE) -+ continue; -+ -+ ptr_lhs_type = TYPE_MAIN_VARIANT(strip_array_types(TYPE_MAIN_VARIANT(TREE_TYPE(lhs_type)))); -+ ptr_rhs_type = TYPE_MAIN_VARIANT(strip_array_types(TYPE_MAIN_VARIANT(TREE_TYPE(rhs_type)))); -+ -+ if (ptr_rhs_type == void_type_node) -+ continue; -+ -+ if (ptr_lhs_type == void_type_node) -+ continue; -+ -+ if (dominated_by_is_err(rhs1, bb)) -+ continue; -+ -+ if (TREE_CODE(ptr_rhs_type) != RECORD_TYPE) { -+#ifndef __DEBUG_PLUGIN -+ if (canister_modified(TYPE_ATTRIBUTES(ptr_lhs_type))) -+#endif -+ MISMATCH(gimple_location(stmt), "rhs", ptr_lhs_type, -+ ptr_rhs_type); -+ continue; -+ } -+ -+ if (rhs_code == SSA_NAME && ptr_lhs_type == ptr_rhs_type) -+ continue; -+ -+ if (rhs_code == ADDR_EXPR) { -+ op0 = TREE_OPERAND(rhs1, 0); -+ -+ if (op0 == NULL_TREE) -+ continue; -+ -+ if (TREE_CODE(op0) != VAR_DECL) -+ continue; -+ -+ op0_type = TYPE_MAIN_VARIANT(strip_array_types(TYPE_MAIN_VARIANT(TREE_TYPE(op0)))); -+ if (op0_type == ptr_lhs_type) -+ continue; -+ -+#ifndef __DEBUG_PLUGIN -+ if (canister_modified(TYPE_ATTRIBUTES(op0_type))) -+#endif -+ MISMATCH(gimple_location(stmt), "op0", ptr_lhs_type, op0_type); -+ } else { -+ const_tree ssa_name_var = SSA_NAME_VAR(rhs1); -+ /* skip bogus type casts introduced by container_of */ -+ if (ssa_name_var != NULL_TREE && DECL_NAME(ssa_name_var) && -+ !strcmp((const char *)DECL_NAME_POINTER(ssa_name_var), "__mptr")) -+ continue; -+#ifndef __DEBUG_PLUGIN -+ if(canister_modified(TYPE_ATTRIBUTES(ptr_rhs_type))) -+#endif -+ MISMATCH(gimple_location(stmt), "ssa", ptr_lhs_type, -+ ptr_rhs_type); -+ } -+ -+ } -+ } -+ return 0; -+} -+ -+#define PASS_NAME find_bad_casts -+#define NO_GATE -+#include "../gcc-generate-gimple-pass.h" -+void register_bad_casts_pass(const char* plugin_name) -+{ -+ struct register_pass_info find_bad_casts_pass_info; -+ -+ find_bad_casts_pass_info.pass = make_find_bad_casts_pass(); -+ find_bad_casts_pass_info.reference_pass_name = "ssa"; -+ find_bad_casts_pass_info.ref_pass_instance_number = 1; -+ find_bad_casts_pass_info.pos_op = PASS_POS_INSERT_AFTER; -+ -+ register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, -+ NULL, &find_bad_casts_pass_info); -+ register_callback(plugin_name, PLUGIN_ALL_IPA_PASSES_START, -+ check_global_variables, NULL); -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/fips_canister_common.c b/scripts/gcc-plugins/fips_canister_plugins/fips_canister_common.c -new file mode 100644 -index 000000000..db836e43d ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/fips_canister_common.c -@@ -0,0 +1,370 @@ -+/* -+ * Common code shared between match_canister_structs and pad_canister_structs. -+ * -+ * Copyright (C) 2025 Broadcom, Inc. -+ */ -+ -+#include "../gcc-common.h" -+ -+#include "fips_canister_common.h" -+#include "constants.h" -+ -+static const int nr_pad_structs = 44; -+const char *pad_struct_list[] = { -+ "crypto_async_request", -+ "crypto_tfm", -+ "cipher_alg", -+ "compress_alg", -+ "crypto_alg", -+ "crypto_aes_ctx", -+ "skcipher_request", -+ "crypto_skcipher", -+ "skcipher_alg_common", -+ "skcipher_alg", -+ "skcipher_walk", -+ "aead_request", -+ "aead_alg", -+ "crypto_aead", -+ "sha256_state", -+ "aead_geniv_ctx", -+ "crypto_sync_skcipher", -+ "rng_alg", -+ "crypto_rng", -+ "gcry_mpi", -+ "rsa_key", -+ "akcipher_request", -+ "crypto_akcipher", -+ "akcipher_alg", -+ "ecc_point", -+ "ecc_curve", -+ "crypto_wait", -+ "crypto_comp", -+ "hash_alg_common", -+ "ahash_request", -+ "crypto_ahash", -+ "shash_desc", -+ "crypto_shash", -+ "shash_alg", -+ "kpp_request", -+ "crypto_kpp", -+ "kpp_alg", -+ "acomp_req", -+ "crypto_acomp", -+ "crypto_cipher", -+ "sha1_state", -+ "sha512_state", -+ "sha3_state", -+ "ecdh" -+}; -+ -+/* TODO, future work: This is slow. Make it faster. */ -+bool struct_in_pad_list(const char *name) -+{ -+ for (int i = 0; i < nr_pad_structs; i++) { -+ if (!strcmp(name, pad_struct_list[i])) -+ return true; -+ } -+ -+ return 0; -+} -+ -+/* Borrowed from randomize_layout_plugin.c */ -+bool is_flexible_array(const_tree field) -+{ -+ const_tree fieldtype; -+ const_tree typesize; -+ -+ fieldtype = TREE_TYPE(field); -+ typesize = TYPE_SIZE(fieldtype); -+ -+ if (TREE_CODE(fieldtype) != ARRAY_TYPE) -+ return false; -+ -+ /* size of type is represented in bits */ -+ -+ if (typesize == NULL_TREE && TYPE_DOMAIN(fieldtype) != NULL_TREE && -+ TYPE_MAX_VALUE(TYPE_DOMAIN(fieldtype)) == NULL_TREE) -+ return true; -+ -+ return false; -+} -+ -+tree create_padding_field(tree context, int pad_len) -+{ -+ tree eltype, index, padding; -+ -+ if (pad_len <= 0) -+ return NULL_TREE; -+ -+ /* Type of array fields */ -+ eltype = build_type_variant(char_type_node, 0, 0); -+ -+ /* Maximum index into the array*/ -+ index = build_index_type(size_int(pad_len - 1)); -+ -+ /* Build the new array type */ -+ padding = build_array_type(eltype, index); -+ -+ /* Build the new declaration */ -+ padding = build_decl(BUILTINS_LOCATION, FIELD_DECL, -+ get_identifier(PAD_FIELD_NAME), padding); -+ -+ /* Context is the parent struct */ -+ DECL_CONTEXT(padding) = context; -+ -+ /* Relayout the new decl */ -+ relayout_decl(padding); -+ -+ return padding; -+} -+ -+location_t get_type_location(tree type) -+{ -+ if (!type) -+ return UNKNOWN_LOCATION; -+ -+ if (DECL_P(type)) -+ return DECL_SOURCE_LOCATION(type); -+ -+ if (EXPR_HAS_LOCATION(type)) -+ return EXPR_LOCATION(type); -+ -+ return UNKNOWN_LOCATION; -+} -+ -+size_t get_type_size(tree type) -+{ -+ tree size_tree; -+ size_t size; -+ -+ size_tree = TYPE_SIZE_UNIT(type); -+ size = size_tree ? TREE_INT_CST_LOW(size_tree) : 0; -+ -+ return size; -+} -+ -+size_t get_field_size(tree field) -+{ -+ tree size_tree; -+ size_t field_size; -+ -+ size_tree = TYPE_SIZE_UNIT(TREE_TYPE(field)); -+ field_size = size_tree ? TREE_INT_CST_LOW(size_tree) : 0; -+ -+ return field_size; -+} -+ -+const char *get_field_name(tree field) -+{ -+ const char *field_name; -+ -+ field_name = get_name(field); -+ if (!field_name) -+ field_name = ANON_NAME; -+ -+ return field_name; -+} -+ -+/* TODO: Future work: improve this function, use it for variable type check */ -+int get_field_type_str(tree field, char *type_str, int len) -+{ -+ const char *type_name = NULL; -+ -+ FILE *tmp_fp; -+ char* buf; -+ size_t length; -+ -+ tree type; -+ tree type_name_node; -+ -+ type = TREE_TYPE(field); -+ -+ if (!type) -+ return 0; -+ -+ type_name_node = TYPE_NAME(type); -+ -+ if (type_name_node && TREE_CODE(type_name_node) == TYPE_DECL) { -+ type_name = IDENTIFIER_POINTER(DECL_NAME(type_name_node)); -+ } else if (type_name_node && -+ TREE_CODE(type_name_node) == IDENTIFIER_NODE) { -+ type_name = get_name(type_name_node); -+ } -+ -+ if(type_name) { -+ strncpy(type_str, type_name, len); -+ return 0; -+ } -+ -+ tmp_fp = open_memstream(&buf, &length); -+ if(tmp_fp) { -+ print_generic_expr(tmp_fp, type, TDF_SLIM); -+ fflush(tmp_fp); -+ fclose(tmp_fp); -+ strncpy(type_str, buf, len); -+ free(buf); -+ return 0; -+ } -+ -+ type_name = UNKWN_TYPE; -+ strncpy(type_str, type_name, len); -+ -+ return 0; -+} -+ -+int insert_pad_field(tree type, tree pad_field) -+{ -+ tree last_field = NULL_TREE; -+ tree penultimate_field = NULL_TREE; -+ tree field; -+ -+ if (!pad_field) -+ return 0; -+ -+ for (field = TYPE_FIELDS(type); field; field = TREE_CHAIN(field)) { -+ penultimate_field = last_field; -+ last_field = field; -+ } -+ -+ if (!last_field) { -+ error("No fields found for struct"); -+ return -1; -+ } -+ -+ if (!strcmp(get_field_name(last_field), PAD_FIELD_NAME)) -+ return 0; -+ -+ /* Add padding before flexible array member, as this must be the last member */ -+ if (is_flexible_array(last_field)) { -+ if (!penultimate_field) { -+ error("must have at least 2 members when a flexible array member is present"); -+ return -1; -+ } -+ -+ TREE_CHAIN(penultimate_field) = pad_field; -+ TREE_CHAIN(pad_field) = last_field; -+ } else { -+ TREE_CHAIN(last_field) = pad_field; -+ TREE_CHAIN(pad_field) = NULL_TREE; -+ } -+ -+ return 0; -+} -+ -+void relayout_canister_struct(tree type, const char *identifier) -+{ -+ tree main_variant, variant; -+ -+ /* Relayout all variants in the same way */ -+ main_variant = TYPE_MAIN_VARIANT(type); -+ for (variant = main_variant; variant; variant = TYPE_NEXT_VARIANT(variant)) { -+ TYPE_FIELDS(variant) = TYPE_FIELDS(type); -+ -+ TYPE_ATTRIBUTES(variant) = copy_list(TYPE_ATTRIBUTES(variant)); -+ TYPE_ATTRIBUTES(variant) = tree_cons(get_identifier(identifier), -+ NULL_TREE, -+ TYPE_ATTRIBUTES(variant)); -+ -+ /* Require designated initializers */ -+ TYPE_ATTRIBUTES(variant) = -+ tree_cons(get_identifier("designated_init"), NULL_TREE, -+ TYPE_ATTRIBUTES(variant)); -+ } -+ -+ /* Relayout with the updated size */ -+ TYPE_SIZE(main_variant) = NULL_TREE; -+ TYPE_SIZE_UNIT(main_variant) = NULL_TREE; -+ layout_type(main_variant); -+} -+ -+bool type_is_struct(tree type) -+{ -+ if (type == NULL_TREE || type == error_mark_node) -+ return false; -+ -+ if (TREE_CODE(type) != RECORD_TYPE) -+ return false; -+ -+ if (TYPE_FIELDS(type) == NULL_TREE) -+ return false; -+ -+ return 1; -+} -+ -+bool lang_check(const char* plugin_name, const char* lang_name) { -+ if (strncmp(lang_name, "GNU C", 5)) { -+ inform(UNKNOWN_LOCATION, G_("%s supports C only, not %s"), -+ plugin_name, -+ lang_name); -+ return false; -+ } -+ -+ return true; -+} -+ -+/* -+ * Validate that the size of the struct with a flexible array -+ * is greater than the size of the basic struct definition, when declared -+ * as a constructor. -+ * -+ * As far as I can tell, this check shouldn't be necessary because -+ * the size of the flexible array is calculated when the declaration is -+ * parsed. But randomize_layout_plugin.c has some logic to reset the size -+ * of the flexible array struct at this point, and I can't figure out why. -+ * For now, just add a check and see if anything trips it. -+ */ -+void validate_decl_flex_size(void *event_data, void *data) -+{ -+ tree decl = (tree)event_data; -+ tree lastidx, field, init, type, flexsize; -+ unsigned HOST_WIDE_INT len; -+ size_t type_size; -+ size_t decl_size; -+ -+ if (decl == NULL_TREE || decl == error_mark_node) -+ return; -+ -+ type = TREE_TYPE(decl); -+ -+ if (TREE_CODE(decl) != VAR_DECL) -+ return; -+ -+ if (TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE) -+ return; -+ -+ if (!lookup_attribute(PADDING_ADDED_ATTR, TYPE_ATTRIBUTES(type))) -+ return; -+ -+ gcc_assert(DECL_SIZE_UNIT(decl)); -+ -+ init = DECL_INITIAL(decl); -+ if (init == NULL_TREE || init == error_mark_node) -+ return; -+ -+ if (TREE_CODE(init) != CONSTRUCTOR) -+ return; -+ -+ len = CONSTRUCTOR_NELTS(init); -+ if (!len) -+ return; -+ -+ lastidx = CONSTRUCTOR_ELT(init, CONSTRUCTOR_NELTS(init) - 1)->index; -+ -+ for (field = TYPE_FIELDS(type); TREE_CHAIN(field); -+ field = TREE_CHAIN(field)) -+ ; -+ -+ if (lastidx != field) -+ return; -+ -+ if (!is_flexible_array(field)) -+ return; -+ -+ decl_size = TREE_INT_CST_LOW(DECL_SIZE_UNIT(decl)); -+ type_size = TREE_INT_CST_LOW(TYPE_SIZE_UNIT(type)); -+ -+ if (decl_size <= type_size) -+ error("struct '%s': declaration size (%ld) for a struct with a " \ -+ "flexible array member must be > basic definition size (%ld)", -+ ORIG_TYPE_NAME(type), decl_size, type_size); -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/fips_canister_common.h b/scripts/gcc-plugins/fips_canister_plugins/fips_canister_common.h -new file mode 100644 -index 000000000..f51cc37e0 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/fips_canister_common.h -@@ -0,0 +1,23 @@ -+/* Copyright (C) 2025 Broadcom, Inc. */ -+ -+#include "../gcc-common.h" -+#include "constants.h" -+ -+#define ORIG_TYPE_NAME(node) \ -+ (TYPE_NAME(TYPE_MAIN_VARIANT(node)) != NULL_TREE ? ((const char *)IDENTIFIER_POINTER(TYPE_NAME(TYPE_MAIN_VARIANT(node)))) : (const char *) ANON_NAME) -+ -+bool is_flexible_array(const_tree field); -+tree create_padding_field(tree context, int pad_len); -+size_t get_type_size(tree type); -+size_t get_field_size(tree field); -+int get_field_type_str(tree field, char *type_str, int len); -+int insert_pad_field(tree type, tree pad_field); -+void relayout_canister_struct(tree type, const char* identifier); -+bool type_is_struct(tree type); -+const char* get_field_name(tree field); -+bool struct_in_pad_list(const char *name); -+unsigned int find_bad_casts_execute(void); -+void register_bad_casts_pass(const char* plugin_name); -+void validate_decl_flex_size(void *event_data, void *data); -+location_t get_type_location(tree type); -+bool lang_check(const char* plugin_name, const char* lang_name); -diff --git a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/dwarf_debuginfo_parser.c b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/dwarf_debuginfo_parser.c -new file mode 100644 -index 000000000..79bb93302 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/dwarf_debuginfo_parser.c -@@ -0,0 +1,267 @@ -+/* -+ * Parse DWARF debuginfo from canister binary and extract structure information. -+ * Structure information can be returned via an API call -+ * -+ * Copyright (C) 2025 Broadcom, Inc. -+ */ -+#include -+#include -+#include -+#include -+#include -+ -+#include "hash_table.h" -+#include "structure_db.h" -+#include "../constants.h" -+ -+#define CANISTER_LOC "crypto/fips_canister.o" -+ -+static struct conf_fprintf conf = { -+ .emit_stats = 1, -+}; -+ -+struct struct_def_entry { -+ struct struct_def *s_def; -+ struct list_head l_entry; -+}; -+ -+static struct list_head struct_list_head; -+ -+static int returncode = 0; -+static int nr_structs; -+ -+static void get_base_type_name(struct class_member *cls_member, struct cu *cu, -+ char *buffer, int buf_len) -+{ -+ char tmp_buf[64]; -+ const char *tag_name; -+ struct tag *member_type = cu__type(cu, cls_member->tag.type); -+ struct base_type *bt = tag__base_type(member_type); -+ -+ tag_name = tag__name(member_type, cu, tmp_buf, sizeof(tmp_buf), &conf); -+ -+ if (tag_name) -+ strncpy(buffer, tag_name, buf_len); -+ else -+ strncpy(buffer, UNKWN_TYPE, buf_len); -+} -+ -+static int parse_struct_member_tag(struct tag *tag, -+ struct cu *cu, -+ struct struct_member *new_member) -+{ -+ struct class_member *cls_member; -+ char *tag_name; -+ struct base_type *base_type; -+ struct type *type; -+ struct tag *tag_pos; -+ -+ cls_member = tag__class_member(tag); -+ -+ if (cls_member->name) -+ strncpy(new_member->name, cls_member->name, -+ sizeof(new_member->name) - 1); -+ else -+ strncpy(new_member->name, ANON_NAME, -+ sizeof(new_member->name) - 1); -+ -+ new_member->byte_size = cls_member->byte_size; -+ new_member->byte_offset = cls_member->byte_offset; -+ get_base_type_name(cls_member, cu, new_member->type_name, -+ sizeof(new_member->type_name) - 1); -+ -+ return 0; -+} -+ -+/* If tag is a struct, parse it. Based off of __class__fprintf() */ -+static struct struct_def *parse_tag(struct tag *tag, struct cu *cu) -+{ -+ struct class *class; -+ struct type *type; -+ char name[64]; -+ struct struct_def *new_struct; -+ struct struct_member *s_member; -+ struct tag *tag_pos; -+ const char *type_name; -+ int i; -+ size_t new_struct_sz; -+ -+ if (!tag__is_struct(tag)) -+ return NULL; -+ -+ class = tag__class(tag); -+ type = &class->type; -+ type_name = type__name(type); -+ -+ /* Don't bother with anonymous structures */ -+ if (!type_name) -+ return NULL; -+ -+ new_struct_sz = sizeof(struct struct_def) + -+ (type->nr_members * sizeof(struct struct_member)); -+ new_struct = calloc(1, new_struct_sz); -+ if (!new_struct) { -+ perror("Failed to allocate memory for new struct!"); -+ return NULL; -+ } -+ -+ strncpy(new_struct->name, type_name, sizeof(new_struct->name) - 1); -+ new_struct->byte_size = type->size; -+ new_struct->nr_members = type->nr_members; -+ new_struct->__sz = new_struct_sz; -+ -+ /* -+ * Get the struct members. -+ * According to DWARF format, the members of the struct should be -+ * separate tags under the parent struct tag. -+ * This loops through all the child tags for the struct. -+ */ -+ i = 0; -+ type__for_each_tag(type, tag_pos) -+ { -+ if (parse_struct_member_tag(tag_pos, cu, &new_struct->members[i]) < 0) { -+ fprintf(stderr, -+ "struct %s: Failed to parse tag for struct member\n", -+ new_struct->name); -+ free(new_struct); -+ return NULL; -+ } -+ -+ i++; -+ } -+ -+ /* -+ * Debuginfo can contain some structs with no member info. Don't add -+ * these to the DB. -+ */ -+ if(i == 0) { -+ free(new_struct); -+ return NULL; -+ } -+ -+ return new_struct; -+} -+ -+ -+ -+static void free_struct_def_list(void) { -+ struct struct_def_entry *pos, *tmp; -+ list_for_each_entry_safe(pos, tmp, &struct_list_head, l_entry) { -+ list_del(&pos->l_entry); -+ free(pos); -+ } -+} -+ -+static int cu__parse_structs(struct cu *cu) -+{ -+ int i; -+ struct tag *tag; -+ struct class *class; -+ const char *type_name; -+ struct struct_def_entry *pos, *new_entry; -+ bool unique; -+ struct struct_def *def; -+ -+ cu__for_each_type(cu, i, tag) { -+ def = parse_tag(tag, cu); -+ if(!def) -+ continue; -+ -+ unique = true; -+ list_for_each_entry(pos, &struct_list_head, l_entry) { -+ if(!strcmp(pos->s_def->name, def->name)) { -+ unique = false; -+ break; -+ } -+ } -+ -+ if(!unique) -+ continue; -+ -+ new_entry = calloc(1, sizeof(struct struct_def_entry)); -+ if(!new_entry) { -+ perror("Failed to allocate memory for tag list entry"); -+ returncode = -1; -+ return -1; -+ } -+ -+ new_entry->s_def = def; -+ list_add_tail(&new_entry->l_entry, &struct_list_head); -+ nr_structs++; -+ } -+ -+ return 0; -+} -+ -+static enum load_steal_kind -+dwarf_struct_parser(struct cu *cu, struct conf_load *conf_load __maybe_unused, -+ void *thr_data __maybe_unused) -+{ -+ if (cu__parse_structs(cu) < 0) -+ return LSK__STOP_LOADING; -+ -+ return LSK__DELETE; -+} -+ -+struct conf_load dwarf_conf_parser = { -+ .steal = dwarf_struct_parser, -+ .conf_fprintf = &conf, -+}; -+ -+/* -+ * API call to initialize the database with the structure info. -+ */ -+int init_db_from_canister(void) -+{ -+ struct cus *cus = NULL; -+ int ret = 0; -+ struct struct_def_entry *pos; -+ -+ if(get_cached_db() == 0) -+ return 0; -+ -+ cus = cus__new(); -+ -+ if (dwarves__init() || cus == NULL) { -+ fprintf(stderr, "dwarf_debuginfo_parser: insufficient memory, " -+ "can't parse canister debuginfo\n"); -+ return -1; -+ } -+ -+ /* -+ * Pass in 0 to read cacheline size from the build machine. -+ * Assuming not cross-compiling, this should be accurate. -+ * Most of the time, it will be 64 bytes anyways. -+ */ -+ dwarves__resolve_cacheline_size(&dwarf_conf_parser, 0); -+ -+ INIT_LIST_HEAD(&struct_list_head); -+ -+ ret = cus__load_file(cus, &dwarf_conf_parser, CANISTER_LOC); -+ if(ret < 0 || returncode < 0) -+ goto exit; -+ -+ ret = init_struct_db(nr_structs); -+ if(ret < 0) -+ goto exit; -+ -+ list_for_each_entry(pos, &struct_list_head, l_entry) -+ add_struct_def(pos->s_def); -+ -+exit: -+ free_struct_def_list(); -+ cus__delete(cus); -+ dwarves__exit(); -+ -+ if(ret < 0) -+ fprintf(stderr, -+ "Failed to read debuginfo from " CANISTER_LOC " : %s\n", -+ errno ? strerror(errno) : "No debugging information found"); -+ -+ if (ret < 0 || returncode < 0) { -+ free_structure_db(); -+ return -1; -+ } -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/hash_table.c b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/hash_table.c -new file mode 100644 -index 000000000..8eea90a8b ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/hash_table.c -@@ -0,0 +1,125 @@ -+/* -+ * Basic hash table implementation for storing structure definitions -+ * -+ * Copyright (C) 2025 Broadcom, Inc. -+ */ -+ -+#include "hash_table.h" -+#include -+#include -+#include -+#include -+ -+#define FNV_OFFSET 14695981039346656037UL -+#define FNV_PRIME 1099511628211UL -+ -+/* -+ * https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function -+ * This is simple to implement, but there may be faster hash functions -+ * out there -+ */ -+static long unsigned int hash_string(const char *str, int len) -+{ -+ long unsigned int hash = FNV_OFFSET; -+ for (int i = 0; i < len; i++) { -+ hash = hash * FNV_PRIME; -+ hash = hash ^ str[i]; -+ } -+ -+ return hash; -+} -+ -+struct hash_table *alloc_hash_table(int num_entries) -+{ -+ struct hash_table *table; -+ struct hash_table_entry *entries; -+ -+ if(num_entries <= 0) { -+ fprintf(stderr, -+ "Can't allocate hash table with %d entries!\n", -+ num_entries); -+ return NULL; -+ } -+ -+ /* Much better performance with some empty spaces */ -+ num_entries = num_entries * 2; -+ -+ table = calloc(1, sizeof(struct hash_table) + -+ (num_entries * sizeof(struct hash_table_entry))); -+ if (!table) { -+ perror("Failed to allocate memory for hash table"); -+ return NULL; -+ } -+ -+ table->num_entries = num_entries; -+ -+ return table; -+} -+ -+int hash_table_insert(struct hash_table *htable, void *entry, const char *key, -+ int key_len) -+{ -+ unsigned index, start_index; -+ struct hash_table_entry *htable_entry; -+ -+ index = hash_string(key, key_len) % htable->num_entries; -+ -+ start_index = index; -+ while(!entry_is_empty(&htable->entries[index])) { -+ if (index >= htable->num_entries - 1) -+ index = 0; -+ else -+ index++; -+ -+ if(index == start_index) { -+ fprintf(stderr, -+ "No space remaining in hash table! No open entry slots!\n"); -+ return -1; -+ } -+ } -+ -+ htable_entry = &htable->entries[index]; -+ strncpy(htable_entry->key, key, sizeof(htable_entry->key) - 1); -+ htable_entry->entry = entry; -+ -+ return 0; -+} -+ -+struct hash_table_entry *hash_table_get(struct hash_table *htable, -+ const char *key, int key_len) -+{ -+ int index, start_index; -+ struct hash_table_entry *htable_entry; -+ -+ index = hash_string(key, key_len) % htable->num_entries; -+ start_index = index; -+ -+ do { -+ htable_entry = &htable->entries[index]; -+ if (!strcmp(key, htable_entry->key)) -+ return htable_entry; -+ -+ if (index >= htable->num_entries - 1) -+ index = 0; -+ else -+ index++; -+ -+ } while (index != start_index); -+ -+ return NULL; -+} -+ -+void hash_table_free(struct hash_table *hash_table, void (*free_entry)(void *)) -+{ -+ if (!hash_table) -+ return; -+ -+ for(int i = 0; i < hash_table->num_entries; i++) { -+ if(entry_is_empty(&hash_table->entries[i])) -+ return; -+ -+ free_entry(hash_table->entries[i].entry); -+ } -+ -+ free(hash_table); -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/hash_table.h b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/hash_table.h -new file mode 100644 -index 000000000..3acc4aa56 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/hash_table.h -@@ -0,0 +1,28 @@ -+/* Copyright (C) 2025 Broadcom, Inc. */ -+#include -+ -+struct hash_table_entry { -+ char key[64]; -+ union { -+ void* entry; -+ size_t cache_ptr; -+ }; -+}; -+ -+struct hash_table { -+ int num_entries; -+ struct hash_table_entry entries[]; -+}; -+ -+static inline int entry_is_empty(struct hash_table_entry *htable_entry) { -+ return htable_entry->key[0] == '\0' && htable_entry->entry == 0; -+} -+ -+struct hash_table *init_hash_table(int num_entries, -+ void (*free_entry)(void *entry)); -+int hash_table_insert(struct hash_table *htable, void *entry, const char *key, -+ int key_len); -+struct hash_table_entry *hash_table_get(struct hash_table *htable, const char *key, -+ int key_len); -+struct hash_table *alloc_hash_table(int num_entries); -+void hash_table_free(struct hash_table *hash_table, void (*free_entry)(void *)); -diff --git a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/match_canister_structs.c b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/match_canister_structs.c -new file mode 100644 -index 000000000..c333f04d6 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/match_canister_structs.c -@@ -0,0 +1,420 @@ -+/* -+ * Using debuginfo from the canister binary, modify kernel structs to match -+ * canister structs. -+ * -+ * Copyright (C) 2025 Broadcom, Inc. -+ */ -+ -+#include "../../gcc-common.h" -+#include "structure_db.h" -+#include "../fips_canister_common.h" -+#include "../constants.h" -+ -+__visible int plugin_is_GPL_compatible; -+ -+static tree get_field_by_name(tree type, char *name) -+{ -+ tree field; -+ const char *field_name; -+ -+ for (field = TYPE_FIELDS(type); field; field = TREE_CHAIN(field)) { -+ field_name = get_field_name(field); -+ if (!strcmp(field_name, name)) -+ return field; -+ } -+ -+ return NULL_TREE; -+} -+ -+static size_t calculate_struct_size(tree type) -+{ -+ size_t cur_offset = 0; -+ size_t total_size; -+ size_t last_fld_size = 0, field_alignment = 0; -+ tree field; -+ -+ for (field = TYPE_FIELDS(type); field; field = TREE_CHAIN(field)) { -+ field_alignment = DECL_ALIGN_UNIT(field); -+ if (!field_alignment) -+ field_alignment = 1; -+ -+ cur_offset += last_fld_size; -+ -+ /* Account for aligning offset on X byte boundary */ -+ if (cur_offset && (cur_offset % field_alignment)) -+ cur_offset = cur_offset - -+ (cur_offset % field_alignment) + -+ field_alignment; -+ -+ last_fld_size = get_field_size(field); -+ } -+ -+ return cur_offset + last_fld_size; -+} -+ -+/* Validate offset of each field matches between kernel and canister */ -+static int validate_offsets(tree type, struct struct_def *canister_def) -+{ -+ size_t cur_offset = 0; -+ size_t total_size; -+ size_t last_fld_size = 0, field_alignment = 0; -+ struct struct_member *member; -+ tree field; -+ const char *field_name; -+ int padding_remaining = 0; -+ int i = 0; -+ -+ for (member = first_member(canister_def), field = TYPE_FIELDS(type); -+ field && i < canister_def->nr_members; -+ field = TREE_CHAIN(field), member = &canister_def->members[++i]) { -+ -+ field_alignment = DECL_ALIGN_UNIT(field); -+ if (!field_alignment) -+ field_alignment = 1; -+ -+ field_name = get_field_name(field); -+ -+ cur_offset += last_fld_size; -+ -+ if (cur_offset && (cur_offset % field_alignment)) -+ cur_offset = cur_offset - -+ (cur_offset % field_alignment) + -+ field_alignment; -+ -+ last_fld_size = get_field_size(field); -+ -+ if (!member) -+ continue; -+ -+ if (!strcmp(member->name, field_name) && -+ cur_offset != (size_t)member->byte_offset) { -+ error("struct '%s': field '%s', kernel offset %ld != canister offset %d\n", -+ canister_def->name, field_name, cur_offset, -+ member->byte_offset); -+ return -1; -+ } -+ -+ } -+ -+ return 0; -+} -+ -+/* Match field order between kernel and canister. Moves any new fields to end of the struct */ -+static int order_fields(struct struct_def *canister_struct_def, tree type, -+ tree *new_field_order, int num_fields) -+{ -+ size_t field_size; -+ struct struct_member *member; -+ tree field, flexible_array = NULL_TREE; -+ tree divergence_point = NULL_TREE; -+ int nr_anon = 0; -+ const char *field_name; -+ int nf_index = 0; -+ char field_type[64]; -+ -+ if (!first_member(canister_struct_def)) { -+ error("struct '%s': Found no members in canister version", -+ canister_struct_def->name); -+ return -1; -+ } -+ -+ /* -+ * Simultaneously walk both canister and kernel struct fields/members. -+ * If we encounter a difference, where the canister/kernel members at -+ * a given index don't match, mark the divergence point and continue -+ * parsing all the canister members. -+ */ -+ field = TYPE_FIELDS(type); -+ for_all_members(canister_struct_def, member) { -+ if (!strcmp(member->name, PAD_FIELD_NAME)) -+ continue; -+ -+retry_divergence: -+ if (divergence_point) -+ field = get_field_by_name(type, member->name); -+ -+ /* -+ * Removal of struct member in the kernel can cause incompatibility -+ * issues with the canister, if canister code is attempting to -+ * access data at some member/memory offset which the kernel -+ * doesn't set. -+ */ -+ if (!field) { -+ error("struct %s: found canister member '%s' which is not " -+ "present in kernel", -+ canister_struct_def->name, member->name); -+ return -1; -+ } -+ -+ field_name = get_field_name(field); -+ field_size = get_field_size(field); -+ get_field_type_str(field, field_type, sizeof(field_type)); -+ -+ if (strcmp(field_name, member->name)) { -+ divergence_point = field; -+ goto retry_divergence; -+ } -+ -+ if (!strcmp(member->name, ANON_NAME)) -+ nr_anon++; -+ -+ gcc_assert(nf_index < num_fields); -+ if (is_flexible_array(field)) -+ new_field_order[num_fields - 1] = field; -+ else -+ new_field_order[nf_index++] = field; -+ -+ // TODO: Future development can also add a type check here. -+ -+ if (field_size != member->byte_size) { -+ inform(DECL_SOURCE_LOCATION(field), -+ "struct '%s': field '%s' size mismatch: " -+ "kernel: (%s) %ld != canister: (%s) %ld\n", -+ canister_struct_def->name, member->name, -+ field_type, field_size, member->type_name, -+ member->byte_size); -+ } -+ -+ field = TREE_CHAIN(field); -+ } -+ -+ /* -+ * Iterate all kernel fields starting from the divergence point. -+ * This ensures we won't miss any kernel fields, but don't have to start -+ * over from the very beginning. Usually, the kernel/canister will -+ * maintain the same order, but in some cases this is necessary. See -+ * crypto_kpp from 6.1 to 6.12 for an example. -+ */ -+ if (divergence_point) -+ field = divergence_point; -+ -+ /* Add any new fields which are not present in the canister version */ -+ while (field && nf_index < num_fields) { -+ field_name = get_field_name(field); -+ if (!strcmp(field_name, ANON_NAME)) -+ nr_anon++; -+ -+ member = get_member_by_name(canister_struct_def, field_name); -+ if (!member) -+ new_field_order[nf_index++] = field; -+ -+ if (is_flexible_array(field) && TREE_CHAIN(field) != NULL_TREE) -+ error("struct '%s': flexible array member must be final member", -+ canister_struct_def->name); -+ -+ field = TREE_CHAIN(field); -+ } -+ -+ if (nr_anon > 1 && divergence_point) { -+ error("struct '%s': Can't handle more than one anonymous member" -+ "when struct has been reordered between kernel/canister", -+ canister_struct_def->name); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+static int pad_struct(struct struct_def *canister_struct_def, tree type, -+ int kernel_size) -+{ -+ size_t padding_size; -+ tree pad_field = NULL_TREE; -+ -+ padding_size = canister_struct_def->byte_size - kernel_size; -+ if ((int)padding_size > 0) -+ pad_field = create_padding_field(type, padding_size); -+ -+ return insert_pad_field(type, pad_field); -+} -+ -+static bool needs_matching(tree type, struct struct_def *canister_def) -+{ -+ struct struct_member *member; -+ const char *field_name; -+ size_t field_size; -+ tree field; -+ int i = 0; -+ -+ if(get_type_size(type) != canister_def->byte_size) -+ return true; -+ -+ for (member = first_member(canister_def), field = TYPE_FIELDS(type); -+ field && i < canister_def->nr_members; -+ field = TREE_CHAIN(field), member = &canister_def->members[++i]) { -+ -+ field_name = get_field_name(field); -+ field_size = get_field_size(field); -+ -+ /* Needs processing if fields/field order differs, or size/type has changed */ -+ if (strcmp(field_name, member->name) || -+ field_size != member->byte_size) -+ return true; -+ } -+ -+ if (!strcmp(member->name, PAD_FIELD_NAME)) -+ return true; -+ -+ if (field || i < canister_def->nr_members) -+ return true; -+ -+ return false; -+} -+ -+/* Match kernel structures to canister structures */ -+static void match_struct(tree type) -+{ -+ tree *new_field_order; -+ int num_fields = 0; -+ struct struct_def *canister_struct_def; -+ const char *type_name; -+ size_t struct_size; -+ -+ type_name = ORIG_TYPE_NAME(type); -+ if (!type_name || !strcmp(type_name, ANON_NAME)) -+ return; -+ -+ /* -+ * hmac_ctx is a weird case. Defined differently in two separate places, -+ * one inside the canister/kernel crypto/ and another inside the chelsio -+ * driver. -+ * -+ * We can't validate the chelsio version against the the canister, because -+ * it is intentionally different by design. Probably in the future, it -+ * would make sense to sync the two definitions so that we can run the -+ * compatibility checks in this plugin. But for now, skip it entirely. -+ */ -+ if(!strcmp(type_name, "hmac_ctx")) -+ return; -+ -+ /* Calculate alignments and sizes for all fields */ -+ layout_type(type); -+ -+ canister_struct_def = get_struct_def_by_name(type_name, strlen(type_name)); -+ if (!canister_struct_def) { -+ if (struct_in_pad_list(type_name)) -+ error("struct '%s': in padding list but not found in canister debuginfo", -+ type_name); -+ return; -+ } -+ -+ if (!needs_matching(type, canister_struct_def)) -+ return; -+ -+ if (!struct_in_pad_list(type_name)) -+ inform(get_type_location(type), -+ "struct '%s': mismatch between kernel/canister versions, " -+ "but not in padding list\n", -+ type_name); -+ -+ /* First pass - count fields. */ -+ for (tree field = TYPE_FIELDS(type); field; field = TREE_CHAIN(field)) -+ num_fields++; -+ -+ /* Note: Can't use m/calloc in GCC */ -+ new_field_order = (tree *) xcalloc(sizeof(tree), num_fields); -+ if (!new_field_order) { -+ perror("Couldn't allocate memory for new field order array!"); -+ return; -+ } -+ -+ /* Second pass - order the fields according to canister definition */ -+ if (order_fields(canister_struct_def, type, new_field_order, -+ num_fields) < 0) -+ goto err_exit; -+ -+ /* Link fields according to the new order */ -+ for (int i = 0; i < num_fields - 1; i++) -+ TREE_CHAIN(new_field_order[i]) = new_field_order[i + 1]; -+ TREE_CHAIN(new_field_order[num_fields - 1]) = NULL_TREE; -+ -+ TYPE_FIELDS(type) = new_field_order[0]; -+ -+ struct_size = calculate_struct_size(type); -+ if ((int)struct_size < 0) -+ goto err_exit; -+ -+ /* Insert padding to match canister size, if necessary */ -+ if (pad_struct(canister_struct_def, type, struct_size) < 0) -+ goto err_exit; -+ -+ /* Relayout the modified structure */ -+ relayout_canister_struct(type, CANISTER_MATCHED_ATTR); -+ -+ /* Validate that offsets for each field are matching between kernel and canister */ -+ if (validate_offsets(type, canister_struct_def) < 0) -+ goto err_exit; -+ -+ /* Enforce structure size matching */ -+ struct_size = get_type_size(TYPE_MAIN_VARIANT(type)); -+ if (struct_size != canister_struct_def->byte_size) { -+ error("struct '%s': kernel size %ld != canister size %ld\n", -+ canister_struct_def->name, struct_size, -+ canister_struct_def->byte_size); -+ goto err_exit; -+ } -+ -+err_exit: -+ free(new_field_order); -+} -+ -+static void before_struct_layout(void *event_data, void *data) -+{ -+ tree type = (tree) event_data; -+ -+ if (lookup_attribute(CANISTER_MATCHED_ATTR, TYPE_ATTRIBUTES(type))) -+ return; -+ -+ if (!type_is_struct(type)) -+ return; -+ -+ match_struct(type); -+} -+ -+static tree handle_canister_matched_attr(tree *node, tree name, tree args, -+ int flags, bool *no_add_attrs) -+{ -+ *no_add_attrs = false; -+ return NULL_TREE; -+} -+ -+static struct attribute_spec canister_matched_attr = {}; -+ -+static void register_attributes(void *event_data, void *data) -+{ -+ canister_matched_attr.name = CANISTER_MATCHED_ATTR; -+ canister_matched_attr.type_required = true; -+ canister_matched_attr.handler = handle_canister_matched_attr; -+ canister_matched_attr.affects_type_identity = true; -+ -+ register_attribute(&canister_matched_attr); -+} -+ -+static void destroy_canister_struct_db(void *event_data, void *data) -+{ -+ cache_structure_db(); -+ free_structure_db(); -+} -+ -+int plugin_init(struct plugin_name_args *plugin_info, -+ struct plugin_gcc_version *version) -+{ -+ if(!lang_check(plugin_info->base_name, lang_hooks.name)) -+ return -1; -+ -+ if (init_db_from_canister() < 0) -+ return -1; -+ -+ register_callback(plugin_info->base_name, PLUGIN_BEFORE_STRUCT_LAYOUT, -+ before_struct_layout, NULL); -+ register_callback(plugin_info->base_name, PLUGIN_ATTRIBUTES, -+ register_attributes, NULL); -+ register_callback(plugin_info->base_name, PLUGIN_FINISH, -+ destroy_canister_struct_db, NULL); -+ register_callback(plugin_info->base_name, PLUGIN_FINISH_DECL, -+ validate_decl_flex_size, NULL); -+ register_bad_casts_pass(plugin_info->base_name); -+ -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/structure_db.c b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/structure_db.c -new file mode 100644 -index 000000000..95e88686a ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/structure_db.c -@@ -0,0 +1,231 @@ -+/* -+ * API for structure database -+ * -+ * Copyright (C) 2025 Broadcom, Inc. -+ */ -+ -+#include "hash_table.h" -+#include "structure_db.h" -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define CACHE_LOC "scripts/gcc-plugins/canister_structures.db" -+ -+/* Simpler to keep the DB reference here. */ -+static struct struct_db { -+ bool cached; -+ struct hash_table *htable; -+ unsigned char *cache; -+ size_t cache_sz; -+} struct_table = {0}; -+ -+struct struct_def *get_struct_def_by_name(const char *name, int name_len) -+{ -+ struct hash_table_entry *entry; -+ -+ entry = hash_table_get(struct_table.htable, name, name_len); -+ -+ if(!entry) -+ return NULL; -+ -+ if(struct_table.cached) { -+ return (struct struct_def *) (struct_table.cache + entry->cache_ptr); -+ } -+ -+ return (struct struct_def *) entry->entry; -+} -+ -+struct struct_member *get_member_by_name(struct struct_def *def, -+ const char *name) -+{ -+ struct struct_member *member; -+ -+ if (!name) -+ return NULL; -+ -+ for_all_members(def, member) { -+ if (!strcmp(name, member->name)) -+ return member; -+ } -+ -+ return NULL; -+} -+ -+static void free_struct_def(void *def) -+{ -+ if (!def) -+ return; -+ -+ free(def); -+} -+ -+int add_struct_def(struct struct_def *new_struct) -+{ -+ int ret; -+ -+ ret = hash_table_insert(struct_table.htable, (void *)new_struct, -+ new_struct->name, strlen(new_struct->name)); -+ if (ret < 0) -+ fprintf(stderr, -+ "Failed to insert new entry for %s into " -+ "structure definition hash table\n", -+ new_struct->name); -+ -+ return ret; -+} -+ -+int get_cached_db(void) -+{ -+ int fd; -+ unsigned char *mem_block; -+ struct stat cache_stat; -+ -+ fd = open(CACHE_LOC, O_RDONLY); -+ if(fd < 0) { -+ fprintf(stderr, "Cache not yet present at: %s\n", CACHE_LOC); -+ return -1; -+ } -+ -+ if(fstat(fd, &cache_stat) < 0) { -+ close(fd); -+ return -1; -+ } -+ -+ mem_block = mmap(NULL, cache_stat.st_size, PROT_READ, MAP_SHARED, fd, 0); -+ close(fd); -+ -+ if(mem_block == MAP_FAILED) { -+ perror("Cache present but failed to load"); -+ return -1; -+ } -+ -+ struct_table.cached = true; -+ struct_table.htable = (struct hash_table*) mem_block; -+ struct_table.cache = mem_block; -+ struct_table.cache_sz = cache_stat.st_size; -+ -+ return 0; -+} -+ -+int init_struct_db(int nr_structs) -+{ -+ struct_table.htable = alloc_hash_table(nr_structs); -+ if (!struct_table.htable) { -+ fprintf(stderr, "Failed to allocate memory for the structure " -+ "definition hash table\n"); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+void free_structure_db(void) -+{ -+ if(struct_table.cached) { -+ if(munmap(struct_table.cache, struct_table.cache_sz) < 0) -+ perror("Failed to unmap cached structure db"); -+ } -+ else -+ hash_table_free(struct_table.htable, free_struct_def); -+} -+ -+/* -+ * Convert the initial hash table and all structure defintions into a memory -+ * block which can be stored as a cache and mapped directly in to other plugin -+ * invocations. -+ * -+ * The cache is organized in two sections: -+ * Section 1: Hash table -+ * Section 2: Generic memory block, used to store the structure -+ * definitions. -+ * -+ * We can use the same hash table, but for cache purposes we can convert the -+ * normal "hash_table_entry->entry" pointer to instead be an offset from the -+ * beginning of the cache. -+ */ -+int cache_structure_db(void) -+{ -+ FILE *cache; -+ size_t ret; -+ unsigned char *mem_block; -+ size_t cur_ptr = 0; -+ size_t table_sz = 0, heap_sz = 0; -+ struct struct_def *def; -+ struct hash_table *cached_table; -+ -+ if(struct_table.cached) -+ return 0; -+ -+ /* Measure size needed for memory block */ -+ table_sz = sizeof(struct hash_table) + -+ (struct_table.htable->num_entries * sizeof(struct hash_table_entry)); -+ -+ for(int i = 0; i < struct_table.htable->num_entries; i++) { -+ if(entry_is_empty(&struct_table.htable->entries[i])) -+ continue; -+ -+ def = (struct struct_def *) struct_table.htable->entries[i].entry; -+ heap_sz += def->__sz; -+ } -+ -+ /* Allocate new memory block */ -+ mem_block = calloc(1, table_sz + heap_sz); -+ if(!mem_block) { -+ perror("Failed to allocate memory block for cache"); -+ return -1; -+ } -+ -+ /* Populate new memory block */ -+ /* Copy hash table into the first bytes */ -+ memcpy(mem_block, struct_table.htable, table_sz); -+ cur_ptr += table_sz; -+ -+ cached_table = (struct hash_table *) mem_block; -+ -+ /* -+ * For each structure definition entry, copy into the "heap" space and -+ * save the ptr as the offset to the beginning of the memory block -+ */ -+ for(int i = 0; i < struct_table.htable->num_entries; i++) { -+ def = (struct struct_def *) struct_table.htable->entries[i].entry; -+ if(!def) -+ continue; -+ -+ cached_table->entries[i].cache_ptr = cur_ptr; -+ memcpy(mem_block + cur_ptr, def, def->__sz); -+ cur_ptr += def->__sz; -+ } -+ -+ if(cur_ptr > table_sz + heap_sz) { -+ fprintf(stderr, "Memory error: Cache overflow\n"); -+ ret = -1; -+ goto finish; -+ } -+ -+ cache = fopen(CACHE_LOC, "wb"); -+ if(!cache) { -+ perror("Failed to open cache location"); -+ ret = -1; -+ goto finish; -+ } -+ -+ ret = fwrite(mem_block, table_sz + heap_sz, 1, cache); -+ if(ret <= 0) { -+ perror("Failed to write structure DB to cache"); -+ ret = -1; -+ } -+ -+ fclose(cache); -+finish: -+ free(mem_block); -+ -+ return (int) ret; -+} -+ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/structure_db.h b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/structure_db.h -new file mode 100644 -index 000000000..f6021ba94 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/match_canister_structs/structure_db.h -@@ -0,0 +1,46 @@ -+/* Copyright (C) 2025 Broadcom, Inc. */ -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+/* Structure member definition */ -+struct struct_member { -+ char name[64]; -+ /* Type, e.g int, char, enum, etc */ -+ char type_name[64]; -+ size_t byte_size; -+ int byte_offset; -+}; -+ -+/* Structure definition */ -+struct struct_def { -+ char name[64]; -+ size_t byte_size; -+ int nr_members; -+ /* Internal total size of the struct, including all struct members */ -+ size_t __sz; -+ struct struct_member members[]; -+}; -+ -+#define first_member(_def) &_def->members[0] -+ -+#define for_all_members(_def, _mbr) \ -+ int _i = 0; \ -+ for (_mbr = first_member(_def); _i < _def->nr_members; _mbr = &_def->members[++_i]) \ -+ -+ -+int init_db_from_canister(void); -+void free_structure_db(void); -+struct struct_def *get_struct_def_by_name(const char *name, int name_len); -+struct struct_member *get_first_member(struct struct_def *def); -+struct struct_member *get_member_by_name(struct struct_def *def, const char *name); -+int add_struct_def(struct struct_def *new_struct); -+struct struct_def *get_struct_def_by_name(const char *name, int name_len); -+int init_struct_db(int nr_structs); -+int cache_structure_db(void); -+int get_cached_db(void); -+ -+#if defined(__cplusplus) -+} -+#endif -diff --git a/scripts/gcc-plugins/fips_canister_plugins/pad_canister_structs/pad_canister_structs.c b/scripts/gcc-plugins/fips_canister_plugins/pad_canister_structs/pad_canister_structs.c -new file mode 100644 -index 000000000..275fd894a ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/pad_canister_structs/pad_canister_structs.c -@@ -0,0 +1,69 @@ -+/* -+ * Pad all canister structures with X bytes -+ * -+ * Copyright (C) 2025 Broadcom, Inc. -+ */ -+ -+#include "gcc-common.h" -+#include "../fips_canister_common.h" -+#include "../constants.h" -+ -+__visible int plugin_is_GPL_compatible; -+ -+static void pad_struct(tree type, int pad_len) { -+ tree pad_field; -+ -+ if(!struct_in_pad_list(ORIG_TYPE_NAME(type))) -+ return; -+ -+ pad_field = create_padding_field(type, pad_len); -+ -+ if(insert_pad_field(type, pad_field) < 0) -+ return; -+ -+ relayout_canister_struct(type, PADDING_ADDED_ATTR); -+} -+ -+static void before_struct_layout(void *event_data, void *data) { -+ tree type = (tree) event_data; -+ -+ if (lookup_attribute(PADDING_ADDED_ATTR, TYPE_ATTRIBUTES(type))) -+ return; -+ -+ if(!type_is_struct(type)) -+ return; -+ -+ pad_struct(type, 8); -+} -+ -+static tree handle_padding_added_attr(tree *node, tree name, tree args, int flags, bool *no_add_attrs) -+{ -+ *no_add_attrs = false; -+ return NULL_TREE; -+} -+ -+static struct attribute_spec padding_added_attr = { }; -+ -+static void register_attributes(void *event_data, void *data) -+{ -+ padding_added_attr.name = PADDING_ADDED_ATTR; -+ padding_added_attr.type_required = true; -+ padding_added_attr.handler = handle_padding_added_attr; -+ padding_added_attr.affects_type_identity = true; -+ -+ register_attribute(&padding_added_attr); -+} -+ -+int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gcc_version *version) -+{ -+ -+ if(!lang_check(plugin_info->base_name, lang_hooks.name)) -+ return 0; -+ -+ register_callback(plugin_info->base_name, PLUGIN_BEFORE_STRUCT_LAYOUT, before_struct_layout, NULL); -+ register_callback(plugin_info->base_name, PLUGIN_ATTRIBUTES, register_attributes, NULL); -+ register_callback(plugin_info->base_name, PLUGIN_FINISH_DECL, validate_decl_flex_size, NULL); -+ register_bad_casts_pass(plugin_info->base_name); -+ -+ return 0; -+} --- -2.40.4 - diff --git a/SPECS/91/linux/fips_canister_plugins/0004-FIPS-Canister-Plugins-Add-self-tests.patch b/SPECS/91/linux/fips_canister_plugins/0004-FIPS-Canister-Plugins-Add-self-tests.patch deleted file mode 100644 index 11241e4923..0000000000 --- a/SPECS/91/linux/fips_canister_plugins/0004-FIPS-Canister-Plugins-Add-self-tests.patch +++ /dev/null @@ -1,1579 +0,0 @@ -From 0c41d7a1638466d60ca55cdab828d8f35564c8b0 Mon Sep 17 00:00:00 2001 -From: Brennan Lamoreaux -Date: Fri, 18 Jul 2025 17:48:37 +0000 -Subject: [PATCH 4/4] FIPS Canister Plugins: Add self tests - -Self tests for FIPS canister GCC plugins. - -Under pad_canister_structs/match_canister_structs, -run ./self-test.sh. Or, from the main self-test directory, -run ./run_tests.sh. - -Common functions are in self-test-lib.sh. - -Mostly validates GCC/pahole output against -expected output. - -When changing ANY code in either FIPS canister -plugin, please run this test suite, and add any -new test cases which are needed. - -Note: In order to run self tests, you must first -edit CANISTER_LOC in dwarf_debuginfo_parser.c -(for match_canister_struct) to be the absolute path -to the FIPS canister .o file. (and rebuild the plugin). - -Signed-off-by: Brennan Lamoreaux ---- - .../match_canister/add-multiple-new-fields.c | 36 +++ - .../add-multiple-new-fields.expected | 28 +++ - .../self_tests/match_canister/add-new-field.c | 30 +++ - .../match_canister/add-new-field.expected | 26 ++ - .../match_canister/add-too-many-fields.c | 27 ++ - .../add-too-many-fields.expected | 4 + - .../self_tests/match_canister/bad-cast.c | 13 + - .../match_canister/bad-cast.expected | 8 + - .../match_canister/bad-cast.gcc.expected | 5 + - .../match_canister/designated-init.c | 12 + - .../match_canister/designated-init.expected | 12 + - .../match_canister/field-size-change.c | 20 ++ - .../match_canister/field-size-change.expected | 12 + - .../self_tests/match_canister/flexible-init.c | 28 +++ - .../match_canister/flexible-init.expected | 16 ++ - .../match_canister/functional-flexible.c | 52 ++++ - .../functional-flexible.expected | 10 + - .../self_tests/match_canister/functional.c | 36 +++ - .../match_canister/functional.expected | 8 + - .../self_tests/match_canister/no-change.c | 35 +++ - .../match_canister/no-change.expected | 32 +++ - .../self_tests/match_canister/remove-field.c | 19 ++ - .../match_canister/remove-field.expected | 3 + - .../match_canister/reorder-fields.c | 23 ++ - .../self_tests/match_canister/self-test.sh | 17 ++ - .../match_canister/struct-assignment.c | 28 +++ - .../match_canister/struct-assignment.expected | 29 +++ - .../match_canister/unnamed-struct-init.c | 11 + - .../unnamed-struct-init.expected | 9 + - .../self_tests/pad_canister/bad-cast.c | 13 + - .../self_tests/pad_canister/bad-cast.expected | 9 + - .../pad_canister/bad-cast.gcc.expected | 5 + - .../self_tests/pad_canister/flexible-init.c | 32 +++ - .../pad_canister/flexible-init.expected | 16 ++ - .../pad_canister/functional-flexible.c | 49 ++++ - .../pad_canister/functional-flexible.expected | 9 + - .../self_tests/pad_canister/functional.c | 26 ++ - .../pad_canister/functional.expected | 5 + - .../pad_canister/pad-flexible-array.c | 20 ++ - .../pad_canister/pad-flexible-array.expected | 17 ++ - .../self_tests/pad_canister/self-test.sh | 12 + - .../self_tests/pad_canister/simple-pad.c | 19 ++ - .../pad_canister/simple-pad.expected | 16 ++ - .../pad_canister/struct-assignment.c | 28 +++ - .../pad_canister/struct-assignment.expected | 25 ++ - .../pad_canister/unnamed-struct-init.c | 11 + - .../pad_canister/unnamed-struct-init.expected | 9 + - .../self_tests/run_tests.sh | 13 + - .../self_tests/self-test-lib.sh | 231 ++++++++++++++++++ - 49 files changed, 1154 insertions(+) - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-multiple-new-fields.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-multiple-new-fields.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-new-field.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-new-field.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-too-many-fields.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-too-many-fields.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/bad-cast.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/bad-cast.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/bad-cast.gcc.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/designated-init.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/designated-init.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/field-size-change.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/field-size-change.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/flexible-init.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/flexible-init.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional-flexible.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional-flexible.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/no-change.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/no-change.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/remove-field.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/remove-field.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/reorder-fields.c - create mode 100755 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/self-test.sh - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/struct-assignment.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/struct-assignment.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/unnamed-struct-init.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/unnamed-struct-init.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/bad-cast.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/bad-cast.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/bad-cast.gcc.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/flexible-init.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/flexible-init.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/functional-flexible.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/functional-flexible.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/functional.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/functional.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/pad-flexible-array.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/pad-flexible-array.expected - create mode 100755 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/self-test.sh - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/simple-pad.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/simple-pad.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/struct-assignment.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/struct-assignment.expected - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/unnamed-struct-init.c - create mode 100644 scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/unnamed-struct-init.expected - create mode 100755 scripts/gcc-plugins/fips_canister_plugins/self_tests/run_tests.sh - create mode 100755 scripts/gcc-plugins/fips_canister_plugins/self_tests/self-test-lib.sh - -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-multiple-new-fields.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-multiple-new-fields.c -new file mode 100644 -index 000000000..e4b970b8b ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-multiple-new-fields.c -@@ -0,0 +1,36 @@ -+/* Add new_field to crypto_tfm */ -+struct crypto_tfm { -+ char refcnt[4]; -+ -+ int crt_flags; -+ -+ int new_field; -+ -+ int new_field1; -+ -+ int node; -+ -+ void (*exit)(struct crypto_tfm *tfm); -+ -+ void *__crt_alg; -+ -+ void *__crt_ctx[] __attribute__((__aligned__(8))); -+}; -+ -+/* Add new field to ecdh, allowing some space for padding */ -+struct ecdh { -+ char new_field[3]; -+ -+ char *key; -+ unsigned short key_size; -+ -+ char new_flexible_array[]; -+}; -+ -+int main() -+{ -+ struct crypto_tfm tfm; -+ struct ecdh ecdh; -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-multiple-new-fields.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-multiple-new-fields.expected -new file mode 100644 -index 000000000..573a7cada ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-multiple-new-fields.expected -@@ -0,0 +1,28 @@ -+struct crypto_tfm { -+ char refcnt[4]; /* 0 4 */ -+ int crt_flags; /* 4 4 */ -+ int node; /* 8 4 */ -+ -+ /* XXX 4 bytes hole, try to pack */ -+ -+ void (*exit)(struct crypto_tfm *); /* 16 8 */ -+ void * __crt_alg; /* 24 8 */ -+ int new_field; /* 32 4 */ -+ int new_field1; /* 36 4 */ -+ void * __crt_ctx[] __attribute__((__aligned__(8))); /* 40 0 */ -+ -+ /* size: 40, cachelines: 1, members: 8 */ -+ /* sum members: 36, holes: 1, sum holes: 4 */ -+ /* forced alignments: 1 */ -+ /* last cacheline: 40 bytes */ -+} __attribute__((__aligned__(8))); -+struct ecdh { -+ char * key; /* 0 8 */ -+ short unsigned int key_size; /* 8 2 */ -+ char new_field[3]; /* 10 3 */ -+ char __fips_canister_padding[11]; /* 13 11 */ -+ char new_flexible_array[]; /* 24 0 */ -+ -+ /* size: 24, cachelines: 1, members: 5 */ -+ /* last cacheline: 24 bytes */ -+}; -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-new-field.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-new-field.c -new file mode 100644 -index 000000000..198206c42 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-new-field.c -@@ -0,0 +1,30 @@ -+/* Add new_field to crypto_tfm */ -+struct crypto_tfm { -+ char refcnt[4]; -+ -+ int crt_flags; -+ -+ long int new_field; -+ -+ int node; -+ -+ void (*exit)(struct crypto_tfm *tfm); -+ -+ void *__crt_alg; -+ -+ void *__crt_ctx[] __attribute__((__aligned__(8))); -+}; -+ -+struct ecdh { -+ char new_field[5]; -+ char *key; -+ unsigned short key_size; -+}; -+ -+int main() -+{ -+ struct crypto_tfm tfm; -+ struct ecdh ecdh; -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-new-field.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-new-field.expected -new file mode 100644 -index 000000000..6b00439d3 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-new-field.expected -@@ -0,0 +1,26 @@ -+struct crypto_tfm { -+ char refcnt[4]; /* 0 4 */ -+ int crt_flags; /* 4 4 */ -+ int node; /* 8 4 */ -+ -+ /* XXX 4 bytes hole, try to pack */ -+ -+ void (*exit)(struct crypto_tfm *); /* 16 8 */ -+ void * __crt_alg; /* 24 8 */ -+ long int new_field; /* 32 8 */ -+ void * __crt_ctx[] __attribute__((__aligned__(8))); /* 40 0 */ -+ -+ /* size: 40, cachelines: 1, members: 7 */ -+ /* sum members: 36, holes: 1, sum holes: 4 */ -+ /* forced alignments: 1 */ -+ /* last cacheline: 40 bytes */ -+} __attribute__((__aligned__(8))); -+struct ecdh { -+ char * key; /* 0 8 */ -+ short unsigned int key_size; /* 8 2 */ -+ char new_field[5]; /* 10 5 */ -+ char __fips_canister_padding[9]; /* 15 9 */ -+ -+ /* size: 24, cachelines: 1, members: 4 */ -+ /* last cacheline: 24 bytes */ -+}; -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-too-many-fields.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-too-many-fields.c -new file mode 100644 -index 000000000..8cbe70647 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-too-many-fields.c -@@ -0,0 +1,27 @@ -+/* Expected failure: Overflowing padding before flexible array member */ -+struct crypto_tfm { -+ char refcnt[4]; -+ -+ int crt_flags; -+ -+ int new_field; -+ -+ int new_field1; -+ -+ int new_field2; -+ -+ int node; -+ -+ void (*exit)(struct crypto_tfm *tfm); -+ -+ void *__crt_alg; -+ -+ void *__crt_ctx[]; -+}; -+ -+int main() -+{ -+ struct crypto_tfm tfm; -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-too-many-fields.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-too-many-fields.expected -new file mode 100644 -index 000000000..7a690ca1d ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/add-too-many-fields.expected -@@ -0,0 +1,4 @@ -+add-too-many-fields.c:20:1: error: struct 'crypto_tfm': kernel size 48 != canister size 40 -+ -+ 20 | }; -+ | ^ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/bad-cast.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/bad-cast.c -new file mode 100644 -index 000000000..3e77a6ae5 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/bad-cast.c -@@ -0,0 +1,13 @@ -+/* This should be a struct which is padded in the canister */ -+struct ecdh { -+ char *key; -+ unsigned short key_size; -+}; -+ -+int main() -+{ -+ struct ecdh ecdh; -+ -+ char *h = (char *)&ecdh; -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/bad-cast.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/bad-cast.expected -new file mode 100644 -index 000000000..0d813b0e0 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/bad-cast.expected -@@ -0,0 +1,8 @@ -+struct ecdh { -+ char * key; /* 0 8 */ -+ short unsigned int key_size; /* 8 2 */ -+ char __fips_canister_padding[14]; /* 10 14 */ -+ -+ /* size: 24, cachelines: 1, members: 3 */ -+ /* last cacheline: 24 bytes */ -+}; -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/bad-cast.gcc.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/bad-cast.gcc.expected -new file mode 100644 -index 000000000..931acedc3 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/bad-cast.gcc.expected -@@ -0,0 +1,5 @@ -+bad-cast.c: In function ‘main’: -+bad-cast.c:11:15: note: fips canister plugin: casting modified canister structure pointer type (op0): ‘char’ and ‘struct ecdh’ -+ -+ 11 | char *h = (char *)&ecdh; -+ | ^ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/designated-init.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/designated-init.c -new file mode 100644 -index 000000000..6031af3f9 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/designated-init.c -@@ -0,0 +1,12 @@ -+ -+/* This should be a struct which is padded in the canister */ -+struct ecdh { -+ char *key; -+ unsigned short key_size; -+}; -+ -+int main() { -+ struct ecdh ecdh = {1, 2}; -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/designated-init.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/designated-init.expected -new file mode 100644 -index 000000000..14af6e9b2 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/designated-init.expected -@@ -0,0 +1,12 @@ -+designated-init.c: In function ‘main’: -+designated-init.c:9:29: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init] -+ 9 | struct ecdh ecdh = {1, 2}; -+ | ^ -+designated-init.c:9:29: note: (near initialization for ‘ecdh’) -+designated-init.c:9:29: warning: initialization of ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] -+designated-init.c:9:29: note: (near initialization for ‘ecdh.key’) -+designated-init.c:9:32: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init] -+ 9 | struct ecdh ecdh = {1, 2}; -+ | ^ -+designated-init.c:9:32: note: (near initialization for ‘ecdh’) -+cc1: some warnings being treated as errors -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/field-size-change.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/field-size-change.c -new file mode 100644 -index 000000000..f08f54a72 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/field-size-change.c -@@ -0,0 +1,20 @@ -+/* Field size change */ -+struct crypto_tfm { -+ char refcnt[24]; -+ -+ int crt_flags; -+ -+ long int node; -+ -+ void (*exit)(struct crypto_tfm *tfm); -+ -+ void *__crt_alg; -+ -+ void *__crt_ctx[] __attribute__((__aligned__(8))); -+}; -+ -+int main() { -+ struct crypto_tfm tfm; -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/field-size-change.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/field-size-change.expected -new file mode 100644 -index 000000000..55499de81 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/field-size-change.expected -@@ -0,0 +1,12 @@ -+field-size-change.c:3:14: note: struct 'crypto_tfm': field 'refcnt' size mismatch: kernel: (char[24]) 24 != canister: (refcount_t) 4 -+ -+ 3 | char refcnt[24]; -+ | ^~~~~~ -+field-size-change.c:7:18: note: struct 'crypto_tfm': field 'node' size mismatch: kernel: (long int) 8 != canister: (int) 4 -+ -+ 7 | long int node; -+ | ^~~~ -+field-size-change.c:14:1: error: struct 'crypto_tfm': field 'crt_flags', kernel offset 24 != canister offset 4 -+ -+ 14 | }; -+ | ^ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/flexible-init.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/flexible-init.c -new file mode 100644 -index 000000000..74061f8fd ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/flexible-init.c -@@ -0,0 +1,28 @@ -+/* Struct padded in canister, with flexible array member */ -+struct crypto_tfm { -+ char refcnt[4]; -+ -+ int crt_flags; -+ -+ int node; -+ -+ void (*exit)(struct crypto_tfm *tfm); -+ -+ void *__crt_alg; -+ -+ char __crt_ctx[]; -+}; -+ -+const struct crypto_tfm tfm_var = { -+ .refcnt = {0}, -+ .crt_flags = 1, -+ .node = 2, -+ .exit = 0, -+ .__crt_alg = 0, -+ // Alloc 8 bytes for the flexible array size -+ .__crt_ctx = {0, 1, 2, 3, 4, 5, 6, 7} -+}; -+ -+int main() { -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/flexible-init.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/flexible-init.expected -new file mode 100644 -index 000000000..d5875707d ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/flexible-init.expected -@@ -0,0 +1,16 @@ -+struct crypto_tfm { -+ char refcnt[4]; /* 0 4 */ -+ int crt_flags; /* 4 4 */ -+ int node; /* 8 4 */ -+ -+ /* XXX 4 bytes hole, try to pack */ -+ -+ void (*exit)(struct crypto_tfm *); /* 16 8 */ -+ void * __crt_alg; /* 24 8 */ -+ char __fips_canister_padding[8]; /* 32 8 */ -+ char __crt_ctx[]; /* 40 0 */ -+ -+ /* size: 40, cachelines: 1, members: 7 */ -+ /* sum members: 36, holes: 1, sum holes: 4 */ -+ /* last cacheline: 40 bytes */ -+}; -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional-flexible.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional-flexible.c -new file mode 100644 -index 000000000..a1a64d504 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional-flexible.c -@@ -0,0 +1,52 @@ -+#include -+#include -+#include -+#include -+ -+struct crypto_tfm { -+ char refcnt[4]; -+ -+ int crt_flags; -+ -+ long int new_field; -+ -+ int node; -+ -+ void (*exit)(struct crypto_tfm *tfm); -+ -+ void *__crt_alg; -+ -+ void *__crt_ctx[] __attribute__((__aligned__(8))); -+}; -+ -+int main() { -+ struct crypto_tfm *func_tfm = calloc(1, sizeof(struct crypto_tfm) + 8); -+ if(!func_tfm) { -+ perror("Couldn't alloc memory for crypto_tfm"); -+ return -1; -+ } -+ -+ char bytes[8] = "8 bytes."; -+ -+ strncpy((char *) func_tfm->__crt_ctx, bytes, sizeof(bytes)); -+ -+ printf("__crt_ctx: %s\n\n", (char *) func_tfm->__crt_ctx); -+ -+ printf("new_field offset: %d\n", offsetof(struct crypto_tfm, new_field)); -+ printf("refcnt offset: %d\n", offsetof(struct crypto_tfm, refcnt)); -+ printf("crt_flags offset: %d\n", offsetof(struct crypto_tfm, crt_flags)); -+ printf("node offset: %d\n", offsetof(struct crypto_tfm, node)); -+ printf("exit offset: %d\n", offsetof(struct crypto_tfm, exit)); -+ printf("__crt_alg offset: %d\n", offsetof(struct crypto_tfm, __crt_alg)); -+ printf("__crt__ctx offset: %d\n", offsetof(struct crypto_tfm, __crt_ctx)); -+ -+ // test explicitly writing to offset -+ int *node = (int*) (((long int) func_tfm) + 8); -+ *node = 75439; -+ -+ printf("Explicit offset write: crypto_tfm->node = %d\n", func_tfm->node); -+ -+ free(func_tfm); -+ return 0; -+} -+ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional-flexible.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional-flexible.expected -new file mode 100644 -index 000000000..9ae2783db ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional-flexible.expected -@@ -0,0 +1,10 @@ -+__crt_ctx: 8 bytes. -+ -+new_field offset: 32 -+refcnt offset: 0 -+crt_flags offset: 4 -+node offset: 8 -+exit offset: 16 -+__crt_alg offset: 24 -+__crt__ctx offset: 40 -+Explicit offset write: crypto_tfm->node = 75439 -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional.c -new file mode 100644 -index 000000000..1c40a6f02 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional.c -@@ -0,0 +1,36 @@ -+#include -+#include -+ -+struct ecdh { -+ char new_field[5]; -+ char *key; -+ unsigned short key_size; -+}; -+ -+int main() -+{ -+ struct ecdh ecdh; -+ size_t key_offset = offsetof(struct ecdh, key); -+ size_t key_size_offset = offsetof(struct ecdh, key_size); -+ size_t new_field_offset = offsetof(struct ecdh, new_field); -+ -+ ecdh.new_field[0] = 1; -+ ecdh.key_size = sizeof(ecdh.new_field); -+ -+ printf("ecdh.key_size = %d\n", ecdh.key_size); -+ printf("ecdh.new_field[0] + ecdh.key_size = %d\n", -+ ecdh.new_field[0] + ecdh.key_size); -+ -+ // test offsets -+ printf("Offsets:\n"); -+ printf("offsetof(ecdh.new_field) = %d\n", new_field_offset); -+ printf("offsetof(ecdh.key) = %d\n", key_offset); -+ printf("offsetof(ecdh.key_size) = %d\n", key_size_offset); -+ -+ -+ unsigned short *key_sz = (unsigned short *) (((char* ) &ecdh) + 8); -+ *key_sz = 53; -+ printf("\necdh->key_sz = %d\n", (int) ecdh.key_size); -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional.expected -new file mode 100644 -index 000000000..44dcb0a39 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/functional.expected -@@ -0,0 +1,8 @@ -+ecdh.key_size = 5 -+ecdh.new_field[0] + ecdh.key_size = 6 -+Offsets: -+offsetof(ecdh.new_field) = 10 -+offsetof(ecdh.key) = 0 -+offsetof(ecdh.key_size) = 8 -+ -+ecdh->key_sz = 53 -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/no-change.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/no-change.c -new file mode 100644 -index 000000000..09964b512 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/no-change.c -@@ -0,0 +1,35 @@ -+ -+/* This should be a struct which is padded in the canister */ -+struct ecdh { -+ char *key; -+ unsigned short key_size; -+}; -+ -+/* Struct padded in canster, with flexible array member */ -+struct crypto_tfm { -+ char refcnt[4]; -+ -+ int crt_flags; -+ -+ int node; -+ -+ void (*exit)(struct crypto_tfm *tfm); -+ -+ void *__crt_alg; -+ -+ void *__crt_ctx[] __attribute__((__aligned__(8))); -+}; -+ -+ -+/* This can be a struct which is not padded in the canister */ -+struct list_head { -+ struct list_head *next, *prev; -+}; -+ -+int main() { -+ struct ecdh ecdh; -+ struct list_head list; -+ struct crypto_tfm tfm; -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/no-change.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/no-change.expected -new file mode 100644 -index 000000000..814dcb7a9 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/no-change.expected -@@ -0,0 +1,32 @@ -+struct ecdh { -+ char * key; /* 0 8 */ -+ short unsigned int key_size; /* 8 2 */ -+ char __fips_canister_padding[14]; /* 10 14 */ -+ -+ /* size: 24, cachelines: 1, members: 3 */ -+ /* last cacheline: 24 bytes */ -+}; -+struct crypto_tfm { -+ char refcnt[4]; /* 0 4 */ -+ int crt_flags; /* 4 4 */ -+ int node; /* 8 4 */ -+ -+ /* XXX 4 bytes hole, try to pack */ -+ -+ void (*exit)(struct crypto_tfm *); /* 16 8 */ -+ void * __crt_alg; /* 24 8 */ -+ char __fips_canister_padding[8]; /* 32 8 */ -+ void * __crt_ctx[] __attribute__((__aligned__(8))); /* 40 0 */ -+ -+ /* size: 40, cachelines: 1, members: 7 */ -+ /* sum members: 36, holes: 1, sum holes: 4 */ -+ /* forced alignments: 1 */ -+ /* last cacheline: 40 bytes */ -+} __attribute__((__aligned__(8))); -+struct list_head { -+ struct list_head * next; /* 0 8 */ -+ struct list_head * prev; /* 8 8 */ -+ -+ /* size: 16, cachelines: 1, members: 2 */ -+ /* last cacheline: 16 bytes */ -+}; -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/remove-field.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/remove-field.c -new file mode 100644 -index 000000000..f7f435d58 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/remove-field.c -@@ -0,0 +1,19 @@ -+/* Remove field from crypto_tfm */ -+struct crypto_tfm { -+ char refcnt[4]; -+ -+ int crt_flags; -+ -+ void (*exit)(struct crypto_tfm *tfm); -+ -+ void *__crt_alg; -+ -+ void *__crt_ctx[] __attribute__((__aligned__(8))); -+}; -+ -+int main() -+{ -+ struct crypto_tfm tfm; -+ -+ return 0; -+} -\ No newline at end of file -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/remove-field.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/remove-field.expected -new file mode 100644 -index 000000000..4ca5ba886 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/remove-field.expected -@@ -0,0 +1,3 @@ -+remove-field.c:12:1: error: struct crypto_tfm: found canister member 'node' which is not present in kernel -+ 12 | }; -+ | ^ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/reorder-fields.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/reorder-fields.c -new file mode 100644 -index 000000000..3f5e90aae ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/reorder-fields.c -@@ -0,0 +1,23 @@ -+/* -+ * Reordering of fields in kernel - plugin should order these -+ * according to the canister order. -+ */ -+struct crypto_tfm { -+ int crt_flags; -+ -+ char refcnt[4]; -+ -+ int node; -+ -+ void *__crt_alg; -+ -+ void (*exit)(struct crypto_tfm *tfm); -+ -+ void *__crt_ctx[] __attribute__((__aligned__(8))); -+}; -+ -+int main() { -+ struct crypto_tfm tfm; -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/self-test.sh b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/self-test.sh -new file mode 100755 -index 000000000..2a765a24e ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/self-test.sh -@@ -0,0 +1,17 @@ -+source ../self-test-lib.sh -+match_canister_plugin_path="../../../match_canister_structs.so" -+ -+test_case "no-change" "$match_canister_plugin_path" -+test_case "add-new-field" "$match_canister_plugin_path" -+test_case "add-multiple-new-fields" "$match_canister_plugin_path" -+test_case "struct-assignment" "$match_canister_plugin_path" -+test_case_expect_gcc_failure "remove-field" "$match_canister_plugin_path" -+test_case_expect_gcc_failure "field-size-change" "$match_canister_plugin_path" -+test_case_expect_gcc_failure "add-too-many-fields" "$match_canister_plugin_path" -+test_case_expect_gcc_failure "designated-init" "$match_canister_plugin_path" -+test_case_expect_gcc_failure "unnamed-struct-init" "$match_canister_plugin_path" -+test_case_gcc_warning "bad-cast" "$match_canister_plugin_path" -+test_flexible_array_init "flexible-init" "$match_canister_plugin_path" 8 "tfm_var" -+test_case_functional "functional" "$match_canister_plugin_path" -+test_case_functional "functional-flexible" "$match_canister_plugin_path" -+exit_return_code -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/struct-assignment.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/struct-assignment.c -new file mode 100644 -index 000000000..1feeffee6 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/struct-assignment.c -@@ -0,0 +1,28 @@ -+struct list_head { -+ struct list_head *next, *prev; -+}; -+ -+struct swait_queue_head { -+ unsigned char lock[4]; -+ struct list_head task_list; -+}; -+ -+struct completion { -+ unsigned int done; -+ struct swait_queue_head wait; -+}; -+ -+int main() { -+ struct swait_queue_head swait = { -+ .lock = 0, -+ .task_list = {0, 0} -+ }; -+ -+ struct completion completion = { -+ .done = 1, -+ .wait = swait -+ }; -+ -+ return 0; -+} -+ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/struct-assignment.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/struct-assignment.expected -new file mode 100644 -index 000000000..cfdd3e224 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/struct-assignment.expected -@@ -0,0 +1,29 @@ -+struct list_head { -+ struct list_head * next; /* 0 8 */ -+ struct list_head * prev; /* 8 8 */ -+ -+ /* size: 16, cachelines: 1, members: 2 */ -+ /* last cacheline: 16 bytes */ -+}; -+struct swait_queue_head { -+ unsigned char lock[4]; /* 0 4 */ -+ -+ /* XXX 4 bytes hole, try to pack */ -+ -+ struct list_head task_list; /* 8 16 */ -+ -+ /* size: 24, cachelines: 1, members: 2 */ -+ /* sum members: 20, holes: 1, sum holes: 4 */ -+ /* last cacheline: 24 bytes */ -+}; -+struct completion { -+ unsigned int done; /* 0 4 */ -+ -+ /* XXX 4 bytes hole, try to pack */ -+ -+ struct swait_queue_head wait; /* 8 24 */ -+ -+ /* size: 32, cachelines: 1, members: 2 */ -+ /* sum members: 28, holes: 1, sum holes: 4 */ -+ /* last cacheline: 32 bytes */ -+}; -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/unnamed-struct-init.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/unnamed-struct-init.c -new file mode 100644 -index 000000000..b8bee9068 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/unnamed-struct-init.c -@@ -0,0 +1,11 @@ -+struct ecdh { -+ char *key; -+ unsigned short key_size; -+} ecdh = { (char*) 1, 2 }; -+ -+ -+int main() { -+ struct ecdh ecdh; -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/unnamed-struct-init.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/unnamed-struct-init.expected -new file mode 100644 -index 000000000..a59936d57 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/match_canister/unnamed-struct-init.expected -@@ -0,0 +1,9 @@ -+unnamed-struct-init.c:4:12: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init] -+ 4 | } ecdh = { (char*) 1, 2 }; -+ | ^ -+unnamed-struct-init.c:4:12: note: (near initialization for ‘ecdh’) -+unnamed-struct-init.c:4:23: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init] -+ 4 | } ecdh = { (char*) 1, 2 }; -+ | ^ -+unnamed-struct-init.c:4:23: note: (near initialization for ‘ecdh’) -+cc1: some warnings being treated as errors -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/bad-cast.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/bad-cast.c -new file mode 100644 -index 000000000..3e77a6ae5 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/bad-cast.c -@@ -0,0 +1,13 @@ -+/* This should be a struct which is padded in the canister */ -+struct ecdh { -+ char *key; -+ unsigned short key_size; -+}; -+ -+int main() -+{ -+ struct ecdh ecdh; -+ -+ char *h = (char *)&ecdh; -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/bad-cast.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/bad-cast.expected -new file mode 100644 -index 000000000..7f235c032 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/bad-cast.expected -@@ -0,0 +1,9 @@ -+struct ecdh { -+ char * key; /* 0 8 */ -+ short unsigned int key_size; /* 8 2 */ -+ char __fips_canister_padding[8]; /* 10 8 */ -+ -+ /* size: 24, cachelines: 1, members: 3 */ -+ /* padding: 6 */ -+ /* last cacheline: 24 bytes */ -+}; -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/bad-cast.gcc.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/bad-cast.gcc.expected -new file mode 100644 -index 000000000..931acedc3 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/bad-cast.gcc.expected -@@ -0,0 +1,5 @@ -+bad-cast.c: In function ‘main’: -+bad-cast.c:11:15: note: fips canister plugin: casting modified canister structure pointer type (op0): ‘char’ and ‘struct ecdh’ -+ -+ 11 | char *h = (char *)&ecdh; -+ | ^ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/flexible-init.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/flexible-init.c -new file mode 100644 -index 000000000..080d0c811 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/flexible-init.c -@@ -0,0 +1,32 @@ -+#include -+#include -+#include -+ -+/* Struct padded in canister, with flexible array member */ -+struct crypto_tfm { -+ char refcnt[12]; -+ -+ int crt_flags; -+ -+ int node; -+ -+ void (*exit)(struct crypto_tfm *tfm); -+ -+ void *__crt_alg; -+ -+ char __crt_ctx[]; -+}; -+ -+const struct crypto_tfm tfm_var = { -+ .refcnt = {0}, -+ .crt_flags = 1, -+ .node = 2, -+ .exit = NULL, -+ .__crt_alg = NULL, -+ // Alloc 8 bytes for the flexible array size -+ .__crt_ctx = {0, 1, 2, 3, 4, 5, 6, 7} -+}; -+ -+int main() { -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/flexible-init.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/flexible-init.expected -new file mode 100644 -index 000000000..6a92a74d1 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/flexible-init.expected -@@ -0,0 +1,16 @@ -+struct crypto_tfm { -+ char refcnt[12]; /* 0 12 */ -+ int crt_flags; /* 12 4 */ -+ int node; /* 16 4 */ -+ -+ /* XXX 4 bytes hole, try to pack */ -+ -+ void (*exit)(struct crypto_tfm *); /* 24 8 */ -+ void * __crt_alg; /* 32 8 */ -+ char __fips_canister_padding[8]; /* 40 8 */ -+ char __crt_ctx[]; /* 48 0 */ -+ -+ /* size: 48, cachelines: 1, members: 7 */ -+ /* sum members: 44, holes: 1, sum holes: 4 */ -+ /* last cacheline: 48 bytes */ -+}; -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/functional-flexible.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/functional-flexible.c -new file mode 100644 -index 000000000..a0f011947 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/functional-flexible.c -@@ -0,0 +1,49 @@ -+#include -+#include -+#include -+#include -+ -+struct crypto_tfm { -+ char refcnt[4]; -+ -+ int crt_flags; -+ -+ int node; -+ -+ void (*exit)(struct crypto_tfm *tfm); -+ -+ void *__crt_alg; -+ -+ void *__crt_ctx[] __attribute__((__aligned__(8))); -+}; -+ -+int main() { -+ struct crypto_tfm *func_tfm = calloc(1, sizeof(struct crypto_tfm) + 8); -+ if(!func_tfm) { -+ perror("Couldn't alloc memory for crypto_tfm"); -+ return -1; -+ } -+ -+ char bytes[8] = "8 bytes."; -+ -+ strncpy((char *) func_tfm->__crt_ctx, bytes, sizeof(bytes)); -+ -+ printf("__crt_ctx: %s\n\n", (char *) func_tfm->__crt_ctx); -+ -+ printf("refcnt offset: %d\n", offsetof(struct crypto_tfm, refcnt)); -+ printf("crt_flags offset: %d\n", offsetof(struct crypto_tfm, crt_flags)); -+ printf("node offset: %d\n", offsetof(struct crypto_tfm, node)); -+ printf("exit offset: %d\n", offsetof(struct crypto_tfm, exit)); -+ printf("__crt_alg offset: %d\n", offsetof(struct crypto_tfm, __crt_alg)); -+ printf("__crt__ctx offset: %d\n", offsetof(struct crypto_tfm, __crt_ctx)); -+ -+ // test explicitly writing to offset -+ char *__crt_ctx = (char*) func_tfm + 40; -+ strcpy(__crt_ctx, "hello"); -+ -+ printf("Explicit offset write: crypto_tfm->__crt_ctx = %s\n", func_tfm->__crt_ctx); -+ -+ free(func_tfm); -+ return 0; -+} -+ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/functional-flexible.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/functional-flexible.expected -new file mode 100644 -index 000000000..19fdd0b74 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/functional-flexible.expected -@@ -0,0 +1,9 @@ -+__crt_ctx: 8 bytes. -+ -+refcnt offset: 0 -+crt_flags offset: 4 -+node offset: 8 -+exit offset: 16 -+__crt_alg offset: 24 -+__crt__ctx offset: 40 -+Explicit offset write: crypto_tfm->__crt_ctx = hello -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/functional.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/functional.c -new file mode 100644 -index 000000000..53119fc01 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/functional.c -@@ -0,0 +1,26 @@ -+#include -+#include -+ -+struct ecdh { -+ char *key; -+ unsigned short key_size; -+}; -+ -+int main() -+{ -+ struct ecdh ecdh; -+ size_t key_offset = offsetof(struct ecdh, key); -+ size_t key_size_offset = offsetof(struct ecdh, key_size); -+ -+ // test offsets -+ printf("Offsets:\n"); -+ printf("offsetof(ecdh.key) = %d\n", key_offset); -+ printf("offsetof(ecdh.key_size) = %d\n", key_size_offset); -+ -+ -+ unsigned short *key_sz = (unsigned short *) (((char* ) &ecdh) + 8); -+ *key_sz = 53; -+ printf("\necdh->key_sz = %d\n", ecdh.key_size); -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/functional.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/functional.expected -new file mode 100644 -index 000000000..2a55c986a ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/functional.expected -@@ -0,0 +1,5 @@ -+Offsets: -+offsetof(ecdh.key) = 0 -+offsetof(ecdh.key_size) = 8 -+ -+ecdh->key_sz = 53 -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/pad-flexible-array.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/pad-flexible-array.c -new file mode 100644 -index 000000000..c88b7c3fb ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/pad-flexible-array.c -@@ -0,0 +1,20 @@ -+/* Struct padded in canster, with flexible array member */ -+struct crypto_tfm { -+ char refcnt[12]; -+ -+ int crt_flags; -+ -+ int node; -+ -+ void (*exit)(struct crypto_tfm *tfm); -+ -+ void *__crt_alg; -+ -+ void *__crt_ctx[] __attribute__((__aligned__(8))); -+}; -+ -+int main() { -+ struct crypto_tfm tfm; -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/pad-flexible-array.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/pad-flexible-array.expected -new file mode 100644 -index 000000000..d41bd844a ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/pad-flexible-array.expected -@@ -0,0 +1,17 @@ -+struct crypto_tfm { -+ char refcnt[12]; /* 0 12 */ -+ int crt_flags; /* 12 4 */ -+ int node; /* 16 4 */ -+ -+ /* XXX 4 bytes hole, try to pack */ -+ -+ void (*exit)(struct crypto_tfm *); /* 24 8 */ -+ void * __crt_alg; /* 32 8 */ -+ char __fips_canister_padding[8]; /* 40 8 */ -+ void * __crt_ctx[] __attribute__((__aligned__(8))); /* 48 0 */ -+ -+ /* size: 48, cachelines: 1, members: 7 */ -+ /* sum members: 44, holes: 1, sum holes: 4 */ -+ /* forced alignments: 1 */ -+ /* last cacheline: 48 bytes */ -+} __attribute__((__aligned__(8))); -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/self-test.sh b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/self-test.sh -new file mode 100755 -index 000000000..4f2f5f5bb ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/self-test.sh -@@ -0,0 +1,12 @@ -+source ../self-test-lib.sh -+pad_canister_plugin_path="../../../pad_canister_structs.so" -+ -+test_case "simple-pad" "$pad_canister_plugin_path" -+test_case "pad-flexible-array" "$pad_canister_plugin_path" -+test_case "struct-assignment" "$pad_canister_plugin_path" -+test_case_expect_gcc_failure "unnamed-struct-init" "$pad_canister_plugin_path" -+test_case_gcc_warning "bad-cast" "$pad_canister_plugin_path" -+test_flexible_array_init "flexible-init" "$pad_canister_plugin_path" 8 "tfm_var" -+test_case_functional "functional" "$pad_canister_plugin_path" -+test_case_functional "functional-flexible" "$pad_canister_plugin_path" -+exit_return_code -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/simple-pad.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/simple-pad.c -new file mode 100644 -index 000000000..3f4fc15e1 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/simple-pad.c -@@ -0,0 +1,19 @@ -+ -+/* This should be a struct which is padded in the canister */ -+struct ecdh { -+ char *key; -+ unsigned short key_size; -+}; -+ -+/* This can be a struct which is not padded in the canister */ -+struct list_head { -+ struct list_head *prev, *next; -+}; -+ -+int main() -+{ -+ struct ecdh ecdh; -+ struct list_head list; -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/simple-pad.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/simple-pad.expected -new file mode 100644 -index 000000000..662667277 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/simple-pad.expected -@@ -0,0 +1,16 @@ -+struct ecdh { -+ char * key; /* 0 8 */ -+ short unsigned int key_size; /* 8 2 */ -+ char __fips_canister_padding[8]; /* 10 8 */ -+ -+ /* size: 24, cachelines: 1, members: 3 */ -+ /* padding: 6 */ -+ /* last cacheline: 24 bytes */ -+}; -+struct list_head { -+ struct list_head * prev; /* 0 8 */ -+ struct list_head * next; /* 8 8 */ -+ -+ /* size: 16, cachelines: 1, members: 2 */ -+ /* last cacheline: 16 bytes */ -+}; -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/struct-assignment.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/struct-assignment.c -new file mode 100644 -index 000000000..4d004277f ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/struct-assignment.c -@@ -0,0 +1,28 @@ -+struct list_head { -+ struct list_head *next, *prev; -+}; -+ -+struct swait_queue_head { -+ void * lock; -+ struct list_head task_list; -+}; -+ -+struct completion { -+ unsigned int done; -+ struct swait_queue_head wait; -+}; -+ -+int main() { -+ struct swait_queue_head swait = { -+ .lock = 0, -+ .task_list = {0, 0} -+ }; -+ -+ struct completion completion = { -+ .done = 1, -+ .wait = swait -+ }; -+ -+ return 0; -+} -+ -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/struct-assignment.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/struct-assignment.expected -new file mode 100644 -index 000000000..fbc659660 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/struct-assignment.expected -@@ -0,0 +1,25 @@ -+struct list_head { -+ struct list_head * next; /* 0 8 */ -+ struct list_head * prev; /* 8 8 */ -+ -+ /* size: 16, cachelines: 1, members: 2 */ -+ /* last cacheline: 16 bytes */ -+}; -+struct swait_queue_head { -+ void * lock; /* 0 8 */ -+ struct list_head task_list; /* 8 16 */ -+ -+ /* size: 24, cachelines: 1, members: 2 */ -+ /* last cacheline: 24 bytes */ -+}; -+struct completion { -+ unsigned int done; /* 0 4 */ -+ -+ /* XXX 4 bytes hole, try to pack */ -+ -+ struct swait_queue_head wait; /* 8 24 */ -+ -+ /* size: 32, cachelines: 1, members: 2 */ -+ /* sum members: 28, holes: 1, sum holes: 4 */ -+ /* last cacheline: 32 bytes */ -+}; -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/unnamed-struct-init.c b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/unnamed-struct-init.c -new file mode 100644 -index 000000000..b8bee9068 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/unnamed-struct-init.c -@@ -0,0 +1,11 @@ -+struct ecdh { -+ char *key; -+ unsigned short key_size; -+} ecdh = { (char*) 1, 2 }; -+ -+ -+int main() { -+ struct ecdh ecdh; -+ -+ return 0; -+} -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/unnamed-struct-init.expected b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/unnamed-struct-init.expected -new file mode 100644 -index 000000000..a59936d57 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/pad_canister/unnamed-struct-init.expected -@@ -0,0 +1,9 @@ -+unnamed-struct-init.c:4:12: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init] -+ 4 | } ecdh = { (char*) 1, 2 }; -+ | ^ -+unnamed-struct-init.c:4:12: note: (near initialization for ‘ecdh’) -+unnamed-struct-init.c:4:23: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init] -+ 4 | } ecdh = { (char*) 1, 2 }; -+ | ^ -+unnamed-struct-init.c:4:23: note: (near initialization for ‘ecdh’) -+cc1: some warnings being treated as errors -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/run_tests.sh b/scripts/gcc-plugins/fips_canister_plugins/self_tests/run_tests.sh -new file mode 100755 -index 000000000..f7a24ea02 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/run_tests.sh -@@ -0,0 +1,13 @@ -+#!/bin/bash -+source "self-test-lib.sh" -+ -+for dir in */; do -+ if [[ -f "${dir}/self-test.sh" ]]; then -+ echo -e "\n\n ***** Running tests for $(basename "${dir}") *****" -+ pushd "$dir" || exit 1 -+ ./self-test.sh || _TEST_FAILURE=1 -+ popd || exit 1 -+ fi -+done -+ -+exit_return_code -diff --git a/scripts/gcc-plugins/fips_canister_plugins/self_tests/self-test-lib.sh b/scripts/gcc-plugins/fips_canister_plugins/self_tests/self-test-lib.sh -new file mode 100755 -index 000000000..e596a4287 ---- /dev/null -+++ b/scripts/gcc-plugins/fips_canister_plugins/self_tests/self-test-lib.sh -@@ -0,0 +1,231 @@ -+#!/bin/bash -+_TEST_FAILURE=0 -+ -+cleanup_files() { -+ local test_name="$1" -+ -+ rm -f "${test_name}.output" \ -+ "${test_name}.diff" \ -+ "${test_name}.o" -+} -+ -+failure() { -+ local test_name="$1" -+ local err_type="$2" -+ -+ echo -e "\n********************** TEST FAIL: $test_name ************************" -+ if [[ "$err_type" = "gcc" ]]; then -+ echo "Failed to test ${test_name}.c" -+ cat "${test_name}.output" -+ elif [[ "$err_type" = "pahole" ]]; then -+ echo "pahole found difference between output and expected output:" -+ cat "${test_name}.diff" -+ elif [[ "$err_type" = "functional" ]]; then -+ echo "Functional test failure, see output diff below:" -+ cat "${test_name}.diff" -+ elif [[ "$err_type" = "expected_gcc" ]]; then -+ echo "Difference between GCC output and expected GCC output:" -+ cat "${test_name}.diff" -+ elif [[ "$err_type" = "expected_gcc_failure" ]]; then -+ echo "gcc passed unexpectedly: ${test_name}.c" -+ else -+ echo "INTERNAL TEST SUITE ERROR: failure() requires an err_type" -+ fi -+ echo "************************ END TEST: $test_name ********************" -+ -+ cleanup_files "$test_name" -+ _TEST_FAILURE=1 -+} -+ -+test_flexible_array_init() { -+ local test_name="$1" -+ local plugin_path="$2" -+ local flex_array_size="$3" -+ local struct_var_name="$4" -+ local base_size= -+ local var_size= -+ -+ echo "Test: ${test_name}" -+ gcc -c "${test_name}".c -O0 -ggdb -fplugin="${plugin_path}" -Werror=designated-init &> "${test_name}.output" -+ if [[ $? -ne 0 ]]; then -+ failure "$test_name" "gcc" -+ return -+ fi -+ -+ if [[ -f "${test_name}.gcc.expected" ]]; then -+ diff -U 3 "${test_name}.gcc.expected" "${test_name}.output" &> "${test_name}.diff" -+ elif [[ -f "${test_name}.output" ]]; then -+ mv "${test_name}.output" "${test_name}.diff" -+ else -+ touch "${test_name}.diff" -+ fi -+ -+ if [[ -s "${test_name}.diff" ]]; then -+ failure "$test_name" "expected_gcc" -+ return -+ fi -+ -+ pahole "${test_name}".o &> "${test_name}.output" -+ -+ diff -U 3 "${test_name}.expected" "${test_name}.output" &> "${test_name}.diff" -+ -+ if [[ -s "${test_name}.diff" ]]; then -+ failure "$test_name" "pahole" -+ return -+ fi -+ -+ base_size=$(grep -Eo "size: [0-9]+" "${test_name}.output") -+ base_size=$(cut -d " " -f 2 <<< "$base_size") -+ -+ var_size=$(readelf -s "${test_name}.o" | grep "$struct_var_name" | awk '{print $3}') -+ -+ cleanup_files "$test_name" -+ -+ if [[ $var_size -ne $((base_size + flex_array_size)) ]]; then -+ echo -e "\n********************** TEST FAIL: $test_name ************************" -+ echo "Expected variable size for $struct_var_name: $((base_size + flex_array_size))" -+ echo "Found variable size: $var_size instead" -+ echo "************************ END TEST: $test_name ********************" -+ _TEST_FAILURE=1 -+ return -+ fi -+ -+ echo -e "${test_name}: Test passed successfully\n" -+} -+ -+test_case () { -+ local test_name="$1" -+ local plugin_path="$2" -+ -+ echo "Test: ${test_name}" -+ gcc -c "${test_name}".c -O0 -ggdb -fplugin="${plugin_path}" -Werror=designated-init &> "${test_name}.output" -+ if [[ $? -ne 0 ]]; then -+ failure "$test_name" "gcc" -+ return -+ fi -+ -+ if [[ -f "${test_name}.gcc.expected" ]]; then -+ diff -U 3 "${test_name}.gcc.expected" "${test_name}.output" &> "${test_name}.diff" -+ elif [[ -f "${test_name}.output" ]]; then -+ mv "${test_name}.output" "${test_name}.diff" -+ else -+ touch "${test_name}.diff" -+ fi -+ -+ if [[ -s "${test_name}.diff" ]]; then -+ failure "$test_name" "expected_gcc" -+ return -+ fi -+ -+ pahole "${test_name}".o &> "${test_name}.output" -+ -+ diff -U 3 "${test_name}.expected" "${test_name}.output" &> "${test_name}.diff" -+ -+ if [[ -s "${test_name}.diff" ]]; then -+ failure "$test_name" "pahole" -+ return -+ fi -+ -+ echo -e "$test_name: Test passed successfully\n" -+ cleanup_files "$test_name" -+} -+ -+test_case_gcc_warning() { -+ local test_name="$1" -+ local plugin_path="$2" -+ -+ echo "Test: ${test_name}" -+ gcc -c "${test_name}".c -O0 -ggdb -fplugin="${plugin_path}" -Werror=designated-init &> "${test_name}.output" -+ if [[ $? -ne 0 ]]; then -+ failure "$test_name" "gcc" -+ return -+ fi -+ -+ diff -U 3 "${test_name}.gcc.expected" "${test_name}.output" &> "${test_name}.diff" -+ -+ if [[ -s "${test_name}.diff" ]]; then -+ failure "$test_name" "expected_gcc" -+ return -+ fi -+ -+ pahole "${test_name}".o &> "${test_name}.output" -+ -+ diff -U 3 "${test_name}.expected" "${test_name}.output" &> "${test_name}.diff" -+ -+ if [[ -s "${test_name}.diff" ]]; then -+ failure "$test_name" "pahole" -+ return -+ fi -+ -+ echo -e "$test_name: Test passed successfully\n" -+ cleanup_files "$test_name" -+} -+ -+test_case_expect_gcc_failure() { -+ local test_name="$1" -+ local plugin_path="$2" -+ -+ echo "Test: ${test_name}" -+ gcc -c "${test_name}".c -O0 -ggdb -fplugin="${plugin_path}" -Werror=designated-init &> "${test_name}.output" -+ if [[ $? -eq 0 ]]; then -+ echo "************************ END TEST: $test_name ********************" -+ rm "${test_name}.output" "${test_name}.o" -+ _TEST_FAILURE=1 -+ return -+ fi -+ -+ diff -U 3 "${test_name}.expected" "${test_name}.output" &> "${test_name}.diff" -+ -+ if [[ -s "${test_name}.diff" ]]; then -+ failure "$test_name" "expected_gcc" -+ return -+ fi -+ -+ echo -e "$test_name: Test passed successfully\n" -+ cleanup_files "$test_name" -+} -+ -+test_case_functional() { -+ local test_name="$1" -+ local plugin_path="$2" -+ -+ echo "Test: ${test_name}" -+ gcc -o "$test_name.o" "${test_name}".c -O0 -ggdb -fplugin="${plugin_path}" -Werror=designated-init &> "${test_name}.output" -+ if [[ $? -ne 0 ]]; then -+ failure "$test_name" "gcc" -+ return -+ fi -+ -+ if [[ -f "${test_name}.gcc.expected" ]]; then -+ diff -U 3 "${test_name}.gcc.expected" "${test_name}.output" &> "${test_name}.diff" -+ elif [[ -f "${test_name}.output" ]]; then -+ mv "${test_name}.output" "${test_name}.diff" -+ else -+ touch "${test_name}.diff" -+ fi -+ -+ if [[ -s "${test_name}.diff" ]]; then -+ failure "$test_name" "expected_gcc" -+ return -+ fi -+ -+ "./${test_name}.o" &> "${test_name}.output" -+ diff -U 3 "${test_name}.expected" "${test_name}.output" &> "${test_name}.diff" -+ if [[ -s "${test_name}.diff" ]]; then -+ failure "$test_name" "functional" -+ return -+ fi -+ -+ echo -e "${test_name}: Test passed successfully\n" -+ cleanup_files "$test_name" -+} -+ -+exit_return_code() { -+ if [[ "$_TEST_FAILURE" -ne 0 ]]; then -+ echo "SOME TESTS FAILED" -+ else -+ echo "ALL TESTS SUCCESSFUL" -+ fi -+ -+ exit $_TEST_FAILURE -+} --- -2.40.4 - diff --git a/SPECS/91/linux/generic/0001-ACPI-PNP-Drop-PNP0C01-and-PNP0C02-from-acpi_pnp_devi.patch b/SPECS/91/linux/generic/0001-ACPI-PNP-Drop-PNP0C01-and-PNP0C02-from-acpi_pnp_devi.patch deleted file mode 100644 index c94fe27033..0000000000 --- a/SPECS/91/linux/generic/0001-ACPI-PNP-Drop-PNP0C01-and-PNP0C02-from-acpi_pnp_devi.patch +++ /dev/null @@ -1,241 +0,0 @@ -From 3ad5df2391040d1596ce888c042f99b7c1d7870a Mon Sep 17 00:00:00 2001 -From: "Rafael J. Wysocki" -Date: Mon, 15 Dec 2025 14:34:06 +0100 -Subject: [PATCH] ACPI: PNP: Drop PNP0C01 and PNP0C02 from - acpi_pnp_device_ids[] - -[ Upstream commit 3ad5df2391040d1596ce888c042f99b7c1d7870a ] - -There is a long-standing problem with ACPI device enumeration that -if the given device has a compatible ID which is one of the generic -system resource device IDs (PNP0C01 and PNP0C02), it will be claimed -by the PNP scan handler and it will not be represented as a platform -device, so it cannot be handled by a platform driver. - -Drivers have been working around this issue by "manually" creating -platform devices that they can bind to (see the Intel HID driver for -one example) or adding their device IDs to acpi_nonpnp_device_ids[]. -None of the above is particularly clean though and the only reason why -the PNP0C01 and PNP0C02 device IDs are present in acpi_pnp_device_ids[] -is to allow the legacy PNP system driver to bind to those devices and -reserve their resources so they are not used going forward. - -Obviously, to address this problem PNP0C01 and PNP0C02 need to be -dropped from acpi_pnp_device_ids[], but doing so without making any -other changes would be problematic because the ACPI core would then -create platform devices for the generic system resource device objects -and that would not work on all systems for two reasons. First, the -PNP system driver explicitly avoids reserving I/O resources below the -"standard PC hardware" boundary, 0x100, to avoid conflicts in that range -(one possible case when this may happen is when the CMOS RTC driver is -involved), but the platform device creation code does not do that. -Second, there may be resource conflicts between the "system" devices and -the other devices in the system, possibly including conflicts with PCI -BARs. Registering the PNP system driver via fs_initcall() helps to -manage those conflicts, even though it does not make them go away. -Resource conflicts during the registration of "motherboard resources" -that occur after PCI has claimed BARs are harmless as a rule and do -not need to be addressed in any specific way. - -To overcome the issues mentioned above, use the observation that it -is not actually necessary to create any device objects in addition -to struct acpi_device ones in order to reserve the "system" device -resources because that can be done directly in the ACPI device -enumeration code. - -Namely, modify acpi_default_enumeration() to add the given ACPI device -object to a special "system devices" list if its _HID is either PNP0C01 -or PNP0C02 without creating a platform device for it. Next, add a new -special acpi_scan_claim_resources() function that will be run via -fs_initcall() and will walk that list and reserve resources for each -device in it along the lines of what the PNP system driver does. - -Having made the above changes, drop PNP0C01 and PNP0C02 from -acpi_pnp_device_ids[] which will allow platform devices to be created -for ACPI device objects whose _CID lists contain PNP0C01 or PNP0C02, -but the _HID is not in acpi_pnp_device_ids[]. - -Signed-off-by: Rafael J. Wysocki -Reviewed-by: Mario Limonciello (AMD) -[ rjw: Drop a leftover comment and add a new one elsewhere ] -Link: https://patch.msgid.link/9550709.CDJkKcVGEf@rafael.j.wysocki -Signed-off-by: Rafael J. Wysocki - -[Bo: Backported to v6.12] -Signed-off-by: Bo Gan ---- - drivers/acpi/acpi_pnp.c | 3 - - drivers/acpi/scan.c | 120 ++++++++++++++++++++++++++++++++++++++-- - 2 files changed, 116 insertions(+), 7 deletions(-) - -diff --git a/drivers/acpi/acpi_pnp.c b/drivers/acpi/acpi_pnp.c -index 4ad88187dc7a0..17b2219a361e7 100644 ---- a/drivers/acpi/acpi_pnp.c -+++ b/drivers/acpi/acpi_pnp.c -@@ -125,9 +125,6 @@ static const struct acpi_device_id acpi_pnp_device_ids[] = { - {"PNP0401"}, /* ECP Printer Port */ - /* apple-gmux */ - {"APP000B"}, -- /* system */ -- {"PNP0c02"}, /* General ID for reserving resources */ -- {"PNP0c01"}, /* memory controller */ - /* rtc_cmos */ - {"PNP0b00"}, - {"PNP0b01"}, -diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c -index 416d87f9bd107..8a895d377e213 100644 ---- a/drivers/acpi/scan.c -+++ b/drivers/acpi/scan.c -@@ -42,6 +42,7 @@ static LIST_HEAD(acpi_scan_handlers_list); - DEFINE_MUTEX(acpi_device_lock); - LIST_HEAD(acpi_wakeup_device_list); - static DEFINE_MUTEX(acpi_hp_context_lock); -+static LIST_HEAD(acpi_scan_system_dev_list); - - /* - * The UART device described by the SPCR table is the only object which needs -@@ -2203,19 +2204,48 @@ static acpi_status acpi_bus_check_add_2(acpi_handle handle, u32 lvl_not_used, - return acpi_bus_check_add(handle, false, (struct acpi_device **)ret_p); - } - -+struct acpi_scan_system_dev { -+ struct list_head node; -+ struct acpi_device *adev; -+}; -+ -+static const char * const acpi_system_dev_ids[] = { -+ "PNP0C01", /* Memory controller */ -+ "PNP0C02", /* Motherboard resource */ -+ NULL -+}; -+ - static void acpi_default_enumeration(struct acpi_device *device) - { - /* - * Do not enumerate devices with enumeration_by_parent flag set as - * they will be enumerated by their respective parents. - */ -- if (!device->flags.enumeration_by_parent) { -- acpi_create_platform_device(device, NULL); -- acpi_device_set_enumerated(device); -- } else { -+ if (device->flags.enumeration_by_parent) { - blocking_notifier_call_chain(&acpi_reconfig_chain, - ACPI_RECONFIG_DEVICE_ADD, device); -+ return; -+ } -+ if (match_string(acpi_system_dev_ids, -1, acpi_device_hid(device)) >= 0) { -+ struct acpi_scan_system_dev *sd; -+ -+ /* -+ * This is a generic system device, so there is no need to -+ * create a platform device for it, but its resources need to be -+ * reserved. However, that needs to be done after all of the -+ * other device objects have been processed and PCI has claimed -+ * BARs in case there are resource conflicts. -+ */ -+ sd = kmalloc(sizeof(*sd), GFP_KERNEL); -+ if (sd) { -+ sd->adev = device; -+ list_add_tail(&sd->node, &acpi_scan_system_dev_list); -+ } -+ } else { -+ /* For a regular device object, create a platform device. */ -+ acpi_create_platform_device(device, NULL); - } -+ acpi_device_set_enumerated(device); - } - - static const struct acpi_device_id generic_device_ids[] = { -@@ -2571,6 +2601,88 @@ static void acpi_scan_postponed(void) - mutex_unlock(&acpi_dep_list_lock); - } - -+static void acpi_scan_claim_resources(struct acpi_device *adev) -+{ -+ struct list_head resource_list = LIST_HEAD_INIT(resource_list); -+ struct resource_entry *rentry; -+ unsigned int count = 0; -+ const char *regionid; -+ -+ if (acpi_dev_get_resources(adev, &resource_list, NULL, NULL) <= 0) -+ return; -+ -+ regionid = kstrdup(dev_name(&adev->dev), GFP_KERNEL); -+ if (!regionid) -+ goto exit; -+ -+ list_for_each_entry(rentry, &resource_list, node) { -+ struct resource *res = rentry->res; -+ struct resource *r; -+ -+ /* Skip disabled and invalid resources. */ -+ if ((res->flags & IORESOURCE_DISABLED) || res->end < res->start) -+ continue; -+ -+ if (res->flags & IORESOURCE_IO) { -+ /* -+ * Follow the PNP system driver and on x86 skip I/O -+ * resources that start below 0x100 (the "standard PC -+ * hardware" boundary). -+ */ -+ if (IS_ENABLED(CONFIG_X86) && res->start < 0x100) { -+ dev_info(&adev->dev, "Skipped %pR\n", res); -+ continue; -+ } -+ r = request_region(res->start, resource_size(res), regionid); -+ } else if (res->flags & IORESOURCE_MEM) { -+ r = request_mem_region(res->start, resource_size(res), regionid); -+ } else { -+ continue; -+ } -+ -+ if (r) { -+ r->flags &= ~IORESOURCE_BUSY; -+ dev_info(&adev->dev, "Reserved %pR\n", r); -+ count++; -+ } else { -+ /* -+ * Failures at this point are usually harmless. PCI -+ * quirks, for example, reserve resources they know -+ * about too, so there may well be double reservations. -+ */ -+ dev_info(&adev->dev, "Could not reserve %pR\n", res); -+ } -+ } -+ -+ if (!count) -+ kfree(regionid); -+ -+exit: -+ acpi_dev_free_resource_list(&resource_list); -+} -+ -+ -+static int __init acpi_reserve_motherboard_resources(void) -+{ -+ struct acpi_scan_system_dev *sd, *tmp; -+ -+ guard(mutex)(&acpi_scan_lock); -+ -+ list_for_each_entry_safe(sd, tmp, &acpi_scan_system_dev_list, node) { -+ acpi_scan_claim_resources(sd->adev); -+ list_del(&sd->node); -+ kfree(sd); -+ } -+ -+ return 0; -+} -+ -+/* -+ * Reserve motherboard resources after PCI claims BARs, but before PCI assigns -+ * resources for uninitialized PCI devices. -+ */ -+fs_initcall(acpi_reserve_motherboard_resources); -+ - /** - * acpi_bus_scan - Add ACPI device node objects in a given namespace scope. - * @handle: Root of the namespace scope to scan. --- -2.34.1 - diff --git a/SPECS/91/linux/generic/0001-Enable-AUXILIARY_BUS-by-default.patch b/SPECS/91/linux/generic/0001-Enable-AUXILIARY_BUS-by-default.patch deleted file mode 100644 index 5b18863ebe..0000000000 --- a/SPECS/91/linux/generic/0001-Enable-AUXILIARY_BUS-by-default.patch +++ /dev/null @@ -1,25 +0,0 @@ -From cedcd4f4dacd601c993b5358f15d45ab5cae9b10 Mon Sep 17 00:00:00 2001 -From: Bo Gan -Date: Fri, 23 Dec 2022 07:45:06 +0000 -Subject: [PATCH] Enable AUXILIARY_BUS by default - -Signed-off-by: Bo Gan ---- - drivers/base/Kconfig | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig -index 6f04b831a5c0..6568f9b6c457 100644 ---- a/drivers/base/Kconfig -+++ b/drivers/base/Kconfig -@@ -2,6 +2,7 @@ - menu "Generic Driver Options" - - config AUXILIARY_BUS -+ default y - bool - - config UEVENT_HELPER --- -2.25.1 - diff --git a/SPECS/91/linux/generic/0001-alloc_tag-avoid-current-alloc_tag-manipulations-when.patch b/SPECS/91/linux/generic/0001-alloc_tag-avoid-current-alloc_tag-manipulations-when.patch deleted file mode 100644 index 6a15dc9d1a..0000000000 --- a/SPECS/91/linux/generic/0001-alloc_tag-avoid-current-alloc_tag-manipulations-when.patch +++ /dev/null @@ -1,76 +0,0 @@ -From dec5eaf675ff8730b0f82f408265c81b3be1b9ab Mon Sep 17 00:00:00 2001 -From: Suren Baghdasaryan -Date: Thu, 26 Dec 2024 13:16:38 -0800 -Subject: [PATCH] alloc_tag: avoid current->alloc_tag manipulations when - profiling is disabled - -commit 07438779313caafe52ac1a1a6958d735a5938988 upstream - -When memory allocation profiling is disabled there is no need to update -current->alloc_tag and these manipulations add unnecessary overhead. Fix -the overhead by skipping these extra updates. - -I ran comprehensive testing on Pixel 6 on Big, Medium and Little cores: - - Overhead before fixes Overhead after fixes - slab alloc page alloc slab alloc page alloc -Big 6.21% 5.32% 3.31% 4.93% -Medium 4.51% 5.05% 3.79% 4.39% -Little 7.62% 1.82% 6.68% 1.02% - -This is an allocation microbenchmark doing allocations in a tight loop. -Not a really realistic scenario and useful only to make performance -comparisons. - -Link: https://lkml.kernel.org/r/20241226211639.1357704-1-surenb@google.com -Fixes: b951aaff5035 ("mm: enable page allocation tagging") -Signed-off-by: Suren Baghdasaryan -Cc: David Wang <00107082@163.com> -Cc: Kent Overstreet -Cc: Yu Zhao -Cc: Zhenhua Huang -Signed-off-by: Andrew Morton -[Ankit: Backported for v6.12.1] -Signed-off-by: Ankit Jain ---- - include/linux/alloc_tag.h | 11 ++++++++--- - lib/alloc_tag.c | 1 + - 2 files changed, 9 insertions(+), 3 deletions(-) - -diff --git a/include/linux/alloc_tag.h b/include/linux/alloc_tag.h -index 941deffc590d..8f099e4da7fd 100644 ---- a/include/linux/alloc_tag.h -+++ b/include/linux/alloc_tag.h -@@ -202,9 +202,14 @@ static inline void alloc_tag_sub(union codetag_ref *ref, size_t bytes) {} - - #define alloc_hooks_tag(_tag, _do_alloc) \ - ({ \ -- struct alloc_tag * __maybe_unused _old = alloc_tag_save(_tag); \ -- typeof(_do_alloc) _res = _do_alloc; \ -- alloc_tag_restore(_tag, _old); \ -+ typeof(_do_alloc) _res; \ -+ if (mem_alloc_profiling_enabled()) { \ -+ struct alloc_tag * __maybe_unused _old; \ -+ _old = alloc_tag_save(_tag); \ -+ _res = _do_alloc; \ -+ alloc_tag_restore(_tag, _old); \ -+ } else \ -+ _res = _do_alloc; \ - _res; \ - }) - -diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c -index 81e5f9a70f22..832f79a32b3e 100644 ---- a/lib/alloc_tag.c -+++ b/lib/alloc_tag.c -@@ -15,6 +15,7 @@ EXPORT_SYMBOL(_shared_alloc_tag); - - DEFINE_STATIC_KEY_MAYBE(CONFIG_MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT, - mem_alloc_profiling_key); -+EXPORT_SYMBOL(mem_alloc_profiling_key); - - struct allocinfo_private { - struct codetag_iterator iter; --- -2.39.4 - diff --git a/SPECS/91/linux/generic/0001-cgroup-v1-cgroup_stat-support.patch b/SPECS/91/linux/generic/0001-cgroup-v1-cgroup_stat-support.patch deleted file mode 100644 index 848154c5f3..0000000000 --- a/SPECS/91/linux/generic/0001-cgroup-v1-cgroup_stat-support.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 16127c54bd8664b84a1a55aca45507e80f02695c Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Thu, 1 Apr 2021 03:28:10 +0000 -Subject: [PATCH] cgroup v1: cgroup.stat support - -Enabled cgroup statistic for cgroups version 1. - -Signed-off-by: Alexey Makhalov -Signed-off-by: Keerthana K - -[Srinidhi Rao Ported this patch to v6.12.x] -Signed-off-by: srinidhira0 ---- - include/linux/cgroup.h | 1 + - kernel/cgroup/cgroup-v1.c | 4 ++++ - kernel/cgroup/cgroup.c | 2 +- - 3 files changed, 6 insertions(+), 1 deletion(-) - -diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h -index f8ef47f8a634..6d0a380541ed 100644 ---- a/include/linux/cgroup.h -+++ b/include/linux/cgroup.h -@@ -120,6 +120,7 @@ void cgroup_file_show(struct cgroup_file *cfile, bool show); - int cgroupstats_build(struct cgroupstats *stats, struct dentry *dentry); - int proc_cgroup_show(struct seq_file *m, struct pid_namespace *ns, - struct pid *pid, struct task_struct *tsk); -+int cgroup_stat_show(struct seq_file *seq, void *v); - - void cgroup_fork(struct task_struct *p); - extern int cgroup_can_fork(struct task_struct *p, -diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c -index e28d5f0d20ed..bd13fabf8a80 100644 ---- a/kernel/cgroup/cgroup-v1.c -+++ b/kernel/cgroup/cgroup-v1.c -@@ -645,6 +645,10 @@ struct cftype cgroup1_base_files[] = { - .flags = CFTYPE_ONLY_ON_ROOT, - .seq_show = cgroup_sane_behavior_show, - }, -+ { -+ .name = "cgroup.stat", -+ .seq_show = cgroup_stat_show, -+ }, - { - .name = "tasks", - .seq_start = cgroup_pidlist_start, -diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c -index 044c7ba1cc48..0056b45d82f5 100644 ---- a/kernel/cgroup/cgroup.c -+++ b/kernel/cgroup/cgroup.c -@@ -3673,7 +3673,7 @@ static int cgroup_events_show(struct seq_file *seq, void *v) - return 0; - } - --static int cgroup_stat_show(struct seq_file *seq, void *v) -+int cgroup_stat_show(struct seq_file *seq, void *v) - { - struct cgroup *cgroup = seq_css(seq)->cgroup; - struct cgroup_subsys_state *css; --- -2.39.4 - diff --git a/SPECS/91/linux/generic/0001-mm-add-provision-to-disable-CONFIG_PER_VMA_LOCK.patch b/SPECS/91/linux/generic/0001-mm-add-provision-to-disable-CONFIG_PER_VMA_LOCK.patch deleted file mode 100644 index 00c1e60d2d..0000000000 --- a/SPECS/91/linux/generic/0001-mm-add-provision-to-disable-CONFIG_PER_VMA_LOCK.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 06da6052306d9eb1c136a108550f71ccecf9edb9 Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Tue, 21 Apr 2026 16:08:33 +0000 -Subject: [PATCH] mm: add provision to disable CONFIG_PER_VMA_LOCK - -A performance regression has been observed due to PER_VMA_LOCK. - -Remove ARCH_SUPPORTS_PER_VMA_LOCK from the X86_64 select config list, -allowing CONFIG_PER_VMA_LOCK to be disabled. - -Signed-off-by: Ajay Kaher - ---- - arch/x86/Kconfig | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index 36f833c6..5adc8a44 100644 ---- a/arch/x86/Kconfig -+++ b/arch/x86/Kconfig -@@ -27,7 +27,6 @@ config X86_64 - # Options that are inherently 64-bit kernel only: - select ARCH_HAS_GIGANTIC_PAGE - select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 -- select ARCH_SUPPORTS_PER_VMA_LOCK - select ARCH_SUPPORTS_HUGE_PFNMAP if TRANSPARENT_HUGEPAGE - select HAVE_ARCH_SOFT_DIRTY - select MODULES_USE_ELF_RELA --- -2.40.4 - diff --git a/SPECS/91/linux/generic/0001-perf-disasm-Constify-variables-storing-the-result-of.patch b/SPECS/91/linux/generic/0001-perf-disasm-Constify-variables-storing-the-result-of.patch deleted file mode 100644 index 04614674eb..0000000000 --- a/SPECS/91/linux/generic/0001-perf-disasm-Constify-variables-storing-the-result-of.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0a64c0c046e6b88c1668f742439a4e9a87dc904f Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Sun, 5 Apr 2026 15:04:29 +0000 -Subject: [PATCH 01/19] perf disasm: Constify variables storing the result of - bsearch() on const tables - -As newer glibcs will propagate the const attribute of the searched table -to its return. - -Signed-off-by: Arnaldo Carvalho de Melo -Signed-off-by: Vamsi Krishna Brahmajosyula ---- - tools/perf/util/disasm.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c -index 8a6f450c6..77cf6bd93 100644 ---- a/tools/perf/util/disasm.c -+++ b/tools/perf/util/disasm.c -@@ -865,7 +865,7 @@ static void ins__sort(struct arch *arch) - - static struct ins_ops *__ins__find(struct arch *arch, const char *name, struct disasm_line *dl) - { -- struct ins *ins; -+ const struct ins *ins; - const int nmemb = arch->nr_instructions; - - if (arch__is(arch, "powerpc")) { --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0001-randomize_kstack-Unify-random-source-across-arches.patch b/SPECS/91/linux/generic/0001-randomize_kstack-Unify-random-source-across-arches.patch deleted file mode 100644 index 76ace4c74c..0000000000 --- a/SPECS/91/linux/generic/0001-randomize_kstack-Unify-random-source-across-arches.patch +++ /dev/null @@ -1,415 +0,0 @@ -From a96ef5848cb096226bf6aff31a90d8b136d99b71 Mon Sep 17 00:00:00 2001 -From: Ryan Roberts -Date: Tue, 3 Mar 2026 15:08:39 +0000 -Subject: [PATCH] randomize_kstack: Unify random source across arches - -[ Upstream commit a96ef5848cb096226bf6aff31a90d8b136d99b71 ] - -Previously different architectures were using random sources of -differing strength and cost to decide the random kstack offset. A number -of architectures (loongarch, powerpc, s390, x86) were using their -timestamp counter, at whatever the frequency happened to be. Other -arches (arm64, riscv) were using entropy from the crng via -get_random_u16(). - -There have been concerns that in some cases the timestamp counters may -be too weak, because they can be easily guessed or influenced by user -space. And get_random_u16() has been shown to be too costly for the -level of protection kstack offset randomization provides. - -So let's use a common, architecture-agnostic source of entropy; a -per-cpu prng, seeded at boot-time from the crng. This has a few -benefits: - - - We can remove choose_random_kstack_offset(); That was only there to - try to make the timestamp counter value a bit harder to influence - from user space [*]. - - - The architecture code is simplified. All it has to do now is call - add_random_kstack_offset() in the syscall path. - - - The strength of the randomness can be reasoned about independently - of the architecture. - - - Arches previously using get_random_u16() now have much faster - syscall paths, see below results. - -[*] Additionally, this gets rid of some redundant work on s390 and x86. -Before this patch, those architectures called -choose_random_kstack_offset() under arch_exit_to_user_mode_prepare(), -which is also called for exception returns to userspace which were *not* -syscalls (e.g. regular interrupts). Getting rid of -choose_random_kstack_offset() avoids a small amount of redundant work -for the non-syscall cases. - -In some configurations, add_random_kstack_offset() will now call -instrumentable code, so for a couple of arches, I have moved the call a -bit later to the first point where instrumentation is allowed. This -doesn't impact the efficacy of the mechanism. - -There have been some claims that a prng may be less strong than the -timestamp counter if not regularly reseeded. But the prng has a period -of about 2^113. So as long as the prng state remains secret, it should -not be possible to guess. If the prng state can be accessed, we have -bigger problems. - -Additionally, we are only consuming 6 bits to randomize the stack, so -there are only 64 possible random offsets. I assert that it would be -trivial for an attacker to brute force by repeating their attack and -waiting for the random stack offset to be the desired one. The prng -approach seems entirely proportional to this level of protection. - -Performance data are provided below. The baseline is v6.18 with rndstack -on for each respective arch. (I)/(R) indicate statistically significant -improvement/regression. arm64 platform is AWS Graviton3 (m7g.metal). -x86_64 platform is AWS Sapphire Rapids (m7i.24xlarge): - -+-----------------+--------------+---------------+---------------+ -| Benchmark | Result Class | per-cpu-prng | per-cpu-prng | -| | | arm64 (metal) | x86_64 (VM) | -+=================+==============+===============+===============+ -| syscall/getpid | mean (ns) | (I) -9.50% | (I) -17.65% | -| | p99 (ns) | (I) -59.24% | (I) -24.41% | -| | p99.9 (ns) | (I) -59.52% | (I) -28.52% | -+-----------------+--------------+---------------+---------------+ -| syscall/getppid | mean (ns) | (I) -9.52% | (I) -19.24% | -| | p99 (ns) | (I) -59.25% | (I) -25.03% | -| | p99.9 (ns) | (I) -59.50% | (I) -28.17% | -+-----------------+--------------+---------------+---------------+ -| syscall/invalid | mean (ns) | (I) -10.31% | (I) -18.56% | -| | p99 (ns) | (I) -60.79% | (I) -20.06% | -| | p99.9 (ns) | (I) -61.04% | (I) -25.04% | -+-----------------+--------------+---------------+---------------+ - -I tested an earlier version of this change on x86 bare metal and it -showed a smaller but still significant improvement. The bare metal -system wasn't available this time around so testing was done in a VM -instance. I'm guessing the cost of rdtsc is higher for VMs. - -Acked-by: Mark Rutland -Signed-off-by: Ryan Roberts -Link: https://patch.msgid.link/20260303150840.3789438-3-ryan.roberts@arm.com -Signed-off-by: Kees Cook - -[Ankit: Backported for v6.12.95] -Signed-off-by: Ankit Jain ---- - arch/Kconfig | 5 ++- - arch/arm64/kernel/syscall.c | 11 ------ - arch/powerpc/kernel/syscall.c | 16 ++------- - arch/riscv/kernel/traps.c | 12 ------- - arch/x86/entry/common.c | 6 ++-- - arch/x86/include/asm/entry-common.h | 12 ------- - include/linux/randomize_kstack.h | 52 ++++++++++------------------- - include/linux/sched.h | 4 --- - init/main.c | 8 +++++ - kernel/fork.c | 1 - - 10 files changed, 32 insertions(+), 95 deletions(-) - -diff --git a/arch/Kconfig b/arch/Kconfig -index 1812e4e4d714..c60ce8b562a5 100644 ---- a/arch/Kconfig -+++ b/arch/Kconfig -@@ -1401,9 +1401,8 @@ config HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET - def_bool n - help - An arch should select this symbol if it can support kernel stack -- offset randomization with calls to add_random_kstack_offset() -- during syscall entry and choose_random_kstack_offset() during -- syscall exit. Careful removal of -fstack-protector-strong and -+ offset randomization with a call to add_random_kstack_offset() -+ during syscall entry. Careful removal of -fstack-protector-strong and - -fstack-protector should also be applied to the entry code and - closely examined, as the artificial stack bump looks like an array - to the compiler, so it will attempt to add canary checks regardless -diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c -index c442fcec6b9e..c689002408fa 100644 ---- a/arch/arm64/kernel/syscall.c -+++ b/arch/arm64/kernel/syscall.c -@@ -52,17 +52,6 @@ static void invoke_syscall(struct pt_regs *regs, unsigned int scno, - } - - syscall_set_return_value(current, regs, 0, ret); -- -- /* -- * This value will get limited by KSTACK_OFFSET_MAX(), which is 10 -- * bits. The actual entropy will be further reduced by the compiler -- * when applying stack alignment constraints: the AAPCS mandates a -- * 16-byte aligned SP at function boundaries, which will remove the -- * 4 low bits from any entropy chosen here. -- * -- * The resulting 6 bits of entropy is seen in SP[9:4]. -- */ -- choose_random_kstack_offset(get_random_u16()); - } - - static inline bool has_syscall_work(unsigned long flags) -diff --git a/arch/powerpc/kernel/syscall.c b/arch/powerpc/kernel/syscall.c -index be159ad4b77b..b762677f8737 100644 ---- a/arch/powerpc/kernel/syscall.c -+++ b/arch/powerpc/kernel/syscall.c -@@ -20,8 +20,6 @@ notrace long system_call_exception(struct pt_regs *regs, unsigned long r0) - - kuap_lock(); - -- add_random_kstack_offset(); -- - if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG)) - BUG_ON(irq_soft_mask_return() != IRQS_ALL_DISABLED); - -@@ -30,6 +28,8 @@ notrace long system_call_exception(struct pt_regs *regs, unsigned long r0) - CT_WARN_ON(ct_state() == CT_STATE_KERNEL); - user_exit_irqoff(); - -+ add_random_kstack_offset(); -+ - BUG_ON(regs_is_unrecoverable(regs)); - BUG_ON(!user_mode(regs)); - BUG_ON(arch_irq_disabled_regs(regs)); -@@ -173,17 +173,5 @@ notrace long system_call_exception(struct pt_regs *regs, unsigned long r0) - } - #endif - -- /* -- * Ultimately, this value will get limited by KSTACK_OFFSET_MAX(), -- * so the maximum stack offset is 1k bytes (10 bits). -- * -- * The actual entropy will be further reduced by the compiler when -- * applying stack alignment constraints: the powerpc architecture -- * may have two kinds of stack alignment (16-bytes and 8-bytes). -- * -- * So the resulting 6 or 7 bits of entropy is seen in SP[9:4] or SP[9:3]. -- */ -- choose_random_kstack_offset(mftb()); -- - return ret; - } -diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c -index 47afea4ff1a8..dfb91ed3a243 100644 ---- a/arch/riscv/kernel/traps.c -+++ b/arch/riscv/kernel/traps.c -@@ -344,18 +344,6 @@ void do_trap_ecall_u(struct pt_regs *regs) - syscall_handler(regs, syscall); - } - -- /* -- * Ultimately, this value will get limited by KSTACK_OFFSET_MAX(), -- * so the maximum stack offset is 1k bytes (10 bits). -- * -- * The actual entropy will be further reduced by the compiler when -- * applying stack alignment constraints: 16-byte (i.e. 4-bit) aligned -- * for RV32I or RV64I. -- * -- * The resulting 6 bits of entropy is seen in SP[9:4]. -- */ -- choose_random_kstack_offset(get_random_u16()); -- - syscall_exit_to_user_mode(regs); - } else { - irqentry_state_t state = irqentry_nmi_enter(regs); -diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c -index 7b9321c48a90..3f5bd1ed2cbd 100644 ---- a/arch/x86/entry/common.c -+++ b/arch/x86/entry/common.c -@@ -70,10 +70,10 @@ static __always_inline bool do_syscall_x32(struct pt_regs *regs, int nr) - /* Returns true to return using SYSRET, or false to use IRET */ - __visible noinstr bool do_syscall_64(struct pt_regs *regs, int nr) - { -- add_random_kstack_offset(); - nr = syscall_enter_from_user_mode(regs, nr); - - instrumentation_begin(); -+ add_random_kstack_offset(); - - if (!do_syscall_x64(regs, nr) && !do_syscall_x32(regs, nr) && nr != -1) { - /* Invalid system call, but still a system call. */ -@@ -322,7 +322,6 @@ __visible noinstr void do_int80_syscall_32(struct pt_regs *regs) - { - int nr = syscall_32_enter(regs); - -- add_random_kstack_offset(); - /* - * Subtlety here: if ptrace pokes something larger than 2^31-1 into - * orig_ax, the int return value truncates it. This matches -@@ -331,6 +330,7 @@ __visible noinstr void do_int80_syscall_32(struct pt_regs *regs) - nr = syscall_enter_from_user_mode(regs, nr); - instrumentation_begin(); - -+ add_random_kstack_offset(); - do_syscall_32_irqs_on(regs, nr); - - instrumentation_end(); -@@ -343,7 +343,6 @@ static noinstr bool __do_fast_syscall_32(struct pt_regs *regs) - int nr = syscall_32_enter(regs); - int res; - -- add_random_kstack_offset(); - /* - * This cannot use syscall_enter_from_user_mode() as it has to - * fetch EBP before invoking any of the syscall entry work -@@ -352,6 +351,7 @@ static noinstr bool __do_fast_syscall_32(struct pt_regs *regs) - syscall_enter_from_user_mode_prepare(regs); - - instrumentation_begin(); -+ add_random_kstack_offset(); - /* Fetch EBP from where the vDSO stashed it. */ - if (IS_ENABLED(CONFIG_X86_64)) { - /* -diff --git a/arch/x86/include/asm/entry-common.h b/arch/x86/include/asm/entry-common.h -index f71290eec4b1..d8836188067c 100644 ---- a/arch/x86/include/asm/entry-common.h -+++ b/arch/x86/include/asm/entry-common.h -@@ -81,18 +81,6 @@ static inline void arch_exit_to_user_mode_prepare(struct pt_regs *regs, - current_thread_info()->status &= ~(TS_COMPAT | TS_I386_REGS_POKED); - #endif - -- /* -- * This value will get limited by KSTACK_OFFSET_MAX(), which is 10 -- * bits. The actual entropy will be further reduced by the compiler -- * when applying stack alignment constraints (see cc_stack_align4/8 in -- * arch/x86/Makefile), which will remove the 3 (x86_64) or 2 (ia32) -- * low bits from any entropy chosen here. -- * -- * Therefore, final stack offset entropy will be 7 (x86_64) or -- * 8 (ia32) bits. -- */ -- choose_random_kstack_offset(rdtsc()); -- - /* Avoid unnecessary reads of 'x86_ibpb_exit_to_user' */ - if (cpu_feature_enabled(X86_FEATURE_IBPB_EXIT_TO_USER) && - this_cpu_read(x86_ibpb_exit_to_user)) { -diff --git a/include/linux/randomize_kstack.h b/include/linux/randomize_kstack.h -index 5d3916ca747c..024fc20e7762 100644 ---- a/include/linux/randomize_kstack.h -+++ b/include/linux/randomize_kstack.h -@@ -6,6 +6,7 @@ - #include - #include - #include -+#include - - DECLARE_STATIC_KEY_MAYBE(CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT, - randomize_kstack_offset); -@@ -45,9 +46,22 @@ DECLARE_STATIC_KEY_MAYBE(CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT, - #define KSTACK_OFFSET_MAX(x) ((x) & 0b1111111100) - #endif - -+DECLARE_PER_CPU(struct rnd_state, kstack_rnd_state); -+ -+static __always_inline u32 get_kstack_offset(void) -+{ -+ struct rnd_state *state; -+ u32 rnd; -+ -+ state = &get_cpu_var(kstack_rnd_state); -+ rnd = prandom_u32_state(state); -+ put_cpu_var(kstack_rnd_state); -+ -+ return rnd; -+} -+ - /** -- * add_random_kstack_offset - Increase stack utilization by previously -- * chosen random offset -+ * add_random_kstack_offset - Increase stack utilization by a random offset. - * - * This should be used in the syscall entry path after user registers have been - * stored to the stack. Preemption may be enabled. For testing the resulting -@@ -56,47 +70,15 @@ DECLARE_STATIC_KEY_MAYBE(CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT, - #define add_random_kstack_offset() do { \ - if (static_branch_maybe(CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT, \ - &randomize_kstack_offset)) { \ -- u32 offset = current->kstack_offset; \ -+ u32 offset = get_kstack_offset(); \ - u8 *ptr = __kstack_alloca(KSTACK_OFFSET_MAX(offset)); \ - /* Keep allocation even after "ptr" loses scope. */ \ - asm volatile("" :: "r"(ptr) : "memory"); \ - } \ - } while (0) - --/** -- * choose_random_kstack_offset - Choose the random offset for the next -- * add_random_kstack_offset() -- * -- * This should only be used during syscall exit. Preemption may be enabled. This -- * position in the syscall flow is done to frustrate attacks from userspace -- * attempting to learn the next offset: -- * - Maximize the timing uncertainty visible from userspace: if the -- * offset is chosen at syscall entry, userspace has much more control -- * over the timing between choosing offsets. "How long will we be in -- * kernel mode?" tends to be more difficult to predict than "how long -- * will we be in user mode?" -- * - Reduce the lifetime of the new offset sitting in memory during -- * kernel mode execution. Exposure of "thread-local" memory content -- * (e.g. current, percpu, etc) tends to be easier than arbitrary -- * location memory exposure. -- */ --#define choose_random_kstack_offset(rand) do { \ -- if (static_branch_maybe(CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT, \ -- &randomize_kstack_offset)) { \ -- u32 offset = current->kstack_offset; \ -- offset = ror32(offset, 5) ^ (rand); \ -- current->kstack_offset = offset; \ -- } \ --} while (0) -- --static inline void random_kstack_task_init(struct task_struct *tsk) --{ -- tsk->kstack_offset = 0; --} - #else /* CONFIG_RANDOMIZE_KSTACK_OFFSET */ - #define add_random_kstack_offset() do { } while (0) --#define choose_random_kstack_offset(rand) do { } while (0) --#define random_kstack_task_init(tsk) do { } while (0) - #endif /* CONFIG_RANDOMIZE_KSTACK_OFFSET */ - - #endif -diff --git a/include/linux/sched.h b/include/linux/sched.h -index f9ffe42cae17..cc379c389311 100644 ---- a/include/linux/sched.h -+++ b/include/linux/sched.h -@@ -1560,10 +1560,6 @@ struct task_struct { - unsigned long prev_lowest_stack; - #endif - --#ifdef CONFIG_RANDOMIZE_KSTACK_OFFSET -- u32 kstack_offset; --#endif -- - #ifdef CONFIG_X86_MCE - void __user *mce_vaddr; - __u64 mce_kflags; -diff --git a/init/main.c b/init/main.c -index dca88ac54c43..bda9ee2ab201 100644 ---- a/init/main.c -+++ b/init/main.c -@@ -835,6 +835,14 @@ static inline void initcall_debug_enable(void) - #ifdef CONFIG_RANDOMIZE_KSTACK_OFFSET - DEFINE_STATIC_KEY_MAYBE_RO(CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT, - randomize_kstack_offset); -+DEFINE_PER_CPU(struct rnd_state, kstack_rnd_state); -+ -+static int __init random_kstack_init(void) -+{ -+ prandom_seed_full_state(&kstack_rnd_state); -+ return 0; -+} -+late_initcall(random_kstack_init); - - static int __init early_randomize_kstack_offset(char *buf) - { -diff --git a/kernel/fork.c b/kernel/fork.c -index c81b45509e8a..6a3232d3b347 100644 ---- a/kernel/fork.c -+++ b/kernel/fork.c -@@ -2417,7 +2417,6 @@ __latent_entropy struct task_struct *copy_process( - if (retval) - goto bad_fork_cleanup_io; - -- random_kstack_task_init(p); - stackleak_task_init(p); - - if (pid != &init_struct_pid) { --- -2.53.0 - diff --git a/SPECS/91/linux/generic/0001-tools-power-turbostat-Skip-some-CPUID-checks-if-runn.patch b/SPECS/91/linux/generic/0001-tools-power-turbostat-Skip-some-CPUID-checks-if-runn.patch deleted file mode 100644 index 4e06ad6e24..0000000000 --- a/SPECS/91/linux/generic/0001-tools-power-turbostat-Skip-some-CPUID-checks-if-runn.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 3f7d953c5851efb29d494bb9b13382573363750e Mon Sep 17 00:00:00 2001 -From: "Srivatsa S. Bhat (VMware)" -Date: Tue, 21 Feb 2023 13:38:44 -0800 -Subject: [PATCH] tools/power turbostat: Skip some CPUID checks if running on - VMware hypervisor - -Turbostat hasn't really worked full-fledged within Linux guests on -ESXi, since some of the MSRs that it needs in order to gather data -have traditionally not been exposed to VMs by ESXi. - -This is going to change in newer versions of ESXi, where these MSRs -will be accessible from guests for read operations. In preparation to -get turbostat working in the guest with these underlying changes, skip -some CPUID checks while accessing certain MSRs when running on VMware -hypervisor. - -Skip CPUID checks for APERF/MPERF, CoreTmp and PkgTmp if running on -VMware hypervisor and query those MSRs directly. - -(Note that some of the data reported by turbostat will only be -valid/reliable if the guest has its vCPUs exclusively pinned to pCPUs, -because the data actually pertains to the underlying physical CPU, -such as the CPU frequency, thermal and power statistics.) - -Based-on-patch-by: Jim White -Signed-off-by: Srivatsa S. Bhat (VMware) ---- - tools/power/x86/turbostat/turbostat.c | 38 ++++++++++++++++++++++++++- - 1 file changed, 37 insertions(+), 1 deletion(-) - -diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c -index 089220aaa5c9..ec3ed1b7df63 100644 ---- a/tools/power/x86/turbostat/turbostat.c -+++ b/tools/power/x86/turbostat/turbostat.c -@@ -7943,6 +7943,8 @@ void process_cpuid() - unsigned int fms, family, model, stepping, ecx_flags, edx_flags; - unsigned long long ucode_patch = 0; - bool ucode_patch_valid = false; -+ unsigned int hyper_vendor_id[3]; -+ int retry_count; - - eax = ebx = ecx = edx = 0; - -@@ -7982,6 +7984,7 @@ void process_cpuid() - * This is needed to check for invariant TSC. - * This check is valid for both Intel and AMD. - */ -+ - ebx = ecx = edx = 0; - __cpuid(0x80000000, max_extended_level, ebx, ecx, edx); - -@@ -8025,13 +8028,46 @@ void process_cpuid() - * this check is valid for both Intel and AMD - */ - -+ /* -+ * Skip CPUID checks for APERF/MPERF, CoreTmp and PkgTmp if running -+ * on VMware hypervisor and query those MSRs directly. -+ */ -+ __cpuid(0x40000000, eax, hyper_vendor_id[0], hyper_vendor_id[1], -+ hyper_vendor_id[2]); -+ -+ if (!memcmp(hyper_vendor_id, "VMwareVMware", 12)) { -+ /* -+ * Verify that reading APERF/MPERF returns non-zero -+ * values before marking them as available, to make -+ * sure that the hypervisor does indeed support them. -+ */ -+ for (retry_count = 0; retry_count < 3; retry_count++) { -+ unsigned long long msr_aperf, msr_mperf; -+ -+ get_msr(base_cpu, MSR_IA32_APERF, &msr_aperf); -+ get_msr(base_cpu, MSR_IA32_MPERF, &msr_mperf); -+ if (msr_aperf != 0 && msr_mperf != 0) -+ break; -+ } -+ -+ if (retry_count < 3) -+ has_aperf = do_dts = do_ptm = 1; -+ } -+ - __cpuid(0x6, eax, ebx, ecx, edx); -- has_aperf = ecx & (1 << 0); -+ -+ if (!has_aperf) -+ has_aperf = ecx & (1 << 0); - do_dts = eax & (1 << 0); -+ -+ if (!do_dts) -+ do_dts = eax & (1 << 0); - if (do_dts) - BIC_PRESENT(BIC_CoreTmp); - has_turbo = eax & (1 << 1); - do_ptm = eax & (1 << 6); -+ if (!do_ptm) -+ do_ptm = eax & (1 << 6); - if (do_ptm) - BIC_PRESENT(BIC_PkgTmp); - has_hwp = eax & (1 << 7); --- -2.39.4 - diff --git a/SPECS/91/linux/generic/0002-perf-metricgroup-Constify-variables-storing-the-resu.patch b/SPECS/91/linux/generic/0002-perf-metricgroup-Constify-variables-storing-the-resu.patch deleted file mode 100644 index ff4eba00d3..0000000000 --- a/SPECS/91/linux/generic/0002-perf-metricgroup-Constify-variables-storing-the-resu.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 92961e6e1db99f1e3a7730079ee05405ac174d5b Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Sun, 5 Apr 2026 15:18:07 +0000 -Subject: [PATCH 02/19] perf metricgroup: Constify variables storing the result - of strchr() on const tables - -As newer glibcs will propagate the const attribute of the searched table -to its return. - -Signed-off-by: Arnaldo Carvalho de Melo -Signed-off-by: Vamsi Krishna Brahmajosyula ---- - tools/perf/util/metricgroup.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c -index 4dff3e925..3f75e17a6 100644 ---- a/tools/perf/util/metricgroup.c -+++ b/tools/perf/util/metricgroup.c -@@ -355,7 +355,7 @@ static int setup_metric_events(const char *pmu, struct hashmap *ids, - static bool match_metric(const char *metric_or_groups, const char *sought) - { - int len; -- char *m; -+ const char *m; - - if (!sought) - return false; -@@ -559,11 +559,10 @@ static const char *code_characters = ",-=@"; - - static int encode_metric_id(struct strbuf *sb, const char *x) - { -- char *c; - int ret = 0; - - for (; *x; x++) { -- c = strchr(code_characters, *x); -+ const char *c = strchr(code_characters, *x); - if (c) { - ret = strbuf_addch(sb, '!'); - if (ret) --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0003-perf-strlist-Don-t-write-to-const-memory.patch b/SPECS/91/linux/generic/0003-perf-strlist-Don-t-write-to-const-memory.patch deleted file mode 100644 index ded8a6fc1f..0000000000 --- a/SPECS/91/linux/generic/0003-perf-strlist-Don-t-write-to-const-memory.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 95b0fb25c29814df055477d5ce27427e58631d75 Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Tue, 27 Jan 2026 02:03:01 -0300 -Subject: [PATCH 03/19] perf strlist: Don't write to const memory - -Do a strdup to the list string and parse from it, free at the end. - -This is to deal with newer glibcs const-correctness. - -Signed-off-by: Arnaldo Carvalho de Melo ---- - tools/perf/util/strlist.c | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/tools/perf/util/strlist.c b/tools/perf/util/strlist.c -index 8a868cbef..98883672f 100644 ---- a/tools/perf/util/strlist.c -+++ b/tools/perf/util/strlist.c -@@ -139,21 +139,25 @@ static int strlist__parse_list_entry(struct strlist *slist, const char *s, - return err; - } - --static int strlist__parse_list(struct strlist *slist, const char *s, const char *subst_dir) -+static int strlist__parse_list(struct strlist *slist, const char *list, const char *subst_dir) - { -- char *sep; -+ char *sep, *s = strdup(list), *sdup = s; - int err; - -+ if (s == NULL) -+ return -ENOMEM; -+ - while ((sep = strchr(s, ',')) != NULL) { - *sep = '\0'; - err = strlist__parse_list_entry(slist, s, subst_dir); -- *sep = ','; - if (err != 0) - return err; - s = sep + 1; - } - -- return *s ? strlist__parse_list_entry(slist, s, subst_dir) : 0; -+ err = *s ? strlist__parse_list_entry(slist, s, subst_dir) : 0; -+ free(sdup); -+ return err; - } - - struct strlist *strlist__new(const char *list, const struct strlist_config *config) --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0004-perf-session-Don-t-write-to-memory-pointed-to-a-cons.patch b/SPECS/91/linux/generic/0004-perf-session-Don-t-write-to-memory-pointed-to-a-cons.patch deleted file mode 100644 index ca539eb9ae..0000000000 --- a/SPECS/91/linux/generic/0004-perf-session-Don-t-write-to-memory-pointed-to-a-cons.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 90df4148651c3e9b5a76e3189f77e76f2dc2a21d Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Tue, 27 Jan 2026 02:09:37 -0300 -Subject: [PATCH 04/19] perf session: Don't write to memory pointed to a const - pointer - -Since it is freshly allocated just attribute it to a non-const pointer -and then change it via that pointer. - -That way we avoid const-correctness warnings in recent glibc versions. - -Signed-off-by: Arnaldo Carvalho de Melo ---- - tools/perf/util/session.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c -index 89e5354fa..70df76f35 100644 ---- a/tools/perf/util/session.c -+++ b/tools/perf/util/session.c -@@ -2394,7 +2394,7 @@ bool perf_session__has_traces(struct perf_session *session, const char *msg) - - int map__set_kallsyms_ref_reloc_sym(struct map *map, const char *symbol_name, u64 addr) - { -- char *bracket; -+ char *bracket, *name; - struct ref_reloc_sym *ref; - struct kmap *kmap; - -@@ -2402,13 +2402,13 @@ int map__set_kallsyms_ref_reloc_sym(struct map *map, const char *symbol_name, u6 - if (ref == NULL) - return -ENOMEM; - -- ref->name = strdup(symbol_name); -+ ref->name = name = strdup(symbol_name); - if (ref->name == NULL) { - free(ref); - return -ENOMEM; - } - -- bracket = strchr(ref->name, ']'); -+ bracket = strchr(name, ']'); - if (bracket) - *bracket = '\0'; - --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0005-perf-trace-event-Constify-variables-storing-the-resu.patch b/SPECS/91/linux/generic/0005-perf-trace-event-Constify-variables-storing-the-resu.patch deleted file mode 100644 index ea7c9e3ff7..0000000000 --- a/SPECS/91/linux/generic/0005-perf-trace-event-Constify-variables-storing-the-resu.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 99519a574fbcb6b5149900ed8e9187b217606f0a Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Tue, 27 Jan 2026 01:15:47 -0300 -Subject: [PATCH 05/19] perf trace-event: Constify variables storing the result - of strchr() on const tables - -As newer glibcs will propagate the const attribute of the searched table -to its return. - -Signed-off-by: Arnaldo Carvalho de Melo ---- - tools/perf/util/trace-event-info.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c -index c87556792..45774722f 100644 ---- a/tools/perf/util/trace-event-info.c -+++ b/tools/perf/util/trace-event-info.c -@@ -482,7 +482,7 @@ char *tracepoint_id_to_name(u64 config) - static struct tracepoint_path *tracepoint_name_to_path(const char *name) - { - struct tracepoint_path *path = zalloc(sizeof(*path)); -- char *str = strchr(name, ':'); -+ const char *str = strchr(name, ':'); - - if (path == NULL || str == NULL) { - free(path); --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0006-perf-units-Constify-variables-storing-the-result-of-.patch b/SPECS/91/linux/generic/0006-perf-units-Constify-variables-storing-the-result-of-.patch deleted file mode 100644 index d2a7a25907..0000000000 --- a/SPECS/91/linux/generic/0006-perf-units-Constify-variables-storing-the-result-of-.patch +++ /dev/null @@ -1,30 +0,0 @@ -From f8cbe0a27606ed9829c0c4694462c20ea665f857 Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Tue, 27 Jan 2026 01:15:47 -0300 -Subject: [PATCH 06/19] perf units: Constify variables storing the result of - strchr() on const tables - -As newer glibcs will propagate the const attribute of the searched table -to its return. - -Signed-off-by: Arnaldo Carvalho de Melo ---- - tools/perf/util/units.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/perf/util/units.c b/tools/perf/util/units.c -index 4c6a86e1c..0bbacf5a2 100644 ---- a/tools/perf/util/units.c -+++ b/tools/perf/util/units.c -@@ -12,7 +12,7 @@ unsigned long parse_tag_value(const char *str, struct parse_tag *tags) - struct parse_tag *i = tags; - - while (i->tag) { -- char *s = strchr(str, i->tag); -+ const char *s = strchr(str, i->tag); - - if (s) { - unsigned long int value; --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0007-perf-time-utils-Constify-variables-storing-the-resul.patch b/SPECS/91/linux/generic/0007-perf-time-utils-Constify-variables-storing-the-resul.patch deleted file mode 100644 index 6d1417c418..0000000000 --- a/SPECS/91/linux/generic/0007-perf-time-utils-Constify-variables-storing-the-resul.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 0bc96f982ab71413ce8cde006d4d2f349b00bfd1 Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Tue, 27 Jan 2026 01:15:47 -0300 -Subject: [PATCH 07/19] perf time-utils: Constify variables storing the result - of strchr() on const tables - -As newer glibcs will propagate the const attribute of the searched table -to its return. - -Signed-off-by: Arnaldo Carvalho de Melo ---- - tools/perf/util/time-utils.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/tools/perf/util/time-utils.c b/tools/perf/util/time-utils.c -index 1b91ccd4d..d43c4577d 100644 ---- a/tools/perf/util/time-utils.c -+++ b/tools/perf/util/time-utils.c -@@ -325,7 +325,7 @@ static int percent_comma_split(struct perf_time_interval *ptime_buf, int num, - } - - static int one_percent_convert(struct perf_time_interval *ptime_buf, -- const char *ostr, u64 start, u64 end, char *c) -+ const char *ostr, u64 start, u64 end, const char *c) - { - char *str; - int len = strlen(ostr), ret; -@@ -358,7 +358,7 @@ static int one_percent_convert(struct perf_time_interval *ptime_buf, - int perf_time__percent_parse_str(struct perf_time_interval *ptime_buf, int num, - const char *ostr, u64 start, u64 end) - { -- char *c; -+ const char *c; - - /* - * ostr example: --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0008-perf-demangle-java-Constify-variables-storing-the-re.patch b/SPECS/91/linux/generic/0008-perf-demangle-java-Constify-variables-storing-the-re.patch deleted file mode 100644 index 15e8563ca7..0000000000 --- a/SPECS/91/linux/generic/0008-perf-demangle-java-Constify-variables-storing-the-re.patch +++ /dev/null @@ -1,30 +0,0 @@ -From d1b835a708f6a3853db42c0e1f6817fe9fb2e37b Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Tue, 27 Jan 2026 01:15:47 -0300 -Subject: [PATCH 08/19] perf demangle-java: Constify variables storing the - result of strchr() on const tables - -As newer glibcs will propagate the const attribute of the searched table -to its return. - -Signed-off-by: Arnaldo Carvalho de Melo ---- - tools/perf/util/demangle-java.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/perf/util/demangle-java.c b/tools/perf/util/demangle-java.c -index ddf33d58b..c3cb327ed 100644 ---- a/tools/perf/util/demangle-java.c -+++ b/tools/perf/util/demangle-java.c -@@ -158,7 +158,7 @@ char * - java_demangle_sym(const char *str, int flags) - { - char *buf, *ptr; -- char *p; -+ const char *p; - size_t len, l1 = 0; - - if (!str) --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0009-perf-bpf-event-Constify-variables-storing-the-result.patch b/SPECS/91/linux/generic/0009-perf-bpf-event-Constify-variables-storing-the-result.patch deleted file mode 100644 index 33e6e42154..0000000000 --- a/SPECS/91/linux/generic/0009-perf-bpf-event-Constify-variables-storing-the-result.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 877be8889da99a866f260a28d14003099ceca991 Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Tue, 27 Jan 2026 01:15:47 -0300 -Subject: [PATCH 09/19] perf bpf-event: Constify variables storing the result - of strchr() on const tables - -As newer glibcs will propagate the const attribute of the searched table -to its return. - -Signed-off-by: Arnaldo Carvalho de Melo ---- - tools/perf/util/bpf-event.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c -index d9123c963..572ef0be6 100644 ---- a/tools/perf/util/bpf-event.c -+++ b/tools/perf/util/bpf-event.c -@@ -357,7 +357,8 @@ kallsyms_process_symbol(void *data, const char *_name, - char type __maybe_unused, u64 start) - { - char disp[KSYM_NAME_LEN]; -- char *module, *name; -+ const char *module; -+ char *name; - unsigned long id; - int err = 0; - --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0010-perf-jitdump-Constify-variables-storing-the-result-o.patch b/SPECS/91/linux/generic/0010-perf-jitdump-Constify-variables-storing-the-result-o.patch deleted file mode 100644 index 2d50daa7fb..0000000000 --- a/SPECS/91/linux/generic/0010-perf-jitdump-Constify-variables-storing-the-result-o.patch +++ /dev/null @@ -1,31 +0,0 @@ -From bc1d82ed49e34641247120ea22e203fa80f0a031 Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Sun, 5 Apr 2026 15:49:55 +0000 -Subject: [PATCH 10/19] perf jitdump: Constify variables storing the result of - strchr() on const tables - -As newer glibcs will propagate the const attribute of the searched table -to its return. - -Signed-off-by: Arnaldo Carvalho de Melo -Signed-off-by: Vamsi Krishna Brahmajosyula ---- - tools/perf/util/jitdump.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c -index 346513e5e..888242d21 100644 ---- a/tools/perf/util/jitdump.c -+++ b/tools/perf/util/jitdump.c -@@ -739,7 +739,7 @@ jit_inject(struct jit_buf_desc *jd, const char *path) - static int - jit_detect(const char *mmap_name, pid_t pid, struct nsinfo *nsi) - { -- char *p; -+ const char *p; - char *end = NULL; - pid_t pid2; - --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0011-perf-list-Remove-unused-sep-variable.patch b/SPECS/91/linux/generic/0011-perf-list-Remove-unused-sep-variable.patch deleted file mode 100644 index 87ba065511..0000000000 --- a/SPECS/91/linux/generic/0011-perf-list-Remove-unused-sep-variable.patch +++ /dev/null @@ -1,42 +0,0 @@ -From c15fe01340729c9aaf55a581d6ef170113a9e6d4 Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Sun, 5 Apr 2026 17:27:43 +0000 -Subject: [PATCH 11/19] perf list: Remove unused 'sep' variable - -It is just being set to the return of strchr() but never used, just -ditch it and with it get rid of a warning about it not being const on -fedora 44. - -Reviewed-by: Ian Rogers -Link: https://lore.kernel.org/r/20251211221756.96294-2-acme@kernel.org -Signed-off-by: Arnaldo Carvalho de Melo -Signed-off-by: Vamsi Krishna Brahmajosyula ---- - tools/perf/builtin-list.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c -index c5331721d..c39edcb81 100644 ---- a/tools/perf/builtin-list.c -+++ b/tools/perf/builtin-list.c -@@ -604,7 +604,7 @@ int cmd_list(int argc, const char **argv) - } - - for (i = 0; i < argc; ++i) { -- char *sep, *s; -+ char *s; - - if (strcmp(argv[i], "tracepoint") == 0) - print_tracepoint_events(&print_cb, ps); -@@ -638,7 +638,7 @@ int cmd_list(int argc, const char **argv) - else if (strcmp(argv[i], "pfm") == 0) - print_libpfm_events(&print_cb, ps); - #endif -- else if ((sep = strchr(argv[i], ':')) != NULL) { -+ else if ((strchr(argv[i], ':')) != NULL) { - char *old_pmu_glob = default_ps.pmu_glob; - - default_ps.event_glob = strdup(argv[i]); --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0012-perf-diff-Constify-strchr-return-variables.patch b/SPECS/91/linux/generic/0012-perf-diff-Constify-strchr-return-variables.patch deleted file mode 100644 index 7e0324e709..0000000000 --- a/SPECS/91/linux/generic/0012-perf-diff-Constify-strchr-return-variables.patch +++ /dev/null @@ -1,68 +0,0 @@ -From ea90e111948e01fbc9f8c6979fb4408b1fa2c99d Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Thu, 11 Dec 2025 19:17:54 -0300 -Subject: [PATCH 12/19] perf diff: Constify strchr() return variables - -Newer glibc versions return const char for strchr() when the 's' arg is -const, change the return variable to const to match that. - -Also we don't need to turn that ',' into a '\0', as strtol() will stop -in the first invalid char. No need to touch read only memory. - -First noticed with fedora 44. - -Reviewed-by: Ian Rogers -Link: https://lore.kernel.org/r/20251211221756.96294-3-acme@kernel.org -Signed-off-by: Arnaldo Carvalho de Melo ---- - tools/perf/builtin-diff.c | 12 +++++------- - 1 file changed, 5 insertions(+), 7 deletions(-) - -diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c -index 23326dd20..71e00562c 100644 ---- a/tools/perf/builtin-diff.c -+++ b/tools/perf/builtin-diff.c -@@ -177,10 +177,9 @@ static struct header_column { - } - }; - --static int setup_compute_opt_wdiff(char *opt) -+static int setup_compute_opt_wdiff(const char *opt) - { -- char *w1_str = opt; -- char *w2_str; -+ const char *w1_str = opt, *w2_str; - - int ret = -EINVAL; - -@@ -191,8 +190,7 @@ static int setup_compute_opt_wdiff(char *opt) - if (!w2_str) - goto out; - -- *w2_str++ = 0x0; -- if (!*w2_str) -+ if (!*++w2_str) - goto out; - - compute_wdiff_w1 = strtol(w1_str, NULL, 10); -@@ -213,7 +211,7 @@ static int setup_compute_opt_wdiff(char *opt) - return ret; - } - --static int setup_compute_opt(char *opt) -+static int setup_compute_opt(const char *opt) - { - if (compute == COMPUTE_WEIGHTED_DIFF) - return setup_compute_opt_wdiff(opt); -@@ -233,7 +231,7 @@ static int setup_compute(const struct option *opt, const char *str, - char *cstr = (char *) str; - char buf[50]; - unsigned i; -- char *option; -+ const char *option; - - if (!str) { - *cp = COMPUTE_DELTA; --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0013-perf-tools-Use-const-for-variables-receiving-str-str.patch b/SPECS/91/linux/generic/0013-perf-tools-Use-const-for-variables-receiving-str-str.patch deleted file mode 100644 index 0c5c8187e3..0000000000 --- a/SPECS/91/linux/generic/0013-perf-tools-Use-const-for-variables-receiving-str-str.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 6e5dca80bc574de9be127179a2b7674cf340d062 Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Sun, 5 Apr 2026 17:45:37 +0000 -Subject: [PATCH 13/19] perf tools: Use const for variables receiving - str{str,r?chr}() returns - -Newer glibc versions return const char for str{str,chr}() where the -haystack/s is const so to avoid warnings like these on fedora 44 change -some variables to const: - - 36 8.17 fedora:44 : FAIL gcc version 15.2.1 20251111 (Red Hat 15.2.1-4) (GCC) - libbpf.c: In function 'kallsyms_cb': - libbpf.c:8489:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] - 8489 | res = strstr(sym_name, ".llvm."); - -Reviewed-by: Ian Rogers -Link: https://lore.kernel.org/r/20251211221756.96294-4-acme@kernel.org -Signed-off-by: Arnaldo Carvalho de Melo -Signed-off-by: Vamsi Krishna Brahmajosyula ---- - tools/perf/jvmti/libjvmti.c | 2 +- - tools/perf/util/evlist.c | 3 ++- - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/tools/perf/jvmti/libjvmti.c b/tools/perf/jvmti/libjvmti.c -index fcca275e5..d6b04d0fd 100644 ---- a/tools/perf/jvmti/libjvmti.c -+++ b/tools/perf/jvmti/libjvmti.c -@@ -142,7 +142,7 @@ copy_class_filename(const char * class_sign, const char * file_name, char * resu - */ - if (*class_sign == 'L') { - int j, i = 0; -- char *p = strrchr(class_sign, '/'); -+ const char *p = strrchr(class_sign, '/'); - if (p) { - /* drop the 'L' prefix and copy up to the final '/' */ - for (i = 0; i < (p - class_sign); i++) -diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c -index dac87dcca..9a7dcd05f 100644 ---- a/tools/perf/util/evlist.c -+++ b/tools/perf/util/evlist.c -@@ -1995,7 +1995,8 @@ static int evlist__parse_control_fifo(const char *str, int *ctl_fd, int *ctl_fd_ - - int evlist__parse_control(const char *str, int *ctl_fd, int *ctl_fd_ack, bool *ctl_fd_close) - { -- char *comma = NULL, *endptr = NULL; -+ const char *comma = NULL; -+ char *endptr = NULL; - - *ctl_fd_close = false; - --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0014-perf-trace-Don-t-change-const-char-strings.patch b/SPECS/91/linux/generic/0014-perf-trace-Don-t-change-const-char-strings.patch deleted file mode 100644 index b10fd854f0..0000000000 --- a/SPECS/91/linux/generic/0014-perf-trace-Don-t-change-const-char-strings.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 6ef0b4645b9661a371d2e2b632be4e7554bb20ba Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Thu, 11 Dec 2025 19:17:56 -0300 -Subject: [PATCH 14/19] perf trace: Don't change const char strings - -We got away with this so far but now with fedora 44 complaining about -the return value of strchr et all, lets use strdup for good measure. - -Reviewed-by: Ian Rogers -Link: https://lore.kernel.org/r/20251211221756.96294-5-acme@kernel.org -Signed-off-by: Arnaldo Carvalho de Melo ---- - tools/perf/builtin-trace.c | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - -diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c -index f77e4f4b6..02dd9138f 100644 ---- a/tools/perf/builtin-trace.c -+++ b/tools/perf/builtin-trace.c -@@ -4909,8 +4909,8 @@ static int trace__parse_events_option(const struct option *opt, const char *str, - int unset __maybe_unused) - { - struct trace *trace = (struct trace *)opt->value; -- const char *s = str; -- char *sep = NULL, *lists[2] = { NULL, NULL, }; -+ const char *s; -+ char *strd, *sep = NULL, *lists[2] = { NULL, NULL, }; - int len = strlen(str) + 1, err = -1, list, idx; - char *strace_groups_dir = system_path(STRACE_GROUPS_DIR); - char group_name[PATH_MAX]; -@@ -4919,6 +4919,10 @@ static int trace__parse_events_option(const struct option *opt, const char *str, - if (strace_groups_dir == NULL) - return -1; - -+ s = strd = strdup(str); -+ if (strd == NULL) -+ return -1; -+ - if (*s == '!') { - ++s; - trace->not_ev_qualifier = true; -@@ -4992,8 +4996,7 @@ static int trace__parse_events_option(const struct option *opt, const char *str, - free(strace_groups_dir); - free(lists[0]); - free(lists[1]); -- if (sep) -- *sep = ','; -+ free(strd); - - return err; - } --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0015-perf-list-Don-t-write-to-const-memory.patch b/SPECS/91/linux/generic/0015-perf-list-Don-t-write-to-const-memory.patch deleted file mode 100644 index 862b035ed2..0000000000 --- a/SPECS/91/linux/generic/0015-perf-list-Don-t-write-to-const-memory.patch +++ /dev/null @@ -1,49 +0,0 @@ -From f5af604d88285899202c985ecb4bc08cad0e71de Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Tue, 20 Jan 2026 18:16:09 -0300 -Subject: [PATCH 15/19] perf list: Don't write to const memory - -Something now detected on fedora 44, where strchr() returns const if it -is passed a const pointer: - - util/print-events.c: In function 'print_sdt_events': - util/print-events.c:89:29: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] - 89 | char *bid = strchr(sdt_name->s, '@'); - | ^~~~~~ - -Fix it by using strchrnul() + strncmp() instead of temporarily scrubbing -it with '\0'. - -Reviewed-by: Ian Rogers -Suggested-by: David Laight -Link: https://lore.kernel.org/r/20260121112536.27fd5d11@pumpkin -Signed-off-by: Arnaldo Carvalho de Melo ---- - tools/perf/util/print-events.c | 11 +++-------- - 1 file changed, 3 insertions(+), 8 deletions(-) - -diff --git a/tools/perf/util/print-events.c b/tools/perf/util/print-events.c -index a1c71d979..3624a3c79 100644 ---- a/tools/perf/util/print-events.c -+++ b/tools/perf/util/print-events.c -@@ -202,14 +202,9 @@ void print_sdt_events(const struct print_callbacks *print_cb, void *print_state) - } else { - next_sdt_name = strlist__next(sdt_name); - if (next_sdt_name) { -- char *bid2 = strchr(next_sdt_name->s, '@'); -- -- if (bid2) -- *bid2 = '\0'; -- if (strcmp(sdt_name->s, next_sdt_name->s) == 0) -- show_detail = true; -- if (bid2) -- *bid2 = '@'; -+ const char *bid2 = strchrnul(next_sdt_name->s, '@'); -+ -+ show_detail = strncmp(sdt_name->s, next_sdt_name->s, bid2 - next_sdt_name->s) == 0; - } - } - last_sdt_name = sdt_name->s; --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0016-perf-trace-Deal-with-compiler-const-checks.patch b/SPECS/91/linux/generic/0016-perf-trace-Deal-with-compiler-const-checks.patch deleted file mode 100644 index f294f991bd..0000000000 --- a/SPECS/91/linux/generic/0016-perf-trace-Deal-with-compiler-const-checks.patch +++ /dev/null @@ -1,34 +0,0 @@ -From f26507f36a9960e69676fd2cf73ebd72a2cf6a96 Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Tue, 20 Jan 2026 17:57:43 -0300 -Subject: [PATCH 16/19] perf trace: Deal with compiler const checks - -The strchr() function these days return const/non-const based on the arg -it receives, and sometimes we need to use casts when we're dealing with -variables that are used in code that needs to safely change the returned -value and sometimes not (as it points to really const areas). - -Tweak one such case. - -Reviewed-by: Ian Rogers -Signed-off-by: Arnaldo Carvalho de Melo ---- - tools/perf/builtin-trace.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c -index 02dd9138f..05835495e 100644 ---- a/tools/perf/builtin-trace.c -+++ b/tools/perf/builtin-trace.c -@@ -4929,7 +4929,7 @@ static int trace__parse_events_option(const struct option *opt, const char *str, - } - - while (1) { -- if ((sep = strchr(s, ',')) != NULL) -+ if ((sep = strchr((char *)s, ',')) != NULL) - *sep = '\0'; - - list = 0; --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0017-perf-print-events-Fix-compiler-issues-with-newer-gil.patch b/SPECS/91/linux/generic/0017-perf-print-events-Fix-compiler-issues-with-newer-gil.patch deleted file mode 100644 index 435659a641..0000000000 --- a/SPECS/91/linux/generic/0017-perf-print-events-Fix-compiler-issues-with-newer-gil.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 900e22d8e024f4113243ea16cba2cfea1a41cba0 Mon Sep 17 00:00:00 2001 -From: Vamsi Krishna Brahmajosyula -Date: Sun, 5 Apr 2026 18:21:27 +0000 -Subject: [PATCH 17/19] perf print events: Fix compiler issues with newer gilbc - -In newer glibc, strstr function returns const char * based -on input constant string, handle this by casting to char * - -Signed-off-by: Vamsi Krishna Brahmajosyula ---- - tools/perf/util/print-events.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/perf/util/print-events.c b/tools/perf/util/print-events.c -index 3624a3c79..850c7acfc 100644 ---- a/tools/perf/util/print-events.c -+++ b/tools/perf/util/print-events.c -@@ -387,7 +387,7 @@ void print_symbol_events(const struct print_callbacks *print_cb, void *print_sta - } - - strlist__for_each_entry(nd, evt_name_list) { -- char *alias = strstr(nd->s, " OR "); -+ char *alias = strstr((char *)nd->s, " OR "); - - if (alias) { - *alias = '\0'; --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0018-perf-list-Signal-changing-const-memory-is-ok.patch b/SPECS/91/linux/generic/0018-perf-list-Signal-changing-const-memory-is-ok.patch deleted file mode 100644 index 5c66a0e286..0000000000 --- a/SPECS/91/linux/generic/0018-perf-list-Signal-changing-const-memory-is-ok.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 5d384844ab266357702a3e4d9b9aabc1109ae948 Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Tue, 20 Jan 2026 18:26:44 -0300 -Subject: [PATCH 18/19] perf list: Signal changing const memory is ok - -In this case its a temp list that is created just for listing events and -will be deleted at the end, so just cast it to get rid of the compiler -warning. - -Reviewed-by: Ian Rogers -Signed-off-by: Arnaldo Carvalho de Melo ---- - tools/perf/util/print-events.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/perf/util/print-events.c b/tools/perf/util/print-events.c -index 850c7acfc..a5d9a6ccc 100644 ---- a/tools/perf/util/print-events.c -+++ b/tools/perf/util/print-events.c -@@ -191,7 +191,7 @@ void print_sdt_events(const struct print_callbacks *print_cb, void *print_state) - - strlist__for_each_entry(sdt_name, sdtlist) { - bool show_detail = false; -- char *bid = strchr(sdt_name->s, '@'); -+ char *bid = (char *)strchr(sdt_name->s, '@'); - char *evt_name = NULL; - - if (bid) --- -2.43.7 - diff --git a/SPECS/91/linux/generic/0019-perf-tools-Remove-unused-color_fwrite_lines.patch b/SPECS/91/linux/generic/0019-perf-tools-Remove-unused-color_fwrite_lines.patch deleted file mode 100644 index a513394d53..0000000000 --- a/SPECS/91/linux/generic/0019-perf-tools-Remove-unused-color_fwrite_lines.patch +++ /dev/null @@ -1,75 +0,0 @@ -From ca3ac344a067e9f6d16d0ba8ed687360fda1942c Mon Sep 17 00:00:00 2001 -From: "Dr. David Alan Gilbert" -Date: Wed, 9 Oct 2024 01:39:38 +0100 -Subject: [PATCH 19/19] perf tools: Remove unused color_fwrite_lines - -color_fwrite_lines() was added by 2009's commit -8fc0321f1ad0 ("perf_counter tools: Add color terminal output support") - -but has never been used. - -Remove it. - -Signed-off-by: Dr. David Alan Gilbert -Reviewed-by: Ian Rogers -Link: https://lore.kernel.org/r/20241009003938.254936-1-linux@treblig.org -Signed-off-by: Namhyung Kim ---- - tools/perf/util/color.c | 28 ---------------------------- - tools/perf/util/color.h | 1 - - 2 files changed, 29 deletions(-) - -diff --git a/tools/perf/util/color.c b/tools/perf/util/color.c -index bffbdd216..e51f0a676 100644 ---- a/tools/perf/util/color.c -+++ b/tools/perf/util/color.c -@@ -93,34 +93,6 @@ int color_fprintf(FILE *fp, const char *color, const char *fmt, ...) - return r; - } - --/* -- * This function splits the buffer by newlines and colors the lines individually. -- * -- * Returns 0 on success. -- */ --int color_fwrite_lines(FILE *fp, const char *color, -- size_t count, const char *buf) --{ -- if (!*color) -- return fwrite(buf, count, 1, fp) != 1; -- -- while (count) { -- char *p = memchr(buf, '\n', count); -- -- if (p != buf && (fputs(color, fp) < 0 || -- fwrite(buf, p ? (size_t)(p - buf) : count, 1, fp) != 1 || -- fputs(PERF_COLOR_RESET, fp) < 0)) -- return -1; -- if (!p) -- return 0; -- if (fputc('\n', fp) < 0) -- return -1; -- count -= p + 1 - buf; -- buf = p + 1; -- } -- return 0; --} -- - const char *get_percent_color(double percent) - { - const char *color = PERF_COLOR_NORMAL; -diff --git a/tools/perf/util/color.h b/tools/perf/util/color.h -index 01f7bed21..aecf56dae 100644 ---- a/tools/perf/util/color.h -+++ b/tools/perf/util/color.h -@@ -39,7 +39,6 @@ int color_vsnprintf(char *bf, size_t size, const char *color, - int color_vfprintf(FILE *fp, const char *color, const char *fmt, va_list args); - int color_fprintf(FILE *fp, const char *color, const char *fmt, ...); - int color_snprintf(char *bf, size_t size, const char *color, const char *fmt, ...); --int color_fwrite_lines(FILE *fp, const char *color, size_t count, const char *buf); - int value_color_snprintf(char *bf, size_t size, const char *fmt, double value); - int percent_color_snprintf(char *bf, size_t size, const char *fmt, ...); - int percent_color_len_snprintf(char *bf, size_t size, const char *fmt, ...); --- -2.43.7 - diff --git a/SPECS/91/linux/generic/9p-support-for-local-file-lock.patch b/SPECS/91/linux/generic/9p-support-for-local-file-lock.patch deleted file mode 100644 index 2768b17ebf..0000000000 --- a/SPECS/91/linux/generic/9p-support-for-local-file-lock.patch +++ /dev/null @@ -1,124 +0,0 @@ -From ca6ad55ed9bd661d88a3099ba66c52f97a0f54d8 Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Fri, 22 May 2020 05:16:15 +0000 -Subject: [PATCH] 9p: support for local file lock - -Implementation of the local lock only from the perspective -of current kernel. Can be used to speedup performance when -the client has monopoly access to server resource or/and -where 9p server does not support file locking. -Can be enabled by "local_lock" mount options. ---- - Documentation/filesystems/9p.rst | 4 ++++ - fs/9p/v9fs.c | 7 +++++++ - fs/9p/v9fs.h | 3 ++- - fs/9p/vfs_file.c | 11 +++++++++-- - 4 files changed, 22 insertions(+), 3 deletions(-) - -diff --git a/Documentation/filesystems/9p.rst b/Documentation/filesystems/9p.rst -index 2bbf68b56..523e036da 100644 ---- a/Documentation/filesystems/9p.rst -+++ b/Documentation/filesystems/9p.rst -@@ -238,6 +238,10 @@ Options - cachetag cache tag to use the specified persistent cache. - cache tags for existing cache sessions can be listed at - /sys/fs/9p/caches. (applies only to cache=fscache) -+ -+ local_lock Use only local posix locking from the perspective of "this" -+ kernel. Do not perform server side locking. -+ - ============= =============================================================== - - Behavior -diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c -index 281a1ed03..45fe8f39f 100644 ---- a/fs/9p/v9fs.c -+++ b/fs/9p/v9fs.c -@@ -43,6 +43,8 @@ enum { - Opt_access, Opt_posixacl, - /* Lock timeout option */ - Opt_locktimeout, -+ /* Local lock */ -+ Opt_local_lock, - /* Error token */ - Opt_err - }; -@@ -63,6 +65,7 @@ static const match_table_t tokens = { - {Opt_access, "access=%s"}, - {Opt_posixacl, "posixacl"}, - {Opt_locktimeout, "locktimeout=%u"}, -+ {Opt_local_lock, "local_lock"}, - {Opt_err, NULL} - }; - -@@ -369,6 +372,10 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts) - v9ses->session_lock_timeout = (long)option * HZ; - break; - -+ case Opt_local_lock: -+ v9ses->flags |= V9FS_LOCAL_LOCK; -+ break; -+ - default: - continue; - } -diff --git a/fs/9p/v9fs.h b/fs/9p/v9fs.h -index 698c43dd5..9dd33721d 100644 ---- a/fs/9p/v9fs.h -+++ b/fs/9p/v9fs.h -@@ -40,7 +40,8 @@ enum p9_session_flags { - V9FS_NO_XATTR = 0x40, - V9FS_IGNORE_QV = 0x80, /* ignore qid.version for cache hints */ - V9FS_DIRECT_IO = 0x100, -- V9FS_SYNC = 0x200 -+ V9FS_SYNC = 0x200, -+ V9FS_LOCAL_LOCK = 0x400 - }; - - /** -diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c -index 348cc90bf..afd5aecde 100644 ---- a/fs/9p/vfs_file.c -+++ b/fs/9p/vfs_file.c -@@ -132,6 +132,10 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl) - if (res < 0) - goto out; - -+ v9ses = v9fs_inode2v9ses(file_inode(filp)); -+ if (v9ses->flags & V9FS_LOCAL_LOCK) -+ goto out; -+ - /* convert posix lock to p9 tlock args */ - memset(&flock, 0, sizeof(flock)); - /* map the lock type */ -@@ -156,8 +160,6 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl) - if (IS_SETLKW(cmd)) - flock.flags = P9_LOCK_FLAGS_BLOCK; - -- v9ses = v9fs_inode2v9ses(file_inode(filp)); -- - /* - * if its a blocked request and we get P9_LOCK_BLOCKED as the status - * for lock request, keep on trying -@@ -224,6 +226,7 @@ static int v9fs_file_getlock(struct file *filp, struct file_lock *fl) - { - struct p9_getlock glock; - struct p9_fid *fid; -+ struct v9fs_session_info *v9ses; - int res = 0; - - fid = filp->private_data; -@@ -237,6 +240,10 @@ static int v9fs_file_getlock(struct file *filp, struct file_lock *fl) - if (fl->c.flc_type != F_UNLCK) - return res; - -+ v9ses = v9fs_inode2v9ses(file_inode(filp)); -+ if (v9ses->flags & V9FS_LOCAL_LOCK) -+ return res; -+ - /* convert posix lock to p9 tgetlock args */ - memset(&glock, 0, sizeof(glock)); - glock.type = P9_LOCK_TYPE_UNLCK; --- -2.39.4 - diff --git a/SPECS/91/linux/generic/9p-trans_fd-extend-port-variable-to-u32.patch b/SPECS/91/linux/generic/9p-trans_fd-extend-port-variable-to-u32.patch deleted file mode 100644 index 7bced1862f..0000000000 --- a/SPECS/91/linux/generic/9p-trans_fd-extend-port-variable-to-u32.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 423138ae07d7739040d37d67eddca7d9a7ae0fb8 Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Wed, 5 Jun 2019 17:17:28 -0700 -Subject: [PATCH 05/12] 9p: trans_fd: extend port variable to u32 - -This patch is an addition to vsock transport for 9p patch. -vsock layer uses 32 bits for the port number but trans_fd -options parser limits it to 16 bits. It is safe to extend -it since it is internal structure and does not break -existing code. ---- - net/9p/trans_fd.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c -index e7ec72e..5d42d84 100644 ---- a/net/9p/trans_fd.c -+++ b/net/9p/trans_fd.c -@@ -53,7 +53,7 @@ static struct p9_trans_module p9_fd_trans; - struct p9_fd_opts { - int rfd; - int wfd; -- u16 port; -+ u32 port; - bool privport; - }; - --- -2.7.4 - diff --git a/SPECS/91/linux/generic/SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch b/SPECS/91/linux/generic/SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch deleted file mode 100644 index b32653653f..0000000000 --- a/SPECS/91/linux/generic/SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 5ff0b9e728e23e54001c2bb6df29d85ac2c5e08f Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Fri, 25 Mar 2016 21:51:12 +0000 -Subject: [PATCH] sunrpc: xs_bind uses ip_local_reserved_ports - ---- - net/sunrpc/xprtsock.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c -index 2ffaf6a..90543d6 100644 ---- a/net/sunrpc/xprtsock.c -+++ b/net/sunrpc/xprtsock.c -@@ -1798,9 +1798,11 @@ static unsigned short xs_next_srcport(struct sock_xprt *transport, unsigned shor - static int xs_bind(struct sock_xprt *transport, struct socket *sock) - { - struct sockaddr_storage myaddr; -- int err, nloop = 0; -+ int err = -EADDRINUSE; -+ int nloop = 0; - int port = xs_get_srcport(transport); - unsigned short last; -+ struct net *net = transport->xprt.xprt_net; - - /* - * If we are asking for any ephemeral port (i.e. port == 0 && -@@ -1822,6 +1824,8 @@ static int xs_bind(struct sock_xprt *transport, struct socket *sock) - - memcpy(&myaddr, &transport->srcaddr, transport->xprt.addrlen); - do { -+ if (inet_is_local_reserved_port(net, port)) -+ goto next_port; - rpc_set_port((struct sockaddr *)&myaddr, port); - err = kernel_bind(sock, (struct sockaddr *)&myaddr, - transport->xprt.addrlen); -@@ -1829,6 +1833,7 @@ static int xs_bind(struct sock_xprt *transport, struct socket *sock) - transport->srcport = port; - break; - } -+next_port: - last = port; - port = xs_next_srcport(transport, port); - if (port > last) --- -1.9.1 - diff --git a/SPECS/91/linux/generic/net-Double-tcp_mem-limits.patch b/SPECS/91/linux/generic/net-Double-tcp_mem-limits.patch deleted file mode 100644 index c6d5661787..0000000000 --- a/SPECS/91/linux/generic/net-Double-tcp_mem-limits.patch +++ /dev/null @@ -1,25 +0,0 @@ -From ce17bb6cade0e08571f01516e23c8398549fdf17 Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Tue, 9 May 2017 12:32:51 -0700 -Subject: [PATCH 01/23] net: Double tcp_mem limits - ---- - net/ipv4/tcp.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c -index deb466f..c024ab7 100644 ---- a/net/ipv4/tcp.c -+++ b/net/ipv4/tcp.c -@@ -3932,7 +3932,7 @@ __setup("thash_entries=", set_thash_entries); - - static void __init tcp_init_mem(void) - { -- unsigned long limit = nr_free_buffer_pages() / 16; -+ unsigned long limit = nr_free_buffer_pages() / 8; - - limit = max(limit, 128UL); - sysctl_tcp_mem[0] = limit / 4 * 3; /* 4.68 % */ --- -2.7.4 - diff --git a/SPECS/91/linux/generic/usb-acm-exclude-exar-usb-serial-ports-nxt.patch b/SPECS/91/linux/generic/usb-acm-exclude-exar-usb-serial-ports-nxt.patch deleted file mode 100644 index ff6ccd2310..0000000000 --- a/SPECS/91/linux/generic/usb-acm-exclude-exar-usb-serial-ports-nxt.patch +++ /dev/null @@ -1,37 +0,0 @@ -From fd97f0f45ae85eddc1a1ec36849be0a9d80fd235 Mon Sep 17 00:00:00 2001 -From: Bo Gan -Date: Fri, 20 Mar 2020 17:54:18 -0700 -Subject: [PATCH 10/23] usb-acm-exclude-exar-usb-serial-ports - ---- - drivers/usb/class/cdc-acm.c | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c -index 2f4e5174e78c..72c239f65f13 100644 ---- a/drivers/usb/class/cdc-acm.c -+++ b/drivers/usb/class/cdc-acm.c -@@ -2011,6 +2011,20 @@ static const struct usb_device_id acm_ids[] = { - { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, - USB_CDC_PROTO_NONE) }, - -+ /* Exclude Exar USB serial ports */ -+ { USB_DEVICE(0x04e2, 0x1400), .driver_info = IGNORE_DEVICE, }, -+ { USB_DEVICE(0x04e2, 0x1401), .driver_info = IGNORE_DEVICE, }, -+ { USB_DEVICE(0x04e2, 0x1402), .driver_info = IGNORE_DEVICE, }, -+ { USB_DEVICE(0x04e2, 0x1403), .driver_info = IGNORE_DEVICE, }, -+ { USB_DEVICE(0x04e2, 0x1410), .driver_info = IGNORE_DEVICE, }, -+ { USB_DEVICE(0x04e2, 0x1411), .driver_info = IGNORE_DEVICE, }, -+ { USB_DEVICE(0x04e2, 0x1412), .driver_info = IGNORE_DEVICE, }, -+ { USB_DEVICE(0x04e2, 0x1414), .driver_info = IGNORE_DEVICE, }, -+ { USB_DEVICE(0x04e2, 0x1420), .driver_info = IGNORE_DEVICE, }, -+ { USB_DEVICE(0x04e2, 0x1421), .driver_info = IGNORE_DEVICE, }, -+ { USB_DEVICE(0x04e2, 0x1422), .driver_info = IGNORE_DEVICE, }, -+ { USB_DEVICE(0x04e2, 0x1424), .driver_info = IGNORE_DEVICE, }, -+ - /* control interfaces with various AT-command sets */ - { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, - USB_CDC_ACM_PROTO_AT_V25TER) }, --- -2.17.1 - diff --git a/SPECS/91/linux/generic/vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch b/SPECS/91/linux/generic/vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch deleted file mode 100644 index a066b5ad3b..0000000000 --- a/SPECS/91/linux/generic/vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 854580e7451ba741bddbc832f5df12e16ba43f02 Mon Sep 17 00:00:00 2001 -From: Rolf Neugebauer -Date: Mon, 23 May 2016 18:55:45 +0100 -Subject: [PATCH 11/23] vmbus: Don't spam the logs with unknown GUIDs - -With Hyper-V sockets device types are introduced on the fly. The pr_info() -then prints a message on every connection, which is way too verbose. Since -there doesn't seem to be an easy way to check for registered services, -disable the pr_info() completely. - -Signed-off-by: Rolf Neugebauer ---- - drivers/hv/channel_mgmt.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c -index 8eb1675..5a07371 100644 ---- a/drivers/hv/channel_mgmt.c -+++ b/drivers/hv/channel_mgmt.c -@@ -181,7 +181,6 @@ static u16 hv_get_dev_type(const struct vmbus_channel *channel) - if (guid_equal(guid, &vmbus_devs[i].guid)) - return i; - } -- pr_info("Unknown GUID: %pUl\n", guid); - return i; - } - --- -2.7.4 - diff --git a/SPECS/91/linux/generic/vsock-delay-detach-of-QP-with-outgoing-data-59.patch b/SPECS/91/linux/generic/vsock-delay-detach-of-QP-with-outgoing-data-59.patch deleted file mode 100644 index b8a3291fec..0000000000 --- a/SPECS/91/linux/generic/vsock-delay-detach-of-QP-with-outgoing-data-59.patch +++ /dev/null @@ -1,168 +0,0 @@ -From 028ec946534a0b2c3c401aae66ec4d34b9bbaa62 Mon Sep 17 00:00:00 2001 -From: Jorgen Hansen -Date: Thu, 22 Aug 2019 04:43:38 -0700 -Subject: [PATCH] VSOCK: Delay detach of QP with outgoing data - -This patch is intended for WCP, and will be applied to Photon OS 3.0 as a -patch. We will consider upstreaming this at a later point in time. - -When detaching from a QP, the content of the QP may become inaccessible to -the peer. To handle that, we keep the QP around for a maximum of 2 minutes -while waiting for the data of the QP to be consumed by the peer. In the -following cases, the QP will be freed even if outgoing data is still -present: -- the peer detaches -- the vmci vsock transport is unloaded -- the data has not been consumed within 2 minutes - -Signed-off-by: Jorgen Hansen -Reviewed-by: Adit Ranadive -Reviewed-by: Vishnu Dasa ---- - net/vmw_vsock/vmci_transport.c | 46 ++++++++++++++++++++++++++++++++++++++---- - net/vmw_vsock/vmci_transport.h | 1 + - 2 files changed, 43 insertions(+), 4 deletions(-) - -diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c -index 8b65323..cdc3884 100644 ---- a/net/vmw_vsock/vmci_transport.c -+++ b/net/vmw_vsock/vmci_transport.c -@@ -10,6 +10,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -68,6 +69,8 @@ struct vmci_transport_recv_pkt_info { - static LIST_HEAD(vmci_transport_cleanup_list); - static DEFINE_SPINLOCK(vmci_transport_cleanup_lock); - static DECLARE_WORK(vmci_transport_cleanup_work, vmci_transport_cleanup); -+static DECLARE_DELAYED_WORK(vmci_qp_delayed_detach_work, -+ vmci_transport_cleanup); - - static struct vmci_handle vmci_transport_stream_handle = { VMCI_INVALID_ID, - VMCI_INVALID_ID }; -@@ -80,6 +80,18 @@ static int PROTOCOL_OVERRIDE = -1; - - static struct vsock_transport vmci_transport; /* forward declaration */ - -+/* The default peer timeout indicates how long we will wait for a peer response -+ * to a control message. -+ */ -+#define VSOCK_DEFAULT_CONNECT_TIMEOUT (2 * HZ) -+ -+/* The close wait timeout indicates how long we'll keep a queue pair around -+ * after a detach - in the case where there is still data left in the queue -+ * pair. -+ */ -+#define VSOCK_CLOSE_WAIT_TIMEOUT_JIF (120 * HZ) -+#define VSOCK_CLOSE_WAIT_RETRY_TIMEOUT (10 * HZ) -+ - /* Helper function to convert from a VMCI error code to a VSock error code. */ - - static s32 vmci_transport_error_to_vsock_error(s32 vmci_error) -@@ -847,6 +862,7 @@ static void vmci_transport_peer_detach_cb(u32 sub_id, - { - struct vmci_transport *trans = client_data; - const struct vmci_event_payload_qp *e_payload; -+ bool schedule_cleanup = false; - - e_payload = vmci_event_data_const_payload(e_data); - -@@ -864,8 +880,11 @@ static void vmci_transport_peer_detach_cb(u32 sub_id, - * need to account for all possible contexts here. - */ - spin_lock_bh(&trans->lock); -- if (!trans->sk) -+ if (!trans->sk) { -+ schedule_cleanup = true; -+ trans->close_wait_timeout_jif = jiffies - 1; - goto out; -+ } - - /* Apart from here, trans->lock is only grabbed as part of sk destruct, - * where trans->sk isn't locked. -@@ -877,6 +896,8 @@ static void vmci_transport_peer_detach_cb(u32 sub_id, - bh_unlock_sock(trans->sk); - out: - spin_unlock_bh(&trans->lock); -+ if (schedule_cleanup) -+ schedule_work(&vmci_transport_cleanup_work); - } - - static void vmci_transport_qp_resumed_cb(u32 sub_id, -@@ -1592,7 +1613,8 @@ static int vmci_transport_socket_init(struct vsock_sock *vsk, - return 0; - } - --static void vmci_transport_free_resources(struct list_head *transport_list) -+static void vmci_transport_free_resources(struct list_head *transport_list, -+ bool force) - { - while (!list_empty(transport_list)) { - struct vmci_transport *transport = -@@ -1600,6 +1622,19 @@ static void vmci_transport_free_resources(struct list_head *transport_list) - elem); - list_del(&transport->elem); - -+ if (!vmci_handle_is_invalid(transport->qp_handle) && !force && -+ time_is_after_jiffies(transport->close_wait_timeout_jif) && -+ vmci_qpair_produce_buf_ready(transport->qpair) > 0) { -+ /* Peer hasn't read the data yet - delay detach. */ -+ spin_lock_bh(&vmci_transport_cleanup_lock); -+ list_add(&transport->elem, -+ &vmci_transport_cleanup_list); -+ spin_unlock_bh(&vmci_transport_cleanup_lock); -+ schedule_delayed_work(&vmci_qp_delayed_detach_work, -+ VSOCK_CLOSE_WAIT_RETRY_TIMEOUT); -+ continue; -+ } -+ - if (transport->detach_sub_id != VMCI_INVALID_ID) { - vmci_event_unsubscribe(transport->detach_sub_id); - transport->detach_sub_id = VMCI_INVALID_ID; -@@ -1623,7 +1658,7 @@ static void vmci_transport_cleanup(struct work_struct *work) - spin_lock_bh(&vmci_transport_cleanup_lock); - list_replace_init(&vmci_transport_cleanup_list, &pending); - spin_unlock_bh(&vmci_transport_cleanup_lock); -- vmci_transport_free_resources(&pending); -+ vmci_transport_free_resources(&pending, false); - } - - static void vmci_transport_destruct(struct vsock_sock *vsk) -@@ -1637,6 +1672,8 @@ static void vmci_transport_destruct(struct vsock_sock *vsk) - */ - spin_lock_bh(&vmci_trans(vsk)->lock); - vmci_trans(vsk)->sk = NULL; -+ vmci_trans(vsk)->close_wait_timeout_jif = jiffies + -+ VSOCK_CLOSE_WAIT_TIMEOUT_JIF; - spin_unlock_bh(&vmci_trans(vsk)->lock); - - if (vmci_trans(vsk)->notify_ops) -@@ -2119,7 +2156,8 @@ module_init(vmci_transport_init); - static void __exit vmci_transport_exit(void) - { - cancel_work_sync(&vmci_transport_cleanup_work); -- vmci_transport_free_resources(&vmci_transport_cleanup_list); -+ cancel_delayed_work_sync(&vmci_qp_delayed_detach_work); -+ vmci_transport_free_resources(&vmci_transport_cleanup_list, true); - - if (!vmci_handle_is_invalid(vmci_transport_stream_handle)) { - if (vmci_datagram_destroy_handle( -diff --git a/net/vmw_vsock/vmci_transport.h b/net/vmw_vsock/vmci_transport.h -index b7b0721..b3d6618 100644 ---- a/net/vmw_vsock/vmci_transport.h -+++ b/net/vmw_vsock/vmci_transport.h -@@ -108,6 +108,7 @@ struct vmci_transport { - struct vmci_qp *qpair; - u64 produce_size; - u64 consume_size; -+ unsigned long close_wait_timeout_jif; - u32 detach_sub_id; - union vmci_transport_notify notify; - const struct vmci_transport_notify_ops *notify_ops; --- -2.17.1 - diff --git a/SPECS/91/linux/hcx/0001-Active-probing-of-dst-mac-of-unknown-unicast.patch b/SPECS/91/linux/hcx/0001-Active-probing-of-dst-mac-of-unknown-unicast.patch deleted file mode 100644 index 07e6c29b10..0000000000 --- a/SPECS/91/linux/hcx/0001-Active-probing-of-dst-mac-of-unknown-unicast.patch +++ /dev/null @@ -1,586 +0,0 @@ -From 22b8422ef4e6ec2f15c132de226b7aea1a2ecb4d Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Fri, 19 Dec 2025 18:17:28 +0530 -Subject: [PATCH 01/15] Active probing of dst mac of unknown unicast - -Actively do arp probe when received an unknown unicast. -We just send arp probe back the receiving port in stand of -flooding all the other ports. - -Add some stats counters for troubleshooting purpose. -Add a option arp_probe to enable or disable this function. - -Change value of arp_probe_per_packets to change the frequence -of arp probing. Skip unknown unicast from gretap dev. - -Add proc variable arp_probe_src_mac to let user specify the -source mac of probing packet. - -Add port flag "sink_connected", if this flag on means -this a l2c tapdevice connected. Do not send arp probe for the -packet coming form port with this flag. - -Signed-off-by: Srish Srinivasan -[Guru: Ported to the 6.12 kernel by repositioning the code -to ensure it applies cleanly and fixed some compilation errors] -Signed-off-by: Guruswamy Basavaiah ---- - include/linux/if_bridge.h | 1 + - include/uapi/linux/if_link.h | 1 + - net/bridge/br.c | 7 + - net/bridge/br_device.c | 12 +- - net/bridge/br_input.c | 255 +++++++++++++++++++++++++++++++++++ - net/bridge/br_netlink.c | 5 + - net/bridge/br_private.h | 14 ++ - net/bridge/br_sysfs_br.c | 24 ++++ - net/bridge/br_sysfs_if.c | 2 + - net/core/rtnetlink.c | 4 +- - 10 files changed, 323 insertions(+), 2 deletions(-) - -diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h -index 3ff96ae31bf6..056238a97f23 100644 ---- a/include/linux/if_bridge.h -+++ b/include/linux/if_bridge.h -@@ -61,6 +61,7 @@ struct br_ip_list { - #define BR_PORT_LOCKED BIT(21) - #define BR_PORT_MAB BIT(22) - #define BR_NEIGH_VLAN_SUPPRESS BIT(23) -+#define BR_SINK_CONNECTED BIT(30) - - #define BR_DEFAULT_AGEING_TIME (300 * HZ) - -diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h -index 2acc7687e017..e1c734e29d21 100644 ---- a/include/uapi/linux/if_link.h -+++ b/include/uapi/linux/if_link.h -@@ -1094,6 +1094,7 @@ enum { - IFLA_BRPORT_MCAST_MAX_GROUPS, - IFLA_BRPORT_NEIGH_VLAN_SUPPRESS, - IFLA_BRPORT_BACKUP_NHID, -+ IFLA_BRPORT_SINK_CONNECTED = 60, - __IFLA_BRPORT_MAX - }; - #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) -diff --git a/net/bridge/br.c b/net/bridge/br.c -index 35e9842f4203..7cde464b5bed 100644 ---- a/net/bridge/br.c -+++ b/net/bridge/br.c -@@ -441,6 +441,10 @@ static int __init br_init(void) - "need this.\n"); - #endif - -+#ifdef CONFIG_SYSCTL -+ br_input_sysctl_init(); -+#endif -+ - return 0; - - err_out6: -@@ -477,6 +481,9 @@ static void __exit br_deinit(void) - br_fdb_test_addr_hook = NULL; - #endif - br_fdb_fini(); -+#ifdef CONFIG_SYSCTL -+ br_input_sysctl_fini(); -+#endif - } - - module_init(br_init) -diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c -index 26b79feb385d..b76f0aec8c5a 100644 ---- a/net/bridge/br_device.c -+++ b/net/bridge/br_device.c -@@ -119,18 +119,26 @@ static int br_dev_init(struct net_device *dev) - struct net_bridge *br = netdev_priv(dev); - int err; - -+ br->ukn_stats = alloc_percpu_gfp(struct ukn_unicast_stats, GFP_KERNEL); -+ if (!br->ukn_stats) -+ return -ENOMEM; -+ - err = br_fdb_hash_init(br); -- if (err) -+ if (err) { -+ free_percpu(br->ukn_stats); - return err; -+ } - - err = br_mdb_hash_init(br); - if (err) { -+ free_percpu(br->ukn_stats); - br_fdb_hash_fini(br); - return err; - } - - err = br_vlan_init(br); - if (err) { -+ free_percpu(br->ukn_stats); - br_mdb_hash_fini(br); - br_fdb_hash_fini(br); - return err; -@@ -138,6 +146,7 @@ static int br_dev_init(struct net_device *dev) - - err = br_multicast_init_stats(br); - if (err) { -+ free_percpu(br->ukn_stats); - br_vlan_flush(br); - br_mdb_hash_fini(br); - br_fdb_hash_fini(br); -@@ -157,6 +166,7 @@ static void br_dev_uninit(struct net_device *dev) - br_vlan_flush(br); - br_mdb_hash_fini(br); - br_fdb_hash_fini(br); -+ free_percpu(br->ukn_stats); - } - - static int br_dev_open(struct net_device *dev) -diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c -index 2eb2bb664388..c7c0e27033ac 100644 ---- a/net/bridge/br_input.c -+++ b/net/bridge/br_input.c -@@ -23,6 +23,21 @@ - #include "br_private.h" - #include "br_private_tunnel.h" - -+#ifdef CONFIG_SYSCTL -+#include -+static int proc_arp_probe_src_mac(const struct ctl_table *table, int write, -+ void *buffer, -+ size_t *lenp, loff_t *ppos); -+static struct ctl_table_header *br_input_sysctl_header; -+int br_arp_probe __read_mostly = 1; -+int br_arp_probe_per_packets __read_mostly = 8192; -+u8 br_arp_probe_src_mac[ETH_ALEN+1] = {0}; -+int br_arp_probe_src_mac_set = 0; -+#else -+#define br_arp_probe 1 -+#define br_arp_probe_per_packets 8192 -+#endif -+ - static int - br_netif_receive_skb(struct net *net, struct sock *sk, struct sk_buff *skb) - { -@@ -30,6 +45,145 @@ br_netif_receive_skb(struct net *net, struct sock *sk, struct sk_buff *skb) - return netif_receive_skb(skb); - } - -+#ifdef CONFIG_SYSCTL -+/* addr string should be in format like 00:50:56:A8:EF:F3 */ -+static int string_to_mac(char *mac, u8 *macs, int len) -+{ -+ int n; -+ -+ n = sscanf(macs, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", -+ &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5]); -+ -+ if ( n != 6 ) { -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static int proc_arp_probe_src_mac(const struct ctl_table *table, int write, -+ void *buffer, -+ size_t *lenp, loff_t *ppos) -+{ -+ char *data; -+ char macs[ETH_ALEN * 3]; -+ char macz[ETH_ALEN+1] = {0}; -+ char mac[ETH_ALEN+1]; -+ size_t len, maxlen; -+ char *buf = buffer; -+ -+ if (!*lenp || (*ppos && !write)) { -+ *lenp = 0; -+ return 0; -+ } -+ -+ if (write) { -+ len = *lenp > 17 ? 17 : *lenp; -+ if (len != 17) { -+ printk(KERN_ERR "length %lu or format of mac address is invalid, " -+ "should be in format as 00:50:56:A8:EF:F3", len); -+ return -EINVAL; -+ } -+ -+ memcpy(macs, buffer, len); -+ -+ macs[17] = 0; -+ -+ if (string_to_mac(mac, macs, len) ) { -+ printk(KERN_ERR "invalid format of mac address %s, should be in " \ -+ "format as 00:50:56:A8:EF:F3\n", macs); -+ return -EINVAL; -+ } -+ -+ memcpy(br_arp_probe_src_mac, mac, ETH_ALEN); -+ br_arp_probe_src_mac[ETH_ALEN] = 0; -+ -+ if (memcmp(mac, macz, ETH_ALEN) == 0) { -+ br_arp_probe_src_mac_set = 0; -+ } else { -+ br_arp_probe_src_mac_set = 1; -+ } -+ -+ *ppos += len; -+ -+ return 0; -+ -+ } else { -+ if (memcmp(br_arp_probe_src_mac, macz, ETH_ALEN)) -+ snprintf(macs, sizeof(macs), "%*phC", ETH_ALEN, br_arp_probe_src_mac); -+ else -+ macs[0] = '\0'; -+ -+ buf = buffer; -+ data = macs; -+ len = strlen(macs); -+ maxlen = sizeof(macs); -+ -+ if (len > maxlen) -+ len = maxlen; -+ -+ if (*ppos > len) { -+ *lenp = 0; -+ return 0; -+ } -+ -+ data += *ppos; -+ len -= *ppos; -+ -+ if (len > *lenp) -+ len = *lenp; -+ if (len) -+ memcpy(buffer, data, len); -+ if (len < *lenp) { -+ buf[len] = '\n'; -+ len++; -+ } -+ *lenp = len; -+ *ppos += len; -+ return 0; -+ } -+} -+ -+static struct ctl_table br_input_table[] = { -+ { -+ .procname = "arp_probe", -+ .data = &br_arp_probe, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec, -+ }, -+ { -+ .procname = "arp_probe_per_packets", -+ .data = &br_arp_probe_per_packets, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec, -+ }, -+ { -+ .procname = "arp_probe_src_mac", -+ .data = &br_arp_probe_src_mac, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_arp_probe_src_mac, -+ }, -+}; -+ -+int br_input_sysctl_init(void) -+{ -+ br_input_sysctl_header = register_net_sysctl(&init_net, "net/bridge", br_input_table); -+ if (br_input_sysctl_header == NULL) { -+ printk(KERN_ERR "br: can't register to sysctl.\n"); -+ return -ENOMEM; -+ } -+ return 0; -+} -+ -+void br_input_sysctl_fini(void) -+{ -+ unregister_net_sysctl_table(br_input_sysctl_header); -+} -+#endif -+ - static int br_pass_frame_up(struct sk_buff *skb, bool promisc) - { - struct net_device *indev, *brdev = BR_INPUT_SKB_CB(skb)->brdev; -@@ -72,6 +226,104 @@ static int br_pass_frame_up(struct sk_buff *skb, bool promisc) - br_netif_receive_skb); - } - -+/* -+ * under certain circumstances, emit packet to solicit response -+ * from which bridge can learn. -+ */ -+static void br_proactive_learn( -+ struct net_bridge *br, struct net_bridge_port *p, struct sk_buff *skb) -+{ -+ const struct ethhdr *ethhdr; -+ struct sk_buff *skb2; -+ const u8 *daddr = NULL, *dest_hw = NULL, *src_hw = NULL; -+ struct ukn_unicast_stats *stats = this_cpu_ptr(br->ukn_stats); -+ u32 vlan, buf; -+ -+ if (!br_arp_probe) { -+ return; -+ } -+ -+ if (unlikely(!skb->dev)) { -+ printk_ratelimited(KERN_WARNING "%s: dev of skb %p is null, failed " \ -+ "to creat arp probe", __FUNCTION__, skb); -+ return; -+ } -+ -+ /* Skip unknown unicast coming from gretap dev, which means this packet is -+ * from remote site. If its destination mac is at remote, remote bridge -+ * will send out arp probe. If its destincation mac is actually local, the -+ * reverse packet will create the mac entry in local fdb. So no needs to -+ * send arp probe back to gretap over l2c tunnel. -+ */ -+ if (!(p->flags & BR_SINK_CONNECTED)) { -+ return; -+ } -+ -+ stats->ukn_unicast_total_rcvd++; -+ -+ /* do sanity check on skb */ -+ if (skb->protocol != cpu_to_be16(ETH_P_IP)) { -+ return; -+ } -+ -+ /* check the size of IP header */ -+ if (unlikely(skb->len < sizeof(struct iphdr))) { -+ printk_ratelimited(KERN_WARNING "%s: can't parse destination IP, " \ -+ "header size is less than %lu", __FUNCTION__, sizeof(struct iphdr)); -+ return; -+ } -+ -+ /* If skb_headlen is less than 20, get daddr from buffer of skb header */ -+ daddr = skb_header_pointer(skb, offsetof(struct iphdr, daddr), -+ sizeof(u32), &buf); -+ if (!daddr) { -+ printk_ratelimited(KERN_WARNING "%s: Failed to get daddr, skb_headlen " -+ "is %d", __FUNCTION__, skb_headlen(skb)); -+ return; -+ } -+ -+ /* every of unknown unicast received, we trigger -+ * an arp probe per CPU. -+ */ -+ stats->ukn_unicast_ip_rcvd++; -+ if (br_arp_probe_per_packets && -+ (stats->ukn_unicast_ip_rcvd%br_arp_probe_per_packets)) { -+ return; -+ } -+ -+ if (likely(skb_mac_header_was_set(skb))) { -+ ethhdr = eth_hdr(skb); -+ dest_hw = ethhdr->h_dest; -+ } -+ -+ if (br_arp_probe_src_mac_set) { -+ src_hw = br_arp_probe_src_mac; -+ }else { -+ src_hw = skb->dev->dev_addr; -+ } -+ -+ /* skb->dev is actually dev of bridge port */ -+ skb2 = arp_create(ARPOP_REQUEST, ETH_P_ARP, *(__be32*)(daddr), skb->dev, -+ 0, dest_hw, src_hw, NULL); -+ if (!skb2) { -+ printk_ratelimited(KERN_ERR "Failed to create proactive learning " \ -+ "ARP request"); -+ stats->ukn_unicast_arp_create_err++; -+ return; -+ } -+ -+ /* copy the input vlan tag to arp probe */ -+ vlan = skb_vlan_tag_get(skb); -+ if (vlan != 0) { -+ __vlan_hwaccel_put_tag(skb2, cpu_to_be16(ETH_P_8021Q), vlan); -+ } -+ -+ dev_queue_xmit(skb2); -+ stats->ukn_unicast_total_probe_sent++; -+ -+ return; -+} -+ - /* note: already called with rcu_read_lock */ - int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb) - { -@@ -211,6 +463,9 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb - WRITE_ONCE(dst->used, now); - br_forward(READ_ONCE(dst->dst), skb, local_rcv, false); - } else { -+ if (pkt_type == BR_PKT_UNICAST) { -+ br_proactive_learn(br, p, skb); -+ } - if (!mcast_hit) - br_flood(br, skb, pkt_type, local_rcv, false, vid); - else -diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c -index 6b97ae47f855..1af43bf2e786 100644 ---- a/net/bridge/br_netlink.c -+++ b/net/bridge/br_netlink.c -@@ -190,6 +190,7 @@ static inline size_t br_port_info_size(void) - + nla_total_size(1) /* IFLA_BRPORT_LOCKED */ - + nla_total_size(1) /* IFLA_BRPORT_MAB */ - + nla_total_size(1) /* IFLA_BRPORT_NEIGH_VLAN_SUPPRESS */ -+ + nla_total_size(1) /* IFLA_BRPORT_SINK_CONNECTED */ - + nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_ROOT_ID */ - + nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_BRIDGE_ID */ - + nla_total_size(sizeof(u16)) /* IFLA_BRPORT_DESIGNATED_PORT */ -@@ -258,6 +259,8 @@ static int br_port_fill_attrs(struct sk_buff *skb, - nla_put_u8(skb, IFLA_BRPORT_PROXYARP, !!(p->flags & BR_PROXYARP)) || - nla_put_u8(skb, IFLA_BRPORT_PROXYARP_WIFI, - !!(p->flags & BR_PROXYARP_WIFI)) || -+ nla_put_u8(skb, IFLA_BRPORT_SINK_CONNECTED, -+ !!(p->flags & BR_SINK_CONNECTED)) || - nla_put(skb, IFLA_BRPORT_ROOT_ID, sizeof(struct ifla_bridge_id), - &p->designated_root) || - nla_put(skb, IFLA_BRPORT_BRIDGE_ID, sizeof(struct ifla_bridge_id), -@@ -886,6 +889,7 @@ static const struct nla_policy br_port_policy[IFLA_BRPORT_MAX + 1] = { - [IFLA_BRPORT_UNICAST_FLOOD] = { .type = NLA_U8 }, - [IFLA_BRPORT_PROXYARP] = { .type = NLA_U8 }, - [IFLA_BRPORT_PROXYARP_WIFI] = { .type = NLA_U8 }, -+ [IFLA_BRPORT_SINK_CONNECTED] = { .type = NLA_U8 }, - [IFLA_BRPORT_MULTICAST_ROUTER] = { .type = NLA_U8 }, - [IFLA_BRPORT_MCAST_TO_UCAST] = { .type = NLA_U8 }, - [IFLA_BRPORT_MCAST_FLOOD] = { .type = NLA_U8 }, -@@ -963,6 +967,7 @@ static int br_setport(struct net_bridge_port *p, struct nlattr *tb[], - br_set_port_flag(p, tb, IFLA_BRPORT_BCAST_FLOOD, BR_BCAST_FLOOD); - br_set_port_flag(p, tb, IFLA_BRPORT_PROXYARP, BR_PROXYARP); - br_set_port_flag(p, tb, IFLA_BRPORT_PROXYARP_WIFI, BR_PROXYARP_WIFI); -+ br_set_port_flag(p, tb, IFLA_BRPORT_SINK_CONNECTED, BR_SINK_CONNECTED); - br_set_port_flag(p, tb, IFLA_BRPORT_VLAN_TUNNEL, BR_VLAN_TUNNEL); - br_set_port_flag(p, tb, IFLA_BRPORT_NEIGH_SUPPRESS, BR_NEIGH_SUPPRESS); - br_set_port_flag(p, tb, IFLA_BRPORT_ISOLATED, BR_ISOLATED); -diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h -index 741b0b8c4bab..b1333722f335 100644 ---- a/net/bridge/br_private.h -+++ b/net/bridge/br_private.h -@@ -461,6 +461,14 @@ static inline struct net_bridge_port *br_port_get_rtnl(const struct net_device * - rtnl_dereference(dev->rx_handler_data) : NULL; - } - -+struct ukn_unicast_stats -+{ -+ unsigned long ukn_unicast_total_rcvd; -+ unsigned long ukn_unicast_ip_rcvd; -+ unsigned long ukn_unicast_total_probe_sent; -+ unsigned long ukn_unicast_arp_create_err; -+}; -+ - static inline struct net_bridge_port *br_port_get_rtnl_rcu(const struct net_device *dev) - { - return netif_is_bridge_port(dev) ? -@@ -580,6 +588,7 @@ struct net_bridge { - #if IS_ENABLED(CONFIG_BRIDGE_CFM) - struct hlist_head mep_list; - #endif -+ struct ukn_unicast_stats __percpu *ukn_stats; - }; - - struct br_input_skb_cb { -@@ -2303,6 +2312,11 @@ static inline void br_switchdev_init(struct net_bridge *br) - - #endif /* CONFIG_NET_SWITCHDEV */ - -+#ifdef CONFIG_SYSCTL -+int br_input_sysctl_init(void); -+void br_input_sysctl_fini(void); -+#endif -+ - /* br_arp_nd_proxy.c */ - void br_recalculate_neigh_suppress_enabled(struct net_bridge *br); - void br_do_proxy_suppress_arp(struct sk_buff *skb, struct net_bridge *br, -diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c -index ea733542244c..cc0f7a30196d 100644 ---- a/net/bridge/br_sysfs_br.c -+++ b/net/bridge/br_sysfs_br.c -@@ -933,6 +933,29 @@ static ssize_t vlan_stats_per_port_store(struct device *d, - static DEVICE_ATTR_RW(vlan_stats_per_port); - #endif - -+static ssize_t ukn_unicast_stats_show(struct device *d, -+ struct device_attribute *attr, -+ char *buf) -+{ -+ struct net_bridge *br = to_bridge(d); -+ struct ukn_unicast_stats sum = {0}; -+ int cpu; -+ -+ for_each_possible_cpu(cpu) { -+ const struct ukn_unicast_stats *stats = per_cpu_ptr(br->ukn_stats, cpu); -+ sum.ukn_unicast_total_rcvd += stats->ukn_unicast_total_rcvd; -+ sum.ukn_unicast_ip_rcvd += stats->ukn_unicast_ip_rcvd; -+ sum.ukn_unicast_total_probe_sent += stats->ukn_unicast_total_probe_sent; -+ sum.ukn_unicast_arp_create_err += stats->ukn_unicast_arp_create_err; -+ } -+ return sprintf(buf, "total_rcvd: %lu, ip_rcvd: %lu, total_probe_sent: %lu," -+ " arp_create_err: %lu\n", sum.ukn_unicast_total_rcvd, -+ sum.ukn_unicast_ip_rcvd, sum.ukn_unicast_total_probe_sent, -+ sum.ukn_unicast_arp_create_err); -+} -+ -+static DEVICE_ATTR_RO(ukn_unicast_stats); -+ - static struct attribute *bridge_attrs[] = { - &dev_attr_forward_delay.attr, - &dev_attr_hello_time.attr, -@@ -987,6 +1010,7 @@ static struct attribute *bridge_attrs[] = { - &dev_attr_vlan_stats_enabled.attr, - &dev_attr_vlan_stats_per_port.attr, - #endif -+ &dev_attr_ukn_unicast_stats.attr, - NULL - }; - -diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c -index 74fdd8105dca..8f8058d3b754 100644 ---- a/net/bridge/br_sysfs_if.c -+++ b/net/bridge/br_sysfs_if.c -@@ -240,6 +240,7 @@ BRPORT_ATTR_FLAG(multicast_flood, BR_MCAST_FLOOD); - BRPORT_ATTR_FLAG(broadcast_flood, BR_BCAST_FLOOD); - BRPORT_ATTR_FLAG(neigh_suppress, BR_NEIGH_SUPPRESS); - BRPORT_ATTR_FLAG(isolated, BR_ISOLATED); -+BRPORT_ATTR_FLAG(sink_connected, BR_SINK_CONNECTED); - - #ifdef CONFIG_BRIDGE_IGMP_SNOOPING - static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf) -@@ -293,6 +294,7 @@ static const struct brport_attribute *brport_attrs[] = { - &brport_attr_neigh_suppress, - &brport_attr_isolated, - &brport_attr_backup_port, -+ &brport_attr_sink_connected, - NULL - }; - -diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c -index 650c3c20e79f..5b52819a4114 100644 ---- a/net/core/rtnetlink.c -+++ b/net/core/rtnetlink.c -@@ -62,7 +62,7 @@ - #include "dev.h" - - #define RTNL_MAX_TYPE 50 --#define RTNL_SLAVE_MAX_TYPE 44 -+#define RTNL_SLAVE_MAX_TYPE 60 - - struct rtnl_link { - rtnl_doit_func doit; -@@ -5004,6 +5004,8 @@ int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, - IFLA_BRPORT_LEARNING_SYNC, BR_LEARNING_SYNC) || - brport_nla_put_flag(skb, flags, mask, - IFLA_BRPORT_UNICAST_FLOOD, BR_FLOOD) || -+ brport_nla_put_flag(skb, flags, mask, -+ IFLA_BRPORT_SINK_CONNECTED, BR_SINK_CONNECTED) || - brport_nla_put_flag(skb, flags, mask, - IFLA_BRPORT_PROXYARP, BR_PROXYARP) || - brport_nla_put_flag(skb, flags, mask, --- -2.43.0 - diff --git a/SPECS/91/linux/hcx/0002-Skip-IP_ECN_decapsulate-for-gretap-devices.patch b/SPECS/91/linux/hcx/0002-Skip-IP_ECN_decapsulate-for-gretap-devices.patch deleted file mode 100644 index 2a0489c63a..0000000000 --- a/SPECS/91/linux/hcx/0002-Skip-IP_ECN_decapsulate-for-gretap-devices.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 96c9d8e55c76a354a2b8a4aad0e2ecdb2c26e8c6 Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Fri, 19 Dec 2025 18:49:04 +0530 -Subject: [PATCH 02/15] Skip IP_ECN_decapsulate for gretap devices - -ip_tunnel decap code includes a call to do nested ECN processing. -This code doesn't work correctly when the tunnel device -encaps ethernet. It tries to look at the wrong part of the packet, -so may generate spurious warnings. - -Signed-off-by: Keerthana K -Signed-off-by: Srish Srinivasan -[Guru: Ported to 6.12 kernel. Copied some code manually] -Signed-off-by: Guruswamy Basavaiah ---- - include/net/ip_tunnels.h | 1 + - net/ipv4/ip_tunnel.c | 62 ++++++++++++++++++++++++++++++++++------ - 2 files changed, 54 insertions(+), 9 deletions(-) - -diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h -index 01fcf952b05d..b1bb100c326c 100644 ---- a/include/net/ip_tunnels.h -+++ b/include/net/ip_tunnels.h -@@ -369,6 +369,7 @@ static inline void ip_tunnel_init_flow(struct flowi4 *fl4, - fl4->flowi4_flags = flow_flags; - } - -+int ipip_sysctl_init(void); - int ip_tunnel_init(struct net_device *dev); - void ip_tunnel_uninit(struct net_device *dev); - void ip_tunnel_dellink(struct net_device *dev, struct list_head *head); -diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c -index 7c77d06372d1..1d3e04eb82f6 100644 ---- a/net/ipv4/ip_tunnel.c -+++ b/net/ipv4/ip_tunnel.c -@@ -38,6 +38,9 @@ - #include - #include - #include -+#ifdef CONFIG_SYSCTL -+#include -+#endif - #include - #include - #include -@@ -51,6 +54,38 @@ - #include - #endif - -+#ifdef CONFIG_SYSCTL -+struct ctl_table_header *ipip_sysctl_header = NULL; -+int ipip_tunnel_skip_encap_decap __read_mostly = 0; -+EXPORT_SYMBOL_GPL(ipip_tunnel_skip_encap_decap); -+EXPORT_SYMBOL_GPL(ipip_sysctl_header); -+ -+struct ctl_table ipip_sysctl_table[] = { -+ { -+ .procname = "ipip_tunnel_skip_encap_decap", -+ .data = &ipip_tunnel_skip_encap_decap, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec, -+ }, -+}; -+EXPORT_SYMBOL_GPL(ipip_sysctl_table); -+ -+int ipip_sysctl_init(void) -+{ -+ ipip_sysctl_header = register_net_sysctl(&init_net, "net/ipv4", ipip_sysctl_table); -+ if (ipip_sysctl_header == NULL) { -+ printk(KERN_ERR "ipip: can't register to sysctl"); -+ return -ENOMEM; -+ } -+ return 0; -+} -+EXPORT_SYMBOL_GPL(ipip_sysctl_init); -+ -+#else -+#define ipip_tunnel_skip_encap_decap 0 -+#endif -+ - static unsigned int ip_tunnel_hash(__be32 key, __be32 remote) - { - return hash_32((__force u32)key ^ (__force u32)remote, -@@ -419,15 +454,24 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb, - } - iph = (struct iphdr *)(skb->head + nh); - -- err = IP_ECN_decapsulate(iph, skb); -- if (unlikely(err)) { -- if (log_ecn_error) -- net_info_ratelimited("non-ECT from %pI4 with TOS=%#x\n", -- &iph->saddr, iph->tos); -- if (err > 1) { -- DEV_STATS_INC(tunnel->dev, rx_frame_errors); -- DEV_STATS_INC(tunnel->dev, rx_errors); -- goto drop; -+ /* If the device is gretap, or similar, the network header is -+ * pointing to the encapped ether header now, so the -+ * IP_ECN_decapsulate check doesn't work right. It could be -+ * made to work right, but isn't needed for our use case. So -+ * just skip it. -+ */ -+ if ((ipip_tunnel_skip_encap_decap && tunnel->dev->type != ARPHRD_ETHER) -+ || ipip_tunnel_skip_encap_decap == 0) { -+ err = IP_ECN_decapsulate(iph, skb); -+ if (unlikely(err)) { -+ if (log_ecn_error) -+ net_info_ratelimited("non-ECT from %pI4 with TOS=%#x\n", -+ &iph->saddr, iph->tos); -+ if (err > 1) { -+ DEV_STATS_INC(tunnel->dev, rx_frame_errors); -+ DEV_STATS_INC(tunnel->dev, rx_errors); -+ goto drop; -+ } - } - } - --- -2.43.0 - diff --git a/SPECS/91/linux/hcx/0003-Handle-ipsec-in-ipip-more-correctly.patch b/SPECS/91/linux/hcx/0003-Handle-ipsec-in-ipip-more-correctly.patch deleted file mode 100644 index 2171f4c808..0000000000 --- a/SPECS/91/linux/hcx/0003-Handle-ipsec-in-ipip-more-correctly.patch +++ /dev/null @@ -1,85 +0,0 @@ -From bbc9043b25dbcaaa2338ff514f7d35381cfe931c Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Fri, 18 Jun 2021 09:09:34 +0000 -Subject: [PATCH 03/15] Handle ipsec in ipip more correctly - -If there is already encapsulation present, ipip tries to -use the inner-most header for things like copying ttl and -tos. That is okay, unless ipsec encrypted the inner -header. In that case, ipip tries to use encrypted values -instead of the real ones. Prevent that by treating ipsec -as non encapsulated. - -Signed-off-by: Keerthana K -Signed-off-by: Srish Srinivasan ---- - net/ipv4/ipip.c | 32 ++++++++++++++++++++++++++++++++ - 1 file changed, 32 insertions(+) - -diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c -index dc0db5895e0e..b8f44cd05569 100644 ---- a/net/ipv4/ipip.c -+++ b/net/ipv4/ipip.c -@@ -116,6 +116,14 @@ static bool log_ecn_error = true; - module_param(log_ecn_error, bool, 0644); - MODULE_PARM_DESC(log_ecn_error, "Log packets received with corrupted ECN"); - -+#ifdef CONFIG_SYSCTL -+extern int ipip_tunnel_skip_encap_decap __read_mostly; -+extern struct ctl_table_header *ipip_sysctl_header __read_mostly; -+#else -+#define ipip_tunnel_skip_encap_decap 0 -+#define ipip_sysctl_header NULL -+#endif -+ - static unsigned int ipip_net_id __read_mostly; - - static int ipip_tunnel_init(struct net_device *dev); -@@ -302,6 +310,24 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, - goto tx_error; - } - -+ /* If there is already encapsulation present, ipip tries to -+ * use the inner-most header for things like copying ttl and -+ * tos. That is okay, unless ipsec encrypted the inner -+ * header. In that case, ipip tries to use encrypted values -+ * instead of the real ones. Prevent that by treating ipsec -+ * as non encapsulated. -+ * -+ * It's not clear this is 100% correct solution. It feels -+ * more like ipsec should prevent this, but it fixes our use -+ * case. -+ */ -+ if (ipip_tunnel_skip_encap_decap && skb->encapsulation) { -+ struct iphdr *iph = ip_hdr(skb); -+ if (iph->protocol == IPPROTO_ESP) { -+ skb->encapsulation = 0; -+ } -+ } -+ - if (tiph->protocol != ipproto && tiph->protocol != 0) - goto tx_error; - -@@ -639,6 +665,9 @@ static int __init ipip_init(void) - err = rtnl_link_register(&ipip_link_ops); - if (err < 0) - goto rtnl_link_failed; -+#ifdef CONFIG_SYSCTL -+ ipip_sysctl_init(); -+#endif - - out: - return err; -@@ -665,6 +694,9 @@ static void __exit ipip_fini(void) - pr_info("%s: can't deregister tunnel\n", __func__); - #endif - unregister_pernet_device(&ipip_net_ops); -+#ifdef CONFIG_SYSCTL -+ unregister_net_sysctl_table(ipip_sysctl_header); -+#endif - } - - module_init(ipip_init); --- -2.43.0 - diff --git a/SPECS/91/linux/hcx/0004-De-cap-fou-traffic-into-correct-tunnel-device-s.patch b/SPECS/91/linux/hcx/0004-De-cap-fou-traffic-into-correct-tunnel-device-s.patch deleted file mode 100644 index 9842924e62..0000000000 --- a/SPECS/91/linux/hcx/0004-De-cap-fou-traffic-into-correct-tunnel-device-s.patch +++ /dev/null @@ -1,186 +0,0 @@ -From 2981145f02557cba571e3ae4768f9d3b5e11dc0d Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Wed, 24 Dec 2025 18:29:26 +0530 -Subject: [PATCH 04/15] De-cap fou traffic into correct tunnel device(s) - -Default fou device doesn't allow multiple fou tunnels -between one pair of IPs. Previous patch has been working -around that by adding additional parameter and extra logic -in ip_tunnel_find to allow it. Unwanted side effect was -that inbound traffic for all of the different src port fou -tunnels would be seen as arriving on a single fou tunnel. -This worked (still works) but is very confusing. - -The change reverts the old patch, and uses a different -approach. When a fou tunnel is added, if there are both -src and dst ports specified, it auto-populates the tunnel -key information to match. This lets multiple fou tunnels -get added. Then on Rx, the fou layer saves the src/dst ports -in the skb, and that is used later as the key during tunnel -lookup. - -Result is that traffic for each fou tunnel arrives on the -correct ipip device. Note that there is still confusion -as our ping probe traffic may still send requests on one -tunnel and have the replies arrive on a different tunnel. -Addressing that requires changing the approach the probes -use. - -Signed-off-by: Keerthana K -Signed-off-by: Srish Srinivasan -[Guru: Ported to 6.12 kernel. renamed TUNNEL_NO_KEY to - IP_TUNNEL_KEY_BIT in function ipip_tunnel_rcv] -Signed-off-by: Guruswamy Basavaiah ---- - include/linux/skbuff.h | 1 + - net/ipv4/fou_core.c | 5 +++++ - net/ipv4/ip_tunnel.c | 10 ++++++++++ - net/ipv4/ipip.c | 36 ++++++++++++++++++++++++++++++++++++ - 4 files changed, 52 insertions(+) - -diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h -index 314328ab0b84..db174ad9bb76 100644 ---- a/include/linux/skbuff.h -+++ b/include/linux/skbuff.h -@@ -1062,6 +1062,7 @@ struct sk_buff { - __u16 transport_header; - __u16 network_header; - __u16 mac_header; -+ __be32 fou_key; - - #ifdef CONFIG_KCOV - u64 kcov_handle; -diff --git a/net/ipv4/fou_core.c b/net/ipv4/fou_core.c -index 3e30745e2c09..c9ef55eace26 100644 ---- a/net/ipv4/fou_core.c -+++ b/net/ipv4/fou_core.c -@@ -55,6 +55,11 @@ static inline struct fou *fou_from_sock(struct sock *sk) - - static int fou_recv_pull(struct sk_buff *skb, struct fou *fou, size_t len) - { -+ struct udphdr *udph = udp_hdr(skb); -+ -+ /* Save udp ports for use as key later. -+ */ -+ skb->fou_key = (((udph->source) << 16) | udph->dest); - /* Remove 'len' bytes from the packet (UDP header and - * FOU header if present). - */ -diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c -index 1d3e04eb82f6..a472d2c8da21 100644 ---- a/net/ipv4/ip_tunnel.c -+++ b/net/ipv4/ip_tunnel.c -@@ -57,8 +57,10 @@ - #ifdef CONFIG_SYSCTL - struct ctl_table_header *ipip_sysctl_header = NULL; - int ipip_tunnel_skip_encap_decap __read_mostly = 0; -+int fou_key_multi_port __read_mostly = 0; - EXPORT_SYMBOL_GPL(ipip_tunnel_skip_encap_decap); - EXPORT_SYMBOL_GPL(ipip_sysctl_header); -+EXPORT_SYMBOL_GPL(fou_key_multi_port); - - struct ctl_table ipip_sysctl_table[] = { - { -@@ -68,6 +70,13 @@ struct ctl_table ipip_sysctl_table[] = { - .mode = 0644, - .proc_handler = proc_dointvec, - }, -+ { -+ .procname = "fou_key_multi_port", -+ .data = &fou_key_multi_port, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec, -+ }, - }; - EXPORT_SYMBOL_GPL(ipip_sysctl_table); - -@@ -84,6 +93,7 @@ EXPORT_SYMBOL_GPL(ipip_sysctl_init); - - #else - #define ipip_tunnel_skip_encap_decap 0 -+#define fou_key_multi_port 0 - #endif - - static unsigned int ip_tunnel_hash(__be32 key, __be32 remote) -diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c -index b8f44cd05569..887ef49a2a9b 100644 ---- a/net/ipv4/ipip.c -+++ b/net/ipv4/ipip.c -@@ -119,9 +119,11 @@ MODULE_PARM_DESC(log_ecn_error, "Log packets received with corrupted ECN"); - #ifdef CONFIG_SYSCTL - extern int ipip_tunnel_skip_encap_decap __read_mostly; - extern struct ctl_table_header *ipip_sysctl_header __read_mostly; -+extern int fou_key_multi_port __read_mostly; - #else - #define ipip_tunnel_skip_encap_decap 0 - #define ipip_sysctl_header NULL -+#define fou_key_multi_port 0 - #endif - - static unsigned int ipip_net_id __read_mostly; -@@ -234,6 +236,12 @@ static int ipip_tunnel_rcv(struct sk_buff *skb, u8 ipproto) - iph = ip_hdr(skb); - tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, flags, iph->saddr, - iph->daddr, 0); -+ if (fou_key_multi_port && !tunnel) { -+ ip_tunnel_flags_zero(flags); -+ __set_bit(IP_TUNNEL_KEY_BIT, flags); -+ tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, flags, -+ iph->saddr, iph->daddr, skb->fou_key); -+ } - if (tunnel) { - const struct tnl_ptk_info *tpi; - -@@ -462,6 +470,28 @@ static void ipip_netlink_parms(struct nlattr *data[], - *fwmark = nla_get_u32(data[IFLA_IPTUN_FWMARK]); - } - -+static void ipip_fou_fixup_key(struct ip_tunnel_parm_kern *p, -+ struct ip_tunnel_encap *ipencap) -+{ -+ /* If no key is provided, but encap src/dst ports are, -+ * set key based on src/dst ports. Allows for multiple -+ * fou tunnels using different port pairs. Requires -+ * storing ports/key in skb header between fou and ipip -+ * layer. -+ */ -+ if ((ipencap->type == TUNNEL_ENCAP_FOU) && -+ (ipencap->sport != 0) && (ipencap->dport != 0) && -+ (p->i_key == 0) && (p->o_key == 0)) { -+ /* For arriving packets, key is (sport << 16 | dport) -+ * so need to reverse things here for i_key. -+ * o_key is set to same, but it's never used for fou -+ */ -+ p->i_key = (ipencap->dport << 16) | ipencap->sport; -+ p->o_key = p->i_key; -+ __set_bit(IP_TUNNEL_KEY_BIT, p->i_flags); -+ } -+} -+ - static int ipip_newlink(struct net *src_net, struct net_device *dev, - struct nlattr *tb[], struct nlattr *data[], - struct netlink_ext_ack *extack) -@@ -479,6 +509,9 @@ static int ipip_newlink(struct net *src_net, struct net_device *dev, - } - - ipip_netlink_parms(data, &p, &t->collect_md, &fwmark); -+ if (fou_key_multi_port) { -+ ipip_fou_fixup_key(&p, &ipencap); -+ } - return ip_tunnel_newlink(dev, tb, &p, fwmark); - } - -@@ -500,6 +533,9 @@ static int ipip_changelink(struct net_device *dev, struct nlattr *tb[], - } - - ipip_netlink_parms(data, &p, &collect_md, &fwmark); -+ if (fou_key_multi_port) { -+ ipip_fou_fixup_key(&p, &ipencap); -+ } - if (collect_md) - return -EINVAL; - --- -2.43.0 - diff --git a/SPECS/91/linux/hcx/0005-Add-unknown-fou-tracking-to-kernel.patch b/SPECS/91/linux/hcx/0005-Add-unknown-fou-tracking-to-kernel.patch deleted file mode 100644 index ccee975f45..0000000000 --- a/SPECS/91/linux/hcx/0005-Add-unknown-fou-tracking-to-kernel.patch +++ /dev/null @@ -1,643 +0,0 @@ -From 0234d0965c6d4a148078705e85b2d693f8e4e398 Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Tue, 6 Aug 2024 13:21:14 +0530 -Subject: [PATCH 05/15] Add unknown fou tracking to kernel - -Keep unknown fou tuples in a hash table, aging them out, as -appropriate. Allow user space to query the entries, and also -receive pkt notifications. Allow user space to muffle entries -it is not interested in. >imit the rate at which notifications -will be sent to user space. - -This will allow cgw daemon to use this method for detecting and managing -Fou NAT tunnels, instead of trying to monitor conntrack entries. - -Signed-off-by: Srish Srinivasan ---- - net/ipv4/ipip.c | 544 ++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 544 insertions(+) - -diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c -index 887ef49a2a9b..d2cabe0b4f99 100644 ---- a/net/ipv4/ipip.c -+++ b/net/ipv4/ipip.c -@@ -101,6 +101,8 @@ - #include - #include - #include -+#include -+#include - - #include - #include -@@ -110,6 +112,7 @@ - #include - #include - #include -+#include - #include - - static bool log_ecn_error = true; -@@ -130,6 +133,7 @@ static unsigned int ipip_net_id __read_mostly; - - static int ipip_tunnel_init(struct net_device *dev); - static struct rtnl_link_ops ipip_link_ops __read_mostly; -+static void ipip_handle_unknown_fou(struct net *net, struct sk_buff *skb); - - static int ipip_err(struct sk_buff *skb, u32 info) - { -@@ -272,6 +276,10 @@ static int ipip_tunnel_rcv(struct sk_buff *skb, u8 ipproto) - return ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); - } - -+ if (fou_key_multi_port && skb->fou_key != 0) { -+ ipip_handle_unknown_fou(net, skb); -+ } -+ - return -1; - - drop: -@@ -279,6 +287,526 @@ static int ipip_tunnel_rcv(struct sk_buff *skb, u8 ipproto) - return 0; - } - -+struct unknown_fou { -+ struct hlist_node list; -+ struct rcu_head rcu; -+ spinlock_t lock; -+ -+ /* key fields */ -+ __be32 saddr; -+ __be32 daddr; -+ __be16 sport; -+ __be16 dport; -+ struct net *net; -+ -+ /* data fields */ -+ unsigned long created; /* jiffies */ -+ unsigned long last_seen; /* jiffies */ -+ unsigned long muffle_until; /* jiffies */ -+ unsigned long notice_sent; /* jiffies */ -+ unsigned long count; -+}; -+ -+ -+/* -+ * declare hashtable and lock for unknown fou. Using only 256 buckets -+ * since we don't expect a lot of these. -+ */ -+static DEFINE_HASHTABLE(ipip_fou_unk_hash, 8); -+static DEFINE_SPINLOCK(ipip_fou_hash_lock); -+ -+static u32 ipip_unknown_fou_key(struct unknown_fou *key) -+{ -+ return jhash_3words((u32)key->saddr, (u32)key->daddr, -+ (u32)((key->sport<<16)|key->dport), -+ (u32)net_hash_mix(key->net)); -+} -+ -+static struct unknown_fou *ipip_alloc_unknown_fou(void) -+{ -+ return kmalloc(sizeof(struct unknown_fou), GFP_ATOMIC); -+} -+ -+#define VERBOSE 0 -+ -+static void ipip_free_unknown_fou_rcu(struct rcu_head *head) -+{ -+ struct unknown_fou *e; -+ e = container_of(head, struct unknown_fou, rcu); -+#if VERBOSE -+ pr_info("ipip: free entry: (%p) %pI4:%u to %pI4:%u\n", e, -+ &e->saddr, ntohs(e->sport), &e->daddr, ntohs(e->dport)); -+#endif -+ kfree(e); -+} -+ -+static void ipip_fou_unk_gc(struct timer_list *unused); -+static DEFINE_TIMER(ipip_fou_unk_gc_timer, ipip_fou_unk_gc); -+ -+enum fou_unk_cmd { -+ FOU_UNK_CMD_UNSPEC, -+ FOU_UNK_CMD_NEW, -+ FOU_UNK_CMD_DEL, -+ FOU_UNK_CMD_GET, -+ FOU_UNK_CMD_SET, -+ FOU_UNK_CMD_PKT -+}; -+ -+static struct genl_family fou_unknown_genl_family; -+ -+#define FOU_UNK_FAMILY "fou_unknown" -+#define FOU_UNK_MCGROUP "fou_unknown" -+ -+enum fou_unk_attr { -+ FOU_UNK_ATTR_UNSPEC, -+ FOU_UNK_ATTR_SRC_IP, -+ FOU_UNK_ATTR_DST_IP, -+ FOU_UNK_ATTR_SRC_PORT, -+ FOU_UNK_ATTR_DST_PORT, -+ FOU_UNK_ATTR_PKT_LEN, -+ FOU_UNK_ATTR_PKT_PAYLOAD, -+ // TODO: reorder a little? -+ FOU_UNK_ATTR_CREATED_USEC, -+ FOU_UNK_ATTR_AGE_USEC, -+ FOU_UNK_ATTR_MUFFLE_USEC, -+ __FOU_UNK_ATTR_MAX -+}; -+ -+#define FOU_UNK_ATTR_MAX (__FOU_UNK_ATTR_MAX - 1) -+ -+/* Arbitrary limit for now */ -+#define FOU_UNK_MAX_PAYLOAD 1024 -+ -+static void ipip_fou_unk_gc(struct timer_list *unused) -+{ -+ int bkt; -+ struct hlist_node *tmp; -+ struct unknown_fou *entry; -+ -+ unsigned long now = jiffies; -+ unsigned long max_age = msecs_to_jiffies(30000); -+ -+ spin_lock_bh(&ipip_fou_hash_lock); -+ hash_for_each_safe(ipip_fou_unk_hash, bkt, tmp, entry, list) { -+ if ((now - entry->last_seen) < max_age) { -+ continue; -+ } -+ hash_del_rcu(&entry->list); -+ call_rcu(&entry->rcu, ipip_free_unknown_fou_rcu); -+ } -+ spin_unlock_bh(&ipip_fou_hash_lock); -+ mod_timer(&ipip_fou_unk_gc_timer, jiffies + msecs_to_jiffies(1000)); -+} -+ -+/* -+ * purge all entries from hash. Assumes any needed locks are held. -+ */ -+static void ipip_fou_unk_purge(void) -+{ -+ int bkt; -+ struct hlist_node *tmp; -+ struct unknown_fou *entry; -+ -+ hash_for_each_safe(ipip_fou_unk_hash, bkt, tmp, entry, list) { -+ hash_del_rcu(&entry->list); -+ call_rcu(&entry->rcu, ipip_free_unknown_fou_rcu); -+ } -+} -+ -+/* -+ * Tell unknown_fou about a new/updated link. Unknown_fou layer -+ * checks if it currently has a matching entry, and removes it if it -+ * does. (The tuple is no longer unknown when a device is created for -+ * it.) -+ */ -+static void ipip_fou_unk_notice(struct net *net, -+ struct ip_tunnel_parm_kern *p, -+ struct ip_tunnel_encap *ipencap) -+{ -+ struct hlist_node *tmp; -+ struct unknown_fou key; -+ struct unknown_fou *entry, *u = &key; -+ u32 hash_key; -+ -+ if ((ipencap->type != TUNNEL_ENCAP_FOU) || -+ (ipencap->sport == 0) || (ipencap->dport == 0)) { -+ return; -+ } -+ key.net = net; -+ /* inverted because fou_unk is incoming tuple */ -+ key.saddr = p->iph.daddr; -+ key.daddr = p->iph.saddr; -+ key.sport = ipencap->dport; -+ key.dport = ipencap->sport; -+ hash_key = ipip_unknown_fou_key(&key); -+ spin_lock_bh(&ipip_fou_hash_lock); -+ hash_for_each_possible_safe(ipip_fou_unk_hash, entry, tmp, list, hash_key) { -+ if ((entry->net == u->net) && -+ (entry->saddr == u->saddr) && -+ (entry->daddr == u->daddr) && -+ (entry->sport == u->sport) && -+ (entry->dport == u->dport)) { -+ hash_del_rcu(&entry->list); -+ call_rcu(&entry->rcu, ipip_free_unknown_fou_rcu); -+ } -+ } -+ spin_unlock_bh(&ipip_fou_hash_lock); -+} -+ -+ -+static struct sk_buff *fou_unk_build_pkt_report(struct unknown_fou *entry, -+ struct sk_buff *fou_skb, int len, -+ u32 portid, u32 seq, u8 cmd); -+ -+/* -+ * Find an unknown_fou entry if it exists. Assumes needed lock(s) are -+ * taken. -+ */ -+static struct unknown_fou *ipip_find_unknown_fou(struct unknown_fou *u) -+{ -+ u32 hash_key; -+ struct unknown_fou *entry, *found; -+ -+ /* lookup unknown_fou */ -+ hash_key = ipip_unknown_fou_key(u); -+ found = NULL; -+ hash_for_each_possible_rcu(ipip_fou_unk_hash, entry, list, hash_key) { -+ if ((entry->net == u->net) && -+ (entry->saddr == u->saddr) && -+ (entry->daddr == u->daddr) && -+ (entry->sport == u->sport) && -+ (entry->dport == u->dport)) { -+ found = entry; -+ break; -+ } -+ } -+ return found; -+} -+ -+#define MIN_NOTICE_INTVL_SECS 1 -+ -+/* -+ * Do something useful (like track, notify, etc.) with unknown fou -+ * packets. -+ */ -+static void ipip_handle_unknown_fou(struct net *net, struct sk_buff *skb) -+{ -+ const struct iphdr *iph; -+ u32 hash_key; -+ struct unknown_fou key; -+ struct unknown_fou *entry, *found; -+ __be16 sport, dport; -+ unsigned long now; -+ -+ iph = ip_hdr(skb); -+ sport = ((skb->fou_key >> 16)&0xffff); -+ dport = (skb->fou_key&0xffff); -+ -+ key.net = net; -+ key.saddr = iph->saddr; -+ key.daddr = iph->daddr; -+ key.sport = sport; -+ key.dport = dport; -+ -+ rcu_read_lock(); -+ /* lookup unknown_fou */ -+ hash_key = ipip_unknown_fou_key(&key); -+ entry = ipip_find_unknown_fou(&key); -+ -+ now = jiffies; -+ /* if not found */ -+ if (!entry) { -+ /* create */ -+ entry = ipip_alloc_unknown_fou(); -+ if (!entry) { -+ rcu_read_unlock(); -+ if (net_ratelimit()) { -+ pr_info("failed to alloc node fou for tuple: %pI4:%u to %pI4:%u\n", -+ &entry->saddr, ntohs(sport), &entry->daddr, ntohs(dport)); -+ } -+ return; -+ } -+ entry->net = net; -+ entry->saddr = iph->saddr; -+ entry->daddr = iph->daddr; -+ entry->sport = sport; -+ entry->dport = dport; -+ -+ spin_lock_init(&entry->lock); -+ entry->created = now; -+ entry->muffle_until = now - 1; -+ entry->last_seen = 0; /* will be set below */ -+ entry->notice_sent = jiffies - msecs_to_jiffies(1000 * MIN_NOTICE_INTVL_SECS); -+ init_rcu_head(&entry->rcu); -+ spin_lock_bh(&ipip_fou_hash_lock); -+ /* check for dup (could be racing) */ -+ found = ipip_find_unknown_fou(&key); -+ if (found) { -+ spin_unlock_bh(&ipip_fou_hash_lock); -+ rcu_read_unlock(); -+ pr_info("ipip: found dup unknown_fou while adding.\n"); -+ kfree(entry); -+ return; -+ } -+ hash_add_rcu(ipip_fou_unk_hash, &entry->list, hash_key); -+ spin_unlock_bh(&ipip_fou_hash_lock); -+ } -+ spin_lock_bh(&entry->lock); -+ entry->last_seen = now; -+ -+ /* send notifs, as needed */ -+ if (((signed long)(entry->muffle_until - now)) > 0) { -+ goto out; -+ } -+ /* only send max of 1 per second */ -+ if (jiffies_to_msecs(jiffies - entry->notice_sent) < (1000 * MIN_NOTICE_INTVL_SECS)) { -+ goto out; -+ } -+ -+ if (skb->len < FOU_UNK_MAX_PAYLOAD) { -+ struct sk_buff *fou_skb; -+ -+ fou_skb = fou_unk_build_pkt_report(entry, -+ skb, skb->len, -+ 0, 0, FOU_UNK_CMD_PKT); -+ if (!fou_skb) { -+ /* XXX: stat/log */ -+ if (net_ratelimit()) { -+ pr_info("fou_unk: failed to build pkt report\n"); -+ } -+ goto out; -+ } -+ entry->notice_sent = jiffies; -+ genlmsg_multicast_netns(&fou_unknown_genl_family, -+ entry->net, fou_skb, -+ 0, 0, GFP_ATOMIC); -+ } -+out: -+ spin_unlock_bh(&entry->lock); -+ rcu_read_unlock(); -+} -+ -+ -+ -+static const struct genl_multicast_group fou_unk_multicast_group = { -+ .name = FOU_UNK_MCGROUP, -+}; -+ -+static const struct nla_policy fou_unk_policy[FOU_UNK_ATTR_MAX + 1] = { -+ [FOU_UNK_ATTR_SRC_IP] = { .type = NLA_U32 }, -+ [FOU_UNK_ATTR_DST_IP] = { .type = NLA_U32 }, -+ [FOU_UNK_ATTR_SRC_PORT] = { .type = NLA_U16 }, -+ [FOU_UNK_ATTR_DST_PORT] = { .type = NLA_U16 }, -+ [FOU_UNK_ATTR_PKT_LEN] = { .type = NLA_U16 }, /* skb->len, whether all copied or not */ -+ [FOU_UNK_ATTR_PKT_PAYLOAD] = { .len = FOU_UNK_MAX_PAYLOAD }, /* remove? forces allocation? */ -+ [FOU_UNK_ATTR_CREATED_USEC] = { .type = NLA_U32 }, -+ [FOU_UNK_ATTR_AGE_USEC] = { .type = NLA_U32 }, -+ [FOU_UNK_ATTR_MUFFLE_USEC] = { .type = NLA_U32 }, -+}; -+ -+static struct sk_buff *fou_unk_build_pkt_report(struct unknown_fou *entry, -+ struct sk_buff *fou_skb, int len, -+ u32 portid, u32 seq, u8 cmd) -+{ -+ struct sk_buff *skb; -+ void *hdr; -+ struct nlattr *nla; -+ int err; -+ -+ /* XXX: probably genlmsg_new(nla_size(attributes), ...); -+ * this over-allocates. -+ */ -+ skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); -+ if (!skb) -+ return ERR_PTR(-ENOMEM); -+ -+ hdr = genlmsg_put(skb, portid, seq, &fou_unknown_genl_family, -+ 0, cmd); -+ if (!hdr) { -+ err = -EMSGSIZE; -+ goto error; -+ } -+ -+ if (nla_put_u32(skb, FOU_UNK_ATTR_SRC_IP, ntohl(entry->saddr)) || -+ nla_put_u32(skb, FOU_UNK_ATTR_DST_IP, ntohl(entry->daddr)) || -+ nla_put_u16(skb, FOU_UNK_ATTR_SRC_PORT, ntohs(entry->sport)) || -+ nla_put_u16(skb, FOU_UNK_ATTR_DST_PORT, ntohs(entry->dport))) -+ goto nla_put_failure; -+ -+ if (nla_put_u16(skb, FOU_UNK_ATTR_PKT_LEN, skb->len)) -+ goto nla_put_failure; -+ -+ if (!(nla = nla_reserve(skb, FOU_UNK_ATTR_PKT_PAYLOAD, len))) { -+ goto nla_put_failure; -+ } -+ -+ nla->nla_len = nla_attr_size(len); -+ err = skb_copy_bits(fou_skb, 0, nla_data(nla), len); -+ if (err != 0) { -+ goto nla_put_failure; -+ } -+ -+ genlmsg_end(skb, hdr); -+ return skb; -+ -+nla_put_failure: -+ err = -EMSGSIZE; -+ genlmsg_cancel(skb, hdr); -+error: -+ kfree_skb(skb); -+ return ERR_PTR(err); -+} -+ -+ -+ -+static int fou_unk_cmd_fill_info(struct unknown_fou *entry, struct sk_buff *skb, -+ u32 portid, u32 seq, u32 flags, u8 cmd) -+{ -+ int err; -+ void *hdr; -+ unsigned long now; -+ unsigned int created, age; -+ -+ hdr = genlmsg_put(skb, portid, seq, &fou_unknown_genl_family, -+ flags, cmd); -+ if (!hdr) -+ return -EMSGSIZE; -+ -+ if (nla_put_u32(skb, FOU_UNK_ATTR_SRC_IP, ntohl(entry->saddr)) || -+ nla_put_u32(skb, FOU_UNK_ATTR_DST_IP, ntohl(entry->daddr)) || -+ nla_put_u16(skb, FOU_UNK_ATTR_SRC_PORT, ntohs(entry->sport)) || -+ nla_put_u16(skb, FOU_UNK_ATTR_DST_PORT, ntohs(entry->dport))) -+ goto nla_put_failure; -+ -+ created = jiffies_to_usecs(jiffies - entry->created); -+ if (nla_put_u32(skb, FOU_UNK_ATTR_CREATED_USEC, created)) -+ goto nla_put_failure; -+ -+ age = jiffies_to_usecs(jiffies - entry->last_seen); -+ if (nla_put_u32(skb, FOU_UNK_ATTR_AGE_USEC, age)) -+ goto nla_put_failure; -+ -+ now = jiffies; -+ if (entry->muffle_until >= now) { -+ unsigned int muffle; -+ muffle = jiffies_to_usecs(entry->muffle_until - now); -+ if (nla_put_u32(skb, FOU_UNK_ATTR_MUFFLE_USEC, muffle)) -+ goto nla_put_failure; -+ } -+ -+ genlmsg_end(skb, hdr); -+ return 0; -+ -+nla_put_failure: -+ err = -EMSGSIZE; -+ genlmsg_cancel(skb, hdr); -+ return err; -+} -+ -+static int fou_unk_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb) -+{ -+ int bucket = cb->args[0], skip = cb->args[1]; -+ int i, j = 0; -+ struct unknown_fou *entry; -+ struct net *net = sock_net(skb->sk); -+ -+ rcu_read_lock(); -+ for (i = bucket, entry=NULL; entry == NULL && i < HASH_SIZE(ipip_fou_unk_hash); i++) { -+ -+ j = 0; -+ hlist_for_each_entry_rcu(entry, &ipip_fou_unk_hash[i], list) { -+ if ((j >= skip) && (net == entry->net) && -+ fou_unk_cmd_fill_info(entry, skb, -+ NETLINK_CB(cb->skb).portid, -+ cb->nlh->nlmsg_seq, -+ NLM_F_MULTI, -+ FOU_UNK_CMD_NEW) < 0) -+ goto out; -+ -+ j++; -+ } -+ skip = 0; -+ } -+out: -+ rcu_read_unlock(); -+ -+ cb->args[0] = i; -+ cb->args[1] = j; -+ -+ return skb->len; -+} -+ -+static int fou_unk_cmd_set(struct sk_buff *skb, struct genl_info *info) -+{ -+ struct nlattr **a = info->attrs; -+ struct unknown_fou key; -+ struct unknown_fou *entry; -+ unsigned int muffle_jiffies; -+ -+ /* verify values present */ -+ if (!a[FOU_UNK_ATTR_SRC_IP] || -+ !a[FOU_UNK_ATTR_DST_IP] || -+ !a[FOU_UNK_ATTR_SRC_PORT] || -+ !a[FOU_UNK_ATTR_DST_PORT]) -+ return -EINVAL; -+ -+ /* only thing settable now is muffle time */ -+ if (!a[FOU_UNK_ATTR_MUFFLE_USEC]) { -+ return -EINVAL; -+ } -+ -+ key.net = sock_net(skb->sk); -+ /* extract values from attributes */ -+ key.saddr = htonl(nla_get_u32(a[FOU_UNK_ATTR_SRC_IP])); -+ key.daddr = htonl(nla_get_u32(a[FOU_UNK_ATTR_DST_IP])); -+ key.sport = htons(nla_get_u16(a[FOU_UNK_ATTR_SRC_PORT])); -+ key.dport = htons(nla_get_u16(a[FOU_UNK_ATTR_DST_PORT])); -+ -+ rcu_read_lock(); -+ /* find relevant entry */ -+ entry = ipip_find_unknown_fou(&key); -+ if (!entry) { -+ rcu_read_unlock(); -+ return -ENOENT; -+ } -+ -+ /* modify entry */ -+ spin_lock_bh(&entry->lock); -+ muffle_jiffies = usecs_to_jiffies(nla_get_u32(a[FOU_UNK_ATTR_MUFFLE_USEC])); -+ entry->muffle_until = jiffies + muffle_jiffies; -+ spin_unlock_bh(&entry->lock); -+ rcu_read_unlock(); -+ -+ return 0; -+} -+ -+static const struct genl_ops fou_unk_genl_ops[] = { -+ { .cmd = FOU_UNK_CMD_GET, -+ .flags = 0, /* OK for unprivileged users. */ -+ .policy = fou_unk_policy, -+ .dumpit = fou_unk_cmd_dump -+ }, -+ { .cmd = FOU_UNK_CMD_SET, -+ .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ -+ .policy = fou_unk_policy, -+ .doit = fou_unk_cmd_set, -+ }, -+}; -+ -+static struct genl_family fou_unknown_genl_family = { -+ .hdrsize = 0, -+ .name = FOU_UNK_FAMILY, -+ .version = 1, -+ .maxattr = FOU_UNK_ATTR_MAX, -+ .netnsok = true, -+ .parallel_ops = true, -+ .ops = fou_unk_genl_ops, -+ .n_ops = ARRAY_SIZE(fou_unk_genl_ops), -+ .mcgrps = &fou_unk_multicast_group, -+ .n_mcgrps = 1, -+}; -+ -+ - static int ipip_rcv(struct sk_buff *skb) - { - return ipip_tunnel_rcv(skb, IPPROTO_IPIP); -@@ -511,6 +1039,7 @@ static int ipip_newlink(struct net *src_net, struct net_device *dev, - ipip_netlink_parms(data, &p, &t->collect_md, &fwmark); - if (fou_key_multi_port) { - ipip_fou_fixup_key(&p, &ipencap); -+ ipip_fou_unk_notice(src_net, &p, &ipencap); - } - return ip_tunnel_newlink(dev, tb, &p, fwmark); - } -@@ -543,6 +1072,10 @@ static int ipip_changelink(struct net_device *dev, struct nlattr *tb[], - (!(dev->flags & IFF_POINTOPOINT) && p.iph.daddr)) - return -EINVAL; - -+ if (fou_key_multi_port) { -+ ipip_fou_unk_notice(dev_net(dev), &p, &ipencap); -+ } -+ - return ip_tunnel_changelink(dev, tb, &p, fwmark); - } - -@@ -705,9 +1238,16 @@ static int __init ipip_init(void) - ipip_sysctl_init(); - #endif - -+ err = genl_register_family(&fou_unknown_genl_family); -+ if (err) -+ goto genl_reg_failed; -+ mod_timer(&ipip_fou_unk_gc_timer, jiffies + msecs_to_jiffies(1000)); -+ - out: - return err; - -+genl_reg_failed: -+ rtnl_link_unregister(&ipip_link_ops); - rtnl_link_failed: - #if IS_ENABLED(CONFIG_MPLS) - xfrm4_tunnel_deregister(&mplsip_handler, AF_MPLS); -@@ -722,6 +1262,8 @@ static int __init ipip_init(void) - - static void __exit ipip_fini(void) - { -+ del_timer_sync(&ipip_fou_unk_gc_timer); -+ genl_unregister_family(&fou_unknown_genl_family); - rtnl_link_unregister(&ipip_link_ops); - if (xfrm4_tunnel_deregister(&ipip_handler, AF_INET)) - pr_info("%s: can't deregister tunnel\n", __func__); -@@ -730,6 +1272,8 @@ static void __exit ipip_fini(void) - pr_info("%s: can't deregister tunnel\n", __func__); - #endif - unregister_pernet_device(&ipip_net_ops); -+ ipip_fou_unk_purge(); -+ rcu_barrier(); - #ifdef CONFIG_SYSCTL - unregister_net_sysctl_table(ipip_sysctl_header); - #endif --- -2.43.0 - diff --git a/SPECS/91/linux/hcx/0006-Add-support-for-mac-flapping-and-long-mac-flapping-p.patch b/SPECS/91/linux/hcx/0006-Add-support-for-mac-flapping-and-long-mac-flapping-p.patch deleted file mode 100644 index 825df1d952..0000000000 --- a/SPECS/91/linux/hcx/0006-Add-support-for-mac-flapping-and-long-mac-flapping-p.patch +++ /dev/null @@ -1,478 +0,0 @@ -From 381eb87af65deb72eb2eec3cdd3cc566d00f7494 Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Sun, 4 Jan 2026 02:28:11 +0530 -Subject: [PATCH 06/15] Add support for mac-flapping and long mac-flapping prevention - -Add fields to the bridge so that it can track when macs -move from one bridge port to another. If that happens -within a small enough threshold, consider it a flap -and drop the packet, as well as noting the time. - -Continue dropping packets from the new bridge port until -a second threshold is reached, without having seen any -packets on the original bridge port. - -Log packets dropped and number of flaps when clearing, -subject to rate-limit. - -For some packets, do an additional flap check with a longer -timeout. This is for handling the case where VDR may send an -ARP reply (which is seen by the bridge) to a different host, -without the bridge having seen the real arp request or reply. - -Signed-off-by: Srish Srinivasan -Signed-off-by: Guruswamy Basavaiah ---- - net/bridge/br_device.c | 3 + - net/bridge/br_fdb.c | 146 +++++++++++++++++++++++++++++++++++++-- - net/bridge/br_input.c | 26 +++++-- - net/bridge/br_private.h | 14 +++- - net/bridge/br_sysfs_br.c | 84 ++++++++++++++++++++++ - 5 files changed, 262 insertions(+), 11 deletions(-) - -diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c -index b76f0aec8..d19cc1ddd 100644 ---- a/net/bridge/br_device.c -+++ b/net/bridge/br_device.c -@@ -539,5 +539,8 @@ void br_dev_setup(struct net_device *dev) - br_netfilter_rtable_init(br); - br_stp_timer_init(br); - br_multicast_init(br); -+ br->flap_threshold = BR_DEFAULT_FLAP_THRESHOLD; -+ br->flap_clear_threshold = BR_DEFAULT_FLAP_CLEAR_THRESHOLD; -+ br->flap_long_threshold = BR_DEFAULT_FLAP_LONG_THRESHOLD; - INIT_DELAYED_WORK(&br->gc_work, br_fdb_cleanup); - } -diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c -index 9dd405b64..62d098726 100644 ---- a/net/bridge/br_fdb.c -+++ b/net/bridge/br_fdb.c -@@ -24,6 +24,14 @@ - #include - #include "br_private.h" - -+#include -+ -+#ifdef CONFIG_SYSCTL -+extern int br_mac_flap; -+#else -+#define br_mac_flap 0 -+#endif -+ - static const struct rhashtable_params br_fdb_rht_params = { - .head_offset = offsetof(struct net_bridge_fdb_entry, rhnode), - .key_offset = offsetof(struct net_bridge_fdb_entry, key), -@@ -415,6 +423,10 @@ static struct net_bridge_fdb_entry *fdb_create(struct net_bridge *br, - fdb->key.vlan_id = vid; - fdb->flags = flags; - fdb->updated = fdb->used = jiffies; -+ fdb->last_flap = 0; -+ fdb->flap_port = NULL; -+ fdb->flap_drops = 0; -+ fdb->flap_count = 0; - err = rhashtable_lookup_insert_fast(&br->fdb_hash_tbl, &fdb->rhnode, - br_fdb_rht_params); - if (err) { -@@ -891,14 +903,33 @@ static bool __fdb_mark_active(struct net_bridge_fdb_entry *fdb) - test_and_clear_bit(BR_FDB_NOTIFY_INACTIVE, &fdb->flags)); - } - --void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, -- const unsigned char *addr, u16 vid, unsigned long flags) -+/* Decide whether an skb qualifies for a long flap drop */ -+/* Currently, that is just for unicast ARP replies */ -+static bool br_skb_is_long_flap(struct sk_buff *skb) -+{ -+ struct arphdr *parp; -+ if (!skb) { -+ return false; -+ } -+ if (skb->protocol != htons(ETH_P_ARP) || -+ !is_unicast_ether_addr(eth_hdr(skb)->h_dest) || -+ !pskb_may_pull(skb, sizeof(struct arphdr))) { -+ return false; -+ } -+ parp = arp_hdr(skb); -+ return parp->ar_op == htons(ARPOP_REPLY); -+} -+ -+ -+int br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, -+ const unsigned char *addr, u16 vid, unsigned long flags, -+ struct sk_buff *skb) - { - struct net_bridge_fdb_entry *fdb; - - /* some users want to always flood. */ - if (hold_time(br) == 0) -- return; -+ return 0; - - fdb = fdb_find_rcu(&br->fdb_hash_tbl, addr, vid); - if (likely(fdb)) { -@@ -910,6 +941,7 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, - } else { - unsigned long now = jiffies; - bool fdb_modified = false; -+ unsigned long fdb_updated_to_check = fdb->updated; - - if (now != READ_ONCE(fdb->updated)) { - WRITE_ONCE(fdb->updated, now); -@@ -919,9 +951,78 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, - /* fastpath: update of existing entry */ - if (unlikely(source != READ_ONCE(fdb->dst) && - !test_bit(BR_FDB_STICKY, &fdb->flags))) { -+ unsigned long delay; -+ -+ br_debug(br, "flap detection at %lu (current fdb->updated) " -+ "against %lu (original fdb->updated)\n", -+ fdb->updated, fdb_updated_to_check); -+ -+ delay = fdb_updated_to_check + br->flap_threshold; -+ if (time_before_eq(jiffies, delay)) { -+ /* flap! */ -+ if (fdb->flap_port != source) { -+ fdb->last_flap = jiffies; -+ fdb->flap_count++; -+ fdb->flap_port = source; -+ if (net_ratelimit()) -+ br_info(br, "flap detected on %s with " -+ "address %02x:%02x:%02x:%02x:%02x:%02x as source\n", -+ source->dev->name, -+ addr[0], addr[1], -+ addr[2], addr[3], -+ addr[4], addr[5]); -+ } -+ fdb->flap_drops++; -+ if (net_ratelimit()) -+ br_info(br, "address %02x:%02x:%02x:%02x:%02x:%02x drops: %lu, count:%lu\n", -+ addr[0], addr[1], -+ addr[2], addr[3], -+ addr[4], addr[5], -+ fdb->flap_drops, -+ fdb->flap_count); -+ if (br_mac_flap) -+ return -EINVAL; -+ } -+ delay = fdb_updated_to_check + br->flap_long_threshold; -+ if (br_skb_is_long_flap(skb) && time_before(jiffies, delay)) { -+ /* long flap! probably VDR sending arp reply */ -+ fdb->flap_count++; -+ fdb->flap_drops++; -+ if (net_ratelimit()) -+ br_info(br, "address %02x:%02x:%02x:%02x:%02x:%02x (long) drop: %lu, count:%lu\n", -+ addr[0], addr[1], -+ addr[2], addr[3], -+ addr[4], addr[5], -+ fdb->flap_drops, -+ fdb->flap_count); -+ if (br_mac_flap) -+ return -EINVAL; -+ } -+ if (fdb->last_flap) { -+ if (net_ratelimit()) -+ br_info(br, "flap stop change detected on %s with " -+ "address %02x:%02x:%02x:%02x:%02x:%02x as source. drops: %lu, count: %lu\n", -+ source->dev->name, -+ addr[0], addr[1], -+ addr[2], addr[3], -+ addr[4], addr[5], -+ fdb->flap_drops, fdb->flap_count); -+ } else { -+ if (net_ratelimit()) -+ br_info(br, "non-flap change detected on %s with " -+ "address %02x:%02x:%02x:%02x:%02x:%02x as source.\n", -+ source->dev->name, -+ addr[0], addr[1], -+ addr[2], addr[3], -+ addr[4], addr[5]); -+ } - br_switchdev_fdb_notify(br, fdb, RTM_DELNEIGH); - WRITE_ONCE(fdb->dst, source); - fdb_modified = true; -+ fdb->last_flap = 0; -+ fdb->flap_port = NULL; -+ fdb->flap_drops = 0; -+ fdb->flap_count = 0; - /* Take over HW learned entry */ - if (unlikely(test_bit(BR_FDB_ADDED_BY_EXT_LEARN, - &fdb->flags))) -@@ -932,6 +1033,42 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, - */ - if (unlikely(test_bit(BR_FDB_LOCKED, &fdb->flags))) - clear_bit(BR_FDB_LOCKED, &fdb->flags); -+ } else { -+ /* flap back? or clear flapping? */ -+ if (unlikely(fdb->last_flap)) { -+ unsigned long delta; -+ delta = fdb->last_flap + br->flap_clear_threshold; -+ if (time_before_eq(jiffies, delta)) { -+ /* possible flap back */ -+ if (fdb->flap_port != source) { -+ fdb->flap_port = source; -+ fdb->last_flap = jiffies; -+ fdb->flap_count++; -+ fdb->flap_port = source; -+ if (net_ratelimit()) -+ br_info(br, "flap back detected on %s with " -+ "address %02x:%02x:%02x:%02x:%02x:%02x as source\n", -+ source->dev->name, -+ addr[0], addr[1], -+ addr[2], addr[3], -+ addr[4], addr[5]); -+ } -+ } else { -+ /* clear thing */ -+ if (net_ratelimit()) -+ br_info(br, "clearing flap on %s with " -+ "address %02x:%02x:%02x:%02x:%02x:%02x as source, drops: %lu, count: %lu\n", -+ source->dev->name, -+ addr[0], addr[1], -+ addr[2], addr[3], -+ addr[4], addr[5], -+ fdb->flap_drops, fdb->flap_count); -+ fdb->last_flap = 0; -+ fdb->flap_port = NULL; -+ fdb->flap_drops = 0; -+ fdb->flap_count = 0; -+ } -+ } - } - - if (unlikely(test_bit(BR_FDB_ADDED_BY_USER, &flags))) { -@@ -957,6 +1094,7 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, - */ - spin_unlock(&br->hash_lock); - } -+ return 0; - } - - /* Dump information about entries, in response to GETNEIGH */ -@@ -1178,7 +1316,7 @@ static int __br_fdb_add(struct ndmsg *ndm, struct net_bridge *br, - - local_bh_disable(); - rcu_read_lock(); -- br_fdb_update(br, p, addr, vid, BIT(BR_FDB_ADDED_BY_USER)); -+ br_fdb_update(br, p, addr, vid, BIT(BR_FDB_ADDED_BY_USER), NULL); - rcu_read_unlock(); - local_bh_enable(); - } else if (ndm->ndm_flags & NTF_EXT_LEARNED) { -diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c -index 408559d16..73c5e3023 100644 ---- a/net/bridge/br_input.c -+++ b/net/bridge/br_input.c -@@ -33,9 +33,11 @@ int br_arp_probe __read_mostly = 1; - int br_arp_probe_per_packets __read_mostly = 8192; - u8 br_arp_probe_src_mac[ETH_ALEN+1] = {0}; - int br_arp_probe_src_mac_set = 0; -+int br_mac_flap = 0; - #else - #define br_arp_probe 1 - #define br_arp_probe_per_packets 8192 -+#define br_mac_flap 0 - #endif - - static int -@@ -166,6 +168,13 @@ static struct ctl_table br_input_table[] = { - .mode = 0644, - .proc_handler = proc_arp_probe_src_mac, - }, -+ { -+ .procname = "mac_flap", -+ .data = &br_mac_flap, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec, -+ }, - }; - - int br_input_sysctl_init(void) -@@ -370,7 +379,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb - */ - if (p->flags & BR_PORT_MAB) - br_fdb_update(br, p, eth_hdr(skb)->h_source, -- vid, BIT(BR_FDB_LOCKED)); -+ vid, BIT(BR_FDB_LOCKED), skb); - goto drop; - } else if (READ_ONCE(fdb_src->dst) != p || - test_bit(BR_FDB_LOCAL, &fdb_src->flags)) { -@@ -381,7 +390,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb - * the packet. - */ - br_fdb_update(br, p, eth_hdr(skb)->h_source, vid, -- BIT(BR_FDB_LOCKED)); -+ BIT(BR_FDB_LOCKED), skb); - goto drop; - } - } -@@ -389,8 +398,15 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb - nbp_switchdev_frame_mark(p, skb); - - /* insert into forwarding database after filtering to avoid spoofing */ -- if (p->flags & BR_LEARNING) -- br_fdb_update(br, p, eth_hdr(skb)->h_source, vid, 0); -+ if (p->flags & BR_LEARNING) { -+ int rc; -+ rc = br_fdb_update(br, p, eth_hdr(skb)->h_source, vid, false, skb); -+ if (br_mac_flap ){ -+ if (rc < 0) { -+ goto drop; -+ } -+ } -+ } - - promisc = !!(br->dev->flags & IFF_PROMISC); - local_rcv = promisc; -@@ -493,7 +509,7 @@ static void __br_handle_local_finish(struct sk_buff *skb) - nbp_state_should_learn(p) && - !br_opt_get(p->br, BROPT_NO_LL_LEARN) && - br_should_learn(p, skb, &vid)) -- br_fdb_update(p->br, p, eth_hdr(skb)->h_source, vid, 0); -+ br_fdb_update(p->br, p, eth_hdr(skb)->h_source, vid, 0, skb); - } - - /* note: already called with rcu_read_lock */ -diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h -index db31d918d..50b34f3b1 100644 ---- a/net/bridge/br_private.h -+++ b/net/bridge/br_private.h -@@ -298,6 +298,10 @@ struct net_bridge_fdb_entry { - /* write-heavy members should not affect lookups */ - unsigned long updated ____cacheline_aligned_in_smp; - unsigned long used; -+ unsigned long last_flap; -+ struct net_bridge_port *flap_port; -+ unsigned long flap_drops; -+ unsigned long flap_count; - - struct rcu_head rcu; - }; -@@ -590,6 +594,12 @@ struct net_bridge { - struct hlist_head mep_list; - #endif - struct ukn_unicast_stats __percpu *ukn_stats; -+#define BR_DEFAULT_FLAP_THRESHOLD 0 -+#define BR_DEFAULT_FLAP_CLEAR_THRESHOLD (HZ) -+#define BR_DEFAULT_FLAP_LONG_THRESHOLD (10 * (HZ)) -+ unsigned long flap_threshold; -+ unsigned long flap_clear_threshold; -+ unsigned long flap_long_threshold; - }; - - struct br_input_skb_cb { -@@ -861,8 +871,8 @@ int br_fdb_fillbuf(struct net_bridge *br, void *buf, unsigned long count, - unsigned long off); - int br_fdb_add_local(struct net_bridge *br, struct net_bridge_port *source, - const unsigned char *addr, u16 vid); --void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, -- const unsigned char *addr, u16 vid, unsigned long flags); -+int br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, -+ const unsigned char *addr, u16 vid, unsigned long flags, struct sk_buff *skb); - - int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], - struct net_device *dev, const unsigned char *addr, u16 vid, -diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c -index cc0f7a301..cd74ef897 100644 ---- a/net/bridge/br_sysfs_br.c -+++ b/net/bridge/br_sysfs_br.c -@@ -888,6 +888,87 @@ static ssize_t default_pvid_store(struct device *d, - } - static DEVICE_ATTR_RW(default_pvid); - -+static int set_br_flap_threshold(struct net_bridge *br, unsigned long val, struct netlink_ext_ack *extack) -+{ -+ /* limit value to 10s */ -+ if (val > 10 * MSEC_PER_SEC) { -+ val = 10 * MSEC_PER_SEC; -+ } -+ br->flap_threshold = (val * HZ) / MSEC_PER_SEC; -+ return 0; -+} -+ -+static ssize_t flap_threshold_show(struct device *d, -+ struct device_attribute *attr, -+ char *buf) -+{ -+ struct net_bridge *br = to_bridge(d); -+ return sprintf(buf, "%lu\n", (br->flap_threshold * MSEC_PER_SEC) / HZ); -+} -+ -+static ssize_t flap_threshold_store(struct device *d, -+ struct device_attribute *attr, -+ const char *buf, size_t len) -+{ -+ return store_bridge_parm(d, buf, len, set_br_flap_threshold); -+} -+static DEVICE_ATTR_RW(flap_threshold); -+ -+static int set_br_flap_clear_threshold(struct net_bridge *br, unsigned long val, struct netlink_ext_ack *extack) -+{ -+ /* limit value to 10s */ -+ if (val > 10 * MSEC_PER_SEC) { -+ val = 10 * MSEC_PER_SEC; -+ } -+ br->flap_clear_threshold = (val * HZ) / MSEC_PER_SEC; -+ return 0; -+} -+ -+static ssize_t flap_clear_threshold_show(struct device *d, -+ struct device_attribute *attr, -+ char *buf) -+{ -+ struct net_bridge *br = to_bridge(d); -+ return sprintf(buf, "%lu\n", (br->flap_clear_threshold * MSEC_PER_SEC) / HZ); -+} -+ -+static ssize_t flap_clear_threshold_store(struct device *d, -+ struct device_attribute *attr, -+ const char *buf, size_t len) -+{ -+ return store_bridge_parm(d, buf, len, set_br_flap_clear_threshold); -+} -+static DEVICE_ATTR_RW(flap_clear_threshold); -+ -+static int set_br_flap_long_threshold(struct net_bridge *br, unsigned long val, struct netlink_ext_ack *extack) -+{ -+ /* limit value to 100s */ -+ if (val > 100 * MSEC_PER_SEC) { -+ val = 100 * MSEC_PER_SEC; -+ } -+ br->flap_long_threshold = (val * HZ) / MSEC_PER_SEC; -+ return 0; -+} -+ -+static ssize_t flap_long_threshold_show(struct device *d, -+ struct device_attribute *attr, -+ char *buf) -+{ -+ struct net_bridge *br = to_bridge(d); -+ return sprintf(buf, "%lu\n", (br->flap_long_threshold * MSEC_PER_SEC) / HZ); -+} -+ -+static ssize_t flap_long_threshold_store(struct device *d, -+ struct device_attribute *attr, -+ const char *buf, size_t len) -+{ -+ return store_bridge_parm(d, buf, len, set_br_flap_long_threshold); -+} -+static DEVICE_ATTR_RW(flap_long_threshold); -+ -+ -+ -+ - static ssize_t vlan_stats_enabled_show(struct device *d, - struct device_attribute *attr, - char *buf) -@@ -1011,6 +1092,9 @@ static struct attribute *bridge_attrs[] = { - &dev_attr_vlan_stats_per_port.attr, - #endif - &dev_attr_ukn_unicast_stats.attr, -+ &dev_attr_flap_threshold.attr, -+ &dev_attr_flap_clear_threshold.attr, -+ &dev_attr_flap_long_threshold.attr, - NULL - }; - --- -2.43.7 - diff --git a/SPECS/91/linux/hcx/0007-vmxnet3-Avoid-fragmentation-by-giving-each-vmxnet3-d.patch b/SPECS/91/linux/hcx/0007-vmxnet3-Avoid-fragmentation-by-giving-each-vmxnet3-d.patch deleted file mode 100644 index b64388c180..0000000000 --- a/SPECS/91/linux/hcx/0007-vmxnet3-Avoid-fragmentation-by-giving-each-vmxnet3-d.patch +++ /dev/null @@ -1,265 +0,0 @@ -From 284ac6ca71e16bec085daa8605aa02ad29eec2be Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Sun, 4 Jan 2026 18:48:00 +0530 -Subject: [PATCH 07/15] vmxnet3: Avoid fragmentation by giving each vmxnet3 - device a per-rx-queue page - -Linux network stack uses an allocation page cache for skbs. The -purpose is to reduce the number of page allocations that it needs to -make, and it works by allocating a group of pages, and then -sub-allocating skb memory from them. When all skbs referencing the -shared pages are freed, then the block of pages is finally freed. - -When these skbs are all freed close together in time, this works fine. -However, what can happen is that there are multiple nics (or multiple -rx-queues in a single nic), and the skbs are allocated to fill the rx -ring(s). If some nics or queues are far more active than others, the -entries in the less busy nic/queue may end up referencing a page -block, while all of the other packets that referenced that block of -pages are freed. - -The result of this is that the memory used by an appliance for its rx -rings can slowly grow to be much greater than it was originally. - -This patch fixes that by giving each vmxnet3 device a per-rx-queue page -cache. - -Signed-off-by: Srish Srinivasan -Signed-off-by: Guruswamy Basavaiah ---- - drivers/net/vmxnet3/vmxnet3_drv.c | 78 +++++++++++++++++++++++++++++-- - drivers/net/vmxnet3/vmxnet3_int.h | 2 + - include/linux/skbuff.h | 2 + - net/core/skbuff.c | 22 ++++++--- - 4 files changed, 92 insertions(+), 12 deletions(-) - -diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c -index e1e472b3a301..2ab40409c9f4 100644 ---- a/drivers/net/vmxnet3/vmxnet3_drv.c -+++ b/drivers/net/vmxnet3/vmxnet3_drv.c -@@ -33,6 +33,33 @@ - char vmxnet3_driver_name[] = "vmxnet3"; - #define VMXNET3_DRIVER_DESC "VMware vmxnet3 virtual NIC driver" - -+#ifdef CONFIG_SYSCTL -+#include -+static struct ctl_table_header *vmxnet3_sysctl_header; -+int vmxnet3_rcvq_avoid_frag __read_mostly = 0; -+static struct ctl_table vmxnet3_sysctl_table[] = { -+ { -+ .procname = "vmxnet3_rcvq_avoid_frag", -+ .data = &vmxnet3_rcvq_avoid_frag, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec, -+ }, -+}; -+ -+static int vmxnet3_sysctl_init(void) -+{ -+ vmxnet3_sysctl_header = register_net_sysctl(&init_net, "net", vmxnet3_sysctl_table); -+ if (vmxnet3_sysctl_header == NULL) { -+ printk(KERN_ERR "vmxnet3: can't register to sysctl"); -+ return -ENOMEM; -+ } -+ return 0; -+} -+#else -+#define vmxnet3_rcvq_avoid_frag 0 -+#endif -+ - /* - * PCI Device ID Table - * Last entry must be all 0s -@@ -686,9 +713,17 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx, - val = VMXNET3_RXD_BTYPE_HEAD << VMXNET3_RXD_BTYPE_SHIFT; - } else if (rbi->buf_type == VMXNET3_RX_BUF_SKB) { - if (rbi->skb == NULL) { -- rbi->skb = __netdev_alloc_skb_ip_align(adapter->netdev, -- rbi->len, -- GFP_KERNEL); -+ if (vmxnet3_rcvq_avoid_frag) { -+ rbi->skb = ___netdev_alloc_skb(adapter->netdev, -+ rbi->len + NET_IP_ALIGN, GFP_KERNEL, -+ &adapter->frag_cache[rq->qid]); -+ if (NET_IP_ALIGN && rbi->skb) -+ skb_reserve(rbi->skb, NET_IP_ALIGN); -+ } else { -+ rbi->skb = __netdev_alloc_skb_ip_align(adapter->netdev, -+ rbi->len, -+ GFP_KERNEL); -+ } - if (unlikely(rbi->skb == NULL)) { - rq->stats.rx_buf_alloc_failure++; - break; -@@ -1724,8 +1759,17 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, - - goto rcd_done; - } -- new_skb = netdev_alloc_skb_ip_align(adapter->netdev, -- len); -+ if (vmxnet3_rcvq_avoid_frag) { -+ new_skb = ___netdev_alloc_skb(adapter->netdev, -+ len + NET_IP_ALIGN, GFP_ATOMIC, -+ &adapter->frag_cache[rq->qid]); -+ if (NET_IP_ALIGN && new_skb) -+ skb_reserve(new_skb, NET_IP_ALIGN); -+ } else { -+ new_skb = netdev_alloc_skb_ip_align(adapter->netdev, -+ len); -+ } -+ - if (new_skb == NULL) { - /* Skb allocation failed, do not handover this - * skb to stack. Reuse it. Drop the existing pkt -@@ -1780,6 +1824,9 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, - } - - skb_record_rx_queue(ctx->skb, rq->qid); -+ if (vmxnet3_rcvq_avoid_frag) { -+ skb_record_rx_queue(ctx->skb, rq->qid); -+ } - skb_put(ctx->skb, rcd->len); - - if (VMXNET3_VERSION_GE_2(adapter) && -@@ -4361,6 +4408,21 @@ vmxnet3_remove_device(struct pci_dev *pdev) - adapter->shared, adapter->shared_pa); - dma_unmap_single(&adapter->pdev->dev, adapter->adapter_pa, - sizeof(struct vmxnet3_adapter), DMA_TO_DEVICE); -+ if (vmxnet3_rcvq_avoid_frag) { -+ int i; -+ for (i = 0; i < VMXNET3_DEVICE_MAX_RX_QUEUES; i++) { -+ struct page *page; -+ struct page_frag_cache *nc; -+ -+ nc = &adapter->frag_cache[i]; -+ if (unlikely(!nc->va)) { -+ /* nothing to do */ -+ continue; -+ } -+ page = virt_to_page(nc->va); -+ __page_frag_cache_drain(page, nc->pagecnt_bias); -+ } -+ } - free_netdev(netdev); - } - -@@ -4584,6 +4646,9 @@ vmxnet3_init_module(void) - { - pr_info("%s - version %s\n", VMXNET3_DRIVER_DESC, - VMXNET3_DRIVER_VERSION_REPORT); -+#ifdef CONFIG_SYSCTL -+ vmxnet3_sysctl_init(); -+#endif - return pci_register_driver(&vmxnet3_driver); - } - -@@ -4593,6 +4658,9 @@ module_init(vmxnet3_init_module); - static void - vmxnet3_exit_module(void) - { -+#ifdef CONFIG_SYSCTL -+ unregister_net_sysctl_table(vmxnet3_sysctl_header); -+#endif - pci_unregister_driver(&vmxnet3_driver); - } - -diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h -index 9f24d66dbb27..378ed89b2887 100644 ---- a/drivers/net/vmxnet3/vmxnet3_int.h -+++ b/drivers/net/vmxnet3/vmxnet3_int.h -@@ -42,6 +42,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -407,6 +408,7 @@ struct vmxnet3_adapter { - dma_addr_t shared_pa; - dma_addr_t queue_desc_pa; - dma_addr_t coal_conf_pa; -+ struct page_frag_cache frag_cache[VMXNET3_DEVICE_MAX_RX_QUEUES]; - - /* Wake-on-LAN */ - u32 wol; -diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h -index fb9513bd66e4..4a11aac79c0a 100644 ---- a/include/linux/skbuff.h -+++ b/include/linux/skbuff.h -@@ -3375,6 +3375,8 @@ static inline void *netdev_alloc_frag_align(unsigned int fragsz, - - struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int length, - gfp_t gfp_mask); -+struct sk_buff *___netdev_alloc_skb(struct net_device *dev, unsigned int length, -+ gfp_t gfp_mask, struct page_frag_cache *nc); - - /** - * netdev_alloc_skb - allocate an skbuff for rx on a specific device -diff --git a/net/core/skbuff.c b/net/core/skbuff.c -index 6a92c03ee6f4..c1ad286f6f1e 100644 ---- a/net/core/skbuff.c -+++ b/net/core/skbuff.c -@@ -714,10 +714,11 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, - EXPORT_SYMBOL(__alloc_skb); - - /** -- * __netdev_alloc_skb - allocate an skbuff for rx on a specific device -+ * ___netdev_alloc_skb - allocate an skbuff for rx on a specific device - * @dev: network device to receive on - * @len: length to allocate - * @gfp_mask: get_free_pages mask, passed to alloc_skb -+ * @nc: page frag cache - * - * Allocate a new &sk_buff and assign it a usage count of one. The - * buffer has NET_SKB_PAD headroom built in. Users should allocate -@@ -726,10 +727,9 @@ EXPORT_SYMBOL(__alloc_skb); - * - * %NULL is returned if there is no free memory. - */ --struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int len, -- gfp_t gfp_mask) -+struct sk_buff *___netdev_alloc_skb(struct net_device *dev, unsigned int len, -+ gfp_t gfp_mask, struct page_frag_cache *nc) - { -- struct page_frag_cache *nc; - struct sk_buff *skb; - bool pfmemalloc; - void *data; -@@ -754,14 +754,15 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int len, - gfp_mask |= __GFP_MEMALLOC; - - if (in_hardirq() || irqs_disabled()) { -- nc = this_cpu_ptr(&netdev_alloc_cache); -+ if (!nc) -+ nc = this_cpu_ptr(&netdev_alloc_cache); - data = page_frag_alloc(nc, len, gfp_mask); - pfmemalloc = nc->pfmemalloc; - } else { - local_bh_disable(); - local_lock_nested_bh(&napi_alloc_cache.bh_lock); -- -- nc = this_cpu_ptr(&napi_alloc_cache.page); -+ if (!nc) -+ nc = this_cpu_ptr(&napi_alloc_cache.page); - data = page_frag_alloc(nc, len, gfp_mask); - pfmemalloc = nc->pfmemalloc; - -@@ -789,6 +790,13 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int len, - skb_fail: - return skb; - } -+EXPORT_SYMBOL(___netdev_alloc_skb); -+ -+struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int len, -+ gfp_t gfp_mask) -+{ -+ return ___netdev_alloc_skb(dev, len, gfp_mask, NULL); -+} - EXPORT_SYMBOL(__netdev_alloc_skb); - - /** --- -2.43.0 - diff --git a/SPECS/91/linux/hcx/0008-RPS-flow-balance.patch b/SPECS/91/linux/hcx/0008-RPS-flow-balance.patch deleted file mode 100644 index 56bbb1affd..0000000000 --- a/SPECS/91/linux/hcx/0008-RPS-flow-balance.patch +++ /dev/null @@ -1,1020 +0,0 @@ -From 5401eb53d641d83168d9a4e4faea668e0adacc56 Mon Sep 17 00:00:00 2001 -From: Jonathan Shao -Date: Mon, 5 Jan 2026 18:37:36 +0530 -Subject: [PATCH] RPS flow balance - -Signed-off-by: Guruswamy Basavaiah ---- - include/linux/netdevice.h | 14 ++ - include/net/netdev_rx_queue.h | 12 + - net/core/dev.c | 401 ++++++++++++++++++++++++++++++++-- - net/core/net-procfs.c | 66 +++++- - net/core/net-sysfs.c | 187 ++++++++++++++++ - net/core/sysctl_net_core.c | 42 ++++ - 6 files changed, 704 insertions(+), 18 deletions(-) - -diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h -index 0aa536df9..c8df2de98 100644 ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -3282,6 +3282,13 @@ struct softnet_data { - struct softnet_data *rps_ipi_next; - unsigned int cpu; - unsigned int input_queue_tail; -+ unsigned int do_move; -+ unsigned int first_place; -+ unsigned int keep_place; -+ unsigned int try_elephant; -+ unsigned int try_mouse; -+ unsigned int user_def_rps_skip; -+ unsigned int user_def_rps_proc; - #endif - struct sk_buff_head input_pkt_queue; - struct napi_struct backlog; -@@ -5002,6 +5009,13 @@ static inline bool netdev_xmit_more(void) - } - #endif - -+extern int netdev_custom_steer; -+extern int netdev_elephant_trigger; -+extern int netdev_mice_trigger; -+extern int netdev_better_threshold; -+extern int netdev_flowlim_threshold; -+extern int netdev_dbg_hash; -+ - static inline netdev_tx_t __netdev_start_xmit(const struct net_device_ops *ops, - struct sk_buff *skb, struct net_device *dev, - bool more) -diff --git a/include/net/netdev_rx_queue.h b/include/net/netdev_rx_queue.h -index 596836abf..e88f21082 100644 ---- a/include/net/netdev_rx_queue.h -+++ b/include/net/netdev_rx_queue.h -@@ -14,6 +14,18 @@ struct netdev_rx_queue { - #ifdef CONFIG_RPS - struct rps_map __rcu *rps_map; - struct rps_dev_flow_table __rcu *rps_flow_table; -+#define RPS_USER_DEF_MAKE(o,m,s,f) ((((u64)(f) & 0x1) << 56) | (((u64)(s) & 0xFF) << 48) | (((u64)(o) & 0xFFFF) << 32) | (u64)(m) & 0xFFFFFFFF) -+#define RPS_USER_DEF_MASK(u) ((u32)(u)) -+#define RPS_USER_DEF_OFFSET(u) ((u16)(((u) >> 32) & 0xFFFF)) -+#define RPS_USER_DEF_SHIFT(u) ((u8)(((u) >> 48) & 0xFF)) -+#define RPS_USER_DEF_FILTER_EN(u) ((u8)(((u) >> 56) & 0x1)) -+ atomic64_t rps_user_def; -+ atomic_t rps_flow_balance; -+ atomic_t rps_flow_limit; -+ atomic_t rps_user_def_dst_ip; -+ atomic_t rps_user_def_dst_ip_mask; -+ atomic_t rps_user_def_dst_port_low; -+ atomic_t rps_user_def_dst_port_high; - #endif - struct kobject kobj; - struct net_device *dev; -diff --git a/net/core/dev.c b/net/core/dev.c -index 28a44ff68..d67e59cd9 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -4654,6 +4654,19 @@ EXPORT_SYMBOL(__dev_direct_xmit); - *************************************************************************/ - static DEFINE_PER_CPU(struct task_struct *, backlog_napi); - -+int netdev_custom_steer __read_mostly = 0; -+EXPORT_SYMBOL(netdev_custom_steer); -+int netdev_elephant_trigger __read_mostly = 2; -+EXPORT_SYMBOL(netdev_elephant_trigger); -+int netdev_mice_trigger __read_mostly = 4; -+EXPORT_SYMBOL(netdev_mice_trigger); -+int netdev_better_threshold __read_mostly = 6; -+EXPORT_SYMBOL(netdev_better_threshold); -+int netdev_flowlim_threshold __read_mostly = 1; -+EXPORT_SYMBOL(netdev_flowlim_threshold); -+int netdev_dbg_hash __read_mostly = 0; -+EXPORT_SYMBOL(netdev_dbg_hash); -+ - int weight_p __read_mostly = 64; /* old backlog weight */ - int dev_weight_rx_bias __read_mostly = 1; /* bias for backlog weight */ - int dev_weight_tx_bias __read_mostly = 1; /* bias for output_queue quota */ -@@ -4746,6 +4759,175 @@ set_rps_cpu(struct net_device *dev, struct sk_buff *skb, - WRITE_ONCE(rflow->cpu, next_cpu); - return rflow; - } -+ /* -+ * Return the least backlogged CPU from map, provided it -+ * is at least below some threshold. -+ */ -+static int rps_least_backlogged_cpu(struct rps_map *map, int current_cpu) -+{ -+ int i; -+ int cpu = current_cpu; -+ struct softnet_data *sd; -+ unsigned int qlen; -+ /* must be below this to be considered */ -+ unsigned int least = net_hotdata.max_backlog >> netdev_better_threshold; -+ -+ for (i=0; i < map->len; i++) { -+ sd = &per_cpu(softnet_data, map->cpus[i]); -+ qlen = skb_queue_len(&sd->input_pkt_queue); -+ -+ if (qlen < least) { -+ least = qlen; -+ cpu = map->cpus[i]; -+ } else if ((qlen == least) && (map->cpus[i] == current_cpu)) { -+ cpu = current_cpu; -+ } -+ } -+ return cpu; -+} -+ -+static int get_user_def_rps_cpu(const struct sk_buff *skb, -+ struct net_device *dev, -+ struct netdev_rx_queue *rxqueue, -+ struct rps_map *map, -+ struct softnet_data *local_sd) { -+ u32 tcpu; -+ u64 rps_user_def; -+ u32 rps_user_def_mask; -+ u16 rps_user_def_offset; -+ u8 rps_user_def_shift; -+ u32 pkt_value; -+ -+ if (map->len <= 0) { -+ return -1; -+ } -+ -+ // Try using the used-defined queue decider -+ rps_user_def = atomic64_read(&rxqueue->rps_user_def); -+ rps_user_def_mask = RPS_USER_DEF_MASK(rps_user_def); -+ // rps_user_def_mask should be non zero -+ if (!rps_user_def_mask) { -+ return -1; -+ } -+ -+ // Apply filter if enabled -+ if (RPS_USER_DEF_FILTER_EN(rps_user_def)) { -+ struct flow_keys flow; -+ u32 rps_user_def_dst_ip_mask; -+ u32 rps_user_def_dst_port_high; -+ __be32 dst; -+ -+ // Extract flow details -+ if (!skb_flow_dissect_flow_keys(skb, &flow, 0)) { -+ goto user_def_rps_skip; -+ } -+ dst = flow_get_u32_dst(&flow); -+ -+ // check dst-ip if mask set -+ rps_user_def_dst_ip_mask = -+ atomic_read(&rxqueue->rps_user_def_dst_ip_mask); -+ if (rps_user_def_dst_ip_mask) { -+ if ((ntohl(dst) & rps_user_def_dst_ip_mask) != -+ (atomic_read(&rxqueue->rps_user_def_dst_ip) & -+ rps_user_def_dst_ip_mask)) { -+ goto user_def_rps_skip; -+ } -+ } -+ -+ // check dst-port if mask set -+ rps_user_def_dst_port_high = -+ atomic_read(&rxqueue->rps_user_def_dst_port_high); -+ if (rps_user_def_dst_port_high) { -+ u32 dport; -+ -+ // Hard-coded ip-proto check to match UDP -+ if (flow.basic.ip_proto != IPPROTO_UDP) { -+ goto user_def_rps_skip; -+ } -+ -+ dport = ntohs(flow.ports.dst); -+ if ((dport < atomic_read( -+ &rxqueue->rps_user_def_dst_port_low)) || -+ (dport > rps_user_def_dst_port_high)) { -+ goto user_def_rps_skip; -+ } -+ } -+ } -+ -+ local_sd->user_def_rps_proc++; -+ -+ rps_user_def_offset = RPS_USER_DEF_OFFSET(rps_user_def); -+ if (skb_copy_bits(skb, skb_network_offset(skb) + rps_user_def_offset, -+ &pkt_value, sizeof(u32)) < 0) { -+ return -1; -+ } -+ -+ rps_user_def_shift = RPS_USER_DEF_SHIFT(rps_user_def); -+ pkt_value = be32_to_cpu(pkt_value); -+ pkt_value = (pkt_value & rps_user_def_mask) >> rps_user_def_shift; -+ pkt_value++; -+ tcpu = map->cpus[pkt_value % map->len]; -+ if (cpu_online(tcpu)) { -+ return tcpu; -+ } -+ return -1; -+ -+user_def_rps_skip: -+ local_sd->user_def_rps_skip++; -+ return -1; -+} -+ -+/* -+ * Determine whether rps flow is backlogged. Takes into account -+ * potential for input_queue_head to have advanced to the point where -+ * subtraction overflows. -+ * -+ * Details: -+ * -+ * The input queue for a CPU has a head and tail counter. The tail is -+ * incremented when a packet is put into the input queue. The head is -+ * incremented after a packet is pulled from the queue and processed. -+ * -+ * When the rps code shifts a packet to another cpu, it records the -+ * tail value for that cpu in the flow's record (rflow->last_qtail). -+ * -+ * When it's deciding whether it is okay to move a flow between CPUs, -+ * it checks that there are no packets for the flow in the backlog. -+ * It has been doing this by this logic: -+ * -+ * (((int)(queue_head - rflow->last_qtail)) >= 0) -+ * -+ * which is olrc below. -+ * -+ * It wants to know whether head has advanced past the last packet -+ * queued, so it does subtraction. To account for the possibility of -+ * wraparound, it casts that to int and checks for >= 0. Note that it -+ * could simply do queue_head > last_qtail, except that could be wrong -+ * immediately after queue_head wraps around. Thus, the cast to int -+ * and >= 0. This is what it was doing. -+ * -+ * Notice, that when the diff is cast to int, the range of values goes -+ * from INT_MIN up to INT_MAX, and that all values from INT_MIN up to -+ * -1 are considered as 'backlogged'. However, the actual backlog is -+ * limited to netdev_max_backlog packets. So the vast majority of -+ * that range is, in fact, not backlogged. -+ * -+ * A better check is to look at the actual backlog, and the backlog -+ * that would be needed for the flow to be backlogged and compare -+ * them. Because the actual backlog is limited by netdev_max_backlog, -+ * the wraparound case does not affect this. -+ */ -+static inline bool rps_flow_is_backlogged(int cpu, struct rps_dev_flow *rflow) -+{ -+ unsigned int queue_head = per_cpu(softnet_data, cpu).input_queue_head; -+ unsigned int queue_tail = per_cpu(softnet_data, cpu).input_queue_tail; -+ unsigned int backlog = queue_tail - queue_head; -+ unsigned int flow_backlog = rflow->last_qtail - queue_head; -+ return ((flow_backlog > 0) && (flow_backlog <= backlog)); -+} -+ -+/* this macro checks if the head of queue has moved beyond last recorded tail */ -+#define CHECK_QTAIL(t,r) (((int)(per_cpu(softnet_data, (t)).input_queue_head - (r)->last_qtail)) >= 0) - - /* - * get_rps_cpu is called from netif_receive_skb and returns the target -@@ -4753,7 +4935,9 @@ set_rps_cpu(struct net_device *dev, struct sk_buff *skb, - * rcu_read_lock must be held on entry. - */ - static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb, -- struct rps_dev_flow **rflowp) -+ struct rps_dev_flow **rflowp, -+ int *do_flow_limit, -+ int *do_flow_balance, struct rps_map **mapp) - { - const struct rps_sock_flow_table *sock_flow_table; - struct netdev_rx_queue *rxqueue = dev->_rx; -@@ -4761,7 +4945,10 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb, - struct rps_map *map; - int cpu = -1; - u32 tcpu; -+ u32 raw_hash = 0; - u32 hash; -+ int local_cpu = smp_processor_id(); -+ struct softnet_data *local_sd = &per_cpu(softnet_data, local_cpu); - - if (skb_rx_queue_recorded(skb)) { - u16 index = skb_get_rx_queue(skb); -@@ -4784,6 +4971,9 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb, - goto done; - - skb_reset_network_header(skb); -+ if (netdev_custom_steer && unlikely(netdev_dbg_hash)) { -+ raw_hash = skb->hash; -+ } - hash = skb_get_hash(skb); - if (!hash) - goto done; -@@ -4794,12 +4984,31 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb, - u32 next_cpu; - u32 ident; - -+ if (netdev_custom_steer) { -+ /* in here, so won't do uplinks, as we don't set flow table for them. */ -+ if (unlikely(netdev_dbg_hash && net_ratelimit())) { -+ pr_info("dev: %s, skb_hash: %p: raw: %08x, cooked: %08x, queue: %u\n", -+ dev->name, skb, raw_hash, hash, skb_get_rx_queue(skb)); -+ } -+ -+ if (do_flow_limit) { -+ *do_flow_limit = atomic_read(&rxqueue->rps_flow_limit); -+ } -+ if (do_flow_balance) { -+ *do_flow_balance = atomic_read(&rxqueue->rps_flow_balance); -+ } -+ if (mapp) { -+ *mapp = map; -+ } -+ } -+ -+ - /* First check into global flow table if there is a match. - * This READ_ONCE() pairs with WRITE_ONCE() from rps_record_sock_flow(). - */ - ident = READ_ONCE(sock_flow_table->ents[hash & sock_flow_table->mask]); - if ((ident ^ hash) & ~net_hotdata.rps_cpu_mask) -- goto try_rps; -+ goto try_just_flows; - - next_cpu = ident & net_hotdata.rps_cpu_mask; - -@@ -4808,6 +5017,97 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb, - */ - rflow = &flow_table->flows[hash & flow_table->mask]; - tcpu = rflow->cpu; -+ /* -+ * If the desired CPU (where last recvmsg was done) is -+ * different from current CPU (one in the rx-queue flow -+ * table entry), switch if one of the following holds: -+ * - Current CPU is unset (>= nr_cpu_ids). -+ * - Current CPU is offline. -+ * - The current CPU's queue tail has advanced beyond the -+ * last packet that was enqueued using this table entry. -+ * This guarantees that all previous packets for the flow -+ * have been dequeued, thus preserving in order delivery. -+ */ -+ if (unlikely(tcpu != next_cpu) && -+ (tcpu >= nr_cpu_ids || !cpu_online(tcpu) || -+ (netdev_custom_steer == 1 ? -+ !rps_flow_is_backlogged(tcpu, rflow) : CHECK_QTAIL(tcpu, rflow)))) { -+ if (netdev_custom_steer) { -+ if (tcpu >= nr_cpu_ids || !cpu_online(tcpu)) { -+ local_sd->first_place++; -+ } else { -+ local_sd->do_move++; -+ } -+ } -+ tcpu = next_cpu; -+ rflow = set_rps_cpu(dev, skb, rflow, next_cpu); -+ } else if (netdev_custom_steer && tcpu != next_cpu) { -+ local_sd->keep_place++; -+ } -+ -+ if (tcpu < nr_cpu_ids && cpu_online(tcpu)) { -+ *rflowp = rflow; -+ cpu = tcpu; -+ goto done; -+ } else if (netdev_custom_steer) { -+ /* don't want just flows, as above already tried */ -+ goto try_rps; -+ } -+ } -+ -+try_just_flows: -+ if (!netdev_custom_steer) { -+ goto try_rps; -+ } -+ if (flow_table && map) { -+ /* if we have just per-dev flow table, try to move -+ flows when backlogged */ -+ struct rps_dev_flow *rflow; -+ u32 next_cpu; -+ -+ /* OK, we didn't find an elephant flow, match, but use -+ * per rx queue flow table to deal with mice -+ */ -+ rflow = &flow_table->flows[hash & flow_table->mask]; -+ tcpu = rflow->cpu; -+ if (tcpu != RPS_NO_CPU) { -+ struct softnet_data *sd; -+ unsigned int qlen; -+ -+ sd = &per_cpu(softnet_data, tcpu); -+ qlen = skb_queue_len(&sd->input_pkt_queue); -+ -+ if (qlen > (net_hotdata.max_backlog >> netdev_mice_trigger)) { -+ local_sd->try_mouse++; -+ next_cpu = rps_least_backlogged_cpu(map, tcpu); -+ if (next_cpu == RPS_NO_CPU) { -+ next_cpu = tcpu; -+ } -+ } else { -+ /* stick with current cpu, if still okay */ -+ local_sd->keep_place++; -+ next_cpu = tcpu; -+ } -+ } else { -+ struct softnet_data *sd; -+ unsigned int qlen; -+ -+ local_sd->first_place++; -+ -+ /* start with regular rps */ -+ next_cpu = map->cpus[reciprocal_scale(hash, map->len)]; -+ sd = &per_cpu(softnet_data, next_cpu); -+ qlen = skb_queue_len(&sd->input_pkt_queue); -+ -+ if ((qlen > (net_hotdata.max_backlog >> netdev_mice_trigger)) && -+ ((next_cpu = rps_least_backlogged_cpu(map, next_cpu)) -+ != RPS_NO_CPU)) { -+ local_sd->try_mouse++; -+ } else { -+ next_cpu = map->cpus[reciprocal_scale(hash, map->len)]; -+ local_sd->keep_place++; -+ } -+ } - - /* - * If the desired CPU (where last recvmsg was done) is -@@ -4822,8 +5122,10 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb, - */ - if (unlikely(tcpu != next_cpu) && - (tcpu >= nr_cpu_ids || !cpu_online(tcpu) || -- ((int)(READ_ONCE(per_cpu(softnet_data, tcpu).input_queue_head) - -- rflow->last_qtail)) >= 0)) { -+ !rps_flow_is_backlogged(tcpu, rflow))) { -+ if (tcpu != RPS_NO_CPU) { -+ local_sd->do_move++; -+ } - tcpu = next_cpu; - rflow = set_rps_cpu(dev, skb, rflow, next_cpu); - } -@@ -4836,8 +5138,14 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb, - } - - try_rps: -- - if (map) { -+ // Try using the used-defined queue decider -+ if (netdev_custom_steer) { -+ cpu = get_user_def_rps_cpu(skb, dev, rxqueue, map, local_sd); -+ if (cpu != -1) { -+ goto done; -+ } -+ } - tcpu = map->cpus[reciprocal_scale(hash, map->len)]; - if (cpu_online(tcpu)) { - cpu = tcpu; -@@ -4972,7 +5280,8 @@ static bool skb_flow_limit(struct sk_buff *skb, unsigned int qlen) - struct softnet_data *sd; - unsigned int old_flow, new_flow; - -- if (qlen < (READ_ONCE(net_hotdata.max_backlog) >> 1)) -+ if (qlen < (READ_ONCE(net_hotdata.max_backlog) >> -+ (netdev_custom_steer == 1 ? netdev_flowlim_threshold : 1))) - return false; - - sd = this_cpu_ptr(&softnet_data); -@@ -5001,12 +5310,28 @@ static bool skb_flow_limit(struct sk_buff *skb, unsigned int qlen) - return false; - } - -+static inline void rps_record_sock_flow_w_cpu( -+ struct rps_sock_flow_table *table, -+ u32 hash, u8 cpu_id) -+{ -+ if (table && hash) { -+ unsigned int index = hash & table->mask; -+ u32 val = hash & ~net_hotdata.rps_cpu_mask; -+ -+ val |= cpu_id; -+ -+ if (table->ents[index] != val) -+ table->ents[index] = val; -+ } -+} -+ - /* - * enqueue_to_backlog is called to queue an skb to a per CPU backlog - * queue (may be a remote CPU queue). - */ - static int enqueue_to_backlog(struct sk_buff *skb, int cpu, -- unsigned int *qtail) -+ unsigned int *qtail, struct rps_map *map, -+ int do_flow_limit, int do_flow_bal) - { - enum skb_drop_reason reason; - struct softnet_data *sd; -@@ -5014,6 +5339,7 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu, - unsigned int qlen; - int max_backlog; - u32 tail; -+ int next_cpu = RPS_NO_CPU; - - reason = SKB_DROP_REASON_CPU_BACKLOG; - sd = &per_cpu(softnet_data, cpu); -@@ -5024,12 +5350,34 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu, - goto cpu_backlog_drop; - backlog_lock_irq_save(sd, &flags); - qlen = skb_queue_len(&sd->input_pkt_queue); -- if (qlen <= max_backlog && !skb_flow_limit(skb, qlen)) { -+ if (qlen <= max_backlog) { - if (unlikely(!netif_running(skb->dev))) { - reason = SKB_DROP_REASON_DEV_READY; - backlog_unlock_irq_restore(sd, &flags); - goto bad_dev; - } -+ if (netdev_custom_steer) { -+ int flow_limited = do_flow_limit && skb_flow_limit(skb, qlen); -+ if (do_flow_bal && map) { -+ if (flow_limited && -+ (qlen >= (net_hotdata.max_backlog >> netdev_elephant_trigger))) { -+ /* try to move elephant flow */ -+ sd->try_elephant++; -+ next_cpu = rps_least_backlogged_cpu(map, cpu); -+ } -+ } -+ -+ struct rps_sock_flow_table *table; -+ -+ if (do_flow_bal && next_cpu != RPS_NO_CPU) { -+ table = rcu_dereference(net_hotdata.rps_sock_flow_table); -+ if (table) { -+ rps_record_sock_flow_w_cpu(table, skb_get_hash(skb), next_cpu); -+ } -+ } -+ } else if (skb_flow_limit(skb, qlen)) { -+ goto backlog_unlock; -+ } - if (!qlen) { - /* Schedule NAPI for backlog device. We can use - * non atomic operation as we own the queue lock. -@@ -5046,7 +5394,7 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu, - rps_input_queue_tail_save(qtail, tail); - return NET_RX_SUCCESS; - } -- -+backlog_unlock: - backlog_unlock_irq_restore(sd, &flags); - - cpu_backlog_drop: -@@ -5337,14 +5685,20 @@ static int netif_rx_internal(struct sk_buff *skb) - if (static_branch_unlikely(&rps_needed)) { - struct rps_dev_flow voidflow, *rflow = &voidflow; - int cpu; -+ int do_flow_limit = 0; -+ int do_flow_balance = 0; -+ struct rps_map *map = NULL; - - rcu_read_lock(); - -- cpu = get_rps_cpu(skb->dev, skb, &rflow); -+ cpu = get_rps_cpu(skb->dev, skb, &rflow, -+ &do_flow_limit, &do_flow_balance, &map); - if (cpu < 0) - cpu = smp_processor_id(); - -- ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail); -+ ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail, -+ map, do_flow_limit, -+ do_flow_balance); - - rcu_read_unlock(); - } else -@@ -5352,7 +5706,7 @@ static int netif_rx_internal(struct sk_buff *skb) - { - unsigned int qtail; - -- ret = enqueue_to_backlog(skb, smp_processor_id(), &qtail); -+ ret = enqueue_to_backlog(skb, smp_processor_id(), &qtail, NULL, 1, 0); - } - return ret; - } -@@ -6013,10 +6367,18 @@ static int netif_receive_skb_internal(struct sk_buff *skb) - #ifdef CONFIG_RPS - if (static_branch_unlikely(&rps_needed)) { - struct rps_dev_flow voidflow, *rflow = &voidflow; -- int cpu = get_rps_cpu(skb->dev, skb, &rflow); -+ int cpu; -+ int do_flow_limit = 0; -+ int do_flow_balance = 0; -+ struct rps_map *map = NULL; -+ -+ cpu = get_rps_cpu(skb->dev, skb, &rflow, -+ &do_flow_limit, &do_flow_balance, &map); - - if (cpu >= 0) { -- ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail); -+ ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail, -+ map, do_flow_limit, -+ do_flow_balance); - rcu_read_unlock(); - return ret; - } -@@ -6046,12 +6408,19 @@ void netif_receive_skb_list_internal(struct list_head *head) - if (static_branch_unlikely(&rps_needed)) { - list_for_each_entry_safe(skb, next, head, list) { - struct rps_dev_flow voidflow, *rflow = &voidflow; -- int cpu = get_rps_cpu(skb->dev, skb, &rflow); -+ int cpu; -+ int do_flow_limit = 0; -+ int do_flow_balance = 0; -+ struct rps_map *map = NULL; -+ cpu = get_rps_cpu(skb->dev, skb, &rflow, -+ &do_flow_limit, &do_flow_balance, &map); - - if (cpu >= 0) { - /* Will be handled, remove from list */ - skb_list_del_init(skb); -- enqueue_to_backlog(skb, cpu, &rflow->last_qtail); -+ enqueue_to_backlog(skb, cpu, &rflow->last_qtail, -+ map, do_flow_limit, -+ do_flow_balance); - } - } - } -diff --git a/net/core/net-procfs.c b/net/core/net-procfs.c -index e29d43fe1..1e47184f7 100644 ---- a/net/core/net-procfs.c -+++ b/net/core/net-procfs.c -@@ -126,6 +126,7 @@ static int softnet_seq_show(struct seq_file *seq, void *v) - u32 input_qlen = softnet_input_pkt_queue_len(sd); - u32 process_qlen = softnet_process_queue_len(sd); - unsigned int flow_limit_count = 0; -+ unsigned int qlen = 0; - - #ifdef CONFIG_NET_FLOW_LIMIT - struct sd_flow_limit *fl; -@@ -137,20 +138,58 @@ static int softnet_seq_show(struct seq_file *seq, void *v) - rcu_read_unlock(); - #endif - -+#ifdef CONFIG_RPS -+ qlen = skb_queue_len_lockless(&sd->input_pkt_queue); -+#endif -+ - /* the index is the CPU id owing this sd. Since offline CPUs are not - * displayed, it would be othrwise not trivial for the user-space - * mapping the data a specific CPU - */ - seq_printf(seq, - "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x " -- "%08x %08x\n", -+ "%08x %08x %08x %08x %08x %08x %08x %08x\n", - sd->processed, atomic_read(&sd->dropped), - sd->time_squeeze, 0, - 0, 0, 0, 0, /* was fastroute */ - 0, /* was cpu_collision */ - sd->received_rps, flow_limit_count, - input_qlen + process_qlen, (int)seq->index, -- input_qlen, process_qlen); -+ input_qlen, process_qlen, -+ qlen, sd->do_move, -+ sd->first_place, sd->keep_place, -+ sd->try_elephant, sd->try_mouse); -+ -+ return 0; -+} -+ -+static int softnet_rps_seq_show(struct seq_file *seq, void *v) -+{ -+ struct softnet_data *sd = v; -+ unsigned int flow_limit_count = 0; -+ unsigned int qlen = 0; -+ -+#ifdef CONFIG_NET_FLOW_LIMIT -+ struct sd_flow_limit *fl; -+ -+ rcu_read_lock(); -+ fl = rcu_dereference(sd->flow_limit); -+ if (fl) -+ flow_limit_count = fl->count; -+ rcu_read_unlock(); -+#endif -+ -+#ifdef CONFIG_RPS -+ qlen = skb_queue_len_lockless(&sd->input_pkt_queue); -+#endif -+ -+ seq_printf(seq, -+ "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n", -+ sd->received_rps, flow_limit_count, -+ qlen, sd->do_move, -+ sd->first_place, sd->keep_place, -+ sd->try_elephant, sd->try_mouse, -+ sd->user_def_rps_skip, sd->user_def_rps_proc); - return 0; - } - -@@ -173,6 +212,26 @@ struct ptype_iter_state { - struct net_device *dev; - }; - -+static const struct seq_operations softnet_rps_seq_ops = { -+ .start = softnet_seq_start, -+ .next = softnet_seq_next, -+ .stop = softnet_seq_stop, -+ .show = softnet_rps_seq_show, -+}; -+ -+static int softnet_rps_seq_open(struct inode *inode, struct file *file) -+{ -+ return seq_open(file, &softnet_rps_seq_ops); -+} -+ -+static const struct proc_ops softnet_rps_seq_proc_ops = { -+ .proc_open = softnet_rps_seq_open, -+ .proc_read = seq_read, -+ .proc_lseek = seq_lseek, -+ .proc_release = seq_release, -+}; -+ -+ - static void *ptype_get_idx(struct seq_file *seq, loff_t pos) - { - struct ptype_iter_state *iter = seq->private; -@@ -315,6 +374,9 @@ static int __net_init dev_proc_net_init(struct net *net) - if (!proc_create_seq("softnet_stat", 0444, net->proc_net, - &softnet_seq_ops)) - goto out_dev; -+ if (!proc_create("softnet_rps_stat", S_IRUGO, net->proc_net, -+ &softnet_rps_seq_proc_ops)) -+ goto out_dev; - if (!proc_create_net("ptype", 0444, net->proc_net, &ptype_seq_ops, - sizeof(struct ptype_iter_state))) - goto out_softnet; -diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c -index 05cf5347f..957068531 100644 ---- a/net/core/net-sysfs.c -+++ b/net/core/net-sysfs.c -@@ -29,6 +29,8 @@ - #include "dev.h" - #include "net-sysfs.h" - -+#define MAX_USER_DEF_RPS_PORT 65535 -+ - #ifdef CONFIG_SYSFS - static const char fmt_hex[] = "%#x\n"; - static const char fmt_dec[] = "%d\n"; -@@ -1013,18 +1015,198 @@ static ssize_t store_rps_dev_flow_table_cnt(struct netdev_rx_queue *queue, - return len; - } - -+static ssize_t show_rps_user_def(struct netdev_rx_queue *queue, char *buf) -+{ -+ u64 value; -+ -+ value = atomic64_read(&queue->rps_user_def); -+ -+ return sprintf(buf, "0x%016llx: %u, 0x%08x, %u, %u\n", value, -+ RPS_USER_DEF_OFFSET(value), RPS_USER_DEF_MASK(value), -+ RPS_USER_DEF_SHIFT(value), RPS_USER_DEF_FILTER_EN(value)); -+} -+ -+static ssize_t store_rps_user_def(struct netdev_rx_queue *queue, const char *buf, size_t len) -+{ -+ u8 shift; -+ u64 value; -+ int rc; -+ -+ if (!capable(CAP_NET_ADMIN)) -+ return -EPERM; -+ -+ rc = kstrtou64(buf, 0, &value); -+ if (rc < 0) { -+ return -EINVAL; -+ } -+ -+ shift = RPS_USER_DEF_SHIFT(value); -+ if (shift > 31) { -+ return -EINVAL; -+ } -+ -+ atomic64_set(&queue->rps_user_def, value); -+ -+ return len; -+} -+ -+static ssize_t show_rps_flow_balance(struct netdev_rx_queue *queue, char *buf) -+{ -+ int value; -+ value = atomic_read(&queue->rps_flow_balance); -+ return sprintf(buf, "%d\n", value); -+} -+ -+static ssize_t store_rps_flow_balance(struct netdev_rx_queue *queue, const char *buf, size_t len) -+{ -+ int value; -+ int rc; -+ -+ if (!capable(CAP_NET_ADMIN)) -+ return -EPERM; -+ -+ rc = kstrtoint(buf, 0, &value); -+ if (rc < 0) -+ return rc; -+ -+ atomic_set(&queue->rps_flow_balance, value); -+ -+ return len; -+} -+ -+static ssize_t show_rps_flow_limit(struct netdev_rx_queue *queue, char *buf) -+{ -+ int value; -+ value = atomic_read(&queue->rps_flow_limit); -+ return sprintf(buf, "%d\n", value); -+} -+ -+static ssize_t store_rps_flow_limit(struct netdev_rx_queue *queue, const char *buf, size_t len) -+{ -+ int value; -+ int rc; -+ -+ if (!capable(CAP_NET_ADMIN)) -+ return -EPERM; -+ -+ rc = kstrtoint(buf, 0, &value); -+ if (rc < 0) -+ return rc; -+ -+ atomic_set(&queue->rps_flow_limit, value); -+ -+ return len; -+} -+ -+static ssize_t show_atomic32_value(const atomic_t *const src, char *buf) -+{ -+ return sprintf(buf, "0x%08x\n", atomic_read(src)); -+} -+ -+static ssize_t store_atomic32_value(atomic_t *dst, const char *buf, size_t len, u32 max_value) -+{ -+ u32 value; -+ int rc; -+ -+ if (!capable(CAP_NET_ADMIN)) -+ return -EPERM; -+ -+ rc = kstrtou32(buf, 0, &value); -+ if (rc < 0) { -+ return -EINVAL; -+ } -+ -+ if (value > max_value) { -+ return -EINVAL; -+ } -+ -+ atomic_set(dst, value); -+ -+ return len; -+} -+ -+static ssize_t show_rps_user_def_dst_port_high(struct netdev_rx_queue *queue, char *buf) -+{ -+ return show_atomic32_value(&queue->rps_user_def_dst_port_high, buf); -+} -+ -+static ssize_t store_rps_user_def_dst_port_high(struct netdev_rx_queue *queue, const char *buf, size_t len) -+{ -+ return store_atomic32_value(&queue->rps_user_def_dst_port_high, buf, -+ len, MAX_USER_DEF_RPS_PORT); -+} -+ -+static ssize_t show_rps_user_def_dst_port_low(struct netdev_rx_queue *queue, char *buf) -+{ -+ return show_atomic32_value(&queue->rps_user_def_dst_port_low, buf); -+} -+ -+static ssize_t store_rps_user_def_dst_port_low(struct netdev_rx_queue *queue, const char *buf, size_t len) -+{ -+ return store_atomic32_value(&queue->rps_user_def_dst_port_low, buf, -+ len, MAX_USER_DEF_RPS_PORT); -+} -+ -+static ssize_t show_rps_user_def_dst_ip_mask(struct netdev_rx_queue *queue, char *buf) -+{ -+ return show_atomic32_value(&queue->rps_user_def_dst_ip_mask, buf); -+} -+ -+static ssize_t store_rps_user_def_dst_ip_mask(struct netdev_rx_queue *queue, const char *buf, size_t len) -+{ -+ return store_atomic32_value(&queue->rps_user_def_dst_ip_mask, buf, len, UINT_MAX); -+} -+ -+static ssize_t show_rps_user_def_dst_ip(struct netdev_rx_queue *queue, char *buf) -+{ -+ return show_atomic32_value(&queue->rps_user_def_dst_ip, buf); -+} -+ -+static ssize_t store_rps_user_def_dst_ip(struct netdev_rx_queue *queue, const char *buf, size_t len) -+{ -+ return store_atomic32_value(&queue->rps_user_def_dst_ip, buf, len, UINT_MAX); -+} -+ - static struct rx_queue_attribute rps_cpus_attribute __ro_after_init - = __ATTR(rps_cpus, 0644, show_rps_map, store_rps_map); - - static struct rx_queue_attribute rps_dev_flow_table_cnt_attribute __ro_after_init - = __ATTR(rps_flow_cnt, 0644, - show_rps_dev_flow_table_cnt, store_rps_dev_flow_table_cnt); -+ -+static struct rx_queue_attribute rps_user_def_attribute = -+ __ATTR(rps_user_def, S_IRUGO | S_IWUSR, show_rps_user_def, store_rps_user_def); -+static struct rx_queue_attribute rps_user_def_dst_ip_attribute = -+ __ATTR(rps_user_def_dst_ip, S_IRUGO | S_IWUSR, -+ show_rps_user_def_dst_ip, store_rps_user_def_dst_ip); -+static struct rx_queue_attribute rps_user_def_dst_ip_mask_attribute = -+ __ATTR(rps_user_def_dst_ip_mask, S_IRUGO | S_IWUSR, -+ show_rps_user_def_dst_ip_mask, store_rps_user_def_dst_ip_mask); -+static struct rx_queue_attribute rps_user_def_dst_port_low_attribute = -+ __ATTR(rps_user_def_dst_port_low, S_IRUGO | S_IWUSR, -+ show_rps_user_def_dst_port_low, store_rps_user_def_dst_port_low); -+static struct rx_queue_attribute rps_user_def_dst_port_high_attribute = -+ __ATTR(rps_user_def_dst_port_high, S_IRUGO | S_IWUSR, -+ show_rps_user_def_dst_port_high, store_rps_user_def_dst_port_high); -+static struct rx_queue_attribute rps_flow_balance_attribute = -+ __ATTR(rps_flow_balance, S_IRUGO | S_IWUSR, -+ show_rps_flow_balance, store_rps_flow_balance); -+static struct rx_queue_attribute rps_flow_limit_attribute = -+ __ATTR(rps_flow_limit, S_IRUGO | S_IWUSR, -+ show_rps_flow_limit, store_rps_flow_limit); - #endif /* CONFIG_RPS */ - - static struct attribute *rx_queue_default_attrs[] __ro_after_init = { - #ifdef CONFIG_RPS - &rps_cpus_attribute.attr, - &rps_dev_flow_table_cnt_attribute.attr, -+ &rps_user_def_attribute.attr, -+ &rps_user_def_dst_ip_attribute.attr, -+ &rps_user_def_dst_ip_mask_attribute.attr, -+ &rps_user_def_dst_port_low_attribute.attr, -+ &rps_user_def_dst_port_high_attribute.attr, -+ &rps_flow_balance_attribute.attr, -+ &rps_flow_limit_attribute.attr, - #endif - NULL - }; -@@ -1048,6 +1230,11 @@ static void rx_queue_release(struct kobject *kobj) - RCU_INIT_POINTER(queue->rps_flow_table, NULL); - call_rcu(&flow_table->rcu, rps_dev_flow_table_release); - } -+ atomic64_set(&queue->rps_user_def, 0); -+ atomic_set(&queue->rps_user_def_dst_ip, 0); -+ atomic_set(&queue->rps_user_def_dst_ip_mask, 0); -+ atomic_set(&queue->rps_user_def_dst_port_low, 0); -+ atomic_set(&queue->rps_user_def_dst_port_high, 0); - #endif - - memset(kobj, 0, sizeof(*kobj)); -diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c -index 47e2743ff..f70e803c5 100644 ---- a/net/core/sysctl_net_core.c -+++ b/net/core/sysctl_net_core.c -@@ -422,6 +422,48 @@ static struct ctl_table net_core_table[] = { - .mode = 0644, - .proc_handler = proc_dointvec - }, -+ { -+ .procname = "netdev_custom_steer", -+ .data = &netdev_custom_steer, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec -+ }, -+ { -+ .procname = "netdev_elephant_trigger", -+ .data = &netdev_elephant_trigger, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec -+ }, -+ { -+ .procname = "netdev_mice_trigger", -+ .data = &netdev_mice_trigger, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec -+ }, -+ { -+ .procname = "netdev_better_threshold", -+ .data = &netdev_better_threshold, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec -+ }, -+ { -+ .procname = "netdev_flowlim_threshold", -+ .data = &netdev_flowlim_threshold, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec -+ }, -+ { -+ .procname = "netdev_dbg_hash", -+ .data = &netdev_dbg_hash, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec -+ }, - { - .procname = "netdev_rss_key", - .data = &netdev_rss_key, --- -2.53.0 - diff --git a/SPECS/91/linux/hcx/0009-add-mss-clamp-support-to-gretap-baseimage.patch b/SPECS/91/linux/hcx/0009-add-mss-clamp-support-to-gretap-baseimage.patch deleted file mode 100644 index 4fe61a5ea6..0000000000 --- a/SPECS/91/linux/hcx/0009-add-mss-clamp-support-to-gretap-baseimage.patch +++ /dev/null @@ -1,309 +0,0 @@ -From ac2ead42770bd7550aabdd9af1e2073fc39facd7 Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Wed, 7 Jan 2026 16:45:50 +0530 -Subject: [PATCH 09/15] add mss clamp support to gretap - baseimage - -Add mss_clamp support to gretap devices. This lets the gretap device -limit the mss value TCP is able to get through to the peer, which -allows them to use an mss value that gets rid of fragmentation through -the L2C (for the TCP sessions that use it). - -mss clamp value must be configured as opposed to determined by PMTU, -because of the custom routing used within the appliance. For 1500 mtu -uplinks, a value of 1348 is recommended. - -Will be enabled by config-engine, when told to by mgr, and mgr will -have a zql (or whatever) to enable/disable the feature. - -Signed-off-by: Srish Srinivasan -Signed-off-by: Guruswamy Basavaiah ---- - include/net/ip_tunnels.h | 1 + - include/uapi/linux/if_tunnel.h | 1 + - net/ipv4/ip_gre.c | 170 +++++++++++++++++++++++++++++++++ - net/ipv4/ip_tunnel.c | 1 + - 4 files changed, 173 insertions(+) - -diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h -index b1bb100c326c..f10d53125943 100644 ---- a/include/net/ip_tunnels.h -+++ b/include/net/ip_tunnels.h -@@ -137,6 +137,7 @@ struct ip_tunnel_parm_kern { - __be32 o_key; - int link; - struct iphdr iph; -+ __u16 mss_clamp; - }; - - struct ip_tunnel { -diff --git a/include/uapi/linux/if_tunnel.h b/include/uapi/linux/if_tunnel.h -index e1a246dd8c62..836e85972324 100644 ---- a/include/uapi/linux/if_tunnel.h -+++ b/include/uapi/linux/if_tunnel.h -@@ -140,6 +140,7 @@ enum { - IFLA_GRE_ERSPAN_VER, - IFLA_GRE_ERSPAN_DIR, - IFLA_GRE_ERSPAN_HWID, -+ IFLA_GRE_MSS_CLAMP = 30, - __IFLA_GRE_MAX, - }; - -diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c -index 9667f2774025..65bb3e41bb1f 100644 ---- a/net/ipv4/ip_gre.c -+++ b/net/ipv4/ip_gre.c -@@ -45,6 +45,7 @@ - #include - #include - #include -+#include /* for TCPOLEN_MSS */ - - /* - Problems & solutions -@@ -103,6 +104,34 @@ - Alexey Kuznetsov. - */ - -+#ifdef CONFIG_SYSCTL -+#include -+static struct ctl_table_header *gre_sysctl_header; -+int gre_mss_clamp __read_mostly = 0; -+EXPORT_SYMBOL(gre_mss_clamp); -+static int gre_tap_mss_clamp(struct sk_buff *skb, int max_mss); -+static struct ctl_table gre_sysctl_table[] = { -+ { -+ .procname = "gre_mss_clamp", -+ .data = &gre_mss_clamp, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec, -+ }, -+}; -+static int gre_sysctl_init(void) -+{ -+ gre_sysctl_header = register_net_sysctl(&init_net, "net/ipv4", gre_sysctl_table); -+ if (gre_sysctl_header == NULL) { -+ printk(KERN_ERR "gre: can't register to sysctl"); -+ return -ENOMEM; -+ } -+ return 0; -+} -+#else -+#define gre_mss_clamp 0 -+#endif -+ - static bool log_ecn_error = true; - module_param(log_ecn_error, bool, 0644); - MODULE_PARM_DESC(log_ecn_error, "Log packets received with corrupted ECN"); -@@ -689,6 +718,12 @@ static netdev_tx_t ipgre_xmit(struct sk_buff *skb, - tunnel->parms.o_flags))) - goto free_skb; - -+ if (gre_mss_clamp) { -+ if ((tunnel->parms.mss_clamp != 0) && -+ gre_tap_mss_clamp(skb, tunnel->parms.mss_clamp)) -+ goto free_skb; -+ } -+ - __gre_xmit(skb, dev, tnl_params, skb->protocol); - return NETDEV_TX_OK; - -@@ -753,6 +788,126 @@ static netdev_tx_t erspan_xmit(struct sk_buff *skb, - return NETDEV_TX_OK; - } - -+/* -+ * Nasty hack to clamp mss of tcp packets. -+ * Normal way to do this would be via iptables, but -+ * we don't want to do that for a few reasons: -+ * 1. CPU Overhead of sending bridge packets through iptables -+ * 2. Memory overhead for maintaining conntrack states -+ * 3. conntrack states can timeout, causing dropped packets -+ * 4. conntrack states can collide, unless we create multiple -+ * namespaces to separate out L2s. -+ * -+ * So, doing the same thing here directly. -+ */ -+static int gre_tap_mss_clamp(struct sk_buff *skb, -+ int max_mss) -+{ -+ struct ethhdr *eth; -+ struct iphdr iphdr; -+ struct iphdr *iph; -+ struct tcphdr tcphdr; -+ struct tcphdr *tcph; -+ int ip_hdrlen, tcp_hdrlen; -+ unsigned int i, optlen; -+ u8 _opt[15 * 4 - sizeof(tcphdr)]; -+ const u_int8_t *op; -+ -+ /* get eth hdr or bail */ -+ eth = (struct ethhdr *)skb_mac_header(skb); -+ /* If not ipv4, bail */ -+ if (eth->h_proto != __constant_htons(ETH_P_IP)) { -+ return 0; -+ } -+ if (skb->len < (sizeof(*eth) + sizeof(*iph) + sizeof(*tcph))) { -+ return 0; -+ } -+ /* skip ip_hdr */ -+ iph = skb_header_pointer(skb, sizeof(*eth), sizeof(*iph), &iphdr); -+ if (!iph) { -+ return 0; -+ } -+ /* If not tcp, bail */ -+ if (iph->protocol != IPPROTO_TCP) { -+ return 0; -+ } -+ if ((iph->frag_off & __constant_htons(IP_OFFSET)) != 0) { -+ return 0; -+ } -+ ip_hdrlen = (iph->ihl*4); -+ if (skb->len < (sizeof(*eth) + ip_hdrlen + sizeof(*tcph))) { -+ return 0; -+ } -+ /* get tcp_hdr */ -+ tcph = skb_header_pointer(skb, sizeof(*eth) + ip_hdrlen, sizeof(*tcph), &tcphdr); -+ if (!tcph) { -+ return 0; -+ } -+ /* if not syn, bail */ -+ if (!tcph->syn) { -+ return 0; -+ } -+ -+ tcp_hdrlen = tcph->doff * 4; -+ if (tcp_hdrlen < sizeof(*tcph)) { -+ return 0; -+ } -+ if (skb->len < (sizeof(*eth) + ip_hdrlen + tcp_hdrlen)) { -+ return 0; -+ } -+ -+ optlen = tcp_hdrlen - sizeof(*tcph); -+ if (!optlen) { -+ return 0; -+ } -+ -+ /* Truncated options. */ -+ op = skb_header_pointer(skb, sizeof(*eth) + (iph->ihl*4) + sizeof(*tcph), optlen, _opt); -+ if (op == NULL) { -+ return 0; -+ } -+ -+ for (i = 0; i < optlen; ) { -+ if (op[i] == TCPOPT_MSS -+ && (optlen - i) >= TCPOLEN_MSS -+ && op[i+1] == TCPOLEN_MSS) { -+ u_int16_t mssval; -+ u_int8_t *opts; -+ -+ mssval = (op[i+2] << 8) | op[i+3]; -+ if (mssval <= max_mss) { -+ /* no need to adjust */ -+ return 0; -+ } -+ /* actual code to do change */ -+ if (skb_ensure_writable(skb, skb->len)) { -+ return 0; -+ } -+ /* skb_make_writable may have moved skb data. -+ * re-do tcph and opts to compensate. -+ */ -+ tcph = (struct tcphdr *)(skb_mac_header(skb) + sizeof(*eth) + ip_hdrlen); -+ opts = (u_int8_t *)(tcph+1); -+ /* replace mss */ -+ opts[i+2] = (max_mss & 0xff00) >> 8; -+ opts[i+3] = (max_mss & 0x00ff); -+ /* adjust csum */ -+ inet_proto_csum_replace2(&tcph->check, skb, -+ htons(mssval), htons(max_mss), -+ false); -+ return 0; -+ } -+ /* Be sure to keep making progess. For NOP and EOL, advance one. -+ * For everything else, go opt len, but at least one. -+ */ -+ if (op[i] < 2) -+ i++; -+ else -+ i += op[i+1] ? : 1; -+ } -+ return 0; -+} -+ - static netdev_tx_t gre_tap_xmit(struct sk_buff *skb, - struct net_device *dev) - { -@@ -1229,6 +1384,9 @@ static int ipgre_netlink_parms(struct net_device *dev, - t->ignore_df = !!nla_get_u8(data[IFLA_GRE_IGNORE_DF]); - } - -+ if (data[IFLA_GRE_MSS_CLAMP]) -+ parms->mss_clamp = nla_get_u16(data[IFLA_GRE_MSS_CLAMP]); -+ - if (data[IFLA_GRE_FWMARK]) - *fwmark = nla_get_u32(data[IFLA_GRE_FWMARK]); - -@@ -1530,6 +1688,8 @@ static size_t ipgre_get_size(const struct net_device *dev) - nla_total_size(1) + - /* IFLA_GRE_ERSPAN_HWID */ - nla_total_size(2) + -+ /* IFLA_GRE_MSS_CLAMP */ -+ nla_total_size(2) + - 0; - } - -@@ -1575,6 +1735,9 @@ static int ipgre_fill_info(struct sk_buff *skb, const struct net_device *dev) - goto nla_put_failure; - } - -+ if (nla_put_u16(skb, IFLA_GRE_MSS_CLAMP, p->mss_clamp)) -+ goto nla_put_failure; -+ - return 0; - - nla_put_failure: -@@ -1644,6 +1807,7 @@ static const struct nla_policy ipgre_policy[IFLA_GRE_MAX + 1] = { - [IFLA_GRE_ERSPAN_VER] = { .type = NLA_U8 }, - [IFLA_GRE_ERSPAN_DIR] = { .type = NLA_U8 }, - [IFLA_GRE_ERSPAN_HWID] = { .type = NLA_U16 }, -+ [IFLA_GRE_MSS_CLAMP] = { .type = NLA_U16 }, - }; - - static struct rtnl_link_ops ipgre_link_ops __read_mostly = { -@@ -1810,6 +1974,9 @@ static int __init ipgre_init(void) - err = rtnl_link_register(&erspan_link_ops); - if (err < 0) - goto erspan_link_failed; -+#ifdef CONFIG_SYSCTL -+ gre_sysctl_init(); -+#endif - - return 0; - -@@ -1821,6 +1988,9 @@ static int __init ipgre_init(void) - gre_del_protocol(&ipgre_protocol, GREPROTO_CISCO); - add_proto_failed: - unregister_pernet_device(&erspan_net_ops); -+#ifdef CONFIG_SYSCTL -+ unregister_net_sysctl_table(gre_sysctl_header); -+#endif - pnet_erspan_failed: - unregister_pernet_device(&ipgre_tap_net_ops); - pnet_tap_failed: -diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c -index a472d2c8da21..6b8d452b81b3 100644 ---- a/net/ipv4/ip_tunnel.c -+++ b/net/ipv4/ip_tunnel.c -@@ -930,6 +930,7 @@ static void ip_tunnel_update(struct ip_tunnel_net *itn, - t->parms.iph.ttl = p->iph.ttl; - t->parms.iph.tos = p->iph.tos; - t->parms.iph.frag_off = p->iph.frag_off; -+ t->parms.mss_clamp = p->mss_clamp; - - if (t->parms.link != p->link || t->fwmark != fwmark) { - int mtu; --- -2.43.0 - diff --git a/SPECS/91/linux/hcx/0010-iptunnel-mark-xfrm-multi-parts.patch b/SPECS/91/linux/hcx/0010-iptunnel-mark-xfrm-multi-parts.patch deleted file mode 100644 index 1eb98a056a..0000000000 --- a/SPECS/91/linux/hcx/0010-iptunnel-mark-xfrm-multi-parts.patch +++ /dev/null @@ -1,249 +0,0 @@ -From 94688f27a1c2c30a5aa845c62a9d951dd93fb9be Mon Sep 17 00:00:00 2001 -From: Harinadh D -Date: Wed, 7 Jan 2026 17:07:42 +0530 -Subject: [PATCH 10/15] iptunnel mark xfrm multi parts - -This patch modifies several places for HCX specific purpose. - -Signed-off-by: Srish Srinivasan -Signed-off-by: Guruswamy Basavaiah ---- - include/net/dst_cache.h | 27 ++++++++++++++++++++++ - net/core/dst_cache.c | 51 +++++++++++++++++++++++++++++++++++++---- - net/ipv4/ip_tunnel.c | 46 ++++++++++++++++++++++++++++++------- - 3 files changed, 112 insertions(+), 12 deletions(-) - -diff --git a/include/net/dst_cache.h b/include/net/dst_cache.h -index 1961699598e2..5510a5f1aa34 100644 ---- a/include/net/dst_cache.h -+++ b/include/net/dst_cache.h -@@ -32,6 +32,19 @@ struct dst_entry *dst_cache_get(struct dst_cache *dst_cache); - */ - struct rtable *dst_cache_get_ip4(struct dst_cache *dst_cache, __be32 *saddr); - -+/** -+ * dst_cache_get_ip4_use_mark - perform cache lookup and fetch ipv4 source -+ * using custom mark -+ * @dst_cache: the cache -+ * @saddr: return value for the retrieved source address -+ * @mark : the custom mark -+ * @use_mark: enables using the mark (allows using zero for mark value) -+ * -+ * local BH must be disabled. -+ */ -+struct rtable *dst_cache_get_ip4_use_mark(struct dst_cache *dst_cache, -+ __be32 *saddr, u32 mark); -+ - /** - * dst_cache_set_ip4 - store the ipv4 dst into the cache - * @dst_cache: the cache -@@ -42,6 +55,20 @@ struct rtable *dst_cache_get_ip4(struct dst_cache *dst_cache, __be32 *saddr); - */ - void dst_cache_set_ip4(struct dst_cache *dst_cache, struct dst_entry *dst, - __be32 saddr); -+/** -+ * dst_cache_set_ip4_use_mark - store the ipv4 dst into the cache using -+ * custom mark -+ * @dst_cache: the cache -+ * @dst: the entry to be cached -+ * @saddr: the source address to be stored inside the cache -+ * @mark : the custom mark -+ * @use_mark: enables using the mark (allows using zero for mark value) -+ * -+ * local BH must be disabled. -+ */ -+void dst_cache_set_ip4_use_mark(struct dst_cache *dst_cache, -+ struct dst_entry *dst, __be32 saddr, u32 mark); -+ - - #if IS_ENABLED(CONFIG_IPV6) - -diff --git a/net/core/dst_cache.c b/net/core/dst_cache.c -index 70c634b9e7b0..bbedc218dd13 100644 ---- a/net/core/dst_cache.c -+++ b/net/core/dst_cache.c -@@ -22,6 +22,7 @@ struct dst_cache_pcpu { - struct in_addr in_saddr; - struct in6_addr in6_saddr; - }; -+ u32 mark; - }; - - static void dst_cache_per_cpu_dst_set(struct dst_cache_pcpu *dst_cache, -@@ -72,7 +73,8 @@ struct dst_entry *dst_cache_get(struct dst_cache *dst_cache) - } - EXPORT_SYMBOL_GPL(dst_cache_get); - --struct rtable *dst_cache_get_ip4(struct dst_cache *dst_cache, __be32 *saddr) -+static struct rtable *__dst_cache_get_ip4(struct dst_cache *dst_cache, -+ __be32 *saddr, u32 mark, bool use_mark) - { - struct dst_cache_pcpu *idst; - struct dst_entry *dst; -@@ -85,13 +87,37 @@ struct rtable *dst_cache_get_ip4(struct dst_cache *dst_cache, __be32 *saddr) - if (!dst) - return NULL; - -- *saddr = idst->in_saddr.s_addr; -+ if (use_mark) { -+ if (idst->mark == mark) { -+ *saddr = idst->in_saddr.s_addr; -+ } else { -+ dst_cache_set_ip4_use_mark(dst_cache, NULL, 0, 0); -+ dst_release(dst); -+ dst = NULL; -+ return NULL; -+ } -+ } else { -+ *saddr = idst->in_saddr.s_addr; -+ } -+ - return dst_rtable(dst); - } -+ -+struct rtable *dst_cache_get_ip4(struct dst_cache *dst_cache, __be32 *saddr) -+{ -+ return __dst_cache_get_ip4(dst_cache, saddr, 0, false); -+} - EXPORT_SYMBOL_GPL(dst_cache_get_ip4); - --void dst_cache_set_ip4(struct dst_cache *dst_cache, struct dst_entry *dst, -- __be32 saddr) -+struct rtable *dst_cache_get_ip4_use_mark(struct dst_cache *dst_cache, -+ __be32 *saddr, u32 mark) -+{ -+ return __dst_cache_get_ip4(dst_cache, saddr, mark, true); -+} -+EXPORT_SYMBOL_GPL(dst_cache_get_ip4_use_mark); -+ -+static void __dst_cache_set_ip4(struct dst_cache *dst_cache, -+ struct dst_entry *dst, __be32 saddr, u32 mark, u32 use_mark) - { - struct dst_cache_pcpu *idst; - -@@ -101,9 +127,26 @@ void dst_cache_set_ip4(struct dst_cache *dst_cache, struct dst_entry *dst, - idst = this_cpu_ptr(dst_cache->cache); - dst_cache_per_cpu_dst_set(idst, dst, 0); - idst->in_saddr.s_addr = saddr; -+ if (use_mark) { -+ idst->mark = mark; -+ } -+} -+ -+void dst_cache_set_ip4(struct dst_cache *dst_cache, struct dst_entry *dst, -+ __be32 saddr) -+{ -+ __dst_cache_set_ip4(dst_cache, dst, saddr, 0, true); - } - EXPORT_SYMBOL_GPL(dst_cache_set_ip4); - -+void dst_cache_set_ip4_use_mark(struct dst_cache *dst_cache, -+ struct dst_entry *dst, __be32 saddr, u32 mark) -+{ -+ -+ __dst_cache_set_ip4(dst_cache, dst, saddr, mark, true); -+} -+EXPORT_SYMBOL_GPL(dst_cache_set_ip4_use_mark); -+ - #if IS_ENABLED(CONFIG_IPV6) - void dst_cache_set_ip6(struct dst_cache *dst_cache, struct dst_entry *dst, - const struct in6_addr *saddr) -diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c -index 6b8d452b81b3..85959118d9d3 100644 ---- a/net/ipv4/ip_tunnel.c -+++ b/net/ipv4/ip_tunnel.c -@@ -58,9 +58,11 @@ - struct ctl_table_header *ipip_sysctl_header = NULL; - int ipip_tunnel_skip_encap_decap __read_mostly = 0; - int fou_key_multi_port __read_mostly = 0; -+int ipip_dst_cache_use_mark __read_mostly = 0; - EXPORT_SYMBOL_GPL(ipip_tunnel_skip_encap_decap); - EXPORT_SYMBOL_GPL(ipip_sysctl_header); - EXPORT_SYMBOL_GPL(fou_key_multi_port); -+EXPORT_SYMBOL_GPL(ipip_dst_cache_use_mark); - - struct ctl_table ipip_sysctl_table[] = { - { -@@ -77,6 +79,14 @@ struct ctl_table ipip_sysctl_table[] = { - .mode = 0644, - .proc_handler = proc_dointvec, - }, -+ { -+ .procname = "ipip_dst_cache_use_mark", -+ .data = &ipip_dst_cache_use_mark, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec, -+ }, -+ - }; - EXPORT_SYMBOL_GPL(ipip_sysctl_table); - -@@ -94,6 +104,7 @@ EXPORT_SYMBOL_GPL(ipip_sysctl_init); - #else - #define ipip_tunnel_skip_encap_decap 0 - #define fou_key_multi_port 0 -+#define ipip_dst_cache_use_mark 0 - #endif - - static unsigned int ip_tunnel_hash(__be32 key, __be32 remote) -@@ -812,10 +823,17 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, - } - } - -- ip_tunnel_init_flow(&fl4, protocol, dst, tnl_params->saddr, -- tunnel->parms.o_key, tos & INET_DSCP_MASK, -- tunnel->net, READ_ONCE(tunnel->parms.link), -- tunnel->fwmark, skb_get_hash(skb), 0); -+ if(ipip_dst_cache_use_mark) { -+ ip_tunnel_init_flow(&fl4, protocol, dst, tnl_params->saddr, -+ tunnel->parms.o_key, tos & INET_DSCP_MASK, -+ tunnel->net, READ_ONCE(tunnel->parms.link), -+ skb->mark, skb_get_hash(skb), 0); -+ } else { -+ ip_tunnel_init_flow(&fl4, protocol, dst, tnl_params->saddr, -+ tunnel->parms.o_key, tos & INET_DSCP_MASK, -+ tunnel->net, READ_ONCE(tunnel->parms.link), -+ tunnel->fwmark, skb_get_hash(skb), 0); -+ } - - if (ip_tunnel_encap(skb, &tunnel->encap, &protocol, &fl4) < 0) - goto tx_error; -@@ -826,8 +844,14 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, - rt = dst_cache_get_ip4(&tun_info->dst_cache, - &fl4.saddr); - } else { -- rt = connected ? dst_cache_get_ip4(&tunnel->dst_cache, -- &fl4.saddr) : NULL; -+ if(ipip_dst_cache_use_mark) { -+ rt = connected ? -+ dst_cache_get_ip4_use_mark(&tunnel->dst_cache, &fl4.saddr, -+ skb->mark) : NULL; -+ } else { -+ rt = connected ? dst_cache_get_ip4(&tunnel->dst_cache, &fl4.saddr) -+ : NULL; -+ } - } - - if (!rt) { -@@ -840,9 +864,15 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, - if (use_cache) - dst_cache_set_ip4(&tun_info->dst_cache, &rt->dst, - fl4.saddr); -- else if (!md && connected) -- dst_cache_set_ip4(&tunnel->dst_cache, &rt->dst, -+ else if (!md && connected) { -+ if(ipip_dst_cache_use_mark) { -+ dst_cache_set_ip4_use_mark(&tunnel->dst_cache, -+ &rt->dst, fl4.saddr, fl4.flowi4_mark); -+ } else { -+ dst_cache_set_ip4(&tunnel->dst_cache, &rt->dst, - fl4.saddr); -+ } -+ } - } - - if (rt->dst.dev == dev) { --- -2.43.0 - diff --git a/SPECS/91/linux/hcx/0011-disable-pskb_inet_may_pull-in-tunnel.patch b/SPECS/91/linux/hcx/0011-disable-pskb_inet_may_pull-in-tunnel.patch deleted file mode 100644 index 25e217fbd2..0000000000 --- a/SPECS/91/linux/hcx/0011-disable-pskb_inet_may_pull-in-tunnel.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 49bc6d4d0c8ff8b62c0772828b5a92f827f53f19 Mon Sep 17 00:00:00 2001 -From: Jonathan Shao -Date: Wed, 15 Jun 2022 18:02:38 -0700 -Subject: [PATCH 11/15] disable pskb_inet_may_pull in tunnel - -pskb_inet_may_pull is not needed for HCX in tunnel code paths - -Signed-off-by: Srish Srinivasan ---- - net/ipv4/ip_gre.c | 16 ++++++++++++++-- - net/ipv4/ip_tunnel.c | 4 ++-- - 2 files changed, 16 insertions(+), 4 deletions(-) - -diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c -index 65bb3e41bb1f..017206296736 100644 ---- a/net/ipv4/ip_gre.c -+++ b/net/ipv4/ip_gre.c -@@ -108,7 +108,9 @@ - #include - static struct ctl_table_header *gre_sysctl_header; - int gre_mss_clamp __read_mostly = 0; -+int gre_skb_dont_pull __read_mostly = 0; - EXPORT_SYMBOL(gre_mss_clamp); -+EXPORT_SYMBOL(gre_skb_dont_pull); - static int gre_tap_mss_clamp(struct sk_buff *skb, int max_mss); - static struct ctl_table gre_sysctl_table[] = { - { -@@ -118,6 +120,13 @@ static struct ctl_table gre_sysctl_table[] = { - .mode = 0644, - .proc_handler = proc_dointvec, - }, -+ { -+ .procname = "gre_skb_dont_pull", -+ .data = &gre_skb_dont_pull, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec, -+ }, - }; - static int gre_sysctl_init(void) - { -@@ -130,6 +139,7 @@ static int gre_sysctl_init(void) - } - #else - #define gre_mss_clamp 0 -+#define gre_skb_dont_pull - #endif - - static bool log_ecn_error = true; -@@ -740,8 +750,10 @@ static netdev_tx_t erspan_xmit(struct sk_buff *skb, - bool truncate = false; - __be16 proto; - -- if (!pskb_inet_may_pull(skb)) -- goto free_skb; -+ if (unlikely(!gre_skb_dont_pull)) { -+ if (!pskb_inet_may_pull(skb)) -+ goto free_skb; -+ } - - if (tunnel->collect_md) { - erspan_fb_xmit(skb, dev); -diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c -index 85959118d9d3..3f2297cba1cc 100644 ---- a/net/ipv4/ip_tunnel.c -+++ b/net/ipv4/ip_tunnel.c -@@ -844,7 +844,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, - rt = dst_cache_get_ip4(&tun_info->dst_cache, - &fl4.saddr); - } else { -- if(ipip_dst_cache_use_mark) { -+ if(likely(ipip_dst_cache_use_mark)) { - rt = connected ? - dst_cache_get_ip4_use_mark(&tunnel->dst_cache, &fl4.saddr, - skb->mark) : NULL; -@@ -865,7 +865,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, - dst_cache_set_ip4(&tun_info->dst_cache, &rt->dst, - fl4.saddr); - else if (!md && connected) { -- if(ipip_dst_cache_use_mark) { -+ if(likely(ipip_dst_cache_use_mark)) { - dst_cache_set_ip4_use_mark(&tunnel->dst_cache, - &rt->dst, fl4.saddr, fl4.flowi4_mark); - } else { --- -2.43.0 - diff --git a/SPECS/91/linux/hcx/0012-gre_tap-interface-mss_clamp-support.patch b/SPECS/91/linux/hcx/0012-gre_tap-interface-mss_clamp-support.patch deleted file mode 100644 index 3993cc40ad..0000000000 --- a/SPECS/91/linux/hcx/0012-gre_tap-interface-mss_clamp-support.patch +++ /dev/null @@ -1,30 +0,0 @@ -From e726a9174a1804b54b1ce5679b0ba12e95fdb1ac Mon Sep 17 00:00:00 2001 -From: Kevin Wang -Date: Sat, 25 Jun 2022 01:13:35 +0000 -Subject: [PATCH 12/15] gre_tap interface mss_clamp support - -Signed-off-by: Srish Srinivasan ---- - net/ipv4/ip_gre.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c -index 017206296736..8a75d9cf0a14 100644 ---- a/net/ipv4/ip_gre.c -+++ b/net/ipv4/ip_gre.c -@@ -940,6 +940,12 @@ static netdev_tx_t gre_tap_xmit(struct sk_buff *skb, - if (skb_cow_head(skb, dev->needed_headroom)) - goto free_skb; - -+ if (gre_mss_clamp) { -+ if ((tunnel->parms.mss_clamp != 0) && -+ gre_tap_mss_clamp(skb, tunnel->parms.mss_clamp)) -+ goto free_skb; -+ } -+ - __gre_xmit(skb, dev, &tunnel->parms.iph, htons(ETH_P_TEB)); - return NETDEV_TX_OK; - --- -2.43.0 - diff --git a/SPECS/91/linux/hcx/0013-rps_cpus-skip-receive-packets-queuing-to-only-housek.patch b/SPECS/91/linux/hcx/0013-rps_cpus-skip-receive-packets-queuing-to-only-housek.patch deleted file mode 100644 index 1c1df794ae..0000000000 --- a/SPECS/91/linux/hcx/0013-rps_cpus-skip-receive-packets-queuing-to-only-housek.patch +++ /dev/null @@ -1,39 +0,0 @@ -From ebff6232e683d0de020498b864b318854e748292 Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Wed, 7 Jan 2026 17:33:43 +0530 -Subject: [PATCH 13/15] rps_cpus: skip receive packets queuing to only - housekeeping CPUs - -Revert the logic of restricting receive packets queueing to only -housekeeping CPUs as HCX wants to set rps_cpus to isolated CPUs. - -Signed-off-by: Keerthana K -Signed-off-by: Guruswamy Basavaiah ---- - net/core/net-sysfs.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c -index 95706853140e..90c909bc56fd 100644 ---- a/net/core/net-sysfs.c -+++ b/net/core/net-sysfs.c -@@ -37,6 +37,7 @@ static const char fmt_dec[] = "%d\n"; - static const char fmt_uint[] = "%u\n"; - static const char fmt_ulong[] = "%lu\n"; - static const char fmt_u64[] = "%llu\n"; -+extern int netdev_custom_steer; - - /* Caller holds RTNL or RCU */ - static inline int dev_isalive(const struct net_device *dev) -@@ -898,7 +899,7 @@ static int netdev_rx_queue_set_rps_mask(struct netdev_rx_queue *queue, - - int rps_cpumask_housekeeping(struct cpumask *mask) - { -- if (!cpumask_empty(mask)) { -+ if (netdev_custom_steer == 0 && !cpumask_empty(mask)) { - cpumask_and(mask, mask, housekeeping_cpumask(HK_TYPE_DOMAIN)); - cpumask_and(mask, mask, housekeeping_cpumask(HK_TYPE_WQ)); - if (cpumask_empty(mask)) --- -2.43.0 - diff --git a/SPECS/91/linux/hcx/0014-Introduce-xfrm_dst-cache-mechanism-to-reuse-xfrm_dst.patch b/SPECS/91/linux/hcx/0014-Introduce-xfrm_dst-cache-mechanism-to-reuse-xfrm_dst.patch deleted file mode 100644 index 4a14c06da9..0000000000 --- a/SPECS/91/linux/hcx/0014-Introduce-xfrm_dst-cache-mechanism-to-reuse-xfrm_dst.patch +++ /dev/null @@ -1,554 +0,0 @@ -From 7f9311bca2000f95bea9c066b9b453089bf6df3d Mon Sep 17 00:00:00 2001 -From: Jonathan Shao -Date: Thu, 22 Jan 2026 20:22:00 +0530 -Subject: [PATCH] Introduce xfrm_dst cache mechanism to reuse xfrm_dst in - -The xfrm policy (xfrm_dst) cache was introduced in 4.14. -It is removed at 4.19 (e4db5b61c572475bbbcf63e3c8a2606bfccf2c9d), -because it has negative performance impact when each CPU core must -handle multiple different policies. - -Re-introduce this mechanism back, since the mechanism performs well -in the case where each CPU core has only one IPsec tunnel. HCX Network -Extension can be hugely benitfitted from this mechanism. This mechanism -provides 2 benefits: - -1, It can greatly reduce the number of xfrm_dst allocations, - such that it avoid the possibility of "out of memory" under - high throughput. -2, It provides about 5%-7% of performance improvement. - -This patch ports the cache mechanism from 4.18 kernel and modifies -the reuse conditions to meet 6.1 kernel xfrm implementation. -In addition, two enhancements are added: - -1, boot parameter: xfrm_dst_cache - The presence of presence in the boot commandline parameter enables - the xfrm_dst cache mechanism. - The default setting is disabled as the parameter is omitted. - -2, /proc/net/softnet_xfrm_stat - Per-cpu statistics of the cache mechanism behaviors. - -Signed-off-by: Jonathan Shao -Signed-off-by: Guruswamy Basavaiah ---- - include/linux/netdevice.h | 13 ++ - include/net/xfrm.h | 1 + - net/core/net-procfs.c | 60 +++++++- - net/xfrm/xfrm_device.c | 4 + - net/xfrm/xfrm_policy.c | 284 +++++++++++++++++++++++++++++++++++++- - net/xfrm/xfrm_state.c | 7 +- - 6 files changed, 364 insertions(+), 5 deletions(-) - -diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h -index 660754efe..1a894b9e3 100644 ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -3254,6 +3254,16 @@ struct softnet_data { - unsigned int user_def_rps_skip; - unsigned int user_def_rps_proc; - #endif -+#ifdef CONFIG_XFRM -+ /* statistics for xfrm_dst cache mechanism */ -+ unsigned int hit_xfrm_dst; -+ unsigned int miss_xfrm_dst; -+ unsigned int xfrm_dst_check_1; /* check src dev failure */ -+ unsigned int xfrm_dst_check_2; /* check SA bundles */ -+ unsigned int xfrm_dst_check_3; /* check destination */ -+ unsigned int xfrm_dst_flush; /* cache flush counter */ -+#endif -+ - struct sk_buff_head input_pkt_queue; - struct napi_struct backlog; - -@@ -4979,6 +4989,9 @@ extern int netdev_mice_trigger; - extern int netdev_better_threshold; - extern int netdev_flowlim_threshold; - extern int netdev_dbg_hash; -+#ifdef CONFIG_XFRM -+extern int netdev_xfrm_cache; -+#endif - - static inline netdev_tx_t __netdev_start_xmit(const struct net_device_ops *ops, - struct sk_buff *skb, struct net_device *dev, -diff --git a/include/net/xfrm.h b/include/net/xfrm.h -index b6fff506b..2a27db94c 100644 ---- a/include/net/xfrm.h -+++ b/include/net/xfrm.h -@@ -380,6 +380,7 @@ int xfrm_policy_register_afinfo(const struct xfrm_policy_afinfo *afinfo, int fam - void xfrm_policy_unregister_afinfo(const struct xfrm_policy_afinfo *afinfo); - void km_policy_notify(struct xfrm_policy *xp, int dir, - const struct km_event *c); -+void xfrm_policy_cache_flush(void); - void km_state_notify(struct xfrm_state *x, const struct km_event *c); - - struct xfrm_tmpl; -diff --git a/net/core/net-procfs.c b/net/core/net-procfs.c -index 1e47184f7..d71dccf3a 100644 ---- a/net/core/net-procfs.c -+++ b/net/core/net-procfs.c -@@ -232,6 +232,51 @@ static const struct proc_ops softnet_rps_seq_proc_ops = { - }; - - -+#ifdef CONFIG_XFRM -+/* for xfrm_dst cache mechanism */ -+extern int netdev_xfrm_cache; -+static int softnet_xfrm_seq_show(struct seq_file *seq, void *v) -+{ -+ struct softnet_data *sd = v; -+ -+ /* -+ * cpu: cpu id -+ * hi: hit counter -+ * mi: miss counter -+ * c1: check condition 1 fail counter (see net/xfrm/xfrm_policy.c) -+ * c2: check condition 2 fail counter (see net/xfrm/xfrm_policy.c) -+ * c3: check condition 3 fail counter (see net/xfrm/xfrm_policy.c) -+ * fl: cache flush counter -+ */ -+ if (netdev_xfrm_cache) -+ seq_printf(seq, "cpu:%u hi:%d mi:%d c1:%d c2:%d c3:%d fl:%d\n", -+ sd->cpu, sd->hit_xfrm_dst, sd->miss_xfrm_dst, -+ sd->xfrm_dst_check_1, sd->xfrm_dst_check_2, -+ sd->xfrm_dst_check_3, sd->xfrm_dst_flush); -+ return 0; -+} -+ -+static const struct seq_operations softnet_xfrm_seq_ops = { -+ .start = softnet_seq_start, -+ .next = softnet_seq_next, -+ .stop = softnet_seq_stop, -+ .show = softnet_xfrm_seq_show, -+}; -+ -+static int softnet_xfrm_seq_open(struct inode *inode, struct file *file) -+{ -+ return seq_open(file, &softnet_xfrm_seq_ops); -+} -+ -+static const struct proc_ops softnet_xfrm_seq_proc_ops = { -+ .proc_open = softnet_xfrm_seq_open, -+ .proc_read = seq_read, -+ .proc_lseek = seq_lseek, -+ .proc_release = seq_release, -+}; -+#endif -+ -+ - static void *ptype_get_idx(struct seq_file *seq, loff_t pos) - { - struct ptype_iter_state *iter = seq->private; -@@ -376,10 +421,15 @@ static int __net_init dev_proc_net_init(struct net *net) - goto out_dev; - if (!proc_create("softnet_rps_stat", S_IRUGO, net->proc_net, - &softnet_rps_seq_proc_ops)) -- goto out_dev; -+ goto out_softnet; -+#ifdef CONFIG_XFRM -+ if (!proc_create("softnet_xfrm_stat", S_IRUGO, net->proc_net, -+ &softnet_xfrm_seq_proc_ops)) -+ goto out_softnet_rps; -+#endif - if (!proc_create_net("ptype", 0444, net->proc_net, &ptype_seq_ops, - sizeof(struct ptype_iter_state))) -- goto out_softnet; -+ goto out_xfrm_stat; - - if (wext_proc_init(net)) - goto out_ptype; -@@ -388,6 +438,12 @@ static int __net_init dev_proc_net_init(struct net *net) - return rc; - out_ptype: - remove_proc_entry("ptype", net->proc_net); -+out_xfrm_stat: -+#ifdef CONFIG_XFRM -+ remove_proc_entry("softnet_xfrm_stat", net->proc_net); -+#endif -+out_softnet_rps: -+ remove_proc_entry("softnet_rps_stat", net->proc_net); - out_softnet: - remove_proc_entry("softnet_stat", net->proc_net); - out_dev: -diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c -index 7744ed8e4..859c9fcd1 100644 ---- a/net/xfrm/xfrm_device.c -+++ b/net/xfrm/xfrm_device.c -@@ -514,6 +514,10 @@ static int xfrm_dev_down(struct net_device *dev) - xfrm_dev_policy_flush(dev_net(dev), dev, true); - } - -+ if (netdev_xfrm_cache) { -+ xfrm_policy_cache_flush(); -+ } -+ - return NOTIFY_DONE; - } - -diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c -index fca07f8e6..c80014d81 100644 ---- a/net/xfrm/xfrm_policy.c -+++ b/net/xfrm/xfrm_policy.c -@@ -2847,8 +2847,229 @@ static int xfrm_expand_policies(const struct flowi *fl, u16 family, - } - - return 0; -+} -+ -+/* XFRM_DST caching mechanism (begin) */ -+ -+/* xfrm_dst cache per-cpu array */ -+static struct xfrm_dst * __percpu *xfrm_last_dst; -+ -+static struct work_struct __percpu *xfrm_pcpu_work; -+ -+/* -+ * The flag indicates if xfrm_dst caching mechanism is enabled. -+ * The default behavior is disabled. -+ */ -+int netdev_xfrm_cache __read_mostly = 0; -+EXPORT_SYMBOL(netdev_xfrm_cache); -+ -+/* -+ * this function sets the new object, @xdst, as the new cached object, -+ * and releases the old cached object, @old, which fails the reuse checks -+ * -+ * Note: this function only update the cache object of THIS CPU -+ */ -+static void xfrm_last_dst_update(struct xfrm_dst *xdst, struct xfrm_dst *old) -+{ -+ this_cpu_write(*xfrm_last_dst, xdst); -+ if (old) -+ dst_release(&old->u.dst); -+} -+ -+/* -+ * remove cached xfrm_dst object which is stale, on THIS CPU -+ * -+ * Note: this is used in two conditions: -+ * 1, ipsec/xfrm is put down -+ * 2, xfrm policy is changed -+ */ -+static void __xfrm_pcpu_work_fn(void) -+{ -+ struct xfrm_dst *old; -+ -+ old = this_cpu_read(*xfrm_last_dst); -+ if (old && !xfrm_bundle_ok(old)) -+ xfrm_last_dst_update(NULL, old); -+} -+ -+/* -+ * a safe version of __xfrm_pcpu_work_fn() -+ * this function is used for scheduling per-cpu tasks -+ */ -+static void xfrm_pcpu_work_fn(struct work_struct *work) -+{ -+ local_bh_disable(); -+ __xfrm_pcpu_work_fn(); -+ local_bh_enable(); -+} -+ -+/* -+ * parsing boot commandline parameter "xfrm_dst_chace" -+ * The input string "1" indicates enabling the xfrm_dst caching -+ * Otherwise, xfrm_dst caching mechanism is disabled -+ * -+ * Design Note: -+ * The reason of choosing the boot commandline to enable the -+ * xfrm_dst cache mechanism is to allocate cache related memory -+ * if and only if when the mechanism is activated. -+ * -+ * The alternative scheme of using sysctl would require the -+ * extra synchronizations to manage memory when enabling/disabling -+ * the cache mechansim. -+ * The known use case does not need such dynamic capability. -+ */ -+static int __init xfrm_dst_cache_init(char *str) -+{ -+ int cpu; -+ netdev_xfrm_cache = 0; -+ -+ if (!str) { -+ pr_notice("Unexpected use of xfrm_dst_chace: %s\n", str); -+ return 0; -+ } - -+ pr_notice("Enable xfrm_dst cache mechanism.\n"); -+ -+ xfrm_last_dst = alloc_percpu(struct xfrm_dst *); -+ if (!xfrm_last_dst) { -+ pr_err("Failed to allocate the percpu xfrm_dst cache. Disable xfrm_dst cache.\n"); -+ return 0; -+ } -+ -+ /* -+ * initialize per-cpu work_struct object -+ * to be used in xfrm_policy_cache_flush() -+ */ -+ xfrm_pcpu_work = alloc_percpu(struct work_struct); -+ if (!xfrm_pcpu_work) { -+ pr_err("Failed to allocate the percpu xfrm_dst cache. Disable xfrm_dst cache.\n"); -+ free_percpu(xfrm_last_dst); -+ xfrm_last_dst = NULL; -+ return 0; -+ } -+ -+ for_each_possible_cpu(cpu) { -+ (*per_cpu_ptr(xfrm_last_dst, cpu)) = NULL; -+ INIT_WORK(per_cpu_ptr(xfrm_pcpu_work, cpu), xfrm_pcpu_work_fn); -+ } -+ -+ netdev_xfrm_cache = 1; -+ return 1; - } -+__setup("xfrm_dst_cache", xfrm_dst_cache_init); -+ -+void xfrm_policy_cache_flush(void) -+{ -+ struct xfrm_dst *old; -+ bool found = 0; -+ int cpu; -+ struct softnet_data *sd = this_cpu_ptr(&softnet_data); -+ -+ sd->xfrm_dst_flush++; -+ -+ might_sleep(); -+ -+ local_bh_disable(); -+ for_each_possible_cpu(cpu) { -+ old = *per_cpu_ptr(xfrm_last_dst, cpu); -+ if (old && !xfrm_bundle_ok(old)) { -+ if (smp_processor_id() == cpu) { -+ __xfrm_pcpu_work_fn(); -+ continue; -+ } -+ found = true; -+ break; -+ } -+ } -+ local_bh_enable(); -+ -+ if (!found) -+ return; -+ -+ /* lock all cpus from modifying the xfrm_dst caches */ -+ cpus_read_lock(); -+ -+ for_each_possible_cpu(cpu) { -+ bool bundle_release; -+ -+ old = *per_cpu_ptr(xfrm_last_dst, cpu); -+ bundle_release = old && !xfrm_bundle_ok(old); -+ -+ if (!bundle_release) -+ continue; -+ -+ if (cpu_online(cpu)) { -+ schedule_work_on(cpu, per_cpu_ptr(xfrm_pcpu_work, cpu)); -+ continue; -+ } -+ -+ /* cpu offline, so the cache can be safely clean */ -+ old = *per_cpu_ptr(xfrm_last_dst, cpu); -+ if (old && !xfrm_bundle_ok(old)) { -+ (*per_cpu_ptr(xfrm_last_dst, cpu)) = NULL; -+ dst_release(&old->u.dst); -+ } -+ } -+ -+ cpus_read_unlock(); -+} -+ -+static bool xfrm_xdst_can_reuse(struct softnet_data *sd, -+ const struct flowi *fl, -+ struct xfrm_dst *xdst, -+ struct xfrm_state * const xfrm[], -+ int num) -+{ -+ const struct dst_entry *dst = &xdst->u.dst; -+ int i; -+ -+ if (xdst->num_xfrms != num) -+ goto sa_failed; -+ -+ /* -+ * verify if the cached object has the same SA bundles -+ * as defined by xfrm[]. -+ */ -+ for (i = 0; i < num; i++) { -+ if (!dst || dst->xfrm != xfrm[i]) -+ goto sa_failed; -+ dst = xfrm_dst_child(dst); -+ } -+ -+ if (!xfrm_bundle_ok(xdst)) -+ goto sa_failed; -+ -+ /* -+ * check if the packet is still routed to the same device after ipsec -+ * this is the extra check for HCX APR -+ */ -+ if (num && (xfrm[0]->props.mode != XFRM_MODE_TRANSPORT)) { -+ struct xfrm_state *x = xfrm[0]; -+ struct dst_entry *dst; -+ xfrm_address_t saddr, daddr; -+ int family = x->props.family; -+ int tos = xfrm_get_tos(fl, family); -+ int oif = fl->flowi_oif ? : fl->flowi_l3mdev; -+ __u32 m = 0; -+ -+ xfrm_flowi_addr_get(fl, &saddr, &daddr, family); -+ if (x->props.smark.v || x->props.smark.m) { -+ m = xfrm_smark_get(fl->flowi_mark, x); -+ } -+ dst = xfrm_dst_lookup(x, tos, oif, &saddr, &daddr, family, m); -+ if (IS_ERR(dst) || (dst->dev != xdst->u.dst.dev)) { -+ sd->xfrm_dst_check_3++; -+ return false; -+ } -+ } -+ -+ return true; -+ -+sa_failed: -+ sd->xfrm_dst_check_2++; -+ return false; -+} -+/* XFRM_DST caching mechanism (end) */ - - static struct xfrm_dst * - xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols, -@@ -2858,7 +3079,7 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols, - struct net *net = xp_net(pols[0]); - struct xfrm_state *xfrm[XFRM_MAX_DEPTH]; - struct xfrm_dst *bundle[XFRM_MAX_DEPTH]; -- struct xfrm_dst *xdst; -+ struct xfrm_dst *xdst, *old; - struct dst_entry *dst; - int err; - -@@ -2873,6 +3094,54 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols, - return ERR_PTR(err); - } - -+ if (netdev_xfrm_cache) { -+ struct softnet_data *sd = this_cpu_ptr(&softnet_data); -+ bool cond = false; -+ -+ xdst = this_cpu_read(*xfrm_last_dst); -+ -+ /* -+ * verify if the cached object can be reused, -+ * if not, the cached object is replaced with newly created one. -+ * -+ * 1, the cached object is routed from the same origin device -+ * false counter: sd->xfrm_dst_check_1 (c1 in statistics) -+ * 2, the cached object is under the same Security Policies -+ * false counter: sd->xfrm_dst_check_2 (c2 in statistics) -+ * 3, the cached object has the same Security Bundle -+ * 4, the cached object is routed to the same device -+ * false counter: sd->xfrm_dst_check_3 (c3 in statistics) -+ */ -+ if (xdst && xdst->route->dev == dst_orig->dev) { -+ cond = true; -+ } else { -+ sd->xfrm_dst_check_1++; -+ } -+ if (cond && -+ xdst->num_pols == num_pols && -+ memcmp(xdst->pols, pols, -+ sizeof(struct xfrm_policy *) * num_pols) == 0 && -+ xfrm_xdst_can_reuse(sd, fl, xdst, xfrm, err)) { -+ dst_hold(&xdst->u.dst); -+ -+ /* -+ * the cached object has held the policy already -+ * release the hold which is intended for new object -+ */ -+ xfrm_pols_put(pols, num_pols); -+ -+ /* unwind the output from xfrm_tmpl_resolve() */ -+ while (err > 0) -+ xfrm_state_put(xfrm[--err]); -+ -+ sd->hit_xfrm_dst++; -+ return xdst; -+ } -+ -+ sd->miss_xfrm_dst++; -+ old = xdst; -+ } -+ - dst = xfrm_bundle_create(pols[0], xfrm, bundle, err, fl, dst_orig); - if (IS_ERR(dst)) { - XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTBUNDLEGENERROR); -@@ -2885,6 +3154,11 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols, - memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); - xdst->policy_genid = atomic_read(&pols[0]->genid); - -+ if (netdev_xfrm_cache) { -+ rcuref_init(&xdst->u.dst.__rcuref, 2); -+ xfrm_last_dst_update(xdst, old); -+ } -+ - return xdst; - } - -@@ -3098,8 +3372,12 @@ static struct xfrm_dst *xfrm_bundle_lookup(struct net *net, - if (num_xfrms <= 0) - goto make_dummy_bundle; - -+ if (netdev_xfrm_cache) -+ local_bh_disable(); - xdst = xfrm_resolve_and_create_bundle(pols, num_pols, fl, family, - xflo->dst_orig); -+ if (netdev_xfrm_cache) -+ local_bh_enable(); - if (IS_ERR(xdst)) { - err = PTR_ERR(xdst); - if (err == -EREMOTE) { -@@ -3197,9 +3475,13 @@ struct dst_entry *xfrm_lookup_with_ifid(struct net *net, - goto no_transform; - } - -+ if (netdev_xfrm_cache) -+ local_bh_disable(); - xdst = xfrm_resolve_and_create_bundle( - pols, num_pols, fl, - family, dst_orig); -+ if (netdev_xfrm_cache) -+ local_bh_enable(); - - if (IS_ERR(xdst)) { - xfrm_pols_put(pols, num_pols); -diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c -index a55c88b43..d69054632 100644 ---- a/net/xfrm/xfrm_state.c -+++ b/net/xfrm/xfrm_state.c -@@ -855,6 +855,7 @@ xfrm_dev_state_flush_secctx_check(struct net *net, struct net_device *dev, bool - } - #endif - -+extern int netdev_xfrm_cache; - int xfrm_state_flush(struct net *net, u8 proto, bool task_valid) - { - int i, err = 0, cnt = 0; -@@ -888,9 +889,11 @@ int xfrm_state_flush(struct net *net, u8 proto, bool task_valid) - } - out: - spin_unlock_bh(&net->xfrm.xfrm_state_lock); -- if (cnt) -+ if (cnt) { - err = 0; -- -+ if (netdev_xfrm_cache) -+ xfrm_policy_cache_flush(); -+ } - return err; - } - EXPORT_SYMBOL(xfrm_state_flush); --- -2.53.0 - diff --git a/SPECS/91/linux/hcx/0015-rcutree-Adding-rcu_max_blimit-rcutree-param.patch b/SPECS/91/linux/hcx/0015-rcutree-Adding-rcu_max_blimit-rcutree-param.patch deleted file mode 100644 index c610325d16..0000000000 --- a/SPECS/91/linux/hcx/0015-rcutree-Adding-rcu_max_blimit-rcutree-param.patch +++ /dev/null @@ -1,61 +0,0 @@ -From a5050b1b4dccce4f17c2bed8bd8a5d967fa45baf Mon Sep 17 00:00:00 2001 -From: Ankit Jain -Date: Mon, 11 Nov 2024 08:54:27 +0000 -Subject: [PATCH 15/15] rcutree: Adding "rcu_max_blimit" rcutree param - -- In usecase, where rcu callbacks are more than 10K - and responsible for freeing some objects. -- 10K blimit seems low value due to high traffic causes - more allocs and freeing of objects depends on rcu callbacks -- Thus, due to 10K blimit invocation of rcu callbacks can't - keep up with allocs and causes OOM after certain duration. - -- To fix this, introducing new rcutree param "rcu_max_blimit" - through which we can set default max value of blimit instead - of hardcoding it with 10K. -- Value can be either via boot kernel cmdline param as - "rcutree.rcu_max_blimit = " or set it post boot as - "echo > /sys/module/rcutree/parameters/rcu_max_blimit" -- Default value of "/sys/module/rcutree/parameters/rcu_max_blimit" - set to 10000 - -Signed-off-by: Ankit Jain ---- - kernel/rcu/tree.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c -index 7b073b8b5e91..70303f4c16ab 100644 ---- a/kernel/rcu/tree.c -+++ b/kernel/rcu/tree.c -@@ -446,6 +446,9 @@ module_param(rcu_divisor, int, 0644); - static long rcu_resched_ns = 3 * NSEC_PER_MSEC; - module_param(rcu_resched_ns, long, 0644); - -+static long rcu_max_blimit = DEFAULT_MAX_RCU_BLIMIT; -+module_param(rcu_max_blimit, long, 0644); -+ - /* - * How long the grace period must be before we start recruiting - * quiescent-state help from rcu_note_context_switch(). -@@ -2617,7 +2620,7 @@ static void rcu_do_batch(struct rcu_data *rdp) - - /* Reinstate batch limit if we have worked down the excess. */ - count = rcu_segcblist_n_cbs(&rdp->cblist); -- if (rdp->blimit >= DEFAULT_MAX_RCU_BLIMIT && count <= qlowmark) -+ if (rdp->blimit >= rcu_max_blimit && count <= qlowmark) - rdp->blimit = blimit; - - /* Reset ->qlen_last_fqs_check trigger if enough CBs have drained. */ -@@ -3006,7 +3009,7 @@ static void call_rcu_core(struct rcu_data *rdp, struct rcu_head *head, - rcu_accelerate_cbs_unlocked(rdp->mynode, rdp); - } else { - /* Give the grace period a kick. */ -- rdp->blimit = DEFAULT_MAX_RCU_BLIMIT; -+ rdp->blimit = rcu_max_blimit; - if (READ_ONCE(rcu_state.n_force_qs) == rdp->n_force_qs_snap && - rcu_segcblist_first_pend_cb(&rdp->cblist) != head) - rcu_force_quiescent_state(); --- -2.43.0 - diff --git a/SPECS/91/linux/initramfs.trigger b/SPECS/91/linux/initramfs.trigger deleted file mode 100644 index bc492bd686..0000000000 --- a/SPECS/91/linux/initramfs.trigger +++ /dev/null @@ -1,4 +0,0 @@ -%triggerin -- initramfs -mkdir -p %{_sharedstatedir}/rpm-state/initramfs/pending -touch %{_sharedstatedir}/rpm-state/initramfs/pending/%{uname_r} -echo "initrd generation of kernel %{uname_r} will be triggered later" >&2 diff --git a/SPECS/91/linux/jitterentropy_builder/0001-New-memsize-options-for-jent.patch b/SPECS/91/linux/jitterentropy_builder/0001-New-memsize-options-for-jent.patch deleted file mode 100644 index 7474f4167b..0000000000 --- a/SPECS/91/linux/jitterentropy_builder/0001-New-memsize-options-for-jent.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/crypto/Kconfig b/crypto/Kconfig -index e7528986e94f..307a6499e292 100644 ---- a/crypto/Kconfig -+++ b/crypto/Kconfig -@@ -1281,6 +1281,15 @@ choice - config CRYPTO_JITTERENTROPY_MEMSIZE_2 - bool "2048 Bytes (default)" - -+ config CRYPTO_JITTERENTROPY_MEMSIZE_8 -+ bool "8192 Bytes" -+ -+ config CRYPTO_JITTERENTROPY_MEMSIZE_32 -+ bool "32768 Bytes" -+ -+ config CRYPTO_JITTERENTROPY_MEMSIZE_64 -+ bool "65536 Bytes" -+ - config CRYPTO_JITTERENTROPY_MEMSIZE_128 - bool "128 kBytes" - -@@ -1294,6 +1303,9 @@ endchoice - config CRYPTO_JITTERENTROPY_MEMORY_BLOCKS - int - default 64 if CRYPTO_JITTERENTROPY_MEMSIZE_2 -+ default 64 if CRYPTO_JITTERENTROPY_MEMSIZE_8 -+ default 128 if CRYPTO_JITTERENTROPY_MEMSIZE_32 -+ default 256 if CRYPTO_JITTERENTROPY_MEMSIZE_64 - default 512 if CRYPTO_JITTERENTROPY_MEMSIZE_128 - default 1024 if CRYPTO_JITTERENTROPY_MEMSIZE_1024 - default 4096 if CRYPTO_JITTERENTROPY_MEMSIZE_8192 -@@ -1301,6 +1313,9 @@ config CRYPTO_JITTERENTROPY_MEMORY_BLOCKS - config CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE - int - default 32 if CRYPTO_JITTERENTROPY_MEMSIZE_2 -+ default 128 if CRYPTO_JITTERENTROPY_MEMSIZE_8 -+ default 256 if CRYPTO_JITTERENTROPY_MEMSIZE_32 -+ default 256 if CRYPTO_JITTERENTROPY_MEMSIZE_64 - default 256 if CRYPTO_JITTERENTROPY_MEMSIZE_128 - default 1024 if CRYPTO_JITTERENTROPY_MEMSIZE_1024 - default 2048 if CRYPTO_JITTERENTROPY_MEMSIZE_8192 diff --git a/SPECS/91/linux/jitterentropy_builder/0001-compile-jitterentropy-rng-proxy.patch b/SPECS/91/linux/jitterentropy_builder/0001-compile-jitterentropy-rng-proxy.patch deleted file mode 100644 index 39c5d15826..0000000000 --- a/SPECS/91/linux/jitterentropy_builder/0001-compile-jitterentropy-rng-proxy.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 4247b0e778ad00ad51b625740810c0f635c61852 Mon Sep 17 00:00:00 2001 -From: Brennan Lamoreaux -Date: Fri, 17 Oct 2025 16:40:33 +0000 -Subject: [PATCH 1/2] compile jitterentropy rng proxy - -Signed-off-by: Brennan Lamoreaux ---- - crypto/Makefile | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/crypto/Makefile b/crypto/Makefile -index 3b7cd40e1..3acd6666b 100644 ---- a/crypto/Makefile -+++ b/crypto/Makefile -@@ -6,8 +6,9 @@ - obj-$(CONFIG_CRYPTO) += crypto.o - crypto-y := api.o cipher.o compress.o - --obj-$(CONFIG_CRYPTO_JITTERENTROPY) += jitterentropy_rng.o photon-jitterentropy-v6.12/ -+obj-$(CONFIG_CRYPTO_JITTERENTROPY) += jitterentropy_rng.o jitterentropy_rng_proxy.o photon-jitterentropy-v6.12/ - jitterentropy_rng-y := photon-jitterentropy-v6.12/jitterentropy_canister_wrapper_asm.o photon-jitterentropy-v6.12/jitterentropy_canister_wrapper.o jitterentropy-kcapi.o -+jitterentropy_rng_proxy-y := jitterentropy_rng_proxy.o - - obj-$(CONFIG_CRYPTO_ENGINE) += crypto_engine.o - obj-$(CONFIG_CRYPTO_FIPS) += fips.o --- -2.40.4 - diff --git a/SPECS/91/linux/jitterentropy_builder/0001-jitterentropy-Defer-jent_mod_init-in-non-fips-boot.patch b/SPECS/91/linux/jitterentropy_builder/0001-jitterentropy-Defer-jent_mod_init-in-non-fips-boot.patch deleted file mode 100644 index 36f8e12c97..0000000000 --- a/SPECS/91/linux/jitterentropy_builder/0001-jitterentropy-Defer-jent_mod_init-in-non-fips-boot.patch +++ /dev/null @@ -1,299 +0,0 @@ -From 046f5375514b4c1b4cf092e2f2c5bc854ee75a01 Mon Sep 17 00:00:00 2001 -From: srinidhira0 -Date: Fri, 19 Sep 2025 11:41:09 +0000 -Subject: [PATCH] jitterentropy: Defer jent_mod_init in non fips boot - - - In linux-esx, when fips is not enabled in command line, then the - kernel is expected to boot as quickly as possible. when fips is 0 - it is not neccessary to perform conditioning on the 1024 TEST LOOP - during jent_entropy_init. Optimize by skipping conditioning and - also defer the jent_mod_init work to a delayed workqueue so that - initialization can continue in parallel instead of blocking other - initcalls. - -Signed-off-by: srinidhira0 ---- - jitterentropy-kcapi.c | 96 +++++++++++++++++++++++++++++++++++++++++-- - jitterentropy.c | 28 +++++++++---- - jitterentropy.h | 3 ++ - 3 files changed, 115 insertions(+), 12 deletions(-) - -diff --git a/jitterentropy-kcapi.c b/jitterentropy-kcapi.c -index dceadb7..a731dcb 100644 ---- a/jitterentropy-kcapi.c -+++ b/jitterentropy-kcapi.c -@@ -46,6 +46,9 @@ - #include - #include - -+#include -+#include -+ - #include "photon-jitterentropy-v6.12/jitterentropy.h" - #include "photon-jitterentropy-v6.12/jitterentropy_canister_wrapper.h" - -@@ -57,6 +60,17 @@ module_param_string(mem_access_type, mem_access_method, - ARRAY_SIZE(mem_access_method), 0444); - MODULE_PARM_DESC(mem_access_type, "jent Mem Block Access default=random"); - -+/*************************************************************************** -+ * wait for jent init completion helpers -+ ***************************************************************************/ -+ -+static int sync_on_jent_init(void); -+static void jent_delayed_init(struct work_struct *work); -+ -+static atomic_t jent_init_complete; -+static DECLARE_DELAYED_WORK(jent_init_work, jent_delayed_init); -+static DEFINE_MUTEX(jent_init_mutex); -+ - /*************************************************************************** - * Helper function - ***************************************************************************/ -@@ -200,6 +214,11 @@ static void jent_kcapi_cleanup(struct crypto_tfm *tfm) - { - struct jitterentropy *rng = crypto_tfm_ctx(tfm); - -+ if (!atomic_read(&jent_init_complete) && !jcw_fips_enabled()) { -+ cancel_delayed_work_sync(&jent_init_work); -+ pr_devel("Invoked %s, canceled sync\n", __func__); -+ } -+ - spin_lock(&rng->jent_lock); - - if (rng->sdesc) { -@@ -225,6 +244,12 @@ static int jent_kcapi_init(struct crypto_tfm *tfm) - struct shash_desc *sdesc; - int size, ret = 0; - -+ /* If jent init was delayed, sync till jent init is complete */ -+ if (!jcw_fips_enabled()) { -+ if (!sync_on_jent_init()) -+ pr_devel("Invoked %s. Sync jent_init\n", __func__); -+ } -+ - spin_lock_init(&rng->jent_lock); - - /* -@@ -277,6 +302,9 @@ static int jent_kcapi_random(struct crypto_rng *tfm, - struct jitterentropy *rng = crypto_rng_ctx(tfm); - int ret = 0; - -+ if (!sync_on_jent_init()) -+ pr_devel("Invoked %s\n", __func__); -+ - spin_lock(&rng->jent_lock); - - ret = jent_read_entropy(rng->entropy_collector, rdata, dlen); -@@ -311,6 +339,9 @@ static int jent_kcapi_random(struct crypto_rng *tfm, - static int jent_kcapi_reset(struct crypto_rng *tfm, - const u8 *seed, unsigned int slen) - { -+ if (!sync_on_jent_init()) -+ pr_devel("Invoked %s\n", __func__); -+ - return 0; - } - -@@ -329,13 +360,16 @@ static struct rng_alg jent_alg = { - } - }; - --static int __init jent_mod_init(void) -+static int invoke_jent_init(void) - { - SHASH_DESC_ON_STACK(desc, tfm); - struct crypto_shash *tfm; - int ret = 0; -+ int init_in_progress = 0; - - jent_testing_init(); -+ if (!jcw_fips_enabled()) -+ init_in_progress = JENT_INIT; - - tfm = crypto_alloc_shash(JENT_CONDITIONING_HASH, 0, 0); - if (IS_ERR(tfm)) { -@@ -345,24 +379,78 @@ static int __init jent_mod_init(void) - - desc->tfm = tfm; - crypto_shash_init(desc); -- ret = jent_entropy_init(CONFIG_CRYPTO_JITTERENTROPY_OSR, 0, desc, NULL); -+ ret = jent_entropy_init(CONFIG_CRYPTO_JITTERENTROPY_OSR, init_in_progress, desc, NULL); - shash_desc_zero(desc); - crypto_free_shash(tfm); -- if (ret) { -+ if (unlikely(ret)) { - /* Handle permanent health test error */ - if (fips_enabled) - panic("jitterentropy: Initialization failed with host not compliant with requirements: %d\n", ret); - - jent_testing_exit(); - pr_info("jitterentropy: Initialization failed with host not compliant with requirements: %d\n", ret); -- return -EFAULT; -+ ret = -EFAULT; - } - pr_info("jitterentropy: Initialized Jitterentropy\n"); -+ return ret; -+} -+ -+static int sync_on_jent_init(void) -+{ -+ int ret = -EALREADY; -+ -+ if (unlikely(mutex_lock_interruptible(&jent_init_mutex))) -+ return -EINTR; -+ if (!atomic_read(&jent_init_complete) && !jcw_fips_enabled()) { -+ if (cancel_delayed_work_sync(&jent_init_work)) { -+ ret = invoke_jent_init(); -+ if (unlikely(ret)) { -+ WARN_ONCE(1, "jent: Init failed %d\n", ret); -+ crypto_unregister_rng(&jent_alg); -+ goto check_exit; -+ } -+ } -+ atomic_set(&jent_init_complete, true); -+ ret = 0; -+ } -+check_exit: -+ mutex_unlock(&jent_init_mutex); -+ return ret; -+} -+ -+static void jent_delayed_init(struct work_struct *work) -+{ -+ int ret = 0; -+ -+ ret = invoke_jent_init(); -+ if (unlikely(ret)) { -+ WARN_ONCE(1, "jitterentropy: Delayed Initialization Failure %d\n", ret); -+ crypto_unregister_rng(&jent_alg); -+ } else { -+ pr_devel("Jent delayed init completed successfully\n"); -+ atomic_set(&jent_init_complete, true); -+ } -+} -+ -+static int __init jent_mod_init(void) -+{ -+ int ret = 0; -+ -+ if (!jcw_fips_enabled()) { -+ schedule_delayed_work(&jent_init_work, HZ); -+ } else { -+ ret = invoke_jent_init(); -+ if (unlikely(ret)) -+ return ret; -+ } - return crypto_register_rng(&jent_alg); - } - - static void __exit jent_mod_exit(void) - { -+ if (!atomic_read(&jent_init_complete) && !jcw_fips_enabled()) -+ cancel_delayed_work_sync(&jent_init_work); -+ - jent_testing_exit(); - crypto_unregister_rng(&jent_alg); - } -diff --git a/jitterentropy.c b/jitterentropy.c -index ddfe1ed..d992a73 100644 ---- a/jitterentropy.c -+++ b/jitterentropy.c -@@ -730,7 +730,8 @@ static void jent_memaccess_sequential(struct rand_data *ec, __u64 loop_cnt) - * - * @return result of stuck test - */ --static int jent_measure_jitter(struct rand_data *ec, __u64 *ret_current_delta) -+static int jent_measure_jitter(struct rand_data *ec, __u64 *ret_current_delta, -+ bool init_in_progress) - { - __u64 time = 0; - __u64 current_delta = 0; -@@ -761,8 +762,10 @@ static int jent_measure_jitter(struct rand_data *ec, __u64 *ret_current_delta) - stuck = jent_stuck(ec, current_delta); - - /* Now call the next noise sources which also injects the data */ -- if (jent_condition_data(ec, current_delta, stuck)) -- stuck = 1; -+ /* Skip conditioning if fips_enabled is 0 & bootup is in progress */ -+ if (init_in_progress == false) -+ if (jent_condition_data(ec, current_delta, stuck)) -+ stuck = 1; - - /* return the raw entropy value */ - if (ret_current_delta) -@@ -785,11 +788,11 @@ static void jent_gen_entropy(struct rand_data *ec) - safety_factor = JENT_ENTROPY_SAFETY_FACTOR; - - /* priming of the ->prev_time value */ -- jent_measure_jitter(ec, NULL); -+ jent_measure_jitter(ec, NULL, false); - - while (!jent_health_failure(ec)) { - /* If a stuck measurement is received, repeat measurement */ -- if (jent_measure_jitter(ec, NULL)) -+ if (jent_measure_jitter(ec, NULL, false)) - continue; - - /* -@@ -926,7 +929,12 @@ struct rand_data *jent_entropy_collector_alloc(unsigned int osr, - jent_lag_init(entropy_collector, osr); - - /* fill the data pad with non-zero values */ -- jent_gen_entropy(entropy_collector); -+ /* -+ * Optimize jent_init during bootup by skipping the call to -+ * jent_gen_entropy when fips_enabled is 0 and init is in progress -+ */ -+ if (jcw_fips_enabled() || (flags != JENT_INIT)) -+ jent_gen_entropy(entropy_collector); - - return entropy_collector; - } -@@ -951,6 +959,7 @@ int jent_entropy_init(unsigned int osr, unsigned int flags, void *hash_state, - struct rand_data *ec = p_ec; - int i, time_backwards = 0, ret = 0, ec_free = 0, delta_indx = 0; - unsigned int health_test_result; -+ bool init_in_progress = false; - - if (!ec) { - ec = jent_entropy_collector_alloc(osr, flags, hash_state); -@@ -972,8 +981,11 @@ int jent_entropy_init(unsigned int osr, unsigned int flags, void *hash_state, - ec->health_failure &= (~JENT_APT_FAILURE); - } - -+ if (!jcw_fips_enabled() && (flags == JENT_INIT)) -+ init_in_progress = true; -+ - /* priming of the ec->prev_time value */ -- jent_measure_jitter(ec, NULL); -+ jent_measure_jitter(ec, NULL, false); - - /* We could perform statistical tests here, but the problem is - * that we only have a few loop counts to do testing. These -@@ -1005,7 +1017,7 @@ int jent_entropy_init(unsigned int osr, unsigned int flags, void *hash_state, - __u64 start_time = 0, end_time = 0, delta = 0; - - /* Invoke core entropy collection logic */ -- jent_measure_jitter(ec, &delta); -+ jent_measure_jitter(ec, &delta, init_in_progress); - end_time = ec->prev_time; - start_time = ec->prev_time - delta; - -diff --git a/jitterentropy.h b/jitterentropy.h -index 95f4ce6..a56e17e 100644 ---- a/jitterentropy.h -+++ b/jitterentropy.h -@@ -11,6 +11,9 @@ - - #define JENT_CONF_DISABLE_LOOP_SHUFFLE - -+/* Declare ASCII Value of Init to be used during initialization */ -+#define JENT_INIT 0x494E4950 -+ - extern void jent_get_nstime(__u64 *out); - extern int jent_hash_time(void *hash_state, __u64 time, u8 *addtl, - unsigned int addtl_len, __u64 hash_loop_cnt, --- -2.35.6 - diff --git a/SPECS/91/linux/jitterentropy_builder/0001-jitterentropy-Makefile-changes.patch b/SPECS/91/linux/jitterentropy_builder/0001-jitterentropy-Makefile-changes.patch deleted file mode 100644 index 3bba3bc67d..0000000000 --- a/SPECS/91/linux/jitterentropy_builder/0001-jitterentropy-Makefile-changes.patch +++ /dev/null @@ -1,42 +0,0 @@ -From b57e0c01327b9d48aa8f29891b4820ab558d7316 Mon Sep 17 00:00:00 2001 -From: Vamsi Krishna Brahmajosyula -Date: Fri, 20 Jun 2025 11:07:36 -0500 -Subject: [PATCH] jitterentropy: Makefile changes - -- Add photon-jitterentropy-v6.12 to compile instead of - linux kernel's default jitterentropy. - -Signed-off-by: srinidhira0 ---- - crypto/Makefile | 8 +++----- - 1 file changed, 3 insertions(+), 5 deletions(-) - -diff --git a/crypto/Makefile b/crypto/Makefile -index 4c99e5d37..af6614b46 100644 ---- a/crypto/Makefile -+++ b/crypto/Makefile -@@ -6,6 +6,9 @@ - obj-$(CONFIG_CRYPTO) += crypto.o - crypto-y := api.o cipher.o compress.o - -+obj-$(CONFIG_CRYPTO_JITTERENTROPY) += jitterentropy_rng.o photon-jitterentropy-v6.12/ -+jitterentropy_rng-y := photon-jitterentropy-v6.12/jitterentropy_canister_wrapper_asm.o photon-jitterentropy-v6.12/jitterentropy_canister_wrapper.o jitterentropy-kcapi.o -+ - obj-$(CONFIG_CRYPTO_ENGINE) += crypto_engine.o - obj-$(CONFIG_CRYPTO_FIPS) += fips.o - -@@ -163,11 +166,6 @@ obj-$(CONFIG_CRYPTO_842) += 842.o - obj-$(CONFIG_CRYPTO_RNG2) += rng.o - obj-$(CONFIG_CRYPTO_ANSI_CPRNG) += ansi_cprng.o - obj-$(CONFIG_CRYPTO_DRBG) += drbg.o --obj-$(CONFIG_CRYPTO_JITTERENTROPY) += jitterentropy_rng.o --CFLAGS_jitterentropy.o = -O0 --KASAN_SANITIZE_jitterentropy.o = n --UBSAN_SANITIZE_jitterentropy.o = n --jitterentropy_rng-y := jitterentropy.o jitterentropy-kcapi.o - obj-$(CONFIG_CRYPTO_JITTERENTROPY_TESTINTERFACE) += jitterentropy-testing.o - obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o - obj-$(CONFIG_CRYPTO_GHASH) += ghash-generic.o --- -2.49.0 - diff --git a/SPECS/91/linux/jitterentropy_builder/0012-jitterentropy-kcapi-Support-for-sample-collection.patch b/SPECS/91/linux/jitterentropy_builder/0012-jitterentropy-kcapi-Support-for-sample-collection.patch deleted file mode 100644 index 3789e72186..0000000000 --- a/SPECS/91/linux/jitterentropy_builder/0012-jitterentropy-kcapi-Support-for-sample-collection.patch +++ /dev/null @@ -1,449 +0,0 @@ -From cf8f4e570dc1a3ceb07236753829fae765ca6123 Mon Sep 17 00:00:00 2001 -From: srinidhira0 -Date: Wed, 25 Jun 2025 09:03:43 +0000 -Subject: [PATCH] jitterentropy-kcapi: Support-for-sample-collection - - - Add support for jitterentropy sample collection - which will be enabled under ACVP build. - This patch enables functions which can capture 300 million - raw data samples & 1000 restart samples. - one raw data sample consists of a u64 value of high resolution - time delta between two successive jent measurements. - Modify sample write functions to only collect lower bound - raw values i.e. raw data with no conditioning from jitterentropy. - -Signed-off-by: srinidhira0 ---- - photon-jitterentropy-v6.12/jitterentropy-kcapi.c | 290 +++++++++++++++++++++++++++++++++++++++++- - photon-jitterentropy-v6.12/jitterentropy.c | 65 +++++++++- - photon-jitterentropy-v6.12/jitterentropy.h | 6 + - 3 files changed, 358 insertions(+), 3 deletions(-) - -diff --git a/crypto/jitterentropy-kcapi.c b/crypto/jitterentropy-kcapi.c -index dceadb7..8cfc77e 100644 ---- a/crypto/jitterentropy-kcapi.c -+++ b/crypto/jitterentropy-kcapi.c -@@ -44,6 +44,13 @@ - #include - #include - #include -+#include -+#include -+#include -+#include -+#include -+#include -+#include - #include - - #include "photon-jitterentropy-v6.12/jitterentropy.h" -@@ -57,13 +64,38 @@ module_param_string(mem_access_type, mem_access_method, - ARRAY_SIZE(mem_access_method), 0444); - MODULE_PARM_DESC(mem_access_type, "jent Mem Block Access default=random"); - -+/* -+ * We need to collect 300 million samples for ESV certification. However, -+ * Max file size in linux is limited by FILE_MAX which is around 2.3GB. -+ * The Total size of 300 million samples will be around 5GB, we need -+ * 3 files to collect 300 million samples in total -+ */ -+#define NUM_SAMPLE_FILES 3 -+ -+struct sample_file_param { -+ struct file *fp; -+ char name[224]; -+ bool full; -+}; -+ -+int jent_hash_time(void *hash_state, __u64 time, u8 *addtl, -+ unsigned int addtl_len, __u64 hash_loop_cnt, -+ unsigned int stuck); -+ -+int check_stat_and_fetch_fp(struct sample_file_param *sampl, -+ loff_t *ppos, struct file **fp); -+int jitterentropy_kcapi_write_sample_file(const char *sample_file_name, -+ unsigned long rounds); -+int jitterentropy_kcapi_write_restart_files(const char *sample_file_name, -+ unsigned long rounds); -+ - /*************************************************************************** - * Helper function - ***************************************************************************/ - bool is_jent_mem_access_method_random(void) - { - if (strlen(mem_access_method) == 0) { -- jcw_printk(KERN_ERR"MEM access method not set %s\n",__func__); -+ jcw_printk("MEM access method not set %s\n",__func__); - return true; - } - if (!jcw_strncasecmp(mem_access_method, "sequential", -@@ -100,6 +132,256 @@ void jent_get_nstime(__u64 *out) - jent_raw_hires_entropy_store(tmp); - } - -+int check_stat_and_fetch_fp(struct sample_file_param *sampl, -+ loff_t *ppos, struct file **fp) -+{ -+ int ret = 0, i = 0; -+ struct path path; -+ struct kstat stat; -+ -+ for (i = 0; i < NUM_SAMPLE_FILES; i++) { -+ memset(&stat, 0, sizeof(struct kstat)); -+ if (sampl[i].full == true) -+ continue; -+ ret = kern_path(sampl[i].name, 0, &path); -+ if (ret) { -+ jcw_printk("kernel path error %s\n",sampl[i].name); -+ return ret; -+ } -+ ret = vfs_getattr(&path, &stat, STATX_SIZE, 0); -+ if (ret) { -+ jcw_printk("vfs_getattr file stats Error\n"); -+ path_put(&path); -+ return ret; -+ } -+ if (stat.size >= MAX_RW_COUNT || *ppos >= MAX_RW_COUNT) { -+ jcw_printk("File size exceeded\n"); -+ sampl[i].full = true; -+ *ppos = 0; -+ path_put(&path); -+ continue; -+ } -+ if (sampl[i].full == false) { -+ *fp = sampl[i].fp; -+ ret = 0; -+ break; -+ } else -+ ret = -EFBIG; -+ } -+ return ret; -+} -+ -+int jitterentropy_kcapi_write_sample_file(const char *sample_file_name, -+ unsigned long rounds) -+{ -+ struct file *wr_fp = NULL; -+ /* -+ * One sample is collected as a u64 value. To express the MAX Value -+ * of a u64 in terms of char bytes will required 20 bytes. Accounting -+ * for new line character, allocate a char array of 24 to hold one -+ * sample. -+ */ -+ char tmp_rdata[24] = {0}; -+ struct sample_file_param smp_files[NUM_SAMPLE_FILES] = {0}; -+ loff_t ppos = 0; -+ int wr_siz = 0; -+ __u64 *duration = NULL; -+ -+ unsigned int health_test_result = 0; -+ int ret = 0, indx = 0, i = 0; -+ -+ struct rand_data *ec = NULL; -+ -+ struct crypto_shash *tfm; -+ SHASH_DESC_ON_STACK(f_desc, tfm); -+ -+ snprintf(smp_files[0].name, sizeof(smp_files[0].name), "%s-%.4u", sample_file_name, 1); -+ snprintf(smp_files[1].name, sizeof(smp_files[1].name), "%s-%.4u", sample_file_name, 2); -+ snprintf(smp_files[2].name, sizeof(smp_files[2].name), "%s-%.4u", sample_file_name, 3); -+ -+ tfm = crypto_alloc_shash(JENT_CONDITIONING_HASH, 0, 0); -+ if (IS_ERR(tfm)) -+ return PTR_ERR(tfm); -+ -+ f_desc->tfm = tfm; -+ crypto_shash_init(f_desc); -+ -+ ec = jent_entropy_collector_alloc(CONFIG_CRYPTO_JITTERENTROPY_OSR, -+ 0, f_desc); -+ if (!ec) { -+ pr_err("Failed to allocate jitter entropy rng for sample\n"); -+ goto out_2; -+ } -+ ret = jent_entropy_init(CONFIG_CRYPTO_JITTERENTROPY_OSR, -+ 0, f_desc, ec); -+ if (ret || !ec) { -+ pr_err("\n Failed to initialize jitterentropy \n"); -+ goto out_2; -+ } -+ for (i = 0; i < NUM_SAMPLE_FILES; i++) { -+ smp_files[i].fp = filp_open(smp_files[i].name, -+ O_CREAT | O_WRONLY | O_CLOEXEC, -+ S_IRUSR | S_IWUSR); -+ -+ if ( IS_ERR_OR_NULL(smp_files[i].fp)) { -+ pr_err("JENT: Failed to open fp for writing\n"); -+ goto out; -+ } -+ } -+ /* Prime the EC */ -+ for (i = 0; i < 1024; i++) -+ jent_sample_collect(ec, 0, NULL); -+ -+ duration = (__u64 *)kzalloc(sizeof(__u64)*1, GFP_KERNEL); -+ if (IS_ERR_OR_NULL(duration)) { -+ pr_err("\n Failed to allocate memory for duration\n"); -+ goto out; -+ } -+ /* -+ * TODO: Read one sample from jent_collect_sample() & write it -+ * immediately into the file. It doesn't matter if the file write takes -+ * some additional cpu cycles. Keep writing to the file till the file -+ * size reaches FILE_MAX. After that open the second file & keep -+ * dumping the data into second file till 300 million samples are -+ * collected. -+ */ -+ do { -+ jcw_memzero_explicit(duration, sizeof(__u64)); -+ /* Disregard stuck indicator*/ -+ jent_sample_collect(ec, 0, duration); -+ ret = check_stat_and_fetch_fp(smp_files, &ppos, &wr_fp); -+ if (ret) { -+ jcw_printk("Error as all files are full %d\n", ret); -+ goto out; -+ } -+ memset(tmp_rdata, 0 ,sizeof(tmp_rdata)); -+ wr_siz = snprintf(tmp_rdata, sizeof(tmp_rdata), -+ "%llu\n", *duration); -+ kernel_write(wr_fp, tmp_rdata, wr_siz, &ppos); -+ ppos += wr_siz; -+ indx++; -+ } while (indx <= rounds); -+ -+ if ((health_test_result = jent_health_failure(ec))) { -+ jcw_printk("jent collector health test failure(s):\n"); -+ if(health_test_result & 1) -+ jcw_printk(" RCT "); -+ if(health_test_result & 2) -+ jcw_printk(" APT "); -+ if(health_test_result & 4) -+ jcw_printk(" Lag "); -+ jcw_printk("\n"); -+ } -+ -+out: -+ for (i = 0; i < NUM_SAMPLE_FILES; i++) { -+ if (!IS_ERR_OR_NULL(smp_files[i].fp)) -+ filp_close(smp_files[i].fp, NULL); -+ } -+ if (duration) -+ kfree(duration); -+out_2: -+ if (ec) -+ jent_entropy_collector_free(ec); -+ if (f_desc) -+ shash_desc_zero(f_desc); -+ if (tfm) -+ crypto_free_shash(tfm); -+ -+ return ret; -+} -+EXPORT_SYMBOL(jitterentropy_kcapi_write_sample_file); -+ -+int jitterentropy_kcapi_write_restart_files(const char *sample_file_name, -+ unsigned long rounds) -+{ -+ struct file *fp = NULL; -+ char tmp_rdata[24] = {0}; /* 24 char bytes to hold u64 MAX value */ -+ loff_t ppos = 0; -+ int wr_siz = 0; -+ __u64 *duration = NULL; -+ __u64 size = 0; -+ -+ unsigned int health_test_result = 0; -+ int ret = 0; -+ -+ struct rand_data *ec = NULL; -+ -+ struct crypto_shash *tfm; -+ SHASH_DESC_ON_STACK(f_desc, tfm); -+ -+ tfm = crypto_alloc_shash(JENT_CONDITIONING_HASH, 0, 0); -+ if (IS_ERR(tfm)) -+ return PTR_ERR(tfm); -+ -+ f_desc->tfm = tfm; -+ crypto_shash_init(f_desc); -+ -+ ec = jent_entropy_collector_alloc(CONFIG_CRYPTO_JITTERENTROPY_OSR, -+ 0, f_desc); -+ if (!ec) { -+ pr_err("Failed to allocate jitter entropy rng for sample\n"); -+ goto out_2; -+ } -+ ret = jent_entropy_init(CONFIG_CRYPTO_JITTERENTROPY_OSR, -+ 0, f_desc, ec); -+ if (ret || !ec) { -+ pr_err("\n Failed to initialize first jitterentropy \n"); -+ goto out_2; -+ } -+ duration = (__u64 *)vzalloc(sizeof(__u64)*rounds); -+ if (IS_ERR_OR_NULL(duration)) { -+ pr_err("\n Failed to allocate memory for duration\n"); -+ goto out; -+ } -+ /* Prime the test */ -+ jent_sample_collect(ec, 0, NULL); -+ for (size = 0; size < rounds; size++) { -+ /* Disregard stuck indicator*/ -+ jent_sample_collect(ec, 0, &duration[size]); -+ } -+ fp = filp_open(sample_file_name, -+ O_CREAT | O_WRONLY | O_CLOEXEC, S_IRUSR | S_IWUSR); -+ if (IS_ERR_OR_NULL(fp)) { -+ pr_err("JENT: Failed to open fp for writing\n"); -+ goto out; -+ } -+ for (size = 0; size < rounds; size++) { -+ memset(tmp_rdata, 0 ,sizeof(tmp_rdata)); -+ wr_siz = snprintf(tmp_rdata, sizeof(tmp_rdata), "%llu\n", -+ duration[size]); -+ kernel_write(fp, tmp_rdata, wr_siz, &ppos); -+ -+ /* Increment the file position after 1000 samples */ -+ ppos += wr_siz; -+ } -+ if ((health_test_result = jent_health_failure(ec))) { -+ jcw_printk("ent collector health test failure(s):\n"); -+ if(health_test_result & 1) -+ jcw_printk(" RCT "); -+ if(health_test_result & 2) -+ jcw_printk(" APT "); -+ if(health_test_result & 4) -+ jcw_printk(" Lag "); -+ jcw_printk("\n"); -+ } -+out: -+ if (!IS_ERR_OR_NULL(fp)) -+ filp_close(fp, NULL); -+ if (duration) -+ vfree(duration); -+out_2: -+ if (ec) -+ jent_entropy_collector_free(ec); -+ if (f_desc) -+ shash_desc_zero(f_desc); -+ if (tfm) -+ crypto_free_shash(tfm); -+ -+ return ret; -+} -+EXPORT_SYMBOL(jitterentropy_kcapi_write_restart_files); -+ - int jent_hash_time(void *hash_state, __u64 time, u8 *addtl, - unsigned int addtl_len, __u64 hash_loop_cnt, - unsigned int stuck) -@@ -138,7 +420,11 @@ int jent_hash_time(void *hash_state, __u64 time, u8 *addtl, - if (ret) - goto err; - } -- -+ /* Before the next operation, In case if the loop count was zero, -+ * It is neccessary to instantiate crypto descriptor. -+ */ -+ if (hash_loop_cnt <= 0) -+ ret = crypto_shash_init(desc); - /* - * Inject the data from the previous loop into the pool. This data is - * not considered to contain any entropy, but it stirs the pool a bit. -diff --git a/crypto/photon-jitterentropy-v6.12/jitterentropy.c b/crypto/photon-jitterentropy-v6.12/jitterentropy.c -index ddfe1ed..e30908f 100644 ---- a/crypto/photon-jitterentropy-v6.12/jitterentropy.c -+++ b/crypto/photon-jitterentropy-v6.12/jitterentropy.c -@@ -562,7 +562,7 @@ static int jent_stuck(struct rand_data *ec, __u64 current_delta) - * 1<rct_count, -+ ec->apt_observations, -+ ec->apt_count, -+ ec->apt_base -+ }; -+ if (!ec) { -+ jcw_printk("IN %s, ec is NULL\n", __func__); -+ return -1; -+ } -+ /* Invoke one noise source before time measurement to add variations */ -+ -+ if (is_jent_mem_access_method_random()) -+ jent_memaccess_random(ec, 0); -+ else -+ jent_memaccess_sequential(ec, 0); -+ -+ /* -+ * Get time stamp and calculate time delta to previous -+ * invocation to measure the timing variations -+ */ -+ jent_get_nstime(&time); -+ if (ec->gcd != GCD_READY) { -+ ec->gcd = 1; -+ } -+ current_delta = jent_delta(ec->prev_time, time) / ec->gcd; -+ ec->prev_time = time; -+ -+ /* Check whether we have a stuck measurement. */ -+ stuck = jent_stuck(ec, current_delta); -+ -+ /* Now call the next noise sources which also injects the data */ -+ if (ec->hash_state == NULL) { -+ jcw_printk("In %s ec->hash_state is NULL\n", __func__); -+ return -1; -+ } -+ if (loop_cnt) { -+ if (jent_hash_time(ec->hash_state, time, (u8 *)&addtl, -+ sizeof(addtl), loop_cnt, stuck)) -+ stuck = 1; -+ } -+ -+ /* return the raw entropy value */ -+ if (ret_current_delta) -+ *ret_current_delta = current_delta; -+ -+ return stuck; -+} -+ - static int jent_measure_jitter(struct rand_data *ec, __u64 *ret_current_delta) - { - __u64 time = 0; -diff --git a/crypto/photon-jitterentropy-v6.12/jitterentropy.h b/crypto/photon-jitterentropy-v6.12/jitterentropy.h -index 95f4ce6..78fd109 100644 ---- a/crypto/photon-jitterentropy-v6.12/jitterentropy.h -+++ b/crypto/photon-jitterentropy-v6.12/jitterentropy.h -@@ -37,3 +37,9 @@ static inline int jent_raw_hires_entropy_store(__u32 value) { return 0; } - static inline void jent_testing_init(void) { } - static inline void jent_testing_exit(void) { } - #endif /* CONFIG_CRYPTO_JITTERENTROPY_TESTINTERFACE */ -+ -+extern int jent_sample_collect(struct rand_data *ec, -+ int loop_cnt, -+ __u64 *ret_current_delta); -+ -+extern unsigned int jent_health_failure(struct rand_data *ec); --- -2.35.6 - diff --git a/SPECS/91/linux/jitterentropy_builder/0013-Jitterentropy-Add-char-dev-interface-for-jent-osr.patch b/SPECS/91/linux/jitterentropy_builder/0013-Jitterentropy-Add-char-dev-interface-for-jent-osr.patch deleted file mode 100644 index b3f447d2db..0000000000 --- a/SPECS/91/linux/jitterentropy_builder/0013-Jitterentropy-Add-char-dev-interface-for-jent-osr.patch +++ /dev/null @@ -1,301 +0,0 @@ -From 1b51f12c10839cfa37ca7b42909b8d033f54f926 Mon Sep 17 00:00:00 2001 -From: srinidhira0 -Date: Fri, 25 Jul 2025 08:25:38 +0000 -Subject: [PATCH] Jitterentropy: Add char dev interface for jent-osr - - - Add a char dev in jitterentropy-kcapi int and export - open, read, ioctl & release calls to user space such that - jitterentropy-osr tool can call the jent-osr char dev & - calculate OSR(max). - -Signed-off-by: srinidhira0 ---- - photon-jitterentropy-v6.12/jitterentropy-kcapi.c | 213 +++++++++++++++++++++++++++++++++++++++++- - photon-jitterentropy-v6.12/jitterentropy.c | 3 +- - 2 files changed, 214 insertions(+), 2 deletions(-) - -diff --git a/crypto/jitterentropy-kcapi.c b/crypto/jitterentropy-kcapi.c -index 8cfc77e..b4f42b8 100644 ---- a/crypto/jitterentropy-kcapi.c -+++ b/crypto/jitterentropy-kcapi.c -@@ -42,12 +42,16 @@ - #include - #include - #include -+#include -+#include -+#include - #include - #include - #include - #include - #include - #include -+#include - #include - #include - #include -@@ -72,9 +76,19 @@ MODULE_PARM_DESC(mem_access_type, "jent Mem Block Access default=random"); - */ - #define NUM_SAMPLE_FILES 3 - -+#define JENT_OSR_DEVICE_NAME "jent_osr" -+static struct class* jent_osr_class = NULL; -+static struct device* jent_osr_device = NULL; -+static int jent_osr_major; -+DEFINE_MUTEX(jent_osr_lock); -+ -+#define JENT_OSR_MAGIC 'J' -+#define JENT_ALLOC_AND_INIT _IOW(JENT_OSR_MAGIC, 1, unsigned long *) -+#define JENT_SET_FLAGS _IOW(JENT_OSR_MAGIC, 2, unsigned long *) -+ - struct sample_file_param { - struct file *fp; -- char name[224]; -+ char name[224]; /* Max File name with path */ - bool full; - }; - -@@ -615,6 +629,180 @@ static struct rng_alg jent_alg = { - } - }; - -+struct jent_osr_data { -+ struct rand_data *ec; -+ struct crypto_shash *hash; -+ struct shash_desc *sdesc; -+ u32 osr; -+ u32 flags; -+}; -+ -+static int jent_osr_data_alloc(struct jent_osr_data *data) -+{ -+ int size = 0, ret = -EINVAL; -+ -+ data->hash = crypto_alloc_shash(JENT_CONDITIONING_HASH, 0, 0); -+ if (IS_ERR(data->hash)) { -+ pr_err("Jitterentropy: Failed to alloc hash: jent_osr_data\n"); -+ ret = PTR_ERR(data->hash); -+ devm_kfree(jent_osr_device, data); -+ return ret; -+ } -+ size = sizeof(struct shash_desc) + crypto_shash_descsize(data->hash); -+ data->sdesc = devm_kzalloc(jent_osr_device, size, GFP_KERNEL); -+ if (!data->sdesc) { -+ pr_err("Jitterentropy: Fail to alloc sdesc: jent_osr_data\n"); -+ crypto_free_shash(data->hash); -+ ret = -ENOMEM; -+ return ret; -+ } -+ data->sdesc->tfm = data->hash; -+ crypto_shash_init(data->sdesc); -+ return 0; -+} -+ -+static void jent_osr_data_destroy(struct jent_osr_data * data) -+{ -+ if (data->ec) -+ jent_entropy_collector_free(data->ec); -+ data->ec = NULL; -+ -+ if (data->sdesc) { -+ shash_desc_zero(data->sdesc); -+ devm_kfree(jent_osr_device, data->sdesc); -+ } -+ data->sdesc = NULL; -+ -+ if (data->hash) -+ crypto_free_shash(data->hash); -+ data->hash = NULL; -+} -+ -+static int dev_open(struct inode *inod, struct file *filep) -+{ -+ int ret = -EINVAL; -+ struct jent_osr_data *data = devm_kzalloc(jent_osr_device, -+ sizeof(struct jent_osr_data), GFP_KERNEL); -+ if (IS_ERR_OR_NULL(data)) { -+ pr_err("Jitterentropy: Failed to alloc mem: jent_osr_data\n"); -+ return -ENOMEM; -+ } -+ ret = jent_osr_data_alloc((struct jent_osr_data *)data); -+ if (ret) { -+ pr_err("Jitterentropy: Fail to alloc jent_osr_data\n"); -+ devm_kfree(jent_osr_device, data); -+ return ret; -+ } -+ filep->private_data = (struct jent_osr_data *)data; -+ pr_info("Jitterentropy: Device opened %s\n", JENT_OSR_DEVICE_NAME); -+ return 0; -+} -+ -+static ssize_t dev_read(struct file *filep, char *buf, size_t len, loff_t *off) -+{ -+ int ret = -EINVAL; -+ char tmp_buf[32] = {0}; -+ struct jent_osr_data *data = (struct jent_osr_data *)filep->private_data; -+ -+ mutex_lock(&jent_osr_lock); -+ if (32 < len) -+ len = 32; -+ ret = jent_read_entropy(data->ec, tmp_buf, len); -+ if (ret) { -+ pr_err("Jitterentropy: Failed to read jent\n"); -+ jent_entropy_collector_free(data->ec); -+ jent_osr_data_destroy(data); -+ return ret; -+ } -+ if (copy_to_user(buf, tmp_buf, len)) { -+ pr_err("Jitterentropy: Failed to copy_to_user\n"); -+ return -EFAULT; -+ } -+ mutex_unlock(&jent_osr_lock); -+ return len; -+} -+ -+static ssize_t dev_write(struct file *filep, const char *buf, size_t len, -+ loff_t *off) -+{ -+ return -EINVAL; -+} -+ -+static int dev_release(struct inode *inod, struct file *filep) -+{ -+ struct jent_osr_data *data = (struct jent_osr_data *)filep->private_data; -+ jent_osr_data_destroy(data); -+ devm_kfree(jent_osr_device, data); -+ filep->private_data = NULL; -+ pr_info("Jitterentropy: Device closed\n"); -+ return 0; -+} -+ -+static long jent_osr_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) -+{ -+ int ret = -EINVAL; -+ unsigned long arg_val = 0; -+ u32 osr = 0; -+ u32 flags = 0; -+ -+ struct jent_osr_data *data = (struct jent_osr_data *)filep->private_data; -+ -+ mutex_lock(&jent_osr_lock); -+ -+ if (copy_from_user(&arg_val, (unsigned long __user *)arg, -+ sizeof(arg_val))) { -+ pr_err("Jitterentropy: FAIL to copy arg from user\n"); -+ return ret; -+ } -+ osr = (u32)(arg_val & 0xFFFFFFFFULL); -+ flags = (u32)((arg_val >> 32) & 0xFFFFFFFFULL); -+ pr_err("jent: Input osr = %u & Input flags = 0x%X\n", osr, flags); -+ switch(cmd) { -+ -+ case JENT_ALLOC_AND_INIT: -+ data->osr = osr; -+ data->flags = flags; -+ if (!filep || !filep->private_data) { -+ pr_err("Jitterentropy: IOCTL called with Null buf or ptr\n"); -+ return ret; -+ } -+ data->ec = jent_entropy_collector_alloc(data->osr, data->flags, data->sdesc); -+ if (!data->ec) { -+ pr_err("Jitterentropy: Fail to alloc ec\n"); -+ jent_osr_data_destroy(data); -+ return PTR_ERR(data->ec); -+ } -+ ret = jent_entropy_init(data->osr, data->flags, data->sdesc, data->ec); -+ if (ret || !data->ec) { -+ pr_err("Jitterentropy: Failed to initialize\n"); -+ jent_osr_data_destroy(data); -+ jent_entropy_collector_free(data->ec); -+ return ret; -+ } -+ break; -+ -+ case JENT_SET_FLAGS: -+ data->flags = (u32)(arg_val & 0xFFFFFFFFULL); -+ break; -+ -+ default: -+ pr_err("Jitterentropy: Unsupported IOCTL\n"); -+ break; -+ } -+ -+ mutex_unlock(&jent_osr_lock); -+ return ret; -+} -+ -+static struct file_operations fops= -+{ -+ .read=dev_read, -+ .write=dev_write, -+ .open=dev_open, -+ .release=dev_release, -+ .unlocked_ioctl = jent_osr_ioctl, -+}; -+ - static int __init jent_mod_init(void) - { - SHASH_DESC_ON_STACK(desc, tfm); -@@ -623,6 +811,26 @@ static int __init jent_mod_init(void) - - jent_testing_init(); - -+ jent_osr_major = register_chrdev(0, JENT_OSR_DEVICE_NAME, &fops); -+ if (jent_osr_major < 0 ) { -+ pr_info("jitterentropy: Failed to register chr dev for OSR\n"); -+ jent_testing_exit(); -+ return jent_osr_major; -+ } -+ jent_osr_class = class_create("jent_osr_class"); -+ if (IS_ERR_OR_NULL(jent_osr_class)) { -+ pr_info("jitterentropy: Failed to register device class \n"); -+ jent_testing_exit(); -+ return PTR_ERR(jent_osr_class); -+ } -+ jent_osr_device = device_create(jent_osr_class, NULL, -+ MKDEV(jent_osr_major, 0), NULL, JENT_OSR_DEVICE_NAME); -+ if (IS_ERR_OR_NULL(jent_osr_device)) { -+ pr_info("jitterentropy: Failed to register char device \n"); -+ class_destroy(jent_osr_class); -+ jent_testing_exit(); -+ return PTR_ERR(jent_osr_device); -+ } - tfm = crypto_alloc_shash(JENT_CONDITIONING_HASH, 0, 0); - if (IS_ERR(tfm)) { - jent_testing_exit(); -@@ -650,7 +858,10 @@ static int __init jent_mod_init(void) - static void __exit jent_mod_exit(void) - { - jent_testing_exit(); -+ device_destroy(jent_osr_class, MKDEV(jent_osr_major, 0)); -+ class_destroy(jent_osr_class); - crypto_unregister_rng(&jent_alg); -+ unregister_chrdev(jent_osr_major, JENT_OSR_DEVICE_NAME); - } - - /* Must be initialized before tcrypt */ -diff --git a/crypto/photon-jitterentropy-v6.12/jitterentropy.c b/crypto/photon-jitterentropy-v6.12/jitterentropy.c -index e30908f..41cd090 100644 ---- a/crypto/photon-jitterentropy-v6.12/jitterentropy.c -+++ b/crypto/photon-jitterentropy-v6.12/jitterentropy.c -@@ -842,7 +842,7 @@ static int jent_measure_jitter(struct rand_data *ec, __u64 *ret_current_delta) - */ - static void jent_gen_entropy(struct rand_data *ec) - { -- unsigned int k = 0, safety_factor = 0; -+ unsigned long k = 0, safety_factor = 0; - - if (jcw_fips_enabled()) - safety_factor = JENT_ENTROPY_SAFETY_FACTOR; -@@ -954,6 +954,7 @@ struct rand_data *jent_entropy_collector_alloc(unsigned int osr, - /* Initialize GCD to 1 */ - entropy_collector->gcd = JENT_GCD_DEFAULT; - -+ jcw_printk("jent: In %s, osr = %u & flags = 0x%X\n", __func__, osr, flags); - if (!(flags & JENT_DISABLE_MEMORY_ACCESS)) { - /* Allocate memory for adding variations based on memory - * access --- -2.35.6 - diff --git a/SPECS/91/linux/jitterentropy_builder/0014-jitterentropy-Add-prototype-for-sample-collection.patch b/SPECS/91/linux/jitterentropy_builder/0014-jitterentropy-Add-prototype-for-sample-collection.patch deleted file mode 100644 index 6b3147dd31..0000000000 --- a/SPECS/91/linux/jitterentropy_builder/0014-jitterentropy-Add-prototype-for-sample-collection.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 43d059863f6ef181ae871d23cf0d78fd100118a7 Mon Sep 17 00:00:00 2001 -From: srinidhira0 -Date: Wed, 25 Jun 2025 11:16:39 +0000 -Subject: [PATCH] jitterentropy: Add prototype for sample collection - - - Add the function prototypes for functions that collect - the jitterentropy samples. - -Signed-off-by: srinidhira0 ---- - include/crypto/internal/rng.h | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/include/crypto/internal/rng.h b/include/crypto/internal/rng.h -index e0711b6a5..fee78b2bd 100644 ---- a/include/crypto/internal/rng.h -+++ b/include/crypto/internal/rng.h -@@ -37,4 +37,9 @@ static inline void crypto_rng_set_entropy(struct crypto_rng *tfm, - crypto_rng_alg(tfm)->set_ent(tfm, data, len); - } - -+int jitterentropy_kcapi_write_sample_file(const char *sample_file_name, -+ unsigned long rounds); -+int jitterentropy_kcapi_write_restart_files(const char *sample_file_name, -+ unsigned long rounds); -+ - #endif --- -2.35.6 - diff --git a/SPECS/91/linux/jitterentropy_builder/jitterentropy_canister_wrapper.c b/SPECS/91/linux/jitterentropy_builder/jitterentropy_canister_wrapper.c deleted file mode 100644 index 580d8ada43..0000000000 --- a/SPECS/91/linux/jitterentropy_builder/jitterentropy_canister_wrapper.c +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Kernel APIs wrapper for jitterentropy v3.4.1. - * - * Copyright (C) 2023 VMware, Inc. - * Author: Keerthana K - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "jitterentropy_canister_wrapper.h" -#include "jitterentropy.h" - -#define SHADOW_JENT_MEMORY_SIZE \ - (CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKS * \ - CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE) - -/* Prototype definitions */ -int jcw_strncasecmp(const char *s1, const char *s2, size_t len); -void *jcw_memcpy(void *dst, const void *src, size_t len); -void jcw_memzero_explicit(void *s, size_t count); -int jcw_printk(const char *fmt, ...); -void *jcw_kzalloc(size_t size); -void *jcw_vzalloc(size_t size); -void *jcw_kvzalloc(unsigned int len); -void *jcw_kvzalloc_align(unsigned char *ptr, unsigned int len); -void jcw_zfree(void *ptr, unsigned int len); -void jcw_kvzfree(void *ptr, unsigned int len); -void jcw_vfree(void *ptr, unsigned int len); -int jcw_set_memory_uc(unsigned char *addr, int numpages); -int jcw_fips_enabled(void); -u64 jcw_ktime_get_ns(void); - -inline bool jcw_is_err_or_null(void *ptr); - -size_t jcw_strlen(const char *str); -int set_memory_uc(unsigned long addr, int numpages); - -inline bool jcw_is_err_or_null(void *ptr) -{ - return IS_ERR_OR_NULL(ptr); -} - -/* - * Local copy of struct rand_data from - * photon-jitterentropy-v6.12/jitterentropy.c. - * - * struct rand_data is private to jitterentropy.c - * this wrapper has to reach ec->pmem and ec->mem in - * order to make the mem blockbuffer reachable from the free path. See - * jcw_kzalloc() below. - * - * The member list is duplicated in full, so the layout is identical and - * sizeof() identifies an entropy-collector allocation exactly. - * - * This is a necessary hack to fix the entropy collector free path. - * If jitterentropy code ever changes, this particular copy also needs to - * be updated accordingly along with jitterentropy. - */ -#define SHADOW_JENT_LAG_HISTORY_SIZE 8 - -enum shadow_jcw_gcd_state_t { - SHADOW_GCD_NOT_INITIALIZED = 0, - SHADOW_GCD_INITIALIZED, - SHADOW_GCD_READY, -}; - -struct shadow_jcw_rand_data { - void *hash_state; - __u64 prev_time; - __u64 last_delta; - __s64 last_delta2; - unsigned int flags; - unsigned int osr; - unsigned char *pmem; - unsigned char *mem; - unsigned int memlocation; - unsigned int memblocks; - unsigned int memblocksize; - unsigned int memaccessloops; - unsigned int rct_count; - unsigned int apt_cutoff; - unsigned int apt_cutoff_permanent; - unsigned int apt_observations; - unsigned int apt_count; - unsigned int apt_base; - unsigned int health_failure; - unsigned int apt_base_set:1; - unsigned int lag_global_cutoff; - unsigned int lag_local_cutoff; - unsigned int lag_prediction_success_count; - unsigned int lag_prediction_success_run; - unsigned int lag_best_predictor; - unsigned int lag_observations; - __u64 lag_delta_history[SHADOW_JENT_LAG_HISTORY_SIZE]; - unsigned int lag_scoreboard[SHADOW_JENT_LAG_HISTORY_SIZE]; - __u64 gcd; - enum shadow_jcw_gcd_state_t gcd_state; -}; - -void *jcw_kzalloc(size_t size) -{ - struct shadow_jcw_rand_data *ec; - - /* - * jent_entropy_collector_alloc() is the only caller of jcw_kzalloc() in - * jitterentropy.c, and it allocates exactly one struct rand_data. Point - * ->pmem at ->mem for that allocation so the noise buffer becomes - * reachable from jent_entropy_collector_free(). - * - * The passed size should exactly match the size of shadow rand_data. - * If it doesn't match, the structure has drifted and should fail. - */ - BUG_ON(size != sizeof(struct shadow_jcw_rand_data)); - - ec = kzalloc(size, GFP_KERNEL); - if (!ec) - return NULL; - - ec->pmem = (unsigned char *)&ec->mem; - - return ec; -} - -void *jcw_memcpy(void *dst, const void *src, size_t len) -{ - return memcpy(dst, src, len); -} - -void jcw_memzero_explicit(void *s, size_t count) -{ - return memzero_explicit(s, count); -} - -void *jcw_kvzalloc(unsigned int len) -{ - return kvzalloc(len, GFP_KERNEL); -} - -void *jcw_kvzalloc_align(unsigned char *ptr, unsigned int len) -{ - unsigned long algn_len = len; - - if (len < PAGE_SIZE) - return kvzalloc(len, GFP_KERNEL); - - if (len & ~PAGE_MASK) - algn_len = roundup(len, PAGE_SIZE); - - ptr = kvzalloc(algn_len, GFP_KERNEL); - if (IS_ERR_OR_NULL(ptr)) { - pr_err("\n Failed to allocate aligned memory"); - return NULL; - } - - return (unsigned char *)PAGE_ALIGN((unsigned long)ptr); -} - -/* - * @ptr is ec->pmem, i.e. the address of the collector's ->mem member rather - * than the buffer itself - see jcw_kzalloc(). Load the buffer from it, restore - * write-back on the pages that jent_entropy_collector_alloc() mapped as - * uncacheable, and release it. - */ -void jcw_kvzfree(void *ptr, unsigned int len) -{ - unsigned char *mem = *(unsigned char **)ptr; - int ret; - - if (!mem) - return; - - /* - * jcw_kvzalloc_align() only ever returns page-aligned memory for a - * request of a page or more, so a mem that is not page aligned means - * the shadow structure above has drifted from the real - * struct rand_data and we are reading the wrong member. - */ - BUG_ON(!PAGE_ALIGNED(mem) || len != SHADOW_JENT_MEMORY_SIZE); - - /* - * Undo the jcw_set_memory_uc() done at alloc time before the pages go - * back to the page allocator. - */ - ret = set_memory_wb((unsigned long)mem, len >> JENT_PAGE_SHIFT); - WARN(ret < 0, "Failed to set jent mem to write back 0x%p: %d\n", - (void *)mem, ret); - - kvfree(mem); -} - -void *jcw_vzalloc(size_t size) -{ - return vzalloc(size); -} - -void jcw_vfree(void *ptr, unsigned int len) -{ - memzero_explicit(ptr, len); - vfree(ptr); -} - -int jcw_strncasecmp(const char *s1, const char *s2, size_t len) -{ - return strncasecmp((const char *)s1, (const char *)s2, len); -} - -size_t jcw_strlen(const char *str) -{ - return strlen((const char *)str); -} - -int jcw_set_memory_uc(unsigned char *addr, int numpages) -{ - return set_memory_uc((unsigned long)addr, numpages); -} - -int jcw_fips_enabled(void) -{ - return fips_enabled; -} - -void jcw_zfree(void *ptr, unsigned int len) -{ - memzero_explicit(ptr, len); - kfree_sensitive(ptr); -} - -u64 jcw_ktime_get_ns(void) -{ - return ktime_get_ns(); -} diff --git a/SPECS/91/linux/jitterentropy_builder/jitterentropy_canister_wrapper.h b/SPECS/91/linux/jitterentropy_builder/jitterentropy_canister_wrapper.h deleted file mode 100644 index 6c709493e5..0000000000 --- a/SPECS/91/linux/jitterentropy_builder/jitterentropy_canister_wrapper.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Kernel APIs wrapper for jitterentropy v3.4.1. - * - * Copyright (C) 2023 VMware, Inc. - * Author: Keerthana K - * - */ - -#ifndef JITTERENTROPY_CANISTER_WRAPPER_H -#define JITTERENTROPY_CANISTER_WRAPPER_H - -#include -#include - -#define JENT_PAGE_SHIFT 12 - -extern int jcw_strncasecmp(const char *s1, const char *s2, size_t len); -extern void *jcw_memcpy(void *dst, const void *src, size_t len); -extern void jcw_memzero_explicit(void *s, size_t count); -extern int jcw_printk(const char *fmt, ...); -extern void *jcw_kzalloc(size_t size); -extern void *jcw_kvzalloc(unsigned int len); -extern void *jcw_kvzalloc_align(unsigned char *ptr, unsigned int len); -extern void jcw_zfree(void *ptr, unsigned int len); -extern void jcw_kvzfree(void *ptr, unsigned int len); -extern int jcw_fips_enabled(void); -extern u64 jcw_ktime_get_ns(void); -extern unsigned long jcw_random_get_entropy(void); -extern inline void jcw_pr_info(const char *fmt, ...); -extern inline void jcw_pr_err(const char *fmt, ...); -extern inline bool jcw_is_err_or_null(void *ptr); -extern size_t jcw_strlen(const char *str); -int jcw_set_memory_uc(unsigned char *addr, int numpages); - -bool is_jent_mem_access_method_random(void); - -#endif diff --git a/SPECS/91/linux/kernel-macros/0002-linux-Makefile-Add-kernel-flavor-info-to-the-generat.patch b/SPECS/91/linux/kernel-macros/0002-linux-Makefile-Add-kernel-flavor-info-to-the-generat.patch deleted file mode 100644 index ba1113e855..0000000000 --- a/SPECS/91/linux/kernel-macros/0002-linux-Makefile-Add-kernel-flavor-info-to-the-generat.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 69563d90e2f51ccffef2067ece678cde782146ad Mon Sep 17 00:00:00 2001 -From: "Srivatsa S. Bhat (VMware)" -Date: Fri, 31 Mar 2023 13:56:48 -0700 -Subject: [PATCH] linux, Makefile: Add kernel flavor info to the generated - version.h file - -Add "PHOTON_KERNEL_FLAVOR_GENERIC" macro definition to the generated file -include/generated/uapi/linux/version.h to identify Photon's linux -(generic) kernel flavor. - -Signed-off-by: Srivatsa S. Bhat (VMware) ---- - Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index fa5f08d5e76d..5a5a5393e08c 100644 ---- a/Makefile -+++ b/Makefile -@@ -1260,7 +1260,7 @@ define filechk_version.h - echo '#define PHOTON_KERNEL'; \ - echo '#define PHOTON_KERNEL_RELEASE \ - $(shell echo -n "$(KERNELRELEASE)" | cut -d'-' -f2 | cut -d'.' -f1)'; \ -- echo '#define PHOTON_KERNEL_FLAVOR_' -+ echo '#define PHOTON_KERNEL_FLAVOR_GENERIC' - endef - - $(version_h): private PATCHLEVEL := $(or $(PATCHLEVEL), 0) --- -2.35.6 - diff --git a/SPECS/91/linux/kernel-macros/0002-linux-esx-Makefile-Add-kernel-flavor-info-to-the-gen.patch b/SPECS/91/linux/kernel-macros/0002-linux-esx-Makefile-Add-kernel-flavor-info-to-the-gen.patch deleted file mode 100644 index b82e800101..0000000000 --- a/SPECS/91/linux/kernel-macros/0002-linux-esx-Makefile-Add-kernel-flavor-info-to-the-gen.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 13476d4c2222b853184d230bb43cef143ba03d29 Mon Sep 17 00:00:00 2001 -From: "Srivatsa S. Bhat (VMware)" -Date: Wed, 6 Nov 2024 10:22:41 +0000 -Subject: [PATCH 2/2] linux-esx, Makefile: Add kernel flavor info to the - generated version.h file - -Add "PHOTON_KERNEL_FLAVOR_ESX" macro definition to the generated file -include/generated/uapi/linux/version.h to identify Photon's linux-esx -kernel flavor. - -Signed-off-by: Srivatsa S. Bhat (VMware) ---- - Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index 9893280cf..f859c155f 100644 ---- a/Makefile -+++ b/Makefile -@@ -1270,7 +1270,7 @@ define filechk_version.h - echo '#define PHOTON_KERNEL'; \ - echo '#define PHOTON_KERNEL_RELEASE \ - $(shell echo -n "$(KERNELRELEASE)" | cut -d'-' -f2 | cut -d'.' -f1)'; \ -- echo '#define PHOTON_KERNEL_FLAVOR_' -+ echo '#define PHOTON_KERNEL_FLAVOR_ESX' - endef - - $(version_h): private PATCHLEVEL := $(or $(PATCHLEVEL), 0) --- -2.39.4 - diff --git a/SPECS/91/linux/kernel_cve_patches.inc b/SPECS/91/linux/kernel_cve_patches.inc deleted file mode 100644 index 86a74d8fa6..0000000000 --- a/SPECS/91/linux/kernel_cve_patches.inc +++ /dev/null @@ -1,106 +0,0 @@ -# CVE patches shared across all Linux kernel flavours -# Patch range reserved: 3000–3999 -# DO NOT add non-CVE patches to this file. - -# Fix CVE-2017-1000252 -Patch3000: KVM-Don-t-accept-obviously-wrong-gsi-values-via-KVM_.patch - -# Fix CVE-2026-43083 -Patch3001: 0001-net-ioam6-fix-OOB-and-missing-lock.patch - -# Fix CVE-2025-68359 -Patch3002: 0001-btrfs-fix-double-free-of-qgroup-record-after-failure.patch - -# Fix CVE-2026-43101 -Patch3004: 0002-ipv6-ioam-fix-potential-NULL-dereferences-in-__ioam6.patch -# Fixes CVE-2026-31589, CVE-2026-43414, CVE-2026-43465, CVE-2026-53224, CVE-2026-53246, CVE-2026-53260 -Patch3005: 0001-mm-call-free_folio-directly-in-folio_.patch -Patch3006: 0001-net-mlx5e-RX-Fix-XDP-multi-buf-frag-c.patch -Patch3007: 0001-scsi-qla2xxx-Completely-fix-fcport-do.patch -Patch3008: 0001-sctp-validate-cached-peer-INIT-chunk-length-in-COOKI.patch -Patch3010: 0002-sctp-validate-embedded-INIT-chunk-and.patch -Patch3011: 0003-sctp-add-INIT-verification-after-cookie-unpacking.patch -# Fixes CVE-2025-40074, CVE-2025-68353, CVE-2026-23208, CVE-2026-43009, CVE-2026-43485 -Patch3014: 0001-ALSA-usb-audio-Prevent-excessive-number-of-frames.patch -Patch3015: 0001-bpf-Fix-incorrect-pruning-due-to-atomic-fetch-precis.patch -Patch3017: 0001-net-vxlan-prevent-NULL-deref-in-vxlan_xmit_one.patch -Patch3018: 0001-nouveau-gsp-drop-WARN_ON-in-ACPI-probes.patch -Patch3019: 0002-ALSA-usb-audio-Use-the-right-limit-for-PCM-OOB-check.patch -# Fixes CVE-2025-40158, CVE-2025-68745, CVE-2026-63872, CVE-2026-64076, CVE-2026-64077 -Patch3020: 0001-esp-fix-page-frag-reference-leak-on-skb_to_sgvec-failure.patch -Patch3021: 0001-ipv6-use-RCU-in-ip6_output.patch -Patch3022: 0001-netfilter-bridge-eb_tables-close-module-init-race.patch -Patch3023: 0001-netfilter-ebtables-move-to-two-stage-removal-scheme.patch -Patch3024: 0001-scsi-qla2xxx-Clear-cmds-after-chip-reset.patch -# Fixes CVE-2026-52988, CVE-2026-52991, CVE-2026-53089, CVE-2026-53091 -Patch3026: 0001-cgroup-psi-Set-of-priv-to-NULL-upon-file-release.patch -Patch3027: 0001-rculist-add-list_splice_rcu-for-private-lists.patch -Patch3028: 0002-netfilter-nf_tables-join-hook-list-via-splice_list_r.patch -Patch3029: 0002-sched-psi-fix-race-between-file-release-and-pressure.patch -Patch3030: 0001-net_sched-make-room-for-struct-qdisc_skb_cb-pkt_segs.patch -Patch3031: 0002-net-init-shinfo-gso_segs-from-qdisc_pkt_len_init.patch -Patch3032: 0003-net_sched-initialize-qdisc_skb_cb-skb-pkt_segs-in-qd.patch -Patch3033: 0004-net-use-qdisc_pkt_len_segs_init-in-sch_handle_ingres.patch -Patch3034: 0005-net-dropreason-add-SKB_DROP_REASON_RECURSION_LIMIT.patch -Patch3035: 0006-net-plumb-drop-reasons-to-__dev_queue_xmit.patch -Patch3036: 0007-net-qdisc_pkt_len_segs_init-cleanup.patch -Patch3037: 0008-net-pull-headers-in-qdisc_pkt_len_segs_init.patch -Patch3038: 0009-xfrm-Do-not-clobber-inner-headers-when-already-set.patch -# Fixes CVE-2026-63979, CVE-2026-64024, CVE-2026-64066, CVE-2026-64067, CVE-2026-64068 -Patch3039: 0001-net-handshake-hand-off-the-pinned-file-reference-to-.patch -Patch3040: 0001-netfs-Fix-missing-barriers-when-accessing-stream-sub.patch -Patch3041: 0001-netfs-Fix-missing-locking-around-retry-adding-new-su.patch -Patch3042: 0001-netfs-Fix-netfs_read_to_pagecache-to-pause-on-subreq.patch -Patch3043: 0001-tcp-fix-stale-per-CPU-tcp_tw_isn-leak-enabling-ISN-p.patch -# Fixes CVE-2026-72288, CVE-2026-72355 -Patch3045: 0001-KVM-arm64-vgic-Handle-race-between-interrupt-affini.patch -Patch3046: 0001-netfs-Fix-barriering-when-walking-subrequest-list.patch -# Fixes CVE-2026-72413, CVE-2026-72423 -Patch3047: 0001-bpf-Guard-conntrack-opts-error-writes.patch -# Fixes CVE-2026-72366, CVE-2026-72463, CVE-2026-72493, CVE-2026-74268, CVE-2026-74269 -Patch3049: 0001-bnxt-fix-head-underflow-on-XDP-head-grow.patch -Patch3050: 0001-net-serialize-netif_running-check-in-enqueue_to_backlog.patch -Patch3051: 0001-netfs-Fix-netfs_create_write_req-to-handle-async-cac.patch -Patch3053: 0001-xfrm-Fix-dev-use-after-free-in-xfrm-async-resumption.patch -# Fixes CVE-2026-64160 -Patch3054: 0001-cifs-Fix-handling-of-a-beyond-EOF-DIO-unbuffered-rea.patch -Patch3055: 0002-filemap-Add-folio_next_pos.patch -Patch3056: 0003-netfs-Fix-potential-for-tearing-in-remote_i_size-and.patch -Patch3057: 0004-cifs-Fix-undefined-variables.patch -# Fixes CVE-2026-63853, CVE-2026-63879, CVE-2026-64036, CVE-2026-64058, CVE-2026-64078 -Patch3058: 0001-cgroup-rstat-validate-cpu-before-css_rstat_cpu-acce.patch -Patch3059: 0001-drm-amdgpu-fix-amdgpu_hmm_range_get_pages.patch -Patch3060: 0001-drm-amdgpu-vcn-set-no_user_fence-for-VCN-v4.0-enc-r.patch -Patch3061: 0001-netfilter-x_tables-add-and-use-xt_unregister_table_p.patch -Patch3063: 0002-netfilter-x_tables-add-and-use-xtables_unregister_ta.patch -# Fixes CVE-2026-74571, CVE-2026-80580 -Patch3064: 0001-btrfs-skip-global-block-reserve-accounting-for-res.patch -Patch3065: 0001-fbdev-bound-mode-sysfs-output-to-the-sysfs-buffer.patch -# Fixes CVE-2026-68399, CVE-2026-68404, CVE-2026-68409, CVE-2026-68441, CVE-2026-68447, CVE-2026-74571 -Patch3066: 0001-CVE-2026-68399-bpf-Fix-UAF-in-sock-clone-early-bailo.patch -Patch3067: 0001-CVE-2026-68404-wifi-cfg80211-use-wiphy-work-for-sock.patch -Patch3068: 0001-CVE-2026-68409-wifi-mac80211-defer-link-RX-stats-per.patch -Patch3069: 0001-CVE-2026-68441-net-sched-Handle-TC_ACT_REDIRECT-from.patch -Patch3070: 0001-CVE-2026-68447-drm-amdkfd-clamp-v9-CRIU-control-stac.patch -# Fixes CVE-2026-74605, CVE-2026-74611 -Patch3071: 0001-eventfs-Use-children-field-for-rcu-head-and-add-memo.patch -Patch3072: 0002-tls-rx-restore-msg_iter-before-TLS-1.3-optimistic-re.patch -# Fixes CVE-2026-80785 -Patch3073: 0001-fbdev-Wrap-user-invoked-calls-to-fb_set_var-in-helpe.patch -Patch3074: 0002-fbdev-serialize-mode-sysfs-access-with-lock_fb_info.patch -# Fixes CVE-2026-43464, CVE-2026-45932, CVE-2026-46324, CVE-2026-52956 -Patch3075: 0001-bpf-Fix-tcx-netkit-detach-permissions-when-prog-fd-i.patch -Patch3076: 0001-libceph-Fix-potential-out-of-bounds-access-in-__ceph.patch -Patch3077: 0001-net-mlx5e-RX-Fix-XDP-multi-buf-frag-counting-for-leg.patch -Patch3078: 0001-netfilter-nf_tables-use-list_del_rcu-for-netlink-hoo.patch -# Fixes CVE-2026-64388, CVE-2026-72031, CVE-2026-72341, CVE-2026-72439 -Patch3080: 0001-ata-libata-core-Add-NOLPM-quirk-for-PNY-CS900-1TB-SS.patch -Patch3081: 0001-md-raid10-fix-writes_pending-leak-on-write-request-f.patch -Patch3082: 0001-net-mlx5e-Fix-publication-race-for-priv-channel_stat.patch -Patch3083: 0001-smb-client-fix-chown-chgrp-with-SMB3-POSIX-Extension.patch -# Fixes CVE-2026-68426 -Patch3084: 0001-xfrm-fix-stale-skb-prev-after-async-crypto-steals-a-.patch -# Fixes CVE-2026-46325, CVE-2026-68242, CVE-2026-68258 -Patch3085: 0001-RDMA-rxe-Fix-iova-to-va-conversion-for-MR-page-sizes.patch -Patch3086: 0001-drm-amdkfd-Check-bounds-on-CRIU-restore-queue-type-a.patch -Patch3087: 0001-drm-i915-gt-Fix-NULL-deref-on-sched_engine-alloc-fai.patch diff --git a/SPECS/91/linux/license-esx.txt b/SPECS/91/linux/license-esx.txt deleted file mode 100644 index b26c01de23..0000000000 --- a/SPECS/91/linux/license-esx.txt +++ /dev/null @@ -1 +0,0 @@ -License: (CC0-1.0 OR OpenSSL OR Apache-2.0) AND (GPL-2.0-or-later OR X11) AND (GPL-1.0-or-later OR BSD-3-Clause OR OpenSSL) AND (Artistic-2.0 OR GPL-2.0-only) AND (GPL-2.0-only WITH Linux-syscall-note OR BSD-3-Clause) AND (GPL-2.0-only OR BSD-2-Clause) AND (GPL-2.0-or-later OR MIT) AND (GFDL-1.1-no-invariants-or-later OR GPL-2.0-only) AND (BSD-2-Clause OR GPL-2.0-or-later) AND (BSD-3-Clause OR GPL-1.0-or-later) AND (OpenSSL OR BSD-3-Clause) AND (GPL-2.0-only OR GFDL-1.2-no-invariants-only) AND (GPL-2.0-only OR X11) AND (MIT OR GPL-2.0-only) AND (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (BSD-3-Clause OR GPL-2.0-only) AND (MIT OR GPL-2.0-or-later) AND (GPL-2.0-only OR Linux-OpenIB) AND (GPL-2.0-only WITH Linux-syscall-note OR Linux-OpenIB) AND (BSD-3-Clause OR GPL-2.0-or-later) AND (GPL-1.0-or-later OR MIT) AND (GPL-2.0-only OR GFDL-1.1-no-invariants-only) AND (GPL-2.0-only OR GFDL-1.2-no-invariants-or-later) AND (LGPL-2.1-only OR BSD-2-Clause) AND (GPL-2.0-or-later OR BSD-3-Clause) AND (GPL-2.0-only OR MPL-1.1) AND (LGPL-2.1-only OR MIT) AND (GPL-2.0-or-later WITH Linux-syscall-note OR MIT) AND (GPL-2.0-only OR Linux-OpenIB OR BSD-2-Clause) AND (MPL-1.1 OR GPL-2.0-only) AND (GPL-2.0-only OR MIT) AND (Apache-2.0 OR BSD-2-Clause) AND (MPL-2.0 OR GPL-2.0-only) AND (GPL-2.0-only WITH Linux-syscall-note OR CDDL-1.0) AND (LGPL-2.0-or-later OR BSD-2-Clause) AND (GFDL-1.2-only OR GPL-2.0-only) AND (GPL-2.0-only OR CDDL-1.0) AND (GPL-2.0-only OR GFDL-1.1-no-invariants-or-later) AND (GPL-2.0-only WITH Linux-syscall-note OR BSD-2-Clause) AND (Apache-2.0 OR MIT) AND (GPL-2.0-or-later OR copyleft-next-0.3.1) AND (BSD-3-Clause-acpica OR GPL-2.0-only) AND (GPL-2.0-or-later OR BSD-2-Clause) AND (LGPL-3.0-or-later OR GPL-2.0-or-later) AND (GPL-1.0-only OR GPL-2.0-only) AND (GPL-2.0-only OR GPL-3.0-only) AND (GPL-1.0-or-later OR BSD-3-Clause) AND (GPL-2.0-only OR BSD-3-Clause) AND (GPL-2.0-only OR Apache-2.0) AND (GPL-2.0-or-later OR CC-BY-4.0) AND (OSL-1.1 OR GPL-2.0-only) AND (GPL-2.0-or-later WITH Linux-syscall-note OR BSD-3-Clause) AND NTP-0 AND GPL-2.0-only WITH Linux-syscall-note AND MIT AND GPL-3.0-only AND HPND-sell-variant AND Parity-7.0.0 AND CDDL-1.0 AND X11 AND GPL-2.0-only AND MPL-1.1 AND BSD-4.3TAHOE AND FSFUL AND GFDL-1.2-no-invariants-or-later AND copyleft-next-0.3.1 AND LGPL-2.1-or-later AND GFDL-1.2-only AND Apache-2.0 AND HPND-export-US-modify AND CC0-1.0 AND Unlicense AND GFDL-1.2-no-invariants-only AND MS-LPL AND GFDL-1.2-or-later AND pkgconf AND HPND-export2-US AND BSD-3-Clause-acpica AND GFDL-1.1-or-later AND 0BSD AND LGPL-2.1-only WITH Linux-syscall-note AND GPL-2.0-or-later WITH GCC-exception-2.0 AND LGPL-2.1-or-later WITH Linux-syscall-note AND GPL-1.0-or-later AND NTP AND Unicode-3.0 AND GPL-3.0-or-later WITH Bison-exception-2.2 AND GPL-3.0-or-later AND LGPL-2.1-only AND GPL-1.0-only AND GPL-2.0-or-later WITH mif-exception AND BSD-3-Clause AND BSD-2-Clause AND SSPL-1.0 AND GFDL-1.1-no-invariants-only AND BSD-4-Clause-UC AND GFDL-1.1-only AND BSD-Source-beginning-file AND LGPL-2.0-or-later AND CMU-Mach-nodoc AND GPL-2.0-or-later WITH Linux-syscall-note AND GFDL-1.1-no-invariants-or-later AND OpenSSL AND GPL-1.0-or-later WITH Linux-syscall-note AND HPND-Pbmplus AND CC-BY-3.0 AND GPL-2.0-only WITH mif-exception AND Zlib AND Linux-OpenIB AND LGPL-2.0-only AND BSD-3-Clause-Clear AND LGPL-2.0-or-later WITH Linux-syscall-note AND GPL-2.0-or-later AND ISC AND Linux-man-pages-copyleft AND MPL-1.0 AND CC-BY-4.0 diff --git a/SPECS/91/linux/license.txt b/SPECS/91/linux/license.txt deleted file mode 100644 index efa0236c33..0000000000 --- a/SPECS/91/linux/license.txt +++ /dev/null @@ -1 +0,0 @@ -License: (Apache-2.0 OR BSD-2-Clause) AND (Apache-2.0 OR CC0-1.0 OR OpenSSL) AND (Apache-2.0 OR GPL-2.0-only) AND (Apache-2.0 OR MIT) AND (Artistic-2.0 OR GPL-2.0-only) AND (BSD-2-Clause OR GPL-2.0-only OR Linux-OpenIB) AND (BSD-2-Clause OR GPL-2.0-only WITH Linux-syscall-note) AND (BSD-2-Clause OR GPL-2.0-only) AND (BSD-2-Clause OR GPL-2.0-or-later) AND (BSD-2-Clause OR LGPL-2.0-or-later) AND (BSD-2-Clause OR LGPL-2.1-only) AND (BSD-3-Clause OR GPL-1.0-or-later OR OpenSSL) AND (BSD-3-Clause OR GPL-1.0-or-later) AND (BSD-3-Clause OR GPL-2.0-only WITH Linux-syscall-note) AND (BSD-3-Clause OR GPL-2.0-only) AND (BSD-3-Clause OR GPL-2.0-or-later WITH Linux-syscall-note) AND (BSD-3-Clause OR GPL-2.0-or-later) AND (BSD-3-Clause OR OpenSSL) AND (BSD-3-Clause-acpica OR GPL-2.0-only) AND (CC-BY-4.0 OR GPL-2.0-or-later) AND (CDDL-1.0 OR GPL-2.0-only WITH Linux-syscall-note) AND (CDDL-1.0 OR GPL-2.0-only) AND (GFDL-1.1-no-invariants-only OR GPL-2.0-only) AND (GFDL-1.1-no-invariants-or-later OR GPL-2.0-only) AND (GFDL-1.2-no-invariants-only OR GPL-2.0-only) AND (GFDL-1.2-no-invariants-or-later OR GPL-2.0-only) AND (GFDL-1.2-only OR GPL-2.0-only) AND (GPL-1.0-only OR GPL-2.0-only) AND (GPL-1.0-or-later OR MIT) AND (GPL-2.0-only OR GPL-3.0-only) AND (GPL-2.0-only OR Linux-OpenIB) AND (GPL-2.0-only OR MIT) AND (GPL-2.0-only OR MPL-1.1) AND (GPL-2.0-only OR MPL-2.0) AND (GPL-2.0-only OR OSL-1.1) AND (GPL-2.0-only OR X11) AND (GPL-2.0-only WITH Linux-syscall-note OR Linux-OpenIB) AND (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (GPL-2.0-or-later OR LGPL-3.0-or-later) AND (GPL-2.0-or-later OR MIT) AND (GPL-2.0-or-later OR X11) AND (GPL-2.0-or-later OR copyleft-next-0.3.1) AND (GPL-2.0-or-later WITH Linux-syscall-note OR MIT) AND (LGPL-2.1-only OR MIT) AND 0BSD AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-Clear AND BSD-3-Clause-acpica AND BSD-4-Clause-UC AND BSD-4.3TAHOE AND BSD-Source-Code AND BSD-Source-beginning-file AND CC-BY-3.0 AND CC-BY-4.0 AND CC0-1.0 AND CDDL-1.0 AND CMU-Mach-nodoc AND FSFUL AND GFDL-1.1-no-invariants-only AND GFDL-1.1-no-invariants-or-later AND GFDL-1.1-only AND GFDL-1.1-or-later AND GFDL-1.2-no-invariants-only AND GFDL-1.2-no-invariants-or-later AND GFDL-1.2-only AND GFDL-1.2-or-later AND GFDL-1.3-no-invariants-only AND GPL-1.0-only AND GPL-1.0-or-later AND GPL-1.0-or-later WITH Linux-syscall-note AND GPL-2.0-only AND GPL-2.0-only WITH Linux-syscall-note AND GPL-2.0-only WITH mif-exception AND GPL-2.0-or-later AND GPL-2.0-or-later WITH GCC-exception-2.0 AND GPL-2.0-or-later WITH Linux-syscall-note AND GPL-2.0-or-later WITH mif-exception AND GPL-3.0-only AND GPL-3.0-or-later AND GPL-3.0-or-later WITH Bison-exception-2.2 AND HPND-Pbmplus AND HPND-export-US-modify AND HPND-export2-US AND HPND-sell-variant AND ISC AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.0-or-later WITH Linux-syscall-note AND LGPL-2.1-only AND LGPL-2.1-only WITH Linux-syscall-note AND LGPL-2.1-or-later AND LGPL-2.1-or-later WITH Linux-syscall-note AND Linux-OpenIB AND Linux-man-pages-copyleft AND MIT AND MPL-1.0 AND MPL-1.1 AND MS-LPL AND NTP AND NTP-0 AND OpenSSL AND Parity-7.0.0 AND Unicode-3.0 AND Unlicense AND X11 AND Zlib AND copyleft-next-0.3.1 AND pkgconf diff --git a/SPECS/91/linux/linux-dracut-aarch64.conf b/SPECS/91/linux/linux-dracut-aarch64.conf deleted file mode 100644 index bbfc4bb125..0000000000 --- a/SPECS/91/linux/linux-dracut-aarch64.conf +++ /dev/null @@ -1 +0,0 @@ -add_drivers+=" xen-scsifront xen-blkfront xen-evtchn xen-gntalloc xen-gntdev xen-privcmd xen-pciback xenfs cn dm-mod megaraid_sas nvme nvme-core " diff --git a/SPECS/91/linux/linux-dracut-x86_64.conf b/SPECS/91/linux/linux-dracut-x86_64.conf deleted file mode 100644 index 47be529107..0000000000 --- a/SPECS/91/linux/linux-dracut-x86_64.conf +++ /dev/null @@ -1 +0,0 @@ -add_drivers+=" xen-scsifront xen-blkfront xen-acpi-processor xen-evtchn xen-gntalloc xen-gntdev xen-privcmd xen-pciback xenfs hv_utils hv_vmbus hv_storvsc hv_netvsc hv_sock hv_balloon cn dm-mod megaraid_sas " diff --git a/SPECS/91/linux/linux-esx-dracut.conf b/SPECS/91/linux/linux-esx-dracut.conf deleted file mode 100644 index 9cc37d172c..0000000000 --- a/SPECS/91/linux/linux-esx-dracut.conf +++ /dev/null @@ -1 +0,0 @@ -add_drivers+=" dm-mod " diff --git a/SPECS/91/linux/linux-sbat.csv.in b/SPECS/91/linux/linux-sbat.csv.in deleted file mode 100644 index 0542072b87..0000000000 --- a/SPECS/91/linux/linux-sbat.csv.in +++ /dev/null @@ -1,2 +0,0 @@ -sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md -linux.photon,@@LINUX_PH_GEN@@,VMware Photon OS,@@NAME@@,@@VERSION_RELEASE@@,https://github.com/vmware/photon diff --git a/SPECS/91/linux/photon_km_2025.pem b/SPECS/91/linux/photon_km_2025.pem deleted file mode 100644 index 56f671f6ef..0000000000 --- a/SPECS/91/linux/photon_km_2025.pem +++ /dev/null @@ -1,34 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFzjCCA7agAwIBAgIUVeqaUsBOcPDf8lw1QJnGF5xvIk0wDQYJKoZIhvcNAQEL -BQAwfzELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExEjAQBgNVBAcM -CVBhbG8gQWx0bzEVMBMGA1UECgwMQnJvYWRjb20gSW5jMTAwLgYDVQQDDCdQaG90 -b24gT1MgS2VybmVsIE1vZHVsZSBhbmQgQ1NSIFNpZ25pbmcwHhcNMjUxMDE1MTcy -NjQ2WhcNMzUxMDE2MTcyNjQ2WjB/MQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2Fs -aWZvcm5pYTESMBAGA1UEBwwJUGFsbyBBbHRvMRUwEwYDVQQKDAxCcm9hZGNvbSBJ -bmMxMDAuBgNVBAMMJ1Bob3RvbiBPUyBLZXJuZWwgTW9kdWxlIGFuZCBDU1IgU2ln -bmluZzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANExTyTeAAg7XFoF -9uVWAwVMGJ93gLgg3pC9yGkSD18Gl98KjD4ctBUodV9p4PNx9elvdZP0nVRXPfoj -F+aR/YUssQ482QYoEa0bNzHG2Jrf/tPkCfhccmJbnCrL4iyDjdEhEgVml5vqqQsb -DM0rSjlEabUahTOhvTCq/7/a/pXADU7BQA1d4sKII4ivpqtt7kan4KPLApl6WEw0 -vRBz8BjahGwPo/YefsJApHaaPEGcfjZcE3i0dCu2fp+AIUOqiZj5VkVneAfvN3gx -GWfLqJ1iXJmb04/2osRetIS9M+3xr3R3ddFtMBE3DnAggTqikyekMURyIim4dmo2 -HdxlxI/kuBHnH7G0CiT80+iE/leWQFAQdve3susoBZcbhGI3d0xh4Y9S0c14apD/ -jo9lYi3MuZ71JtzzSmPoItlLoE9jwNIYxVvTnXwS/HG9Vho0al5iy6ESjfr1l6Mc -qK0YMcxTxQhzbWc1/SxNzLIO1gaFIAtMapTgcXGaOlK0y7UL9YLV4wQmV5uH4oQD -tt7A8GBl9Yq72wQbJwnrY88nXh1CYtSRiMNLQpwQwzoKubxYnBht84VPtKt+slFo -ZGF2efdJQ/s7ayKam7Dh94MMB9YTizbURhWut++jiGuuZnD4MrfiKkSAhbnUyQ4Q -cX7emBnR28JszW/nwgW0v/QRzcotAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8w -DgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBQcLP65pZkMcw4wIuLOk9MqoSBKxDAN -BgkqhkiG9w0BAQsFAAOCAgEAtfycCcH7ytNmFV1LsS8KsPLIeNaFZC6hhTEBBLlP -cFJWbveadCfGRbE/m2lUBIgiyLsuA2MY0KOpWhOZ+CrTAu9SAz85oVT9LJk7ICoO -SxBj4NQtkKS7YUwp9tlv2W9csdxWS4Bq3ZW8fb7fpPAccljDbep2SMhVyTtKfAkQ -26OQVaubajrB7Ay26b8goQQaBfpXXsIm6g+4J1ePTRkBDZG9/tR6LyQ9C1EsgkNH -E3sXnM05JK3wj3UTbK4ZLxiLXwviCtbaWVCbiY7ijgyfCXWdrdNZjhLyIUHoW5E6 -MvhTUNMir2+Kl+r/LowMkdu+xreBH3N2Jm7MKREUsxk0SwcKIgYn/4PaoXboCYs0 -b6aLnQnwT3/4k6Coy9gwt7PQND+n10fBJY4yGQZm50JHd2eqdNIB9Mq/2yLgd/GH -JOb6Tx6IJDPehtNgU8F0GyVomn8hMuUock+nh4Zcmldu9ihP3rhAeu/snBbW+FuW -gMYeNHp90Q4W5qPPbNAWnEPEOj8uo7wbF65if5wUGQ5oJcuE7wLeVGO+QhnEE9yU -42nLWNtx3q/kBmuTAa022ynQALwHN19bPBKzfCY0pHACDpzfvipp/OeqbnI1xVzv -xICribAdpQqOmgLLjlf7u0fqIXPW3eX3xDl5dA2lNwG/6352B35zckA8LnSg5TrH -jFk= ------END CERTIFICATE----- diff --git a/SPECS/91/linux/photon_sb2020.pem b/SPECS/91/linux/photon_sb2020.pem deleted file mode 100644 index 90db1ff25c..0000000000 --- a/SPECS/91/linux/photon_sb2020.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDMzCCAhugAwIBAgIQH1TNe1FCU5lM1Zr8dJPmDjANBgkqhkiG9w0BAQsFADBE -MUIwQAYDVQQDDDlWTXdhcmUsIEluYy4sTz1WTXdhcmUsIEluYy4sTD1QYWxvIEFs -dG8sUz1DYWxpZm9ybmlhLEM9VVMwHhcNMjAwNzA4MDE1MzAwWhcNMzAwMTAxMDY1 -OTU5WjBEMUIwQAYDVQQDDDlWTXdhcmUsIEluYy4sTz1WTXdhcmUsIEluYy4sTD1Q -YWxvIEFsdG8sUz1DYWxpZm9ybmlhLEM9VVMwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQCeJMaljf6VWEdFyCZRRvleLvCJKFJd0KrNeuhYb0xQa4i+kD18 -3pB0qa0T7YdaTbxZqmRzjGQqIgDETCxTZCGiCe2PqvgURVPpaQuLsbPXZKTebDBy -JwKK+PKG2QQPLzH7pRoY/3ot6qstsVJKBGD9h+MtN2xi7pnXnz3DQ1HzkcVotTPs -uZC1a5fdECXYivpJqS4FRPy1FOxBKFmGGJZhzGF8+x6r4PuophAhy1qJR4MPfDKn -kZbVc+GeehKDurgNKqs7DnG3erHCVB0n1gurJBHETfhVB4ZnZykoiGJNTcRJ+8uI -grhpfKdmv2sQoMGu8lrt8tFniY/SZNkD0lsXAgMBAAGjITAfMB0GA1UdDgQWBBRf -B57aqnN2Ez8EW5rXKZfd83d4WDANBgkqhkiG9w0BAQsFAAOCAQEAPY2Z7lqMH5Ry -XarxwGdmfNEe5FD3FdHF6JJOfE7eqM8mCdAV1EYnw62kfEf0esvbSSCilVebmEki -UJFdTISLjhxhht/50/IfOktXJb9Pfl8JXRxSOVAUBKBpM6XxjrERcoN3qFCCHeO6 -5hCpOp+flf2af3ZD8yO5GJsqJhbBMLsBso8rmWMJ2rwgjVzWeFUAjoc9VF3aFXwm -FKKjMTOcIqIEldJqa93XRKm9iEXwOWX3rGbUZveyJxDo8D2x/rJgG3zivZMONQ5a -uXo+YWI2uv3HARPoUHsq6HMEUqk6xNkDkMjWTxyqwxTZnjzcPqXzwWnjbFEHk3Sp -tMb0kQlv9g== ------END CERTIFICATE----- diff --git a/SPECS/91/linux/scriptlets.inc b/SPECS/91/linux/scriptlets.inc deleted file mode 100644 index 9e67794e9e..0000000000 --- a/SPECS/91/linux/scriptlets.inc +++ /dev/null @@ -1,54 +0,0 @@ -%define running_kernel_ver $(uname -r) -%define modules_backup_loc /tmp/.%{running_kernel_ver} -%define running_kernel_modules_dir /lib/modules/%{running_kernel_ver} - -# delete dead symlinks and empty dirs at top level only -# if running kernel is re-installed, remove the symlink -%define do_libmodules_housekeeping \ -if [ -d "%{running_kernel_modules_dir}" ]; then \ - find /lib/modules -mindepth 1 -maxdepth 1 -xtype l -delete \ - find /lib/modules -mindepth 1 -maxdepth 1 -type d -empty -delete \ - if [ "%{running_kernel_ver}" = "%{uname_r}" ] && [ -L "%{running_kernel_modules_dir}" ]; then \ - rm -f %{running_kernel_modules_dir} \ - fi \ -fi \ -%{nil} - -%pre -%do_libmodules_housekeeping -if [ "%{running_kernel_ver}" = "%{uname_r}" ]; then - rm -rf %{modules_backup_loc} -fi - -%postun -if [ ! -e /boot/photon.cfg ]; then - list="$(basename "$(ls -1 -tu /boot/linux-*.cfg 2>/dev/null | head -n1)")" - test -n "$list" && ln -sf "$list" /boot/photon.cfg -fi - -if [ ! -s /boot/linux-%{uname_r}.cfg ]; then - rm -f %{_sharedstatedir}/rpm-state/initramfs/pending/%{uname_r} \ - /boot/initrd.img-%{uname_r} - echo "initrd of kernel %{uname_r} removed" >&2 -fi - -if [ -d "%{modules_backup_loc}" ]; then - if [ ! -s /boot/linux-%{running_kernel_ver}.cfg ]; then - - %do_libmodules_housekeeping - - # if running kernel's modules dir doesn't exist - # create a symlink which points to backup dir - if [ ! -d "%{running_kernel_modules_dir}" ]; then - ln -sfn "%{modules_backup_loc}" "%{running_kernel_modules_dir}" - fi - else - rm -rf "%{modules_backup_loc}" - fi -fi - -%filetriggerun -- /lib/modules/ -%do_libmodules_housekeeping -if [ "%{running_kernel_ver}" = "%{uname_r}" ] && [ ! -d "%{modules_backup_loc}" ]; then - cp -pr "%{running_kernel_modules_dir}" "%{modules_backup_loc}" -fi diff --git a/SPECS/91/linux/secure/0001-gcc-rap-plugin-with-kcfi.patch b/SPECS/91/linux/secure/0001-gcc-rap-plugin-with-kcfi.patch deleted file mode 100644 index 01ab792232..0000000000 --- a/SPECS/91/linux/secure/0001-gcc-rap-plugin-with-kcfi.patch +++ /dev/null @@ -1,1895 +0,0 @@ -From 6846b30c4c970a3b4e305283597f25d828b14e97 Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Fri, 26 Jul 2024 10:51:50 +0000 -Subject: [PATCH] gcc rap plugin with kcfi - -This patch adopts the forward-edge control-flow integrity -scheme for Clang known as KCFI in gcc with the help -of RAP plugin. - -The original RAP gcc plugin code developed by PaX team -is modified to adopt to kcfi implementation in kernel. - -Following changes are made to adopt KCFI in GCC RAP plugin: - -- Padding and hash size is changed to match with KCFI -- Function label and size paramter are added - E.g: -0000000000000000 <__cfi_func>: - 0: cc int3 - 1: cc int3 - 2: b8 a7 9e 9e 58 mov $0x589e9ea7,%eax - 7: cc int3 - 8: cc int3 -- weak attribute handling and skip generation of rap hash - for direct calls -- change the runtime comparison injection code of RAP plugin - to use 4 bytes hash comparision instead of 8 bytes -- Add Kconfig changes to enable CFI_CLANG when PAX_RAP is 'y' -- Fix rap_hash injection for bpf_prog_run() to use int instead of - long as the size of rap_hash is 4 bytes now -- KCFI code adds SYM_TYPED_FUNC_START which emits the type identifier - before the assembly functions that are called indirectly from C code. - As the padding and size of cfi_type and rap_hash_type is different, - replaced __CFI_TYPE macro with __RAP_TYPE for adding rap_hash for - callers of SYM_TYPED_FUNC_START when CONFIG_PAX_RAP is enabled. - -Signed-off-by: Keerthana K -Signed-off-by: Mukul Sikka - -[Srinidhi Rao Back ported this patch to v6.12.x] -Signed-off-by: srinidhira0 ---- - Makefile | 2 + - arch/Kconfig | 8 +- - arch/x86/Kconfig | 2 +- - arch/x86/include/asm/text-patching.h | 4 + - arch/x86/include/asm/vermagic.h | 9 +- - arch/x86/kernel/alternative.c | 7 + - arch/x86/kernel/cpu/vmware.c | 9 +- - arch/x86/kernel/module.c | 6 +- - arch/x86/kernel/traps.c | 4 + - include/linux/compiler_types.h | 6 +- - include/linux/moduleparam.h | 4 +- - include/linux/syscalls.h | 17 +- - kernel/bpf/core.c | 21 + - kernel/events/core.c | 3 +- - kernel/module/main.c | 9 + - kernel/sched/core.c | 2 +- - net/bridge/br_private.h | 3 +- - net/netfilter/ipset/ip_set_core.c | 1 - - scripts/Makefile.gcc-plugins | 12 + - scripts/gcc-plugins/Makefile | 6 + - scripts/gcc-plugins/rap_plugin/rap.h | 38 ++ - .../gcc-plugins/rap_plugin/rap_fptr_pass.c | 187 +++++++ - scripts/gcc-plugins/rap_plugin/rap_hash.c | 396 +++++++++++++ - scripts/gcc-plugins/rap_plugin/rap_plugin.c | 573 ++++++++++++++++++ - scripts/gcc-plugins/rap_plugin/sip.c | 96 +++ - scripts/mod/modpost.c | 6 - - security/Kconfig | 29 + - 27 files changed, 1435 insertions(+), 25 deletions(-) - create mode 100644 scripts/gcc-plugins/rap_plugin/rap.h - create mode 100644 scripts/gcc-plugins/rap_plugin/rap_fptr_pass.c - create mode 100644 scripts/gcc-plugins/rap_plugin/rap_hash.c - create mode 100644 scripts/gcc-plugins/rap_plugin/rap_plugin.c - create mode 100644 scripts/gcc-plugins/rap_plugin/sip.c - -diff --git a/Makefile b/Makefile -index 9210e46bf..2fd2253d8 100644 ---- a/Makefile -+++ b/Makefile -@@ -965,6 +965,7 @@ export CC_FLAGS_LTO - endif - - ifdef CONFIG_CFI_CLANG -+ifdef CONFIG_KCFI_CLANG - CC_FLAGS_CFI := -fsanitize=kcfi - ifdef CONFIG_CFI_ICALL_NORMALIZE_INTEGERS - CC_FLAGS_CFI += -fsanitize-cfi-icall-experimental-normalize-integers -@@ -979,6 +980,7 @@ endif - KBUILD_CFLAGS += $(CC_FLAGS_CFI) - export CC_FLAGS_CFI - endif -+endif - - # Architectures can define flags to add/remove for floating-point support - CC_FLAGS_FPU += -D_LINUX_FPU_COMPILATION_UNIT -diff --git a/arch/Kconfig b/arch/Kconfig -index c60ce8b56..3e3f3d274 100644 ---- a/arch/Kconfig -+++ b/arch/Kconfig -@@ -821,10 +821,16 @@ config ARCH_SUPPORTS_CFI_CLANG - config ARCH_USES_CFI_TRAPS - bool - -+config KCFI_CLANG -+ bool "Use Clang's Kernel Control Flow Integrity (KCFI)" -+ depends on $(cc-option,-fsanitize=kcfi) -+ help -+ This option is Clang's Kernel Control Flow Integrity checking -+ - config CFI_CLANG - bool "Use Clang's Control Flow Integrity (CFI)" - depends on ARCH_SUPPORTS_CFI_CLANG -- depends on $(cc-option,-fsanitize=kcfi) -+ depends on GCC_PLUGINS || KCFI_CLANG - help - This option enables Clang's forward-edge Control Flow Integrity - (CFI) checking, where the compiler injects a runtime check to each -diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index bbd604b5b..5adc8a44e 100644 ---- a/arch/x86/Kconfig -+++ b/arch/x86/Kconfig -@@ -2479,7 +2479,7 @@ config CALL_PADDING - - config FINEIBT - def_bool y -- depends on X86_KERNEL_IBT && CFI_CLANG && MITIGATION_RETPOLINE -+ depends on X86_KERNEL_IBT && KCFI_CLANG && MITIGATION_RETPOLINE - select CALL_PADDING - - config HAVE_CALL_THUNKS -diff --git a/arch/x86/include/asm/text-patching.h b/arch/x86/include/asm/text-patching.h -index bb3fd7f2c..61c4d6f63 100644 ---- a/arch/x86/include/asm/text-patching.h -+++ b/arch/x86/include/asm/text-patching.h -@@ -43,6 +43,10 @@ extern void text_poke_bp(void *addr, const void *opcode, size_t len, const void - extern void text_poke_queue(void *addr, const void *opcode, size_t len, const void *emulate); - extern void text_poke_finish(void); - -+#ifdef CONFIG_PAX_RAP -+extern void *memcpy_alt(void *addr, const void *opcode, size_t len); -+#endif -+ - #define INT3_INSN_SIZE 1 - #define INT3_INSN_OPCODE 0xCC - -diff --git a/arch/x86/include/asm/vermagic.h b/arch/x86/include/asm/vermagic.h -index 75884d2cd..266f5ce89 100644 ---- a/arch/x86/include/asm/vermagic.h -+++ b/arch/x86/include/asm/vermagic.h -@@ -5,6 +5,7 @@ - - #ifdef CONFIG_X86_64 - /* X86_64 does not define MODULE_PROC_FAMILY */ -+#define MODULE_PROC_FAMILY "" - #elif defined CONFIG_M486SX - #define MODULE_PROC_FAMILY "486SX " - #elif defined CONFIG_M486 -@@ -59,10 +60,12 @@ - #error unknown processor family - #endif - --#ifdef CONFIG_X86_32 --# define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY -+#ifdef CONFIG_PAX_RAP -+#define MODULE_PAX_RAP "RAP " - #else --# define MODULE_ARCH_VERMAGIC "" -+#define MODULE_PAX_RAP "" - #endif - -+#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_PAX_RAP -+ - #endif /* _ASM_VERMAGIC_H */ -diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c -index a05503983..0b6daa937 100644 ---- a/arch/x86/kernel/alternative.c -+++ b/arch/x86/kernel/alternative.c -@@ -2212,6 +2212,13 @@ void *text_poke(void *addr, const void *opcode, size_t len) - return __text_poke(text_poke_memcpy, addr, opcode, len); - } - -+#ifdef CONFIG_PAX_RAP -+void *memcpy_alt(void *addr, const void *opcode, size_t len) -+{ -+ return memcpy(addr, opcode, len); -+} -+#endif -+ - /** - * text_poke_kgdb - Update instructions on a live kernel by kgdb - * @addr: address to modify -diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c -index c7f6500d3..e61b2e19b 100644 ---- a/arch/x86/kernel/cpu/vmware.c -+++ b/arch/x86/kernel/cpu/vmware.c -@@ -384,10 +384,17 @@ static __init int activate_jump_labels(void) - } - arch_initcall(activate_jump_labels); - -+/* -+ * No need for any "IO delay" on VMware hypervisor -+ */ -+static void vmware_io_delay(void) -+{ -+} -+ - static void __init vmware_paravirt_ops_setup(void) - { - pv_info.name = "VMware hypervisor"; -- pv_ops.cpu.io_delay = paravirt_nop; -+ pv_ops.cpu.io_delay = vmware_io_delay; - - if (vmware_tsc_khz == 0) - return; -diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c -index 1e231dac6..7c9b2e043 100644 ---- a/arch/x86/kernel/module.c -+++ b/arch/x86/kernel/module.c -@@ -180,7 +180,11 @@ static int write_relocate_add(Elf64_Shdr *sechdrs, - { - int ret; - bool early = me->state == MODULE_STATE_UNFORMED; -- void *(*write)(void *, const void *, size_t) = memcpy; -+#ifdef CONFIG_PAX_RAP -+ void *(*write)(void *, const void *, size_t) = memcpy_alt; -+#else -+ void *(*write)(void *, const void *, size_t) = memcpy; -+#endif - - if (!early) { - write = text_poke; -diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c -index 243f3bc9b..14f4c7518 100644 ---- a/arch/x86/kernel/traps.c -+++ b/arch/x86/kernel/traps.c -@@ -178,6 +178,10 @@ do_trap_no_signal(struct task_struct *tsk, int trapnr, const char *str, - - tsk->thread.error_code = error_code; - tsk->thread.trap_nr = trapnr; -+#ifdef CONFIG_PAX_RAP -+ if (trapnr == X86_TRAP_UD) -+ str = "PAX: overwritten function pointer or return address detected"; -+#endif - die(str, regs, error_code); - } else { - if (fixup_vdso_exception(regs, trapnr, error_code, 0)) -diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h -index b624f3e87..c79edb3d8 100644 ---- a/include/linux/compiler_types.h -+++ b/include/linux/compiler_types.h -@@ -101,7 +101,7 @@ static inline void __chk_io_ptr(const volatile void __iomem *ptr) { } - /* Attributes */ - #include - --#if CONFIG_FUNCTION_ALIGNMENT > 0 -+#if !defined(CONFIG_PAX_RAP) && (CONFIG_FUNCTION_ALIGNMENT > 0) - #define __function_aligned __aligned(CONFIG_FUNCTION_ALIGNMENT) - #else - #define __function_aligned -@@ -519,6 +519,10 @@ struct ftrace_likely_data { - __scalar_type_to_expr_cases(long long), \ - default: (x))) - -+#define __type_is_unsigned(t) \ -+ (__same_type((t)0, 0UL) || __same_type((t)0, 0U) || \ -+ __same_type((t)0, (unsigned short)0) || __same_type((t)0, (unsigned char)0)) -+ - /* Is this type a native word size -- useful for atomic operations */ - #define __native_word(t) \ - (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \ -diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h -index 4c0b436f2..24f025c3d 100644 ---- a/include/linux/moduleparam.h -+++ b/include/linux/moduleparam.h -@@ -357,7 +357,7 @@ static inline void kernel_param_unlock(struct module *mod) - * @len is usually just sizeof(string). - */ - #define module_param_string(name, string, len, perm) \ -- static const struct kparam_string __param_string_##name \ -+ static const struct kparam_string __param_string_##name __used \ - = { len, string }; \ - __module_param_call(MODULE_PARAM_PREFIX, name, \ - ¶m_ops_string, \ -@@ -511,7 +511,7 @@ extern int param_set_bint(const char *val, const struct kernel_param *kp); - */ - #define module_param_array_named(name, array, type, nump, perm) \ - param_check_##type(name, &(array)[0]); \ -- static const struct kparam_array __param_arr_##name \ -+ static const struct kparam_array __param_arr_##name __used \ - = { .max = ARRAY_SIZE(array), .num = nump, \ - .ops = ¶m_ops_##type, \ - .elemsize = sizeof(array[0]), .elem = array }; \ -diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h -index d300a009f..a8f32fede 100644 ---- a/include/linux/syscalls.h -+++ b/include/linux/syscalls.h -@@ -127,8 +127,14 @@ struct mnt_id_req; - #define __TYPE_IS_UL(t) (__TYPE_AS(t, 0UL)) - #define __TYPE_IS_LL(t) (__TYPE_AS(t, 0LL) || __TYPE_AS(t, 0ULL)) - #define __SC_LONG(t, a) __typeof(__builtin_choose_expr(__TYPE_IS_LL(t), 0LL, 0L)) a -+#define __SC_TYPE(t, a) __typeof__( \ -+ __builtin_choose_expr( \ -+ sizeof(t) > sizeof(int), \ -+ (t) 0, \ -+ __builtin_choose_expr(__type_is_unsigned(t), 0UL, 0L) \ -+ )) -+#define __SC_WRAP(t, a) (__SC_TYPE(t, a)) a - #define __SC_CAST(t, a) (__force t) a --#define __SC_TYPE(t, a) t - #define __SC_ARGS(t, a) a - #define __SC_TEST(t, a) (void)BUILD_BUG_ON_ZERO(!__TYPE_IS_LL(t) && sizeof(t) > sizeof(long)) - -@@ -249,18 +255,19 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event) - "Avoid breaking versions without -Wattribute-alias");\ - __diag_ignore(clang, 23, "-Wattribute-alias", \ - "Type aliasing is used to sanitize syscall arguments");\ -- asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ -- __attribute__((alias(__stringify(__se_sys##name)))); \ - ALLOW_ERROR_INJECTION(sys##name, ERRNO); \ - static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\ -- asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \ -- asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ -+ static inline asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ - { \ - long ret = __do_sys##name(__MAP(x,__SC_CAST,__VA_ARGS__));\ - __MAP(x,__SC_TEST,__VA_ARGS__); \ - __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \ - return ret; \ - } \ -+ asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ -+ { \ -+ return __se_sys##name(__MAP(x,__SC_WRAP,__VA_ARGS__)); \ -+ } \ - __diag_pop(); \ - static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) - #endif /* __SYSCALL_DEFINEx */ -diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c -index 6bc3dc998..2bcfef374 100644 ---- a/kernel/bpf/core.c -+++ b/kernel/bpf/core.c -@@ -1182,6 +1182,10 @@ void bpf_jit_binary_free(struct bpf_binary_header *hdr) - bpf_jit_uncharge_modmem(size); - } - -+#ifdef CONFIG_PAX_RAP -+extern long __rap_hash___bpf_prog_run; -+#endif -+ - /* Allocate jit binary from bpf_prog_pack allocator. - * Since the allocated memory is RO+X, the JIT engine cannot write directly - * to the memory. To solve this problem, a RW buffer is also allocated at -@@ -1200,6 +1204,10 @@ bpf_jit_binary_pack_alloc(unsigned int proglen, u8 **image_ptr, - { - struct bpf_binary_header *ro_header; - u32 size, hole, start; -+ u32 padding_bytes = 0; -+#ifdef CONFIG_CALL_PADDING -+ padding_bytes += CONFIG_FUNCTION_PADDING_BYTES; -+#endif - - WARN_ON_ONCE(!is_power_of_2(alignment) || - alignment > BPF_IMAGE_ALIGNMENT); -@@ -1228,10 +1236,23 @@ bpf_jit_binary_pack_alloc(unsigned int proglen, u8 **image_ptr, - - hole = min_t(unsigned int, size - (proglen + sizeof(*ro_header)), - BPF_PROG_CHUNK_SIZE - sizeof(*ro_header)); -+#ifdef CONFIG_PAX_RAP -+ hole -= (4 + padding_bytes); -+#endif - start = get_random_u32_below(hole) & ~(alignment - 1); - -+#ifdef CONFIG_PAX_RAP -+ start += (4 + padding_bytes); -+#endif - *image_ptr = &ro_header->image[start]; - *rw_image = &(*rw_header)->image[start]; -+#ifdef CONFIG_PAX_RAP -+#ifdef CONFIG_RELOCATABLE -+ *(int *)(*rw_image - (4 + padding_bytes)) = 0x456bce13; -+#else -+ *(int *)(*rw_image - (4 + padding_bytes)) = (int)&__rap_hash___bpf_prog_run; -+#endif -+#endif - - return ro_header; - } -diff --git a/kernel/events/core.c b/kernel/events/core.c -index da77f856e..543744b7e 100644 ---- a/kernel/events/core.c -+++ b/kernel/events/core.c -@@ -1169,8 +1169,9 @@ static void __perf_mux_hrtimer_init(struct perf_cpu_pmu_context *cpc, int cpu) - timer->function = perf_mux_hrtimer_handler; - } - --static int perf_mux_hrtimer_restart(struct perf_cpu_pmu_context *cpc) -+static int perf_mux_hrtimer_restart(void *_cpc) - { -+ struct perf_cpu_pmu_context *cpc = _cpc; - struct hrtimer *timer = &cpc->hrtimer; - unsigned long flags; - -diff --git a/kernel/module/main.c b/kernel/module/main.c -index ad58c44fb..58ee35380 100644 ---- a/kernel/module/main.c -+++ b/kernel/module/main.c -@@ -2103,8 +2103,17 @@ static void module_augment_kernel_taints(struct module *mod, struct load_info *i - static int check_modinfo(struct module *mod, struct load_info *info, int flags) - { - const char *modmagic = get_modinfo(info, "vermagic"); -+#ifdef CONFIG_PAX_RAP -+ const char *license = get_modinfo(info, "license"); -+#endif - int err; - -+#if defined(CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_OR) || defined(CONFIG_PAX_RAP) -+ if (!license || !license_is_gpl_compatible(license)) { -+ pr_err("%s: module is not compatible with the KERNEXEC 'or' method and RAP\n", mod->name); -+ return -ENOEXEC; -+ } -+#endif - if (flags & MODULE_INIT_IGNORE_VERMAGIC) - modmagic = NULL; - -diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index ea106403a..d5ac2115b 100644 ---- a/kernel/sched/core.c -+++ b/kernel/sched/core.c -@@ -4990,7 +4990,7 @@ static void do_balance_callbacks(struct rq *rq, struct balance_callback *head) - lockdep_assert_rq_held(rq); - - while (head) { -- func = (void (*)(struct rq *))head->func; -+ func = head->func; - next = head->next; - head->next = NULL; - head = next; -diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h -index b2e4e2d04..00956eb4f 100644 ---- a/net/bridge/br_private.h -+++ b/net/bridge/br_private.h -@@ -931,7 +931,8 @@ void br_del_frame(struct net_bridge *br, struct br_frame_type *ft); - - static inline bool br_rx_handler_check_rcu(const struct net_device *dev) - { -- return rcu_dereference(dev->rx_handler) == br_get_rx_handler(dev); -+ //return rcu_dereference(dev->rx_handler) == br_get_rx_handler(dev); -+ return br_get_rx_handler(dev) == rcu_dereference(dev->rx_handler); - } - - static inline bool br_rx_handler_check_rtnl(const struct net_device *dev) -diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c -index f51a1af31..f936b4a00 100644 ---- a/net/netfilter/ipset/ip_set_core.c -+++ b/net/netfilter/ipset/ip_set_core.c -@@ -397,7 +397,6 @@ ip_set_comment_free(struct ip_set *set, void *ptr) - kfree_rcu(c, rcu); - } - --typedef void (*destroyer)(struct ip_set *, void *); - /* ipset data extension types, in size order */ - - const struct ip_set_ext_type ip_set_extensions[] = { -diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins -index e4deaf5fa..7acd78f9d 100644 ---- a/scripts/Makefile.gcc-plugins -+++ b/scripts/Makefile.gcc-plugins -@@ -22,6 +22,14 @@ export DISABLE_STRUCTLEAK_PLUGIN - gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) \ - += -DSTRUCTLEAK_PLUGIN - -+gcc-plugin-$(CONFIG_PAX_RAP) += rap_plugin.so -+gcc-plugin-cflags-$(CONFIG_PAX_RAP) += -DRAP_PLUGIN -fplugin-arg-rap_plugin-check=call -fplugin-arg-rap_plugin-hash=abs-finish -+# gcc-plugin-cflags-$(CONFIG_PAX_RAP) += -fplugin-arg-rap_plugin-report=func,fptr,abs -+ifdef CONFIG_PAX_RAP -+ RAP_PLUGIN_ABS_CFLAGS := -fplugin-arg-rap_plugin-hash=abs-finish -+endif -+gcc-plugin-aflags-$(CONFIG_PAX_RAP) += -DRAP_PLUGIN -+ - gcc-plugin-$(CONFIG_GCC_PLUGIN_STACKLEAK) += stackleak_plugin.so - gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STACKLEAK) \ - += -DSTACKLEAK_PLUGIN -@@ -47,8 +55,12 @@ export DISABLE_ARM_SSP_PER_TASK_PLUGIN - GCC_PLUGINS_CFLAGS := $(strip $(addprefix -fplugin=$(objtree)/scripts/gcc-plugins/, $(gcc-plugin-y)) $(gcc-plugin-cflags-y)) - export GCC_PLUGINS_CFLAGS - -+GCC_PLUGINS_AFLAGS := $(gcc-plugin-aflags-y) -+export RAP_PLUGIN_ABS_CFLAGS GCC_PLUGINS_AFLAGS -+ - # Add the flags to the build! - KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS) -+KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS) - - # Some plugins are enabled outside of this Makefile, but they still need to - # be included in GCC_PLUGIN so they can get built. -diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile -index 320afd3cf..668d130f3 100644 ---- a/scripts/gcc-plugins/Makefile -+++ b/scripts/gcc-plugins/Makefile -@@ -33,6 +33,12 @@ plugin_cxxflags = -Wp,-MMD,$(depfile) $(KBUILD_HOSTCXXFLAGS) -fPIC \ - -fno-rtti -fno-exceptions -fasynchronous-unwind-tables \ - -ggdb -Wno-narrowing -Wno-unused-variable \ - -Wno-format-diag -+ifdef CONFIG_CALL_PADDING -+plugin_cxxflags += -DCONFIG_FUNCTION_PADDING_BYTES='$(CONFIG_FUNCTION_PADDING_BYTES)' -+endif -+ -+rap_plugin-objs := $(patsubst $(srctree)/$(src)/rap_plugin/%.c,rap_plugin/%.o,$(wildcard $(srctree)/$(src)/rap_plugin/*.c)) -+ - - plugin_ldflags = -shared - -diff --git a/scripts/gcc-plugins/rap_plugin/rap.h b/scripts/gcc-plugins/rap_plugin/rap.h -new file mode 100644 -index 000000000..0e2c26301 ---- /dev/null -+++ b/scripts/gcc-plugins/rap_plugin/rap.h -@@ -0,0 +1,38 @@ -+#ifndef RAP_H_INCLUDED -+#define RAP_H_INCLUDED -+ -+#include "gcc-common.h" -+ -+#define RAP_HASH_START_PADDING_SIZE 1 -+#define RAP_HASH_END_PADDING_SIZE 2 -+typedef struct { -+ int hash; // will be sign extended to long in reality -+} rap_hash_t; -+ -+typedef struct { -+ unsigned int qual_const:1; -+ unsigned int qual_volatile:1; -+} rap_hash_flags_t; -+extern rap_hash_flags_t imprecise_rap_hash_flags; -+ -+extern bool report_fptr_hash; -+ -+extern GTY(()) tree rap_hash_type_node; -+ -+void siphash24fold(unsigned char *out, const unsigned char *in, unsigned long long inlen, const unsigned char *k); -+void rap_calculate_func_hashes(void *event_data, void *data); -+rap_hash_t rap_hash_function_type(const_tree fntype, rap_hash_flags_t flags); -+rap_hash_t rap_hash_function_decl(const_tree fndecl, rap_hash_flags_t flags); -+rap_hash_t rap_hash_function_node_imprecise(cgraph_node_ptr node); -+const_tree type_name(const_tree type); -+tree create_new_var(tree type, const char *name); -+ -+gimple barrier(tree var, bool full); -+ -+#if BUILDING_GCC_VERSION >= 4009 -+opt_pass *make_rap_fptr_pass(void); -+#else -+struct opt_pass *make_rap_fptr_pass(void); -+#endif -+ -+#endif -diff --git a/scripts/gcc-plugins/rap_plugin/rap_fptr_pass.c b/scripts/gcc-plugins/rap_plugin/rap_fptr_pass.c -new file mode 100644 -index 000000000..f8124b597 ---- /dev/null -+++ b/scripts/gcc-plugins/rap_plugin/rap_fptr_pass.c -@@ -0,0 +1,187 @@ -+/* -+ * Copyright 2012-2016 by PaX Team -+ * Licensed under the GPL v2 -+ * -+ * Homepage: http://pax.grsecurity.net/ -+ */ -+ -+#include "rap.h" -+ -+bool report_fptr_hash; -+ -+static bool rap_fptr_gate(void) -+{ -+#ifdef TARGET_64BIT -+ tree section; -+ -+ if (!TARGET_64BIT || ix86_cmodel != CM_KERNEL) -+ return true; -+ -+ section = lookup_attribute("section", DECL_ATTRIBUTES(current_function_decl)); -+ if (!section || !TREE_VALUE(section)) -+ return true; -+ -+ section = TREE_VALUE(TREE_VALUE(section)); -+ return strncmp(TREE_STRING_POINTER(section), ".vsyscall_", 10); -+#else -+#error unsupported target -+#endif -+} -+ -+// check the function hash of the target of the fptr, emitted as inline asm -+// (a GIMPLE tree comparison leaves codegen free to lower it however it -+// likes, which is how the previous version ended up with extra -+// sign-extension-correction instructions) so it always matches the exact -+// instruction encoding KCFI's compiler-generated caller check uses (see -+// decode_caller_hash() in arch/x86/kernel/alternative.c), making this call -+// site recognizable/rewritable by the same kernel code that already -+// handles Clang's kcfi/FineIBT callers: -+// -+// movl $-hash, %r10d ; 41 ba <4 bytes> (decode_caller_hash() match) -+// addl -rap_hash_offset(%fptr), %r10d -+// je 1f -+// ud2 -+// 1: -+static basic_block rap_instrument_fptr(gimple_stmt_iterator *gsi) -+{ -+ gimple asm_stmt, call_stmt; -+ location_t loc; -+ tree fptr, fntype, input, clobber; -+ rap_hash_t hash; -+ char *tmpl; -+ vec *inputs = NULL; -+ vec *clobbers = NULL; -+ basic_block bb; -+ edge e; -+ const HOST_WIDE_INT rap_hash_offset = sizeof(rap_hash_t) + CONFIG_FUNCTION_PADDING_BYTES; -+ -+ call_stmt = gsi_stmt(*gsi); -+ loc = gimple_location(call_stmt); -+ fptr = gimple_call_fn(call_stmt); -+ fntype = TREE_TYPE(TREE_TYPE(fptr)); -+ -+ if (TREE_CODE(fntype) != FUNCTION_TYPE) { -+ debug_tree(fntype); -+ gcc_unreachable(); -+ } -+ -+ hash = rap_hash_function_type(fntype, imprecise_rap_hash_flags); -+ if (report_fptr_hash) -+ inform(loc, "fptr rap_hash: %x", hash.hash); -+ -+ gcc_assert(asprintf(&tmpl, -+ "movl $%d, %%%%r10d\n\t" -+ "addl -%lld(%%0), %%%%r10d\n\t" -+ "je 1f\n\t" -+ "ud2\n" -+ "1:", -+ -(int)hash.hash, (long long)rap_hash_offset) != -1); -+ -+ input = build_tree_list(NULL_TREE, build_string(2, "r")); -+ input = chainon(NULL_TREE, build_tree_list(input, fptr)); -+ vec_safe_push(inputs, input); -+ -+ clobber = build_tree_list(NULL_TREE, build_string(4, "r10")); -+ vec_safe_push(clobbers, clobber); -+ clobber = build_tree_list(NULL_TREE, build_string(3, "cc")); -+ vec_safe_push(clobbers, clobber); -+ -+ asm_stmt = gimple_build_asm_vec(tmpl, inputs, NULL, clobbers, NULL); -+ gimple_asm_set_volatile(as_a_gasm(asm_stmt), true); -+ gimple_set_location(asm_stmt, loc); -+ gsi_insert_before(gsi, asm_stmt, GSI_SAME_STMT); -+ update_stmt(asm_stmt); -+ free(tmpl); -+ -+ // split right after our asm block so the returned block's first -+ // statement is still call_stmt, matching what rap_fptr_execute()'s -+ // driving loop expects (gsi_start_bb(bb) must land back on the call). -+ e = split_block(gimple_bb(asm_stmt), asm_stmt); -+ bb = e->dest; -+ -+ return bb; -+} -+ -+// find all language level function pointer dereferences and verify the target function -+static unsigned int rap_fptr_execute(void) -+{ -+ basic_block bb; -+ -+ loop_optimizer_init(LOOPS_NORMAL | LOOPS_HAVE_RECORDED_EXITS); -+ gcc_assert(current_loops); -+ -+ calculate_dominance_info(CDI_DOMINATORS); -+ calculate_dominance_info(CDI_POST_DOMINATORS); -+ -+ // 1. loop through BBs and GIMPLE statements -+ FOR_EACH_BB_FN(bb, cfun) { -+ gimple_stmt_iterator gsi; -+ -+ for (gsi = gsi_start_bb(bb); !gsi_end_p(gsi); gsi_next(&gsi)) { -+ // gimple match: h_1 = get_fptr (); D.2709_3 = h_1 (x_2(D)); -+ tree fptr, fntype; -+ gimple call_stmt; -+ -+ // is it a call ... -+ call_stmt = gsi_stmt(gsi); -+ if (!is_gimple_call(call_stmt)) -+ continue; -+ -+ fptr = gimple_call_fn(call_stmt); -+ if (!fptr) -+ continue; -+ -+ switch (TREE_CODE(fptr)) { -+ default: -+ debug_gimple_stmt(call_stmt); -+ debug_tree(fptr); -+ debug_tree(TREE_TYPE(fptr)); -+ gcc_unreachable(); -+ -+ case ADDR_EXPR: -+ continue; -+ -+ case SSA_NAME: -+ if (SSA_NAME_VAR(fptr) == NULL_TREE) -+ break; -+ -+ switch (TREE_CODE(SSA_NAME_VAR(fptr))) { -+ default: -+ debug_gimple_stmt(call_stmt); -+ debug_tree(fptr); -+ gcc_unreachable(); -+ -+ case VAR_DECL: -+ case PARM_DECL: -+ break; -+ } -+ break; -+ -+ case INTEGER_CST: -+ case OBJ_TYPE_REF: -+ break; -+ } -+ -+ // ... through a function pointer -+ fntype = TREE_TYPE(fptr); -+ if (TREE_CODE(fntype) != POINTER_TYPE) -+ continue; -+ -+ fntype = TREE_TYPE(fntype); -+ gcc_assert(TREE_CODE(fntype) == FUNCTION_TYPE || TREE_CODE(fntype) == METHOD_TYPE); -+ -+ bb = rap_instrument_fptr(&gsi); -+ gsi = gsi_start_bb(bb); -+ } -+ } -+ -+ free_dominance_info(CDI_DOMINATORS); -+ free_dominance_info(CDI_POST_DOMINATORS); -+ loop_optimizer_finalize(); -+ -+ return 0; -+} -+ -+#define PASS_NAME rap_fptr -+#define TODO_FLAGS_FINISH TODO_verify_ssa | TODO_verify_stmts | TODO_dump_func | TODO_remove_unused_locals | TODO_update_ssa | TODO_cleanup_cfg | TODO_rebuild_cgraph_edges | TODO_verify_flow -+#include "gcc-generate-gimple-pass.h" -diff --git a/scripts/gcc-plugins/rap_plugin/rap_hash.c b/scripts/gcc-plugins/rap_plugin/rap_hash.c -new file mode 100644 -index 000000000..420fcbdbf ---- /dev/null -+++ b/scripts/gcc-plugins/rap_plugin/rap_hash.c -@@ -0,0 +1,396 @@ -+/* -+ * Copyright 2012-2016 by PaX Team -+ * Licensed under the GPL v2 -+ * -+ * Homepage: http://pax.grsecurity.net/ -+ */ -+ -+#include "rap.h" -+ -+static rap_hash_t *rap_imprecise_hashes; -+static int rap_cgraph_max_uid; -+ -+static void rap_hash_function(const_tree fntype, rap_hash_flags_t flags, unsigned char sip_hash[8]); -+ -+static const unsigned char rap_hash_tree_code[MAX_TREE_CODES] = { -+ [0] = 0, -+ [1] = 0, -+ [2] = 0, -+ [3] = 0, -+ [4] = 0, -+ [OFFSET_TYPE] = 10, -+ [ENUMERAL_TYPE] = 20, -+ [BOOLEAN_TYPE] = 30, -+ [INTEGER_TYPE] = 40, -+ [REAL_TYPE] = 50, -+ [POINTER_TYPE] = 60, -+ [REFERENCE_TYPE] = 70, -+#if BUILDING_GCC_VERSION >= 4006 -+ [NULLPTR_TYPE] = 80, -+#endif -+ [FIXED_POINT_TYPE] = 0, -+ [COMPLEX_TYPE] = 100, -+ [VECTOR_TYPE] = 110, -+ [ARRAY_TYPE] = 120, -+ [RECORD_TYPE] = 130, -+ [UNION_TYPE] = 140, -+ [QUAL_UNION_TYPE] = 0, -+ [VOID_TYPE] = 160, -+#if BUILDING_GCC_VERSION >= 5000 && BUILDING_GCC_VERSION < 9000 -+ [POINTER_BOUNDS_TYPE] = 170, -+#endif -+ [FUNCTION_TYPE] = 180, -+ [METHOD_TYPE] = 0, -+ [LANG_TYPE] = 0, -+}; -+ -+static void rap_fold_hash(unsigned char *out, const unsigned char *in, unsigned long long inlen) -+{ -+ static const unsigned char rap_sip_key[16] = { -+ 'P', 'a', 'X', ' ', 'T', 'e', 'a', 'm', -+ 'R', 'A', 'P', ' ', 'H', 'A', 'S', 'H', -+ }; -+ -+ siphash24fold(out, in, inlen, rap_sip_key); -+} -+ -+// compute the final hash value in the range [1,INT_MAX] -+// the % and +1 trick leaves the value 0 available for marking non-indirectly callable functions -+// and INT_MIN (0x80000000) for longjmp targets (sign extended) -+// return places will use the (sign extended) range [INT_MIN+1,-1] ([0x8000001,0xffffffff]) -+static rap_hash_t rap_extract_hash(const unsigned char sip_hash[8]) -+{ -+ rap_hash_t hash; -+ unsigned long long dividend, divisor; -+ -+ memcpy(÷nd, sip_hash, sizeof dividend); -+// divisor = 1ULL << (sizeof hash * 8 - 1); -+// divisor |= divisor - 1; -+ divisor = 0x7fffffffUL; -+ hash.hash = dividend % divisor + 1; -+ return hash; -+} -+ -+static void rap_hash_type_name(const_tree type, unsigned char sip_hash[8]) -+{ -+ const_tree name = type_name(TYPE_MAIN_VARIANT(type)); -+ -+ // handle typedefs of anonymous structs/unions -+ if (name == NULL_TREE) -+ name = type_name(type); -+ -+ if (name == NULL_TREE) -+ return; -+ -+ gcc_assert(TREE_CODE(name) == IDENTIFIER_NODE); -+ rap_fold_hash(sip_hash, (const unsigned char *)IDENTIFIER_POINTER(name), IDENTIFIER_LENGTH(name)); -+} -+ -+static void rap_hash_type_precision(const_tree type, unsigned char sip_hash[8]) -+{ -+ unsigned HOST_WIDE_INT size; -+ -+ gcc_assert(TYPE_PRECISION(type)); -+ -+ size = TYPE_PRECISION(type); -+ rap_fold_hash(sip_hash, (const unsigned char *)&size, sizeof size); -+} -+ -+const_tree type_name(const_tree type) -+{ -+ const_tree name; -+ -+ name = TYPE_NAME(type); -+ if (!name) -+ return NULL_TREE; -+ -+ switch (TREE_CODE(name)) { -+ case IDENTIFIER_NODE: -+ return name; -+ -+ case TYPE_DECL: -+ gcc_assert(DECL_NAME(name)); -+ return DECL_NAME(name); -+ -+ default: -+ gcc_unreachable(); -+ } -+} -+ -+__attribute__((weak)) tree c_global_trees[CTI_MAX]; -+ -+// the core computation of the rap hash -+// the first piece is a (hopefully) compiler independent encondig of the type, derived from the gcc tree code -+// the second piece is type specific information, such as the size, qualifiers, (recursively) referenced types, etc -+static void rap_hash_tree(const_tree type, rap_hash_flags_t flags, unsigned char sip_hash[8]) -+{ -+ enum tree_code code; -+ unsigned int attrs; -+ -+ code = TREE_CODE(type); -+ attrs = rap_hash_tree_code[code]; -+ if (!attrs) { -+ fprintf(stderr, "unhandled tree_code %s %d\n", get_tree_code_name(code), code); -+ debug_tree(type); -+ gcc_unreachable(); -+ } -+ rap_fold_hash(sip_hash, (const unsigned char *)&attrs, sizeof attrs); -+ -+ enum { -+ // attrs layout for -+ // - all types: -+ RAP_HASH_VOLATILE = 1U << 31, -+ RAP_HASH_NOT_VOLATILE = 1U << 30, -+ RAP_HASH_CONST = 1U << 29, -+ RAP_HASH_NOT_CONST = 1U << 28, -+ -+ // - pointer types: -+ RAP_HASH_RESTRICT = 1U << 27, -+ RAP_HASH_NOT_RESTRICT = 1U << 26, -+ -+ // - C integer types: -+ RAP_HASH_UNSIGNED = 1U << 25, -+ RAP_HASH_SIGNED = 1U << 24, -+ -+ RAP_HASH_UNQUALIFIED_CHAR = 1U << 23, -+ RAP_HASH_CHAR = 1U << 22, -+ RAP_HASH_SHORT = 1U << 21, -+ RAP_HASH_INT = 1U << 20, -+ RAP_HASH_LONG = 1U << 19, -+ RAP_HASH_LONG_LONG = 1U << 18, -+ RAP_HASH_WCHAR = 1U << 17, -+ RAP_HASH_CHAR16 = 1U << 16, -+ RAP_HASH_CHAR32 = 1U << 15, -+ -+ // - C float types -+ RAP_HASH_FLOAT = 1U << 14, -+ RAP_HASH_DOUBLE = 1U << 13, -+ RAP_HASH_LONG_DOUBLE = 1U << 12, -+ RAP_HASH_DFLOAT32 = 1U << 11, -+ RAP_HASH_DFLOAT64 = 1U << 10, -+ RAP_HASH_DFLOAT128 = 1U << 9, -+ }; -+ -+ attrs = 0; -+ if (flags.qual_volatile) -+ attrs |= TYPE_VOLATILE(type) ? RAP_HASH_VOLATILE : RAP_HASH_NOT_VOLATILE; -+ if (flags.qual_const) -+ attrs |= TYPE_READONLY(type) ? RAP_HASH_CONST : RAP_HASH_NOT_CONST; -+ -+ switch (code) { -+ default: -+ debug_tree(type); -+ gcc_unreachable(); -+ break; -+ -+ case VOID_TYPE: -+ break; -+ -+ case OFFSET_TYPE: -+ rap_hash_tree(TREE_TYPE(type), flags, sip_hash); -+ rap_hash_tree(TYPE_OFFSET_BASETYPE(type), flags, sip_hash); -+ break; -+ -+ case FUNCTION_TYPE: -+ rap_hash_function(type, flags, sip_hash); -+ break; -+ -+ case RECORD_TYPE: -+ rap_hash_type_name(type, sip_hash); -+ break; -+ -+ case UNION_TYPE: -+ rap_hash_type_name(type, sip_hash); -+ break; -+ -+ case POINTER_TYPE: -+ case REFERENCE_TYPE: -+ rap_hash_tree(TREE_TYPE(type), flags, sip_hash); -+ break; -+ -+ case VECTOR_TYPE: -+ rap_hash_tree(TREE_TYPE(type), flags, sip_hash); -+ rap_hash_type_precision(TREE_TYPE(type), sip_hash); -+ break; -+ -+ case ARRAY_TYPE: -+ rap_hash_tree(TREE_TYPE(type), flags, sip_hash); -+ break; -+ -+ case REAL_TYPE: { -+ const_tree main_variant = TYPE_MAIN_VARIANT(type); -+ -+ switch (TYPE_PRECISION(main_variant)) { -+ default: -+ debug_tree(type); -+ debug_tree(TYPE_MAIN_VARIANT(type)); -+ gcc_unreachable(); -+ -+ case 32: -+// attrs |= RAP_HASH_FLOAT; -+ break; -+ -+ case 64: -+// attrs |= RAP_HASH_DOUBLE; -+ break; -+ -+ case 80: -+ case 128: -+ attrs |= RAP_HASH_LONG_DOUBLE; -+ break; -+ } -+ rap_hash_type_precision(main_variant, sip_hash); -+ break; -+ } -+ -+ case ENUMERAL_TYPE: -+ rap_hash_type_name(type, sip_hash); -+ case BOOLEAN_TYPE: -+ rap_hash_type_precision(type, sip_hash); -+ break; -+ -+ case INTEGER_TYPE: { -+ attrs |= TYPE_UNSIGNED(type) ? RAP_HASH_UNSIGNED : RAP_HASH_SIGNED; -+ rap_hash_type_precision(type, sip_hash); -+ break; -+ } -+ } -+ -+ rap_fold_hash(sip_hash, (const unsigned char *)&attrs, sizeof attrs); -+} -+ -+static const_tree rap_dequal_argtype(const_tree argtype) -+{ -+ // since gcc/tree.c:free_lang_data_in_type removes const/volatile from the top level param decl -+ // we have to simulate it here as this can be called earlier from the frontend as well -+ if (TYPE_READONLY(argtype) || TYPE_VOLATILE(argtype)) { -+ int quals; -+ -+ quals = TYPE_QUALS(argtype) & ~TYPE_QUAL_CONST & ~TYPE_QUAL_VOLATILE; -+ argtype = build_qualified_type(CONST_CAST_TREE(argtype), quals); -+ } -+ -+ return argtype; -+} -+ -+// main function to compute the rap hash for function types -+// while virtual class methods are always replaced with their ancestor, -+// callers can decide whether to fully utilize that information via flags.method_ancestor -+static void rap_hash_function(const_tree fntype, rap_hash_flags_t flags, unsigned char sip_hash[8]) -+{ -+ function_args_iterator args_iter; -+ const_tree arg; -+ -+ switch (TREE_CODE(fntype)) { -+ default: -+ debug_tree(fntype); -+ gcc_unreachable(); -+ -+ case FUNCTION_TYPE: -+ // 1. hash the result -+ rap_hash_tree(TREE_TYPE(fntype), flags, sip_hash); -+ -+ // 2. hash the function parameters -+ FOREACH_FUNCTION_ARGS(fntype, arg, args_iter) { -+ const_tree argtype = arg; -+ -+ argtype = rap_dequal_argtype(argtype); -+ rap_hash_tree(argtype, flags, sip_hash); -+ } -+ break; -+ } -+} -+ -+rap_hash_t rap_hash_function_type(const_tree fntype, rap_hash_flags_t flags) -+{ -+ unsigned char sip_hash[8] = { }; -+ rap_hash_t hash; -+ -+ rap_hash_function(fntype, flags, sip_hash); -+ hash = rap_extract_hash(sip_hash); -+ -+ gcc_assert(hash.hash); -+ return hash; -+} -+ -+rap_hash_t rap_hash_function_decl(const_tree fndecl, rap_hash_flags_t flags) -+{ -+ tree fntype; -+ -+ gcc_assert(TREE_CODE(fndecl) == FUNCTION_DECL); -+ fntype = TREE_TYPE(fndecl); -+ -+ switch (TREE_CODE(fntype)) { -+ default: -+ debug_tree(fndecl); -+ gcc_unreachable(); -+ -+ case FUNCTION_TYPE: -+ return rap_hash_function_type(fntype, flags); -+ } -+} -+ -+rap_hash_t rap_hash_function_node_imprecise(cgraph_node_ptr node) -+{ -+ rap_hash_t hash; -+ tree fndecl; -+ int uid; -+ -+ gcc_assert(rap_imprecise_hashes); -+ -+ hash.hash = 0; -+#if BUILDING_GCC_VERSION < 9003 -+ uid = node->uid; -+#else -+ uid = node->get_uid(); -+#endif -+ if (uid < rap_cgraph_max_uid) -+ hash = rap_imprecise_hashes[uid]; -+ -+ if (hash.hash) -+ return hash; -+ -+ fndecl = NODE_DECL(node); -+ if (TREE_CODE(TREE_TYPE(fndecl)) == FUNCTION_TYPE) -+ return rap_hash_function_decl(fndecl, imprecise_rap_hash_flags); -+ -+ debug_cgraph_node(node); -+ debug_tree(fndecl); -+ error("indirect call to function %qD with a reserved hash value", fndecl); -+ return hash; -+} -+ -+void rap_calculate_func_hashes(void *event_data __unused, void *data __unused) -+{ -+ cgraph_node_ptr node; -+ int uid; -+ -+ gcc_assert(!rap_imprecise_hashes); -+ -+ rap_imprecise_hashes = (rap_hash_t *)xcalloc(cgraph_max_uid, sizeof(*rap_imprecise_hashes)); -+ rap_cgraph_max_uid = cgraph_max_uid; -+ -+ FOR_EACH_FUNCTION(node) { -+ const_tree fndecl; -+ -+#if BUILDING_GCC_VERSION < 9003 -+ uid = node->uid; -+#else -+ uid = node->get_uid(); -+#endif -+ gcc_assert(uid < rap_cgraph_max_uid); -+ -+#if BUILDING_GCC_VERSION < 10000 -+ if (node->global.inlined_to) -+#else -+ if (node->inlined_to) -+#endif -+ continue; -+ -+ fndecl = NODE_DECL(node); -+ gcc_assert(fndecl); -+ -+ rap_imprecise_hashes[uid] = rap_hash_function_decl(fndecl, imprecise_rap_hash_flags); -+ gcc_assert(rap_imprecise_hashes[uid].hash); -+ } -+} -diff --git a/scripts/gcc-plugins/rap_plugin/rap_plugin.c b/scripts/gcc-plugins/rap_plugin/rap_plugin.c -new file mode 100644 -index 000000000..b05e0bf95 ---- /dev/null -+++ b/scripts/gcc-plugins/rap_plugin/rap_plugin.c -@@ -0,0 +1,573 @@ -+/* -+ * Copyright 2012-2016 by PaX Team -+ * Licensed under the GPL v2 -+ * -+ * Homepage: http://pax.grsecurity.net/ -+ * -+ * Usage: -+ * $ # for 4.5/4.6/C based 4.7 -+ * $ gcc -I`gcc -print-file-name=plugin`/include -I`gcc -print-file-name=plugin`/include/c-family -fPIC -shared -O2 -o rap_plugin.so rap_plugin.c -+ * $ # for C++ based 4.7/4.8+ -+ * $ g++ -I`g++ -print-file-name=plugin`/include -I`g++ -print-file-name=plugin`/include/c-family -fPIC -shared -O2 -o rap_plugin.so rap_plugin.c -+ * $ gcc -fplugin=./rap_plugin.so -fplugin-arg-rap_plugin-check=call test.c -O2 -+ */ -+ -+#include "rap.h" -+ -+__visible int plugin_is_GPL_compatible; -+ -+static struct plugin_info rap_plugin_info = { -+ .version = "201604272100", -+ .help = "check=call\tenable the corresponding features\n" -+ "hash=abs,abs-finish,const,volatile\n" -+ "report=func,fptr,abs\n" -+}; -+ -+rap_hash_flags_t imprecise_rap_hash_flags = { -+ .qual_const = 1, -+ .qual_volatile = 1, -+}; -+ -+tree rap_hash_type_node; -+ -+static bool report_func_hash, report_abs_hash; -+ -+// create the equivalent of -+// asm volatile("" : : : "memory"); -+// or -+// asm("" : "+rm"(var)); -+// or -+// asm("" : : "rm"(var)); -+gimple barrier(tree var, bool full) -+{ -+ gimple stmt; -+ gasm *asm_stmt; -+#if BUILDING_GCC_VERSION <= 4007 -+ VEC(tree, gc) *inputs = NULL; -+ VEC(tree, gc) *outputs = NULL; -+ VEC(tree, gc) *clobbers = NULL; -+#else -+ vec *inputs = NULL; -+ vec *outputs = NULL; -+ vec *clobbers = NULL; -+#endif -+ -+ if (!var && full) { -+ tree clobber; -+ -+ clobber = build_tree_list(NULL_TREE, build_string(7, "memory")); -+#if BUILDING_GCC_VERSION <= 4007 -+ VEC_safe_push(tree, gc, clobbers, clobber); -+#else -+ vec_safe_push(clobbers, clobber); -+#endif -+ } else if (full) { -+ tree input, output; -+ -+ input = build_tree_list(NULL_TREE, build_string(2, "0")); -+ input = chainon(NULL_TREE, build_tree_list(input, var)); -+#if BUILDING_GCC_VERSION <= 4007 -+ VEC_safe_push(tree, gc, inputs, input); -+#else -+ vec_safe_push(inputs, input); -+#endif -+ -+ output = build_tree_list(NULL_TREE, build_string(4, "=rm")); -+ gcc_assert(SSA_NAME_VAR(var)); -+ var = make_ssa_name(SSA_NAME_VAR(var), NULL); -+ output = chainon(NULL_TREE, build_tree_list(output, var)); -+#if BUILDING_GCC_VERSION <= 4007 -+ VEC_safe_push(tree, gc, outputs, output); -+#else -+ vec_safe_push(outputs, output); -+#endif -+ } else { -+ tree input; -+ -+ input = build_tree_list(NULL_TREE, build_string(3, "rm")); -+ input = chainon(NULL_TREE, build_tree_list(input, var)); -+#if BUILDING_GCC_VERSION <= 4007 -+ VEC_safe_push(tree, gc, inputs, input); -+#else -+ vec_safe_push(inputs, input); -+#endif -+ } -+ -+ stmt = gimple_build_asm_vec("", inputs, outputs, clobbers, NULL); -+ asm_stmt = as_a_gasm(stmt); -+ if (!var && full) -+ gimple_asm_set_volatile(asm_stmt, true); -+ else if (full) -+ SSA_NAME_DEF_STMT(var) = stmt; -+ return stmt; -+} -+ -+static const struct gcc_debug_hooks *old_debug_hooks; -+static struct gcc_debug_hooks rap_debug_hooks; -+ -+static bool __rap_cgraph_indirectly_callable(cgraph_node_ptr node, void *data) -+{ -+#if BUILDING_GCC_VERSION >= 4008 -+ if (NODE_SYMBOL(node)->externally_visible) -+#else -+ if (node->local.externally_visible) -+#endif -+ return true; -+ -+ if (NODE_SYMBOL(node)->address_taken) -+ return true; -+ -+ return false; -+} -+ -+static bool rap_cgraph_indirectly_callable(cgraph_node_ptr node) -+{ -+ return cgraph_for_node_and_aliases(node, __rap_cgraph_indirectly_callable, NULL, true); -+} -+ -+static void rap_hash_align(tree decl) -+{ -+ const unsigned HOST_WIDE_INT rap_hash_offset = TARGET_64BIT ? 2 * sizeof(rap_hash_t) : sizeof(rap_hash_t); -+ unsigned HOST_WIDE_INT skip; -+ -+#if BUILDING_GCC_VERSION < 9003 -+ skip = 1ULL << align_functions_log; -+#else -+ skip = 1ULL << align_functions.levels[0].log; -+#endif -+ if (DECL_USER_ALIGN(decl)) -+ return; -+ -+ if (!optimize_function_for_speed_p(cfun)) { -+ ASM_OUTPUT_ASCII(asm_out_file, "\xb8", 1); -+ return; -+ } -+ -+ if (skip <= rap_hash_offset) -+ return; -+ -+#ifdef TARGET_64BIT -+ { -+ char padding[RAP_HASH_START_PADDING_SIZE]; -+ -+ // this byte sequence helps disassemblers not trip up on the following rap hash -+ //memset(padding, 0xcc, sizeof padding - 1); -+ padding[sizeof padding - 1] = 0xb8; -+ ASM_OUTPUT_ASCII(asm_out_file, padding, sizeof padding); -+ } -+#else -+ ASM_OUTPUT_SKIP(asm_out_file, skip - rap_hash_offset); -+#endif -+} -+ -+static void rap_begin_function(tree decl) -+{ -+ cgraph_node_ptr node; -+ rap_hash_t imprecise_rap_hash; -+ char *name = NULL; -+#if 0 -+ char end_padding[RAP_HASH_END_PADDING_SIZE]; -+ -+ memset(end_padding, 0xcc, sizeof end_padding); -+#endif -+ gcc_assert(debug_hooks == &rap_debug_hooks); -+ -+ // chain to previous callback -+ if (old_debug_hooks && old_debug_hooks->begin_function) -+ old_debug_hooks->begin_function(decl); -+ -+ // don't compute hash for functions called only directly -+ node = cgraph_get_node(decl); -+ gcc_assert(node); -+ if (!rap_cgraph_indirectly_callable(node)) { -+ // GCC and clang both drop -falign-functions (or -+ // -fmin-function-alignment) once -fpatchable-function-entry is -+ // also active, unless real content follows the alignment -+ // directive immediately -- this is how -fpatchable-function-entry's -+ // own section-switch bookkeeping works in both compilers, not a -+ // bug in either. clang's -fsanitize=kcfi works around it by -+ // writing a real hash, or a flat placeholder like this one, right -+ // after the alignment point for every function unconditionally; -+ // do the same here for the functions that don't get a real rap -+ // hash below. -+#if BUILDING_GCC_VERSION < 9003 -+ ASM_OUTPUT_ALIGN(asm_out_file, align_functions_log); -+#else -+ ASM_OUTPUT_ALIGN(asm_out_file, align_functions.levels[0].log); -+#endif -+ ASM_OUTPUT_ASCII(asm_out_file, "\x90\x90\x90\x90\x90", 5); -+ imprecise_rap_hash.hash = 0; -+ return; -+ } else { -+ imprecise_rap_hash = rap_hash_function_node_imprecise(node); -+ } -+ -+ gcc_assert(asprintf(&name, "__cfi_%s", IDENTIFIER_POINTER(DECL_ASSEMBLER_NAME(decl))) != -1); -+ if (TREE_PUBLIC(decl)) { -+ if (lookup_attribute("weak", DECL_ATTRIBUTES(decl))) -+ fprintf(asm_out_file, "\t.weak\t%s\n", name); -+ else -+ fprintf(asm_out_file, GLOBAL_ASM_OP " %s\n", name); -+ } -+ -+ ASM_OUTPUT_TYPE_DIRECTIVE(asm_out_file, name, "function"); -+ ASM_OUTPUT_LABEL(asm_out_file, name); -+ -+ // align the rap hash if necessary -+ rap_hash_align(decl); -+ -+ if (report_func_hash) -+ inform(DECL_SOURCE_LOCATION(decl), "func rap_hash: %x %s", imprecise_rap_hash.hash, IDENTIFIER_POINTER(DECL_ASSEMBLER_NAME(decl))); -+ -+ fprintf(asm_out_file, "\t.long %#x\t%s __kcfi_typeid_%s\n", imprecise_rap_hash.hash, ASM_COMMENT_START, IDENTIFIER_POINTER(DECL_ASSEMBLER_NAME(decl))); -+ -+#if 0 -+ ASM_OUTPUT_ASCII(asm_out_file, end_padding, sizeof end_padding); -+#endif -+ fprintf(asm_out_file, "\t.size\t%s, .-%s\n", name, name); -+} -+ -+static void rap_start_unit_common(void *gcc_data __unused, void *user_data __unused) -+{ -+ rap_hash_type_node = long_integer_type_node; -+ -+ if (debug_hooks) -+ rap_debug_hooks = *debug_hooks; -+ rap_debug_hooks.begin_function = rap_begin_function; -+ old_debug_hooks = debug_hooks; -+ debug_hooks = &rap_debug_hooks; -+} -+ -+/* -+ emit an absolute symbol for each function that may be referenced through the plt -+ - all externs -+ - non-static functions -+ - use visibility instead? -+ -+ .globl __rap_hash_func -+ .offset 0xhash_for_func -+ .type __rap_hash_func, @object -+ __rap_hash_func: -+ .previous -+*/ -+static void rap_finish_unit(void *gcc_data __unused, void *user_data __unused) -+{ -+ cgraph_node_ptr node; -+ rap_hash_t hash; -+ -+ gcc_assert(debug_hooks == &rap_debug_hooks); -+ -+ hash.hash = 0; -+ FOR_EACH_FUNCTION(node) { -+ tree fndecl; -+ const char *asmname; -+ char *name = NULL; -+ -+ if (cgraph_function_body_availability(node) >= AVAIL_INTERPOSABLE) { -+ if (node->thunk || node->alias) -+ continue; -+ if (!rap_cgraph_indirectly_callable(node)) -+ continue; -+ } -+ -+#if BUILDING_GCC_VERSION >= 4007 -+ gcc_assert(cgraph_function_or_thunk_node(node, NULL) == node); -+#endif -+ -+ fndecl = NODE_DECL(node); -+ gcc_assert(fndecl); -+ if (DECL_IS_UNDECLARED_BUILTIN(fndecl) && DECL_BUILT_IN_CLASS(fndecl) == BUILT_IN_NORMAL) -+ continue; -+ -+ if (!TREE_PUBLIC(fndecl)) -+ continue; -+ -+ if (DECL_ARTIFICIAL(fndecl)) -+ continue; -+ -+ if (DECL_ABSTRACT_ORIGIN(fndecl) && DECL_ABSTRACT_ORIGIN(fndecl) != fndecl) -+ continue; -+ -+ gcc_assert(DECL_ASSEMBLER_NAME(fndecl)); -+ asmname = IDENTIFIER_POINTER(DECL_ASSEMBLER_NAME(fndecl)); -+ if (strchr(asmname, '.')) -+ continue; -+ -+ if (asmname[0] == '*') -+ asmname++; -+ -+ gcc_assert(asmname[0]); -+ gcc_assert(asprintf(&name, "__kcfi_typeid_%s", asmname) != -1); -+ -+ hash = rap_hash_function_node_imprecise(node); -+ if (report_abs_hash) -+ inform(DECL_SOURCE_LOCATION(fndecl), "abs rap_hash: %x %s", hash.hash, IDENTIFIER_POINTER(DECL_ASSEMBLER_NAME(fndecl))); -+ -+ fprintf(asm_out_file, GLOBAL_ASM_OP " %s\n", name); -+ fprintf(asm_out_file, "\t.offset %#x\n", hash.hash); -+ ASM_OUTPUT_TYPE_DIRECTIVE(asm_out_file, name, "object"); -+ ASM_OUTPUT_LABEL(asm_out_file, name); -+ free(name); -+ } -+ -+ if (hash.hash) -+ fprintf(asm_out_file, "\t.previous\n"); -+} -+ -+#if BUILDING_GCC_VERSION >= 4007 -+// emit the rap hash as an absolute symbol for all functions seen in the frontend -+// this is necessary as later unreferenced nodes will be removed yet we'd like to emit as many hashes as possible -+static void rap_finish_decl(void *event_data, void *data __unused) -+{ -+ tree fndecl = (tree)event_data; -+ rap_hash_t hash; -+ const char *asmname; -+ char *name = NULL; -+ -+ if (fndecl == error_mark_node) -+ return; -+ -+ if (TREE_CODE(fndecl) != FUNCTION_DECL) -+ return; -+ -+ if (!TREE_PUBLIC(fndecl)) -+ return; -+ -+ if (DECL_ARTIFICIAL(fndecl)) -+ return; -+ -+ if (DECL_ABSTRACT_ORIGIN(fndecl) && DECL_ABSTRACT_ORIGIN(fndecl) != fndecl) -+ return; -+ -+ asmname = DECL_NAME_POINTER(fndecl); -+ gcc_assert(asmname[0]); -+ -+ if (strchr(asmname, '.')) -+ return; -+ -+ gcc_assert(asprintf(&name, "__kcfi_typeid_%s", asmname) != -1); -+ -+ hash = rap_hash_function_decl(fndecl, imprecise_rap_hash_flags); -+ -+ if (report_abs_hash) -+ inform(DECL_SOURCE_LOCATION(fndecl), "abs rap_hash: %x %s", hash.hash, asmname); -+ -+ fprintf(asm_out_file, GLOBAL_ASM_OP " %s\n", name); -+ if (TARGET_64BIT) -+ fprintf(asm_out_file, "\t.offset %#lx\n", (long)hash.hash); -+ else -+ fprintf(asm_out_file, "\t.offset %#x\n", hash.hash); -+ ASM_OUTPUT_TYPE_DIRECTIVE(asm_out_file, name, "object"); -+ ASM_OUTPUT_LABEL(asm_out_file, name); -+ free(name); -+ -+ fprintf(asm_out_file, "\t.previous\n"); -+} -+#endif -+ -+static bool rap_unignore_gate(void) -+{ -+ if (!DECL_IGNORED_P(current_function_decl)) -+ return false; -+ -+ inform(DECL_SOURCE_LOCATION(current_function_decl), "DECL_IGNORED fixed"); -+ -+ DECL_IGNORED_P(current_function_decl) = 0; -+ return false; -+} -+ -+#define PASS_NAME rap_unignore -+#define NO_EXECUTE -+#define TODO_FLAGS_FINISH TODO_dump_func -+#include "gcc-generate-rtl-pass.h" -+ -+static bool rap_version_check(struct plugin_gcc_version *gcc_version, struct plugin_gcc_version *plugin_version) -+{ -+ if (!gcc_version || !plugin_version) -+ return false; -+ -+#if BUILDING_GCC_VERSION >= 5000 -+ if (strncmp(gcc_version->basever, plugin_version->basever, 4)) -+#else -+ if (strcmp(gcc_version->basever, plugin_version->basever)) -+#endif -+ return false; -+ if (strcmp(gcc_version->datestamp, plugin_version->datestamp)) -+ return false; -+ if (strcmp(gcc_version->devphase, plugin_version->devphase)) -+ return false; -+ if (strcmp(gcc_version->revision, plugin_version->revision)) -+ return false; -+// if (strcmp(gcc_version->configuration_arguments, plugin_version->configuration_arguments)) -+// return false; -+ return true; -+} -+ -+EXPORTED_CONST struct ggc_root_tab gt_ggc_r_gt_rap[] = { -+ { -+ .base = &rap_hash_type_node, -+ .nelt = 1, -+ .stride = sizeof(rap_hash_type_node), -+ .cb = >_ggc_mx_tree_node, -+ .pchw = >_pch_nx_tree_node -+ }, -+ LAST_GGC_ROOT_TAB -+}; -+ -+static void -+handle_type_cast (void *gcc_data, void *user_data) -+{ -+ (void) user_data; -+ tree *t = (tree *) gcc_data; -+ tree type = t[0]; -+ tree otype = t[1]; -+ -+ if (TREE_CODE (type) == POINTER_TYPE -+ && TREE_CODE (otype) == POINTER_TYPE -+ && TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE -+ && TREE_CODE (TREE_TYPE (otype)) == FUNCTION_TYPE -+// && type != TYPE_MAIN_VARIANT (otype) -+ && TYPE_CANONICAL (TREE_TYPE (type)) != TYPE_CANONICAL (TREE_TYPE (otype))) -+ error (G_("cast from function type %qT " -+ "to non-matching type %qT"), otype, type); -+ -+} -+ -+__visible int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gcc_version *version) -+{ -+ int i; -+ const char * const plugin_name = plugin_info->base_name; -+ const int argc = plugin_info->argc; -+ const struct plugin_argument * const argv = plugin_info->argv; -+ bool enable_call = false; -+ bool enable_abs = false, enable_abs_finish = false; -+ -+ struct register_pass_info rap_fptr_pass_info; -+ struct register_pass_info rap_unignore_pass_info; -+ -+ rap_fptr_pass_info.pass = make_rap_fptr_pass(); -+ rap_fptr_pass_info.reference_pass_name = "nrv"; -+ rap_fptr_pass_info.ref_pass_instance_number = 1; -+ rap_fptr_pass_info.pos_op = PASS_POS_INSERT_AFTER; -+ -+ rap_unignore_pass_info.pass = make_rap_unignore_pass(); -+ rap_unignore_pass_info.reference_pass_name = "final"; -+ rap_unignore_pass_info.ref_pass_instance_number = 1; -+ rap_unignore_pass_info.pos_op = PASS_POS_INSERT_BEFORE; -+ -+ if (!rap_version_check(version, &gcc_version)) { -+ error(G_("incompatible gcc/plugin versions")); -+ return 1; -+ } -+ -+#if BUILDING_GCC_VERSION >= 5000 -+ if (flag_ipa_icf_functions) { -+// warning_at(UNKNOWN_LOCATION, 0, G_("-fipa-icf is incompatible with %s, disabling..."), plugin_name); -+// inform(UNKNOWN_LOCATION, G_("-fipa-icf is incompatible with %s, disabling..."), plugin_name); -+ flag_ipa_icf_functions = 0; -+ } -+#endif -+ -+ for (i = 0; i < argc; ++i) { -+ if (!strcmp(argv[i].key, "disable")) -+ continue; -+ -+ if (!strcmp(argv[i].key, "check")) { -+ char *values, *value, *saveptr; -+ -+ if (!argv[i].value) { -+ error(G_("no value supplied for option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key); -+ continue; -+ } -+ -+ values = xstrdup(argv[i].value); -+ value = strtok_r(values, ",", &saveptr); -+ while (value) { -+ if (!strcmp(value, "call")) -+ enable_call = true; -+ else -+ error(G_("unknown value supplied for option '-fplugin-arg-%s-%s=%s'"), plugin_name, argv[i].key, value); -+ value = strtok_r(NULL, ",", &saveptr); -+ } -+ free(values); -+ continue; -+ } -+ -+ if (!strcmp(argv[i].key, "hash")) { -+ char *values, *value, *saveptr; -+ -+ if (!argv[i].value) { -+ error(G_("no value supplied for option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key); -+ continue; -+ } -+ -+ values = xstrdup(argv[i].value); -+ value = strtok_r(values, ",", &saveptr); -+ while (value) { -+ if (!strcmp(value, "abs")) -+ enable_abs = enable_abs_finish = true; -+ else if (!strcmp(value, "abs-finish")) -+ enable_abs_finish = true; -+// else if (!strcmp(value, "const")) -+// imprecise_rap_hash_flags.qual_const = 1; -+// else if (!strcmp(value, "volatile")) -+// imprecise_rap_hash_flags.qual_volatile = 1; -+ else -+ error(G_("unknown value supplied for option '-fplugin-arg-%s-%s=%s'"), plugin_name, argv[i].key, value); -+ value = strtok_r(NULL, ",", &saveptr); -+ } -+ free(values); -+ continue; -+ } -+ -+ if (!strcmp(argv[i].key, "report")) { -+ char *values, *value, *saveptr; -+ -+ if (!argv[i].value) { -+ error(G_("no value supplied for option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key); -+ continue; -+ } -+ -+ values = xstrdup(argv[i].value); -+ value = strtok_r(values, ",", &saveptr); -+ while (value) { -+ if (!strcmp(value, "func")) -+ report_func_hash = true; -+ else if (!strcmp(value, "fptr")) -+ report_fptr_hash = true; -+ else if (!strcmp(value, "abs")) -+ report_abs_hash = true; -+ else -+ error(G_("unknown value supplied for option '-fplugin-arg-%s-%s=%s'"), plugin_name, argv[i].key, value); -+ value = strtok_r(NULL, ",", &saveptr); -+ } -+ free(values); -+ continue; -+ } -+ -+ error(G_("unkown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key); -+ } -+ -+ register_callback(plugin_name, PLUGIN_INFO, NULL, &rap_plugin_info); -+ -+ if (enable_call) { -+ register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &rap_fptr_pass_info); -+ } -+ -+ if (enable_call || enable_abs_finish) { -+#if BUILDING_GCC_VERSION >= 4007 -+ if (enable_abs) -+ register_callback(plugin_name, PLUGIN_FINISH_DECL, rap_finish_decl, NULL); -+#else -+#warning TODO -+#endif -+ register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &rap_unignore_pass_info); -+ register_callback(plugin_name, PLUGIN_REGISTER_GGC_ROOTS, NULL, (void *)>_ggc_r_gt_rap); -+ register_callback(plugin_name, PLUGIN_START_UNIT, rap_start_unit_common, NULL); -+ if (enable_abs_finish) -+ register_callback(plugin_name, PLUGIN_FINISH_UNIT, rap_finish_unit, NULL); -+ register_callback(plugin_name, PLUGIN_ALL_IPA_PASSES_START, rap_calculate_func_hashes, NULL); -+ register_callback (plugin_name, PLUGIN_TYPE_CAST, handle_type_cast, NULL); -+ } -+ return 0; -+} -diff --git a/scripts/gcc-plugins/rap_plugin/sip.c b/scripts/gcc-plugins/rap_plugin/sip.c -new file mode 100644 -index 000000000..65bc1cdea ---- /dev/null -+++ b/scripts/gcc-plugins/rap_plugin/sip.c -@@ -0,0 +1,96 @@ -+// SipHash-2-4 adapted by the PaX Team from the public domain version written by -+// Jean-Philippe Aumasson -+// Daniel J. Bernstein -+ -+#include -+ -+#define ROTL(x, b) (u64)(((x) << (b)) | ((x) >> (64 - (b)))) -+ -+#define U32TO8_LE(p, v) \ -+ (p)[0] = (u8)((v) ); (p)[1] = (u8)((v) >> 8); \ -+ (p)[2] = (u8)((v) >> 16); (p)[3] = (u8)((v) >> 24); -+ -+#define U64TO8_LE(p, v) \ -+ U32TO8_LE((p), (u32)((v) )); \ -+ U32TO8_LE((p) + 4, (u32)((v) >> 32)); -+ -+#define U8TO64_LE(p) ( \ -+ ((u64)((p)[0]) ) | \ -+ ((u64)((p)[1]) << 8) | \ -+ ((u64)((p)[2]) << 16) | \ -+ ((u64)((p)[3]) << 24) | \ -+ ((u64)((p)[4]) << 32) | \ -+ ((u64)((p)[5]) << 40) | \ -+ ((u64)((p)[6]) << 48) | \ -+ ((u64)((p)[7]) << 56)) -+ -+#define SIPROUND \ -+do { \ -+ v0 += v1; v1 = ROTL(v1, 13); v1 ^= v0; v0 = ROTL(v0, 32); \ -+ v2 += v3; v3 = ROTL(v3, 16); v3 ^= v2; \ -+ v0 += v3; v3 = ROTL(v3, 21); v3 ^= v0; \ -+ v2 += v1; v1 = ROTL(v1, 17); v1 ^= v2; v2 = ROTL(v2, 32); \ -+} while(0) -+ -+typedef uint64_t u64; -+typedef uint32_t u32; -+typedef uint8_t u8; -+ -+/* SipHash-2-4 with previous output folding, a poor man's streaming interface */ -+void siphash24fold(unsigned char *out, const unsigned char *in, unsigned long long inlen, const unsigned char *k); -+ -+void siphash24fold(unsigned char *out, const unsigned char *in, unsigned long long inlen, const unsigned char *k) -+{ -+ u64 k0 = U8TO64_LE(k); -+ u64 k1 = U8TO64_LE(k + 8); -+ /* "somepseudorandomlygeneratedbytes" */ -+ u64 v0 = 0x736f6d6570736575ULL ^ k0; -+ u64 v1 = 0x646f72616e646f6dULL ^ k1; -+ u64 v2 = 0x6c7967656e657261ULL ^ k0; -+ u64 v3 = 0x7465646279746573ULL ^ k1; -+ u64 b, m; -+ const u8 * const end = in + inlen - (inlen % sizeof(u64)); -+ const int left = inlen & 7; -+ b = ((u64)inlen) << 56; -+ -+ // fold in the previous output -+ m = U8TO64_LE(out); -+ v3 ^= m; -+ SIPROUND; -+ SIPROUND; -+ v0 ^= m; -+ -+ // consume full input blocks -+ for (; in != end; in += 8) { -+ m = U8TO64_LE(in); -+ v3 ^= m; -+ SIPROUND; -+ SIPROUND; -+ v0 ^= m; -+ } -+ -+ // consume the last potentially partial block -+ switch (left) { -+ case 7: b |= ((u64)in[6]) << 48; -+ case 6: b |= ((u64)in[5]) << 40; -+ case 5: b |= ((u64)in[4]) << 32; -+ case 4: b |= ((u64)in[3]) << 24; -+ case 3: b |= ((u64)in[2]) << 16; -+ case 2: b |= ((u64)in[1]) << 8; -+ case 1: b |= ((u64)in[0]); break; -+ case 0: break; -+ } -+ -+ // finalize -+ v3 ^= b; -+ SIPROUND; -+ SIPROUND; -+ v0 ^= b; -+ v2 ^= 0xff; -+ SIPROUND; -+ SIPROUND; -+ SIPROUND; -+ SIPROUND; -+ b = v0 ^ v1 ^ v2 ^ v3; -+ U64TO8_LE(out, b); -+} -diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c -index 07e8a4eb7..0dd83ee66 100644 ---- a/scripts/mod/modpost.c -+++ b/scripts/mod/modpost.c -@@ -1687,15 +1687,9 @@ static void check_exports(struct module *mod) - const char *basename; - exp = find_symbol(s->name); - if (!exp) { -- if (!s->weak && nr_unresolved++ < MAX_UNRESOLVED_REPORTS) -- modpost_log(!warn_unresolved, -- "\"%s\" [%s.ko] undefined!\n", -- s->name, mod->name); - continue; - } - if (exp->module == mod) { -- error("\"%s\" [%s.ko] was exported without definition\n", -- s->name, mod->name); - continue; - } - -diff --git a/security/Kconfig b/security/Kconfig -index 9a3297d39..d7c228b95 100644 ---- a/security/Kconfig -+++ b/security/Kconfig -@@ -5,6 +5,35 @@ - - menu "Security options" - -+menuconfig PAX -+ bool "Enable various PaX features" -+ depends on X86 -+ help -+ This allows you to enable various PaX features. PaX adds -+ intrusion prevention mechanisms to the kernel that reduce -+ the risks posed by exploitable memory corruption bugs. -+ -+if PAX -+config PAX_RAP -+ bool "Prevent code reuse attacks" -+ depends on X86_64 && GCC_PLUGINS -+ select CFI_CLANG -+ help -+ By saying Y here the kernel will check indirect control transfers -+ in order to detect and prevent attacks that try to hijack control -+ flow by overwriting code pointers. -+ -+ If you have an amd64 processor that does not support SMEP then you -+ must also enable a KERNEXEC code pointer instrumentation method -+ (see PAX_KERNEXEC_PLUGIN). -+ -+ Note that binary modules cannot be instrumented by this approach. -+ -+ Note that the implementation requires a gcc with plugin support, -+ i.e., gcc 4.5 or newer. You may need to install the supporting -+ headers explicitly in addition to the normal gcc package. -+endif -+ - source "security/keys/Kconfig" - - config SECURITY_DMESG_RESTRICT --- -2.53.0 - diff --git a/SPECS/91/linux/secure/0002-objtool-Return-error-in-case-of-failures.patch b/SPECS/91/linux/secure/0002-objtool-Return-error-in-case-of-failures.patch deleted file mode 100644 index 710f934ca4..0000000000 --- a/SPECS/91/linux/secure/0002-objtool-Return-error-in-case-of-failures.patch +++ /dev/null @@ -1,33 +0,0 @@ -From bbc75cb652c435688b9e3cf89e92a6931728e56a Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Tue, 9 Jul 2024 07:40:01 +0000 -Subject: [PATCH 2/2] objtool: Return error in case of failures - -Signed-off-by: Keerthana K ---- - tools/objtool/check.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/tools/objtool/check.c b/tools/objtool/check.c -index 0a33d9195b7a..93347f1efd0d 100644 ---- a/tools/objtool/check.c -+++ b/tools/objtool/check.c -@@ -4696,7 +4696,7 @@ static void free_insns(struct objtool_file *file) - - int check(struct objtool_file *file) - { -- int ret, warnings = 0; -+ int ret = 0, warnings = 0; - - arch_initial_func_cfi_state(&initial_func_cfi); - init_cfi_state(&init_cfi); -@@ -4858,5 +4858,5 @@ int check(struct objtool_file *file) - * errors are still fairly common due to the growing matrix of - * supported toolchains and their recent pace of change. - */ -- return 0; -+ return ret; - } --- -2.39.4 - diff --git a/SPECS/91/linux/secure/0004-Fix-PAX-function-pointer-overwritten-for-tasklet-cal.patch b/SPECS/91/linux/secure/0004-Fix-PAX-function-pointer-overwritten-for-tasklet-cal.patch deleted file mode 100644 index 6c15cfa3ce..0000000000 --- a/SPECS/91/linux/secure/0004-Fix-PAX-function-pointer-overwritten-for-tasklet-cal.patch +++ /dev/null @@ -1,35 +0,0 @@ -From bbcfac6abd6a009e7e59703072a5f6619d62575d Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Wed, 6 Jan 2021 07:35:04 +0000 -Subject: [PATCH 4/5] Fix PAX function pointer overwritten for tasklet callback - -Tasklet_struct has union of function pointers which is called based on -use_callback bool value. GCC RAP plugin has a bug which does not generate -RAP hash for the function pointers declared inside union. Fix here is to remove -the union of function pointers and declare it separately. - -Signed-off-by: Keerthana K ---- - include/linux/interrupt.h | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h -index ee8299eb1..d1498e678 100644 ---- a/include/linux/interrupt.h -+++ b/include/linux/interrupt.h -@@ -612,10 +612,8 @@ struct tasklet_struct - unsigned long state; - atomic_t count; - bool use_callback; -- union { -- void (*func)(unsigned long data); -- void (*callback)(struct tasklet_struct *t); -- }; -+ void (*func)(unsigned long data); -+ void (*callback)(struct tasklet_struct *t); - unsigned long data; - }; - --- -2.28.0 - diff --git a/SPECS/91/linux/sev/0079-x86-sev-es-Disable-BIOS-ACPI-RSDP-probing-if-SEV-ES-.patch b/SPECS/91/linux/sev/0079-x86-sev-es-Disable-BIOS-ACPI-RSDP-probing-if-SEV-ES-.patch deleted file mode 100644 index fcaee8066f..0000000000 --- a/SPECS/91/linux/sev/0079-x86-sev-es-Disable-BIOS-ACPI-RSDP-probing-if-SEV-ES-.patch +++ /dev/null @@ -1,36 +0,0 @@ -From e1c5b13e55850963ebd3877c2c7d57b0ab2a4bc6 Mon Sep 17 00:00:00 2001 -From: Bo Gan -Date: Wed, 2 Sep 2020 05:40:06 -0700 -Subject: [PATCH 79/82] x86/sev-es: Disable BIOS ACPI RSDP probing if SEV-ES is - enabled - -Signed-off-by: Bo Gan ---- - arch/x86/boot/compressed/acpi.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c -index 8bcbcee..b93e6b4 100644 ---- a/arch/x86/boot/compressed/acpi.c -+++ b/arch/x86/boot/compressed/acpi.c -@@ -249,6 +249,8 @@ static acpi_physical_address bios_get_rsdp_addr(void) - return 0; - } - -+extern unsigned int get_sev_encryption_bit(void); -+ - /* Return RSDP address on success, otherwise 0. */ - acpi_physical_address get_rsdp_addr(void) - { -@@ -267,7 +269,7 @@ acpi_physical_address get_rsdp_addr(void) - if (!pa) - pa = efi_get_rsdp_addr(); - -- if (!pa) -+ if (!pa && !get_sev_encryption_bit()) - pa = bios_get_rsdp_addr(); - - return pa; --- -2.7.4 - diff --git a/SPECS/91/linux/sev/0080-x86-boot-Enable-vmw-serial-port-via-Super-I-O.patch b/SPECS/91/linux/sev/0080-x86-boot-Enable-vmw-serial-port-via-Super-I-O.patch deleted file mode 100644 index 18a19c4397..0000000000 --- a/SPECS/91/linux/sev/0080-x86-boot-Enable-vmw-serial-port-via-Super-I-O.patch +++ /dev/null @@ -1,84 +0,0 @@ -From a19564ab4baead7c8ad673a611a94b178278d906 Mon Sep 17 00:00:00 2001 -From: Bo Gan -Date: Wed, 2 Sep 2020 05:42:08 -0700 -Subject: [PATCH 80/82] x86/boot: Enable vmw serial port via Super I/O - -Signed-off-by: Bo Gan ---- - arch/x86/boot/early_serial_console.c | 51 ++++++++++++++++++++++++++++++++++++ - 1 file changed, 51 insertions(+) - -diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c -index 023bf1c..9efbc1f 100644 ---- a/arch/x86/boot/early_serial_console.c -+++ b/arch/x86/boot/early_serial_console.c -@@ -4,6 +4,8 @@ - * included from both the compressed kernel and the regular kernel. - */ - #include "boot.h" -+#include "string.h" -+#include - - #define DEFAULT_SERIAL_PORT 0x3f8 /* ttyS0 */ - -@@ -145,8 +147,57 @@ static void parse_console_uart8250(void) - early_serial_init(port, baud); - } - -+/* Registers for the NS PC97338/PC87338 SuperI/O chip. */ -+#define SIO_IDX_REG 0x2e -+#define SIO_DATA_REG 0x2f -+ -+#define FER_IDX 0x00 -+#define PNP1_IDX 0x1C -+#define S1BAL_IDX 0x44 -+#define S1BAH_IDX 0x45 -+ -+static void vmw_sio_write(u8 addr, u8 data) -+{ -+ outb(addr, SIO_IDX_REG); -+ outb(data, SIO_DATA_REG); -+} -+ -+static u8 vmw_sio_read(u8 addr) -+{ -+ outb(addr, SIO_IDX_REG); -+ return inb(SIO_DATA_REG); -+} -+ -+static void vmw_sio_serial_init(void) -+{ -+ u8 fer = vmw_sio_read(FER_IDX); -+ -+ if (fer & 2) -+ return; -+ -+ vmw_sio_write(S1BAL_IDX, 0xfe); -+ vmw_sio_write(S1BAH_IDX, 0); -+ vmw_sio_write(PNP1_IDX, 4); -+ vmw_sio_write(FER_IDX, fer | 2); -+} -+ - void console_init(void) - { -+ unsigned int hyper_vendor_id[3], ecx_f1; -+ unsigned int eax_f1 = 1, eax_f2 = CPUID_VMWARE_INFO_LEAF; -+ -+ asm("cpuid" : "+a" (eax_f1), "=c" (ecx_f1) :: "ebx", "edx"); -+ -+ if (ecx_f1 & (1UL << 31)) { -+ asm("cpuid" : "+a" (eax_f2), -+ "=b"(hyper_vendor_id[0]), -+ "=c"(hyper_vendor_id[1]), -+ "=d"(hyper_vendor_id[2])); -+ -+ if (!memcmp(hyper_vendor_id, "VMwareVMware", 12)) -+ vmw_sio_serial_init(); -+ } -+ - parse_earlyprintk(); - - if (!early_serial_base) --- -2.7.4 - diff --git a/SPECS/91/linux/viomem/Makefile.viomem b/SPECS/91/linux/viomem/Makefile.viomem deleted file mode 100644 index 58b75a636f..0000000000 --- a/SPECS/91/linux/viomem/Makefile.viomem +++ /dev/null @@ -1,7 +0,0 @@ -obj-m := viomem.o - -all: - $(MAKE) -C /lib/modules/$(BUILD_KERNEL)/build M=$(CURDIR) modules - -clean: - $(MAKE) -C /lib/modules/$(BUILD_KERNEL)/build M=$(CURDIR) clean diff --git a/SPECS/91/linux/viomem/viomem.c b/SPECS/91/linux/viomem/viomem.c deleted file mode 100644 index ca67082cc5..0000000000 --- a/SPECS/91/linux/viomem/viomem.c +++ /dev/null @@ -1,550 +0,0 @@ -/* - * ***************************************************************** - * Copyright (c) 2024-2026 Broadcom. All Rights Reserved. - * The term “Broadcom” refers solely to the Broadcom Inc. - * corporate affiliate that distributes this software. - * ****************************************************************** - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define MAX_SIZE (8 * 1024 * 1024 * 1024ULL) /* max size mmaped to userspace */ -#define SIZE_2M (2ULL * 1024 * 1024) /* 2M alignment granularity */ -#define SIZE_512M (512ULL * 1024 * 1024) /* minimum map size */ -#define DEVICE_NAME "viomem" -#define CLASS_NAME "viomem" - -/* - * Any changes made to ioctldata, IOCTL_GET_PFN, and IOCTL_SET_MAP_SIZE - * IOCTL_GET_MAP_SIZE and should be made both in Kernel Driver and - * Protocol header files - */ -#define IOCTL_GET_PFN 3 -#define IOCTL_SET_MAP_SIZE 4 -#define IOCTL_GET_MAP_SIZE 5 - -struct __attribute__((__packed__)) ioctldata { - unsigned long offset; - unsigned int array_size; - unsigned long pfn[]; -}; - -typedef struct viomem_ctx { - struct class *class; - struct device *device; - int refcount; - int major; - void *sh_mem; - unsigned long long allocatedmem; - int mmap_count; - bool size_locked; - struct mutex lock; -} viomem_ctx; - -static viomem_ctx gctx; -static unsigned long memsize_mb = 1024; -module_param(memsize_mb, ulong, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - - -/* - *--------------------------------------------------------------------------- - * - * viomem_alloc_shmem_locked -- - * - * Allocate backing store of @bytes (caller holds gctx.lock). - * - *--------------------------------------------------------------------------- - */ - -static int viomem_alloc_shmem_locked(unsigned long long bytes) -{ - void *p; - - p = vmalloc(bytes); - if (p == NULL) { - pr_info("viomem: vmalloc failed for %llu bytes\n", bytes); - return -ENOMEM; - } - gctx.sh_mem = p; - gctx.allocatedmem = bytes; - return 0; -} - -/* - *--------------------------------------------------------------------------- - * - * viomem_ensure_shmem_locked -- - * - * First-time allocation: vmalloc(memsize_mb) when mmap runs. Caller - * holds gctx.lock. - * - *--------------------------------------------------------------------------- - */ - -static int viomem_ensure_shmem_locked(void) -{ - unsigned long long bytes; - - if (gctx.sh_mem != NULL) - return 0; - - bytes = (unsigned long long)memsize_mb * 1024ULL * 1024ULL; - if (bytes < SIZE_512M || bytes >= MAX_SIZE) { - pr_info("viomem: invalid memsize_mb %lu for lazy alloc\n", memsize_mb); - return -EINVAL; - } - return viomem_alloc_shmem_locked(bytes); -} - - -/* - *--------------------------------------------------------------------------- - * - * viomem_release -- - * - * Executed once the device is closed or released by userspace - * - * @param inodep: pointer to struct inode - * @param filep: pointer to struct file - * Results: - * int - * - *--------------------------------------------------------------------------- - */ - -static int viomem_release(struct inode *inodep, struct file *filep) -{ - mutex_lock(&gctx.lock); - gctx.refcount--; - pr_debug("viomem: refcount %u Device successfully closed\n", gctx.refcount); - mutex_unlock(&gctx.lock); - - return 0; -} - -/* - *--------------------------------------------------------------------------- - * - * viomem_open -- - * - * Executed once the device is opened. - * - * @param inodep: pointer to struct inode - * @param filep: pointer to struct file - * Results: - * int - * - *--------------------------------------------------------------------------- - */ - -static int viomem_open(struct inode *inodep, struct file *filep) -{ - /* Only allow for SYS_ADMIN capability user to access the device .*/ - if (!capable(CAP_SYS_ADMIN)) { - return -EACCES; - } - - mutex_lock(&gctx.lock); - gctx.refcount++; - pr_debug("viomem: refcount:%u Device opened\n", gctx.refcount); - mutex_unlock(&gctx.lock); - - return 0; -} - - -/* - *--------------------------------------------------------------------------- - * - * viomem_ioctl -- - * - * GET_PFN (active mmap only). SET_MAP_SIZE updates memsize_mb only - * (before first mmap); backing store is allocated on first mmap. - * GET_MAP_SIZE anytime. - * - * @param filep: pointer to struct file - * @param cmd: command for ioctl - * @param arg: Userspae argument - * - * Results: - * int - * - *--------------------------------------------------------------------------- - */ - -static long viomem_ioctl(struct file *filep, unsigned int cmd, - unsigned long arg) -{ - int ret = 0; - - pr_debug("viomem: ioctl cmd is %d", cmd); - - switch (cmd) { - case IOCTL_GET_PFN: { - int i; - unsigned long pageoff; - struct ioctldata *datap = vmalloc(sizeof(struct ioctldata)); - - if (datap == NULL) { - pr_info("viomem: failed in allocation of memory in ioctl"); - return -ENOMEM; - } - - ret = copy_from_user(datap, (void *)arg, sizeof(struct ioctldata)); - if (ret != 0) { - pr_info("viomem: failed in copy_from_user"); - ret = -EFAULT; - goto pfn_out; - } - - if (gctx.mmap_count == 0) { - pr_info("viomem: GET_PFN requires an active mmap"); - ret = -EINVAL; - goto pfn_out; - } - - if (gctx.sh_mem == NULL) { - pr_info("viomem: GET_PFN: missing backing store"); - ret = -EINVAL; - goto pfn_out; - } - - if (datap->array_size > (gctx.allocatedmem / PAGE_SIZE)) { - pr_info("viomem: Invalid size of array %d", datap->array_size); - ret = -EINVAL; - goto pfn_out; - } - - if (datap->offset > gctx.allocatedmem) { - pr_info("viomem: Invalid offset for ioctl"); - ret = -EINVAL; - goto pfn_out; - } - - if (datap->offset % PAGE_SIZE != 0) { - pr_info("viomem: start offset should be multiple of PAGE_SIZE: " - "%lu", datap->offset); - ret = -EINVAL; - goto pfn_out; - } - - pageoff = datap->offset / PAGE_SIZE; - pr_debug("viomem: offset %lu array_size %d pageoff %lu ", - datap->offset, datap->array_size, pageoff); - for (i = 0; i < datap->array_size; i++, pageoff++) { - void *ptrend = gctx.sh_mem + (pageoff << PAGE_SHIFT); - if (ptrend >= (gctx.sh_mem + gctx.allocatedmem)) { - pr_info("viomem: memory off bounds"); - ret = -EINVAL; - goto pfn_out; - } - - { - unsigned long pfn = vmalloc_to_pfn(ptrend); - struct ioctldata *userdatap = (struct ioctldata *)arg; - - pr_debug("viomem: page no %d to copy %lu", i, pfn); - ret = copy_to_user((void *)(&userdatap->pfn[i]), - &pfn, sizeof(pfn)); - if (ret != 0) { - pr_info("viomem: failed in copy_to_user"); - ret = -EFAULT; - goto pfn_out; - } - } - } - ret = 0; -pfn_out: - vfree(datap); - break; - } - - case IOCTL_SET_MAP_SIZE: { - unsigned long long size_mb = 0; - unsigned long long size; - - ret = copy_from_user(&size_mb, (void *)arg, sizeof(size_mb)); - if (ret != 0) { - pr_info("viomem: failed in copy_from_user"); - ret = -EFAULT; - break; - } - - size = size_mb * 1024ULL * 1024ULL; - if (size < SIZE_512M || size >= MAX_SIZE) { - pr_info("viomem: map_size %llu must be in [512M, MAX_SIZE)", - size); - ret = -EINVAL; - break; - } - - if (size % SIZE_2M != 0) { - pr_info("viomem: map_size %llu is not 2M aligned", size); - ret = -EINVAL; - break; - } - - mutex_lock(&gctx.lock); - if (gctx.size_locked) { - pr_info("viomem: map size locked after first mmap\n"); - ret = -EBUSY; - } else { - memsize_mb = (unsigned long)size_mb; - ret = 0; - } - mutex_unlock(&gctx.lock); - - if (ret == 0) - pr_info("viomem: map_size (logical) %llu MiB; alloc on mmap\n", - size_mb); - break; - } - - case IOCTL_GET_MAP_SIZE: { - unsigned long long size_mb; - - mutex_lock(&gctx.lock); - size_mb = memsize_mb; - mutex_unlock(&gctx.lock); - - ret = copy_to_user((void *)arg, &size_mb, sizeof(size_mb)); - if (ret != 0) { - pr_info("viomem: failed in copy_to_user (GET_MAP_SIZE)"); - ret = -EFAULT; - } - break; - } - - default : - pr_debug("viomem : Unhandled IOCTL command"); - ret = -EINVAL; - } - - return ret; -} - - -/* - *--------------------------------------------------------------------------- - * - * viomem_vma_open / viomem_vma_close -- - * - * Track active mmap VMAs (fork duplicates call open; unmap/exit calls - * close). Initial mmap increments mmap_count in viomem_mmap. - * - *--------------------------------------------------------------------------- - */ - -static void viomem_vma_open(struct vm_area_struct *vma) -{ - mutex_lock(&gctx.lock); - gctx.mmap_count++; - mutex_unlock(&gctx.lock); -} - -static void viomem_vma_close(struct vm_area_struct *vma) -{ - mutex_lock(&gctx.lock); - gctx.mmap_count--; - mutex_unlock(&gctx.lock); -} - -static const struct vm_operations_struct viomem_vm_ops = { - .open = viomem_vma_open, - .close = viomem_vma_close, -}; - - -/* - *--------------------------------------------------------------------------- - * - * viomem_mmap -- - * - * mmap handler to map kernel space to user space - * - * @param inodep: pointer to struct inode - * @param vma: pointer to struct vm_area_struct - * Results: - * int - * - *--------------------------------------------------------------------------- - */ - -static int viomem_mmap(struct file *filp, struct vm_area_struct *vma) -{ - int ret = 0; - unsigned long size = (unsigned long)(vma->vm_end - vma->vm_start); - int npages, i; - unsigned long vastart = vma->vm_start; - unsigned long pageoff = vma->vm_pgoff; - - mutex_lock(&gctx.lock); - - ret = viomem_ensure_shmem_locked(); - if (ret != 0) { - pr_info("viomem: ensure shmem failed in mmap (%d)\n", ret); - goto out; - } - - pr_debug("viomem: mmap , start = %lu end = %lu size = %lu pageoff %lu allocated %llu ", - vma->vm_start, vma->vm_end, size, pageoff, gctx.allocatedmem); - if (size > gctx.allocatedmem) { - pr_info("viomem: mmap wrong length size %lu allocatedmem %llu \n", size, - gctx.allocatedmem); - ret = -EINVAL; - goto out; - } - - if (size % PAGE_SIZE != 0) { - pr_info("viomem: mmap size is not page aligned\n"); - ret = -EINVAL; - goto out; - } - - npages = size / PAGE_SIZE; - - for (i = 0; i < npages; i++) { - void *ptrend = gctx.sh_mem + (pageoff << PAGE_SHIFT); - if (ptrend >= gctx.sh_mem + gctx.allocatedmem) { - pr_info("viomem: memory off bounds"); - ret = -EINVAL; - goto out; - } - unsigned long pfn = vmalloc_to_pfn(ptrend); - ret = remap_pfn_range(vma, vastart, pfn, PAGE_SIZE, vma->vm_page_prot); - if (ret != 0) { - goto out; - } - pageoff++; - vastart += PAGE_SIZE; - } - - if (ret == 0) { - gctx.mmap_count++; - gctx.size_locked = true; - vma->vm_ops = &viomem_vm_ops; - } - -out: - mutex_unlock(&gctx.lock); - return ret; -} - - -/* initialize our handlers */ -static const struct file_operations viomem_fops = { - .open = viomem_open, - .release = viomem_release, - .mmap = viomem_mmap, - .unlocked_ioctl = viomem_ioctl, - .owner = THIS_MODULE, -}; - - -/* - *--------------------------------------------------------------------------- - * - * viomem_init -- - * - * Called when inserting the module - * - * Results: - * int - * - *--------------------------------------------------------------------------- -*/ - -static int __init viomem_init(void) -{ - int ret = 0; - - pr_info("viomem: Module parameter memsize_mb %lu\n", memsize_mb); - if (((unsigned long long)memsize_mb * 1024ULL * 1024ULL) < SIZE_512M || - ((unsigned long long)memsize_mb * 1024ULL * 1024ULL) > MAX_SIZE) { - pr_info("viomem: memsize_mb out of range (need 512M..MAX_SIZE)\n"); - ret = -EINVAL; - return ret; - } - - gctx.major = register_chrdev(0, DEVICE_NAME, &viomem_fops); - if (gctx.major < 0) { - pr_info("viomem: fail to register major number!"); - return gctx.major; - } - - gctx.class = class_create(CLASS_NAME); - if (IS_ERR(gctx.class)){ - pr_info("viomem: failed to register device class"); - ret = PTR_ERR(gctx.class); - goto error_class_create; - } - - gctx.device = device_create(gctx.class, NULL, MKDEV(gctx.major, 0), NULL, - DEVICE_NAME); - if (IS_ERR(gctx.device)) { - pr_info("viomem: failed in device_create\n"); - ret = PTR_ERR(gctx.device); - goto error_device_create; - } - - mutex_init(&gctx.lock); - - return ret; - -error_device_create: - class_destroy(gctx.class); -error_class_create: - unregister_chrdev(gctx.major, DEVICE_NAME); - pr_info("viomem: Failed in init unregistered!"); - - return ret; -} - - -/* - *--------------------------------------------------------------------------- - * - * viomem_exit -- - * - * Called when removing the module - * - * Results: - * void - * - *--------------------------------------------------------------------------- -*/ - -static void __exit viomem_exit(void) -{ - mutex_lock(&gctx.lock); - pr_info("viomem: unregistering refcount %d", gctx.refcount); - if (gctx.refcount > 0) { - pr_warn("Device is busy\n"); - mutex_unlock(&gctx.lock); - return; - } - mutex_unlock(&gctx.lock); - - mutex_destroy(&gctx.lock); - device_destroy(gctx.class, MKDEV(gctx.major, 0)); - class_destroy(gctx.class); - unregister_chrdev(gctx.major, DEVICE_NAME); - - if (gctx.sh_mem != NULL) { - vfree(gctx.sh_mem); - } - pr_info("viomem: unregistered!"); -} - -module_init(viomem_init); -module_exit(viomem_exit); -MODULE_LICENSE("GPL v2"); diff --git a/SPECS/91/linux/vmw/0001-Add-PCI-quirk-for-VMware-PCIe-Root-Port.patch b/SPECS/91/linux/vmw/0001-Add-PCI-quirk-for-VMware-PCIe-Root-Port.patch deleted file mode 100644 index 296cd4adc9..0000000000 --- a/SPECS/91/linux/vmw/0001-Add-PCI-quirk-for-VMware-PCIe-Root-Port.patch +++ /dev/null @@ -1,48 +0,0 @@ -From f5305072a7c45071853301c61caacc7d94239c93 Mon Sep 17 00:00:00 2001 -From: Todd Sabin -Date: Thu, 22 Jul 2021 18:20:09 -0400 -Subject: [PATCH] Add PCI quirk for VMware PCIe Root Port - -Add a PCI quirk entry for the VMware virtual PCIe Root Port, -which will allow multiple devices under the same virtual PCI -bridge to be put into separate IOMMU groups. - -Signed-off-by: Todd Sabin -Signed-off-by: Srivatsa S. Bhat (VMware) ---- - drivers/pci/quirks.c | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - -diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c -index 8d32a3834..15789cf85 100644 ---- a/drivers/pci/quirks.c -+++ b/drivers/pci/quirks.c -@@ -4868,6 +4868,19 @@ static int pci_quirk_wangxun_nic_acs(struct pci_dev *dev, u16 acs_flags) - return false; - } - -+static int pci_quirk_vmw_rp_acs(struct pci_dev *dev, u16 acs_flags) -+{ -+ /* -+ * VMware virtual PCIe Root Ports do not indicate ACS -+ * capability, but the ESXi hypervisor prevents direct -+ * peer-to-peer transactions between Root Ports. Claim -+ * SV/RR/CR/UF bits to allow separate IOMMU groups per Root -+ * Port. -+ */ -+ return pci_acs_ctrl_enabled(acs_flags, -+ PCI_ACS_SV | PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF); -+} -+ - static const struct pci_dev_acs_enabled { - u16 vendor; - u16 device; -@@ -5015,6 +5028,8 @@ static const struct pci_dev_acs_enabled { - { PCI_VENDOR_ID_ZHAOXIN, PCI_ANY_ID, pci_quirk_zhaoxin_pcie_ports_acs }, - /* Wangxun nics */ - { PCI_VENDOR_ID_WANGXUN, PCI_ANY_ID, pci_quirk_wangxun_nic_acs }, -+ /* VMware PCIe Root Port */ -+ { PCI_VENDOR_ID_VMWARE, 0x07a0, pci_quirk_vmw_rp_acs }, - { 0 } - }; - diff --git a/SPECS/91/linux/vmw/0001-ptp-ptp_vmw-Implement-PTP-clock-adjustments-ops.patch b/SPECS/91/linux/vmw/0001-ptp-ptp_vmw-Implement-PTP-clock-adjustments-ops.patch deleted file mode 100644 index 25a49d6c4d..0000000000 --- a/SPECS/91/linux/vmw/0001-ptp-ptp_vmw-Implement-PTP-clock-adjustments-ops.patch +++ /dev/null @@ -1,122 +0,0 @@ -From d8d533c9a8b2bc69dd690e003227f959679c2a57 Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Sat, 21 Sep 2024 06:20:22 +0000 -Subject: [PATCH 1/2] ptp/ptp_vmw: Implement PTP clock adjustments ops - -Implement PTP clock ops that set time and frequency of the underlying -clock. On supported versions of VMware precision clock virtual device, -new commands can adjust its time and frequency, allowing time transfer -from a virtual machine to the underlying hypervisor. - -In case of error, vmware_hypercall doesn't return Linux defined errno, -converting it to -EIO. - -Cc: Shubham Gupta -Cc: Nick Shi -Tested-by: Karen Wang -Signed-off-by: Vivek Thampi -Signed-off-by: Ajay Kaher ---- - drivers/ptp/ptp_vmw.c | 39 +++++++++++++++++++++++++++++---------- - 1 file changed, 29 insertions(+), 10 deletions(-) - -diff --git a/drivers/ptp/ptp_vmw.c b/drivers/ptp/ptp_vmw.c -index 20ab05c..a18ba72 100644 ---- a/drivers/ptp/ptp_vmw.c -+++ b/drivers/ptp/ptp_vmw.c -@@ -1,6 +1,7 @@ - // SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause - /* -- * Copyright (C) 2020 VMware, Inc., Palo Alto, CA., USA -+ * Copyright (C) 2020-2023 VMware, Inc., Palo Alto, CA., USA -+ * Copyright (C) 2024 Broadcom Ltd. - * - * PTP clock driver for VMware precision clock virtual device. - */ -@@ -16,20 +17,36 @@ - - #define VMWARE_CMD_PCLK(nr) ((nr << 16) | 97) - #define VMWARE_CMD_PCLK_GETTIME VMWARE_CMD_PCLK(0) -+#define VMWARE_CMD_PCLK_SETTIME VMWARE_CMD_PCLK(1) -+#define VMWARE_CMD_PCLK_ADJTIME VMWARE_CMD_PCLK(2) -+#define VMWARE_CMD_PCLK_ADJFREQ VMWARE_CMD_PCLK(3) - - static struct acpi_device *ptp_vmw_acpi_device; - static struct ptp_clock *ptp_vmw_clock; - -+/* -+ * Helpers for reading and writing to precision clock device. -+ */ - --static int ptp_vmw_pclk_read(u64 *ns) -+static int ptp_vmw_pclk_read(int cmd, u64 *ns) - { - u32 ret, nsec_hi, nsec_lo; - -- ret = vmware_hypercall3(VMWARE_CMD_PCLK_GETTIME, 0, -- &nsec_hi, &nsec_lo); -+ ret = vmware_hypercall3(cmd, 0, &nsec_hi, &nsec_lo); - if (ret == 0) - *ns = ((u64)nsec_hi << 32) | nsec_lo; -- return ret; -+ -+ return ret != 0 ? -EIO : 0; -+} -+ -+static int ptp_vmw_pclk_write(int cmd, u64 in) -+{ -+ u32 ret, unused; -+ -+ ret = vmware_hypercall5(cmd, 0, 0, in >> 32, in & 0xffffffff, -+ &unused); -+ -+ return ret != 0 ? -EIO : 0; - } - - /* -@@ -38,19 +55,19 @@ static int ptp_vmw_pclk_read(u64 *ns) - - static int ptp_vmw_adjtime(struct ptp_clock_info *info, s64 delta) - { -- return -EOPNOTSUPP; -+ return ptp_vmw_pclk_write(VMWARE_CMD_PCLK_ADJTIME, (u64)delta); - } - - static int ptp_vmw_adjfine(struct ptp_clock_info *info, long delta) - { -- return -EOPNOTSUPP; -+ return ptp_vmw_pclk_write(VMWARE_CMD_PCLK_ADJFREQ, (u64)delta); - } - - static int ptp_vmw_gettime(struct ptp_clock_info *info, struct timespec64 *ts) - { - u64 ns; - -- if (ptp_vmw_pclk_read(&ns) != 0) -+ if (ptp_vmw_pclk_read(VMWARE_CMD_PCLK_GETTIME, &ns) != 0) - return -EIO; - *ts = ns_to_timespec64(ns); - return 0; -@@ -59,7 +76,9 @@ static int ptp_vmw_gettime(struct ptp_clock_info *info, struct timespec64 *ts) - static int ptp_vmw_settime(struct ptp_clock_info *info, - const struct timespec64 *ts) - { -- return -EOPNOTSUPP; -+ u64 ns = timespec64_to_ns(ts); -+ -+ return ptp_vmw_pclk_write(VMWARE_CMD_PCLK_SETTIME, ns); - } - - static int ptp_vmw_enable(struct ptp_clock_info *info, -@@ -71,7 +90,7 @@ static int ptp_vmw_enable(struct ptp_clock_info *info, - static struct ptp_clock_info ptp_vmw_clock_info = { - .owner = THIS_MODULE, - .name = "ptp_vmw", -- .max_adj = 0, -+ .max_adj = 500000, - .adjtime = ptp_vmw_adjtime, - .adjfine = ptp_vmw_adjfine, - .gettime64 = ptp_vmw_gettime, --- -2.39.4 - diff --git a/SPECS/91/linux/vmw/0001-vmgenid-expose-vmgenid-via-sysfs.patch b/SPECS/91/linux/vmw/0001-vmgenid-expose-vmgenid-via-sysfs.patch deleted file mode 100644 index 7fe0e2277f..0000000000 --- a/SPECS/91/linux/vmw/0001-vmgenid-expose-vmgenid-via-sysfs.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 31716a8f2399dfbd10ff370dca03b5b5ecc63ba7 Mon Sep 17 00:00:00 2001 -From: Guruswamy Basavaiah -Date: Sat, 3 Jan 2026 01:30:07 +0530 -Subject: [PATCH] vmgenid: expose vmgenid via sysfs - -Make VM generation ID available as a hex string in /sys/kernel/vmgenid. -Using this ID userspace can detect if VM was cloned or modified. - -Signed-off-by: Alexey Makhalov -[Guru: Ported to 6.12 kernel from 6.1. 6.12 kernel vmgenid_add -function now modified to handle device tree. -Modified the patch accordingly.] -Signed-off-by: Guruswamy Basavaiah ---- - drivers/virt/vmgenid.c | 39 ++++++++++++++++++++++++++++++++++++++- - 1 file changed, 38 insertions(+), 1 deletion(-) - -diff --git a/drivers/virt/vmgenid.c b/drivers/virt/vmgenid.c -index 66135eac3abf..4192e4fed02e 100644 ---- a/drivers/virt/vmgenid.c -+++ b/drivers/virt/vmgenid.c -@@ -21,15 +21,37 @@ enum { VMGENID_SIZE = 16 }; - struct vmgenid_state { - u8 *next_id; - u8 this_id[VMGENID_SIZE]; -+ spinlock_t lock; /* to protect this_id */ -+ struct kobj_attribute kobj_attr; - }; - -+static ssize_t vmgenid_show(struct kobject *kobj, struct kobj_attribute *attr, -+ char *page) -+{ -+ struct vmgenid_state *state = container_of(attr, struct vmgenid_state, kobj_attr); -+ u8 id[VMGENID_SIZE]; -+ unsigned long flags; -+ -+ /* To avoid reading partially modified ID */ -+ spin_lock_irqsave(&state->lock, flags); -+ memcpy(id, state->this_id, sizeof(id)); -+ spin_unlock_irqrestore(&state->lock, flags); -+ -+ return sysfs_emit(page, "%*phN\n", VMGENID_SIZE, id); -+} -+ - static void vmgenid_notify(struct device *device) - { - struct vmgenid_state *state = device->driver_data; - u8 old_id[VMGENID_SIZE]; -+ unsigned long flags; - - memcpy(old_id, state->this_id, sizeof(old_id)); -+ -+ spin_lock_irqsave(&state->lock, flags); - memcpy(state->this_id, state->next_id, sizeof(state->this_id)); -+ spin_unlock_irqrestore(&state->lock, flags); -+ - if (!memcmp(old_id, state->this_id, sizeof(old_id))) - return; - add_vmfork_randomness(state->this_id, sizeof(state->this_id)); -@@ -136,7 +158,7 @@ static int vmgenid_add(struct platform_device *pdev) - { - struct device *dev = &pdev->dev; - struct vmgenid_state *state; -- int ret; -+ int rc, ret; - - state = devm_kmalloc(dev, sizeof(*state), GFP_KERNEL); - if (!state) -@@ -149,6 +171,21 @@ static int vmgenid_add(struct platform_device *pdev) - - if (ret < 0) - devm_kfree(dev, state); -+ else { -+ spin_lock_init(&state->lock); -+ -+ state->kobj_attr.attr.name = "vmgenid"; -+ state->kobj_attr.attr.mode = 0444; -+ state->kobj_attr.show = vmgenid_show; -+ rc = sysfs_add_file_to_group(kernel_kobj, &state->kobj_attr.attr, NULL); -+ if (rc) { -+ /* -+ * Throw an error message and go forward. Continue using -+ * vmgenid device without sysfs entry. -+ */ -+ dev_err(dev, "Error adding sysfs file [%d]\n", rc); -+ } -+ } - return ret; - } - --- -2.43.0 - diff --git a/SPECS/91/linux/vmw/0001-vmxnet3_support_higher_link_speeds_from_vmxnet3_v9.patch b/SPECS/91/linux/vmw/0001-vmxnet3_support_higher_link_speeds_from_vmxnet3_v9.patch deleted file mode 100644 index 583dbfe1f6..0000000000 --- a/SPECS/91/linux/vmw/0001-vmxnet3_support_higher_link_speeds_from_vmxnet3_v9.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 15eddcfdfe7249e19ec89ba5dd939a5c48b59760 Mon Sep 17 00:00:00 2001 -From: Ronak Doshi -Date: Fri, 4 Oct 2024 10:43:03 -0700 -Subject: [PATCH] vmxnet3: support higher link speeds from vmxnet3 v9 - -commit 0458cbedfe35a2762fc82ddf38e004cc886b9ed4 upstream - -Until now, vmxnet3 was default reporting 10Gbps as link speed. -Vmxnet3 v9 adds support for user to configure higher link speeds. -User can configure the link speed via VMs advanced parameters options -in VCenter. This speed is reported in gbps by hypervisor. - -This patch adds support for vmxnet3 to report higher link speeds and -converts it to mbps as expected by Linux stack. - -Signed-off-by: Ronak Doshi -Acked-by: Guolin Yang -Reviewed-by: Simon Horman -Link: https://patch.msgid.link/20241004174303.5370-1-ronak.doshi@broadcom.com -Signed-off-by: Jakub Kicinski -Signed-off-by: Ajay Kaher ---- - drivers/net/vmxnet3/vmxnet3_drv.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c -index e1e472b3a..287b7c20c 100644 ---- a/drivers/net/vmxnet3/vmxnet3_drv.c -+++ b/drivers/net/vmxnet3/vmxnet3_drv.c -@@ -201,6 +201,14 @@ vmxnet3_check_link(struct vmxnet3_adapter *adapter, bool affectTxQueue) - - adapter->link_speed = ret >> 16; - if (ret & 1) { /* Link is up. */ -+ /* -+ * From vmxnet3 v9, the hypervisor reports the speed in Gbps. -+ * Convert the speed to Mbps before rporting it to the kernel. -+ * Max link speed supported is 10000G. -+ */ -+ if (VMXNET3_VERSION_GE_9(adapter) && -+ adapter->link_speed < 10000) -+ adapter->link_speed = adapter->link_speed * 1000; - netdev_info(adapter->netdev, "NIC Link is Up %d Mbps\n", - adapter->link_speed); - netif_carrier_on(adapter->netdev); --- -2.39.4 - diff --git a/SPECS/91/linux/vmw/0001-x86-report-guest-crash-to-vmware-hypervisor.patch b/SPECS/91/linux/vmw/0001-x86-report-guest-crash-to-vmware-hypervisor.patch deleted file mode 100644 index 5fc993ef33..0000000000 --- a/SPECS/91/linux/vmw/0001-x86-report-guest-crash-to-vmware-hypervisor.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 82fc8b8a10349ec149c45a03ca8307b1f2793033 Mon Sep 17 00:00:00 2001 -From: Brennan Lamoreaux -Date: Tue, 1 Jul 2025 18:38:14 +0000 -Subject: [PATCH] x86: report guest crash to vmware hypervisor - -Register the guest crash reporter to panic_notifier_list, -which will be called at panic time. Guest crash reporter -will report the crash to the hypervisor through -a hypercall. - -Signed-off-by: Brennan Lamoreaux ---- - arch/x86/include/asm/vmware.h | 1 + - arch/x86/kernel/cpu/vmware.c | 21 +++++++++++++++++++++ - 2 files changed, 22 insertions(+) - -diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h -index d70ee4c0e..03e487151 100644 ---- a/arch/x86/include/asm/vmware.h -+++ b/arch/x86/include/asm/vmware.h -@@ -62,6 +62,7 @@ - #define VMWARE_CMD_GETHZ 45 - #define VMWARE_CMD_GETVCPU_INFO 68 - #define VMWARE_CMD_STEALCLOCK 91 -+#define VMWARE_CMD_REPORTGUESTCRASH 102 - /* - * Hypercall command mask: - * bits [6:0] command, range [0, 127] -diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c -index 8b6728509..909bac6ce 100644 ---- a/arch/x86/kernel/cpu/vmware.c -+++ b/arch/x86/kernel/cpu/vmware.c -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -410,6 +411,24 @@ static void __init vmware_paravirt_ops_setup(void) - #define vmware_paravirt_ops_setup() do {} while (0) - #endif - -+static int vmware_report_guest_crash(struct notifier_block *self, -+ unsigned long action, void *data) -+{ -+ vmware_hypercall1(VMWARE_CMD_REPORTGUESTCRASH, 0); -+ return 0; -+} -+ -+static struct notifier_block guest_crash_reporter = { -+ .notifier_call = vmware_report_guest_crash -+}; -+ -+static int __init register_guest_crash_reporter(void) -+{ -+ atomic_notifier_chain_register(&panic_notifier_list, -+ &guest_crash_reporter); -+ -+ return 0; -+} - /* - * VMware hypervisor takes care of exporting a reliable TSC to the guest. - * Still, due to timing difference when running on virtual cpus, the TSC can -@@ -480,6 +499,8 @@ static void __init vmware_platform_setup(void) - vmware_set_capabilities(); - - kmsg_dump_register(&kmsg_dumper); -+ -+ register_guest_crash_reporter(); - } - - static u8 __init vmware_select_hypercall(void) --- -2.43.7 - diff --git a/SPECS/91/linux/vmw/0001-x86-vmware-Redefine-the-macro-of-CPUID_VMWARE.patch b/SPECS/91/linux/vmw/0001-x86-vmware-Redefine-the-macro-of-CPUID_VMWARE.patch deleted file mode 100644 index a2c4b6db44..0000000000 --- a/SPECS/91/linux/vmw/0001-x86-vmware-Redefine-the-macro-of-CPUID_VMWARE.patch +++ /dev/null @@ -1,45 +0,0 @@ -From addd2bc952dea388aa9622b4369213f96b1cca29 Mon Sep 17 00:00:00 2001 -From: srinidhira0 -Date: Mon, 25 Nov 2024 06:41:42 +0000 -Subject: [PATCH] x86/vmware: Redefine the macro of CPUID_VMWARE - - - Redefine the Macro definitions related to CPUI_VMWARE in - early_serial_console as it is required to initialize - early console for vmware specific platforms. - -Signed-off-by: srinidhira0 ---- - arch/x86/boot/early_serial_console.c | 4 +++- - arch/x86/include/asm/vmware.h | 1 + - 2 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c -index 9efbc1f6e..d649668d1 100644 ---- a/arch/x86/boot/early_serial_console.c -+++ b/arch/x86/boot/early_serial_console.c -@@ -5,7 +5,9 @@ - */ - #include "boot.h" - #include "string.h" --#include -+ -+#define CPUID_VMWARE_INFO_LEAF 0x40000000 -+#define CPUID_VMWARE_FEATURES_LEAF 0x40000010 - - #define DEFAULT_SERIAL_PORT 0x3f8 /* ttyS0 */ - -diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h -index c9cf43d5e..f71e4b5de 100644 ---- a/arch/x86/include/asm/vmware.h -+++ b/arch/x86/include/asm/vmware.h -@@ -2,6 +2,7 @@ - #ifndef _ASM_X86_VMWARE_H - #define _ASM_X86_VMWARE_H - -+#include - #include - #include - #include --- -2.39.4 - diff --git a/SPECS/91/linux/vmw/0002-ptp-ptp_vmw-Add-module-param-to-probe-device-using-h.patch b/SPECS/91/linux/vmw/0002-ptp-ptp_vmw-Add-module-param-to-probe-device-using-h.patch deleted file mode 100644 index 6877dad4d0..0000000000 --- a/SPECS/91/linux/vmw/0002-ptp-ptp_vmw-Add-module-param-to-probe-device-using-h.patch +++ /dev/null @@ -1,135 +0,0 @@ -From a95c6122ac989794e330fb81b1698ea5c3074a80 Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Sat, 21 Sep 2024 06:35:11 +0000 -Subject: [PATCH 2/2] ptp/ptp_vmw: load ptp_vmw driver by directly probing the - device - -For scenerios when ACPI is disabled, allow ptp_vmw driver to be -loaded by directly probing for the device using VMware hypercalls. - -VMware precision clock virtual device is exposed as a platform ACPI -device in its virtual chipset hardware. Its driver - ptp_vmw - is -registered with the ACPI bus for discovery and binding. On systems -where ACPI is disabled, such as virtual machines optimized for fast -boot times, this means that the device is not discoverable and cannot -be loaded. Since the device operations are performed via VMware -hypercalls, the ACPI sub-system can be by-passed and manually loaded. - -Cc: Shubham Gupta -Cc: Nick Shi -Tested-by: Karen Wang -Signed-off-by: Vivek Thampi -Signed-off-by: Ajay Kaher ---- - drivers/ptp/ptp_vmw.c | 71 +++++++++++++++++++++++++++++++++++-------- - 1 file changed, 59 insertions(+), 12 deletions(-) - -diff --git a/drivers/ptp/ptp_vmw.c b/drivers/ptp/ptp_vmw.c -index a18ba72..ce44b12 100644 ---- a/drivers/ptp/ptp_vmw.c -+++ b/drivers/ptp/ptp_vmw.c -@@ -98,25 +98,41 @@ static struct ptp_clock_info ptp_vmw_clock_info = { - .enable = ptp_vmw_enable, - }; - -+static int ptp_vmw_clock_register(void) -+{ -+ ptp_vmw_clock = ptp_clock_register(&ptp_vmw_clock_info, NULL); -+ if (IS_ERR(ptp_vmw_clock)) { -+ pr_err("ptp_vmw: Failed to register ptp clock\n"); -+ return PTR_ERR(ptp_vmw_clock); -+ } -+ pr_debug("ptp_vmw: ptp clock registered\n"); -+ return 0; -+} -+ -+static void ptp_vmw_clock_unregister(void) -+{ -+ ptp_clock_unregister(ptp_vmw_clock); -+ ptp_vmw_clock = NULL; -+ pr_debug("ptp_vmw: ptp clock unregistered\n"); -+} -+ - /* - * ACPI driver ops for VMware "precision clock" virtual device. - */ - - static int ptp_vmw_acpi_add(struct acpi_device *device) - { -- ptp_vmw_clock = ptp_clock_register(&ptp_vmw_clock_info, NULL); -- if (IS_ERR(ptp_vmw_clock)) { -- pr_err("failed to register ptp clock\n"); -- return PTR_ERR(ptp_vmw_clock); -- } -+ int ret = ptp_vmw_clock_register(); - -- ptp_vmw_acpi_device = device; -- return 0; -+ if (ret == 0) -+ ptp_vmw_acpi_device = device; -+ return ret; - } - - static void ptp_vmw_acpi_remove(struct acpi_device *device) - { -- ptp_clock_unregister(ptp_vmw_clock); -+ ptp_vmw_clock_unregister(); -+ ptp_vmw_acpi_device = NULL; - } - - static const struct acpi_device_id ptp_vmw_acpi_device_ids[] = { -@@ -135,16 +151,47 @@ static struct acpi_driver ptp_vmw_acpi_driver = { - }, - }; - -+/* -+ * Probe existence of device by poking at a command. If successful, -+ * register as a PTP clock. This is a fallback option for when ACPI -+ * is not available. -+ */ -+static int ptp_vmw_probe(void) -+{ -+ u64 ns; -+ -+ return ptp_vmw_pclk_read(VMWARE_CMD_PCLK_GETTIME, &ns); -+} -+ - static int __init ptp_vmw_init(void) - { -- if (x86_hyper_type != X86_HYPER_VMWARE) -- return -1; -- return acpi_bus_register_driver(&ptp_vmw_acpi_driver); -+ -+ int error = -ENODEV; -+ -+ if (x86_hyper_type != X86_HYPER_VMWARE) { -+ error = -EINVAL; -+ goto out; -+ } -+ -+ if (!acpi_disabled) { -+ error = acpi_bus_register_driver(&ptp_vmw_acpi_driver); -+ if (!error) -+ goto out; -+ } -+ -+ if (!ptp_vmw_probe()) -+ error = ptp_vmw_clock_register(); -+ -+out: -+ return error; - } - - static void __exit ptp_vmw_exit(void) - { -- acpi_bus_unregister_driver(&ptp_vmw_acpi_driver); -+ if (!acpi_disabled && ptp_vmw_acpi_device) -+ acpi_bus_unregister_driver(&ptp_vmw_acpi_driver); -+ else if (ptp_vmw_clock) -+ ptp_vmw_clock_unregister(); - } - - module_init(ptp_vmw_init); --- -2.39.4 - diff --git a/SPECS/91/linux/vmw/0009-esx-vmxnet3-software-timestamping.patch b/SPECS/91/linux/vmw/0009-esx-vmxnet3-software-timestamping.patch deleted file mode 100644 index 58935d53c8..0000000000 --- a/SPECS/91/linux/vmw/0009-esx-vmxnet3-software-timestamping.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -Naur a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c ---- a/drivers/net/vmxnet3/vmxnet3_drv.c 2020-11-09 23:46:32.741883266 -0800 -+++ b/drivers/net/vmxnet3/vmxnet3_drv.c 2020-11-09 23:44:22.621643088 -0800 -@@ -1099,6 +1099,9 @@ - goto drop_pkt; - } - -+ /* timestamp packet in software */ -+ skb_tx_timestamp(skb); -+ - spin_lock_irqsave(&tq->tx_lock, flags); - - if (count > vmxnet3_cmd_ring_desc_avail(&tq->tx_ring)) { -diff -Naur a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c ---- a/drivers/net/vmxnet3/vmxnet3_ethtool.c 2020-11-09 23:38:51.529031950 -0800 -+++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c 2020-11-09 23:47:53.082031551 -0800 -@@ -1204,6 +1204,7 @@ - .set_ringparam = vmxnet3_set_ringparam, - .get_rxnfc = vmxnet3_get_rxnfc, - .set_rxnfc = vmxnet3_set_rxnfc, -+ .get_ts_info = ethtool_op_get_ts_info, - #ifdef VMXNET3_RSS - .get_rxfh_indir_size = vmxnet3_get_rss_indir_size, - .get_rxfh = vmxnet3_get_rss, diff --git a/SPECS/91/linux/vmw/x86-probe_roms-Skip-OpROM-probing-if-running-as-VMwa.patch b/SPECS/91/linux/vmw/x86-probe_roms-Skip-OpROM-probing-if-running-as-VMwa.patch deleted file mode 100644 index bc33bed8d5..0000000000 --- a/SPECS/91/linux/vmw/x86-probe_roms-Skip-OpROM-probing-if-running-as-VMwa.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 5731d56dd926dbbe88b79717a9b6f39913714a3c Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Thu, 23 Jan 2025 10:31:37 +0000 -Subject: [PATCH] x86/probe_roms: Skip OpROM probing if running as VMware - Guests - -Avoid unnecessary MMIO acesses that triggers VMEXITs, which could cause -performance degradation. Such MMIO VMEXITs also lead to unexpected #VC, -if SEV-ES was enabled. - -Signed-off-by: Bo Gan - ---- - arch/x86/kernel/probe_roms.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/arch/x86/kernel/probe_roms.c b/arch/x86/kernel/probe_roms.c -index cc2c34ba7..eb9b72a87 100644 ---- a/arch/x86/kernel/probe_roms.c -+++ b/arch/x86/kernel/probe_roms.c -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - - static struct resource system_rom_resource = { - .name = "System ROM", -@@ -203,6 +204,13 @@ void __init probe_roms(void) - unsigned char c; - int i; - -+ /* Stop probing if running under VMware -- avoid MMIO/VMEXITs */ -+ if (hypervisor_is_type(X86_HYPER_VMWARE)) { -+ request_resource(&iomem_resource, &video_rom_resource); -+ request_resource(&iomem_resource, &system_rom_resource); -+ return; -+ } -+ - /* video rom */ - upper = adapter_rom_resources[0].start; - for (start = video_rom_resource.start; start < upper; start += 2048) { --- -2.39.4 - diff --git a/SPECS/91/linux/vmw/x86-vmware-Log-kmsg-dump-on-panic.patch b/SPECS/91/linux/vmw/x86-vmware-Log-kmsg-dump-on-panic.patch deleted file mode 100644 index ef4b9d42de..0000000000 --- a/SPECS/91/linux/vmw/x86-vmware-Log-kmsg-dump-on-panic.patch +++ /dev/null @@ -1,192 +0,0 @@ -From 6804c10a076680c5b606d00bb9397fa0b732273e Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Mon, 24 Jun 2024 22:54:03 -0700 -Subject: [PATCH] x86/vmware: Log kmsg dump on panic - -Improve debugability of VMware Linux guests by dumping -kernel messages during a panic to VM log file (vmware.log). - -Co-developed-by: Bo Gan -Signed-off-by: Bo Gan -Signed-off-by: Alexey Makhalov ---- - arch/x86/include/asm/vmware.h | 1 + - arch/x86/kernel/cpu/vmware.c | 132 ++++++++++++++++++++++++++++++++++ - 2 files changed, 133 insertions(+) - -diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h -index c9cf43d5e..433755b41 100644 ---- a/arch/x86/include/asm/vmware.h -+++ b/arch/x86/include/asm/vmware.h -@@ -57,6 +57,7 @@ - #define VMWARE_HYPERVISOR_MAGIC 0x564d5868U - - #define VMWARE_CMD_GETVERSION 10 -+#define VMWARE_CMD_MESSAGE 30 - #define VMWARE_CMD_GETHZ 45 - #define VMWARE_CMD_GETVCPU_INFO 68 - #define VMWARE_CMD_STEALCLOCK 91 -diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c -index cb3f900c4..a0b0a70c9 100644 ---- a/arch/x86/kernel/cpu/vmware.c -+++ b/arch/x86/kernel/cpu/vmware.c -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -140,6 +141,13 @@ static unsigned long vmware_get_tsc_khz(void) - return vmware_tsc_khz; - } - -+static void kmsg_dumper_vmware_log(struct kmsg_dumper *dumper, -+ struct kmsg_dump_detail *detail); -+ -+static struct kmsg_dumper kmsg_dumper = { -+ .dump = kmsg_dumper_vmware_log -+}; -+ - #ifdef CONFIG_PARAVIRT - static struct cyc2ns_data vmware_cyc2ns __ro_after_init; - static bool vmw_sched_clock __initdata = true; -@@ -440,6 +448,8 @@ static void __init vmware_platform_setup(void) - #endif - - vmware_set_capabilities(); -+ -+ kmsg_dump_register(&kmsg_dumper); - } - - static u8 __init vmware_select_hypercall(void) -@@ -591,3 +601,125 @@ const __initconst struct hypervisor_x86 x86_hyper_vmware = { - .runtime.sev_es_hcall_finish = vmware_sev_es_hcall_finish, - #endif - }; -+ -+#define VMWARE_HB_CMD_MESSAGE 0 -+#define MESSAGE_STATUS_SUCCESS (0x01 << 16) -+#define MESSAGE_STATUS_CPT (0x10 << 16) -+#define MESSAGE_STATUS_HB (0x80 << 16) -+ -+#define RPCI_PROTOCOL_NUM 0x49435052 /* 'RPCI' */ -+#define GUESTMSG_FLAG_COOKIE 0x80000000 -+ -+#define MESSAGE_TYPE_OPEN (0 << 16) -+#define MESSAGE_TYPE_SENDSIZE (1 << 16) -+#define MESSAGE_TYPE_SEND (2 << 16) -+#define MESSAGE_TYPE_CLOSE (6 << 16) -+ -+struct vmw_msg { -+ u32 id; -+ u32 cookie_high; -+ u32 cookie_low; -+}; -+ -+static int -+vmware_log_open(struct vmw_msg *msg) -+{ -+ u32 info; -+ -+ vmware_hypercall6(VMWARE_CMD_MESSAGE | MESSAGE_TYPE_OPEN, -+ RPCI_PROTOCOL_NUM | GUESTMSG_FLAG_COOKIE, -+ 0, &info, &msg->id, &msg->cookie_high, -+ &msg->cookie_low); -+ -+ if ((info & MESSAGE_STATUS_SUCCESS) == 0) -+ return 1; -+ -+ msg->id &= 0xffff0000UL; -+ return 0; -+} -+ -+static int -+vmware_log_close(struct vmw_msg *msg) -+{ -+ u32 info; -+ -+ vmware_hypercall5(VMWARE_CMD_MESSAGE | MESSAGE_TYPE_CLOSE, 0, msg->id, -+ msg->cookie_high, msg->cookie_low, &info); -+ -+ if ((info & MESSAGE_STATUS_SUCCESS) == 0) -+ return 1; -+ return 0; -+} -+ -+static int -+vmware_log_send(struct vmw_msg *msg, const char *string) -+{ -+ u32 info; -+ u32 len = strlen(string); -+ -+retry: -+ vmware_hypercall5(VMWARE_CMD_MESSAGE | MESSAGE_TYPE_SENDSIZE, len, -+ msg->id, msg->cookie_high, msg->cookie_low, &info); -+ -+ if (!(info & MESSAGE_STATUS_SUCCESS)) -+ return 1; -+ -+ /* HB port can't access encrypted memory. */ -+ if (!cc_platform_has(CC_ATTR_MEM_ENCRYPT) && (info & MESSAGE_STATUS_HB)) { -+ vmware_hypercall_hb_out( -+ VMWARE_HB_CMD_MESSAGE | MESSAGE_STATUS_SUCCESS, -+ len, msg->id, (uintptr_t) string, msg->cookie_low, -+ msg->cookie_high, &info); -+ } else { -+ do { -+ u32 word; -+ size_t s = min_t(u32, len, sizeof(word)); -+ -+ memcpy(&word, string, s); -+ len -= s; -+ string += s; -+ -+ vmware_hypercall5(VMWARE_CMD_MESSAGE | MESSAGE_TYPE_SEND, -+ word, msg->id, msg->cookie_high, -+ msg->cookie_low, &info); -+ } while (len && (info & MESSAGE_STATUS_SUCCESS)); -+ } -+ -+ if ((info & MESSAGE_STATUS_SUCCESS) == 0) { -+ if (info & MESSAGE_STATUS_CPT) -+ /* A checkpoint occurred. Retry. */ -+ goto retry; -+ return 1; -+ } -+ return 0; -+} -+STACK_FRAME_NON_STANDARD(vmware_log_send); -+ -+/** -+ * kmsg_dumper_vmware_log - dumps kmsg to vmware.log file on the host -+ */ -+static void kmsg_dumper_vmware_log(struct kmsg_dumper *dumper, -+ struct kmsg_dump_detail *detail) -+{ -+ struct vmw_msg msg; -+ struct kmsg_dump_iter iter; -+ static char line[1024]; -+ size_t len = 0; -+ -+ /* Line prefix to send to VM log file. */ -+ line[0] = 'l'; -+ line[1] = 'o'; -+ line[2] = 'g'; -+ line[3] = ' '; -+ -+ kmsg_dump_rewind(&iter); -+ while (kmsg_dump_get_line(&iter, true, line + 4, sizeof(line) - 4, -+ &len)) { -+ line[len + 4] = '\0'; -+ if (vmware_log_open(&msg)) -+ return; -+ if (vmware_log_send(&msg, line)) -+ return; -+ vmware_log_close(&msg); -+ } -+} --- -2.43.7 - diff --git a/SPECS/91/linux/vmw/x86-vmware-Support-steal-time-clock-for-encrypted-gu.patch b/SPECS/91/linux/vmw/x86-vmware-Support-steal-time-clock-for-encrypted-gu.patch deleted file mode 100644 index 0b04912d84..0000000000 --- a/SPECS/91/linux/vmw/x86-vmware-Support-steal-time-clock-for-encrypted-gu.patch +++ /dev/null @@ -1,94 +0,0 @@ -From e2d9f271f82b6574fd8d41cb91e16a2384f19c77 Mon Sep 17 00:00:00 2001 -From: Alexey Makhalov -Date: Tue, 2 Jun 2020 20:02:06 -0700 -Subject: [PATCH] x86/vmware: Support steal time clock for encrypted guests - -Shared memory containing steal time counter should be set to -decrypted when guest memory is encrypted. - -Co-developed-by: Bo Gan -Signed-off-by: Bo Gan -Signed-off-by: Alexey Makhalov ---- - arch/x86/kernel/cpu/vmware.c | 41 ++++++++++++++++++++++++++++++++++++ - 1 file changed, 41 insertions(+) - -diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c -index d9753b1aba58..30b40c667d38 100644 ---- a/arch/x86/kernel/cpu/vmware.c -+++ b/arch/x86/kernel/cpu/vmware.c -@@ -31,6 +31,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -38,6 +39,7 @@ - #include - #include - #include -+#include - - #undef pr_fmt - #define pr_fmt(fmt) "vmware: " fmt -@@ -378,9 +380,47 @@ static struct notifier_block vmware_pv_reboot_nb = { - .notifier_call = vmware_pv_reboot_notify, - }; - -+ /* -+ * Map per-CPU variables for all possible CPUs as decrypted. -+ * Do this early in boot, before sharing the corresponding -+ * guest physical addresses with the hypervisor. -+ */ -+static void __init set_shared_memory_decrypted(void) -+{ -+ int cpu; -+ -+ if (!cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) -+ return; -+ -+ for_each_possible_cpu(cpu) { -+ unsigned long size = sizeof(vmw_steal_time); -+ unsigned long addr = (unsigned long)&per_cpu(vmw_steal_time, -+ cpu); -+ -+ /* -+ * There is no generic high-level API to mark memory as -+ * decrypted. Intel's set_memory_decrypted() depends on the -+ * buddy allocator and can fail early in boot if a page split -+ * is required and allocation is not possible. Use AMD's -+ * early_set_memory_decrypted() instead, which can perform -+ * the split during early boot. -+ */ -+ early_set_memory_decrypted(addr, size); -+ -+ /* That's it for AMD */ -+ if (cc_vendor == CC_VENDOR_AMD) -+ continue; -+ -+ set_memory_decrypted(addr & PAGE_MASK, 1UL << -+ get_order((addr & ~PAGE_MASK) + size)); -+ -+ } -+} -+ - #ifdef CONFIG_SMP - static void __init vmware_smp_prepare_boot_cpu(void) - { -+ set_shared_memory_decrypted(); - vmware_guest_cpu_init(); - native_smp_prepare_boot_cpu(); - } -@@ -443,6 +483,7 @@ static void __init vmware_paravirt_ops_setup(void) - vmware_cpu_down_prepare) < 0) - pr_err("vmware_guest: Failed to install cpu hotplug callbacks\n"); - #else -+ set_shared_memory_decrypted(); - vmware_guest_cpu_init(); - #endif - } --- -2.43.7 - diff --git a/SPECS/90/linux/0001-perf-core-add-logic-to-collect-off-cpu-sample.patch b/SPECS/linux/6.1/0001-perf-core-add-logic-to-collect-off-cpu-sample-6.1.patch similarity index 100% rename from SPECS/90/linux/0001-perf-core-add-logic-to-collect-off-cpu-sample.patch rename to SPECS/linux/6.1/0001-perf-core-add-logic-to-collect-off-cpu-sample-6.1.patch diff --git a/SPECS/90/linux/0002-perf-record-add-options-to-off-cpu.patch b/SPECS/linux/6.1/0002-perf-record-add-options-to-off-cpu-6.1.patch similarity index 100% rename from SPECS/90/linux/0002-perf-record-add-options-to-off-cpu.patch rename to SPECS/linux/6.1/0002-perf-record-add-options-to-off-cpu-6.1.patch diff --git a/SPECS/90/linux/0003-perf-display-off-cpu-samples.patch b/SPECS/linux/6.1/0003-perf-display-off-cpu-samples-6.1.patch similarity index 100% rename from SPECS/90/linux/0003-perf-display-off-cpu-samples.patch rename to SPECS/linux/6.1/0003-perf-display-off-cpu-samples-6.1.patch diff --git a/SPECS/90/linux/9p/0001-fs-9p-Add-opt_metaonly-cache-option.patch b/SPECS/linux/6.1/9p/0001-fs-9p-Add-opt_metaonly-cache-option-6.1.patch similarity index 100% rename from SPECS/90/linux/9p/0001-fs-9p-Add-opt_metaonly-cache-option.patch rename to SPECS/linux/6.1/9p/0001-fs-9p-Add-opt_metaonly-cache-option-6.1.patch diff --git a/SPECS/90/linux/9p/0003-Add-9p-zero-copy-data-path-using-crossfd.patch b/SPECS/linux/6.1/9p/0003-Add-9p-zero-copy-data-path-using-crossfd.patch similarity index 100% rename from SPECS/90/linux/9p/0003-Add-9p-zero-copy-data-path-using-crossfd.patch rename to SPECS/linux/6.1/9p/0003-Add-9p-zero-copy-data-path-using-crossfd.patch diff --git a/SPECS/90/linux/9p/0004-Enable-cache-loose-for-vdfs-9p.patch b/SPECS/linux/6.1/9p/0004-Enable-cache-loose-for-vdfs-9p.patch similarity index 100% rename from SPECS/90/linux/9p/0004-Enable-cache-loose-for-vdfs-9p.patch rename to SPECS/linux/6.1/9p/0004-Enable-cache-loose-for-vdfs-9p.patch diff --git a/SPECS/90/linux/9p/0005-Ensure-seekdir-take-effect-when-entries-in-readdir-b.patch b/SPECS/linux/6.1/9p/0005-Ensure-seekdir-take-effect-when-entries-in-readdir-b.patch similarity index 100% rename from SPECS/90/linux/9p/0005-Ensure-seekdir-take-effect-when-entries-in-readdir-b.patch rename to SPECS/linux/6.1/9p/0005-Ensure-seekdir-take-effect-when-entries-in-readdir-b.patch diff --git a/SPECS/90/linux/9p/0006-Initialize-fid-iounit-during-creation-of-p9_fid.patch b/SPECS/linux/6.1/9p/0006-Initialize-fid-iounit-during-creation-of-p9_fid.patch similarity index 100% rename from SPECS/90/linux/9p/0006-Initialize-fid-iounit-during-creation-of-p9_fid.patch rename to SPECS/linux/6.1/9p/0006-Initialize-fid-iounit-during-creation-of-p9_fid.patch diff --git a/SPECS/90/linux/9p/0007-Don-t-use-writeback-fid-for-cache-when-enabled-for-V.patch b/SPECS/linux/6.1/9p/0007-Don-t-use-writeback-fid-for-cache-when-enabled-for-V.patch similarity index 100% rename from SPECS/90/linux/9p/0007-Don-t-use-writeback-fid-for-cache-when-enabled-for-V.patch rename to SPECS/linux/6.1/9p/0007-Don-t-use-writeback-fid-for-cache-when-enabled-for-V.patch diff --git a/SPECS/90/linux/9p/0008-fscache-Only-fetch-attr-from-inode-cache-when-cache-.patch b/SPECS/linux/6.1/9p/0008-fscache-Only-fetch-attr-from-inode-cache-when-cache-.patch similarity index 100% rename from SPECS/90/linux/9p/0008-fscache-Only-fetch-attr-from-inode-cache-when-cache-.patch rename to SPECS/linux/6.1/9p/0008-fscache-Only-fetch-attr-from-inode-cache-when-cache-.patch diff --git a/SPECS/90/linux/9p/0009-9p-fscache-Make-dcache-work-with-case-insensitive-vo.patch b/SPECS/linux/6.1/9p/0009-9p-fscache-Make-dcache-work-with-case-insensitive-vo.patch similarity index 100% rename from SPECS/90/linux/9p/0009-9p-fscache-Make-dcache-work-with-case-insensitive-vo.patch rename to SPECS/linux/6.1/9p/0009-9p-fscache-Make-dcache-work-with-case-insensitive-vo.patch diff --git a/SPECS/90/linux/9p/0010-9p-fscache-Ensure-consistent-blksize-is-returned-fro.patch b/SPECS/linux/6.1/9p/0010-9p-fscache-Ensure-consistent-blksize-is-returned-fro.patch similarity index 100% rename from SPECS/90/linux/9p/0010-9p-fscache-Ensure-consistent-blksize-is-returned-fro.patch rename to SPECS/linux/6.1/9p/0010-9p-fscache-Ensure-consistent-blksize-is-returned-fro.patch diff --git a/SPECS/linux/6.1/CVE/0001-9p-xen-protect-xen_9pfs_front_free-against-concurren.patch b/SPECS/linux/6.1/CVE/0001-9p-xen-protect-xen_9pfs_front_free-against-concurren.patch new file mode 100644 index 0000000000..0da92368b6 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-9p-xen-protect-xen_9pfs_front_free-against-concurren.patch @@ -0,0 +1,197 @@ +From 30a29610201adbebe839cda8405a5a3bd372a84e Mon Sep 17 00:00:00 2001 +From: Stefano Stabellini +Date: Thu, 29 Jan 2026 15:03:48 -0800 +Subject: [PATCH] 9p/xen: protect xen_9pfs_front_free against concurrent calls + +[ Upstream commit ce8ded2e61f47747e31eeefb44dc24a2160a7e32 ] + +The xenwatch thread can race with other back-end change notifications +and call xen_9pfs_front_free() twice, hitting the observed general +protection fault due to a double-free. Guard the teardown path so only +one caller can release the front-end state at a time, preventing the +crash. + +This is a fix for the following double-free: + +[ 27.052347] Oops: general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b6b6b: 0000 [#1] SMP DEBUG_PAGEALLOC NOPTI +[ 27.052357] CPU: 0 UID: 0 PID: 32 Comm: xenwatch Not tainted 6.18.0-02087-g51ab33fc0a8b-dirty #60 PREEMPT(none) +[ 27.052363] RIP: e030:xen_9pfs_front_free+0x1d/0x150 +[ 27.052368] Code: 90 90 90 90 90 90 90 90 90 90 90 90 90 41 55 41 54 55 48 89 fd 48 c7 c7 48 d0 92 85 53 e8 cb cb 05 00 48 8b 45 08 48 8b 55 00 <48> 3b 28 0f 85 f9 28 35 fe 48 3b 6a 08 0f 85 ef 28 35 fe 48 89 42 +[ 27.052377] RSP: e02b:ffffc9004016fdd0 EFLAGS: 00010246 +[ 27.052381] RAX: 6b6b6b6b6b6b6b6b RBX: ffff88800d66e400 RCX: 0000000000000000 +[ 27.052385] RDX: 6b6b6b6b6b6b6b6b RSI: 0000000000000000 RDI: 0000000000000000 +[ 27.052389] RBP: ffff88800a887040 R08: 0000000000000000 R09: 0000000000000000 +[ 27.052393] R10: 0000000000000000 R11: 0000000000000000 R12: ffff888009e46b68 +[ 27.052397] R13: 0000000000000200 R14: 0000000000000000 R15: ffff88800a887040 +[ 27.052404] FS: 0000000000000000(0000) GS:ffff88808ca57000(0000) knlGS:0000000000000000 +[ 27.052408] CS: e030 DS: 0000 ES: 0000 CR0: 0000000080050033 +[ 27.052412] CR2: 00007f9714004360 CR3: 0000000004834000 CR4: 0000000000050660 +[ 27.052418] Call Trace: +[ 27.052420] +[ 27.052422] xen_9pfs_front_changed+0x5d5/0x720 +[ 27.052426] ? xenbus_otherend_changed+0x72/0x140 +[ 27.052430] ? __pfx_xenwatch_thread+0x10/0x10 +[ 27.052434] xenwatch_thread+0x94/0x1c0 +[ 27.052438] ? __pfx_autoremove_wake_function+0x10/0x10 +[ 27.052442] kthread+0xf8/0x240 +[ 27.052445] ? __pfx_kthread+0x10/0x10 +[ 27.052449] ? __pfx_kthread+0x10/0x10 +[ 27.052452] ret_from_fork+0x16b/0x1a0 +[ 27.052456] ? __pfx_kthread+0x10/0x10 +[ 27.052459] ret_from_fork_asm+0x1a/0x30 +[ 27.052463] +[ 27.052465] Modules linked in: +[ 27.052471] ---[ end trace 0000000000000000 ]--- + +Signed-off-by: Stefano Stabellini +Message-ID: <20260129230348.2390470-1-stefano.stabellini@amd.com> +Signed-off-by: Dominique Martinet +Signed-off-by: Sasha Levin +[Shivani: Modified to apply on 6.1.y ] +Signed-off-by: Shivani Agarwal +--- + net/9p/trans_xen.c | 86 ++++++++++++++++++++++++---------------------- + 1 file changed, 44 insertions(+), 42 deletions(-) + +diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c +index 36f432ca4..471d3ba3e 100644 +--- a/net/9p/trans_xen.c ++++ b/net/9p/trans_xen.c +@@ -273,48 +273,54 @@ static void xen_9pfs_front_free(struct xen_9pfs_front_priv *priv) + { + int i, j; + +- write_lock(&xen_9pfs_lock); +- list_del(&priv->list); +- write_unlock(&xen_9pfs_lock); +- +- for (i = 0; i < priv->num_rings; i++) { +- struct xen_9pfs_dataring *ring = &priv->rings[i]; +- +- cancel_work_sync(&ring->work); +- +- if (!priv->rings[i].intf) +- break; +- if (priv->rings[i].irq > 0) +- unbind_from_irqhandler(priv->rings[i].irq, ring); +- if (priv->rings[i].data.in) { +- for (j = 0; +- j < (1 << priv->rings[i].intf->ring_order); +- j++) { +- grant_ref_t ref; +- +- ref = priv->rings[i].intf->ref[j]; +- gnttab_end_foreign_access(ref, NULL); +- } +- free_pages_exact(priv->rings[i].data.in, ++ if (priv->rings) { ++ for (i = 0; i < priv->num_rings; i++) { ++ struct xen_9pfs_dataring *ring = &priv->rings[i]; ++ ++ cancel_work_sync(&ring->work); ++ ++ if (!priv->rings[i].intf) ++ break; ++ if (priv->rings[i].irq > 0) ++ unbind_from_irqhandler(priv->rings[i].irq, ring); ++ if (priv->rings[i].data.in) { ++ for (j = 0; ++ j < (1 << priv->rings[i].intf->ring_order); ++ j++) { ++ grant_ref_t ref; ++ ++ ref = priv->rings[i].intf->ref[j]; ++ gnttab_end_foreign_access(ref, NULL); ++ } ++ free_pages_exact(priv->rings[i].data.in, + 1UL << (priv->rings[i].intf->ring_order + + XEN_PAGE_SHIFT)); ++ } ++ gnttab_end_foreign_access(priv->rings[i].ref, NULL); ++ free_page((unsigned long)priv->rings[i].intf); + } +- gnttab_end_foreign_access(priv->rings[i].ref, NULL); +- free_page((unsigned long)priv->rings[i].intf); ++ kfree(priv->rings); + } +- kfree(priv->rings); + kfree(priv->tag); + kfree(priv); + } + + static void xen_9pfs_front_remove(struct xenbus_device *dev) + { +- struct xen_9pfs_front_priv *priv = dev_get_drvdata(&dev->dev); ++ struct xen_9pfs_front_priv *priv; + ++ write_lock(&xen_9pfs_lock); ++ priv = dev_get_drvdata(&dev->dev); ++ if (priv == NULL) { ++ write_unlock(&xen_9pfs_lock); ++ return; ++ } + dev_set_drvdata(&dev->dev, NULL); ++ list_del(&priv->list); ++ write_unlock(&xen_9pfs_lock); ++ + xen_9pfs_front_free(priv); + } +- + static int xen_9pfs_front_alloc_dataring(struct xenbus_device *dev, + struct xen_9pfs_dataring *ring, + unsigned int order) +@@ -378,7 +384,7 @@ static int xen_9pfs_front_init(struct xenbus_device *dev) + { + int ret, i; + struct xenbus_transaction xbt; +- struct xen_9pfs_front_priv *priv = dev_get_drvdata(&dev->dev); ++ struct xen_9pfs_front_priv *priv; + char *versions, *v; + unsigned int max_rings, max_ring_order, len = 0; + +@@ -406,6 +412,10 @@ static int xen_9pfs_front_init(struct xenbus_device *dev) + if (p9_xen_trans.maxsize > XEN_FLEX_RING_SIZE(max_ring_order)) + p9_xen_trans.maxsize = XEN_FLEX_RING_SIZE(max_ring_order) / 2; + ++ priv = kzalloc(sizeof(*priv), GFP_KERNEL); ++ if (!priv) ++ return -ENOMEM; ++ priv->dev = dev; + priv->num_rings = XEN_9PFS_NUM_RINGS; + priv->rings = kcalloc(priv->num_rings, sizeof(*priv->rings), + GFP_KERNEL); +@@ -464,6 +474,11 @@ static int xen_9pfs_front_init(struct xenbus_device *dev) + goto error; + } + ++ write_lock(&xen_9pfs_lock); ++ dev_set_drvdata(&dev->dev, priv); ++ list_add_tail(&priv->list, &xen_9pfs_devs); ++ write_unlock(&xen_9pfs_lock); ++ + xenbus_switch_state(dev, XenbusStateInitialised); + return 0; + +@@ -478,19 +493,6 @@ static int xen_9pfs_front_init(struct xenbus_device *dev) + static int xen_9pfs_front_probe(struct xenbus_device *dev, + const struct xenbus_device_id *id) + { +- struct xen_9pfs_front_priv *priv = NULL; +- +- priv = kzalloc(sizeof(*priv), GFP_KERNEL); +- if (!priv) +- return -ENOMEM; +- +- priv->dev = dev; +- dev_set_drvdata(&dev->dev, priv); +- +- write_lock(&xen_9pfs_lock); +- list_add_tail(&priv->list, &xen_9pfs_devs); +- write_unlock(&xen_9pfs_lock); +- + return 0; + } + +-- +2.53.0 + diff --git a/SPECS/linux/6.1/CVE/0001-CIFS-New-mount-option-for-cifs.upcall-namespace-reso.patch b/SPECS/linux/6.1/CVE/0001-CIFS-New-mount-option-for-cifs.upcall-namespace-reso.patch new file mode 100644 index 0000000000..c110c0313d --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-CIFS-New-mount-option-for-cifs.upcall-namespace-reso.patch @@ -0,0 +1,309 @@ +From a0bd22e433d8e3fcfc62b51d98384a95a3648d97 Mon Sep 17 00:00:00 2001 +From: Ritvik Budhiraja +Date: Wed, 19 Nov 2025 17:52:55 +0530 +Subject: [PATCH] CIFS: New mount option for cifs.upcall namespace resolution + +[ Upstream commit db363b0a1d9e6b9dc556296f1b1007aeb496a8cf ] + +In the current implementation, the SMB filesystem on a mount point can +trigger upcalls from the kernel to the userspace to enable certain +functionalities like spnego, dns_resolution, amongst others. These upcalls +usually either happen in the context of the mount or in the context of an +application/user. The upcall handler for cifs, cifs.upcall already has +existing code which switches the namespaces to the caller's namespace +before handling the upcall. This behaviour is expected for scenarios like +multiuser mounts, but might not cover all single user scenario with +services such as Kubernetes, where the mount can happen from different +locations such as on the host, from an app container, or a driver pod +which does the mount on behalf of a different pod. + +This patch introduces a new mount option called upcall_target, to +customise the upcall behaviour. upcall_target can take 'mount' and 'app' +as possible values. This aids use cases like Kubernetes where the mount +happens on behalf of the application in another container altogether. +Having this new mount option allows the mount command to specify where the +upcall should happen: 'mount' for resolving the upcall to the host +namespace, and 'app' for resolving the upcall to the ns of the calling +thread. This will enable both the scenarios where the Kerberos credentials +can be found on the application namespace or the host namespace to which +just the mount operation is "delegated". + +Reviewed-by: Shyam Prasad +Reviewed-by: Bharath S M +Reviewed-by: Ronnie Sahlberg +Signed-off-by: Ritvik Budhiraja +Signed-off-by: Steve French +Cc: Salvatore Bonaccorso +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Guruswamy Basavaiah +--- + fs/smb/client/cifs_spnego.c | 16 +++++++++++++++ + fs/smb/client/cifsfs.c | 25 ++++++++++++++++++++++++ + fs/smb/client/cifsglob.h | 7 +++++++ + fs/smb/client/connect.c | 19 ++++++++++++++++++ + fs/smb/client/fs_context.c | 39 +++++++++++++++++++++++++++++++++++++ + fs/smb/client/fs_context.h | 10 ++++++++++ + 6 files changed, 116 insertions(+) + +diff --git a/fs/smb/client/cifs_spnego.c b/fs/smb/client/cifs_spnego.c +index 8b58f494235f..08885ec1b407 100644 +--- a/fs/smb/client/cifs_spnego.c ++++ b/fs/smb/client/cifs_spnego.c +@@ -82,6 +82,9 @@ struct key_type cifs_spnego_key_type = { + /* strlen of ";pid=0x" */ + #define PID_KEY_LEN 7 + ++/* strlen of ";upcall_target=" */ ++#define UPCALL_TARGET_KEY_LEN 15 ++ + /* get a key struct with a SPNEGO security blob, suitable for session setup */ + struct key * + cifs_get_spnego_key(struct cifs_ses *sesInfo, +@@ -108,6 +111,11 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo, + if (sesInfo->user_name) + desc_len += USER_KEY_LEN + strlen(sesInfo->user_name); + ++ if (sesInfo->upcall_target == UPTARGET_MOUNT) ++ desc_len += UPCALL_TARGET_KEY_LEN + 5; // strlen("mount") ++ else ++ desc_len += UPCALL_TARGET_KEY_LEN + 3; // strlen("app") ++ + spnego_key = ERR_PTR(-ENOMEM); + description = kzalloc(desc_len, GFP_KERNEL); + if (description == NULL) +@@ -158,6 +166,14 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo, + dp = description + strlen(description); + sprintf(dp, ";pid=0x%x", current->pid); + ++ if (sesInfo->upcall_target == UPTARGET_MOUNT) { ++ dp = description + strlen(description); ++ sprintf(dp, ";upcall_target=mount"); ++ } else { ++ dp = description + strlen(description); ++ sprintf(dp, ";upcall_target=app"); ++ } ++ + cifs_dbg(FYI, "key description = %s\n", description); + saved_cred = override_creds(spnego_cred); + spnego_key = request_key(&cifs_spnego_key_type, description, ""); +diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c +index 32b008bc99a0..854cadb605cc 100644 +--- a/fs/smb/client/cifsfs.c ++++ b/fs/smb/client/cifsfs.c +@@ -539,6 +539,30 @@ static int cifs_show_devname(struct seq_file *m, struct dentry *root) + return 0; + } + ++static void ++cifs_show_upcall_target(struct seq_file *s, struct cifs_sb_info *cifs_sb) ++{ ++ if (cifs_sb->ctx->upcall_target == UPTARGET_UNSPECIFIED) { ++ seq_puts(s, ",upcall_target=app"); ++ return; ++ } ++ ++ seq_puts(s, ",upcall_target="); ++ ++ switch (cifs_sb->ctx->upcall_target) { ++ case UPTARGET_APP: ++ seq_puts(s, "app"); ++ break; ++ case UPTARGET_MOUNT: ++ seq_puts(s, "mount"); ++ break; ++ default: ++ /* shouldn't ever happen */ ++ seq_puts(s, "unknown"); ++ break; ++ } ++} ++ + /* + * cifs_show_options() is for displaying mount options in /proc/mounts. + * Not all settable options are displayed but most of the important +@@ -555,6 +579,7 @@ cifs_show_options(struct seq_file *s, struct dentry *root) + seq_show_option(s, "vers", tcon->ses->server->vals->version_string); + cifs_show_security(s, tcon->ses); + cifs_show_cache_flavor(s, cifs_sb); ++ cifs_show_upcall_target(s, cifs_sb); + + if (tcon->no_lease) + seq_puts(s, ",nolease"); +diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h +index 6df50ff6d918..cfc2a3e8ce42 100644 +--- a/fs/smb/client/cifsglob.h ++++ b/fs/smb/client/cifsglob.h +@@ -151,6 +151,12 @@ enum securityEnum { + IAKerb, /* Kerberos proxy */ + }; + ++enum upcall_target_enum { ++ UPTARGET_UNSPECIFIED, /* not specified, defaults to app */ ++ UPTARGET_MOUNT, /* upcall to the mount namespace */ ++ UPTARGET_APP, /* upcall to the application namespace which did the mount */ ++}; ++ + struct session_key { + unsigned int len; + char *response; +@@ -1016,6 +1022,7 @@ struct cifs_ses { + struct session_key auth_key; + struct ntlmssp_auth *ntlmssp; /* ciphertext, flags, server challenge */ + enum securityEnum sectype; /* what security flavor was specified? */ ++ enum upcall_target_enum upcall_target; /* what upcall target was specified? */ + bool sign; /* is signing required? */ + bool domainAuto:1; + __u16 session_flags; +diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c +index 7105b7d653f2..bd29cddedd64 100644 +--- a/fs/smb/client/connect.c ++++ b/fs/smb/client/connect.c +@@ -2363,6 +2363,25 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb3_fs_context *ctx) + ses->sectype = ctx->sectype; + ses->sign = ctx->sign; + ++ /* ++ *Explicitly marking upcall_target mount option for easier handling ++ * by cifs_spnego.c and eventually cifs.upcall.c ++ */ ++ ++ switch (ctx->upcall_target) { ++ case UPTARGET_UNSPECIFIED: /* default to app */ ++ case UPTARGET_APP: ++ ses->upcall_target = UPTARGET_APP; ++ break; ++ case UPTARGET_MOUNT: ++ ses->upcall_target = UPTARGET_MOUNT; ++ break; ++ default: ++ // should never happen ++ ses->upcall_target = UPTARGET_APP; ++ break; ++ } ++ + /* add server as first channel */ + spin_lock(&ses->chan_lock); + ses->chans[0].server = server; +diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c +index e6d2e4162b08..cb602f641334 100644 +--- a/fs/smb/client/fs_context.c ++++ b/fs/smb/client/fs_context.c +@@ -67,6 +67,12 @@ static const match_table_t cifs_secflavor_tokens = { + { Opt_sec_err, NULL } + }; + ++static const match_table_t cifs_upcall_target = { ++ { Opt_upcall_target_mount, "mount" }, ++ { Opt_upcall_target_application, "app" }, ++ { Opt_upcall_target_err, NULL } ++}; ++ + const struct fs_parameter_spec smb3_fs_parameters[] = { + /* Mount options that take no arguments */ + fsparam_flag_no("user_xattr", Opt_user_xattr), +@@ -172,6 +178,7 @@ const struct fs_parameter_spec smb3_fs_parameters[] = { + fsparam_string("vers", Opt_vers), + fsparam_string("sec", Opt_sec), + fsparam_string("cache", Opt_cache), ++ fsparam_string("upcall_target", Opt_upcalltarget), + + /* Arguments that should be ignored */ + fsparam_flag("guest", Opt_ignore), +@@ -240,6 +247,29 @@ cifs_parse_security_flavors(struct fs_context *fc, char *value, struct smb3_fs_c + return 0; + } + ++static int ++cifs_parse_upcall_target(struct fs_context *fc, char *value, struct smb3_fs_context *ctx) ++{ ++ substring_t args[MAX_OPT_ARGS]; ++ ++ ctx->upcall_target = UPTARGET_UNSPECIFIED; ++ ++ switch (match_token(value, cifs_upcall_target, args)) { ++ case Opt_upcall_target_mount: ++ ctx->upcall_target = UPTARGET_MOUNT; ++ break; ++ case Opt_upcall_target_application: ++ ctx->upcall_target = UPTARGET_APP; ++ break; ++ ++ default: ++ cifs_errorf(fc, "bad upcall target: %s\n", value); ++ return 1; ++ } ++ ++ return 0; ++} ++ + static const match_table_t cifs_cacheflavor_tokens = { + { Opt_cache_loose, "loose" }, + { Opt_cache_strict, "strict" }, +@@ -1327,6 +1357,10 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, + if (cifs_parse_security_flavors(fc, param->string, ctx) != 0) + goto cifs_parse_mount_err; + break; ++ case Opt_upcalltarget: ++ if (cifs_parse_upcall_target(fc, param->string, ctx) != 0) ++ goto cifs_parse_mount_err; ++ break; + case Opt_cache: + if (cifs_parse_cache_flavor(fc, param->string, ctx) != 0) + goto cifs_parse_mount_err; +@@ -1500,6 +1534,11 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, + } + /* case Opt_ignore: - is ignored as expected ... */ + ++ if (ctx->multiuser && ctx->upcall_target == UPTARGET_MOUNT) { ++ cifs_errorf(fc, "multiuser mount option not supported with upcalltarget set as 'mount'\n"); ++ goto cifs_parse_mount_err; ++ } ++ + return 0; + + cifs_parse_mount_err: +diff --git a/fs/smb/client/fs_context.h b/fs/smb/client/fs_context.h +index 319a91b7f670..32e7439a230b 100644 +--- a/fs/smb/client/fs_context.h ++++ b/fs/smb/client/fs_context.h +@@ -54,6 +54,12 @@ enum cifs_sec_param { + Opt_sec_err + }; + ++enum cifs_upcall_target_param { ++ Opt_upcall_target_mount, ++ Opt_upcall_target_application, ++ Opt_upcall_target_err ++}; ++ + enum cifs_param { + /* Mount options that take no arguments */ + Opt_user_xattr, +@@ -107,6 +113,8 @@ enum cifs_param { + Opt_multichannel, + Opt_compress, + Opt_witness, ++ Opt_is_upcall_target_mount, ++ Opt_is_upcall_target_application, + + /* Mount options which take numeric value */ + Opt_backupuid, +@@ -146,6 +154,7 @@ enum cifs_param { + Opt_vers, + Opt_sec, + Opt_cache, ++ Opt_upcalltarget, + + /* Mount options to be ignored */ + Opt_ignore, +@@ -186,6 +195,7 @@ struct smb3_fs_context { + umode_t file_mode; + umode_t dir_mode; + enum securityEnum sectype; /* sectype requested via mnt opts */ ++ enum upcall_target_enum upcall_target; /* where to upcall for mount */ + bool sign; /* was signing requested via mnt opts? */ + bool ignore_signature:1; + bool retry:1; +-- +2.43.0 + diff --git a/SPECS/linux/6.1/CVE/0001-RDMA-mlx5-Fix-implicit-ODP-hang-on-parent-deregistra.patch b/SPECS/linux/6.1/CVE/0001-RDMA-mlx5-Fix-implicit-ODP-hang-on-parent-deregistra.patch new file mode 100644 index 0000000000..7c26b8ca4c --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-RDMA-mlx5-Fix-implicit-ODP-hang-on-parent-deregistra.patch @@ -0,0 +1,83 @@ +From 54337a462e9cd81ae52c71b0d234728fd262c8f9 Mon Sep 17 00:00:00 2001 +From: Yishai Hadas +Date: Mon, 10 Feb 2025 13:31:11 +0200 +Subject: [PATCH] RDMA/mlx5: Fix implicit ODP hang on parent deregistration + +[ Upstream commit 3d8c6f26893d55fab218ad086719de1fc9bb86ba ] + +Fix the destroy_unused_implicit_child_mr() to prevent hanging during +parent deregistration as of below [1]. + +Upon entering destroy_unused_implicit_child_mr(), the reference count +for the implicit MR parent is incremented using: +refcount_inc_not_zero(). + +A corresponding decrement must be performed if +free_implicit_child_mr_work() is not called. + +The code has been updated to properly manage the reference count that +was incremented. + +[1] +INFO: task python3:2157 blocked for more than 120 seconds. +Not tainted 6.12.0-rc7+ #1633 +"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. +task:python3 state:D stack:0 pid:2157 tgid:2157 ppid:1685 flags:0x00000000 +Call Trace: + +__schedule+0x420/0xd30 +schedule+0x47/0x130 +__mlx5_ib_dereg_mr+0x379/0x5d0 [mlx5_ib] +? __pfx_autoremove_wake_function+0x10/0x10 +ib_dereg_mr_user+0x5f/0x120 [ib_core] +? lock_release+0xc6/0x280 +destroy_hw_idr_uobject+0x1d/0x60 [ib_uverbs] +uverbs_destroy_uobject+0x58/0x1d0 [ib_uverbs] +uobj_destroy+0x3f/0x70 [ib_uverbs] +ib_uverbs_cmd_verbs+0x3e4/0xbb0 [ib_uverbs] +? __pfx_uverbs_destroy_def_handler+0x10/0x10 [ib_uverbs] +? lock_acquire+0xc1/0x2f0 +? ib_uverbs_ioctl+0xcb/0x170 [ib_uverbs] +? ib_uverbs_ioctl+0x116/0x170 [ib_uverbs] +? lock_release+0xc6/0x280 +ib_uverbs_ioctl+0xe7/0x170 [ib_uverbs] +? ib_uverbs_ioctl+0xcb/0x170 [ib_uverbs] + __x64_sys_ioctl+0x1b0/0xa70 +? kmem_cache_free+0x221/0x400 +do_syscall_64+0x6b/0x140 +entry_SYSCALL_64_after_hwframe+0x76/0x7e +RIP: 0033:0x7f20f21f017b +RSP: 002b:00007ffcfc4a77c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 +RAX: ffffffffffffffda RBX: 00007ffcfc4a78d8 RCX: 00007f20f21f017b +RDX: 00007ffcfc4a78c0 RSI: 00000000c0181b01 RDI: 0000000000000003 +RBP: 00007ffcfc4a78a0 R08: 000056147d125190 R09: 00007f20f1f14c60 +R10: 0000000000000001 R11: 0000000000000246 R12: 00007ffcfc4a7890 +R13: 000000000000001c R14: 000056147d100fc0 R15: 00007f20e365c9d0 + + +Fixes: d3d930411ce3 ("RDMA/mlx5: Fix implicit ODP use after free") +Signed-off-by: Yishai Hadas +Reviewed-by: Artemy Kovalyov +Link: https://patch.msgid.link/80f2fcd19952dfa7d9981d93fd6359b4471f8278.1739186929.git.leon@kernel.org +Signed-off-by: Leon Romanovsky +Signed-off-by: Sasha Levin +Signed-off-by: Brennan Lamoreaux +--- + drivers/infiniband/hw/mlx5/odp.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c +index 160553d26ee1..0ed88f6a2069 100644 +--- a/drivers/infiniband/hw/mlx5/odp.c ++++ b/drivers/infiniband/hw/mlx5/odp.c +@@ -227,6 +227,7 @@ static void destroy_unused_implicit_child_mr(struct mlx5_ib_mr *mr) + if (__xa_cmpxchg(&imr->implicit_children, idx, mr, NULL, GFP_KERNEL) != + mr) { + xa_unlock(&imr->implicit_children); ++ mlx5r_deref_odp_mkey(&imr->mmkey); + return; + } + +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-RDMA-mlx5-Fix-implicit-ODP-use-after-free.patch b/SPECS/linux/6.1/CVE/0001-RDMA-mlx5-Fix-implicit-ODP-use-after-free.patch new file mode 100644 index 0000000000..2c5b734eaa --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-RDMA-mlx5-Fix-implicit-ODP-use-after-free.patch @@ -0,0 +1,91 @@ +From 73719dc70d21cd5073e705a87b471c9285b98156 Mon Sep 17 00:00:00 2001 +From: Patrisious Haddad +Date: Sun, 19 Jan 2025 10:21:41 +0200 +Subject: [PATCH] RDMA/mlx5: Fix implicit ODP use after free + +commit d3d930411ce390e532470194296658a960887773 upstream + +Prevent double queueing of implicit ODP mr destroy work by using +__xa_cmpxchg() to make sure this is the only time we are destroying this +specific mr. + +Without this change, we could try to invalidate this mr twice, which in +turn could result in queuing a MR work destroy twice, and eventually the +second work could execute after the MR was freed due to the first work, +causing a user after free and trace below. + + refcount_t: underflow; use-after-free. + WARNING: CPU: 2 PID: 12178 at lib/refcount.c:28 refcount_warn_saturate+0x12b/0x130 + Modules linked in: bonding ib_ipoib vfio_pci ip_gre geneve nf_tables ip6_gre gre ip6_tunnel tunnel6 ipip tunnel4 ib_umad rdma_ucm mlx5_vfio_pci vfio_pci_core vfio_iommu_type1 mlx5_ib vfio ib_uverbs mlx5_core iptable_raw openvswitch nsh rpcrdma ib_iser libiscsi scsi_transport_iscsi rdma_cm iw_cm ib_cm ib_core xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter rpcsec_gss_krb5 auth_rpcgss oid_registry overlay zram zsmalloc fuse [last unloaded: ib_uverbs] + CPU: 2 PID: 12178 Comm: kworker/u20:5 Not tainted 6.5.0-rc1_net_next_mlx5_58c644e #1 + Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 + Workqueue: events_unbound free_implicit_child_mr_work [mlx5_ib] + RIP: 0010:refcount_warn_saturate+0x12b/0x130 + Code: 48 c7 c7 38 95 2a 82 c6 05 bc c6 fe 00 01 e8 0c 66 aa ff 0f 0b 5b c3 48 c7 c7 e0 94 2a 82 c6 05 a7 c6 fe 00 01 e8 f5 65 aa ff <0f> 0b 5b c3 90 8b 07 3d 00 00 00 c0 74 12 83 f8 01 74 13 8d 50 ff + RSP: 0018:ffff8881008e3e40 EFLAGS: 00010286 + RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000027 + RDX: ffff88852c91b5c8 RSI: 0000000000000001 RDI: ffff88852c91b5c0 + RBP: ffff8881dacd4e00 R08: 00000000ffffffff R09: 0000000000000019 + R10: 000000000000072e R11: 0000000063666572 R12: ffff88812bfd9e00 + R13: ffff8881c792d200 R14: ffff88810011c005 R15: ffff8881002099c0 + FS: 0000000000000000(0000) GS:ffff88852c900000(0000) knlGS:0000000000000000 + CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 + CR2: 00007f5694b5e000 CR3: 00000001153f6003 CR4: 0000000000370ea0 + DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 + DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 + Call Trace: + + ? refcount_warn_saturate+0x12b/0x130 + free_implicit_child_mr_work+0x180/0x1b0 [mlx5_ib] + process_one_work+0x1cc/0x3c0 + worker_thread+0x218/0x3c0 + kthread+0xc6/0xf0 + ret_from_fork+0x1f/0x30 + + +Fixes: 5256edcb98a1 ("RDMA/mlx5: Rework implicit ODP destroy") +Cc: stable@vger.kernel.org +Link: https://patch.msgid.link/r/c96b8645a81085abff739e6b06e286a350d1283d.1737274283.git.leon@kernel.org +Signed-off-by: Patrisious Haddad +Signed-off-by: Leon Romanovsky +Signed-off-by: Jason Gunthorpe +[ Brennan : Drop patch for implicit_get_child_mr, as this code + is not present in v6.1 ] +Signed-off-by: Brennan Lamoreaux +--- + drivers/infiniband/hw/mlx5/odp.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c +index 87fbee806100..12debdce0e91 100644 +--- a/drivers/infiniband/hw/mlx5/odp.c ++++ b/drivers/infiniband/hw/mlx5/odp.c +@@ -213,10 +213,24 @@ static void destroy_unused_implicit_child_mr(struct mlx5_ib_mr *mr) + unsigned long idx = ib_umem_start(odp) >> MLX5_IMR_MTT_SHIFT; + struct mlx5_ib_mr *imr = mr->parent; + ++ /* ++ * If userspace is racing freeing the parent implicit ODP MR then we can ++ * loose the race with parent destruction. In this case ++ * mlx5_ib_free_odp_mr() will free everything in the implicit_children ++ * xarray so NOP is fine. This child MR cannot be destroyed here because ++ * we are under its umem_mutex. ++ */ + if (!refcount_inc_not_zero(&imr->mmkey.usecount)) + return; + +- xa_erase(&imr->implicit_children, idx); ++ xa_lock(&imr->implicit_children); ++ if (__xa_cmpxchg(&imr->implicit_children, idx, mr, NULL, GFP_KERNEL) != ++ mr) { ++ xa_unlock(&imr->implicit_children); ++ return; ++ } ++ ++ xa_unlock(&imr->implicit_children); + + /* Freeing a MR is a sleeping operation, so bounce to a work queue */ + INIT_WORK(&mr->odp_destroy.work, free_implicit_child_mr_work); +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-RDMA-rxe-Fix-null-deref-on-srq-rq.queue-after-resize.patch b/SPECS/linux/6.1/CVE/0001-RDMA-rxe-Fix-null-deref-on-srq-rq.queue-after-resize.patch new file mode 100644 index 0000000000..2213a91ca4 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-RDMA-rxe-Fix-null-deref-on-srq-rq.queue-after-resize.patch @@ -0,0 +1,94 @@ +From b8f6eeb87a76b6fb1f6381b0b2894568e1b784f7 Mon Sep 17 00:00:00 2001 +From: Zhu Yanjun +Date: Mon, 27 Oct 2025 14:52:03 -0700 +Subject: [PATCH] RDMA/rxe: Fix null deref on srq->rq.queue after resize + failure + +[ Upstream commit 503a5e4690ae14c18570141bc0dcf7501a8419b0 ] + +A NULL pointer dereference can occur in rxe_srq_chk_attr() when +ibv_modify_srq() is invoked twice in succession under certain error +conditions. The first call may fail in rxe_queue_resize(), which leads +rxe_srq_from_attr() to set srq->rq.queue = NULL. The second call then +triggers a crash (null deref) when accessing +srq->rq.queue->buf->index_mask. + +Call Trace: + +rxe_modify_srq+0x170/0x480 [rdma_rxe] +? __pfx_rxe_modify_srq+0x10/0x10 [rdma_rxe] +? uverbs_try_lock_object+0x4f/0xa0 [ib_uverbs] +? rdma_lookup_get_uobject+0x1f0/0x380 [ib_uverbs] +ib_uverbs_modify_srq+0x204/0x290 [ib_uverbs] +? __pfx_ib_uverbs_modify_srq+0x10/0x10 [ib_uverbs] +? tryinc_node_nr_active+0xe6/0x150 +? uverbs_fill_udata+0xed/0x4f0 [ib_uverbs] +ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0x2c0/0x470 [ib_uverbs] +? __pfx_ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0x10/0x10 [ib_uverbs] +? uverbs_fill_udata+0xed/0x4f0 [ib_uverbs] +ib_uverbs_run_method+0x55a/0x6e0 [ib_uverbs] +? __pfx_ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0x10/0x10 [ib_uverbs] +ib_uverbs_cmd_verbs+0x54d/0x800 [ib_uverbs] +? __pfx_ib_uverbs_cmd_verbs+0x10/0x10 [ib_uverbs] +? __pfx___raw_spin_lock_irqsave+0x10/0x10 +? __pfx_do_vfs_ioctl+0x10/0x10 +? ioctl_has_perm.constprop.0.isra.0+0x2c7/0x4c0 +? __pfx_ioctl_has_perm.constprop.0.isra.0+0x10/0x10 +ib_uverbs_ioctl+0x13e/0x220 [ib_uverbs] +? __pfx_ib_uverbs_ioctl+0x10/0x10 [ib_uverbs] +__x64_sys_ioctl+0x138/0x1c0 +do_syscall_64+0x82/0x250 +? fdget_pos+0x58/0x4c0 +? ksys_write+0xf3/0x1c0 +? __pfx_ksys_write+0x10/0x10 +? do_syscall_64+0xc8/0x250 +? __pfx_vm_mmap_pgoff+0x10/0x10 +? fget+0x173/0x230 +? fput+0x2a/0x80 +? ksys_mmap_pgoff+0x224/0x4c0 +? do_syscall_64+0xc8/0x250 +? do_user_addr_fault+0x37b/0xfe0 +? clear_bhb_loop+0x50/0xa0 +? clear_bhb_loop+0x50/0xa0 +? clear_bhb_loop+0x50/0xa0 +entry_SYSCALL_64_after_hwframe+0x76/0x7e + +Fixes: 8700e3e7c485 ("Soft RoCE driver") +Tested-by: Liu Yi +Signed-off-by: Zhu Yanjun +Link: https://patch.msgid.link/20251027215203.1321-1-yanjun.zhu@linux.dev +Signed-off-by: Leon Romanovsky +Signed-off-by: Sasha Levin +[ Keerthana: Backport to v6.1.y ] +Signed-off-by: Keerthana K +--- + drivers/infiniband/sw/rxe/rxe_srq.c | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/drivers/infiniband/sw/rxe/rxe_srq.c b/drivers/infiniband/sw/rxe/rxe_srq.c +index 02b39498c370..432648e84cd0 100644 +--- a/drivers/infiniband/sw/rxe/rxe_srq.c ++++ b/drivers/infiniband/sw/rxe/rxe_srq.c +@@ -161,18 +161,13 @@ int rxe_srq_from_attr(struct rxe_dev *rxe, struct rxe_srq *srq, + &srq->rq.producer_lock, + &srq->rq.consumer_lock); + if (err) +- goto err2; ++ return err; + } + + if (mask & IB_SRQ_LIMIT) + srq->limit = attr->srq_limit; + + return 0; +- +-err2: +- rxe_queue_cleanup(q); +- srq->rq.queue = NULL; +- return err; + } + + void rxe_srq_cleanup(struct rxe_pool_elem *elem) +-- +2.43.7 + diff --git a/SPECS/linux/6.1/CVE/0001-RDMA-rxe-Fix-the-failure-of-ibv_query_device-and-ibv.patch b/SPECS/linux/6.1/CVE/0001-RDMA-rxe-Fix-the-failure-of-ibv_query_device-and-ibv.patch new file mode 100644 index 0000000000..6f427a999c --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-RDMA-rxe-Fix-the-failure-of-ibv_query_device-and-ibv.patch @@ -0,0 +1,138 @@ +From 7e1a5154749a45b7d749b6758ed2c664a8840b7b Mon Sep 17 00:00:00 2001 +From: Zhu Yanjun +Date: Sun, 2 Mar 2025 22:54:44 +0100 +Subject: [PATCH] RDMA/rxe: Fix the failure of ibv_query_device() and + ibv_query_device_ex() tests + +[ Upstream commit 8ce2eb9dfac8743d1c423b86339336a5b6a6069e ] + +In rdma-core, the following failures appear. + +" +$ ./build/bin/run_tests.py -k device +ssssssss....FF........s +====================================================================== +FAIL: test_query_device (tests.test_device.DeviceTest.test_query_device) +Test ibv_query_device() +---------------------------------------------------------------------- +Traceback (most recent call last): + File "/home/ubuntu/rdma-core/tests/test_device.py", line 63, in + test_query_device + self.verify_device_attr(attr, dev) + File "/home/ubuntu/rdma-core/tests/test_device.py", line 200, in + verify_device_attr + assert attr.sys_image_guid != 0 + ^^^^^^^^^^^^^^^^^^^^^^^^ +AssertionError + +====================================================================== +FAIL: test_query_device_ex (tests.test_device.DeviceTest.test_query_device_ex) +Test ibv_query_device_ex() +---------------------------------------------------------------------- +Traceback (most recent call last): + File "/home/ubuntu/rdma-core/tests/test_device.py", line 222, in + test_query_device_ex + self.verify_device_attr(attr_ex.orig_attr, dev) + File "/home/ubuntu/rdma-core/tests/test_device.py", line 200, in + verify_device_attr + assert attr.sys_image_guid != 0 + ^^^^^^^^^^^^^^^^^^^^^^^^ +AssertionError +" + +The root cause is: before a net device is set with rxe, this net device +is used to generate a sys_image_guid. + +Fixes: 2ac5415022d1 ("RDMA/rxe: Remove the direct link to net_device") +Signed-off-by: Zhu Yanjun +Link: https://patch.msgid.link/20250302215444.3742072-1-yanjun.zhu@linux.dev +Reviewed-by: Daisuke Matsuda +Tested-by: Daisuke Matsuda +Signed-off-by: Leon Romanovsky +Signed-off-by: Sasha Levin +[Shivani: Modified to apply on 6.1.y] +Signed-off-by: Shivani Agarwal +--- + drivers/infiniband/sw/rxe/rxe.c | 25 ++++++------------------- + 1 file changed, 6 insertions(+), 19 deletions(-) + +diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c +index 2535c4048..271e69c83 100644 +--- a/drivers/infiniband/sw/rxe/rxe.c ++++ b/drivers/infiniband/sw/rxe/rxe.c +@@ -38,10 +38,8 @@ void rxe_dealloc(struct ib_device *ib_dev) + } + + /* initialize rxe device parameters */ +-static void rxe_init_device_param(struct rxe_dev *rxe) ++static void rxe_init_device_param(struct rxe_dev *rxe, struct net_device *ndev) + { +- struct net_device *ndev; +- + rxe->max_inline_data = RXE_MAX_INLINE_DATA; + + rxe->attr.vendor_id = RXE_VENDOR_ID; +@@ -74,15 +72,9 @@ static void rxe_init_device_param(struct rxe_dev *rxe) + rxe->attr.max_pkeys = RXE_MAX_PKEYS; + rxe->attr.local_ca_ack_delay = RXE_LOCAL_CA_ACK_DELAY; + +- ndev = rxe_ib_device_get_netdev(&rxe->ib_dev); +- if (!ndev) +- return; +- + addrconf_addr_eui48((unsigned char *)&rxe->attr.sys_image_guid, + ndev->dev_addr); + +- dev_put(ndev); +- + rxe->max_ucontext = RXE_MAX_UCONTEXT; + } + +@@ -115,18 +107,13 @@ static void rxe_init_port_param(struct rxe_port *port) + /* initialize port state, note IB convention that HCA ports are always + * numbered from 1 + */ +-static void rxe_init_ports(struct rxe_dev *rxe) ++static void rxe_init_ports(struct rxe_dev *rxe, struct net_device *ndev) + { + struct rxe_port *port = &rxe->port; +- struct net_device *ndev; + + rxe_init_port_param(port); +- ndev = rxe_ib_device_get_netdev(&rxe->ib_dev); +- if (!ndev) +- return; + addrconf_addr_eui48((unsigned char *)&port->port_guid, + ndev->dev_addr); +- dev_put(ndev); + spin_lock_init(&port->port_lock); + } + +@@ -144,12 +131,12 @@ static void rxe_init_pools(struct rxe_dev *rxe) + } + + /* initialize rxe device state */ +-static void rxe_init(struct rxe_dev *rxe) ++static void rxe_init(struct rxe_dev *rxe, struct net_device *ndev) + { + /* init default device parameters */ +- rxe_init_device_param(rxe); ++ rxe_init_device_param(rxe, ndev); + +- rxe_init_ports(rxe); ++ rxe_init_ports(rxe, ndev); + rxe_init_pools(rxe); + + /* init pending mmap list */ +@@ -184,7 +171,7 @@ void rxe_set_mtu(struct rxe_dev *rxe, unsigned int ndev_mtu) + int rxe_add(struct rxe_dev *rxe, unsigned int mtu, const char *ibdev_name, + struct net_device *ndev) + { +- rxe_init(rxe); ++ rxe_init(rxe, ndev); + rxe_set_mtu(rxe, mtu); + + return rxe_register_device(rxe, ibdev_name, ndev); +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-RDMA-rxe-Remove-the-direct-link-to-net_device.patch b/SPECS/linux/6.1/CVE/0001-RDMA-rxe-Remove-the-direct-link-to-net_device.patch new file mode 100644 index 0000000000..b414af41e0 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-RDMA-rxe-Remove-the-direct-link-to-net_device.patch @@ -0,0 +1,434 @@ +From d2537d83861aa6cedf99d03fb158312cf1ddd6c9 Mon Sep 17 00:00:00 2001 +From: Zhu Yanjun +Date: Fri, 20 Dec 2024 23:23:25 +0100 +Subject: [PATCH] RDMA/rxe: Remove the direct link to net_device + +[ Upstream commit 2ac5415022d16d63d912a39a06f32f1f51140261 ] + +The similar patch in siw is in the link: +https://git.kernel.org/rdma/rdma/c/16b87037b48889 + +This problem also occurred in RXE. The following analyze this problem. +In the following Call Traces: +" +BUG: KASAN: slab-use-after-free in dev_get_flags+0x188/0x1d0 net/core/dev.c:8782 +Read of size 4 at addr ffff8880554640b0 by task kworker/1:4/5295 + +CPU: 1 UID: 0 PID: 5295 Comm: kworker/1:4 Not tainted +6.12.0-rc3-syzkaller-00399-g9197b73fd7bb #0 +Hardware name: Google Compute Engine/Google Compute Engine, +BIOS Google 09/13/2024 +Workqueue: infiniband ib_cache_event_task +Call Trace: + + __dump_stack lib/dump_stack.c:94 [inline] + dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 + print_address_description mm/kasan/report.c:377 [inline] + print_report+0x169/0x550 mm/kasan/report.c:488 + kasan_report+0x143/0x180 mm/kasan/report.c:601 + dev_get_flags+0x188/0x1d0 net/core/dev.c:8782 + rxe_query_port+0x12d/0x260 drivers/infiniband/sw/rxe/rxe_verbs.c:60 + __ib_query_port drivers/infiniband/core/device.c:2111 [inline] + ib_query_port+0x168/0x7d0 drivers/infiniband/core/device.c:2143 + ib_cache_update+0x1a9/0xb80 drivers/infiniband/core/cache.c:1494 + ib_cache_event_task+0xf3/0x1e0 drivers/infiniband/core/cache.c:1568 + process_one_work kernel/workqueue.c:3229 [inline] + process_scheduled_works+0xa65/0x1850 kernel/workqueue.c:3310 + worker_thread+0x870/0xd30 kernel/workqueue.c:3391 + kthread+0x2f2/0x390 kernel/kthread.c:389 + ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147 + ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 + +" + +1). In the link [1], + +" + infiniband syz2: set down +" + +This means that on 839.350575, the event ib_cache_event_task was sent andi +queued in ib_wq. + +2). In the link [1], + +" + team0 (unregistering): Port device team_slave_0 removed +" + +It indicates that before 843.251853, the net device should be freed. + +3). In the link [1], + +" + BUG: KASAN: slab-use-after-free in dev_get_flags+0x188/0x1d0 +" + +This means that on 850.559070, this slab-use-after-free problem occurred. + +In all, on 839.350575, the event ib_cache_event_task was sent and queued +in ib_wq, + +before 843.251853, the net device veth was freed. + +on 850.559070, this event was executed, and the mentioned freed net device +was called. Thus, the above call trace occurred. + +[1] https://syzkaller.appspot.com/x/log.txt?x=12e7025f980000 + +Reported-by: syzbot+4b87489410b4efd181bf@syzkaller.appspotmail.com +Closes: https://syzkaller.appspot.com/bug?extid=4b87489410b4efd181bf +Fixes: 8700e3e7c485 ("Soft RoCE driver") +Signed-off-by: Zhu Yanjun +Link: https://patch.msgid.link/20241220222325.2487767-1-yanjun.zhu@linux.dev +Signed-off-by: Leon Romanovsky +Signed-off-by: Sasha Levin +[Shivani: Modified to apply on 6.1.y, Exported ib_device_get_netdev() +function and also added it to ib_verbs.h file. Added Error handling +in rxe_query_port() function.] +Signed-off-by: Shivani Agarwal +--- + drivers/infiniband/core/device.c | 1 + + drivers/infiniband/sw/rxe/rxe.c | 23 +++++++++++++++---- + drivers/infiniband/sw/rxe/rxe.h | 3 ++- + drivers/infiniband/sw/rxe/rxe_mcast.c | 22 ++++++++++++++++-- + drivers/infiniband/sw/rxe/rxe_net.c | 25 ++++++++++++++++----- + drivers/infiniband/sw/rxe/rxe_verbs.c | 32 ++++++++++++++++++++++----- + drivers/infiniband/sw/rxe/rxe_verbs.h | 11 ++++++--- + include/rdma/ib_verbs.h | 2 ++ + 8 files changed, 98 insertions(+), 21 deletions(-) + +diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c +index a5ba2cb30..8649cb3d8 100644 +--- a/drivers/infiniband/core/device.c ++++ b/drivers/infiniband/core/device.c +@@ -2258,6 +2258,7 @@ struct net_device *ib_device_get_netdev(struct ib_device *ib_dev, + + return res; + } ++EXPORT_SYMBOL(ib_device_get_netdev); + + /** + * ib_device_get_by_netdev - Find an IB device associated with a netdev +diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c +index be3ddfbf3..2535c4048 100644 +--- a/drivers/infiniband/sw/rxe/rxe.c ++++ b/drivers/infiniband/sw/rxe/rxe.c +@@ -40,6 +40,8 @@ void rxe_dealloc(struct ib_device *ib_dev) + /* initialize rxe device parameters */ + static void rxe_init_device_param(struct rxe_dev *rxe) + { ++ struct net_device *ndev; ++ + rxe->max_inline_data = RXE_MAX_INLINE_DATA; + + rxe->attr.vendor_id = RXE_VENDOR_ID; +@@ -71,8 +73,15 @@ static void rxe_init_device_param(struct rxe_dev *rxe) + rxe->attr.max_fast_reg_page_list_len = RXE_MAX_FMR_PAGE_LIST_LEN; + rxe->attr.max_pkeys = RXE_MAX_PKEYS; + rxe->attr.local_ca_ack_delay = RXE_LOCAL_CA_ACK_DELAY; ++ ++ ndev = rxe_ib_device_get_netdev(&rxe->ib_dev); ++ if (!ndev) ++ return; ++ + addrconf_addr_eui48((unsigned char *)&rxe->attr.sys_image_guid, +- rxe->ndev->dev_addr); ++ ndev->dev_addr); ++ ++ dev_put(ndev); + + rxe->max_ucontext = RXE_MAX_UCONTEXT; + } +@@ -109,10 +118,15 @@ static void rxe_init_port_param(struct rxe_port *port) + static void rxe_init_ports(struct rxe_dev *rxe) + { + struct rxe_port *port = &rxe->port; ++ struct net_device *ndev; + + rxe_init_port_param(port); ++ ndev = rxe_ib_device_get_netdev(&rxe->ib_dev); ++ if (!ndev) ++ return; + addrconf_addr_eui48((unsigned char *)&port->port_guid, +- rxe->ndev->dev_addr); ++ ndev->dev_addr); ++ dev_put(ndev); + spin_lock_init(&port->port_lock); + } + +@@ -167,12 +181,13 @@ void rxe_set_mtu(struct rxe_dev *rxe, unsigned int ndev_mtu) + /* called by ifc layer to create new rxe device. + * The caller should allocate memory for rxe by calling ib_alloc_device. + */ +-int rxe_add(struct rxe_dev *rxe, unsigned int mtu, const char *ibdev_name) ++int rxe_add(struct rxe_dev *rxe, unsigned int mtu, const char *ibdev_name, ++ struct net_device *ndev) + { + rxe_init(rxe); + rxe_set_mtu(rxe, mtu); + +- return rxe_register_device(rxe, ibdev_name); ++ return rxe_register_device(rxe, ibdev_name, ndev); + } + + static int rxe_newlink(const char *ibdev_name, struct net_device *ndev) +diff --git a/drivers/infiniband/sw/rxe/rxe.h b/drivers/infiniband/sw/rxe/rxe.h +index ab334900f..803e57971 100644 +--- a/drivers/infiniband/sw/rxe/rxe.h ++++ b/drivers/infiniband/sw/rxe/rxe.h +@@ -59,7 +59,8 @@ + + void rxe_set_mtu(struct rxe_dev *rxe, unsigned int dev_mtu); + +-int rxe_add(struct rxe_dev *rxe, unsigned int mtu, const char *ibdev_name); ++int rxe_add(struct rxe_dev *rxe, unsigned int mtu, const char *ibdev_name, ++ struct net_device *ndev); + + void rxe_rcv(struct sk_buff *skb); + +diff --git a/drivers/infiniband/sw/rxe/rxe_mcast.c b/drivers/infiniband/sw/rxe/rxe_mcast.c +index 86cc2e18a..07ff47bae 100644 +--- a/drivers/infiniband/sw/rxe/rxe_mcast.c ++++ b/drivers/infiniband/sw/rxe/rxe_mcast.c +@@ -31,10 +31,19 @@ + static int rxe_mcast_add(struct rxe_dev *rxe, union ib_gid *mgid) + { + unsigned char ll_addr[ETH_ALEN]; ++ struct net_device *ndev; ++ int ret; ++ ++ ndev = rxe_ib_device_get_netdev(&rxe->ib_dev); ++ if (!ndev) ++ return -ENODEV; + + ipv6_eth_mc_map((struct in6_addr *)mgid->raw, ll_addr); + +- return dev_mc_add(rxe->ndev, ll_addr); ++ ret = dev_mc_add(ndev, ll_addr); ++ dev_put(ndev); ++ ++ return ret; + } + + /** +@@ -47,10 +56,19 @@ static int rxe_mcast_add(struct rxe_dev *rxe, union ib_gid *mgid) + static int rxe_mcast_del(struct rxe_dev *rxe, union ib_gid *mgid) + { + unsigned char ll_addr[ETH_ALEN]; ++ struct net_device *ndev; ++ int ret; ++ ++ ndev = rxe_ib_device_get_netdev(&rxe->ib_dev); ++ if (!ndev) ++ return -ENODEV; + + ipv6_eth_mc_map((struct in6_addr *)mgid->raw, ll_addr); + +- return dev_mc_del(rxe->ndev, ll_addr); ++ ret = dev_mc_del(ndev, ll_addr); ++ dev_put(ndev); ++ ++ return ret; + } + + /** +diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c +index 779cd547c..4554b746e 100644 +--- a/drivers/infiniband/sw/rxe/rxe_net.c ++++ b/drivers/infiniband/sw/rxe/rxe_net.c +@@ -505,7 +505,16 @@ struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av, + */ + const char *rxe_parent_name(struct rxe_dev *rxe, unsigned int port_num) + { +- return rxe->ndev->name; ++ struct net_device *ndev; ++ char *ndev_name; ++ ++ ndev = rxe_ib_device_get_netdev(&rxe->ib_dev); ++ if (!ndev) ++ return NULL; ++ ndev_name = ndev->name; ++ dev_put(ndev); ++ ++ return ndev_name; + } + + int rxe_net_add(const char *ibdev_name, struct net_device *ndev) +@@ -517,9 +526,7 @@ int rxe_net_add(const char *ibdev_name, struct net_device *ndev) + if (!rxe) + return -ENOMEM; + +- rxe->ndev = ndev; +- +- err = rxe_add(rxe, ndev->mtu, ibdev_name); ++ err = rxe_add(rxe, ndev->mtu, ibdev_name, ndev); + if (err) { + ib_dealloc_device(&rxe->ib_dev); + return err; +@@ -567,10 +574,18 @@ void rxe_port_down(struct rxe_dev *rxe) + + void rxe_set_port_state(struct rxe_dev *rxe) + { +- if (netif_running(rxe->ndev) && netif_carrier_ok(rxe->ndev)) ++ struct net_device *ndev; ++ ++ ndev = rxe_ib_device_get_netdev(&rxe->ib_dev); ++ if (!ndev) ++ return; ++ ++ if (netif_running(ndev) && netif_carrier_ok(ndev)) + rxe_port_up(rxe); + else + rxe_port_down(rxe); ++ ++ dev_put(ndev); + } + + static int rxe_notify(struct notifier_block *not_blk, +diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c +index 065717c11..d280f5017 100644 +--- a/drivers/infiniband/sw/rxe/rxe_verbs.c ++++ b/drivers/infiniband/sw/rxe/rxe_verbs.c +@@ -29,25 +29,37 @@ static int rxe_query_port(struct ib_device *dev, + u32 port_num, struct ib_port_attr *attr) + { + struct rxe_dev *rxe = to_rdev(dev); +- int rc; ++ struct net_device *ndev; ++ int err, rc; + + /* *attr being zeroed by the caller, avoid zeroing it here */ + *attr = rxe->port.attr; + ++ ndev = rxe_ib_device_get_netdev(dev); ++ if (!ndev) { ++ err = -ENODEV; ++ goto err_out; ++ } ++ + mutex_lock(&rxe->usdev_lock); + rc = ib_get_eth_speed(dev, port_num, &attr->active_speed, + &attr->active_width); + + if (attr->state == IB_PORT_ACTIVE) + attr->phys_state = IB_PORT_PHYS_STATE_LINK_UP; +- else if (dev_get_flags(rxe->ndev) & IFF_UP) ++ else if (dev_get_flags(ndev) & IFF_UP) + attr->phys_state = IB_PORT_PHYS_STATE_POLLING; + else + attr->phys_state = IB_PORT_PHYS_STATE_DISABLED; + + mutex_unlock(&rxe->usdev_lock); + ++ dev_put(ndev); + return rc; ++ ++err_out: ++ pr_err("rxe returned err = %d", err); ++ return err; + } + + static int rxe_query_pkey(struct ib_device *device, +@@ -1003,9 +1015,16 @@ static const struct attribute_group rxe_attr_group = { + static int rxe_enable_driver(struct ib_device *ib_dev) + { + struct rxe_dev *rxe = container_of(ib_dev, struct rxe_dev, ib_dev); ++ struct net_device *ndev; ++ ++ ndev = rxe_ib_device_get_netdev(ib_dev); ++ if (!ndev) ++ return -ENODEV; + + rxe_set_port_state(rxe); +- dev_info(&rxe->ib_dev.dev, "added %s\n", netdev_name(rxe->ndev)); ++ dev_info(&rxe->ib_dev.dev, "added %s\n", netdev_name(ndev)); ++ ++ dev_put(ndev); + return 0; + } + +@@ -1072,7 +1091,8 @@ static const struct ib_device_ops rxe_dev_ops = { + INIT_RDMA_OBJ_SIZE(ib_mw, rxe_mw, ibmw), + }; + +-int rxe_register_device(struct rxe_dev *rxe, const char *ibdev_name) ++int rxe_register_device(struct rxe_dev *rxe, const char *ibdev_name, ++ struct net_device *ndev) + { + int err; + struct ib_device *dev = &rxe->ib_dev; +@@ -1084,13 +1104,13 @@ int rxe_register_device(struct rxe_dev *rxe, const char *ibdev_name) + dev->num_comp_vectors = num_possible_cpus(); + dev->local_dma_lkey = 0; + addrconf_addr_eui48((unsigned char *)&dev->node_guid, +- rxe->ndev->dev_addr); ++ ndev->dev_addr); + + dev->uverbs_cmd_mask |= BIT_ULL(IB_USER_VERBS_CMD_POST_SEND) | + BIT_ULL(IB_USER_VERBS_CMD_REQ_NOTIFY_CQ); + + ib_set_device_ops(dev, &rxe_dev_ops); +- err = ib_device_set_netdev(&rxe->ib_dev, rxe->ndev, 1); ++ err = ib_device_set_netdev(&rxe->ib_dev, ndev, 1); + if (err) + return err; + +diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.h b/drivers/infiniband/sw/rxe/rxe_verbs.h +index 5f5cbfcb3..f6db92bff 100644 +--- a/drivers/infiniband/sw/rxe/rxe_verbs.h ++++ b/drivers/infiniband/sw/rxe/rxe_verbs.h +@@ -369,6 +369,7 @@ struct rxe_port { + u32 qp_gsi_index; + }; + ++#define RXE_PORT 1 + struct rxe_dev { + struct ib_device ib_dev; + struct ib_device_attr attr; +@@ -376,8 +377,6 @@ struct rxe_dev { + int max_inline_data; + struct mutex usdev_lock; + +- struct net_device *ndev; +- + struct rxe_pool uc_pool; + struct rxe_pool pd_pool; + struct rxe_pool ah_pool; +@@ -405,6 +404,11 @@ struct rxe_dev { + struct crypto_shash *tfm; + }; + ++static inline struct net_device *rxe_ib_device_get_netdev(struct ib_device *dev) ++{ ++ return ib_device_get_netdev(dev, RXE_PORT); ++} ++ + static inline void rxe_counter_inc(struct rxe_dev *rxe, enum rxe_counters index) + { + atomic64_inc(&rxe->stats_counters[index]); +@@ -470,6 +474,7 @@ static inline struct rxe_pd *rxe_mw_pd(struct rxe_mw *mw) + return to_rpd(mw->ibmw.pd); + } + +-int rxe_register_device(struct rxe_dev *rxe, const char *ibdev_name); ++int rxe_register_device(struct rxe_dev *rxe, const char *ibdev_name, ++ struct net_device *ndev); + + #endif /* RXE_VERBS_H */ +diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h +index 41eb2a7c9..ae53ee2da 100644 +--- a/include/rdma/ib_verbs.h ++++ b/include/rdma/ib_verbs.h +@@ -4397,6 +4397,8 @@ struct net_device *ib_get_net_dev_by_params(struct ib_device *dev, u32 port, + const struct sockaddr *addr); + int ib_device_set_netdev(struct ib_device *ib_dev, struct net_device *ndev, + unsigned int port); ++struct net_device *ib_device_get_netdev(struct ib_device *ib_dev, ++ u32 port); + struct net_device *ib_device_netdev(struct ib_device *dev, u32 port); + + struct ib_wq *ib_create_wq(struct ib_pd *pd, +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-SUNRPC-fix-a-memleak-in-gss_import_v2_context.patch b/SPECS/linux/6.1/CVE/0001-SUNRPC-fix-a-memleak-in-gss_import_v2_context.patch new file mode 100644 index 0000000000..205e00af84 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-SUNRPC-fix-a-memleak-in-gss_import_v2_context.patch @@ -0,0 +1,70 @@ +From 48233ada37da182d4f98ed6467ea72ebb71d1650 Mon Sep 17 00:00:00 2001 +From: Zhipeng Lu +Date: Sun, 24 Dec 2023 16:20:33 +0800 +Subject: [PATCH] SUNRPC: fix a memleak in gss_import_v2_context + +[ Upstream commit e67b652d8e8591d3b1e569dbcdfcee15993e91fa ] + +The ctx->mech_used.data allocated by kmemdup is not freed in neither +gss_import_v2_context nor it only caller gss_krb5_import_sec_context, +which frees ctx on error. + +Thus, this patch reform the last call of gss_import_v2_context to the +gss_krb5_import_ctx_v2, preventing the memleak while keepping the return +formation. + +Fixes: 47d848077629 ("gss_krb5: handle new context format from gssd") +Signed-off-by: Zhipeng Lu +Reviewed-by: Jeff Layton +Signed-off-by: Chuck Lever +Signed-off-by: Sasha Levin +[ Brennan : Ported error handling to v6.1 ] +Signed-off-by: Brennan Lamoreaux +--- + net/sunrpc/auth_gss/gss_krb5_mech.c | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c +index 1c092b05c2bb..232d31111e4f 100644 +--- a/net/sunrpc/auth_gss/gss_krb5_mech.c ++++ b/net/sunrpc/auth_gss/gss_krb5_mech.c +@@ -471,6 +471,7 @@ gss_import_v2_context(const void *p, const void *end, struct krb5_ctx *ctx, + u64 seq_send64; + int keylen; + u32 time32; ++ int ret; + + p = simple_get_bytes(p, end, &ctx->flags, sizeof(ctx->flags)); + if (IS_ERR(p)) +@@ -528,14 +529,25 @@ gss_import_v2_context(const void *p, const void *end, struct krb5_ctx *ctx, + + switch (ctx->enctype) { + case ENCTYPE_DES3_CBC_RAW: +- return context_derive_keys_des3(ctx, gfp_mask); ++ ret = context_derive_keys_des3(ctx, gfp_mask); ++ break; + case ENCTYPE_AES128_CTS_HMAC_SHA1_96: + case ENCTYPE_AES256_CTS_HMAC_SHA1_96: +- return context_derive_keys_new(ctx, gfp_mask); ++ ret = context_derive_keys_new(ctx, gfp_mask); ++ break; + default: +- return -EINVAL; ++ ret = -EINVAL; ++ } ++ ++ if (ret) { ++ p = ERR_PTR(ret); ++ goto out_free; + } + ++ return 0; ++ ++out_free: ++ kfree(ctx->mech_used.data); + out_err: + return PTR_ERR(p); + } +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-bnxt_en-Fix-possible-crash-after-creating-sw-mqprio-.patch b/SPECS/linux/6.1/CVE/0001-bnxt_en-Fix-possible-crash-after-creating-sw-mqprio-.patch new file mode 100644 index 0000000000..bbcaf86bbc --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-bnxt_en-Fix-possible-crash-after-creating-sw-mqprio-.patch @@ -0,0 +1,205 @@ +From d3901ff5ff76fe9e08e20df771dd28ab215e21ae Mon Sep 17 00:00:00 2001 +From: Michael Chan +Date: Wed, 17 Jan 2024 15:45:15 -0800 +Subject: [PATCH 1/2] bnxt_en: Fix possible crash after creating sw mqprio TCs + +commit 467739baf63646d4a5033f7f8a9306669ea55326 upstream + +The driver relies on netdev_get_num_tc() to get the number of HW +offloaded mqprio TCs to allocate and free TX rings. This won't +work and can potentially crash the system if software mqprio or +taprio TCs have been setup. netdev_get_num_tc() will return the +number of software TCs and it may cause the driver to allocate or +free more TX rings that it should. Fix it by adding a bp->num_tc +field to store the number of HW offload mqprio TCs for the device. +Use bp->num_tc instead of netdev_get_num_tc(). + +This fixes a crash like this: + +BUG: kernel NULL pointer dereference, address: 0000000000000000 +PGD 42b8404067 P4D 0 +Oops: 0000 [#1] PREEMPT SMP NOPTI +CPU: 120 PID: 8661 Comm: ifconfig Kdump: loaded Tainted: G OE 5.18.16 #1 +Hardware name: Lenovo ThinkSystem SR650 V3/SB27A92818, BIOS ESE114N-2.12 04/25/2023 +RIP: 0010:bnxt_hwrm_cp_ring_alloc_p5+0x10/0x90 [bnxt_en] +Code: 41 5c 41 5d 41 5e c3 cc cc cc cc 41 8b 44 24 08 66 89 03 eb c6 e8 b0 f1 7d db 0f 1f 44 00 00 41 56 41 55 41 54 55 48 89 fd 53 <48> 8b 06 48 89 f3 48 81 c6 28 01 00 00 0f b6 96 13 ff ff ff 44 8b +RSP: 0018:ff65907660d1fa88 EFLAGS: 00010202 +RAX: 0000000000000010 RBX: ff4dde1d907e4980 RCX: f400000000000000 +RDX: 0000000000000010 RSI: 0000000000000000 RDI: ff4dde1d907e4980 +RBP: ff4dde1d907e4980 R08: 000000000000000f R09: 0000000000000000 +R10: ff4dde5f02671800 R11: 0000000000000008 R12: 0000000088888889 +R13: 0500000000000000 R14: 00f0000000000000 R15: ff4dde5f02671800 +FS: 00007f4b126b5740(0000) GS:ff4dde9bff600000(0000) knlGS:0000000000000000 +CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 0000000000000000 CR3: 000000416f9c6002 CR4: 0000000000771ee0 +DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 +DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400 +PKRU: 55555554 +Call Trace: + + bnxt_hwrm_ring_alloc+0x204/0x770 [bnxt_en] + bnxt_init_chip+0x4d/0x680 [bnxt_en] + ? bnxt_poll+0x1a0/0x1a0 [bnxt_en] + __bnxt_open_nic+0xd2/0x740 [bnxt_en] + bnxt_open+0x10b/0x220 [bnxt_en] + ? raw_notifier_call_chain+0x41/0x60 + __dev_open+0xf3/0x1b0 + __dev_change_flags+0x1db/0x250 + dev_change_flags+0x21/0x60 + devinet_ioctl+0x590/0x720 + ? avc_has_extended_perms+0x1b7/0x420 + ? _copy_from_user+0x3a/0x60 + inet_ioctl+0x189/0x1c0 + ? wp_page_copy+0x45a/0x6e0 + sock_do_ioctl+0x42/0xf0 + ? ioctl_has_perm.constprop.0.isra.0+0xbd/0x120 + sock_ioctl+0x1ce/0x2e0 + __x64_sys_ioctl+0x87/0xc0 + do_syscall_64+0x59/0x90 + ? syscall_exit_work+0x103/0x130 + ? syscall_exit_to_user_mode+0x12/0x30 + ? do_syscall_64+0x69/0x90 + ? exc_page_fault+0x62/0x150 + +Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") +Reviewed-by: Damodharam Ammepalli +Reviewed-by: Andy Gospodarek +Signed-off-by: Michael Chan +Link: https://lore.kernel.org/r/20240117234515.226944-6-michael.chan@broadcom.com +Signed-off-by: Jakub Kicinski +[ Brennan : Backported to v6.1, drop context in few places as not needed ] +Signed-off-by: Brennan Lamoreaux +--- + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 13 +++++++++---- + drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 + + drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c | 2 +- + drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 4 ++-- + drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 2 +- + 5 files changed, 14 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +index 6b1245a3ab4b..5d85f04f9ed6 100644 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +@@ -8990,7 +8990,7 @@ static void bnxt_setup_msix(struct bnxt *bp) + struct net_device *dev = bp->dev; + int tcs, i; + +- tcs = netdev_get_num_tc(dev); ++ tcs = bp->num_tc; + if (tcs) { + int i, off, count; + +@@ -9022,8 +9022,10 @@ static void bnxt_setup_inta(struct bnxt *bp) + { + const int len = sizeof(bp->irq_tbl[0].name); + +- if (netdev_get_num_tc(bp->dev)) ++ if (bp->num_tc) { + netdev_reset_tc(bp->dev); ++ bp->num_tc = 0; ++ } + + snprintf(bp->irq_tbl[0].name, len, "%s-%s-%d", bp->dev->name, "TxRx", + 0); +@@ -9250,8 +9252,8 @@ static void bnxt_clear_int_mode(struct bnxt *bp) + + int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init) + { +- int tcs = netdev_get_num_tc(bp->dev); + bool irq_cleared = false; ++ int tcs = bp->num_tc; + int rc; + + if (!bnxt_need_reserve_rings(bp)) +@@ -9277,6 +9279,7 @@ int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init) + bp->tx_nr_rings - bp->tx_nr_rings_xdp)) { + netdev_err(bp->dev, "tx ring reservation failure\n"); + netdev_reset_tc(bp->dev); ++ bp->num_tc = 0; + if (bp->tx_nr_rings_xdp) + bp->tx_nr_rings_per_tc = bp->tx_nr_rings_xdp; + else +@@ -12827,7 +12830,7 @@ int bnxt_setup_mq_tc(struct net_device *dev, u8 tc) + return -EINVAL; + } + +- if (netdev_get_num_tc(dev) == tc) ++ if (bp->num_tc == tc) + return 0; + + if (bp->flags & BNXT_FLAG_SHARED_RINGS) +@@ -12845,9 +12848,11 @@ int bnxt_setup_mq_tc(struct net_device *dev, u8 tc) + if (tc) { + bp->tx_nr_rings = bp->tx_nr_rings_per_tc * tc; + netdev_set_num_tc(dev, tc); ++ bp->num_tc = tc; + } else { + bp->tx_nr_rings = bp->tx_nr_rings_per_tc; + netdev_reset_tc(dev); ++ bp->num_tc = 0; + } + bp->tx_nr_rings += bp->tx_nr_rings_xdp; + bp->cp_nr_rings = sh ? max_t(int, bp->tx_nr_rings, bp->rx_nr_rings) : +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h +index 111098b4b606..cf2e72d8ea7a 100644 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h +@@ -1935,6 +1935,7 @@ struct bnxt { + u8 tc_to_qidx[BNXT_MAX_QUEUE]; + u8 q_ids[BNXT_MAX_QUEUE]; + u8 max_q; ++ u8 num_tc; + + unsigned int current_interval; + #define BNXT_TIMER_INTERVAL HZ +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c +index 1727e9bb1479..71e14be2507e 100644 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c +@@ -228,7 +228,7 @@ static int bnxt_queue_remap(struct bnxt *bp, unsigned int lltc_mask) + } + } + if (bp->ieee_ets) { +- int tc = netdev_get_num_tc(bp->dev); ++ int tc = bp->num_tc; + + if (!tc) + tc = 1; +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +index 7daaed4520ac..b1629c7b517f 100644 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +@@ -866,7 +866,7 @@ static void bnxt_get_channels(struct net_device *dev, + if (max_tx_sch_inputs) + max_tx_rings = min_t(int, max_tx_rings, max_tx_sch_inputs); + +- tcs = netdev_get_num_tc(dev); ++ tcs = bp->num_tc; + tx_grps = max(tcs, 1); + if (bp->tx_nr_rings_xdp) + tx_grps++; +@@ -925,7 +925,7 @@ static int bnxt_set_channels(struct net_device *dev, + if (channel->combined_count) + sh = true; + +- tcs = netdev_get_num_tc(dev); ++ tcs = bp->num_tc; + + req_tx_rings = sh ? channel->combined_count : channel->tx_count; + req_rx_rings = sh ? channel->combined_count : channel->rx_count; +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c +index 967a7fa291ea..e883ce65a697 100644 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c +@@ -404,7 +404,7 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog) + if (prog) + tx_xdp = bp->rx_nr_rings; + +- tc = netdev_get_num_tc(dev); ++ tc = bp->num_tc; + if (!tc) + tc = 1; + rc = bnxt_check_rings(bp, bp->tx_nr_rings_per_tc, bp->rx_nr_rings, +-- +2.40.4 diff --git a/SPECS/linux/6.1/CVE/0001-bonding-fix-type-confusion-in-bond_setup_by_slave.patch b/SPECS/linux/6.1/CVE/0001-bonding-fix-type-confusion-in-bond_setup_by_slave.patch new file mode 100644 index 0000000000..a31f334862 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-bonding-fix-type-confusion-in-bond_setup_by_slave.patch @@ -0,0 +1,151 @@ +From 9baf26a91565b7bb2b1d9f99aaf884a2b28c2f6d Mon Sep 17 00:00:00 2001 +From: Jiayuan Chen +Date: Fri, 6 Mar 2026 10:15:07 +0800 +Subject: [PATCH] bonding: fix type confusion in bond_setup_by_slave() + +[ Upstream commit 950803f7254721c1c15858fbbfae3deaaeeecb11 ] + +kernel BUG at net/core/skbuff.c:2306! +Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI +RIP: 0010:pskb_expand_head+0xa08/0xfe0 net/core/skbuff.c:2306 +RSP: 0018:ffffc90004aff760 EFLAGS: 00010293 +RAX: 0000000000000000 RBX: ffff88807e3c8780 RCX: ffffffff89593e0e +RDX: ffff88807b7c4900 RSI: ffffffff89594747 RDI: ffff88807b7c4900 +RBP: 0000000000000820 R08: 0000000000000005 R09: 0000000000000000 +R10: 00000000961a63e0 R11: 0000000000000000 R12: ffff88807e3c8780 +R13: 00000000961a6560 R14: dffffc0000000000 R15: 00000000961a63e0 +CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 00007fe1a0ed8df0 CR3: 000000002d816000 CR4: 00000000003526f0 +Call Trace: + + ipgre_header+0xdd/0x540 net/ipv4/ip_gre.c:900 + dev_hard_header include/linux/netdevice.h:3439 [inline] + packet_snd net/packet/af_packet.c:3028 [inline] + packet_sendmsg+0x3ae5/0x53c0 net/packet/af_packet.c:3108 + sock_sendmsg_nosec net/socket.c:727 [inline] + __sock_sendmsg net/socket.c:742 [inline] + ____sys_sendmsg+0xa54/0xc30 net/socket.c:2592 + ___sys_sendmsg+0x190/0x1e0 net/socket.c:2646 + __sys_sendmsg+0x170/0x220 net/socket.c:2678 + do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] + do_syscall_64+0x106/0xf80 arch/x86/entry/syscall_64.c:94 + entry_SYSCALL_64_after_hwframe+0x77/0x7f +RIP: 0033:0x7fe1a0e6c1a9 + +When a non-Ethernet device (e.g. GRE tunnel) is enslaved to a bond, +bond_setup_by_slave() directly copies the slave's header_ops to the +bond device: + + bond_dev->header_ops = slave_dev->header_ops; + +This causes a type confusion when dev_hard_header() is later called +on the bond device. Functions like ipgre_header(), ip6gre_header(),all use +netdev_priv(dev) to access their device-specific private data. When +called with the bond device, netdev_priv() returns the bond's private +data (struct bonding) instead of the expected type (e.g. struct +ip_tunnel), leading to garbage values being read and kernel crashes. + +Fix this by introducing bond_header_ops with wrapper functions that +delegate to the active slave's header_ops using the slave's own +device. This ensures netdev_priv() in the slave's header functions +always receives the correct device. + +The fix is placed in the bonding driver rather than individual device +drivers, as the root cause is bond blindly inheriting header_ops from +the slave without considering that these callbacks expect a specific +netdev_priv() layout. + +The type confusion can be observed by adding a printk in +ipgre_header() and running the following commands: + + ip link add dummy0 type dummy + ip addr add 10.0.0.1/24 dev dummy0 + ip link set dummy0 up + ip link add gre1 type gre local 10.0.0.1 + ip link add bond1 type bond mode active-backup + ip link set gre1 master bond1 + ip link set gre1 up + ip link set bond1 up + ip addr add fe80::1/64 dev bond1 + +Fixes: 1284cd3a2b74 ("bonding: two small fixes for IPoIB support") +Suggested-by: Jay Vosburgh +Reviewed-by: Eric Dumazet +Signed-off-by: Jiayuan Chen +Link: https://patch.msgid.link/20260306021508.222062-1-jiayuan.chen@linux.dev +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +[ Keerthana: Modified to apply on v6.1.y ] +Signed-off-by: Keerthana K +--- + drivers/net/bonding/bond_main.c | 47 ++++++++++++++++++++++++++++++++- + 1 file changed, 46 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c +index e9e2dec1dcb1..026b1c4f4f0d 100644 +--- a/drivers/net/bonding/bond_main.c ++++ b/drivers/net/bonding/bond_main.c +@@ -1457,6 +1457,50 @@ static netdev_features_t bond_fix_features(struct net_device *dev, + return features; + } + ++static int bond_header_create(struct sk_buff *skb, struct net_device *bond_dev, ++ unsigned short type, const void *daddr, ++ const void *saddr, unsigned int len) ++{ ++ struct bonding *bond = netdev_priv(bond_dev); ++ const struct header_ops *slave_ops; ++ struct slave *slave; ++ int ret = 0; ++ ++ rcu_read_lock(); ++ slave = rcu_dereference(bond->curr_active_slave); ++ if (slave) { ++ slave_ops = READ_ONCE(slave->dev->header_ops); ++ if (slave_ops && slave_ops->create) ++ ret = slave_ops->create(skb, slave->dev, ++ type, daddr, saddr, len); ++ } ++ rcu_read_unlock(); ++ return ret; ++} ++ ++static int bond_header_parse(const struct sk_buff *skb, unsigned char *haddr) ++{ ++ struct bonding *bond = netdev_priv(skb->dev); ++ const struct header_ops *slave_ops; ++ struct slave *slave; ++ int ret = 0; ++ ++ rcu_read_lock(); ++ slave = rcu_dereference(bond->curr_active_slave); ++ if (slave) { ++ slave_ops = READ_ONCE(slave->dev->header_ops); ++ if (slave_ops && slave_ops->parse) ++ ret = slave_ops->parse(skb, haddr); ++ } ++ rcu_read_unlock(); ++ return ret; ++} ++ ++static const struct header_ops bond_header_ops = { ++ .create = bond_header_create, ++ .parse = bond_header_parse, ++}; ++ + #define BOND_VLAN_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ + NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE | \ + NETIF_F_GSO_ENCAP_ALL | \ +@@ -1545,7 +1589,8 @@ static void bond_setup_by_slave(struct net_device *bond_dev, + + dev_close(bond_dev); + +- bond_dev->header_ops = slave_dev->header_ops; ++ bond_dev->header_ops = slave_dev->header_ops ? ++ &bond_header_ops : NULL; + + bond_dev->type = slave_dev->type; + bond_dev->hard_header_len = slave_dev->hard_header_len; +-- +2.43.7 + diff --git a/SPECS/linux/6.1/CVE/0001-bonding-fix-use-after-free-due-to-enslave-fail-after-slave-array-update.patch b/SPECS/linux/6.1/CVE/0001-bonding-fix-use-after-free-due-to-enslave-fail-after-slave-array-update.patch new file mode 100644 index 0000000000..30b3270653 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-bonding-fix-use-after-free-due-to-enslave-fail-after-slave-array-update.patch @@ -0,0 +1,102 @@ +From bd25b092a06a3e05f7e8bd6da6fa7318777d8c3d Mon Sep 17 00:00:00 2001 +From: Nikolay Aleksandrov +Date: Fri, 23 Jan 2026 14:06:59 +0200 +Subject: bonding: fix use-after-free due to enslave fail after slave array + update + +[ Upstream commit e9acda52fd2ee0cdca332f996da7a95c5fd25294 ] + +Fix a use-after-free which happens due to enslave failure after the new +slave has been added to the array. Since the new slave can be used for Tx +immediately, we can use it after it has been freed by the enslave error +cleanup path which frees the allocated slave memory. Slave update array is +supposed to be called last when further enslave failures are not expected. +Move it after xdp setup to avoid any problems. + +It is very easy to reproduce the problem with a simple xdp_pass prog: + ip l add bond1 type bond mode balance-xor + ip l set bond1 up + ip l set dev bond1 xdp object xdp_pass.o sec xdp_pass + ip l add dumdum type dummy + +Then run in parallel: + while :; do ip l set dumdum master bond1 1>/dev/null 2>&1; done; + mausezahn bond1 -a own -b rand -A rand -B 1.1.1.1 -c 0 -t tcp "dp=1-1023, flags=syn" + +The crash happens almost immediately: + [ 605.602850] Oops: general protection fault, probably for non-canonical address 0xe0e6fc2460000137: 0000 [#1] SMP KASAN NOPTI + [ 605.602916] KASAN: maybe wild-memory-access in range [0x07380123000009b8-0x07380123000009bf] + [ 605.602946] CPU: 0 UID: 0 PID: 2445 Comm: mausezahn Kdump: loaded Tainted: G B 6.19.0-rc6+ #21 PREEMPT(voluntary) + [ 605.602979] Tainted: [B]=BAD_PAGE + [ 605.602998] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 + [ 605.603032] RIP: 0010:netdev_core_pick_tx+0xcd/0x210 + [ 605.603063] Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 3e 01 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 6b 08 49 8d 7d 30 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 25 01 00 00 49 8b 45 30 4c 89 e2 48 89 ee 48 89 + [ 605.603111] RSP: 0018:ffff88817b9af348 EFLAGS: 00010213 + [ 605.603145] RAX: dffffc0000000000 RBX: ffff88817d28b420 RCX: 0000000000000000 + [ 605.603172] RDX: 00e7002460000137 RSI: 0000000000000008 RDI: 07380123000009be + [ 605.603199] RBP: ffff88817b541a00 R08: 0000000000000001 R09: fffffbfff3ed8c0c + [ 605.603226] R10: ffffffff9f6c6067 R11: 0000000000000001 R12: 0000000000000000 + [ 605.603253] R13: 073801230000098e R14: ffff88817d28b448 R15: ffff88817b541a84 + [ 605.603286] FS: 00007f6570ef67c0(0000) GS:ffff888221dfa000(0000) knlGS:0000000000000000 + [ 605.603319] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 + [ 605.603343] CR2: 00007f65712fae40 CR3: 000000011371b000 CR4: 0000000000350ef0 + [ 605.603373] Call Trace: + [ 605.603392] + [ 605.603410] __dev_queue_xmit+0x448/0x32a0 + [ 605.603434] ? __pfx_vprintk_emit+0x10/0x10 + [ 605.603461] ? __pfx_vprintk_emit+0x10/0x10 + [ 605.603484] ? __pfx___dev_queue_xmit+0x10/0x10 + [ 605.603507] ? bond_start_xmit+0xbfb/0xc20 [bonding] + [ 605.603546] ? _printk+0xcb/0x100 + [ 605.603566] ? __pfx__printk+0x10/0x10 + [ 605.603589] ? bond_start_xmit+0xbfb/0xc20 [bonding] + [ 605.603627] ? add_taint+0x5e/0x70 + [ 605.603648] ? add_taint+0x2a/0x70 + [ 605.603670] ? end_report.cold+0x51/0x75 + [ 605.603693] ? bond_start_xmit+0xbfb/0xc20 [bonding] + [ 605.603731] bond_start_xmit+0x623/0xc20 [bonding] + +Fixes: 9e2ee5c7e7c3 ("net, bonding: Add XDP support to the bonding driver") +Signed-off-by: Nikolay Aleksandrov +Reported-by: Chen Zhen +Closes: https://lore.kernel.org/netdev/fae17c21-4940-5605-85b2-1d5e17342358@huawei.com/ +CC: Jussi Maki +CC: Daniel Borkmann +Acked-by: Daniel Borkmann +Link: https://patch.msgid.link/20260123120659.571187-1-razor@blackwall.org +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +[Harinadh: Backport to v6.1] +Signed-off-by: Harinadh Dommaraju +--- + drivers/net/bonding/bond_main.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c +index e9e2dec1dcb1..825cf7737a4d 100644 +--- a/drivers/net/bonding/bond_main.c ++++ b/drivers/net/bonding/bond_main.c +@@ -2258,11 +2258,6 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev, + unblock_netpoll_tx(); + } + +- /* broadcast mode uses the all_slaves to loop through slaves. */ +- if (bond_mode_can_use_xmit_hash(bond) || +- BOND_MODE(bond) == BOND_MODE_BROADCAST) +- bond_update_slave_arr(bond, NULL); +- + if (!slave_dev->netdev_ops->ndo_bpf || + !slave_dev->netdev_ops->ndo_xdp_xmit) { + if (bond->xdp_prog) { +@@ -2296,6 +2291,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev, + bpf_prog_inc(bond->xdp_prog); + } + ++ /* broadcast mode uses the all_slaves to loop through slaves. */ ++ if (bond_mode_can_use_xmit_hash(bond) || ++ BOND_MODE(bond) == BOND_MODE_BROADCAST) ++ bond_update_slave_arr(bond, NULL); ++ + slave_info(bond_dev, slave_dev, "Enslaving as %s interface with %s link\n", + bond_is_active_slave(new_slave) ? "an active" : "a backup", + new_slave->link != BOND_LINK_DOWN ? "an up" : "a down"); diff --git a/SPECS/linux/6.1/CVE/0001-bpf-Add-attach_type-checks-under-bpf_prog_attach_che.patch b/SPECS/linux/6.1/CVE/0001-bpf-Add-attach_type-checks-under-bpf_prog_attach_che.patch new file mode 100644 index 0000000000..e2aaf85956 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-bpf-Add-attach_type-checks-under-bpf_prog_attach_che.patch @@ -0,0 +1,157 @@ +From: Jiri Olsa +Date: Wed, 9 Aug 2023 10:34:14 +0200 +Subject: [PATCH] bpf: Add attach_type checks under + bpf_prog_attach_check_attach_type + +[ Upstream commit 3505cb9fa26cfec9512744466e754a8cbc2365b0 ] + +Add extra attach_type checks from link_create under +bpf_prog_attach_check_attach_type. + +Suggested-by: Andrii Nakryiko +Acked-by: Andrii Nakryiko +Acked-by: Yafang Shao +Signed-off-by: Jiri Olsa +Acked-by: Yonghong Song +Link: https://lore.kernel.org/r/20230809083440.3209381-3-jolsa@kernel.org +Signed-off-by: Alexei Starovoitov +[ KN: Backport to LTS v6.1.y; Skip checks for case BPF_PROG_TYPE_NETFILTER, + BPF_PROG_TYPE_SCHED_CLS as they are not present. ] +Signed-off-by: Kuntal Nayak +--- + kernel/bpf/syscall.c | 98 +++++++++++++++++++------------------------- + 1 file changed, 43 insertions(+), 55 deletions(-) + +diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c +index b145f3ef3..62d483f8d 100644 +--- a/kernel/bpf/syscall.c ++++ b/kernel/bpf/syscall.c +@@ -3417,34 +3417,6 @@ static int bpf_raw_tracepoint_open(const union bpf_attr *attr) + return fd; + } + +-static int bpf_prog_attach_check_attach_type(const struct bpf_prog *prog, +- enum bpf_attach_type attach_type) +-{ +- switch (prog->type) { +- case BPF_PROG_TYPE_CGROUP_SOCK: +- case BPF_PROG_TYPE_CGROUP_SOCK_ADDR: +- case BPF_PROG_TYPE_CGROUP_SOCKOPT: +- case BPF_PROG_TYPE_SK_LOOKUP: +- return attach_type == prog->expected_attach_type ? 0 : -EINVAL; +- case BPF_PROG_TYPE_CGROUP_SKB: +- if (!capable(CAP_NET_ADMIN)) +- /* cg-skb progs can be loaded by unpriv user. +- * check permissions at attach time. +- */ +- return -EPERM; +- return prog->enforce_expected_attach_type && +- prog->expected_attach_type != attach_type ? +- -EINVAL : 0; +- case BPF_PROG_TYPE_KPROBE: +- if (prog->expected_attach_type == BPF_TRACE_KPROBE_MULTI && +- attach_type != BPF_TRACE_KPROBE_MULTI) +- return -EINVAL; +- return 0; +- default: +- return 0; +- } +-} +- + static enum bpf_prog_type + attach_type_to_prog_type(enum bpf_attach_type attach_type) + { +@@ -3508,6 +3480,49 @@ attach_type_to_prog_type(enum bpf_attach_type attach_type) + } + } + ++static int bpf_prog_attach_check_attach_type(const struct bpf_prog *prog, ++ enum bpf_attach_type attach_type) ++{ ++ enum bpf_prog_type ptype; ++ ++ switch (prog->type) { ++ case BPF_PROG_TYPE_CGROUP_SOCK: ++ case BPF_PROG_TYPE_CGROUP_SOCK_ADDR: ++ case BPF_PROG_TYPE_CGROUP_SOCKOPT: ++ case BPF_PROG_TYPE_SK_LOOKUP: ++ return attach_type == prog->expected_attach_type ? 0 : -EINVAL; ++ case BPF_PROG_TYPE_CGROUP_SKB: ++ if (!capable(CAP_NET_ADMIN)) ++ /* cg-skb progs can be loaded by unpriv user. ++ * check permissions at attach time. ++ */ ++ return -EPERM; ++ return prog->enforce_expected_attach_type && ++ prog->expected_attach_type != attach_type ? ++ -EINVAL : 0; ++ case BPF_PROG_TYPE_EXT: ++ return 0; ++ case BPF_PROG_TYPE_PERF_EVENT: ++ case BPF_PROG_TYPE_TRACEPOINT: ++ if (attach_type != BPF_PERF_EVENT) ++ return -EINVAL; ++ return 0; ++ case BPF_PROG_TYPE_KPROBE: ++ if (prog->expected_attach_type == BPF_TRACE_KPROBE_MULTI && ++ attach_type != BPF_TRACE_KPROBE_MULTI) ++ return -EINVAL; ++ if (attach_type != BPF_PERF_EVENT && ++ attach_type != BPF_TRACE_KPROBE_MULTI) ++ return -EINVAL; ++ return 0; ++ default: ++ ptype = attach_type_to_prog_type(attach_type); ++ if (ptype == BPF_PROG_TYPE_UNSPEC || ptype != prog->type) ++ return -EINVAL; ++ return 0; ++ } ++} ++ + #define BPF_PROG_ATTACH_LAST_FIELD replace_bpf_fd + + #define BPF_F_ATTACH_MASK \ +@@ -4572,7 +4587,6 @@ static int bpf_map_do_batch(const union bpf_attr *attr, + #define BPF_LINK_CREATE_LAST_FIELD link_create.kprobe_multi.cookies + static int link_create(union bpf_attr *attr, bpfptr_t uattr) + { +- enum bpf_prog_type ptype; + struct bpf_prog *prog; + int ret; + +@@ -4588,32 +4602,6 @@ static int link_create(union bpf_attr *attr, bpfptr_t uattr) + if (ret) + goto out; + +- switch (prog->type) { +- case BPF_PROG_TYPE_EXT: +- break; +- case BPF_PROG_TYPE_PERF_EVENT: +- case BPF_PROG_TYPE_TRACEPOINT: +- if (attr->link_create.attach_type != BPF_PERF_EVENT) { +- ret = -EINVAL; +- goto out; +- } +- break; +- case BPF_PROG_TYPE_KPROBE: +- if (attr->link_create.attach_type != BPF_PERF_EVENT && +- attr->link_create.attach_type != BPF_TRACE_KPROBE_MULTI) { +- ret = -EINVAL; +- goto out; +- } +- break; +- default: +- ptype = attach_type_to_prog_type(attr->link_create.attach_type); +- if (ptype == BPF_PROG_TYPE_UNSPEC || ptype != prog->type) { +- ret = -EINVAL; +- goto out; +- } +- break; +- } +- + switch (prog->type) { + case BPF_PROG_TYPE_CGROUP_SKB: + case BPF_PROG_TYPE_CGROUP_SOCK: +-- +2.43.7 + diff --git a/SPECS/linux/6.1/CVE/0001-bpf-Check-the-helper-function-is-valid-in-get_helper.patch b/SPECS/linux/6.1/CVE/0001-bpf-Check-the-helper-function-is-valid-in-get_helper.patch new file mode 100644 index 0000000000..7e95d44825 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-bpf-Check-the-helper-function-is-valid-in-get_helper.patch @@ -0,0 +1,65 @@ +From 4e014529a721526239db5bb0216ca671766c8708 Mon Sep 17 00:00:00 2001 +From: Jiri Olsa +Date: Mon, 27 Oct 2025 19:06:18 +0530 +Subject: [PATCH] bpf: Check the helper function is valid in get_helper_proto + +[ Upstream commit e4414b01c1cd9887bbde92f946c1ba94e40d6d64 ] + +kernel test robot reported verifier bug [1] where the helper func +pointer could be NULL due to disabled config option. + +As Alexei suggested we could check on that in get_helper_proto +directly. Marking tail_call helper func with BPF_PTR_POISON, +because it is unused by design. + + [1] https://lore.kernel.org/oe-lkp/202507160818.68358831-lkp@intel.com + +Reported-by: kernel test robot +Reported-by: syzbot+a9ed3d9132939852d0df@syzkaller.appspotmail.com +Suggested-by: Alexei Starovoitov +Signed-off-by: Jiri Olsa +Signed-off-by: Daniel Borkmann +Acked-by: Paul Chaignon +Acked-by: Daniel Borkmann +Link: https://lore.kernel.org/bpf/20250814200655.945632-1-jolsa@kernel.org +Closes: https://lore.kernel.org/oe-lkp/202507160818.68358831-lkp@intel.com +Signed-off-by: Sasha Levin +[Guru: Check if func is not NULL inside get_helper_proto itself] +Signed-off-by: Guruswamy Basavaiah +--- + kernel/bpf/core.c | 5 ++++- + kernel/bpf/verifier.c | 2 +- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c +index 6924f86a8a3f..ae3a01efe300 100644 +--- a/kernel/bpf/core.c ++++ b/kernel/bpf/core.c +@@ -2732,7 +2732,10 @@ EXPORT_SYMBOL_GPL(bpf_event_output); + + /* Always built-in helper functions. */ + const struct bpf_func_proto bpf_tail_call_proto = { +- .func = NULL, ++ /* func is unused for tail_call, we set it to pass the ++ * get_helper_proto check ++ */ ++ .func = BPF_PTR_POISON, + .gpl_only = false, + .ret_type = RET_VOID, + .arg1_type = ARG_PTR_TO_CTX, +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c +index 276a0de9a1bb..e1d1351a1f73 100644 +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -7485,7 +7485,7 @@ static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn + + if (env->ops->get_func_proto) + fn = env->ops->get_func_proto(func_id, env->prog); +- if (!fn) { ++ if (!(fn && fn->func)) { + verbose(env, "unknown func %s#%d\n", func_id_name(func_id), + func_id); + return -EINVAL; +-- +2.43.0 + diff --git a/SPECS/linux/6.1/CVE/0001-bpf-Defer-work-in-bpf_timer_cancel_and_free.patch b/SPECS/linux/6.1/CVE/0001-bpf-Defer-work-in-bpf_timer_cancel_and_free.patch new file mode 100644 index 0000000000..01f7267d9c --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-bpf-Defer-work-in-bpf_timer_cancel_and_free.patch @@ -0,0 +1,152 @@ +From a6fcd19d7eac1335eb76bc16b6a66b7f574d1d69 Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Tue, 9 Jul 2024 18:54:39 +0000 +Subject: [PATCH] bpf: Defer work in bpf_timer_cancel_and_free + +[ Upstream commit a6fcd19d7eac1335eb76bc16b6a66b7f574d1d69 ] + +Currently, the same case as previous patch (two timer callbacks trying +to cancel each other) can be invoked through bpf_map_update_elem as +well, or more precisely, freeing map elements containing timers. Since +this relies on hrtimer_cancel as well, it is prone to the same deadlock +situation as the previous patch. + +It would be sufficient to use hrtimer_try_to_cancel to fix this problem, +as the timer cannot be enqueued after async_cancel_and_free. Once +async_cancel_and_free has been done, the timer must be reinitialized +before it can be armed again. The callback running in parallel trying to +arm the timer will fail, and freeing bpf_hrtimer without waiting is +sufficient (given kfree_rcu), and bpf_timer_cb will return +HRTIMER_NORESTART, preventing the timer from being rearmed again. + +However, there exists a UAF scenario where the callback arms the timer +before entering this function, such that if cancellation fails (due to +timer callback invoking this routine, or the target timer callback +running concurrently). In such a case, if the timer expiration is +significantly far in the future, the RCU grace period expiration +happening before it will free the bpf_hrtimer state and along with it +the struct hrtimer, that is enqueued. + +Hence, it is clear cancellation needs to occur after +async_cancel_and_free, and yet it cannot be done inline due to deadlock +issues. We thus modify bpf_timer_cancel_and_free to defer work to the +global workqueue, adding a work_struct alongside rcu_head (both used at +_different_ points of time, so can share space). + +Update existing code comments to reflect the new state of affairs. + +Fixes: b00628b1c7d5 ("bpf: Introduce bpf timers.") +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20240709185440.1104957-3-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Sasha Levin +[ KN: backported to v6.1; adjusted for lack of bpf_async_cb abstraction ] +Signed-off-by: Kuntal Nayak +--- + kernel/bpf/helpers.c | 64 +++++++++++++++++++++++++++++++++----------- + 1 file changed, 49 insertions(+), 15 deletions(-) + +diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c +index aa3649a08..c6d43dcc3 100644 +--- a/kernel/bpf/helpers.c ++++ b/kernel/bpf/helpers.c +@@ -1095,7 +1095,10 @@ struct bpf_hrtimer { + struct bpf_prog *prog; + void __rcu *callback_fn; + void *value; +- struct rcu_head rcu; ++ union { ++ struct rcu_head rcu; ++ struct work_struct delete_work; ++ }; + }; + + /* the actual struct hidden inside uapi struct bpf_timer */ +@@ -1149,6 +1152,21 @@ static enum hrtimer_restart bpf_timer_cb(struct hrtimer *hrtimer) + return HRTIMER_NORESTART; + } + ++static void bpf_timer_delete_work(struct work_struct *work) ++{ ++ struct bpf_hrtimer *t = container_of(work, struct bpf_hrtimer, delete_work); ++ ++ /* Cancel the timer and wait for callback to complete if it was running. ++ * If hrtimer_cancel() can be safely called it's safe to call ++ * kfree_rcu(t) right after for both preallocated and non-preallocated ++ * maps. The async->cb = NULL was already done and no code path can see ++ * address 't' anymore. Timer if armed for existing bpf_hrtimer before ++ * bpf_timer_cancel_and_free will have been cancelled. ++ */ ++ hrtimer_cancel(&t->timer); ++ kfree_rcu(t, rcu); ++} ++ + BPF_CALL_3(bpf_timer_init, struct bpf_timer_kern *, timer, struct bpf_map *, map, + u64, flags) + { +@@ -1181,6 +1199,7 @@ BPF_CALL_3(bpf_timer_init, struct bpf_timer_kern *, timer, struct bpf_map *, map + ret = -ENOMEM; + goto out; + } ++ INIT_WORK(&t->delete_work, bpf_timer_delete_work); + t->value = (void *)timer - map->timer_off; + t->map = map; + t->prog = NULL; +@@ -1376,25 +1395,40 @@ void bpf_timer_cancel_and_free(void *val) + __bpf_spin_unlock_irqrestore(&timer->lock); + if (!t) + return; +- /* Cancel the timer and wait for callback to complete if it was running. +- * If hrtimer_cancel() can be safely called it's safe to call kfree(t) +- * right after for both preallocated and non-preallocated maps. +- * The timer->timer = NULL was already done and no code path can +- * see address 't' anymore. +- * +- * Check that bpf_map_delete/update_elem() wasn't called from timer +- * callback_fn. In such case don't call hrtimer_cancel() (since it will +- * deadlock) and don't call hrtimer_try_to_cancel() (since it will just +- * return -1). Though callback_fn is still running on this cpu it's ++ ++ /* We check that bpf_map_delete/update_elem() was called from timer ++ * callback_fn. In such case we don't call hrtimer_cancel() (since it ++ * will deadlock) and don't call hrtimer_try_to_cancel() (since it will ++ * just return -1). Though callback_fn is still running on this cpu it's + * safe to do kfree(t) because bpf_timer_cb() read everything it needed + * from 't'. The bpf subprog callback_fn won't be able to access 't', +- * since timer->timer = NULL was already done. The timer will be ++ * since async->cb = NULL was already done. The timer will be + * effectively cancelled because bpf_timer_cb() will return + * HRTIMER_NORESTART. ++ * ++ * However, it is possible the timer callback_fn calling us armed the ++ * timer _before_ calling us, such that failing to cancel it here will ++ * cause it to possibly use struct hrtimer after freeing bpf_hrtimer. ++ * Therefore, we _need_ to cancel any outstanding timers before we do ++ * kfree_rcu, even though no more timers can be armed. ++ * ++ * Moreover, we need to schedule work even if timer does not belong to ++ * the calling callback_fn, as on two different CPUs, we can end up in a ++ * situation where both sides run in parallel, try to cancel one ++ * another, and we end up waiting on both sides in hrtimer_cancel ++ * without making forward progress, since timer1 depends on time2 ++ * callback to finish, and vice versa. ++ * ++ * CPU 1 (timer1_cb) CPU 2 (timer2_cb) ++ * bpf_timer_cancel_and_free(timer2) bpf_timer_cancel_and_free(timer1) ++ * ++ * To avoid these issues, punt to workqueue context when we are in a ++ * timer callback. + */ +- if (this_cpu_read(hrtimer_running) != t) +- hrtimer_cancel(&t->timer); +- kfree_rcu(t, rcu); ++ if (this_cpu_read(hrtimer_running)) ++ queue_work(system_unbound_wq, &t->delete_work); ++ else ++ bpf_timer_delete_work(&t->delete_work); + } + + BPF_CALL_2(bpf_kptr_xchg, void *, map_value, void *, ptr) +-- +2.43.7 + diff --git a/SPECS/linux/6.1/CVE/0001-bpf-Fix-accesses-to-uninit-stack-slots.patch b/SPECS/linux/6.1/CVE/0001-bpf-Fix-accesses-to-uninit-stack-slots.patch new file mode 100644 index 0000000000..528b3b54bb --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-bpf-Fix-accesses-to-uninit-stack-slots.patch @@ -0,0 +1,447 @@ +From e3f3bd6da9aa88a82fad3c7e8d74db79a2a6ec76 Mon Sep 17 00:00:00 2001 +From: Brennan Lamoreaux +Date: Mon, 1 Apr 2024 23:15:12 +0000 +Subject: [PATCH] bpf: Fix accesses to uninit stack slots + +commit 6b4a64bafd107e521c01eec3453ce94a3fb38529 upstream + +Privileged programs are supposed to be able to read uninitialized stack +memory (ever since 6715df8) but, before this patch, these accesses +were permitted inconsistently. In particular, accesses were permitted +above state->allocated_stack, but not below it. In other words, if the +stack was already "large enough", the access was permitted, but +otherwise the access was rejected instead of being allowed to "grow the +stack". This undesired rejection was happening in two places: +- in check_stack_slot_within_bounds() +- in check_stack_range_initialized() +This patch arranges for these accesses to be permitted. A bunch of tests +that were relying on the old rejection had to change; all of them were +changed to add also run unprivileged, in which case the old behavior +persists. One tests couldn't be updated - global_func16 - because it +can't run unprivileged for other reasons. + +This patch also fixes the tracking of the stack size for variable-offset +reads. This second fix is bundled in the same commit as the first one +because they're inter-related. Before this patch, writes to the stack +using registers containing a variable offset (as opposed to registers +with fixed, known values) were not properly contributing to the +function's needed stack size. As a result, it was possible for a program +to verify, but then to attempt to read out-of-bounds data at runtime +because a too small stack had been allocated for it. + +Each function tracks the size of the stack it needs in +bpf_subprog_info.stack_depth, which is maintained by +update_stack_depth(). For regular memory accesses, check_mem_access() +was calling update_state_depth() but it was passing in only the fixed +part of the offset register, ignoring the variable offset. This was +incorrect; the minimum possible value of that register should be used +instead. + +This tracking is now fixed by centralizing the tracking of stack size in +grow_stack_state(), and by lifting the calls to grow_stack_state() to +check_stack_access_within_bounds() as suggested by Andrii. The code is +now simpler and more convincingly tracks the correct maximum stack size. +check_stack_range_initialized() can now rely on enough stack having been +allocated for the access; this helps with the fix for the first issue. + +A few tests were changed to also check the stack depth computation. The +one that fails without this patch is verifier_var_off:stack_write_priv_vs_unpriv. + +Fixes: 01f810a ("bpf: Allow variable-offset stack access") +Reported-by: Hao Sun +Signed-off-by: Andrei Matei +Signed-off-by: Andrii Nakryiko +Acked-by: Andrii Nakryiko +Link: https://lore.kernel.org/bpf/20231208032519.260451-3-andreimatei1@gmail.com + +Closes: https://lore.kernel.org/bpf/CABWLsev9g8UP_c3a=1qbuZUi20tGoUXoU07FPf-5FLvhOKOY+Q@mail.gmail.com/ + +[ Brennan : Ported to v6.1 - fix return values of several tests to match ] +[ Refreshed for 6.1.189: check_stack_slot_within_bounds() already takes + s64 off (32bit overflow guard is in 6.1.y). ] +--- + kernel/bpf/verifier.c | 61 +++++++----------- + .../selftests/bpf/verifier/atomic_cmpxchg.c | 11 ---- + .../selftests/bpf/verifier/basic_stack.c | 13 ++-- + tools/testing/selftests/bpf/verifier/calls.c | 4 +- + .../testing/selftests/bpf/verifier/int_ptr.c | 6 +- + .../selftests/bpf/verifier/raw_stack.c | 9 ++- + .../testing/selftests/bpf/verifier/var_off.c | 62 +++++++++++++++---- + 7 files changed, 95 insertions(+), 71 deletions(-) + +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c +index 4b5b4d032..a3e083b99 100644 +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -1198,7 +1198,10 @@ static int resize_reference_state(struct bpf_func_state *state, size_t n) + return 0; + } + +-static int grow_stack_state(struct bpf_func_state *state, int size) ++/* Possibly update state->allocated_stack to be at least size bytes. Also ++ * possibly update the function's high-water mark in its bpf_subprog_info. ++ */ ++static int grow_stack_state(struct bpf_verifier_env *env, struct bpf_func_state *state, int size) + { + size_t old_n = state->allocated_stack / BPF_REG_SIZE, n = size / BPF_REG_SIZE; + +@@ -1210,6 +1213,11 @@ static int grow_stack_state(struct bpf_func_state *state, int size) + return -ENOMEM; + + state->allocated_stack = size; ++ ++ /* update known max for given subprogram */ ++ if (env->subprog_info[state->subprogno].stack_depth < size) ++ env->subprog_info[state->subprogno].stack_depth = size; ++ + return 0; + } + +@@ -3424,9 +3432,6 @@ static int check_stack_write_fixed_off(struct bpf_verifier_env *env, + struct bpf_reg_state *reg = NULL; + u32 dst_reg = insn->dst_reg; + +- err = grow_stack_state(state, round_up(slot + 1, BPF_REG_SIZE)); +- if (err) +- return err; + /* caller checked that off % size == 0 and -MAX_BPF_STACK <= off < 0, + * so it's aligned access and [off, off + size) are within stack limits + */ +@@ -3580,10 +3585,6 @@ static int check_stack_write_var_off(struct bpf_verifier_env *env, + if (value_reg && register_is_null(value_reg)) + writing_zero = true; + +- err = grow_stack_state(state, round_up(-min_off, BPF_REG_SIZE)); +- if (err) +- return err; +- + for (i = min_off; i < max_off; i++) { + int spi; + +@@ -4627,20 +4628,6 @@ static int check_ptr_alignment(struct bpf_verifier_env *env, + strict); + } + +-static int update_stack_depth(struct bpf_verifier_env *env, +- const struct bpf_func_state *func, +- int off) +-{ +- u16 stack = env->subprog_info[func->subprogno].stack_depth; +- +- if (stack >= -off) +- return 0; +- +- /* update known max for given subprogram */ +- env->subprog_info[func->subprogno].stack_depth = -off; +- return 0; +-} +- + /* starting from main bpf function walk all instructions of the function + * and recursively walk all callees that given function can call. + * Ignore jump and exit insns. +@@ -5070,13 +5057,14 @@ static int check_ptr_to_map_access(struct bpf_verifier_env *env, + * The minimum valid offset is -MAX_BPF_STACK for writes, and + * -state->allocated_stack for reads. + */ +-static int check_stack_slot_within_bounds(s64 off, ++static int check_stack_slot_within_bounds(struct bpf_verifier_env *env, ++ int off, + struct bpf_func_state *state, + enum bpf_access_type t) + { + int min_valid_off; + +- if (t == BPF_WRITE) ++ if (t == BPF_WRITE || env->allow_uninit_stack) + min_valid_off = -MAX_BPF_STACK; + else + min_valid_off = -state->allocated_stack; +@@ -5125,7 +5113,7 @@ static int check_stack_access_within_bounds( + max_off = reg->smax_value + off + access_size; + } + +- err = check_stack_slot_within_bounds(min_off, state, type); ++ err = check_stack_slot_within_bounds(env, min_off, state, type); + if (!err && max_off > 0) + err = -EINVAL; /* out of stack access into non-negative offsets */ + if (!err && access_size < 0) +@@ -5145,8 +5133,10 @@ static int check_stack_access_within_bounds( + verbose(env, "invalid variable-offset%s stack R%d var_off=%s size=%d\n", + err_extra, regno, tn_buf, access_size); + } ++ return err; + } +- return err; ++ ++ return grow_stack_state(env, state, round_up(-min_off, BPF_REG_SIZE)); + } + + /* check whether memory at (regno + off) is accessible for t = (read | write) +@@ -5161,7 +5151,6 @@ static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regn + { + struct bpf_reg_state *regs = cur_regs(env); + struct bpf_reg_state *reg = regs + regno; +- struct bpf_func_state *state; + int size, err = 0; + + size = bpf_size_to_bytes(bpf_size); +@@ -5305,11 +5294,6 @@ static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regn + if (err) + return err; + +- state = func(env, reg); +- err = update_stack_depth(env, state, off); +- if (err) +- return err; +- + if (t == BPF_READ) + err = check_stack_read(env, regno, off, size, + value_regno); +@@ -5502,7 +5486,8 @@ static int check_atomic(struct bpf_verifier_env *env, int insn_idx, struct bpf_i + + /* When register 'regno' is used to read the stack (either directly or through + * a helper function) make sure that it's within stack boundary and, depending +- * on the access type, that all elements of the stack are initialized. ++ * on the access type and privileges, that all elements of the stack are ++ * initialized. + * + * 'off' includes 'regno->off', but not its dynamic part (if any). + * +@@ -5610,8 +5595,11 @@ static int check_stack_range_initialized( + + slot = -i - 1; + spi = slot / BPF_REG_SIZE; +- if (state->allocated_stack <= slot) +- goto err; ++ if (state->allocated_stack <= slot) { ++ verbose(env, "verifier bug: allocated_stack too small"); ++ return -EFAULT; ++ } ++ + stype = &state->stack[spi].slot_type[slot % BPF_REG_SIZE]; + if (*stype == STACK_MISC) + goto mark; +@@ -5635,7 +5623,6 @@ static int check_stack_range_initialized( + goto mark; + } + +-err: + if (tnum_is_const(reg->var_off)) { + verbose(env, "invalid%s read from stack R%d off %d+%d size %d\n", + err_extra, regno, min_off, i - min_off, access_size); +@@ -5660,7 +5647,7 @@ static int check_stack_range_initialized( + * helper may write to the entire memory range. + */ + } +- return update_stack_depth(env, state, min_off); ++ return 0; + } + + static int check_helper_mem_access(struct bpf_verifier_env *env, int regno, +diff --git a/tools/testing/selftests/bpf/verifier/atomic_cmpxchg.c b/tools/testing/selftests/bpf/verifier/atomic_cmpxchg.c +index b39665f33..096219311 100644 +--- a/tools/testing/selftests/bpf/verifier/atomic_cmpxchg.c ++++ b/tools/testing/selftests/bpf/verifier/atomic_cmpxchg.c +@@ -83,17 +83,6 @@ + .result = REJECT, + .errstr = "!read_ok", + }, +-{ +- "Can't use cmpxchg on uninit memory", +- .insns = { +- BPF_MOV64_IMM(BPF_REG_0, 3), +- BPF_MOV64_IMM(BPF_REG_2, 4), +- BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, BPF_REG_10, BPF_REG_2, -8), +- BPF_EXIT_INSN(), +- }, +- .result = REJECT, +- .errstr = "invalid read from stack", +-}, + { + "BPF_W cmpxchg should zero top 32 bits", + .insns = { +diff --git a/tools/testing/selftests/bpf/verifier/basic_stack.c b/tools/testing/selftests/bpf/verifier/basic_stack.c +index f995777dd..dfba5ee4e 100644 +--- a/tools/testing/selftests/bpf/verifier/basic_stack.c ++++ b/tools/testing/selftests/bpf/verifier/basic_stack.c +@@ -17,18 +17,23 @@ + BPF_EXIT_INSN(), + }, + .fixup_map_hash_8b = { 2 }, +- .errstr = "invalid indirect read from stack", +- .result = REJECT, ++ .errstr = "stack depth 8", ++ .errstr_unpriv = "invalid indirect read from stack", ++ .result = ACCEPT, ++ .result_unpriv = REJECT, + }, + { + "uninitialized stack2", + .insns = { + BPF_MOV64_REG(BPF_REG_2, BPF_REG_10), + BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_2, -8), ++ BPF_MOV64_IMM(BPF_REG_0, 0), + BPF_EXIT_INSN(), + }, +- .errstr = "invalid read from stack", +- .result = REJECT, ++ .errstr = "stack depth 8", ++ .errstr_unpriv = "invalid read from stack", ++ .result = ACCEPT, ++ .result_unpriv = REJECT, + }, + { + "invalid fp arithmetic", +diff --git a/tools/testing/selftests/bpf/verifier/calls.c b/tools/testing/selftests/bpf/verifier/calls.c +index 2f9aeeb7e..aed6c4c31 100644 +--- a/tools/testing/selftests/bpf/verifier/calls.c ++++ b/tools/testing/selftests/bpf/verifier/calls.c +@@ -1501,7 +1501,9 @@ + .prog_type = BPF_PROG_TYPE_XDP, + .fixup_map_hash_8b = { 23 }, + .result = REJECT, +- .errstr = "invalid read from stack R7 off=-16 size=8", ++ .errstr = "R0 invalid mem access 'scalar'", ++ .result_unpriv = REJECT, ++ .errstr_unpriv = "invalid read from stack R7 off=-16 size=8", + }, + { + "calls: two calls that receive map_value via arg=ptr_stack_of_caller. test1", +diff --git a/tools/testing/selftests/bpf/verifier/int_ptr.c b/tools/testing/selftests/bpf/verifier/int_ptr.c +index 8c74cff20..ee5749c82 100644 +--- a/tools/testing/selftests/bpf/verifier/int_ptr.c ++++ b/tools/testing/selftests/bpf/verifier/int_ptr.c +@@ -22,11 +22,13 @@ + /* bpf_strtoul() */ + BPF_EMIT_CALL(BPF_FUNC_strtoul), + +- BPF_MOV64_IMM(BPF_REG_0, 1), ++ BPF_MOV64_IMM(BPF_REG_0, 0), + BPF_EXIT_INSN(), + }, + .result = ACCEPT, +- .prog_type = BPF_PROG_TYPE_CGROUP_SYSCTL, ++ .result_unpriv = REJECT, ++ .prog_type = BPF_PROG_TYPE_SOCKET_FILTER, ++ .errstr_unpriv = "invalid indirect read from stack R4 off -16+0 size 8", + }, + { + "ARG_PTR_TO_LONG half-uninitialized", +diff --git a/tools/testing/selftests/bpf/verifier/raw_stack.c b/tools/testing/selftests/bpf/verifier/raw_stack.c +index eb5ed9365..d3bde22ce 100644 +--- a/tools/testing/selftests/bpf/verifier/raw_stack.c ++++ b/tools/testing/selftests/bpf/verifier/raw_stack.c +@@ -8,11 +8,14 @@ + BPF_MOV64_IMM(BPF_REG_4, 8), + /* Call to skb_load_bytes() omitted. */ + BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_6, 0), ++ /* exit 0 if successful */ ++ BPF_MOV64_IMM(BPF_REG_0, 0), + BPF_EXIT_INSN(), + }, +- .result = REJECT, +- .errstr = "invalid read from stack R6 off=-8 size=8", +- .prog_type = BPF_PROG_TYPE_SCHED_CLS, ++ .result = ACCEPT, ++ .result_unpriv = REJECT, ++ .errstr_unpriv = "invalid read from stack R6 off=-8 size=8", ++ .prog_type = BPF_PROG_TYPE_SOCKET_FILTER, + }, + { + "raw_stack: skb_load_bytes, negative len", +diff --git a/tools/testing/selftests/bpf/verifier/var_off.c b/tools/testing/selftests/bpf/verifier/var_off.c +index b183e26c0..ab62f029d 100644 +--- a/tools/testing/selftests/bpf/verifier/var_off.c ++++ b/tools/testing/selftests/bpf/verifier/var_off.c +@@ -58,9 +58,10 @@ + BPF_MOV64_IMM(BPF_REG_0, 0), + BPF_EXIT_INSN(), + }, +- .result = REJECT, +- .errstr = "invalid variable-offset read from stack R2", +- .prog_type = BPF_PROG_TYPE_LWT_IN, ++ .result = ACCEPT, ++ .result_unpriv = REJECT, ++ .errstr_unpriv = "R2 variable stack access prohibited for !root", ++ .prog_type = BPF_PROG_TYPE_CGROUP_SKB, + }, + { + "variable-offset stack write, priv vs unpriv", +@@ -75,19 +76,53 @@ + */ + BPF_ALU64_REG(BPF_ADD, BPF_REG_2, BPF_REG_10), + /* Dereference it for a stack write */ +- BPF_ST_MEM(BPF_DW, BPF_REG_2, 0, 0), +- /* Now read from the address we just wrote. This shows +- * that, after a variable-offset write, a priviledged +- * program can read the slots that were in the range of +- * that write (even if the verifier doesn't actually know +- * if the slot being read was really written to or not. ++ BPF_MOV64_IMM(BPF_REG_0, 0), ++ BPF_STX_MEM(BPF_DW, BPF_REG_2, BPF_REG_0, 0), ++ BPF_EXIT_INSN(), ++ }, ++ /* Check that the maximum stack depth is correctly maintained according to the ++ * maximum possible variable offset. + */ ++ .errstr = "stack depth 16", ++ .errstr_unpriv = "R2 variable stack access prohibited for !root", ++ .result_unpriv = REJECT, ++ .result = ACCEPT, ++}, ++ ++/* Similar to the previous test, but this time also perform a read from the ++* address written to with a variable offset. The read is allowed, showing that, ++* after a variable-offset write, a priviledged program can read the slots that ++* were in the range of that write (even if the verifier doesn't actually know if ++* the slot being read was really written to or not. ++* ++* Despite this test being mostly a superset, the previous test is also kept for ++* the sake of it checking the stack depth in the case where there is no read. ++*/ ++{ ++ "variable-offset stack write followed by read", ++ .insns = { ++ /* Get an unknown value */ ++ BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1, 0), ++ /* Make it small and 8-byte aligned */ ++ BPF_ALU64_IMM(BPF_AND, BPF_REG_2, 8), ++ BPF_ALU64_IMM(BPF_SUB, BPF_REG_2, 16), ++ /* Add it to fp. We now have either fp-8 or fp-16, but ++ * we don't know which ++ */ ++ BPF_ALU64_REG(BPF_ADD, BPF_REG_2, BPF_REG_10), ++ /* Dereference it for a stack write */ ++ BPF_MOV64_IMM(BPF_REG_0, 0), ++ BPF_STX_MEM(BPF_DW, BPF_REG_2, BPF_REG_0, 0), ++ ++ /* Now read from the address we just wrote. */ + BPF_LDX_MEM(BPF_DW, BPF_REG_3, BPF_REG_2, 0), + BPF_MOV64_IMM(BPF_REG_0, 0), + BPF_EXIT_INSN(), + }, +- /* Variable stack access is rejected for unprivileged. ++ /* Check that the maximum stack depth is correctly maintained according to the ++ * maximum possible variable offset. + */ ++ .errstr = "stack depth 16", + .errstr_unpriv = "R2 variable stack access prohibited for !root", + .result_unpriv = REJECT, + .result = ACCEPT, +@@ -233,9 +268,10 @@ + BPF_EXIT_INSN(), + }, + .fixup_map_hash_8b = { 5 }, +- .errstr = "invalid indirect read from stack R2 var_off", +- .result = REJECT, +- .prog_type = BPF_PROG_TYPE_LWT_IN, ++ .errstr_unpriv = "R2 variable stack access prohibited for !root", ++ .result = ACCEPT, ++ .result_unpriv = REJECT, ++ .prog_type = BPF_PROG_TYPE_CGROUP_SKB, + }, + { + "indirect variable-offset stack access, priv vs unpriv", +-- +2.53.0 + diff --git a/SPECS/linux/6.1/CVE/0001-bpf-arm64-Force-8-byte-alignment-for-JIT-buffer.patch b/SPECS/linux/6.1/CVE/0001-bpf-arm64-Force-8-byte-alignment-for-JIT-buffer.patch new file mode 100644 index 0000000000..b33c1b2cba --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-bpf-arm64-Force-8-byte-alignment-for-JIT-buffer.patch @@ -0,0 +1,60 @@ +From def7b67de861f1c16e42a68a1b1fc2f4d1ef85fe Mon Sep 17 00:00:00 2001 +From: Fuad Tabba +Date: Thu, 26 Feb 2026 07:55:25 +0000 +Subject: [PATCH] bpf, arm64: Force 8-byte alignment for JIT buffer to prevent + atomic tearing + +[ Upstream commit ef06fd16d48704eac868441d98d4ef083d8f3d07 ] + +struct bpf_plt contains a u64 target field. Currently, the BPF JIT +allocator requests an alignment of 4 bytes (sizeof(u32)) for the JIT +buffer. + +Because the base address of the JIT buffer can be 4-byte aligned (e.g., +ending in 0x4 or 0xc), the relative padding logic in build_plt() fails +to ensure that target lands on an 8-byte boundary. + +This leads to two issues: +1. UBSAN reports misaligned-access warnings when dereferencing the + structure. +2. More critically, target is updated concurrently via WRITE_ONCE() in + bpf_arch_text_poke() while the JIT'd code executes ldr. On arm64, + 64-bit loads/stores are only guaranteed to be single-copy atomic if + they are 64-bit aligned. A misaligned target risks a torn read, + causing the JIT to jump to a corrupted address. + +Fix this by increasing the allocation alignment requirement to 8 bytes +(sizeof(u64)) in bpf_jit_binary_pack_alloc(). This anchors the base of +the JIT buffer to an 8-byte boundary, allowing the relative padding math +in build_plt() to correctly align the target field. + +Fixes: b2ad54e1533e ("bpf, arm64: Implement bpf_arch_text_poke() for arm64") +Signed-off-by: Fuad Tabba +Acked-by: Will Deacon +Link: https://lore.kernel.org/r/20260226075525.233321-1-tabba@google.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Sasha Levin +[Brennan: linux-6.1.y uses bpf_jit_binary_alloc() rather than + bpf_jit_binary_pack_alloc() (introduced later); the same + sizeof(u32) -> sizeof(u64) alignment fix is applied there.] +Signed-off-by: Brennan Lamoreaux +--- + arch/arm64/net/bpf_jit_comp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c +index e66218aed831..1a8627ab4f2c 100644 +--- a/arch/arm64/net/bpf_jit_comp.c ++++ b/arch/arm64/net/bpf_jit_comp.c +@@ -1589,7 +1589,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) + extable_offset = round_up(prog_size + PLT_TARGET_SIZE, extable_align); + image_size = extable_offset + extable_size; + header = bpf_jit_binary_alloc(image_size, &image_ptr, +- sizeof(u32), jit_fill_hole); ++ sizeof(u64), jit_fill_hole); + if (header == NULL) { + prog = orig_prog; + goto out_off; +-- +2.53.0 + diff --git a/SPECS/linux/6.1/CVE/0001-bridge-mcast-fix-use-after-free-during-router-port-configuration.patch b/SPECS/linux/6.1/CVE/0001-bridge-mcast-fix-use-after-free-during-router-port-configuration.patch new file mode 100644 index 0000000000..a28ed51566 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-bridge-mcast-fix-use-after-free-during-router-port-configuration.patch @@ -0,0 +1,179 @@ +From f05a4f9e959e0fc098046044c650acf897ea52d2 Mon Sep 17 00:00:00 2001 +From: Ido Schimmel +Date: Thu, 19 Jun 2025 21:22:28 +0300 +Subject: bridge: mcast: Fix use-after-free during router port configuration + +[ Upstream commit 7544f3f5b0b58c396f374d060898b5939da31709 ] + +The bridge maintains a global list of ports behind which a multicast +router resides. The list is consulted during forwarding to ensure +multicast packets are forwarded to these ports even if the ports are not +member in the matching MDB entry. + +When per-VLAN multicast snooping is enabled, the per-port multicast +context is disabled on each port and the port is removed from the global +router port list: + + # ip link add name br1 up type bridge vlan_filtering 1 mcast_snooping 1 + # ip link add name dummy1 up master br1 type dummy + # ip link set dev dummy1 type bridge_slave mcast_router 2 + $ bridge -d mdb show | grep router + router ports on br1: dummy1 + # ip link set dev br1 type bridge mcast_vlan_snooping 1 + $ bridge -d mdb show | grep router + +However, the port can be re-added to the global list even when per-VLAN +multicast snooping is enabled: + + # ip link set dev dummy1 type bridge_slave mcast_router 0 + # ip link set dev dummy1 type bridge_slave mcast_router 2 + $ bridge -d mdb show | grep router + router ports on br1: dummy1 + +Since commit 4b30ae9adb04 ("net: bridge: mcast: re-implement +br_multicast_{enable, disable}_port functions"), when per-VLAN multicast +snooping is enabled, multicast disablement on a port will disable the +per-{port, VLAN} multicast contexts and not the per-port one. As a +result, a port will remain in the global router port list even after it +is deleted. This will lead to a use-after-free [1] when the list is +traversed (when adding a new port to the list, for example): + + # ip link del dev dummy1 + # ip link add name dummy2 up master br1 type dummy + # ip link set dev dummy2 type bridge_slave mcast_router 2 + +Similarly, stale entries can also be found in the per-VLAN router port +list. When per-VLAN multicast snooping is disabled, the per-{port, VLAN} +contexts are disabled on each port and the port is removed from the +per-VLAN router port list: + + # ip link add name br1 up type bridge vlan_filtering 1 mcast_snooping 1 mcast_vlan_snooping 1 + # ip link add name dummy1 up master br1 type dummy + # bridge vlan add vid 2 dev dummy1 + # bridge vlan global set vid 2 dev br1 mcast_snooping 1 + # bridge vlan set vid 2 dev dummy1 mcast_router 2 + $ bridge vlan global show dev br1 vid 2 | grep router + router ports: dummy1 + # ip link set dev br1 type bridge mcast_vlan_snooping 0 + $ bridge vlan global show dev br1 vid 2 | grep router + +However, the port can be re-added to the per-VLAN list even when +per-VLAN multicast snooping is disabled: + + # bridge vlan set vid 2 dev dummy1 mcast_router 0 + # bridge vlan set vid 2 dev dummy1 mcast_router 2 + $ bridge vlan global show dev br1 vid 2 | grep router + router ports: dummy1 + +When the VLAN is deleted from the port, the per-{port, VLAN} multicast +context will not be disabled since multicast snooping is not enabled +on the VLAN. As a result, the port will remain in the per-VLAN router +port list even after it is no longer member in the VLAN. This will lead +to a use-after-free [2] when the list is traversed (when adding a new +port to the list, for example): + + # ip link add name dummy2 up master br1 type dummy + # bridge vlan add vid 2 dev dummy2 + # bridge vlan del vid 2 dev dummy1 + # bridge vlan set vid 2 dev dummy2 mcast_router 2 + +Fix these issues by removing the port from the relevant (global or +per-VLAN) router port list in br_multicast_port_ctx_deinit(). The +function is invoked during port deletion with the per-port multicast +context and during VLAN deletion with the per-{port, VLAN} multicast +context. + +Note that deleting the multicast router timer is not enough as it only +takes care of the temporary multicast router states (1 or 3) and not the +permanent one (2). + +[1] +BUG: KASAN: slab-out-of-bounds in br_multicast_add_router.part.0+0x3f1/0x560 +Write of size 8 at addr ffff888004a67328 by task ip/384 +[...] +Call Trace: + + dump_stack_lvl+0x6f/0xa0 + print_address_description.constprop.0+0x6f/0x350 + print_report+0x108/0x205 + kasan_report+0xdf/0x110 + br_multicast_add_router.part.0+0x3f1/0x560 + br_multicast_set_port_router+0x74e/0xac0 + br_setport+0xa55/0x1870 + br_port_slave_changelink+0x95/0x120 + __rtnl_newlink+0x5e8/0xa40 + rtnl_newlink+0x627/0xb00 + rtnetlink_rcv_msg+0x6fb/0xb70 + netlink_rcv_skb+0x11f/0x350 + netlink_unicast+0x426/0x710 + netlink_sendmsg+0x75a/0xc20 + __sock_sendmsg+0xc1/0x150 + ____sys_sendmsg+0x5aa/0x7b0 + ___sys_sendmsg+0xfc/0x180 + __sys_sendmsg+0x124/0x1c0 + do_syscall_64+0xbb/0x360 + entry_SYSCALL_64_after_hwframe+0x4b/0x53 + +[2] +BUG: KASAN: slab-use-after-free in br_multicast_add_router.part.0+0x378/0x560 +Read of size 8 at addr ffff888009f00840 by task bridge/391 +[...] +Call Trace: + + dump_stack_lvl+0x6f/0xa0 + print_address_description.constprop.0+0x6f/0x350 + print_report+0x108/0x205 + kasan_report+0xdf/0x110 + br_multicast_add_router.part.0+0x378/0x560 + br_multicast_set_port_router+0x6f9/0xac0 + br_vlan_process_options+0x8b6/0x1430 + br_vlan_rtm_process_one+0x605/0xa30 + br_vlan_rtm_process+0x396/0x4c0 + rtnetlink_rcv_msg+0x2f7/0xb70 + netlink_rcv_skb+0x11f/0x350 + netlink_unicast+0x426/0x710 + netlink_sendmsg+0x75a/0xc20 + __sock_sendmsg+0xc1/0x150 + ____sys_sendmsg+0x5aa/0x7b0 + ___sys_sendmsg+0xfc/0x180 + __sys_sendmsg+0x124/0x1c0 + do_syscall_64+0xbb/0x360 + entry_SYSCALL_64_after_hwframe+0x4b/0x53 + +Fixes: 2796d846d74a ("net: bridge: vlan: convert mcast router global option to per-vlan entry") +Fixes: 4b30ae9adb04 ("net: bridge: mcast: re-implement br_multicast_{enable, disable}_port functions") +Reported-by: syzbot+7bfa4b72c6a5da128d32@syzkaller.appspotmail.com +Closes: https://lore.kernel.org/all/684c18bd.a00a0220.279073.000b.GAE@google.com/T/ +Signed-off-by: Ido Schimmel +Link: https://patch.msgid.link/20250619182228.1656906-1-idosch@nvidia.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +[Backport to 6.1.158] +Signed-off-by: Harinadh Dommaraju +--- + net/bridge/br_multicast.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c +index 140dbcfc8..5d6bda9a8 100644 +--- a/net/bridge/br_multicast.c ++++ b/net/bridge/br_multicast.c +@@ -1859,10 +1859,18 @@ void br_multicast_port_ctx_init(struct net_bridge_port *port, + + void br_multicast_port_ctx_deinit(struct net_bridge_mcast_port *pmctx) + { ++ struct net_bridge *br = pmctx->port->br; ++ bool del = false; + #if IS_ENABLED(CONFIG_IPV6) + del_timer_sync(&pmctx->ip6_mc_router_timer); + #endif + del_timer_sync(&pmctx->ip4_mc_router_timer); ++ ++ spin_lock_bh(&br->multicast_lock); ++ del |= br_ip6_multicast_rport_del(pmctx); ++ del |= br_ip4_multicast_rport_del(pmctx); ++ br_multicast_rport_del_notify(pmctx, del); ++ spin_unlock_bh(&br->multicast_lock); + } + + int br_multicast_add_port(struct net_bridge_port *port) diff --git a/SPECS/linux/6.1/CVE/0001-btrfs-fix-NULL-dereference-on-root-when-tracing-inod.patch b/SPECS/linux/6.1/CVE/0001-btrfs-fix-NULL-dereference-on-root-when-tracing-inod.patch new file mode 100644 index 0000000000..185af85d4a --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-btrfs-fix-NULL-dereference-on-root-when-tracing-inod.patch @@ -0,0 +1,51 @@ +From 4f78584ce52a8203a9096f8e4571308f5ae9cd3c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miquel=20Sabat=C3=A9=20Sol=C3=A0?= +Date: Tue, 21 Oct 2025 11:11:25 +0200 +Subject: [PATCH] btrfs: fix NULL dereference on root when tracing inode + eviction +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[ Upstream commit f157dd661339fc6f5f2b574fe2429c43bd309534 ] + +When evicting an inode the first thing we do is to setup tracing for it, +which implies fetching the root's id. But in btrfs_evict_inode() the +root might be NULL, as implied in the next check that we do in +btrfs_evict_inode(). + +Hence, we either should set the ->root_objectid to 0 in case the root is +NULL, or we move tracing setup after checking that the root is not +NULL. Setting the rootid to 0 at least gives us the possibility to trace +this call even in the case when the root is NULL, so that's the solution +taken here. + +Fixes: 1abe9b8a138c ("Btrfs: add initial tracepoint support for btrfs") +Reported-by: syzbot+d991fea1b4b23b1f6bf8@syzkaller.appspotmail.com +Closes: https://syzkaller.appspot.com/bug?extid=d991fea1b4b23b1f6bf8 +Signed-off-by: Miquel Sabaté Solà +Reviewed-by: David Sterba +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +Signed-off-by: Brennan Lamoreaux +--- + include/trace/events/btrfs.h | 12 ++++++------ + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h +index 31847ccae493..6b58eac23099 100644 +--- a/include/trace/events/btrfs.h ++++ b/include/trace/events/btrfs.h +@@ -225,8 +225,8 @@ DECLARE_EVENT_CLASS(btrfs__inode, + __entry->generation = BTRFS_I(inode)->generation; + __entry->last_trans = BTRFS_I(inode)->last_trans; + __entry->logged_trans = BTRFS_I(inode)->logged_trans; +- __entry->root_objectid = +- BTRFS_I(inode)->root->root_key.objectid; ++ __entry->root_objectid = BTRFS_I(inode)->root ? ++ BTRFS_I(inode)->root->root_key.objectid : 0; + ), + + TP_printk_btrfs("root=%llu(%s) gen=%llu ino=%llu blocks=%llu " +2.43.7 + diff --git a/SPECS/linux/6.1/CVE/0001-btrfs-make-sure-that-WRITTEN-is-set-on-all-metadata-.patch b/SPECS/linux/6.1/CVE/0001-btrfs-make-sure-that-WRITTEN-is-set-on-all-metadata-.patch new file mode 100644 index 0000000000..c3bec8e22a --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-btrfs-make-sure-that-WRITTEN-is-set-on-all-metadata-.patch @@ -0,0 +1,118 @@ +From: Josef Bacik +Date: Mon, 29 Apr 2024 09:03:35 -0400 +Subject: [PATCH] btrfs: make sure that WRITTEN is set on all metadata blocks + +commit e03418abde871314e1a3a550f4c8afb7b89cb273 upstream. + +[ KN: Backport for Photon Kernels ; + + CONFIG_BTRFS_FS_CHECK_INTEGRITY is disabled. So check_leaf() always runs + with full validation enabled (check_item_data=true) and check_leaf_item() + validates all item pointers. This does not leaves a gap in checking as + it did in latest codebases (6.6+). + + Hence, we only need to add checks to make sure we have WRITTEN + set appropriately. ] + +We previously would call btrfs_check_leaf() if we had the check +integrity code enabled, which meant that we could only run the extended +leaf checks if we had WRITTEN set on the header flags. + +This leaves a gap in our checking, because we could end up with +corruption on disk where WRITTEN isn't set on the leaf, and then the +extended leaf checks don't get run which we rely on to validate all of +the item pointers to make sure we don't access memory outside of the +extent buffer. + +However, since 732fab95abe2 ("btrfs: check-integrity: remove +CONFIG_BTRFS_FS_CHECK_INTEGRITY option") we no longer call +btrfs_check_leaf() from btrfs_mark_buffer_dirty(), which means we only +ever call it on blocks that are being written out, and thus have WRITTEN +set, or that are being read in, which should have WRITTEN set. + +Add checks to make sure we have WRITTEN set appropriately, and then make +sure __btrfs_check_leaf() always does the item checking. This will +protect us from file systems that have been corrupted and no longer have +WRITTEN set on some of the blocks. + +This was hit on a crafted image tweaking the WRITTEN bit and reported by +KASAN as out-of-bound access in the eb accessors. The example is a dir +item at the end of an eb. + + [2.042] BTRFS warning (device loop1): bad eb member start: ptr 0x3fff start 30572544 member offset 16410 size 2 + [2.040] general protection fault, probably for non-canonical address 0xe0009d1000000003: 0000 [#1] PREEMPT SMP KASAN NOPTI + [2.537] KASAN: maybe wild-memory-access in range [0x0005088000000018-0x000508800000001f] + [2.729] CPU: 0 PID: 2587 Comm: mount Not tainted 6.8.2 #1 + [2.729] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 + [2.621] RIP: 0010:btrfs_get_16+0x34b/0x6d0 + [2.621] RSP: 0018:ffff88810871fab8 EFLAGS: 00000206 + [2.621] RAX: 0000a11000000003 RBX: ffff888104ff8720 RCX: ffff88811b2288c0 + [2.621] RDX: dffffc0000000000 RSI: ffffffff81dd8aca RDI: ffff88810871f748 + [2.621] RBP: 000000000000401a R08: 0000000000000001 R09: ffffed10210e3ee9 + [2.621] R10: ffff88810871f74f R11: 205d323430333737 R12: 000000000000001a + [2.621] R13: 000508800000001a R14: 1ffff110210e3f5d R15: ffffffff850011e8 + [2.621] FS: 00007f56ea275840(0000) GS:ffff88811b200000(0000) knlGS:0000000000000000 + [2.621] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 + [2.621] CR2: 00007febd13b75c0 CR3: 000000010bb50000 CR4: 00000000000006f0 + [2.621] Call Trace: + [2.621] + [2.621] ? show_regs+0x74/0x80 + [2.621] ? die_addr+0x46/0xc0 + [2.621] ? exc_general_protection+0x161/0x2a0 + [2.621] ? asm_exc_general_protection+0x26/0x30 + [2.621] ? btrfs_get_16+0x33a/0x6d0 + [2.621] ? btrfs_get_16+0x34b/0x6d0 + [2.621] ? btrfs_get_16+0x33a/0x6d0 + [2.621] ? __pfx_btrfs_get_16+0x10/0x10 + [2.621] ? __pfx_mutex_unlock+0x10/0x10 + [2.621] btrfs_match_dir_item_name+0x101/0x1a0 + [2.621] btrfs_lookup_dir_item+0x1f3/0x280 + [2.621] ? __pfx_btrfs_lookup_dir_item+0x10/0x10 + [2.621] btrfs_get_tree+0xd25/0x1910 + +Reported-by: lei lu +CC: stable@vger.kernel.org # 6.7+ +Reviewed-by: Qu Wenruo +Signed-off-by: Josef Bacik +Reviewed-by: David Sterba +[ copy more details from report ] +Signed-off-by: David Sterba +Signed-off-by: Jianqi Ren +Signed-off-by: He Zhe +Signed-off-by: Greg Kroah-Hartman +[ KN: Backport for Photon Kernels ] +Signed-off-by: Kuntal Nayak +--- + fs/btrfs/tree-checker.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c +index bf3822b25..e6e70699d 100644 +--- a/fs/btrfs/tree-checker.c ++++ b/fs/btrfs/tree-checker.c +@@ -1780,6 +1780,11 @@ static int check_leaf(struct extent_buffer *leaf, bool check_item_data) + return -EUCLEAN; + } + ++ if (unlikely(!btrfs_header_flag(leaf, BTRFS_HEADER_FLAG_WRITTEN))) { ++ generic_err(leaf, 0, "invalid flag for leaf, WRITTEN not set"); ++ return -EUCLEAN; ++ } ++ + /* + * Extent buffers from a relocation tree have a owner field that + * corresponds to the subvolume tree they are based on. So just from an +@@ -1936,6 +1941,10 @@ int btrfs_check_node(struct extent_buffer *node) + u64 bytenr; + int ret = 0; + ++ if (unlikely(!btrfs_header_flag(node, BTRFS_HEADER_FLAG_WRITTEN))) { ++ generic_err(node, 0, "invalid flag for node, WRITTEN not set"); ++ return -EUCLEAN; ++ } + if (unlikely(level <= 0 || level >= BTRFS_MAX_LEVEL)) { + generic_err(node, 0, + "invalid level for node, have %d expect [1, %d]", +-- +2.43.7 + diff --git a/SPECS/linux/6.1/CVE/0001-btrfs-zoned-fix-use-after-free-in-do_zone_finish.patch b/SPECS/linux/6.1/CVE/0001-btrfs-zoned-fix-use-after-free-in-do_zone_finish.patch new file mode 100644 index 0000000000..4e0ada314d --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-btrfs-zoned-fix-use-after-free-in-do_zone_finish.patch @@ -0,0 +1,190 @@ +From 352838ce1dac8c879271981e3b1229136bcedbc4 Mon Sep 17 00:00:00 2001 +From: Johannes Thumshirn +Date: Wed, 28 Feb 2024 12:13:27 +0100 +Subject: [PATCH] btrfs: zoned: fix use-after-free in do_zone_finish() + +commit 1ec17ef59168a1a6f1105f5dc517f783839a5302 upstream. + +Shinichiro reported the following use-after-free triggered by the device +replace operation in fstests btrfs/070. + + BTRFS info (device nullb1): scrub: finished on devid 1 with status: 0 + ================================================================== + BUG: KASAN: slab-use-after-free in do_zone_finish+0x91a/0xb90 [btrfs] + Read of size 8 at addr ffff8881543c8060 by task btrfs-cleaner/3494007 + + CPU: 0 PID: 3494007 Comm: btrfs-cleaner Tainted: G W 6.8.0-rc5-kts #1 + Hardware name: Supermicro Super Server/X11SPi-TF, BIOS 3.3 02/21/2020 + Call Trace: + + dump_stack_lvl+0x5b/0x90 + print_report+0xcf/0x670 + ? __virt_addr_valid+0x200/0x3e0 + kasan_report+0xd8/0x110 + ? do_zone_finish+0x91a/0xb90 [btrfs] + ? do_zone_finish+0x91a/0xb90 [btrfs] + do_zone_finish+0x91a/0xb90 [btrfs] + btrfs_delete_unused_bgs+0x5e1/0x1750 [btrfs] + ? __pfx_btrfs_delete_unused_bgs+0x10/0x10 [btrfs] + ? btrfs_put_root+0x2d/0x220 [btrfs] + ? btrfs_clean_one_deleted_snapshot+0x299/0x430 [btrfs] + cleaner_kthread+0x21e/0x380 [btrfs] + ? __pfx_cleaner_kthread+0x10/0x10 [btrfs] + kthread+0x2e3/0x3c0 + ? __pfx_kthread+0x10/0x10 + ret_from_fork+0x31/0x70 + ? __pfx_kthread+0x10/0x10 + ret_from_fork_asm+0x1b/0x30 + + + Allocated by task 3493983: + kasan_save_stack+0x33/0x60 + kasan_save_track+0x14/0x30 + __kasan_kmalloc+0xaa/0xb0 + btrfs_alloc_device+0xb3/0x4e0 [btrfs] + device_list_add.constprop.0+0x993/0x1630 [btrfs] + btrfs_scan_one_device+0x219/0x3d0 [btrfs] + btrfs_control_ioctl+0x26e/0x310 [btrfs] + __x64_sys_ioctl+0x134/0x1b0 + do_syscall_64+0x99/0x190 + entry_SYSCALL_64_after_hwframe+0x6e/0x76 + + Freed by task 3494056: + kasan_save_stack+0x33/0x60 + kasan_save_track+0x14/0x30 + kasan_save_free_info+0x3f/0x60 + poison_slab_object+0x102/0x170 + __kasan_slab_free+0x32/0x70 + kfree+0x11b/0x320 + btrfs_rm_dev_replace_free_srcdev+0xca/0x280 [btrfs] + btrfs_dev_replace_finishing+0xd7e/0x14f0 [btrfs] + btrfs_dev_replace_by_ioctl+0x1286/0x25a0 [btrfs] + btrfs_ioctl+0xb27/0x57d0 [btrfs] + __x64_sys_ioctl+0x134/0x1b0 + do_syscall_64+0x99/0x190 + entry_SYSCALL_64_after_hwframe+0x6e/0x76 + + The buggy address belongs to the object at ffff8881543c8000 + which belongs to the cache kmalloc-1k of size 1024 + The buggy address is located 96 bytes inside of + freed 1024-byte region [ffff8881543c8000, ffff8881543c8400) + + The buggy address belongs to the physical page: + page:00000000fe2c1285 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1543c8 + head:00000000fe2c1285 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 + flags: 0x17ffffc0000840(slab|head|node=0|zone=2|lastcpupid=0x1fffff) + page_type: 0xffffffff() + raw: 0017ffffc0000840 ffff888100042dc0 ffffea0019e8f200 dead000000000002 + raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 + page dumped because: kasan: bad access detected + + Memory state around the buggy address: + ffff8881543c7f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + ffff8881543c7f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + >ffff8881543c8000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb + ^ + ffff8881543c8080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb + ffff8881543c8100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb + +This UAF happens because we're accessing stale zone information of a +already removed btrfs_device in do_zone_finish(). + +The sequence of events is as follows: + +btrfs_dev_replace_start + btrfs_scrub_dev + btrfs_dev_replace_finishing + btrfs_dev_replace_update_device_in_mapping_tree <-- devices replaced + btrfs_rm_dev_replace_free_srcdev + btrfs_free_device <-- device freed + +cleaner_kthread + btrfs_delete_unused_bgs + btrfs_zone_finish + do_zone_finish <-- refers the freed device + +The reason for this is that we're using a cached pointer to the chunk_map +from the block group, but on device replace this cached pointer can +contain stale device entries. + +The staleness comes from the fact, that btrfs_block_group::physical_map is +not a pointer to a btrfs_chunk_map but a memory copy of it. + +Also take the fs_info::dev_replace::rwsem to prevent +btrfs_dev_replace_update_device_in_mapping_tree() from changing the device +underneath us again. + +Note: btrfs_dev_replace_update_device_in_mapping_tree() is holding +fs_info::mapping_tree_lock, but as this is a spinning read/write lock we +cannot take it as the call to blkdev_zone_mgmt() requires a memory +allocation which may not sleep. +But btrfs_dev_replace_update_device_in_mapping_tree() is always called with +the fs_info::dev_replace::rwsem held in write mode. + +Many thanks to Shinichiro for analyzing the bug. + +Reported-by: Shinichiro Kawasaki +CC: stable@vger.kernel.org # 6.8 +Reviewed-by: Filipe Manana +Signed-off-by: Johannes Thumshirn +Reviewed-by: David Sterba +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman +[ Brennan : Ported to v6.1 ] +Signed-off-by: Brennan Lamoreaux +--- + fs/btrfs/zoned.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c +index ba03ea17a10f..12f0057f2f3f 100644 +--- a/fs/btrfs/zoned.c ++++ b/fs/btrfs/zoned.c +@@ -1464,11 +1464,7 @@ int btrfs_load_block_group_zone_info(struct btrfs_block_group *cache, bool new) + + map = em->map_lookup; + +- cache->physical_map = kmemdup(map, map_lookup_size(map->num_stripes), GFP_NOFS); +- if (!cache->physical_map) { +- ret = -ENOMEM; +- goto out; +- } ++ cache->physical_map = map; + + zone_info = kcalloc(map->num_stripes, sizeof(*zone_info), GFP_NOFS); + if (!zone_info) { +@@ -1978,6 +1974,7 @@ static int do_zone_finish(struct btrfs_block_group *block_group, bool fully_writ + struct map_lookup *map; + const bool is_metadata = (block_group->flags & + (BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_SYSTEM)); ++ struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace; + int ret = 0; + int i; + +@@ -2050,6 +2047,7 @@ static int do_zone_finish(struct btrfs_block_group *block_group, bool fully_writ + btrfs_clear_data_reloc_bg(block_group); + spin_unlock(&block_group->lock); + ++ down_read(&dev_replace->rwsem); + map = block_group->physical_map; + for (i = 0; i < map->num_stripes; i++) { + struct btrfs_device *device = map->stripes[i].dev; +@@ -2066,11 +2064,14 @@ static int do_zone_finish(struct btrfs_block_group *block_group, bool fully_writ + device->zone_info->zone_size >> SECTOR_SHIFT, + GFP_NOFS); + +- if (ret) ++ if (ret) { ++ up_read(&dev_replace->rwsem); + return ret; ++ } + + btrfs_dev_clear_active_zone(device, physical); + } ++ up_read(&dev_replace->rwsem); + + if (!fully_written) + btrfs_dec_block_group_ro(block_group); +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-cifs-Fix-locking-usage-for-tcon-fields.patch b/SPECS/linux/6.1/CVE/0001-cifs-Fix-locking-usage-for-tcon-fields.patch new file mode 100644 index 0000000000..d1b453fad2 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-cifs-Fix-locking-usage-for-tcon-fields.patch @@ -0,0 +1,112 @@ +From 953953abb66e52c224057ab91e404284fefeab62 Mon Sep 17 00:00:00 2001 +From: Shyam Prasad N +Date: Sun, 1 Feb 2026 00:21:13 +0530 +Subject: [PATCH] cifs: Fix locking usage for tcon fields + +[ Upstream commit 96c4af418586ee9a6aab61738644366426e05316 ] + +We used to use the cifs_tcp_ses_lock to protect a lot of objects +that are not just the server, ses or tcon lists. We later introduced +srv_lock, ses_lock and tc_lock to protect fields within the +corresponding structs. This was done to provide a more granular +protection and avoid unnecessary serialization. + +There were still a couple of uses of cifs_tcp_ses_lock to provide +tcon fields. In this patch, I've replaced them with tc_lock. + +Cc: stable@vger.kernel.org +Signed-off-by: Shyam Prasad N +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +[ Keerthana: skipped cfids_laundromat_worker() and trace.h changes, +which are unavailable on 6.1.y ] +Signed-off-by: Keerthana K +[Ankit: Refreshed for 6.1.183 kernel. Kept the new trace calls added +upstream, no logic change.] +Signed-off-by: Ankit Jain +--- + fs/smb/client/smb2misc.c | 6 ++++--- + fs/smb/client/smb2ops.c | 10 +++------- + fs/smb/client/smb2pdu.c | 2 ++ + 3 files changed, 8 insertions(+), 10 deletions(-) + +diff --git a/fs/smb/client/smb2misc.c b/fs/smb/client/smb2misc.c +index cd00bf48c9a5..e41fcccb9011 100644 +--- a/fs/smb/client/smb2misc.c ++++ b/fs/smb/client/smb2misc.c +@@ -844,14 +844,14 @@ smb2_handle_cancelled_close(struct cifs_tcon *tcon, __u64 persistent_fid, + int rc; + + cifs_dbg(FYI, "%s: tc_count=%d\n", __func__, tcon->tc_count); +- spin_lock(&cifs_tcp_ses_lock); ++ spin_lock(&tcon->tc_lock); + if (tcon->tc_count <= 0) { + struct TCP_Server_Info *server = NULL; + + trace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count, + netfs_trace_tcon_ref_see_cancelled_close); + WARN_ONCE(tcon->tc_count < 0, "tcon refcount is negative"); +- spin_unlock(&cifs_tcp_ses_lock); ++ spin_unlock(&tcon->tc_lock); + + if (tcon->ses) { + server = tcon->ses->server; +@@ -865,7 +865,7 @@ smb2_handle_cancelled_close(struct cifs_tcon *tcon, __u64 persistent_fid, + tcon->tc_count++; + trace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count, + netfs_trace_tcon_ref_get_cancelled_close); +- spin_unlock(&cifs_tcp_ses_lock); ++ spin_unlock(&tcon->tc_lock); + + rc = __smb2_handle_cancelled_cmd(tcon, SMB2_CLOSE_HE, 0, + persistent_fid, volatile_fid); +diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c +index 245737ba4ea6..8ebf6989f7bf 100644 +--- a/fs/smb/client/smb2ops.c ++++ b/fs/smb/client/smb2ops.c +@@ -2848,9 +2848,11 @@ smb2_get_dfs_refer(const unsigned int xid, struct cifs_ses *ses, + struct cifs_tcon, + tcon_list); + if (tcon) { ++ spin_lock(&tcon->tc_lock); + tcon->tc_count++; + trace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count, + netfs_trace_tcon_ref_get_dfs_refer); ++ spin_unlock(&tcon->tc_lock); + } + spin_unlock(&cifs_tcp_ses_lock); + } +@@ -2913,13 +2915,7 @@ smb2_get_dfs_refer(const unsigned int xid, struct cifs_ses *ses, + out: + if (tcon && !tcon->ipc) { + /* ipc tcons are not refcounted */ +- spin_lock(&cifs_tcp_ses_lock); +- tcon->tc_count--; +- trace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count, +- netfs_trace_tcon_ref_dec_dfs_refer); +- /* tc_count can never go negative */ +- WARN_ON(tcon->tc_count < 0); +- spin_unlock(&cifs_tcp_ses_lock); ++ cifs_put_tcon(tcon, netfs_trace_tcon_ref_put_dfs_refer); + } + kfree(utf16_path); + kfree(dfs_req); +diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c +index 98d6fcdf2236..6ea3dea5829c 100644 +--- a/fs/smb/client/smb2pdu.c ++++ b/fs/smb/client/smb2pdu.c +@@ -3994,9 +3994,11 @@ void smb2_reconnect_server(struct work_struct *work) + + list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { + if (tcon->need_reconnect || tcon->need_reopen_files) { ++ spin_lock(&tcon->tc_lock); + tcon->tc_count++; + trace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count, + netfs_trace_tcon_ref_get_reconnect_server); ++ spin_unlock(&tcon->tc_lock); + list_add_tail(&tcon->rlist, &tmp_list); + tcon_selected = tcon_exist = true; + } +-- +2.43.7 + diff --git a/SPECS/linux/6.1/CVE/0001-cifs-fix-memory-leak-in-smb3_fs_context_parse_param-.patch b/SPECS/linux/6.1/CVE/0001-cifs-fix-memory-leak-in-smb3_fs_context_parse_param-.patch new file mode 100644 index 0000000000..0cf2ede5fe --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-cifs-fix-memory-leak-in-smb3_fs_context_parse_param-.patch @@ -0,0 +1,65 @@ +From d429631794ed3b1880278d82c28da1089edb38ae Mon Sep 17 00:00:00 2001 +From: Shaurya Rane +Date: Tue, 18 Nov 2025 20:32:57 +0530 +Subject: [PATCH] cifs: fix memory leak in smb3_fs_context_parse_param error + path + +[ Upstream commit 7e4d9120cfa413dd34f4f434befc5dbe6c38b2e5 ] + +Add proper cleanup of ctx->source and fc->source to the +cifs_parse_mount_err error handler. This ensures that memory allocated +for the source strings is correctly freed on all error paths, matching +the cleanup already performed in the success path by +smb3_cleanup_fs_context_contents(). +Pointers are also set to NULL after freeing to prevent potential +double-free issues. + +This change fixes a memory leak originally detected by syzbot. The +leak occurred when processing Opt_source mount options if an error +happened after ctx->source and fc->source were successfully +allocated but before the function completed. + +The specific leak sequence was: +1. ctx->source = smb3_fs_context_fullpath(ctx, '/') allocates memory +2. fc->source = kstrdup(ctx->source, GFP_KERNEL) allocates more memory +3. A subsequent error jumps to cifs_parse_mount_err +4. The old error handler freed passwords but not the source strings, +causing the memory to leak. + +This issue was not addressed by commit e8c73eb7db0a ("cifs: client: +fix memory leak in smb3_fs_context_parse_param"), which only fixed +leaks from repeated fsconfig() calls but not this error path. + +Patch updated with minor change suggested by kernel test robot + +Reported-by: syzbot+87be6809ed9bf6d718e3@syzkaller.appspotmail.com +Closes: https://syzkaller.appspot.com/bug?extid=87be6809ed9bf6d718e3 +Fixes: 24e0a1eff9e2 ("cifs: switch to new mount api") +Reviewed-by: David Howells +Signed-off-by: Shaurya Rane +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +[Ankit: Backported for v6.1] +Signed-off-by: Ankit Jain +--- + fs/smb/client/fs_context.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c +index 41fff2f8f..bf8d76d3b 100644 +--- a/fs/smb/client/fs_context.c ++++ b/fs/smb/client/fs_context.c +@@ -1544,6 +1544,10 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, + cifs_parse_mount_err: + kfree_sensitive(ctx->password); + ctx->password = NULL; ++ kfree(ctx->source); ++ ctx->source = NULL; ++ kfree(fc->source); ++ fc->source = NULL; + return -EINVAL; + } + +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-dlm-validate-length-in-dlm_search_rsb_tree.patch b/SPECS/linux/6.1/CVE/0001-dlm-validate-length-in-dlm_search_rsb_tree.patch new file mode 100644 index 0000000000..3893a2b398 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-dlm-validate-length-in-dlm_search_rsb_tree.patch @@ -0,0 +1,41 @@ +From 67288113c5e6cf9e659b4065c0ed6f16100e0c71 Mon Sep 17 00:00:00 2001 +From: Ezrak1e +Date: Tue, 20 Jan 2026 10:35:06 -0500 +Subject: [PATCH] dlm: validate length in dlm_search_rsb_tree + +[ Upstream commit 080e5563f878c64e697b89e7439d730d0daad882 ] + +The len parameter in dlm_dump_rsb_name() is not validated and comes +from network messages. When it exceeds DLM_RESNAME_MAXLEN, it can +cause out-of-bounds write in dlm_search_rsb_tree(). + +Add length validation to prevent potential buffer overflow. + +Signed-off-by: Ezrak1e +Signed-off-by: Alexander Aring +Signed-off-by: David Teigland +[ Brennan : Vulnerable memcpy is in rsb_cmp() instead ] +Signed-off-by: Brennan Lamoreaux +--- + fs/dlm/lock.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c +index fa81cd79a..e4d3cf155 100644 +--- a/fs/dlm/lock.c ++++ b/fs/dlm/lock.c +@@ -449,6 +449,11 @@ int dlm_search_rsb_tree(struct rb_root *tree, char *name, int len, + struct dlm_rsb *r; + int rc; + ++ if (len > DLM_RESNAME_MAXLEN) { ++ *r_ret = NULL; ++ return -EINVAL; ++ } ++ + while (node) { + r = rb_entry(node, struct dlm_rsb, res_hashnode); + rc = rsb_cmp(r, name, len); +-- +2.53.0 + diff --git a/SPECS/linux/6.1/CVE/0001-driver-core-generalize-driver_override-in-struct-dev.patch b/SPECS/linux/6.1/CVE/0001-driver-core-generalize-driver_override-in-struct-dev.patch new file mode 100644 index 0000000000..00902c96ae --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-driver-core-generalize-driver_override-in-struct-dev.patch @@ -0,0 +1,322 @@ +From ddc9602e80e9a18dfb90a3c9e9849001d6705dfe Mon Sep 17 00:00:00 2001 +From: Danilo Krummrich +Date: Tue, 3 Mar 2026 12:53:18 +0100 +Subject: [PATCH] driver core: generalize driver_override in struct device + +[ Upstream commit cb3d1049f4ea77d5ad93f17d8ac1f2ed4da70501 ] + +Currently, there are 12 busses (including platform and PCI) that +duplicate the driver_override logic for their individual devices. + +All of them seem to be prone to the bug described in [1]. + +While this could be solved for every bus individually using a separate +lock, solving this in the driver-core generically results in less (and +cleaner) changes overall. + +Thus, move driver_override to struct device, provide corresponding +accessors for busses and handle locking with a separate lock internally. + +In particular, add device_set_driver_override(), +device_has_driver_override(), device_match_driver_override() and +generalize the sysfs store() and show() callbacks via a driver_override +feature flag in struct bus_type. + +Until all busses have migrated, keep driver_set_override() in place. + +Note that we can't use the device lock for the reasons described in [2]. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=220789 [1] +Link: https://lore.kernel.org/driver-core/DGRGTIRHA62X.3RY09D9SOK77P@kernel.org/ [2] +Tested-by: Gui-Dong Han +Co-developed-by: Gui-Dong Han +Signed-off-by: Gui-Dong Han +Reviewed-by: Greg Kroah-Hartman +Link: https://patch.msgid.link/20260303115720.48783-2-dakr@kernel.org +[ Use dev->bus instead of sp->bus for consistency; fix commit message to + refer to the struct bus_type's driver_override feature flag. - Danilo ] +Signed-off-by: Danilo Krummrich +[ Brennan : Backported to v6.1 ] +Signed-off-by: Brennan Lamoreaux +--- + drivers/base/bus.c | 44 +++++++++++++++++++++++++++- + drivers/base/core.c | 2 ++ + drivers/base/dd.c | 60 ++++++++++++++++++++++++++++++++++++++ + include/linux/device.h | 54 ++++++++++++++++++++++++++++++++++ + include/linux/device/bus.h | 4 +++ + 5 files changed, 163 insertions(+), 1 deletion(-) + +diff --git a/drivers/base/bus.c b/drivers/base/bus.c +index 941532ddfdc6..971fdf473425 100644 +--- a/drivers/base/bus.c ++++ b/drivers/base/bus.c +@@ -432,6 +432,36 @@ int bus_for_each_drv(struct bus_type *bus, struct device_driver *start, + } + EXPORT_SYMBOL_GPL(bus_for_each_drv); + ++static ssize_t driver_override_store(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ int ret; ++ ++ ret = __device_set_driver_override(dev, buf, count); ++ if (ret) ++ return ret; ++ ++ return count; ++} ++ ++static ssize_t driver_override_show(struct device *dev, ++ struct device_attribute *attr, char *buf) ++{ ++ guard(spinlock)(&dev->driver_override.lock); ++ return sysfs_emit(buf, "%s\n", dev->driver_override.name); ++} ++static DEVICE_ATTR_RW(driver_override); ++ ++static struct attribute *driver_override_dev_attrs[] = { ++ &dev_attr_driver_override.attr, ++ NULL, ++}; ++ ++static const struct attribute_group driver_override_dev_group = { ++ .attrs = driver_override_dev_attrs, ++}; ++ + /** + * bus_add_device - add device to bus + * @dev: device being added +@@ -450,10 +480,17 @@ int bus_add_device(struct device *dev) + error = device_add_groups(dev, bus->dev_groups); + if (error) + goto out_put; ++ ++ if (dev->bus->driver_override) { ++ error = device_add_group(dev, &driver_override_dev_group); ++ if (error) ++ goto out_groups; ++ } ++ + error = sysfs_create_link(&bus->p->devices_kset->kobj, + &dev->kobj, dev_name(dev)); + if (error) +- goto out_groups; ++ goto out_override; + error = sysfs_create_link(&dev->kobj, + &dev->bus->p->subsys.kobj, "subsystem"); + if (error) +@@ -464,6 +501,9 @@ int bus_add_device(struct device *dev) + + out_subsys: + sysfs_remove_link(&bus->p->devices_kset->kobj, dev_name(dev)); ++out_override: ++ if (dev->bus->driver_override) ++ device_remove_group(dev, &driver_override_dev_group); + out_groups: + device_remove_groups(dev, bus->dev_groups); + out_put: +@@ -522,6 +562,8 @@ void bus_remove_device(struct device *dev) + sysfs_remove_link(&dev->kobj, "subsystem"); + sysfs_remove_link(&dev->bus->p->devices_kset->kobj, + dev_name(dev)); ++ if (dev->bus->driver_override) ++ device_remove_group(dev, &driver_override_dev_group); + device_remove_groups(dev, dev->bus->dev_groups); + if (klist_node_attached(&dev->p->knode_bus)) + klist_del(&dev->p->knode_bus); +diff --git a/drivers/base/core.c b/drivers/base/core.c +index d985c4b87de5..8efdf5377ca8 100644 +--- a/drivers/base/core.c ++++ b/drivers/base/core.c +@@ -2498,6 +2498,7 @@ static void device_release(struct kobject *kobj) + devres_release_all(dev); + + kfree(dev->dma_range_map); ++ kfree(dev->driver_override.name); + + if (dev->release) + dev->release(dev); +@@ -3159,6 +3160,7 @@ void device_initialize(struct device *dev) + kobject_init(&dev->kobj, &device_ktype); + INIT_LIST_HEAD(&dev->dma_pools); + mutex_init(&dev->mutex); ++ spin_lock_init(&dev->driver_override.lock); + lockdep_set_novalidate_class(&dev->mutex); + spin_lock_init(&dev->devres_lock); + INIT_LIST_HEAD(&dev->devres_head); +diff --git a/drivers/base/dd.c b/drivers/base/dd.c +index dbbe2cebb891..94fbdf00093c 100644 +--- a/drivers/base/dd.c ++++ b/drivers/base/dd.c +@@ -376,6 +376,66 @@ static void __exit deferred_probe_exit(void) + } + __exitcall(deferred_probe_exit); + ++int __device_set_driver_override(struct device *dev, const char *s, size_t len) ++{ ++ const char *new, *old; ++ char *cp; ++ ++ if (!s) ++ return -EINVAL; ++ ++ /* ++ * The stored value will be used in sysfs show callback (sysfs_emit()), ++ * which has a length limit of PAGE_SIZE and adds a trailing newline. ++ * Thus we can store one character less to avoid truncation during sysfs ++ * show. ++ */ ++ if (len >= (PAGE_SIZE - 1)) ++ return -EINVAL; ++ ++ /* ++ * Compute the real length of the string in case userspace sends us a ++ * bunch of \0 characters like python likes to do. ++ */ ++ len = strlen(s); ++ ++ if (!len) { ++ /* Empty string passed - clear override */ ++ spin_lock(&dev->driver_override.lock); ++ old = dev->driver_override.name; ++ dev->driver_override.name = NULL; ++ spin_unlock(&dev->driver_override.lock); ++ kfree(old); ++ ++ return 0; ++ } ++ ++ cp = strnchr(s, len, '\n'); ++ if (cp) ++ len = cp - s; ++ ++ new = kstrndup(s, len, GFP_KERNEL); ++ if (!new) ++ return -ENOMEM; ++ ++ spin_lock(&dev->driver_override.lock); ++ old = dev->driver_override.name; ++ if (cp != s) { ++ dev->driver_override.name = new; ++ spin_unlock(&dev->driver_override.lock); ++ } else { ++ /* "\n" passed - clear override */ ++ dev->driver_override.name = NULL; ++ spin_unlock(&dev->driver_override.lock); ++ ++ kfree(new); ++ } ++ kfree(old); ++ ++ return 0; ++} ++EXPORT_SYMBOL_GPL(__device_set_driver_override); ++ + /** + * device_is_bound() - Check if device is bound to a driver + * @dev: device to check +diff --git a/include/linux/device.h b/include/linux/device.h +index cc84521795b1..96e34365c671 100644 +--- a/include/linux/device.h ++++ b/include/linux/device.h +@@ -482,6 +482,8 @@ struct device_physical_location { + * on. This shrinks the "Board Support Packages" (BSPs) and + * minimizes board-specific #ifdefs in drivers. + * @driver_data: Private pointer for driver specific info. ++ * @driver_override: Driver name to force a match. Do not touch directly; use ++ * device_set_driver_override() instead. + * @links: Links to suppliers and consumers of this device. + * @power: For device power management. + * See Documentation/driver-api/pm/devices.rst for details. +@@ -570,6 +572,10 @@ struct device { + core doesn't touch it */ + void *driver_data; /* Driver data, set and get with + dev_set_drvdata/dev_get_drvdata */ ++ struct { ++ const char *name; ++ spinlock_t lock; ++ } driver_override; + struct mutex mutex; /* mutex to synchronize calls to + * its driver. + */ +@@ -687,6 +693,54 @@ static inline struct device *kobj_to_dev(struct kobject *kobj) + return container_of(kobj, struct device, kobj); + } + ++int __device_set_driver_override(struct device *dev, const char *s, size_t len); ++ ++/** ++ * device_set_driver_override() - Helper to set or clear driver override. ++ * @dev: Device to change ++ * @s: NUL-terminated string, new driver name to force a match, pass empty ++ * string to clear it ("" or "\n", where the latter is only for sysfs ++ * interface). ++ * ++ * Helper to set or clear driver override of a device. ++ * ++ * Returns: 0 on success or a negative error code on failure. ++ */ ++static inline int device_set_driver_override(struct device *dev, const char *s) ++{ ++ return __device_set_driver_override(dev, s, s ? strlen(s) : 0); ++} ++ ++/** ++ * device_has_driver_override() - Check if a driver override has been set. ++ * @dev: device to check ++ * ++ * Returns true if a driver override has been set for this device. ++ */ ++static inline bool device_has_driver_override(struct device *dev) ++{ ++ guard(spinlock)(&dev->driver_override.lock); ++ return !!dev->driver_override.name; ++} ++ ++/** ++ * device_match_driver_override() - Match a driver against the device's driver_override. ++ * @dev: device to check ++ * @drv: driver to match against ++ * ++ * Returns > 0 if a driver override is set and matches the given driver, 0 if a ++ * driver override is set but does not match, or < 0 if a driver override is not ++ * set at all. ++ */ ++static inline int device_match_driver_override(struct device *dev, ++ const struct device_driver *drv) ++{ ++ guard(spinlock)(&dev->driver_override.lock); ++ if (dev->driver_override.name) ++ return !strcmp(dev->driver_override.name, drv->name); ++ return -1; ++} ++ + /** + * device_iommu_mapped - Returns true when the device DMA is translated + * by an IOMMU +diff --git a/include/linux/device/bus.h b/include/linux/device/bus.h +index d8b29ccd07e5..7a9e4aecbe65 100644 +--- a/include/linux/device/bus.h ++++ b/include/linux/device/bus.h +@@ -69,6 +69,9 @@ struct fwnode_handle; + * @p: The private data of the driver core, only the driver core can + * touch this. + * @lock_key: Lock class key for use by the lock validator ++ * @driver_override: Set to true if this bus supports the driver_override ++ * mechanism, which allows userspace to force a specific ++ * driver to bind to a device via a sysfs attribute. + * @need_parent_lock: When probing or removing a device on this bus, the + * device core should lock the device's parent. + * +@@ -114,6 +117,7 @@ struct bus_type { + struct subsys_private *p; + struct lock_class_key lock_key; + ++ bool driver_override; + bool need_parent_lock; + }; + +-- +2.53.0 + diff --git a/SPECS/linux/6.1/CVE/0001-driver-core-platform-use-generic-driver_override-inf.patch b/SPECS/linux/6.1/CVE/0001-driver-core-platform-use-generic-driver_override-inf.patch new file mode 100644 index 0000000000..c1861035dd --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-driver-core-platform-use-generic-driver_override-inf.patch @@ -0,0 +1,199 @@ +From 6beff67173e71dd6f20760b5b3b88d89178387b3 Mon Sep 17 00:00:00 2001 +From: Danilo Krummrich +Date: Tue, 3 Mar 2026 12:53:21 +0100 +Subject: [PATCH] driver core: platform: use generic driver_override infrastructure + +commit 2b38efc05bf7a8568ec74bfffea0f5cfa62bc01d upstream. + +When a driver is probed through __driver_attach(), the bus' match() +callback is called without the device lock held, thus accessing the +driver_override field without a lock, which can cause a UAF. + +Fix this by using the driver-core driver_override infrastructure taking +care of proper locking internally. + +Note that calling match() from __driver_attach() without the device lock +held is intentional. [1] + +Link: https://lore.kernel.org/driver-core/DGRGTIRHA62X.3RY09D9SOK77P@kernel.org/ [1] +Reported-by: Gui-Dong Han +Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220789 +Fixes: 3d713e0e382e ("driver core: platform: add device binding path 'driver_override'") +Reviewed-by: Greg Kroah-Hartman +Link: https://patch.msgid.link/20260303115720.48783-5-dakr@kernel.org +Signed-off-by: Danilo Krummrich +Signed-off-by: Sasha Levin +Signed-off-by: Brennan Lamoreaux +--- + drivers/base/platform.c | 37 +++++---------------------------- + drivers/bus/simple-pm-bus.c | 4 ++-- + drivers/clk/imx/clk-scu.c | 3 +-- + drivers/slimbus/qcom-ngd-ctrl.c | 6 ++---- + include/linux/platform_device.h | 5 ----- + sound/soc/samsung/i2s.c | 6 +++--- + 6 files changed, 13 insertions(+), 48 deletions(-) + +diff --git a/drivers/base/platform.c b/drivers/base/platform.c +index 3a06c214c..418d49991 100644 +--- a/drivers/base/platform.c ++++ b/drivers/base/platform.c +@@ -561,7 +561,6 @@ static void platform_device_release(struct device *dev) + kfree(pa->pdev.dev.platform_data); + kfree(pa->pdev.mfd_cell); + kfree(pa->pdev.resource); +- kfree(pa->pdev.driver_override); + kfree(pa); + } + +@@ -1261,38 +1260,9 @@ static ssize_t numa_node_show(struct device *dev, + } + static DEVICE_ATTR_RO(numa_node); + +-static ssize_t driver_override_show(struct device *dev, +- struct device_attribute *attr, char *buf) +-{ +- struct platform_device *pdev = to_platform_device(dev); +- ssize_t len; +- +- device_lock(dev); +- len = sysfs_emit(buf, "%s\n", pdev->driver_override); +- device_unlock(dev); +- +- return len; +-} +- +-static ssize_t driver_override_store(struct device *dev, +- struct device_attribute *attr, +- const char *buf, size_t count) +-{ +- struct platform_device *pdev = to_platform_device(dev); +- int ret; +- +- ret = driver_set_override(dev, &pdev->driver_override, buf, count); +- if (ret) +- return ret; +- +- return count; +-} +-static DEVICE_ATTR_RW(driver_override); +- + static struct attribute *platform_dev_attrs[] = { + &dev_attr_modalias.attr, + &dev_attr_numa_node.attr, +- &dev_attr_driver_override.attr, + NULL, + }; + +@@ -1332,10 +1302,12 @@ static int platform_match(struct device *dev, struct device_driver *drv) + { + struct platform_device *pdev = to_platform_device(dev); + struct platform_driver *pdrv = to_platform_driver(drv); ++ int ret; + + /* When driver_override is set, only bind to the matching driver */ +- if (pdev->driver_override) +- return !strcmp(pdev->driver_override, drv->name); ++ ret = device_match_driver_override(dev, drv); ++ if (ret >= 0) ++ return ret; + + /* Attempt an OF style match first */ + if (of_driver_match_device(dev, drv)) +@@ -1478,6 +1450,7 @@ static const struct dev_pm_ops platform_dev_pm_ops = { + struct bus_type platform_bus_type = { + .name = "platform", + .dev_groups = platform_dev_groups, ++ .driver_override = true, + .match = platform_match, + .uevent = platform_uevent, + .probe = platform_probe, +diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c +index 6b8d6257e..3176a5dd1 100644 +--- a/drivers/bus/simple-pm-bus.c ++++ b/drivers/bus/simple-pm-bus.c +@@ -26,7 +26,7 @@ static int simple_pm_bus_probe(struct platform_device *pdev) + * that's not listed in simple_pm_bus_of_match. We don't want to do any + * of the simple-pm-bus tasks for these devices, so return early. + */ +- if (pdev->driver_override) ++ if (device_has_driver_override(&pdev->dev)) + return 0; + + match = of_match_device(dev->driver->of_match_table, dev); +@@ -58,7 +58,7 @@ static int simple_pm_bus_remove(struct platform_device *pdev) + { + const void *data = of_device_get_match_data(&pdev->dev); + +- if (pdev->driver_override || data) ++ if (device_has_driver_override(&pdev->dev) || data) + return 0; + + dev_dbg(&pdev->dev, "%s\n", __func__); +diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c +index ec5afc7f2..30b4a2e7d 100644 +--- a/drivers/clk/imx/clk-scu.c ++++ b/drivers/clk/imx/clk-scu.c +@@ -683,8 +683,7 @@ struct clk_hw *imx_clk_scu_alloc_dev(const char *name, + return ERR_PTR(ret); + } + +- ret = driver_set_override(&pdev->dev, &pdev->driver_override, +- "imx-scu-clk", strlen("imx-scu-clk")); ++ ret = device_set_driver_override(&pdev->dev, "imx-scu-clk"); + if (ret) { + platform_device_put(pdev); + return ERR_PTR(ret); +diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c +index 3fa245a47..7cde3dfe5 100644 +--- a/drivers/slimbus/qcom-ngd-ctrl.c ++++ b/drivers/slimbus/qcom-ngd-ctrl.c +@@ -1462,10 +1462,8 @@ static int of_qcom_slim_ngd_register(struct device *parent, + ngd->id = id; + ngd->pdev->dev.parent = parent; + +- ret = driver_set_override(&ngd->pdev->dev, +- &ngd->pdev->driver_override, +- QCOM_SLIM_NGD_DRV_NAME, +- strlen(QCOM_SLIM_NGD_DRV_NAME)); ++ ret = device_set_driver_override(&ngd->pdev->dev, ++ QCOM_SLIM_NGD_DRV_NAME); + if (ret) { + platform_device_put(ngd->pdev); + kfree(ngd); +diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h +index b845fd83f..d7f24b72b 100644 +--- a/include/linux/platform_device.h ++++ b/include/linux/platform_device.h +@@ -31,11 +31,6 @@ struct platform_device { + struct resource *resource; + + const struct platform_device_id *id_entry; +- /* +- * Driver name to force a match. Do not set directly, because core +- * frees it. Use driver_set_override() to set or clear it. +- */ +- const char *driver_override; + + /* MFD cell pointer */ + struct mfd_cell *mfd_cell; +diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c +index 9505200f3..aefee127b 100644 +--- a/sound/soc/samsung/i2s.c ++++ b/sound/soc/samsung/i2s.c +@@ -1350,10 +1350,10 @@ static int i2s_create_secondary_device(struct samsung_i2s_priv *priv) + if (!pdev_sec) + return -ENOMEM; + +- pdev_sec->driver_override = kstrdup("samsung-i2s", GFP_KERNEL); +- if (!pdev_sec->driver_override) { ++ ret = device_set_driver_override(&pdev_sec->dev, "samsung-i2s"); ++ if (ret) { + platform_device_put(pdev_sec); +- return -ENOMEM; ++ return ret; + } + + ret = platform_device_add(pdev_sec); +-- +2.53.0 + diff --git a/SPECS/linux/6.1/CVE/0001-drm-amd-display-Add-NULL-test-for-timing-generator-i.patch b/SPECS/linux/6.1/CVE/0001-drm-amd-display-Add-NULL-test-for-timing-generator-i.patch new file mode 100644 index 0000000000..0210007077 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-drm-amd-display-Add-NULL-test-for-timing-generator-i.patch @@ -0,0 +1,60 @@ +From fdbe386e5c8778379b4df849623659f633af4a6e Mon Sep 17 00:00:00 2001 +From: Srinivasan Shanmugam +Date: Wed, 31 Jan 2024 08:49:41 +0530 +Subject: [PATCH] drm/amd/display: Add NULL test for 'timing generator' in + 'dcn21_set_pipe()' + +[ Upstream commit 66951d98d9bf45ba25acf37fe0747253fafdf298 ] + +In "u32 otg_inst = pipe_ctx->stream_res.tg->inst;" +pipe_ctx->stream_res.tg could be NULL, it is relying on the caller to +ensure the tg is not NULL. + +Fixes: 474ac4a875ca ("drm/amd/display: Implement some asic specific abm call backs.") +Cc: Yongqiang Sun +Cc: Anthony Koo +Cc: Rodrigo Siqueira +Cc: Aurabindo Pillai +Signed-off-by: Srinivasan Shanmugam +Reviewed-by: Anthony Koo +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +[ Brennan : Ported to v6.1 ] +Signed-off-by: Brennan Lamoreaux +--- + drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c +index 69cc192a7e71..a43a7dee4e66 100644 +--- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c ++++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c +@@ -182,17 +182,22 @@ void dcn21_set_abm_immediate_disable(struct pipe_ctx *pipe_ctx) + void dcn21_set_pipe(struct pipe_ctx *pipe_ctx) + { + struct abm *abm = pipe_ctx->stream_res.abm; +- uint32_t otg_inst = pipe_ctx->stream_res.tg->inst; ++ struct timing_generator *tg = pipe_ctx->stream_res.tg; + struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl; + struct dmcu *dmcu = pipe_ctx->stream->ctx->dc->res_pool->dmcu; ++ uint32_t otg_inst; ++ ++ if (!abm && !tg && !panel_cntl) ++ return; ++ ++ otg_inst = tg->inst; + + if (dmcu) { + dce110_set_pipe(pipe_ctx); + return; + } + +- if (abm && panel_cntl) +- dmub_abm_set_pipe(abm, otg_inst, SET_ABM_PIPE_NORMAL, panel_cntl->inst); ++ dmub_abm_set_pipe(abm, otg_inst, SET_ABM_PIPE_NORMAL, panel_cntl->inst); + } + + bool dcn21_set_backlight_level(struct pipe_ctx *pipe_ctx, +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-drm-amd-display-Check-link_index-before-accessing-dc.patch b/SPECS/linux/6.1/CVE/0001-drm-amd-display-Check-link_index-before-accessing-dc.patch new file mode 100644 index 0000000000..c8c37a5e42 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-drm-amd-display-Check-link_index-before-accessing-dc.patch @@ -0,0 +1,48 @@ +From 032c5407a608ac3b2a98bf4fbda27d12c20c5887 Mon Sep 17 00:00:00 2001 +From: Alex Hung +Date: Tue, 16 Apr 2024 16:30:17 -0600 +Subject: [PATCH] drm/amd/display: Check link_index before accessing + dc->links[] + +commit 8aa2864044b9d13e95fe224f32e808afbf79ecdf upstream. + +[WHY & HOW] +dc->links[] has max size of MAX_LINKS and NULL is return when trying to +access with out-of-bound index. + +This fixes 3 OVERRUN and 1 RESOURCE_LEAK issues reported by Coverity. + +Reviewed-by: Harry Wentland +Acked-by: Tom Chung +Signed-off-by: Alex Hung +Tested-by: Daniel Wheeler +Signed-off-by: Alex Deucher +[The macro MAX_LINKS is introduced by Commit 60df5628144b ("drm/amd/display: + handle invalid connector indices") after 6.10. So here we still use the + original array length MAX_PIPES * 2] +Signed-off-by: Jianqi Ren +Signed-off-by: He Zhe +Signed-off-by: Greg Kroah-Hartman +[ KN: Backport to v6.1 ; dc_link_get_status() is in dc/dc_link.h ] +Signed-off-by: Kuntal Nayak +--- + drivers/gpu/drm/amd/display/dc/dc_link.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/gpu/drm/amd/display/dc/dc_link.h b/drivers/gpu/drm/amd/display/dc/dc_link.h +index 17f080f8a..fe313104d 100644 +--- a/drivers/gpu/drm/amd/display/dc/dc_link.h ++++ b/drivers/gpu/drm/amd/display/dc/dc_link.h +@@ -285,6 +285,9 @@ const struct dc_link_status *dc_link_get_status(const struct dc_link *dc_link); + */ + static inline struct dc_link *dc_get_link_at_index(struct dc *dc, uint32_t link_index) + { ++ if (link_index >= (MAX_PIPES * 2)) ++ return NULL; ++ + return dc->links[link_index]; + } + +-- +2.39.4 + diff --git a/SPECS/linux/6.1/CVE/0001-drm-amd-display-Check-null-pointers-before-using-the.patch b/SPECS/linux/6.1/CVE/0001-drm-amd-display-Check-null-pointers-before-using-the.patch new file mode 100644 index 0000000000..31e65b558d --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-drm-amd-display-Check-null-pointers-before-using-the.patch @@ -0,0 +1,58 @@ +From 9758061d84434a90ed54c3ff9c852d630cc7fdb4 Mon Sep 17 00:00:00 2001 +From: Alex Hung +Date: Thu, 27 Jun 2024 17:38:16 -0600 +Subject: [PATCH] drm/amd/display: Check null pointers before using them + +[ Upstream commit 1ff12bcd7deaeed25efb5120433c6a45dd5504a8 ] + +[WHAT & HOW] +These pointers are null checked previously in the same function, +indicating they might be null as reported by Coverity. As a result, +they need to be checked when used again. + +This fixes 3 FORWARD_NULL issue reported by Coverity. + +Reviewed-by: Rodrigo Siqueira +Signed-off-by: Jerry Zuo +Signed-off-by: Alex Hung +Tested-by: Daniel Wheeler +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin + +[Srinidhi Rao: Backported this fix to v6.1.x] +Signed-off-by: srinidhira0 +--- + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +index 39151212b8a7..9d1d88e194e7 100644 +--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c ++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +@@ -6468,6 +6468,9 @@ create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector, + int requested_bpc = drm_state ? drm_state->max_requested_bpc : 8; + enum dc_status dc_result = DC_OK; + ++ if (!dm_state) ++ return NULL; ++ + do { + stream = create_stream_for_sink(aconnector, drm_mode, + dm_state, old_stream, +@@ -8616,9 +8619,10 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) + + DRM_INFO("[HDCP_DM] hdcp_update_display enable_encryption = %x\n", enable_encryption); + +- hdcp_update_display( +- adev->dm.hdcp_workqueue, aconnector->dc_link->link_index, aconnector, +- new_con_state->hdcp_content_type, enable_encryption); ++ if (aconnector->dc_link) ++ hdcp_update_display( ++ adev->dm.hdcp_workqueue, aconnector->dc_link->link_index, aconnector, ++ new_con_state->hdcp_content_type, enable_encryption); + } + } + #endif +-- +2.35.6 + diff --git a/SPECS/linux/6.1/CVE/0001-drm-amd-display-Fix-index-may-exceed-array-range-wit.patch b/SPECS/linux/6.1/CVE/0001-drm-amd-display-Fix-index-may-exceed-array-range-wit.patch new file mode 100644 index 0000000000..fbb867280e --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-drm-amd-display-Fix-index-may-exceed-array-range-wit.patch @@ -0,0 +1,116 @@ +From 188fd1616ec43033cedbe343b6579e9921e2d898 Mon Sep 17 00:00:00 2001 +From: Hersen Wu +Date: Thu, 25 Apr 2024 09:24:44 -0400 +Subject: [PATCH] drm/amd/display: Fix index may exceed array range within + fpu_update_bw_bounding_box + + [ Upstream commit 188fd1616ec43033cedbe343b6579e9921e2d898 ] + +[Why] +Coverity reports OVERRUN warning. soc.num_states could +be 40. But array range of bw_params->clk_table.entries is 8. + +[How] +Assert if soc.num_states greater than 8. + +Reviewed-by: Alex Hung +Acked-by: Tom Chung +Signed-off-by: Hersen Wu +Tested-by: Daniel Wheeler +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +Signed-off-by: Keerthana K +--- + drivers/gpu/drm/amd/display/dc/dml/dcn302/dcn302_fpu.c | 10 ++++++++++ + drivers/gpu/drm/amd/display/dc/dml/dcn303/dcn303_fpu.c | 10 ++++++++++ + drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 10 ++++++++++ + drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c | 10 ++++++++++ + 4 files changed, 40 insertions(+) + +diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn302/dcn302_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn302/dcn302_fpu.c +index e2bcd205a..8da97a96b 100644 +--- a/drivers/gpu/drm/amd/display/dc/dml/dcn302/dcn302_fpu.c ++++ b/drivers/gpu/drm/amd/display/dc/dml/dcn302/dcn302_fpu.c +@@ -304,6 +304,16 @@ void dcn302_fpu_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_p + dram_speed_mts[num_states++] = bw_params->clk_table.entries[j++].memclk_mhz * 16; + } + ++ /* bw_params->clk_table.entries[MAX_NUM_DPM_LVL]. ++ * MAX_NUM_DPM_LVL is 8. ++ * dcn3_02_soc.clock_limits[DC__VOLTAGE_STATES]. ++ * DC__VOLTAGE_STATES is 40. ++ */ ++ if (num_states > MAX_NUM_DPM_LVL) { ++ ASSERT(0); ++ return; ++ } ++ + dcn3_02_soc.num_states = num_states; + for (i = 0; i < dcn3_02_soc.num_states; i++) { + dcn3_02_soc.clock_limits[i].state = i; +diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn303/dcn303_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn303/dcn303_fpu.c +index 3eb3a021a..c283780ad 100644 +--- a/drivers/gpu/drm/amd/display/dc/dml/dcn303/dcn303_fpu.c ++++ b/drivers/gpu/drm/amd/display/dc/dml/dcn303/dcn303_fpu.c +@@ -299,6 +299,16 @@ void dcn303_fpu_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_p + dram_speed_mts[num_states++] = bw_params->clk_table.entries[j++].memclk_mhz * 16; + } + ++ /* bw_params->clk_table.entries[MAX_NUM_DPM_LVL]. ++ * MAX_NUM_DPM_LVL is 8. ++ * dcn3_02_soc.clock_limits[DC__VOLTAGE_STATES]. ++ * DC__VOLTAGE_STATES is 40. ++ */ ++ if (num_states > MAX_NUM_DPM_LVL) { ++ ASSERT(0); ++ return; ++ } ++ + dcn3_03_soc.num_states = num_states; + for (i = 0; i < dcn3_03_soc.num_states; i++) { + dcn3_03_soc.clock_limits[i].state = i; +diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +index 85e0d1c2a..1af14b570 100644 +--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c ++++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +@@ -2507,6 +2507,16 @@ void dcn32_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_pa + dram_speed_mts[num_states++] = bw_params->clk_table.entries[j++].memclk_mhz * 16; + } + ++ /* bw_params->clk_table.entries[MAX_NUM_DPM_LVL]. ++ * MAX_NUM_DPM_LVL is 8. ++ * dcn3_02_soc.clock_limits[DC__VOLTAGE_STATES]. ++ * DC__VOLTAGE_STATES is 40. ++ */ ++ if (num_states > MAX_NUM_DPM_LVL) { ++ ASSERT(0); ++ return; ++ } ++ + dcn3_2_soc.num_states = num_states; + for (i = 0; i < dcn3_2_soc.num_states; i++) { + dcn3_2_soc.clock_limits[i].state = i; +diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c +index 383a409a3..2c7d58ac6 100644 +--- a/drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c ++++ b/drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c +@@ -652,6 +652,16 @@ void dcn321_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_p + dram_speed_mts[num_states++] = bw_params->clk_table.entries[j++].memclk_mhz * 16; + } + ++ /* bw_params->clk_table.entries[MAX_NUM_DPM_LVL]. ++ * MAX_NUM_DPM_LVL is 8. ++ * dcn3_02_soc.clock_limits[DC__VOLTAGE_STATES]. ++ * DC__VOLTAGE_STATES is 40. ++ */ ++ if (num_states > MAX_NUM_DPM_LVL) { ++ ASSERT(0); ++ return; ++ } ++ + dcn3_21_soc.num_states = num_states; + for (i = 0; i < dcn3_21_soc.num_states; i++) { + dcn3_21_soc.clock_limits[i].state = i; +-- +2.39.4 + diff --git a/SPECS/linux/6.1/CVE/0001-drm-amd-display-Fix-panel_cntl-could-be-null-in-dcn2.patch b/SPECS/linux/6.1/CVE/0001-drm-amd-display-Fix-panel_cntl-could-be-null-in-dcn2.patch new file mode 100644 index 0000000000..d2535ec5dd --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-drm-amd-display-Fix-panel_cntl-could-be-null-in-dcn2.patch @@ -0,0 +1,65 @@ +From da4e54c3dce7136eaf40147b54bac681e3d253ad Mon Sep 17 00:00:00 2001 +From: Srinivasan Shanmugam +Date: Sat, 27 Jan 2024 18:34:01 +0530 +Subject: [PATCH] drm/amd/display: Fix 'panel_cntl' could be null in + 'dcn21_set_backlight_level()' + +[ Upstream commit e96fddb32931d007db12b1fce9b5e8e4c080401b ] + +'panel_cntl' structure used to control the display panel could be null, +dereferencing it could lead to a null pointer access. + +Fixes the below: +drivers/gpu/drm/amd/amdgpu/../display/dc/hwss/dcn21/dcn21_hwseq.c:269 dcn21_set_backlight_level() error: we previously assumed 'panel_cntl' could be null (see line 250) + +Fixes: 474ac4a875ca ("drm/amd/display: Implement some asic specific abm call backs.") +Cc: Yongqiang Sun +Cc: Anthony Koo +Cc: Rodrigo Siqueira +Cc: Aurabindo Pillai +Signed-off-by: Srinivasan Shanmugam +Reviewed-by: Anthony Koo +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +[ Brennan : Ported to v6.1. Remove check before dmub_abm_set_pipe() as equivalent + to upstream check removal before the larger if/else block, before + set_pipe_ex()/dumb_abm_set_pipe() is called. + Also, skip other part for abm->funcs->set_backlight_level_pwm as + it is not present in v6.1 ] +Signed-off-by: Brennan Lamoreaux +--- + drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c +index a43a7dee4e66..a0376f518762 100644 +--- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c ++++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c +@@ -207,16 +207,21 @@ bool dcn21_set_backlight_level(struct pipe_ctx *pipe_ctx, + union dmub_rb_cmd cmd; + struct dc_context *dc = pipe_ctx->stream->ctx; + struct abm *abm = pipe_ctx->stream_res.abm; +- uint32_t otg_inst = pipe_ctx->stream_res.tg->inst; ++ struct timing_generator *tg = pipe_ctx->stream_res.tg; + struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl; ++ uint32_t otg_inst; ++ ++ if (!abm && !tg && !panel_cntl) ++ return false; ++ ++ otg_inst = tg->inst; + + if (dc->dc->res_pool->dmcu) { + dce110_set_backlight_level(pipe_ctx, backlight_pwm_u16_16, frame_ramp); + return true; + } + +- if (abm && panel_cntl) +- dmub_abm_set_pipe(abm, otg_inst, SET_ABM_PIPE_NORMAL, panel_cntl->inst); ++ dmub_abm_set_pipe(abm, otg_inst, SET_ABM_PIPE_NORMAL, panel_cntl->inst); + + memset(&cmd, 0, sizeof(cmd)); + cmd.abm_set_backlight.header.type = DMUB_CMD__ABM; +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-drm-amd-display-Fix-vs-typos.patch b/SPECS/linux/6.1/CVE/0001-drm-amd-display-Fix-vs-typos.patch new file mode 100644 index 0000000000..fb7720ef83 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-drm-amd-display-Fix-vs-typos.patch @@ -0,0 +1,45 @@ +From 1c25a71f2f29fa01cf4663640f10dc921e8e9fed Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Fri, 9 Feb 2024 16:02:42 +0300 +Subject: [PATCH] drm/amd/display: Fix && vs || typos + +commit 17ba9cde11c2bfebbd70867b0a2ac4a22e573379 upstream + +These ANDs should be ORs or it will lead to a NULL dereference. + +Fixes: fb5a3d037082 ("drm/amd/display: Add NULL test for 'timing generator' in 'dcn21_set_pipe()'") +Fixes: 886571d217d7 ("drm/amd/display: Fix 'panel_cntl' could be null in 'dcn21_set_backlight_level()'") +Reviewed-by: Anthony Koo +Signed-off-by: Dan Carpenter +Signed-off-by: Hamza Mahfooz +Signed-off-by: Alex Deucher +Signed-off-by: Brennan Lamoreaux +--- + drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c +index a0376f518762..5910cde0408d 100644 +--- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c ++++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c +@@ -187,7 +187,7 @@ void dcn21_set_pipe(struct pipe_ctx *pipe_ctx) + struct dmcu *dmcu = pipe_ctx->stream->ctx->dc->res_pool->dmcu; + uint32_t otg_inst; + +- if (!abm && !tg && !panel_cntl) ++ if (!abm || !tg || !panel_cntl) + return; + + otg_inst = tg->inst; +@@ -211,7 +211,7 @@ bool dcn21_set_backlight_level(struct pipe_ctx *pipe_ctx, + struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl; + uint32_t otg_inst; + +- if (!abm && !tg && !panel_cntl) ++ if (!abm || !tg || !panel_cntl) + return false; + + otg_inst = tg->inst; +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-drm-amd-display-fix-a-Null-pointer-dereference-vulne.patch b/SPECS/linux/6.1/CVE/0001-drm-amd-display-fix-a-Null-pointer-dereference-vulne.patch new file mode 100644 index 0000000000..d190f4159c --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-drm-amd-display-fix-a-Null-pointer-dereference-vulne.patch @@ -0,0 +1,69 @@ +From 6122226b612a734127117a61e4357aac7f945872 Mon Sep 17 00:00:00 2001 +From: Siyang Liu +Date: Mon, 29 Sep 2025 17:53:18 +0530 +Subject: [PATCH] drm/amd/display: fix a Null pointer dereference vulnerability + +[ Upstream commit 1bcf63a44381691d6192872801f830ce3250e367 ] + +[Why] +A null pointer dereference vulnerability exists in the AMD display driver's +(DC module) cleanup function dc_destruct(). +When display control context (dc->ctx) construction fails +(due to memory allocation failure), this pointer remains NULL. +During subsequent error handling when dc_destruct() is called, +there's no NULL check before dereferencing the perf_trace member +(dc->ctx->perf_trace), causing a kernel null pointer dereference crash. + +[How] +Check if dc->ctx is non-NULL before dereferencing. + +Link: https://lore.kernel.org/r/tencent_54FF4252EDFB6533090A491A25EEF3EDBF06@qq.com +Co-developed-by: Mario Limonciello +Signed-off-by: Mario Limonciello +(Updated commit text and removed unnecessary error message) +Signed-off-by: Siyang Liu +Signed-off-by: Roman Li +Reviewed-by: Alex Hung +Tested-by: Daniel Wheeler +Signed-off-by: Alex Deucher +(cherry picked from commit 9dd8e2ba268c636c240a918e0a31e6feaee19404) +Cc: stable@vger.kernel.org +[Guru: Manually ported. kfree(dc->ctx->logger); not required removed] +Signed-off-by: Guruswamy Basavaiah +--- + drivers/gpu/drm/amd/display/dc/core/dc.c | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c +index 10672bb90a02..711895d1e765 100644 +--- a/drivers/gpu/drm/amd/display/dc/core/dc.c ++++ b/drivers/gpu/drm/amd/display/dc/core/dc.c +@@ -831,16 +831,17 @@ static void dc_destruct(struct dc *dc) + + dc_destroy_resource_pool(dc); + +- if (dc->ctx->gpio_service) +- dal_gpio_service_destroy(&dc->ctx->gpio_service); ++ if (dc->ctx) { ++ if (dc->ctx->gpio_service) ++ dal_gpio_service_destroy(&dc->ctx->gpio_service); + +- if (dc->ctx->created_bios) +- dal_bios_parser_destroy(&dc->ctx->dc_bios); ++ if (dc->ctx->created_bios) ++ dal_bios_parser_destroy(&dc->ctx->dc_bios); ++ dc_perf_trace_destroy(&dc->ctx->perf_trace); + +- dc_perf_trace_destroy(&dc->ctx->perf_trace); +- +- kfree(dc->ctx); +- dc->ctx = NULL; ++ kfree(dc->ctx); ++ dc->ctx = NULL; ++ } + + kfree(dc->bw_vbios); + dc->bw_vbios = NULL; +-- +2.43.0 + diff --git a/SPECS/linux/6.1/CVE/0001-drm-amd-pm-fix-null-pointer-access.patch b/SPECS/linux/6.1/CVE/0001-drm-amd-pm-fix-null-pointer-access.patch new file mode 100644 index 0000000000..8b95369c31 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-drm-amd-pm-fix-null-pointer-access.patch @@ -0,0 +1,37 @@ +From 489db45b53be216d8b39e62c992226515c92c57a Mon Sep 17 00:00:00 2001 +From: Umio Yasuno +Date: Mon, 29 Sep 2025 16:45:01 +0530 +Subject: [PATCH] drm/amd/pm: fix null pointer access + +[ Upstream commit d524d40e3a6152a3ea1125af729f8cd8ca65efde ] + +Writing a string without delimiters (' ', '\n', '\0') to the under +gpu_od/fan_ctrl sysfs or pp_power_profile_mode for the CUSTOM profile +will result in a null pointer dereference. + +Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4401 +Signed-off-by: Umio Yasuno +Acked-by: Alex Deucher +Signed-off-by: Alex Deucher +[Guru: Removed second hunk. Not required] +Signed-off-by: Guruswamy Basavaiah +--- + drivers/gpu/drm/amd/pm/amdgpu_pm.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c +index cdb406690b7e..8aa00e326287 100644 +--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c ++++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c +@@ -1442,6 +1442,8 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev, + if (ret) + return -EINVAL; + parameter_size++; ++ if (!tmp_str) ++ break; + while (isspace(*tmp_str)) + tmp_str++; + } +-- +2.43.0 + diff --git a/SPECS/linux/6.1/CVE/0001-drm-amdgpu-Fix-potential-out-of-bounds-access-in-amd.patch b/SPECS/linux/6.1/CVE/0001-drm-amdgpu-Fix-potential-out-of-bounds-access-in-amd.patch new file mode 100644 index 0000000000..43f314f989 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-drm-amdgpu-Fix-potential-out-of-bounds-access-in-amd.patch @@ -0,0 +1,67 @@ +From 3c0b353242d2964b6c3442a336e7fc8fc282f353 Mon Sep 17 00:00:00 2001 +From: Srinivasan Shanmugam +Date: Mon, 30 Jun 2025 23:33:59 -0500 +Subject: [PATCH] drm/amdgpu: Fix potential out-of-bounds access in + 'amdgpu_discovery_reg_base_init()' +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[ Upstream commit cdb637d339572398821204a1142d8d615668f1e9 ] + +The issue arises when the array 'adev->vcn.vcn_config' is accessed +before checking if the index 'adev->vcn.num_vcn_inst' is within the +bounds of the array. + +The fix involves moving the bounds check before the array access. This +ensures that 'adev->vcn.num_vcn_inst' is within the bounds of the array +before it is used as an index. + +Fixes the below: +drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1289 amdgpu_discovery_reg_base_init() error: testing array offset 'adev->vcn.num_vcn_inst' after use. + +Fixes: a0ccc717c4ab ("drm/amdgpu/discovery: validate VCN and SDMA instances") +Cc: Christian König +Cc: Alex Deucher +Signed-off-by: Srinivasan Shanmugam +Reviewed-by: Alex Deucher +Signed-off-by: Alex Deucher +Signed-off-by: Vamsi Krishna Brahmajosyula +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +index d8441e273cb5..0358923865ce 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +@@ -1128,15 +1128,16 @@ static int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev) + * 0b10 : encode is disabled + * 0b01 : decode is disabled + */ +- adev->vcn.vcn_config[adev->vcn.num_vcn_inst] = +- ip->revision & 0xc0; +- ip->revision &= ~0xc0; +- if (adev->vcn.num_vcn_inst < AMDGPU_MAX_VCN_INSTANCES) +- adev->vcn.num_vcn_inst++; ++ if (adev->vcn.num_vcn_inst < AMDGPU_MAX_VCN_INSTANCES) { ++ adev->vcn.vcn_config[adev->vcn.num_vcn_inst] = ++ ip->revision & 0xc0; ++ adev->vcn.num_vcn_inst++; ++ } + else + dev_err(adev->dev, "Too many VCN instances: %d vs %d\n", + adev->vcn.num_vcn_inst + 1, + AMDGPU_MAX_VCN_INSTANCES); ++ ip->revision &= ~0xc0; + } + if (le16_to_cpu(ip->hw_id) == SDMA0_HWID || + le16_to_cpu(ip->hw_id) == SDMA1_HWID || +@@ -2424,4 +2425,3 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev) + + return 0; + } +- +-- +2.49.0 + diff --git a/SPECS/linux/6.1/CVE/0001-ethtool-Fail-number-of-channels-change-when-it-confl.patch b/SPECS/linux/6.1/CVE/0001-ethtool-Fail-number-of-channels-change-when-it-confl.patch new file mode 100644 index 0000000000..9e9a6a60e1 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-ethtool-Fail-number-of-channels-change-when-it-confl.patch @@ -0,0 +1,199 @@ +From d15ffcb2153a198ffbc6d37a6adcc69e14e86b84 Mon Sep 17 00:00:00 2001 +From: Gal Pressman +Date: Sun, 6 Nov 2022 14:31:27 +0200 +Subject: [PATCH 1/2] ethtool: Fail number of channels change when it conflicts + with rxnfc + +[ Upstream commit 47f3ecf4763d3fea37d3453c9ee1f9f2169d71b3 ] + +Similar to what we do with the hash indirection table [1], when network +flow classification rules are forwarding traffic to channels greater +than the requested number of channels, fail the operation. +Without this, traffic could be directed to channels which no longer +exist (dropped) after changing number of channels. + +[1] commit d4ab4286276f ("ethtool: correctly ensure {GS}CHANNELS doesn't conflict with GS{RXFH}") + +Reviewed-by: Tariq Toukan +Signed-off-by: Gal Pressman +Link: https://lore.kernel.org/r/20221106123127.522985-1-gal@nvidia.com +Signed-off-by: Paolo Abeni +Signed-off-by: Keerthana K +--- + net/ethtool/channels.c | 19 ++++++++---- + net/ethtool/common.c | 66 ++++++++++++++++++++++++++++++++++++++++++ + net/ethtool/common.h | 1 + + net/ethtool/ioctl.c | 17 +++++++---- + 4 files changed, 92 insertions(+), 11 deletions(-) + +diff --git a/net/ethtool/channels.c b/net/ethtool/channels.c +index 6a070dc8e..4833b3231 100644 +--- a/net/ethtool/channels.c ++++ b/net/ethtool/channels.c +@@ -116,9 +116,10 @@ int ethnl_set_channels(struct sk_buff *skb, struct genl_info *info) + struct ethtool_channels channels = {}; + struct ethnl_req_info req_info = {}; + struct nlattr **tb = info->attrs; +- u32 err_attr, max_rx_in_use = 0; ++ u32 err_attr, max_rxfh_in_use; + const struct ethtool_ops *ops; + struct net_device *dev; ++ u64 max_rxnfc_in_use; + int ret; + + ret = ethnl_parse_header_dev_get(&req_info, +@@ -189,15 +190,23 @@ int ethnl_set_channels(struct sk_buff *skb, struct genl_info *info) + } + + /* ensure the new Rx count fits within the configured Rx flow +- * indirection table settings ++ * indirection table/rxnfc settings + */ +- if (netif_is_rxfh_configured(dev) && +- !ethtool_get_max_rxfh_channel(dev, &max_rx_in_use) && +- (channels.combined_count + channels.rx_count) <= max_rx_in_use) { ++ if (ethtool_get_max_rxnfc_channel(dev, &max_rxnfc_in_use)) ++ max_rxnfc_in_use = 0; ++ if (!netif_is_rxfh_configured(dev) || ++ ethtool_get_max_rxfh_channel(dev, &max_rxfh_in_use)) ++ max_rxfh_in_use = 0; ++ if (channels.combined_count + channels.rx_count <= max_rxfh_in_use) { + ret = -EINVAL; + GENL_SET_ERR_MSG(info, "requested channel counts are too low for existing indirection table settings"); + goto out_ops; + } ++ if (channels.combined_count + channels.rx_count <= max_rxnfc_in_use) { ++ ret = -EINVAL; ++ GENL_SET_ERR_MSG(info, "requested channel counts are too low for existing ntuple filter settings"); ++ goto out_ops; ++ } + + /* Disabling channels, query zero-copy AF_XDP sockets */ + from_channel = channels.combined_count + +diff --git a/net/ethtool/common.c b/net/ethtool/common.c +index 24036e305..d6f387ff6 100644 +--- a/net/ethtool/common.c ++++ b/net/ethtool/common.c +@@ -339,6 +339,72 @@ int __ethtool_get_link(struct net_device *dev) + return netif_running(dev) && dev->ethtool_ops->get_link(dev); + } + ++static int ethtool_get_rxnfc_rule_count(struct net_device *dev) ++{ ++ const struct ethtool_ops *ops = dev->ethtool_ops; ++ struct ethtool_rxnfc info = { ++ .cmd = ETHTOOL_GRXCLSRLCNT, ++ }; ++ int err; ++ ++ err = ops->get_rxnfc(dev, &info, NULL); ++ if (err) ++ return err; ++ ++ return info.rule_cnt; ++} ++ ++int ethtool_get_max_rxnfc_channel(struct net_device *dev, u64 *max) ++{ ++ const struct ethtool_ops *ops = dev->ethtool_ops; ++ struct ethtool_rxnfc *info; ++ int err, i, rule_cnt; ++ u64 max_ring = 0; ++ ++ if (!ops->get_rxnfc) ++ return -EOPNOTSUPP; ++ ++ rule_cnt = ethtool_get_rxnfc_rule_count(dev); ++ if (rule_cnt <= 0) ++ return -EINVAL; ++ ++ info = kvzalloc(struct_size(info, rule_locs, rule_cnt), GFP_KERNEL); ++ if (!info) ++ return -ENOMEM; ++ ++ info->cmd = ETHTOOL_GRXCLSRLALL; ++ info->rule_cnt = rule_cnt; ++ err = ops->get_rxnfc(dev, info, info->rule_locs); ++ if (err) ++ goto err_free_info; ++ ++ for (i = 0; i < rule_cnt; i++) { ++ struct ethtool_rxnfc rule_info = { ++ .cmd = ETHTOOL_GRXCLSRULE, ++ .fs.location = info->rule_locs[i], ++ }; ++ ++ err = ops->get_rxnfc(dev, &rule_info, NULL); ++ if (err) ++ goto err_free_info; ++ ++ if (rule_info.fs.ring_cookie != RX_CLS_FLOW_DISC && ++ rule_info.fs.ring_cookie != RX_CLS_FLOW_WAKE && ++ !(rule_info.flow_type & FLOW_RSS) && ++ !ethtool_get_flow_spec_ring_vf(rule_info.fs.ring_cookie)) ++ max_ring = ++ max_t(u64, max_ring, rule_info.fs.ring_cookie); ++ } ++ ++ kvfree(info); ++ *max = max_ring; ++ return 0; ++ ++err_free_info: ++ kvfree(info); ++ return err; ++} ++ + int ethtool_get_max_rxfh_channel(struct net_device *dev, u32 *max) + { + u32 dev_size, current_max = 0; +diff --git a/net/ethtool/common.h b/net/ethtool/common.h +index 3d9251c95..90b375122 100644 +--- a/net/ethtool/common.h ++++ b/net/ethtool/common.h +@@ -36,6 +36,7 @@ bool convert_legacy_settings_to_link_ksettings( + struct ethtool_link_ksettings *link_ksettings, + const struct ethtool_cmd *legacy_settings); + int ethtool_get_max_rxfh_channel(struct net_device *dev, u32 *max); ++int ethtool_get_max_rxnfc_channel(struct net_device *dev, u64 *max); + int __ethtool_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info); + + extern const struct ethtool_phy_ops *ethtool_phy_ops; +diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c +index 0a588545d..08ec984b4 100644 +--- a/net/ethtool/ioctl.c ++++ b/net/ethtool/ioctl.c +@@ -1771,7 +1771,8 @@ static noinline_for_stack int ethtool_set_channels(struct net_device *dev, + { + struct ethtool_channels channels, curr = { .cmd = ETHTOOL_GCHANNELS }; + u16 from_channel, to_channel; +- u32 max_rx_in_use = 0; ++ u64 max_rxnfc_in_use; ++ u32 max_rxfh_in_use; + unsigned int i; + int ret; + +@@ -1802,11 +1803,15 @@ static noinline_for_stack int ethtool_set_channels(struct net_device *dev, + return -EINVAL; + + /* ensure the new Rx count fits within the configured Rx flow +- * indirection table settings */ +- if (netif_is_rxfh_configured(dev) && +- !ethtool_get_max_rxfh_channel(dev, &max_rx_in_use) && +- (channels.combined_count + channels.rx_count) <= max_rx_in_use) +- return -EINVAL; ++ * indirection table/rxnfc settings */ ++ if (ethtool_get_max_rxnfc_channel(dev, &max_rxnfc_in_use)) ++ max_rxnfc_in_use = 0; ++ if (!netif_is_rxfh_configured(dev) || ++ ethtool_get_max_rxfh_channel(dev, &max_rxfh_in_use)) ++ max_rxfh_in_use = 0; ++ if (channels.combined_count + channels.rx_count <= ++ max_t(u64, max_rxnfc_in_use, max_rxfh_in_use)) ++ return -EINVAL; + + /* Disabling channels, query zero-copy AF_XDP sockets */ + from_channel = channels.combined_count + +-- +2.39.4 + diff --git a/SPECS/linux/6.1/CVE/0001-firmware-arm_scmi-Fix-slab-use-after-free-in-scmi_bu.patch b/SPECS/linux/6.1/CVE/0001-firmware-arm_scmi-Fix-slab-use-after-free-in-scmi_bu.patch new file mode 100644 index 0000000000..8655dada56 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-firmware-arm_scmi-Fix-slab-use-after-free-in-scmi_bu.patch @@ -0,0 +1,158 @@ +From 07cb6d534cb5339975f58878b3720988904edf51 Mon Sep 17 00:00:00 2001 +From: Ajay Kaher +Date: Mon, 23 Jun 2025 10:36:53 +0000 +Subject: [PATCH] firmware: arm_scmi: Fix slab-use-after-free in + scmi_bus_notifier() + +From: Xinqi Zhang + +[ Upstream commit 295416091e44806760ccf753aeafdafc0ae268f3 ] + +The scmi_dev->name is released prematurely in __scmi_device_destroy(), +which causes slab-use-after-free when accessing scmi_dev->name in +scmi_bus_notifier(). So move the release of scmi_dev->name to +scmi_device_release() to avoid slab-use-after-free. + + | BUG: KASAN: slab-use-after-free in strncmp+0xe4/0xec + | Read of size 1 at addr ffffff80a482bcc0 by task swapper/0/1 + | + | CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.6.38-debug #1 + | Hardware name: Qualcomm Technologies, Inc. SA8775P Ride (DT) + | Call trace: + | dump_backtrace+0x94/0x114 + | show_stack+0x18/0x24 + | dump_stack_lvl+0x48/0x60 + | print_report+0xf4/0x5b0 + | kasan_report+0xa4/0xec + | __asan_report_load1_noabort+0x20/0x2c + | strncmp+0xe4/0xec + | scmi_bus_notifier+0x5c/0x54c + | notifier_call_chain+0xb4/0x31c + | blocking_notifier_call_chain+0x68/0x9c + | bus_notify+0x54/0x78 + | device_del+0x1bc/0x840 + | device_unregister+0x20/0xb4 + | __scmi_device_destroy+0xac/0x280 + | scmi_device_destroy+0x94/0xd0 + | scmi_chan_setup+0x524/0x750 + | scmi_probe+0x7fc/0x1508 + | platform_probe+0xc4/0x19c + | really_probe+0x32c/0x99c + | __driver_probe_device+0x15c/0x3c4 + | driver_probe_device+0x5c/0x170 + | __driver_attach+0x1c8/0x440 + | bus_for_each_dev+0xf4/0x178 + | driver_attach+0x3c/0x58 + | bus_add_driver+0x234/0x4d4 + | driver_register+0xf4/0x3c0 + | __platform_driver_register+0x60/0x88 + | scmi_driver_init+0xb0/0x104 + | do_one_initcall+0xb4/0x664 + | kernel_init_freeable+0x3c8/0x894 + | kernel_init+0x24/0x1e8 + | ret_from_fork+0x10/0x20 + | + | Allocated by task 1: + | kasan_save_stack+0x2c/0x54 + | kasan_set_track+0x2c/0x40 + | kasan_save_alloc_info+0x24/0x34 + | __kasan_kmalloc+0xa0/0xb8 + | __kmalloc_node_track_caller+0x6c/0x104 + | kstrdup+0x48/0x84 + | kstrdup_const+0x34/0x40 + | __scmi_device_create.part.0+0x8c/0x408 + | scmi_device_create+0x104/0x370 + | scmi_chan_setup+0x2a0/0x750 + | scmi_probe+0x7fc/0x1508 + | platform_probe+0xc4/0x19c + | really_probe+0x32c/0x99c + | __driver_probe_device+0x15c/0x3c4 + | driver_probe_device+0x5c/0x170 + | __driver_attach+0x1c8/0x440 + | bus_for_each_dev+0xf4/0x178 + | driver_attach+0x3c/0x58 + | bus_add_driver+0x234/0x4d4 + | driver_register+0xf4/0x3c0 + | __platform_driver_register+0x60/0x88 + | scmi_driver_init+0xb0/0x104 + | do_one_initcall+0xb4/0x664 + | kernel_init_freeable+0x3c8/0x894 + | kernel_init+0x24/0x1e8 + | ret_from_fork+0x10/0x20 + | + | Freed by task 1: + | kasan_save_stack+0x2c/0x54 + | kasan_set_track+0x2c/0x40 + | kasan_save_free_info+0x38/0x5c + | __kasan_slab_free+0xe8/0x164 + | __kmem_cache_free+0x11c/0x230 + | kfree+0x70/0x130 + | kfree_const+0x20/0x40 + | __scmi_device_destroy+0x70/0x280 + | scmi_device_destroy+0x94/0xd0 + | scmi_chan_setup+0x524/0x750 + | scmi_probe+0x7fc/0x1508 + | platform_probe+0xc4/0x19c + | really_probe+0x32c/0x99c + | __driver_probe_device+0x15c/0x3c4 + | driver_probe_device+0x5c/0x170 + | __driver_attach+0x1c8/0x440 + | bus_for_each_dev+0xf4/0x178 + | driver_attach+0x3c/0x58 + | bus_add_driver+0x234/0x4d4 + | driver_register+0xf4/0x3c0 + | __platform_driver_register+0x60/0x88 + | scmi_driver_init+0xb0/0x104 + | do_one_initcall+0xb4/0x664 + | kernel_init_freeable+0x3c8/0x894 + | kernel_init+0x24/0x1e8 + | ret_from_fork+0x10/0x20 + +Fixes: ee7a9c9f67c5 ("firmware: arm_scmi: Add support for multiple device per protocol") +Signed-off-by: Xinqi Zhang +Reviewed-by: Cristian Marussi +Reviewed-by: Bjorn Andersson +Message-Id: <20241016-fix-arm-scmi-slab-use-after-free-v2-1-1783685ef90d@quicinc.com> +Signed-off-by: Sudeep Holla +Signed-off-by: Sasha Levin +[Ajay: Modified to apply on v6.1.y] +Signed-off-by: Ajay Kaher +--- + drivers/firmware/arm_scmi/bus.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c +index 8c6f99d..42e4ac6 100644 +--- a/drivers/firmware/arm_scmi/bus.c ++++ b/drivers/firmware/arm_scmi/bus.c +@@ -164,7 +164,10 @@ EXPORT_SYMBOL_GPL(scmi_driver_unregister); + + static void scmi_device_release(struct device *dev) + { +- kfree(to_scmi_dev(dev)); ++ struct scmi_device *scmi_dev = to_scmi_dev(dev); ++ ++ kfree_const(scmi_dev->name); ++ kfree(scmi_dev); + } + + struct scmi_device * +@@ -205,7 +208,6 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol, + + return scmi_dev; + put_dev: +- kfree_const(scmi_dev->name); + put_device(&scmi_dev->dev); + ida_free(&scmi_bus_id, id); + return NULL; +@@ -213,7 +215,6 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol, + + void scmi_device_destroy(struct scmi_device *scmi_dev) + { +- kfree_const(scmi_dev->name); + scmi_handle_put(scmi_dev->handle); + ida_free(&scmi_bus_id, scmi_dev->id); + device_unregister(&scmi_dev->dev); +-- +2.39.0 + diff --git a/SPECS/linux/6.1/CVE/0001-iavf-fix-out-of-bounds-writes-in-iavf_get_ethtool_st.patch b/SPECS/linux/6.1/CVE/0001-iavf-fix-out-of-bounds-writes-in-iavf_get_ethtool_st.patch new file mode 100644 index 0000000000..596da13297 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-iavf-fix-out-of-bounds-writes-in-iavf_get_ethtool_st.patch @@ -0,0 +1,158 @@ +From b1347f3608a09f5824fc1eb89e33a992213b6507 Mon Sep 17 00:00:00 2001 +From: Kohei Enju +Date: Sat, 14 Feb 2026 19:14:25 +0000 +Subject: [PATCH 1/2] iavf: fix out-of-bounds writes in + iavf_get_ethtool_stats() + +[ Upstream commit fecacfc95f195b99c71c579a472120d0b4ed65fa ] + +iavf incorrectly uses real_num_tx_queues for ETH_SS_STATS. Since the +value could change in runtime, we should use num_tx_queues instead. + +Moreover iavf_get_ethtool_stats() uses num_active_queues while +iavf_get_sset_count() and iavf_get_stat_strings() use +real_num_tx_queues, which triggers out-of-bounds writes when we do +"ethtool -L" and "ethtool -S" simultaneously [1]. + +For example when we change channels from 1 to 8, Thread 3 could be +scheduled before Thread 2, and out-of-bounds writes could be triggered +in Thread 3: + +Thread 1 (ethtool -L) Thread 2 (work) Thread 3 (ethtool -S) +iavf_set_channels() +... +iavf_alloc_queues() +-> num_active_queues = 8 +iavf_schedule_finish_config() + iavf_get_sset_count() + real_num_tx_queues: 1 + -> buffer for 1 queue + iavf_get_ethtool_stats() + num_active_queues: 8 + -> out-of-bounds! + iavf_finish_config() + -> real_num_tx_queues = 8 + +Use immutable num_tx_queues in all related functions to avoid the issue. + +[1] + BUG: KASAN: vmalloc-out-of-bounds in iavf_add_one_ethtool_stat+0x200/0x270 + Write of size 8 at addr ffffc900031c9080 by task ethtool/5800 + + CPU: 1 UID: 0 PID: 5800 Comm: ethtool Not tainted 6.19.0-enjuk-08403-g8137e3db7f1c #241 PREEMPT(full) + Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 + Call Trace: + + dump_stack_lvl+0x6f/0xb0 + print_report+0x170/0x4f3 + kasan_report+0xe1/0x180 + iavf_add_one_ethtool_stat+0x200/0x270 + iavf_get_ethtool_stats+0x14c/0x2e0 + __dev_ethtool+0x3d0c/0x5830 + dev_ethtool+0x12d/0x270 + dev_ioctl+0x53c/0xe30 + sock_do_ioctl+0x1a9/0x270 + sock_ioctl+0x3d4/0x5e0 + __x64_sys_ioctl+0x137/0x1c0 + do_syscall_64+0xf3/0x690 + entry_SYSCALL_64_after_hwframe+0x77/0x7f + RIP: 0033:0x7f7da0e6e36d + ... + + + The buggy address belongs to a 1-page vmalloc region starting at 0xffffc900031c9000 allocated at __dev_ethtool+0x3cc9/0x5830 + The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 + index:0xffff88813a013de0 pfn:0x13a013 + flags: 0x200000000000000(node=0|zone=2) + raw: 0200000000000000 0000000000000000 dead000000000122 0000000000000000 + raw: ffff88813a013de0 0000000000000000 00000001ffffffff 0000000000000000 + page dumped because: kasan: bad access detected + + Memory state around the buggy address: + ffffc900031c8f80: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 + ffffc900031c9000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + >ffffc900031c9080: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 + ^ + ffffc900031c9100: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 + ffffc900031c9180: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 + +Fixes: 64430f70ba6f ("iavf: Fix displaying queue statistics shown by ethtool") +Signed-off-by: Kohei Enju +Reviewed-by: Simon Horman +Reviewed-by: Przemek Kitszel +Reviewed-by: Paul Menzel +Tested-by: Rafal Romanowski +Signed-off-by: Tony Nguyen +Signed-off-by: Sasha Levin +Signed-off-by: Brennan Lamoreaux +--- + .../net/ethernet/intel/iavf/iavf_ethtool.c | 31 +++++++++---------- + 1 file changed, 15 insertions(+), 16 deletions(-) + +diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c +index f4ac2b164b3e..630d93e0512d 100644 +--- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c ++++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c +@@ -333,14 +333,13 @@ static int iavf_get_sset_count(struct net_device *netdev, int sset) + { + /* Report the maximum number queues, even if not every queue is + * currently configured. Since allocation of queues is in pairs, +- * use netdev->real_num_tx_queues * 2. The real_num_tx_queues is set +- * at device creation and never changes. ++ * use netdev->num_tx_queues * 2. The num_tx_queues is set at ++ * device creation and never changes. + */ + + if (sset == ETH_SS_STATS) + return IAVF_STATS_LEN + +- (IAVF_QUEUE_STATS_LEN * 2 * +- netdev->real_num_tx_queues); ++ (IAVF_QUEUE_STATS_LEN * 2 * netdev->num_tx_queues); + else if (sset == ETH_SS_PRIV_FLAGS) + return IAVF_PRIV_FLAGS_STR_LEN; + else +@@ -367,19 +366,19 @@ static void iavf_get_ethtool_stats(struct net_device *netdev, + iavf_add_ethtool_stats(&data, adapter, iavf_gstrings_stats); + + rcu_read_lock(); +- /* As num_active_queues describe both tx and rx queues, we can use +- * it to iterate over rings' stats. ++ /* Use num_tx_queues to report stats for the maximum number of queues. ++ * Queues beyond num_active_queues will report zero. + */ +- for (i = 0; i < adapter->num_active_queues; i++) { +- struct iavf_ring *ring; ++ for (i = 0; i < netdev->num_tx_queues; i++) { ++ struct iavf_ring *tx_ring = NULL, *rx_ring = NULL; + +- /* Tx rings stats */ +- ring = &adapter->tx_rings[i]; +- iavf_add_queue_stats(&data, ring); ++ if (i < adapter->num_active_queues) { ++ tx_ring = &adapter->tx_rings[i]; ++ rx_ring = &adapter->rx_rings[i]; ++ } + +- /* Rx rings stats */ +- ring = &adapter->rx_rings[i]; +- iavf_add_queue_stats(&data, ring); ++ iavf_add_queue_stats(&data, tx_ring); ++ iavf_add_queue_stats(&data, rx_ring); + } + rcu_read_unlock(); + } +@@ -416,9 +415,9 @@ static void iavf_get_stat_strings(struct net_device *netdev, u8 *data) + iavf_add_stat_strings(&data, iavf_gstrings_stats); + + /* Queues are always allocated in pairs, so we just use +- * real_num_tx_queues for both Tx and Rx queues. ++ * num_tx_queues for both Tx and Rx queues. + */ +- for (i = 0; i < netdev->real_num_tx_queues; i++) { ++ for (i = 0; i < netdev->num_tx_queues; i++) { + iavf_add_stat_strings(&data, iavf_gstrings_queue_stats, + "tx", i); + iavf_add_stat_strings(&data, iavf_gstrings_queue_stats, +-- +2.53.0 + diff --git a/SPECS/linux/6.1/CVE/0001-mm-filemap-fix-nr_pages-calculation-overflow-in-file.patch b/SPECS/linux/6.1/CVE/0001-mm-filemap-fix-nr_pages-calculation-overflow-in-file.patch new file mode 100644 index 0000000000..ec40381f28 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-mm-filemap-fix-nr_pages-calculation-overflow-in-file.patch @@ -0,0 +1,139 @@ +From f58df566524ebcdfa394329c64f47e3c9257516e Mon Sep 17 00:00:00 2001 +From: Baolin Wang +Date: Tue, 17 Mar 2026 17:29:55 +0800 +Subject: [PATCH] mm: filemap: fix nr_pages calculation overflow in + filemap_map_pages() + +[ Upstream commit f58df566524ebcdfa394329c64f47e3c9257516e ] + +When running stress-ng on my Arm64 machine with v7.0-rc3 kernel, I +encountered some very strange crash issues showing up as "Bad page state": + +" +[ 734.496287] BUG: Bad page state in process stress-ng-env pfn:415735fb +[ 734.496427] page: refcount:0 mapcount:1 mapping:0000000000000000 index:0x4cf316 pfn:0x415735fb +[ 734.496434] flags: 0x57fffe000000800(owner_2|node=1|zone=2|lastcpupid=0x3ffff) +[ 734.496439] raw: 057fffe000000800 0000000000000000 dead000000000122 0000000000000000 +[ 734.496440] raw: 00000000004cf316 0000000000000000 0000000000000000 0000000000000000 +[ 734.496442] page dumped because: nonzero mapcount +" + +After analyzing this page's state, it is hard to understand why the +mapcount is not 0 while the refcount is 0, since this page is not where +the issue first occurred. By enabling the CONFIG_DEBUG_VM config, I can +reproduce the crash as well and captured the first warning where the issue +appears: + +" +[ 734.469226] page: refcount:33 mapcount:0 mapping:00000000bef2d187 index:0x81a0 pfn:0x415735c0 +[ 734.469304] head: order:5 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 +[ 734.469315] memcg:ffff000807a8ec00 +[ 734.469320] aops:ext4_da_aops ino:100b6f dentry name(?):"stress-ng-mmaptorture-9397-0-2736200540" +[ 734.469335] flags: 0x57fffe400000069(locked|uptodate|lru|head|node=1|zone=2|lastcpupid=0x3ffff) +...... +[ 734.469364] page dumped because: VM_WARN_ON_FOLIO((_Generic((page + nr_pages - 1), +const struct page *: (const struct folio *)_compound_head(page + nr_pages - 1), struct page *: +(struct folio *)_compound_head(page + nr_pages - 1))) != folio) +[ 734.469390] ------------[ cut here ]------------ +[ 734.469393] WARNING: ./include/linux/rmap.h:351 at folio_add_file_rmap_ptes+0x3b8/0x468, +CPU#90: stress-ng-mlock/9430 +[ 734.469551] folio_add_file_rmap_ptes+0x3b8/0x468 (P) +[ 734.469555] set_pte_range+0xd8/0x2f8 +[ 734.469566] filemap_map_folio_range+0x190/0x400 +[ 734.469579] filemap_map_pages+0x348/0x638 +[ 734.469583] do_fault_around+0x140/0x198 +...... +[ 734.469640] el0t_64_sync+0x184/0x188 +" + +The code that triggers the warning is: "VM_WARN_ON_FOLIO(page_folio(page + +nr_pages - 1) != folio, folio)", which indicates that set_pte_range() +tried to map beyond the large folio's size. + +By adding more debug information, I found that 'nr_pages' had overflowed +in filemap_map_pages(), causing set_pte_range() to establish mappings for +a range exceeding the folio size, potentially corrupting fields of pages +that do not belong to this folio (e.g., page->_mapcount). + +After above analysis, I think the possible race is as follows: + +CPU 0 CPU 1 +filemap_map_pages() ext4_setattr() + //get and lock folio with old inode->i_size + next_uptodate_folio() + + ....... + //shrink the inode->i_size + i_size_write(inode, attr->ia_size); + + //calculate the end_pgoff with the new inode->i_size + file_end = DIV_ROUND_UP(i_size_read(mapping->host), PAGE_SIZE) - 1; + end_pgoff = min(end_pgoff, file_end); + + ...... + //nr_pages can be overflowed, cause xas.xa_index > end_pgoff + end = folio_next_index(folio) - 1; + nr_pages = min(end, end_pgoff) - xas.xa_index + 1; + + ...... + //map large folio + filemap_map_folio_range() + ...... + //truncate folios + truncate_pagecache(inode, inode->i_size); + +To fix this issue, move the 'end_pgoff' calculation before +next_uptodate_folio(), so the retrieved folio stays consistent with the +file end to avoid 'nr_pages' calculation overflow. After this patch, the +crash issue is gone. + +Link: https://lkml.kernel.org/r/1cf1ac59018fc647a87b0dad605d4056a71c14e4.1773739704.git.baolin.wang@linux.alibaba.com +Fixes: 743a2753a02e ("filemap: cap PTE range to be created to allowed zero fill in folio_map_range()") +Signed-off-by: Baolin Wang +Reported-by: Yuanhe Shu +Tested-by: Yuanhe Shu +Acked-by: Kiryl Shutsemau (Meta) +Acked-by: David Hildenbrand (Arm) +Cc: Christian Brauner +Cc: Daniel Gomez +Cc: "Darrick J. Wong" +Cc: Dave Chinner +Cc: David Howells +Cc: Hannes Reinecke +Cc: Lorenzo Stoakes (Oracle) +Cc: Luis Chamberalin +Cc: Matthew Wilcox (Oracle) +Cc: Pankaj Raghav +Signed-off-by: Andrew Morton +[Ankit: Backported for v6.1.x] +Signed-off-by: Ankit Jain +--- + mm/filemap.c | 11 ++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/mm/filemap.c b/mm/filemap.c +index 40c186c7210b..8e8f9b2a1c7d 100644 +--- a/mm/filemap.c ++++ b/mm/filemap.c +@@ -3469,5 +3469,12 @@ vm_fault_t filemap_map_pages(struct vm_fault *vmf, + vm_fault_t ret = 0; + ++ /* ++ * Recalculate end_pgoff based on file_end before calling ++ * first_map_page() to avoid races with concurrent truncation. ++ */ ++ file_end = DIV_ROUND_UP(i_size_read(mapping->host), PAGE_SIZE) - 1; ++ end_pgoff = min(end_pgoff, file_end); ++ + rcu_read_lock(); + folio = first_map_page(mapping, &xas, end_pgoff); + if (!folio) +@@ -3483,6 +3490,2 @@ vm_fault_t filemap_map_pages(struct vm_fault *vmf, + +- file_end = DIV_ROUND_UP(i_size_read(mapping->host), PAGE_SIZE) - 1; +- if (end_pgoff > file_end) +- end_pgoff = file_end; +- + do { +-- +2.40.4 diff --git a/SPECS/linux/6.1/CVE/0001-mm-mempolicy-fix-migrate_to_node-assuming-there-is-a.patch b/SPECS/linux/6.1/CVE/0001-mm-mempolicy-fix-migrate_to_node-assuming-there-is-a.patch new file mode 100644 index 0000000000..096558d333 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-mm-mempolicy-fix-migrate_to_node-assuming-there-is-a.patch @@ -0,0 +1,81 @@ +From e365732c02328ebf97e02cc545dcf781ed0648ec Mon Sep 17 00:00:00 2001 +From: Ajay Kaher +Date: Mon, 22 Sep 2025 10:47:07 +0000 +Subject: [PATCH] mm/mempolicy: fix migrate_to_node() assuming there is at + least one VMA in a MM + +From: David Hildenbrand + +[ Upstream commit 091c1dd2d4df6edd1beebe0e5863d4034ade9572 ] + +We currently assume that there is at least one VMA in a MM, which isn't +true. + +So we might end up having find_vma() return NULL, to then de-reference +NULL. So properly handle find_vma() returning NULL. + +This fixes the report: + +Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN PTI +KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] +CPU: 1 UID: 0 PID: 6021 Comm: syz-executor284 Not tainted 6.12.0-rc7-syzkaller-00187-gf868cd251776 #0 +Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 +RIP: 0010:migrate_to_node mm/mempolicy.c:1090 [inline] +RIP: 0010:do_migrate_pages+0x403/0x6f0 mm/mempolicy.c:1194 +Code: ... +RSP: 0018:ffffc9000375fd08 EFLAGS: 00010246 +RAX: 0000000000000000 RBX: ffffc9000375fd78 RCX: 0000000000000000 +RDX: ffff88807e171300 RSI: dffffc0000000000 RDI: ffff88803390c044 +RBP: ffff88807e171428 R08: 0000000000000014 R09: fffffbfff2039ef1 +R10: ffffffff901cf78f R11: 0000000000000000 R12: 0000000000000003 +R13: ffffc9000375fe90 R14: ffffc9000375fe98 R15: ffffc9000375fdf8 +FS: 00005555919e1380(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000 +CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 00005555919e1ca8 CR3: 000000007f12a000 CR4: 00000000003526f0 +DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 +DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 +Call Trace: + + kernel_migrate_pages+0x5b2/0x750 mm/mempolicy.c:1709 + __do_sys_migrate_pages mm/mempolicy.c:1727 [inline] + __se_sys_migrate_pages mm/mempolicy.c:1723 [inline] + __x64_sys_migrate_pages+0x96/0x100 mm/mempolicy.c:1723 + do_syscall_x64 arch/x86/entry/common.c:52 [inline] + do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 + entry_SYSCALL_64_after_hwframe+0x77/0x7f + +[akpm@linux-foundation.org: add unlikely()] +Link: https://lkml.kernel.org/r/20241120201151.9518-1-david@redhat.com +Fixes: 39743889aaf7 ("[PATCH] Swap Migration V5: sys_migrate_pages interface") +Signed-off-by: David Hildenbrand +Reported-by: syzbot+3511625422f7aa637f0d@syzkaller.appspotmail.com +Closes: https://lore.kernel.org/lkml/673d2696.050a0220.3c9d61.012f.GAE@google.com/T/ +Reviewed-by: Liam R. Howlett +Reviewed-by: Christoph Lameter +Cc: Liam R. Howlett +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Sasha Levin +[Ajay: dropped mmap_read_unlock() as not required for v6.1] +Signed-off-by: Ajay Kaher +--- +--- + mm/mempolicy.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/mm/mempolicy.c b/mm/mempolicy.c +index 399d8cb48..13b04fd04 100644 +--- a/mm/mempolicy.c ++++ b/mm/mempolicy.c +@@ -1068,6 +1068,8 @@ static int migrate_to_node(struct mm_struct *mm, int source, int dest, + * space range and MPOL_MF_DISCONTIG_OK, this call can not fail. + */ + vma = find_vma(mm, 0); ++ if (unlikely(!vma)) ++ return 0; + VM_BUG_ON(!(flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL))); + queue_pages_range(mm, vma->vm_start, mm->task_size, &nmask, + flags | MPOL_MF_DISCONTIG_OK, &pagelist); +-- +2.40.4 + diff --git a/SPECS/91/linux/CVE/0001-net-ioam6-fix-OOB-and-missing-lock.patch b/SPECS/linux/6.1/CVE/0001-net-ioam6-fix-OOB-and-missing-lock-6.1.patch similarity index 84% rename from SPECS/91/linux/CVE/0001-net-ioam6-fix-OOB-and-missing-lock.patch rename to SPECS/linux/6.1/CVE/0001-net-ioam6-fix-OOB-and-missing-lock-6.1.patch index 871e4618f3..c6c8b8a3b5 100644 --- a/SPECS/91/linux/CVE/0001-net-ioam6-fix-OOB-and-missing-lock.patch +++ b/SPECS/linux/6.1/CVE/0001-net-ioam6-fix-OOB-and-missing-lock-6.1.patch @@ -1,4 +1,4 @@ -From 05a7d5fca507d14a0122591b0a4e7622039acbdf Mon Sep 17 00:00:00 2001 +From 281a5a756ac174e495c08a099a97988a99dc3890 Mon Sep 17 00:00:00 2001 From: Justin Iurman Date: Sat, 4 Apr 2026 15:41:37 +0200 Subject: [PATCH] net: ioam6: fix OOB and missing lock @@ -38,19 +38,19 @@ Signed-off-by: Brennan Lamoreaux 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/ipv6/ioam6.c b/net/ipv6/ioam6.c -index 868a25c57b92..12f765114ba0 100644 +index a1953cf6131b..8db53f4da660 100644 --- a/net/ipv6/ioam6.c +++ b/net/ipv6/ioam6.c -@@ -802,12 +802,16 @@ static void __ioam6_fill_trace_data(struct sk_buff *skb, +@@ -737,12 +737,16 @@ static void __ioam6_fill_trace_data(struct sk_buff *skb, struct Qdisc *qdisc; __u32 qlen, backlog; -- if (dev->flags & IFF_LOOPBACK) { -+ if (dev->flags & IFF_LOOPBACK || -+ skb_get_queue_mapping(skb) >= dev->num_tx_queues) { +- if (skb_dst(skb)->dev->flags & IFF_LOOPBACK) { ++ if (skb_dst(skb)->dev->flags & IFF_LOOPBACK || ++ skb_get_queue_mapping(skb) >= skb_dst(skb)->dev->num_tx_queues) { *(__be32 *)data = cpu_to_be32(IOAM6_U32_UNAVAILABLE); } else { - queue = skb_get_tx_queue(dev, skb); + queue = skb_get_tx_queue(skb_dst(skb)->dev, skb); qdisc = rcu_dereference(queue->qdisc); + + spin_lock_bh(qdisc_lock(qdisc)); diff --git a/SPECS/linux/6.1/CVE/0001-net-mlx5e-Avoid-WARN_ON-when-configuring-MQPRIO-with.patch b/SPECS/linux/6.1/CVE/0001-net-mlx5e-Avoid-WARN_ON-when-configuring-MQPRIO-with.patch new file mode 100644 index 0000000000..664483e2c8 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-net-mlx5e-Avoid-WARN_ON-when-configuring-MQPRIO-with.patch @@ -0,0 +1,48 @@ +From 638d4fd5d6b8b76396b2a9547210350cc6ca8faa Mon Sep 17 00:00:00 2001 +From: Ajay Kaher +Date: Wed, 15 Oct 2025 10:01:28 +0000 +Subject: [PATCH] net/mlx5e: Avoid WARN_ON when configuring MQPRIO with HTB + offload enabled + +[ Upstream commit 689805dcc474c2accb5cffbbcea1c06ee4a54570 ] + +When attempting to enable MQPRIO while HTB offload is already +configured, the driver currently returns `-EINVAL` and triggers a +`WARN_ON`, leading to an unnecessary call trace. + +Update the code to handle this case more gracefully by returning +`-EOPNOTSUPP` instead, while also providing a helpful user message. + +Signed-off-by: Carolina Jubran +Reviewed-by: Yael Chemla +Reviewed-by: Cosmin Ratiu +Signed-off-by: Tariq Toukan +Reviewed-by: Kalesh AP +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +[ Ajay: Modified to apply on v6.1] + dropped message as mqprio->extack doesn't + exists for v6.1 ] +Signed-off-by: Ajay Kaher +--- + drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +index 887d44635..74e0b582c 100644 +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +@@ -3537,8 +3537,8 @@ static int mlx5e_setup_tc_mqprio(struct mlx5e_priv *priv, + /* MQPRIO is another toplevel qdisc that can't be attached + * simultaneously with the offloaded HTB. + */ +- if (WARN_ON(mlx5e_selq_is_htb_enabled(&priv->selq))) +- return -EINVAL; ++ if (mlx5e_selq_is_htb_enabled(&priv->selq)) ++ return -EOPNOTSUPP; + + switch (mqprio->mode) { + case TC_MQPRIO_MODE_DCB: +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-net-napi-Prevent-overflow-of-napi_defer_hard_irqs.patch b/SPECS/linux/6.1/CVE/0001-net-napi-Prevent-overflow-of-napi_defer_hard_irqs.patch new file mode 100644 index 0000000000..ac5991993e --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-net-napi-Prevent-overflow-of-napi_defer_hard_irqs.patch @@ -0,0 +1,110 @@ +From 36beb34feb158a20b9c76428b2dcda02a52ceeba Mon Sep 17 00:00:00 2001 +From: Joe Damato +Date: Wed, 4 Sep 2024 15:34:30 +0000 +Subject: [PATCH] net: napi: Prevent overflow of napi_defer_hard_irqs + +[ Upstream commit 08062af0a52107a243f7608fd972edb54ca5b7f8 ] + +In commit 6f8b12d661d0 ("net: napi: add hard irqs deferral feature") +napi_defer_irqs was added to net_device and napi_defer_irqs_count was +added to napi_struct, both as type int. + +This value never goes below zero, so there is not reason for it to be a +signed int. Change the type for both from int to u32, and add an +overflow check to sysfs to limit the value to S32_MAX. + +The limit of S32_MAX was chosen because the practical limit before this +patch was S32_MAX (anything larger was an overflow) and thus there are +no behavioral changes introduced. If the extra bit is needed in the +future, the limit can be raised. + +Before this patch: + +$ sudo bash -c 'echo 2147483649 > /sys/class/net/eth4/napi_defer_hard_irqs' +$ cat /sys/class/net/eth4/napi_defer_hard_irqs +-2147483647 + +After this patch: + +$ sudo bash -c 'echo 2147483649 > /sys/class/net/eth4/napi_defer_hard_irqs' +bash: line 0: echo: write error: Numerical result out of range + +Similarly, /sys/class/net/XXXXX/tx_queue_len is defined as unsigned: + +include/linux/netdevice.h: unsigned int tx_queue_len; + +And has an overflow check: + +dev_change_tx_queue_len(..., unsigned long new_len): + + if (new_len != (unsigned int)new_len) + return -ERANGE; + +Suggested-by: Jakub Kicinski +Signed-off-by: Joe Damato +Reviewed-by: Eric Dumazet +Link: https://patch.msgid.link/20240904153431.307932-1-jdamato@fastly.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +Signed-off-by: Brennan Lamoreaux +--- + include/linux/netdevice.h | 4 ++-- + net/core/net-sysfs.c | 6 +++++- + 2 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h +index fbbd0df1106b..8379e938cd89 100644 +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -352,7 +352,7 @@ struct napi_struct { + + unsigned long state; + int weight; +- int defer_hard_irqs_count; ++ u32 defer_hard_irqs_count; + unsigned long gro_bitmask; + int (*poll)(struct napi_struct *, int); + #ifdef CONFIG_NETPOLL +@@ -2193,7 +2193,7 @@ struct net_device { + + struct bpf_prog __rcu *xdp_prog; + unsigned long gro_flush_timeout; +- int napi_defer_hard_irqs; ++ u32 napi_defer_hard_irqs; + #define GRO_LEGACY_MAX_SIZE 65536u + /* TCP minimal MSS is 8 (TCP_MIN_GSO_SIZE), + * and shinfo->gso_segs is a 16bit field. +diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c +index 8a06f97320e0..4ce57e75d139 100644 +--- a/net/core/net-sysfs.c ++++ b/net/core/net-sysfs.c +@@ -30,6 +30,7 @@ + #ifdef CONFIG_SYSFS + static const char fmt_hex[] = "%#x\n"; + static const char fmt_dec[] = "%d\n"; ++static const char fmt_uint[] = "%u\n"; + static const char fmt_ulong[] = "%lu\n"; + static const char fmt_u64[] = "%llu\n"; + +@@ -405,6 +406,9 @@ NETDEVICE_SHOW_RW(gro_flush_timeout, fmt_ulong); + + static int change_napi_defer_hard_irqs(struct net_device *dev, unsigned long val) + { ++ if (val > S32_MAX) ++ return -ERANGE; ++ + WRITE_ONCE(dev->napi_defer_hard_irqs, val); + return 0; + } +@@ -418,7 +422,7 @@ static ssize_t napi_defer_hard_irqs_store(struct device *dev, + + return netdev_store(dev, attr, buf, len, change_napi_defer_hard_irqs); + } +-NETDEVICE_SHOW_RW(napi_defer_hard_irqs, fmt_dec); ++NETDEVICE_SHOW_RW(napi_defer_hard_irqs, fmt_uint); + + static ssize_t ifalias_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t len) +-- +2.39.4 + diff --git a/SPECS/linux/6.1/CVE/0001-net-phylink-add-lock-for-serializing-concurrent-pl-p.patch b/SPECS/linux/6.1/CVE/0001-net-phylink-add-lock-for-serializing-concurrent-pl-p.patch new file mode 100644 index 0000000000..1c03a34f5b --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-net-phylink-add-lock-for-serializing-concurrent-pl-p.patch @@ -0,0 +1,139 @@ +From 02816c52515542f0b2ef00fde316c7020c8d424f Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Thu, 4 Sep 2025 15:52:37 +0300 +Subject: [PATCH] net: phylink: add lock for serializing concurrent pl->phydev + writes with resolver + +[ Upstream commit 0ba5b2f2c381dbec9ed9e4ab3ae5d3e667de0dc3 ] + +Currently phylink_resolve() protects itself against concurrent +phylink_bringup_phy() or phylink_disconnect_phy() calls which modify +pl->phydev by relying on pl->state_mutex. + +The problem is that in phylink_resolve(), pl->state_mutex is in a lock +inversion state with pl->phydev->lock. So pl->phydev->lock needs to be +acquired prior to pl->state_mutex. But that requires dereferencing +pl->phydev in the first place, and without pl->state_mutex, that is +racy. + +Hence the reason for the extra lock. Currently it is redundant, but it +will serve a functional purpose once mutex_lock(&phy->lock) will be +moved outside of the mutex_lock(&pl->state_mutex) section. + +Another alternative considered would have been to let phylink_resolve() +acquire the rtnl_mutex, which is also held when phylink_bringup_phy() +and phylink_disconnect_phy() are called. But since phylink_disconnect_phy() +runs under rtnl_lock(), it would deadlock with phylink_resolve() when +calling flush_work(&pl->resolve). Additionally, it would have been +undesirable because it would have unnecessarily blocked many other call +paths as well in the entire kernel, so the smaller-scoped lock was +preferred. + +Link: https://lore.kernel.org/netdev/aLb6puGVzR29GpPx@shell.armlinux.org.uk/ +Signed-off-by: Vladimir Oltean +Reviewed-by: Russell King (Oracle) +Link: https://patch.msgid.link/20250904125238.193990-1-vladimir.oltean@nxp.com +Signed-off-by: Jakub Kicinski +Stable-dep-of: e2a10daba849 ("net: phy: transfer phy_config_inband() locking responsibility to phylink") +Signed-off-by: Sasha Levin +[Ankit: Backported for v6.1] +Signed-off-by: Ankit Jain +--- + drivers/net/phy/phylink.c | 19 ++++++++++++++++--- + 1 file changed, 16 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c +index 3069a7df25d3..a5d0243b33f7 100644 +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -69,6 +69,8 @@ struct phylink { + struct phylink_link_state *s); + + struct mutex state_mutex; ++ /* Serialize updates to pl->phydev with phylink_resolve() */ ++ struct mutex phydev_mutex; + struct phylink_link_state phy_state; + struct work_struct resolve; + +@@ -1255,8 +1257,11 @@ static void phylink_resolve(struct work_struct *w) + struct net_device *ndev = pl->netdev; + bool mac_config = false; + bool retrigger = false; ++ struct phy_device *phy; + bool cur_link_state; + ++ mutex_lock(&pl->phydev_mutex); ++ phy = pl->phydev; + mutex_lock(&pl->state_mutex); + if (pl->netdev) + cur_link_state = netif_carrier_ok(ndev); +@@ -1301,11 +1306,11 @@ static void phylink_resolve(struct work_struct *w) + /* If we have a phy, the "up" state is the union of + * both the PHY and the MAC + */ +- if (pl->phydev) ++ if (phy) + link_state.link &= pl->phy_state.link; + + /* Only update if the PHY link is up */ +- if (pl->phydev && pl->phy_state.link) { ++ if (phy && pl->phy_state.link) { + /* If the interface has changed, force a + * link down event if the link isn't already + * down, and re-resolve. +@@ -1372,6 +1377,7 @@ static void phylink_resolve(struct work_struct *w) + queue_work(system_power_efficient_wq, &pl->resolve); + } + mutex_unlock(&pl->state_mutex); ++ mutex_unlock(&pl->phydev_mutex); + } + + static void phylink_run_resolve(struct phylink *pl) +@@ -1473,6 +1479,7 @@ struct phylink *phylink_create(struct phylink_config *config, + if (!pl) + return ERR_PTR(-ENOMEM); + ++ mutex_init(&pl->phydev_mutex); + mutex_init(&pl->state_mutex); + INIT_WORK(&pl->resolve, phylink_resolve); + +@@ -1666,6 +1673,7 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy, + dev_name(&phy->mdio.dev), phy->drv->name, irq_str); + kfree(irq_str); + ++ mutex_lock(&pl->phydev_mutex); + mutex_lock(&phy->lock); + mutex_lock(&pl->state_mutex); + pl->phydev = phy; +@@ -1681,6 +1689,7 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy, + linkmode_copy(phy->advertising, config.advertising); + mutex_unlock(&pl->state_mutex); + mutex_unlock(&phy->lock); ++ mutex_unlock(&pl->phydev_mutex); + + phylink_dbg(pl, + "phy: %s setting supported %*pb advertising %*pb\n", +@@ -1838,6 +1847,7 @@ void phylink_disconnect_phy(struct phylink *pl) + + ASSERT_RTNL(); + ++ mutex_lock(&pl->phydev_mutex); + phy = pl->phydev; + if (phy) { + mutex_lock(&phy->lock); +@@ -1845,8 +1855,11 @@ void phylink_disconnect_phy(struct phylink *pl) + pl->phydev = NULL; + mutex_unlock(&pl->state_mutex); + mutex_unlock(&phy->lock); +- flush_work(&pl->resolve); ++ } ++ mutex_unlock(&pl->phydev_mutex); + ++ if (phy) { ++ flush_work(&pl->resolve); + phy_disconnect(phy); + } + } +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-net-sched-flower-Fix-chain-template-offload.patch b/SPECS/linux/6.1/CVE/0001-net-sched-flower-Fix-chain-template-offload.patch new file mode 100644 index 0000000000..991049723b --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-net-sched-flower-Fix-chain-template-offload.patch @@ -0,0 +1,188 @@ +From f0a4c8b176972eefdac23ebe03c43d6da18338c5 Mon Sep 17 00:00:00 2001 +From: Ido Schimmel +Date: Tue, 1 Jul 2025 00:17:27 -0500 +Subject: [PATCH] net/sched: flower: Fix chain template offload + +[ Upstream commit 32f2a0afa95fae0d1ceec2ff06e0e816939964b8 ] + +When a qdisc is deleted from a net device the stack instructs the +underlying driver to remove its flow offload callback from the +associated filter block using the 'FLOW_BLOCK_UNBIND' command. The stack +then continues to replay the removal of the filters in the block for +this driver by iterating over the chains in the block and invoking the +'reoffload' operation of the classifier being used. In turn, the +classifier in its 'reoffload' operation prepares and emits a +'FLOW_CLS_DESTROY' command for each filter. + +However, the stack does not do the same for chain templates and the +underlying driver never receives a 'FLOW_CLS_TMPLT_DESTROY' command when +a qdisc is deleted. This results in a memory leak [1] which can be +reproduced using [2]. + +Fix by introducing a 'tmplt_reoffload' operation and have the stack +invoke it with the appropriate arguments as part of the replay. +Implement the operation in the sole classifier that supports chain +templates (flower) by emitting the 'FLOW_CLS_TMPLT_{CREATE,DESTROY}' +command based on whether a flow offload callback is being bound to a +filter block or being unbound from one. + +As far as I can tell, the issue happens since cited commit which +reordered tcf_block_offload_unbind() before tcf_block_flush_all_chains() +in __tcf_block_put(). The order cannot be reversed as the filter block +is expected to be freed after flushing all the chains. + +[1] +unreferenced object 0xffff888107e28800 (size 2048): + comm "tc", pid 1079, jiffies 4294958525 (age 3074.287s) + hex dump (first 32 bytes): + b1 a6 7c 11 81 88 ff ff e0 5b b3 10 81 88 ff ff ..|......[...... + 01 00 00 00 00 00 00 00 e0 aa b0 84 ff ff ff ff ................ + backtrace: + [] __kmem_cache_alloc_node+0x1e8/0x320 + [] __kmalloc+0x4e/0x90 + [] mlxsw_sp_acl_ruleset_get+0x34d/0x7a0 + [] mlxsw_sp_flower_tmplt_create+0x145/0x180 + [] mlxsw_sp_flow_block_cb+0x1ea/0x280 + [] tc_setup_cb_call+0x183/0x340 + [] fl_tmplt_create+0x3da/0x4c0 + [] tc_ctl_chain+0xa15/0x1170 + [] rtnetlink_rcv_msg+0x3cc/0xed0 + [] netlink_rcv_skb+0x170/0x440 + [] netlink_unicast+0x540/0x820 + [] netlink_sendmsg+0x8d8/0xda0 + [] ____sys_sendmsg+0x30f/0xa80 + [] ___sys_sendmsg+0x13a/0x1e0 + [] __sys_sendmsg+0x11c/0x1f0 + [] do_syscall_64+0x40/0xe0 +unreferenced object 0xffff88816d2c0400 (size 1024): + comm "tc", pid 1079, jiffies 4294958525 (age 3074.287s) + hex dump (first 32 bytes): + 40 00 00 00 00 00 00 00 57 f6 38 be 00 00 00 00 @.......W.8..... + 10 04 2c 6d 81 88 ff ff 10 04 2c 6d 81 88 ff ff ..,m......,m.... + backtrace: + [] __kmem_cache_alloc_node+0x1e8/0x320 + [] __kmalloc_node+0x51/0x90 + [] kvmalloc_node+0xa6/0x1f0 + [] bucket_table_alloc.isra.0+0x83/0x460 + [] rhashtable_init+0x43b/0x7c0 + [] mlxsw_sp_acl_ruleset_get+0x428/0x7a0 + [] mlxsw_sp_flower_tmplt_create+0x145/0x180 + [] mlxsw_sp_flow_block_cb+0x1ea/0x280 + [] tc_setup_cb_call+0x183/0x340 + [] fl_tmplt_create+0x3da/0x4c0 + [] tc_ctl_chain+0xa15/0x1170 + [] rtnetlink_rcv_msg+0x3cc/0xed0 + [] netlink_rcv_skb+0x170/0x440 + [] netlink_unicast+0x540/0x820 + [] netlink_sendmsg+0x8d8/0xda0 + [] ____sys_sendmsg+0x30f/0xa80 + +[2] + # tc qdisc add dev swp1 clsact + # tc chain add dev swp1 ingress proto ip chain 1 flower dst_ip 0.0.0.0/32 + # tc qdisc del dev swp1 clsact + # devlink dev reload pci/0000:06:00.0 + +Fixes: bbf73830cd48 ("net: sched: traverse chains in block with tcf_get_next_chain()") +Signed-off-by: Ido Schimmel +Signed-off-by: David S. Miller +Signed-off-by: Vamsi Krishna Brahmajosyula +--- + include/net/sch_generic.h | 4 ++++ + net/sched/cls_api.c | 9 ++++++++- + net/sched/cls_flower.c | 23 +++++++++++++++++++++++ + 3 files changed, 35 insertions(+), 1 deletion(-) + +diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h +index b34e9e93a146..cc14b41a4e72 100644 +--- a/include/net/sch_generic.h ++++ b/include/net/sch_generic.h +@@ -377,6 +377,10 @@ struct tcf_proto_ops { + struct nlattr **tca, + struct netlink_ext_ack *extack); + void (*tmplt_destroy)(void *tmplt_priv); ++ void (*tmplt_reoffload)(struct tcf_chain *chain, ++ bool add, ++ flow_setup_cb_t *cb, ++ void *cb_priv); + + /* rtnetlink specific */ + int (*dump)(struct net*, struct tcf_proto*, void *, +diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c +index 89da596be1b8..8548220b6112 100644 +--- a/net/sched/cls_api.c ++++ b/net/sched/cls_api.c +@@ -1431,6 +1431,9 @@ tcf_block_playback_offloads(struct tcf_block *block, flow_setup_cb_t *cb, + chain_prev = chain, + chain = __tcf_get_next_chain(block, chain), + tcf_chain_put(chain_prev)) { ++ if (chain->tmplt_ops && add) ++ chain->tmplt_ops->tmplt_reoffload(chain, true, cb, ++ cb_priv); + for (tp = __tcf_get_next_proto(chain, NULL); tp; + tp_prev = tp, + tp = __tcf_get_next_proto(chain, tp), +@@ -1446,6 +1449,9 @@ tcf_block_playback_offloads(struct tcf_block *block, flow_setup_cb_t *cb, + goto err_playback_remove; + } + } ++ if (chain->tmplt_ops && !add) ++ chain->tmplt_ops->tmplt_reoffload(chain, false, cb, ++ cb_priv); + } + + return 0; +@@ -2832,7 +2838,8 @@ static int tc_chain_tmplt_add(struct tcf_chain *chain, struct net *net, + ops = tcf_proto_lookup_ops(name, true, extack); + if (IS_ERR(ops)) + return PTR_ERR(ops); +- if (!ops->tmplt_create || !ops->tmplt_destroy || !ops->tmplt_dump) { ++ if (!ops->tmplt_create || !ops->tmplt_destroy || !ops->tmplt_dump || ++ !ops->tmplt_reoffload) { + NL_SET_ERR_MSG(extack, "Chain templates are not supported with specified classifier"); + module_put(ops->owner); + return -EOPNOTSUPP; +diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c +index a40a9e84c75f..42234a0101e7 100644 +--- a/net/sched/cls_flower.c ++++ b/net/sched/cls_flower.c +@@ -2596,6 +2596,28 @@ static void fl_tmplt_destroy(void *tmplt_priv) + kfree(tmplt); + } + ++static void fl_tmplt_reoffload(struct tcf_chain *chain, bool add, ++ flow_setup_cb_t *cb, void *cb_priv) ++{ ++ struct fl_flow_tmplt *tmplt = chain->tmplt_priv; ++ struct flow_cls_offload cls_flower = {}; ++ ++ cls_flower.rule = flow_rule_alloc(0); ++ if (!cls_flower.rule) ++ return; ++ ++ cls_flower.common.chain_index = chain->index; ++ cls_flower.command = add ? FLOW_CLS_TMPLT_CREATE : ++ FLOW_CLS_TMPLT_DESTROY; ++ cls_flower.cookie = (unsigned long) tmplt; ++ cls_flower.rule->match.dissector = &tmplt->dissector; ++ cls_flower.rule->match.mask = &tmplt->mask; ++ cls_flower.rule->match.key = &tmplt->dummy_key; ++ ++ cb(TC_SETUP_CLSFLOWER, &cls_flower, cb_priv); ++ kfree(cls_flower.rule); ++} ++ + static int fl_dump_key_val(struct sk_buff *skb, + void *val, int val_type, + void *mask, int mask_type, int len) +@@ -3452,6 +3474,7 @@ static struct tcf_proto_ops cls_fl_ops __read_mostly = { + .bind_class = fl_bind_class, + .tmplt_create = fl_tmplt_create, + .tmplt_destroy = fl_tmplt_destroy, ++ .tmplt_reoffload = fl_tmplt_reoffload, + .tmplt_dump = fl_tmplt_dump, + .owner = THIS_MODULE, + .flags = TCF_PROTO_OPS_DOIT_UNLOCKED, +-- +2.49.0 + diff --git a/SPECS/linux/6.1/CVE/0001-net-sched-sch_netem-fix-out-of-bounds-access-in-pack.patch b/SPECS/linux/6.1/CVE/0001-net-sched-sch_netem-fix-out-of-bounds-access-in-pack.patch new file mode 100644 index 0000000000..44b5c397a0 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-net-sched-sch_netem-fix-out-of-bounds-access-in-pack.patch @@ -0,0 +1,55 @@ +From d64cb81dcbd54927515a7f65e5e24affdc73c14b Mon Sep 17 00:00:01 2001 +From: Yucheng Lu +Date: Tue, 31 Mar 2026 16:00:21 +0800 +Subject: [PATCH] net/sched: sch_netem: fix out-of-bounds access in packet corruption + +[ Upstream commit d64cb81dcbd54927515a7f65e5e24affdc73c14b ] + +In netem_enqueue(), the packet corruption logic uses +get_random_u32_below(skb_headlen(skb)) to select an index for +modifying skb->data. When an AF_PACKET TX_RING sends fully non-linear +packets over an IPIP tunnel, skb_headlen(skb) evaluates to 0. + +Passing 0 to get_random_u32_below() takes the variable-ceil slow path +which returns an unconstrained 32-bit random integer. Using this +unconstrained value as an offset into skb->data results in an +out-of-bounds memory access. + +Fix this by verifying skb_headlen(skb) is non-zero before attempting +to corrupt the linear data area. Fully non-linear packets will silently +bypass the corruption logic. + +Fixes: c865e5d99e25 ("[PKT_SCHED] netem: packet corruption option") +Reported-by: Yifan Wu +Reported-by: Juefei Pu +Signed-off-by: Yuan Tan +Signed-off-by: Xin Liu +Signed-off-by: Yuhang Zheng +Signed-off-by: Yucheng Lu +Reviewed-by: Stephen Hemminger +Link: https://patch.msgid.link/45435c0935df877853a81e6d06205ac738ec65fa.1774941614.git.kanolyc@gmail.com +Signed-off-by: Jakub Kicinski +[Ankit: Backported for v6.1.175. v6.1.x uses prandom_u32_max() in place of get_random_u32_below()] +Signed-off-by: Ankit Jain +--- + net/sched/sch_netem.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c +index 2c47bd8dba64..5d6e928ab750 100644 +--- a/net/sched/sch_netem.c ++++ b/net/sched/sch_netem.c +@@ -508,8 +508,9 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch, + goto finish_segs; + } + +- skb->data[prandom_u32_max(skb_headlen(skb))] ^= +- 1<data[prandom_u32_max(skb_headlen(skb))] ^= ++ 1 << prandom_u32_max(8); + } + + if (unlikely(sch->q.qlen >= sch->limit)) { +-- +2.39.5 diff --git a/SPECS/91/linux/CVE/0001-net-vxlan-prevent-NULL-deref-in-vxlan_xmit_one.patch b/SPECS/linux/6.1/CVE/0001-net-vxlan-prevent-NULL-deref-in-vxlan_xmit_one-6.1.patch similarity index 73% rename from SPECS/91/linux/CVE/0001-net-vxlan-prevent-NULL-deref-in-vxlan_xmit_one.patch rename to SPECS/linux/6.1/CVE/0001-net-vxlan-prevent-NULL-deref-in-vxlan_xmit_one-6.1.patch index 1b492fead3..e706ca4720 100644 --- a/SPECS/91/linux/CVE/0001-net-vxlan-prevent-NULL-deref-in-vxlan_xmit_one.patch +++ b/SPECS/linux/6.1/CVE/0001-net-vxlan-prevent-NULL-deref-in-vxlan_xmit_one-6.1.patch @@ -1,7 +1,7 @@ -From 4ac26aafdc8c7271414e2e7c0b2cb266a26591bc Mon Sep 17 00:00:00 2001 +From ac8f43b9bb383bf62a07986e2f7914675c8e543d Mon Sep 17 00:00:00 2001 From: Antoine Tenart Date: Wed, 26 Nov 2025 11:26:25 +0100 -Subject: net: vxlan: prevent NULL deref in vxlan_xmit_one +Subject: [PATCH] net: vxlan: prevent NULL deref in vxlan_xmit_one [ Upstream commit 1f73a56f986005f0bc64ed23873930e2ee4f5911 ] @@ -36,55 +36,56 @@ Tested-by: Ido Schimmel Link: https://patch.msgid.link/20251126102627.74223-1-atenart@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin -[Shivani: Backported for CVE-2025-68353. Modified to apply on 6.12.y. - This kernel has no per-drop-reason tracking in vxlan_xmit_one(), so - the new NULL checks use the existing int err/goto tx_error error path - with -ENOTCONN instead of SKB_DROP_REASON_DEV_READY. ] +[Shivani: Modified to apply on 6.1.y] Signed-off-by: Shivani Agarwal --- - drivers/net/vxlan/vxlan_core.c | 16 ++++++++++++++-- - 1 file changed, 14 insertions(+), 2 deletions(-) + drivers/net/vxlan/vxlan_core.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c -index 765d25eee..9475e1e29 100644 +index 50dacdc1b..a4490d795 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c -@@ -2481,11 +2481,17 @@ void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, +@@ -2527,7 +2527,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, + struct dst_entry *ndst = NULL; + __u8 tos, ttl, flow_flags = 0; + int ifindex; +- int err; ++ int err = 0; + u32 flags = vxlan->cfg.flags; + bool udp_sum = false; + bool xnet = !net_eq(vxlan->net, dev_net(vxlan->dev)); +@@ -2612,10 +2612,15 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, rcu_read_lock(); - if (addr_family == AF_INET) { + if (dst->sa.sa_family == AF_INET) { - struct vxlan_sock *sock4 = rcu_dereference(vxlan->vn4_sock); + struct vxlan_sock *sock4; struct rtable *rt; __be16 df = 0; - __be32 saddr; + sock4 = rcu_dereference(vxlan->vn4_sock); + if (unlikely(!sock4)) { -+ err = -ENOTCONN; + goto tx_error; + } + if (!ifindex) ifindex = sock4->sock->sk->sk_bound_dev_if; -@@ -2553,9 +2559,15 @@ void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, +@@ -2687,7 +2692,12 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, src_port, dst_port, xnet, !udp_sum); #if IS_ENABLED(CONFIG_IPV6) } else { - struct vxlan_sock *sock6 = rcu_dereference(vxlan->vn6_sock); + struct vxlan_sock *sock6; - struct in6_addr saddr; - ++ + sock6 = rcu_dereference(vxlan->vn6_sock); + if (unlikely(!sock6)) { -+ err = -ENOTCONN; + goto tx_error; + } -+ + if (!ifindex) ifindex = sock6->sock->sk->sk_bound_dev_if; - -- -2.53.0 +2.43.7 diff --git a/SPECS/linux/6.1/CVE/0001-nvmet-move-async-event-work-off-nvmet-wq.patch b/SPECS/linux/6.1/CVE/0001-nvmet-move-async-event-work-off-nvmet-wq.patch new file mode 100644 index 0000000000..9ebbcc85bf --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-nvmet-move-async-event-work-off-nvmet-wq.patch @@ -0,0 +1,180 @@ +From 4fbe42a2c5693a6372e2647622bea92acd9f098d Mon Sep 17 00:00:00 2001 +From: Chaitanya Kulkarni +Date: Wed, 25 Feb 2026 20:30:03 -0800 +Subject: [PATCH] nvmet: move async event work off nvmet-wq + +[ Upstream commit 2922e3507f6d5caa7f1d07f145e186fc6f317a4e ] + +For target nvmet_ctrl_free() flushes ctrl->async_event_work. +If nvmet_ctrl_free() runs on nvmet-wq, the flush re-enters workqueue +completion for the same worker:- + +A. Async event work queued on nvmet-wq (prior to disconnect): + nvmet_execute_async_event() + queue_work(nvmet_wq, &ctrl->async_event_work) + + nvmet_add_async_event() + queue_work(nvmet_wq, &ctrl->async_event_work) + +B. Full pre-work chain (RDMA CM path): + nvmet_rdma_cm_handler() + nvmet_rdma_queue_disconnect() + __nvmet_rdma_queue_disconnect() + queue_work(nvmet_wq, &queue->release_work) + process_one_work() + lock((wq_completion)nvmet-wq) <--------- 1st + nvmet_rdma_release_queue_work() + +C. Recursive path (same worker): + nvmet_rdma_release_queue_work() + nvmet_rdma_free_queue() + nvmet_sq_destroy() + nvmet_ctrl_put() + nvmet_ctrl_free() + flush_work(&ctrl->async_event_work) + __flush_work() + touch_wq_lockdep_map() + lock((wq_completion)nvmet-wq) <--------- 2nd + +Lockdep splat: + + ============================================ + WARNING: possible recursive locking detected + 6.19.0-rc3nvme+ #14 Tainted: G N + -------------------------------------------- + kworker/u192:42/44933 is trying to acquire lock: + ffff888118a00948 ((wq_completion)nvmet-wq){+.+.}-{0:0}, at: touch_wq_lockdep_map+0x26/0x90 + + but task is already holding lock: + ffff888118a00948 ((wq_completion)nvmet-wq){+.+.}-{0:0}, at: process_one_work+0x53e/0x660 + + 3 locks held by kworker/u192:42/44933: + #0: ffff888118a00948 ((wq_completion)nvmet-wq){+.+.}-{0:0}, at: process_one_work+0x53e/0x660 + #1: ffffc9000e6cbe28 ((work_completion)(&queue->release_work)){+.+.}-{0:0}, at: process_one_work+0x1c5/0x660 + #2: ffffffff82d4db60 (rcu_read_lock){....}-{1:3}, at: __flush_work+0x62/0x530 + + Workqueue: nvmet-wq nvmet_rdma_release_queue_work [nvmet_rdma] + Call Trace: + __flush_work+0x268/0x530 + nvmet_ctrl_free+0x140/0x310 [nvmet] + nvmet_cq_put+0x74/0x90 [nvmet] + nvmet_rdma_free_queue+0x23/0xe0 [nvmet_rdma] + nvmet_rdma_release_queue_work+0x19/0x50 [nvmet_rdma] + process_one_work+0x206/0x660 + worker_thread+0x184/0x320 + kthread+0x10c/0x240 + ret_from_fork+0x319/0x390 + +Move async event work to a dedicated nvmet-aen-wq to avoid reentrant +flush on nvmet-wq. + +Reviewed-by: Christoph Hellwig +Signed-off-by: Chaitanya Kulkarni +Signed-off-by: Keith Busch +Signed-off-by: Sasha Levin +[Brennan: linux-6.1.y lacks nvmet_init_debugfs(); nvmet_aen_wq is + allocated before nvmet_init_discovery() instead of nvmet_init_debugfs(), + and the error unwind labels are adjusted accordingly.] +Signed-off-by: Brennan Lamoreaux +--- + drivers/nvme/target/admin-cmd.c | 2 +- + drivers/nvme/target/core.c | 14 ++++++++++++-- + drivers/nvme/target/nvmet.h | 1 + + drivers/nvme/target/rdma.c | 1 + + 4 files changed, 15 insertions(+), 3 deletions(-) + +diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c +index 31d35279b37a..0d83afae0653 100644 +--- a/drivers/nvme/target/admin-cmd.c ++++ b/drivers/nvme/target/admin-cmd.c +@@ -988,7 +988,7 @@ void nvmet_execute_async_event(struct nvmet_req *req) + ctrl->async_event_cmds[ctrl->nr_async_event_cmds++] = req; + mutex_unlock(&ctrl->lock); + +- queue_work(nvmet_wq, &ctrl->async_event_work); ++ queue_work(nvmet_aen_wq, &ctrl->async_event_work); + } + + void nvmet_execute_keep_alive(struct nvmet_req *req) +diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c +index d2389918b1e8..e92db8504780 100644 +--- a/drivers/nvme/target/core.c ++++ b/drivers/nvme/target/core.c +@@ -23,6 +23,8 @@ static DEFINE_IDA(cntlid_ida); + + struct workqueue_struct *nvmet_wq; + EXPORT_SYMBOL_GPL(nvmet_wq); ++struct workqueue_struct *nvmet_aen_wq; ++EXPORT_SYMBOL_GPL(nvmet_aen_wq); + + /* + * This read/write semaphore is used to synchronize access to configuration +@@ -209,7 +211,7 @@ void nvmet_add_async_event(struct nvmet_ctrl *ctrl, u8 event_type, + list_add_tail(&aen->entry, &ctrl->async_events); + mutex_unlock(&ctrl->lock); + +- queue_work(nvmet_wq, &ctrl->async_event_work); ++ queue_work(nvmet_aen_wq, &ctrl->async_event_work); + } + + static void nvmet_add_to_changed_ns_log(struct nvmet_ctrl *ctrl, __le32 nsid) +@@ -1670,9 +1672,14 @@ static int __init nvmet_init(void) + if (!nvmet_wq) + goto out_free_buffered_work_queue; + ++ nvmet_aen_wq = alloc_workqueue("nvmet-aen-wq", ++ WQ_MEM_RECLAIM | WQ_UNBOUND, 0); ++ if (!nvmet_aen_wq) ++ goto out_free_nvmet_work_queue; ++ + error = nvmet_init_discovery(); + if (error) +- goto out_free_nvmet_work_queue; ++ goto out_free_nvmet_aen_work_queue; + + error = nvmet_init_configfs(); + if (error) +@@ -1681,6 +1688,8 @@ static int __init nvmet_init(void) + + out_exit_discovery: + nvmet_exit_discovery(); ++out_free_nvmet_aen_work_queue: ++ destroy_workqueue(nvmet_aen_wq); + out_free_nvmet_work_queue: + destroy_workqueue(nvmet_wq); + out_free_buffered_work_queue: +@@ -1697,6 +1706,7 @@ static void __exit nvmet_exit(void) + nvmet_exit_configfs(); + nvmet_exit_discovery(); + ida_destroy(&cntlid_ida); ++ destroy_workqueue(nvmet_aen_wq); + destroy_workqueue(nvmet_wq); + destroy_workqueue(buffered_io_wq); + destroy_workqueue(zbd_wq); +diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h +index 6aee0ce60a4b..66c61d3822c2 100644 +--- a/drivers/nvme/target/nvmet.h ++++ b/drivers/nvme/target/nvmet.h +@@ -397,6 +397,7 @@ extern struct kmem_cache *nvmet_bvec_cache; + extern struct workqueue_struct *buffered_io_wq; + extern struct workqueue_struct *zbd_wq; + extern struct workqueue_struct *nvmet_wq; ++extern struct workqueue_struct *nvmet_aen_wq; + + static inline void nvmet_set_result(struct nvmet_req *req, u32 result) + { +diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c +index 298c46834a53..5942949c18af 100644 +--- a/drivers/nvme/target/rdma.c ++++ b/drivers/nvme/target/rdma.c +@@ -2059,6 +2059,7 @@ static void nvmet_rdma_remove_one(struct ib_device *ib_device, void *client_data + mutex_unlock(&nvmet_rdma_queue_mutex); + + flush_workqueue(nvmet_wq); ++ flush_workqueue(nvmet_aen_wq); + } + + static struct ib_client nvmet_rdma_ib_client = { +-- +2.53.0 + diff --git a/SPECS/linux/6.1/CVE/0001-rcu-Fix-rcu_read_unlock-deadloop-due-to-IRQ-work.patch b/SPECS/linux/6.1/CVE/0001-rcu-Fix-rcu_read_unlock-deadloop-due-to-IRQ-work.patch new file mode 100644 index 0000000000..8ae22300ee --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-rcu-Fix-rcu_read_unlock-deadloop-due-to-IRQ-work.patch @@ -0,0 +1,159 @@ +From f64f1b582ecca00fc265570ef35ba085193da1b4 Mon Sep 17 00:00:00 2001 +From: Joel Fernandes +Date: Tue, 8 Jul 2025 10:22:19 -0400 +Subject: [PATCH 1/2] rcu: Fix rcu_read_unlock() deadloop due to IRQ work + +[ Upstream commit b41642c87716bbd09797b1e4ea7d904f06c39b7b ] + +During rcu_read_unlock_special(), if this happens during irq_exit(), we +can lockup if an IPI is issued. This is because the IPI itself triggers +the irq_exit() path causing a recursive lock up. + +This is precisely what Xiongfeng found when invoking a BPF program on +the trace_tick_stop() tracepoint As shown in the trace below. Fix by +managing the irq_work state correctly. + +irq_exit() + __irq_exit_rcu() + /* in_hardirq() returns false after this */ + preempt_count_sub(HARDIRQ_OFFSET) + tick_irq_exit() + tick_nohz_irq_exit() + tick_nohz_stop_sched_tick() + trace_tick_stop() /* a bpf prog is hooked on this trace point */ + __bpf_trace_tick_stop() + bpf_trace_run2() + rcu_read_unlock_special() + /* will send a IPI to itself */ + irq_work_queue_on(&rdp->defer_qs_iw, rdp->cpu); + +A simple reproducer can also be obtained by doing the following in +tick_irq_exit(). It will hang on boot without the patch: + + static inline void tick_irq_exit(void) + { + + rcu_read_lock(); + + WRITE_ONCE(current->rcu_read_unlock_special.b.need_qs, true); + + rcu_read_unlock(); + + + +Reported-by: Xiongfeng Wang +Closes: https://lore.kernel.org/all/9acd5f9f-6732-7701-6880-4b51190aa070@huawei.com/ +Tested-by: Qi Xi +Signed-off-by: Joel Fernandes +Reviewed-by: "Paul E. McKenney" +Reported-by: Linux Kernel Functional Testing +[neeraj: Apply Frederic's suggested fix for PREEMPT_RT] +Signed-off-by: Neeraj Upadhyay (AMD) +Signed-off-by: Sasha Levin +[Ankit: Backported for v6.1] +Signed-off-by: Ankit Jain +--- + kernel/rcu/tree.h | 13 ++++++++++++- + kernel/rcu/tree_plugin.h | 37 ++++++++++++++++++++++++++----------- + 2 files changed, 38 insertions(+), 12 deletions(-) + +diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h +index aa16d3cd62ba..4770ff998f27 100644 +--- a/kernel/rcu/tree.h ++++ b/kernel/rcu/tree.h +@@ -158,6 +158,17 @@ union rcu_noqs { + u16 s; /* Set of bits, aggregate OR here. */ + }; + ++/* ++ * An IRQ work (deferred_qs_iw) is used by RCU to get the scheduler's attention. ++ * to report quiescent states at the soonest possible time. ++ * The request can be in one of the following states: ++ * - DEFER_QS_IDLE: An IRQ work is yet to be scheduled. ++ * - DEFER_QS_PENDING: An IRQ work was scheduled but either not yet run, or it ++ * ran and we still haven't reported a quiescent state. ++ */ ++#define DEFER_QS_IDLE 0 ++#define DEFER_QS_PENDING 1 ++ + /* Per-CPU data for read-copy update. */ + struct rcu_data { + /* 1) quiescent-state and grace-period handling : */ +@@ -175,7 +186,7 @@ struct rcu_data { + /* during and after the last grace */ + /* period it is aware of. */ + struct irq_work defer_qs_iw; /* Obtain later scheduler attention. */ +- bool defer_qs_iw_pending; /* Scheduler attention pending? */ ++ int defer_qs_iw_pending; /* Scheduler attention pending? */ + struct work_struct strict_work; /* Schedule readers for strict GPs. */ + + /* 2) batch handling */ +diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h +index 6fc1ff14bfdf..e61ade810935 100644 +--- a/kernel/rcu/tree_plugin.h ++++ b/kernel/rcu/tree_plugin.h +@@ -474,13 +474,16 @@ rcu_preempt_deferred_qs_irqrestore(struct task_struct *t, unsigned long flags) + struct rcu_node *rnp; + union rcu_special special; + ++ rdp = this_cpu_ptr(&rcu_data); ++ if (rdp->defer_qs_iw_pending == DEFER_QS_PENDING) ++ rdp->defer_qs_iw_pending = DEFER_QS_IDLE; ++ + /* + * If RCU core is waiting for this CPU to exit its critical section, + * report the fact that it has exited. Because irqs are disabled, + * t->rcu_read_unlock_special cannot change. + */ + special = t->rcu_read_unlock_special; +- rdp = this_cpu_ptr(&rcu_data); + if (!special.s && !rdp->cpu_no_qs.b.exp) { + local_irq_restore(flags); + return; +@@ -617,7 +620,23 @@ static void rcu_preempt_deferred_qs_handler(struct irq_work *iwp) + + rdp = container_of(iwp, struct rcu_data, defer_qs_iw); + local_irq_save(flags); +- rdp->defer_qs_iw_pending = false; ++ ++ /* ++ * If the IRQ work handler happens to run in the middle of RCU read-side ++ * critical section, it could be ineffective in getting the scheduler's ++ * attention to report a deferred quiescent state (the whole point of the ++ * IRQ work). For this reason, requeue the IRQ work. ++ * ++ * Basically, we want to avoid following situation: ++ * 1. rcu_read_unlock() queues IRQ work (state -> DEFER_QS_PENDING) ++ * 2. CPU enters new rcu_read_lock() ++ * 3. IRQ work runs but cannot report QS due to rcu_preempt_depth() > 0 ++ * 4. rcu_read_unlock() does not re-queue work (state still PENDING) ++ * 5. Deferred QS reporting does not happen. ++ */ ++ if (rcu_preempt_depth() > 0) ++ WRITE_ONCE(rdp->defer_qs_iw_pending, DEFER_QS_IDLE); ++ + local_irq_restore(flags); + } + +@@ -664,17 +683,13 @@ static void rcu_read_unlock_special(struct task_struct *t) + set_tsk_need_resched(current); + set_preempt_need_resched(); + if (IS_ENABLED(CONFIG_IRQ_WORK) && irqs_were_disabled && +- expboost && !rdp->defer_qs_iw_pending && cpu_online(rdp->cpu)) { ++ expboost && rdp->defer_qs_iw_pending != DEFER_QS_PENDING && ++ cpu_online(rdp->cpu)) { + // Get scheduler to re-evaluate and call hooks. + // If !IRQ_WORK, FQS scan will eventually IPI. +- if (IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD) && +- IS_ENABLED(CONFIG_PREEMPT_RT)) +- rdp->defer_qs_iw = IRQ_WORK_INIT_HARD( +- rcu_preempt_deferred_qs_handler); +- else +- init_irq_work(&rdp->defer_qs_iw, +- rcu_preempt_deferred_qs_handler); +- rdp->defer_qs_iw_pending = true; ++ rdp->defer_qs_iw = ++ IRQ_WORK_INIT_HARD(rcu_preempt_deferred_qs_handler); ++ rdp->defer_qs_iw_pending = DEFER_QS_PENDING; + irq_work_queue_on(&rdp->defer_qs_iw, rdp->cpu); + } + } +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-rv-Use-strings-in-da-monitors-tracepoints.patch b/SPECS/linux/6.1/CVE/0001-rv-Use-strings-in-da-monitors-tracepoints.patch new file mode 100644 index 0000000000..5961741182 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-rv-Use-strings-in-da-monitors-tracepoints.patch @@ -0,0 +1,190 @@ +From fc8d29da25c710b1e05d488f3b761995819c6d17 Mon Sep 17 00:00:00 2001 +From: Ajay Kaher +Date: Wed, 26 Nov 2025 09:00:43 +0000 +Subject: [PATCH] rv: Use strings in da monitors tracepoints + +From: Gabriele Monaco + +[ Upstream commit 7f904ff6e58d398c4336f3c19c42b338324451f7 ] + +Using DA monitors tracepoints with KASAN enabled triggers the following +warning: + + BUG: KASAN: global-out-of-bounds in do_trace_event_raw_event_event_da_monitor+0xd6/0x1a0 + Read of size 32 at addr ffffffffaada8980 by task ... + Call Trace: + + [...] + do_trace_event_raw_event_event_da_monitor+0xd6/0x1a0 + ? __pfx_do_trace_event_raw_event_event_da_monitor+0x10/0x10 + ? trace_event_sncid+0x83/0x200 + trace_event_sncid+0x163/0x200 + [...] + The buggy address belongs to the variable: + automaton_snep+0x4e0/0x5e0 + +This is caused by the tracepoints reading 32 bytes __array instead of +__string from the automata definition. Such strings are literals and +reading 32 bytes ends up in out of bound memory accesses (e.g. the next +automaton's data in this case). +The error is harmless as, while printing the string, we stop at the null +terminator, but it should still be fixed. + +Use the __string facilities while defining the tracepoints to avoid +reading out of bound memory. + +Cc: Masami Hiramatsu +Cc: Ingo Molnar +Cc: Peter Zijlstra +Cc: Tomas Glozar +Cc: Juri Lelli +Cc: Clark Williams +Cc: John Kacur +Link: https://lore.kernel.org/20250728135022.255578-4-gmonaco@redhat.com +Fixes: 792575348ff7 ("rv/include: Add deterministic automata monitor definition via C macros") +Reviewed-by: Nam Cao +Signed-off-by: Gabriele Monaco +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Sasha Levin +Signed-off-by: Ajay Kaher +--- + include/trace/events/rv.h | 76 +++++++++++++++++++-------------------- + 1 file changed, 38 insertions(+), 38 deletions(-) + +diff --git a/include/trace/events/rv.h b/include/trace/events/rv.h +index 56592da93..89b59b154 100644 +--- a/include/trace/events/rv.h ++++ b/include/trace/events/rv.h +@@ -16,23 +16,23 @@ DECLARE_EVENT_CLASS(event_da_monitor, + TP_ARGS(state, event, next_state, final_state), + + TP_STRUCT__entry( +- __array( char, state, MAX_DA_NAME_LEN ) +- __array( char, event, MAX_DA_NAME_LEN ) +- __array( char, next_state, MAX_DA_NAME_LEN ) +- __field( bool, final_state ) ++ __string( state, state ) ++ __string( event, event ) ++ __string( next_state, next_state ) ++ __field( bool, final_state ) + ), + + TP_fast_assign( +- memcpy(__entry->state, state, MAX_DA_NAME_LEN); +- memcpy(__entry->event, event, MAX_DA_NAME_LEN); +- memcpy(__entry->next_state, next_state, MAX_DA_NAME_LEN); +- __entry->final_state = final_state; ++ __assign_str(state); ++ __assign_str(event); ++ __assign_str(next_state); ++ __entry->final_state = final_state; + ), + + TP_printk("%s x %s -> %s %s", +- __entry->state, +- __entry->event, +- __entry->next_state, ++ __get_str(state), ++ __get_str(event), ++ __get_str(next_state), + __entry->final_state ? "(final)" : "") + ); + +@@ -43,18 +43,18 @@ DECLARE_EVENT_CLASS(error_da_monitor, + TP_ARGS(state, event), + + TP_STRUCT__entry( +- __array( char, state, MAX_DA_NAME_LEN ) +- __array( char, event, MAX_DA_NAME_LEN ) ++ __string( state, state ) ++ __string( event, event ) + ), + + TP_fast_assign( +- memcpy(__entry->state, state, MAX_DA_NAME_LEN); +- memcpy(__entry->event, event, MAX_DA_NAME_LEN); ++ __assign_str(state); ++ __assign_str(event); + ), + + TP_printk("event %s not expected in the state %s", +- __entry->event, +- __entry->state) ++ __get_str(event), ++ __get_str(state)) + ); + + #ifdef CONFIG_RV_MON_WIP +@@ -76,26 +76,26 @@ DECLARE_EVENT_CLASS(event_da_monitor_id, + TP_ARGS(id, state, event, next_state, final_state), + + TP_STRUCT__entry( +- __field( int, id ) +- __array( char, state, MAX_DA_NAME_LEN ) +- __array( char, event, MAX_DA_NAME_LEN ) +- __array( char, next_state, MAX_DA_NAME_LEN ) +- __field( bool, final_state ) ++ __field( int, id ) ++ __string( state, state ) ++ __string( event, event ) ++ __string( next_state, next_state ) ++ __field( bool, final_state ) + ), + + TP_fast_assign( +- memcpy(__entry->state, state, MAX_DA_NAME_LEN); +- memcpy(__entry->event, event, MAX_DA_NAME_LEN); +- memcpy(__entry->next_state, next_state, MAX_DA_NAME_LEN); +- __entry->id = id; +- __entry->final_state = final_state; ++ __assign_str(state); ++ __assign_str(event); ++ __assign_str(next_state); ++ __entry->id = id; ++ __entry->final_state = final_state; + ), + + TP_printk("%d: %s x %s -> %s %s", + __entry->id, +- __entry->state, +- __entry->event, +- __entry->next_state, ++ __get_str(state), ++ __get_str(event), ++ __get_str(next_state), + __entry->final_state ? "(final)" : "") + ); + +@@ -106,21 +106,21 @@ DECLARE_EVENT_CLASS(error_da_monitor_id, + TP_ARGS(id, state, event), + + TP_STRUCT__entry( +- __field( int, id ) +- __array( char, state, MAX_DA_NAME_LEN ) +- __array( char, event, MAX_DA_NAME_LEN ) ++ __field( int, id ) ++ __string( state, state ) ++ __string( event, event ) + ), + + TP_fast_assign( +- memcpy(__entry->state, state, MAX_DA_NAME_LEN); +- memcpy(__entry->event, event, MAX_DA_NAME_LEN); +- __entry->id = id; ++ __assign_str(state); ++ __assign_str(event); ++ __entry->id = id; + ), + + TP_printk("%d: event %s not expected in the state %s", + __entry->id, +- __entry->event, +- __entry->state) ++ __get_str(event), ++ __get_str(state)) + ); + + #ifdef CONFIG_RV_MON_WWNR +-- +2.40.4 + diff --git a/SPECS/91/linux/CVE/0001-scsi-qla2xxx-Completely-fix-fcport-do.patch b/SPECS/linux/6.1/CVE/0001-scsi-qla2xxx-Completely-fix-fcport-double-free.patch similarity index 71% rename from SPECS/91/linux/CVE/0001-scsi-qla2xxx-Completely-fix-fcport-do.patch rename to SPECS/linux/6.1/CVE/0001-scsi-qla2xxx-Completely-fix-fcport-double-free.patch index 7a328696af..ae89814c8e 100644 --- a/SPECS/91/linux/CVE/0001-scsi-qla2xxx-Completely-fix-fcport-do.patch +++ b/SPECS/linux/6.1/CVE/0001-scsi-qla2xxx-Completely-fix-fcport-double-free.patch @@ -1,12 +1,9 @@ -From c2e27bf916be26d20fc453ee6a94bdab54617f9a Mon Sep 17 00:00:00 2001 -From: Ajay Kaher -Date: Wed, 15 Jul 2026 09:34:57 +0000 -Subject: [PATCH] CVE-2026-43414: scsi: qla2xxx: Completely fix fcport double - free - +From 590a3745c99ceb8ba1a064134193a8090c780d0c Mon Sep 17 00:00:00 2001 From: Vladimir Riabchun +Date: Tue, 10 Feb 2026 11:08:22 +0100 +Subject: [PATCH] scsi: qla2xxx: Completely fix fcport double free -commit c0b7da13a04bd70ef6070bfb9ea85f582294560a upstream. +[ Upstream commit c0b7da13a04bd70ef6070bfb9ea85f582294560a ] In qla24xx_els_dcmd_iocb() sp->free is set to qla2x00_els_dcmd_sp_free(). When an error happens, this function is called by qla2x00_sp_release(), @@ -21,17 +18,16 @@ Signed-off-by: Vladimir Riabchun Signed-off-by: Farhat Abbas Link: https://patch.msgid.link/aYsDln9NFQQsPDgg@vova-pc Signed-off-by: Martin K. Petersen -[ Ajay: Modified to apply on v6.12 ] -Signed-off-by: Ajay Kaher +Signed-off-by: Sasha Levin --- drivers/scsi/qla2xxx/qla_iocb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c -index 0b41e8a06..faec66bd1 100644 +index 7bccd525ee19..d7facceea1eb 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c -@@ -2751,7 +2751,6 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, +@@ -2752,7 +2752,6 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, if (!elsio->u.els_logo.els_logo_pyld) { /* ref: INIT */ kref_put(&sp->cmd_kref, qla2x00_sp_release); @@ -39,7 +35,7 @@ index 0b41e8a06..faec66bd1 100644 return QLA_FUNCTION_FAILED; } -@@ -2776,7 +2775,6 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, +@@ -2777,7 +2776,6 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, if (rval != QLA_SUCCESS) { /* ref: INIT */ kref_put(&sp->cmd_kref, qla2x00_sp_release); @@ -48,5 +44,5 @@ index 0b41e8a06..faec66bd1 100644 } -- -2.53.0 +2.43.7 diff --git a/SPECS/linux/6.1/CVE/0001-smb-client-Fix-use-after-free-of-network-namespace.patch b/SPECS/linux/6.1/CVE/0001-smb-client-Fix-use-after-free-of-network-namespace.patch new file mode 100644 index 0000000000..9a61eafe13 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-smb-client-Fix-use-after-free-of-network-namespace.patch @@ -0,0 +1,204 @@ +From b65ddc79fb373a79822ceb22359c22746a6c875b Mon Sep 17 00:00:00 2001 +From: Kuniyuki Iwashima +Date: Mon, 29 Dec 2025 23:01:01 +0530 +Subject: [PATCH] smb: client: Fix use-after-free of network namespace. + +[ Upstream commit ef7134c7fc48e1441b398e55a862232868a6f0a7 ] + +Recently, we got a customer report that CIFS triggers oops while +reconnecting to a server. [0] + +The workload runs on Kubernetes, and some pods mount CIFS servers +in non-root network namespaces. The problem rarely happened, but +it was always while the pod was dying. + +The root cause is wrong reference counting for network namespace. + +CIFS uses kernel sockets, which do not hold refcnt of the netns that +the socket belongs to. That means CIFS must ensure the socket is +always freed before its netns; otherwise, use-after-free happens. + +The repro steps are roughly: + + 1. mount CIFS in a non-root netns + 2. drop packets from the netns + 3. destroy the netns + 4. unmount CIFS + +We can reproduce the issue quickly with the script [1] below and see +the splat [2] if CONFIG_NET_NS_REFCNT_TRACKER is enabled. + +When the socket is TCP, it is hard to guarantee the netns lifetime +without holding refcnt due to async timers. + +Let's hold netns refcnt for each socket as done for SMC in commit +9744d2bf1976 ("smc: Fix use-after-free in tcp_write_timer_handler()."). + +Note that we need to move put_net() from cifs_put_tcp_session() to +clean_demultiplex_info(); otherwise, __sock_create() still could touch a +freed netns while cifsd tries to reconnect from cifs_demultiplex_thread(). + +Also, maybe_get_net() cannot be put just before __sock_create() because +the code is not under RCU and there is a small chance that the same +address happened to be reallocated to another netns. + +[0]: +CIFS: VFS: \\XXXXXXXXXXX has not responded in 15 seconds. Reconnecting... +CIFS: Serverclose failed 4 times, giving up +Unable to handle kernel paging request at virtual address 14de99e461f84a07 +Mem abort info: + ESR = 0x0000000096000004 + EC = 0x25: DABT (current EL), IL = 32 bits + SET = 0, FnV = 0 + EA = 0, S1PTW = 0 + FSC = 0x04: level 0 translation fault +Data abort info: + ISV = 0, ISS = 0x00000004 + CM = 0, WnR = 0 +[14de99e461f84a07] address between user and kernel address ranges +Internal error: Oops: 0000000096000004 [#1] SMP +Modules linked in: cls_bpf sch_ingress nls_utf8 cifs cifs_arc4 cifs_md4 dns_resolver tcp_diag inet_diag veth xt_state xt_connmark nf_conntrack_netlink xt_nat xt_statistic xt_MASQUERADE xt_mark xt_addrtype ipt_REJECT nf_reject_ipv4 nft_chain_nat nf_nat xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 xt_comment nft_compat nf_tables nfnetlink overlay nls_ascii nls_cp437 sunrpc vfat fat aes_ce_blk aes_ce_cipher ghash_ce sm4_ce_cipher sm4 sm3_ce sm3 sha3_ce sha512_ce sha512_arm64 sha1_ce ena button sch_fq_codel loop fuse configfs dmi_sysfs sha2_ce sha256_arm64 dm_mirror dm_region_hash dm_log dm_mod dax efivarfs +CPU: 5 PID: 2690970 Comm: cifsd Not tainted 6.1.103-109.184.amzn2023.aarch64 #1 +Hardware name: Amazon EC2 r7g.4xlarge/, BIOS 1.0 11/1/2018 +pstate: 00400005 (nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) +pc : fib_rules_lookup+0x44/0x238 +lr : __fib_lookup+0x64/0xbc +sp : ffff8000265db790 +x29: ffff8000265db790 x28: 0000000000000000 x27: 000000000000bd01 +x26: 0000000000000000 x25: ffff000b4baf8000 x24: ffff00047b5e4580 +x23: ffff8000265db7e0 x22: 0000000000000000 x21: ffff00047b5e4500 +x20: ffff0010e3f694f8 x19: 14de99e461f849f7 x18: 0000000000000000 +x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 +x14: 0000000000000000 x13: 0000000000000000 x12: 3f92800abd010002 +x11: 0000000000000001 x10: ffff0010e3f69420 x9 : ffff800008a6f294 +x8 : 0000000000000000 x7 : 0000000000000006 x6 : 0000000000000000 +x5 : 0000000000000001 x4 : ffff001924354280 x3 : ffff8000265db7e0 +x2 : 0000000000000000 x1 : ffff0010e3f694f8 x0 : ffff00047b5e4500 +Call trace: + fib_rules_lookup+0x44/0x238 + __fib_lookup+0x64/0xbc + ip_route_output_key_hash_rcu+0x2c4/0x398 + ip_route_output_key_hash+0x60/0x8c + tcp_v4_connect+0x290/0x488 + __inet_stream_connect+0x108/0x3d0 + inet_stream_connect+0x50/0x78 + kernel_connect+0x6c/0xac + generic_ip_connect+0x10c/0x6c8 [cifs] + __reconnect_target_unlocked+0xa0/0x214 [cifs] + reconnect_dfs_server+0x144/0x460 [cifs] + cifs_reconnect+0x88/0x148 [cifs] + cifs_readv_from_socket+0x230/0x430 [cifs] + cifs_read_from_socket+0x74/0xa8 [cifs] + cifs_demultiplex_thread+0xf8/0x704 [cifs] + kthread+0xd0/0xd4 +Code: aa0003f8 f8480f13 eb18027f 540006c0 (b9401264) + +[1]: +CIFS_CRED="/root/cred.cifs" +CIFS_USER="Administrator" +CIFS_PASS="Password" +CIFS_IP="X.X.X.X" +CIFS_PATH="//${CIFS_IP}/Users/Administrator/Desktop/CIFS_TEST" +CIFS_MNT="/mnt/smb" +DEV="enp0s3" + +cat < ${CIFS_CRED} +username=${CIFS_USER} +password=${CIFS_PASS} +domain=EXAMPLE.COM +EOF + +unshare -n bash -c " +mkdir -p ${CIFS_MNT} +ip netns attach root 1 +ip link add eth0 type veth peer veth0 netns root +ip link set eth0 up +ip -n root link set veth0 up +ip addr add 192.168.0.2/24 dev eth0 +ip -n root addr add 192.168.0.1/24 dev veth0 +ip route add default via 192.168.0.1 dev eth0 +ip netns exec root sysctl net.ipv4.ip_forward=1 +ip netns exec root iptables -t nat -A POSTROUTING -s 192.168.0.2 -o ${DEV} -j MASQUERADE +mount -t cifs ${CIFS_PATH} ${CIFS_MNT} -o vers=3.0,sec=ntlmssp,credentials=${CIFS_CRED},rsize=65536,wsize=65536,cache=none,echo_interval=1 +touch ${CIFS_MNT}/a.txt +ip netns exec root iptables -t nat -D POSTROUTING -s 192.168.0.2 -o ${DEV} -j MASQUERADE +" + +umount ${CIFS_MNT} + +[2]: +ref_tracker: net notrefcnt@000000004bbc008d has 1/1 users at + sk_alloc (./include/net/net_namespace.h:339 net/core/sock.c:2227) + inet_create (net/ipv4/af_inet.c:326 net/ipv4/af_inet.c:252) + __sock_create (net/socket.c:1576) + generic_ip_connect (fs/smb/client/connect.c:3075) + cifs_get_tcp_session.part.0 (fs/smb/client/connect.c:3160 fs/smb/client/connect.c:1798) + cifs_mount_get_session (fs/smb/client/trace.h:959 fs/smb/client/connect.c:3366) + dfs_mount_share (fs/smb/client/dfs.c:63 fs/smb/client/dfs.c:285) + cifs_mount (fs/smb/client/connect.c:3622) + cifs_smb3_do_mount (fs/smb/client/cifsfs.c:949) + smb3_get_tree (fs/smb/client/fs_context.c:784 fs/smb/client/fs_context.c:802 fs/smb/client/fs_context.c:794) + vfs_get_tree (fs/super.c:1800) + path_mount (fs/namespace.c:3508 fs/namespace.c:3834) + __x64_sys_mount (fs/namespace.c:3848 fs/namespace.c:4057 fs/namespace.c:4034 fs/namespace.c:4034) + do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) + entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) + +Fixes: 26abe14379f8 ("net: Modify sk_alloc to not reference count the netns of kernel sockets.") +Signed-off-by: Kuniyuki Iwashima +Acked-by: Tom Talpey +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +Signed-off-by: Vamsi Krishna Brahmajosyula +--- + fs/smb/client/connect.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c +index fba6471973ef..5253f0ad534c 100644 +--- a/fs/smb/client/connect.c ++++ b/fs/smb/client/connect.c +@@ -1069,6 +1069,7 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server) + */ + } + ++ put_net(cifs_net_ns(server)); + #ifdef CONFIG_CIFS_DFS_UPCALL + kfree(server->origin_fullpath); + kfree(server->leaf_fullpath); +@@ -1663,8 +1664,6 @@ cifs_put_tcp_session(struct TCP_Server_Info *server, int from_reconnect) + /* srv_count can never go negative */ + WARN_ON(server->srv_count < 0); + +- put_net(cifs_net_ns(server)); +- + list_del_init(&server->tcp_ses_list); + spin_unlock(&cifs_tcp_ses_lock); + +@@ -3058,7 +3057,10 @@ generic_ip_connect(struct TCP_Server_Info *server) + } + + if (socket == NULL) { +- rc = __sock_create(cifs_net_ns(server), sfamily, SOCK_STREAM, ++ struct net *net = cifs_net_ns(server); ++ struct sock *sk; ++ ++ rc = __sock_create(net, sfamily, SOCK_STREAM, + IPPROTO_TCP, &socket, 1); + if (rc < 0) { + cifs_server_dbg(VFS, "Error %d creating socket\n", rc); +@@ -3066,6 +3068,11 @@ generic_ip_connect(struct TCP_Server_Info *server) + return rc; + } + ++ sk = socket->sk; ++ sk->sk_net_refcnt = 1; ++ get_net_track(net, &sk->ns_tracker, GFP_KERNEL); ++ sock_inuse_add(net, 1); ++ + /* BB other socket options to set KEEPALIVE, NODELAY? */ + cifs_dbg(FYI, "Socket created\n"); + server->ssocket = socket; +-- +2.50.1 (Apple Git-155) + diff --git a/SPECS/linux/6.1/CVE/0001-smb-client-fix-UAF-in-decryption-with-multichannel.patch b/SPECS/linux/6.1/CVE/0001-smb-client-fix-UAF-in-decryption-with-multichannel.patch new file mode 100644 index 0000000000..203a7c5507 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-smb-client-fix-UAF-in-decryption-with-multichannel.patch @@ -0,0 +1,113 @@ +From aa5a1e4b882964eb79d5b5d1d1e8a1a5efbb1d15 Mon Sep 17 00:00:00 2001 +From: Paulo Alcantara +Date: Wed, 9 Apr 2025 11:14:21 -0300 +Subject: [PATCH] smb: client: fix UAF in decryption with multichannel + +[ Upstream commit 9502dd5c7029902f4a425bf959917a5a9e7c0e50 ] + +After commit f7025d861694 ("smb: client: allocate crypto only for +primary server") and commit b0abcd65ec54 ("smb: client: fix UAF in +async decryption"), the channels started reusing AEAD TFM from primary +channel to perform synchronous decryption, but that can't done as +there could be multiple cifsd threads (one per channel) simultaneously +accessing it to perform decryption. + +This fixes the following KASAN splat when running fstest generic/249 +with 'vers=3.1.1,multichannel,max_channels=4,seal' against Windows +Server 2022: + +BUG: KASAN: slab-use-after-free in gf128mul_4k_lle+0xba/0x110 +Read of size 8 at addr ffff8881046c18a0 by task cifsd/986 +CPU: 3 UID: 0 PID: 986 Comm: cifsd Not tainted 6.15.0-rc1 #1 +PREEMPT(voluntary) +Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-3.fc41 +04/01/2014 +Call Trace: + + dump_stack_lvl+0x5d/0x80 + print_report+0x156/0x528 + ? gf128mul_4k_lle+0xba/0x110 + ? __virt_addr_valid+0x145/0x300 + ? __phys_addr+0x46/0x90 + ? gf128mul_4k_lle+0xba/0x110 + kasan_report+0xdf/0x1a0 + ? gf128mul_4k_lle+0xba/0x110 + gf128mul_4k_lle+0xba/0x110 + ghash_update+0x189/0x210 + shash_ahash_update+0x295/0x370 + ? __pfx_shash_ahash_update+0x10/0x10 + ? __pfx_shash_ahash_update+0x10/0x10 + ? __pfx_extract_iter_to_sg+0x10/0x10 + ? ___kmalloc_large_node+0x10e/0x180 + ? __asan_memset+0x23/0x50 + crypto_ahash_update+0x3c/0xc0 + gcm_hash_assoc_remain_continue+0x93/0xc0 + crypt_message+0xe09/0xec0 [cifs] + ? __pfx_crypt_message+0x10/0x10 [cifs] + ? _raw_spin_unlock+0x23/0x40 + ? __pfx_cifs_readv_from_socket+0x10/0x10 [cifs] + decrypt_raw_data+0x229/0x380 [cifs] + ? __pfx_decrypt_raw_data+0x10/0x10 [cifs] + ? __pfx_cifs_read_iter_from_socket+0x10/0x10 [cifs] + smb3_receive_transform+0x837/0xc80 [cifs] + ? __pfx_smb3_receive_transform+0x10/0x10 [cifs] + ? __pfx___might_resched+0x10/0x10 + ? __pfx_smb3_is_transform_hdr+0x10/0x10 [cifs] + cifs_demultiplex_thread+0x692/0x1570 [cifs] + ? __pfx_cifs_demultiplex_thread+0x10/0x10 [cifs] + ? rcu_is_watching+0x20/0x50 + ? rcu_lockdep_current_cpu_online+0x62/0xb0 + ? find_held_lock+0x32/0x90 + ? kvm_sched_clock_read+0x11/0x20 + ? local_clock_noinstr+0xd/0xd0 + ? trace_irq_enable.constprop.0+0xa8/0xe0 + ? __pfx_cifs_demultiplex_thread+0x10/0x10 [cifs] + kthread+0x1fe/0x380 + ? kthread+0x10f/0x380 + ? __pfx_kthread+0x10/0x10 + ? local_clock_noinstr+0xd/0xd0 + ? ret_from_fork+0x1b/0x60 + ? local_clock+0x15/0x30 + ? lock_release+0x29b/0x390 + ? rcu_is_watching+0x20/0x50 + ? __pfx_kthread+0x10/0x10 + ret_from_fork+0x31/0x60 + ? __pfx_kthread+0x10/0x10 + ret_from_fork_asm+0x1a/0x30 + + +Tested-by: David Howells +Reported-by: Steve French +Closes: https://lore.kernel.org/r/CAH2r5mu6Yc0-RJXM3kFyBYUB09XmXBrNodOiCVR4EDrmxq5Szg@mail.gmail.com +Fixes: f7025d861694 ("smb: client: allocate crypto only for primary server") +Fixes: b0abcd65ec54 ("smb: client: fix UAF in async decryption") +Signed-off-by: Paulo Alcantara (Red Hat) +Signed-off-by: Steve French +Signed-off-by: Sasha Levin + + +Signed-off-by: Keerthana K +--- + fs/smb/client/smb2ops.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c +index 497417a98397..453ec8717158 100644 +--- a/fs/smb/client/smb2ops.c ++++ b/fs/smb/client/smb2ops.c +@@ -4704,9 +4704,9 @@ decrypt_raw_data(struct TCP_Server_Info *server, char *buf, + return rc; + } + } else { +- if (unlikely(!server->secmech.dec)) +- return -EIO; +- ++ rc = smb3_crypto_aead_allocate(server); ++ if (unlikely(rc)) ++ return rc; + tfm = server->secmech.dec; + } + +-- +2.43.7 + diff --git a/SPECS/linux/6.1/CVE/0001-smb-client-fix-potential-UAF-in-smb2_close_cached_fi.patch b/SPECS/linux/6.1/CVE/0001-smb-client-fix-potential-UAF-in-smb2_close_cached_fi.patch new file mode 100644 index 0000000000..cd12f07008 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-smb-client-fix-potential-UAF-in-smb2_close_cached_fi.patch @@ -0,0 +1,100 @@ +From a911926c34d52116e4300056c7e6223bb130ee5b Mon Sep 17 00:00:00 2001 +From: Henrique Carvalho +Date: Mon, 3 Nov 2025 19:52:55 -0300 +Subject: [PATCH] smb: client: fix potential UAF in smb2_close_cached_fid() + +commit 734e99623c5b65bf2c03e35978a0b980ebc3c2f8 upstream. + +find_or_create_cached_dir() could grab a new reference after kref_put() +had seen the refcount drop to zero but before cfid_list_lock is acquired +in smb2_close_cached_fid(), leading to use-after-free. + +Switch to kref_put_lock() so cfid_release() is called with +cfid_list_lock held, closing that gap. + +Fixes: ebe98f1447bb ("cifs: enable caching of directories for which a lease is held") +Cc: stable@vger.kernel.org +Reported-by: Jay Shin +Reviewed-by: Paulo Alcantara (Red Hat) +Signed-off-by: Henrique Carvalho +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +[Ankit: Backported for v6.1] +Signed-off-by: Ankit Jain +--- + fs/smb/client/cached_dir.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c +index 2ef11a99a..b69f845ce 100644 +--- a/fs/smb/client/cached_dir.c ++++ b/fs/smb/client/cached_dir.c +@@ -344,11 +344,11 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + * lease. Release one here, and the second below. + */ + cfid->has_lease = false; +- kref_put(&cfid->refcount, smb2_close_cached_fid); ++ close_cached_dir(cfid); + } + spin_unlock(&cfids->cfid_list_lock); + +- kref_put(&cfid->refcount, smb2_close_cached_fid); ++ close_cached_dir(cfid); + } else { + *ret_cfid = cfid; + atomic_inc(&tcon->num_remote_opens); +@@ -383,12 +383,14 @@ int open_cached_dir_by_dentry(struct cifs_tcon *tcon, + + static void + smb2_close_cached_fid(struct kref *ref) ++__releases(&cfid->cfids->cfid_list_lock) + { + struct cached_fid *cfid = container_of(ref, struct cached_fid, + refcount); + int rc; + +- spin_lock(&cfid->cfids->cfid_list_lock); ++ lockdep_assert_held(&cfid->cfids->cfid_list_lock); ++ + if (cfid->on_list) { + list_del(&cfid->entry); + cfid->on_list = false; +@@ -423,7 +425,7 @@ void drop_cached_dir_by_name(const unsigned int xid, struct cifs_tcon *tcon, + spin_lock(&cfid->cfids->cfid_list_lock); + if (cfid->has_lease) { + cfid->has_lease = false; +- kref_put(&cfid->refcount, smb2_close_cached_fid); ++ close_cached_dir(cfid); + } + spin_unlock(&cfid->cfids->cfid_list_lock); + close_cached_dir(cfid); +@@ -432,7 +434,7 @@ void drop_cached_dir_by_name(const unsigned int xid, struct cifs_tcon *tcon, + + void close_cached_dir(struct cached_fid *cfid) + { +- kref_put(&cfid->refcount, smb2_close_cached_fid); ++ kref_put_lock(&cfid->refcount, smb2_close_cached_fid, &cfid->cfids->cfid_list_lock); + } + + /* +@@ -496,7 +498,7 @@ void invalidate_all_cached_dirs(struct cifs_tcon *tcon) + * Drop the ref-count from above, either the lease-ref (if there + * was one) or the extra one acquired. + */ +- kref_put(&cfid->refcount, smb2_close_cached_fid); ++ close_cached_dir(cfid); + } + } + +@@ -506,7 +508,7 @@ smb2_cached_lease_break(struct work_struct *work) + struct cached_fid *cfid = container_of(work, + struct cached_fid, lease_break); + +- kref_put(&cfid->refcount, smb2_close_cached_fid); ++ close_cached_dir(cfid); + } + + int cached_dir_lease_break(struct cifs_tcon *tcon, __u8 lease_key[16]) +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-smb-client-fix-use-after-free-of-signing-key.patch b/SPECS/linux/6.1/CVE/0001-smb-client-fix-use-after-free-of-signing-key.patch new file mode 100644 index 0000000000..e9abbef467 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-smb-client-fix-use-after-free-of-signing-key.patch @@ -0,0 +1,167 @@ +From 600d19a7369abc9e258a130e4fb8ebc4e4987164 Mon Sep 17 00:00:00 2001 +From: Ajay Kaher +Date: Mon, 23 Jun 2025 06:41:09 +0000 +Subject: [PATCH] smb: client: fix use-after-free of signing key + +From: Paulo Alcantara + +[ Upstream commit 343d7fe6df9e247671440a932b6a73af4fa86d95 ] + +Customers have reported use-after-free in @ses->auth_key.response with +SMB2.1 + sign mounts which occurs due to following race: + +task A task B +cifs_mount() + dfs_mount_share() + get_session() + cifs_mount_get_session() cifs_send_recv() + cifs_get_smb_ses() compound_send_recv() + cifs_setup_session() smb2_setup_request() + kfree_sensitive() smb2_calc_signature() + crypto_shash_setkey() *UAF* + +Fix this by ensuring that we have a valid @ses->auth_key.response by +checking whether @ses->ses_status is SES_GOOD or SES_EXITING with +@ses->ses_lock held. After commit 24a9799aa8ef ("smb: client: fix UAF +in smb2_reconnect_server()"), we made sure to call ->logoff() only +when @ses was known to be good (e.g. valid ->auth_key.response), so +it's safe to access signing key when @ses->ses_status == SES_EXITING. + +Cc: stable@vger.kernel.org +Reported-by: Jay Shin +Signed-off-by: Paulo Alcantara (Red Hat) +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +[Ajay: Modified to apply on v6.1.y] +Signed-off-by: Ajay Kaher +--- + fs/smb/client/smb2proto.h | 2 -- + fs/smb/client/smb2transport.c | 56 +++++++++++++++++++++++++---------- + 2 files changed, 40 insertions(+), 18 deletions(-) + +diff --git a/fs/smb/client/smb2proto.h b/fs/smb/client/smb2proto.h +index 79e5e77..a48fd3f 100644 +--- a/fs/smb/client/smb2proto.h ++++ b/fs/smb/client/smb2proto.h +@@ -37,8 +37,6 @@ extern struct mid_q_entry *smb2_setup_request(struct cifs_ses *ses, + struct smb_rqst *rqst); + extern struct mid_q_entry *smb2_setup_async_request( + struct TCP_Server_Info *server, struct smb_rqst *rqst); +-extern struct cifs_ses *smb2_find_smb_ses(struct TCP_Server_Info *server, +- __u64 ses_id); + extern struct cifs_tcon *smb2_find_smb_tcon(struct TCP_Server_Info *server, + __u64 ses_id, __u32 tid); + extern int smb2_calc_signature(struct smb_rqst *rqst, +diff --git a/fs/smb/client/smb2transport.c b/fs/smb/client/smb2transport.c +index 763cf94..5ab9cf8 100644 +--- a/fs/smb/client/smb2transport.c ++++ b/fs/smb/client/smb2transport.c +@@ -74,7 +74,7 @@ smb311_crypto_shash_allocate(struct TCP_Server_Info *server) + + + static +-int smb2_get_sign_key(__u64 ses_id, struct TCP_Server_Info *server, u8 *key) ++int smb3_get_sign_key(__u64 ses_id, struct TCP_Server_Info *server, u8 *key) + { + struct cifs_chan *chan; + struct TCP_Server_Info *pserver; +@@ -167,16 +167,41 @@ smb2_find_smb_ses_unlocked(struct TCP_Server_Info *server, __u64 ses_id) + return NULL; + } + +-struct cifs_ses * +-smb2_find_smb_ses(struct TCP_Server_Info *server, __u64 ses_id) ++static int smb2_get_sign_key(struct TCP_Server_Info *server, ++ __u64 ses_id, u8 *key) + { + struct cifs_ses *ses; ++ int rc = -ENOENT; ++ ++ if (CIFS_SERVER_IS_CHAN(server)) ++ server = server->primary_server; + + spin_lock(&cifs_tcp_ses_lock); +- ses = smb2_find_smb_ses_unlocked(server, ses_id); +- spin_unlock(&cifs_tcp_ses_lock); ++ list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) { ++ if (ses->Suid != ses_id) ++ continue; + +- return ses; ++ rc = 0; ++ spin_lock(&ses->ses_lock); ++ switch (ses->ses_status) { ++ case SES_EXITING: /* SMB2_LOGOFF */ ++ case SES_GOOD: ++ if (likely(ses->auth_key.response)) { ++ memcpy(key, ses->auth_key.response, ++ SMB2_NTLMV2_SESSKEY_SIZE); ++ } else { ++ rc = -EIO; ++ } ++ break; ++ default: ++ rc = -EAGAIN; ++ break; ++ } ++ spin_unlock(&ses->ses_lock); ++ break; ++ } ++ spin_unlock(&cifs_tcp_ses_lock); ++ return rc; + } + + static struct cifs_tcon * +@@ -233,14 +258,16 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server, + unsigned char *sigptr = smb2_signature; + struct kvec *iov = rqst->rq_iov; + struct smb2_hdr *shdr = (struct smb2_hdr *)iov[0].iov_base; +- struct cifs_ses *ses; + struct shash_desc *shash = NULL; + struct smb_rqst drqst; ++ __u64 sid = le64_to_cpu(shdr->SessionId); ++ u8 key[SMB2_NTLMV2_SESSKEY_SIZE]; + +- ses = smb2_find_smb_ses(server, le64_to_cpu(shdr->SessionId)); +- if (unlikely(!ses)) { +- cifs_server_dbg(VFS, "%s: Could not find session\n", __func__); +- return -ENOENT; ++ rc = smb2_get_sign_key(server, sid, key); ++ if (unlikely(rc)) { ++ cifs_server_dbg(VFS, "%s: [sesid=0x%llx] couldn't find signing key: %d\n", ++ __func__, sid, rc); ++ return rc; + } + + memset(smb2_signature, 0x0, SMB2_HMACSHA256_SIZE); +@@ -257,8 +284,7 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server, + shash = server->secmech.hmacsha256; + } + +- rc = crypto_shash_setkey(shash->tfm, ses->auth_key.response, +- SMB2_NTLMV2_SESSKEY_SIZE); ++ rc = crypto_shash_setkey(shash->tfm, key, sizeof(key)); + if (rc) { + cifs_server_dbg(VFS, + "%s: Could not update with response\n", +@@ -300,8 +326,6 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server, + out: + if (allocate_crypto) + cifs_free_hash(&shash); +- if (ses) +- cifs_put_smb_ses(ses); + return rc; + } + +@@ -561,7 +585,7 @@ smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server, + struct smb_rqst drqst; + u8 key[SMB3_SIGN_KEY_SIZE]; + +- rc = smb2_get_sign_key(le64_to_cpu(shdr->SessionId), server, key); ++ rc = smb3_get_sign_key(le64_to_cpu(shdr->SessionId), server, key); + if (unlikely(rc)) { + cifs_server_dbg(VFS, "%s: Could not get signing key\n", __func__); + return rc; +-- +2.39.4 + diff --git a/SPECS/linux/6.1/CVE/0001-smb-client-prevent-new-fids-from-being-removed-by-la.patch b/SPECS/linux/6.1/CVE/0001-smb-client-prevent-new-fids-from-being-removed-by-la.patch new file mode 100644 index 0000000000..519ab439c8 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-smb-client-prevent-new-fids-from-being-removed-by-la.patch @@ -0,0 +1,118 @@ +From 872d185a42c327bb4f7c9ba2acfde2d59cc9deed Mon Sep 17 00:00:00 2001 +From: Paulo Alcantara +Date: Mon, 9 Oct 2023 17:37:40 -0300 +Subject: [PATCH 1/4] smb: client: prevent new fids from being removed by + laundromat + +commit 81ba10959970d15c388bf29866b01b62f387e6a3 upstream + +Check if @cfid->time is set in laundromat so we guarantee that only +fully cached fids will be selected for removal. While we're at it, +add missing locks to protect access of @cfid fields in order to avoid +races with open_cached_dir() and cfids_laundromat_worker(), +respectively. + +Signed-off-by: Paulo Alcantara (SUSE) +Reviewed-by: Shyam Prasad N +Signed-off-by: Steve French +[ Brennan: Backport to v6.1, skip cfids_laundromat_worker() as + it is not present in v6.1 ] +Signed-off-by: Brennan Lamoreaux +--- + fs/smb/client/cached_dir.c | 47 +++++++++++++++++++++++--------------- + 1 file changed, 28 insertions(+), 19 deletions(-) + +diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c +index d09226c1ac90..bd6fb0b2d92c 100644 +--- a/fs/smb/client/cached_dir.c ++++ b/fs/smb/client/cached_dir.c +@@ -168,15 +168,18 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + return -ENOENT; + } + /* +- * At this point we either have a lease already and we can just +- * return it. If not we are guaranteed to be the only thread accessing +- * this cfid. ++ * Return cached fid if it has a lease. Otherwise, it is either a new ++ * entry or laundromat worker removed it from @cfids->entries. Caller ++ * will put last reference if the latter. + */ ++ spin_lock(&cfids->cfid_list_lock); + if (cfid->has_lease) { ++ spin_unlock(&cfids->cfid_list_lock); + *ret_cfid = cfid; + kfree(utf16_path); + return 0; + } ++ spin_unlock(&cfids->cfid_list_lock); + + /* + * Skip any prefix paths in @path as lookup_positive_unlocked() ends up +@@ -296,9 +299,11 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + goto oshr_free; + } + } ++ spin_lock(&cfids->cfid_list_lock); + cfid->dentry = dentry; + cfid->time = jiffies; + cfid->has_lease = true; ++ spin_unlock(&cfids->cfid_list_lock); + + oshr_free: + kfree(utf16_path); +@@ -307,24 +312,28 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + free_rsp_buf(resp_buftype[0], rsp_iov[0].iov_base); + free_rsp_buf(resp_buftype[1], rsp_iov[1].iov_base); + spin_lock(&cfids->cfid_list_lock); +- if (rc && !cfid->has_lease) { +- if (cfid->on_list) { +- list_del(&cfid->entry); +- cfid->on_list = false; +- cfids->num_entries--; ++ if (!cfid->has_lease) { ++ if (rc) { ++ if (cfid->on_list) { ++ list_del(&cfid->entry); ++ cfid->on_list = false; ++ cfids->num_entries--; ++ } ++ rc = -ENOENT; ++ } else { ++ /* ++ * We are guaranteed to have two references at this ++ * point. One for the caller and one for a potential ++ * lease. Release the Lease-ref so that the directory ++ * will be closed when the caller closes the cached ++ * handle. ++ */ ++ spin_unlock(&cfids->cfid_list_lock); ++ kref_put(&cfid->refcount, smb2_close_cached_fid); ++ goto out; + } +- rc = -ENOENT; + } + spin_unlock(&cfids->cfid_list_lock); +- if (!rc && !cfid->has_lease) { +- /* +- * We are guaranteed to have two references at this point. +- * One for the caller and one for a potential lease. +- * Release the Lease-ref so that the directory will be closed +- * when the caller closes the cached handle. +- */ +- kref_put(&cfid->refcount, smb2_close_cached_fid); +- } + if (rc) { + if (cfid->is_open) + SMB2_close(0, cfid->tcon, cfid->fid.persistent_fid, +@@ -332,7 +341,7 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + free_cached_dir(cfid); + cfid = NULL; + } +- ++out: + if (rc == 0) { + *ret_cfid = cfid; + atomic_inc(&tcon->num_remote_opens); +-- +2.43.7 + diff --git a/SPECS/linux/6.1/CVE/0001-smb-client-prevent-races-in-query_interfaces.patch b/SPECS/linux/6.1/CVE/0001-smb-client-prevent-races-in-query_interfaces.patch new file mode 100644 index 0000000000..096ba5d80c --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-smb-client-prevent-races-in-query_interfaces.patch @@ -0,0 +1,70 @@ +From 93e8e3ee165ae4609a1222b516b573837103d2c3 Mon Sep 17 00:00:00 2001 +From: Henrique Carvalho +Date: Mon, 19 Jan 2026 14:54:44 -0300 +Subject: [PATCH] smb: client: prevent races in ->query_interfaces() + +[ Upstream commit c3c06e42e1527716c54f3ad2ced6a034b5f3a489 ] + +It was possible for two query interface works to be concurrently trying +to update the interfaces. + +Prevent this by checking and updating iface_last_update under +iface_lock. + +Signed-off-by: Henrique Carvalho +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +[ Keerthana: Modified to apply on v6.1.y ] +Signed-off-by: Keerthana K +--- + fs/smb/client/smb2ops.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c +index 57f6d25c9262..308b4cc6926f 100644 +--- a/fs/smb/client/smb2ops.c ++++ b/fs/smb/client/smb2ops.c +@@ -590,13 +590,6 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf, + p = buf; + + spin_lock(&ses->iface_lock); +- /* do not query too frequently, this time with lock held */ +- if (ses->iface_last_update && +- time_before(jiffies, ses->iface_last_update + +- (SMB_INTERFACE_POLL_INTERVAL * HZ))) { +- spin_unlock(&ses->iface_lock); +- return 0; +- } + + /* + * Go through iface_list and mark them as inactive +@@ -727,7 +720,6 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf, + + ses->iface_count++; + spin_unlock(&ses->iface_lock); +- ses->iface_last_update = jiffies; + next_iface: + nb_iface++; + next = le32_to_cpu(p->Next); +@@ -792,10 +784,17 @@ SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon, bool in_ + struct TCP_Server_Info *pserver; + + /* do not query too frequently */ ++ spin_lock(&ses->iface_lock); + if (ses->iface_last_update && + time_before(jiffies, ses->iface_last_update + +- (SMB_INTERFACE_POLL_INTERVAL * HZ))) ++ (SMB_INTERFACE_POLL_INTERVAL * HZ))) { ++ spin_unlock(&ses->iface_lock); + return 0; ++ } ++ ++ ses->iface_last_update = jiffies; ++ ++ spin_unlock(&ses->iface_lock); + + rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID, + FSCTL_QUERY_NETWORK_INTERFACE_INFO, +-- +2.43.7 + diff --git a/SPECS/linux/6.1/CVE/0001-spi-rockchip-Fix-register-out-of-bounds-access.patch b/SPECS/linux/6.1/CVE/0001-spi-rockchip-Fix-register-out-of-bounds-access.patch new file mode 100644 index 0000000000..a40ca93ef0 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-spi-rockchip-Fix-register-out-of-bounds-access.patch @@ -0,0 +1,36 @@ +From 4a120221661fcecb253448d7b041a52d47f1d91f Mon Sep 17 00:00:00 2001 +From: Luis de Arquer +Date: Fri, 21 Mar 2025 13:57:53 +0100 +Subject: [PATCH] spi-rockchip: Fix register out of bounds access + +[ Upstream commit 7a874e8b54ea21094f7fd2d428b164394c6cb316 ] + +Do not write native chip select stuff for GPIO chip selects. +GPIOs can be numbered much higher than native CS. +Also, it makes no sense. + +Signed-off-by: Luis de Arquer +Link: https://patch.msgid.link/365ccddfba110549202b3520f4401a6a936e82a8.camel@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +Signed-off-by: Mukul Sikka +--- + drivers/spi/spi-rockchip.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c +index dbefc7e77..10222d08e 100644 +--- a/drivers/spi/spi-rockchip.c ++++ b/drivers/spi/spi-rockchip.c +@@ -540,7 +540,7 @@ static int rockchip_spi_config(struct rockchip_spi *rs, + cr0 |= (spi->mode & 0x3U) << CR0_SCPH_OFFSET; + if (spi->mode & SPI_LSB_FIRST) + cr0 |= CR0_FBM_LSB << CR0_FBM_OFFSET; +- if (spi->mode & SPI_CS_HIGH) ++ if ((spi->mode & SPI_CS_HIGH) && !(spi_get_csgpiod(spi, 0))) + cr0 |= BIT(spi->chip_select) << CR0_SOI_OFFSET; + + if (xfer->rx_buf && xfer->tx_buf) +-- +2.43.7 + diff --git a/SPECS/linux/6.1/CVE/0001-sunrpc-fix-one-UAF-issue-caused-by-sunrpc-kernel-tcp.patch b/SPECS/linux/6.1/CVE/0001-sunrpc-fix-one-UAF-issue-caused-by-sunrpc-kernel-tcp.patch new file mode 100644 index 0000000000..8bdfe3cf54 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-sunrpc-fix-one-UAF-issue-caused-by-sunrpc-kernel-tcp.patch @@ -0,0 +1,169 @@ +From d17d620818601c93948d1634f9051795b1f38975 Mon Sep 17 00:00:00 2001 +From: Ajay Kaher +Date: Mon, 23 Jun 2025 06:33:15 +0000 +Subject: [PATCH] sunrpc: fix one UAF issue caused by sunrpc kernel tcp + socket + +From: Liu Jian + +[ Upstream commit 3f23f96528e8fcf8619895c4c916c52653892ec1 ] + +BUG: KASAN: slab-use-after-free in tcp_write_timer_handler+0x156/0x3e0 +Read of size 1 at addr ffff888111f322cd by task swapper/0/0 + +CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted 6.12.0-rc4-dirty #7 +Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 +Call Trace: + + dump_stack_lvl+0x68/0xa0 + print_address_description.constprop.0+0x2c/0x3d0 + print_report+0xb4/0x270 + kasan_report+0xbd/0xf0 + tcp_write_timer_handler+0x156/0x3e0 + tcp_write_timer+0x66/0x170 + call_timer_fn+0xfb/0x1d0 + __run_timers+0x3f8/0x480 + run_timer_softirq+0x9b/0x100 + handle_softirqs+0x153/0x390 + __irq_exit_rcu+0x103/0x120 + irq_exit_rcu+0xe/0x20 + sysvec_apic_timer_interrupt+0x76/0x90 + + + asm_sysvec_apic_timer_interrupt+0x1a/0x20 +RIP: 0010:default_idle+0xf/0x20 +Code: 4c 01 c7 4c 29 c2 e9 72 ff ff ff 90 90 90 90 90 90 90 90 90 90 90 90 + 90 90 90 90 f3 0f 1e fa 66 90 0f 00 2d 33 f8 25 00 fb f4 c3 cc cc cc + cc 66 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 +RSP: 0018:ffffffffa2007e28 EFLAGS: 00000242 +RAX: 00000000000f3b31 RBX: 1ffffffff4400fc7 RCX: ffffffffa09c3196 +RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff9f00590f +RBP: 0000000000000000 R08: 0000000000000001 R09: ffffed102360835d +R10: ffff88811b041aeb R11: 0000000000000001 R12: 0000000000000000 +R13: ffffffffa202d7c0 R14: 0000000000000000 R15: 00000000000147d0 + default_idle_call+0x6b/0xa0 + cpuidle_idle_call+0x1af/0x1f0 + do_idle+0xbc/0x130 + cpu_startup_entry+0x33/0x40 + rest_init+0x11f/0x210 + start_kernel+0x39a/0x420 + x86_64_start_reservations+0x18/0x30 + x86_64_start_kernel+0x97/0xa0 + common_startup_64+0x13e/0x141 + + +Allocated by task 595: + kasan_save_stack+0x24/0x50 + kasan_save_track+0x14/0x30 + __kasan_slab_alloc+0x87/0x90 + kmem_cache_alloc_noprof+0x12b/0x3f0 + copy_net_ns+0x94/0x380 + create_new_namespaces+0x24c/0x500 + unshare_nsproxy_namespaces+0x75/0xf0 + ksys_unshare+0x24e/0x4f0 + __x64_sys_unshare+0x1f/0x30 + do_syscall_64+0x70/0x180 + entry_SYSCALL_64_after_hwframe+0x76/0x7e + +Freed by task 100: + kasan_save_stack+0x24/0x50 + kasan_save_track+0x14/0x30 + kasan_save_free_info+0x3b/0x60 + __kasan_slab_free+0x54/0x70 + kmem_cache_free+0x156/0x5d0 + cleanup_net+0x5d3/0x670 + process_one_work+0x776/0xa90 + worker_thread+0x2e2/0x560 + kthread+0x1a8/0x1f0 + ret_from_fork+0x34/0x60 + ret_from_fork_asm+0x1a/0x30 + +Reproduction script: + +mkdir -p /mnt/nfsshare +mkdir -p /mnt/nfs/netns_1 +mkfs.ext4 /dev/sdb +mount /dev/sdb /mnt/nfsshare +systemctl restart nfs-server +chmod 777 /mnt/nfsshare +exportfs -i -o rw,no_root_squash *:/mnt/nfsshare + +ip netns add netns_1 +ip link add name veth_1_peer type veth peer veth_1 +ifconfig veth_1_peer 11.11.0.254 up +ip link set veth_1 netns netns_1 +ip netns exec netns_1 ifconfig veth_1 11.11.0.1 + +ip netns exec netns_1 /root/iptables -A OUTPUT -d 11.11.0.254 -p tcp \ + --tcp-flags FIN FIN -j DROP + +(note: In my environment, a DESTROY_CLIENTID operation is always sent + immediately, breaking the nfs tcp connection.) +ip netns exec netns_1 timeout -s 9 300 mount -t nfs -o proto=tcp,vers=4.1 \ + 11.11.0.254:/mnt/nfsshare /mnt/nfs/netns_1 + +ip netns del netns_1 + +The reason here is that the tcp socket in netns_1 (nfs side) has been +shutdown and closed (done in xs_destroy), but the FIN message (with ack) +is discarded, and the nfsd side keeps sending retransmission messages. +As a result, when the tcp sock in netns_1 processes the received message, +it sends the message (FIN message) in the sending queue, and the tcp timer +is re-established. When the network namespace is deleted, the net structure +accessed by tcp's timer handler function causes problems. + +To fix this problem, let's hold netns refcnt for the tcp kernel socket as +done in other modules. This is an ugly hack which can easily be backported +to earlier kernels. A proper fix which cleans up the interfaces will +follow, but may not be so easy to backport. + +Fixes: 26abe14379f8 ("net: Modify sk_alloc to not reference count the netns of kernel sockets.") +Signed-off-by: Liu Jian +Acked-by: Jeff Layton +Reviewed-by: Kuniyuki Iwashima +Signed-off-by: Trond Myklebust +[Routine __netns_tracker_free() is not supported in 6.1 and so using +netns_tracker_free() instead.] +Signed-off-by: Jianqi Ren +Signed-off-by: He Zhe +--- + net/sunrpc/svcsock.c | 4 ++++ + net/sunrpc/xprtsock.c | 7 +++++++ + 2 files changed, 11 insertions(+) + +diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c +index 23b4c72..6545795 100644 +--- a/net/sunrpc/svcsock.c ++++ b/net/sunrpc/svcsock.c +@@ -1457,6 +1457,10 @@ static struct svc_xprt *svc_create_socket(struct svc_serv *serv, + newlen = error; + + if (protocol == IPPROTO_TCP) { ++ netns_tracker_free(net, &sock->sk->ns_tracker); ++ sock->sk->sk_net_refcnt = 1; ++ get_net_track(net, &sock->sk->ns_tracker, GFP_KERNEL); ++ sock_inuse_add(net, 1); + if ((error = kernel_listen(sock, 64)) < 0) + goto bummer; + } +diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c +index fe4b8e7..c647ee7 100644 +--- a/net/sunrpc/xprtsock.c ++++ b/net/sunrpc/xprtsock.c +@@ -1860,6 +1860,13 @@ static struct socket *xs_create_sock(struct rpc_xprt *xprt, + goto out; + } + ++ if (protocol == IPPROTO_TCP) { ++ netns_tracker_free(xprt->xprt_net, &sock->sk->ns_tracker); ++ sock->sk->sk_net_refcnt = 1; ++ get_net_track(xprt->xprt_net, &sock->sk->ns_tracker, GFP_KERNEL); ++ sock_inuse_add(xprt->xprt_net, 1); ++ } ++ + filp = sock_alloc_file(sock, O_NONBLOCK, NULL); + if (IS_ERR(filp)) + return ERR_CAST(filp); +-- +2.39.4 + diff --git a/SPECS/linux/6.1/CVE/0001-svcrdma-bound-check-rq_pages-index-in-inline-path.patch b/SPECS/linux/6.1/CVE/0001-svcrdma-bound-check-rq_pages-index-in-inline-path.patch new file mode 100644 index 0000000000..f73cc1d0fd --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-svcrdma-bound-check-rq_pages-index-in-inline-path.patch @@ -0,0 +1,40 @@ +From df1478f468e5e8ab9fdef1e1a0728616307d1e0b Mon Sep 17 00:00:00 2001 +From: Joshua Rogers +Date: Wed, 31 Dec 2025 17:44:24 -0500 +Subject: [PATCH] svcrdma: bound check rq_pages index in inline path + +[ Upstream commit d1bea0ce35b6095544ee82bb54156fc62c067e58 ] + +svc_rdma_copy_inline_range indexed rqstp->rq_pages[rc_curpage] without +verifying rc_curpage stays within the allocated page array. Add guards +before the first use and after advancing to a new page. + +Fixes: d7cc73972661 ("svcrdma: support multiple Read chunks per RPC") +Cc: stable@vger.kernel.org +Signed-off-by: Joshua Rogers +Signed-off-by: Chuck Lever +[ adapted rc_curpage and rq_maxpages fields to ri_pageno and RPCSVC_MAXPAGES constant ] +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +[ Applied patch to v6.1 by Gerrit Photon ] +--- + net/sunrpc/xprtrdma/svc_rdma_rw.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/sunrpc/xprtrdma/svc_rdma_rw.c b/net/sunrpc/xprtrdma/svc_rdma_rw.c +index ed581c183..024d36b92 100644 +--- a/net/sunrpc/xprtrdma/svc_rdma_rw.c ++++ b/net/sunrpc/xprtrdma/svc_rdma_rw.c +@@ -811,6 +811,9 @@ static int svc_rdma_copy_inline_range(struct svc_rdma_read_info *info, + for (page_no = 0; page_no < numpages; page_no++) { + unsigned int page_len; + ++ if (info->ri_pageno >= RPCSVC_MAXPAGES) ++ return -EINVAL; ++ + page_len = min_t(unsigned int, remaining, + PAGE_SIZE - info->ri_pageoff); + +-- +2.43.7 + diff --git a/SPECS/linux/6.1/CVE/0001-tcp-use-dst_dev_rcu-in-tcp_fastopen_active_disable_o.patch b/SPECS/linux/6.1/CVE/0001-tcp-use-dst_dev_rcu-in-tcp_fastopen_active_disable_o.patch new file mode 100644 index 0000000000..e74550228f --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-tcp-use-dst_dev_rcu-in-tcp_fastopen_active_disable_o.patch @@ -0,0 +1,43 @@ +From cf4b7fd6a003b75eea2faaf1f3ab89fdbc5b470a Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Thu, 28 Aug 2025 19:58:22 +0000 +Subject: [PATCH] tcp: use dst_dev_rcu() in + tcp_fastopen_active_disable_ofo_check() + +[ Upstream commit b62a59c18b692f892dcb8109c1c2e653b2abc95c ] + +Use RCU to avoid a pair of atomic operations and a potential +UAF on dst_dev()->flags. + +Signed-off-by: Eric Dumazet +Reviewed-by: David Ahern +Link: https://patch.msgid.link/20250828195823.3958522-8-edumazet@google.com +Signed-off-by: Jakub Kicinski +[Ankit: Backported for v6.1] +Signed-off-by: Ankit Jain +--- + net/ipv4/tcp_fastopen.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c +index cbce1306b..0f049ab39 100644 +--- a/net/ipv4/tcp_fastopen.c ++++ b/net/ipv4/tcp_fastopen.c +@@ -575,11 +575,12 @@ void tcp_fastopen_active_disable_ofo_check(struct sock *sk) + } + } else if (tp->syn_fastopen_ch && + atomic_read(&sock_net(sk)->ipv4.tfo_active_disable_times)) { +- dst = sk_dst_get(sk); +- dev = dst ? dst_dev(dst) : NULL; ++ rcu_read_lock(); ++ dst = __sk_dst_get(sk); ++ dev = dst ? dst_dev_rcu(dst) : NULL; + if (!(dev && (dev->flags & IFF_LOOPBACK))) + atomic_set(&sock_net(sk)->ipv4.tfo_active_disable_times, 0); +- dst_release(dst); ++ rcu_read_unlock(); + } + } + +-- +2.40.4 diff --git a/SPECS/linux/6.1/CVE/0001-team-fix-header_ops-type-confusion-with-non-Ethernet.patch b/SPECS/linux/6.1/CVE/0001-team-fix-header_ops-type-confusion-with-non-Ethernet.patch new file mode 100644 index 0000000000..cfd31a10ad --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-team-fix-header_ops-type-confusion-with-non-Ethernet.patch @@ -0,0 +1,131 @@ +From e09b4436bcc0b5fe8b57cfcfcbf8701ee43ac3f2 Mon Sep 17 00:00:00 2001 +From: Jiayuan Chen +Date: Fri, 20 Mar 2026 15:21:26 +0800 +Subject: [PATCH] team: fix header_ops type confusion with non-Ethernet + ports + +[ Upstream commit 425000dbf17373a4ab8be9428f5dc055ef870a56 ] + +Similar to commit 950803f72547 ("bonding: fix type confusion in +bond_setup_by_slave()") team has the same class of header_ops type +confusion. + +For non-Ethernet ports, team_setup_by_port() copies port_dev->header_ops +directly. When the team device later calls dev_hard_header() or +dev_parse_header(), these callbacks can run with the team net_device +instead of the real lower device, so netdev_priv(dev) is interpreted as +the wrong private type and can crash. + +The syzbot report shows a crash in bond_header_create(), but the root +cause is in team: the topology is gre -> bond -> team, and team calls +the inherited header_ops with its own net_device instead of the lower +device, so bond_header_create() receives a team device and interprets +netdev_priv() as bonding private data, causing a type confusion crash. + +Fix this by introducing team header_ops wrappers for create/parse, +selecting a team port under RCU, and calling the lower device callbacks +with port->dev, so each callback always sees the correct net_device +context. + +Also pass the selected lower device to the lower parse callback, so +recursion is bounded in stacked non-Ethernet topologies and parse +callbacks always run with the correct device context. + +Fixes: 1d76efe1577b ("team: add support for non-ethernet devices") +Reported-by: syzbot+3d8bc31c45e11450f24c@syzkaller.appspotmail.com +Closes: https://lore.kernel.org/all/69b46af7.050a0220.36eb34.000e.GAE@google.com/T/ +Cc: Jiayuan Chen +Signed-off-by: Jiayuan Chen +Link: https://patch.msgid.link/20260320072139.134249-2-jiayuan.chen@linux.dev +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +Signed-off-by: Brennan Lamoreaux +--- + drivers/net/team/team.c | 65 ++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 64 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c +index ea2a7cea3f6a..42631072063e 100644 +--- a/drivers/net/team/team.c ++++ b/drivers/net/team/team.c +@@ -2141,6 +2141,67 @@ static const struct ethtool_ops team_ethtool_ops = { + * rt netlink interface + ***********************/ + ++/* For tx path we need a linkup && enabled port and for parse any port ++ * suffices. ++ */ ++static struct team_port *team_header_port_get_rcu(struct team *team, ++ bool txable) ++{ ++ struct team_port *port; ++ ++ list_for_each_entry_rcu(port, &team->port_list, list) { ++ if (!txable || team_port_txable(port)) ++ return port; ++ } ++ ++ return NULL; ++} ++ ++static int team_header_create(struct sk_buff *skb, struct net_device *team_dev, ++ unsigned short type, const void *daddr, ++ const void *saddr, unsigned int len) ++{ ++ struct team *team = netdev_priv(team_dev); ++ const struct header_ops *port_ops; ++ struct team_port *port; ++ int ret = 0; ++ ++ rcu_read_lock(); ++ port = team_header_port_get_rcu(team, true); ++ if (port) { ++ port_ops = READ_ONCE(port->dev->header_ops); ++ if (port_ops && port_ops->create) ++ ret = port_ops->create(skb, port->dev, ++ type, daddr, saddr, len); ++ } ++ rcu_read_unlock(); ++ return ret; ++} ++ ++static int team_header_parse(const struct sk_buff *skb, ++ unsigned char *haddr) ++{ ++ struct team *team = netdev_priv(skb->dev); ++ const struct header_ops *port_ops; ++ struct team_port *port; ++ int ret = 0; ++ ++ rcu_read_lock(); ++ port = team_header_port_get_rcu(team, false); ++ if (port) { ++ port_ops = READ_ONCE(port->dev->header_ops); ++ if (port_ops && port_ops->parse) ++ ret = port_ops->parse(skb, haddr); ++ } ++ rcu_read_unlock(); ++ return ret; ++} ++ ++static const struct header_ops team_header_ops = { ++ .create = team_header_create, ++ .parse = team_header_parse, ++}; ++ + static void team_setup_by_port(struct net_device *dev, + struct net_device *port_dev) + { +@@ -2149,7 +2210,8 @@ static void team_setup_by_port(struct net_device *dev, + if (port_dev->type == ARPHRD_ETHER) + dev->header_ops = team->header_ops_cache; + else +- dev->header_ops = port_dev->header_ops; ++ dev->header_ops = port_dev->header_ops ? ++ &team_header_ops : NULL; + dev->type = port_dev->type; + dev->hard_header_len = port_dev->hard_header_len; + dev->needed_headroom = port_dev->needed_headroom; +-- +2.53.0 + diff --git a/SPECS/linux/6.1/CVE/0001-virtio-break-and-reset-virtio-devices-on-device_shut.patch b/SPECS/linux/6.1/CVE/0001-virtio-break-and-reset-virtio-devices-on-device_shut.patch new file mode 100644 index 0000000000..d3d270ada1 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-virtio-break-and-reset-virtio-devices-on-device_shut.patch @@ -0,0 +1,93 @@ +From 0548186b2fe7610e550a466d32cdc89560654cd8 Mon Sep 17 00:00:00 2001 +From: Ajay Kaher +Date: Wed, 15 Oct 2025 10:27:45 +0000 +Subject: [PATCH] virtio: break and reset virtio devices on device_shutdown() + +From: Michael S. Tsirkin + +[ Upstream commit 8bd2fa086a04886798b505f28db4002525895203 ] + +Hongyu reported a hang on kexec in a VM. QEMU reported invalid memory +accesses during the hang. + + Invalid read at addr 0x102877002, size 2, region '(null)', reason: rejected + Invalid write at addr 0x102877A44, size 2, region '(null)', reason: rejected + ... + +It was traced down to virtio-console. Kexec works fine if virtio-console +is not in use. + +The issue is that virtio-console continues to write to the MMIO even after +underlying virtio-pci device is reset. + +Additionally, Eric noticed that IOMMUs are reset before devices, if +devices are not reset on shutdown they continue to poke at guest memory +and get errors from the IOMMU. Some devices get wedged then. + +The problem can be solved by breaking all virtio devices on virtio +bus shutdown, then resetting them. + +Reported-by: Eric Auger +Reported-by: Hongyu Ning +Message-ID: +Tested-by: Eric Auger +Acked-by: Jason Wang +Signed-off-by: Michael S. Tsirkin +Signed-off-by: Sasha Levin + +[ Ajay: Modified to apply on v6.1.y] +Signed-off-by: Ajay Kaher +--- + drivers/virtio/virtio.c | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c +index 1ef094427..0d3481250 100644 +--- a/drivers/virtio/virtio.c ++++ b/drivers/virtio/virtio.c +@@ -340,6 +340,34 @@ static void virtio_dev_remove(struct device *_d) + of_node_put(dev->dev.of_node); + } + ++static void virtio_dev_shutdown(struct device *_d) ++{ ++ struct virtio_device *dev = dev_to_virtio(_d); ++ struct virtio_driver *drv = drv_to_virtio(dev->dev.driver); ++ ++ /* ++ * Stop accesses to or from the device. ++ * We only need to do it if there's a driver - no accesses otherwise. ++ */ ++ if (!drv) ++ return; ++ ++ /* ++ * Some devices get wedged if you kick them after they are ++ * reset. Mark all vqs as broken to make sure we don't. ++ */ ++ virtio_break_device(dev); ++ /* ++ * Guarantee that any callback will see vq->broken as true. ++ */ ++ virtio_synchronize_cbs(dev); ++ /* ++ * As IOMMUs are reset on shutdown, this will block device access to memory. ++ * Some devices get wedged if this happens, so reset to make sure it does not. ++ */ ++ dev->config->reset(dev); ++} ++ + static struct bus_type virtio_bus = { + .name = "virtio", + .match = virtio_dev_match, +@@ -347,6 +375,7 @@ static struct bus_type virtio_bus = { + .uevent = virtio_uevent, + .probe = virtio_dev_probe, + .remove = virtio_dev_remove, ++ .shutdown = virtio_dev_shutdown, + }; + + int register_virtio_driver(struct virtio_driver *driver) +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-wifi-iwlwifi-fix-debug-actions-order.patch b/SPECS/linux/6.1/CVE/0001-wifi-iwlwifi-fix-debug-actions-order.patch new file mode 100644 index 0000000000..0e418d374b --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-wifi-iwlwifi-fix-debug-actions-order.patch @@ -0,0 +1,76 @@ +From 0cf3a0aa304a3268518b90486086a20bf062918e Mon Sep 17 00:00:00 2001 +From: Ajay Kaher +Date: Wed, 15 Oct 2025 10:12:39 +0000 +Subject: [PATCH] wifi: iwlwifi: fix debug actions order + +From: Johannes Berg + +[ Upstream commit eb29b4ffafb20281624dcd2cbb768d6f30edf600 ] + +The order of actions taken for debug was implemented incorrectly. +Now we implemented the dump split and do the FW reset only in the +middle of the dump (rather than the FW killing itself on error.) +As a result, some of the actions taken when applying the config +will now crash the device, so we need to fix the order. + +Signed-off-by: Johannes Berg +Signed-off-by: Miri Korenblit +Link: https://patch.msgid.link/20250308231427.6de7fa8e63ed.I40632c48e2a67a8aca05def572a934b88ce7934b@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +[ Ajay: Modified to apply on v6.1 ] +Signed-off-by: Ajay Kaher +--- + drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +index 677c9e0b4..47922cc23 100644 +--- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause + /* +- * Copyright (C) 2018-2022 Intel Corporation ++ * Copyright (C) 2018-2025 Intel Corporation + */ + #include + #include "iwl-drv.h" +@@ -1363,15 +1363,15 @@ void _iwl_dbg_tlv_time_point(struct iwl_fw_runtime *fwrt, + switch (tp_id) { + case IWL_FW_INI_TIME_POINT_EARLY: + iwl_dbg_tlv_init_cfg(fwrt); +- iwl_dbg_tlv_apply_config(fwrt, conf_list); + iwl_dbg_tlv_update_drams(fwrt); + iwl_dbg_tlv_tp_trigger(fwrt, sync, trig_list, tp_data, NULL); ++ iwl_dbg_tlv_apply_config(fwrt, conf_list); + break; + case IWL_FW_INI_TIME_POINT_AFTER_ALIVE: + iwl_dbg_tlv_apply_buffers(fwrt); + iwl_dbg_tlv_send_hcmds(fwrt, hcmd_list); +- iwl_dbg_tlv_apply_config(fwrt, conf_list); + iwl_dbg_tlv_tp_trigger(fwrt, sync, trig_list, tp_data, NULL); ++ iwl_dbg_tlv_apply_config(fwrt, conf_list); + break; + case IWL_FW_INI_TIME_POINT_PERIODIC: + iwl_dbg_tlv_set_periodic_trigs(fwrt); +@@ -1381,14 +1381,14 @@ void _iwl_dbg_tlv_time_point(struct iwl_fw_runtime *fwrt, + case IWL_FW_INI_TIME_POINT_MISSED_BEACONS: + case IWL_FW_INI_TIME_POINT_FW_DHC_NOTIFICATION: + iwl_dbg_tlv_send_hcmds(fwrt, hcmd_list); +- iwl_dbg_tlv_apply_config(fwrt, conf_list); + iwl_dbg_tlv_tp_trigger(fwrt, sync, trig_list, tp_data, + iwl_dbg_tlv_check_fw_pkt); ++ iwl_dbg_tlv_apply_config(fwrt, conf_list); + break; + default: + iwl_dbg_tlv_send_hcmds(fwrt, hcmd_list); +- iwl_dbg_tlv_apply_config(fwrt, conf_list); + iwl_dbg_tlv_tp_trigger(fwrt, sync, trig_list, tp_data, NULL); ++ iwl_dbg_tlv_apply_config(fwrt, conf_list); + break; + } + } +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-x86-mm-Randomize-per-cpu-entry-area.patch b/SPECS/linux/6.1/CVE/0001-x86-mm-Randomize-per-cpu-entry-area.patch new file mode 100644 index 0000000000..036fd5eeb7 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-x86-mm-Randomize-per-cpu-entry-area.patch @@ -0,0 +1,161 @@ +From c6aee07d9fe1646f3fb21e86fe2bd109ab9037f1 Mon Sep 17 00:00:00 2001 +From: Peter Zijlstra +Date: Thu, 27 Oct 2022 14:54:41 -0700 +Subject: [PATCH 1/2] x86/mm: Randomize per-cpu entry area + +commit 97e3d26b5e5f371b3ee223d94dd123e6c442ba80 upstream + +Seth found that the CPU-entry-area; the piece of per-cpu data that is +mapped into the userspace page-tables for kPTI is not subject to any +randomization -- irrespective of kASLR settings. + +On x86_64 a whole P4D (512 GB) of virtual address space is reserved for +this structure, which is plenty large enough to randomize things a +little. + +As such, use a straight forward randomization scheme that avoids +duplicates to spread the existing CPUs over the available space. + + [ bp: Fix le build. ] + +Reported-by: Seth Jenkins +Reviewed-by: Kees Cook +Signed-off-by: Peter Zijlstra (Intel) +Signed-off-by: Dave Hansen +Signed-off-by: Borislav Petkov +[Ankit: Backported the change for v6.1.x] +Signed-off-by: Ankit Jain +--- + arch/x86/include/asm/cpu_entry_area.h | 4 --- + arch/x86/include/asm/pgtable_areas.h | 8 ++++- + arch/x86/kernel/hw_breakpoint.c | 2 +- + arch/x86/mm/cpu_entry_area.c | 46 ++++++++++++++++++++++++--- + 4 files changed, 50 insertions(+), 10 deletions(-) + +diff --git a/arch/x86/include/asm/cpu_entry_area.h b/arch/x86/include/asm/cpu_entry_area.h +index 75efc4c6f..462fc34f1 100644 +--- a/arch/x86/include/asm/cpu_entry_area.h ++++ b/arch/x86/include/asm/cpu_entry_area.h +@@ -130,10 +130,6 @@ struct cpu_entry_area { + }; + + #define CPU_ENTRY_AREA_SIZE (sizeof(struct cpu_entry_area)) +-#define CPU_ENTRY_AREA_ARRAY_SIZE (CPU_ENTRY_AREA_SIZE * NR_CPUS) +- +-/* Total size includes the readonly IDT mapping page as well: */ +-#define CPU_ENTRY_AREA_TOTAL_SIZE (CPU_ENTRY_AREA_ARRAY_SIZE + PAGE_SIZE) + + DECLARE_PER_CPU(struct cpu_entry_area *, cpu_entry_area); + DECLARE_PER_CPU(struct cea_exception_stacks *, cea_exception_stacks); +diff --git a/arch/x86/include/asm/pgtable_areas.h b/arch/x86/include/asm/pgtable_areas.h +index d34cce1b9..4f056fb88 100644 +--- a/arch/x86/include/asm/pgtable_areas.h ++++ b/arch/x86/include/asm/pgtable_areas.h +@@ -11,6 +11,12 @@ + + #define CPU_ENTRY_AREA_RO_IDT_VADDR ((void *)CPU_ENTRY_AREA_RO_IDT) + +-#define CPU_ENTRY_AREA_MAP_SIZE (CPU_ENTRY_AREA_PER_CPU + CPU_ENTRY_AREA_ARRAY_SIZE - CPU_ENTRY_AREA_BASE) ++#ifdef CONFIG_X86_32 ++#define CPU_ENTRY_AREA_MAP_SIZE (CPU_ENTRY_AREA_PER_CPU + \ ++ (CPU_ENTRY_AREA_SIZE * NR_CPUS) - \ ++ CPU_ENTRY_AREA_BASE) ++#else ++#define CPU_ENTRY_AREA_MAP_SIZE P4D_SIZE ++#endif + + #endif /* _ASM_X86_PGTABLE_AREAS_H */ +diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c +index 668a4a653..bbb0f737a 100644 +--- a/arch/x86/kernel/hw_breakpoint.c ++++ b/arch/x86/kernel/hw_breakpoint.c +@@ -266,7 +266,7 @@ static inline bool within_cpu_entry(unsigned long addr, unsigned long end) + + /* CPU entry erea is always used for CPU entry */ + if (within_area(addr, end, CPU_ENTRY_AREA_BASE, +- CPU_ENTRY_AREA_TOTAL_SIZE)) ++ CPU_ENTRY_AREA_MAP_SIZE)) + return true; + + /* +diff --git a/arch/x86/mm/cpu_entry_area.c b/arch/x86/mm/cpu_entry_area.c +index 6c2f1b76a..20844cf14 100644 +--- a/arch/x86/mm/cpu_entry_area.c ++++ b/arch/x86/mm/cpu_entry_area.c +@@ -15,16 +15,53 @@ static DEFINE_PER_CPU_PAGE_ALIGNED(struct entry_stack_page, entry_stack_storage) + #ifdef CONFIG_X86_64 + static DEFINE_PER_CPU_PAGE_ALIGNED(struct exception_stacks, exception_stacks); + DEFINE_PER_CPU(struct cea_exception_stacks*, cea_exception_stacks); +-#endif + +-#ifdef CONFIG_X86_32 ++static DEFINE_PER_CPU_READ_MOSTLY(unsigned long, _cea_offset); ++ ++static __always_inline unsigned int cea_offset(unsigned int cpu) ++{ ++ return per_cpu(_cea_offset, cpu); ++} ++ ++static __init void init_cea_offsets(void) ++{ ++ unsigned int max_cea; ++ unsigned int i, j; ++ ++ max_cea = (CPU_ENTRY_AREA_MAP_SIZE - PAGE_SIZE) / CPU_ENTRY_AREA_SIZE; ++ ++ /* O(sodding terrible) */ ++ for_each_possible_cpu(i) { ++ unsigned int cea; ++ ++again: ++ cea = prandom_u32_max(max_cea); ++ ++ for_each_possible_cpu(j) { ++ if (cea_offset(j) == cea) ++ goto again; ++ ++ if (i == j) ++ break; ++ } ++ ++ per_cpu(_cea_offset, i) = cea; ++ } ++} ++#else /* !X86_64 */ + DECLARE_PER_CPU_PAGE_ALIGNED(struct doublefault_stack, doublefault_stack); ++ ++static __always_inline unsigned int cea_offset(unsigned int cpu) ++{ ++ return cpu; ++} ++static inline void init_cea_offsets(void) { } + #endif + + /* Is called from entry code, so must be noinstr */ + noinstr struct cpu_entry_area *get_cpu_entry_area(int cpu) + { +- unsigned long va = CPU_ENTRY_AREA_PER_CPU + cpu * CPU_ENTRY_AREA_SIZE; ++ unsigned long va = CPU_ENTRY_AREA_PER_CPU + cea_offset(cpu) * CPU_ENTRY_AREA_SIZE; + BUILD_BUG_ON(sizeof(struct cpu_entry_area) % PAGE_SIZE != 0); + + return (struct cpu_entry_area *) va; +@@ -205,7 +242,6 @@ static __init void setup_cpu_entry_area_ptes(void) + + /* The +1 is for the readonly IDT: */ + BUILD_BUG_ON((CPU_ENTRY_AREA_PAGES+1)*PAGE_SIZE != CPU_ENTRY_AREA_MAP_SIZE); +- BUILD_BUG_ON(CPU_ENTRY_AREA_TOTAL_SIZE != CPU_ENTRY_AREA_MAP_SIZE); + BUG_ON(CPU_ENTRY_AREA_BASE & ~PMD_MASK); + + start = CPU_ENTRY_AREA_BASE; +@@ -221,6 +257,8 @@ void __init setup_cpu_entry_areas(void) + { + unsigned int cpu; + ++ init_cea_offsets(); ++ + setup_cpu_entry_area_ptes(); + + for_each_possible_cpu(cpu) +-- +2.23.1 + diff --git a/SPECS/linux/6.1/CVE/0001-x86-sev-Harden-VC-instruction-emulation-somewhat.patch b/SPECS/linux/6.1/CVE/0001-x86-sev-Harden-VC-instruction-emulation-somewhat.patch new file mode 100644 index 0000000000..13a902c117 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-x86-sev-Harden-VC-instruction-emulation-somewhat.patch @@ -0,0 +1,185 @@ +From 41ab9cb8d595b65504b23e3c815f62a5acbac5e7 Mon Sep 17 00:00:00 2001 +From: "Borislav Petkov (AMD)" +Date: Fri, 5 Jan 2024 11:14:07 +0100 +Subject: [PATCH] x86/sev: Harden #VC instruction emulation somewhat + +commit e3ef461af35a8c74f2f4ce6616491ddb355a208f upstream. + +Compare the opcode bytes at rIP for each #VC exit reason to verify the +instruction which raised the #VC exception is actually the right one. + +Signed-off-by: Borislav Petkov (AMD) +Acked-by: Tom Lendacky +Link: https://lore.kernel.org/r/20240105101407.11694-1-bp@alien8.de +--- + arch/x86/boot/compressed/sev.c | 4 ++ + arch/x86/kernel/sev-shared.c | 103 ++++++++++++++++++++++++++++++++- + arch/x86/kernel/sev.c | 5 +- + 3 files changed, 109 insertions(+), 3 deletions(-) + +diff --git a/arch/x86/boot/compressed/sev.c b/arch/x86/boot/compressed/sev.c +index 4f61d48f2575..98a1aba59f01 100644 +--- a/arch/x86/boot/compressed/sev.c ++++ b/arch/x86/boot/compressed/sev.c +@@ -264,6 +264,10 @@ void do_boot_stage2_vc(struct pt_regs *regs, unsigned long exit_code) + if (result != ES_OK) + goto finish; + ++ result = vc_check_opcode_bytes(&ctxt, exit_code); ++ if (result != ES_OK) ++ goto finish; ++ + switch (exit_code) { + case SVM_EXIT_RDTSC: + case SVM_EXIT_RDTSCP: +diff --git a/arch/x86/kernel/sev-shared.c b/arch/x86/kernel/sev-shared.c +index e658e83c62ae..36966094ed20 100644 +--- a/arch/x86/kernel/sev-shared.c ++++ b/arch/x86/kernel/sev-shared.c +@@ -10,8 +10,13 @@ + */ + + #ifndef __BOOT_COMPRESSED +-#define error(v) pr_err(v) +-#define has_cpuflag(f) boot_cpu_has(f) ++#define error(v) pr_err(v) ++#define has_cpuflag(f) boot_cpu_has(f) ++#define sev_printk(fmt, ...) printk(fmt, ##__VA_ARGS__) ++#define sev_printk_rtl(fmt, ...) printk_ratelimited(fmt, ##__VA_ARGS__) ++#else ++#define sev_printk(fmt, ...) ++#define sev_printk_rtl(fmt, ...) + #endif + + /* I/O parameters for CPUID-related helpers */ +@@ -567,6 +572,7 @@ void __head do_vc_no_ghcb(struct pt_regs *regs, unsigned long exit_code) + { + unsigned int subfn = lower_bits(regs->cx, 32); + unsigned int fn = lower_bits(regs->ax, 32); ++ u16 opcode = *(unsigned short *)regs->ip; + struct cpuid_leaf leaf; + int ret; + +@@ -574,6 +580,10 @@ void __head do_vc_no_ghcb(struct pt_regs *regs, unsigned long exit_code) + if (exit_code != SVM_EXIT_CPUID) + goto fail; + ++ /* Is it really a CPUID insn? */ ++ if (opcode != 0xa20f) ++ goto fail; ++ + leaf.fn = fn; + leaf.subfn = subfn; + +@@ -1082,3 +1092,92 @@ static inline void sev_evict_cache(void *va, int npages) + val = bytes[page_idx * PAGE_SIZE + PAGE_SIZE - 1]; + } + } ++ ++static enum es_result vc_check_opcode_bytes(struct es_em_ctxt *ctxt, ++ unsigned long exit_code) ++{ ++ unsigned int opcode = (unsigned int)ctxt->insn.opcode.value; ++ u8 modrm = ctxt->insn.modrm.value; ++ ++ switch (exit_code) { ++ ++ case SVM_EXIT_IOIO: ++ case SVM_EXIT_NPF: ++ /* handled separately */ ++ return ES_OK; ++ ++ case SVM_EXIT_CPUID: ++ if (opcode == 0xa20f) ++ return ES_OK; ++ break; ++ ++ case SVM_EXIT_INVD: ++ if (opcode == 0x080f) ++ return ES_OK; ++ break; ++ ++ case SVM_EXIT_MONITOR: ++ if (opcode == 0x010f && modrm == 0xc8) ++ return ES_OK; ++ break; ++ ++ case SVM_EXIT_MWAIT: ++ if (opcode == 0x010f && modrm == 0xc9) ++ return ES_OK; ++ break; ++ ++ case SVM_EXIT_MSR: ++ /* RDMSR */ ++ if (opcode == 0x320f || ++ /* WRMSR */ ++ opcode == 0x300f) ++ return ES_OK; ++ break; ++ ++ case SVM_EXIT_RDPMC: ++ if (opcode == 0x330f) ++ return ES_OK; ++ break; ++ ++ case SVM_EXIT_RDTSC: ++ if (opcode == 0x310f) ++ return ES_OK; ++ break; ++ ++ case SVM_EXIT_RDTSCP: ++ if (opcode == 0x010f && modrm == 0xf9) ++ return ES_OK; ++ break; ++ ++ case SVM_EXIT_READ_DR7: ++ if (opcode == 0x210f && ++ X86_MODRM_REG(ctxt->insn.modrm.value) == 7) ++ return ES_OK; ++ break; ++ ++ case SVM_EXIT_VMMCALL: ++ if (opcode == 0x010f && modrm == 0xd9) ++ return ES_OK; ++ ++ break; ++ ++ case SVM_EXIT_WRITE_DR7: ++ if (opcode == 0x230f && ++ X86_MODRM_REG(ctxt->insn.modrm.value) == 7) ++ return ES_OK; ++ break; ++ ++ case SVM_EXIT_WBINVD: ++ if (opcode == 0x90f) ++ return ES_OK; ++ break; ++ ++ default: ++ break; ++ } ++ ++ sev_printk(KERN_ERR "Wrong/unhandled opcode bytes: 0x%x, exit_code: 0x%lx, rIP: 0x%lx\n", ++ opcode, exit_code, ctxt->regs->ip); ++ ++ return ES_UNSUPPORTED; ++} +diff --git a/arch/x86/kernel/sev.c b/arch/x86/kernel/sev.c +index 7b7fa85d1547..91160c2248fe 100644 +--- a/arch/x86/kernel/sev.c ++++ b/arch/x86/kernel/sev.c +@@ -1788,7 +1788,10 @@ static enum es_result vc_handle_exitcode(struct es_em_ctxt *ctxt, + struct ghcb *ghcb, + unsigned long exit_code) + { +- enum es_result result; ++ enum es_result result = vc_check_opcode_bytes(ctxt, exit_code); ++ ++ if (result != ES_OK) ++ return result; + + switch (exit_code) { + case SVM_EXIT_READ_DR7: +-- +2.43.0 + diff --git a/SPECS/linux/6.1/CVE/0001-xfrm-Duplicate-SPI-Handling.patch b/SPECS/linux/6.1/CVE/0001-xfrm-Duplicate-SPI-Handling.patch new file mode 100644 index 0000000000..a85e052c40 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-xfrm-Duplicate-SPI-Handling.patch @@ -0,0 +1,157 @@ +From 408737291484e40433a35eba026f900df17e0b95 Mon Sep 17 00:00:00 2001 +From: Aakash Kumar S +Date: Mon, 30 Jun 2025 18:08:56 +0530 +Subject: [PATCH] xfrm: Duplicate SPI Handling + +[ Upstream commit 94f39804d891cffe4ce17737d295f3b195bc7299 ] + +The issue originates when Strongswan initiates an XFRM_MSG_ALLOCSPI +Netlink message, which triggers the kernel function xfrm_alloc_spi(). +This function is expected to ensure uniqueness of the Security Parameter +Index (SPI) for inbound Security Associations (SAs). However, it can +return success even when the requested SPI is already in use, leading +to duplicate SPIs assigned to multiple inbound SAs, differentiated +only by their destination addresses. + +This behavior causes inconsistencies during SPI lookups for inbound packets. +Since the lookup may return an arbitrary SA among those with the same SPI, +packet processing can fail, resulting in packet drops. + +According to RFC 4301 section 4.4.2 , for inbound processing a unicast SA +is uniquely identified by the SPI and optionally protocol. + +Reproducing the Issue Reliably: +To consistently reproduce the problem, restrict the available SPI range in +charon.conf : spi_min = 0x10000000 spi_max = 0x10000002 +This limits the system to only 2 usable SPI values. +Next, create more than 2 Child SA. each using unique pair of src/dst address. +As soon as the 3rd Child SA is initiated, it will be assigned a duplicate +SPI, since the SPI pool is already exhausted. +With a narrow SPI range, the issue is consistently reproducible. +With a broader/default range, it becomes rare and unpredictable. + +Current implementation: +xfrm_spi_hash() lookup function computes hash using daddr, proto, and family. +So if two SAs have the same SPI but different destination addresses, then +they will: +a. Hash into different buckets +b. Be stored in different linked lists (byspi + h) +c. Not be seen in the same hlist_for_each_entry_rcu() iteration. +As a result, the lookup will result in NULL and kernel allows that Duplicate SPI + +Proposed Change: +xfrm_state_lookup_spi_proto() does a truly global search - across all states, +regardless of hash bucket and matches SPI and proto. + +Signed-off-by: Aakash Kumar S +Acked-by: Herbert Xu +Signed-off-by: Steffen Klassert +Signed-off-by: Sasha Levin +[ Brennan : Applied to v6.1, continue to use hlist_add_head_rcu() + as XFRM_STATE_INSERT is not present, and use old random + calculation method as get_random_u32_inclusive() is not present. + Don't add msg log as c2dad11 is not present. ] +Signed-off-by: Brennan Lamoreaux +--- + net/xfrm/xfrm_state.c | 67 ++++++++++++++++++++++++++----------------- + 1 file changed, 41 insertions(+), 26 deletions(-) + +diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c +index 58c53bb1c583..181c10252180 100644 +--- a/net/xfrm/xfrm_state.c ++++ b/net/xfrm/xfrm_state.c +@@ -1268,6 +1268,26 @@ struct xfrm_state *xfrm_state_lookup_byspi(struct net *net, __be32 spi, + } + EXPORT_SYMBOL(xfrm_state_lookup_byspi); + ++static struct xfrm_state *xfrm_state_lookup_spi_proto(struct net *net, __be32 spi, u8 proto) ++{ ++ struct xfrm_state *x; ++ unsigned int i; ++ ++ rcu_read_lock(); ++ for (i = 0; i <= net->xfrm.state_hmask; i++) { ++ hlist_for_each_entry_rcu(x, &net->xfrm.state_byspi[i], byspi) { ++ if (x->id.spi == spi && x->id.proto == proto) { ++ if (!xfrm_state_hold_rcu(x)) ++ continue; ++ rcu_read_unlock(); ++ return x; ++ } ++ } ++ } ++ rcu_read_unlock(); ++ return NULL; ++} ++ + static void __xfrm_state_insert(struct xfrm_state *x) + { + struct net *net = xs_net(x); +@@ -2047,10 +2067,8 @@ int xfrm_alloc_spi(struct xfrm_state *x, u32 low, u32 high) + unsigned int h; + struct xfrm_state *x0; + int err = -ENOENT; +- __be32 minspi = htonl(low); +- __be32 maxspi = htonl(high); ++ u32 range = high - low + 1; + __be32 newspi = 0; +- u32 mark = x->mark.v & x->mark.m; + + spin_lock_bh(&x->lock); + if (x->km.state == XFRM_STATE_DEAD) +@@ -2062,33 +2080,30 @@ int xfrm_alloc_spi(struct xfrm_state *x, u32 low, u32 high) + + err = -ENOENT; + +- if (minspi == maxspi) { +- x0 = xfrm_state_lookup(net, mark, &x->id.daddr, minspi, x->id.proto, x->props.family); +- if (x0) { +- xfrm_state_put(x0); ++ for (h = 0; h < range; h++) { ++ u32 spi = (low == high) ? low : low + prandom_u32_max(high - low + 1); ++ newspi = htonl(spi); ++ ++ spin_lock_bh(&net->xfrm.xfrm_state_lock); ++ x0 = xfrm_state_lookup_spi_proto(net, newspi, x->id.proto); ++ if (!x0) { ++ x->id.spi = newspi; ++ h = xfrm_spi_hash(net, &x->id.daddr, newspi, x->id.proto, x->props.family); ++ hlist_add_head_rcu(&x->byspi, net->xfrm.state_byspi + h); ++ spin_unlock_bh(&net->xfrm.xfrm_state_lock); ++ err = 0; + goto unlock; + } +- newspi = minspi; +- } else { +- u32 spi = 0; +- for (h = 0; h < high-low+1; h++) { +- spi = low + prandom_u32_max(high - low + 1); +- x0 = xfrm_state_lookup(net, mark, &x->id.daddr, htonl(spi), x->id.proto, x->props.family); +- if (x0 == NULL) { +- newspi = htonl(spi); +- break; +- } +- xfrm_state_put(x0); +- } +- } +- if (newspi) { +- spin_lock_bh(&net->xfrm.xfrm_state_lock); +- x->id.spi = newspi; +- h = xfrm_spi_hash(net, &x->id.daddr, x->id.spi, x->id.proto, x->props.family); +- hlist_add_head_rcu(&x->byspi, net->xfrm.state_byspi + h); ++ xfrm_state_put(x0); + spin_unlock_bh(&net->xfrm.xfrm_state_lock); + +- err = 0; ++ if (signal_pending(current)) { ++ err = -ERESTARTSYS; ++ goto unlock; ++ } ++ ++ if (low == high) ++ break; + } + + unlock: +-- +2.40.4 diff --git a/SPECS/linux/6.1/CVE/0001-xfrm-hold-dev-ref-until-after-transport_finish-NF_HO.patch b/SPECS/linux/6.1/CVE/0001-xfrm-hold-dev-ref-until-after-transport_finish-NF_HO.patch new file mode 100644 index 0000000000..d2d19e1fa4 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-xfrm-hold-dev-ref-until-after-transport_finish-NF_HO.patch @@ -0,0 +1,138 @@ +From 1c428b03840094410c5fb6a5db30640486bbbfcb Mon Sep 17 00:00:00 2001 +From: Qi Tang +Date: Thu, 02 Apr 2026 19:44:01 +0800 +Subject: [PATCH] xfrm: hold dev ref until after transport_finish NF_HOOK + +[ Upstream commit 1c428b03840094410c5fb6a5db30640486bbbfcb ] + +After async crypto completes, xfrm_input_resume() calls dev_put() +immediately on re-entry before the skb reaches transport_finish. +The skb->dev pointer is then used inside NF_HOOK and its okfn, +which can race with device teardown. + +Remove the dev_put from the async resumption entry and instead +drop the reference after the NF_HOOK call in transport_finish, +using a saved device pointer since NF_HOOK may consume the skb. +This covers NF_DROP, NF_QUEUE and NF_STOLEN paths that skip +the okfn. + +For non-transport exits (decaps, gro, drop) and secondary +async return points, release the reference inline when +async is set. + +Suggested-by: Florian Westphal +Fixes: acf568ee859f ("xfrm: Reinject transport-mode packets through tasklet") +Signed-off-by: Qi Tang +Signed-off-by: Steffen Klassert +[Ankit: Backported for v6.1.x. Applied on top of b05d42e + (xfrm: hold device only for the asynchronous decryption)] +Signed-off-by: Ankit Jain +--- + net/ipv4/xfrm4_input.c | 5 ++++- + net/ipv6/xfrm6_input.c | 5 ++++- + net/xfrm/xfrm_input.c | 12 ++++++++++-- + 3 files changed, 18 insertions(+), 4 deletions(-) + +diff --git a/net/ipv4/xfrm4_input.c b/net/ipv4/xfrm4_input.c +index f6e90ba50b63..d05e8ff9c37b 100644 +--- a/net/ipv4/xfrm4_input.c ++++ b/net/ipv4/xfrm4_input.c +@@ -48,6 +48,7 @@ int xfrm4_transport_finish(struct sk_buff *skb, int async) + { + struct xfrm_offload *xo = xfrm_offload(skb); + struct iphdr *iph = ip_hdr(skb); ++ struct net_device *dev = skb->dev; + + iph->protocol = XFRM_MODE_SKB_CB(skb)->protocol; + +@@ -71,8 +72,10 @@ int xfrm4_transport_finish(struct sk_buff *skb, int async) + } + + NF_HOOK(NFPROTO_IPV4, NF_INET_PRE_ROUTING, +- dev_net(skb->dev), NULL, skb, skb->dev, NULL, ++ dev_net(dev), NULL, skb, dev, NULL, + xfrm4_rcv_encap_finish); ++ if (async) ++ dev_put(dev); + return 0; + } + +diff --git a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c +index 8432b50d9ce4..b2e328de620b 100644 +--- a/net/ipv6/xfrm6_input.c ++++ b/net/ipv6/xfrm6_input.c +@@ -41,6 +41,7 @@ static int xfrm6_transport_finish2(struct net *net, struct sock *sk, + int xfrm6_transport_finish(struct sk_buff *skb, int async) + { + struct xfrm_offload *xo = xfrm_offload(skb); ++ struct net_device *dev = skb->dev; + int nhlen = skb->data - skb_network_header(skb); + + skb_network_header(skb)[IP6CB(skb)->nhoff] = +@@ -66,8 +67,10 @@ int xfrm6_transport_finish(struct sk_buff *skb, int async) + } + + NF_HOOK(NFPROTO_IPV6, NF_INET_PRE_ROUTING, +- dev_net(skb->dev), NULL, skb, skb->dev, NULL, ++ dev_net(dev), NULL, skb, dev, NULL, + xfrm6_transport_finish2); ++ if (async) ++ dev_put(dev); + return 0; + } + +diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c +index 6f674357d30d..be9dc0cae46e 100644 +--- a/net/xfrm/xfrm_input.c ++++ b/net/xfrm/xfrm_input.c +@@ -490,7 +490,6 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) + /* An encap_type of -1 indicates async resumption. */ + if (encap_type == -1) { + async = 1; +- dev_put(skb->dev); + seq = XFRM_SKB_CB(skb)->seq.input.low; + goto resume; + } +@@ -636,8 +635,11 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) + dev_hold(skb->dev); + + nexthdr = x->type->input(x, skb); +- if (nexthdr == -EINPROGRESS) ++ if (nexthdr == -EINPROGRESS) { ++ if (async) ++ dev_put(skb->dev); + return 0; ++ } + + dev_put(skb->dev); + } +@@ -707,6 +709,8 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) + sp->olen = 0; + if (skb_valid_dst(skb)) + skb_dst_drop(skb); ++ if (async) ++ dev_put(skb->dev); + gro_cells_receive(&gro_cells, skb); + return 0; + } else { +@@ -726,6 +730,8 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) + sp->olen = 0; + if (skb_valid_dst(skb)) + skb_dst_drop(skb); ++ if (async) ++ dev_put(skb->dev); + gro_cells_receive(&gro_cells, skb); + return err; + } +@@ -736,6 +742,8 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) + drop_unlock: + spin_unlock(&x->lock); + drop: ++ if (async) ++ dev_put(skb->dev); + xfrm_rcv_cb(skb, family, x && x->type ? x->type->proto : nexthdr, -1); + kfree_skb(skb); + return 0; +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-xfrm-hold-device-only-for-asynchronous-decryption.patch b/SPECS/linux/6.1/CVE/0001-xfrm-hold-device-only-for-asynchronous-decryption.patch new file mode 100644 index 0000000000..be1f11ba73 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-xfrm-hold-device-only-for-asynchronous-decryption.patch @@ -0,0 +1,69 @@ +From b05d42eefac737ce3cd80114d3579111023941b8 Mon Sep 17 00:00:00 2001 +From: Jianbo Liu +Date: Thu, 19 Jun 2025 12:48:51 +0300 +Subject: [PATCH] xfrm: hold device only for the asynchronous decryption + +[ Upstream commit b05d42eefac737ce3cd80114d3579111023941b8 ] +The dev_hold() on skb->dev during packet reception was originally +added to prevent the device from being released prematurely during +asynchronous decryption operations. + +As current hardware can offload decryption, this asynchronous path is +not always utilized. This often results in a pattern of dev_hold() +immediately followed by dev_put() for each packet, creating +unnecessary reference counting overhead detrimental to performance. + +This patch optimizes this by skipping the dev_hold() and subsequent +dev_put() when asynchronous decryption is not being performed. + +Signed-off-by: Jianbo Liu +Reviewed-by: Cosmin Ratiu +Signed-off-by: Steffen Klassert +[Ankit: Backported for v6.1.x] +Signed-off-by: Ankit Jain +--- + net/xfrm/xfrm_input.c | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c +index 4bba890ff3bc..6f674357d30d 100644 +--- a/net/xfrm/xfrm_input.c ++++ b/net/xfrm/xfrm_input.c +@@ -490,6 +490,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) + /* An encap_type of -1 indicates async resumption. */ + if (encap_type == -1) { + async = 1; ++ dev_put(skb->dev); + seq = XFRM_SKB_CB(skb)->seq.input.low; + goto resume; + } +@@ -629,18 +630,18 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) + XFRM_SKB_CB(skb)->seq.input.low = seq; + XFRM_SKB_CB(skb)->seq.input.hi = seq_hi; + +- dev_hold(skb->dev); +- +- if (crypto_done) ++ if (crypto_done) { + nexthdr = x->type_offload->input_tail(x, skb); +- else ++ } else { ++ dev_hold(skb->dev); ++ + nexthdr = x->type->input(x, skb); ++ if (nexthdr == -EINPROGRESS) ++ return 0; + +- if (nexthdr == -EINPROGRESS) +- return 0; ++ dev_put(skb->dev); ++ } + resume: +- dev_put(skb->dev); +- + spin_lock(&x->lock); + if (nexthdr < 0) { + if (nexthdr == -EBADMSG) { +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0001-xfrm-prevent-policy_hthresh.work-from-racing-with-ne.patch b/SPECS/linux/6.1/CVE/0001-xfrm-prevent-policy_hthresh.work-from-racing-with-ne.patch new file mode 100644 index 0000000000..d0c0b32de8 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-xfrm-prevent-policy_hthresh.work-from-racing-with-ne.patch @@ -0,0 +1,48 @@ +From 9942ee80b7c2f8b26d2f05414dc694559dc18aec Mon Sep 17 00:00:00 2001 +From: Minwoo Ra +Date: Sat, 14 Mar 2026 00:58:44 +0900 +Subject: [PATCH] xfrm: prevent policy_hthresh.work from racing with netns + +commit 29fe3a61bcdce398ee3955101c39f89c01a8a77e upstream. + +A XFRM_MSG_NEWSPDINFO request can queue the per-net work item +policy_hthresh.work onto the system workqueue. + +The queued callback, xfrm_hash_rebuild(), retrieves the enclosing +struct net via container_of(). If the net namespace is torn down +before that work runs, the associated struct net may already have +been freed, and xfrm_hash_rebuild() may then dereference stale memory. + +xfrm_policy_fini() already flushes policy_hash_work during teardown, +but it does not synchronize policy_hthresh.work. + +Synchronize policy_hthresh.work in xfrm_policy_fini() as well, so the +queued work cannot outlive the net namespace teardown and access a +freed struct net. + +Fixes: 880a6fab8f6b ("xfrm: configure policy hash table thresholds by netlink") +Signed-off-by: Minwoo Ra +Signed-off-by: Steffen Klassert +Signed-off-by: Sasha Levin +[ Brennan : Use cancel_work_sync() instead of disable_work_sync() ] +Signed-off-by: Brennan Lamoreaux +--- + net/xfrm/xfrm_policy.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c +index cd534803a0e4..92271297984e 100644 +--- a/net/xfrm/xfrm_policy.c ++++ b/net/xfrm/xfrm_policy.c +@@ -4123,6 +4123,8 @@ static void xfrm_policy_fini(struct net *net) + unsigned int sz; + int dir; + ++ cancel_work_sync(&net->xfrm.policy_hthresh.work); ++ + flush_work(&net->xfrm.policy_hash_work); + #ifdef CONFIG_XFRM_SUB_POLICY + xfrm_policy_flush(net, XFRM_POLICY_TYPE_SUB, false); +-- +2.53.0 + diff --git a/SPECS/linux/6.1/CVE/0001-xfrm-state-fix-out-of-bounds-read-during-lookup.patch b/SPECS/linux/6.1/CVE/0001-xfrm-state-fix-out-of-bounds-read-during-lookup.patch new file mode 100644 index 0000000000..5cc5102792 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-xfrm-state-fix-out-of-bounds-read-during-lookup.patch @@ -0,0 +1,252 @@ +From a16871c7832ea6435abb6e0b58289ae7dcb7e4fc Mon Sep 17 00:00:00 2001 +From: Florian Westphal +Date: Thu, 28 Nov 2024 15:26:25 +0100 +Subject: xfrm: state: fix out-of-bounds read during lookup + +[ Upstream commit e952837f3ddb0ff726d5b582aa1aad9aa38d024d ] + +lookup and resize can run in parallel. + +The xfrm_state_hash_generation seqlock ensures a retry, but the hash +functions can observe a hmask value that is too large for the new hlist +array. + +rehash does: + rcu_assign_pointer(net->xfrm.state_bydst, ndst) [..] + net->xfrm.state_hmask = nhashmask; + +While state lookup does: + h = xfrm_dst_hash(net, daddr, saddr, tmpl->reqid, encap_family); + hlist_for_each_entry_rcu(x, net->xfrm.state_bydst + h, bydst) { + +This is only safe in case the update to state_bydst is larger than +net->xfrm.xfrm_state_hmask (or if the lookup function gets +serialized via state spinlock again). + +Fix this by prefetching state_hmask and the associated pointers. +The xfrm_state_hash_generation seqlock retry will ensure that the pointer +and the hmask will be consistent. + +The existing helpers, like xfrm_dst_hash(), are now unsafe for RCU side, +add lockdep assertions to document that they are only safe for insert +side. + +xfrm_state_lookup_byaddr() uses the spinlock rather than RCU. +AFAICS this is an oversight from back when state lookup was converted to +RCU, this lock should be replaced with RCU in a future patch. + +Reported-by: syzbot+5f9f31cb7d985f584d8e@syzkaller.appspotmail.com +Closes: https://lore.kernel.org/netdev/CACT4Y+azwfrE3uz6A5ZErov5YN2LYBN5KrsymBerT36VU8qzBA@mail.gmail.com/ +Diagnosed-by: Dmitry Vyukov +Fixes: c2f672fc9464 ("xfrm: state lookup can be lockless") +Signed-off-by: Florian Westphal +Signed-off-by: Steffen Klassert +Signed-off-by: Sasha Levin +[Harinadh: Backport patch to 6.1.147 , __xfrm_state_lookup_all() and xfrm_input_state_lookup() func in +upstream patch are not there in 6.1.x source code] +Signed-off-by: Harinadh Dommaraju +--- + +diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c +index 2f4cf976b..b878dd4b2 100644 +--- a/net/xfrm/xfrm_state.c ++++ b/net/xfrm/xfrm_state.c +@@ -34,6 +34,8 @@ + + #define xfrm_state_deref_prot(table, net) \ + rcu_dereference_protected((table), lockdep_is_held(&(net)->xfrm.xfrm_state_lock)) ++#define xfrm_state_deref_check(table, net) \ ++ rcu_dereference_check((table), lockdep_is_held(&(net)->xfrm.xfrm_state_lock)) + + static void xfrm_state_gc_task(struct work_struct *work); + +@@ -61,6 +63,8 @@ static inline unsigned int xfrm_dst_hash(struct net *net, + u32 reqid, + unsigned short family) + { ++ lockdep_assert_held(&net->xfrm.xfrm_state_lock); ++ + return __xfrm_dst_hash(daddr, saddr, reqid, family, net->xfrm.state_hmask); + } + +@@ -69,6 +73,8 @@ static inline unsigned int xfrm_src_hash(struct net *net, + const xfrm_address_t *saddr, + unsigned short family) + { ++ lockdep_assert_held(&net->xfrm.xfrm_state_lock); ++ + return __xfrm_src_hash(daddr, saddr, family, net->xfrm.state_hmask); + } + +@@ -76,11 +82,15 @@ static inline unsigned int + xfrm_spi_hash(struct net *net, const xfrm_address_t *daddr, + __be32 spi, u8 proto, unsigned short family) + { ++ lockdep_assert_held(&net->xfrm.xfrm_state_lock); ++ + return __xfrm_spi_hash(daddr, spi, proto, family, net->xfrm.state_hmask); + } + + static unsigned int xfrm_seq_hash(struct net *net, u32 seq) + { ++ lockdep_assert_held(&net->xfrm.xfrm_state_lock); ++ + return __xfrm_seq_hash(seq, net->xfrm.state_hmask); + } + +@@ -951,15 +961,38 @@ xfrm_init_tempstate(struct xfrm_state *x, const struct flowi *fl, + x->props.family = tmpl->encap_family; + } + +-static struct xfrm_state *__xfrm_state_lookup(struct net *net, u32 mark, ++ ++struct xfrm_hash_state_ptrs { ++ const struct hlist_head *bydst; ++ const struct hlist_head *bysrc; ++ const struct hlist_head *byspi; ++ unsigned int hmask; ++}; ++ ++static void xfrm_hash_ptrs_get(const struct net *net, struct xfrm_hash_state_ptrs *ptrs) ++{ ++ unsigned int sequence; ++ ++ do { ++ sequence = read_seqcount_begin(&net->xfrm.xfrm_state_hash_generation); ++ ++ ptrs->bydst = xfrm_state_deref_check(net->xfrm.state_bydst, net); ++ ptrs->bysrc = xfrm_state_deref_check(net->xfrm.state_bysrc, net); ++ ptrs->byspi = xfrm_state_deref_check(net->xfrm.state_byspi, net); ++ ptrs->hmask = net->xfrm.state_hmask; ++ } while (read_seqcount_retry(&net->xfrm.xfrm_state_hash_generation, sequence)); ++} ++ ++static struct xfrm_state *__xfrm_state_lookup(const struct xfrm_hash_state_ptrs *state_ptrs, ++ u32 mark, + const xfrm_address_t *daddr, + __be32 spi, u8 proto, + unsigned short family) + { +- unsigned int h = xfrm_spi_hash(net, daddr, spi, proto, family); ++ unsigned int h = __xfrm_spi_hash(daddr, spi, proto, family, state_ptrs->hmask); + struct xfrm_state *x; + +- hlist_for_each_entry_rcu(x, net->xfrm.state_byspi + h, byspi) { ++ hlist_for_each_entry_rcu(x, state_ptrs->byspi + h, byspi) { + if (x->props.family != family || + x->id.spi != spi || + x->id.proto != proto || +@@ -976,15 +1009,16 @@ static struct xfrm_state *__xfrm_state_lookup(struct net *net, u32 mark, + return NULL; + } + +-static struct xfrm_state *__xfrm_state_lookup_byaddr(struct net *net, u32 mark, ++static struct xfrm_state *__xfrm_state_lookup_byaddr(const struct xfrm_hash_state_ptrs *state_ptrs, ++ u32 mark, + const xfrm_address_t *daddr, + const xfrm_address_t *saddr, + u8 proto, unsigned short family) + { +- unsigned int h = xfrm_src_hash(net, daddr, saddr, family); ++ unsigned int h = __xfrm_src_hash(daddr, saddr, family, state_ptrs->hmask); + struct xfrm_state *x; + +- hlist_for_each_entry_rcu(x, net->xfrm.state_bysrc + h, bysrc) { ++ hlist_for_each_entry_rcu(x, state_ptrs->bysrc + h, bysrc) { + if (x->props.family != family || + x->id.proto != proto || + !xfrm_addr_equal(&x->id.daddr, daddr, family) || +@@ -1004,14 +1038,17 @@ static struct xfrm_state *__xfrm_state_lookup_byaddr(struct net *net, u32 mark, + static inline struct xfrm_state * + __xfrm_state_locate(struct xfrm_state *x, int use_spi, int family) + { ++ struct xfrm_hash_state_ptrs state_ptrs; + struct net *net = xs_net(x); + u32 mark = x->mark.v & x->mark.m; + ++ xfrm_hash_ptrs_get(net, &state_ptrs); ++ + if (use_spi) +- return __xfrm_state_lookup(net, mark, &x->id.daddr, ++ return __xfrm_state_lookup(&state_ptrs, mark, &x->id.daddr, + x->id.spi, x->id.proto, family); + else +- return __xfrm_state_lookup_byaddr(net, mark, ++ return __xfrm_state_lookup_byaddr(&state_ptrs, mark, + &x->id.daddr, + &x->props.saddr, + x->id.proto, family); +@@ -1074,6 +1111,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, + unsigned short family, u32 if_id) + { + static xfrm_address_t saddr_wildcard = { }; ++ struct xfrm_hash_state_ptrs state_ptrs; + struct net *net = xp_net(pol); + unsigned int h, h_wildcard; + struct xfrm_state *x, *x0, *to_put; +@@ -1090,9 +1128,10 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, + sequence = read_seqcount_begin(&net->xfrm.xfrm_state_hash_generation); + + rcu_read_lock(); +- h = xfrm_dst_hash(net, daddr, saddr, tmpl->reqid, encap_family); +- hlist_for_each_entry_rcu(x, net->xfrm.state_bydst + h, bydst) { +- if (x->props.family == encap_family && ++ xfrm_hash_ptrs_get(net, &state_ptrs); ++ h = __xfrm_dst_hash(daddr, saddr, tmpl->reqid, encap_family, state_ptrs.hmask); ++ hlist_for_each_entry_rcu(x, state_ptrs.bydst + h, bydst) { ++ if (x->props.family == encap_family && + x->props.reqid == tmpl->reqid && + (mark & x->mark.m) == x->mark.v && + x->if_id == if_id && +@@ -1107,8 +1146,9 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, + if (best || acquire_in_progress) + goto found; + +- h_wildcard = xfrm_dst_hash(net, daddr, &saddr_wildcard, tmpl->reqid, encap_family); +- hlist_for_each_entry_rcu(x, net->xfrm.state_bydst + h_wildcard, bydst) { ++ h_wildcard = __xfrm_dst_hash(daddr, &saddr_wildcard, tmpl->reqid, ++ encap_family, state_ptrs.hmask); ++ hlist_for_each_entry_rcu(x, state_ptrs.bydst + h_wildcard, bydst) { + if (x->props.family == encap_family && + x->props.reqid == tmpl->reqid && + (mark & x->mark.m) == x->mark.v && +@@ -1126,7 +1166,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, + x = best; + if (!x && !error && !acquire_in_progress) { + if (tmpl->id.spi && +- (x0 = __xfrm_state_lookup(net, mark, daddr, tmpl->id.spi, ++ (x0 = __xfrm_state_lookup(&state_ptrs, mark, daddr, tmpl->id.spi, + tmpl->id.proto, encap_family)) != NULL) { + to_put = x0; + error = -EEXIST; +@@ -1810,10 +1850,13 @@ struct xfrm_state * + xfrm_state_lookup(struct net *net, u32 mark, const xfrm_address_t *daddr, __be32 spi, + u8 proto, unsigned short family) + { ++ struct xfrm_hash_state_ptrs state_ptrs; + struct xfrm_state *x; + + rcu_read_lock(); +- x = __xfrm_state_lookup(net, mark, daddr, spi, proto, family); ++ xfrm_hash_ptrs_get(net, &state_ptrs); ++ ++ x = __xfrm_state_lookup(&state_ptrs, mark, daddr, spi, proto, family); + rcu_read_unlock(); + return x; + } +@@ -1824,10 +1867,14 @@ xfrm_state_lookup_byaddr(struct net *net, u32 mark, + const xfrm_address_t *daddr, const xfrm_address_t *saddr, + u8 proto, unsigned short family) + { ++ struct xfrm_hash_state_ptrs state_ptrs; + struct xfrm_state *x; + + spin_lock_bh(&net->xfrm.xfrm_state_lock); +- x = __xfrm_state_lookup_byaddr(net, mark, daddr, saddr, proto, family); ++ ++ xfrm_hash_ptrs_get(net, &state_ptrs); ++ ++ x = __xfrm_state_lookup_byaddr(&state_ptrs, mark, daddr, saddr, proto, family); + spin_unlock_bh(&net->xfrm.xfrm_state_lock); + return x; + } diff --git a/SPECS/linux/6.1/CVE/0001-xfrm-xfrm_alloc_spi-shouldn-t-use-0-as-SPI.patch b/SPECS/linux/6.1/CVE/0001-xfrm-xfrm_alloc_spi-shouldn-t-use-0-as-SPI.patch new file mode 100644 index 0000000000..5abf15e467 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0001-xfrm-xfrm_alloc_spi-shouldn-t-use-0-as-SPI.patch @@ -0,0 +1,50 @@ +From 85c78cbec1d3e518cfe5de898772761c48ef96d0 Mon Sep 17 00:00:00 2001 +From: Sabrina Dubroca +Date: Fri, 29 Aug 2025 10:54:15 +0200 +Subject: [PATCH] xfrm: xfrm_alloc_spi shouldn't use 0 as SPI + +commit cd8ae32e4e4652db55bce6b9c79267d8946765a9 upstream + +x->id.spi == 0 means "no SPI assigned", but since commit +94f39804d891 ("xfrm: Duplicate SPI Handling"), we now create states +and add them to the byspi list with this value. + +__xfrm_state_delete doesn't remove those states from the byspi list, +since they shouldn't be there, and this shows up as a UAF the next +time we go through the byspi list. + +Reported-by: syzbot+a25ee9d20d31e483ba7b@syzkaller.appspotmail.com +Closes: https://syzkaller.appspot.com/bug?extid=a25ee9d20d31e483ba7b +Fixes: 94f39804d891 ("xfrm: Duplicate SPI Handling") +Signed-off-by: Sabrina Dubroca +Reviewed-by: Simon Horman +Signed-off-by: Steffen Klassert +[ Brennan : Applied to v6.1 ] +Signed-off-by: Brennan Lamoreaux +--- + net/xfrm/xfrm_state.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c +index 181c10252180..cb7fbb15e744 100644 +--- a/net/xfrm/xfrm_state.c ++++ b/net/xfrm/xfrm_state.c +@@ -2082,6 +2082,8 @@ int xfrm_alloc_spi(struct xfrm_state *x, u32 low, u32 high) + + for (h = 0; h < range; h++) { + u32 spi = (low == high) ? low : low + prandom_u32_max(high - low + 1); ++ if (spi == 0) ++ goto next; + newspi = htonl(spi); + + spin_lock_bh(&net->xfrm.xfrm_state_lock); +@@ -2097,6 +2099,7 @@ int xfrm_alloc_spi(struct xfrm_state *x, u32 low, u32 high) + xfrm_state_put(x0); + spin_unlock_bh(&net->xfrm.xfrm_state_lock); + ++next: + if (signal_pending(current)) { + err = -ERESTARTSYS; + goto unlock; +-- +2.40.4 diff --git a/SPECS/linux/6.1/CVE/0002-bnxt_en-Fix-memory-corruption-when-FW-resources-chan.patch b/SPECS/linux/6.1/CVE/0002-bnxt_en-Fix-memory-corruption-when-FW-resources-chan.patch new file mode 100644 index 0000000000..e0d93a1d0f --- /dev/null +++ b/SPECS/linux/6.1/CVE/0002-bnxt_en-Fix-memory-corruption-when-FW-resources-chan.patch @@ -0,0 +1,104 @@ +From baaf21d853da3cfd4ad043600747ceae8a49fae7 Mon Sep 17 00:00:00 2001 +From: Sreekanth Reddy +Date: Mon, 25 Aug 2025 10:59:25 -0700 +Subject: [PATCH 2/2] bnxt_en: Fix memory corruption when FW resources change + during ifdown + +[ Upstream commit 2747328ba2714f1a7454208dbbc1dc0631990b4a ] + +bnxt_set_dflt_rings() assumes that it is always called before any TC has +been created. So it doesn't take bp->num_tc into account and assumes +that it is always 0 or 1. + +In the FW resource or capability change scenario, the FW will return +flags in bnxt_hwrm_if_change() that will cause the driver to +reinitialize and call bnxt_cancel_reservations(). This will lead to +bnxt_init_dflt_ring_mode() calling bnxt_set_dflt_rings() and bp->num_tc +may be greater than 1. This will cause bp->tx_ring[] to be sized too +small and cause memory corruption in bnxt_alloc_cp_rings(). + +Fix it by properly scaling the TX rings by bp->num_tc in the code +paths mentioned above. Add 2 helper functions to determine +bp->tx_nr_rings and bp->tx_nr_rings_per_tc. + +Fixes: ec5d31e3c15d ("bnxt_en: Handle firmware reset status during IF_UP.") +Reviewed-by: Kalesh AP +Reviewed-by: Andy Gospodarek +Signed-off-by: Sreekanth Reddy +Signed-off-by: Michael Chan +Link: https://patch.msgid.link/20250825175927.459987-2-michael.chan@broadcom.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +[ Brennan : Backported to v6.1 ] +Signed-off-by: Brennan Lamoreaux +--- + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 21 ++++++++++++++++----- + 1 file changed, 16 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +index 5d85f04f9ed6..c5b10ce352fc 100644 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +@@ -10475,6 +10475,17 @@ static int bnxt_reinit_after_abort(struct bnxt *bp) + return rc; + } + ++static int bnxt_tx_nr_rings(struct bnxt *bp) ++{ ++ return bp->num_tc ? bp->tx_nr_rings_per_tc * bp->num_tc : ++ bp->tx_nr_rings_per_tc; ++} ++ ++static int bnxt_tx_nr_rings_per_tc(struct bnxt *bp) ++{ ++ return bp->num_tc ? bp->tx_nr_rings / bp->num_tc : bp->tx_nr_rings; ++} ++ + static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init) + { + int rc = 0; +@@ -13421,7 +13432,7 @@ static void bnxt_trim_dflt_sh_rings(struct bnxt *bp) + bp->cp_nr_rings = min_t(int, bp->tx_nr_rings_per_tc, bp->rx_nr_rings); + bp->rx_nr_rings = bp->cp_nr_rings; + bp->tx_nr_rings_per_tc = bp->cp_nr_rings; +- bp->tx_nr_rings = bp->tx_nr_rings_per_tc; ++ bp->tx_nr_rings = bnxt_tx_nr_rings(bp); + } + + static int bnxt_set_dflt_rings(struct bnxt *bp, bool sh) +@@ -13452,12 +13463,12 @@ static int bnxt_set_dflt_rings(struct bnxt *bp, bool sh) + bnxt_trim_dflt_sh_rings(bp); + else + bp->cp_nr_rings = bp->tx_nr_rings_per_tc + bp->rx_nr_rings; +- bp->tx_nr_rings = bp->tx_nr_rings_per_tc; ++ bp->tx_nr_rings = bnxt_tx_nr_rings(bp); + + rc = __bnxt_reserve_rings(bp); + if (rc && rc != -ENODEV) + netdev_warn(bp->dev, "Unable to reserve tx rings\n"); +- bp->tx_nr_rings_per_tc = bp->tx_nr_rings; ++ bp->tx_nr_rings_per_tc = bnxt_tx_nr_rings_per_tc(bp); + if (sh) + bnxt_trim_dflt_sh_rings(bp); + +@@ -13466,7 +13477,7 @@ static int bnxt_set_dflt_rings(struct bnxt *bp, bool sh) + rc = __bnxt_reserve_rings(bp); + if (rc && rc != -ENODEV) + netdev_warn(bp->dev, "2nd rings reservation failed.\n"); +- bp->tx_nr_rings_per_tc = bp->tx_nr_rings; ++ bp->tx_nr_rings_per_tc = bnxt_tx_nr_rings_per_tc(bp); + } + if (BNXT_CHIP_TYPE_NITRO_A0(bp)) { + bp->rx_nr_rings++; +@@ -13500,7 +13511,7 @@ static int bnxt_init_dflt_ring_mode(struct bnxt *bp) + if (rc) + goto init_dflt_ring_err; + +- bp->tx_nr_rings_per_tc = bp->tx_nr_rings; ++ bp->tx_nr_rings_per_tc = bnxt_tx_nr_rings_per_tc(bp); + + bnxt_set_dflt_rfs(bp); + +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0002-bpf-Add-BPF_PROG_TYPE_CGROUP_SKB-attach-type-enforce.patch b/SPECS/linux/6.1/CVE/0002-bpf-Add-BPF_PROG_TYPE_CGROUP_SKB-attach-type-enforce.patch new file mode 100644 index 0000000000..439ba047ea --- /dev/null +++ b/SPECS/linux/6.1/CVE/0002-bpf-Add-BPF_PROG_TYPE_CGROUP_SKB-attach-type-enforce.patch @@ -0,0 +1,47 @@ +From: Stanislav Fomichev +Date: Fri, 26 Apr 2024 16:16:18 -0700 +Subject: [PATCH] bpf: Add BPF_PROG_TYPE_CGROUP_SKB attach type enforcement in + BPF_LINK_CREATE + +[ Upstream commit 543576ec15b17c0c93301ac8297333c7b6e84ac7 ] + +bpf_prog_attach uses attach_type_to_prog_type to enforce proper +attach type for BPF_PROG_TYPE_CGROUP_SKB. link_create uses +bpf_prog_get and relies on bpf_prog_attach_check_attach_type +to properly verify prog_type <> attach_type association. + +Add missing attach_type enforcement for the link_create case. +Otherwise, it's currently possible to attach cgroup_skb prog +types to other cgroup hooks. + +Fixes: af6eea57437a ("bpf: Implement bpf_link-based cgroup BPF program attachment") +Link: https://lore.kernel.org/bpf/0000000000004792a90615a1dde0@google.com/ +Reported-by: syzbot+838346b979830606c854@syzkaller.appspotmail.com +Signed-off-by: Stanislav Fomichev +Acked-by: Eduard Zingerman +Link: https://lore.kernel.org/r/20240426231621.2716876-2-sdf@google.com +Signed-off-by: Martin KaFai Lau +Signed-off-by: Kuntal Nayak +--- + kernel/bpf/syscall.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c +index 62d483f8d..54680f986 100644 +--- a/kernel/bpf/syscall.c ++++ b/kernel/bpf/syscall.c +@@ -3497,6 +3497,11 @@ static int bpf_prog_attach_check_attach_type(const struct bpf_prog *prog, + * check permissions at attach time. + */ + return -EPERM; ++ ++ ptype = attach_type_to_prog_type(attach_type); ++ if (prog->type != ptype) ++ return -EINVAL; ++ + return prog->enforce_expected_attach_type && + prog->expected_attach_type != attach_type ? + -EINVAL : 0; +-- +2.43.7 + diff --git a/SPECS/linux/6.1/CVE/0002-ceph-fix-multifs-mds-auth-caps-issue.patch b/SPECS/linux/6.1/CVE/0002-ceph-fix-multifs-mds-auth-caps-issue.patch new file mode 100644 index 0000000000..e73ed03201 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0002-ceph-fix-multifs-mds-auth-caps-issue.patch @@ -0,0 +1,165 @@ +From 27f747254dd91086c5909083708ea5c5b5d7bc12 Mon Sep 17 00:00:00 2001 +From: Kotresh HR +Date: Thu, 11 Sep 2025 15:02:35 +0530 +Subject: [PATCH 2/2] ceph: fix multifs mds auth caps issue + +[ Upstream commit 22c73d52a6d05c5a2053385c0d6cd9984732799d ] + +The mds auth caps check should also validate the +fsname along with the associated caps. Not doing +so would result in applying the mds auth caps of +one fs on to the other fs in a multifs ceph cluster. +The bug causes multiple issues w.r.t user +authentication, following is one such example. + +Steps to Reproduce (on vstart cluster): +1. Create two file systems in a cluster, say 'fsname1' and 'fsname2' +2. Authorize read only permission to the user 'client.usr' on fs 'fsname1' + $ceph fs authorize fsname1 client.usr / r +3. Authorize read and write permission to the same user 'client.usr' on fs 'fsname2' + $ceph fs authorize fsname2 client.usr / rw +4. Update the keyring + $ceph auth get client.usr >> ./keyring + +With above permssions for the user 'client.usr', following is the +expectation. + a. The 'client.usr' should be able to only read the contents + and not allowed to create or delete files on file system 'fsname1'. + b. The 'client.usr' should be able to read/write on file system 'fsname2'. + +But, with this bug, the 'client.usr' is allowed to read/write on file +system 'fsname1'. See below. + +5. Mount the file system 'fsname1' with the user 'client.usr' + $sudo bin/mount.ceph usr@.fsname1=/ /kmnt_fsname1_usr/ +6. Try creating a file on file system 'fsname1' with user 'client.usr'. This + should fail but passes with this bug. + $touch /kmnt_fsname1_usr/file1 +7. Mount the file system 'fsname1' with the user 'client.admin' and create a + file. + $sudo bin/mount.ceph admin@.fsname1=/ /kmnt_fsname1_admin + $echo "data" > /kmnt_fsname1_admin/admin_file1 +8. Try removing an existing file on file system 'fsname1' with the user + 'client.usr'. This shoudn't succeed but succeeds with the bug. + $rm -f /kmnt_fsname1_usr/admin_file1 + +For more information, please take a look at the corresponding mds/fuse patch +and tests added by looking into the tracker mentioned below. + +v2: Fix a possible null dereference in doutc +v3: Don't store fsname from mdsmap, validate against + ceph_mount_options's fsname and use it +v4: Code refactor, better warning message and + fix possible compiler warning + +[ Slava.Dubeyko: "fsname check failed" -> "fsname mismatch" ] + +Link: https://tracker.ceph.com/issues/72167 +Signed-off-by: Kotresh HR +Reviewed-by: Viacheslav Dubeyko +Signed-off-by: Ilya Dryomov +Signed-off-by: Sasha Levin +[Ankit: Backported for v6.1, + skip 'ceph_md5_check_access()' changes which + because this got introduced in v6.10 kernel + https://github.com/torvalds/linux/commit/596afb0b8933ba6ed7227adcc538db26feb25c74 + This is not needed in v6.1. + From https://github.com/torvalds/linux/commit/38d46409c4639a1d659ebfa70e27a8bed6b8ee1d + took required header and converted pr_warn_client -> pr_warn +] +Signed-off-by: Ankit Jain +--- + fs/ceph/mdsmap.c | 15 ++++++++++++++- + fs/ceph/super.c | 14 -------------- + fs/ceph/super.h | 14 ++++++++++++++ + 3 files changed, 28 insertions(+), 15 deletions(-) + +diff --git a/fs/ceph/mdsmap.c b/fs/ceph/mdsmap.c +index 8f93861f0138..837f8f6ae73d 100644 +--- a/fs/ceph/mdsmap.c ++++ b/fs/ceph/mdsmap.c +@@ -11,6 +11,7 @@ + #include + #include + ++#include "mds_client.h" + #include "super.h" + + #define CEPH_MDS_IS_READY(i, ignore_laggy) \ +@@ -353,10 +354,22 @@ struct ceph_mdsmap *ceph_mdsmap_decode(struct ceph_mds_client *mdsc, void **p, + __decode_and_drop_type(p, end, u8, bad_ext); + } + if (mdsmap_ev >= 8) { ++ u32 fsname_len; + /* enabled */ + ceph_decode_8_safe(p, end, m->m_enabled, bad_ext); + /* fs_name */ +- ceph_decode_skip_string(p, end, bad_ext); ++ ceph_decode_32_safe(p, end, fsname_len, bad_ext); ++ ++ /* validate fsname against mds_namespace */ ++ if (!namespace_equals(mdsc->fsc->mount_options, *p, ++ fsname_len)) { ++ pr_warn("fsname %*pE doesn't match mds_namespace %s\n", ++ (int)fsname_len, (char *)*p, ++ mdsc->fsc->mount_options->mds_namespace); ++ goto bad; ++ } ++ /* skip fsname after validation */ ++ ceph_decode_skip_n(p, end, fsname_len, bad); + } + /* damaged */ + if (mdsmap_ev >= 9) { +diff --git a/fs/ceph/super.c b/fs/ceph/super.c +index 0f56e4ba7812..f19872f072cb 100644 +--- a/fs/ceph/super.c ++++ b/fs/ceph/super.c +@@ -235,20 +235,6 @@ static void canonicalize_path(char *path) + path[j] = '\0'; + } + +-/* +- * Check if the mds namespace in ceph_mount_options matches +- * the passed in namespace string. First time match (when +- * ->mds_namespace is NULL) is treated specially, since +- * ->mds_namespace needs to be initialized by the caller. +- */ +-static int namespace_equals(struct ceph_mount_options *fsopt, +- const char *namespace, size_t len) +-{ +- return !(fsopt->mds_namespace && +- (strlen(fsopt->mds_namespace) != len || +- strncmp(fsopt->mds_namespace, namespace, len))); +-} +- + static int ceph_parse_old_source(const char *dev_name, const char *dev_name_end, + struct fs_context *fc) + { +diff --git a/fs/ceph/super.h b/fs/ceph/super.h +index d87483005650..02891e00aef1 100644 +--- a/fs/ceph/super.h ++++ b/fs/ceph/super.h +@@ -100,6 +100,20 @@ struct ceph_mount_options { + char *mon_addr; + }; + ++/* ++ * Check if the mds namespace in ceph_mount_options matches ++ * the passed in namespace string. First time match (when ++ * ->mds_namespace is NULL) is treated specially, since ++ * ->mds_namespace needs to be initialized by the caller. ++ */ ++static inline int namespace_equals(struct ceph_mount_options *fsopt, ++ const char *namespace, size_t len) ++{ ++ return !(fsopt->mds_namespace && ++ (strlen(fsopt->mds_namespace) != len || ++ strncmp(fsopt->mds_namespace, namespace, len))); ++} ++ + /* mount state */ + enum { + CEPH_MOUNT_MOUNTING, +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0002-ethtool-fail-closed-if-we-can-t-get-max-channel-used.patch b/SPECS/linux/6.1/CVE/0002-ethtool-fail-closed-if-we-can-t-get-max-channel-used.patch new file mode 100644 index 0000000000..07d4e8e298 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0002-ethtool-fail-closed-if-we-can-t-get-max-channel-used.patch @@ -0,0 +1,130 @@ +From 2899d58462ba868287d6ff3acad3675e7adf934f Mon Sep 17 00:00:00 2001 +From: Jakub Kicinski +Date: Wed, 10 Jul 2024 10:40:42 -0700 +Subject: [PATCH 2/2] ethtool: fail closed if we can't get max channel used in + indirection tables + +[ Upstream commit 2899d58462ba868287d6ff3acad3675e7adf934f ] + +Commit 0d1b7d6c9274 ("bnxt: fix crashes when reducing ring count with +active RSS contexts") proves that allowing indirection table to contain +channels with out of bounds IDs may lead to crashes. Currently the +max channel check in the core gets skipped if driver can't fetch +the indirection table or when we can't allocate memory. + +Both of those conditions should be extremely rare but if they do +happen we should try to be safe and fail the channel change. + +Reviewed-by: Jacob Keller +Link: https://patch.msgid.link/20240710174043.754664-2-kuba@kernel.org +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +Signed-off-by: Keerthana K +--- + net/ethtool/channels.c | 4 +--- + net/ethtool/common.c | 26 +++++++++++++++----------- + net/ethtool/common.h | 2 +- + net/ethtool/ioctl.c | 4 +--- + 4 files changed, 18 insertions(+), 18 deletions(-) + +diff --git a/net/ethtool/channels.c b/net/ethtool/channels.c +index 4833b3231..23bda1dcc 100644 +--- a/net/ethtool/channels.c ++++ b/net/ethtool/channels.c +@@ -194,9 +194,7 @@ int ethnl_set_channels(struct sk_buff *skb, struct genl_info *info) + */ + if (ethtool_get_max_rxnfc_channel(dev, &max_rxnfc_in_use)) + max_rxnfc_in_use = 0; +- if (!netif_is_rxfh_configured(dev) || +- ethtool_get_max_rxfh_channel(dev, &max_rxfh_in_use)) +- max_rxfh_in_use = 0; ++ max_rxfh_in_use = ethtool_get_max_rxfh_channel(dev); + if (channels.combined_count + channels.rx_count <= max_rxfh_in_use) { + ret = -EINVAL; + GENL_SET_ERR_MSG(info, "requested channel counts are too low for existing indirection table settings"); +diff --git a/net/ethtool/common.c b/net/ethtool/common.c +index d6f387ff6..baeb6a9bf 100644 +--- a/net/ethtool/common.c ++++ b/net/ethtool/common.c +@@ -405,35 +405,39 @@ int ethtool_get_max_rxnfc_channel(struct net_device *dev, u64 *max) + return err; + } + +-int ethtool_get_max_rxfh_channel(struct net_device *dev, u32 *max) ++u32 ethtool_get_max_rxfh_channel(struct net_device *dev) + { +- u32 dev_size, current_max = 0; ++ u32 dev_size, current_max; + u32 *indir; + int ret; + ++ if (!netif_is_rxfh_configured(dev)) ++ return 0; ++ + if (!dev->ethtool_ops->get_rxfh_indir_size || + !dev->ethtool_ops->get_rxfh) +- return -EOPNOTSUPP; ++ return 0; + dev_size = dev->ethtool_ops->get_rxfh_indir_size(dev); + if (dev_size == 0) +- return -EOPNOTSUPP; ++ return 0; + + indir = kcalloc(dev_size, sizeof(indir[0]), GFP_USER); + if (!indir) +- return -ENOMEM; ++ return U32_MAX; + + ret = dev->ethtool_ops->get_rxfh(dev, indir, NULL, NULL); +- if (ret) +- goto out; ++ if (ret) { ++ current_max = U32_MAX; ++ goto out_free; ++ } + ++ current_max = 0; + while (dev_size--) + current_max = max(current_max, indir[dev_size]); + +- *max = current_max; +- +-out: ++out_free: + kfree(indir); +- return ret; ++ return current_max; + } + + int ethtool_check_ops(const struct ethtool_ops *ops) +diff --git a/net/ethtool/common.h b/net/ethtool/common.h +index 90b375122..98581c3de 100644 +--- a/net/ethtool/common.h ++++ b/net/ethtool/common.h +@@ -35,7 +35,7 @@ int __ethtool_get_link(struct net_device *dev); + bool convert_legacy_settings_to_link_ksettings( + struct ethtool_link_ksettings *link_ksettings, + const struct ethtool_cmd *legacy_settings); +-int ethtool_get_max_rxfh_channel(struct net_device *dev, u32 *max); ++u32 ethtool_get_max_rxfh_channel(struct net_device *dev); + int ethtool_get_max_rxnfc_channel(struct net_device *dev, u64 *max); + int __ethtool_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info); + +diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c +index 08ec984b4..fa4673c2a 100644 +--- a/net/ethtool/ioctl.c ++++ b/net/ethtool/ioctl.c +@@ -1806,9 +1806,7 @@ static noinline_for_stack int ethtool_set_channels(struct net_device *dev, + * indirection table/rxnfc settings */ + if (ethtool_get_max_rxnfc_channel(dev, &max_rxnfc_in_use)) + max_rxnfc_in_use = 0; +- if (!netif_is_rxfh_configured(dev) || +- ethtool_get_max_rxfh_channel(dev, &max_rxfh_in_use)) +- max_rxfh_in_use = 0; ++ max_rxfh_in_use = ethtool_get_max_rxfh_channel(dev); + if (channels.combined_count + channels.rx_count <= + max_t(u64, max_rxnfc_in_use, max_rxfh_in_use)) + return -EINVAL; +-- +2.39.4 + diff --git a/SPECS/linux/6.1/CVE/0002-ksmbd-fix-use-after-free-in-SMB-request-handling.patch b/SPECS/linux/6.1/CVE/0002-ksmbd-fix-use-after-free-in-SMB-request-handling.patch new file mode 100644 index 0000000000..a332875736 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0002-ksmbd-fix-use-after-free-in-SMB-request-handling.patch @@ -0,0 +1,65 @@ +From e34dd9af349f786e9c5525d6baa8022c88ba5e4d Mon Sep 17 00:00:00 2001 +From: Yunseong Kim +Date: Mon, 25 Nov 2024 16:45:55 +0900 +Subject: [PATCH] ksmbd: fix use-after-free in SMB request handling + +[ Upstream commit 9a8c5d89d327ff58e9b2517f8a6afb4181d32c6e ] + +A race condition exists between SMB request handling in +`ksmbd_conn_handler_loop()` and the freeing of `ksmbd_conn` in the +workqueue handler `handle_ksmbd_work()`. This leads to a UAF. +- KASAN: slab-use-after-free Read in handle_ksmbd_work +- KASAN: slab-use-after-free in rtlock_slowlock_locked + +This race condition arises as follows: +- `ksmbd_conn_handler_loop()` waits for `conn->r_count` to reach zero: + `wait_event(conn->r_count_q, atomic_read(&conn->r_count) == 0);` +- Meanwhile, `handle_ksmbd_work()` decrements `conn->r_count` using + `atomic_dec_return(&conn->r_count)`, and if it reaches zero, calls + `ksmbd_conn_free()`, which frees `conn`. +- However, after `handle_ksmbd_work()` decrements `conn->r_count`, + it may still access `conn->r_count_q` in the following line: + `waitqueue_active(&conn->r_count_q)` or `wake_up(&conn->r_count_q)` + This results in a UAF, as `conn` has already been freed. + +The discovery of this UAF can be referenced in the following PR for +syzkaller's support for SMB requests. +Link: https://github.com/google/syzkaller/pull/5524 + +Fixes: ee426bfb9d09 ("ksmbd: add refcnt to ksmbd_conn struct") +Cc: linux-cifs@vger.kernel.org +Cc: stable@vger.kernel.org # v6.6.55+, v6.10.14+, v6.11.3+ +Cc: syzkaller@googlegroups.com +Signed-off-by: Yunseong Kim +Acked-by: Namjae Jeon +Signed-off-by: Steve French + +[Srinidhi Rao: Backported this fix to v6.1.x] +Signed-off-by: srinidhira0 +[Ankit: Refreshed for 6.1.183 kernel. Dropped the sibling refcnt patch +(already upstream) and switched this fix to use the existing +ksmbd_conn_get()/put() instead of raw refcnt. Same fix, no logic +change.] +Signed-off-by: Ankit Jain +--- + fs/smb/server/server.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/fs/smb/server/server.c b/fs/smb/server/server.c +index fe797e8fe941..ad47a7ad2d66 100644 +--- a/fs/smb/server/server.c ++++ b/fs/smb/server/server.c +@@ -275,8 +275,10 @@ static void handle_ksmbd_work(struct work_struct *wk) + * disconnection. waitqueue_active is safe because it + * uses atomic operation for condition. + */ ++ ksmbd_conn_get(conn); + if (!atomic_dec_return(&conn->r_count) && waitqueue_active(&conn->r_count_q)) + wake_up(&conn->r_count_q); ++ ksmbd_conn_put(conn); + } + + /** +-- +2.35.6 + diff --git a/SPECS/linux/6.1/CVE/0002-net-sched-netem-handle-multi-segment-skb-in-corrupti.patch b/SPECS/linux/6.1/CVE/0002-net-sched-netem-handle-multi-segment-skb-in-corrupti.patch new file mode 100644 index 0000000000..8242e0253f --- /dev/null +++ b/SPECS/linux/6.1/CVE/0002-net-sched-netem-handle-multi-segment-skb-in-corrupti.patch @@ -0,0 +1,54 @@ +From e8be7cdedc41ff28876d66b566770929d03acbb8 Mon Sep 17 00:00:01 2001 +From: Stephen Hemminger +Date: Sat, 9 May 2026 10:03:25 -0700 +Subject: [PATCH] net/sched: netem: handle multi-segment skb in corruption + +[ Upstream commit e8be7cdedc41ff28876d66b566770929d03acbb8 ] + +The packet corruption code only flipped bits in the linear +header portion of the skb, skipping corruption when +skb_headlen() was zero. + +Linearize the whole skb if necessary before corruption. +Extends d64cb81dcbd5 ("net/sched: sch_netem: fix out-of-bounds access +in packet corruption") with a more general solution. + +Signed-off-by: Stephen Hemminger +Link: https://patch.msgid.link/20260509171123.307549-5-stephen@networkplumber.org +Signed-off-by: Paolo Abeni +[Ankit: Backported for v6.1.175. v6.1.x uses prandom_u32_max() in place + of get_random_u32_below().] +Signed-off-by: Ankit Jain +--- + net/sched/sch_netem.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c +index 5d6e928ab750..89e13659d19f 100644 +--- a/net/sched/sch_netem.c ++++ b/net/sched/sch_netem.c +@@ -501,16 +501,17 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch, + qdisc_qstats_drop(sch); + goto finish_segs; + } +- if (skb->ip_summed == CHECKSUM_PARTIAL && +- skb_checksum_help(skb)) { ++ if (skb_linearize(skb) || ++ (skb->ip_summed == CHECKSUM_PARTIAL && skb_checksum_help(skb))) { + qdisc_drop(skb, sch, to_free); + skb = NULL; + goto finish_segs; + } + +- if (skb_headlen(skb)) +- skb->data[prandom_u32_max(skb_headlen(skb))] ^= +- 1 << prandom_u32_max(8); ++ if (skb->len) { ++ u32 offset = prandom_u32_max(skb->len); ++ skb->data[offset] ^= 1 << prandom_u32_max(8); ++ } + } + + if (unlikely(sch->q.qlen >= sch->limit)) { +-- +2.39.5 diff --git a/SPECS/linux/6.1/CVE/0002-rcu-Fix-racy-re-initialization-of-irq_work-causing-h.patch b/SPECS/linux/6.1/CVE/0002-rcu-Fix-racy-re-initialization-of-irq_work-causing-h.patch new file mode 100644 index 0000000000..1e67b60dc3 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0002-rcu-Fix-racy-re-initialization-of-irq_work-causing-h.patch @@ -0,0 +1,113 @@ +From 7285c495da35553ed11ec28cd72d695ca8b26407 Mon Sep 17 00:00:00 2001 +From: Frederic Weisbecker +Date: Fri, 8 Aug 2025 19:03:22 +0200 +Subject: [PATCH 2/2] rcu: Fix racy re-initialization of irq_work causing hangs + +[ Upstream commit 61399e0c5410567ef60cb1cda34cca42903842e3 ] + +RCU re-initializes the deferred QS irq work everytime before attempting +to queue it. However there are situations where the irq work is +attempted to be queued even though it is already queued. In that case +re-initializing messes-up with the irq work queue that is about to be +handled. + +The chances for that to happen are higher when the architecture doesn't +support self-IPIs and irq work are then all lazy, such as with the +following sequence: + +1) rcu_read_unlock() is called when IRQs are disabled and there is a + grace period involving blocked tasks on the node. The irq work + is then initialized and queued. + +2) The related tasks are unblocked and the CPU quiescent state + is reported. rdp->defer_qs_iw_pending is reset to DEFER_QS_IDLE, + allowing the irq work to be requeued in the future (note the previous + one hasn't fired yet). + +3) A new grace period starts and the node has blocked tasks. + +4) rcu_read_unlock() is called when IRQs are disabled again. The irq work + is re-initialized (but it's queued! and its node is cleared) and + requeued. Which means it's requeued to itself. + +5) The irq work finally fires with the tick. But since it was requeued + to itself, it loops and hangs. + +Fix this with initializing the irq work only once before the CPU boots. + +Fixes: b41642c87716 ("rcu: Fix rcu_read_unlock() deadloop due to IRQ work") +Reported-by: kernel test robot +Closes: https://lore.kernel.org/oe-lkp/202508071303.c1134cce-lkp@intel.com +Signed-off-by: Frederic Weisbecker +Reviewed-by: Joel Fernandes +Signed-off-by: Neeraj Upadhyay (AMD) +Signed-off-by: Greg Kroah-Hartman +[Ankit: Backported for v6.1, no change] +Signed-off-by: Ankit Jain +--- + kernel/rcu/tree.c | 2 ++ + kernel/rcu/tree.h | 1 + + kernel/rcu/tree_plugin.h | 8 ++++++-- + 3 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c +index 38ab28a53e10..f421ae6d24ac 100644 +--- a/kernel/rcu/tree.c ++++ b/kernel/rcu/tree.c +@@ -4205,6 +4205,8 @@ int rcutree_prepare_cpu(unsigned int cpu) + rdp->rcu_iw_gp_seq = rdp->gp_seq - 1; + trace_rcu_grace_period(rcu_state.name, rdp->gp_seq, TPS("cpuonl")); + raw_spin_unlock_irqrestore_rcu_node(rnp, flags); ++ ++ rcu_preempt_deferred_qs_init(rdp); + rcu_spawn_one_boost_kthread(rnp); + rcu_spawn_cpu_nocb_kthread(cpu); + WRITE_ONCE(rcu_state.n_online_cpus, rcu_state.n_online_cpus + 1); +diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h +index 4770ff998f27..9169882636d6 100644 +--- a/kernel/rcu/tree.h ++++ b/kernel/rcu/tree.h +@@ -442,6 +442,7 @@ static int rcu_print_task_exp_stall(struct rcu_node *rnp); + static void rcu_preempt_check_blocked_tasks(struct rcu_node *rnp); + static void rcu_flavor_sched_clock_irq(int user); + static void dump_blkd_tasks(struct rcu_node *rnp, int ncheck); ++static void rcu_preempt_deferred_qs_init(struct rcu_data *rdp); + static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags); + static void rcu_preempt_boost_start_gp(struct rcu_node *rnp); + static bool rcu_is_callbacks_kthread(struct rcu_data *rdp); +diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h +index e61ade810935..5f6788c3b906 100644 +--- a/kernel/rcu/tree_plugin.h ++++ b/kernel/rcu/tree_plugin.h +@@ -687,8 +687,6 @@ static void rcu_read_unlock_special(struct task_struct *t) + cpu_online(rdp->cpu)) { + // Get scheduler to re-evaluate and call hooks. + // If !IRQ_WORK, FQS scan will eventually IPI. +- rdp->defer_qs_iw = +- IRQ_WORK_INIT_HARD(rcu_preempt_deferred_qs_handler); + rdp->defer_qs_iw_pending = DEFER_QS_PENDING; + irq_work_queue_on(&rdp->defer_qs_iw, rdp->cpu); + } +@@ -828,6 +826,10 @@ dump_blkd_tasks(struct rcu_node *rnp, int ncheck) + } + } + ++static void rcu_preempt_deferred_qs_init(struct rcu_data *rdp) ++{ ++ rdp->defer_qs_iw = IRQ_WORK_INIT_HARD(rcu_preempt_deferred_qs_handler); ++} + #else /* #ifdef CONFIG_PREEMPT_RCU */ + + /* +@@ -1027,6 +1029,8 @@ dump_blkd_tasks(struct rcu_node *rnp, int ncheck) + WARN_ON_ONCE(!list_empty(&rnp->blkd_tasks)); + } + ++static void rcu_preempt_deferred_qs_init(struct rcu_data *rdp) { } ++ + #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ + + /* +-- +2.40.4 + diff --git a/SPECS/linux/6.1/CVE/0002-smb-client-fix-use-after-free-in-smb2_query_info_com.patch b/SPECS/linux/6.1/CVE/0002-smb-client-fix-use-after-free-in-smb2_query_info_com.patch new file mode 100644 index 0000000000..26c4710db8 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0002-smb-client-fix-use-after-free-in-smb2_query_info_com.patch @@ -0,0 +1,291 @@ +From 480151c56ede70e0da626d873a6ed3801d07ddf9 Mon Sep 17 00:00:00 2001 +From: Paulo Alcantara +Date: Fri, 12 Dec 2025 18:17:38 +0000 +Subject: [PATCH] smb: client: fix use-after-free in smb2_query_info_compound() + +commit 5c86919455c1edec99ebd3338ad213b59271a71b upstream. + +The following UAF was triggered when running fstests generic/072 with +KASAN enabled against Windows Server 2022 and mount options +'multichannel,max_channels=2,vers=3.1.1,mfsymlinks,noperm' + + BUG: KASAN: slab-use-after-free in smb2_query_info_compound+0x423/0x6d0 [cifs] + Read of size 8 at addr ffff888014941048 by task xfs_io/27534 + + CPU: 0 PID: 27534 Comm: xfs_io Not tainted 6.6.0-rc7 #1 + Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS + rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014 + Call Trace: + dump_stack_lvl+0x4a/0x80 + print_report+0xcf/0x650 + ? srso_alias_return_thunk+0x5/0x7f + ? srso_alias_return_thunk+0x5/0x7f + ? __phys_addr+0x46/0x90 + kasan_report+0xda/0x110 + ? smb2_query_info_compound+0x423/0x6d0 [cifs] + ? smb2_query_info_compound+0x423/0x6d0 [cifs] + smb2_query_info_compound+0x423/0x6d0 [cifs] + ? __pfx_smb2_query_info_compound+0x10/0x10 [cifs] + ? srso_alias_return_thunk+0x5/0x7f + ? __stack_depot_save+0x39/0x480 + ? kasan_save_stack+0x33/0x60 + ? kasan_set_track+0x25/0x30 + ? ____kasan_slab_free+0x126/0x170 + smb2_queryfs+0xc2/0x2c0 [cifs] + ? __pfx_smb2_queryfs+0x10/0x10 [cifs] + ? __pfx___lock_acquire+0x10/0x10 + smb311_queryfs+0x210/0x220 [cifs] + ? __pfx_smb311_queryfs+0x10/0x10 [cifs] + ? srso_alias_return_thunk+0x5/0x7f + ? __lock_acquire+0x480/0x26c0 + ? lock_release+0x1ed/0x640 + ? srso_alias_return_thunk+0x5/0x7f + ? do_raw_spin_unlock+0x9b/0x100 + cifs_statfs+0x18c/0x4b0 [cifs] + statfs_by_dentry+0x9b/0xf0 + fd_statfs+0x4e/0xb0 + __do_sys_fstatfs+0x7f/0xe0 + ? __pfx___do_sys_fstatfs+0x10/0x10 + ? srso_alias_return_thunk+0x5/0x7f + ? lockdep_hardirqs_on_prepare+0x136/0x200 + ? srso_alias_return_thunk+0x5/0x7f + do_syscall_64+0x3f/0x90 + entry_SYSCALL_64_after_hwframe+0x6e/0xd8 + + Allocated by task 27534: + kasan_save_stack+0x33/0x60 + kasan_set_track+0x25/0x30 + __kasan_kmalloc+0x8f/0xa0 + open_cached_dir+0x71b/0x1240 [cifs] + + smb2_query_info_compound+0x5c3/0x6d0 [cifs] + smb2_queryfs+0xc2/0x2c0 [cifs] + smb311_queryfs+0x210/0x220 [cifs] + cifs_statfs+0x18c/0x4b0 [cifs] + statfs_by_dentry+0x9b/0xf0 + fd_statfs+0x4e/0xb0 + __do_sys_fstatfs+0x7f/0xe0 + do_syscall_64+0x3f/0x90 + entry_SYSCALL_64_after_hwframe+0x6e/0xd8 + + Freed by task 27534: + kasan_save_stack+0x33/0x60 + kasan_set_track+0x25/0x30 + kasan_save_free_info+0x2b/0x50 + ____kasan_slab_free+0x126/0x170 + slab_free_freelist_hook+0xd0/0x1e0 + __kmem_cache_free+0x9d/0x1b0 + open_cached_dir+0xff5/0x1240 [cifs] + smb2_query_info_compound+0x5c3/0x6d0 [cifs] + smb2_queryfs+0xc2/0x2c0 [cifs] + +This is a race between open_cached_dir() and cached_dir_lease_break() +where the cache entry for the open directory handle receives a lease +break while creating it. And before returning from open_cached_dir(), +we put the last reference of the new @cfid because of +!@cfid->has_lease. + +Besides the UAF, while running xfstests a lot of missed lease breaks +have been noticed in tests that run several concurrent statfs(2) calls +on those cached fids + + CIFS: VFS: \\w22-root1.gandalf.test No task to wake, unknown frame... + CIFS: VFS: \\w22-root1.gandalf.test Cmd: 18 Err: 0x0 Flags: 0x1... + CIFS: VFS: \\w22-root1.gandalf.test smb buf 00000000715bfe83 len 108 + CIFS: VFS: Dump pending requests: + CIFS: VFS: \\w22-root1.gandalf.test No task to wake, unknown frame... + CIFS: VFS: \\w22-root1.gandalf.test Cmd: 18 Err: 0x0 Flags: 0x1... + CIFS: VFS: \\w22-root1.gandalf.test smb buf 000000005aa7316e len 108 + ... + +To fix both, in open_cached_dir() ensure that @cfid->has_lease is set +right before sending out compounded request so that any potential +lease break will be get processed by demultiplex thread while we're +still caching @cfid. And, if open failed for some reason, re-check +@cfid->has_lease to decide whether or not put lease reference. + +Cc: stable@vger.kernel.org +Signed-off-by: Paulo Alcantara (SUSE) +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +[ Brennan : Backported to v6.1 ] +Signed-off-by: Brennan Lamoreaux +--- + fs/smb/client/cached_dir.c | 84 ++++++++++++++++++++++---------------- + 1 file changed, 49 insertions(+), 35 deletions(-) + +diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c +index f4e0bbdf3..1dd1e7335 100644 +--- a/fs/smb/client/cached_dir.c ++++ b/fs/smb/client/cached_dir.c +@@ -30,7 +30,7 @@ static struct cached_fid *find_or_create_cached_dir(struct cached_fids *cfids, + * fully cached or it may be in the process of + * being deleted due to a lease break. + */ +- if (!cfid->has_lease) { ++ if (!cfid->time || !cfid->has_lease) { + spin_unlock(&cfids->cfid_list_lock); + return NULL; + } +@@ -191,11 +191,21 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + npath = path_no_prefix(cifs_sb, path); + if (IS_ERR(npath)) { + rc = PTR_ERR(npath); +- kfree(utf16_path); +- return rc; ++ goto out; + } + cfid->tcon = tcon; + ++ if (!npath[0]) { ++ dentry = dget(cifs_sb->root); ++ } else { ++ dentry = path_to_dentry(cifs_sb, npath); ++ if (IS_ERR(dentry)) { ++ rc = -ENOENT; ++ goto out; ++ } ++ } ++ cfid->dentry = dentry; ++ + /* + * We do not hold the lock for the open because in case + * SMB2_open needs to reconnect. +@@ -249,6 +259,15 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + + smb2_set_related(&rqst[1]); + ++ /* ++ * Set @cfid->has_lease to true before sending out compounded request so ++ * its lease reference can be put in cached_dir_lease_break() due to a ++ * potential lease break right after the request is sent or while @cfid ++ * is still being cached. Concurrent processes won't be to use it yet ++ * due to @cfid->time being zero. ++ */ ++ cfid->has_lease = true; ++ + rc = compound_send_recv(xid, ses, server, + flags, 2, rqst, + resp_buftype, rsp_iov); +@@ -262,6 +281,8 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + } + cfid->is_open = true; + ++ spin_lock(&cfids->cfid_list_lock); ++ + o_rsp = (struct smb2_create_rsp *)rsp_iov[0].iov_base; + oparms.fid->persistent_fid = o_rsp->PersistentFileId; + oparms.fid->volatile_fid = o_rsp->VolatileFileId; +@@ -269,8 +290,11 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + oparms.fid->mid = le64_to_cpu(o_rsp->hdr.MessageId); + #endif /* CIFS_DEBUG2 */ + +- if (o_rsp->OplockLevel != SMB2_OPLOCK_LEVEL_LEASE) ++ rc = -EINVAL; ++ if (o_rsp->OplockLevel != SMB2_OPLOCK_LEVEL_LEASE) { ++ spin_unlock(&cfids->cfid_list_lock); + goto oshr_free; ++ } + + rc = smb2_parse_contexts(server, rsp_iov, + &oparms.fid->epoch, +@@ -278,11 +302,15 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + &oplock, NULL, NULL); + if (rc) + goto oshr_free; +- if (!(oplock & SMB2_LEASE_READ_CACHING_HE)) ++ if (!(oplock & SMB2_LEASE_READ_CACHING_HE)) { ++ spin_unlock(&cfids->cfid_list_lock); + goto oshr_free; ++ } + qi_rsp = (struct smb2_query_info_rsp *)rsp_iov[1].iov_base; +- if (le32_to_cpu(qi_rsp->OutputBufferLength) < sizeof(struct smb2_file_all_info)) ++ if (le32_to_cpu(qi_rsp->OutputBufferLength) < sizeof(struct smb2_file_all_info)) { ++ spin_unlock(&cfids->cfid_list_lock); + goto oshr_free; ++ } + if (!smb2_validate_and_copy_iov( + le16_to_cpu(qi_rsp->OutputBufferOffset), + sizeof(struct smb2_file_all_info), +@@ -290,37 +318,24 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + (char *)&cfid->file_all_info)) + cfid->file_all_info_is_valid = true; + +- if (!npath[0]) +- dentry = dget(cifs_sb->root); +- else { +- dentry = path_to_dentry(cifs_sb, npath); +- if (IS_ERR(dentry)) { +- rc = -ENOENT; +- goto oshr_free; +- } +- } +- spin_lock(&cfids->cfid_list_lock); +- cfid->dentry = dentry; + cfid->time = jiffies; +- cfid->has_lease = true; + spin_unlock(&cfids->cfid_list_lock); ++ /* At this point the directory handle is fully cached */ ++ rc = 0; + + oshr_free: +- kfree(utf16_path); + SMB2_open_free(&rqst[0]); + SMB2_query_info_free(&rqst[1]); + free_rsp_buf(resp_buftype[0], rsp_iov[0].iov_base); + free_rsp_buf(resp_buftype[1], rsp_iov[1].iov_base); +- spin_lock(&cfids->cfid_list_lock); +- if (!cfid->has_lease) { +- if (rc) { +- if (cfid->on_list) { +- list_del(&cfid->entry); +- cfid->on_list = false; +- cfids->num_entries--; +- } +- rc = -ENOENT; +- } else { ++ if (rc) { ++ spin_lock(&cfids->cfid_list_lock); ++ if (cfid->on_list) { ++ list_del(&cfid->entry); ++ cfid->on_list = false; ++ cfids->num_entries--; ++ } ++ if (cfid->has_lease) { + /* + * We are guaranteed to have two references at this + * point. One for the caller and one for a potential +@@ -328,25 +343,24 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + * will be closed when the caller closes the cached + * handle. + */ ++ cfid->has_lease = false; + spin_unlock(&cfids->cfid_list_lock); + kref_put(&cfid->refcount, smb2_close_cached_fid); + goto out; + } ++ spin_unlock(&cfids->cfid_list_lock); + } +- spin_unlock(&cfids->cfid_list_lock); ++out: + if (rc) { + if (cfid->is_open) + SMB2_close(0, cfid->tcon, cfid->fid.persistent_fid, + cfid->fid.volatile_fid); + free_cached_dir(cfid); +- cfid = NULL; +- } +-out: +- if (rc == 0) { ++ } else { + *ret_cfid = cfid; + atomic_inc(&tcon->num_remote_opens); + } +- ++ kfree(utf16_path); + return rc; + } + +-- +2.43.7 + diff --git a/SPECS/linux/6.1/CVE/0002-x86-mm-Do-not-shuffle-CPU-entry-areas-without-KASLR.patch b/SPECS/linux/6.1/CVE/0002-x86-mm-Do-not-shuffle-CPU-entry-areas-without-KASLR.patch new file mode 100644 index 0000000000..ae4056214f --- /dev/null +++ b/SPECS/linux/6.1/CVE/0002-x86-mm-Do-not-shuffle-CPU-entry-areas-without-KASLR.patch @@ -0,0 +1,61 @@ +From 53acba99c876d36136f9bf10caed24dc7d1c934f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michal=20Koutn=C3=BD?= +Date: Mon, 6 Mar 2023 20:31:44 +0100 +Subject: [PATCH 2/2] x86/mm: Do not shuffle CPU entry areas without KASLR +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit a3f547addcaa10df5a226526bc9e2d9a94542344 upstream. + +The commit 97e3d26b5e5f ("x86/mm: Randomize per-cpu entry area") fixed +an omission of KASLR on CPU entry areas. It doesn't take into account +KASLR switches though, which may result in unintended non-determinism +when a user wants to avoid it (e.g. debugging, benchmarking). + +Generate only a single combination of CPU entry areas offsets -- the +linear array that existed prior randomization when KASLR is turned off. + +Since we have 3f148f331814 ("x86/kasan: Map shadow for percpu pages on +demand") and followups, we can use the more relaxed guard +kasrl_enabled() (in contrast to kaslr_memory_enabled()). + +Fixes: 97e3d26b5e5f ("x86/mm: Randomize per-cpu entry area") +Signed-off-by: Michal Koutný +Signed-off-by: Dave Hansen +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/all/20230306193144.24605-1-mkoutny%40suse.com +[Ankit: Backported the change for v6.1.x] +Signed-off-by: Ankit Jain +--- + arch/x86/mm/cpu_entry_area.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/arch/x86/mm/cpu_entry_area.c b/arch/x86/mm/cpu_entry_area.c +index 20844cf14..4d7fba2b2 100644 +--- a/arch/x86/mm/cpu_entry_area.c ++++ b/arch/x86/mm/cpu_entry_area.c +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + + static DEFINE_PER_CPU_PAGE_ALIGNED(struct entry_stack_page, entry_stack_storage); + +@@ -28,6 +29,12 @@ static __init void init_cea_offsets(void) + unsigned int max_cea; + unsigned int i, j; + ++ if (!kaslr_enabled()) { ++ for_each_possible_cpu(i) ++ per_cpu(_cea_offset, i) = i; ++ return; ++ } ++ + max_cea = (CPU_ENTRY_AREA_MAP_SIZE - PAGE_SIZE) / CPU_ENTRY_AREA_SIZE; + + /* O(sodding terrible) */ +-- +2.23.1 + diff --git a/SPECS/linux/6.1/CVE/0003-net-mlx5-Reload-only-IB-representors-upon-lag-disabl.patch b/SPECS/linux/6.1/CVE/0003-net-mlx5-Reload-only-IB-representors-upon-lag-disabl.patch new file mode 100644 index 0000000000..b9aa57b3bd --- /dev/null +++ b/SPECS/linux/6.1/CVE/0003-net-mlx5-Reload-only-IB-representors-upon-lag-disabl.patch @@ -0,0 +1,210 @@ +From d7454dc5223ce88822352f3be23255383ce8cdc0 Mon Sep 17 00:00:00 2001 +From: Maher Sanalla +Date: Thu, 9 May 2024 14:29:49 +0300 +Subject: [PATCH 3/5] net/mlx5: Reload only IB representors upon lag + disable/enable + +[ Upstream commit 0f06228d4a2dcc1fca5b3ddb0eefa09c05b102c4 ] + +On lag disable, the bond IB device along with all of its +representors are destroyed, and then the slaves' representors get reloaded. + +In case the slave IB representor load fails, the eswitch error flow +unloads all representors, including ethernet representors, where the +netdevs get detached and removed from lag bond. Such flow is inaccurate +as the lag driver is not responsible for loading/unloading ethernet +representors. Furthermore, the flow described above begins by holding +lag lock to prevent bond changes during disable flow. However, when +reaching the ethernet representors detachment from lag, the lag lock is +required again, triggering the following deadlock: + +Call trace: +__switch_to+0xf4/0x148 +__schedule+0x2c8/0x7d0 +schedule+0x50/0xe0 +schedule_preempt_disabled+0x18/0x28 +__mutex_lock.isra.13+0x2b8/0x570 +__mutex_lock_slowpath+0x1c/0x28 +mutex_lock+0x4c/0x68 +mlx5_lag_remove_netdev+0x3c/0x1a0 [mlx5_core] +mlx5e_uplink_rep_disable+0x70/0xa0 [mlx5_core] +mlx5e_detach_netdev+0x6c/0xb0 [mlx5_core] +mlx5e_netdev_change_profile+0x44/0x138 [mlx5_core] +mlx5e_netdev_attach_nic_profile+0x28/0x38 [mlx5_core] +mlx5e_vport_rep_unload+0x184/0x1b8 [mlx5_core] +mlx5_esw_offloads_rep_load+0xd8/0xe0 [mlx5_core] +mlx5_eswitch_reload_reps+0x74/0xd0 [mlx5_core] +mlx5_disable_lag+0x130/0x138 [mlx5_core] +mlx5_lag_disable_change+0x6c/0x70 [mlx5_core] // hold ldev->lock +mlx5_devlink_eswitch_mode_set+0xc0/0x410 [mlx5_core] +devlink_nl_cmd_eswitch_set_doit+0xdc/0x180 +genl_family_rcv_msg_doit.isra.17+0xe8/0x138 +genl_rcv_msg+0xe4/0x220 +netlink_rcv_skb+0x44/0x108 +genl_rcv+0x40/0x58 +netlink_unicast+0x198/0x268 +netlink_sendmsg+0x1d4/0x418 +sock_sendmsg+0x54/0x60 +__sys_sendto+0xf4/0x120 +__arm64_sys_sendto+0x30/0x40 +el0_svc_common+0x8c/0x120 +do_el0_svc+0x30/0xa0 +el0_svc+0x20/0x30 +el0_sync_handler+0x90/0xb8 +el0_sync+0x160/0x180 + +Thus, upon lag enable/disable, load and unload only the IB representors +of the slaves preventing the deadlock mentioned above. + +While at it, refactor the mlx5_esw_offloads_rep_load() function to have +a static helper method for its internal logic, in symmetry with the +representor unload design. + +Fixes: 598fe77df855 ("net/mlx5: Lag, Create shared FDB when in switchdev mode") +Co-developed-by: Mark Bloch +Signed-off-by: Mark Bloch +Signed-off-by: Maher Sanalla +Signed-off-by: Tariq Toukan +Reviewed-by: Simon Horman +Link: https://lore.kernel.org/r/20240509112951.590184-4-tariqt@nvidia.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +[Guru: Backported to 6.1.y version] +Signed-off-by: Guruswamy Basavaiah +[Alexey: Added missing chunk from the upstream commit for eswitch_offload.c + with mlx5_eswitch_reload_ib_reps() function definition] +Signed-off-by: Alexey Makhalov +--- + .../net/ethernet/mellanox/mlx5/core/eswitch.h | 4 +-- + .../mellanox/mlx5/core/eswitch_offloads.c | 28 +++++++++++++-------- + .../net/ethernet/mellanox/mlx5/core/lag/lag.c | 12 ++++----- + 3 files changed, 25 insertions(+), 17 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +index a3daca44f74b..5a16ea8bfd63 100644 +--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h ++++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +@@ -743,7 +743,7 @@ int mlx5_eswitch_offloads_config_single_fdb(struct mlx5_eswitch *master_esw, + struct mlx5_eswitch *slave_esw); + void mlx5_eswitch_offloads_destroy_single_fdb(struct mlx5_eswitch *master_esw, + struct mlx5_eswitch *slave_esw); +-int mlx5_eswitch_reload_reps(struct mlx5_eswitch *esw); ++int mlx5_eswitch_reload_ib_reps(struct mlx5_eswitch *esw); + + static inline int mlx5_eswitch_num_vfs(struct mlx5_eswitch *esw) + { +@@ -795,7 +795,7 @@ mlx5_eswitch_offloads_destroy_single_fdb(struct mlx5_eswitch *master_esw, + struct mlx5_eswitch *slave_esw) {} + + static inline int +-mlx5_eswitch_reload_reps(struct mlx5_eswitch *esw) ++mlx5_eswitch_reload_ib_reps(struct mlx5_eswitch *esw) + { + return 0; + } +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +index 433cdd0a2cf3..1179c625f85d 100644 +--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +@@ -2405,6 +2405,16 @@ int esw_offloads_init_reps(struct mlx5_eswitch *esw) + return err; + } + ++static int __esw_offloads_load_rep(struct mlx5_eswitch *esw, ++ struct mlx5_eswitch_rep *rep, u8 rep_type) ++{ ++ if (atomic_cmpxchg(&rep->rep_data[rep_type].state, ++ REP_REGISTERED, REP_LOADED) == REP_REGISTERED) ++ return esw->offloads.rep_ops[rep_type]->load(esw->dev, rep); ++ ++ return 0; ++} ++ + static void __esw_offloads_unload_rep(struct mlx5_eswitch *esw, + struct mlx5_eswitch_rep *rep, u8 rep_type) + { +@@ -2453,13 +2463,11 @@ int mlx5_esw_offloads_rep_load(struct mlx5_eswitch *esw, u16 vport_num) + int err; + + rep = mlx5_eswitch_get_rep(esw, vport_num); +- for (rep_type = 0; rep_type < NUM_REP_TYPES; rep_type++) +- if (atomic_cmpxchg(&rep->rep_data[rep_type].state, +- REP_REGISTERED, REP_LOADED) == REP_REGISTERED) { +- err = esw->offloads.rep_ops[rep_type]->load(esw->dev, rep); +- if (err) +- goto err_reps; +- } ++ for (rep_type = 0; rep_type < NUM_REP_TYPES; rep_type++) { ++ err = __esw_offloads_load_rep(esw, rep, rep_type); ++ if (err) ++ goto err_reps; ++ } + + return 0; + +@@ -3102,7 +3110,7 @@ static void esw_destroy_offloads_acl_tables(struct mlx5_eswitch *esw) + esw_vport_destroy_offloads_acl_tables(esw, vport); + } + +-int mlx5_eswitch_reload_reps(struct mlx5_eswitch *esw) ++int mlx5_eswitch_reload_ib_reps(struct mlx5_eswitch *esw) + { + struct mlx5_eswitch_rep *rep; + unsigned long i; +@@ -3115,13 +3123,13 @@ int mlx5_eswitch_reload_reps(struct mlx5_eswitch *esw) + if (atomic_read(&rep->rep_data[REP_ETH].state) != REP_LOADED) + return 0; + +- ret = mlx5_esw_offloads_rep_load(esw, MLX5_VPORT_UPLINK); ++ ret = __esw_offloads_load_rep(esw, rep, REP_IB); + if (ret) + return ret; + + mlx5_esw_for_each_rep(esw, i, rep) { + if (atomic_read(&rep->rep_data[REP_ETH].state) == REP_LOADED) +- mlx5_esw_offloads_rep_load(esw, rep->vport); ++ __esw_offloads_load_rep(esw, rep, REP_IB); + } + + return 0; +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c +index 4b4d76108111..e127cbdf2bbf 100644 +--- a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c +@@ -796,9 +796,9 @@ void mlx5_disable_lag(struct mlx5_lag *ldev) + + if (shared_fdb) { + if (!(dev0->priv.flags & MLX5_PRIV_FLAGS_DISABLE_ALL_ADEV)) +- mlx5_eswitch_reload_reps(dev0->priv.eswitch); ++ mlx5_eswitch_reload_ib_reps(dev0->priv.eswitch); + if (!(dev1->priv.flags & MLX5_PRIV_FLAGS_DISABLE_ALL_ADEV)) +- mlx5_eswitch_reload_reps(dev1->priv.eswitch); ++ mlx5_eswitch_reload_ib_reps(dev1->priv.eswitch); + } + } + +@@ -898,17 +898,17 @@ static void mlx5_do_bond(struct mlx5_lag *ldev) + dev0->priv.flags &= ~MLX5_PRIV_FLAGS_DISABLE_IB_ADEV; + mlx5_rescan_drivers_locked(dev0); + +- err = mlx5_eswitch_reload_reps(dev0->priv.eswitch); ++ err = mlx5_eswitch_reload_ib_reps(dev0->priv.eswitch); + if (!err) +- err = mlx5_eswitch_reload_reps(dev1->priv.eswitch); ++ err = mlx5_eswitch_reload_ib_reps(dev1->priv.eswitch); + + if (err) { + dev0->priv.flags |= MLX5_PRIV_FLAGS_DISABLE_IB_ADEV; + mlx5_rescan_drivers_locked(dev0); + mlx5_deactivate_lag(ldev); + mlx5_lag_add_devices(ldev); +- mlx5_eswitch_reload_reps(dev0->priv.eswitch); +- mlx5_eswitch_reload_reps(dev1->priv.eswitch); ++ mlx5_eswitch_reload_ib_reps(dev0->priv.eswitch); ++ mlx5_eswitch_reload_ib_reps(dev1->priv.eswitch); + mlx5_core_err(dev0, "Failed to enable lag\n"); + return; + } +-- +2.39.4 + diff --git a/SPECS/linux/6.1/CVE/0003-smb-Don-t-leak-cfid-when-reconnect-races-with-open_c.patch b/SPECS/linux/6.1/CVE/0003-smb-Don-t-leak-cfid-when-reconnect-races-with-open_c.patch new file mode 100644 index 0000000000..b9fd6e4e90 --- /dev/null +++ b/SPECS/linux/6.1/CVE/0003-smb-Don-t-leak-cfid-when-reconnect-races-with-open_c.patch @@ -0,0 +1,231 @@ +From 293461e3b5af8618d28760d887159412abb2276d Mon Sep 17 00:00:00 2001 +From: Paul Aurich +Date: Mon, 18 Nov 2024 13:50:26 -0800 +Subject: [PATCH 3/4] smb: Don't leak cfid when reconnect races with + open_cached_dir + +commit 7afb86733685c64c604d32faf00fa4a1f22c2ab1 upstream + +open_cached_dir() may either race with the tcon reconnection even before +compound_send_recv() or directly trigger a reconnection via +SMB2_open_init() or SMB_query_info_init(). + +The reconnection process invokes invalidate_all_cached_dirs() via +cifs_mark_open_files_invalid(), which removes all cfids from the +cfids->entries list but doesn't drop a ref if has_lease isn't true. This +results in the currently-being-constructed cfid not being on the list, +but still having a refcount of 2. It leaks if returned from +open_cached_dir(). + +Fix this by setting cfid->has_lease when the ref is actually taken; the +cfid will not be used by other threads until it has a valid time. + +Addresses these kmemleaks: + +unreferenced object 0xffff8881090c4000 (size 1024): + comm "bash", pid 1860, jiffies 4295126592 + hex dump (first 32 bytes): + 00 01 00 00 00 00 ad de 22 01 00 00 00 00 ad de ........"....... + 00 ca 45 22 81 88 ff ff f8 dc 4f 04 81 88 ff ff ..E"......O..... + backtrace (crc 6f58c20f): + [] __kmalloc_cache_noprof+0x2be/0x350 + [] open_cached_dir+0x993/0x1fb0 + [] cifs_readdir+0x15a0/0x1d50 + [] iterate_dir+0x28f/0x4b0 + [] __x64_sys_getdents64+0xfd/0x200 + [] do_syscall_64+0x95/0x1a0 + [] entry_SYSCALL_64_after_hwframe+0x76/0x7e +unreferenced object 0xffff8881044fdcf8 (size 8): + comm "bash", pid 1860, jiffies 4295126592 + hex dump (first 8 bytes): + 00 cc cc cc cc cc cc cc ........ + backtrace (crc 10c106a9): + [] __kmalloc_node_track_caller_noprof+0x363/0x480 + [] kstrdup+0x36/0x60 + [] open_cached_dir+0x9b0/0x1fb0 + [] cifs_readdir+0x15a0/0x1d50 + [] iterate_dir+0x28f/0x4b0 + [] __x64_sys_getdents64+0xfd/0x200 + [] do_syscall_64+0x95/0x1a0 + [] entry_SYSCALL_64_after_hwframe+0x76/0x7e + +And addresses these BUG splats when unmounting the SMB filesystem: + +BUG: Dentry ffff888140590ba0{i=1000000000080,n=/} still in use (2) [unmount of cifs cifs] +WARNING: CPU: 3 PID: 3433 at fs/dcache.c:1536 umount_check+0xd0/0x100 +Modules linked in: +CPU: 3 UID: 0 PID: 3433 Comm: bash Not tainted 6.12.0-rc4-g850925a8133c-dirty #49 +Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020 +RIP: 0010:umount_check+0xd0/0x100 +Code: 8d 7c 24 40 e8 31 5a f4 ff 49 8b 54 24 40 41 56 49 89 e9 45 89 e8 48 89 d9 41 57 48 89 de 48 c7 c7 80 e7 db ac e8 f0 72 9a ff <0f> 0b 58 31 c0 5a 5b 5d 41 5c 41 5d 41 5e 41 5f e9 2b e5 5d 01 41 +RSP: 0018:ffff88811cc27978 EFLAGS: 00010286 +RAX: 0000000000000000 RBX: ffff888140590ba0 RCX: ffffffffaaf20bae +RDX: dffffc0000000000 RSI: 0000000000000008 RDI: ffff8881f6fb6f40 +RBP: ffff8881462ec000 R08: 0000000000000001 R09: ffffed1023984ee3 +R10: ffff88811cc2771f R11: 00000000016cfcc0 R12: ffff888134383e08 +R13: 0000000000000002 R14: ffff8881462ec668 R15: ffffffffaceab4c0 +FS: 00007f23bfa98740(0000) GS:ffff8881f6f80000(0000) knlGS:0000000000000000 +CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 0000556de4a6f808 CR3: 0000000123c80000 CR4: 0000000000350ef0 +Call Trace: + + d_walk+0x6a/0x530 + shrink_dcache_for_umount+0x6a/0x200 + generic_shutdown_super+0x52/0x2a0 + kill_anon_super+0x22/0x40 + cifs_kill_sb+0x159/0x1e0 + deactivate_locked_super+0x66/0xe0 + cleanup_mnt+0x140/0x210 + task_work_run+0xfb/0x170 + syscall_exit_to_user_mode+0x29f/0x2b0 + do_syscall_64+0xa1/0x1a0 + entry_SYSCALL_64_after_hwframe+0x76/0x7e +RIP: 0033:0x7f23bfb93ae7 +Code: ff ff ff ff c3 66 0f 1f 44 00 00 48 8b 0d 11 93 0d 00 f7 d8 64 89 01 b8 ff ff ff ff eb bf 0f 1f 44 00 00 b8 50 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e9 92 0d 00 f7 d8 64 89 01 48 +RSP: 002b:00007ffee9138598 EFLAGS: 00000246 ORIG_RAX: 0000000000000050 +RAX: 0000000000000000 RBX: 0000558f1803e9a0 RCX: 00007f23bfb93ae7 +RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000558f1803e9a0 +RBP: 0000558f1803e600 R08: 0000000000000007 R09: 0000558f17fab610 +R10: d91d5ec34ab757b0 R11: 0000000000000246 R12: 0000000000000001 +R13: 0000000000000000 R14: 0000000000000015 R15: 0000000000000000 + +irq event stamp: 1163486 +hardirqs last enabled at (1163485): [] _raw_spin_unlock_irqrestore+0x34/0x60 +hardirqs last disabled at (1163486): [] __schedule+0xc7c/0x19a0 +softirqs last enabled at (1163482): [] __smb_send_rqst+0x3de/0x990 +softirqs last disabled at (1163480): [] release_sock+0x21/0xf0 +---[ end trace 0000000000000000 ]--- + +VFS: Busy inodes after unmount of cifs (cifs) +------------[ cut here ]------------ +kernel BUG at fs/super.c:661! +Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI +CPU: 1 UID: 0 PID: 3433 Comm: bash Tainted: G W 6.12.0-rc4-g850925a8133c-dirty #49 +Tainted: [W]=WARN +Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020 +RIP: 0010:generic_shutdown_super+0x290/0x2a0 +Code: e8 15 7c f7 ff 48 8b 5d 28 48 89 df e8 09 7c f7 ff 48 8b 0b 48 89 ee 48 8d 95 68 06 00 00 48 c7 c7 80 7f db ac e8 00 69 af ff <0f> 0b 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 90 90 90 90 90 90 +RSP: 0018:ffff88811cc27a50 EFLAGS: 00010246 +RAX: 000000000000003e RBX: ffffffffae994420 RCX: 0000000000000027 +RDX: 0000000000000000 RSI: ffffffffab06180e RDI: ffff8881f6eb18c8 +RBP: ffff8881462ec000 R08: 0000000000000001 R09: ffffed103edd6319 +R10: ffff8881f6eb18cb R11: 00000000016d3158 R12: ffff8881462ec9c0 +R13: ffff8881462ec050 R14: 0000000000000001 R15: 0000000000000000 +FS: 00007f23bfa98740(0000) GS:ffff8881f6e80000(0000) knlGS:0000000000000000 +CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 00007f8364005d68 CR3: 0000000123c80000 CR4: 0000000000350ef0 +Call Trace: + + kill_anon_super+0x22/0x40 + cifs_kill_sb+0x159/0x1e0 + deactivate_locked_super+0x66/0xe0 + cleanup_mnt+0x140/0x210 + task_work_run+0xfb/0x170 + syscall_exit_to_user_mode+0x29f/0x2b0 + do_syscall_64+0xa1/0x1a0 + entry_SYSCALL_64_after_hwframe+0x76/0x7e +RIP: 0033:0x7f23bfb93ae7 + +Modules linked in: +---[ end trace 0000000000000000 ]--- +RIP: 0010:generic_shutdown_super+0x290/0x2a0 +Code: e8 15 7c f7 ff 48 8b 5d 28 48 89 df e8 09 7c f7 ff 48 8b 0b 48 89 ee 48 8d 95 68 06 00 00 48 c7 c7 80 7f db ac e8 00 69 af ff <0f> 0b 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 90 90 90 90 90 90 +RSP: 0018:ffff88811cc27a50 EFLAGS: 00010246 +RAX: 000000000000003e RBX: ffffffffae994420 RCX: 0000000000000027 +RDX: 0000000000000000 RSI: ffffffffab06180e RDI: ffff8881f6eb18c8 +RBP: ffff8881462ec000 R08: 0000000000000001 R09: ffffed103edd6319 +R10: ffff8881f6eb18cb R11: 00000000016d3158 R12: ffff8881462ec9c0 +R13: ffff8881462ec050 R14: 0000000000000001 R15: 0000000000000000 +FS: 00007f23bfa98740(0000) GS:ffff8881f6e80000(0000) knlGS:0000000000000000 +CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 00007f8364005d68 CR3: 0000000123c80000 CR4: 0000000000350ef0 + +This reproduces eventually with an SMB mount and two shells running +these loops concurrently + +- while true; do + cd ~; sleep 1; + for i in {1..3}; do cd /mnt/test/subdir; + echo $PWD; sleep 1; cd ..; echo $PWD; sleep 1; + done; + echo ...; + done +- while true; do + iptables -F OUTPUT; mount -t cifs -a; + for _ in {0..2}; do ls /mnt/test/subdir/ | wc -l; done; + iptables -I OUTPUT -p tcp --dport 445 -j DROP; + sleep 10 + echo "unmounting"; umount -l -t cifs -a; echo "done unmounting"; + sleep 20 + echo "recovering"; iptables -F OUTPUT; + sleep 10; + done + +Fixes: ebe98f1447bb ("cifs: enable caching of directories for which a lease is held") +Fixes: 5c86919455c1 ("smb: client: fix use-after-free in smb2_query_info_compound()") +Cc: stable@vger.kernel.org +Signed-off-by: Paul Aurich +Signed-off-by: Steve French +[ Brennan : Backported to v6.1 ] +Signed-off-by: Brennan Lamoreaux +--- + fs/smb/client/cached_dir.c | 27 ++++++++++++++------------- + 1 file changed, 14 insertions(+), 13 deletions(-) + +diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c +index e318ed8539a9..51500e53a098 100644 +--- a/fs/smb/client/cached_dir.c ++++ b/fs/smb/client/cached_dir.c +@@ -57,6 +57,16 @@ static struct cached_fid *find_or_create_cached_dir(struct cached_fids *cfids, + list_add(&cfid->entry, &cfids->entries); + cfid->on_list = true; + kref_get(&cfid->refcount); ++ /* ++ * Set @cfid->has_lease to true during construction so that the lease ++ * reference can be put in cached_dir_lease_break() due to a potential ++ * lease break right after the request is sent or while @cfid is still ++ * being cached, or if a reconnection is triggered during construction. ++ * Concurrent processes won't be to use it yet due to @cfid->time being ++ * zero. ++ */ ++ cfid->has_lease = true; ++ + spin_unlock(&cfids->cfid_list_lock); + return cfid; + } +@@ -168,12 +178,12 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + return -ENOENT; + } + /* +- * Return cached fid if it has a lease. Otherwise, it is either a new +- * entry or laundromat worker removed it from @cfids->entries. Caller +- * will put last reference if the latter. ++ * Return cached fid if it is valid (has a lease and has a time). ++ * Otherwise, it is either a new entry or laundromat worker removed it ++ * from @cfids->entries. Caller will put last reference if the latter. + */ + spin_lock(&cfids->cfid_list_lock); +- if (cfid->has_lease) { ++ if (cfid->has_lease && cfid->time) { + spin_unlock(&cfids->cfid_list_lock); + *ret_cfid = cfid; + kfree(utf16_path); +@@ -258,15 +268,6 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + + smb2_set_related(&rqst[1]); + +- /* +- * Set @cfid->has_lease to true before sending out compounded request so +- * its lease reference can be put in cached_dir_lease_break() due to a +- * potential lease break right after the request is sent or while @cfid +- * is still being cached. Concurrent processes won't be to use it yet +- * due to @cfid->time being zero. +- */ +- cfid->has_lease = true; +- + rc = compound_send_recv(xid, ses, server, + flags, 2, rqst, + resp_buftype, rsp_iov); +-- +2.43.7 + diff --git a/SPECS/linux/6.1/CVE/0004-smb-Initialize-cfid-tcon-before-performing-network-o.patch b/SPECS/linux/6.1/CVE/0004-smb-Initialize-cfid-tcon-before-performing-network-o.patch new file mode 100644 index 0000000000..034ac1feef --- /dev/null +++ b/SPECS/linux/6.1/CVE/0004-smb-Initialize-cfid-tcon-before-performing-network-o.patch @@ -0,0 +1,45 @@ +From c457d2a99f79b6c652bab292289fb2e4a3c14db4 Mon Sep 17 00:00:00 2001 +From: Paul Aurich +Date: Fri, 24 Jan 2025 09:40:14 +0000 +Subject: [PATCH 4/5] smb: Initialize cfid->tcon before performing network ops + +[ Upstream commit c353ee4fb119a2582d0e011f66a76a38f5cf984d ] + +Avoid leaking a tcon ref when a lease break races with opening the +cached directory. Processing the leak break might take a reference to +the tcon in cached_dir_lease_break() and then fail to release the ref in +cached_dir_offload_close, since cfid->tcon is still NULL. + +Fixes: ebe98f1447bb ("cifs: enable caching of directories for which a lease is held") +Signed-off-by: Paul Aurich +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +[Guru: Backported to 6.1.y branch] +Signed-off-by: Guruswamy Basavaiah +--- + fs/smb/client/cached_dir.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c +index d09226c1ac90..3d028b6a2089 100644 +--- a/fs/smb/client/cached_dir.c ++++ b/fs/smb/client/cached_dir.c +@@ -191,6 +191,7 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + kfree(utf16_path); + return rc; + } ++ cfid->tcon = tcon; + + /* + * We do not hold the lock for the open because in case +@@ -256,7 +257,6 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + } + goto oshr_free; + } +- cfid->tcon = tcon; + cfid->is_open = true; + + o_rsp = (struct smb2_create_rsp *)rsp_iov[0].iov_base; +-- +2.39.4 + diff --git a/SPECS/linux/6.1/CVE/0004-smb-prevent-use-after-free-due-to-open_cached_dir-er.patch b/SPECS/linux/6.1/CVE/0004-smb-prevent-use-after-free-due-to-open_cached_dir-er.patch new file mode 100644 index 0000000000..f48d28088a --- /dev/null +++ b/SPECS/linux/6.1/CVE/0004-smb-prevent-use-after-free-due-to-open_cached_dir-er.patch @@ -0,0 +1,214 @@ +From affb33df65e400ee235c406b79ffa1c1ef05bffb Mon Sep 17 00:00:00 2001 +From: Paul Aurich +Date: Mon, 18 Nov 2024 13:50:27 -0800 +Subject: [PATCH 4/4] smb: prevent use-after-free due to open_cached_dir error + paths + +commit a9685b409a03b73d2980bbfa53eb47555802d0a9 upstream. + +If open_cached_dir() encounters an error parsing the lease from the +server, the error handling may race with receiving a lease break, +resulting in open_cached_dir() freeing the cfid while the queued work is +pending. + +Update open_cached_dir() to drop refs rather than directly freeing the +cfid. + +Have cached_dir_lease_break(), cfids_laundromat_worker(), and +invalidate_all_cached_dirs() clear has_lease immediately while still +holding cfids->cfid_list_lock, and then use this to also simplify the +reference counting in cfids_laundromat_worker() and +invalidate_all_cached_dirs(). + +Fixes this KASAN splat (which manually injects an error and lease break +in open_cached_dir()): + +================================================================== +BUG: KASAN: slab-use-after-free in smb2_cached_lease_break+0x27/0xb0 +Read of size 8 at addr ffff88811cc24c10 by task kworker/3:1/65 + +CPU: 3 UID: 0 PID: 65 Comm: kworker/3:1 Not tainted 6.12.0-rc6-g255cf264e6e5-dirty #87 +Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020 +Workqueue: cifsiod smb2_cached_lease_break +Call Trace: + + dump_stack_lvl+0x77/0xb0 + print_report+0xce/0x660 + kasan_report+0xd3/0x110 + smb2_cached_lease_break+0x27/0xb0 + process_one_work+0x50a/0xc50 + worker_thread+0x2ba/0x530 + kthread+0x17c/0x1c0 + ret_from_fork+0x34/0x60 + ret_from_fork_asm+0x1a/0x30 + + +Allocated by task 2464: + kasan_save_stack+0x33/0x60 + kasan_save_track+0x14/0x30 + __kasan_kmalloc+0xaa/0xb0 + open_cached_dir+0xa7d/0x1fb0 + smb2_query_path_info+0x43c/0x6e0 + cifs_get_fattr+0x346/0xf10 + cifs_get_inode_info+0x157/0x210 + cifs_revalidate_dentry_attr+0x2d1/0x460 + cifs_getattr+0x173/0x470 + vfs_statx_path+0x10f/0x160 + vfs_statx+0xe9/0x150 + vfs_fstatat+0x5e/0xc0 + __do_sys_newfstatat+0x91/0xf0 + do_syscall_64+0x95/0x1a0 + entry_SYSCALL_64_after_hwframe+0x76/0x7e + +Freed by task 2464: + kasan_save_stack+0x33/0x60 + kasan_save_track+0x14/0x30 + kasan_save_free_info+0x3b/0x60 + __kasan_slab_free+0x51/0x70 + kfree+0x174/0x520 + open_cached_dir+0x97f/0x1fb0 + smb2_query_path_info+0x43c/0x6e0 + cifs_get_fattr+0x346/0xf10 + cifs_get_inode_info+0x157/0x210 + cifs_revalidate_dentry_attr+0x2d1/0x460 + cifs_getattr+0x173/0x470 + vfs_statx_path+0x10f/0x160 + vfs_statx+0xe9/0x150 + vfs_fstatat+0x5e/0xc0 + __do_sys_newfstatat+0x91/0xf0 + do_syscall_64+0x95/0x1a0 + entry_SYSCALL_64_after_hwframe+0x76/0x7e + +Last potentially related work creation: + kasan_save_stack+0x33/0x60 + __kasan_record_aux_stack+0xad/0xc0 + insert_work+0x32/0x100 + __queue_work+0x5c9/0x870 + queue_work_on+0x82/0x90 + open_cached_dir+0x1369/0x1fb0 + smb2_query_path_info+0x43c/0x6e0 + cifs_get_fattr+0x346/0xf10 + cifs_get_inode_info+0x157/0x210 + cifs_revalidate_dentry_attr+0x2d1/0x460 + cifs_getattr+0x173/0x470 + vfs_statx_path+0x10f/0x160 + vfs_statx+0xe9/0x150 + vfs_fstatat+0x5e/0xc0 + __do_sys_newfstatat+0x91/0xf0 + do_syscall_64+0x95/0x1a0 + entry_SYSCALL_64_after_hwframe+0x76/0x7e + +The buggy address belongs to the object at ffff88811cc24c00 + which belongs to the cache kmalloc-1k of size 1024 +The buggy address is located 16 bytes inside of + freed 1024-byte region [ffff88811cc24c00, ffff88811cc25000) + +Cc: stable@vger.kernel.org +Signed-off-by: Paul Aurich +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +[ Brennan: Backported to v6.1. Drop context for cfids_laundromat_worker(), + this function is not present in v6.1 ] +Signed-off-by: Brennan Lamoreaux +--- + fs/smb/client/cached_dir.c | 45 ++++++++++++++------------------------ + 1 file changed, 17 insertions(+), 28 deletions(-) + +diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c +index 51500e53a098..86709e2300c2 100644 +--- a/fs/smb/client/cached_dir.c ++++ b/fs/smb/client/cached_dir.c +@@ -329,6 +329,7 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + SMB2_query_info_free(&rqst[1]); + free_rsp_buf(resp_buftype[0], rsp_iov[0].iov_base); + free_rsp_buf(resp_buftype[1], rsp_iov[1].iov_base); ++out: + if (rc) { + spin_lock(&cfids->cfid_list_lock); + if (cfid->on_list) { +@@ -340,23 +341,14 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, + /* + * We are guaranteed to have two references at this + * point. One for the caller and one for a potential +- * lease. Release the Lease-ref so that the directory +- * will be closed when the caller closes the cached +- * handle. ++ * lease. Release one here, and the second below. + */ + cfid->has_lease = false; +- spin_unlock(&cfids->cfid_list_lock); + kref_put(&cfid->refcount, smb2_close_cached_fid); +- goto out; + } + spin_unlock(&cfids->cfid_list_lock); +- } +-out: +- if (rc) { +- if (cfid->is_open) +- SMB2_close(0, cfid->tcon, cfid->fid.persistent_fid, +- cfid->fid.volatile_fid); +- free_cached_dir(cfid); ++ ++ kref_put(&cfid->refcount, smb2_close_cached_fid); + } else { + *ret_cfid = cfid; + atomic_inc(&tcon->num_remote_opens); +@@ -486,25 +478,24 @@ void invalidate_all_cached_dirs(struct cifs_tcon *tcon) + cfids->num_entries--; + cfid->is_open = false; + cfid->on_list = false; +- /* To prevent race with smb2_cached_lease_break() */ +- kref_get(&cfid->refcount); ++ if (cfid->has_lease) { ++ /* ++ * The lease was never cancelled from the server, ++ * so steal that reference. ++ */ ++ cfid->has_lease = false; ++ } else ++ kref_get(&cfid->refcount); + } + spin_unlock(&cfids->cfid_list_lock); + + list_for_each_entry_safe(cfid, q, &entry, entry) { + list_del(&cfid->entry); + cancel_work_sync(&cfid->lease_break); +- if (cfid->has_lease) { +- /* +- * We lease was never cancelled from the server so we +- * need to drop the reference. +- */ +- spin_lock(&cfids->cfid_list_lock); +- cfid->has_lease = false; +- spin_unlock(&cfids->cfid_list_lock); +- kref_put(&cfid->refcount, smb2_close_cached_fid); +- } +- /* Drop the extra reference opened above*/ ++ /* ++ * Drop the ref-count from above, either the lease-ref (if there ++ * was one) or the extra one acquired. ++ */ + kref_put(&cfid->refcount, smb2_close_cached_fid); + } + } +@@ -515,9 +506,6 @@ smb2_cached_lease_break(struct work_struct *work) + struct cached_fid *cfid = container_of(work, + struct cached_fid, lease_break); + +- spin_lock(&cfid->cfids->cfid_list_lock); +- cfid->has_lease = false; +- spin_unlock(&cfid->cfids->cfid_list_lock); + kref_put(&cfid->refcount, smb2_close_cached_fid); + } + +@@ -535,6 +523,7 @@ int cached_dir_lease_break(struct cifs_tcon *tcon, __u8 lease_key[16]) + !memcmp(lease_key, + cfid->fid.lease_key, + SMB2_LEASE_KEY_SIZE)) { ++ cfid->has_lease = false; + cfid->time = 0; + /* + * We found a lease remove it from the list +-- +2.43.7 + diff --git a/SPECS/linux/6.1/CVE/6.0-0003-apparmor-fix-use-after-free-in-sk_peer_label.patch b/SPECS/linux/6.1/CVE/6.0-0003-apparmor-fix-use-after-free-in-sk_peer_label.patch new file mode 100644 index 0000000000..997c493d6c --- /dev/null +++ b/SPECS/linux/6.1/CVE/6.0-0003-apparmor-fix-use-after-free-in-sk_peer_label.patch @@ -0,0 +1,58 @@ +From b8f993ad60435fe078a4cd88c6b232da7116c37f Mon Sep 17 00:00:00 2001 +From: John Johansen +Date: Tue, 26 Jun 2018 20:19:19 -0700 +Subject: [PATCH 3/3] apparmor: fix use after free in sk_peer_label + +BugLink: http://bugs.launchpad.net/bugs/1778646 +Signed-off-by: John Johansen +Signed-off-by: Srivatsa S. Bhat (VMware) +--- + security/apparmor/lsm.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c +index 1a2faede007e..5377160c342b 100644 +--- a/security/apparmor/lsm.c ++++ b/security/apparmor/lsm.c +@@ -1187,9 +1187,10 @@ static struct aa_label *sk_peer_label(struct sock *sk) + { + struct sock *peer_sk; + struct aa_sk_ctx *ctx = aa_sock(sk); ++ struct aa_label *label = ERR_PTR(-ENOPROTOOPT); + + if (ctx->peer) +- return ctx->peer; ++ return aa_get_label(ctx->peer); + + if (sk->sk_family != PF_UNIX) + return ERR_PTR(-ENOPROTOOPT); +@@ -1197,14 +1198,15 @@ static struct aa_label *sk_peer_label(struct sock *sk) + /* check for sockpair peering which does not go through + * security_unix_stream_connect + */ +- peer_sk = unix_peer(sk); ++ peer_sk = unix_peer_get(sk); + if (peer_sk) { + ctx = aa_sock(peer_sk); + if (ctx->label) +- return ctx->label; ++ label = aa_get_label(ctx->label); ++ sock_put(peer_sk); + } + +- return ERR_PTR(-ENOPROTOOPT); ++ return label; + } + + /** +@@ -1248,6 +1250,7 @@ static int apparmor_socket_getpeersec_stream(struct socket *sock, + + } + ++ aa_put_label(peer); + done: + end_current_label_crit_section(label); + +-- +2.25.1 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0001-bpf-Refactor-ARG_PTR_TO_DYNPTR-checks-into-process_d.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0001-bpf-Refactor-ARG_PTR_TO_DYNPTR-checks-into-process_d.patch new file mode 100644 index 0000000000..32779f7a2b --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0001-bpf-Refactor-ARG_PTR_TO_DYNPTR-checks-into-process_d.patch @@ -0,0 +1,224 @@ +From 6b75bd3d036745b9be30917909f03602099adbdb Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Thu, 8 Dec 2022 02:11:35 +0530 +Subject: [PATCH 01/19] bpf: Refactor ARG_PTR_TO_DYNPTR checks into + process_dynptr_func + +[ upstream commit 6b75bd3d036745b9be30917909f03602099adbdb ] + +ARG_PTR_TO_DYNPTR is akin to ARG_PTR_TO_TIMER, ARG_PTR_TO_KPTR, where +the underlying register type is subjected to more special checks to +determine the type of object represented by the pointer and its state +consistency. + +Move dynptr checks to their own 'process_dynptr_func' function so that +is consistent and in-line with existing code. This also makes it easier +to reuse this code for kfunc handling. + +Then, reuse this consolidated function in kfunc dynptr handling too. +Note that for kfuncs, the arg_type constraint of DYNPTR_TYPE_LOCAL has +been lifted. + +[ KN - 1) Omitted creating static definition of is_dynptr_reg_valid_init() +and is_dynptr_type_expected() as they are utilized by kernel/bpf/btf.c in +btf_check_func_arg_match(). +2) For the whole patchset, Skip inclusion of code in +check_kfunc_args() as not present in 6.1.x ] + +Acked-by: David Vernet +Acked-by: Joanne Koong +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20221207204141.308952-2-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak + +--- + include/linux/bpf_verifier.h | 3 + + kernel/bpf/verifier.c | 107 ++++++++++-------- + .../bpf/prog_tests/kfunc_dynptr_param.c | 7 +- + .../bpf/progs/test_kfunc_dynptr_param.c | 12 -- + 4 files changed, 66 insertions(+), 63 deletions(-) + +diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h +index 33b073deb..081e2e63b 100644 +--- a/include/linux/bpf_verifier.h ++++ b/include/linux/bpf_verifier.h +@@ -594,6 +594,9 @@ bool is_dynptr_reg_valid_init(struct bpf_verifier_env *env, + bool is_dynptr_type_expected(struct bpf_verifier_env *env, + struct bpf_reg_state *reg, + enum bpf_arg_type arg_type); ++struct bpf_call_arg_meta; ++int process_dynptr_func(struct bpf_verifier_env *env, int regno, ++ enum bpf_arg_type arg_type, struct bpf_call_arg_meta *meta); + + /* this lives here instead of in bpf.h because it needs to dereference tgt_prog */ + static inline u64 bpf_trampoline_compute_key(const struct bpf_prog *tgt_prog, +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c +index ead181153..cc4007612 100644 +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -5785,6 +5785,65 @@ static int process_kptr_func(struct bpf_verifier_env *env, int regno, + return 0; + } + ++int process_dynptr_func(struct bpf_verifier_env *env, int regno, ++ enum bpf_arg_type arg_type, ++ struct bpf_call_arg_meta *meta) ++{ ++ struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno]; ++ ++ /* We only need to check for initialized / uninitialized helper ++ * dynptr args if the dynptr is not PTR_TO_DYNPTR, as the ++ * assumption is that if it is, that a helper function ++ * initialized the dynptr on behalf of the BPF program. ++ */ ++ if (base_type(reg->type) == PTR_TO_DYNPTR) ++ return 0; ++ if (arg_type & MEM_UNINIT) { ++ if (!is_dynptr_reg_valid_uninit(env, reg)) { ++ verbose(env, "Dynptr has to be an uninitialized dynptr\n"); ++ return -EINVAL; ++ } ++ ++ /* We only support one dynptr being uninitialized at the moment, ++ * which is sufficient for the helper functions we have right now. ++ */ ++ if (meta->uninit_dynptr_regno) { ++ verbose(env, "verifier internal error: multiple uninitialized dynptr args\n"); ++ return -EFAULT; ++ } ++ ++ meta->uninit_dynptr_regno = regno; ++ } else { ++ if (!is_dynptr_reg_valid_init(env, reg)) { ++ verbose(env, ++ "Expected an initialized dynptr as arg #%d\n", ++ regno); ++ return -EINVAL; ++ } ++ ++ if (!is_dynptr_type_expected(env, reg, arg_type)) { ++ const char *err_extra = ""; ++ ++ switch (arg_type & DYNPTR_TYPE_FLAG_MASK) { ++ case DYNPTR_TYPE_LOCAL: ++ err_extra = "local"; ++ break; ++ case DYNPTR_TYPE_RINGBUF: ++ err_extra = "ringbuf"; ++ break; ++ default: ++ err_extra = ""; ++ break; ++ } ++ verbose(env, ++ "Expected a dynptr of type %s as arg #%d\n", ++ err_extra, regno); ++ return -EINVAL; ++ } ++ } ++ return 0; ++} ++ + static bool arg_type_is_mem_size(enum bpf_arg_type type) + { + return type == ARG_CONST_SIZE || +@@ -6291,52 +6350,8 @@ static int check_func_arg(struct bpf_verifier_env *env, u32 arg, + true, meta); + break; + case ARG_PTR_TO_DYNPTR: +- /* We only need to check for initialized / uninitialized helper +- * dynptr args if the dynptr is not PTR_TO_DYNPTR, as the +- * assumption is that if it is, that a helper function +- * initialized the dynptr on behalf of the BPF program. +- */ +- if (base_type(reg->type) == PTR_TO_DYNPTR) +- break; +- if (arg_type & MEM_UNINIT) { +- if (!is_dynptr_reg_valid_uninit(env, reg)) { +- verbose(env, "Dynptr has to be an uninitialized dynptr\n"); +- return -EINVAL; +- } +- +- /* We only support one dynptr being uninitialized at the moment, +- * which is sufficient for the helper functions we have right now. +- */ +- if (meta->uninit_dynptr_regno) { +- verbose(env, "verifier internal error: multiple uninitialized dynptr args\n"); +- return -EFAULT; +- } +- +- meta->uninit_dynptr_regno = regno; +- } else if (!is_dynptr_reg_valid_init(env, reg)) { +- verbose(env, +- "Expected an initialized dynptr as arg #%d\n", +- arg + 1); +- return -EINVAL; +- } else if (!is_dynptr_type_expected(env, reg, arg_type)) { +- const char *err_extra = ""; +- +- switch (arg_type & DYNPTR_TYPE_FLAG_MASK) { +- case DYNPTR_TYPE_LOCAL: +- err_extra = "local"; +- break; +- case DYNPTR_TYPE_RINGBUF: +- err_extra = "ringbuf"; +- break; +- default: +- err_extra = ""; +- break; +- } +- verbose(env, +- "Expected a dynptr of type %s as arg #%d\n", +- err_extra, arg + 1); +- return -EINVAL; +- } ++ if (process_dynptr_func(env, regno, arg_type, meta)) ++ return -EACCES; + break; + case ARG_CONST_ALLOC_SIZE_OR_ZERO: + if (!tnum_is_const(reg->var_off)) { +diff --git a/tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c b/tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c +index c210657d4..a9229260a 100644 +--- a/tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c ++++ b/tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c +@@ -18,11 +18,8 @@ static struct { + const char *expected_verifier_err_msg; + int expected_runtime_err; + } kfunc_dynptr_tests[] = { +- {"dynptr_type_not_supp", +- "arg#0 pointer type STRUCT bpf_dynptr_kern points to unsupported dynamic pointer type", 0}, +- {"not_valid_dynptr", +- "arg#0 pointer type STRUCT bpf_dynptr_kern must be valid and initialized", 0}, +- {"not_ptr_to_stack", "arg#0 pointer type STRUCT bpf_dynptr_kern not to stack", 0}, ++ {"not_valid_dynptr", "Expected an initialized dynptr as arg #1", 0}, ++ {"not_ptr_to_stack", "arg#0 expected pointer to stack or dynptr_ptr", 0}, + {"dynptr_data_null", NULL, -EBADMSG}, + }; + +diff --git a/tools/testing/selftests/bpf/progs/test_kfunc_dynptr_param.c b/tools/testing/selftests/bpf/progs/test_kfunc_dynptr_param.c +index ce39d096b..f4a825032 100644 +--- a/tools/testing/selftests/bpf/progs/test_kfunc_dynptr_param.c ++++ b/tools/testing/selftests/bpf/progs/test_kfunc_dynptr_param.c +@@ -32,18 +32,6 @@ int err, pid; + + char _license[] SEC("license") = "GPL"; + +-SEC("?lsm.s/bpf") +-int BPF_PROG(dynptr_type_not_supp, int cmd, union bpf_attr *attr, +- unsigned int size) +-{ +- char write_data[64] = "hello there, world!!"; +- struct bpf_dynptr ptr; +- +- bpf_ringbuf_reserve_dynptr(&ringbuf, sizeof(write_data), 0, &ptr); +- +- return bpf_verify_pkcs7_signature(&ptr, &ptr, NULL); +-} +- + SEC("?lsm.s/bpf") + int BPF_PROG(not_valid_dynptr, int cmd, union bpf_attr *attr, unsigned int size) + { +-- +2.39.4 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0002-bpf-Rework-process_dynptr_func.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0002-bpf-Rework-process_dynptr_func.patch new file mode 100644 index 0000000000..deb3ab1651 --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0002-bpf-Rework-process_dynptr_func.patch @@ -0,0 +1,677 @@ +From 270605317366e4535d8d9fc3d9da1ad0fb3c9d45 Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Thu, 8 Dec 2022 02:11:37 +0530 +Subject: [PATCH 02/19] bpf: Rework process_dynptr_func + +[ upstream commit 270605317366e4535d8d9fc3d9da1ad0fb3c9d45 ] + +Recently, user ringbuf support introduced a PTR_TO_DYNPTR register type +for use in callback state, because in case of user ringbuf helpers, +there is no dynptr on the stack that is passed into the callback. To +reflect such a state, a special register type was created. + +However, some checks have been bypassed incorrectly during the addition +of this feature. First, for arg_type with MEM_UNINIT flag which +initialize a dynptr, they must be rejected for such register type. +Secondly, in the future, there are plans to add dynptr helpers that +operate on the dynptr itself and may change its offset and other +properties. + +In all of these cases, PTR_TO_DYNPTR shouldn't be allowed to be passed +to such helpers, however the current code simply returns 0. + +The rejection for helpers that release the dynptr is already handled. + +For fixing this, we take a step back and rework existing code in a way +that will allow fitting in all classes of helpers and have a coherent +model for dealing with the variety of use cases in which dynptr is used. + +First, for ARG_PTR_TO_DYNPTR, it can either be set alone or together +with a DYNPTR_TYPE_* constant that denotes the only type it accepts. + +Next, helpers which initialize a dynptr use MEM_UNINIT to indicate this +fact. To make the distinction clear, use MEM_RDONLY flag to indicate +that the helper only operates on the memory pointed to by the dynptr, +not the dynptr itself. In C parlance, it would be equivalent to taking +the dynptr as a point to const argument. + +When either of these flags are not present, the helper is allowed to +mutate both the dynptr itself and also the memory it points to. +Currently, the read only status of the memory is not tracked in the +dynptr, but it would be trivial to add this support inside dynptr state +of the register. + +With these changes and renaming PTR_TO_DYNPTR to CONST_PTR_TO_DYNPTR to +better reflect its usage, it can no longer be passed to helpers that +initialize a dynptr, i.e. bpf_dynptr_from_mem, bpf_ringbuf_reserve_dynptr. + +A note to reviewers is that in code that does mark_stack_slots_dynptr, +and unmark_stack_slots_dynptr, we implicitly rely on the fact that +PTR_TO_STACK reg is the only case that can reach that code path, as one +cannot pass CONST_PTR_TO_DYNPTR to helpers that don't set MEM_RDONLY. In +both cases such helpers won't be setting that flag. + +The next patch will add a couple of selftest cases to make sure this +doesn't break. + +Fixes: 205715673844 ("bpf: Add bpf_user_ringbuf_drain() helper") +Acked-by: Joanne Koong +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20221207204141.308952-4-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak + +--- + include/linux/bpf.h | 4 +- + include/uapi/linux/bpf.h | 8 +- + kernel/bpf/helpers.c | 18 +- + kernel/bpf/verifier.c | 223 +++++++++++++----- + scripts/bpf_doc.py | 1 + + tools/include/uapi/linux/bpf.h | 8 +- + .../selftests/bpf/prog_tests/user_ringbuf.c | 4 +- + 7 files changed, 189 insertions(+), 77 deletions(-) + +diff --git a/include/linux/bpf.h b/include/linux/bpf.h +index 2189c0d18..be8d77b3a 100644 +--- a/include/linux/bpf.h ++++ b/include/linux/bpf.h +@@ -685,7 +685,7 @@ enum bpf_reg_type { + PTR_TO_MEM, /* reg points to valid memory region */ + PTR_TO_BUF, /* reg points to a read/write buffer */ + PTR_TO_FUNC, /* reg points to a bpf program function */ +- PTR_TO_DYNPTR, /* reg points to a dynptr */ ++ CONST_PTR_TO_DYNPTR, /* reg points to a const struct bpf_dynptr */ + __BPF_REG_TYPE_MAX, + + /* Extended reg_types. */ +@@ -2799,7 +2799,7 @@ void bpf_dynptr_init(struct bpf_dynptr_kern *ptr, void *data, + enum bpf_dynptr_type type, u32 offset, u32 size); + void bpf_dynptr_set_null(struct bpf_dynptr_kern *ptr); + int bpf_dynptr_check_size(u32 size); +-u32 bpf_dynptr_get_size(struct bpf_dynptr_kern *ptr); ++u32 bpf_dynptr_get_size(const struct bpf_dynptr_kern *ptr); + + #ifdef CONFIG_BPF_LSM + void bpf_cgroup_atype_get(u32 attach_btf_id, int cgroup_atype); +diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h +index 667f49a64..b4efcab19 100644 +--- a/include/uapi/linux/bpf.h ++++ b/include/uapi/linux/bpf.h +@@ -5318,7 +5318,7 @@ union bpf_attr { + * Return + * Nothing. Always succeeds. + * +- * long bpf_dynptr_read(void *dst, u32 len, struct bpf_dynptr *src, u32 offset, u64 flags) ++ * long bpf_dynptr_read(void *dst, u32 len, const struct bpf_dynptr *src, u32 offset, u64 flags) + * Description + * Read *len* bytes from *src* into *dst*, starting from *offset* + * into *src*. +@@ -5328,7 +5328,7 @@ union bpf_attr { + * of *src*'s data, -EINVAL if *src* is an invalid dynptr or if + * *flags* is not 0. + * +- * long bpf_dynptr_write(struct bpf_dynptr *dst, u32 offset, void *src, u32 len, u64 flags) ++ * long bpf_dynptr_write(const struct bpf_dynptr *dst, u32 offset, void *src, u32 len, u64 flags) + * Description + * Write *len* bytes from *src* into *dst*, starting from *offset* + * into *dst*. +@@ -5338,7 +5338,7 @@ union bpf_attr { + * of *dst*'s data, -EINVAL if *dst* is an invalid dynptr or if *dst* + * is a read-only dynptr or if *flags* is not 0. + * +- * void *bpf_dynptr_data(struct bpf_dynptr *ptr, u32 offset, u32 len) ++ * void *bpf_dynptr_data(const struct bpf_dynptr *ptr, u32 offset, u32 len) + * Description + * Get a pointer to the underlying dynptr data. + * +@@ -5439,7 +5439,7 @@ union bpf_attr { + * Drain samples from the specified user ring buffer, and invoke + * the provided callback for each such sample: + * +- * long (\*callback_fn)(struct bpf_dynptr \*dynptr, void \*ctx); ++ * long (\*callback_fn)(const struct bpf_dynptr \*dynptr, void \*ctx); + * + * If **callback_fn** returns 0, the helper will continue to try + * and drain the next sample, up to a maximum of +diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c +index 4fef0a015..c55ab2e57 100644 +--- a/kernel/bpf/helpers.c ++++ b/kernel/bpf/helpers.c +@@ -1426,7 +1426,7 @@ static const struct bpf_func_proto bpf_kptr_xchg_proto = { + #define DYNPTR_SIZE_MASK 0xFFFFFF + #define DYNPTR_RDONLY_BIT BIT(31) + +-static bool bpf_dynptr_is_rdonly(struct bpf_dynptr_kern *ptr) ++static bool bpf_dynptr_is_rdonly(const struct bpf_dynptr_kern *ptr) + { + return ptr->size & DYNPTR_RDONLY_BIT; + } +@@ -1436,7 +1436,7 @@ static void bpf_dynptr_set_type(struct bpf_dynptr_kern *ptr, enum bpf_dynptr_typ + ptr->size |= type << DYNPTR_TYPE_SHIFT; + } + +-u32 bpf_dynptr_get_size(struct bpf_dynptr_kern *ptr) ++u32 bpf_dynptr_get_size(const struct bpf_dynptr_kern *ptr) + { + return ptr->size & DYNPTR_SIZE_MASK; + } +@@ -1460,7 +1460,7 @@ void bpf_dynptr_set_null(struct bpf_dynptr_kern *ptr) + memset(ptr, 0, sizeof(*ptr)); + } + +-static int bpf_dynptr_check_off_len(struct bpf_dynptr_kern *ptr, u32 offset, u32 len) ++static int bpf_dynptr_check_off_len(const struct bpf_dynptr_kern *ptr, u32 offset, u32 len) + { + u32 size = bpf_dynptr_get_size(ptr); + +@@ -1505,7 +1505,7 @@ static const struct bpf_func_proto bpf_dynptr_from_mem_proto = { + .arg4_type = ARG_PTR_TO_DYNPTR | DYNPTR_TYPE_LOCAL | MEM_UNINIT | MEM_WRITE, + }; + +-BPF_CALL_5(bpf_dynptr_read, void *, dst, u32, len, struct bpf_dynptr_kern *, src, ++BPF_CALL_5(bpf_dynptr_read, void *, dst, u32, len, const struct bpf_dynptr_kern *, src, + u32, offset, u64, flags) + { + int err; +@@ -1528,12 +1528,12 @@ static const struct bpf_func_proto bpf_dynptr_read_proto = { + .ret_type = RET_INTEGER, + .arg1_type = ARG_PTR_TO_UNINIT_MEM, + .arg2_type = ARG_CONST_SIZE_OR_ZERO, +- .arg3_type = ARG_PTR_TO_DYNPTR, ++ .arg3_type = ARG_PTR_TO_DYNPTR | MEM_RDONLY, + .arg4_type = ARG_ANYTHING, + .arg5_type = ARG_ANYTHING, + }; + +-BPF_CALL_5(bpf_dynptr_write, struct bpf_dynptr_kern *, dst, u32, offset, void *, src, ++BPF_CALL_5(bpf_dynptr_write, const struct bpf_dynptr_kern *, dst, u32, offset, void *, src, + u32, len, u64, flags) + { + int err; +@@ -1554,14 +1554,14 @@ static const struct bpf_func_proto bpf_dynptr_write_proto = { + .func = bpf_dynptr_write, + .gpl_only = false, + .ret_type = RET_INTEGER, +- .arg1_type = ARG_PTR_TO_DYNPTR, ++ .arg1_type = ARG_PTR_TO_DYNPTR | MEM_RDONLY, + .arg2_type = ARG_ANYTHING, + .arg3_type = ARG_PTR_TO_MEM | MEM_RDONLY, + .arg4_type = ARG_CONST_SIZE_OR_ZERO, + .arg5_type = ARG_ANYTHING, + }; + +-BPF_CALL_3(bpf_dynptr_data, struct bpf_dynptr_kern *, ptr, u32, offset, u32, len) ++BPF_CALL_3(bpf_dynptr_data, const struct bpf_dynptr_kern *, ptr, u32, offset, u32, len) + { + int err; + +@@ -1582,7 +1582,7 @@ static const struct bpf_func_proto bpf_dynptr_data_proto = { + .func = bpf_dynptr_data, + .gpl_only = false, + .ret_type = RET_PTR_TO_DYNPTR_MEM_OR_NULL, +- .arg1_type = ARG_PTR_TO_DYNPTR, ++ .arg1_type = ARG_PTR_TO_DYNPTR | MEM_RDONLY, + .arg2_type = ARG_ANYTHING, + .arg3_type = ARG_CONST_ALLOC_SIZE_OR_ZERO, + }; +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c +index cc4007612..51ea72692 100644 +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -503,7 +503,7 @@ static const char *reg_type_str(struct bpf_verifier_env *env, + [PTR_TO_BUF] = "buf", + [PTR_TO_FUNC] = "func", + [PTR_TO_MAP_KEY] = "map_key", +- [PTR_TO_DYNPTR] = "dynptr_ptr", ++ [CONST_PTR_TO_DYNPTR] = "dynptr_ptr", + }; + + if (type & PTR_MAYBE_NULL) { +@@ -637,6 +637,28 @@ static bool dynptr_type_refcounted(enum bpf_dynptr_type type) + return type == BPF_DYNPTR_TYPE_RINGBUF; + } + ++static void __mark_dynptr_reg(struct bpf_reg_state *reg, ++ enum bpf_dynptr_type type, ++ bool first_slot); ++ ++static void __mark_reg_not_init(const struct bpf_verifier_env *env, ++ struct bpf_reg_state *reg); ++ ++static void mark_dynptr_stack_regs(struct bpf_reg_state *sreg1, ++ struct bpf_reg_state *sreg2, ++ enum bpf_dynptr_type type) ++{ ++ __mark_dynptr_reg(sreg1, type, true); ++ __mark_dynptr_reg(sreg2, type, false); ++} ++ ++static void mark_dynptr_cb_reg(struct bpf_reg_state *reg, ++ enum bpf_dynptr_type type) ++{ ++ __mark_dynptr_reg(reg, type, true); ++} ++ ++ + static int mark_stack_slots_dynptr(struct bpf_verifier_env *env, struct bpf_reg_state *reg, + enum bpf_arg_type arg_type, int insn_idx) + { +@@ -658,9 +680,8 @@ static int mark_stack_slots_dynptr(struct bpf_verifier_env *env, struct bpf_reg_ + if (type == BPF_DYNPTR_TYPE_INVALID) + return -EINVAL; + +- state->stack[spi].spilled_ptr.dynptr.first_slot = true; +- state->stack[spi].spilled_ptr.dynptr.type = type; +- state->stack[spi - 1].spilled_ptr.dynptr.type = type; ++ mark_dynptr_stack_regs(&state->stack[spi].spilled_ptr, ++ &state->stack[spi - 1].spilled_ptr, type); + + if (dynptr_type_refcounted(type)) { + /* The id is used to track proper releasing */ +@@ -668,8 +689,8 @@ static int mark_stack_slots_dynptr(struct bpf_verifier_env *env, struct bpf_reg_ + if (id < 0) + return id; + +- state->stack[spi].spilled_ptr.id = id; +- state->stack[spi - 1].spilled_ptr.id = id; ++ state->stack[spi].spilled_ptr.ref_obj_id = id; ++ state->stack[spi - 1].spilled_ptr.ref_obj_id = id; + } + + return 0; +@@ -691,25 +712,23 @@ static int unmark_stack_slots_dynptr(struct bpf_verifier_env *env, struct bpf_re + } + + /* Invalidate any slices associated with this dynptr */ +- if (dynptr_type_refcounted(state->stack[spi].spilled_ptr.dynptr.type)) { +- release_reference(env, state->stack[spi].spilled_ptr.id); +- state->stack[spi].spilled_ptr.id = 0; +- state->stack[spi - 1].spilled_ptr.id = 0; +- } +- +- state->stack[spi].spilled_ptr.dynptr.first_slot = false; +- state->stack[spi].spilled_ptr.dynptr.type = 0; +- state->stack[spi - 1].spilled_ptr.dynptr.type = 0; ++ if (dynptr_type_refcounted(state->stack[spi].spilled_ptr.dynptr.type)) ++ WARN_ON_ONCE(release_reference(env, state->stack[spi].spilled_ptr.ref_obj_id)); + ++ __mark_reg_not_init(env, &state->stack[spi].spilled_ptr); ++ __mark_reg_not_init(env, &state->stack[spi - 1].spilled_ptr); + return 0; + } + + static bool is_dynptr_reg_valid_uninit(struct bpf_verifier_env *env, struct bpf_reg_state *reg) + { + struct bpf_func_state *state = func(env, reg); +- int spi = get_spi(reg->off); +- int i; ++ int spi, i; ++ ++ if (reg->type == CONST_PTR_TO_DYNPTR) ++ return false; + ++ spi = get_spi(reg->off); + if (!is_spi_bounds_valid(state, spi, BPF_DYNPTR_NR_SLOTS)) + return true; + +@@ -726,9 +745,14 @@ bool is_dynptr_reg_valid_init(struct bpf_verifier_env *env, + struct bpf_reg_state *reg) + { + struct bpf_func_state *state = func(env, reg); +- int spi = get_spi(reg->off); ++ int spi; + int i; + ++ /* This already represents first slot of initialized bpf_dynptr */ ++ if (reg->type == CONST_PTR_TO_DYNPTR) ++ return true; ++ ++ spi = get_spi(reg->off); + if (!is_spi_bounds_valid(state, spi, BPF_DYNPTR_NR_SLOTS) || + !state->stack[spi].spilled_ptr.dynptr.first_slot) + return false; +@@ -748,15 +772,19 @@ bool is_dynptr_type_expected(struct bpf_verifier_env *env, + { + struct bpf_func_state *state = func(env, reg); + enum bpf_dynptr_type dynptr_type; +- int spi = get_spi(reg->off); ++ int spi; + + /* ARG_PTR_TO_DYNPTR takes any type of dynptr */ + if (arg_type == ARG_PTR_TO_DYNPTR) + return true; + + dynptr_type = arg_to_dynptr_type(arg_type); +- +- return state->stack[spi].spilled_ptr.dynptr.type == dynptr_type; ++ if (reg->type == CONST_PTR_TO_DYNPTR) { ++ return reg->dynptr.type == dynptr_type; ++ } else { ++ spi = get_spi(reg->off); ++ return state->stack[spi].spilled_ptr.dynptr.type == dynptr_type; ++ } + } + + /* The reg state of a pointer or a bounded scalar was saved when +@@ -1269,9 +1297,6 @@ static const int caller_saved[CALLER_SAVED_REGS] = { + BPF_REG_0, BPF_REG_1, BPF_REG_2, BPF_REG_3, BPF_REG_4, BPF_REG_5 + }; + +-static void __mark_reg_not_init(const struct bpf_verifier_env *env, +- struct bpf_reg_state *reg); +- + /* This helper doesn't clear reg->id */ + static void ___mark_reg_known(struct bpf_reg_state *reg, u64 imm) + { +@@ -1334,6 +1359,19 @@ static void mark_reg_known_zero(struct bpf_verifier_env *env, + __mark_reg_known_zero(regs + regno); + } + ++static void __mark_dynptr_reg(struct bpf_reg_state *reg, enum bpf_dynptr_type type, ++ bool first_slot) ++{ ++ /* reg->type has no meaning for STACK_DYNPTR, but when we set reg for ++ * callback arguments, it does need to be CONST_PTR_TO_DYNPTR, so simply ++ * set it unconditionally as it is ignored for STACK_DYNPTR anyway. ++ */ ++ __mark_reg_known_zero(reg); ++ reg->type = CONST_PTR_TO_DYNPTR; ++ reg->dynptr.type = type; ++ reg->dynptr.first_slot = first_slot; ++} ++ + static void mark_ptr_not_null_reg(struct bpf_reg_state *reg) + { + if (base_type(reg->type) == PTR_TO_MAP_VALUE) { +@@ -5785,19 +5823,58 @@ static int process_kptr_func(struct bpf_verifier_env *env, int regno, + return 0; + } + ++/* There are two register types representing a bpf_dynptr, one is PTR_TO_STACK ++ * which points to a stack slot, and the other is CONST_PTR_TO_DYNPTR. ++ * ++ * In both cases we deal with the first 8 bytes, but need to mark the next 8 ++ * bytes as STACK_DYNPTR in case of PTR_TO_STACK. In case of ++ * CONST_PTR_TO_DYNPTR, we are guaranteed to get the beginning of the object. ++ * ++ * Mutability of bpf_dynptr is at two levels, one is at the level of struct ++ * bpf_dynptr itself, i.e. whether the helper is receiving a pointer to struct ++ * bpf_dynptr or pointer to const struct bpf_dynptr. In the former case, it can ++ * mutate the view of the dynptr and also possibly destroy it. In the latter ++ * case, it cannot mutate the bpf_dynptr itself but it can still mutate the ++ * memory that dynptr points to. ++ * ++ * The verifier will keep track both levels of mutation (bpf_dynptr's in ++ * reg->type and the memory's in reg->dynptr.type), but there is no support for ++ * readonly dynptr view yet, hence only the first case is tracked and checked. ++ * ++ * This is consistent with how C applies the const modifier to a struct object, ++ * where the pointer itself inside bpf_dynptr becomes const but not what it ++ * points to. ++ * ++ * Helpers which do not mutate the bpf_dynptr set MEM_RDONLY in their argument ++ * type, and declare it as 'const struct bpf_dynptr *' in their prototype. ++ */ + int process_dynptr_func(struct bpf_verifier_env *env, int regno, +- enum bpf_arg_type arg_type, +- struct bpf_call_arg_meta *meta) ++ enum bpf_arg_type arg_type, struct bpf_call_arg_meta *meta) + { + struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno]; + +- /* We only need to check for initialized / uninitialized helper +- * dynptr args if the dynptr is not PTR_TO_DYNPTR, as the +- * assumption is that if it is, that a helper function +- * initialized the dynptr on behalf of the BPF program. ++ /* MEM_UNINIT and MEM_RDONLY are exclusive, when applied to an ++ * ARG_PTR_TO_DYNPTR (or ARG_PTR_TO_DYNPTR | DYNPTR_TYPE_*): ++ */ ++ if ((arg_type & (MEM_UNINIT | MEM_RDONLY)) == (MEM_UNINIT | MEM_RDONLY)) { ++ verbose(env, "verifier internal error: misconfigured dynptr helper type flags\n"); ++ return -EFAULT; ++ } ++ /* MEM_UNINIT - Points to memory that is an appropriate candidate for ++ * constructing a mutable bpf_dynptr object. ++ * ++ * Currently, this is only possible with PTR_TO_STACK ++ * pointing to a region of at least 16 bytes which doesn't ++ * contain an existing bpf_dynptr. ++ * ++ * MEM_RDONLY - Points to a initialized bpf_dynptr that will not be ++ * mutated or destroyed. However, the memory it points to ++ * may be mutated. ++ * ++ * None - Points to a initialized dynptr that can be mutated and ++ * destroyed, including mutation of the memory it points ++ * to. + */ +- if (base_type(reg->type) == PTR_TO_DYNPTR) +- return 0; + if (arg_type & MEM_UNINIT) { + if (!is_dynptr_reg_valid_uninit(env, reg)) { + verbose(env, "Dynptr has to be an uninitialized dynptr\n"); +@@ -5813,7 +5890,13 @@ int process_dynptr_func(struct bpf_verifier_env *env, int regno, + } + + meta->uninit_dynptr_regno = regno; +- } else { ++ } else /* MEM_RDONLY and None case from above */ { ++ /* For the reg->type == PTR_TO_STACK case, bpf_dynptr is never const */ ++ if (reg->type == CONST_PTR_TO_DYNPTR && !(arg_type & MEM_RDONLY)) { ++ verbose(env, "cannot pass pointer to const bpf_dynptr, the helper mutates it\n"); ++ return -EINVAL; ++ } ++ + if (!is_dynptr_reg_valid_init(env, reg)) { + verbose(env, + "Expected an initialized dynptr as arg #%d\n", +@@ -5821,7 +5904,8 @@ int process_dynptr_func(struct bpf_verifier_env *env, int regno, + return -EINVAL; + } + +- if (!is_dynptr_type_expected(env, reg, arg_type)) { ++ /* Fold modifiers (in this case, MEM_RDONLY) when checking expected type */ ++ if (!is_dynptr_type_expected(env, reg, arg_type & ~MEM_RDONLY)) { + const char *err_extra = ""; + + switch (arg_type & DYNPTR_TYPE_FLAG_MASK) { +@@ -5962,7 +6046,7 @@ static const struct bpf_reg_types kptr_types = { .types = { PTR_TO_MAP_VALUE } } + static const struct bpf_reg_types dynptr_types = { + .types = { + PTR_TO_STACK, +- PTR_TO_DYNPTR | DYNPTR_TYPE_LOCAL, ++ CONST_PTR_TO_DYNPTR, + } + }; + +@@ -6136,12 +6220,16 @@ int check_func_arg_reg_off(struct bpf_verifier_env *env, + return __check_ptr_off_reg(env, reg, regno, fixed_off_ok); + } + +-static u32 stack_slot_get_id(struct bpf_verifier_env *env, struct bpf_reg_state *reg) ++static u32 dynptr_ref_obj_id(struct bpf_verifier_env *env, struct bpf_reg_state *reg) + { + struct bpf_func_state *state = func(env, reg); +- int spi = get_spi(reg->off); ++ int spi; ++ ++ if (reg->type == CONST_PTR_TO_DYNPTR) ++ return reg->ref_obj_id; + +- return state->stack[spi].spilled_ptr.id; ++ spi = get_spi(reg->off); ++ return state->stack[spi].spilled_ptr.ref_obj_id; + } + + static int check_func_arg(struct bpf_verifier_env *env, u32 arg, +@@ -6205,11 +6293,22 @@ static int check_func_arg(struct bpf_verifier_env *env, u32 arg, + if (arg_type_is_release(arg_type)) { + if (arg_type_is_dynptr(arg_type)) { + struct bpf_func_state *state = func(env, reg); +- int spi = get_spi(reg->off); ++ int spi; + +- if (!is_spi_bounds_valid(state, spi, BPF_DYNPTR_NR_SLOTS) || +- !state->stack[spi].spilled_ptr.id) { +- verbose(env, "arg %d is an unacquired reference\n", regno); ++ /* Only dynptr created on stack can be released, thus ++ * the get_spi and stack state checks for spilled_ptr ++ * should only be done before process_dynptr_func for ++ * PTR_TO_STACK. ++ */ ++ if (reg->type == PTR_TO_STACK) { ++ spi = get_spi(reg->off); ++ if (!is_spi_bounds_valid(state, spi, BPF_DYNPTR_NR_SLOTS) || ++ !state->stack[spi].spilled_ptr.ref_obj_id) { ++ verbose(env, "arg %d is an unacquired reference\n", regno); ++ return -EINVAL; ++ } ++ } else { ++ verbose(env, "cannot release unowned const bpf_dynptr\n"); + return -EINVAL; + } + } else if (!reg->ref_obj_id && !register_is_null(reg)) { +@@ -7169,11 +7268,10 @@ static int set_user_ringbuf_callback_state(struct bpf_verifier_env *env, + { + /* bpf_user_ringbuf_drain(struct bpf_map *map, void *callback_fn, void + * callback_ctx, u64 flags); +- * callback_fn(struct bpf_dynptr_t* dynptr, void *callback_ctx); ++ * callback_fn(const struct bpf_dynptr_t* dynptr, void *callback_ctx); + */ + __mark_reg_not_init(env, &callee->regs[BPF_REG_0]); +- callee->regs[BPF_REG_1].type = PTR_TO_DYNPTR | DYNPTR_TYPE_LOCAL; +- __mark_reg_known_zero(&callee->regs[BPF_REG_1]); ++ mark_dynptr_cb_reg(&callee->regs[BPF_REG_1], BPF_DYNPTR_TYPE_LOCAL); + callee->regs[BPF_REG_2] = caller->regs[BPF_REG_3]; + + /* unused */ +@@ -7559,7 +7657,15 @@ static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn + + regs = cur_regs(env); + ++ /* This can only be set for PTR_TO_STACK, as CONST_PTR_TO_DYNPTR cannot ++ * be reinitialized by any dynptr helper. Hence, mark_stack_slots_dynptr ++ * is safe to do directly. ++ */ + if (meta.uninit_dynptr_regno) { ++ if (regs[meta.uninit_dynptr_regno].type == CONST_PTR_TO_DYNPTR) { ++ verbose(env, "verifier internal error: CONST_PTR_TO_DYNPTR cannot be initialized\n"); ++ return -EFAULT; ++ } + /* we write BPF_DW bits (8 bytes) at a time */ + for (i = 0; i < BPF_DYNPTR_SIZE; i += 8) { + err = check_mem_access(env, insn_idx, meta.uninit_dynptr_regno, +@@ -7577,15 +7683,24 @@ static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn + + if (meta.release_regno) { + err = -EINVAL; +- if (arg_type_is_dynptr(fn->arg_type[meta.release_regno - BPF_REG_1])) ++ /* This can only be set for PTR_TO_STACK, as CONST_PTR_TO_DYNPTR cannot ++ * be released by any dynptr helper. Hence, unmark_stack_slots_dynptr ++ * is safe to do directly. ++ */ ++ if (arg_type_is_dynptr(fn->arg_type[meta.release_regno - BPF_REG_1])) { ++ if (regs[meta.release_regno].type == CONST_PTR_TO_DYNPTR) { ++ verbose(env, "verifier internal error: CONST_PTR_TO_DYNPTR cannot be released\n"); ++ return -EFAULT; ++ } + err = unmark_stack_slots_dynptr(env, ®s[meta.release_regno]); +- else if (meta.ref_obj_id) ++ } else if (meta.ref_obj_id) { + err = release_reference(env, meta.ref_obj_id); +- /* meta.ref_obj_id can only be 0 if register that is meant to be +- * released is NULL, which must be > R0. +- */ +- else if (register_is_null(®s[meta.release_regno])) ++ } else if (register_is_null(®s[meta.release_regno])) { ++ /* meta.ref_obj_id can only be 0 if register that is meant to be ++ * released is NULL, which must be > R0. ++ */ + err = 0; ++ } + if (err) { + verbose(env, "func %s#%d reference has not been acquired before\n", + func_id_name(func_id), func_id); +@@ -7659,11 +7774,7 @@ static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn + return -EFAULT; + } + +- if (base_type(reg->type) != PTR_TO_DYNPTR) +- /* Find the id of the dynptr we're +- * tracking the reference of +- */ +- meta.ref_obj_id = stack_slot_get_id(env, reg); ++ meta.ref_obj_id = dynptr_ref_obj_id(env, reg); + break; + } + } +diff --git a/scripts/bpf_doc.py b/scripts/bpf_doc.py +index c2da6ed32..d8a7abbe7 100755 +--- a/scripts/bpf_doc.py ++++ b/scripts/bpf_doc.py +@@ -732,6 +732,7 @@ class PrinterHelpers(Printer): + 'struct bpf_timer', + 'struct mptcp_sock', + 'struct bpf_dynptr', ++ 'const struct bpf_dynptr', + 'struct iphdr', + 'struct ipv6hdr', + } +diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h +index 58c7fc75d..9f15c5e1e 100644 +--- a/tools/include/uapi/linux/bpf.h ++++ b/tools/include/uapi/linux/bpf.h +@@ -5318,7 +5318,7 @@ union bpf_attr { + * Return + * Nothing. Always succeeds. + * +- * long bpf_dynptr_read(void *dst, u32 len, struct bpf_dynptr *src, u32 offset, u64 flags) ++ * long bpf_dynptr_read(void *dst, u32 len, const struct bpf_dynptr *src, u32 offset, u64 flags) + * Description + * Read *len* bytes from *src* into *dst*, starting from *offset* + * into *src*. +@@ -5328,7 +5328,7 @@ union bpf_attr { + * of *src*'s data, -EINVAL if *src* is an invalid dynptr or if + * *flags* is not 0. + * +- * long bpf_dynptr_write(struct bpf_dynptr *dst, u32 offset, void *src, u32 len, u64 flags) ++ * long bpf_dynptr_write(const struct bpf_dynptr *dst, u32 offset, void *src, u32 len, u64 flags) + * Description + * Write *len* bytes from *src* into *dst*, starting from *offset* + * into *dst*. +@@ -5338,7 +5338,7 @@ union bpf_attr { + * of *dst*'s data, -EINVAL if *dst* is an invalid dynptr or if *dst* + * is a read-only dynptr or if *flags* is not 0. + * +- * void *bpf_dynptr_data(struct bpf_dynptr *ptr, u32 offset, u32 len) ++ * void *bpf_dynptr_data(const struct bpf_dynptr *ptr, u32 offset, u32 len) + * Description + * Get a pointer to the underlying dynptr data. + * +@@ -5439,7 +5439,7 @@ union bpf_attr { + * Drain samples from the specified user ring buffer, and invoke + * the provided callback for each such sample: + * +- * long (\*callback_fn)(struct bpf_dynptr \*dynptr, void \*ctx); ++ * long (\*callback_fn)(const struct bpf_dynptr \*dynptr, void \*ctx); + * + * If **callback_fn** returns 0, the helper will continue to try + * and drain the next sample, up to a maximum of +diff --git a/tools/testing/selftests/bpf/prog_tests/user_ringbuf.c b/tools/testing/selftests/bpf/prog_tests/user_ringbuf.c +index ca81d660e..f97f83845 100644 +--- a/tools/testing/selftests/bpf/prog_tests/user_ringbuf.c ++++ b/tools/testing/selftests/bpf/prog_tests/user_ringbuf.c +@@ -674,8 +674,8 @@ static struct { + {"user_ringbuf_callback_write_forbidden", "invalid mem access 'dynptr_ptr'"}, + {"user_ringbuf_callback_null_context_write", "invalid mem access 'scalar'"}, + {"user_ringbuf_callback_null_context_read", "invalid mem access 'scalar'"}, +- {"user_ringbuf_callback_discard_dynptr", "arg 1 is an unacquired reference"}, +- {"user_ringbuf_callback_submit_dynptr", "arg 1 is an unacquired reference"}, ++ {"user_ringbuf_callback_discard_dynptr", "cannot release unowned const bpf_dynptr"}, ++ {"user_ringbuf_callback_submit_dynptr", "cannot release unowned const bpf_dynptr"}, + {"user_ringbuf_callback_invalid_return", "At callback return the register R0 has value"}, + }; + +-- +2.39.4 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0003-bpf-Rename-RET_PTR_TO_ALLOC_MEM.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0003-bpf-Rename-RET_PTR_TO_ALLOC_MEM.patch new file mode 100644 index 0000000000..d4f5aa5f09 --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0003-bpf-Rename-RET_PTR_TO_ALLOC_MEM.patch @@ -0,0 +1,66 @@ +From 2de2669b4e52b2ae2f118bfc310004f50b47f0f5 Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Tue, 15 Nov 2022 00:45:26 +0530 +Subject: [PATCH 03/19] bpf: Rename RET_PTR_TO_ALLOC_MEM + +[ upstream commit 2de2669b4e52b2ae2f118bfc310004f50b47f0f5 ] + +Currently, the verifier has two return types, RET_PTR_TO_ALLOC_MEM, and +RET_PTR_TO_ALLOC_MEM_OR_NULL, however the former is confusingly named to +imply that it carries MEM_ALLOC, while only the latter does. This causes +confusion during code review leading to conclusions like that the return +value of RET_PTR_TO_DYNPTR_MEM_OR_NULL (which is RET_PTR_TO_ALLOC_MEM | +PTR_MAYBE_NULL) may be consumable by bpf_ringbuf_{submit,commit}. + +Rename it to make it clear MEM_ALLOC needs to be tacked on top of +RET_PTR_TO_MEM. + +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20221114191547.1694267-6-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak +--- + include/linux/bpf.h | 6 +++--- + kernel/bpf/verifier.c | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/include/linux/bpf.h b/include/linux/bpf.h +index 7e84d39e1..d87891dae 100644 +--- a/include/linux/bpf.h ++++ b/include/linux/bpf.h +@@ -546,7 +546,7 @@ enum bpf_return_type { + RET_PTR_TO_SOCKET, /* returns a pointer to a socket */ + RET_PTR_TO_TCP_SOCK, /* returns a pointer to a tcp_sock */ + RET_PTR_TO_SOCK_COMMON, /* returns a pointer to a sock_common */ +- RET_PTR_TO_ALLOC_MEM, /* returns a pointer to dynamically allocated memory */ ++ RET_PTR_TO_MEM, /* returns a pointer to memory */ + RET_PTR_TO_MEM_OR_BTF_ID, /* returns a pointer to a valid memory or a btf_id */ + RET_PTR_TO_BTF_ID, /* returns a pointer to a btf_id */ + __BPF_RET_TYPE_MAX, +@@ -556,8 +556,8 @@ enum bpf_return_type { + RET_PTR_TO_SOCKET_OR_NULL = PTR_MAYBE_NULL | RET_PTR_TO_SOCKET, + RET_PTR_TO_TCP_SOCK_OR_NULL = PTR_MAYBE_NULL | RET_PTR_TO_TCP_SOCK, + RET_PTR_TO_SOCK_COMMON_OR_NULL = PTR_MAYBE_NULL | RET_PTR_TO_SOCK_COMMON, +- RET_PTR_TO_ALLOC_MEM_OR_NULL = PTR_MAYBE_NULL | MEM_ALLOC | RET_PTR_TO_ALLOC_MEM, +- RET_PTR_TO_DYNPTR_MEM_OR_NULL = PTR_MAYBE_NULL | RET_PTR_TO_ALLOC_MEM, ++ RET_PTR_TO_ALLOC_MEM_OR_NULL = PTR_MAYBE_NULL | MEM_ALLOC | RET_PTR_TO_MEM, ++ RET_PTR_TO_DYNPTR_MEM_OR_NULL = PTR_MAYBE_NULL | RET_PTR_TO_MEM, + RET_PTR_TO_BTF_ID_OR_NULL = PTR_MAYBE_NULL | RET_PTR_TO_BTF_ID, + + /* This must be the last entry. Its purpose is to ensure the enum is +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c +index 4a63b4829..32c942937 100644 +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -7881,7 +7881,7 @@ static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn + mark_reg_known_zero(env, regs, BPF_REG_0); + regs[BPF_REG_0].type = PTR_TO_TCP_SOCK | ret_flag; + break; +- case RET_PTR_TO_ALLOC_MEM: ++ case RET_PTR_TO_MEM: + mark_reg_known_zero(env, regs, BPF_REG_0); + regs[BPF_REG_0].type = PTR_TO_MEM | ret_flag; + regs[BPF_REG_0].mem_size = meta.mem_size; +-- +2.39.0 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0004-bpf-Rework-check_func_arg_reg_off.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0004-bpf-Rework-check_func_arg_reg_off.patch new file mode 100644 index 0000000000..a98a1e0f8c --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0004-bpf-Rework-check_func_arg_reg_off.patch @@ -0,0 +1,181 @@ +From 184c9bdb8f65d9f909b3a089a83bc0b0f1e1ea4c Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Thu, 8 Dec 2022 02:11:38 +0530 +Subject: [PATCH 04/19] bpf: Rework check_func_arg_reg_off + +[ upstream commit 184c9bdb8f65d9f909b3a089a83bc0b0f1e1ea4c ] + +While check_func_arg_reg_off is the place which performs generic checks +needed by various candidates of reg->type, there is some handling for +special cases, like ARG_PTR_TO_DYNPTR, OBJ_RELEASE, and +ARG_PTR_TO_RINGBUF_MEM. + +This commit aims to streamline these special cases and instead leave +other things up to argument type specific code to handle. The function +will be restrictive by default, and cover all possible cases when +OBJ_RELEASE is set, without having to update the function again (and +missing to do that being a bug). + +This is done primarily for two reasons: associating back reg->type to +its argument leaves room for the list getting out of sync when a new +reg->type is supported by an arg_type. + +The other case is ARG_PTR_TO_RINGBUF_MEM. The problem there is something +we already handle, whenever a release argument is expected, it should +be passed as the pointer that was received from the acquire function. +Hence zero fixed and variable offset. + +There is nothing special about ARG_PTR_TO_RINGBUF_MEM, where technically +its target register type PTR_TO_MEM | MEM_RINGBUF can already be passed +with non-zero offset to other helper functions, which makes sense. + +Hence, lift the arg_type_is_release check for reg->off and cover all +possible register types, instead of duplicating the same kind of check +twice for current OBJ_RELEASE arg_types (alloc_mem and ptr_to_btf_id). + +For the release argument, arg_type_is_dynptr is the special case, where +we go to actual object being freed through the dynptr, so the offset of +the pointer still needs to allow fixed and variable offset and +process_dynptr_func will verify them later for the release argument case +as well. + +This is not specific to ARG_PTR_TO_DYNPTR though, we will need to make +this exception for any future object on the stack that needs to be +released. In this sense, PTR_TO_STACK as a candidate for object on stack +argument is a special case for release offset checks, and they need to +be done by the helper releasing the object on stack. + +Since the check has been lifted above all register type checks, remove +the duplicated check that is being done for PTR_TO_BTF_ID. + +Acked-by: Joanne Koong +Acked-by: David Vernet +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20221207204141.308952-5-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak +--- + kernel/bpf/verifier.c | 63 +++++++++++-------- + tools/testing/selftests/bpf/verifier/calls.c | 2 +- + .../testing/selftests/bpf/verifier/ringbuf.c | 2 +- + 3 files changed, 40 insertions(+), 27 deletions(-) + +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c +index 32c942937..0a5322cd0 100644 +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -6214,11 +6214,37 @@ int check_func_arg_reg_off(struct bpf_verifier_env *env, + const struct bpf_reg_state *reg, int regno, + enum bpf_arg_type arg_type) + { +- enum bpf_reg_type type = reg->type; +- bool fixed_off_ok = false; ++ u32 type = reg->type; ++ ++ /* When referenced register is passed to release function, its fixed ++ * offset must be 0. ++ * ++ * We will check arg_type_is_release reg has ref_obj_id when storing ++ * meta->release_regno. ++ */ ++ if (arg_type_is_release(arg_type)) { ++ /* ARG_PTR_TO_DYNPTR with OBJ_RELEASE is a bit special, as it ++ * may not directly point to the object being released, but to ++ * dynptr pointing to such object, which might be at some offset ++ * on the stack. In that case, we simply to fallback to the ++ * default handling. ++ */ ++ if (arg_type_is_dynptr(arg_type) && type == PTR_TO_STACK) ++ return 0; ++ /* Doing check_ptr_off_reg check for the offset will catch this ++ * because fixed_off_ok is false, but checking here allows us ++ * to give the user a better error message. ++ */ ++ if (reg->off) { ++ verbose(env, "R%d must have zero offset when passed to release func or trusted arg to kfunc\n", ++ regno); ++ return -EINVAL; ++ } ++ return __check_ptr_off_reg(env, reg, regno, false); ++ } + +- switch ((u32)type) { +- /* Pointer types where reg offset is explicitly allowed: */ ++ switch (type) { ++ /* Pointer types where both fixed and variable offset is explicitly allowed: */ + case PTR_TO_STACK: + if (arg_type_is_dynptr(arg_type) && reg->off % BPF_REG_SIZE) { + verbose(env, "cannot pass in dynptr at an offset\n"); +@@ -6235,35 +6261,22 @@ int check_func_arg_reg_off(struct bpf_verifier_env *env, + case PTR_TO_BUF: + case PTR_TO_BUF | MEM_RDONLY: + case SCALAR_VALUE: +- /* Some of the argument types nevertheless require a +- * zero register offset. +- */ +- if (base_type(arg_type) != ARG_PTR_TO_ALLOC_MEM) +- return 0; +- break; ++ return 0; + /* All the rest must be rejected, except PTR_TO_BTF_ID which allows + * fixed offset. + */ + case PTR_TO_BTF_ID: + /* When referenced PTR_TO_BTF_ID is passed to release function, +- * it's fixed offset must be 0. In the other cases, fixed offset +- * can be non-zero. ++ * its fixed offset must be 0. In the other cases, fixed offset ++ * can be non-zero. This was already checked above. So pass ++ * fixed_off_ok as true to allow fixed offset for all other ++ * cases. var_off always must be 0 for PTR_TO_BTF_ID, hence we ++ * still need to do checks instead of returning. + */ +- if (arg_type_is_release(arg_type) && reg->off) { +- verbose(env, "R%d must have zero offset when passed to release func\n", +- regno); +- return -EINVAL; +- } +- /* For arg is release pointer, fixed_off_ok must be false, but +- * we already checked and rejected reg->off != 0 above, so set +- * to true to allow fixed offset for all other cases. +- */ +- fixed_off_ok = true; +- break; ++ return __check_ptr_off_reg(env, reg, regno, true); + default: +- break; ++ return __check_ptr_off_reg(env, reg, regno, false); + } +- return __check_ptr_off_reg(env, reg, regno, fixed_off_ok); + } + + static u32 dynptr_ref_obj_id(struct bpf_verifier_env *env, struct bpf_reg_state *reg) +diff --git a/tools/testing/selftests/bpf/verifier/calls.c b/tools/testing/selftests/bpf/verifier/calls.c +index e1a937277..686184c61 100644 +--- a/tools/testing/selftests/bpf/verifier/calls.c ++++ b/tools/testing/selftests/bpf/verifier/calls.c +@@ -76,7 +76,7 @@ + }, + .prog_type = BPF_PROG_TYPE_SCHED_CLS, + .result = REJECT, +- .errstr = "arg#0 expected pointer to ctx, but got PTR", ++ .errstr = "R1 must have zero offset when passed to release func or trusted arg to kfunc", + .fixup_kfunc_btf_id = { + { "bpf_kfunc_call_test_pass_ctx", 2 }, + }, +diff --git a/tools/testing/selftests/bpf/verifier/ringbuf.c b/tools/testing/selftests/bpf/verifier/ringbuf.c +index b64d33e48..92e3f6a61 100644 +--- a/tools/testing/selftests/bpf/verifier/ringbuf.c ++++ b/tools/testing/selftests/bpf/verifier/ringbuf.c +@@ -28,7 +28,7 @@ + }, + .fixup_map_ringbuf = { 1 }, + .result = REJECT, +- .errstr = "dereference of modified alloc_mem ptr R1", ++ .errstr = "R1 must have zero offset when passed to release func", + }, + { + "ringbuf: invalid reservation offset 2", +-- +2.39.0 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0005-bpf-Use-memmove-for-bpf_dynptr_-read-write.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0005-bpf-Use-memmove-for-bpf_dynptr_-read-write.patch new file mode 100644 index 0000000000..4b81d53f01 --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0005-bpf-Use-memmove-for-bpf_dynptr_-read-write.patch @@ -0,0 +1,58 @@ +From 76d16077bef0954528ec3896710f9eda8b2b4db1 Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Thu, 8 Dec 2022 02:11:40 +0530 +Subject: [PATCH 05/19] bpf: Use memmove for bpf_dynptr_{read,write} + +[ upstream commit 76d16077bef0954528ec3896710f9eda8b2b4db1 ] + +It may happen that destination buffer memory overlaps with memory dynptr +points to. Hence, we must use memmove to correctly copy from dynptr to +destination buffer, or source buffer to dynptr. + +This actually isn't a problem right now, as memcpy implementation falls +back to memmove on detecting overlap and warns about it, but we +shouldn't be relying on that. + +Acked-by: Joanne Koong +Acked-by: David Vernet +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20221207204141.308952-7-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak +--- + kernel/bpf/helpers.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c +index 0a4017eb3..ff94c652b 100644 +--- a/kernel/bpf/helpers.c ++++ b/kernel/bpf/helpers.c +@@ -1489,7 +1489,11 @@ BPF_CALL_5(bpf_dynptr_read, void *, dst, u32, len, const struct bpf_dynptr_kern + if (err) + return err; + +- memcpy(dst, src->data + src->offset + offset, len); ++ /* Source and destination may possibly overlap, hence use memmove to ++ * copy the data. E.g. bpf_dynptr_from_mem may create two dynptr ++ * pointing to overlapping PTR_TO_MAP_VALUE regions. ++ */ ++ memmove(dst, src->data + src->offset + offset, len); + + return 0; + } +@@ -1517,7 +1521,11 @@ BPF_CALL_5(bpf_dynptr_write, const struct bpf_dynptr_kern *, dst, u32, offset, v + if (err) + return err; + +- memcpy(dst->data + dst->offset + offset, src, len); ++ /* Source and destination may possibly overlap, hence use memmove to ++ * copy the data. E.g. bpf_dynptr_from_mem may create two dynptr ++ * pointing to overlapping PTR_TO_MAP_VALUE regions. ++ */ ++ memmove(dst->data + dst->offset + offset, src, len); + + return 0; + } +-- +2.39.0 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0006-bpf-Propagate-errors-from-process_-checks-in-check_f.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0006-bpf-Propagate-errors-from-process_-checks-in-check_f.patch new file mode 100644 index 0000000000..2d170434fd --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0006-bpf-Propagate-errors-from-process_-checks-in-check_f.patch @@ -0,0 +1,82 @@ +From ac50fe51ce873f4299928e312ce2042e35ab5c08 Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Thu, 8 Dec 2022 02:11:36 +0530 +Subject: [PATCH 06/19] bpf: Propagate errors from process_* checks in + check_func_arg + +[ upstream commit ac50fe51ce873f4299928e312ce2042e35ab5c08 ] + +Currently, we simply ignore the errors in process_spin_lock, +process_timer_func, process_kptr_func, process_dynptr_func. Instead, +bubble up the error by storing and checking err variable. + +Acked-by: Joanne Koong +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20221207204141.308952-3-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak + +--- + kernel/bpf/verifier.c | 25 +++++++++++++++---------- + 1 file changed, 15 insertions(+), 10 deletions(-) + +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c +index 93657834e..ff7459f03 100644 +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -6417,19 +6417,22 @@ static int check_func_arg(struct bpf_verifier_env *env, u32 arg, + break; + case ARG_PTR_TO_SPIN_LOCK: + if (meta->func_id == BPF_FUNC_spin_lock) { +- if (process_spin_lock(env, regno, true)) +- return -EACCES; ++ err = process_spin_lock(env, regno, true); ++ if (err) ++ return err; + } else if (meta->func_id == BPF_FUNC_spin_unlock) { +- if (process_spin_lock(env, regno, false)) +- return -EACCES; ++ err = process_spin_lock(env, regno, false); ++ if (err) ++ return err; + } else { + verbose(env, "verifier internal error\n"); + return -EFAULT; + } + break; + case ARG_PTR_TO_TIMER: +- if (process_timer_func(env, regno, meta)) +- return -EACCES; ++ err = process_timer_func(env, regno, meta); ++ if (err) ++ return err; + break; + case ARG_PTR_TO_FUNC: + meta->subprogno = reg->subprogno; +@@ -6462,8 +6465,9 @@ static int check_func_arg(struct bpf_verifier_env *env, u32 arg, + true, meta); + break; + case ARG_PTR_TO_DYNPTR: +- if (process_dynptr_func(env, regno, arg_type, meta)) +- return -EACCES; ++ err = process_dynptr_func(env, regno, arg_type, meta); ++ if (err) ++ return err; + break; + case ARG_CONST_ALLOC_SIZE_OR_ZERO: + if (!tnum_is_const(reg->var_off)) { +@@ -6519,8 +6523,9 @@ static int check_func_arg(struct bpf_verifier_env *env, u32 arg, + break; + } + case ARG_PTR_TO_KPTR: +- if (process_kptr_func(env, regno, meta)) +- return -EACCES; ++ err = process_kptr_func(env, regno, meta); ++ if (err) ++ return err; + break; + } + +-- +2.39.4 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0007-bpf-Move-PTR_TO_STACK-alignment-check-to-process_dyn.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0007-bpf-Move-PTR_TO_STACK-alignment-check-to-process_dyn.patch new file mode 100644 index 0000000000..a41e41dce1 --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0007-bpf-Move-PTR_TO_STACK-alignment-check-to-process_dyn.patch @@ -0,0 +1,64 @@ +From f6ee298fa140f6b5bae3acf6d6108741278bcced Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Thu, 8 Dec 2022 02:11:39 +0530 +Subject: [PATCH 07/19] bpf: Move PTR_TO_STACK alignment check to process_dynptr_func + +[ upstream commit f6ee298fa140f6b5bae3acf6d6108741278bcced ] + +After previous commit, we are minimizing helper specific assumptions +from check_func_arg_reg_off, making it generic, and offloading checks +for a specific argument type to their respective functions called after +check_func_arg_reg_off has been called. + +This allows relying on a consistent set of guarantees after that call +and then relying on them in code that deals with registers for each +argument type later. This is in line with how process_spin_lock, +process_timer_func, process_kptr_func check reg->var_off to be constant. +The same reasoning is used here to move the alignment check into +process_dynptr_func. Note that it also needs to check for constant +var_off, and accumulate the constant var_off when computing the spi in +get_spi, but that fix will come in later changes. + +Acked-by: Joanne Koong +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20221207204141.308952-6-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak +--- + kernel/bpf/verifier.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c +index c055cf0d7..d26f04b12 100644 +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -5890,6 +5890,14 @@ int process_dynptr_func(struct bpf_verifier_env *env, int regno, + verbose(env, "verifier internal error: misconfigured dynptr helper type flags\n"); + return -EFAULT; + } ++ /* CONST_PTR_TO_DYNPTR already has fixed and var_off as 0 due to ++ * check_func_arg_reg_off's logic. We only need to check offset ++ * alignment for PTR_TO_STACK. ++ */ ++ if (reg->type == PTR_TO_STACK && (reg->off % BPF_REG_SIZE)) { ++ verbose(env, "cannot pass in dynptr at an offset=%d\n", reg->off); ++ return -EINVAL; ++ } + /* MEM_UNINIT - Points to memory that is an appropriate candidate for + * constructing a mutable bpf_dynptr object. + * +@@ -6246,11 +6254,6 @@ int check_func_arg_reg_off(struct bpf_verifier_env *env, + switch (type) { + /* Pointer types where both fixed and variable offset is explicitly allowed: */ + case PTR_TO_STACK: +- if (arg_type_is_dynptr(arg_type) && reg->off % BPF_REG_SIZE) { +- verbose(env, "cannot pass in dynptr at an offset\n"); +- return -EINVAL; +- } +- fallthrough; + case PTR_TO_PACKET: + case PTR_TO_PACKET_META: + case PTR_TO_MAP_KEY: +-- +2.39.0 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0008-bpf-Fix-state-pruning-for-STACK_DYNPTR-stack-slots.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0008-bpf-Fix-state-pruning-for-STACK_DYNPTR-stack-slots.patch new file mode 100644 index 0000000000..1f7ccfc1d4 --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0008-bpf-Fix-state-pruning-for-STACK_DYNPTR-stack-slots.patch @@ -0,0 +1,260 @@ +From d6fefa1105dacc8a742cdcf2f4bfb501c9e61349 Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Sat, 21 Jan 2023 05:52:30 +0530 +Subject: [PATCH 08/19] bpf: Fix state pruning for STACK_DYNPTR stack slots + +[ upstream commit d6fefa1105dacc8a742cdcf2f4bfb501c9e61349 ] + +The root of the problem is missing liveness marking for STACK_DYNPTR +slots. This leads to all kinds of problems inside stacksafe. + +The verifier by default inside stacksafe ignores spilled_ptr in stack +slots which do not have REG_LIVE_READ marks. Since this is being checked +in the 'old' explored state, it must have already done clean_live_states +for this old bpf_func_state. Hence, it won't be receiving any more +liveness marks from to be explored insns (it has received REG_LIVE_DONE +marking from liveness point of view). + +What this means is that verifier considers that it's safe to not compare +the stack slot if was never read by children states. While liveness +marks are usually propagated correctly following the parentage chain for +spilled registers (SCALAR_VALUE and PTR_* types), the same is not the +case for STACK_DYNPTR. + +clean_live_states hence simply rewrites these stack slots to the type +STACK_INVALID since it sees no REG_LIVE_READ marks. + +The end result is that we will never see STACK_DYNPTR slots in explored +state. Even if verifier was conservatively matching !REG_LIVE_READ +slots, very next check continuing the stacksafe loop on seeing +STACK_INVALID would again prevent further checks. + +Now as long as verifier stores an explored state which we can compare to +when reaching a pruning point, we can abuse this bug to make verifier +prune search for obviously unsafe paths using STACK_DYNPTR slots +thinking they are never used hence safe. + +Doing this in unprivileged mode is a bit challenging. add_new_state is +only set when seeing BPF_F_TEST_STATE_FREQ (which requires privileges) +or when jmps_processed difference is >= 2 and insn_processed difference +is >= 8. So coming up with the unprivileged case requires a little more +work, but it is still totally possible. The test case being discussed +below triggers the heuristic even in unprivileged mode. + +However, it no longer works since commit +8addbfc7b308 ("bpf: Gate dynptr API behind CAP_BPF"). + +Let's try to study the test step by step. + +Consider the following program (C style BPF ASM): + +0 r0 = 0; +1 r6 = &ringbuf_map; +3 r1 = r6; +4 r2 = 8; +5 r3 = 0; +6 r4 = r10; +7 r4 -= -16; +8 call bpf_ringbuf_reserve_dynptr; +9 if r0 == 0 goto pc+1; +10 goto pc+1; +11 *(r10 - 16) = 0xeB9F; +12 r1 = r10; +13 r1 -= -16; +14 r2 = 0; +15 call bpf_ringbuf_discard_dynptr; +16 r0 = 0; +17 exit; + +We know that insn 12 will be a pruning point, hence if we force +add_new_state for it, it will first verify the following path as +safe in straight line exploration: +0 1 3 4 5 6 7 8 9 -> 10 -> (12) 13 14 15 16 17 + +Then, when we arrive at insn 12 from the following path: +0 1 3 4 5 6 7 8 9 -> 11 (12) + +We will find a state that has been verified as safe already at insn 12. +Since register state is same at this point, regsafe will pass. Next, in +stacksafe, for spi = 0 and spi = 1 (location of our dynptr) is skipped +seeing !REG_LIVE_READ. The rest matches, so stacksafe returns true. +Next, refsafe is also true as reference state is unchanged in both +states. + +The states are considered equivalent and search is pruned. + +Hence, we are able to construct a dynptr with arbitrary contents and use +the dynptr API to operate on this arbitrary pointer and arbitrary size + +offset. + +To fix this, first define a mark_dynptr_read function that propagates +liveness marks whenever a valid initialized dynptr is accessed by dynptr +helpers. REG_LIVE_WRITTEN is marked whenever we initialize an +uninitialized dynptr. This is done in mark_stack_slots_dynptr. It allows +screening off mark_reg_read and not propagating marks upwards from that +point. + +This ensures that we either set REG_LIVE_READ64 on both dynptr slots, or +none, so clean_live_states either sets both slots to STACK_INVALID or +none of them. This is the invariant the checks inside stacksafe rely on. + +Next, do a complete comparison of both stack slots whenever they have +STACK_DYNPTR. Compare the dynptr type stored in the spilled_ptr, and +also whether both form the same first_slot. Only then is the later path +safe. + +Fixes: 97e03f521050 ("bpf: Add verifier support for dynptrs") +Acked-by: Eduard Zingerman +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20230121002241.2113993-2-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak +--- + kernel/bpf/verifier.c | 88 +++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 84 insertions(+), 4 deletions(-) + +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c +index d26f04b12..aff498729 100644 +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -762,6 +762,9 @@ static int mark_stack_slots_dynptr(struct bpf_verifier_env *env, struct bpf_reg_ + state->stack[spi - 1].spilled_ptr.ref_obj_id = id; + } + ++ state->stack[spi].spilled_ptr.live |= REG_LIVE_WRITTEN; ++ state->stack[spi - 1].spilled_ptr.live |= REG_LIVE_WRITTEN; ++ + return 0; + } + +@@ -786,6 +789,31 @@ static int unmark_stack_slots_dynptr(struct bpf_verifier_env *env, struct bpf_re + + __mark_reg_not_init(env, &state->stack[spi].spilled_ptr); + __mark_reg_not_init(env, &state->stack[spi - 1].spilled_ptr); ++ ++ /* Why do we need to set REG_LIVE_WRITTEN for STACK_INVALID slot? ++ * ++ * While we don't allow reading STACK_INVALID, it is still possible to ++ * do <8 byte writes marking some but not all slots as STACK_MISC. Then, ++ * helpers or insns can do partial read of that part without failing, ++ * but check_stack_range_initialized, check_stack_read_var_off, and ++ * check_stack_read_fixed_off will do mark_reg_read for all 8-bytes of ++ * the slot conservatively. Hence we need to prevent those liveness ++ * marking walks. ++ * ++ * This was not a problem before because STACK_INVALID is only set by ++ * default (where the default reg state has its reg->parent as NULL), or ++ * in clean_live_states after REG_LIVE_DONE (at which point ++ * mark_reg_read won't walk reg->parent chain), but not randomly during ++ * verifier state exploration (like we did above). Hence, for our case ++ * parentage chain will still be live (i.e. reg->parent may be ++ * non-NULL), while earlier reg->parent was NULL, so we need ++ * REG_LIVE_WRITTEN to screen off read marker propagation when it is ++ * done later on reads or by mark_dynptr_read as well to unnecessary ++ * mark registers in verifier state. ++ */ ++ state->stack[spi].spilled_ptr.live |= REG_LIVE_WRITTEN; ++ state->stack[spi - 1].spilled_ptr.live |= REG_LIVE_WRITTEN; ++ + return 0; + } + +@@ -2367,6 +2395,30 @@ static int mark_reg_read(struct bpf_verifier_env *env, + return 0; + } + ++static int mark_dynptr_read(struct bpf_verifier_env *env, struct bpf_reg_state *reg) ++{ ++ struct bpf_func_state *state = func(env, reg); ++ int spi, ret; ++ ++ /* For CONST_PTR_TO_DYNPTR, it must have already been done by ++ * check_reg_arg in check_helper_call and mark_btf_func_reg_size in ++ * check_kfunc_call. ++ */ ++ if (reg->type == CONST_PTR_TO_DYNPTR) ++ return 0; ++ spi = get_spi(reg->off); ++ /* Caller ensures dynptr is valid and initialized, which means spi is in ++ * bounds and spi is the first dynptr slot. Simply mark stack slot as ++ * read. ++ */ ++ ret = mark_reg_read(env, &state->stack[spi].spilled_ptr, ++ state->stack[spi].spilled_ptr.parent, REG_LIVE_READ64); ++ if (ret) ++ return ret; ++ return mark_reg_read(env, &state->stack[spi - 1].spilled_ptr, ++ state->stack[spi - 1].spilled_ptr.parent, REG_LIVE_READ64); ++} ++ + /* This function is supposed to be used by the following 32-bit optimization + * code only. It returns TRUE if the source or destination register operates + * on 64-bit, otherwise return FALSE. +@@ -5929,6 +5981,8 @@ int process_dynptr_func(struct bpf_verifier_env *env, int regno, + + meta->uninit_dynptr_regno = regno; + } else /* MEM_RDONLY and None case from above */ { ++ int err; ++ + /* For the reg->type == PTR_TO_STACK case, bpf_dynptr is never const */ + if (reg->type == CONST_PTR_TO_DYNPTR && !(arg_type & MEM_RDONLY)) { + verbose(env, "cannot pass pointer to const bpf_dynptr, the helper mutates it\n"); +@@ -5962,6 +6016,10 @@ int process_dynptr_func(struct bpf_verifier_env *env, int regno, + err_extra, regno); + return -EINVAL; + } ++ ++ err = mark_dynptr_read(env, reg); ++ if (err) ++ return err; + } + return 0; + } +@@ -12060,10 +12118,9 @@ static bool stacksafe(struct bpf_verifier_env *env, struct bpf_func_state *old, + return false; + if (i % BPF_REG_SIZE != BPF_REG_SIZE - 1) + continue; +- if (!is_spilled_reg(&old->stack[spi])) +- continue; +- if (!regsafe(env, &old->stack[spi].spilled_ptr, +- &cur->stack[spi].spilled_ptr, idmap)) ++ /* Both old and cur are having same slot_type */ ++ switch (old->stack[spi].slot_type[BPF_REG_SIZE - 1]) { ++ case STACK_SPILL: + /* when explored and current stack slot are both storing + * spilled registers, check that stored pointers types + * are the same as well. +@@ -12074,7 +12131,30 @@ static bool stacksafe(struct bpf_verifier_env *env, struct bpf_func_state *old, + * such verifier states are not equivalent. + * return false to continue verification of this path + */ ++ if (!regsafe(env, &old->stack[spi].spilled_ptr, ++ &cur->stack[spi].spilled_ptr, idmap)) ++ return false; ++ break; ++ case STACK_DYNPTR: ++ { ++ const struct bpf_reg_state *old_reg, *cur_reg; ++ ++ old_reg = &old->stack[spi].spilled_ptr; ++ cur_reg = &cur->stack[spi].spilled_ptr; ++ if (old_reg->dynptr.type != cur_reg->dynptr.type || ++ old_reg->dynptr.first_slot != cur_reg->dynptr.first_slot || ++ !check_ids(old_reg->ref_obj_id, cur_reg->ref_obj_id, idmap)) ++ return false; ++ break; ++ } ++ case STACK_MISC: ++ case STACK_ZERO: ++ case STACK_INVALID: ++ continue; ++ /* Ensure that new unhandled slot types return false by default */ ++ default: + return false; ++ } + } + return true; + } +-- +2.39.0 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0009-bpf-Fix-missing-var_off-check-for-ARG_PTR_TO_DYNPTR.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0009-bpf-Fix-missing-var_off-check-for-ARG_PTR_TO_DYNPTR.patch new file mode 100644 index 0000000000..6da7c1ed25 --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0009-bpf-Fix-missing-var_off-check-for-ARG_PTR_TO_DYNPTR.patch @@ -0,0 +1,249 @@ +From 79168a669d8125453c8a271115f1ffd4294e61f6 Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Sat, 21 Jan 2023 05:52:31 +0530 +Subject: [PATCH 09/19] bpf: Fix missing var_off check for ARG_PTR_TO_DYNPTR + +[ upstream commit 79168a669d8125453c8a271115f1ffd4294e61f6 ] + +Currently, the dynptr function is not checking the variable offset part +of PTR_TO_STACK that it needs to check. The fixed offset is considered +when computing the stack pointer index, but if the variable offset was +not a constant (such that it could not be accumulated in reg->off), we +will end up a discrepency where runtime pointer does not point to the +actual stack slot we mark as STACK_DYNPTR. + +It is impossible to precisely track dynptr state when variable offset is +not constant, hence, just like bpf_timer, kptr, bpf_spin_lock, etc. +simply reject the case where reg->var_off is not constant. Then, +consider both reg->off and reg->var_off.value when computing the stack +pointer index. + +A new helper dynptr_get_spi is introduced to hide over these details +since the dynptr needs to be located in multiple places outside the +process_dynptr_func checks, hence once we know it's a PTR_TO_STACK, we +need to enforce these checks in all places. + +Note that it is disallowed for unprivileged users to have a non-constant +var_off, so this problem should only be possible to trigger from +programs having CAP_PERFMON. However, its effects can vary. + +Without the fix, it is possible to replace the contents of the dynptr +arbitrarily by making verifier mark different stack slots than actual +location and then doing writes to the actual stack address of dynptr at +runtime. + +Fixes: 97e03f521050 ("bpf: Add verifier support for dynptrs") +Acked-by: Joanne Koong +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20230121002241.2113993-3-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak +--- + kernel/bpf/verifier.c | 84 +++++++++++++++---- + .../bpf/prog_tests/kfunc_dynptr_param.c | 2 +- + 2 files changed, 67 insertions(+), 19 deletions(-) + +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c +index aff498729..c24550509 100644 +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -619,11 +619,34 @@ static void print_liveness(struct bpf_verifier_env *env, + verbose(env, "D"); + } + +-static int get_spi(s32 off) ++static int __get_spi(s32 off) + { + return (-off - 1) / BPF_REG_SIZE; + } + ++static int dynptr_get_spi(struct bpf_verifier_env *env, struct bpf_reg_state *reg) ++{ ++ int off, spi; ++ ++ if (!tnum_is_const(reg->var_off)) { ++ verbose(env, "dynptr has to be at a constant offset\n"); ++ return -EINVAL; ++ } ++ ++ off = reg->off + reg->var_off.value; ++ if (off % BPF_REG_SIZE) { ++ verbose(env, "cannot pass in dynptr at an offset=%d\n", off); ++ return -EINVAL; ++ } ++ ++ spi = __get_spi(off); ++ if (spi < 1) { ++ verbose(env, "cannot pass in dynptr at an offset=%d\n", off); ++ return -EINVAL; ++ } ++ return spi; ++} ++ + static bool is_spi_bounds_valid(struct bpf_func_state *state, int spi, int nr_slots) + { + int allocated_slots = state->allocated_stack / BPF_REG_SIZE; +@@ -735,7 +758,9 @@ static int mark_stack_slots_dynptr(struct bpf_verifier_env *env, struct bpf_reg_ + enum bpf_dynptr_type type; + int spi, i, id; + +- spi = get_spi(reg->off); ++ spi = dynptr_get_spi(env, reg); ++ if (spi < 0) ++ return spi; + + if (!is_spi_bounds_valid(state, spi, BPF_DYNPTR_NR_SLOTS)) + return -EINVAL; +@@ -773,7 +798,9 @@ static int unmark_stack_slots_dynptr(struct bpf_verifier_env *env, struct bpf_re + struct bpf_func_state *state = func(env, reg); + int spi, i; + +- spi = get_spi(reg->off); ++ spi = dynptr_get_spi(env, reg); ++ if (spi < 0) ++ return spi; + + if (!is_spi_bounds_valid(state, spi, BPF_DYNPTR_NR_SLOTS)) + return -EINVAL; +@@ -825,7 +852,11 @@ static bool is_dynptr_reg_valid_uninit(struct bpf_verifier_env *env, struct bpf_ + if (reg->type == CONST_PTR_TO_DYNPTR) + return false; + +- spi = get_spi(reg->off); ++ spi = dynptr_get_spi(env, reg); ++ if (spi < 0) ++ return false; ++ ++ /* We will do check_mem_access to check and update stack bounds later */ + if (!is_spi_bounds_valid(state, spi, BPF_DYNPTR_NR_SLOTS)) + return true; + +@@ -842,14 +873,15 @@ bool is_dynptr_reg_valid_init(struct bpf_verifier_env *env, + struct bpf_reg_state *reg) + { + struct bpf_func_state *state = func(env, reg); +- int spi; +- int i; ++ int spi, i; + + /* This already represents first slot of initialized bpf_dynptr */ + if (reg->type == CONST_PTR_TO_DYNPTR) + return true; + +- spi = get_spi(reg->off); ++ spi = dynptr_get_spi(env, reg); ++ if (spi < 0) ++ return false; + if (!is_spi_bounds_valid(state, spi, BPF_DYNPTR_NR_SLOTS) || + !state->stack[spi].spilled_ptr.dynptr.first_slot) + return false; +@@ -879,7 +911,9 @@ bool is_dynptr_type_expected(struct bpf_verifier_env *env, + if (reg->type == CONST_PTR_TO_DYNPTR) { + return reg->dynptr.type == dynptr_type; + } else { +- spi = get_spi(reg->off); ++ spi = dynptr_get_spi(env, reg); ++ if (spi < 0) ++ return false; + return state->stack[spi].spilled_ptr.dynptr.type == dynptr_type; + } + } +@@ -2406,7 +2440,9 @@ static int mark_dynptr_read(struct bpf_verifier_env *env, struct bpf_reg_state * + */ + if (reg->type == CONST_PTR_TO_DYNPTR) + return 0; +- spi = get_spi(reg->off); ++ spi = dynptr_get_spi(env, reg); ++ if (spi < 0) ++ return spi; + /* Caller ensures dynptr is valid and initialized, which means spi is in + * bounds and spi is the first dynptr slot. Simply mark stack slot as + * read. +@@ -5944,12 +5980,15 @@ int process_dynptr_func(struct bpf_verifier_env *env, int regno, + } + /* CONST_PTR_TO_DYNPTR already has fixed and var_off as 0 due to + * check_func_arg_reg_off's logic. We only need to check offset +- * alignment for PTR_TO_STACK. ++ * and its alignment for PTR_TO_STACK. + */ +- if (reg->type == PTR_TO_STACK && (reg->off % BPF_REG_SIZE)) { +- verbose(env, "cannot pass in dynptr at an offset=%d\n", reg->off); +- return -EINVAL; ++ if (reg->type == PTR_TO_STACK) { ++ int err = dynptr_get_spi(env, reg); ++ ++ if (err < 0) ++ return err; + } ++ + /* MEM_UNINIT - Points to memory that is an appropriate candidate for + * constructing a mutable bpf_dynptr object. + * +@@ -6340,15 +6379,16 @@ int check_func_arg_reg_off(struct bpf_verifier_env *env, + } + } + +-static u32 dynptr_ref_obj_id(struct bpf_verifier_env *env, struct bpf_reg_state *reg) ++static int dynptr_ref_obj_id(struct bpf_verifier_env *env, struct bpf_reg_state *reg) + { + struct bpf_func_state *state = func(env, reg); + int spi; + + if (reg->type == CONST_PTR_TO_DYNPTR) + return reg->ref_obj_id; +- +- spi = get_spi(reg->off); ++ spi = dynptr_get_spi(env, reg); ++ if (spi < 0) ++ return spi; + return state->stack[spi].spilled_ptr.ref_obj_id; + } + +@@ -6421,7 +6461,9 @@ static int check_func_arg(struct bpf_verifier_env *env, u32 arg, + * PTR_TO_STACK. + */ + if (reg->type == PTR_TO_STACK) { +- spi = get_spi(reg->off); ++ spi = dynptr_get_spi(env, reg); ++ if (spi < 0) ++ return spi; + if (!is_spi_bounds_valid(state, spi, BPF_DYNPTR_NR_SLOTS) || + !state->stack[spi].spilled_ptr.ref_obj_id) { + verbose(env, "arg %d is an unacquired reference\n", regno); +@@ -7883,13 +7925,19 @@ static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn + for (i = 0; i < MAX_BPF_FUNC_REG_ARGS; i++) { + if (arg_type_is_dynptr(fn->arg_type[i])) { + struct bpf_reg_state *reg = ®s[BPF_REG_1 + i]; ++ int ref_obj_id; + + if (meta.ref_obj_id) { + verbose(env, "verifier internal error: meta.ref_obj_id already set\n"); + return -EFAULT; + } + +- meta.ref_obj_id = dynptr_ref_obj_id(env, reg); ++ ref_obj_id = dynptr_ref_obj_id(env, reg); ++ if (ref_obj_id < 0) { ++ verbose(env, "verifier internal error: failed to obtain dynptr ref_obj_id\n"); ++ return ref_obj_id; ++ } ++ meta.ref_obj_id = ref_obj_id; + break; + } + } +diff --git a/tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c b/tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c +index a9229260a..72800b1e8 100644 +--- a/tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c ++++ b/tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c +@@ -18,7 +18,7 @@ static struct { + const char *expected_verifier_err_msg; + int expected_runtime_err; + } kfunc_dynptr_tests[] = { +- {"not_valid_dynptr", "Expected an initialized dynptr as arg #1", 0}, ++ {"not_valid_dynptr", "cannot pass in dynptr at an offset=-8", 0}, + {"not_ptr_to_stack", "arg#0 expected pointer to stack or dynptr_ptr", 0}, + {"dynptr_data_null", NULL, -EBADMSG}, + }; +-- +2.39.0 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0010-bpf-Fix-partial-dynptr-stack-slot-reads-writes.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0010-bpf-Fix-partial-dynptr-stack-slot-reads-writes.patch new file mode 100644 index 0000000000..7232ee88d1 --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0010-bpf-Fix-partial-dynptr-stack-slot-reads-writes.patch @@ -0,0 +1,219 @@ +From ef8fc7a07c0e161841779d6fe3f6acd5a05c547c Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Sat, 21 Jan 2023 05:52:32 +0530 +Subject: [PATCH 10/19] bpf: Fix partial dynptr stack slot reads/writes + +[ upstream commit ef8fc7a07c0e161841779d6fe3f6acd5a05c547c ] + +Currently, while reads are disallowed for dynptr stack slots, writes are +not. Reads don't work from both direct access and helpers, while writes +do work in both cases, but have the effect of overwriting the slot_type. + +While this is fine, handling for a few edge cases is missing. Firstly, +a user can overwrite the stack slots of dynptr partially. + +Consider the following layout: +spi: [d][d][?] + 2 1 0 + +First slot is at spi 2, second at spi 1. +Now, do a write of 1 to 8 bytes for spi 1. + +This will essentially either write STACK_MISC for all slot_types or +STACK_MISC and STACK_ZERO (in case of size < BPF_REG_SIZE partial write +of zeroes). The end result is that slot is scrubbed. + +Now, the layout is: +spi: [d][m][?] + 2 1 0 + +Suppose if user initializes spi = 1 as dynptr. +We get: +spi: [d][d][d] + 2 1 0 + +But this time, both spi 2 and spi 1 have first_slot = true. + +Now, when passing spi 2 to dynptr helper, it will consider it as +initialized as it does not check whether second slot has first_slot == +false. And spi 1 should already work as normal. + +This effectively replaced size + offset of first dynptr, hence allowing +invalid OOB reads and writes. + +Make a few changes to protect against this: +When writing to PTR_TO_STACK using BPF insns, when we touch spi of a +STACK_DYNPTR type, mark both first and second slot (regardless of which +slot we touch) as STACK_INVALID. Reads are already prevented. + +Second, prevent writing to stack memory from helpers if the range may +contain any STACK_DYNPTR slots. Reads are already prevented. + +For helpers, we cannot allow it to destroy dynptrs from the writes as +depending on arguments, helper may take uninit_mem and dynptr both at +the same time. This would mean that helper may write to uninit_mem +before it reads the dynptr, which would be bad. + +PTR_TO_MEM: [?????dd] + +Depending on the code inside the helper, it may end up overwriting the +dynptr contents first and then read those as the dynptr argument. + +Verifier would only simulate destruction when it does byte by byte +access simulation in check_helper_call for meta.access_size, and +fail to catch this case, as it happens after argument checks. + +The same would need to be done for any other non-trivial objects created +on the stack in the future, such as bpf_list_head on stack, or +bpf_rb_root on stack. + +A common misunderstanding in the current code is that MEM_UNINIT means +writes, but note that writes may also be performed even without +MEM_UNINIT in case of helpers, in that case the code after handling meta +&& meta->raw_mode will complain when it sees STACK_DYNPTR. So that +invalid read case also covers writes to potential STACK_DYNPTR slots. +The only loophole was in case of meta->raw_mode which simulated writes +through instructions which could overwrite them. + +A future series sequenced after this will focus on the clean up of +helper access checks and bugs around that. + +Fixes: 97e03f521050 ("bpf: Add verifier support for dynptrs") +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20230121002241.2113993-4-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak +--- + kernel/bpf/verifier.c | 88 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 88 insertions(+) + +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c +index c24550509..75fe95671 100644 +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -750,6 +750,8 @@ static void mark_dynptr_cb_reg(struct bpf_reg_state *reg, + __mark_dynptr_reg(reg, type, true); + } + ++static int destroy_if_dynptr_stack_slot(struct bpf_verifier_env *env, ++ struct bpf_func_state *state, int spi); + + static int mark_stack_slots_dynptr(struct bpf_verifier_env *env, struct bpf_reg_state *reg, + enum bpf_arg_type arg_type, int insn_idx) +@@ -844,6 +846,55 @@ static int unmark_stack_slots_dynptr(struct bpf_verifier_env *env, struct bpf_re + return 0; + } + ++static void __mark_reg_unknown(const struct bpf_verifier_env *env, ++ struct bpf_reg_state *reg); ++ ++static int destroy_if_dynptr_stack_slot(struct bpf_verifier_env *env, ++ struct bpf_func_state *state, int spi) ++{ ++ int i; ++ ++ /* We always ensure that STACK_DYNPTR is never set partially, ++ * hence just checking for slot_type[0] is enough. This is ++ * different for STACK_SPILL, where it may be only set for ++ * 1 byte, so code has to use is_spilled_reg. ++ */ ++ if (state->stack[spi].slot_type[0] != STACK_DYNPTR) ++ return 0; ++ ++ /* Reposition spi to first slot */ ++ if (!state->stack[spi].spilled_ptr.dynptr.first_slot) ++ spi = spi + 1; ++ ++ if (dynptr_type_refcounted(state->stack[spi].spilled_ptr.dynptr.type)) { ++ verbose(env, "cannot overwrite referenced dynptr\n"); ++ return -EINVAL; ++ } ++ ++ mark_stack_slot_scratched(env, spi); ++ mark_stack_slot_scratched(env, spi - 1); ++ ++ /* Writing partially to one dynptr stack slot destroys both. */ ++ for (i = 0; i < BPF_REG_SIZE; i++) { ++ state->stack[spi].slot_type[i] = STACK_INVALID; ++ state->stack[spi - 1].slot_type[i] = STACK_INVALID; ++ } ++ ++ /* TODO: Invalidate any slices associated with this dynptr */ ++ ++ /* Do not release reference state, we are destroying dynptr on stack, ++ * not using some helper to release it. Just reset register. ++ */ ++ __mark_reg_not_init(env, &state->stack[spi].spilled_ptr); ++ __mark_reg_not_init(env, &state->stack[spi - 1].spilled_ptr); ++ ++ /* Same reason as unmark_stack_slots_dynptr above */ ++ state->stack[spi].spilled_ptr.live |= REG_LIVE_WRITTEN; ++ state->stack[spi - 1].spilled_ptr.live |= REG_LIVE_WRITTEN; ++ ++ return 0; ++} ++ + static bool is_dynptr_reg_valid_uninit(struct bpf_verifier_env *env, struct bpf_reg_state *reg) + { + struct bpf_func_state *state = func(env, reg); +@@ -3395,6 +3446,10 @@ static int check_stack_write_fixed_off(struct bpf_verifier_env *env, + env->insn_aux_data[insn_idx].sanitize_stack_spill = true; + } + ++ err = destroy_if_dynptr_stack_slot(env, state, spi); ++ if (err) ++ return err; ++ + mark_stack_slot_scratched(env, spi); + if (reg && !(off % BPF_REG_SIZE) && register_is_bounded(reg) && + !register_is_null(reg) && env->bpf_capable) { +@@ -3519,6 +3574,14 @@ static int check_stack_write_var_off(struct bpf_verifier_env *env, + if (err) + return err; + ++ for (i = min_off; i < max_off; i++) { ++ int spi; ++ ++ spi = __get_spi(i); ++ err = destroy_if_dynptr_stack_slot(env, state, spi); ++ if (err) ++ return err; ++ } + + /* Variable offset writes destroy any spilled pointers in range. */ + for (i = min_off; i < max_off; i++) { +@@ -5498,6 +5561,31 @@ static int check_stack_range_initialized( + } + + if (meta && meta->raw_mode) { ++ /* Ensure we won't be overwriting dynptrs when simulating byte ++ * by byte access in check_helper_call using meta.access_size. ++ * This would be a problem if we have a helper in the future ++ * which takes: ++ * ++ * helper(uninit_mem, len, dynptr) ++ * ++ * Now, uninint_mem may overlap with dynptr pointer. Hence, it ++ * may end up writing to dynptr itself when touching memory from ++ * arg 1. This can be relaxed on a case by case basis for known ++ * safe cases, but reject due to the possibilitiy of aliasing by ++ * default. ++ */ ++ for (i = min_off; i < max_off + access_size; i++) { ++ int stack_off = -i - 1; ++ ++ spi = __get_spi(i); ++ /* raw_mode may write past allocated_stack */ ++ if (state->allocated_stack <= stack_off) ++ continue; ++ if (state->stack[spi].slot_type[stack_off % BPF_REG_SIZE] == STACK_DYNPTR) { ++ verbose(env, "potential write to dynptr at off=%d disallowed\n", i); ++ return -EACCES; ++ } ++ } + meta->access_size = access_size; + meta->regno = regno; + return 0; +-- +2.39.0 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0011-bpf-Invalidate-slices-on-destruction-of-dynptrs-on-s.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0011-bpf-Invalidate-slices-on-destruction-of-dynptrs-on-s.patch new file mode 100644 index 0000000000..2570f77335 --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0011-bpf-Invalidate-slices-on-destruction-of-dynptrs-on-s.patch @@ -0,0 +1,237 @@ +From f8064ab90d6644bc8338d2d7ff6a0d6e7a1b2ef3 Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Sat, 21 Jan 2023 05:52:33 +0530 +Subject: [PATCH 11/19] bpf: Invalidate slices on destruction of dynptrs on + stack + +[ upstream commit f8064ab90d6644bc8338d2d7ff6a0d6e7a1b2ef3 ] + +The previous commit implemented destroy_if_dynptr_stack_slot. It +destroys the dynptr which given spi belongs to, but still doesn't +invalidate the slices that belong to such a dynptr. While for the case +of referenced dynptr, we don't allow their overwrite and return an error +early, we still allow it and destroy the dynptr for unreferenced dynptr. + +To be able to enable precise and scoped invalidation of dynptr slices in +this case, we must be able to associate the source dynptr of slices that +have been obtained using bpf_dynptr_data. When doing destruction, only +slices belonging to the dynptr being destructed should be invalidated, +and nothing else. Currently, dynptr slices belonging to different +dynptrs are indistinguishible. + +Hence, allocate a unique id to each dynptr (CONST_PTR_TO_DYNPTR and +those on stack). This will be stored as part of reg->id. Whenever using +bpf_dynptr_data, transfer this unique dynptr id to the returned +PTR_TO_MEM_OR_NULL slice pointer, and store it in a new per-PTR_TO_MEM +dynptr_id register state member. + +Finally, after establishing such a relationship between dynptrs and +their slices, implement precise invalidation logic that only invalidates +slices belong to the destroyed dynptr in destroy_if_dynptr_stack_slot. + +Acked-by: Joanne Koong +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20230121002241.2113993-5-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak +--- + include/linux/bpf_verifier.h | 5 ++- + kernel/bpf/verifier.c | 74 ++++++++++++++++++++++++++++++------ + 2 files changed, 66 insertions(+), 13 deletions(-) + +diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h +index 28730e3ff..bfe52bedd 100644 +--- a/include/linux/bpf_verifier.h ++++ b/include/linux/bpf_verifier.h +@@ -70,7 +70,10 @@ struct bpf_reg_state { + u32 btf_id; + }; + +- u32 mem_size; /* for PTR_TO_MEM | PTR_TO_MEM_OR_NULL */ ++ struct { /* for PTR_TO_MEM | PTR_TO_MEM_OR_NULL */ ++ u32 mem_size; ++ u32 dynptr_id; /* for dynptr slices */ ++ }; + + /* For dynptr stack slots */ + struct { +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c +index 75fe95671..731d744b7 100644 +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -255,6 +255,7 @@ struct bpf_call_arg_meta { + int mem_size; + u64 msize_max_value; + int ref_obj_id; ++ int dynptr_id; + int map_uid; + int func_id; + struct btf *btf; +@@ -731,23 +732,27 @@ static bool dynptr_type_refcounted(enum bpf_dynptr_type type) + + static void __mark_dynptr_reg(struct bpf_reg_state *reg, + enum bpf_dynptr_type type, +- bool first_slot); ++ bool first_slot, int dynptr_id); + + static void __mark_reg_not_init(const struct bpf_verifier_env *env, + struct bpf_reg_state *reg); + +-static void mark_dynptr_stack_regs(struct bpf_reg_state *sreg1, ++static void mark_dynptr_stack_regs(struct bpf_verifier_env *env, ++ struct bpf_reg_state *sreg1, + struct bpf_reg_state *sreg2, + enum bpf_dynptr_type type) + { +- __mark_dynptr_reg(sreg1, type, true); +- __mark_dynptr_reg(sreg2, type, false); ++ int id = ++env->id_gen; ++ ++ __mark_dynptr_reg(sreg1, type, true, id); ++ __mark_dynptr_reg(sreg2, type, false, id); + } + +-static void mark_dynptr_cb_reg(struct bpf_reg_state *reg, ++static void mark_dynptr_cb_reg(struct bpf_verifier_env *env, ++ struct bpf_reg_state *reg, + enum bpf_dynptr_type type) + { +- __mark_dynptr_reg(reg, type, true); ++ __mark_dynptr_reg(reg, type, true, ++env->id_gen); + } + + static int destroy_if_dynptr_stack_slot(struct bpf_verifier_env *env, +@@ -776,7 +781,7 @@ static int mark_stack_slots_dynptr(struct bpf_verifier_env *env, struct bpf_reg_ + if (type == BPF_DYNPTR_TYPE_INVALID) + return -EINVAL; + +- mark_dynptr_stack_regs(&state->stack[spi].spilled_ptr, ++ mark_dynptr_stack_regs(env, &state->stack[spi].spilled_ptr, + &state->stack[spi - 1].spilled_ptr, type); + + if (dynptr_type_refcounted(type)) { +@@ -852,7 +857,9 @@ static void __mark_reg_unknown(const struct bpf_verifier_env *env, + static int destroy_if_dynptr_stack_slot(struct bpf_verifier_env *env, + struct bpf_func_state *state, int spi) + { +- int i; ++ struct bpf_func_state *fstate; ++ struct bpf_reg_state *dreg; ++ int i, dynptr_id; + + /* We always ensure that STACK_DYNPTR is never set partially, + * hence just checking for slot_type[0] is enough. This is +@@ -880,7 +887,19 @@ static int destroy_if_dynptr_stack_slot(struct bpf_verifier_env *env, + state->stack[spi - 1].slot_type[i] = STACK_INVALID; + } + +- /* TODO: Invalidate any slices associated with this dynptr */ ++ dynptr_id = state->stack[spi].spilled_ptr.id; ++ /* Invalidate any slices associated with this dynptr */ ++ bpf_for_each_reg_in_vstate(env->cur_state, fstate, dreg, ({ ++ /* Dynptr slices are only PTR_TO_MEM_OR_NULL and PTR_TO_MEM */ ++ if (dreg->type != (PTR_TO_MEM | PTR_MAYBE_NULL) && dreg->type != PTR_TO_MEM) ++ continue; ++ if (dreg->dynptr_id == dynptr_id) { ++ if (!env->allow_ptr_leaks) ++ __mark_reg_not_init(env, dreg); ++ else ++ __mark_reg_unknown(env, dreg); ++ } ++ })); + + /* Do not release reference state, we are destroying dynptr on stack, + * not using some helper to release it. Just reset register. +@@ -1541,7 +1560,7 @@ static void mark_reg_known_zero(struct bpf_verifier_env *env, + } + + static void __mark_dynptr_reg(struct bpf_reg_state *reg, enum bpf_dynptr_type type, +- bool first_slot) ++ bool first_slot, int dynptr_id) + { + /* reg->type has no meaning for STACK_DYNPTR, but when we set reg for + * callback arguments, it does need to be CONST_PTR_TO_DYNPTR, so simply +@@ -1549,6 +1568,8 @@ static void __mark_dynptr_reg(struct bpf_reg_state *reg, enum bpf_dynptr_type ty + */ + __mark_reg_known_zero(reg); + reg->type = CONST_PTR_TO_DYNPTR; ++ /* Give each dynptr a unique id to uniquely associate slices to it. */ ++ reg->id = dynptr_id; + reg->dynptr.type = type; + reg->dynptr.first_slot = first_slot; + } +@@ -6467,6 +6488,19 @@ int check_func_arg_reg_off(struct bpf_verifier_env *env, + } + } + ++static int dynptr_id(struct bpf_verifier_env *env, struct bpf_reg_state *reg) ++{ ++ struct bpf_func_state *state = func(env, reg); ++ int spi; ++ ++ if (reg->type == CONST_PTR_TO_DYNPTR) ++ return reg->id; ++ spi = dynptr_get_spi(env, reg); ++ if (spi < 0) ++ return spi; ++ return state->stack[spi].spilled_ptr.id; ++} ++ + static int dynptr_ref_obj_id(struct bpf_verifier_env *env, struct bpf_reg_state *reg) + { + struct bpf_func_state *state = func(env, reg); +@@ -7524,7 +7558,7 @@ static int set_user_ringbuf_callback_state(struct bpf_verifier_env *env, + * callback_fn(const struct bpf_dynptr_t* dynptr, void *callback_ctx); + */ + __mark_reg_not_init(env, &callee->regs[BPF_REG_0]); +- mark_dynptr_cb_reg(&callee->regs[BPF_REG_1], BPF_DYNPTR_TYPE_LOCAL); ++ mark_dynptr_cb_reg(env, &callee->regs[BPF_REG_1], BPF_DYNPTR_TYPE_LOCAL); + callee->regs[BPF_REG_2] = caller->regs[BPF_REG_3]; + + /* unused */ +@@ -8013,18 +8047,31 @@ static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn + for (i = 0; i < MAX_BPF_FUNC_REG_ARGS; i++) { + if (arg_type_is_dynptr(fn->arg_type[i])) { + struct bpf_reg_state *reg = ®s[BPF_REG_1 + i]; +- int ref_obj_id; ++ int id, ref_obj_id; ++ ++ if (meta.dynptr_id) { ++ verbose(env, "verifier internal error: meta.dynptr_id already set\n"); ++ return -EFAULT; ++ } + + if (meta.ref_obj_id) { + verbose(env, "verifier internal error: meta.ref_obj_id already set\n"); + return -EFAULT; + } + ++ id = dynptr_id(env, reg); ++ if (id < 0) { ++ verbose(env, "verifier internal error: failed to obtain dynptr id\n"); ++ return id; ++ } ++ + ref_obj_id = dynptr_ref_obj_id(env, reg); + if (ref_obj_id < 0) { + verbose(env, "verifier internal error: failed to obtain dynptr ref_obj_id\n"); + return ref_obj_id; + } ++ ++ meta.dynptr_id = id; + meta.ref_obj_id = ref_obj_id; + break; + } +@@ -8181,6 +8228,9 @@ static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn + return -EFAULT; + } + ++ if (is_dynptr_ref_function(func_id)) ++ regs[BPF_REG_0].dynptr_id = meta.dynptr_id; ++ + if (is_ptr_cast_function(func_id) || is_dynptr_ref_function(func_id)) { + /* For release_reference() */ + regs[BPF_REG_0].ref_obj_id = meta.ref_obj_id; +-- +2.39.0 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0012-bpf-Allow-reinitializing-unreferenced-dynptr-stack-s.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0012-bpf-Allow-reinitializing-unreferenced-dynptr-stack-s.patch new file mode 100644 index 0000000000..646655fed5 --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0012-bpf-Allow-reinitializing-unreferenced-dynptr-stack-s.patch @@ -0,0 +1,116 @@ +From 379d4ba831cfa895d0cc61d88cd0e1402f35818c Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Sat, 21 Jan 2023 05:52:34 +0530 +Subject: [PATCH 12/19] bpf: Allow reinitializing unreferenced dynptr stack + slots + +[ upstream commit 379d4ba831cfa895d0cc61d88cd0e1402f35818c ] + +Consider a program like below: + +void prog(void) +{ + { + struct bpf_dynptr ptr; + bpf_dynptr_from_mem(...); + } + ... + { + struct bpf_dynptr ptr; + bpf_dynptr_from_mem(...); + } +} + +Here, the C compiler based on lifetime rules in the C standard would be +well within in its rights to share stack storage for dynptr 'ptr' as +their lifetimes do not overlap in the two distinct scopes. Currently, +such an example would be rejected by the verifier, but this is too +strict. Instead, we should allow reinitializing over dynptr stack slots +and forget information about the old dynptr object. + +The destroy_if_dynptr_stack_slot function already makes necessary checks +to avoid overwriting referenced dynptr slots. This is done to present a +better error message instead of forgetting dynptr information on stack +and preserving reference state, leading to an inevitable but +undecipherable error at the end about an unreleased reference which has +to be associated back to its allocating call instruction to make any +sense to the user. + +Acked-by: Joanne Koong +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20230121002241.2113993-6-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak +--- + kernel/bpf/verifier.c | 34 ++++++++++++++++++++++++++-------- + 1 file changed, 26 insertions(+), 8 deletions(-) + +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c +index 731d744b7..6364d8454 100644 +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -763,7 +763,7 @@ static int mark_stack_slots_dynptr(struct bpf_verifier_env *env, struct bpf_reg_ + { + struct bpf_func_state *state = func(env, reg); + enum bpf_dynptr_type type; +- int spi, i, id; ++ int spi, i, id, err; + + spi = dynptr_get_spi(env, reg); + if (spi < 0) +@@ -772,6 +772,22 @@ static int mark_stack_slots_dynptr(struct bpf_verifier_env *env, struct bpf_reg_ + if (!is_spi_bounds_valid(state, spi, BPF_DYNPTR_NR_SLOTS)) + return -EINVAL; + ++ /* We cannot assume both spi and spi - 1 belong to the same dynptr, ++ * hence we need to call destroy_if_dynptr_stack_slot twice for both, ++ * to ensure that for the following example: ++ * [d1][d1][d2][d2] ++ * spi 3 2 1 0 ++ * So marking spi = 2 should lead to destruction of both d1 and d2. In ++ * case they do belong to same dynptr, second call won't see slot_type ++ * as STACK_DYNPTR and will simply skip destruction. ++ */ ++ err = destroy_if_dynptr_stack_slot(env, state, spi); ++ if (err) ++ return err; ++ err = destroy_if_dynptr_stack_slot(env, state, spi - 1); ++ if (err) ++ return err; ++ + for (i = 0; i < BPF_REG_SIZE; i++) { + state->stack[spi].slot_type[i] = STACK_DYNPTR; + state->stack[spi - 1].slot_type[i] = STACK_DYNPTR; +@@ -917,7 +933,7 @@ static int destroy_if_dynptr_stack_slot(struct bpf_verifier_env *env, + static bool is_dynptr_reg_valid_uninit(struct bpf_verifier_env *env, struct bpf_reg_state *reg) + { + struct bpf_func_state *state = func(env, reg); +- int spi, i; ++ int spi; + + if (reg->type == CONST_PTR_TO_DYNPTR) + return false; +@@ -930,12 +946,14 @@ static bool is_dynptr_reg_valid_uninit(struct bpf_verifier_env *env, struct bpf_ + if (!is_spi_bounds_valid(state, spi, BPF_DYNPTR_NR_SLOTS)) + return true; + +- for (i = 0; i < BPF_REG_SIZE; i++) { +- if (state->stack[spi].slot_type[i] == STACK_DYNPTR || +- state->stack[spi - 1].slot_type[i] == STACK_DYNPTR) +- return false; +- } +- ++ /* We allow overwriting existing unreferenced STACK_DYNPTR slots, see ++ * mark_stack_slots_dynptr which calls destroy_if_dynptr_stack_slot to ++ * ensure dynptr objects at the slots we are touching are completely ++ * destructed before we reinitialize them for a new one. For referenced ++ * ones, destroy_if_dynptr_stack_slot returns an error early instead of ++ * delaying it until the end where the user will get "Unreleased ++ * reference" error. ++ */ + return true; + } + +-- +2.39.0 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0013-bpf-Combine-dynptr_get_spi-and-is_spi_bounds_valid.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0013-bpf-Combine-dynptr_get_spi-and-is_spi_bounds_valid.patch new file mode 100644 index 0000000000..f66042f9ef --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0013-bpf-Combine-dynptr_get_spi-and-is_spi_bounds_valid.patch @@ -0,0 +1,176 @@ +From f5b625e5f8bbc6be8bb568a64d7906b091bc7cb0 Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Sat, 21 Jan 2023 05:52:35 +0530 +Subject: [PATCH 13/19] bpf: Combine dynptr_get_spi and is_spi_bounds_valid + +[ upstream commit f5b625e5f8bbc6be8bb568a64d7906b091bc7cb0 ] + +Currently, a check on spi resides in dynptr_get_spi, while others +checking its validity for being within the allocated stack slots happens +in is_spi_bounds_valid. Almost always barring a couple of cases (where +being beyond allocated stack slots is not an error as stack slots need +to be populated), both are used together to make checks. Hence, subsume +the is_spi_bounds_valid check in dynptr_get_spi, and return -ERANGE to +specially distinguish the case where spi is valid but not within +allocated slots in the stack state. + +The is_spi_bounds_valid function is still kept around as it is a generic +helper that will be useful for other objects on stack similar to dynptr +in the future. + +Suggested-by: Joanne Koong +Acked-by: Joanne Koong +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20230121002241.2113993-7-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak +--- + kernel/bpf/verifier.c | 75 +++++++++++++++++++------------------------ + 1 file changed, 33 insertions(+), 42 deletions(-) + +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c +index 6364d8454..10e5f40bb 100644 +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -625,6 +625,28 @@ static int __get_spi(s32 off) + return (-off - 1) / BPF_REG_SIZE; + } + ++static struct bpf_func_state *func(struct bpf_verifier_env *env, ++ const struct bpf_reg_state *reg) ++{ ++ struct bpf_verifier_state *cur = env->cur_state; ++ ++ return cur->frame[reg->frameno]; ++} ++ ++static bool is_spi_bounds_valid(struct bpf_func_state *state, int spi, int nr_slots) ++{ ++ int allocated_slots = state->allocated_stack / BPF_REG_SIZE; ++ ++ /* We need to check that slots between [spi - nr_slots + 1, spi] are ++ * within [0, allocated_stack). ++ * ++ * Please note that the spi grows downwards. For example, a dynptr ++ * takes the size of two stack slots; the first slot will be at ++ * spi and the second slot will be at spi - 1. ++ */ ++ return spi - nr_slots + 1 >= 0 && spi < allocated_slots; ++} ++ + static int dynptr_get_spi(struct bpf_verifier_env *env, struct bpf_reg_state *reg) + { + int off, spi; +@@ -645,29 +667,10 @@ static int dynptr_get_spi(struct bpf_verifier_env *env, struct bpf_reg_state *re + verbose(env, "cannot pass in dynptr at an offset=%d\n", off); + return -EINVAL; + } +- return spi; +-} +- +-static bool is_spi_bounds_valid(struct bpf_func_state *state, int spi, int nr_slots) +-{ +- int allocated_slots = state->allocated_stack / BPF_REG_SIZE; + +- /* We need to check that slots between [spi - nr_slots + 1, spi] are +- * within [0, allocated_stack). +- * +- * Please note that the spi grows downwards. For example, a dynptr +- * takes the size of two stack slots; the first slot will be at +- * spi and the second slot will be at spi - 1. +- */ +- return spi - nr_slots + 1 >= 0 && spi < allocated_slots; +-} +- +-static struct bpf_func_state *func(struct bpf_verifier_env *env, +- const struct bpf_reg_state *reg) +-{ +- struct bpf_verifier_state *cur = env->cur_state; +- +- return cur->frame[reg->frameno]; ++ if (!is_spi_bounds_valid(func(env, reg), spi, BPF_DYNPTR_NR_SLOTS)) ++ return -ERANGE; ++ return spi; + } + + static const char *kernel_type_name(const struct btf* btf, u32 id) +@@ -769,9 +772,6 @@ static int mark_stack_slots_dynptr(struct bpf_verifier_env *env, struct bpf_reg_ + if (spi < 0) + return spi; + +- if (!is_spi_bounds_valid(state, spi, BPF_DYNPTR_NR_SLOTS)) +- return -EINVAL; +- + /* We cannot assume both spi and spi - 1 belong to the same dynptr, + * hence we need to call destroy_if_dynptr_stack_slot twice for both, + * to ensure that for the following example: +@@ -825,9 +825,6 @@ static int unmark_stack_slots_dynptr(struct bpf_verifier_env *env, struct bpf_re + if (spi < 0) + return spi; + +- if (!is_spi_bounds_valid(state, spi, BPF_DYNPTR_NR_SLOTS)) +- return -EINVAL; +- + for (i = 0; i < BPF_REG_SIZE; i++) { + state->stack[spi].slot_type[i] = STACK_INVALID; + state->stack[spi - 1].slot_type[i] = STACK_INVALID; +@@ -932,20 +929,18 @@ static int destroy_if_dynptr_stack_slot(struct bpf_verifier_env *env, + + static bool is_dynptr_reg_valid_uninit(struct bpf_verifier_env *env, struct bpf_reg_state *reg) + { +- struct bpf_func_state *state = func(env, reg); + int spi; + + if (reg->type == CONST_PTR_TO_DYNPTR) + return false; + + spi = dynptr_get_spi(env, reg); ++ /* For -ERANGE (i.e. spi not falling into allocated stack slots), we ++ * will do check_mem_access to check and update stack bounds later, so ++ * return true for that case. ++ */ + if (spi < 0) +- return false; +- +- /* We will do check_mem_access to check and update stack bounds later */ +- if (!is_spi_bounds_valid(state, spi, BPF_DYNPTR_NR_SLOTS)) +- return true; +- ++ return spi == -ERANGE; + /* We allow overwriting existing unreferenced STACK_DYNPTR slots, see + * mark_stack_slots_dynptr which calls destroy_if_dynptr_stack_slot to + * ensure dynptr objects at the slots we are touching are completely +@@ -970,8 +965,7 @@ bool is_dynptr_reg_valid_init(struct bpf_verifier_env *env, + spi = dynptr_get_spi(env, reg); + if (spi < 0) + return false; +- if (!is_spi_bounds_valid(state, spi, BPF_DYNPTR_NR_SLOTS) || +- !state->stack[spi].spilled_ptr.dynptr.first_slot) ++ if (!state->stack[spi].spilled_ptr.dynptr.first_slot) + return false; + + for (i = 0; i < BPF_REG_SIZE; i++) { +@@ -6112,7 +6106,7 @@ int process_dynptr_func(struct bpf_verifier_env *env, int regno, + if (reg->type == PTR_TO_STACK) { + int err = dynptr_get_spi(env, reg); + +- if (err < 0) ++ if (err < 0 && err != -ERANGE) + return err; + } + +@@ -6602,10 +6596,7 @@ static int check_func_arg(struct bpf_verifier_env *env, u32 arg, + */ + if (reg->type == PTR_TO_STACK) { + spi = dynptr_get_spi(env, reg); +- if (spi < 0) +- return spi; +- if (!is_spi_bounds_valid(state, spi, BPF_DYNPTR_NR_SLOTS) || +- !state->stack[spi].spilled_ptr.ref_obj_id) { ++ if (spi < 0 || !state->stack[spi].spilled_ptr.ref_obj_id) { + verbose(env, "arg %d is an unacquired reference\n", regno); + return -EINVAL; + } +-- +2.39.0 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0014-selftests-bpf-convenience-macro-for-use-with-asm-vol.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0014-selftests-bpf-convenience-macro-for-use-with-asm-vol.patch new file mode 100644 index 0000000000..aa3cc5d3b6 --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0014-selftests-bpf-convenience-macro-for-use-with-asm-vol.patch @@ -0,0 +1,66 @@ +From 8d8bdd8b079cc463128eadc15a2631c3f35c93ed Mon Sep 17 00:00:00 2001 +From: Eduard Zingerman +Date: Sat, 21 Jan 2023 05:52:37 +0530 +Subject: [PATCH 14/19] selftests/bpf: convenience macro for use with 'asm volatile' + blocks + +[ upstream commit 91b875a5e43b3a8dec4fbdca067c8860004b5f0e ] + +A set of macros useful for writing naked BPF functions using inline +assembly. E.g. as follows: + +struct map_struct { + ... +} map SEC(".maps"); + +SEC(...) +__naked int foo_test(void) +{ + asm volatile( + "r0 = 0;" + "*(u64*)(r10 - 8) = r0;" + "r1 = %[map] ll;" + "r2 = r10;" + "r2 += -8;" + "call %[bpf_map_lookup_elem];" + "r0 = 0;" + "exit;" + : + : __imm(bpf_map_lookup_elem), + __imm_addr(map) + : __clobber_all); +} + +Acked-by: Andrii Nakryiko +Acked-by: Yonghong Song +Signed-off-by: Eduard Zingerman +[ Kartikeya: Add acks, include __clobber_common from Andrii ] +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20230121002241.2113993-9-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak +--- + tools/testing/selftests/bpf/progs/bpf_misc.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/tools/testing/selftests/bpf/progs/bpf_misc.h b/tools/testing/selftests/bpf/progs/bpf_misc.h +index 4a01ea911..2d7b89b44 100644 +--- a/tools/testing/selftests/bpf/progs/bpf_misc.h ++++ b/tools/testing/selftests/bpf/progs/bpf_misc.h +@@ -7,6 +7,13 @@ + #define __success __attribute__((btf_decl_tag("comment:test_expect_success"))) + #define __log_level(lvl) __attribute__((btf_decl_tag("comment:test_log_level="#lvl))) + ++/* Convenience macro for use with 'asm volatile' blocks */ ++#define __naked __attribute__((naked)) ++#define __clobber_all "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "memory" ++#define __clobber_common "r0", "r1", "r2", "r3", "r4", "r5", "memory" ++#define __imm(name) [name]"i"(name) ++#define __imm_addr(name) [name]"i"(&name) ++ + #if defined(__TARGET_ARCH_x86) + #define SYSCALL_WRAPPER 1 + #define SYS_PREFIX "__x64_" +-- +2.53.0 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0015-selftests-bpf-Add-test-for-dynptr-reinit-in-user_rin.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0015-selftests-bpf-Add-test-for-dynptr-reinit-in-user_rin.patch new file mode 100644 index 0000000000..9e9b04dff0 --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0015-selftests-bpf-Add-test-for-dynptr-reinit-in-user_rin.patch @@ -0,0 +1,169 @@ +From 292064cce7969787f13ed9988733aadc12fe0ca2 Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Thu, 8 Dec 2022 02:11:41 +0530 +Subject: [PATCH 15/19] selftests/bpf: Add test for dynptr reinit in user_ringbuf + callback + +[ upstream commit 292064cce7969787f13ed9988733aadc12fe0ca2 ] + +The original support for bpf_user_ringbuf_drain callbacks simply +short-circuited checks for the dynptr state, allowing users to pass +PTR_TO_DYNPTR (now CONST_PTR_TO_DYNPTR) to helpers that initialize a +dynptr. This bug would have also surfaced with other dynptr helpers in +the future that changed dynptr view or modified it in some way. + +Include test cases for all cases, i.e. both bpf_dynptr_from_mem and +bpf_ringbuf_reserve_dynptr, and ensure verifier rejects both of them. +Without the fix, both of these programs load and pass verification. + +While at it, remove sys_nanosleep target from failure cases' SEC +definition, as there is no such tracepoint. + +Acked-by: David Vernet +Acked-by: Joanne Koong +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20221207204141.308952-8-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak +--- + .../selftests/bpf/prog_tests/user_ringbuf.c | 2 + + .../selftests/bpf/progs/user_ringbuf_fail.c | 51 ++++++++++++++++--- + 2 files changed, 45 insertions(+), 8 deletions(-) + +diff --git a/tools/testing/selftests/bpf/prog_tests/user_ringbuf.c b/tools/testing/selftests/bpf/prog_tests/user_ringbuf.c +index aefa0a474..dae68de28 100644 +--- a/tools/testing/selftests/bpf/prog_tests/user_ringbuf.c ++++ b/tools/testing/selftests/bpf/prog_tests/user_ringbuf.c +@@ -676,6 +676,8 @@ static struct { + {"user_ringbuf_callback_discard_dynptr", "cannot release unowned const bpf_dynptr"}, + {"user_ringbuf_callback_submit_dynptr", "cannot release unowned const bpf_dynptr"}, + {"user_ringbuf_callback_invalid_return", "At callback return the register R0 has value"}, ++ {"user_ringbuf_callback_reinit_dynptr_mem", "Dynptr has to be an uninitialized dynptr"}, ++ {"user_ringbuf_callback_reinit_dynptr_ringbuf", "Dynptr has to be an uninitialized dynptr"}, + }; + + #define SUCCESS_TEST(_func) { _func, #_func } +diff --git a/tools/testing/selftests/bpf/progs/user_ringbuf_fail.c b/tools/testing/selftests/bpf/progs/user_ringbuf_fail.c +index 82aba4529..f3201dc69 100644 +--- a/tools/testing/selftests/bpf/progs/user_ringbuf_fail.c ++++ b/tools/testing/selftests/bpf/progs/user_ringbuf_fail.c +@@ -18,6 +18,13 @@ struct { + __uint(type, BPF_MAP_TYPE_USER_RINGBUF); + } user_ringbuf SEC(".maps"); + ++struct { ++ __uint(type, BPF_MAP_TYPE_RINGBUF); ++ __uint(max_entries, 2); ++} ringbuf SEC(".maps"); ++ ++static int map_value; ++ + static long + bad_access1(struct bpf_dynptr *dynptr, void *context) + { +@@ -32,7 +39,7 @@ bad_access1(struct bpf_dynptr *dynptr, void *context) + /* A callback that accesses a dynptr in a bpf_user_ringbuf_drain callback should + * not be able to read before the pointer. + */ +-SEC("?raw_tp/sys_nanosleep") ++SEC("?raw_tp/") + int user_ringbuf_callback_bad_access1(void *ctx) + { + bpf_user_ringbuf_drain(&user_ringbuf, bad_access1, NULL, 0); +@@ -54,7 +61,7 @@ bad_access2(struct bpf_dynptr *dynptr, void *context) + /* A callback that accesses a dynptr in a bpf_user_ringbuf_drain callback should + * not be able to read past the end of the pointer. + */ +-SEC("?raw_tp/sys_nanosleep") ++SEC("?raw_tp/") + int user_ringbuf_callback_bad_access2(void *ctx) + { + bpf_user_ringbuf_drain(&user_ringbuf, bad_access2, NULL, 0); +@@ -73,7 +80,7 @@ write_forbidden(struct bpf_dynptr *dynptr, void *context) + /* A callback that accesses a dynptr in a bpf_user_ringbuf_drain callback should + * not be able to write to that pointer. + */ +-SEC("?raw_tp/sys_nanosleep") ++SEC("?raw_tp/") + int user_ringbuf_callback_write_forbidden(void *ctx) + { + bpf_user_ringbuf_drain(&user_ringbuf, write_forbidden, NULL, 0); +@@ -92,7 +99,7 @@ null_context_write(struct bpf_dynptr *dynptr, void *context) + /* A callback that accesses a dynptr in a bpf_user_ringbuf_drain callback should + * not be able to write to that pointer. + */ +-SEC("?raw_tp/sys_nanosleep") ++SEC("?raw_tp/") + int user_ringbuf_callback_null_context_write(void *ctx) + { + bpf_user_ringbuf_drain(&user_ringbuf, null_context_write, NULL, 0); +@@ -113,7 +120,7 @@ null_context_read(struct bpf_dynptr *dynptr, void *context) + /* A callback that accesses a dynptr in a bpf_user_ringbuf_drain callback should + * not be able to write to that pointer. + */ +-SEC("?raw_tp/sys_nanosleep") ++SEC("?raw_tp/") + int user_ringbuf_callback_null_context_read(void *ctx) + { + bpf_user_ringbuf_drain(&user_ringbuf, null_context_read, NULL, 0); +@@ -132,7 +139,7 @@ try_discard_dynptr(struct bpf_dynptr *dynptr, void *context) + /* A callback that accesses a dynptr in a bpf_user_ringbuf_drain callback should + * not be able to read past the end of the pointer. + */ +-SEC("?raw_tp/sys_nanosleep") ++SEC("?raw_tp/") + int user_ringbuf_callback_discard_dynptr(void *ctx) + { + bpf_user_ringbuf_drain(&user_ringbuf, try_discard_dynptr, NULL, 0); +@@ -151,7 +158,7 @@ try_submit_dynptr(struct bpf_dynptr *dynptr, void *context) + /* A callback that accesses a dynptr in a bpf_user_ringbuf_drain callback should + * not be able to read past the end of the pointer. + */ +-SEC("?raw_tp/sys_nanosleep") ++SEC("?raw_tp/") + int user_ringbuf_callback_submit_dynptr(void *ctx) + { + bpf_user_ringbuf_drain(&user_ringbuf, try_submit_dynptr, NULL, 0); +@@ -168,10 +175,38 @@ invalid_drain_callback_return(struct bpf_dynptr *dynptr, void *context) + /* A callback that accesses a dynptr in a bpf_user_ringbuf_drain callback should + * not be able to write to that pointer. + */ +-SEC("?raw_tp/sys_nanosleep") ++SEC("?raw_tp/") + int user_ringbuf_callback_invalid_return(void *ctx) + { + bpf_user_ringbuf_drain(&user_ringbuf, invalid_drain_callback_return, NULL, 0); + + return 0; + } ++ ++static long ++try_reinit_dynptr_mem(struct bpf_dynptr *dynptr, void *context) ++{ ++ bpf_dynptr_from_mem(&map_value, 4, 0, dynptr); ++ return 0; ++} ++ ++static long ++try_reinit_dynptr_ringbuf(struct bpf_dynptr *dynptr, void *context) ++{ ++ bpf_ringbuf_reserve_dynptr(&ringbuf, 8, 0, dynptr); ++ return 0; ++} ++ ++SEC("?raw_tp/") ++int user_ringbuf_callback_reinit_dynptr_mem(void *ctx) ++{ ++ bpf_user_ringbuf_drain(&user_ringbuf, try_reinit_dynptr_mem, NULL, 0); ++ return 0; ++} ++ ++SEC("?raw_tp/") ++int user_ringbuf_callback_reinit_dynptr_ringbuf(void *ctx) ++{ ++ bpf_user_ringbuf_drain(&user_ringbuf, try_reinit_dynptr_ringbuf, NULL, 0); ++ return 0; ++} +-- +2.39.0 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0016-selftests-bpf-Add-dynptr-pruning-tests.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0016-selftests-bpf-Add-dynptr-pruning-tests.patch new file mode 100644 index 0000000000..958e245ccc --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0016-selftests-bpf-Add-dynptr-pruning-tests.patch @@ -0,0 +1,210 @@ +From f4d24edf1b9249e43282ac2572d43d9ad10faf43 Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Sat, 21 Jan 2023 05:52:38 +0530 +Subject: [PATCH 16/19] selftests/bpf: Add dynptr pruning tests + +[ upstream commit f4d24edf1b9249e43282ac2572d43d9ad10faf43 ] + +Add verifier tests that verify the new pruning behavior for STACK_DYNPTR +slots, and ensure that state equivalence takes into account changes to +the old and current verifier state correctly. Also ensure that the +stacksafe changes are actually enabling pruning in case states are +equivalent from pruning PoV. + +[ KN - 1) selftests need to be added in appropriate execution-list for +them to be run +2) Added success test in success.c instead of fail.c ] + +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20230121002241.2113993-10-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak +--- + .../testing/selftests/bpf/prog_tests/dynptr.c | 3 + + .../testing/selftests/bpf/progs/dynptr_fail.c | 108 ++++++++++++++++++ + .../selftests/bpf/progs/dynptr_success.c | 30 +++++ + 3 files changed, 141 insertions(+) + +diff --git a/tools/testing/selftests/bpf/prog_tests/dynptr.c b/tools/testing/selftests/bpf/prog_tests/dynptr.c +index 8fc4e6c02..d0891b32c 100644 +--- a/tools/testing/selftests/bpf/prog_tests/dynptr.c ++++ b/tools/testing/selftests/bpf/prog_tests/dynptr.c +@@ -42,11 +42,14 @@ static struct { + {"release_twice_callback", "arg 1 is an unacquired reference"}, + {"dynptr_from_mem_invalid_api", + "Unsupported reg type fp for bpf_dynptr_from_mem data"}, ++ {"dynptr_pruning_overwrite", "cannot overwrite referenced dynptr"}, ++ {"dynptr_pruning_type_confusion", "cannot overwrite referenced dynptr"}, + + /* success cases */ + {"test_read_write", NULL}, + {"test_data_slice", NULL}, + {"test_ringbuf", NULL}, ++ {"dynptr_pruning_stacksafe", NULL}, + }; + + static void verify_fail(const char *prog_name, const char *expected_err_msg) +diff --git a/tools/testing/selftests/bpf/progs/dynptr_fail.c b/tools/testing/selftests/bpf/progs/dynptr_fail.c +index b0f08ff02..7e29ca9b5 100644 +--- a/tools/testing/selftests/bpf/progs/dynptr_fail.c ++++ b/tools/testing/selftests/bpf/progs/dynptr_fail.c +@@ -35,6 +35,13 @@ struct { + __type(value, __u32); + } array_map3 SEC(".maps"); + ++struct { ++ __uint(type, BPF_MAP_TYPE_ARRAY); ++ __uint(max_entries, 1); ++ __type(key, __u32); ++ __type(value, __u64); ++} array_map4 SEC(".maps"); ++ + struct sample { + int pid; + long value; +@@ -622,3 +629,104 @@ int dynptr_from_mem_invalid_api(void *ctx) + + return 0; + } ++ ++SEC("?tc") ++int dynptr_pruning_overwrite(struct __sk_buff *ctx) ++{ ++ asm volatile ( ++ "r9 = 0xeB9F; \ ++ r6 = %[ringbuf] ll; \ ++ r1 = r6; \ ++ r2 = 8; \ ++ r3 = 0; \ ++ r4 = r10; \ ++ r4 += -16; \ ++ call %[bpf_ringbuf_reserve_dynptr]; \ ++ if r0 == 0 goto pjmp1; \ ++ goto pjmp2; \ ++ pjmp1: \ ++ *(u64 *)(r10 - 16) = r9; \ ++ pjmp2: \ ++ r1 = r10; \ ++ r1 += -16; \ ++ r2 = 0; \ ++ call %[bpf_ringbuf_discard_dynptr]; " ++ : ++ : __imm(bpf_ringbuf_reserve_dynptr), ++ __imm(bpf_ringbuf_discard_dynptr), ++ __imm_addr(ringbuf) ++ : __clobber_all ++ ); ++ return 0; ++} ++ ++SEC("?tc") ++int dynptr_pruning_type_confusion(struct __sk_buff *ctx) ++{ ++ asm volatile ( ++ "r6 = %[array_map4] ll; \ ++ r7 = %[ringbuf] ll; \ ++ r1 = r6; \ ++ r2 = r10; \ ++ r2 += -8; \ ++ r9 = 0; \ ++ *(u64 *)(r2 + 0) = r9; \ ++ r3 = r10; \ ++ r3 += -24; \ ++ r9 = 0xeB9FeB9F; \ ++ *(u64 *)(r10 - 16) = r9; \ ++ *(u64 *)(r10 - 24) = r9; \ ++ r9 = 0; \ ++ r4 = 0; \ ++ r8 = r2; \ ++ call %[bpf_map_update_elem]; \ ++ r1 = r6; \ ++ r2 = r8; \ ++ call %[bpf_map_lookup_elem]; \ ++ if r0 != 0 goto tjmp1; \ ++ exit; \ ++ tjmp1: \ ++ r8 = r0; \ ++ r1 = r7; \ ++ r2 = 8; \ ++ r3 = 0; \ ++ r4 = r10; \ ++ r4 += -16; \ ++ r0 = *(u64 *)(r0 + 0); \ ++ call %[bpf_ringbuf_reserve_dynptr]; \ ++ if r0 == 0 goto tjmp2; \ ++ r8 = r8; \ ++ r8 = r8; \ ++ r8 = r8; \ ++ r8 = r8; \ ++ r8 = r8; \ ++ r8 = r8; \ ++ r8 = r8; \ ++ goto tjmp3; \ ++ tjmp2: \ ++ *(u64 *)(r10 - 8) = r9; \ ++ *(u64 *)(r10 - 16) = r9; \ ++ r1 = r8; \ ++ r1 += 8; \ ++ r2 = 0; \ ++ r3 = 0; \ ++ r4 = r10; \ ++ r4 += -16; \ ++ call %[bpf_dynptr_from_mem]; \ ++ tjmp3: \ ++ r1 = r10; \ ++ r1 += -16; \ ++ r2 = 0; \ ++ call %[bpf_ringbuf_discard_dynptr]; " ++ : ++ : __imm(bpf_map_update_elem), ++ __imm(bpf_map_lookup_elem), ++ __imm(bpf_ringbuf_reserve_dynptr), ++ __imm(bpf_dynptr_from_mem), ++ __imm(bpf_ringbuf_discard_dynptr), ++ __imm_addr(array_map4), ++ __imm_addr(ringbuf) ++ : __clobber_all ++ ); ++ return 0; ++} +diff --git a/tools/testing/selftests/bpf/progs/dynptr_success.c b/tools/testing/selftests/bpf/progs/dynptr_success.c +index a3a6103c8..55784c0c7 100644 +--- a/tools/testing/selftests/bpf/progs/dynptr_success.c ++++ b/tools/testing/selftests/bpf/progs/dynptr_success.c +@@ -162,3 +162,33 @@ int test_ringbuf(void *ctx) + bpf_ringbuf_discard_dynptr(&ptr, 0); + return 0; + } ++ ++SEC("tp/syscalls/sys_enter_nanosleep") ++int dynptr_pruning_stacksafe(struct __sk_buff *ctx) ++{ ++ asm volatile ( ++ "r9 = 0xeB9F; \ ++ r6 = %[ringbuf] ll; \ ++ r1 = r6; \ ++ r2 = 8; \ ++ r3 = 0; \ ++ r4 = r10; \ ++ r4 += -16; \ ++ call %[bpf_ringbuf_reserve_dynptr]; \ ++ if r0 == 0 goto stjmp1; \ ++ goto stjmp2; \ ++ stjmp1: \ ++ r9 = r9; \ ++ stjmp2: \ ++ r1 = r10; \ ++ r1 += -16; \ ++ r2 = 0; \ ++ call %[bpf_ringbuf_discard_dynptr]; " ++ : ++ : __imm(bpf_ringbuf_reserve_dynptr), ++ __imm(bpf_ringbuf_discard_dynptr), ++ __imm_addr(ringbuf) ++ : __clobber_all ++ ); ++ return 0; ++} +-- +2.39.0 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0017-selftests-bpf-Add-dynptr-var_off-tests.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0017-selftests-bpf-Add-dynptr-var_off-tests.patch new file mode 100644 index 0000000000..bbb4572acb --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0017-selftests-bpf-Add-dynptr-var_off-tests.patch @@ -0,0 +1,84 @@ +From ef4810135396735c1a6b1c343c3cc4fe4be96a43 Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Sat, 21 Jan 2023 05:52:39 +0530 +Subject: [PATCH 17/19] selftests/bpf: Add dynptr var_off tests + +[ upstream commit ef4810135396735c1a6b1c343c3cc4fe4be96a43 ] + +Ensure that variable offset is handled correctly, and verifier takes +both fixed and variable part into account. Also ensures that only +constant var_off is allowed. + +[ KN - added selftests in execution-list ] + +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20230121002241.2113993-11-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak +--- + .../testing/selftests/bpf/prog_tests/dynptr.c | 1 + + .../testing/selftests/bpf/progs/dynptr_fail.c | 39 +++++++++++++++++++ + 2 files changed, 40 insertions(+) + +diff --git a/tools/testing/selftests/bpf/prog_tests/dynptr.c b/tools/testing/selftests/bpf/prog_tests/dynptr.c +index d0891b32c..f0112abb3 100644 +--- a/tools/testing/selftests/bpf/prog_tests/dynptr.c ++++ b/tools/testing/selftests/bpf/prog_tests/dynptr.c +@@ -44,6 +44,7 @@ static struct { + "Unsupported reg type fp for bpf_dynptr_from_mem data"}, + {"dynptr_pruning_overwrite", "cannot overwrite referenced dynptr"}, + {"dynptr_pruning_type_confusion", "cannot overwrite referenced dynptr"}, ++ {"dynptr_var_off_overwrite", "dynptr has to be at a constant offset"}, + + /* success cases */ + {"test_read_write", NULL}, +diff --git a/tools/testing/selftests/bpf/progs/dynptr_fail.c b/tools/testing/selftests/bpf/progs/dynptr_fail.c +index 7e29ca9b5..025c7c8da 100644 +--- a/tools/testing/selftests/bpf/progs/dynptr_fail.c ++++ b/tools/testing/selftests/bpf/progs/dynptr_fail.c +@@ -730,3 +730,42 @@ int dynptr_pruning_type_confusion(struct __sk_buff *ctx) + ); + return 0; + } ++ ++SEC("?tc") ++int dynptr_var_off_overwrite(struct __sk_buff *ctx) ++{ ++ asm volatile ( ++ "r9 = 16; \ ++ *(u32 *)(r10 - 4) = r9; \ ++ r8 = *(u32 *)(r10 - 4); \ ++ if r8 >= 0 goto vjmp1; \ ++ r0 = 1; \ ++ exit; \ ++ vjmp1: \ ++ if r8 <= 16 goto vjmp2; \ ++ r0 = 1; \ ++ exit; \ ++ vjmp2: \ ++ r8 &= 16; \ ++ r1 = %[ringbuf] ll; \ ++ r2 = 8; \ ++ r3 = 0; \ ++ r4 = r10; \ ++ r4 += -32; \ ++ r4 += r8; \ ++ call %[bpf_ringbuf_reserve_dynptr]; \ ++ r9 = 0xeB9F; \ ++ *(u64 *)(r10 - 16) = r9; \ ++ r1 = r10; \ ++ r1 += -32; \ ++ r1 += r8; \ ++ r2 = 0; \ ++ call %[bpf_ringbuf_discard_dynptr]; " ++ : ++ : __imm(bpf_ringbuf_reserve_dynptr), ++ __imm(bpf_ringbuf_discard_dynptr), ++ __imm_addr(ringbuf) ++ : __clobber_all ++ ); ++ return 0; ++} +-- +2.39.0 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0018-selftests-bpf-Add-dynptr-partial-slot-overwrite-test.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0018-selftests-bpf-Add-dynptr-partial-slot-overwrite-test.patch new file mode 100644 index 0000000000..287a09546f --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0018-selftests-bpf-Add-dynptr-partial-slot-overwrite-test.patch @@ -0,0 +1,112 @@ +From 011edc8e49b8551dfb6cfcc8601d05e029cf5994 Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Sat, 21 Jan 2023 05:52:40 +0530 +Subject: [PATCH 18/19] selftests/bpf: Add dynptr partial slot overwrite tests + +[ upstream commit 011edc8e49b8551dfb6cfcc8601d05e029cf5994 ] + +Try creating a dynptr, then overwriting second slot with first slot of +another dynptr. Then, the first slot of first dynptr should also be +invalidated, but without our fix that does not happen. As a consequence, +the unfixed case allows passing first dynptr (as the kernel check only +checks for slot_type and then first_slot == true). + +[ KN - added selftest in execution-list ] + +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20230121002241.2113993-12-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak +--- + .../testing/selftests/bpf/prog_tests/dynptr.c | 1 + + .../testing/selftests/bpf/progs/dynptr_fail.c | 65 +++++++++++++++++++ + 2 files changed, 66 insertions(+) + +diff --git a/tools/testing/selftests/bpf/prog_tests/dynptr.c b/tools/testing/selftests/bpf/prog_tests/dynptr.c +index f0112abb3..df44a5684 100644 +--- a/tools/testing/selftests/bpf/prog_tests/dynptr.c ++++ b/tools/testing/selftests/bpf/prog_tests/dynptr.c +@@ -45,6 +45,7 @@ static struct { + {"dynptr_pruning_overwrite", "cannot overwrite referenced dynptr"}, + {"dynptr_pruning_type_confusion", "cannot overwrite referenced dynptr"}, + {"dynptr_var_off_overwrite", "dynptr has to be at a constant offset"}, ++ {"dynptr_partial_slot_invalidate", "cannot overwrite referenced dynptr"}, + + /* success cases */ + {"test_read_write", NULL}, +diff --git a/tools/testing/selftests/bpf/progs/dynptr_fail.c b/tools/testing/selftests/bpf/progs/dynptr_fail.c +index 025c7c8da..4a7c59e1e 100644 +--- a/tools/testing/selftests/bpf/progs/dynptr_fail.c ++++ b/tools/testing/selftests/bpf/progs/dynptr_fail.c +@@ -769,3 +769,68 @@ int dynptr_var_off_overwrite(struct __sk_buff *ctx) + ); + return 0; + } ++ ++SEC("?tc") ++int dynptr_partial_slot_invalidate(struct __sk_buff *ctx) ++{ ++ asm volatile ( ++ "r6 = %[ringbuf] ll; \ ++ r7 = %[array_map4] ll; \ ++ r1 = r7; \ ++ r2 = r10; \ ++ r2 += -8; \ ++ r9 = 0; \ ++ *(u64 *)(r2 + 0) = r9; \ ++ r3 = r2; \ ++ r4 = 0; \ ++ r8 = r2; \ ++ call %[bpf_map_update_elem]; \ ++ r1 = r7; \ ++ r2 = r8; \ ++ call %[bpf_map_lookup_elem]; \ ++ if r0 != 0 goto sjmp1; \ ++ exit; \ ++ sjmp1: \ ++ r7 = r0; \ ++ r1 = r6; \ ++ r2 = 8; \ ++ r3 = 0; \ ++ r4 = r10; \ ++ r4 += -24; \ ++ call %[bpf_ringbuf_reserve_dynptr]; \ ++ *(u64 *)(r10 - 16) = r9; \ ++ r1 = r7; \ ++ r2 = 8; \ ++ r3 = 0; \ ++ r4 = r10; \ ++ r4 += -16; \ ++ call %[bpf_dynptr_from_mem]; \ ++ r1 = r10; \ ++ r1 += -512; \ ++ r2 = 488; \ ++ r3 = r10; \ ++ r3 += -24; \ ++ r4 = 0; \ ++ r5 = 0; \ ++ call %[bpf_dynptr_read]; \ ++ r8 = 1; \ ++ if r0 != 0 goto sjmp2; \ ++ r8 = 0; \ ++ sjmp2: \ ++ r1 = r10; \ ++ r1 += -24; \ ++ r2 = 0; \ ++ call %[bpf_ringbuf_discard_dynptr]; " ++ : ++ : __imm(bpf_map_update_elem), ++ __imm(bpf_map_lookup_elem), ++ __imm(bpf_ringbuf_reserve_dynptr), ++ __imm(bpf_ringbuf_discard_dynptr), ++ __imm(bpf_dynptr_from_mem), ++ __imm(bpf_dynptr_read), ++ __imm_addr(ringbuf), ++ __imm_addr(array_map4) ++ : __clobber_all ++ ); ++ return 0; ++} +-- +2.39.0 + diff --git a/SPECS/linux/6.1/CVE/CVE-2023-39191/0019-selftests-bpf-Add-dynptr-helper-tests.patch b/SPECS/linux/6.1/CVE/CVE-2023-39191/0019-selftests-bpf-Add-dynptr-helper-tests.patch new file mode 100644 index 0000000000..6b3587f1c7 --- /dev/null +++ b/SPECS/linux/6.1/CVE/CVE-2023-39191/0019-selftests-bpf-Add-dynptr-helper-tests.patch @@ -0,0 +1,285 @@ +From ae8e354c497af625eaecd3d86e04f9087762d42b Mon Sep 17 00:00:00 2001 +From: Kumar Kartikeya Dwivedi +Date: Sat, 21 Jan 2023 05:52:41 +0530 +Subject: [PATCH 19/19] selftests/bpf: Add dynptr helper tests + +[ upstream commit ae8e354c497af625eaecd3d86e04f9087762d42b ] + +First test that we allow overwriting dynptr slots and reinitializing +them in unreferenced case, and disallow overwriting for referenced case. +Include tests to ensure slices obtained from destroyed dynptrs are being +invalidated on their destruction. The destruction needs to be scoped, as +in slices of dynptr A should not be invalidated when dynptr B is +destroyed. Next, test that MEM_UNINIT doesn't allow writing dynptr stack +slots. + +[ KN - added selftest in execution-list ] + +Acked-by: Joanne Koong +Signed-off-by: Kumar Kartikeya Dwivedi +Link: https://lore.kernel.org/r/20230121002241.2113993-13-memxor@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Kuntal Nayak +--- + .../testing/selftests/bpf/prog_tests/dynptr.c | 9 ++ + .../testing/selftests/bpf/progs/dynptr_fail.c | 141 ++++++++++++++++++ + .../selftests/bpf/progs/dynptr_success.c | 64 ++++++++ + 3 files changed, 214 insertions(+) + +diff --git a/tools/testing/selftests/bpf/prog_tests/dynptr.c b/tools/testing/selftests/bpf/prog_tests/dynptr.c +index df44a5684..fb6d088bb 100644 +--- a/tools/testing/selftests/bpf/prog_tests/dynptr.c ++++ b/tools/testing/selftests/bpf/prog_tests/dynptr.c +@@ -46,12 +46,21 @@ static struct { + {"dynptr_pruning_type_confusion", "cannot overwrite referenced dynptr"}, + {"dynptr_var_off_overwrite", "dynptr has to be at a constant offset"}, + {"dynptr_partial_slot_invalidate", "cannot overwrite referenced dynptr"}, ++ {"dynptr_invalidate_slice_reinit", "invalid mem access 'scalar'"}, ++ {"dynptr_invalidate_slice_or_null", "R1 type=scalar expected=percpu_ptr_"}, ++ {"dynptr_invalidate_slice_failure", "R7 invalid mem access 'scalar'"}, ++ {"dynptr_overwrite_ref", "cannot overwrite referenced dynptr"}, ++ {"dynptr_read_into_slot", "potential write to dynptr at off=-16"}, ++ {"uninit_write_into_slot", "potential write to dynptr at off=-16"}, ++ {"invalid_data_slices", "invalid mem access 'scalar'"}, + + /* success cases */ + {"test_read_write", NULL}, + {"test_data_slice", NULL}, + {"test_ringbuf", NULL}, + {"dynptr_pruning_stacksafe", NULL}, ++ {"dynptr_overwrite_unref", NULL}, ++ {"dynptr_invalidate_slice_success", NULL}, + }; + + static void verify_fail(const char *prog_name, const char *expected_err_msg) +diff --git a/tools/testing/selftests/bpf/progs/dynptr_fail.c b/tools/testing/selftests/bpf/progs/dynptr_fail.c +index 4a7c59e1e..1137ee37e 100644 +--- a/tools/testing/selftests/bpf/progs/dynptr_fail.c ++++ b/tools/testing/selftests/bpf/progs/dynptr_fail.c +@@ -834,3 +834,144 @@ int dynptr_partial_slot_invalidate(struct __sk_buff *ctx) + ); + return 0; + } ++ ++/* Test that slices are invalidated on reinitializing a dynptr. */ ++SEC("?raw_tp") ++int dynptr_invalidate_slice_reinit(void *ctx) ++{ ++ struct bpf_dynptr ptr; ++ __u8 *p; ++ ++ if (get_map_val_dynptr(&ptr)) ++ return 0; ++ p = bpf_dynptr_data(&ptr, 0, 1); ++ if (!p) ++ return 0; ++ if (get_map_val_dynptr(&ptr)) ++ return 0; ++ /* this should fail */ ++ return *p; ++} ++ ++/* Invalidation of dynptr slices on destruction of dynptr should not miss ++ * mem_or_null pointers. ++ */ ++SEC("?raw_tp") ++int dynptr_invalidate_slice_or_null(void *ctx) ++{ ++ struct bpf_dynptr ptr; ++ __u8 *p; ++ ++ if (get_map_val_dynptr(&ptr)) ++ return 0; ++ ++ p = bpf_dynptr_data(&ptr, 0, 1); ++ *(__u8 *)&ptr = 0; ++ /* this should fail */ ++ bpf_this_cpu_ptr(p); ++ return 0; ++} ++ ++/* Destruction of dynptr should also any slices obtained from it */ ++SEC("?raw_tp") ++int dynptr_invalidate_slice_failure(void *ctx) ++{ ++ struct bpf_dynptr ptr1; ++ struct bpf_dynptr ptr2; ++ __u8 *p1, *p2; ++ ++ if (get_map_val_dynptr(&ptr1)) ++ return 0; ++ if (get_map_val_dynptr(&ptr2)) ++ return 0; ++ ++ p1 = bpf_dynptr_data(&ptr1, 0, 1); ++ if (!p1) ++ return 0; ++ p2 = bpf_dynptr_data(&ptr2, 0, 1); ++ if (!p2) ++ return 0; ++ ++ *(__u8 *)&ptr1 = 0; ++ /* this should fail */ ++ return *p1; ++} ++ ++/* Overwriting referenced dynptr should be rejected */ ++SEC("?raw_tp") ++int dynptr_overwrite_ref(void *ctx) ++{ ++ struct bpf_dynptr ptr; ++ ++ bpf_ringbuf_reserve_dynptr(&ringbuf, 64, 0, &ptr); ++ /* this should fail */ ++ if (get_map_val_dynptr(&ptr)) ++ bpf_ringbuf_discard_dynptr(&ptr, 0); ++ return 0; ++} ++ ++/* Reject writes to dynptr slot from bpf_dynptr_read */ ++SEC("?raw_tp") ++int dynptr_read_into_slot(void *ctx) ++{ ++ union { ++ struct { ++ char _pad[48]; ++ struct bpf_dynptr ptr; ++ }; ++ char buf[64]; ++ } data; ++ ++ bpf_ringbuf_reserve_dynptr(&ringbuf, 64, 0, &data.ptr); ++ /* this should fail */ ++ bpf_dynptr_read(data.buf, sizeof(data.buf), &data.ptr, 0, 0); ++ ++ return 0; ++} ++ ++/* Reject writes to dynptr slot for uninit arg */ ++SEC("?raw_tp") ++int uninit_write_into_slot(void *ctx) ++{ ++ struct { ++ char buf[64]; ++ struct bpf_dynptr ptr; ++ } data; ++ ++ bpf_ringbuf_reserve_dynptr(&ringbuf, 80, 0, &data.ptr); ++ /* this should fail */ ++ bpf_get_current_comm(data.buf, 80); ++ ++ return 0; ++} ++ ++static int callback(__u32 index, void *data) ++{ ++ *(__u32 *)data = 123; ++ ++ return 0; ++} ++ ++/* If the dynptr is written into in a callback function, its data ++ * slices should be invalidated as well. ++ */ ++SEC("?raw_tp") ++int invalid_data_slices(void *ctx) ++{ ++ struct bpf_dynptr ptr; ++ __u32 *slice; ++ ++ if (get_map_val_dynptr(&ptr)) ++ return 0; ++ ++ slice = bpf_dynptr_data(&ptr, 0, sizeof(__u32)); ++ if (!slice) ++ return 0; ++ ++ bpf_loop(10, callback, &ptr, 0); ++ ++ /* this should fail */ ++ *slice = 1; ++ ++ return 0; ++} +diff --git a/tools/testing/selftests/bpf/progs/dynptr_success.c b/tools/testing/selftests/bpf/progs/dynptr_success.c +index 55784c0c7..f65be23df 100644 +--- a/tools/testing/selftests/bpf/progs/dynptr_success.c ++++ b/tools/testing/selftests/bpf/progs/dynptr_success.c +@@ -29,6 +29,28 @@ struct { + __type(value, __u32); + } array_map SEC(".maps"); + ++struct { ++ __uint(type, BPF_MAP_TYPE_ARRAY); ++ __uint(max_entries, 1); ++ __type(key, __u32); ++ __type(value, __u32); ++} array_map3 SEC(".maps"); ++ ++static int get_map_val_dynptr(struct bpf_dynptr *ptr) ++{ ++ __u32 key = 0, *map_val; ++ ++ bpf_map_update_elem(&array_map3, &key, &val, 0); ++ ++ map_val = bpf_map_lookup_elem(&array_map3, &key); ++ if (!map_val) ++ return -ENOENT; ++ ++ bpf_dynptr_from_mem(map_val, sizeof(*map_val), 0, ptr); ++ ++ return 0; ++} ++ + SEC("tp/syscalls/sys_enter_nanosleep") + int test_read_write(void *ctx) + { +@@ -192,3 +214,45 @@ int dynptr_pruning_stacksafe(struct __sk_buff *ctx) + ); + return 0; + } ++ ++/* Test that it is allowed to overwrite unreferenced dynptr. */ ++SEC("") ++int dynptr_overwrite_unref(void *ctx) ++{ ++ struct bpf_dynptr ptr; ++ ++ if (get_map_val_dynptr(&ptr)) ++ return 0; ++ if (get_map_val_dynptr(&ptr)) ++ return 0; ++ if (get_map_val_dynptr(&ptr)) ++ return 0; ++ ++ return 0; ++} ++ ++/* Invalidation of slices should be scoped and should not prevent dereferencing ++ * slices of another dynptr after destroying unrelated dynptr ++ */ ++SEC("tp/syscalls/sys_enter_nanosleep") ++int dynptr_invalidate_slice_success(void *ctx) ++{ ++ struct bpf_dynptr ptr1; ++ struct bpf_dynptr ptr2; ++ __u8 *p1, *p2; ++ ++ if (get_map_val_dynptr(&ptr1)) ++ return 1; ++ if (get_map_val_dynptr(&ptr2)) ++ return 1; ++ ++ p1 = bpf_dynptr_data(&ptr1, 0, 1); ++ if (!p1) ++ return 1; ++ p2 = bpf_dynptr_data(&ptr2, 0, 1); ++ if (!p2) ++ return 1; ++ ++ *(__u8 *)&ptr1 = 0; ++ return *p2; ++} +-- +2.39.0 + diff --git a/SPECS/91/linux/Performance-over-security-model.patch b/SPECS/linux/6.1/Performance-over-security-model-6.1.patch similarity index 87% rename from SPECS/91/linux/Performance-over-security-model.patch rename to SPECS/linux/6.1/Performance-over-security-model-6.1.patch index 73481a59bd..74f247ea2d 100644 --- a/SPECS/91/linux/Performance-over-security-model.patch +++ b/SPECS/linux/6.1/Performance-over-security-model-6.1.patch @@ -36,13 +36,13 @@ Signed-off-by: Alexey Makhalov 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c -index 10499bcd4..0624ddf37 100644 +index a2a087a797ae..5644b32edc48 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c -@@ -228,6 +228,24 @@ static void x86_amd_ssb_disable(void) - wrmsrl(MSR_AMD64_LS_CFG, msrval); +@@ -252,6 +252,24 @@ static void x86_amd_ssb_disable(void) + wrmsrl(MSR_AMD64_LS_CFG, msrval); } - + +/* Bitmask of switches for security mitigations to follow PoS model. */ +static unsigned int __ro_after_init performance_over_security = 0; +/* Ignore IBRS (Skylake and older CPUs) and use other techniques instead. */ @@ -63,11 +63,11 @@ index 10499bcd4..0624ddf37 100644 + #undef pr_fmt #define pr_fmt(fmt) "MDS: " fmt - -@@ -1571,8 +1589,15 @@ static void __init spectre_v2_select_mitigation(void) - retbleed_cmd != RETBLEED_CMD_STUFF && - boot_cpu_has(X86_FEATURE_IBRS) && - boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) { + +@@ -1378,8 +1396,15 @@ static void __init spectre_v2_select_mitigation(void) + retbleed_cmd != RETBLEED_CMD_OFF && + boot_cpu_has(X86_FEATURE_IBRS) && + boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) { - mode = SPECTRE_V2_IBRS; - break; + /* Allow pos= only if spectre_v2 is not set (auto). */ @@ -79,8 +79,9 @@ index 10499bcd4..0624ddf37 100644 + mode = SPECTRE_V2_IBRS; + break; + } - } + } + + mode = spectre_v2_select_retpoline(); +-- +2.35.5 - mode = spectre_v2_select_retpoline(); --- -2.41.0 diff --git a/SPECS/90/linux/aarch64/0001-OF-DT-Overlay-configfs-interface.patch b/SPECS/linux/6.1/aarch64/0001-OF-DT-Overlay-configfs-interface-6.1.patch similarity index 100% rename from SPECS/90/linux/aarch64/0001-OF-DT-Overlay-configfs-interface.patch rename to SPECS/linux/6.1/aarch64/0001-OF-DT-Overlay-configfs-interface-6.1.patch diff --git a/SPECS/90/linux/aarch64/0002-of-configfs-Use-of_overlay_fdt_apply-API-call.patch b/SPECS/linux/6.1/aarch64/0002-of-configfs-Use-of_overlay_fdt_apply-API-call.patch similarity index 100% rename from SPECS/90/linux/aarch64/0002-of-configfs-Use-of_overlay_fdt_apply-API-call.patch rename to SPECS/linux/6.1/aarch64/0002-of-configfs-Use-of_overlay_fdt_apply-API-call.patch diff --git a/SPECS/90/linux/aarch64/6.0-0001-vmw_vmci-arm64-support-memory-ordering.patch b/SPECS/linux/6.1/aarch64/6.0-0001-vmw_vmci-arm64-support-memory-ordering.patch similarity index 100% rename from SPECS/90/linux/aarch64/6.0-0001-vmw_vmci-arm64-support-memory-ordering.patch rename to SPECS/linux/6.1/aarch64/6.0-0001-vmw_vmci-arm64-support-memory-ordering.patch diff --git a/SPECS/90/linux/aarch64/6.0-0001-x86-hyper-generalize-hypervisor-type-detection.patch b/SPECS/linux/6.1/aarch64/6.0-0001-x86-hyper-generalize-hypervisor-type-detection.patch similarity index 100% rename from SPECS/90/linux/aarch64/6.0-0001-x86-hyper-generalize-hypervisor-type-detection.patch rename to SPECS/linux/6.1/aarch64/6.0-0001-x86-hyper-generalize-hypervisor-type-detection.patch diff --git a/SPECS/90/linux/aarch64/6.0-0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch b/SPECS/linux/6.1/aarch64/6.0-0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch similarity index 100% rename from SPECS/90/linux/aarch64/6.0-0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch rename to SPECS/linux/6.1/aarch64/6.0-0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch diff --git a/SPECS/90/linux/aarch64/6.0-0003-arm64-VMware-hypervisor-detection.patch b/SPECS/linux/6.1/aarch64/6.0-0003-arm64-VMware-hypervisor-detection.patch similarity index 100% rename from SPECS/90/linux/aarch64/6.0-0003-arm64-VMware-hypervisor-detection.patch rename to SPECS/linux/6.1/aarch64/6.0-0003-arm64-VMware-hypervisor-detection.patch diff --git a/SPECS/90/linux/aarch64/6.0-0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch b/SPECS/linux/6.1/aarch64/6.0-0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch similarity index 100% rename from SPECS/90/linux/aarch64/6.0-0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch rename to SPECS/linux/6.1/aarch64/6.0-0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch diff --git a/SPECS/90/linux/aarch64/6.0-0005-scsi-vmw_pvscsi-add-arm64-support.patch b/SPECS/linux/6.1/aarch64/6.0-0005-scsi-vmw_pvscsi-add-arm64-support.patch similarity index 100% rename from SPECS/90/linux/aarch64/6.0-0005-scsi-vmw_pvscsi-add-arm64-support.patch rename to SPECS/linux/6.1/aarch64/6.0-0005-scsi-vmw_pvscsi-add-arm64-support.patch diff --git a/SPECS/90/linux/aarch64/6.0-0005-vmw_balloon-add-arm64-support.patch b/SPECS/linux/6.1/aarch64/6.0-0005-vmw_balloon-add-arm64-support.patch similarity index 100% rename from SPECS/90/linux/aarch64/6.0-0005-vmw_balloon-add-arm64-support.patch rename to SPECS/linux/6.1/aarch64/6.0-0005-vmw_balloon-add-arm64-support.patch diff --git a/SPECS/90/linux/aarch64/6.0-0006-vmxnet3-build-only-for-x86-and-arm64.patch b/SPECS/linux/6.1/aarch64/6.0-0006-vmxnet3-build-only-for-x86-and-arm64.patch similarity index 100% rename from SPECS/90/linux/aarch64/6.0-0006-vmxnet3-build-only-for-x86-and-arm64.patch rename to SPECS/linux/6.1/aarch64/6.0-0006-vmxnet3-build-only-for-x86-and-arm64.patch diff --git a/SPECS/90/linux/acvp_patches/0001-crypto-AF_ALG-add-sign-verify-API.patch b/SPECS/linux/6.1/acvp_patches/0001-crypto-AF_ALG-add-sign-verify-API-6.1.patch similarity index 100% rename from SPECS/90/linux/acvp_patches/0001-crypto-AF_ALG-add-sign-verify-API.patch rename to SPECS/linux/6.1/acvp_patches/0001-crypto-AF_ALG-add-sign-verify-API-6.1.patch diff --git a/SPECS/90/linux/acvp_patches/0002-crypto-AF_ALG-add-setpubkey-setsockopt-call.patch b/SPECS/linux/6.1/acvp_patches/0002-crypto-AF_ALG-add-setpubkey-setsockopt-call-6.1.patch similarity index 100% rename from SPECS/90/linux/acvp_patches/0002-crypto-AF_ALG-add-setpubkey-setsockopt-call.patch rename to SPECS/linux/6.1/acvp_patches/0002-crypto-AF_ALG-add-setpubkey-setsockopt-call-6.1.patch diff --git a/SPECS/90/linux/acvp_patches/0003-crypto-AF_ALG-add-asymmetric-cipher.patch b/SPECS/linux/6.1/acvp_patches/0003-crypto-AF_ALG-add-asymmetric-cipher-6.1.patch similarity index 100% rename from SPECS/90/linux/acvp_patches/0003-crypto-AF_ALG-add-asymmetric-cipher.patch rename to SPECS/linux/6.1/acvp_patches/0003-crypto-AF_ALG-add-asymmetric-cipher-6.1.patch diff --git a/SPECS/90/linux/acvp_patches/0005-crypto-AF_ALG-add-DH-param-ECDH-curve-setsockopt.patch b/SPECS/linux/6.1/acvp_patches/0005-crypto-AF_ALG-add-DH-param-ECDH-curve-setsockopt-6.1.patch similarity index 100% rename from SPECS/90/linux/acvp_patches/0005-crypto-AF_ALG-add-DH-param-ECDH-curve-setsockopt.patch rename to SPECS/linux/6.1/acvp_patches/0005-crypto-AF_ALG-add-DH-param-ECDH-curve-setsockopt-6.1.patch diff --git a/SPECS/90/linux/acvp_patches/0006-crypto-AF_ALG-eliminate-code-duplication.patch b/SPECS/linux/6.1/acvp_patches/0006-crypto-AF_ALG-eliminate-code-duplication-6.1.patch similarity index 100% rename from SPECS/90/linux/acvp_patches/0006-crypto-AF_ALG-eliminate-code-duplication.patch rename to SPECS/linux/6.1/acvp_patches/0006-crypto-AF_ALG-eliminate-code-duplication-6.1.patch diff --git a/SPECS/90/linux/acvp_patches/0007-crypto-AF_ALG-add-KPP-support.patch b/SPECS/linux/6.1/acvp_patches/0007-crypto-AF_ALG-add-KPP-support-6.1.patch similarity index 100% rename from SPECS/90/linux/acvp_patches/0007-crypto-AF_ALG-add-KPP-support.patch rename to SPECS/linux/6.1/acvp_patches/0007-crypto-AF_ALG-add-KPP-support-6.1.patch diff --git a/SPECS/90/linux/acvp_patches/0008-crypto-AF_ALG-add-ECC-support.patch b/SPECS/linux/6.1/acvp_patches/0008-crypto-AF_ALG-add-ECC-support-6.1.patch similarity index 100% rename from SPECS/90/linux/acvp_patches/0008-crypto-AF_ALG-add-ECC-support.patch rename to SPECS/linux/6.1/acvp_patches/0008-crypto-AF_ALG-add-ECC-support-6.1.patch diff --git a/SPECS/90/linux/acvp_patches/0009-kernels-net-Export-sock_getsockopt.patch b/SPECS/linux/6.1/acvp_patches/0009-kernels-net-Export-sock_getsockopt.patch similarity index 100% rename from SPECS/90/linux/acvp_patches/0009-kernels-net-Export-sock_getsockopt.patch rename to SPECS/linux/6.1/acvp_patches/0009-kernels-net-Export-sock_getsockopt.patch diff --git a/SPECS/90/linux/acvp_patches/0010-DRBG-Fix-issues-with-DRBG.patch b/SPECS/linux/6.1/acvp_patches/0010-DRBG-Fix-issues-with-DRBG.patch similarity index 100% rename from SPECS/90/linux/acvp_patches/0010-DRBG-Fix-issues-with-DRBG.patch rename to SPECS/linux/6.1/acvp_patches/0010-DRBG-Fix-issues-with-DRBG.patch diff --git a/SPECS/90/linux/acvp_patches/0011-Added-jitterentropy-implementation-of-SHA3-256.patch b/SPECS/linux/6.1/acvp_patches/0011-Added-jitterentropy-implementation-of-SHA3-256.patch similarity index 100% rename from SPECS/90/linux/acvp_patches/0011-Added-jitterentropy-implementation-of-SHA3-256.patch rename to SPECS/linux/6.1/acvp_patches/0011-Added-jitterentropy-implementation-of-SHA3-256.patch diff --git a/SPECS/90/linux/acvp_patches/0012-jitterentropy-Support-for-sample-collection.patch b/SPECS/linux/6.1/acvp_patches/0012-jitterentropy-Support-for-sample-collection.patch similarity index 100% rename from SPECS/90/linux/acvp_patches/0012-jitterentropy-Support-for-sample-collection.patch rename to SPECS/linux/6.1/acvp_patches/0012-jitterentropy-Support-for-sample-collection.patch diff --git a/SPECS/90/linux/acvp_patches/0013-crypto-api-return-status-prints-for-LKCM5-demo.patch b/SPECS/linux/6.1/acvp_patches/0013-crypto-api-return-status-prints-for-LKCM5-demo.patch similarity index 100% rename from SPECS/90/linux/acvp_patches/0013-crypto-api-return-status-prints-for-LKCM5-demo.patch rename to SPECS/linux/6.1/acvp_patches/0013-crypto-api-return-status-prints-for-LKCM5-demo.patch diff --git a/SPECS/90/linux/aws/6.0-0001-scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch b/SPECS/linux/6.1/aws/6.0-0001-scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0001-scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch rename to SPECS/linux/6.1/aws/6.0-0001-scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch diff --git a/SPECS/90/linux/aws/6.0-0007-xen-manage-keep-track-of-the-on-going-suspend-mode.patch b/SPECS/linux/6.1/aws/6.0-0007-xen-manage-keep-track-of-the-on-going-suspend-mode.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0007-xen-manage-keep-track-of-the-on-going-suspend-mode.patch rename to SPECS/linux/6.1/aws/6.0-0007-xen-manage-keep-track-of-the-on-going-suspend-mode.patch diff --git a/SPECS/90/linux/aws/6.0-0008-xen-manage-introduce-helper-function-to-know-the-on-.patch b/SPECS/linux/6.1/aws/6.0-0008-xen-manage-introduce-helper-function-to-know-the-on-.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0008-xen-manage-introduce-helper-function-to-know-the-on-.patch rename to SPECS/linux/6.1/aws/6.0-0008-xen-manage-introduce-helper-function-to-know-the-on-.patch diff --git a/SPECS/90/linux/aws/6.0-0009-xenbus-add-freeze-thaw-restore-callbacks-support.patch b/SPECS/linux/6.1/aws/6.0-0009-xenbus-add-freeze-thaw-restore-callbacks-support.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0009-xenbus-add-freeze-thaw-restore-callbacks-support.patch rename to SPECS/linux/6.1/aws/6.0-0009-xenbus-add-freeze-thaw-restore-callbacks-support.patch diff --git a/SPECS/90/linux/aws/6.0-0010-x86-xen-Introduce-new-function-to-map-HYPERVISOR_sha.patch b/SPECS/linux/6.1/aws/6.0-0010-x86-xen-Introduce-new-function-to-map-HYPERVISOR_sha.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0010-x86-xen-Introduce-new-function-to-map-HYPERVISOR_sha.patch rename to SPECS/linux/6.1/aws/6.0-0010-x86-xen-Introduce-new-function-to-map-HYPERVISOR_sha.patch diff --git a/SPECS/90/linux/aws/6.0-0011-x86-xen-add-system-core-suspend-and-resume-callbacks.patch b/SPECS/linux/6.1/aws/6.0-0011-x86-xen-add-system-core-suspend-and-resume-callbacks.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0011-x86-xen-add-system-core-suspend-and-resume-callbacks.patch rename to SPECS/linux/6.1/aws/6.0-0011-x86-xen-add-system-core-suspend-and-resume-callbacks.patch diff --git a/SPECS/90/linux/aws/6.0-0012-xen-blkfront-add-callbacks-for-PM-suspend-and-hibern.patch b/SPECS/linux/6.1/aws/6.0-0012-xen-blkfront-add-callbacks-for-PM-suspend-and-hibern.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0012-xen-blkfront-add-callbacks-for-PM-suspend-and-hibern.patch rename to SPECS/linux/6.1/aws/6.0-0012-xen-blkfront-add-callbacks-for-PM-suspend-and-hibern.patch diff --git a/SPECS/90/linux/aws/6.0-0013-xen-netfront-add-callbacks-for-PM-suspend-and-hibern.patch b/SPECS/linux/6.1/aws/6.0-0013-xen-netfront-add-callbacks-for-PM-suspend-and-hibern.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0013-xen-netfront-add-callbacks-for-PM-suspend-and-hibern.patch rename to SPECS/linux/6.1/aws/6.0-0013-xen-netfront-add-callbacks-for-PM-suspend-and-hibern.patch diff --git a/SPECS/90/linux/aws/6.0-0014-xen-time-introduce-xen_-save-restore-_steal_clock.patch b/SPECS/linux/6.1/aws/6.0-0014-xen-time-introduce-xen_-save-restore-_steal_clock.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0014-xen-time-introduce-xen_-save-restore-_steal_clock.patch rename to SPECS/linux/6.1/aws/6.0-0014-xen-time-introduce-xen_-save-restore-_steal_clock.patch diff --git a/SPECS/90/linux/aws/6.0-0015-x86-xen-save-and-restore-steal-clock.patch b/SPECS/linux/6.1/aws/6.0-0015-x86-xen-save-and-restore-steal-clock.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0015-x86-xen-save-and-restore-steal-clock.patch rename to SPECS/linux/6.1/aws/6.0-0015-x86-xen-save-and-restore-steal-clock.patch diff --git a/SPECS/90/linux/aws/6.0-0016-xen-events-add-xen_shutdown_pirqs-helper-function.patch b/SPECS/linux/6.1/aws/6.0-0016-xen-events-add-xen_shutdown_pirqs-helper-function.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0016-xen-events-add-xen_shutdown_pirqs-helper-function.patch rename to SPECS/linux/6.1/aws/6.0-0016-xen-events-add-xen_shutdown_pirqs-helper-function.patch diff --git a/SPECS/90/linux/aws/6.0-0017-x86-xen-close-event-channels-for-PIRQs-in-system-cor.patch b/SPECS/linux/6.1/aws/6.0-0017-x86-xen-close-event-channels-for-PIRQs-in-system-cor.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0017-x86-xen-close-event-channels-for-PIRQs-in-system-cor.patch rename to SPECS/linux/6.1/aws/6.0-0017-x86-xen-close-event-channels-for-PIRQs-in-system-cor.patch diff --git a/SPECS/90/linux/aws/6.0-0018-PM-hibernate-update-the-resume-offset-on-SNAPSHOT_SE.patch b/SPECS/linux/6.1/aws/6.0-0018-PM-hibernate-update-the-resume-offset-on-SNAPSHOT_SE.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0018-PM-hibernate-update-the-resume-offset-on-SNAPSHOT_SE.patch rename to SPECS/linux/6.1/aws/6.0-0018-PM-hibernate-update-the-resume-offset-on-SNAPSHOT_SE.patch diff --git a/SPECS/90/linux/aws/6.0-0020-xen-blkfront-Fixed-blkfront_restore-to-remove-a-call.patch b/SPECS/linux/6.1/aws/6.0-0020-xen-blkfront-Fixed-blkfront_restore-to-remove-a-call.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0020-xen-blkfront-Fixed-blkfront_restore-to-remove-a-call.patch rename to SPECS/linux/6.1/aws/6.0-0020-xen-blkfront-Fixed-blkfront_restore-to-remove-a-call.patch diff --git a/SPECS/90/linux/aws/6.0-0021-x86-tsc-avoid-system-instability-in-hibernation.patch b/SPECS/linux/6.1/aws/6.0-0021-x86-tsc-avoid-system-instability-in-hibernation.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0021-x86-tsc-avoid-system-instability-in-hibernation.patch rename to SPECS/linux/6.1/aws/6.0-0021-x86-tsc-avoid-system-instability-in-hibernation.patch diff --git a/SPECS/90/linux/aws/6.0-0022-block-xen-blkfront-consider-new-dom0-features-on-res.patch b/SPECS/linux/6.1/aws/6.0-0022-block-xen-blkfront-consider-new-dom0-features-on-res.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0022-block-xen-blkfront-consider-new-dom0-features-on-res.patch rename to SPECS/linux/6.1/aws/6.0-0022-block-xen-blkfront-consider-new-dom0-features-on-res.patch diff --git a/SPECS/90/linux/aws/6.0-0023-xen-restore-pirqs-on-resume-from-hibernation.patch b/SPECS/linux/6.1/aws/6.0-0023-xen-restore-pirqs-on-resume-from-hibernation.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0023-xen-restore-pirqs-on-resume-from-hibernation.patch rename to SPECS/linux/6.1/aws/6.0-0023-xen-restore-pirqs-on-resume-from-hibernation.patch diff --git a/SPECS/90/linux/aws/6.0-0024-xen-Only-restore-the-ACPI-SCI-interrupt-in-xen_resto.patch b/SPECS/linux/6.1/aws/6.0-0024-xen-Only-restore-the-ACPI-SCI-interrupt-in-xen_resto.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0024-xen-Only-restore-the-ACPI-SCI-interrupt-in-xen_resto.patch rename to SPECS/linux/6.1/aws/6.0-0024-xen-Only-restore-the-ACPI-SCI-interrupt-in-xen_resto.patch diff --git a/SPECS/90/linux/aws/6.0-0026-xen-netfront-call-netif_device_attach-on-resume.patch b/SPECS/linux/6.1/aws/6.0-0026-xen-netfront-call-netif_device_attach-on-resume.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0026-xen-netfront-call-netif_device_attach-on-resume.patch rename to SPECS/linux/6.1/aws/6.0-0026-xen-netfront-call-netif_device_attach-on-resume.patch diff --git a/SPECS/90/linux/aws/6.0-0054-xen-Restore-xen-pirqs-on-resume-from-hibernation.patch b/SPECS/linux/6.1/aws/6.0-0054-xen-Restore-xen-pirqs-on-resume-from-hibernation.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0054-xen-Restore-xen-pirqs-on-resume-from-hibernation.patch rename to SPECS/linux/6.1/aws/6.0-0054-xen-Restore-xen-pirqs-on-resume-from-hibernation.patch diff --git a/SPECS/90/linux/aws/6.0-0055-block-xen-blkfront-bump-the-maximum-number-of-indire.patch b/SPECS/linux/6.1/aws/6.0-0055-block-xen-blkfront-bump-the-maximum-number-of-indire.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0055-block-xen-blkfront-bump-the-maximum-number-of-indire.patch rename to SPECS/linux/6.1/aws/6.0-0055-block-xen-blkfront-bump-the-maximum-number-of-indire.patch diff --git a/SPECS/90/linux/aws/6.0-0185-Introduce-page-touching-DMA-ops-binding.patch b/SPECS/linux/6.1/aws/6.0-0185-Introduce-page-touching-DMA-ops-binding.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0185-Introduce-page-touching-DMA-ops-binding.patch rename to SPECS/linux/6.1/aws/6.0-0185-Introduce-page-touching-DMA-ops-binding.patch diff --git a/SPECS/90/linux/aws/6.0-0444-drivers-base-memory-use-MHP_MEMMAP_ON_MEMORY-from-th.patch b/SPECS/linux/6.1/aws/6.0-0444-drivers-base-memory-use-MHP_MEMMAP_ON_MEMORY-from-th.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0444-drivers-base-memory-use-MHP_MEMMAP_ON_MEMORY-from-th.patch rename to SPECS/linux/6.1/aws/6.0-0444-drivers-base-memory-use-MHP_MEMMAP_ON_MEMORY-from-th.patch diff --git a/SPECS/90/linux/aws/6.0-0490-Correct-read-overflow-in-page-touching-DMA-ops-bindi.patch b/SPECS/linux/6.1/aws/6.0-0490-Correct-read-overflow-in-page-touching-DMA-ops-bindi.patch similarity index 100% rename from SPECS/90/linux/aws/6.0-0490-Correct-read-overflow-in-page-touching-DMA-ops-bindi.patch rename to SPECS/linux/6.1/aws/6.0-0490-Correct-read-overflow-in-page-touching-DMA-ops-bindi.patch diff --git a/SPECS/91/linux/canister_builder/crypto/fips_canister_wrapper.c b/SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper-6.1.c similarity index 60% rename from SPECS/91/linux/canister_builder/crypto/fips_canister_wrapper.c rename to SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper-6.1.c index b56ed81325..cae964e0ec 100644 --- a/SPECS/91/linux/canister_builder/crypto/fips_canister_wrapper.c +++ b/SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper-6.1.c @@ -2,10 +2,7 @@ * Kernel APIs wrapper for the canister. * * Copyright (C) 2020 - 2022 VMware, Inc. - * Copyright (c) 2025 Broadcom. All Rights Reserved. The term "Broadcom" - * refers to Broadcom Inc. and/or its subsidiaries. - * - * Author: Alexey Makhalov + * Author: Alexey Makhalov * */ @@ -14,6 +11,7 @@ #include #include #include +#include #include #include @@ -46,6 +44,7 @@ #if LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0) #include #else +#include #include #endif @@ -63,108 +62,31 @@ #include "internal.h" #include #include -#include #include +#include +#include #include -#include -#include -#include #include -#include #include "fips_canister_wrapper_common.h" static __ro_after_init bool alg_request_report = false; -extern void fcw_sg_set_buf(struct scatterlist *sg, const void *buf, unsigned int buflen); -extern int fcw_warn_on(bool cond); -extern size_t fcw_copy_from_iter(void *addr, size_t bytes, struct iov_iter *i); - -void *fcw_sg_page(struct scatterlist *sg); -int fcw_signal_pending(void); -void *fcw_kthread_run(int (*threadfn)(void *data), void *data, const char namefmt[]); -int fcw_cond_resched(void); -void *fcw_kmalloc(size_t size, gfp_t flags); -void *fcw_kzalloc(size_t size, gfp_t flags); -bool fcw_boot_cpu_has(unsigned long bit); -bool fcw_x86_match_cpu_zmm_exclusion_list(void); -bool fcw_x86_match_cpu_aesni_cpu_id(void); -bool fcw_x86_match_cpu_sha256_ssse3_cpu_id(void); -bool fcw_x86_match_cpu_sha512_ssse3_cpu_id(void); -bool fcw_x86_match_cpu_pcmul_cpu_id(void); -void * __init fcw_mem_alloc(size_t size); -void __init fcw_mem_free(void *p); -void *fcw_mutex_init(void); -void fcw_mutex_lock(void *m); -void fcw_mutex_unlock(void *m); -bool fcw_schedule_work(struct work_struct *work); -struct aead_request *fcw_aead_request_alloc(struct crypto_aead *tfm, - gfp_t gfp); -struct ahash_request *fcw_ahash_request_alloc(struct crypto_ahash *tfm, - gfp_t gfp); -struct akcipher_request *fcw_akcipher_request_alloc( - struct crypto_akcipher *tfm, gfp_t gfp); -struct skcipher_request *fcw_skcipher_request_alloc( - struct crypto_skcipher *tfm, gfp_t gfp); -struct kpp_request *fcw_kpp_request_alloc( - struct crypto_kpp *tfm, gfp_t gfp); -void __noreturn __fcw_module_put_and_kthread_exit(struct module *mod, long code); -void fcw_kernel_fpu_begin(void); -void fcw_kernel_fpu_end(void); -void fcw_bug(void); -void *fcw_init_ratelimit_state(void *rs); -bool fcw_ratelimit(void *rs, const char *name); -void fcw_bug_on(int cond); -int fcw_warn_on_once(int cond); -int fcw_is_warn_true(int cond); -void fcw_warn(void); -void *fcw_sg_page_address(struct scatterlist *sg); -int fcw_build_hash_sglist(struct test_sglist *tsgl, - const struct hash_testvec *vec, - const struct testvec_config *cfg, - unsigned int alignmask, - const struct test_sg_division *divs[XBUFSIZE]); -int fcw_build_cipher_test_sglists(struct cipher_test_sglists *tsgls, - const struct testvec_config *cfg, - unsigned int alignmask, - unsigned int src_total_len, - unsigned int dst_total_len, - const struct kvec *inputs, - unsigned int nr_inputs); -struct scatterlist *fcw_scatterwalk_ffwd(struct scatterlist dst[2], - struct scatterlist *src, - unsigned int len); -void fcw_scatterwalk_unmap(void *vaddr); -void fcw_sg_assign_page(struct scatterlist *sg, struct page *page); -void *fcw_sg_virt(struct scatterlist *sg); -void *fcw_scatterwalk_map(struct scatter_walk *walk); -bool fcw_ghash_do_async(struct cryptd_ahash *tfm); -int fcw_fips_not_allowed_alg(char *name); -int fcw_disabled_due_to_fips(char *name); -int fcw_skip_tests(void); - -int fcw_printk(const char *format, ...); -int fcw_warn_printk(const char *fmt, ...); - -bool fcw_need_resched(void); -void fcw_scatterwalk_pagedone(struct scatter_walk *walk, int out, - unsigned int more); -void *fcw_kmap_local_page(void *page); -void fcw_kunmap_local(const void *addr); - -bool fcw_need_resched(void) -{ - return need_resched(); -} - -void *fcw_kmap_local_page(void *page) +/* + * Replicate a no-op stackleak_track_stack() function for other linux flavours + * where CONFIG_GCC_PLUGIN_STACKLEAK is disabled to overcome missing symbols. + * stackleak_track_stack() is inserted for the functions with a stack frame size + * greater than or equal to CONFIG_STACKLEAK_TRACK_MIN_SIZE. + */ +#ifndef CONFIG_GCC_PLUGIN_STACKLEAK +void __used __no_caller_saved_registers noinstr stackleak_track_stack(void) { - return kmap_local_page((struct page *)page); } +#endif -void fcw_kunmap_local(const void *addr) -{ - kunmap_local(addr); -} +extern void fcw_sg_set_buf(struct scatterlist *sg, const void *buf, unsigned int buflen); +extern int fcw_warn_on(int cond); +extern size_t fcw_copy_from_iter(void *addr, size_t bytes, struct iov_iter *i); +extern void *fcw_memcpy(void *dst, const void *src, size_t len); int fcw_signal_pending(void) { @@ -197,92 +119,6 @@ bool fcw_boot_cpu_has(unsigned long bit) return boot_cpu_has(bit); } -/* - * Below arrays has been moved from aesni-intel_glue.c to eliminate - * struct x86_cpu_id from canister - */ -/* - * This is a list of CPU models that are known to suffer from downclocking when - * zmm registers (512-bit vectors) are used. On these CPUs, the AES mode - * implementations with zmm registers won't be used by default. Implementations - * with ymm registers (256-bit vectors) will be used by default instead. - */ -static const struct x86_cpu_id zmm_exclusion_list[] = { - X86_MATCH_VFM(INTEL_SKYLAKE_X, 0), - X86_MATCH_VFM(INTEL_ICELAKE_X, 0), - X86_MATCH_VFM(INTEL_ICELAKE_D, 0), - X86_MATCH_VFM(INTEL_ICELAKE, 0), - X86_MATCH_VFM(INTEL_ICELAKE_L, 0), - X86_MATCH_VFM(INTEL_ICELAKE_NNPI, 0), - X86_MATCH_VFM(INTEL_TIGERLAKE_L, 0), - X86_MATCH_VFM(INTEL_TIGERLAKE, 0), - /* Allow Rocket Lake and later, and Sapphire Rapids and later. */ - /* Also allow AMD CPUs (starting with Zen 4, the first with AVX-512). */ - {}, -}; - -static const struct x86_cpu_id aesni_cpu_id[] = { - X86_MATCH_FEATURE(X86_FEATURE_AES, NULL), - {} -}; - -bool fcw_x86_match_cpu_zmm_exclusion_list(void) -{ - if (x86_match_cpu(zmm_exclusion_list)) - return true; - return false; -} - -bool fcw_x86_match_cpu_aesni_cpu_id(void) -{ - if (x86_match_cpu(aesni_cpu_id)) - return true; - return false; -} - -static const struct x86_cpu_id sha256_ssse3_cpu_ids[] = { -#ifdef CONFIG_AS_SHA256_NI - X86_MATCH_FEATURE(X86_FEATURE_SHA_NI, NULL), -#endif - X86_MATCH_FEATURE(X86_FEATURE_AVX2, NULL), - X86_MATCH_FEATURE(X86_FEATURE_AVX, NULL), - X86_MATCH_FEATURE(X86_FEATURE_SSSE3, NULL), - {} -}; - -bool fcw_x86_match_cpu_sha256_ssse3_cpu_id(void) -{ - if (x86_match_cpu(sha256_ssse3_cpu_ids)) - return true; - return false; -} - -static const struct x86_cpu_id sha512_ssse3_cpu_ids[] = { - X86_MATCH_FEATURE(X86_FEATURE_AVX2, NULL), - X86_MATCH_FEATURE(X86_FEATURE_AVX, NULL), - X86_MATCH_FEATURE(X86_FEATURE_SSSE3, NULL), - {} -}; - -bool fcw_x86_match_cpu_sha512_ssse3_cpu_id(void) -{ - if (x86_match_cpu(sha512_ssse3_cpu_ids)) - return true; - return false; -} - -static const struct x86_cpu_id pcmul_cpu_id[] = { - X86_MATCH_FEATURE(X86_FEATURE_PCLMULQDQ, NULL), /* Pickle-Mickle-Duck */ - {} -}; - -bool fcw_x86_match_cpu_pcmul_cpu_id(void) -{ - if (x86_match_cpu(pcmul_cpu_id)) - return true; - return false; -} - void * __init fcw_mem_alloc(size_t size) { /* Can be called before mm_init(). */ @@ -312,6 +148,10 @@ void fcw_mutex_lock(void *m) mutex_lock((struct mutex *)m); } +void *fcw_spin_lock_init(void) +{ + return (void *)1; +} void fcw_mutex_unlock(void *m) { mutex_unlock((struct mutex *)m); @@ -338,22 +178,6 @@ void fips_fail_notify(void) } #endif -/* Replicate a no-op __fentry__() function for other linux flavours - * where function tracer is disabled. - */ -#ifndef CONFIG_FUNCTION_TRACER -void __fentry__(void) -{ -} -#endif - - -void fcw_scatterwalk_pagedone(struct scatter_walk *walk, int out, - unsigned int more) -{ - scatterwalk_pagedone(walk, out, more); -} - struct aead_request *fcw_aead_request_alloc(struct crypto_aead *tfm, gfp_t gfp) { @@ -384,6 +208,15 @@ struct kpp_request *fcw_kpp_request_alloc( return kpp_request_alloc(tfm, gfp); } +u32 fcw_prandom_u32_max(u32 ep_ro) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0) + return prandom_u32_max(ep_ro); +#else + return get_random_u32_below(ep_ro); +#endif +} + void __noreturn __fcw_module_put_and_kthread_exit(struct module *mod, long code) { #if LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0) @@ -410,11 +243,11 @@ void fcw_bug(void) void *fcw_init_ratelimit_state(void *rs) { - struct ratelimit_state *_rs = kzalloc(sizeof(struct ratelimit_state), - GFP_KERNEL); if (rs != NULL) return rs; + struct ratelimit_state *_rs = kzalloc(sizeof(struct ratelimit_state), + GFP_KERNEL); _rs->lock = __RAW_SPIN_LOCK_UNLOCKED(_rs.lock); _rs->interval = DEFAULT_RATELIMIT_INTERVAL; _rs->burst = DEFAULT_RATELIMIT_BURST; @@ -437,7 +270,7 @@ void fcw_bug_on(int cond) } while(0); } -int fcw_warn_on(bool cond) +int fcw_warn_on(int cond) { int __ret_warn_on = !!(cond); if(unlikely(__ret_warn_on)) @@ -458,21 +291,34 @@ int fcw_is_warn_true(int cond) int __ret_warn_on = !!(cond); return unlikely(__ret_warn_on); } - void fcw_warn(void) { __WARN_FLAGS(BUGFLAG_NO_CUT_HERE | BUGFLAG_TAINT(TAINT_WARN)); } -size_t fcw_copy_from_iter(void *addr, size_t bytes, struct iov_iter *i) +void *fcw_memcpy(void *dst, const void *src, size_t len) { - return copy_from_iter(addr, bytes, i); + return memcpy(dst, src, len); } -void *fcw_sg_page(struct scatterlist *sg) +int fcw_sha1_base_do_update(struct shash_desc *desc, + const u8 *data, + unsigned int len, + sha1_block_fn *block_fn) { - struct page *page = sg_page(sg); - return page; + return sha1_base_do_update(desc, data, len, block_fn); +} + +int fcw_sha512_base_do_update(struct shash_desc *desc, + const u8 *data, + unsigned int len, + sha512_block_fn *block_fn) +{ + return sha512_base_do_update(desc, data, len, block_fn); +} +size_t fcw_copy_from_iter(void *addr, size_t bytes, struct iov_iter *i) +{ + return copy_from_iter(addr, bytes, i); } void *fcw_sg_page_address(struct scatterlist *sg) @@ -592,7 +438,7 @@ static int build_test_sglist(struct test_sglist *tsgl, sg_mark_end(&tsgl->sgl[tsgl->nents - 1]); tsgl->sgl_ptr = tsgl->sgl; - memcpy(tsgl->sgl_saved, tsgl->sgl, tsgl->nents * sizeof(tsgl->sgl[0])); + fcw_memcpy(tsgl->sgl_saved, tsgl->sgl, tsgl->nents * sizeof(tsgl->sgl[0])); return 0; } @@ -650,9 +496,9 @@ int fcw_build_cipher_test_sglists(struct cipher_test_sglists *tsgls, * two scatterlists have identical entries, rather than * different entries that split up the same memory differently. */ - memcpy(tsgls->dst.sgl, tsgls->src.sgl, + fcw_memcpy(tsgls->dst.sgl, tsgls->src.sgl, tsgls->src.nents * sizeof(tsgls->src.sgl[0])); - memcpy(tsgls->dst.sgl_saved, tsgls->src.sgl, + fcw_memcpy(tsgls->dst.sgl_saved, tsgls->src.sgl, tsgls->src.nents * sizeof(tsgls->src.sgl[0])); tsgls->dst.sgl_ptr = tsgls->dst.sgl; tsgls->dst.nents = tsgls->src.nents; @@ -666,8 +512,8 @@ int fcw_build_cipher_test_sglists(struct cipher_test_sglists *tsgls, } struct scatterlist *fcw_scatterwalk_ffwd(struct scatterlist dst[2], - struct scatterlist *src, - unsigned int len) + struct scatterlist *src, + unsigned int len) { return scatterwalk_ffwd(dst, src, len); } @@ -698,102 +544,66 @@ void *fcw_scatterwalk_map(struct scatter_walk *walk) return scatterwalk_map(walk); } -bool fcw_ghash_do_async(struct cryptd_ahash *tfm) -{ - return (!crypto_simd_usable() || - (in_atomic() && cryptd_ahash_queued(tfm))); -} - static char *canister_algs[] = { + "cipher_null-generic", + "ecb-cipher_null", "rsa-generic", + "sha1-generic", "sha256-generic", "sha224-generic", "sha512-generic", "sha384-generic", - "sha256-avx", - "sha224-avx", - "sha512-avx", - "sha384-avx", - "sha256-avx2", - "sha224-avx2", - "sha512-avx2", - "sha384-avx2", - "sha256-ssse3", - "sha224-ssse3", - "sha512-ssse3", - "sha384-ssse3", - "sha256-ni", - "sha224-ni", "aes-generic", "ctr(aes-generic)", - "rfc3686(ctr(aes-generic))", "drbg_pr_ctr_aes128", "drbg_pr_ctr_aes192", "drbg_pr_ctr_aes256", + "drbg_pr_sha1", "drbg_pr_sha384", "drbg_pr_sha512", "drbg_pr_sha256", + "hmac(sha1-generic)", + "drbg_pr_hmac_sha1", "hmac(sha384-generic)", - "hmac(sha384-avx)", - "hmac(sha384-avx2)", - "hmac(sha384-ssse3)", "drbg_pr_hmac_sha384", "hmac(sha512-generic)", - "hmac(sha512-avx)", - "hmac(sha512-avx2)", - "hmac(sha512-ssse3)", "drbg_pr_hmac_sha512", "hmac(sha256-generic)", - "hmac(sha256-avx)", - "hmac(sha256-avx2)", - "hmac(sha256-ssse3)", - "hmac(sha256-ni)", "drbg_pr_hmac_sha256", "drbg_nopr_ctr_aes128", "drbg_nopr_ctr_aes192", "drbg_nopr_ctr_aes256", + "drbg_nopr_sha1", "drbg_nopr_sha384", "drbg_nopr_sha512", "drbg_nopr_sha256", + "drbg_nopr_hmac_sha1", "drbg_nopr_hmac_sha384", "drbg_nopr_hmac_sha512", "drbg_nopr_hmac_sha256", "ecdh-generic", "cbc(aes-generic)", "cbc(aes-aesni)", - "cbc(ecb(aes-generic))", + "ecb(aes-generic)", "hmac(sha224-generic)", - "hmac(sha224-avx)", - "hmac(sha224-avx2)", - "hmac(sha224-ssse3)", - "hmac(sha224-ni)", "pkcs1pad(rsa-generic,sha256)", "pkcs1pad(rsa-generic,sha512)", - "pkcs1pad(rsa-generic,sha3-512)", "xts(ecb(aes-generic))", "aes-aesni", + "__ecb-aes-aesni", "__cbc-aes-aesni", "__ctr-aes-aesni", "__xts-aes-aesni", - "__rfc3686-ctr-aes-aesni", + "cryptd(__ecb-aes-aesni)", + "ecb-aes-aesni", "cryptd(__cbc-aes-aesni)", "cbc-aes-aesni", "cryptd(__ctr-aes-aesni)", - "cryptd(__rfc3686-ctr-aes-aesni)", "ctr-aes-aesni", - "rfc3686-ctr-aes-aesni", "cryptd(__xts-aes-aesni)", "xts-aes-aesni", - "xts-aes-aesni-avx", -#if defined(CONFIG_AS_VAES) && defined(CONFIG_AS_VPCLMULQDQ) - "xts-aes-vaes-avx2", - "xts-aes-vaes-avx10_256", - "xts-aes-vaes-avx10_512", -#endif "ccm_base(ctr(aes-generic),cbcmac(aes-generic))", "ccm_base(ctr-aes-aesni,cbcmac(aes-aesni))", - "rfc4309(ccm_base(ctr(aes-generic),cbcmac(aes-generic)))", - "rfc4309(ccm_base(ctr-aes-aesni,cbcmac(aes-aesni)))", "cfb(aes-generic)", "cfb(aes-aesni)", "cmac(aes-generic)", @@ -806,50 +616,33 @@ static char *canister_algs[] = { "hmac(sha3-384-generic)", "sha3-512-generic", "hmac(sha3-512-generic)", + "pkcs1pad(rsa-generic,sha1)", "pkcs1pad(rsa-generic,sha224)", "pkcs1pad(rsa-generic,sha384)", "ecdsa-nist-p384-generic", "ecdsa-nist-p256-generic", - "ecdsa-nist-p521-generic", "ecdh-nist-p384-generic", "ecdh-nist-p256-generic", - "jitterentropy_rng-generic", + "jitterentropy_rng", "cts-cbc-aes-aesni", "__cts-cbc-aes-aesni", "cryptd(__cts-cbc-aes-aesni)", "seqiv(rfc4106-gcm-aesni)", "seqiv(rfc4106(gcm_base(ctr(aes-generic),ghash-generic)))", - "seqiv(rfc4106(gcm_base(ctr(aes-generic),ghash-clmulni)))", - "seqiv(rfc4106(gcm_base(ctr(aes-generic),__ghash-pclmulqdqni)))", + "ghash-generic", "cts(cbc(aes-generic))", "cts(cbc(aes-generic))", - "cts(cbc(ecb(aes-generic)))", "cryptd(__cbc-aes-aesni)", "cbc-aes-aesni", "gcm_base(ctr(aes-generic),ghash-generic)", - "gcm_base(ctr(aes-generic),ghash-clmulni)", - "gcm_base(ctr(aes-generic),__ghash-pclmulqdqni)", "generic-gcm-aesni", - "generic-gcm-aesni-avx", "__generic-gcm-aesni", -#if defined(CONFIG_AS_VAES) && defined(CONFIG_AS_VPCLMULQDQ) - "generic-gcm-vaes-avx10_256", - "generic-gcm-vaes-avx10_512", -#endif "cryptd(__generic-gcm-aesni)", "rfc4106(gcm_base(ctr(aes-generic),ghash-generic))", - "rfc4106(gcm_base(ctr(aes-generic),ghash-clmulni))", - "rfc4106(gcm_base(ctr(aes-generic),__ghash-pclmulqdqni))", "rfc4106-gcm-aesni", - "rfc4106-gcm-aesni-avx", "__rfc4106-gcm-aesni", -#if defined(CONFIG_AS_VAES) && defined(CONFIG_AS_VPCLMULQDQ) - "rfc4106-gcm-vaes-avx10_256", - "rfc4106-gcm-vaes-avx10_512", -#endif "cryptd(__rfc4106-gcm-aesni)", // no certification require - "cipher_null-generic", "crc32c-generic", "crct10dif-generic", "crc32c-intel", @@ -857,54 +650,16 @@ static char *canister_algs[] = { "deflate-scomp", "deflate-generic", "zlib-deflate-scomp", -}; - -static char *fips_disabled_algs[] = { - "xctr-aes-aesni", "__xctr-aes-aesni", - "compress_null-generic", - "digest_null-generic", - "cbcmac(aes-generic)", - "cbcmac(aes-aesni)", - "ecdsa-nist-p192-generic", - "ecdh-nist-p192-generic", - "ghash-clmulni", - "ghash-generic", - "__ghash-pclmulqdqni", - "des-generic", - "des3_ede-generic", - "dh-generic", - "lzo-rle-scomp", - "lzo-rle-generic", - "lzo-scomp", - "lzo-generic", - "md5-generic", - /* - * Special case for ECB. Eventhough ECB has fips_allowed flag enabled - * in testmgr, ECB algo is outside of the canister and it is marked as - * CRYPTO_ALG_FIPS_INTERNAL. Hence include ecb in the disabled_algs - */ - "ecb-cipher_null", - "ecb-aes-aesni", - "ecb(aes-generic)", - /* Special case for jitterentropy_rng-proxy. It is registered as a separate driver, - * though the main driver name is jitterentropy_rng-generic - */ - "jitterentropy_rng-proxy", + "xctr-aes-aesni", }; int fcw_fips_not_allowed_alg(char *name) { if (fips_enabled == 1) { - /* - * The max name length in the canister_algs list should always be - * less than CRYPTO_MAX_ALG_NAME. Hence limit the comparison length to - * CRYPTO_MAX_ALG_NAME prevent buffer over-read. - */ - int i, len = strnlen(name, CRYPTO_MAX_ALG_NAME); - + int i; for (i = 0; i < sizeof(canister_algs)/sizeof(canister_algs[0]); i++) { - if (strncmp(name, canister_algs[i], len) == 0) + if (strcmp(name, canister_algs[i]) == 0) return 0; } return 1; @@ -912,94 +667,19 @@ int fcw_fips_not_allowed_alg(char *name) return 0; } -int fcw_disabled_due_to_fips(char *name) -{ - if (fips_enabled == 1) { - /* - * If cra_drv_name is not present in canister_algs list, then - * check if it is present in fips_disabled_algs list. This - * fips_disabled_algs list has been populated after confirming - * that the flag fips_allowed is not set in testmgr.c. Return - * true if present so that testmgr can print the log that - * the algorithm is disabled due to fips. - */ - int i, len = strnlen(name, CRYPTO_MAX_ALG_NAME); - for (i = 0; i < sizeof(fips_disabled_algs)/ - sizeof(fips_disabled_algs[0]); i++) { - if (strncmp(name, fips_disabled_algs[i], len) == 0) - return 1; - } - return 0; - } - return 1; -} - -int fcw_skip_tests(void) -{ - return !fips_enabled; -} - -int fcw_printk(const char *format, ...) -{ - va_list args; - struct va_format vaf; - - /* - * printk is a macro which accepts variable arguments. It - * validates the LOGLEVEL of a message during compile time - * itself. - * Hence, if a wrapper is defined for printk, the format and - * variable arguments have to be populated as va_format structure - * and passed to printk as variable argument. If the format message - * is passed directly, then the LOG_LEVEL check will not be applied - * and all messages will be printed on console. - */ - va_start(args, format); - vaf.fmt = format; - vaf.va = &args; - - _printk("%pV", &vaf); - - va_end(args); - - return 0; -} - -int fcw_warn_printk(const char *fmt, ...) -{ - va_list args; - struct va_format vaf; - - va_start(args, fmt); - vaf.fmt = fmt; - vaf.va = &args; - - __warn_printk("%pV", &vaf); - - va_end(args); - - return 0; -} - static int crypto_msg_notify(struct notifier_block *this, unsigned long msg, void *data) { struct crypto_alg *alg = (struct crypto_alg *)data; - if (unlikely(!alg || !alg->cra_driver_name || !alg->cra_name)) { - fcw_printk(KERN_WARNING" name not set in %s\n", __FUNCTION__); - return NOTIFY_DONE; - } if (msg == CRYPTO_MSG_ALG_REQUEST && alg_request_report) { pr_notice("alg request: %s (%s) by %s(%d)", alg->cra_driver_name, alg->cra_name, current->comm, current->pid); } if (msg == CRYPTO_MSG_ALG_REGISTER) { - if (fcw_fips_not_allowed_alg(alg->cra_driver_name) && - !fcw_disabled_due_to_fips(alg->cra_driver_name)) { - pr_notice("alg: %s (%s) not certified", - alg->cra_driver_name, alg->cra_name); + if (fcw_fips_not_allowed_alg(alg->cra_driver_name)) { + pr_notice("alg: %s (%s) not certified", alg->cra_driver_name, alg->cra_name); } } return NOTIFY_DONE; @@ -1011,9 +691,6 @@ static struct notifier_block crypto_msg_notifier = { static int __init wrapper_init(void) { - if (fcw_skip_tests()) - set_crypto_boot_test_finished(); - return crypto_register_notifier(&crypto_msg_notifier); } arch_initcall(wrapper_init); @@ -1062,6 +739,9 @@ EXPORT_SYMBOL_GPL(crypto_ecdh_encode_key); EXPORT_SYMBOL_GPL(crypto_ecdh_decode_key); EXPORT_SYMBOL_GPL(rsa_parse_pub_key); EXPORT_SYMBOL_GPL(rsa_parse_priv_key); +EXPORT_SYMBOL_GPL(sha1_zero_message_hash); +EXPORT_SYMBOL(crypto_sha1_update); +EXPORT_SYMBOL(crypto_sha1_finup); EXPORT_SYMBOL_GPL(sha224_zero_message_hash); EXPORT_SYMBOL_GPL(sha256_zero_message_hash); EXPORT_SYMBOL(crypto_sha256_update); @@ -1076,7 +756,10 @@ EXPORT_SYMBOL(crypto_aes_inv_sbox); EXPORT_SYMBOL(aes_expandkey); EXPORT_SYMBOL(aes_encrypt); EXPORT_SYMBOL(aes_decrypt); +EXPORT_SYMBOL(sha1_transform); +EXPORT_SYMBOL(sha1_init); EXPORT_SYMBOL(sha256_update); +EXPORT_SYMBOL(sha224_update); EXPORT_SYMBOL(sha256_final); EXPORT_SYMBOL(sha224_final); EXPORT_SYMBOL(sha256); diff --git a/SPECS/91/linux/canister_builder/crypto/fips_canister_wrapper.h b/SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper-6.1.h similarity index 57% rename from SPECS/91/linux/canister_builder/crypto/fips_canister_wrapper.h rename to SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper-6.1.h index 49c6fba357..ec56786102 100644 --- a/SPECS/91/linux/canister_builder/crypto/fips_canister_wrapper.h +++ b/SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper-6.1.h @@ -24,12 +24,8 @@ #include #include #include - -#undef DEFINE_LOCK_GUARD_1_COND - -#ifndef CONFIG_FUNCTION_TRACER -void __fentry__(void); -#endif +#include +#include #ifndef CONFIG_GCC_PLUGIN_STACKLEAK void __used __no_caller_saved_registers noinstr stackleak_track_stack(void); @@ -39,6 +35,8 @@ void __used __no_caller_saved_registers noinstr stackleak_track_stack(void); int _printk(const char *fmt, ...); #endif +extern u32 fcw_prandom_u32_max(u32 ep_ro); + extern void __noreturn __fcw_module_put_and_kthread_exit(struct module *mod, long code); #define fcw_module_put_and_kthread_exit(code) __fcw_module_put_and_kthread_exit(THIS_MODULE, code) @@ -57,20 +55,32 @@ extern void *fcw_kthread_run(int (*threadfn)(void *data), void *data, const char extern void *fcw_mutex_init(void); extern void fcw_mutex_lock(void *m); extern void fcw_mutex_unlock(void *m); +extern void *fcw_spin_lock_init(void); extern bool fcw_schedule_work(struct work_struct *work); extern size_t fcw_copy_from_iter(void *addr, size_t bytes, struct iov_iter *i); +extern void *fcw_memcpy(void *dst, const void *src, size_t len); +extern int fcw_sha1_base_do_update(struct shash_desc *desc, + const u8 *data, + unsigned int len, + sha1_block_fn *block_fn); +extern int fcw_sha512_base_do_update(struct shash_desc *desc, + const u8 *data, + unsigned int len, + sha512_block_fn *block_fn); extern void fcw_bug(void); extern void fcw_bug_on(int cond); -extern int fcw_warn_on(bool cond); +extern int fcw_warn_on(int cond); extern int fcw_warn_on_once(int cond); extern void fcw_warn(void); extern int fcw_is_warn_true(int cond); +extern int fcw_warn_printk(const char *fmt, ...); extern void fcw_sg_assign_page(struct scatterlist *sg, struct page *page); extern void fcw_sg_set_buf(struct scatterlist *sg, const void *buf, unsigned int buflen); extern void *fcw_sg_virt(struct scatterlist *sg); extern void *fcw_scatterwalk_map(struct scatter_walk *walk); +extern int fcw_printk(const char *fmt, ...); extern bool fcw_ratelimit(void *rs, const char *name); extern void *fcw_init_ratelimit_state(void *rs); @@ -86,58 +96,5 @@ extern struct skcipher_request *fcw_skcipher_request_alloc( struct crypto_skcipher *tfm, gfp_t gfp); extern struct kpp_request *fcw_kpp_request_alloc( struct crypto_kpp *tfm, gfp_t gfp); - -extern void fcw_scatterwalk_pagedone(struct scatter_walk *walk, int out, - unsigned int more); -extern bool fcw_need_resched(void); -extern void *fcw_kmap_local_page(void *page); -extern void fcw_kunmap_local(const void *addr); -extern int fcw_skip_tests(void); - -extern int fcw_printk(const char *format, ...); -extern int fcw_warn_printk(const char *fmt, ...); - -int __init rsa_init(void); -void __exit rsa_exit(void); -int __init crypto_cbc_module_init(void); -void __exit crypto_cbc_module_exit(void); -int __init crypto_cmac_module_init(void); -void __exit crypto_cmac_module_exit(void); -int __init sha3_generic_mod_init(void); -void __exit sha3_generic_mod_fini(void); -int __init crypto_ctr_module_init(void); -void __exit crypto_ctr_module_exit(void); -int __init ghash_mod_init(void); -void __exit ghash_mod_exit(void); -int __init aes_init(void); -void __exit aes_fini(void); -int __init crypto_self_test_init(void); -int __init ecdsa_init(void); -void __exit ecdsa_exit(void); -int __init cryptomgr_init(void); -void __exit cryptomgr_exit(void); -int __init sha512_generic_mod_init(void); -void __exit sha512_generic_mod_fini(void); -int __init crypto_gcm_module_init(void); -void __exit crypto_gcm_module_exit(void); -int __init crypto_ccm_module_init(void); -void __exit crypto_ccm_module_exit(void); -int __init hmac_module_init(void); -void __exit hmac_module_exit(void); -int __init sha256_generic_mod_init(void); -void __exit sha256_generic_mod_fini(void); -int __init xts_module_init(void); -void __exit xts_module_exit(void); -int __init ecdh_init(void); -void __exit ecdh_exit(void); -int __init drbg_init(void); -void __exit drbg_exit(void); -int __init crypto_cts_module_init(void); -void __exit crypto_cts_module_exit(void); -int __init aesni_init(void); -void __exit aesni_exit(void); -int __init fips_integrity_init(void); -int __init fips_integrity_check (void); -int seqiv_module_init(void); -void seqiv_module_exit(void); #endif + diff --git a/SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper_asm.S b/SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper_asm.S new file mode 100644 index 0000000000..9524e29020 --- /dev/null +++ b/SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper_asm.S @@ -0,0 +1,24 @@ +/* + * Kernel assembly wrapper for canister + * + * Copyright (C) 2023 VMware, Inc. + * Authors: Keerthana K + * Vamsi Krishna Brahmajosyula + * + */ + +#include +#include +#include + +SYM_FUNC_START(fcw_printk) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0) + jmp printk +#else + jmp _printk +#endif +SYM_FUNC_END(fcw_printk) + +SYM_FUNC_START(fcw_warn_printk) + jmp __warn_printk +SYM_FUNC_END(fcw_warn_printk) diff --git a/SPECS/91/linux/canister_builder/crypto/fips_canister_wrapper_common.h b/SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper_common-6.1.h similarity index 99% rename from SPECS/91/linux/canister_builder/crypto/fips_canister_wrapper_common.h rename to SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper_common-6.1.h index ea63f3af48..f1c994a217 100644 --- a/SPECS/91/linux/canister_builder/crypto/fips_canister_wrapper_common.h +++ b/SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper_common-6.1.h @@ -122,7 +122,6 @@ struct testvec_config { bool key_offset_relative_to_alignmask; enum finalization_type finalization_type; bool nosimd; - bool nosimd_setkey; }; /* diff --git a/SPECS/91/linux/canister_builder/crypto/fips_canister_wrapper_internal.c b/SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper_internal-6.1.c similarity index 81% rename from SPECS/91/linux/canister_builder/crypto/fips_canister_wrapper_internal.c rename to SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper_internal-6.1.c index 7a2a4e27d6..0a857eac1b 100644 --- a/SPECS/91/linux/canister_builder/crypto/fips_canister_wrapper_internal.c +++ b/SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper_internal-6.1.c @@ -2,10 +2,7 @@ * canister functions invoked from wrapper layer. * * Copyright (C) 2023 VMware, Inc. - * Copyright (c) 2025 Broadcom. All Rights Reserved. The term "Broadcom" - * refers to Broadcom Inc. and/or its subsidiaries. - * - * Author: Keerthana K + * Author: Keerthana K * */ @@ -23,7 +20,6 @@ module_init(fcw_module_init); static int __init fcw_arch_initcall(void) { cryptomgr_init(); - sha3_generic_mod_init(); return true; } arch_initcall(fcw_arch_initcall); @@ -31,20 +27,21 @@ arch_initcall(fcw_arch_initcall); static int __init fcw_subsys_initcall(void) { rsa_init(); + crypto_ecb_module_init(); seqiv_module_init(); + sha1_generic_mod_init(); sha256_generic_mod_init(); sha512_generic_mod_init(); - sha256_ssse3_mod_init(); - sha512_ssse3_mod_init(); + sha3_generic_mod_init(); aes_init(); crypto_ctr_module_init(); hmac_module_init(); drbg_init(); ecdh_init(); ghash_mod_init(); - ghash_pclmulqdqni_mod_init(); crypto_cbc_module_init(); xts_module_init(); + crypto_cfb_module_init(); crypto_ccm_module_init(); crypto_gcm_module_init(); ecdsa_init(); @@ -67,21 +64,21 @@ static void __exit fcw_module_exit(void) seqiv_module_exit(); crypto_cbc_module_exit(); crypto_ccm_module_exit(); + crypto_cfb_module_exit(); crypto_cmac_module_exit(); crypto_ctr_module_exit(); crypto_cts_module_exit(); drbg_exit(); + crypto_ecb_module_exit(); ecdh_exit(); ecdsa_exit(); crypto_gcm_module_exit(); ghash_mod_exit(); - ghash_pclmulqdqni_mod_exit(); hmac_module_exit(); rsa_exit(); + sha1_generic_mod_fini(); sha256_generic_mod_fini(); sha512_generic_mod_fini(); - sha256_ssse3_mod_fini(); - sha512_ssse3_mod_fini(); sha3_generic_mod_fini(); xts_module_exit(); aesni_exit(); diff --git a/SPECS/91/linux/canister_builder/crypto/fips_canister_wrapper_internal.h b/SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper_internal-6.1.h similarity index 77% rename from SPECS/91/linux/canister_builder/crypto/fips_canister_wrapper_internal.h rename to SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper_internal-6.1.h index 23fa9baf22..71d279e01e 100644 --- a/SPECS/91/linux/canister_builder/crypto/fips_canister_wrapper_internal.h +++ b/SPECS/linux/6.1/canister_builder/crypto/fips_canister_wrapper_internal-6.1.h @@ -2,10 +2,7 @@ * canister functions invoked from wrapper layer. * * Copyright (C) 2023 VMware, Inc. - * Copyright (c) 2025 Broadcom. All Rights Reserved. The term "Broadcom" - * refers to Broadcom Inc. and/or its subsidiaries. - * - * Author: Keerthana K + * Author: Keerthana K * */ @@ -20,6 +17,7 @@ extern int crypto_gcm_module_init(void); extern int aes_init(void); extern int drbg_init(void); extern int xts_module_init(void); +extern int sha1_generic_mod_init(void); extern int sha256_generic_mod_init(void); extern int sha512_generic_mod_init(void); extern int rsa_init(void); @@ -30,9 +28,6 @@ extern int crypto_cts_module_init(void); extern int crypto_ctr_module_init(void); extern int crypto_cmac_module_init(void); extern int aesni_init(void); -extern int sha256_ssse3_mod_init(void); -extern int sha512_ssse3_mod_init(void); -extern int ghash_pclmulqdqni_mod_init(void); extern void cryptomgr_exit(void); extern void crypto_cbc_module_exit(void); extern void crypto_ccm_module_exit(void); @@ -47,19 +42,17 @@ extern void ecdsa_exit(void); extern void crypto_gcm_module_exit(void); extern void hmac_module_exit(void); extern void rsa_exit(void); +extern void sha1_generic_mod_fini(void); extern void sha256_generic_mod_fini(void); extern void sha512_generic_mod_fini(void); extern void xts_module_exit(void); extern void aesni_exit(void); -extern void sha256_ssse3_mod_fini(void); -extern void sha512_ssse3_mod_fini(void); -extern void ghash_pclmulqdqni_mod_exit(void); extern void aes_fini(void); extern int __init dh_init(void); extern void __exit dh_exit(void); extern int __init sha3_generic_mod_init(void); extern void __exit sha3_generic_mod_fini(void); -extern int __init seqiv_module_init(void); -extern void __exit seqiv_module_exit(void); +extern int seqiv_module_init(void); +extern void seqiv_module_exit(void); extern int __init ghash_mod_init(void); extern void __exit ghash_mod_exit(void); diff --git a/SPECS/90/linux/canister_builder/crypto/fips_integrity.c b/SPECS/linux/6.1/canister_builder/crypto/fips_integrity-6.1.c similarity index 100% rename from SPECS/90/linux/canister_builder/crypto/fips_integrity.c rename to SPECS/linux/6.1/canister_builder/crypto/fips_integrity-6.1.c diff --git a/SPECS/90/linux/canister_builder/crypto/fips_integrity.h b/SPECS/linux/6.1/canister_builder/crypto/fips_integrity-6.1.h similarity index 100% rename from SPECS/90/linux/canister_builder/crypto/fips_integrity.h rename to SPECS/linux/6.1/canister_builder/crypto/fips_integrity-6.1.h diff --git a/SPECS/90/linux/canister_builder/crypto/gen_canister_relocs.c b/SPECS/linux/6.1/canister_builder/crypto/gen_canister_relocs-6.1.c similarity index 100% rename from SPECS/90/linux/canister_builder/crypto/gen_canister_relocs.c rename to SPECS/linux/6.1/canister_builder/crypto/gen_canister_relocs-6.1.c diff --git a/SPECS/90/linux/canister_builder/crypto/update_canister_hmac.sh b/SPECS/linux/6.1/canister_builder/crypto/update_canister_hmac-6.1.sh similarity index 100% rename from SPECS/90/linux/canister_builder/crypto/update_canister_hmac.sh rename to SPECS/linux/6.1/canister_builder/crypto/update_canister_hmac-6.1.sh diff --git a/SPECS/91/linux/canister_builder/patches/0001-FIPS-canister-binary-usage.patch b/SPECS/linux/6.1/canister_builder/patches/0001-FIPS-canister-binary-usage-6.1.patch similarity index 66% rename from SPECS/91/linux/canister_builder/patches/0001-FIPS-canister-binary-usage.patch rename to SPECS/linux/6.1/canister_builder/patches/0001-FIPS-canister-binary-usage-6.1.patch index 7d265ee9e0..0f3223db74 100644 --- a/SPECS/91/linux/canister_builder/patches/0001-FIPS-canister-binary-usage.patch +++ b/SPECS/linux/6.1/canister_builder/patches/0001-FIPS-canister-binary-usage-6.1.patch @@ -1,6 +1,6 @@ -From f500907aac555eb458bdd2fcbeca5a0aaca063b1 Mon Sep 17 00:00:00 2001 -From: Vamsi Krishna Brahmajosyula -Date: Fri, 20 Jun 2025 12:53:33 -0500 +From a31ce76f47615c99cc429e8ca0c615401a6f0b0e Mon Sep 17 00:00:00 2001 +From: Keerthana K +Date: Wed, 20 Sep 2023 07:38:08 +0000 Subject: [PATCH] FIPS canister binary usage Build with fips canister and skip building crypto algorithms. @@ -11,81 +11,58 @@ This patch can be used at two stages: 2. Binary canister usage time. Signed-off-by: Alexey Makhalov -Signed-off-by: Keerthana K -Signed-off-by: Shivani Agarwal -Signed-off-by: Vamsi Krishna Brahmajosyula +Signed-off-by: Keerthana K +Signed-off-by: Vamsi Krishna Brahmajosyula --- - arch/x86/crypto/Makefile | 19 ------ - crypto/Makefile | 137 +++++++++++++++++++++++++++++++++------ + arch/x86/crypto/Makefile | 4 -- + crypto/Makefile | 120 +++++++++++++++++++++++++++++++-------- init/main.c | 3 + - lib/crypto/Makefile | 10 +-- - 4 files changed, 121 insertions(+), 48 deletions(-) + lib/crypto/Makefile | 9 --- + 4 files changed, 98 insertions(+), 38 deletions(-) diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile -index 53b4a2778..1e4aa1356 100644 +index 3b1d701a4..3836c4e30 100644 --- a/arch/x86/crypto/Makefile +++ b/arch/x86/crypto/Makefile -@@ -46,32 +46,13 @@ obj-$(CONFIG_CRYPTO_CHACHA20_X86_64) += chacha-x86_64.o +@@ -46,10 +46,6 @@ obj-$(CONFIG_CRYPTO_CHACHA20_X86_64) += chacha-x86_64.o chacha-x86_64-y := chacha-avx2-x86_64.o chacha-ssse3-x86_64.o chacha_glue.o chacha-x86_64-$(CONFIG_AS_AVX512) += chacha-avx512vl-x86_64.o -obj-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o -aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o --aesni-intel-$(CONFIG_64BIT) += aes_ctrby8_avx-x86_64.o \ -- aes-gcm-aesni-x86_64.o \ -- aes-xts-avx-x86_64.o --ifeq ($(CONFIG_AS_VAES)$(CONFIG_AS_VPCLMULQDQ),yy) --aesni-intel-$(CONFIG_64BIT) += aes-gcm-avx10-x86_64.o --endif +-aesni-intel-$(CONFIG_64BIT) += aesni-intel_avx-x86_64.o aes_ctrby8_avx-x86_64.o - obj-$(CONFIG_CRYPTO_SHA1_SSSE3) += sha1-ssse3.o sha1-ssse3-y := sha1_avx2_x86_64_asm.o sha1_ssse3_asm.o sha1_ssse3_glue.o sha1-ssse3-$(CONFIG_AS_SHA1_NI) += sha1_ni_asm.o - --obj-$(CONFIG_CRYPTO_SHA256_SSSE3) += sha256-ssse3.o --sha256-ssse3-y := sha256-ssse3-asm.o sha256-avx-asm.o sha256-avx2-asm.o sha256_ssse3_glue.o --sha256-ssse3-$(CONFIG_AS_SHA256_NI) += sha256_ni_asm.o -- --obj-$(CONFIG_CRYPTO_SHA512_SSSE3) += sha512-ssse3.o --sha512-ssse3-y := sha512-ssse3-asm.o sha512-avx-asm.o sha512-avx2-asm.o sha512_ssse3_glue.o -- - obj-$(CONFIG_CRYPTO_BLAKE2S_X86) += libblake2s-x86_64.o - libblake2s-x86_64-y := blake2s-core.o blake2s-glue.o - --obj-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o --ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o -- - obj-$(CONFIG_CRYPTO_POLYVAL_CLMUL_NI) += polyval-clmulni.o - polyval-clmulni-y := polyval-clmulni_asm.o polyval-clmulni_glue.o - diff --git a/crypto/Makefile b/crypto/Makefile -index af6614b46..8db12b3b5 100644 +index 515ca3a4c..851fbc4fb 100644 --- a/crypto/Makefile +++ b/crypto/Makefile -@@ -17,7 +17,6 @@ crypto_algapi-y := algapi.o scatterwalk.o $(crypto_algapi-y) +@@ -18,10 +18,8 @@ crypto_algapi-y := algapi.o scatterwalk.o $(crypto_algapi-y) obj-$(CONFIG_CRYPTO_ALGAPI2) += crypto_algapi.o obj-$(CONFIG_CRYPTO_AEAD2) += aead.o --obj-$(CONFIG_CRYPTO_GENIV) += geniv.o - - crypto_skcipher-y += lskcipher.o - crypto_skcipher-y += skcipher.o -@@ -27,7 +26,6 @@ ifeq ($(CONFIG_BPF_SYSCALL),y) - obj-$(CONFIG_CRYPTO_SKCIPHER2) += bpf_crypto_skcipher.o - endif +-obj-$(CONFIG_CRYPTO_AEAD2) += geniv.o + obj-$(CONFIG_CRYPTO_SKCIPHER2) += skcipher.o -obj-$(CONFIG_CRYPTO_SEQIV) += seqiv.o obj-$(CONFIG_CRYPTO_ECHAINIV) += echainiv.o crypto_hash-y += ahash.o -@@ -51,13 +49,14 @@ rsa_generic-y += rsaprivkey.asn1.o +@@ -44,7 +42,6 @@ rsa_generic-y += rsaprivkey.asn1.o rsa_generic-y += rsa.o rsa_generic-y += rsa_helper.o rsa_generic-y += rsa-pkcs1pad.o -obj-$(CONFIG_CRYPTO_RSA) += rsa_generic.o -+$(obj)/rsa-pkcs1pad_crypt.o: $(srctree)/crypto/rsa-pkcs1pad.c FORCE -+ $(call if_changed_rule,cc_o_c) -+obj-$(CONFIG_CRYPTO_RSA) += rsa-pkcs1pad_crypt.o + + $(obj)/sm2signature.asn1.o: $(obj)/sm2signature.asn1.c $(obj)/sm2signature.asn1.h + $(obj)/sm2.o: $(obj)/sm2signature.asn1.h +@@ -53,13 +50,11 @@ sm2_generic-y += sm2signature.asn1.o + sm2_generic-y += sm2.o + + obj-$(CONFIG_CRYPTO_SM2) += sm2_generic.o +-obj-$(CONFIG_CRYPTO_SELF_TEST) += crypto_self_test.o $(obj)/ecdsasignature.asn1.o: $(obj)/ecdsasignature.asn1.c $(obj)/ecdsasignature.asn1.h $(obj)/ecdsa.o: $(obj)/ecdsasignature.asn1.h @@ -95,32 +72,36 @@ index af6614b46..8db12b3b5 100644 crypto_acompress-y := acompress.o crypto_acompress-y += scompress.o -@@ -65,10 +64,7 @@ obj-$(CONFIG_CRYPTO_ACOMP2) += crypto_acompress.o +@@ -67,22 +62,15 @@ obj-$(CONFIG_CRYPTO_ACOMP2) += crypto_acompress.o cryptomgr-y := algboss.o testmgr.o -obj-$(CONFIG_CRYPTO_MANAGER2) += cryptomgr.o obj-$(CONFIG_CRYPTO_USER) += crypto_user.o + crypto_user-y := crypto_user_base.o + crypto_user-$(CONFIG_CRYPTO_STATS) += crypto_user_stat.o -obj-$(CONFIG_CRYPTO_CMAC) += cmac.o -obj-$(CONFIG_CRYPTO_HMAC) += hmac.o obj-$(CONFIG_CRYPTO_VMAC) += vmac.o obj-$(CONFIG_CRYPTO_XCBC) += xcbc.o obj-$(CONFIG_CRYPTO_NULL2) += crypto_null.o -@@ -76,9 +72,6 @@ obj-$(CONFIG_CRYPTO_MD4) += md4.o + obj-$(CONFIG_CRYPTO_MD4) += md4.o obj-$(CONFIG_CRYPTO_MD5) += md5.o obj-$(CONFIG_CRYPTO_RMD160) += rmd160.o - obj-$(CONFIG_CRYPTO_SHA1) += sha1_generic.o +-obj-$(CONFIG_CRYPTO_SHA1) += sha1_generic.o -obj-$(CONFIG_CRYPTO_SHA256) += sha256_generic.o -obj-$(CONFIG_CRYPTO_SHA512) += sha512_generic.o -obj-$(CONFIG_CRYPTO_SHA3) += sha3_generic.o obj-$(CONFIG_CRYPTO_SM3) += sm3.o obj-$(CONFIG_CRYPTO_SM3_GENERIC) += sm3_generic.o obj-$(CONFIG_CRYPTO_STREEBOG) += streebog_generic.o -@@ -87,19 +80,16 @@ CFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns) # https://gcc.gnu.org/b +@@ -91,21 +79,13 @@ CFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns) # https://gcc.gnu.org/b obj-$(CONFIG_CRYPTO_BLAKE2B) += blake2b_generic.o CFLAGS_blake2b_generic.o := -Wframe-larger-than=4096 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105930 - obj-$(CONFIG_CRYPTO_ECB) += ecb.o + obj-$(CONFIG_CRYPTO_GF128MUL) += gf128mul.o +-obj-$(CONFIG_CRYPTO_ECB) += ecb.o -obj-$(CONFIG_CRYPTO_CBC) += cbc.o +-obj-$(CONFIG_CRYPTO_CFB) += cfb.o obj-$(CONFIG_CRYPTO_PCBC) += pcbc.o -obj-$(CONFIG_CRYPTO_CTS) += cts.o obj-$(CONFIG_CRYPTO_LRW) += lrw.o @@ -133,13 +114,10 @@ index af6614b46..8db12b3b5 100644 obj-$(CONFIG_CRYPTO_NHPOLY1305) += nhpoly1305.o -obj-$(CONFIG_CRYPTO_GCM) += gcm.o -obj-$(CONFIG_CRYPTO_CCM) += ccm.o -+$(obj)/gcm_rfc4543.o: $(srctree)/crypto/gcm.c FORCE -+ $(call if_changed_rule,cc_o_c) -+obj-$(CONFIG_CRYPTO_GCM) += gcm_rfc4543.o obj-$(CONFIG_CRYPTO_CHACHA20POLY1305) += chacha20poly1305.o obj-$(CONFIG_CRYPTO_AEGIS128) += aegis128.o aegis128-y := aegis128-core.o -@@ -134,7 +124,6 @@ obj-$(CONFIG_CRYPTO_TWOFISH) += twofish_generic.o +@@ -140,7 +120,6 @@ obj-$(CONFIG_CRYPTO_TWOFISH) += twofish_generic.o obj-$(CONFIG_CRYPTO_TWOFISH_COMMON) += twofish_common.o obj-$(CONFIG_CRYPTO_SERPENT) += serpent_generic.o CFLAGS_serpent_generic.o := $(call cc-option,-fsched-pressure) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149 @@ -147,38 +125,40 @@ index af6614b46..8db12b3b5 100644 CFLAGS_aes_generic.o := $(call cc-option,-fno-code-hoisting) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83356 obj-$(CONFIG_CRYPTO_SM4) += sm4.o obj-$(CONFIG_CRYPTO_SM4_GENERIC) += sm4_generic.o -@@ -165,10 +154,8 @@ obj-$(CONFIG_CRYPTO_XXHASH) += xxhash_generic.o +@@ -171,12 +150,10 @@ obj-$(CONFIG_CRYPTO_XXHASH) += xxhash_generic.o obj-$(CONFIG_CRYPTO_842) += 842.o obj-$(CONFIG_CRYPTO_RNG2) += rng.o obj-$(CONFIG_CRYPTO_ANSI_CPRNG) += ansi_cprng.o -obj-$(CONFIG_CRYPTO_DRBG) += drbg.o - obj-$(CONFIG_CRYPTO_JITTERENTROPY_TESTINTERFACE) += jitterentropy-testing.o + CFLAGS_jitterentropy.o = -O0 + KASAN_SANITIZE_jitterentropy.o = n + UBSAN_SANITIZE_jitterentropy.o = n obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o -obj-$(CONFIG_CRYPTO_GHASH) += ghash-generic.o obj-$(CONFIG_CRYPTO_POLYVAL) += polyval-generic.o obj-$(CONFIG_CRYPTO_USER_API) += af_alg.o obj-$(CONFIG_CRYPTO_USER_API_HASH) += algif_hash.o -@@ -176,7 +163,6 @@ obj-$(CONFIG_CRYPTO_USER_API_SKCIPHER) += algif_skcipher.o - obj-$(CONFIG_CRYPTO_USER_API_RNG) += algif_rng.o +@@ -185,7 +162,6 @@ obj-$(CONFIG_CRYPTO_USER_API_RNG) += algif_rng.o obj-$(CONFIG_CRYPTO_USER_API_AEAD) += algif_aead.o obj-$(CONFIG_CRYPTO_ZSTD) += zstd.o + obj-$(CONFIG_CRYPTO_OFB) += ofb.o -obj-$(CONFIG_CRYPTO_ECC) += ecc.o obj-$(CONFIG_CRYPTO_ESSIV) += essiv.o obj-$(CONFIG_CRYPTO_CURVE25519) += curve25519-generic.o - -@@ -187,7 +173,6 @@ endif - + +@@ -192,7 +168,6 @@ obj-$(CONFIG_CRYPTO_USER_API_RNG) += algif_rng.o + ecdh_generic-y += ecdh.o ecdh_generic-y += ecdh_helper.o -obj-$(CONFIG_CRYPTO_ECDH) += ecdh_generic.o - + $(obj)/ecrdsa_params.asn1.o: $(obj)/ecrdsa_params.asn1.c $(obj)/ecrdsa_params.asn1.h $(obj)/ecrdsa_pub_key.asn1.o: $(obj)/ecrdsa_pub_key.asn1.c $(obj)/ecrdsa_pub_key.asn1.h -@@ -206,3 +191,113 @@ obj-$(CONFIG_CRYPTO_SIMD) += crypto_simd.o +@@ -215,3 +190,98 @@ obj-$(CONFIG_CRYPTO_SIMD) += crypto_simd.o # Key derivation function # obj-$(CONFIG_CRYPTO_KDF800108_CTR) += kdf_sp800108.o -+obj-$(CONFIG_CRYPTO_FIPS) += fips_canister_wrapper.o fips_canister.o ++obj-$(CONFIG_CRYPTO_FIPS) += fips_canister_wrapper_asm.o fips_canister_wrapper.o fips_canister.o +obj-$(CONFIG_CRYPTO_FIPS) += fips_canister_wrapper_internal.o + +ifdef CONFIG_CRYPTO_FIPS @@ -191,9 +171,6 @@ index af6614b46..8db12b3b5 100644 +ifneq ($(subst Y,y,$(CONFIG_CRYPTO_AEAD2)),y) + $(error FIPS canister requires CONFIG_CRYPTO_AEAD2=y) +endif -+ifneq ($(subst Y,y,$(CONFIG_CRYPTO_GENIV)),y) -+ $(error FIPS canister requires CONFIG_CRYPTO_GENIV=y) -+endif +ifneq ($(subst Y,y,$(CONFIG_CRYPTO_SEQIV)),y) + $(error FIPS canister requires CONFIG_CRYPTO_SEQIV=y) +endif @@ -221,6 +198,9 @@ index af6614b46..8db12b3b5 100644 +ifneq ($(subst Y,y,$(CONFIG_CRYPTO_AES)),y) + $(error FIPS canister requires CONFIG_CRYPTO_AES=y) +endif ++ifneq ($(subst Y,y,$(CONFIG_CRYPTO_ECB)),y) ++ $(error FIPS canister requires CONFIG_CRYPTO_ECB=y) ++endif +ifneq ($(subst Y,y,$(CONFIG_CRYPTO_CBC)),y) + $(error FIPS canister requires CONFIG_CRYPTO_CBC=y) +endif @@ -248,14 +228,8 @@ index af6614b46..8db12b3b5 100644 +ifneq ($(subst Y,y,$(CONFIG_CRYPTO_AES_NI_INTEL)),y) + $(error FIPS canister requires CONFIG_CRYPTO_AES_NI_INTEL=y) +endif -+ifneq ($(subst Y,y,$(CONFIG_CRYPTO_SHA256_SSSE3)),y) -+ $(error FIPS canister requires CONFIG_CRYPTO_SHA256_SSSE3=y) -+endif -+ifneq ($(subst Y,y,$(CONFIG_CRYPTO_SHA512_SSSE3)),y) -+ $(error FIPS canister requires CONFIG_CRYPTO_SHA512_SSSE3=y) -+endif -+ifneq ($(subst Y,y,$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL)),y) -+ $(error FIPS canister requires CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=y) ++ifneq ($(subst Y,y,$(CONFIG_CRYPTO_CFB)),y) ++ $(error FIPS canister requires CONFIG_CRYPTO_CFB=y) +endif +ifneq ($(subst Y,y,$(CONFIG_CRYPTO_CMAC)),y) + $(error FIPS canister requires CONFIG_CRYPTO_CMAC=y) @@ -278,39 +252,30 @@ index af6614b46..8db12b3b5 100644 +ifneq ($(subst Y,y,$(CONFIG_CRYPTO_GHASH)),y) + $(error FIPS canister requires CONFIG_CRYPTO_GHASH=y) +endif -+ifneq ($(subst Y,y,$(CONFIG_AS_VAES)),y) -+ $(error FIPS canister requires CONFIG_AS_VAES=y) -+endif -+ifneq ($(subst Y,y,$(CONFIG_AS_VPCLMULQDQ)),y) -+ $(error FIPS canister requires CONFIG_AS_VPCLMULQDQ=y) -+endif -+ifneq ($(subst Y,y,$(CONFIG_AS_SHA256_NI)),y) -+ $(error FIPS canister requires CONFIG_AS_SHA256_NI=y) -+endif +endif diff --git a/init/main.c b/init/main.c -index 821df1f05..a21314038 100644 +index fe378351e..962edcc54 100644 --- a/init/main.c +++ b/init/main.c -@@ -855,6 +855,8 @@ static int __init early_randomize_kstack_offset(char *buf) +@@ -882,6 +882,8 @@ static int __init early_randomize_kstack_offset(char *buf) early_param("randomize_kstack_offset", early_randomize_kstack_offset); #endif +extern int fips_integrity_init(void); + - static void __init print_unknown_bootoptions(void) + void __init __weak arch_call_rest_init(void) { - char *unknown_options; -@@ -965,6 +967,7 @@ void start_kernel(void) + rest_init(); +@@ -983,6 +985,7 @@ asmlinkage __visible void __init __no_sanitize_address start_kernel(void) /* Architectural and non-timekeeping rng init, before allocator init */ random_init_early(command_line); + fips_integrity_init(); /* * These use large bootmem allocations and must precede - * initalization of page allocator + * kmem_cache_init() diff --git a/lib/crypto/Makefile b/lib/crypto/Makefile -index 1874bff84..a7ca23657 100644 +index c852f067a..33d229c6d 100644 --- a/lib/crypto/Makefile +++ b/lib/crypto/Makefile @@ -7,9 +7,6 @@ libcryptoutils-y := memneq.o utils.o @@ -320,10 +285,10 @@ index 1874bff84..a7ca23657 100644 -obj-$(CONFIG_CRYPTO_LIB_AES) += libaes.o -libaes-y := aes.o - - obj-$(CONFIG_CRYPTO_LIB_AESCFB) += libaescfb.o - libaescfb-y := aescfb.o + obj-$(CONFIG_CRYPTO_LIB_ARC4) += libarc4.o + libarc4-y := arc4.o -@@ -49,11 +46,8 @@ libpoly1305-y := poly1305-donna32.o +@@ -37,12 +34,6 @@ libpoly1305-y := poly1305-donna32.o libpoly1305-$(CONFIG_ARCH_SUPPORTS_INT128) := poly1305-donna64.o libpoly1305-y += poly1305.o @@ -332,11 +297,9 @@ index 1874bff84..a7ca23657 100644 - -obj-$(CONFIG_CRYPTO_LIB_SHA256) += libsha256.o -libsha256-y := sha256.o -+obj-$(CONFIG_CRYPTO_LIB_SHA1) += libsha1.o -+libsha1-y := sha1.o - +- ifneq ($(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS),y) libblake2s-y += blake2s-selftest.o + libchacha20poly1305-y += chacha20poly1305-selftest.o -- -2.40.4 - +2.43.0 diff --git a/SPECS/90/linux/canister_builder/patches/0001-Handle-approved-and-non-approved-services.patch b/SPECS/linux/6.1/canister_builder/patches/0001-Handle-approved-and-non-approved-services.patch similarity index 100% rename from SPECS/90/linux/canister_builder/patches/0001-Handle-approved-and-non-approved-services.patch rename to SPECS/linux/6.1/canister_builder/patches/0001-Handle-approved-and-non-approved-services.patch diff --git a/SPECS/90/linux/canister_builder/patches/0001-List-canister-objs-in-a-file.patch b/SPECS/linux/6.1/canister_builder/patches/0001-List-canister-objs-in-a-file.patch similarity index 100% rename from SPECS/90/linux/canister_builder/patches/0001-List-canister-objs-in-a-file.patch rename to SPECS/linux/6.1/canister_builder/patches/0001-List-canister-objs-in-a-file.patch diff --git a/SPECS/90/linux/canister_builder/patches/0002-FIPS-canister-creation.patch b/SPECS/linux/6.1/canister_builder/patches/0002-FIPS-canister-creation.patch similarity index 100% rename from SPECS/90/linux/canister_builder/patches/0002-FIPS-canister-creation.patch rename to SPECS/linux/6.1/canister_builder/patches/0002-FIPS-canister-creation.patch diff --git a/SPECS/90/linux/canister_builder/patches/0003-aesni_intel-Remove-static-call.patch b/SPECS/linux/6.1/canister_builder/patches/0003-aesni_intel-Remove-static-call.patch similarity index 100% rename from SPECS/90/linux/canister_builder/patches/0003-aesni_intel-Remove-static-call.patch rename to SPECS/linux/6.1/canister_builder/patches/0003-aesni_intel-Remove-static-call.patch diff --git a/SPECS/90/linux/canister_builder/patches/0004-Disable-retpoline_sites-and-return_sites-section-in-.patch b/SPECS/linux/6.1/canister_builder/patches/0004-Disable-retpoline_sites-and-return_sites-section-in-.patch similarity index 100% rename from SPECS/90/linux/canister_builder/patches/0004-Disable-retpoline_sites-and-return_sites-section-in-.patch rename to SPECS/linux/6.1/canister_builder/patches/0004-Disable-retpoline_sites-and-return_sites-section-in-.patch diff --git a/SPECS/90/linux/canister_builder/patches/0005-Move-__bug_table-section-to-fips_canister_wrapper.patch b/SPECS/linux/6.1/canister_builder/patches/0005-Move-__bug_table-section-to-fips_canister_wrapper.patch similarity index 100% rename from SPECS/90/linux/canister_builder/patches/0005-Move-__bug_table-section-to-fips_canister_wrapper.patch rename to SPECS/linux/6.1/canister_builder/patches/0005-Move-__bug_table-section-to-fips_canister_wrapper.patch diff --git a/SPECS/90/linux/canister_builder/patches/0006-crypto-Add-prandom-module_kthread_exit-to-canister-w.patch b/SPECS/linux/6.1/canister_builder/patches/0006-crypto-Add-prandom-module_kthread_exit-to-canister-w.patch similarity index 100% rename from SPECS/90/linux/canister_builder/patches/0006-crypto-Add-prandom-module_kthread_exit-to-canister-w.patch rename to SPECS/linux/6.1/canister_builder/patches/0006-crypto-Add-prandom-module_kthread_exit-to-canister-w.patch diff --git a/SPECS/90/linux/canister_builder/patches/0007-crypto-Remove-EXPORT_SYMBOL-EXPORT_SYMBOL_GPL-from-c.patch b/SPECS/linux/6.1/canister_builder/patches/0007-crypto-Remove-EXPORT_SYMBOL-EXPORT_SYMBOL_GPL-from-c.patch similarity index 100% rename from SPECS/90/linux/canister_builder/patches/0007-crypto-Remove-EXPORT_SYMBOL-EXPORT_SYMBOL_GPL-from-c.patch rename to SPECS/linux/6.1/canister_builder/patches/0007-crypto-Remove-EXPORT_SYMBOL-EXPORT_SYMBOL_GPL-from-c.patch diff --git a/SPECS/90/linux/canister_builder/patches/0008-Move-kernel-structures-usage.patch b/SPECS/linux/6.1/canister_builder/patches/0008-Move-kernel-structures-usage.patch similarity index 100% rename from SPECS/90/linux/canister_builder/patches/0008-Move-kernel-structures-usage.patch rename to SPECS/linux/6.1/canister_builder/patches/0008-Move-kernel-structures-usage.patch diff --git a/SPECS/90/linux/canister_builder/patches/0009-ecc-Add-pairwise-consistency-test-for-every-generate.patch b/SPECS/linux/6.1/canister_builder/patches/0009-ecc-Add-pairwise-consistency-test-for-every-generate.patch similarity index 100% rename from SPECS/90/linux/canister_builder/patches/0009-ecc-Add-pairwise-consistency-test-for-every-generate.patch rename to SPECS/linux/6.1/canister_builder/patches/0009-ecc-Add-pairwise-consistency-test-for-every-generate.patch diff --git a/SPECS/linux/6.1/canister_struct_comparator/canister_known_struct_def_vmlinux/crypto_alg.txt b/SPECS/linux/6.1/canister_struct_comparator/canister_known_struct_def_vmlinux/crypto_alg.txt new file mode 100644 index 0000000000..402dd4e8d7 --- /dev/null +++ b/SPECS/linux/6.1/canister_struct_comparator/canister_known_struct_def_vmlinux/crypto_alg.txt @@ -0,0 +1,27 @@ +struct crypto_alg { + struct list_head cra_list; /* 0 16 */ + struct list_head cra_users; /* 16 16 */ + u32 cra_flags; /* 32 4 */ + unsigned int cra_blocksize; /* 36 4 */ + unsigned int cra_ctxsize; /* 40 4 */ + unsigned int cra_alignmask; /* 44 4 */ + int cra_priority; /* 48 4 */ + refcount_t cra_refcnt; /* 52 4 */ + char cra_name[128]; /* 56 128 */ + /* --- cacheline 2 boundary (128 bytes) was 56 bytes ago --- */ + char cra_driver_name[128]; /* 184 128 */ + /* --- cacheline 4 boundary (256 bytes) was 56 bytes ago --- */ + const struct crypto_type * cra_type; /* 312 8 */ + /* --- cacheline 5 boundary (320 bytes) --- */ + union { + struct cipher_alg cipher; /* 320 32 */ + struct compress_alg compress; /* 320 16 */ + } cra_u; /* 320 32 */ + int (*cra_init)(struct crypto_tfm *); /* 352 8 */ + void (*cra_exit)(struct crypto_tfm *); /* 360 8 */ + void (*cra_destroy)(struct crypto_alg *); /* 368 8 */ + struct module * cra_module; /* 376 8 */ + + /* size: 384, cachelines: 6, members: 16 */ +} __attribute__((__aligned__(8))); /* size: 384 */ + diff --git a/SPECS/linux/6.1/canister_struct_comparator/canister_known_struct_def_vmlinux/crypto_template.txt b/SPECS/linux/6.1/canister_struct_comparator/canister_known_struct_def_vmlinux/crypto_template.txt new file mode 100644 index 0000000000..f2e0203b12 --- /dev/null +++ b/SPECS/linux/6.1/canister_struct_comparator/canister_known_struct_def_vmlinux/crypto_template.txt @@ -0,0 +1,11 @@ +struct crypto_template { + struct list_head list; /* 0 16 */ + struct hlist_head instances; /* 16 8 */ + struct module * module; /* 24 8 */ + int (*create)(struct crypto_template *, struct rtattr * *); /* 32 8 */ + char name[128]; /* 40 128 */ + + /* size: 168, cachelines: 3, members: 5 */ + /* last cacheline: 40 bytes */ +}; /* size: 168 */ + diff --git a/SPECS/linux/6.1/canister_struct_comparator/canister_known_struct_def_vmlinux/skcipher_walk.txt b/SPECS/linux/6.1/canister_struct_comparator/canister_known_struct_def_vmlinux/skcipher_walk.txt new file mode 100644 index 0000000000..625e1b3e3a --- /dev/null +++ b/SPECS/linux/6.1/canister_struct_comparator/canister_known_struct_def_vmlinux/skcipher_walk.txt @@ -0,0 +1,57 @@ +struct skcipher_walk { + union { + struct { + struct page * page; /* 0 8 */ + long unsigned int offset; /* 8 8 */ + } phys; /* 0 16 */ + struct { + u8 * page; /* 0 8 */ + void * addr; /* 8 8 */ + } virt; /* 0 16 */ + } src; /* 0 16 */ + union { + struct { + struct page * page; /* 16 8 */ + long unsigned int offset; /* 24 8 */ + } phys; /* 16 16 */ + struct { + u8 * page; /* 16 8 */ + void * addr; /* 24 8 */ + } virt; /* 16 16 */ + } dst; /* 16 16 */ + struct scatter_walk in; /* 32 16 */ + + /* XXX last struct has 4 bytes of padding */ + + unsigned int nbytes; /* 48 4 */ + + /* XXX 4 bytes hole, try to pack */ + + struct scatter_walk out; /* 56 16 */ + + /* XXX last struct has 4 bytes of padding */ + + /* --- cacheline 1 boundary (64 bytes) was 8 bytes ago --- */ + unsigned int total; /* 72 4 */ + + /* XXX 4 bytes hole, try to pack */ + + struct list_head buffers; /* 80 16 */ + u8 * page; /* 96 8 */ + u8 * buffer; /* 104 8 */ + u8 * oiv; /* 112 8 */ + void * iv; /* 120 8 */ + /* --- cacheline 2 boundary (128 bytes) --- */ + unsigned int ivsize; /* 128 4 */ + int flags; /* 132 4 */ + unsigned int blocksize; /* 136 4 */ + unsigned int stride; /* 140 4 */ + unsigned int alignmask; /* 144 4 */ + + /* size: 152, cachelines: 3, members: 16 */ + /* sum members: 140, holes: 2, sum holes: 8 */ + /* padding: 4 */ + /* paddings: 2, sum paddings: 8 */ + /* last cacheline: 24 bytes */ +}; /* size: 152 */ + diff --git a/SPECS/linux/6.1/canister_struct_comparator/canister_known_struct_def_vmlinux/swait_queue_head.txt b/SPECS/linux/6.1/canister_struct_comparator/canister_known_struct_def_vmlinux/swait_queue_head.txt new file mode 100644 index 0000000000..9be0362e0f --- /dev/null +++ b/SPECS/linux/6.1/canister_struct_comparator/canister_known_struct_def_vmlinux/swait_queue_head.txt @@ -0,0 +1,12 @@ +struct swait_queue_head { + raw_spinlock_t lock; /* 0 4 */ + + /* XXX 4 bytes hole, try to pack */ + + struct list_head task_list; /* 8 16 */ + + /* size: 24, cachelines: 1, members: 2 */ + /* sum members: 20, holes: 1, sum holes: 4 */ + /* last cacheline: 24 bytes */ +}; /* size: 24 */ + diff --git a/SPECS/linux/6.1/canister_struct_comparator/canister_known_struct_def_vmlinux/x86_cpu_id.txt b/SPECS/linux/6.1/canister_struct_comparator/canister_known_struct_def_vmlinux/x86_cpu_id.txt new file mode 100644 index 0000000000..6f553e6390 --- /dev/null +++ b/SPECS/linux/6.1/canister_struct_comparator/canister_known_struct_def_vmlinux/x86_cpu_id.txt @@ -0,0 +1,17 @@ +struct x86_cpu_id { + __u16 vendor; /* 0 2 */ + __u16 family; /* 2 2 */ + __u16 model; /* 4 2 */ + __u16 steppings; /* 6 2 */ + __u16 feature; /* 8 2 */ + __u16 flags; /* 10 2 */ + + /* XXX 4 bytes hole, try to pack */ + + kernel_ulong_t driver_data; /* 16 8 */ + + /* size: 24, cachelines: 1, members: 7 */ + /* sum members: 20, holes: 1, sum holes: 4 */ + /* last cacheline: 24 bytes */ +}; /* size: 24 */ + diff --git a/SPECS/linux/6.1/canister_struct_comparator/struct-comparator.c b/SPECS/linux/6.1/canister_struct_comparator/struct-comparator.c new file mode 100644 index 0000000000..e1f5b1f690 --- /dev/null +++ b/SPECS/linux/6.1/canister_struct_comparator/struct-comparator.c @@ -0,0 +1,346 @@ +/* vim: set ts=2 sw=2 sts=2 et: */ + +/* Copyright (C) 2024, Broadcom, Inc. */ + +/* + * How to build: + * tdnf install -y build-essential dwarves-devel elfutils-devel + * gcc -Wall -Werror -o struct_comparator struct-comparator.c -ldwarves + */ + +#include +#include +#include +#include + +#include +#include +#include + +#define LINE_SZ 1024 + +#define pr_err(fmt, ...) fprintf(stderr, "ERROR: " fmt, ##__VA_ARGS__) +#define pr_info(fmt, ...) printf("INFO: " fmt, ##__VA_ARGS__) +#define pr_crit(fmt, ...) printf("CRITICAL: " fmt, ##__VA_ARGS__) + +int rc; +LIST_HEAD(fips_head); +char knwn_vmlinux_def_dir[1024]; + +struct struct_def { + char name[1024]; + char *def; + struct list_head list_entry; +}; + +struct conf_fprintf conf = { + .emit_stats = 1, +}; + +static void free_struct_def(struct struct_def *s_def) +{ + free(s_def->def); + free(s_def); +} + +/* Check if this definition matches one that we know we are safe to ignore */ +static int matches_knwn_vmlinux_def(const struct struct_def *s_def) +{ + bool ret = false; + FILE *knwn_fp; + char *tmp = NULL; + char *known_def = NULL; + int new_size = 0; + char filename[PATH_MAX] = {}; + char line[LINE_SZ] = {}; + + /* Definitions should be stored in files in the form: .txt */ + snprintf(filename, sizeof(filename), "%s/%s.txt", knwn_vmlinux_def_dir, + s_def->name); + knwn_fp = fopen(filename, "r"); + if (!knwn_fp) { + pr_err("fopen: '%s' (%s)\n", filename, strerror(errno)); + return ret; + } + + while (fgets(line, sizeof(line), knwn_fp) != NULL) { + int line_sz = strlen(line); + new_size += line_sz; + + tmp = realloc(known_def, new_size + 1); + if (!tmp) { + free(known_def); + fclose(knwn_fp); + return ret; + } + + known_def = tmp; + + strncpy(known_def + (new_size - line_sz), line, line_sz); + known_def[new_size] = '\0'; + } + + fclose(knwn_fp); + + ret = strcmp(known_def, s_def->def) == 0; + free(known_def); + return ret; +} + +/* Compare the vmlinux definition against the FIPS list */ +static int fips_vmlinux_comp(const struct struct_def *vmlinux_def) +{ + struct struct_def *entry, *n; + + list_for_each_entry_safe(entry, n, &fips_head, list_entry) { + /* If name matches, compare the definitions */ + if (strcmp(entry->name, vmlinux_def->name) != 0) + continue; + if (strcmp(entry->def, vmlinux_def->def) == 0) + continue; + + if (matches_knwn_vmlinux_def(vmlinux_def)) + return 0; + + pr_err("struct %s doesn't match between vmlinux and fips canister\n" + "************************************************************\n" + "FIPS Definition:\n%s\n" + "vmlinux definition:\n%s\n" + "***********************************************************\n\n", + entry->name, entry->def, vmlinux_def->def); + + /* Remove from FIPS list, so we don't check/print again */ + list_del(&entry->list_entry); + free_struct_def(entry); + return -1; + } + + return 0; +} + +/* Add a struct_def to the list of FIPS definitions */ +static void add_to_fips_list(struct struct_def *s_def) +{ + /* + * Check if this definition is either brand new, or is + * different from any existing definitions for this struct. + * FIPS canister will likely have the same struct defined + * multiple places in the debuginfo, but we should only keep + * unique definitions... Probably there should be only 1 unique + * but in vmlinux at least, there can be multiple different definitions. + */ + struct struct_def *entry; + bool is_unique = true; + + list_for_each_entry(entry, &fips_head, list_entry) { + if (strcmp(entry->name, s_def->name) != 0) + continue; + + if (strcmp(entry->def, s_def->def) == 0) { + /* Matched an existing def in the list, not unique */ + is_unique = false; + break; + } + } + + if (is_unique) + list_add(&s_def->list_entry, &fips_head); + else + free_struct_def(s_def); +} + +static void free_struct_def_list(struct list_head *list_head) +{ + struct struct_def *n = NULL; + struct struct_def *pos = NULL; + + list_for_each_entry_safe(pos, n, list_head, list_entry) { + list_del(&pos->list_entry); + free_struct_def(pos); + } +} + +static void emit_tag(struct tag *tag, uint32_t tag_id, struct cu *cu, + bool do_compare) +{ + bool name_in_fips_list = false; + FILE *tmp_fp = NULL; + struct struct_def *s_def = NULL; + const char *type_name = NULL; + struct struct_def *pos = NULL; + size_t buf_size; + struct type *type = &tag__class(tag)->type; + + if (tag__is_struct(tag)) { + /* Can't do comparison without a struct name! */ + type_name = type__name(type); + if (!type_name) + return; + + /* Skip comparison if size is 0 */ + if (!tag__size(tag, cu)) + return; + + /* Skip out if not in fips canister list */ + if (do_compare) { + list_for_each_entry(pos, &fips_head, list_entry) { + if (strcmp(pos->name, type_name) == 0) { + name_in_fips_list = true; + break; + } + } + + if (!name_in_fips_list) + return; + } + + s_def = calloc(sizeof(struct struct_def), 1); + if (!s_def) { + pr_err("Failed to allocate memory: %s", strerror(errno)); + free_struct_def_list(&fips_head); + exit(1); + } + + tmp_fp = open_memstream(&s_def->def, &buf_size); + if (!tmp_fp) { + pr_err("Can't open tmp file for writing!: %s\n", strerror(errno)); + free_struct_def_list(&fips_head); + exit(1); + } + + tag__fprintf(tag, cu, &conf, tmp_fp); + fprintf(tmp_fp, " /* size: %zd */\n\n", tag__size(tag, cu)); + + /* Save the definition */ + strncpy(s_def->name, type_name, sizeof(s_def->name)); + + fclose(tmp_fp); + + if (do_compare) { + if (fips_vmlinux_comp(s_def) < 0) + rc = -1; + free_struct_def(s_def); + } else { + add_to_fips_list(s_def); + } + } +} + +static int cu__emit_tags_fips(struct cu *cu) +{ + uint32_t i; + struct tag *tag; + + cu__for_each_type(cu, i, tag) { + emit_tag(tag, i, cu, false); + } + + return 0; +} + +static enum load_steal_kind fips_stealer(struct cu *cu, + struct conf_load *conf_load __maybe_unused, + void *thr_data __maybe_unused) +{ + cu__emit_tags_fips(cu); + return LSK__DELETE; +} + +struct conf_load fips_conf_load = { + .steal = fips_stealer, + .conf_fprintf = &conf, +}; + +static int cu__emit_tags_vmlinux(struct cu *cu) +{ + uint32_t i; + struct tag *tag; + + cu__for_each_type(cu, i, tag) { + emit_tag(tag, i, cu, true); + } + + return 0; +} + +static enum load_steal_kind vmlinux_stealer(struct cu *cu, + struct conf_load *conf_load __maybe_unused, + void *thr_data __maybe_unused) +{ + cu__emit_tags_vmlinux(cu); + return LSK__DELETE; +} + +struct conf_load vmlinux_conf_load = { + .steal = vmlinux_stealer, + .conf_fprintf = &conf, +}; + +int main(int argc, char **argv) +{ + struct cus *cus = NULL; + const char *fips_obj_path; + const char *vmlinux_path; + const char *vmlinux_dir; + + if (argc < 4) { + pr_err("Usage: Please provide all 3 arguments:\n" + "1. fips_canister.o path\n" + "2. vmlinux path\n" + "3. Path to dir holding known vmlinux definitions\n" + ); + return -1; + } + + fips_obj_path = argv[1]; + vmlinux_path = argv[2]; + vmlinux_dir = argv[3]; + + strncpy(knwn_vmlinux_def_dir, vmlinux_dir, sizeof(knwn_vmlinux_def_dir)); + + cus = cus__new(); + + /* Read canister first */ + if (dwarves__init() || cus == NULL) { + fputs("insufficient memory\n", stderr); + goto finish; + } + + dwarves__resolve_cacheline_size(&fips_conf_load, 0); + + if (cus__load_file(cus, &fips_conf_load, fips_obj_path) != 0) { + rc = -1; + goto finish; + } + + /* To be safe, start fresh when processing vmlinux */ + cus__delete(cus); + dwarves__exit(); + + /* Compare vmlinux structs to saved canister definitions */ + cus = cus__new(); + if (dwarves__init() || cus == NULL) { + fputs("insufficient memory\n", stderr); + goto finish; + } + + dwarves__resolve_cacheline_size(&vmlinux_conf_load, 0); + + if (cus__load_file(cus, &vmlinux_conf_load, vmlinux_path) != 0) + rc = -1; + +finish: + /* Free fips list */ + free_struct_def_list(&fips_head); + + cus__delete(cus); + dwarves__exit(); + + if (!rc) { + pr_info("PASS: Struct comparison done\n"); + } else { + pr_err("FAIL: Struct comparison did not go as expected\n"); + } + + return rc; +} diff --git a/SPECS/90/linux/confdata-format-change-for-split-script.patch b/SPECS/linux/6.1/confdata-format-change-for-split-script-6.1.patch similarity index 100% rename from SPECS/90/linux/confdata-format-change-for-split-script.patch rename to SPECS/linux/6.1/confdata-format-change-for-split-script-6.1.patch diff --git a/SPECS/90/linux/config-esx_aarch64 b/SPECS/linux/6.1/config-esx_aarch64-6.1 similarity index 100% rename from SPECS/90/linux/config-esx_aarch64 rename to SPECS/linux/6.1/config-esx_aarch64-6.1 diff --git a/SPECS/90/linux/config-esx_x86_64 b/SPECS/linux/6.1/config-esx_x86_64-6.1 similarity index 100% rename from SPECS/90/linux/config-esx_x86_64 rename to SPECS/linux/6.1/config-esx_x86_64-6.1 diff --git a/SPECS/90/linux/config_aarch64 b/SPECS/linux/6.1/config_aarch64-6.1 similarity index 100% rename from SPECS/90/linux/config_aarch64 rename to SPECS/linux/6.1/config_aarch64-6.1 diff --git a/SPECS/90/linux/config_x86_64 b/SPECS/linux/6.1/config_x86_64-6.1 similarity index 100% rename from SPECS/90/linux/config_x86_64 rename to SPECS/linux/6.1/config_x86_64-6.1 diff --git a/SPECS/90/linux/crypto/0001-Crypto-Tamper-KAT-PCT-and-Integrity-Test.patch b/SPECS/linux/6.1/crypto/0001-Crypto-Tamper-KAT-PCT-and-Integrity-Test-6.1.patch similarity index 100% rename from SPECS/90/linux/crypto/0001-Crypto-Tamper-KAT-PCT-and-Integrity-Test.patch rename to SPECS/linux/6.1/crypto/0001-Crypto-Tamper-KAT-PCT-and-Integrity-Test-6.1.patch diff --git a/SPECS/91/linux/fips_compliance/0001-FIPS-crypto-rng-Jitterentropy-RNG-as-the-only-RND-source.patch b/SPECS/linux/6.1/crypto/0001-FIPS-crypto-rng-Jitterentropy-RNG-as-the-only-RND-source-6.1.patch similarity index 77% rename from SPECS/91/linux/fips_compliance/0001-FIPS-crypto-rng-Jitterentropy-RNG-as-the-only-RND-source.patch rename to SPECS/linux/6.1/crypto/0001-FIPS-crypto-rng-Jitterentropy-RNG-as-the-only-RND-source-6.1.patch index 80a8878cf9..4e40183451 100644 --- a/SPECS/91/linux/fips_compliance/0001-FIPS-crypto-rng-Jitterentropy-RNG-as-the-only-RND-source.patch +++ b/SPECS/linux/6.1/crypto/0001-FIPS-crypto-rng-Jitterentropy-RNG-as-the-only-RND-source-6.1.patch @@ -1,4 +1,4 @@ -From 2d72b59683c85409ee1509e8d94d519f4f2f2fa6 Mon Sep 17 00:00:00 2001 +From 0dd719a950c776f212226690e429e80e53ab867a Mon Sep 17 00:00:00 2001 From: srinidhira0 Date: Mon, 1 Mar 2021 19:51:03 +0000 Subject: [PATCH] FIPS:crypto:rng: Jitterentropy RNG as the only RND source @@ -16,21 +16,18 @@ Jitter entropy rng can be accessed by any crypto module Signed-off-by: srinidhira0 Signed-off-by: Keerthana K - -[Srinidhi Rao Ported this patch to v6.12.y] -Signed-off-by: srinidhira0 --- - crypto/rng.c | 26 +++++++++++++++++++++++++- - 1 file changed, 25 insertions(+), 1 deletion(-) + crypto/rng.c | 27 +++++++++++++++++++++++++-- + 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/crypto/rng.c b/crypto/rng.c -index 9d8804e46422..7eb4c82c7fee 100644 +index a888d84b524a..a89aa226e172 100644 --- a/crypto/rng.c +++ b/crypto/rng.c @@ -19,6 +19,7 @@ - #include - #include #include + #include + #include +#include #include @@ -39,7 +36,7 @@ index 9d8804e46422..7eb4c82c7fee 100644 EXPORT_SYMBOL_GPL(crypto_default_rng); static int crypto_default_rng_refcnt; -+static int get_jent_random_bytes(u8 * buf, unsigned int slen) ++int get_jent_random_bytes(u8 * buf, unsigned int slen) +{ + struct crypto_rng *jitter_entropy = + crypto_alloc_rng("jitterentropy_rng", 0, 0); @@ -60,11 +57,12 @@ index 9d8804e46422..7eb4c82c7fee 100644 +} int crypto_rng_reset(struct crypto_rng *tfm, const u8 *seed, unsigned int slen) { - u8 *buf = NULL; -@@ -38,7 +58,11 @@ int crypto_rng_reset(struct crypto_rng *tfm, const u8 *seed, unsigned int slen) + struct crypto_alg *alg = tfm->base.__crt_alg; +@@ -58,8 +58,11 @@ int crypto_rng_reset(struct crypto_rng *tfm, const u8 *seed, unsigned int slen) + buf = kmalloc(slen, GFP_KERNEL); if (!buf) return -ENOMEM; - +- - err = get_random_bytes_wait(buf, slen); + if (fips_enabled) { + err = get_jent_random_bytes(buf, slen); @@ -75,5 +73,4 @@ index 9d8804e46422..7eb4c82c7fee 100644 goto out; seed = buf; -- -2.39.4 - +2.28.0 diff --git a/SPECS/linux/6.1/crypto/0001-Initialize-jitterentropy-before-ecdh.patch b/SPECS/linux/6.1/crypto/0001-Initialize-jitterentropy-before-ecdh.patch new file mode 100644 index 0000000000..87db69e770 --- /dev/null +++ b/SPECS/linux/6.1/crypto/0001-Initialize-jitterentropy-before-ecdh.patch @@ -0,0 +1,29 @@ +From 0f49406a5049bd0a3bbc7704bb58efc2b4117424 Mon Sep 17 00:00:00 2001 +From: Keerthana K +Date: Wed, 3 Feb 2021 13:33:34 +0000 +Subject: [PATCH] Initialize jitterentropy before ecdh + +ECDH uses jitterentropy for seed, so it must initialized +before ecdh for self tests to pass. + +--- + crypto/jitterentropy-kcapi.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/crypto/jitterentropy-kcapi.c b/crypto/jitterentropy-kcapi.c +index 68f62be..48d475e 100644 +--- a/crypto/jitterentropy-kcapi.c ++++ b/crypto/jitterentropy-kcapi.c +@@ -214,7 +214,8 @@ static void __exit jent_mod_exit(void) + crypto_unregister_rng(&jent_alg); + } + +-module_init(jent_mod_init); ++/* Must be initialized before tcrypt */ ++subsys_initcall(jent_mod_init); + module_exit(jent_mod_exit); + + MODULE_LICENSE("Dual BSD/GPL"); +-- +2.28.0 + diff --git a/SPECS/linux/6.1/crypto/0001-LKCM-5.0-binary-patching-to-fix-struct-aesni_cpu_id-.patch b/SPECS/linux/6.1/crypto/0001-LKCM-5.0-binary-patching-to-fix-struct-aesni_cpu_id-.patch new file mode 100644 index 0000000000..bfd60095c1 --- /dev/null +++ b/SPECS/linux/6.1/crypto/0001-LKCM-5.0-binary-patching-to-fix-struct-aesni_cpu_id-.patch @@ -0,0 +1,130 @@ +From 4aac32910a4ca9300b1a6dd7e13cbf189d481fab Mon Sep 17 00:00:00 2001 +From: Keerthana K +Date: Tue, 20 Aug 2024 15:29:10 +0000 +Subject: [PATCH] LKCM 5.0 binary patching to fix struct aesni_cpu_id mismatch + +x86_cpu_id structure in kernel v6.1.96 is changed. A new member flags +is added just before the last member driver_data. As part of this +change, the INTEL CPU detection code has also been modified to utilize +the flags member. If flags member is not set, then x86_match_cpu will +return NULL. It means the given CPU is not matched with the known array of +available x86_cpu_ids. + +commit: https://github.com/gregkh/linux/commit/8ab1361b2eae44077fef4a + +Problem: +aesni_intel-glue.c declares and populates aesni_cpu_id. This file is +part of fips_canister.o. So the new changes to struct x86_cpu_id will +not be available for aesni_intel-glue.c. + +Fix: +In order to make this work, we have to binary patch aesni_cpu_id value +at runtime. Size of 'aesni_cpu_id[0]' before the commit is 24 bytes +(actually 18 bytes but padded to make it 24 bytes). 6 bytes of padding +is added after 'feature' and before 'driver_data'. Size of +'aesni_cpu_id[0]' after the commit is also 24 bytes, as the flags member +is placed in the padded region. + +Fix here is to set the 2 bytes located after 'feature' member +in the padded region with value X86_CPU_ID_FLAG_ENTRY_VALID. +This will act as u16 flags member of aesni_cpu_id. + +aesni_cpu_id symbol is located in .rodata section at offset 0x3C0 in fips_canister.o +Logic is to locate the __canister_srodata symbol and add this offset to +reach aesni_cpu_id value and set 10th byte (first 5 u16 members) with +X86_CPU_ID_FLAG_ENTRY_VALID value. + +Memory dump of aesni_cpu_id before patching: + + 70740 ffff0000 00000000 99000000 00000000 ................ + 70750 00000000 00000000 00000000 00000000 ................ + 70760 00000000 00000000 00000000 00000000 ................ + +Memory dump of aesni_cpu_ud after patching: + + 70740 ffff0000 00000000 99000100 00000000 ................ + 70750 00000000 00000000 00000000 00000000 ................ + 70760 00000000 00000000 00000000 00000000 ................ + +Signed-off-by: Keerthana K +--- + init/main.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 56 insertions(+) + +diff --git a/init/main.c b/init/main.c +index 6df050a..283b6ab 100644 +--- a/init/main.c ++++ b/init/main.c +@@ -102,6 +102,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -992,6 +993,61 @@ asmlinkage __visible void __init __no_sanitize_address start_kernel(void) + random_init_early(command_line); + + fips_integrity_init(); ++ ++ if(boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && ++ boot_cpu_has(X86_FEATURE_AES)) { ++ u8 *s, *hmac, *start, *skip, *end, *pos, *aesni_val_pos; ++ u16 val = 0, flags_val = X86_CPU_ID_FLAG_ENTRY_VALID; ++ static struct x86_cpu_id aesni_cpu_id_value = X86_MATCH_FEATURE(X86_FEATURE_AES, NULL); ++ u8 canister_hmac[32] = ++ {'\xea', '\x46', '\x29', '\x44', '\x7a', '\xe1', '\x87', '\x00', ++ '\x5c', '\xa7', '\xa1', '\x2a', '\x75', '\x22', '\x0f', '\x28', ++ '\x3c', '\xde', '\x80', '\x1c', '\x16', '\x0a', '\xa6', '\xbf', ++ '\xc7', '\x4f', '\x63', '\xe9', '\xf9', '\x40', '\x91', '\x19'}; ++ ++ /* Check if the size of struct x86_cpu_id is same as expected size */ ++ BUG_ON (sizeof(aesni_cpu_id_value) != 24); ++ ++ /* Verify LKCM 5.0 signature before patching */ ++ hmac = (unsigned char *)kallsyms_lookup_name("canister_hmac"); ++ if (!hmac || memcmp (hmac, canister_hmac, 32)) { ++ pr_warn("LKCM 5.0 not found\n"); ++ goto quit; ++ } ++ /* Patch location: + 0x3c0 + 0xA */ ++ s = (u8 *)kallsyms_lookup_name("__canister_srodata"); ++ if (!s) { ++ pr_warn("LKCM 5.0 patching failed!" ++ "Symbol __canister_srodata not present\n"); ++ goto quit; ++ } ++ start = s + 0x3C0; // start of aesni_cpu_id structure value ++ skip = s + 0x3C0 + 0xA; // Location of flags member in the struct x86_cpu_id ++ end = s + 0x3C0 + 24; // End of aesni_cpu_id structure value ++ aesni_val_pos = (u8 *)&aesni_cpu_id_value; ++ ++ for (pos = start; pos < end; pos++, aesni_val_pos++) { ++ /* Skip checking 2 bytes that contains flags */ ++ if (pos == skip || pos == (skip+1)) ++ continue; ++ /* Check if all the bytes in aesni_cpu_id ++ * is same as aesni_cpu_id_value */ ++ BUG_ON (memcmp (pos, aesni_val_pos, 1)); ++ } ++ s = skip; ++ aesni_val_pos = (u8 *)&aesni_cpu_id_value + 0xA; ++ ++ /* Verify the bytes that is going to be replaced has value 0 */ ++ BUG_ON (memcmp(s, &val, 2)); ++ ++ /* Sanity check flags member 2 bytes */ ++ BUG_ON (memcmp(aesni_val_pos, &flags_val, 2)); ++ ++ memcpy(s, &flags_val, 2); // Copy 2 bytes of flags ++ pr_info("LKCM 5.0 was patched successfully\n"); ++ } ++ ++quit: + /* + * These use large bootmem allocations and must precede + * kmem_cache_init() +-- +2.19.0 + diff --git a/SPECS/linux/6.1/crypto/0001-Revert-crypto-api-Add-crypto_tfm_get.patch b/SPECS/linux/6.1/crypto/0001-Revert-crypto-api-Add-crypto_tfm_get.patch new file mode 100644 index 0000000000..554989ef55 --- /dev/null +++ b/SPECS/linux/6.1/crypto/0001-Revert-crypto-api-Add-crypto_tfm_get.patch @@ -0,0 +1,86 @@ +From e88861055d3a032bec44369a109417c74f5ad6ab Mon Sep 17 00:00:00 2001 +From: Ankit Jain +Date: Thu, 9 Jan 2025 08:31:07 +0000 +Subject: [PATCH] Revert "crypto: api - Add crypto_tfm_get" + +This reverts commit e470d423b0f6ffd3977e74d1d1eef70cc58f18dd. + +commit e470d42 (crypto: api - Add crypto_tfm_get) introduced an api +which adds a new member in struct crypto_tfm, causing build issues +with fips canister, since, crypto_tfm_get() api is not being used +in v6.1.x so reverting upstream commit. + +Signed-off-by: Ankit Jain +--- + crypto/api.c | 4 ---- + crypto/internal.h | 6 ------ + include/linux/crypto.h | 1 - + 3 files changed, 11 deletions(-) + +diff --git a/crypto/api.c b/crypto/api.c +index 4308b1c8ca2e..2d90b95891c4 100644 +--- a/crypto/api.c ++++ b/crypto/api.c +@@ -409,7 +409,6 @@ struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type, + goto out_err; + + tfm->__crt_alg = alg; +- refcount_set(&tfm->refcnt, 1); + + err = crypto_init_ops(tfm, type, mask); + if (err) +@@ -508,7 +507,6 @@ static void *crypto_alloc_tfmmem(struct crypto_alg *alg, + tfm = (struct crypto_tfm *)(mem + tfmsize); + tfm->__crt_alg = alg; + tfm->node = node; +- refcount_set(&tfm->refcnt, 1); + + return mem; + } +@@ -663,8 +661,6 @@ void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm) + if (IS_ERR_OR_NULL(mem)) + return; + +- if (!refcount_dec_and_test(&tfm->refcnt)) +- return; + alg = tfm->__crt_alg; + + if (!tfm->exit && alg->cra_exit) +diff --git a/crypto/internal.h b/crypto/internal.h +index e81cd7594b35..df3125897619 100644 +--- a/crypto/internal.h ++++ b/crypto/internal.h +@@ -10,7 +10,6 @@ + + #include + #include +-#include + #include + #include + #include +@@ -169,10 +168,5 @@ static inline int crypto_is_test_larval(struct crypto_larval *larval) + return larval->alg.cra_driver_name[0]; + } + +-static inline struct crypto_tfm *crypto_tfm_get(struct crypto_tfm *tfm) +-{ +- return refcount_inc_not_zero(&tfm->refcnt) ? tfm : ERR_PTR(-EOVERFLOW); +-} +- + #endif /* _CRYPTO_INTERNAL_H */ + +diff --git a/include/linux/crypto.h b/include/linux/crypto.h +index d354a2a7ac5f..e3c4be29aacc 100644 +--- a/include/linux/crypto.h ++++ b/include/linux/crypto.h +@@ -642,7 +642,6 @@ int crypto_has_alg(const char *name, u32 type, u32 mask); + */ + + struct crypto_tfm { +- refcount_t refcnt; + + u32 crt_flags; + +-- +2.39.4 + diff --git a/SPECS/linux/6.1/crypto/0001-canister-Change-spinlock_t-lock-to-void-reserved.patch b/SPECS/linux/6.1/crypto/0001-canister-Change-spinlock_t-lock-to-void-reserved.patch new file mode 100644 index 0000000000..c037a7c258 --- /dev/null +++ b/SPECS/linux/6.1/crypto/0001-canister-Change-spinlock_t-lock-to-void-reserved.patch @@ -0,0 +1,28 @@ +From e02394d30b6cc2e09b3eba4c4da3c0fe80ad9d13 Mon Sep 17 00:00:00 2001 +From: Keerthana K +Date: Tue, 12 Nov 2024 06:16:56 +0000 +Subject: [PATCH] canister: Change spinlock_t lock to void *reserved + +change tyope of variable lock in structure aead_geniv_ctx from spinlock_t +to void * similar to fips_canister to maintain the compatibility. Rename +the lock variable to reserved for canister usage (for the remaining kernel). +--- + include/crypto/internal/geniv.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/crypto/internal/geniv.h b/include/crypto/internal/geniv.h +index 7fd7126f5..d54724057 100644 +--- a/include/crypto/internal/geniv.h ++++ b/include/crypto/internal/geniv.h +@@ -13,7 +13,7 @@ + #include + + struct aead_geniv_ctx { +- spinlock_t lock; ++ void *reserved; + struct crypto_aead *child; + struct crypto_sync_skcipher *sknull; + u8 salt[] __attribute__ ((aligned(__alignof__(u32)))); +-- +2.39.4 + diff --git a/SPECS/90/linux/crypto/0001-crypto-rsa-allow-only-odd-e-and-restrict-value-in-FI.patch b/SPECS/linux/6.1/crypto/0001-crypto-rsa-allow-only-odd-e-and-restrict-value-in-FI.patch similarity index 100% rename from SPECS/90/linux/crypto/0001-crypto-rsa-allow-only-odd-e-and-restrict-value-in-FI.patch rename to SPECS/linux/6.1/crypto/0001-crypto-rsa-allow-only-odd-e-and-restrict-value-in-FI.patch diff --git a/SPECS/91/linux/canister_builder/patches/0004-scripts-kallsyms-Extra-kallsyms-parsing.patch b/SPECS/linux/6.1/crypto/0001-scripts-kallsyms-Extra-kallsyms-parsing.patch similarity index 66% rename from SPECS/91/linux/canister_builder/patches/0004-scripts-kallsyms-Extra-kallsyms-parsing.patch rename to SPECS/linux/6.1/crypto/0001-scripts-kallsyms-Extra-kallsyms-parsing.patch index c579462e7a..e2d3e1992b 100644 --- a/SPECS/91/linux/canister_builder/patches/0004-scripts-kallsyms-Extra-kallsyms-parsing.patch +++ b/SPECS/linux/6.1/crypto/0001-scripts-kallsyms-Extra-kallsyms-parsing.patch @@ -1,22 +1,24 @@ -From c4ff4b712f12ddc51476a9248e1bbe927b4b8f2c Mon Sep 17 00:00:00 2001 -From: Keerthana K -Date: Thu, 28 Nov 2024 07:22:49 +0000 -Subject: [PATCH] scripts-kallsyms: Extra kallsyms parsing +From 32957298010e50c83e355aba5980d60d3ab6805a Mon Sep 17 00:00:00 2001 +From: Keerthana K +Date: Fri, 17 Jun 2022 14:32:26 +0000 +Subject: [PATCH 1/8] scripts-kallsyms: Extra kallsyms parsing + +From: Keerthana K Adding new option "--extra-symbols=" to scripts/kallsyms.c This helps in adding required symbols to vmlinux when CONFIG_KALLSYMS_ALL is disabled. +Signed-off-by: Keerthana K [Ajay: Regenerated the patch for v6.1.45] Signed-off-by: Ajay Kaher -Signed-off-by: Keerthana K --- - scripts/kallsyms.c | 105 +++++++++++++++++++++++++++++++++++----- + scripts/kallsyms.c | 111 +++++++++++++++++++++++++++++++++++----- scripts/link-vmlinux.sh | 2 + - 2 files changed, 96 insertions(+), 11 deletions(-) + 2 files changed, 101 insertions(+), 12 deletions(-) diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c -index 03852da3d..ae1ade371 100644 +index ff8cce175..cf37d2351 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -26,6 +26,8 @@ @@ -26,9 +28,9 @@ index 03852da3d..ae1ade371 100644 +#include +#include - #include + #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) -@@ -48,10 +50,15 @@ struct addr_range { +@@ -63,10 +65,15 @@ struct addr_range { static unsigned long long _text; static unsigned long long relative_base; @@ -44,24 +46,24 @@ index 03852da3d..ae1ade371 100644 #define text_range_text (&text_ranges[0]) #define text_range_inittext (&text_ranges[1]) -@@ -62,6 +69,7 @@ static struct addr_range percpu_range = { +@@ -77,6 +84,7 @@ static struct addr_range percpu_range = { static struct sym_entry **table; static unsigned int table_size, table_cnt; static int all_symbols; +static int extra_symbols; static int absolute_percpu; - - static int token_profit[0x10000]; -@@ -73,7 +81,7 @@ static unsigned char best_table_len[256]; + static int base_relative; + static int lto_clang; +@@ -90,7 +98,7 @@ static unsigned char best_table_len[256]; static void usage(void) { -- fprintf(stderr, "Usage: kallsyms [--all-symbols] [--absolute-percpu] in.map > out.S\n"); -+ fprintf(stderr, "Usage: kallsyms --extra-symbols= [--all-symbols] [--absolute-percpu] in.map > out.S\n"); +- fprintf(stderr, "Usage: kallsyms [--all-symbols] [--absolute-percpu] " ++ fprintf(stderr, "Usage: kallsyms --extra-symbols= [--all-symbols] [--absolute-percpu] " + "[--base-relative] [--lto-clang] in.map > out.S\n"); exit(1); } - -@@ -118,6 +126,55 @@ static void check_symbol_range(const char *sym, unsigned long long addr, +@@ -215,6 +223,55 @@ static void check_symbol_range(const char *sym, unsigned long long addr, } } @@ -114,10 +116,10 @@ index 03852da3d..ae1ade371 100644 + free(extra_sym_tbl); +} + - static struct sym_entry *read_symbol(FILE *in, char **buf, size_t *buf_len) + static struct sym_entry *read_symbol(FILE *in) { - char *name, type, *p; -@@ -204,10 +261,18 @@ static bool string_starts_with(const char *s, const char *prefix) + char name[KSYM_NAME_LEN_BUFFER+1], type; +@@ -285,10 +342,17 @@ static int symbol_in_range(const struct sym_entry *s, static int symbol_valid(const struct sym_entry *s) { const char *name = sym_name(s); @@ -132,33 +134,35 @@ index 03852da3d..ae1ade371 100644 + return 1; + } + } -+ - /* - * Symbols starting with __start and __stop are used to denote - * section boundaries, and should always be included: -@@ -759,24 +824,41 @@ static void record_relative_base(void) + if (symbol_in_range(s, text_ranges, + ARRAY_SIZE(text_ranges)) == 0) + return 0; +@@ -886,26 +950,48 @@ static void record_relative_base(void) int main(int argc, char **argv) { - while (1) { -- static const struct option long_options[] = { +- static struct option long_options[] = { - {"all-symbols", no_argument, &all_symbols, 1}, - {"absolute-percpu", no_argument, &absolute_percpu, 1}, +- {"base-relative", no_argument, &base_relative, 1}, +- {"lto-clang", no_argument, <o_clang, 1}, - {}, - }; -- -- int c = getopt_long(argc, argv, "", long_options, NULL); - -- if (c == -1) + char *sym_file = NULL; + int opt = 0, index = 0; -+ -+ static const struct option long_options[] = { -+ {"all-symbols", no_argument, NULL, 'l'}, -+ {"absolute-percpu", no_argument, NULL, 'a'}, + +- int c = getopt_long(argc, argv, "", long_options, NULL); ++ static struct option long_options[] = { ++ {"all-symbols", no_argument, NULL, 'l'}, ++ {"absolute-percpu", no_argument, NULL, 'a'}, ++ {"base-relative", no_argument, NULL, 'b'}, ++ {"lto-clang", no_argument, NULL, 'c'}, + {"extra-symbols", required_argument, NULL, 's'}, + {}, + }; + +- if (c == -1) + while ((opt = getopt_long_only(argc, argv, "", + long_options, &index)) != -1) { + switch (opt) { @@ -168,11 +172,17 @@ index 03852da3d..ae1ade371 100644 + case 'a': + absolute_percpu = 1; + break; ++ case 'b': ++ base_relative = 1; ++ break; ++ case 'c': ++ lto_clang = 1; + break; +- if (c != 0) + case 's': + extra_symbols = 1; + sym_file = optarg; - break; -- if (c != 0) ++ break; + default: usage(); + } @@ -184,11 +194,10 @@ index 03852da3d..ae1ade371 100644 + if (extra_symbols) { + populate_extra_symbol_table(sym_file); + } -+ read_map(argv[optind]); shrink_table(); if (absolute_percpu) -@@ -786,5 +868,6 @@ int main(int argc, char **argv) +@@ -916,5 +1002,6 @@ int main(int argc, char **argv) optimize_token_table(); write_src(); @@ -196,18 +205,17 @@ index 03852da3d..ae1ade371 100644 return 0; } diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh -index a9b3f34a7..e248617e6 100755 +index 32e573943..85d9115ad 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh -@@ -144,6 +144,8 @@ kallsyms() - kallsymopt="${kallsymopt} --absolute-percpu" +@@ -160,6 +160,8 @@ kallsyms() + kallsymopt="${kallsymopt} --lto-clang" fi + kallsymopt="${kallsymopt} --extra-symbols=crypto/fips_canister-kallsyms" + - info KSYMS "${2}.S" - scripts/kallsyms ${kallsymopt} "${1}" > "${2}.S" - + info KSYMS ${2} + scripts/kallsyms ${kallsymopt} ${1} > ${2} + } -- -2.49.0 - +2.43.0 diff --git a/SPECS/91/linux/canister_builder/patches/1015-FIPS-crypto-self-tests.patch b/SPECS/linux/6.1/crypto/0002-FIPS-crypto-self-tests.patch similarity index 75% rename from SPECS/91/linux/canister_builder/patches/1015-FIPS-crypto-self-tests.patch rename to SPECS/linux/6.1/crypto/0002-FIPS-crypto-self-tests.patch index bd6d7b0e75..01e0a8e514 100644 --- a/SPECS/91/linux/canister_builder/patches/1015-FIPS-crypto-self-tests.patch +++ b/SPECS/linux/6.1/crypto/0002-FIPS-crypto-self-tests.patch @@ -1,4 +1,4 @@ -From d64b1cd7b8c953c652d443b85c4e811a111fa969 Mon Sep 17 00:00:00 2001 +From f46f799e03c6cdca9c24bcc2483f82752ee75b58 Mon Sep 17 00:00:00 2001 From: Keerthana K Date: Tue, 5 Jan 2021 10:45:39 +0000 Subject: [PATCH] FIPS crypto self tests @@ -10,38 +10,70 @@ Subject: [PATCH] FIPS crypto self tests - Added cts to crypto self-tests - Removed rsa(pkcs1pad, sha512), cbc, and ctr from crypto self-tests - Added ECC pubkey generation and verification success messages +- Use drbg_nopr_sha1_tv_template for drbg_nopr_sha1 self-test -[Alexey: add FIPS_NOT_ALLOWED macro] +Alexey: add FIPS_NOT_ALLOWED macro Signed-off-by: Srish Srinivasan - -[Srinidhi Rao Ported this patch to v6.12.y] -Signed-off-by: srinidhira0 - -[Shivani Agarwal Enable hmac(sha384) self-test, -Added HMAC and HASH DRBGs using SHA-384 in FIPS mode] -Signed-off-by: Shivani Agarwal - -[Alexey: Make it part of the canister_build] -Signed-off-by: Alexey Makhalov -[Ankit: Removed cfb from self-test as there is no test for it. - Added rfc4106, rfc4309, rfc3686 and many more for self-test, - as per testmgr.c - set fips_allowed = 0 for sha1 combinations.] - -Signed-off-by: Ankit Jain +Signed-off-by: Vamsi Krishna Brahmajosyula --- - crypto/crypto_self_test.c | 229 +++++ - crypto/testmgr.c | 72 +- - crypto/testmgr.h | 1843 ++++++++++++++++++++++++++++++++++++- - 3 files changed, 2127 insertions(+), 17 deletions(-) + crypto/Kconfig | 21 + + crypto/Makefile | 1 + + crypto/crypto_self_test.c | 123 ++ + crypto/testmgr.c | 93 +- + crypto/testmgr.h | 2341 ++++++++++++++++++++++++++++++++++++- + 5 files changed, 2562 insertions(+), 17 deletions(-) create mode 100644 crypto/crypto_self_test.c +diff --git a/crypto/Kconfig b/crypto/Kconfig +index d77966767..c849bb918 100644 +--- a/crypto/Kconfig ++++ b/crypto/Kconfig +@@ -229,6 +229,27 @@ config CRYPTO_TEST + help + Quick & dirty crypto test module. + ++config CRYPTO_SELF_TEST ++ bool "Crypto self test" ++ select CRYPTO_MANAGER ++ select CRYPTO_FIPS ++ select CRYPTO_AES ++ select CRYPTO_ECB ++ select CRYPTO_XTS ++ select CRYPTO_GCM ++ select CRYPTO_CCM ++ select CRYPTO_CFB ++ select CRYPTO_CMAC ++ select CRYPTO_CTS ++ select CRYPTO_SHA1 ++ select CRYPTO_SHA256 ++ select CRYPTO_SHA512 ++ select CRYPTO_SHA3 ++ select CRYPTO_HMAC ++ select CRYPTO_RSA ++ help ++ Crypto self test module for FIPS. ++ + config CRYPTO_SIMD + tristate + select CRYPTO_CRYPTD +diff --git a/crypto/Makefile b/crypto/Makefile +index 70f13d445..515ca3a4c 100644 +--- a/crypto/Makefile ++++ b/crypto/Makefile +@@ -53,6 +53,7 @@ sm2_generic-y += sm2signature.asn1.o + sm2_generic-y += sm2.o + + obj-$(CONFIG_CRYPTO_SM2) += sm2_generic.o ++obj-$(CONFIG_CRYPTO_SELF_TEST) += crypto_self_test.o + + $(obj)/ecdsasignature.asn1.o: $(obj)/ecdsasignature.asn1.c $(obj)/ecdsasignature.asn1.h + $(obj)/ecdsa.o: $(obj)/ecdsasignature.asn1.h diff --git a/crypto/crypto_self_test.c b/crypto/crypto_self_test.c new file mode 100644 -index 000000000000..18955b9855ed +index 000000000..eb4ed8bdb --- /dev/null +++ b/crypto/crypto_self_test.c -@@ -0,0 +1,229 @@ +@@ -0,0 +1,123 @@ +/* + * Self test for Crypto Algorithms + * @@ -49,11 +81,12 @@ index 000000000000..18955b9855ed + * + */ + ++#include +#include +#include +#include +#include -+#include "fips_canister_wrapper.h" ++MODULE_LICENSE("GPL"); + +extern int alg_test(const char *driver, const char *alg, u32 type, u32 mask); + @@ -65,10 +98,6 @@ index 000000000000..18955b9855ed +static struct alg_self_test __initdata alg_self_test_tbl[] = +{ + { -+ .driver_name = "cbc(aes)", -+ .alg_name = "cbc(aes)", -+ }, -+ { + .driver_name = "cts(cbc(aes))", + .alg_name = "cts(cbc(aes))", + }, @@ -77,82 +106,30 @@ index 000000000000..18955b9855ed + .alg_name = "gcm(aes)", + }, + { -+ .driver_name = "ccm(aes)", -+ .alg_name = "ccm(aes)", -+ }, -+ { + .driver_name = "rfc4106(gcm(aes))", + .alg_name = "rfc4106(gcm(aes))", + }, + { -+ .driver_name = "rfc4309(ccm(aes))", -+ .alg_name = "rfc4309(ccm(aes))", -+ }, -+ { -+ .driver_name = "rfc3686(ctr(aes))", -+ .alg_name = "rfc3686(ctr(aes))", ++ .driver_name = "ccm(aes)", ++ .alg_name = "ccm(aes)", + }, + { -+ .driver_name = "ctr(aes)", -+ .alg_name = "ctr(aes)", ++ .driver_name = "cfb(aes)", ++ .alg_name = "cfb(aes)", + }, + { + .driver_name = "cmac(aes)", + .alg_name = "cmac(aes)", + }, + { -+ .driver_name = "rsa", -+ .alg_name = "rsa", -+ }, -+ { -+ .driver_name = "sha224", -+ .alg_name = "sha224", -+ }, -+ { -+ .driver_name = "sha256", -+ .alg_name = "sha256", -+ }, -+ { -+ .driver_name = "sha384", -+ .alg_name = "sha384", -+ }, -+ { -+ .driver_name = "sha512", -+ .alg_name = "sha512", -+ }, -+ { -+ .driver_name = "sha3-224", -+ .alg_name = "sha3-224", -+ }, -+ { -+ .driver_name = "sha3-256", -+ .alg_name = "sha3-256", -+ }, -+ { -+ .driver_name = "sha3-384", -+ .alg_name = "sha3-384", -+ }, -+ { -+ .driver_name = "sha3-512", -+ .alg_name = "sha3-512", ++ .driver_name = "ecb(aes)", ++ .alg_name = "ecb(aes)", + }, + { + .driver_name = "hmac(sha224)", + .alg_name = "hmac(sha224)", + }, + { -+ .driver_name = "hmac(sha256)", -+ .alg_name = "hmac(sha256)", -+ }, -+ { -+ .driver_name = "hmac(sha384)", -+ .alg_name = "hmac(sha384)", -+ }, -+ { -+ .driver_name = "hmac(sha512)", -+ .alg_name = "hmac(sha512)", -+ }, -+ { + .driver_name = "hmac(sha3-224)", + .alg_name = "hmac(sha3-224)", + }, @@ -169,6 +146,10 @@ index 000000000000..18955b9855ed + .alg_name = "hmac(sha3-512)", + }, + { ++ .driver_name = "pkcs1pad(rsa,sha1)", ++ .alg_name = "pkcs1pad(rsa,sha1)", ++ }, ++ { + .driver_name = "pkcs1pad(rsa,sha224)", + .alg_name = "pkcs1pad(rsa,sha224)", + }, @@ -181,62 +162,6 @@ index 000000000000..18955b9855ed + .alg_name = "pkcs1pad(rsa,sha384)", + }, + { -+ .driver_name = "drbg_nopr_ctr_aes128", -+ .alg_name = "drbg_nopr_ctr_aes128", -+ }, -+ { -+ .driver_name = "drbg_nopr_ctr_aes192", -+ .alg_name = "drbg_nopr_ctr_aes192", -+ }, -+ { -+ .driver_name = "drbg_nopr_ctr_aes256", -+ .alg_name = "drbg_nopr_ctr_aes256", -+ }, -+ { -+ .driver_name = "drbg_nopr_hmac_sha256", -+ .alg_name = "drbg_nopr_hmac_sha256", -+ }, -+ { -+ .driver_name = "drbg_nopr_hmac_sha512", -+ .alg_name = "drbg_nopr_hmac_sha512", -+ }, -+ { -+ .driver_name = "drbg_nopr_sha256", -+ .alg_name = "drbg_nopr_sha256", -+ }, -+ { -+ .driver_name = "drbg_pr_ctr_aes128", -+ .alg_name = "drbg_pr_ctr_aes128", -+ }, -+ { -+ .driver_name = "drbg_pr_hmac_sha256", -+ .alg_name = "drbg_pr_hmac_sha256", -+ }, -+ { -+ .driver_name = "drbg_pr_sha256", -+ .alg_name = "drbg_pr_sha256", -+ }, -+ { -+ .driver_name = "ecdh-nist-p256", -+ .alg_name = "ecdh-nist-p256", -+ }, -+ { -+ .driver_name = "ecdh-nist-p384", -+ .alg_name = "ecdh-nist-p384", -+ }, -+ { -+ .driver_name = "ecdsa-nist-p256", -+ .alg_name = "ecdsa-nist-p256", -+ }, -+ { -+ .driver_name = "ecdsa-nist-p384", -+ .alg_name = "ecdsa-nist-p384", -+ }, -+ { -+ .driver_name = "ecdsa-nist-p521", -+ .alg_name = "ecdsa-nist-p521", -+ }, -+ { + .driver_name = "xts(aes)", + .alg_name = "xts(aes)", + }, @@ -248,7 +173,7 @@ index 000000000000..18955b9855ed +#define FIPS_NOT_ALLOWED(algname) 0 +#endif + -+int __init crypto_self_test_init(void) ++static int __init crypto_self_test_init(void) +{ + int err = -ENOMEM; + int i = 0; @@ -261,7 +186,7 @@ index 000000000000..18955b9855ed + continue; + err = alg_test(alg_self_test_tbl[i].driver_name, alg_self_test_tbl[i].alg_name, 0, 0); + if (err) { -+ fcw_printk(KERN_ERR "crypto_self_test failed for %s %s \n", ++ printk(KERN_ERR "crypto_self_test failed for %s %s \n", + alg_self_test_tbl[i].driver_name, + alg_self_test_tbl[i].alg_name); + goto error; @@ -271,34 +196,46 @@ index 000000000000..18955b9855ed +error: + return err; +} ++module_init(crypto_self_test_init); diff --git a/crypto/testmgr.c b/crypto/testmgr.c -index c0234893e3ed..809ebd48538e 100644 +index 56c39a0c9..285f5af91 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c -@@ -4083,7 +4083,7 @@ static const struct alg_test_desc alg_test_descs[] = { - }, { - .alg = "authenc(hmac(sha1),cbc(aes))", - .test = alg_test_aead, -- .fips_allowed = 1, -+ .fips_allowed = 0, - .suite = { - .aead = __VECS(hmac_sha1_aes_cbc_tv_temp) +@@ -3925,6 +3925,8 @@ static int do_test_kpp(struct crypto_kpp *tfm, const struct kpp_testvec *vec, + alg, err); + goto free_output; + } ++ if (fips_enabled) ++ printk(KERN_INFO "alg: %s: Party A: generate public key test passed.", alg); + + if (vec->genkey) { + /* Save party A's public key */ +@@ -3942,6 +3944,8 @@ static int do_test_kpp(struct crypto_kpp *tfm, const struct kpp_testvec *vec, + err = -EINVAL; + goto free_output; } -@@ -4102,7 +4102,7 @@ static const struct alg_test_desc alg_test_descs[] = { - }, { - .alg = "authenc(hmac(sha1),ctr(aes))", - .test = alg_test_null, -- .fips_allowed = 1, -+ .fips_allowed = 0, - }, { - .alg = "authenc(hmac(sha1),ecb(cipher_null))", - .test = alg_test_aead, -@@ -4592,7 +4592,11 @@ static const struct alg_test_desc alg_test_descs[] = { - * backend cipher -- covered by drbg_nopr_hmac_sha512 test ++ if (fips_enabled) ++ printk(KERN_INFO "alg: %s: Party A: verify public key test passed.", alg); + } + + /* Calculate shared secret key by using counter part (b) public key. */ +@@ -4837,7 +4841,10 @@ static const struct alg_test_desc alg_test_descs[] = { */ + .alg = "drbg_nopr_hmac_sha1", + .fips_allowed = 1, +- .test = alg_test_null, ++ .test = alg_test_drbg, ++ .suite = { ++ .drbg = __VECS(drbg_nopr_hmac_sha1_tv_template) ++ } + }, { + .alg = "drbg_nopr_hmac_sha256", + .test = alg_test_drbg, +@@ -4849,7 +4856,10 @@ static const struct alg_test_desc alg_test_descs[] = { + /* covered by drbg_nopr_hmac_sha256 test */ .alg = "drbg_nopr_hmac_sha384", + .fips_allowed = 1, - .test = alg_test_null, -+ .fips_allowed = 1, + .test = alg_test_drbg, + .suite = { + .drbg = __VECS(drbg_nopr_hmac_sha384_tv_template) @@ -306,12 +243,23 @@ index c0234893e3ed..809ebd48538e 100644 }, { .alg = "drbg_nopr_hmac_sha512", .test = alg_test_drbg, -@@ -4610,11 +4614,18 @@ static const struct alg_test_desc alg_test_descs[] = { +@@ -4860,7 +4870,10 @@ static const struct alg_test_desc alg_test_descs[] = { + }, { + .alg = "drbg_nopr_sha1", + .fips_allowed = 1, +- .test = alg_test_null, ++ .test = alg_test_drbg, ++ .suite = { ++ .drbg = __VECS(drbg_nopr_sha1_tv_template) ++ } }, { + .alg = "drbg_nopr_sha256", + .test = alg_test_drbg, +@@ -4872,11 +4885,17 @@ static const struct alg_test_desc alg_test_descs[] = { /* covered by drbg_nopr_sha256 test */ .alg = "drbg_nopr_sha384", + .fips_allowed = 1, - .test = alg_test_null, -+ .fips_allowed = 1, + .test = alg_test_drbg, + .suite = { + .drbg = __VECS(drbg_nopr_sha384_tv_template) @@ -327,7 +275,7 @@ index c0234893e3ed..809ebd48538e 100644 }, { .alg = "drbg_pr_ctr_aes128", .test = alg_test_drbg, -@@ -4626,11 +4637,17 @@ static const struct alg_test_desc alg_test_descs[] = { +@@ -4888,15 +4907,24 @@ static const struct alg_test_desc alg_test_descs[] = { /* covered by drbg_pr_ctr_aes128 test */ .alg = "drbg_pr_ctr_aes192", .fips_allowed = 1, @@ -343,16 +291,23 @@ index c0234893e3ed..809ebd48538e 100644 + .test = alg_test_drbg, + .suite = { + .drbg = __VECS(drbg_pr_ctr_aes256_tv_template) ++ } + }, { + .alg = "drbg_pr_hmac_sha1", + .fips_allowed = 1, +- .test = alg_test_null, ++ .test = alg_test_drbg, ++ .suite = { ++ .drbg = __VECS(drbg_pr_hmac_sha1_tv_template) + } }, { .alg = "drbg_pr_hmac_sha256", .test = alg_test_drbg, -@@ -4641,11 +4658,18 @@ static const struct alg_test_desc alg_test_descs[] = { - }, { +@@ -4908,15 +4936,24 @@ static const struct alg_test_desc alg_test_descs[] = { /* covered by drbg_pr_hmac_sha256 test */ .alg = "drbg_pr_hmac_sha384", + .fips_allowed = 1, - .test = alg_test_null, -+ .fips_allowed = 1, + .test = alg_test_drbg, + .suite = { + .drbg = __VECS(drbg_pr_hmac_sha384_tv_template) @@ -364,16 +319,23 @@ index c0234893e3ed..809ebd48538e 100644 .fips_allowed = 1, + .suite = { + .drbg = __VECS(drbg_pr_hmac_sha512_tv_template) ++ } + }, { + .alg = "drbg_pr_sha1", + .fips_allowed = 1, +- .test = alg_test_null, ++ .test = alg_test_drbg, ++ .suite = { ++ .drbg = __VECS(drbg_pr_sha1_tv_template) + } }, { .alg = "drbg_pr_sha256", .test = alg_test_drbg, -@@ -4656,11 +4680,18 @@ static const struct alg_test_desc alg_test_descs[] = { - }, { +@@ -4928,11 +4965,17 @@ static const struct alg_test_desc alg_test_descs[] = { /* covered by drbg_pr_sha256 test */ .alg = "drbg_pr_sha384", + .fips_allowed = 1, - .test = alg_test_null, -+ .fips_allowed = 1, + .test = alg_test_drbg, + .suite = { + .drbg = __VECS(drbg_pr_sha384_tv_template) @@ -389,66 +351,545 @@ index c0234893e3ed..809ebd48538e 100644 }, { .alg = "ecb(aes)", .test = alg_test_skcipher, -@@ -4955,7 +4986,7 @@ static const struct alg_test_desc alg_test_descs[] = { +@@ -5101,12 +5144,14 @@ static const struct alg_test_desc alg_test_descs[] = { }, { - .alg = "hmac(sha1)", - .test = alg_test_hash, -- .fips_allowed = 1, -+ .fips_allowed = 0, + .alg = "ecdsa-nist-p256", + .test = alg_test_akcipher, ++ .fips_allowed = 1, + .suite = { + .akcipher = __VECS(ecdsa_nist_p256_tv_template) + } + }, { + .alg = "ecdsa-nist-p384", + .test = alg_test_akcipher, ++ .fips_allowed = 1, .suite = { - .hash = __VECS(hmac_sha1_tv_template) + .akcipher = __VECS(ecdsa_nist_p384_tv_template) } -@@ -5151,8 +5182,11 @@ static const struct alg_test_desc alg_test_descs[] = { +@@ -5433,10 +5478,20 @@ static const struct alg_test_desc alg_test_descs[] = { + .suite = { + .cipher = __VECS(fcrypt_pcbc_tv_template) } ++ }, { ++ .alg = "pkcs1pad(rsa,sha1)", ++ .test = alg_test_akcipher, ++ .fips_allowed = 1, ++ .suite = { ++ .akcipher = __VECS(pkcs1pad_rsa_sha1_tv_template) ++ } }, { .alg = "pkcs1pad(rsa,sha224)", - .test = alg_test_null, + .test = alg_test_akcipher, .fips_allowed = 1, -+ .suite = { -+ .akcipher = __VECS(pkcs1pad_rsa_sha224_tv_template) -+ } ++ .suite = { ++ .akcipher = __VECS(pkcs1pad_rsa_sha224_tv_template) ++ } }, { .alg = "pkcs1pad(rsa,sha256)", .test = alg_test_akcipher, -@@ -5174,12 +5208,18 @@ static const struct alg_test_desc alg_test_descs[] = { - .fips_allowed = 1, +@@ -5446,12 +5501,18 @@ static const struct alg_test_desc alg_test_descs[] = { + } }, { .alg = "pkcs1pad(rsa,sha384)", - .test = alg_test_null, + .test = alg_test_akcipher, .fips_allowed = 1, -+ .suite = { -+ .akcipher = __VECS(pkcs1pad_rsa_sha384_tv_template) -+ } ++ .suite = { ++ .akcipher = __VECS(pkcs1pad_rsa_sha384_tv_template) ++ } }, { .alg = "pkcs1pad(rsa,sha512)", - .test = alg_test_null, + .test = alg_test_akcipher, .fips_allowed = 1, -+ .suite = { -+ .akcipher = __VECS(pkcs1pad_rsa_sha512_tv_template) -+ } ++ .suite = { ++ .akcipher = __VECS(pkcs1pad_rsa_sha512_tv_template) ++ } }, { .alg = "poly1305", .test = alg_test_hash, -@@ -5272,7 +5312,7 @@ static const struct alg_test_desc alg_test_descs[] = { - }, { - .alg = "sha1", - .test = alg_test_hash, -- .fips_allowed = 1, -+ .fips_allowed = 0, - .suite = { - .hash = __VECS(sha1_tv_template) - } diff --git a/crypto/testmgr.h b/crypto/testmgr.h -index 505227ef8924..34ee73c9ce23 100644 +index d6088e26f..4ca21b56b 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h -@@ -1353,6 +1353,254 @@ static const struct akcipher_testvec ecrdsa_tv_template[] = { +@@ -1228,6 +1228,727 @@ static const struct akcipher_testvec ecrdsa_tv_template[] = { /* * PKCS#1 RSA test vectors. Obtained from CAVS testing. */ ++ ++static const struct akcipher_testvec pkcs1pad_rsa_sha1_tv_template[] = { ++ { ++ .key = ++ "\x30\x82\x0b\x28\x02\x01\x00\x02" ++ "\x82\x02\x01\x00\xb0\xf8\x80\x65" ++ "\x86\xb7\x22\xf4\x14\x07\x04\xf0" ++ "\x00\xf5\x1f\xc9\x03\x28\xad\x8e" ++ "\xc8\xe4\x0d\xeb\x69\x14\xf9\xcc" ++ "\x4a\xfe\x29\x63\x14\xb9\xcc\x6b" ++ "\xbc\x16\x5b\xf4\x27\x94\x4c\xa0" ++ "\xd6\x68\x6b\xfd\xab\x52\xfe\xd2" ++ "\x53\x3a\x3a\x86\xcd\x6a\x58\x4c" ++ "\xd8\x7a\xa3\xaa\x0f\xae\x92\xab" ++ "\x30\x8a\xc6\x96\x7b\xba\x04\xd4" ++ "\xc2\xea\xb4\xca\xfe\x7e\x84\x9a" ++ "\x69\x2e\xef\x11\x34\xd1\x0d\xa2" ++ "\x1b\x5b\x8f\xb2\x94\x54\xbb\xfa" ++ "\xd6\xff\xb0\x98\xec\xf1\x6c\xd1" ++ "\x61\x52\x1f\xcc\x92\x66\x7f\x95" ++ "\x0c\xd4\xe3\x4b\x54\x24\xb0\xc8" ++ "\xa2\x05\x00\xa9\x93\x88\x64\x82" ++ "\xa9\x35\xa8\xc6\x06\xbd\xc9\x10" ++ "\x88\x91\xf9\xe8\x60\x9a\xbe\x17" ++ "\xc3\x9e\xf4\x6b\x92\xf5\xb4\xe7" ++ "\xa3\x24\xcd\xa9\x42\xb8\xfd\x0e" ++ "\x73\x4b\x2a\x2b\xfc\x2d\x75\x48" ++ "\xf8\x8f\x1b\xad\xd8\xab\xa9\x5a" ++ "\x8c\xde\x63\x12\xe8\x89\xb4\x38" ++ "\x5e\xaa\xfe\xf1\x39\xae\xd6\xdf" ++ "\x76\x4f\xb6\xe3\x4a\x5b\xd3\xe1" ++ "\x4d\xe8\x2e\xe5\x9f\xd2\x56\x51" ++ "\x1b\x5f\x66\x15\x4e\x0d\xfa\xed" ++ "\xb5\x74\xdd\x40\x51\xdc\x72\x56" ++ "\x62\xd9\x21\xd2\x73\xc0\x34\x6d" ++ "\x67\x34\xb4\xcb\xfc\xc3\x83\x44" ++ "\xec\xba\x5c\x44\x66\xb5\xb7\xee" ++ "\x50\x3f\xa6\x79\x5c\xb5\x7d\x93" ++ "\xc1\x6c\x05\x34\xef\xb9\xcd\xf6" ++ "\xb1\x8d\x26\xec\x39\x12\x31\x5d" ++ "\x12\x68\xd2\x9c\xe2\x74\xc4\xe5" ++ "\xbf\x46\x6e\xdd\xb6\x92\xee\xd3" ++ "\x9f\x7b\x4b\xe4\x8b\xde\xf2\x3f" ++ "\xd4\x0e\x5c\x11\x40\x9a\x50\xac" ++ "\x81\xab\x9f\x60\xf5\xad\xa7\xa2" ++ "\xb9\xf9\x57\xe8\xc0\xf3\x24\x1f" ++ "\xa1\x89\x95\x31\x19\x32\x66\xd5" ++ "\x8a\xf5\xe4\x66\x65\xf8\xa1\x5a" ++ "\xfb\xb0\xc6\xef\x47\x87\x4a\x60" ++ "\xdd\x0c\xa5\xfe\xd5\x63\xc4\x39" ++ "\x2c\x2e\xd8\xb1\x7b\x53\xa6\x28" ++ "\xa1\x9f\x1b\xf1\xda\x28\xd9\x7e" ++ "\xdf\x15\xc2\x64\x61\x81\x55\x0a" ++ "\x79\x3d\xe6\x9f\x1e\x59\xc7\x74" ++ "\x16\xb0\x75\x48\x02\xb5\x76\x08" ++ "\x64\x10\x53\x6c\xba\xfa\x8e\x93" ++ "\x1b\x55\xb2\x40\x93\x4d\x30\x1b" ++ "\x1f\x11\xc0\x8a\x7e\x73\xe1\x45" ++ "\x46\x95\x5f\x2a\xde\x09\xe5\x11" ++ "\x1f\xa0\xb3\xa2\x29\x08\xac\x96" ++ "\x28\x3b\x8a\xa1\x1e\xb2\x22\x8c" ++ "\x5e\xc1\xe5\x26\x5b\x9f\x62\xa1" ++ "\xb2\x01\xa2\xba\xa0\x75\xfa\xd3" ++ "\xa4\x23\xd4\x26\x82\xeb\x39\x0a" ++ "\x0c\xc8\x0d\x8a\xc3\xda\x92\x62" ++ "\xd1\x5a\xe1\x3f\x4d\xd7\xf2\x70" ++ "\x32\x9f\x4e\xc9\x24\x18\x34\xfc" ++ "\x5e\xc6\x05\x00\xa8\x3d\x86\x02" ++ "\xf8\x10\xa4\x4b\x6b\xb9\x2c\x84" ++ "\x49\xec\x22\x45\x02\x82\x02\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x01\x00\x01" ++ "\x02\x82\x02\x00\x2a\x65\x1d\xbd" ++ "\x34\xac\xa2\xbe\xfe\x1d\x40\x5d" ++ "\x8e\x9d\x2a\x64\x29\x51\x91\x62" ++ "\x67\x55\xda\xcf\xce\x78\xab\xee" ++ "\xf8\xf8\x32\x49\xfe\x29\x14\x83" ++ "\xaa\xa7\x60\x97\xf8\xf3\x59\xf8" ++ "\x1d\xe5\x1e\x19\xc2\xf5\x3a\xfe" ++ "\x7f\xd9\xaf\x33\xa3\xfa\x19\xf5" ++ "\x2e\xd7\x12\x66\x27\x23\x97\x17" ++ "\x53\xa5\xab\x35\x59\xa6\x92\x89" ++ "\xb5\xb8\x2c\x5f\x84\xe0\x22\x3c" ++ "\x2b\x7e\x86\xdf\x04\x5c\x20\x7b" ++ "\xf9\x39\xd2\x0e\xe1\xe1\xfa\xb6" ++ "\x78\xd3\x00\x27\x62\x7b\xe3\xa9" ++ "\xb5\x3a\xcb\x4b\x62\xb7\x13\x51" ++ "\x4d\xa5\xa2\x5d\xe5\x66\x74\xc3" ++ "\x5b\xac\xff\x1f\xa0\xac\x48\x07" ++ "\xd5\x29\x79\xa9\x16\xec\x58\x42" ++ "\x91\xb5\x06\xbd\x58\x87\x39\x8a" ++ "\xcf\xde\x40\x87\x94\xc9\x2f\xf1" ++ "\x5d\xef\xef\x24\xe1\x4b\x17\xb4" ++ "\x62\x82\x5b\x33\xf6\x51\x9d\x8b" ++ "\x41\xa0\x66\xed\x1a\xbe\xe4\xef" ++ "\x40\x57\xf6\x3c\x0d\x61\x0f\xbf" ++ "\x81\x4e\x4d\x8c\xd4\x58\xc2\x38" ++ "\xfe\x4a\xd2\x71\x58\xda\xee\xc3" ++ "\x46\xba\x9c\xa1\x7d\xcc\x11\xc9" ++ "\x94\x59\x22\x47\x70\x4f\x81\x11" ++ "\x79\x2a\xe9\xe6\x02\xb6\x60\xdd" ++ "\xb9\x08\x73\x45\xcb\x5c\xfc\x32" ++ "\x49\x4b\x23\x14\xcb\x14\xbb\x59" ++ "\xc3\xac\x51\x76\x41\x74\xbe\xff" ++ "\x64\x52\x1b\x3b\x09\x76\xa1\xaa" ++ "\xbb\x1f\xda\xe4\xb9\x8d\xd7\x7d" ++ "\x6b\xad\x3f\x87\xac\xe5\x5f\x6d" ++ "\x86\x66\xf1\x1a\x48\xf0\xba\xe8" ++ "\x9c\x49\xb7\x31\x1b\x07\xad\x28" ++ "\x41\x0a\x77\x75\x91\x13\x26\x82" ++ "\x7f\x4a\x9f\x62\x96\x9f\x80\x54" ++ "\xa4\xa5\x33\xd0\x6d\x84\x3c\x3f" ++ "\x9e\xd8\x65\x98\x63\xe2\x77\x76" ++ "\x8f\x89\x60\x68\xcf\x04\x63\x35" ++ "\xbd\xb8\xc0\x5b\xe8\x2e\xb6\xb0" ++ "\x5a\x06\x6c\x53\x02\x98\x1c\x51" ++ "\x7f\x6b\x85\x46\x66\x7a\x08\xc9" ++ "\x67\xca\x30\x40\xca\x5c\x4b\x85" ++ "\x68\x4b\x7b\x9d\x29\x50\x5b\x4e" ++ "\xac\xcb\x9b\xa4\xb9\xe2\x47\x29" ++ "\xdb\x08\x92\x20\xba\x9d\xf8\x11" ++ "\x95\x6c\xc6\x22\x57\xb8\xd6\x76" ++ "\x5e\x64\x78\x2e\x62\x46\x8c\xd8" ++ "\x41\xbc\x26\x2a\x84\xa4\x7b\x62" ++ "\x23\x2e\x78\x12\xb5\x7b\x9b\x89" ++ "\x1b\xae\x7a\x45\x4b\x3c\xf4\x15" ++ "\xac\xa4\xe8\xe3\xe0\x64\x80\x1a" ++ "\x31\x95\xaf\xc5\xd9\x55\x4d\x4e" ++ "\x68\x47\x0d\xa7\x5e\xdd\x5d\x70" ++ "\xe9\xc2\x0a\x32\x7a\x11\x62\x92" ++ "\x5e\x37\x06\x67\x4d\x68\x87\x65" ++ "\xaa\xdb\x41\x35\x6e\x36\xba\xb6" ++ "\x64\x7c\x79\x84\xbe\x35\x16\x43" ++ "\xdf\xf9\xd9\x16\xc1\x49\x62\x49" ++ "\x5f\x14\x0a\x90\x5c\x60\xaf\xee" ++ "\x09\xea\xce\x87\x71\x11\x24\xce" ++ "\xf3\x29\x61\x81\x02\x82\x01\x01" ++ "\x00\xe3\xe0\xd4\x64\xb3\xa8\x8f" ++ "\x16\xd0\x33\xfb\xfc\xca\xc5\x4c" ++ "\xbc\xb7\xc6\xe8\x6c\x71\x55\xbf" ++ "\xe1\xfa\x6e\x12\x48\x3d\x94\xae" ++ "\xb9\x98\xf4\xe1\x59\x24\xfd\x79" ++ "\x73\x6e\xc8\xad\x90\x83\x38\x02" ++ "\x8d\x27\x4c\x87\x56\x5c\xed\x66" ++ "\xbf\xa0\x51\x53\xfa\x7c\x87\x0b" ++ "\xe5\x79\xf5\xda\x3f\x2b\x11\xf5" ++ "\xb4\x1c\xed\x6a\x11\xc6\xfe\x73" ++ "\x2f\x86\x76\x20\x46\x0f\x9b\x84" ++ "\x76\x33\xaa\xc5\xb4\xfa\xe9\x16" ++ "\xbb\x10\xe5\x0c\x3f\x02\x68\x69" ++ "\x10\x81\x30\x4a\x90\x29\xd7\xfb" ++ "\x48\xc7\x98\x59\xb5\xbf\xae\xf6" ++ "\x76\x8f\x6b\x12\xaf\x0d\xc6\x2e" ++ "\x2c\xfe\x35\xdf\x62\x01\xb7\xee" ++ "\x49\xd5\x29\x49\x43\xe4\xfe\x3c" ++ "\x03\xeb\x7a\x04\x6a\xbc\xaf\x44" ++ "\xab\x7d\xe6\x65\xa3\x98\x9c\x77" ++ "\x03\x18\x4e\x90\x13\x3a\x47\x81" ++ "\x8b\x1f\x5d\x11\x6e\xfb\xe2\x56" ++ "\x52\x96\x38\x59\x48\xea\x4e\x9e" ++ "\x25\xe8\xa2\x20\x34\xa3\x90\x1f" ++ "\x01\xee\xa9\x73\xd9\xeb\xca\xbb" ++ "\x36\x76\xc7\x64\xeb\x74\xf7\x10" ++ "\x58\xd1\x77\x41\x91\x1e\xf5\x2b" ++ "\x86\x34\x3f\xe8\x34\x1e\x23\x01" ++ "\xf5\xd6\x36\x40\x60\x50\xec\xd5" ++ "\x22\x57\x75\x77\x75\x3d\xa5\x91" ++ "\xc5\x25\xf0\xc4\xe1\xab\x5b\xa0" ++ "\xb7\x48\xbb\x44\xff\x82\x2c\x40" ++ "\x5d\x02\x82\x01\x01\x00\xc6\xcf" ++ "\x64\x59\xf5\x21\xdf\x0d\x49\xcf" ++ "\x81\x4e\xb4\x73\x45\x65\xa2\x15" ++ "\x89\x33\xd8\x1d\x73\xa1\xa1\xbb" ++ "\x5e\x21\x34\x6e\xb5\xb9\x81\x54" ++ "\x9b\xcb\xc6\x8f\xf2\x23\xc0\x21" ++ "\xf3\x31\xcc\x27\xd5\xae\x43\xec" ++ "\xf2\x8e\x16\xc1\x58\x2b\xe9\x14" ++ "\x6c\x1e\x3e\x3a\x96\xe0\x3a\x7c" ++ "\x39\x19\x07\x00\x97\x8f\x84\xa1" ++ "\x91\x4e\xce\x3b\x2c\xc8\xe5\xfd" ++ "\x45\xad\xcb\x08\xf5\x9d\xf2\x38" ++ "\x80\x14\x5f\xef\xf4\xfb\x2d\xb1" ++ "\x47\x47\xf6\xf9\x1d\x12\xbf\x9d" ++ "\x8e\x0c\xe4\xd0\xe9\x9a\x0e\x5d" ++ "\x8c\xc7\xe1\xba\x89\x22\xa0\x56" ++ "\x8d\x4b\xcb\xb2\x77\xa8\x82\x63" ++ "\x21\x04\x7d\xbe\xe0\x9f\xa3\xbe" ++ "\xaf\xe0\xeb\x6c\xc6\x4a\x71\x1b" ++ "\xfa\xf2\x95\x7e\xf8\x44\x9e\x30" ++ "\xb8\x7c\xe5\x9b\xc7\xe9\x67\x58" ++ "\xe4\x53\xa6\x90\x2a\x65\x26\x68" ++ "\x7b\xee\x4e\xe1\x09\xbf\x58\x3c" ++ "\xc8\x76\xa1\x85\xd9\x71\x9a\xf9" ++ "\xeb\xb7\x0f\xb3\x14\x5e\xca\xac" ++ "\x8d\x4c\xd7\x94\xb2\x17\x1b\x13" ++ "\x04\xb9\x89\x7c\x64\x58\x2a\x1e" ++ "\x40\x28\xfe\x81\x7b\xcd\x64\x4b" ++ "\x24\x96\x6a\xe7\x8c\xd3\x49\xaf" ++ "\x51\xc6\xfd\xb7\x06\x00\x60\x7e" ++ "\x6b\x0a\x88\x06\x87\xa4\x03\x6c" ++ "\x94\x04\x3e\xcd\x02\x3c\xcf\x4d" ++ "\x1e\xa1\x69\xe3\x6b\x09\x02\x82" ++ "\x01\x01\x00\x84\x28\x48\x05\x7f" ++ "\x0c\x2a\xb0\x18\x5f\x8d\xac\xb6" ++ "\x0c\x66\xcc\xab\xe8\x77\xb3\x2c" ++ "\xa7\x86\x79\x10\x3b\xf5\xee\x5f" ++ "\x88\x73\x2c\xc0\x40\x84\xd0\xa6" ++ "\x5b\x3a\xac\x6f\x7b\x82\xed\x64" ++ "\xac\x7f\x0e\x4d\xd4\x5c\x49\x01" ++ "\xeb\xcc\xc3\x25\xbf\x04\xed\x28" ++ "\x7b\x49\xb2\xf4\x60\x59\x0a\x79" ++ "\x78\x18\xff\x34\x27\x9c\x74\x62" ++ "\xeb\xfe\xf1\x79\x11\xd8\xf5\xc8" ++ "\xe7\x70\x92\xfc\xb3\xf5\xa5\x58" ++ "\x3f\x06\x27\xc7\x4c\x8f\x25\x9b" ++ "\xc7\xe1\xe6\xe8\x85\x91\x38\xba" ++ "\x8b\xbf\xf8\x1d\x89\x85\xbd\x9a" ++ "\x45\x66\x3a\xac\x42\x74\xbb\x81" ++ "\x49\x86\x4e\x21\xc0\x2c\xa5\x32" ++ "\x49\xf1\xb0\x70\x27\x59\x8e\x3e" ++ "\xa8\x13\x36\x52\xc2\x98\xfd\x2e" ++ "\x20\x97\xba\xbd\x71\x79\x50\xbf" ++ "\x99\x3e\x8c\x54\xf4\x7b\x2a\x2b" ++ "\x8a\x7c\xde\xaa\x79\xd7\x3a\x7e" ++ "\x6a\x6d\x95\xc7\xf9\x36\x0e\xcb" ++ "\x94\x7c\xb3\x8f\x8f\x37\x0e\x50" ++ "\x2d\xad\x4d\xf9\x93\xdc\xd4\x6d" ++ "\xa3\x4d\x9f\xf0\x93\x03\x3c\x6a" ++ "\xc1\x3e\x81\xc4\x39\x5d\x95\x44" ++ "\x56\xfb\xbf\x01\x5e\x6e\xd4\x8b" ++ "\x05\xd2\x85\x38\x8e\x8e\x17\x4d" ++ "\xd7\x8c\x64\x36\x44\xb1\xdb\x14" ++ "\xbd\x89\x24\xc5\x34\x35\x7a\x8b" ++ "\x5e\xc0\x7e\x8b\x77\xd0\x34\x3e" ++ "\xd2\x5b\x21\x02\x82\x01\x01\x00" ++ "\xc4\x7c\x86\x1e\x8e\x31\xca\xa3" ++ "\xf4\x75\xfb\xc3\x50\x7e\xb8\x70" ++ "\x88\xef\xa5\xe9\x32\x47\x71\x57" ++ "\xa6\x63\x6a\xd5\x80\x5f\x86\x84" ++ "\xef\x78\x32\x7e\x04\x21\x91\xdb" ++ "\x99\x71\x34\x4c\xdc\x0b\xe6\x98" ++ "\xd3\x93\x23\xea\x20\x3d\x38\x2a" ++ "\x35\xb2\xb4\x64\x73\x76\x2e\x55" ++ "\x30\x18\x43\xca\x23\x6c\x87\x5e" ++ "\x15\x64\x25\x1b\x70\xa1\x75\x52" ++ "\x9c\x53\x63\x81\x2f\x30\x0c\xa7" ++ "\xec\x93\xc0\xa9\xe2\x63\x62\x88" ++ "\xb8\x91\x03\xf4\xf0\xf7\x25\xaf" ++ "\xb8\xe7\x3b\x54\x2c\xf4\xf8\x5b" ++ "\x04\xa5\x9a\x94\x95\xd8\x68\xde" ++ "\x6a\xfe\xff\xa8\x90\x8a\x32\xce" ++ "\xbd\x06\xc1\xc4\x11\x8f\x0b\xab" ++ "\x5b\x07\x04\x06\x54\x46\xed\xf6" ++ "\xf6\xb1\x03\xa4\xaa\xf1\x90\xe7" ++ "\x28\x3c\xd8\xa8\xbf\xb8\xe5\xac" ++ "\x1d\x32\xf2\x7e\x66\x19\x07\x7d" ++ "\x6e\xa7\x47\x0c\xb0\xb2\xa2\x92" ++ "\x94\xdf\x85\xf4\x11\x11\x1b\x65" ++ "\xb7\x18\x17\xc9\x95\xdf\x94\x5b" ++ "\x57\x0d\x90\x9d\x08\x57\x72\x67" ++ "\x79\x9f\xa3\x44\xc7\xc7\xc3\xd8" ++ "\x8a\xcf\xd8\xf3\x6b\x0d\x87\xd0" ++ "\xe7\xb5\x88\x54\x8d\x15\x89\xcd" ++ "\xec\x7e\x34\x61\x69\xb1\x70\x62" ++ "\x00\xfc\x10\x48\x99\x45\x72\xdb" ++ "\x3b\x73\x1d\x1a\xd1\x02\x86\x9a" ++ "\x98\xfb\x0c\x31\xd5\x58\x29\x19" ++ "\x02\x82\x01\x00\x00\x87\x87\x9b" ++ "\x3d\x45\x6c\xfb\x63\x20\xa1\xb9" ++ "\xf5\x69\xce\x6b\x96\xae\x69\xf0" ++ "\xe1\xf2\x8b\x39\x2a\x18\xc8\xca" ++ "\x58\xc1\x30\x2f\x15\xca\x93\x89" ++ "\x38\x37\x83\x85\x6e\x09\x5b\xad" ++ "\xac\x43\x23\xa3\x19\xfd\x1d\xc8" ++ "\xa2\x8f\x75\x55\xc8\xf7\x0e\x37" ++ "\xa8\x52\xd1\xb6\x94\x03\xc9\xe1" ++ "\xbf\xde\x4f\xd9\x3c\xa0\xc4\x2d" ++ "\x7d\x6a\x57\x02\xb6\x17\x05\xd7" ++ "\x0d\x43\xce\xf0\x2b\x95\xb3\x31" ++ "\xdf\x96\x03\x36\x5e\x5d\xed\xbd" ++ "\x71\xc3\xf2\x64\x2c\x3d\x3b\x64" ++ "\xfa\x3b\x83\x94\x6d\x07\xda\x52" ++ "\x44\x60\x51\xe5\x4b\xcf\x1d\xec" ++ "\x50\x50\xa6\xea\x39\x40\x18\x17" ++ "\x1d\xd8\xd2\xdf\xc9\x4e\x52\xf4" ++ "\x92\x95\x49\xd6\x3d\x1e\x03\xa2" ++ "\x85\xd7\x5c\xa4\x84\x6c\x80\x22" ++ "\x63\x14\x6c\x41\x20\x23\xbb\x54" ++ "\xc7\x05\x5f\xb7\xb4\x4e\xbd\x79" ++ "\x7d\xeb\xb6\x47\xcc\x70\xeb\x0e" ++ "\x98\x12\x09\x44\x7e\x22\x34\x6a" ++ "\x11\x17\x2f\xdd\xe2\xac\x51\xe9" ++ "\x97\x1c\xb1\xe9\xa2\x3e\xb2\xce" ++ "\x25\x9d\xb6\x67\xed\x11\x93\xa8" ++ "\x62\x49\xcb\x35\x41\xd2\xdd\x9b" ++ "\xb5\xb4\xcb\xcf\xd3\xd5\x09\xc4" ++ "\xfe\xfe\x49\x01\xc7\x0a\xe8\x9d" ++ "\xe3\x09\xa9\x3d\x73\x7f\x20\x8f" ++ "\xbb\x56\xda\x27\x28\x39\xbc\xf6" ++ "\x59\xfe\x77\xb2\x00", ++ .key_len = 2861, ++ /* ++ * m is SHA1 hash of following message: ++ * "\x15\x1a\x49\x51\x70\x2b\x73\xd2" ++ * "\xe6\xd0\xdc\x0d\x75\x72\x3a\xfd" ++ * "\x3f\x1c\xa8\x78\x3a\x3e\x1e\xfd" ++ * "\x69\x6e\xf5\x77\x45\x92\xce\x9b" ++ * "\x4b\xf7\x61\x12\xba\xbc\x18\xc4" ++ * "\x0d\x53\x5f\x79\x4e\x18\xfb\x42" ++ * "\x88\x7c\x78\x71\xae\x8a\xae\x76" ++ * "\x2c\x03\x0d\x89\xef\x80\x25\x46" ++ * "\x4a\x2a\x26\x70\xb5\xc3\x7a\xb7" ++ * "\x8e\x57\x03\xe9\xb5\x4a\x01\x76" ++ * "\xf7\xe5\xf8\x6b\xd8\x18\xc6\x71" ++ * "\x68\x17\xd5\x34\x73\xa6\x1b\x10" ++ * "\x3c\x14\xc4\x50\x8f\xf3\x28\x81" ++ * "\xe8\x51\x8a\x75\xfc\x16\x8d\x01" ++ * "\x37\x81\x30\x0b\x91\x62\x5b\x0f" ++ * "\x7a\xb6\x64\xde\x44\x62\x08\x18" ++ * "\xcc\xff\x00\x42\x4c\x39\xf8\x28" ++ * "\xf0\x89\xce\x33\x28\x41\x28\xcc" ++ * "\xf5\x19\x96\x7c\xbf\xe7\x10\x3d" ++ * "\x57\x10\x89\x88\x1b\x19\x0b\xb6" ++ * "\x84\xb2\xb6\x24\xe3\x82\x1b\xce" ++ * "\xfe\xf0\xf3\xa1\x9f\xb2\x1f\x04" ++ * "\x3f\x7f\xf7\x4f\x19\x8d\xcb\x83" ++ * "\x24\xe3\xc5\x67\x08\xf6\x18\xe3" ++ * "\x2b\x6d\xe6\x47\x46\x67\x4c\xec" ++ * "\x69\xaf\x0a\x8b\x6a\x35\x20\x1d" ++ * "\x77\x91\x7f\x34\xfd\x36\x24\x6b" ++ * "\xfa\xfd\x8c\x2f\x6f\x85\x7e\x08" ++ * "\x7b\x5e\xd6\xc0\xd0\x97\x95\xbe" ++ * "\xb4\xf4\x86\x3d\xf8\xc6\x80\xb1" ++ * "\x12\x35\xec\x86\xff\x94\x41\x02" ++ * "\x2e\xb7\xde\xdc\x25\x00\xe0\xf0" ++ */ ++ .m = ++ "\x11\xf6\xe7\xb6\x78\x4b\xaf\x4e" ++ "\xe2\x48\x2a\x00\x48\x9c\xc9\xf6" ++ "\x4e\xc0\x6f\x13", ++ .m_size = 20, ++ .c = ++ "\x59\x13\xb0\xd9\x68\xe8\xe3\x0b" ++ "\x46\x0f\xdf\x4c\x0d\x23\x83\x86" ++ "\xa0\x16\x46\xc8\x9e\xca\x9a\xda" ++ "\x1e\xc4\x69\xd3\xc5\x84\x3d\x32" ++ "\x73\xf2\x4c\x85\x22\x3f\x07\xd0" ++ "\xfc\x0e\x36\xdb\x3c\xdd\x07\xb5" ++ "\x09\xd0\x0b\x2e\xe1\x04\x0b\x02" ++ "\xb5\x68\x91\xfa\x17\x83\xf7\xb3" ++ "\x40\xea\x86\xc4\x70\x6e\xa0\x1b" ++ "\x5c\x9b\xbe\x8a\xf9\x2d\xb6\x28" ++ "\xeb\xcc\x73\xbb\x60\x50\x51\xfa" ++ "\xbc\x6c\x52\x0c\x1c\x13\x37\xaa" ++ "\xff\x06\xc0\xc8\xff\x75\x1b\x17" ++ "\x01\xe7\x59\x6e\xa6\x71\x29\xbe" ++ "\xf2\x85\xe9\x2e\xb1\x09\x90\xe6" ++ "\xab\x1d\x99\xf2\xce\x66\x6d\xd6" ++ "\xf9\x02\x76\x00\x2f\xd3\xd3\x2e" ++ "\x98\x2d\x2c\x92\x4e\x3f\xc3\xb8" ++ "\x29\x6d\x11\x30\x6f\xa4\x33\x87" ++ "\x6b\xe9\x69\x99\xea\x4d\x99\x60" ++ "\x37\xd9\xbb\x1b\x54\x63\xab\x62" ++ "\x00\xc3\xdd\x2b\x33\xaf\xf2\x22" ++ "\xa9\xd8\x66\xe4\x7b\x2b\xe6\xf7" ++ "\x9e\x4a\x13\xc8\x6b\x3f\x0a\xd9" ++ "\x31\x9c\xb2\x80\xf2\x00\x43\xd3" ++ "\x70\x49\x89\xb4\x09\x6d\xde\xc9" ++ "\x07\x84\x77\x85\xbc\x84\x47\xcf" ++ "\x4f\xa8\x3b\x11\xc0\x41\x33\xbb" ++ "\x54\x11\xa2\x66\xdd\x44\xd0\x87" ++ "\xc5\xea\x6a\xc1\x08\x8d\x9a\x0b" ++ "\x8b\x9e\xd8\x5c\x03\xf6\x13\x4a" ++ "\xd8\xdb\x5b\xcd\x35\x91\xbc\x69" ++ "\x40\x83\x8a\xbe\xba\x45\xd2\xf4" ++ "\x08\x04\xc4\x9f\x2f\xf1\xe2\x0b" ++ "\xb7\xec\x91\x5a\xe4\xbe\xa3\xb6" ++ "\xc9\xec\x79\x3c\x60\x0a\x6a\xe9" ++ "\x93\xa4\xec\x3e\xbb\x84\x59\xad" ++ "\x65\x09\x10\x0b\xcd\xa7\x1b\xdf" ++ "\xec\x15\x2f\xb1\xac\x5c\xf6\xab" ++ "\x44\x99\xa3\xae\x82\xeb\x01\x7a" ++ "\x17\x4a\xa6\xe2\x4f\x4f\x77\x0b" ++ "\xd6\x25\x54\x82\x53\xa4\xf9\x23" ++ "\x41\xa0\xa3\x4a\x88\xc2\xf8\xfa" ++ "\x51\x0a\xd7\x0f\xbd\x1e\xf3\x52" ++ "\x2a\x21\x3d\xb8\x04\xa5\xbc\x5b" ++ "\xa2\x61\xcf\x89\xc0\xce\x9b\x6a" ++ "\xd6\x29\xbe\x82\x7f\x36\xd1\x64" ++ "\x6e\x7c\x35\x0c\x3f\x55\xb1\x23" ++ "\x2f\x84\xbb\x56\x52\xe5\x0b\x0e" ++ "\x88\xac\x17\xb1\x6c\x1c\x60\xfc" ++ "\x82\xae\xe5\x3a\x1d\x3f\x40\x48" ++ "\x5d\xbc\xc0\xba\x89\x9b\x26\x33" ++ "\xec\x18\x3b\xa8\xfc\x5b\x35\xc0" ++ "\x25\xd1\xc8\x79\x72\x74\x8e\x5a" ++ "\xa3\xf1\x72\x63\x72\xec\xfd\xc7" ++ "\xe4\x14\x0d\xeb\xd0\x4b\x17\xd1" ++ "\x8a\x28\x43\x8f\x30\xce\xf6\x87" ++ "\xe3\xd5\xe3\xce\xd0\x54\xaa\x5d" ++ "\x65\x7b\xf7\x67\xeb\x5e\x5d\xf4" ++ "\x73\x2a\x86\x71\x14\x09\x25\x1c" ++ "\x48\xd9\x98\xc8\x0a\x15\x58\x62" ++ "\x51\xe7\x7c\xce\x0a\xf0\x6d\xd9" ++ "\x20\x68\x11\x8c\x3b\x2d\xd9\xcb" ++ "\x13\xe1\x1c\xe3\x2c\x80\xbb\x9a", ++ .c_size = 512, ++ .siggen_sigver_test = true, ++ } ++}; ++ +static const struct akcipher_testvec pkcs1pad_rsa_sha224_tv_template[] = { + { + .key = @@ -700,13 +1141,13 @@ index 505227ef8924..34ee73c9ce23 100644 static const struct akcipher_testvec pkcs1pad_rsa_tv_template[] = { { .key = -@@ -1469,6 +1717,845 @@ static const struct akcipher_testvec pkcs1pad_rsa_tv_template[] = { +@@ -1344,6 +2065,845 @@ static const struct akcipher_testvec pkcs1pad_rsa_tv_template[] = { } }; +static const struct akcipher_testvec pkcs1pad_rsa_sha384_tv_template[] = { + { -+ .key = ++ .key = + "\x30\x82\x08\x62\x02\x01\x00\x02" + "\x82\x01\x81\x00\xdb\x3b\x5c\x32" + "\xa2\x13\x31\xe2\xb4\x90\xf6\x82" @@ -1004,7 +1445,7 @@ index 505227ef8924..34ee73c9ce23 100644 + * "\x5d\x19\x34\xfe\x38\x06\x7f\xb4" + * "\xcd\xed\xc3\xfe\xe2\x6e\xb1\x74" + */ -+ .m = ++ .m = + "\x3e\xea\x5d\xc1\x7d\x4a\x8e\x82" + "\x29\x12\x8f\xc4\x8b\xbd\xea\xfd" + "\x7d\x6e\x45\x5d\xcc\xf6\xf0\x36" @@ -1068,7 +1509,7 @@ index 505227ef8924..34ee73c9ce23 100644 + +static const struct akcipher_testvec pkcs1pad_rsa_sha512_tv_template[] = { + { -+ .key = ++ .key = + "\x30\x82\x0b\x28\x02\x01\x00\x02" + "\x82\x02\x01\x00\xb0\xf8\x80\x65" + "\x86\xb7\x22\xf4\x14\x07\x04\xf0" @@ -1463,7 +1904,7 @@ index 505227ef8924..34ee73c9ce23 100644 + * "\x12\x35\xec\x86\xff\x94\x41\x02" + * "\x2e\xb7\xde\xdc\x25\x00\xe0\xf0" + */ -+ .m = ++ .m = + "\x75\x6e\x38\x30\xab\x85\x52\xff" + "\xb6\xa2\xa7\x16\x22\x05\xb6\x63" + "\xaa\xc7\xdb\xdd\x37\x38\x25\x02" @@ -1473,7 +1914,7 @@ index 505227ef8924..34ee73c9ce23 100644 + "\xcd\x5b\x02\x60\x61\x67\x55\xb5" + "\x56\x37\x34\x6a\xbd\x22\x46\xb1", + .m_size = 64, -+ .c = ++ .c = + "\xae\x51\xd3\xbf\x63\xc8\xaa\x4d" + "\xce\xea\xa9\xf3\xea\x3b\x89\x5d" + "\x76\x00\xcf\xc5\xe8\xdc\x06\xe8" @@ -1546,7 +1987,7 @@ index 505227ef8924..34ee73c9ce23 100644 static const struct kpp_testvec dh_tv_template[] = { { .secret = -@@ -4524,6 +5611,52 @@ static const struct kpp_testvec ecdh_p384_tv_template[] = { +@@ -4399,6 +5959,52 @@ static const struct kpp_testvec ecdh_p384_tv_template[] = { .b_public_size = 96, .expected_a_public_size = 96, .expected_ss_size = 48 @@ -1599,7 +2040,7 @@ index 505227ef8924..34ee73c9ce23 100644 } }; -@@ -7706,6 +8839,98 @@ static const struct hash_testvec aes_cmac128_tv_template[] = { +@@ -7640,6 +9246,98 @@ static const struct hash_testvec aes_cmac128_tv_template[] = { "\x69\x6a\x2c\x05\x6c\x31\x54\x10", .psize = 64, .ksize = 32, @@ -1698,48 +2139,7 @@ index 505227ef8924..34ee73c9ce23 100644 } }; -@@ -24116,6 +25341,40 @@ static const struct drbg_testvec drbg_pr_hmac_sha256_tv_template[] = { - }, - }; - -+static const struct drbg_testvec drbg_pr_ctr_aes192_tv_template[] = { -+ { -+ .entropy = (unsigned char *) -+ "\x96\x5f\xa6\xa2\xc4\x00\x9c\x04\x5c\xff" -+ "\x72\x8f\x24\x42\x38\x26\x25\x08\xbf\x00" -+ "\x8d\xcc\xef\x30\x1d\x22\x59\x1b\x09\x78" -+ "\x73\xd1\x24\xc3\xf8\xc4\x08\xf8\x91\x61", -+ .entropylen = 40, -+ .entpra = (unsigned char *) -+ "\x97\x18\xb8\x80\x42\xa4\xb6\x07\x67\xca" -+ "\xe0\xff\xc7\x97\xe6\x88\xb0\xfe\x38\x19" -+ "\xdb\x2a\x4b\xcb", -+ .entprb = (unsigned char *) -+ "\x73\xe3\xf0\xfd\xf3\x80\xe5\xe6\x12\x6f" -+ "\xf9\xf3\xad\xb3\x4f\xf5\xbc\xc4\x5f\xba" -+ "\x0c\xe1\xd2\x48", -+ .entprlen = 24, -+ .expected = (unsigned char *) -+ "\x90\x9f\xd2\xc9\x71\x92\x1c\x77\x32\x2e" -+ "\x1d\xf2\x73\xa0\x7d\x19\xf5\x27\x13\x3e" -+ "\x56\xa9\xbe\x38\x8c\x29\x8c\xa6\x83\x08" -+ "\x73\xd1\xe8\x47\xb8\xcc\x65\x4d\xd3\xc5" -+ "\x7c\x1c\x8b\x25\xfd\x39\x09\xbe\x84\x7c" -+ "\x1a\x28\x11\x08\x94\x0f\xe7\xf0\x6d\x9d" -+ "\xb6\x0a\xd7\xb4", -+ .expectedlen = 64, -+ .addtla = NULL, -+ .addtlb = NULL, -+ .addtllen = 0, -+ .pers = NULL, -+ .perslen = 0, -+ } -+}; -+ - static const struct drbg_testvec drbg_pr_ctr_aes128_tv_template[] = { - { - .entropy = (unsigned char *) -@@ -24232,6 +25491,185 @@ static const struct drbg_testvec drbg_pr_ctr_aes128_tv_template[] = { +@@ -22994,6 +24692,185 @@ static const struct cprng_testvec ansi_cprng_aes_tv_template[] = { }, }; @@ -1925,41 +2325,36 @@ index 505227ef8924..34ee73c9ce23 100644 /* * SP800-90A DRBG Test vectors from * http://csrc.nist.gov/groups/STM/cavp/documents/drbg/drbgtestvectors.zip -@@ -24362,6 +25800,45 @@ static const struct drbg_testvec drbg_nopr_sha256_tv_template[] = { +@@ -23318,6 +25195,40 @@ static const struct drbg_testvec drbg_pr_hmac_sha256_tv_template[] = { }, }; -+static const struct drbg_testvec drbg_nopr_hmac_sha384_tv_template[] = { ++static const struct drbg_testvec drbg_pr_ctr_aes192_tv_template[] = { + { + .entropy = (unsigned char *) -+ "\xa1\xdc\x2d\xfe\xda\x4f\x3a\x11\x24\xe0" -+ "\xe7\x5e\xbf\xbe\x5f\x98\xca\xc1\x10\x18" -+ "\x22\x1d\xda\x3f\xdc\xf8\xf9\x12\x5d\x68" -+ "\x44\x7a\xba\xe5\xea\x27\x16\x65\x40\x51" -+ "\x52\x68\xa4\x93\xa9\x6b\x51\x87", -+ .entropylen = 48, ++ "\x96\x5f\xa6\xa2\xc4\x00\x9c\x04\x5c\xff" ++ "\x72\x8f\x24\x42\x38\x26\x25\x08\xbf\x00" ++ "\x8d\xcc\xef\x30\x1d\x22\x59\x1b\x09\x78" ++ "\x73\xd1\x24\xc3\xf8\xc4\x08\xf8\x91\x61", ++ .entropylen = 40, ++ .entpra = (unsigned char *) ++ "\x97\x18\xb8\x80\x42\xa4\xb6\x07\x67\xca" ++ "\xe0\xff\xc7\x97\xe6\x88\xb0\xfe\x38\x19" ++ "\xdb\x2a\x4b\xcb", ++ .entprb = (unsigned char *) ++ "\x73\xe3\xf0\xfd\xf3\x80\xe5\xe6\x12\x6f" ++ "\xf9\xf3\xad\xb3\x4f\xf5\xbc\xc4\x5f\xba" ++ "\x0c\xe1\xd2\x48", ++ .entprlen = 24, + .expected = (unsigned char *) -+ "\x22\x82\x93\xe5\x9b\x1e\x45\x45\xa4\xff" -+ "\x9f\x23\x26\x16\xfc\x51\x08\xa1\x12\x8d" -+ "\xeb\xd0\xf7\xc2\x0a\xce\x83\x7c\xa1\x05" -+ "\xcb\xf2\x4c\x0d\xac\x1f\x98\x47\xda\xfd" -+ "\x0d\x05\x00\x72\x1f\xfa\xd3\xc6\x84\xa9" -+ "\x92\xd1\x10\xa5\x49\xa2\x64\xd1\x4a\x89" -+ "\x11\xc5\x0b\xe8\xcd\x6a\x7e\x8f\xac\x78" -+ "\x3a\xd9\x5b\x24\xf6\x4f\xd8\xcc\x4c\x8b" -+ "\x64\x9e\xac\x2b\x15\xb3\x63\xe3\x0d\xf7" -+ "\x95\x41\xa6\xb8\xa1\xca\xac\x23\x89\x49" -+ "\xb4\x66\x43\x69\x4c\x85\xe1\xd5\xfc\xbc" -+ "\xd9\xaa\xae\x62\x60\xac\xee\x66\x0b\x8a" -+ "\x79\xbe\xa4\x8e\x07\x9c\xeb\x6a\x5e\xaf" -+ "\x49\x93\xa8\x2c\x3f\x1b\x75\x8d\x7c\x53" -+ "\xe3\x09\x4e\xea\xc6\x3d\xc2\x55\xbe\x6d" -+ "\xcd\xcc\x2b\x51\xe5\xca\x45\xd2\xb2\x06" -+ "\x84\xa5\xa8\xfa\x58\x06\xb9\x6f\x84\x61" -+ "\xeb\xf5\x1b\xc5\x15\xa7\xdd\x8c\x54\x75" -+ "\xc0\xe7\x0f\x2f\xd0\xfa\xf7\x86\x9a\x99" -+ "\xab\x6c", -+ .expectedlen = 192, ++ "\x90\x9f\xd2\xc9\x71\x92\x1c\x77\x32\x2e" ++ "\x1d\xf2\x73\xa0\x7d\x19\xf5\x27\x13\x3e" ++ "\x56\xa9\xbe\x38\x8c\x29\x8c\xa6\x83\x08" ++ "\x73\xd1\xe8\x47\xb8\xcc\x65\x4d\xd3\xc5" ++ "\x7c\x1c\x8b\x25\xfd\x39\x09\xbe\x84\x7c" ++ "\x1a\x28\x11\x08\x94\x0f\xe7\xf0\x6d\x9d" ++ "\xb6\x0a\xd7\xb4", ++ .expectedlen = 64, + .addtla = NULL, + .addtlb = NULL, + .addtllen = 0, @@ -1968,10 +2363,10 @@ index 505227ef8924..34ee73c9ce23 100644 + }, +}; + - static const struct drbg_testvec drbg_nopr_hmac_sha256_tv_template[] = { + static const struct drbg_testvec drbg_pr_ctr_aes128_tv_template[] = { { .entropy = (unsigned char *) -@@ -25107,6 +26584,283 @@ static const struct cipher_testvec cast5_ctr_tv_template[] = { +@@ -23434,6 +25345,283 @@ static const struct drbg_testvec drbg_pr_ctr_aes128_tv_template[] = { }, }; @@ -2253,12 +2648,83 @@ index 505227ef8924..34ee73c9ce23 100644 +}; + /* - * ARC4 test vectors from OpenSSL - */ -@@ -34482,7 +36236,94 @@ static const struct cipher_testvec adiantum_xchacha20_aes_tv_template[] = { - "\xe9\xe1\xa0\xfe\xb2\xc3\x80\x77" - "\x20\x05\xe4\x9b\x47\x3b\xb2\xbd", - .len = 4096, + * SP800-90A DRBG Test vectors from + * http://csrc.nist.gov/groups/STM/cavp/documents/drbg/drbgtestvectors.zip +@@ -23564,6 +25752,70 @@ static const struct drbg_testvec drbg_nopr_sha256_tv_template[] = { + }, + }; + ++static const struct drbg_testvec drbg_nopr_hmac_sha1_tv_template[] = { ++ { ++ .entropy = (unsigned char *) ++ "\xe9\x1b\x63\x30\x9e\x93\xd1\xd0\x8e\x30" ++ "\xe8\xd5\x56\x90\x68\x75\xf5\x97\x47\xc4" ++ "\x68\xb0\xd0\xda", ++ .entropylen = 24, ++ .expected = (unsigned char *) ++ "\xb7\x92\x8f\x95\x03\xa4\x17\x11\x07\x88" ++ "\xf9\xd0\xc2\x58\x5f\x8a\xee\x6f\xb7\x3b" ++ "\x22\x0a\x62\x6b\x3a\xb9\x82\x5b\x7a\x9f" ++ "\xac\xc7\x97\x23\xd7\xe1\xba\x92\x55\xe4" ++ "\x0e\x65\xc2\x49\xb6\x08\x2a\x7b\xc5\xe3" ++ "\xf1\x29\xd3\xd8\xf6\x9b\x04\xed\x11\x83" ++ "\x41\x9d\x6c\x4f\x2a\x13\xb3\x04\xd2\xc5" ++ "\x74\x3f\x41\xc8\xb0\xee\x73\x22\x53\x47", ++ .expectedlen = 80, ++ .addtla = NULL, ++ .addtlb = NULL, ++ .addtllen = 0, ++ .pers = NULL, ++ .perslen = 0, ++ }, ++}; ++ ++static const struct drbg_testvec drbg_nopr_hmac_sha384_tv_template[] = { ++ { ++ .entropy = (unsigned char *) ++ "\xa1\xdc\x2d\xfe\xda\x4f\x3a\x11\x24\xe0" ++ "\xe7\x5e\xbf\xbe\x5f\x98\xca\xc1\x10\x18" ++ "\x22\x1d\xda\x3f\xdc\xf8\xf9\x12\x5d\x68" ++ "\x44\x7a\xba\xe5\xea\x27\x16\x65\x40\x51" ++ "\x52\x68\xa4\x93\xa9\x6b\x51\x87", ++ .entropylen = 48, ++ .expected = (unsigned char *) ++ "\x22\x82\x93\xe5\x9b\x1e\x45\x45\xa4\xff" ++ "\x9f\x23\x26\x16\xfc\x51\x08\xa1\x12\x8d" ++ "\xeb\xd0\xf7\xc2\x0a\xce\x83\x7c\xa1\x05" ++ "\xcb\xf2\x4c\x0d\xac\x1f\x98\x47\xda\xfd" ++ "\x0d\x05\x00\x72\x1f\xfa\xd3\xc6\x84\xa9" ++ "\x92\xd1\x10\xa5\x49\xa2\x64\xd1\x4a\x89" ++ "\x11\xc5\x0b\xe8\xcd\x6a\x7e\x8f\xac\x78" ++ "\x3a\xd9\x5b\x24\xf6\x4f\xd8\xcc\x4c\x8b" ++ "\x64\x9e\xac\x2b\x15\xb3\x63\xe3\x0d\xf7" ++ "\x95\x41\xa6\xb8\xa1\xca\xac\x23\x89\x49" ++ "\xb4\x66\x43\x69\x4c\x85\xe1\xd5\xfc\xbc" ++ "\xd9\xaa\xae\x62\x60\xac\xee\x66\x0b\x8a" ++ "\x79\xbe\xa4\x8e\x07\x9c\xeb\x6a\x5e\xaf" ++ "\x49\x93\xa8\x2c\x3f\x1b\x75\x8d\x7c\x53" ++ "\xe3\x09\x4e\xea\xc6\x3d\xc2\x55\xbe\x6d" ++ "\xcd\xcc\x2b\x51\xe5\xca\x45\xd2\xb2\x06" ++ "\x84\xa5\xa8\xfa\x58\x06\xb9\x6f\x84\x61" ++ "\xeb\xf5\x1b\xc5\x15\xa7\xdd\x8c\x54\x75" ++ "\xc0\xe7\x0f\x2f\xd0\xfa\xf7\x86\x9a\x99" ++ "\xab\x6c", ++ .expectedlen = 192, ++ .addtla = NULL, ++ .addtlb = NULL, ++ .addtllen = 0, ++ .pers = NULL, ++ .perslen = 0, ++ }, ++}; ++ + static const struct drbg_testvec drbg_nopr_hmac_sha256_tv_template[] = { + { + .entropy = (unsigned char *) +@@ -34639,7 +36891,94 @@ static const struct cipher_testvec cts_mode_tv_template[] = { + "\x26\x73\x0d\xbc\x2f\x7b\xc8\x40" + "\x9d\xad\x8b\xbb\x96\xc4\xcd\xc0" + "\x3b\xc1\x03\xe1\xa1\x94\xbb\xd8", - } + }, { /* keyLen = 24 */ + .klen = 24, @@ -2352,5 +2818,4 @@ index 505227ef8924..34ee73c9ce23 100644 /* -- -2.35.6 - +2.42.0 diff --git a/SPECS/91/linux/canister_builder/patches/1003-FIPS-crypto-drbg-Jitterentropy-RNG-as-the-only-RND.patch b/SPECS/linux/6.1/crypto/0003-FIPS-crypto-drbg-Jitterentropy-RNG-as-the-only-RND.patch similarity index 87% rename from SPECS/91/linux/canister_builder/patches/1003-FIPS-crypto-drbg-Jitterentropy-RNG-as-the-only-RND.patch rename to SPECS/linux/6.1/crypto/0003-FIPS-crypto-drbg-Jitterentropy-RNG-as-the-only-RND.patch index 82a1735459..d5df06b8ca 100644 --- a/SPECS/91/linux/canister_builder/patches/1003-FIPS-crypto-drbg-Jitterentropy-RNG-as-the-only-RND.patch +++ b/SPECS/linux/6.1/crypto/0003-FIPS-crypto-drbg-Jitterentropy-RNG-as-the-only-RND.patch @@ -1,4 +1,4 @@ -From cbd39b5b51509db4a13afa72b61ddf56957928f3 Mon Sep 17 00:00:00 2001 +From 009a1fc5cf8a63275a224dd895f7e1c5791d1f2b Mon Sep 17 00:00:00 2001 From: srinidhira0 Date: Thu, 18 Feb 2021 21:17:40 +0000 Subject: [PATCH] FIPS:crypto:drbg: Jitterentropy RNG as the only RND source @@ -17,19 +17,16 @@ using crypto_alloc_rng for "jitternetropy_rng". Signed-off-by: srinidhira0 Signed-off-by: Keerthana K - -[Srinidhi Rao Ported this patch to v6.12.x] -Signed-off-by: srinidhira0 --- - crypto/drbg.c | 95 ++++++++++++++++++++++++++++++++++++++------------- - crypto/ecc.c | 25 +++++++++++++- - 2 files changed, 95 insertions(+), 25 deletions(-) + crypto/drbg.c | 93 +++++++++++++++++++++++++++++++++++++++------------ + crypto/ecc.c | 26 +++++++++++++- + 2 files changed, 97 insertions(+), 22 deletions(-) diff --git a/crypto/drbg.c b/crypto/drbg.c -index 3addce90930c..1ff3052d4f42 100644 +index 177983b6a..9baf2ec07 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c -@@ -1132,7 +1132,7 @@ static bool drbg_nopr_reseed_interval_elapsed(struct drbg_state *drbg) +@@ -1148,7 +1148,7 @@ static bool drbg_nopr_reseed_interval_elapsed(struct drbg_state *drbg) static int drbg_seed(struct drbg_state *drbg, struct drbg_string *pers, bool reseed) { @@ -38,7 +35,7 @@ index 3addce90930c..1ff3052d4f42 100644 unsigned char entropy[((32 + 16) * 2)]; unsigned int entropylen = drbg_sec_strength(drbg->core->flags); struct drbg_string data1; -@@ -1165,27 +1165,26 @@ static int drbg_seed(struct drbg_state *drbg, struct drbg_string *pers, +@@ -1181,27 +1181,26 @@ static int drbg_seed(struct drbg_state *drbg, struct drbg_string *pers, BUG_ON((entropylen * 2) > sizeof(entropy)); /* Get seed from in-kernel /dev/urandom */ @@ -81,7 +78,7 @@ index 3addce90930c..1ff3052d4f42 100644 /* * Do not treat the transient failure of the -@@ -1200,15 +1199,49 @@ static int drbg_seed(struct drbg_state *drbg, struct drbg_string *pers, +@@ -1216,15 +1215,49 @@ static int drbg_seed(struct drbg_state *drbg, struct drbg_string *pers, * However, we mandate that at least the first * seeding operation must succeed with the * Jitter RNG. @@ -135,7 +132,7 @@ index 3addce90930c..1ff3052d4f42 100644 } list_add_tail(&data1.list, &seedlist); -@@ -1424,9 +1457,23 @@ static int drbg_generate(struct drbg_state *drbg, +@@ -1440,9 +1473,23 @@ static int drbg_generate(struct drbg_state *drbg, } else if (rng_is_initialized() && (drbg->seeded == DRBG_SEED_STATE_PARTIAL || drbg_nopr_reseed_interval_elapsed(drbg))) { @@ -163,10 +160,18 @@ index 3addce90930c..1ff3052d4f42 100644 if (addtl && 0 < addtl->len) diff --git a/crypto/ecc.c b/crypto/ecc.c -index 50ad2d4ed672..234eb2b89c6d 100644 +index 7315217c8..b2a412d94 100644 --- a/crypto/ecc.c +++ b/crypto/ecc.c -@@ -1659,6 +1659,26 @@ int ecc_is_pubkey_valid_full(const struct ecc_curve *curve, +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + + #include "ecc_curve_defs.h" + +@@ -1604,6 +1605,26 @@ int ecc_is_pubkey_valid_full(const struct ecc_curve *curve, } EXPORT_SYMBOL(ecc_is_pubkey_valid_full); @@ -193,7 +198,7 @@ index 50ad2d4ed672..234eb2b89c6d 100644 int crypto_ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits, const u64 *private_key, const u64 *public_key, u64 *secret) -@@ -1676,7 +1696,10 @@ int crypto_ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits, +@@ -1623,7 +1644,10 @@ int crypto_ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits, nbytes = ndigits << ECC_DIGITS_TO_BYTES_SHIFT; @@ -206,5 +211,5 @@ index 50ad2d4ed672..234eb2b89c6d 100644 pk = ecc_alloc_point(ndigits); if (!pk) { -- -2.39.4 +2.23.3 diff --git a/SPECS/91/linux/fips_compliance/0001-disable-md5-and-sha1-algorithms-for-sctp-if-fips-is-enabled.patch b/SPECS/linux/6.1/crypto/6.0-0001-disable-md5-algorithm-for-sctp-if-fips-is-enabled.patch similarity index 78% rename from SPECS/91/linux/fips_compliance/0001-disable-md5-and-sha1-algorithms-for-sctp-if-fips-is-enabled.patch rename to SPECS/linux/6.1/crypto/6.0-0001-disable-md5-algorithm-for-sctp-if-fips-is-enabled.patch index c81588033c..85006d19a7 100644 --- a/SPECS/91/linux/fips_compliance/0001-disable-md5-and-sha1-algorithms-for-sctp-if-fips-is-enabled.patch +++ b/SPECS/linux/6.1/crypto/6.0-0001-disable-md5-algorithm-for-sctp-if-fips-is-enabled.patch @@ -1,15 +1,12 @@ From fd689eadb419d7fde009a6d3e4fe47136878d90d Mon Sep 17 00:00:00 2001 From: Ashwin Dayanand Kamat Date: Fri, 26 Nov 2021 23:25:57 +0000 -Subject: [PATCH] disable md5 and sha1 algorithms for sctp if fips is enabled +Subject: [PATCH] disable md5 algorithm for sctp if fips is enabled Signed-off-by: Keerthana K - -[Alexey: Disable sha1 also] -Signed-off-by: Alexey Makhalov --- - net/sctp/protocol.c | 7 +++++++++++ - 1 file changed, 7 insertions(+) + net/sctp/protocol.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index bcd3384..eb27841 100644 @@ -31,14 +28,18 @@ index bcd3384..eb27841 100644 /* Default sctp sockets to use md5 as their hmac alg */ #if defined (CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5) net->sctp.sctp_hmac_alg = "md5"; -@@ -1320,6 +1322,11 @@ static int __net_init sctp_defaults_init(struct net *net) +@@ -1320,6 +1322,15 @@ static int __net_init sctp_defaults_init(struct net *net) #else net->sctp.sctp_hmac_alg = NULL; #endif + } + + else { ++#if defined (CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA1) ++ net->sctp.sctp_hmac_alg = "sha1"; ++#else + net->sctp.sctp_hmac_alg = NULL; ++#endif + } /* Max.Burst - 4 */ diff --git a/SPECS/linux/6.1/crypto/tcrypt-disable-tests-that-are-not-enabled-in-photon.patch b/SPECS/linux/6.1/crypto/tcrypt-disable-tests-that-are-not-enabled-in-photon.patch new file mode 100644 index 0000000000..358a6fc025 --- /dev/null +++ b/SPECS/linux/6.1/crypto/tcrypt-disable-tests-that-are-not-enabled-in-photon.patch @@ -0,0 +1,180 @@ +From ad667e40b72b13b00b6f413b5cdb094c1f69c0f5 Mon Sep 17 00:00:00 2001 +From: Keerthana K +Date: Wed, 20 Nov 2019 10:52:57 +0530 +Subject: [PATCH 21/23] tcrypt: disable tests that are not enabled in photon + +1. Disable algorithmic tests which are fips_allowed and not supported in photon. +2. Added tests for DRBG and ECDH algorithms. +3. enable tests for newly included algorithms in LKCM 5.0 + +Signed-off-by: Keerthana K +Signed-off-by: Bo Gan +Signed-off-by: Srish Srinivasan +--- + crypto/tcrypt.c | 91 +++++++++++++++++++++++++++++++------------------ + 1 file changed, 58 insertions(+), 33 deletions(-) + +diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c +index b23235d58..e15ece765 100644 +--- a/crypto/tcrypt.c ++++ b/crypto/tcrypt.c +@@ -1522,7 +1522,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) + ret = min(ret, tcrypt_test("xts(aes)")); + ret = min(ret, tcrypt_test("ctr(aes)")); + ret = min(ret, tcrypt_test("rfc3686(ctr(aes))")); +- ret = min(ret, tcrypt_test("ofb(aes)")); + ret = min(ret, tcrypt_test("cfb(aes)")); + ret = min(ret, tcrypt_test("xctr(aes)")); + break; +@@ -1618,10 +1617,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) + ret = min(ret, tcrypt_test("gcm(aes)")); + break; + +- case 36: +- ret = min(ret, tcrypt_test("lzo")); +- break; +- + case 37: + ret = min(ret, tcrypt_test("ccm(aes)")); + break; +@@ -1754,10 +1749,68 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) + ret = min(ret, tcrypt_test("hmac(sha3-512)")); + break; + ++ case 117: ++ ret = min(ret, tcrypt_test("ecdsa-nist-p256")); ++ ret = min(ret, tcrypt_test("ecdsa-nist-p384")); ++ break; ++ ++ case 119: ++ ret += tcrypt_test("drbg_pr_ctr_aes128"); ++ ret += tcrypt_test("drbg_pr_ctr_aes192"); ++ ret += tcrypt_test("drbg_pr_ctr_aes256"); ++ break; ++ ++ case 121: ++ ret += tcrypt_test("drbg_pr_hmac_sha1"); ++ ret += tcrypt_test("drbg_pr_hmac_sha256"); ++ ret += tcrypt_test("drbg_pr_hmac_sha384"); ++ ret += tcrypt_test("drbg_pr_hmac_sha512"); ++ break; ++ ++ case 125: ++ ret += tcrypt_test("drbg_nopr_ctr_aes128"); ++ ret += tcrypt_test("drbg_nopr_ctr_aes192"); ++ ret += tcrypt_test("drbg_nopr_ctr_aes256"); ++ break; ++ ++ case 126: ++ ret += tcrypt_test("drbg_nopr_hmac_sha1"); ++ ret += tcrypt_test("drbg_nopr_hmac_sha256"); ++ ret += tcrypt_test("drbg_nopr_hmac_sha384"); ++ ret += tcrypt_test("drbg_nopr_hmac_sha512"); ++ break; ++ ++ case 130: ++ ret += tcrypt_test("ecdh-nist-p256"); ++ ret += tcrypt_test("ecdh-nist-p384"); ++ break; ++ ++ case 132: ++ ret += tcrypt_test("drbg_pr_sha1"); ++ ret += tcrypt_test("drbg_pr_sha256"); ++ ret += tcrypt_test("drbg_pr_sha384"); ++ ret += tcrypt_test("drbg_pr_sha512"); ++ break; ++ + case 115: + ret = min(ret, tcrypt_test("hmac(streebog256)")); + break; + ++ case 133: ++ ret += tcrypt_test("drbg_nopr_sha1"); ++ ret += tcrypt_test("drbg_nopr_sha256"); ++ ret += tcrypt_test("drbg_nopr_sha384"); ++ ret += tcrypt_test("drbg_nopr_sha512"); ++ break; ++ ++ case 134: ++ ret += tcrypt_test("pkcs1pad(rsa,sha1)"); ++ ret += tcrypt_test("pkcs1pad(rsa,sha224)"); ++ ret += tcrypt_test("pkcs1pad(rsa,sha256)"); ++ ret += tcrypt_test("pkcs1pad(rsa,sha384)"); ++ ret += tcrypt_test("pkcs1pad(rsa,sha512)"); ++ break; ++ + case 116: + ret = min(ret, tcrypt_test("hmac(streebog512)")); + break; +@@ -2421,10 +2474,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) + speed_template_16_24_32); + test_acipher_speed("cfb(aes)", DECRYPT, sec, NULL, 0, + speed_template_16_24_32); +- test_acipher_speed("ofb(aes)", ENCRYPT, sec, NULL, 0, +- speed_template_16_24_32); +- test_acipher_speed("ofb(aes)", DECRYPT, sec, NULL, 0, +- speed_template_16_24_32); + test_acipher_speed("rfc3686(ctr(aes))", ENCRYPT, sec, NULL, 0, + speed_template_20_28_36); + test_acipher_speed("rfc3686(ctr(aes))", DECRYPT, sec, NULL, 0, +@@ -2450,12 +2499,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) + test_acipher_speed("cfb(des3_ede)", DECRYPT, sec, + des3_speed_template, DES3_SPEED_VECTORS, + speed_template_24); +- test_acipher_speed("ofb(des3_ede)", ENCRYPT, sec, +- des3_speed_template, DES3_SPEED_VECTORS, +- speed_template_24); +- test_acipher_speed("ofb(des3_ede)", DECRYPT, sec, +- des3_speed_template, DES3_SPEED_VECTORS, +- speed_template_24); + break; + + case 502: +@@ -2471,10 +2514,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) + speed_template_8); + test_acipher_speed("cfb(des)", DECRYPT, sec, NULL, 0, + speed_template_8); +- test_acipher_speed("ofb(des)", ENCRYPT, sec, NULL, 0, +- speed_template_8); +- test_acipher_speed("ofb(des)", DECRYPT, sec, NULL, 0, +- speed_template_8); + break; + + case 503: +@@ -2663,10 +2702,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) + speed_template_16_24_32, num_mb); + test_mb_skcipher_speed("cfb(aes)", DECRYPT, sec, NULL, 0, + speed_template_16_24_32, num_mb); +- test_mb_skcipher_speed("ofb(aes)", ENCRYPT, sec, NULL, 0, +- speed_template_16_24_32, num_mb); +- test_mb_skcipher_speed("ofb(aes)", DECRYPT, sec, NULL, 0, +- speed_template_16_24_32, num_mb); + test_mb_skcipher_speed("rfc3686(ctr(aes))", ENCRYPT, sec, NULL, + 0, speed_template_20_28_36, num_mb); + test_mb_skcipher_speed("rfc3686(ctr(aes))", DECRYPT, sec, NULL, +@@ -2692,12 +2727,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) + test_mb_skcipher_speed("cfb(des3_ede)", DECRYPT, sec, + des3_speed_template, DES3_SPEED_VECTORS, + speed_template_24, num_mb); +- test_mb_skcipher_speed("ofb(des3_ede)", ENCRYPT, sec, +- des3_speed_template, DES3_SPEED_VECTORS, +- speed_template_24, num_mb); +- test_mb_skcipher_speed("ofb(des3_ede)", DECRYPT, sec, +- des3_speed_template, DES3_SPEED_VECTORS, +- speed_template_24, num_mb); + break; + + case 602: +@@ -2713,10 +2742,6 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb) + speed_template_8, num_mb); + test_mb_skcipher_speed("cfb(des)", DECRYPT, sec, NULL, 0, + speed_template_8, num_mb); +- test_mb_skcipher_speed("ofb(des)", ENCRYPT, sec, NULL, 0, +- speed_template_8, num_mb); +- test_mb_skcipher_speed("ofb(des)", DECRYPT, sec, NULL, 0, +- speed_template_8, num_mb); + break; + + case 603: +-- +2.39.0 diff --git a/SPECS/90/linux/esx/0001-Adding-SBX-kernel-driver.patch b/SPECS/linux/6.1/esx/0001-Adding-SBX-kernel-driver-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/0001-Adding-SBX-kernel-driver.patch rename to SPECS/linux/6.1/esx/0001-Adding-SBX-kernel-driver-6.1.patch diff --git a/SPECS/90/linux/esx/0001-MMIO_should_have_more_priority_then_IO.patch b/SPECS/linux/6.1/esx/0001-MMIO_should_have_more_priority_then_IO-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/0001-MMIO_should_have_more_priority_then_IO.patch rename to SPECS/linux/6.1/esx/0001-MMIO_should_have_more_priority_then_IO-6.1.patch diff --git a/SPECS/90/linux/esx/0001-NEWCA-make-initrd-pages-immutable.patch b/SPECS/linux/6.1/esx/0001-NEWCA-make-initrd-pages-immutable-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/0001-NEWCA-make-initrd-pages-immutable.patch rename to SPECS/linux/6.1/esx/0001-NEWCA-make-initrd-pages-immutable-6.1.patch diff --git a/SPECS/90/linux/esx/0001-external_entropy-Enable-External-Entropy-support.patch b/SPECS/linux/6.1/esx/0001-external_entropy-Enable-External-Entropy-support-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/0001-external_entropy-Enable-External-Entropy-support.patch rename to SPECS/linux/6.1/esx/0001-external_entropy-Enable-External-Entropy-support-6.1.patch diff --git a/SPECS/90/linux/esx/0001-fs-A-new-VTARFS-file-system-to-mount-VTAR-archive.patch b/SPECS/linux/6.1/esx/0001-fs-A-new-VTARFS-file-system-to-mount-VTAR-archive-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/0001-fs-A-new-VTARFS-file-system-to-mount-VTAR-archive.patch rename to SPECS/linux/6.1/esx/0001-fs-A-new-VTARFS-file-system-to-mount-VTAR-archive-6.1.patch diff --git a/SPECS/90/linux/esx/0001-fs-TARFS-file-system-to-mount-TAR-archive.patch b/SPECS/linux/6.1/esx/0001-fs-TARFS-file-system-to-mount-TAR-archive-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/0001-fs-TARFS-file-system-to-mount-TAR-archive.patch rename to SPECS/linux/6.1/esx/0001-fs-TARFS-file-system-to-mount-TAR-archive-6.1.patch diff --git a/SPECS/90/linux/esx/0001-fs-VTAR-archive-to-TPMFS-extractor.patch b/SPECS/linux/6.1/esx/0001-fs-VTAR-archive-to-TPMFS-extractor-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/0001-fs-VTAR-archive-to-TPMFS-extractor.patch rename to SPECS/linux/6.1/esx/0001-fs-VTAR-archive-to-TPMFS-extractor-6.1.patch diff --git a/SPECS/90/linux/esx/0001-initialize-MMCONFIG-if-already-not-initialized.patch b/SPECS/linux/6.1/esx/0001-initialize-MMCONFIG-if-already-not-initialized-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/0001-initialize-MMCONFIG-if-already-not-initialized.patch rename to SPECS/linux/6.1/esx/0001-initialize-MMCONFIG-if-already-not-initialized-6.1.patch diff --git a/SPECS/90/linux/esx/0001-initramfs-support-for-page-aligned-format-newca.patch b/SPECS/linux/6.1/esx/0001-initramfs-support-for-page-aligned-format-newca-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/0001-initramfs-support-for-page-aligned-format-newca.patch rename to SPECS/linux/6.1/esx/0001-initramfs-support-for-page-aligned-format-newca-6.1.patch diff --git a/SPECS/90/linux/esx/0001-vmw_extcfg-hotplug-without-firmware-support.patch b/SPECS/linux/6.1/esx/0001-vmw_extcfg-hotplug-without-firmware-support-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/0001-vmw_extcfg-hotplug-without-firmware-support.patch rename to SPECS/linux/6.1/esx/0001-vmw_extcfg-hotplug-without-firmware-support-6.1.patch diff --git a/SPECS/90/linux/esx/0002-vmw_extcfg-hotplug-without-firmware-support.patch b/SPECS/linux/6.1/esx/0002-vmw_extcfg-hotplug-without-firmware-support-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/0002-vmw_extcfg-hotplug-without-firmware-support.patch rename to SPECS/linux/6.1/esx/0002-vmw_extcfg-hotplug-without-firmware-support-6.1.patch diff --git a/SPECS/90/linux/esx/0002-x86-esx-report-guest-crash-to-vmware-hypervisor.patch b/SPECS/linux/6.1/esx/0002-x86-esx-report-guest-crash-to-vmware-hypervisor.patch similarity index 100% rename from SPECS/90/linux/esx/0002-x86-esx-report-guest-crash-to-vmware-hypervisor.patch rename to SPECS/linux/6.1/esx/0002-x86-esx-report-guest-crash-to-vmware-hypervisor.patch diff --git a/SPECS/90/linux/esx/0003-vmw_extcfg-hotplug-without-firmware-support.patch b/SPECS/linux/6.1/esx/0003-vmw_extcfg-hotplug-without-firmware-support-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/0003-vmw_extcfg-hotplug-without-firmware-support.patch rename to SPECS/linux/6.1/esx/0003-vmw_extcfg-hotplug-without-firmware-support-6.1.patch diff --git a/SPECS/90/linux/esx/02-pci-probe.patch b/SPECS/linux/6.1/esx/02-pci-probe-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/02-pci-probe.patch rename to SPECS/linux/6.1/esx/02-pci-probe-6.1.patch diff --git a/SPECS/90/linux/esx/07-vmware-only.patch b/SPECS/linux/6.1/esx/07-vmware-only-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/07-vmware-only.patch rename to SPECS/linux/6.1/esx/07-vmware-only-6.1.patch diff --git a/SPECS/90/linux/esx/halt-on-panic.patch b/SPECS/linux/6.1/esx/halt-on-panic-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/halt-on-panic.patch rename to SPECS/linux/6.1/esx/halt-on-panic-6.1.patch diff --git a/SPECS/90/linux/esx/poweroff-without-firmware.patch b/SPECS/linux/6.1/esx/poweroff-without-firmware-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/poweroff-without-firmware.patch rename to SPECS/linux/6.1/esx/poweroff-without-firmware-6.1.patch diff --git a/SPECS/90/linux/esx/revert-x86-entry-Align-entry-text-section-to-PMD-boundary.patch b/SPECS/linux/6.1/esx/revert-x86-entry-Align-entry-text-section-to-PMD-boundary-6.1.patch similarity index 100% rename from SPECS/90/linux/esx/revert-x86-entry-Align-entry-text-section-to-PMD-boundary.patch rename to SPECS/linux/6.1/esx/revert-x86-entry-Align-entry-text-section-to-PMD-boundary-6.1.patch diff --git a/SPECS/90/linux/esx/speedup-algos-registration-in-non-fips-mode.patch b/SPECS/linux/6.1/esx/speedup-algos-registration-in-non-fips-mode.patch similarity index 100% rename from SPECS/90/linux/esx/speedup-algos-registration-in-non-fips-mode.patch rename to SPECS/linux/6.1/esx/speedup-algos-registration-in-non-fips-mode.patch diff --git a/SPECS/90/linux/generic/0001-Control-MEMCG_KMEM-config.patch b/SPECS/linux/6.1/generic/0001-Control-MEMCG_KMEM-config.patch similarity index 100% rename from SPECS/90/linux/generic/0001-Control-MEMCG_KMEM-config.patch rename to SPECS/linux/6.1/generic/0001-Control-MEMCG_KMEM-config.patch diff --git a/SPECS/90/linux/generic/0001-cgroup-v1-cgroup_stat-support.patch b/SPECS/linux/6.1/generic/0001-cgroup-v1-cgroup_stat-support-6.1.patch similarity index 100% rename from SPECS/90/linux/generic/0001-cgroup-v1-cgroup_stat-support.patch rename to SPECS/linux/6.1/generic/0001-cgroup-v1-cgroup_stat-support-6.1.patch diff --git a/SPECS/91/linux/generic/0001-kernel-lockdown-when-UEFI-secure-boot-enabled.patch b/SPECS/linux/6.1/generic/0001-kernel-lockdown-when-UEFI-secure-boot-enabled-6.1.patch similarity index 82% rename from SPECS/91/linux/generic/0001-kernel-lockdown-when-UEFI-secure-boot-enabled.patch rename to SPECS/linux/6.1/generic/0001-kernel-lockdown-when-UEFI-secure-boot-enabled-6.1.patch index 488c283a3a..b2d3a8cec2 100644 --- a/SPECS/91/linux/generic/0001-kernel-lockdown-when-UEFI-secure-boot-enabled.patch +++ b/SPECS/linux/6.1/generic/0001-kernel-lockdown-when-UEFI-secure-boot-enabled-6.1.patch @@ -1,6 +1,6 @@ -From afd3e0dc775a61dc220bdbe91312fdf7e2d68a45 Mon Sep 17 00:00:00 2001 -From: Kuntal Nayak -Date: Sat, 22 Feb 2025 01:06:00 +0000 +From 9299b76d51a58f80971bb75a358a1bd19a26da54 Mon Sep 17 00:00:00 2001 +From: Kuntal Nayak +Date: Sat, 23 Sep 2023 05:16:13 +0000 Subject: [PATCH 1/3] kernel: lockdown when UEFI secure boot enabled Implemented a Kernel config that determines whether to lockdown @@ -10,24 +10,23 @@ Boot status is checked and kernel is locked down. lockdown if force (unconditional) config options are not set.] Signed-off-by: Alexey Makhalov -Signed-off-by: Kuntal Nayak --- arch/x86/kernel/Makefile | 2 ++ - arch/x86/kernel/lockdown.c | 28 ++++++++++++++++++++++++++++ + arch/x86/kernel/lockdown.c | 26 ++++++++++++++++++++++++++ include/linux/lockdown.h | 7 +++++++ security/lockdown/Kconfig | 8 ++++++++ security/lockdown/lockdown.c | 8 ++++++++ - 5 files changed, 53 insertions(+) + 5 files changed, 51 insertions(+) create mode 100644 arch/x86/kernel/lockdown.c create mode 100644 include/linux/lockdown.h diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile -index f79189806..855a3698c 100644 +index 42b5540da..4f9bbb047 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile -@@ -154,6 +154,8 @@ obj-$(CONFIG_X86_CET) += cet.o +@@ -144,6 +144,8 @@ obj-$(CONFIG_AMD_MEM_ENCRYPT) += sev.o - obj-$(CONFIG_X86_USER_SHADOW_STACK) += shstk.o + obj-$(CONFIG_CFI_CLANG) += cfi.o +obj-$(CONFIG_LOCK_DOWN_KERNEL_IN_SECUREBOOT) += lockdown.o + @@ -36,22 +35,20 @@ index f79189806..855a3698c 100644 ifeq ($(CONFIG_X86_64),y) diff --git a/arch/x86/kernel/lockdown.c b/arch/x86/kernel/lockdown.c new file mode 100644 -index 000000000..0904e6326 +index 000000000..fd1736acf --- /dev/null +++ b/arch/x86/kernel/lockdown.c -@@ -0,0 +1,28 @@ +@@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include -+#include -+#include +#include + +#include + +extern struct boot_params boot_params; + -+static bool is_efi_system(void) { ++bool is_efi_system(void) { + return efi_enabled(EFI_BOOT) || + !strncmp((char *)&boot_params.efi_info.efi_loader_signature, EFI64_LOADER_SIGNATURE, 4) || + !strncmp((char *)&boot_params.efi_info.efi_loader_signature, EFI32_LOADER_SIGNATURE, 4); @@ -101,7 +98,7 @@ index e84ddf484..f2fa07773 100644 prompt "Kernel default lockdown mode" default LOCK_DOWN_KERNEL_FORCE_NONE diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c -index f2bdbd55a..646d6ef09 100644 +index a79b985e9..56004fc13 100644 --- a/security/lockdown/lockdown.c +++ b/security/lockdown/lockdown.c @@ -13,6 +13,7 @@ @@ -109,10 +106,10 @@ index f2bdbd55a..646d6ef09 100644 #include #include +#include - #include static enum lockdown_reason kernel_locked_down; -@@ -21,6 +22,8 @@ static const enum lockdown_reason lockdown_levels[] = {LOCKDOWN_NONE, + +@@ -20,6 +21,8 @@ static const enum lockdown_reason lockdown_levels[] = {LOCKDOWN_NONE, LOCKDOWN_INTEGRITY_MAX, LOCKDOWN_CONFIDENTIALITY_MAX}; @@ -121,7 +118,7 @@ index f2bdbd55a..646d6ef09 100644 /* * Put the kernel into lock-down mode. */ -@@ -87,6 +90,11 @@ static int __init lockdown_lsm_init(void) +@@ -81,6 +84,11 @@ static int __init lockdown_lsm_init(void) lock_kernel_down("Kernel configuration", LOCKDOWN_INTEGRITY_MAX); #elif defined(CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY) lock_kernel_down("Kernel configuration", LOCKDOWN_CONFIDENTIALITY_MAX); @@ -132,7 +129,7 @@ index f2bdbd55a..646d6ef09 100644 + pr_notice("Kernel not locked down\n"); #endif security_add_hooks(lockdown_hooks, ARRAY_SIZE(lockdown_hooks), - &lockdown_lsmid); + "lockdown"); -- -2.39.4 +2.39.0 diff --git a/SPECS/90/linux/generic/0001-tools-power-turbostat-Skip-some-CPUID-checks-if-runn.patch b/SPECS/linux/6.1/generic/0001-tools-power-turbostat-Skip-some-CPUID-checks-if-runn-6.1.patch similarity index 100% rename from SPECS/90/linux/generic/0001-tools-power-turbostat-Skip-some-CPUID-checks-if-runn.patch rename to SPECS/linux/6.1/generic/0001-tools-power-turbostat-Skip-some-CPUID-checks-if-runn-6.1.patch diff --git a/SPECS/linux/6.1/generic/0001-x86-pti-Fix-kernel-warnings-for-pti-and-nopti-cmdlin.patch b/SPECS/linux/6.1/generic/0001-x86-pti-Fix-kernel-warnings-for-pti-and-nopti-cmdlin.patch new file mode 100644 index 0000000000..7269b3978b --- /dev/null +++ b/SPECS/linux/6.1/generic/0001-x86-pti-Fix-kernel-warnings-for-pti-and-nopti-cmdlin.patch @@ -0,0 +1,120 @@ +From 7b09721e0971e42b08663c685090862bd0cb0861 Mon Sep 17 00:00:00 2001 +From: Jo Van Bulck +Date: Sat, 19 Aug 2023 10:09:21 +0200 +Subject: [PATCH] x86/pti: Fix kernel warnings for pti= and nopti cmdline + options + +commit 0bd7feb2df7ef092c6b8914acca706fb21826f80 upstream + +Parse the pti= and nopti cmdline options using early_param to fix 'Unknown +kernel command line parameters "nopti", will be passed to user space' +warnings in the kernel log when nopti or pti= are passed to the kernel +cmdline on x86 platforms. + +Additionally allow the kernel to warn for malformed pti= options. + +Signed-off-by: Jo Van Bulck +Signed-off-by: Ingo Molnar +Signed-off-by: Borislav Petkov (AMD) +Reviewed-by: Sohil Mehta +Link: https://lore.kernel.org/r/20230819080921.5324-2-jo.vanbulck@cs.kuleuven.be +[Ankit: Backported for v6.1] +Signed-off-by: Ankit Jain +--- + arch/x86/mm/pti.c | 58 +++++++++++++++++++++++------------------------ + 1 file changed, 29 insertions(+), 29 deletions(-) + +diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c +index d5f702ea4c78..ff5ec39b1827 100644 +--- a/arch/x86/mm/pti.c ++++ b/arch/x86/mm/pti.c +@@ -69,6 +69,7 @@ static void __init pti_print_if_secure(const char *reason) + pr_info("%s\n", reason); + } + ++/* Assume mode is auto unless overridden via cmdline below. */ + static enum pti_mode { + PTI_AUTO = 0, + PTI_FORCE_OFF, +@@ -77,50 +78,49 @@ static enum pti_mode { + + void __init pti_check_boottime_disable(void) + { +- char arg[5]; +- int ret; +- +- /* Assume mode is auto unless overridden. */ +- pti_mode = PTI_AUTO; +- + if (hypervisor_is_type(X86_HYPER_XEN_PV)) { + pti_mode = PTI_FORCE_OFF; + pti_print_if_insecure("disabled on XEN PV."); + return; + } + +- ret = cmdline_find_option(boot_command_line, "pti", arg, sizeof(arg)); +- if (ret > 0) { +- if (ret == 3 && !strncmp(arg, "off", 3)) { +- pti_mode = PTI_FORCE_OFF; +- pti_print_if_insecure("disabled on command line."); +- return; +- } +- if (ret == 2 && !strncmp(arg, "on", 2)) { +- pti_mode = PTI_FORCE_ON; +- pti_print_if_secure("force enabled on command line."); +- goto enable; +- } +- if (ret == 4 && !strncmp(arg, "auto", 4)) { +- pti_mode = PTI_AUTO; +- goto autosel; +- } +- } +- +- if (cmdline_find_option_bool(boot_command_line, "nopti") || +- cpu_mitigations_off()) { ++ if (cpu_mitigations_off()) + pti_mode = PTI_FORCE_OFF; ++ if (pti_mode == PTI_FORCE_OFF) { + pti_print_if_insecure("disabled on command line."); + return; + } + +-autosel: +- if (!boot_cpu_has_bug(X86_BUG_CPU_MELTDOWN)) ++ if (pti_mode == PTI_FORCE_ON) ++ pti_print_if_secure("force enabled on command line."); ++ ++ if (pti_mode == PTI_AUTO && !boot_cpu_has_bug(X86_BUG_CPU_MELTDOWN)) + return; +-enable: ++ + setup_force_cpu_cap(X86_FEATURE_PTI); + } + ++static int __init pti_parse_cmdline(char *arg) ++{ ++ if (!strcmp(arg, "off")) ++ pti_mode = PTI_FORCE_OFF; ++ else if (!strcmp(arg, "on")) ++ pti_mode = PTI_FORCE_ON; ++ else if (!strcmp(arg, "auto")) ++ pti_mode = PTI_AUTO; ++ else ++ return -EINVAL; ++ return 0; ++} ++early_param("pti", pti_parse_cmdline); ++ ++static int __init pti_parse_cmdline_nopti(char *arg) ++{ ++ pti_mode = PTI_FORCE_OFF; ++ return 0; ++} ++early_param("nopti", pti_parse_cmdline_nopti); ++ + pgd_t __pti_set_user_pgtbl(pgd_t *pgdp, pgd_t pgd) + { + /* +-- +2.39.4 + diff --git a/SPECS/91/linux/generic/0002-Add-.sbat-section.patch b/SPECS/linux/6.1/generic/0002-Add-.sbat-section-6.1.patch similarity index 91% rename from SPECS/91/linux/generic/0002-Add-.sbat-section.patch rename to SPECS/linux/6.1/generic/0002-Add-.sbat-section-6.1.patch index 335237b9f7..17945acdcb 100644 --- a/SPECS/91/linux/generic/0002-Add-.sbat-section.patch +++ b/SPECS/linux/6.1/generic/0002-Add-.sbat-section-6.1.patch @@ -1,5 +1,6 @@ -From: Kuntal Nayak -Date: Thu, 23 Jan 2025 03:04:48 +0000 +From 0bd358e4ee0c61355ab057a977fa6f5e311b7f07 Mon Sep 17 00:00:00 2001 +From: Alexey Makhalov +Date: Fri, 22 Sep 2023 12:25:24 -0700 Subject: [PATCH 2/3] Add .sbat section To be able to revoke previously shipped signed kernel images by SBAT @@ -20,10 +21,10 @@ Signed-off-by: Kuntal Nayak 4 files changed, 79 insertions(+), 14 deletions(-) diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile -index 9cc0ff6e9..9d48dbd16 100644 +index 3c1b35203..256a7315c 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile -@@ -63,7 +63,7 @@ $(obj)/bzImage: asflags-y := $(SVGA_MODE) +@@ -79,7 +79,7 @@ $(obj)/bzImage: asflags-y := $(SVGA_MODE) quiet_cmd_image = BUILD $@ silent_redirect_image = >/dev/null cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \ @@ -32,7 +33,7 @@ index 9cc0ff6e9..9d48dbd16 100644 $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE $(call if_changed,image) -@@ -84,9 +84,11 @@ targets += zoffset.h +@@ -100,9 +100,11 @@ targets += zoffset.h $(obj)/zoffset.h: $(obj)/compressed/vmlinux FORCE $(call if_changed,zoffset) @@ -46,7 +47,7 @@ index 9cc0ff6e9..9d48dbd16 100644 LDFLAGS_setup.elf := -m elf_i386 -z noexecstack -T $(obj)/setup.elf: $(src)/setup.ld $(SETUP_OBJS) FORCE diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S -index b5c79f433..35bfde424 100644 +index 7593339b5..c5c3e495b 100644 --- a/arch/x86/boot/header.S +++ b/arch/x86/boot/header.S @@ -38,6 +38,12 @@ SYSSEG = 0x1000 /* historical load address >> 4 */ @@ -62,7 +63,7 @@ index b5c79f433..35bfde424 100644 .code16 .section ".bstext", "ax" -@@ -83,9 +89,9 @@ optional_header: +@@ -82,9 +88,9 @@ optional_header: .long ZO__end - ZO__data # SizeOfInitializedData .long 0 # SizeOfUninitializedData @@ -75,7 +76,7 @@ index b5c79f433..35bfde424 100644 #ifdef CONFIG_X86_32 .long 0 # data #endif -@@ -106,7 +112,7 @@ extra_header_fields: +@@ -105,7 +111,7 @@ extra_header_fields: .word 0 # MinorSubsystemVersion .long 0 # Win32VersionValue @@ -84,7 +85,7 @@ index b5c79f433..35bfde424 100644 .long salign # SizeOfHeaders .long 0 # CheckSum -@@ -173,21 +179,41 @@ pecompat_fstart: +@@ -176,21 +182,41 @@ pecompat_fstart: .byte 0x1 # Version .byte 8 # Size .word IMAGE_FILE_MACHINE_I386 # PE machine type @@ -129,7 +130,7 @@ index b5c79f433..35bfde424 100644 .long 0 # PointerToRelocations .long 0 # PointerToLineNumbers .word 0 # NumberOfRelocations -@@ -198,15 +224,16 @@ pecompat_fstart: +@@ -201,15 +227,16 @@ pecompat_fstart: .ascii ".data\0\0\0" .long ZO__end - ZO__data # VirtualSize @@ -148,7 +149,7 @@ index b5c79f433..35bfde424 100644 .set section_count, (. - section_table) / 40 #endif /* CONFIG_EFI_STUB */ -@@ -219,7 +246,7 @@ sentinel: .byte 0xff, 0xff /* Used to detect broken loaders */ +@@ -222,7 +249,7 @@ sentinel: .byte 0xff, 0xff /* Used to detect broken loaders */ .globl hdr hdr: @@ -225,10 +226,10 @@ index 10311d77c..500e8701c 100644 crc = partial_crc32(kernel, sz, crc); if (fwrite(kernel, 1, sz, dest) != sz) diff --git a/security/Kconfig b/security/Kconfig -index 28e685f53..318d41cc1 100644 +index e6db09a77..536689678 100644 --- a/security/Kconfig +++ b/security/Kconfig -@@ -223,6 +223,18 @@ source "security/loadpin/Kconfig" +@@ -206,6 +206,18 @@ source "security/loadpin/Kconfig" source "security/yama/Kconfig" source "security/safesetid/Kconfig" source "security/lockdown/Kconfig" @@ -245,8 +246,8 @@ index 28e685f53..318d41cc1 100644 + about SBAT. + source "security/landlock/Kconfig" - source "security/ipe/Kconfig" + source "security/integrity/Kconfig" -- -2.39.4 +2.39.0 diff --git a/SPECS/91/linux/generic/0003-Verify-SBAT-on-kexec.patch b/SPECS/linux/6.1/generic/0003-Verify-SBAT-on-kexec-6.1.patch similarity index 93% rename from SPECS/91/linux/generic/0003-Verify-SBAT-on-kexec.patch rename to SPECS/linux/6.1/generic/0003-Verify-SBAT-on-kexec-6.1.patch index 8bcd7e6a54..0d62a0c76f 100644 --- a/SPECS/91/linux/generic/0003-Verify-SBAT-on-kexec.patch +++ b/SPECS/linux/6.1/generic/0003-Verify-SBAT-on-kexec-6.1.patch @@ -1,6 +1,6 @@ -From 37b8af5e9c3aae7638e20bed4f692adb753609df Mon Sep 17 00:00:00 2001 -From: Kuntal Nayak -Date: Sat, 1 Mar 2025 00:28:52 +0000 +From 14af6bbafd771b48c507bfce3b7dc582d0b65c6f Mon Sep 17 00:00:00 2001 +From: Alexey Makhalov +Date: Mon, 9 Oct 2023 09:00:46 -0700 Subject: [PATCH 3/3] Verify SBAT on kexec Extend Secure Boot trust-chain to newly loaded kernels. @@ -28,7 +28,7 @@ Signed-off-by: Kuntal Nayak create mode 100644 security/sbat.c diff --git a/crypto/asymmetric_keys/verify_pefile.c b/crypto/asymmetric_keys/verify_pefile.c -index 2863984b6..87b127553 100644 +index 22beaf221..7813de5cf 100644 --- a/crypto/asymmetric_keys/verify_pefile.c +++ b/crypto/asymmetric_keys/verify_pefile.c @@ -454,3 +454,27 @@ int verify_pefile_signature(const void *pebuf, unsigned pelen, @@ -82,7 +82,7 @@ index cb2d47f28..dfebedf56 100644 #endif /* CONFIG_SYSTEM_DATA_VERIFICATION */ diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c -index 3eedb8c22..1ad76d14b 100644 +index 6d787ae9d..ccf282821 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -27,6 +27,8 @@ @@ -94,7 +94,7 @@ index 3eedb8c22..1ad76d14b 100644 #include "kexec_internal.h" #ifdef CONFIG_KEXEC_SIG -@@ -141,6 +143,11 @@ int kexec_kernel_verify_pe_sig(const char *kernel, unsigned long kernel_len) +@@ -139,6 +141,11 @@ int kexec_kernel_verify_pe_sig(const char *kernel, unsigned long kernel_len) VERIFY_USE_PLATFORM_KEYRING, VERIFYING_KEXEC_PE_SIGNATURE); } @@ -107,10 +107,10 @@ index 3eedb8c22..1ad76d14b 100644 } #endif diff --git a/security/Kconfig b/security/Kconfig -index 83eba935f..d7c228b95 100644 +index 356bdaae6..4dc8d0ecf 100644 --- a/security/Kconfig +++ b/security/Kconfig -@@ -264,6 +264,18 @@ config SECURITY_SBAT +@@ -279,6 +279,18 @@ config SECURITY_SBAT See for more information about SBAT. @@ -127,13 +127,13 @@ index 83eba935f..d7c228b95 100644 + about SBAT. + source "security/landlock/Kconfig" - source "security/ipe/Kconfig" + source "security/integrity/Kconfig" diff --git a/security/Makefile b/security/Makefile -index cc0982214..43aa9162a 100644 +index 18121f8f8..38da41d50 100644 --- a/security/Makefile +++ b/security/Makefile -@@ -13,6 +13,7 @@ obj-$(CONFIG_MMU) += min_addr.o +@@ -12,6 +12,7 @@ obj-$(CONFIG_MMU) += min_addr.o # Object file lists obj-$(CONFIG_SECURITY) += security.o obj-$(CONFIG_SECURITYFS) += inode.o @@ -143,7 +143,7 @@ index cc0982214..43aa9162a 100644 obj-$(CONFIG_SECURITY) += lsm_audit.o diff --git a/security/sbat.c b/security/sbat.c new file mode 100644 -index 000000000..a180f02a8 +index 000000000..75571fc08 --- /dev/null +++ b/security/sbat.c @@ -0,0 +1,233 @@ @@ -241,7 +241,7 @@ index 000000000..a180f02a8 + return ERR_PTR(-EILSEQ); +} + -+static struct sbat* get_sbat_from_pefile(const char *pebuf, unsigned long pelen) ++struct sbat* get_sbat_from_pefile(const char *pebuf, unsigned long pelen) +{ + struct sbat *s, *out; + char *sbat_data; @@ -271,7 +271,7 @@ index 000000000..a180f02a8 + return out; +} + -+static struct sbat* get_sbat_from_efi(void) ++struct sbat* get_sbat_from_efi(void) +{ + efi_status_t status; + struct sbat *s, *out; diff --git a/SPECS/91/linux/generic/0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch b/SPECS/linux/6.1/generic/6.0-0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch similarity index 57% rename from SPECS/91/linux/generic/0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch rename to SPECS/linux/6.1/generic/6.0-0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch index fb5d6f0a0f..4db764d8fc 100644 --- a/SPECS/91/linux/generic/0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch +++ b/SPECS/linux/6.1/generic/6.0-0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch @@ -1,7 +1,8 @@ -From 9dc38b5ce96a062a855bda4d399d4c24b05d7a18 Mon Sep 17 00:00:00 2001 +From 82d231f05e17f01fcbc0b1903d61d697992b2a7d Mon Sep 17 00:00:00 2001 From: John Johansen -Date: Thu, 10 Oct 2024 09:43:58 +0000 -Subject: [PATCH] apparmor: patch to provide compatibility with v2.x net rules +Date: Fri, 4 Oct 2019 11:31:30 +0530 +Subject: [PATCH] apparmor: patch to provide compatibility with v2.x net + rules The networking rules upstreamed in 4.17 have a deliberate abi break with the older 2.x network rules. @@ -13,25 +14,21 @@ to work on a newer kernel. Signed-off-by: John Johansen Signed-off-by: Bo Gan Signed-off-by: Srivatsa S. Bhat (VMware) - -[Srinidhi Rao Back Ported this patch to v6.6.x] -Signed-off-by: srinidhira0 --- - security/apparmor/apparmorfs.c | 1 + - security/apparmor/include/apparmor.h | 2 +- - security/apparmor/include/net.h | 11 +++++ - security/apparmor/include/policy.h | 2 + - security/apparmor/include/policy_compat.h | 2 +- - security/apparmor/net.c | 30 +++++++++--- - security/apparmor/policy.c | 1 + - security/apparmor/policy_unpack.c | 56 ++++++++++++++++++++++- - 8 files changed, 96 insertions(+), 9 deletions(-) + security/apparmor/apparmorfs.c | 1 + + security/apparmor/include/apparmor.h | 2 +- + security/apparmor/include/net.h | 11 ++++++ + security/apparmor/include/policy.h | 2 + + security/apparmor/net.c | 31 +++++++++++---- + security/apparmor/policy.c | 1 + + security/apparmor/policy_unpack.c | 57 +++++++++++++++++++++++++++- + 7 files changed, 95 insertions(+), 10 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c -index 01b923d97a44..28b9d59780b2 100644 +index ff84ce10c..51e79e192 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c -@@ -2405,6 +2405,7 @@ static struct aa_sfs_entry aa_sfs_entry_features[] = { +@@ -2435,6 +2435,7 @@ static struct aa_sfs_entry aa_sfs_entry_features[] = { AA_SFS_DIR("domain", aa_sfs_entry_domain), AA_SFS_DIR("file", aa_sfs_entry_file), AA_SFS_DIR("network_v8", aa_sfs_entry_network), @@ -40,7 +37,7 @@ index 01b923d97a44..28b9d59780b2 100644 AA_SFS_DIR("namespaces", aa_sfs_entry_ns), AA_SFS_FILE_U64("capability", VFS_CAP_FLAGS_MASK), diff --git a/security/apparmor/include/apparmor.h b/security/apparmor/include/apparmor.h -index f83934913b0f..7e341cffbc73 100644 +index 9c3fc36a0..6b371fdbf 100644 --- a/security/apparmor/include/apparmor.h +++ b/security/apparmor/include/apparmor.h @@ -20,7 +20,7 @@ @@ -53,13 +50,13 @@ index f83934913b0f..7e341cffbc73 100644 #define AA_CLASS_DOMAIN 6 #define AA_CLASS_MOUNT 7 diff --git a/security/apparmor/include/net.h b/security/apparmor/include/net.h -index 67bf888c3bd6..d6e1fce67266 100644 +index aadb4b29f..98a42efb9 100644 --- a/security/apparmor/include/net.h +++ b/security/apparmor/include/net.h -@@ -73,6 +73,16 @@ static inline struct aa_sk_ctx *aa_sock(const struct sock *sk) +@@ -68,6 +68,16 @@ struct aa_sk_ctx { DEFINE_AUDIT_NET(NAME, OP, SK, (SK)->sk_family, (SK)->sk_type, \ (SK)->sk_protocol) - + +/* struct aa_net - network confinement data + * @allow: basic network families permissions + * @audit: which network permissions to force audit @@ -70,58 +67,45 @@ index 67bf888c3bd6..d6e1fce67266 100644 + u16 audit[AF_MAX]; + u16 quiet[AF_MAX]; +}; - + #define af_select(FAMILY, FN, DEF_FN) \ ({ \ -@@ -92,6 +102,7 @@ struct aa_secmark { +@@ -87,6 +97,7 @@ struct aa_secmark { }; - + extern struct aa_sfs_entry aa_sfs_entry_network[]; +extern struct aa_sfs_entry aa_sfs_entry_network_compat[]; - + void audit_net_cb(struct audit_buffer *ab, void *va); - int aa_profile_af_perm(struct aa_profile *profile, + int aa_profile_af_perm(struct aa_profile *profile, struct common_audit_data *sa, diff --git a/security/apparmor/include/policy.h b/security/apparmor/include/policy.h -index 75088cc310b6..188b21b753a2 100644 +index 44471bb05..646582b0d 100644 --- a/security/apparmor/include/policy.h +++ b/security/apparmor/include/policy.h -@@ -155,6 +155,7 @@ struct aa_data { +@@ -112,6 +112,7 @@ struct aa_data { * @policy: general match rules governing policy * @file: The set of rules governing basic file access and domain transitions * @caps: capabilities for the profile + * @net_compat: v2 compat network controls for the profile * @rlimits: rlimits for the profile - * @secmark_count: number of secmark entries - * @secmark: secmark label match info -@@ -168,6 +169,7 @@ struct aa_ruleset { - struct aa_policydb *policy; - struct aa_policydb *file; + * + * @dents: dentries for the profiles file entries in apparmorfs +@@ -149,6 +150,7 @@ struct aa_profile { + struct aa_policydb policy; + struct aa_file_rules file; struct aa_caps caps; + struct aa_net_compat *net_compat; - - struct aa_rlimit rlimits; - -diff --git a/security/apparmor/include/policy_compat.h b/security/apparmor/include/policy_compat.h -index af0e174332df..3bcb10e69271 100644 ---- a/security/apparmor/include/policy_compat.h -+++ b/security/apparmor/include/policy_compat.h -@@ -22,7 +22,7 @@ - - #define v5 5 /* base version */ - #define v6 6 /* per entry policydb mediation check */ --#define v7 7 -+#define v7 7 /* v2 compat networking */ - #define v8 8 /* full network masking */ - #define v9 9 /* xbits are used as permission bits in policydb */ - + + int xattr_count; + char **xattrs; diff --git a/security/apparmor/net.c b/security/apparmor/net.c -index 87e934b2b548..99679eea3a2c 100644 +index 0c980e62d..762f004a6 100644 --- a/security/apparmor/net.c +++ b/security/apparmor/net.c @@ -24,6 +24,11 @@ struct aa_sfs_entry aa_sfs_entry_network[] = { { } }; - + +struct aa_sfs_entry aa_sfs_entry_network_compat[] = { + AA_SFS_FILE_STRING("af_mask", AA_SFS_AF_MASK), + { } @@ -130,60 +114,69 @@ index 87e934b2b548..99679eea3a2c 100644 static const char * const net_mask_names[] = { "unknown", "send", -@@ -122,14 +127,27 @@ int aa_profile_af_perm(struct aa_profile *profile, +@@ -118,14 +123,26 @@ int aa_profile_af_perm(struct aa_profile *profile, struct common_audit_data *sa, if (profile_unconfined(profile)) return 0; - state = RULE_MEDIATES(rules, AA_CLASS_NET); + state = PROFILE_MEDIATES(profile, AA_CLASS_NET); - if (!state) + if (state) { + if (!state) + return 0; + buffer[0] = cpu_to_be16(family); + buffer[1] = cpu_to_be16((u16) type); -+ state = aa_dfa_match_len(rules->policy->dfa, state, -+ (char *) &buffer, 4); -+ perms = *aa_lookup_perms(rules->policy, state); -+ aa_apply_modes_to_perms(profile, &perms); -+ } else if (rules->net_compat) { ++ state = aa_dfa_match_len(profile->policy.dfa, state, ++ (char *) &buffer, 4); ++ aa_compute_perms(profile->policy.dfa, state, &perms); ++ } else if (profile->net_compat) { + /* 2.x socket mediation compat */ -+ perms.allow = (rules->net_compat->allow[family] & (1 << type)) ? ++ perms.allow = (profile->net_compat->allow[family] & (1 << type)) ? + ALL_PERMS_MASK : 0; -+ perms.audit = (rules->net_compat->audit[family] & (1 << type)) ? ++ perms.audit = (profile->net_compat->audit[family] & (1 << type)) ? + ALL_PERMS_MASK : 0; -+ perms.quiet = (rules->net_compat->quiet[family] & (1 << type)) ? ++ perms.quiet = (profile->net_compat->quiet[family] & (1 << type)) ? + ALL_PERMS_MASK : 0; ++ + } else { return 0; -+ } - +- - buffer[0] = cpu_to_be16(family); - buffer[1] = cpu_to_be16((u16) type); -- state = aa_dfa_match_len(rules->policy->dfa, state, (char *) &buffer, +- state = aa_dfa_match_len(profile->policy.dfa, state, (char *) &buffer, - 4); -- perms = *aa_lookup_perms(rules->policy, state); +- aa_compute_perms(profile->policy.dfa, state, &perms); ++ } aa_apply_modes_to_perms(profile, &perms); - - return aa_check_perms(profile, &perms, request, ad, audit_net_cb); + + return aa_check_perms(profile, &perms, request, sa, audit_net_cb); diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c -index 14df15e35695..f6367e825528 100644 +index c94e7a6d6..485205a6e 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c -@@ -252,6 +252,7 @@ static void free_ruleset(struct aa_ruleset *rules) - for (i = 0; i < rules->secmark_count; i++) - kfree_sensitive(rules->secmark[i].label); - kfree_sensitive(rules->secmark); -+ kfree_sensitive(rules->net_compat); - kfree_sensitive(rules); - } - +@@ -247,6 +247,7 @@ void aa_free_profile(struct aa_profile *profile) + aa_free_file_rules(&profile->file); + aa_free_cap_rules(&profile->caps); + aa_free_rlimit_rules(&profile->rlimits); ++ kfree_sensitive(profile->net_compat); + + for (i = 0; i < profile->xattr_count; i++) + kfree_sensitive(profile->xattrs[i]); diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c -index 5a570235427d..3ba33e98448f 100644 +index 636fa078f..f9f762d38 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c -@@ -270,6 +270,23 @@ static bool unpack_u8(struct aa_ext *e, u8 *data, const char *name) +@@ -35,7 +35,7 @@ + + #define v5 5 /* base version */ + #define v6 6 /* per entry policydb mediation check */ +-#define v7 7 ++#define v7 7 /* v2 compat networking */ + #define v8 8 /* full network masking */ + + /* audit callback for unpack fields */ +@@ -299,6 +299,23 @@ static bool unpack_u8(struct aa_ext *e, u8 *data, const char *name) return false; } - + +static bool unpack_u16(struct aa_ext *e, u16 *data, const char *name) +{ + void *pos = e->pos; @@ -194,36 +187,33 @@ index 5a570235427d..3ba33e98448f 100644 + if (data) + *data = le16_to_cpu(get_unaligned((__le16 *) e->pos)); + e->pos += sizeof(u16); -+ return true; ++ return 1; + } +fail: + e->pos = pos; -+ return false; ++ return 0; +} + VISIBLE_IF_KUNIT bool aa_unpack_u32(struct aa_ext *e, u32 *data, const char *name) { void *pos = e->pos; -@@ -824,9 +841,10 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name) +@@ -670,7 +687,7 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name) + struct aa_profile *profile = NULL; + const char *tmpname, *tmpns = NULL, *name = NULL; + const char *info = "failed to unpack profile"; +- size_t ns_len; ++ size_t size = 0, ns_len; struct rhashtable_params params = { 0 }; char *key = NULL, *disconnected = NULL; struct aa_data *data; -- int error = -EPROTO; -+ int error = -EPROTO, i = 0; - kernel_cap_t tmpcap; - u32 tmp; -+ u16 size = 0; - - *ns_name = NULL; - -@@ -992,6 +1010,42 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name) +@@ -828,6 +845,42 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name) goto fail; } - -+ aa_unpack_array(e, "net_allowed_af", &size); + ++ size = aa_unpack_array(e, "net_allowed_af"); + if (size || VERSION_LT(e->version, v8)) { -+ rules->net_compat = kzalloc(sizeof(struct aa_net_compat), GFP_KERNEL); -+ if (!rules->net_compat) { ++ profile->net_compat = kzalloc(sizeof(struct aa_net_compat), GFP_KERNEL); ++ if (!profile->net_compat) { + info = "out of memory"; + goto fail; + } @@ -235,30 +225,30 @@ index 5a570235427d..3ba33e98448f 100644 + u16 tmp; + + if (!unpack_u16(e, &tmp, NULL) || -+ !unpack_u16(e, &tmp, NULL) || -+ !unpack_u16(e, &tmp, NULL)) -+ goto fail; ++ !unpack_u16(e, &tmp, NULL) || ++ !unpack_u16(e, &tmp, NULL)) ++ goto fail; + continue; + } -+ if (!unpack_u16(e, &rules->net_compat->allow[i], NULL)) ++ if (!unpack_u16(e, &profile->net_compat->allow[i], NULL)) + goto fail; -+ if (!unpack_u16(e, &rules->net_compat->audit[i], NULL)) ++ if (!unpack_u16(e, &profile->net_compat->audit[i], NULL)) + goto fail; -+ if (!unpack_u16(e, &rules->net_compat->quiet[i], NULL)) ++ if (!unpack_u16(e, &profile->net_compat->quiet[i], NULL)) + goto fail; + } + if (size && !aa_unpack_nameX(e, AA_ARRAYEND, NULL)) + goto fail; + if (VERSION_LT(e->version, v7)) { + /* pre v7 policy always allowed these */ -+ rules->net_compat->allow[AF_UNIX] = 0xffff; -+ rules->net_compat->allow[AF_NETLINK] = 0xffff; ++ profile->net_compat->allow[AF_UNIX] = 0xffff; ++ profile->net_compat->allow[AF_NETLINK] = 0xffff; + } + } + if (aa_unpack_nameX(e, AA_STRUCT, "policydb")) { - /* generic policy dfa - optional and may be NULL */ - info = "failed to unpack policydb"; --- -2.39.4 + size_t state_count; + +-- +2.53.0 diff --git a/SPECS/91/linux/generic/0002-apparmor-af_unix-mediation.patch b/SPECS/linux/6.1/generic/6.0-0002-apparmor-af_unix-mediation.patch similarity index 55% rename from SPECS/91/linux/generic/0002-apparmor-af_unix-mediation.patch rename to SPECS/linux/6.1/generic/6.0-0002-apparmor-af_unix-mediation.patch index 765c8de2be..2b0cfc4ced 100644 --- a/SPECS/91/linux/generic/0002-apparmor-af_unix-mediation.patch +++ b/SPECS/linux/6.1/generic/6.0-0002-apparmor-af_unix-mediation.patch @@ -1,60 +1,54 @@ -From 65f62f0702ddbc435e794a7280bd16e0e6691dde Mon Sep 17 00:00:00 2001 +From bc25c9a28e8bf163fc8858414c38288f92669638 Mon Sep 17 00:00:00 2001 From: John Johansen -Date: Thu, 10 Oct 2024 10:34:26 +0000 -Subject: [PATCH] apparmor: af_unix mediation +Date: Thu, 26 Mar 2020 02:25:34 -0700 +Subject: [PATCH 2/3] apparmor: af_unix mediation af_socket mediation did not make it into 4.17 so add remaining out of tree patch Signed-off-by: John Johansen -(cherry picked from https://gitlab.com/jjohansen/apparmor-kernel) -Signed-off-by: Andrea Righi -(cherry picked from commit 651f0b2cc1d78cb7afbc0fcadc166ed0bcc78dd3 -https://git.launchpad.net/~apparmor-dev/ubuntu-kernel-next) -Signed-off-by: Paolo Pisati - -[Srinidhi Rao Back ported this patch to v6.12.x] -Signed-off-by: srinidhira0 -[Keerthana: Fix: register af_unix sfs entry in aa_sfs_entry_network_compat[] (network/) -instead of aa_sfs_entry_network[] (network_v8/) to match abi/4.0] -Signed-off-by: Keerthana K ----- - security/apparmor/Makefile | 2 +- - security/apparmor/af_unix.c | 702 ++++++++++++++++++++++++++++ +Signed-off-by: Srivatsa S. Bhat (VMware) +Signed-off-by: Shivani Agarwal +[ Refreshed for 6.1.189: AppArmor socket context now lives in the + LSM-managed sock blob, so use aa_sock() in place of SK_CTX() and + rename the local af_unix.c helper to aa_unix_sk() to avoid a clash + with aa_sock() in include/net.h. ] +--- + security/apparmor/Makefile | 3 +- + security/apparmor/af_unix.c | 650 ++++++++++++++++++++++++++++ security/apparmor/apparmorfs.c | 6 + - security/apparmor/file.c | 13 +- - security/apparmor/include/af_unix.h | 122 +++++ - security/apparmor/include/file.h | 4 + - security/apparmor/include/label.h | 5 +- - security/apparmor/include/net.h | 5 + + security/apparmor/file.c | 4 +- + security/apparmor/include/af_unix.h | 114 +++++ + security/apparmor/include/net.h | 4 + security/apparmor/include/path.h | 1 + - security/apparmor/include/policy.h | 7 +- - security/apparmor/lsm.c | 130 +++++- - security/apparmor/net.c | 61 ++- - 12 files changed, 1040 insertions(+), 18 deletions(-) + security/apparmor/include/policy.h | 10 +- + security/apparmor/lsm.c | 113 +++++ + security/apparmor/net.c | 53 ++- + security/apparmor/policy_unpack.c | 4 +- + 11 files changed, 954 insertions(+), 8 deletions(-) create mode 100644 security/apparmor/af_unix.c create mode 100644 security/apparmor/include/af_unix.h diff --git a/security/apparmor/Makefile b/security/apparmor/Makefile -index b9c5879..be51607 100644 +index 065f4e3..5f8a096 100644 --- a/security/apparmor/Makefile +++ b/security/apparmor/Makefile -@@ -6,7 +6,7 @@ obj-$(CONFIG_SECURITY_APPARMOR) += apparmor.o +@@ -5,7 +5,8 @@ obj-$(CONFIG_SECURITY_APPARMOR) += apparmor.o + apparmor-y := apparmorfs.o audit.o capability.o task.o ipc.o lib.o match.o \ path.o domain.o policy.o policy_unpack.o procattr.o lsm.o \ - resource.o secid.o file.o policy_ns.o label.o mount.o net.o \ -- policy_compat.o -+ policy_compat.o af_unix.o +- resource.o secid.o file.o policy_ns.o label.o mount.o net.o ++ resource.o secid.o file.o policy_ns.o label.o mount.o net.o \ ++ af_unix.o apparmor-$(CONFIG_SECURITY_APPARMOR_HASH) += crypto.o obj-$(CONFIG_SECURITY_APPARMOR_KUNIT_TEST) += apparmor_policy_unpack_test.o diff --git a/security/apparmor/af_unix.c b/security/apparmor/af_unix.c new file mode 100644 -index 0000000..4fdc04f +index 0000000..d9344ee --- /dev/null +++ b/security/apparmor/af_unix.c -@@ -0,0 +1,702 @@ -+// SPDX-License-Identifier: GPL-2.0-only +@@ -0,0 +1,650 @@ +/* + * AppArmor security module + * @@ -84,19 +78,7 @@ index 0000000..4fdc04f + return &u->sk; +} + -+static umode_t sock_i_mode(struct sock *sk) -+{ -+ umode_t mode; -+ -+ read_lock_bh(&sk->sk_callback_lock); -+ mode = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_mode : 0; -+ read_unlock_bh(&sk->sk_callback_lock); -+ return mode; -+} -+ -+static inline int unix_fs_perm(const char *op, u32 mask, -+ const struct cred *subj_cred, -+ struct aa_label *label, ++static inline int unix_fs_perm(const char *op, u32 mask, struct aa_label *label, + struct unix_sock *u, int flags) +{ + AA_BUG(!label); @@ -108,87 +90,83 @@ index 0000000..4fdc04f + + mask &= NET_FS_PERMS; + if (!u->path.dentry) { -+ struct path_cond cond = { -+ .uid = sock_i_uid(&u->sk), -+ .mode = sock_i_mode(&u->sk), -+ }; ++ struct path_cond cond = { }; + struct aa_perms perms = { }; + struct aa_profile *profile; + + /* socket path has been cleared because it is being shutdown + * can only fall back to original sun_path request + */ -+ struct aa_sk_ctx *ctx = SK_CTX(aa_unix_sk(u)); -+ ++ struct aa_sk_ctx *ctx = aa_sock(&u->sk); + if (ctx->path.dentry) -+ return aa_path_perm(op, subj_cred, label, &ctx->path, -+ flags, mask, ++ return aa_path_perm(op, label, &ctx->path, flags, mask, + &cond); + return fn_for_each_confined(label, profile, + ((flags | profile->path_flags) & PATH_MEDIATE_DELETED) ? -+ __aa_path_perm(op, subj_cred, profile, ++ __aa_path_perm(op, profile, + u->addr->name->sun_path, mask, + &cond, flags, &perms) : -+ aa_audit_file(subj_cred, profile, &nullperms, -+ op, mask, ++ aa_audit_file(profile, &nullperms, op, mask, + u->addr->name->sun_path, NULL, + NULL, cond.uid, -+ "Failed name lookup - deleted entry", -+ -EACCES)); ++ "Failed name lookup - " ++ "deleted entry", -EACCES)); + } else { + /* the sunpath may not be valid for this ns so use the path */ + struct path_cond cond = { u->path.dentry->d_inode->i_uid, + u->path.dentry->d_inode->i_mode + }; + -+ return aa_path_perm(op, subj_cred, label, &u->path, flags, -+ mask, &cond); ++ return aa_path_perm(op, label, &u->path, flags, mask, &cond); + } + + return 0; +} + +/* passing in state returned by PROFILE_MEDIATES_AF */ -+static unsigned int match_to_prot(struct aa_dfa *dfa, ++static unsigned int match_to_prot(struct aa_profile *profile, + unsigned int state, int type, int protocol, + const char **info) +{ + __be16 buffer[2]; -+ + buffer[0] = cpu_to_be16(type); + buffer[1] = cpu_to_be16(protocol); -+ state = aa_dfa_match_len(dfa, state, (char *) &buffer, 4); ++ state = aa_dfa_match_len(profile->policy.dfa, state, (char *) &buffer, ++ 4); + if (!state) + *info = "failed type and protocol match"; + return state; +} + -+static unsigned int match_addr(struct aa_dfa *dfa, unsigned int state, ++static unsigned int match_addr(struct aa_profile *profile, unsigned int state, + struct sockaddr_un *addr, int addrlen) +{ + if (addr) + /* include leading \0 */ -+ state = aa_dfa_match_len(dfa, state, addr->sun_path, ++ state = aa_dfa_match_len(profile->policy.dfa, state, ++ addr->sun_path, + unix_addr_len(addrlen)); + else + /* anonymous end point */ -+ state = aa_dfa_match_len(dfa, state, "\x01", 1); ++ state = aa_dfa_match_len(profile->policy.dfa, state, "\x01", ++ 1); + /* todo change to out of band */ -+ state = aa_dfa_null_transition(dfa, state); ++ state = aa_dfa_null_transition(profile->policy.dfa, state); + return state; +} + -+static unsigned int match_to_local(struct aa_dfa *dfa, ++static unsigned int match_to_local(struct aa_profile *profile, + unsigned int state, int type, int protocol, + struct sockaddr_un *addr, int addrlen, + const char **info) +{ -+ state = match_to_prot(dfa, state, type, protocol, info); ++ state = match_to_prot(profile, state, type, protocol, info); + if (state) { -+ state = match_addr(dfa, state, addr, addrlen); ++ state = match_addr(profile, state, addr, addrlen); + if (state) { + /* todo: local label matching */ -+ state = aa_dfa_null_transition(dfa, state); ++ state = aa_dfa_null_transition(profile->policy.dfa, ++ state); + if (!state) + *info = "failed local label match"; + } else @@ -198,7 +176,7 @@ index 0000000..4fdc04f + return state; +} + -+static unsigned int match_to_sk(struct aa_dfa *dfa, ++static unsigned int match_to_sk(struct aa_profile *profile, + unsigned int state, struct unix_sock *u, + const char **info) +{ @@ -210,7 +188,7 @@ index 0000000..4fdc04f + addrlen = u->addr->len; + } + -+ return match_to_local(dfa, state, u->sk.sk_type, u->sk.sk_protocol, ++ return match_to_local(profile, state, u->sk.sk_type, u->sk.sk_protocol, + addr, addrlen, info); +} + @@ -218,13 +196,13 @@ index 0000000..4fdc04f +#define CMD_LISTEN 2 +#define CMD_OPT 4 + -+static inline unsigned int match_to_cmd(struct aa_dfa *dfa, ++static inline unsigned int match_to_cmd(struct aa_profile *profile, + unsigned int state, struct unix_sock *u, + char cmd, const char **info) +{ -+ state = match_to_sk(dfa, state, u, info); ++ state = match_to_sk(profile, state, u, info); + if (state) { -+ state = aa_dfa_match_len(dfa, state, &cmd, 1); ++ state = aa_dfa_match_len(profile->policy.dfa, state, &cmd, 1); + if (!state) + *info = "failed cmd selection match"; + } @@ -232,52 +210,51 @@ index 0000000..4fdc04f + return state; +} + -+static inline unsigned int match_to_peer(struct aa_dfa *dfa, ++static inline unsigned int match_to_peer(struct aa_profile *profile, + unsigned int state, + struct unix_sock *u, + struct sockaddr_un *peer_addr, + int peer_addrlen, + const char **info) +{ -+ state = match_to_cmd(dfa, state, u, CMD_ADDR, info); ++ state = match_to_cmd(profile, state, u, CMD_ADDR, info); + if (state) { -+ state = match_addr(dfa, state, peer_addr, peer_addrlen); ++ state = match_addr(profile, state, peer_addr, peer_addrlen); + if (!state) + *info = "failed peer address match"; + } + return state; +} + -+static int do_perms(struct aa_profile *profile, struct aa_ruleset *rule, -+ unsigned int state, u32 request, -+ struct apparmor_audit_data *ad) ++static int do_perms(struct aa_profile *profile, unsigned int state, u32 request, ++ struct common_audit_data *sa) +{ + struct aa_perms perms; + + AA_BUG(!profile); + -+ perms = *aa_lookup_perms(rule->policy, state); ++ aa_compute_perms(profile->policy.dfa, state, &perms); + aa_apply_modes_to_perms(profile, &perms); -+ return aa_check_perms(profile, &perms, request, ad, ++ return aa_check_perms(profile, &perms, request, sa, + audit_net_cb); +} + -+static int match_label(struct aa_profile *profile, struct aa_ruleset *rule, -+ struct aa_profile *peer, unsigned int state, u32 request, -+ struct apparmor_audit_data *ad) ++static int match_label(struct aa_profile *profile, struct aa_profile *peer, ++ unsigned int state, u32 request, ++ struct common_audit_data *sa) +{ + AA_BUG(!profile); + AA_BUG(!peer); + -+ ad->peer = &peer->label; ++ aad(sa)->peer = &peer->label; + + if (state) { -+ state = aa_dfa_match(rule->policy->dfa, state, ++ state = aa_dfa_match(profile->policy.dfa, state, + peer->base.hname); + if (!state) -+ ad->info = "failed peer label match"; ++ aad(sa)->info = "failed peer label match"; + } -+ return do_perms(profile, rule, state, request, ad); ++ return do_perms(profile, state, request, sa); +} + + @@ -289,22 +266,19 @@ index 0000000..4fdc04f +static int profile_create_perm(struct aa_profile *profile, int family, + int type, int protocol) +{ -+ struct aa_ruleset *rules = list_first_entry(&profile->rules, -+ typeof(*rules), list); -+ aa_state_t state; -+ DEFINE_AUDIT_NET(ad, OP_CREATE, NULL, family, type, protocol); ++ unsigned int state; ++ DEFINE_AUDIT_NET(sa, OP_CREATE, NULL, family, type, protocol); + + AA_BUG(!profile); + AA_BUG(profile_unconfined(profile)); + -+ state = RULE_MEDIATES_AF(rules, AF_UNIX); -+ if (state) { -+ state = match_to_prot(rules->policy->dfa, state, type, protocol, -+ &ad.info); -+ return do_perms(profile, rules, state, AA_MAY_CREATE, &ad); ++ if ((state = PROFILE_MEDIATES_AF(profile, AF_UNIX))) { ++ state = match_to_prot(profile, state, type, protocol, ++ &aad(&sa)->info); ++ return do_perms(profile, state, AA_MAY_CREATE, &sa); + } + -+ return aa_profile_af_perm(profile, &ad, AA_MAY_CREATE, family, type); ++ return aa_profile_af_perm(profile, &sa, AA_MAY_CREATE, family, type); +} + +int aa_unix_create_perm(struct aa_label *label, int family, int type, @@ -320,56 +294,45 @@ index 0000000..4fdc04f +} + + -+static inline int profile_sk_perm(struct aa_profile *profile, -+ struct apparmor_audit_data *ad, ++static inline int profile_sk_perm(struct aa_profile *profile, const char *op, + u32 request, struct sock *sk) +{ -+ struct aa_ruleset *rules = list_first_entry(&profile->rules, -+ typeof(*rules), -+ list); + unsigned int state; ++ DEFINE_AUDIT_SK(sa, op, sk); + + AA_BUG(!profile); + AA_BUG(!sk); + AA_BUG(UNIX_FS(sk)); + AA_BUG(profile_unconfined(profile)); + -+ state = RULE_MEDIATES_AF(rules, AF_UNIX); ++ state = PROFILE_MEDIATES_AF(profile, AF_UNIX); + if (state) { -+ state = match_to_sk(rules->policy->dfa, state, unix_sk(sk), -+ &ad->info); -+ return do_perms(profile, rules, state, request, ad); ++ state = match_to_sk(profile, state, unix_sk(sk), ++ &aad(&sa)->info); ++ return do_perms(profile, state, request, &sa); + } + -+ return aa_profile_af_sk_perm(profile, ad, request, sk); ++ return aa_profile_af_sk_perm(profile, &sa, request, sk); +} + -+int aa_unix_label_sk_perm(const struct cred *subj_cred, -+ struct aa_label *label, const char *op, u32 request, ++int aa_unix_label_sk_perm(struct aa_label *label, const char *op, u32 request, + struct sock *sk) +{ -+ if (!unconfined(label)) { -+ struct aa_profile *profile; -+ DEFINE_AUDIT_SK(ad, op, sk); ++ struct aa_profile *profile; + -+ ad.subj_cred = subj_cred; -+ return fn_for_each_confined(label, profile, -+ profile_sk_perm(profile, &ad, request, sk)); -+ } -+ return 0; ++ return fn_for_each_confined(label, profile, ++ profile_sk_perm(profile, op, request, sk)); +} + -+static int unix_label_sock_perm(const struct cred *subj_cred, -+ struct aa_label *label, const char *op, -+ u32 request, struct socket *sock) ++static int unix_label_sock_perm(struct aa_label *label, const char *op, u32 request, ++ struct socket *sock) +{ + if (unconfined(label)) + return 0; + if (UNIX_FS(sock->sk)) -+ return unix_fs_perm(op, request, subj_cred, label, -+ unix_sk(sock->sk), 0); ++ return unix_fs_perm(op, request, label, unix_sk(sock->sk), 0); + -+ return aa_unix_label_sk_perm(subj_cred, label, op, request, sock->sk); ++ return aa_unix_label_sk_perm(label, op, request, sock->sk); +} + +/* revaliation, get/set attr */ @@ -379,7 +342,7 @@ index 0000000..4fdc04f + int error; + + label = begin_current_label_crit_section(); -+ error = unix_label_sock_perm(current_cred(), label, op, request, sock); ++ error = unix_label_sock_perm(label, op, request, sock); + end_current_label_crit_section(label); + + return error; @@ -388,32 +351,29 @@ index 0000000..4fdc04f +static int profile_bind_perm(struct aa_profile *profile, struct sock *sk, + struct sockaddr *addr, int addrlen) +{ -+ struct aa_ruleset *rules = list_first_entry(&profile->rules, -+ typeof(*rules), list); + unsigned int state; -+ DEFINE_AUDIT_SK(ad, OP_BIND, sk); ++ DEFINE_AUDIT_SK(sa, OP_BIND, sk); + -+ ad.subj_cred = current_cred(); + AA_BUG(!profile); + AA_BUG(!sk); + AA_BUG(addr->sa_family != AF_UNIX); + AA_BUG(profile_unconfined(profile)); + AA_BUG(unix_addr_fs(addr, addrlen)); + -+ state = RULE_MEDIATES_AF(rules, AF_UNIX); ++ state = PROFILE_MEDIATES_AF(profile, AF_UNIX); + if (state) { + /* bind for abstract socket */ -+ ad.net.addr = unix_addr(addr); -+ ad.net.addrlen = addrlen; ++ aad(&sa)->net.addr = unix_addr(addr); ++ aad(&sa)->net.addrlen = addrlen; + -+ state = match_to_local(rules->policy->dfa, state, ++ state = match_to_local(profile, state, + sk->sk_type, sk->sk_protocol, + unix_addr(addr), addrlen, -+ &ad.info); -+ return do_perms(profile, rules, state, AA_MAY_BIND, &ad); ++ &aad(&sa)->info); ++ return do_perms(profile, state, AA_MAY_BIND, &sa); + } + -+ return aa_profile_af_sk_perm(profile, &ad, AA_MAY_BIND, sk); ++ return aa_profile_af_sk_perm(profile, &sa, AA_MAY_BIND, sk); +} + +int aa_unix_bind_perm(struct socket *sock, struct sockaddr *address, @@ -447,32 +407,30 @@ index 0000000..4fdc04f +static int profile_listen_perm(struct aa_profile *profile, struct sock *sk, + int backlog) +{ -+ struct aa_ruleset *rules = list_first_entry(&profile->rules, -+ typeof(*rules), list); + unsigned int state; -+ DEFINE_AUDIT_SK(ad, OP_LISTEN, sk); ++ DEFINE_AUDIT_SK(sa, OP_LISTEN, sk); + + AA_BUG(!profile); + AA_BUG(!sk); + AA_BUG(UNIX_FS(sk)); + AA_BUG(profile_unconfined(profile)); + -+ state = RULE_MEDIATES_AF(rules, AF_UNIX); ++ state = PROFILE_MEDIATES_AF(profile, AF_UNIX); + if (state) { + __be16 b = cpu_to_be16(backlog); + -+ state = match_to_cmd(rules->policy->dfa, state, unix_sk(sk), -+ CMD_LISTEN, &ad.info); ++ state = match_to_cmd(profile, state, unix_sk(sk), CMD_LISTEN, ++ &aad(&sa)->info); + if (state) { -+ state = aa_dfa_match_len(rules->policy->dfa, state, ++ state = aa_dfa_match_len(profile->policy.dfa, state, + (char *) &b, 2); + if (!state) -+ ad.info = "failed listen backlog match"; ++ aad(&sa)->info = "failed listen backlog match"; + } -+ return do_perms(profile, rules, state, AA_MAY_LISTEN, &ad); ++ return do_perms(profile, state, AA_MAY_LISTEN, &sa); + } + -+ return aa_profile_af_sk_perm(profile, &ad, AA_MAY_LISTEN, sk); ++ return aa_profile_af_sk_perm(profile, &sa, AA_MAY_LISTEN, sk); +} + +int aa_unix_listen_perm(struct socket *sock, int backlog) @@ -496,24 +454,22 @@ index 0000000..4fdc04f + struct sock *sk, + struct sock *newsk) +{ -+ struct aa_ruleset *rules = list_first_entry(&profile->rules, -+ typeof(*rules), list); + unsigned int state; -+ DEFINE_AUDIT_SK(ad, OP_ACCEPT, sk); ++ DEFINE_AUDIT_SK(sa, OP_ACCEPT, sk); + + AA_BUG(!profile); + AA_BUG(!sk); + AA_BUG(UNIX_FS(sk)); + AA_BUG(profile_unconfined(profile)); + -+ state = RULE_MEDIATES_AF(rules, AF_UNIX); ++ state = PROFILE_MEDIATES_AF(profile, AF_UNIX); + if (state) { -+ state = match_to_sk(rules->policy->dfa, state, unix_sk(sk), -+ &ad.info); -+ return do_perms(profile, rules, state, AA_MAY_ACCEPT, &ad); ++ state = match_to_sk(profile, state, unix_sk(sk), ++ &aad(&sa)->info); ++ return do_perms(profile, state, AA_MAY_ACCEPT, &sa); + } + -+ return aa_profile_af_sk_perm(profile, &ad, AA_MAY_ACCEPT, sk); ++ return aa_profile_af_sk_perm(profile, &sa, AA_MAY_ACCEPT, sk); +} + +/* ability of sock to connect, not peer address binding */ @@ -548,32 +504,30 @@ index 0000000..4fdc04f +static int profile_opt_perm(struct aa_profile *profile, const char *op, u32 request, + struct sock *sk, int level, int optname) +{ -+ struct aa_ruleset *rules = list_first_entry(&profile->rules, -+ typeof(*rules), list); + unsigned int state; -+ DEFINE_AUDIT_SK(ad, op, sk); ++ DEFINE_AUDIT_SK(sa, op, sk); + + AA_BUG(!profile); + AA_BUG(!sk); + AA_BUG(UNIX_FS(sk)); + AA_BUG(profile_unconfined(profile)); + -+ state = RULE_MEDIATES_AF(rules, AF_UNIX); ++ state = PROFILE_MEDIATES_AF(profile, AF_UNIX); + if (state) { + __be16 b = cpu_to_be16(optname); + -+ state = match_to_cmd(rules->policy->dfa, state, unix_sk(sk), -+ CMD_OPT, &ad.info); ++ state = match_to_cmd(profile, state, unix_sk(sk), CMD_OPT, ++ &aad(&sa)->info); + if (state) { -+ state = aa_dfa_match_len(rules->policy->dfa, state, ++ state = aa_dfa_match_len(profile->policy.dfa, state, + (char *) &b, 2); + if (!state) -+ ad.info = "failed sockopt match"; ++ aad(&sa)->info = "failed sockopt match"; + } -+ return do_perms(profile, rules, state, request, &ad); ++ return do_perms(profile, state, request, &sa); + } + -+ return aa_profile_af_sk_perm(profile, &ad, request, sk); ++ return aa_profile_af_sk_perm(profile, &sa, request, sk); +} + +int aa_unix_opt_perm(const char *op, u32 request, struct socket *sock, int level, @@ -597,10 +551,8 @@ index 0000000..4fdc04f +static int profile_peer_perm(struct aa_profile *profile, const char *op, u32 request, + struct sock *sk, struct sock *peer_sk, + struct aa_label *peer_label, -+ struct apparmor_audit_data *ad) ++ struct common_audit_data *sa) +{ -+ struct aa_ruleset *rules = list_first_entry(&profile->rules, -+ typeof(*rules), list); + unsigned int state; + + AA_BUG(!profile); @@ -609,35 +561,33 @@ index 0000000..4fdc04f + AA_BUG(!peer_sk); + AA_BUG(UNIX_FS(peer_sk)); + -+ state = RULE_MEDIATES_AF(rules, AF_UNIX); ++ state = PROFILE_MEDIATES_AF(profile, AF_UNIX); + if (state) { -+ struct aa_sk_ctx *peer_ctx = SK_CTX(peer_sk); ++ struct aa_sk_ctx *peer_ctx = aa_sock(peer_sk); + struct aa_profile *peerp; + struct sockaddr_un *addr = NULL; + int len = 0; -+ + if (unix_sk(peer_sk)->addr) { + addr = unix_sk(peer_sk)->addr->name; + len = unix_sk(peer_sk)->addr->len; + } -+ state = match_to_peer(rules->policy->dfa, state, unix_sk(sk), -+ addr, len, &ad->info); ++ state = match_to_peer(profile, state, unix_sk(sk), ++ addr, len, &aad(sa)->info); + if (!peer_label) + peer_label = peer_ctx->label; + return fn_for_each_in_ns(peer_label, peerp, -+ match_label(profile, rules, peerp, state, -+ request, ad)); ++ match_label(profile, peerp, state, request, ++ sa)); + } + -+ return aa_profile_af_sk_perm(profile, ad, request, sk); ++ return aa_profile_af_sk_perm(profile, sa, request, sk); +} + +/** + * + * Requires: lock held on both @sk and @peer_sk + */ -+int aa_unix_peer_perm(const struct cred *subj_cred, -+ struct aa_label *label, const char *op, u32 request, ++int aa_unix_peer_perm(struct aa_label *label, const char *op, u32 request, + struct sock *sk, struct sock *peer_sk, + struct aa_label *peer_label) +{ @@ -648,18 +598,18 @@ index 0000000..4fdc04f + AA_BUG(!sk); + AA_BUG(!peer_sk); + -+ if (UNIX_FS(aa_unix_sk(peeru))) { -+ return unix_fs_perm(op, request, subj_cred, label, peeru, 0); -+ } else if (UNIX_FS(aa_unix_sk(u))) { -+ return unix_fs_perm(op, request, subj_cred, label, u, 0); -+ } else { ++ if (UNIX_FS(aa_unix_sk(peeru))) ++ return unix_fs_perm(op, request, label, peeru, 0); ++ else if (UNIX_FS(aa_unix_sk(u))) ++ return unix_fs_perm(op, request, label, u, 0); ++ else { + struct aa_profile *profile; -+ DEFINE_AUDIT_SK(ad, op, sk); ++ DEFINE_AUDIT_SK(sa, op, sk); ++ aad(&sa)->net.peer_sk = peer_sk; + -+ ad.net.peer_sk = peer_sk; -+ ad.subj_cred = subj_cred; + /* TODO: ns!!! */ + if (!net_eq(sock_net(sk), sock_net(peer_sk))) { ++ ; + } + + if (unconfined(label)) @@ -667,7 +617,7 @@ index 0000000..4fdc04f + + return fn_for_each_confined(label, profile, + profile_peer_perm(profile, op, request, sk, -+ peer_sk, peer_label, &ad)); ++ peer_sk, peer_label, &sa)); + } +} + @@ -679,13 +629,11 @@ index 0000000..4fdc04f + unix_state_lock(sk1); + return; + } -+ if (sk1 < sk2) { -+ unix_state_lock(sk1); -+ unix_state_lock(sk2); -+ } else { -+ unix_state_lock(sk2); -+ unix_state_lock(sk1); -+ } ++ if (sk1 > sk2) ++ swap(sk1, sk2); ++ ++ unix_state_lock(sk1); ++ unix_state_lock_nested(sk2, U_LOCK_SECOND); +} + +static void unix_state_double_unlock(struct sock *sk1, struct sock *sk2) @@ -698,8 +646,8 @@ index 0000000..4fdc04f + unix_state_unlock(sk2); +} + -+int aa_unix_file_perm(const struct cred *subj_cred, struct aa_label *label, -+ const char *op, u32 request, struct socket *sock) ++int aa_unix_file_perm(struct aa_label *label, const char *op, u32 request, ++ struct socket *sock) +{ + struct sock *peer_sk = NULL; + u32 sk_req = request & ~NET_PEER_MASK; @@ -716,10 +664,10 @@ index 0000000..4fdc04f + if (peer_sk) + sock_hold(peer_sk); + if (!unix_connected(sock) && sk_req) { -+ error = unix_label_sock_perm(subj_cred, label, op, sk_req, -+ sock); ++ error = unix_label_sock_perm(label, op, sk_req, sock); + if (!error) { -+ } // TODO: update label ++ // update label ++ } + } + unix_state_unlock(sock->sk); + if (!peer_sk) @@ -727,26 +675,21 @@ index 0000000..4fdc04f + + unix_state_double_lock(sock->sk, peer_sk); + if (UNIX_FS(sock->sk)) { -+ error = unix_fs_perm(op, request, subj_cred, label, -+ unix_sk(sock->sk), ++ error = unix_fs_perm(op, request, label, unix_sk(sock->sk), + PATH_SOCK_COND); + } else if (UNIX_FS(peer_sk)) { -+ error = unix_fs_perm(op, request, subj_cred, label, -+ unix_sk(peer_sk), ++ error = unix_fs_perm(op, request, label, unix_sk(peer_sk), + PATH_SOCK_COND); + } else { -+ struct aa_sk_ctx *pctx = SK_CTX(peer_sk); -+ ++ struct aa_sk_ctx *pctx = aa_sock(peer_sk); + if (sk_req) -+ error = aa_unix_label_sk_perm(subj_cred, -+ label, op, sk_req, ++ error = aa_unix_label_sk_perm(label, op, sk_req, + sock->sk); + last_error(error, -+ xcheck(aa_unix_peer_perm(subj_cred, label, op, ++ xcheck(aa_unix_peer_perm(label, op, + MAY_READ | MAY_WRITE, + sock->sk, peer_sk, NULL), -+ aa_unix_peer_perm(sock->file ? sock->file->f_cred : NULL, -+ pctx->label, op, ++ aa_unix_peer_perm(pctx->label, op, + MAY_READ | MAY_WRITE, + peer_sk, sock->sk, label))); + } @@ -757,10 +700,10 @@ index 0000000..4fdc04f + return error; +} diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c -index 28b9d59..8bce525 100644 +index c880bbf..e39b03a 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c -@@ -2383,6 +2383,11 @@ static struct aa_sfs_entry aa_sfs_entry_ns[] = { +@@ -2421,6 +2421,11 @@ static struct aa_sfs_entry aa_sfs_entry_ns[] = { { } }; @@ -772,16 +715,16 @@ index 28b9d59..8bce525 100644 static struct aa_sfs_entry aa_sfs_entry_query_label[] = { AA_SFS_FILE_STRING("perms", "allow deny audit quiet"), AA_SFS_FILE_BOOLEAN("data", 1), -@@ -2413,6 +2418,7 @@ static struct aa_sfs_entry aa_sfs_entry_features[] = { +@@ -2445,6 +2450,7 @@ static struct aa_sfs_entry aa_sfs_entry_features[] = { AA_SFS_DIR("caps", aa_sfs_entry_caps), AA_SFS_DIR("ptrace", aa_sfs_entry_ptrace), AA_SFS_DIR("signal", aa_sfs_entry_signal), -+ AA_SFS_DIR("dbus", aa_sfs_entry_dbus), ++ AA_SFS_DIR("dbus", aa_sfs_entry_dbus), AA_SFS_DIR("query", aa_sfs_entry_query), - AA_SFS_DIR("io_uring", aa_sfs_entry_io_uring), { } + }; diff --git a/security/apparmor/file.c b/security/apparmor/file.c -index 62bc46e..1846bf2 100644 +index e1b7e93..866272c 100644 --- a/security/apparmor/file.c +++ b/security/apparmor/file.c @@ -14,6 +14,7 @@ @@ -792,37 +735,22 @@ index 62bc46e..1846bf2 100644 #include "include/apparmor.h" #include "include/audit.h" #include "include/cred.h" -@@ -212,16 +213,18 @@ aa_state_t aa_str_perms(struct aa_policydb *file_rules, aa_state_t start, - return state; - } - --static int __aa_path_perm(const char *op, const struct cred *subj_cred, -- struct aa_profile *profile, const char *name, -- u32 request, struct path_cond *cond, int flags, -- struct aa_perms *perms) -+int __aa_path_perm(const char *op, const struct cred *subj_cred, -+ struct aa_profile *profile, const char *name, -+ u32 request, struct path_cond *cond, int flags, -+ struct aa_perms *perms) +@@ -271,7 +272,8 @@ int __aa_path_perm(const char *op, struct aa_profile *profile, const char *name, { - struct aa_ruleset *rules = list_first_entry(&profile->rules, - typeof(*rules), list); int e = 0; - if (profile_unconfined(profile)) + if (profile_unconfined(profile) || -+ ((flags & PATH_SOCK_COND) && -+ !RULE_MEDIATES_AF(rules, AF_UNIX))) ++ ((flags & PATH_SOCK_COND) && !PROFILE_MEDIATES_AF(profile, AF_UNIX))) return 0; - aa_str_perms(rules->file, rules->file->start[AA_CLASS_FILE], - name, cond, perms); + aa_str_perms(profile->file.dfa, profile->file.start, name, cond, perms); + if (request & ~perms->allow) diff --git a/security/apparmor/include/af_unix.h b/security/apparmor/include/af_unix.h new file mode 100644 -index 0000000..bd0fb49 +index 0000000..d1b7f23 --- /dev/null +++ b/security/apparmor/include/af_unix.h -@@ -0,0 +1,122 @@ -+/* SPDX-License-Identifier: GPL-2.0-only */ +@@ -0,0 +1,114 @@ +/* + * AppArmor security module + * @@ -852,8 +780,7 @@ index 0000000..bd0fb49 + +#define unix_addr(A) ((struct sockaddr_un *)(A)) +#define unix_addr_anon(A, L) ((A) && unix_addr_len(L) <= 0) -+#define unix_addr_fs(A, L) (!unix_addr_anon(A, L) && \ -+ !addr_unix_abstract_name(unix_addr(A)->sun_path)) ++#define unix_addr_fs(A, L) (!unix_addr_anon(A, L) && !addr_unix_abstract_name(unix_addr(A)->sun_path)) + +#define UNIX_ANONYMOUS(U) (!unix_sk(U)->addr) +/* from net/unix/af_unix.c */ @@ -867,64 +794,59 @@ index 0000000..bd0fb49 +{ + char *buf = (A) ? (char *) &(A)->sun_path : NULL; + int len = unix_addr_len(L); -+ + if (!buf || len <= 0) -+ pr_warn(" "); ++ printk(" "); + else if (buf[0]) -+ pr_warn(" %s", buf); ++ printk(" %s", buf); + else + /* abstract name len includes leading \0 */ -+ pr_warn(" %d @%.*s", len - 1, len - 1, buf+1); ++ printk(" %d @%.*s", len - 1, len - 1, buf+1); +}; + ++/* ++ printk("%s: %s: f %d, t %d, p %d", __FUNCTION__, \ ++ #SK , \ ++*/ +#define print_unix_sk(SK) \ +do { \ + struct unix_sock *u = unix_sk(SK); \ -+ \ -+ pr_warn("%s: f %d, t %d, p %d", #SK, \ ++ printk("%s: f %d, t %d, p %d", #SK , \ + (SK)->sk_family, (SK)->sk_type, (SK)->sk_protocol); \ + if (u->addr) \ + print_unix_addr(u->addr->name, u->addr->len); \ + else \ + print_unix_addr(NULL, sizeof(sa_family_t)); \ ++ /* printk("\n");*/ \ +} while (0) + +#define print_sk(SK) \ +do { \ + if (!(SK)) { \ -+ pr_warn("%s: %s is null\n", __func__, #SK); \ ++ printk("%s: %s is null\n", __FUNCTION__, #SK); \ + } else if ((SK)->sk_family == PF_UNIX) { \ + print_unix_sk(SK); \ -+ pr_warn("\n"); \ ++ printk("\n"); \ + } else { \ -+ pr_warn("%s: %s: family %d\n", __func__, #SK, \ ++ printk("%s: %s: family %d\n", __FUNCTION__, #SK , \ + (SK)->sk_family); \ + } \ +} while (0) + -+#define print_sock_addr(U) \ -+do { \ -+ pr_warn("%s:\n", __func__); \ -+ pr_warn" sock %s:", sock_ctx && sock_ctx->label ? \ -+ aa_label_printk(sock_ctx->label, GFP_ATOMIC); : \ -+ ""); print_sk(sock); \ -+ pr_warn(" other %s:", other_ctx && other_ctx->label ? \ -+ aa_label_printk(other_ctx->label, GFP_ATOMIC); : \ -+ ""); print_sk(other); \ -+ pr_warn(" new %s", new_ctx && new_ctx->label ? \ -+ aa_label_printk(new_ctx->label, GFP_ATOMIC); : \ -+ ""); print_sk(newsk); \ ++#define print_sock_addr(U) \ ++do { \ ++ printk("%s:\n", __FUNCTION__); \ ++ printk(" sock %s:", sock_ctx && sock_ctx->label ? aa_label_printk(sock_ctx->label, GFP_ATOMIC); : ""); print_sk(sock); \ ++ printk(" other %s:", other_ctx && other_ctx->label ? aa_label_printk(other_ctx->label, GFP_ATOMIC); : ""); print_sk(other); \ ++ printk(" new %s", new_ctx && new_ctx->label ? aa_label_printk(new_ctx->label, GFP_ATOMIC); : ""); print_sk(newsk); \ +} while (0) + + + + -+int aa_unix_peer_perm(const struct cred *subj_cred, -+ struct aa_label *label, const char *op, u32 request, ++int aa_unix_peer_perm(struct aa_label *label, const char *op, u32 request, + struct sock *sk, struct sock *peer_sk, + struct aa_label *peer_label); -+int aa_unix_label_sk_perm(const struct cred *subj_cred, -+ struct aa_label *label, const char *op, u32 request, ++int aa_unix_label_sk_perm(struct aa_label *label, const char *op, u32 request, + struct sock *sk); +int aa_unix_sock_perm(const char *op, u32 request, struct socket *sock); +int aa_unix_create_perm(struct aa_label *label, int family, int type, @@ -939,58 +861,23 @@ index 0000000..bd0fb49 + struct msghdr *msg, int size); +int aa_unix_opt_perm(const char *op, u32 request, struct socket *sock, int level, + int optname); -+int aa_unix_file_perm(const struct cred *subj_cred, -+ struct aa_label *label, const char *op, u32 request, ++int aa_unix_file_perm(struct aa_label *label, const char *op, u32 request, + struct socket *sock); + +#endif /* __AA_AF_UNIX_H */ -diff --git a/security/apparmor/include/file.h b/security/apparmor/include/file.h -index 6e8f2aa..d5b3c1f 100644 ---- a/security/apparmor/include/file.h -+++ b/security/apparmor/include/file.h -@@ -83,6 +83,10 @@ aa_state_t aa_str_perms(struct aa_policydb *file_rules, aa_state_t start, - const char *name, struct path_cond *cond, - struct aa_perms *perms); - -+int __aa_path_perm(const char *op, const struct cred *subj_cred, -+ struct aa_profile *profile, const char *name, -+ u32 request, struct path_cond *cond, int flags, -+ struct aa_perms *perms); - int aa_path_perm(const char *op, const struct cred *subj_cred, - struct aa_label *label, const struct path *path, - int flags, u32 request, struct path_cond *cond); -diff --git a/security/apparmor/include/label.h b/security/apparmor/include/label.h -index 2a72e6b..1ac9e10 100644 ---- a/security/apparmor/include/label.h -+++ b/security/apparmor/include/label.h -@@ -261,7 +261,10 @@ for ((I).i = (I).j = 0; \ - struct label_it i; \ - int ret = 0; \ - label_for_each(i, (L), profile) { \ -- if (RULE_MEDIATES(&profile->rules, (C))) { \ -+ struct aa_ruleset *rules = \ -+ list_first_entry(&profile->rules, typeof(*rules),\ -+ list); \ -+ if (RULE_MEDIATES(rules, (C))) { \ - ret = 1; \ - break; \ - } \ diff --git a/security/apparmor/include/net.h b/security/apparmor/include/net.h -index b7769ea..f377e02 100644 +index 7cfcf68..52c2d9b 100644 --- a/security/apparmor/include/net.h +++ b/security/apparmor/include/net.h -@@ -49,8 +49,10 @@ +@@ -49,6 +49,7 @@ struct aa_sk_ctx { struct aa_label *label; struct aa_label *peer; + struct path path; }; -+#define SK_CTX(X) ((X)->sk_security) static inline struct aa_sk_ctx *aa_sock(const struct sock *sk) - { - return sk->sk_security + apparmor_blob_sizes.lbs_sock; -@@ -87,6 +89,9 @@ struct aa_net_compat { +@@ -87,6 +88,9 @@ struct aa_net_compat { ({ \ int __e; \ switch ((FAMILY)) { \ @@ -1013,36 +900,42 @@ index 3431899..8bb915d 100644 PATH_CHROOT_REL = 0x8, /* do path lookup relative to chroot */ PATH_CHROOT_NSCONNECT = 0x10, /* connect paths that are at ns root */ diff --git a/security/apparmor/include/policy.h b/security/apparmor/include/policy.h -index 188b21b..e0e8e02 100644 +index 646582b..e423bb1 100644 --- a/security/apparmor/include/policy.h +++ b/security/apparmor/include/policy.h -@@ -306,8 +306,11 @@ static inline aa_state_t RULE_MEDIATES_AF(struct aa_ruleset *rules, u16 AF) - aa_state_t state = RULE_MEDIATES(rules, AA_CLASS_NET); +@@ -234,9 +234,13 @@ static inline unsigned int PROFILE_MEDIATES_AF(struct aa_profile *profile, + unsigned int state = PROFILE_MEDIATES(profile, AA_CLASS_NET); __be16 be_af = cpu_to_be16(AF); - if (!state) -- return DFA_NOMATCH; +- return 0; +- return aa_dfa_match_len(profile->policy.dfa, state, (char *) &be_af, 2); + if (!state) { -+ state = RULE_MEDIATES(rules, AA_CLASS_NET_COMPAT); ++ state = PROFILE_MEDIATES(profile, AA_CLASS_NET_COMPAT); + if (!state) -+ return DFA_NOMATCH; ++ return 0; + } - return aa_dfa_match_len(rules->policy->dfa, state, (char *) &be_af, 2); ++ state = aa_dfa_match_len(profile->policy.dfa, state, (char *) &be_af, 2); ++ return state; } + /** diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c -index 9a78fd3..9c5c73e 100644 +index 501e3ec..5ab3291 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c -@@ -26,6 +26,7 @@ +@@ -23,8 +23,10 @@ + #include + #include + #include ++#include #include - #include +#include "include/af_unix.h" #include "include/apparmor.h" #include "include/apparmorfs.h" #include "include/audit.h" -@@ -1064,6 +1065,7 @@ static void apparmor_sk_free_security(struct sock *sk) +@@ -811,6 +813,7 @@ static void apparmor_sk_free_security(struct sock *sk) aa_put_label(ctx->label); aa_put_label(ctx->peer); @@ -1050,7 +943,7 @@ index 9a78fd3..9c5c73e 100644 } /** -@@ -1084,6 +1086,102 @@ static void apparmor_sk_clone_security(const struct sock *sk, +@@ -829,6 +832,99 @@ static void apparmor_sk_clone_security(const struct sock *sk, if (new->peer) aa_put_label(new->peer); new->peer = aa_get_label(ctx->peer); @@ -1068,30 +961,29 @@ index 9a78fd3..9c5c73e 100644 +} + +/** -+ * apparmor_unix_stream_connect - check perms before making unix domain conn -+ * -+ * peer is locked when this hook is called -+ */ ++ * apparmor_unix_stream_connect - check perms before making unix domain conn ++ * ++ * peer is locked when this hook is called ++ */ +static int apparmor_unix_stream_connect(struct sock *sk, struct sock *peer_sk, -+ struct sock *newsk) ++ struct sock *newsk) +{ -+ struct aa_sk_ctx *sk_ctx = SK_CTX(sk); -+ struct aa_sk_ctx *peer_ctx = SK_CTX(peer_sk); -+ struct aa_sk_ctx *new_ctx = SK_CTX(newsk); ++ struct aa_sk_ctx *sk_ctx = aa_sock(sk); ++ struct aa_sk_ctx *peer_ctx = aa_sock(peer_sk); ++ struct aa_sk_ctx *new_ctx = aa_sock(newsk); + struct aa_label *label; + struct path *path; + int error; + + label = __begin_current_label_crit_section(); -+ error = aa_unix_peer_perm(current_cred(), label, OP_CONNECT, -+ (AA_MAY_CONNECT | AA_MAY_SEND | AA_MAY_RECEIVE), -+ sk, peer_sk, NULL); ++ error = aa_unix_peer_perm(label, OP_CONNECT, ++ (AA_MAY_CONNECT | AA_MAY_SEND | AA_MAY_RECEIVE), ++ sk, peer_sk, NULL); + if (!UNIX_FS(peer_sk)) { + last_error(error, -+ aa_unix_peer_perm(current_cred(), -+ peer_ctx->label, OP_CONNECT, -+ (AA_MAY_ACCEPT | AA_MAY_SEND | AA_MAY_RECEIVE), -+ peer_sk, sk, label)); ++ aa_unix_peer_perm(peer_ctx->label, OP_CONNECT, ++ (AA_MAY_ACCEPT | AA_MAY_SEND | AA_MAY_RECEIVE), ++ peer_sk, sk, label)); + } + __end_current_label_crit_section(label); + @@ -1127,95 +1019,57 @@ index 9a78fd3..9c5c73e 100644 +} + +/** -+ * apparmor_unix_may_send - check perms before conn or sending unix dgrams -+ * -+ * other is locked when this hook is called -+ * -+ * dgram connect calls may_send, peer setup but path not copied????? -+ */ ++ * apparmor_unix_may_send - check perms before conn or sending unix dgrams ++ * ++ * other is locked when this hook is called ++ * ++ * dgram connect calls may_send, peer setup but path not copied????? ++ */ +static int apparmor_unix_may_send(struct socket *sock, struct socket *peer) +{ -+ struct aa_sk_ctx *peer_ctx = SK_CTX(peer->sk); ++ struct aa_sk_ctx *peer_ctx = aa_sock(peer->sk); + struct aa_label *label; + int error; + + label = __begin_current_label_crit_section(); -+ error = xcheck(aa_unix_peer_perm(current_cred(), -+ label, OP_SENDMSG, AA_MAY_SEND, -+ sock->sk, peer->sk, NULL), -+ aa_unix_peer_perm(peer->file ? peer->file->f_cred : NULL, -+ peer_ctx->label, OP_SENDMSG, -+ AA_MAY_RECEIVE, -+ peer->sk, sock->sk, label)); ++ error = xcheck(aa_unix_peer_perm(label, OP_SENDMSG, AA_MAY_SEND, ++ sock->sk, peer->sk, NULL), ++ aa_unix_peer_perm(peer_ctx->label, OP_SENDMSG, ++ AA_MAY_RECEIVE, ++ peer->sk, sock->sk, label)); + __end_current_label_crit_section(label); + + return error; } - static int apparmor_socket_create(int family, int type, int protocol, int kern) -@@ -1303,14 +1401,30 @@ static int apparmor_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb) - #endif - + /** +@@ -1092,11 +1188,25 @@ static int apparmor_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb) --static struct aa_label *sk_peer_label(struct sock *sk) -+static struct aa_label *sk_peer_get_label(struct sock *sk) + static struct aa_label *sk_peer_label(struct sock *sk) { + struct sock *peer_sk; struct aa_sk_ctx *ctx = aa_sock(sk); -+ struct aa_label *label = ERR_PTR(-ENOPROTOOPT); if (ctx->peer) -- return ctx->peer; -+ return aa_get_label(ctx->peer); + return ctx->peer; -- return ERR_PTR(-ENOPROTOOPT); + if (sk->sk_family != PF_UNIX) + return ERR_PTR(-ENOPROTOOPT); + + /* check for sockpair peering which does not go through + * security_unix_stream_connect + */ -+ peer_sk = unix_peer_get(sk); ++ peer_sk = unix_peer(sk); + if (peer_sk) { -+ ctx = SK_CTX(peer_sk); ++ ctx = aa_sock(peer_sk); + if (ctx->label) -+ label = aa_get_label(ctx->label); -+ sock_put(peer_sk); ++ return ctx->label; + } + -+ return label; + return ERR_PTR(-ENOPROTOOPT); } - /** -@@ -1333,7 +1447,7 @@ static int apparmor_socket_getpeersec_stream(struct socket *sock, - struct aa_label *peer; - - label = begin_current_label_crit_section(); -- peer = sk_peer_label(sock->sk); -+ peer = sk_peer_get_label(sock->sk); - if (IS_ERR(peer)) { - error = PTR_ERR(peer); - goto done; -@@ -1344,7 +1458,7 @@ static int apparmor_socket_getpeersec_stream(struct socket *sock, - /* don't include terminating \0 in slen, it breaks some apps */ - if (slen < 0) { - error = -ENOMEM; -- goto done; -+ goto done_put; - } - if (slen > len) { - error = -ERANGE; -@@ -1356,6 +1470,9 @@ static int apparmor_socket_getpeersec_stream(struct socket *sock, - done_len: - if (copy_to_sockptr(optlen, &slen, sizeof(slen))) - error = -EFAULT; -+ -+done_put: -+ aa_put_label(peer); - done: - end_current_label_crit_section(label); - kfree(name); -@@ -1467,6 +1584,9 @@ static struct security_hook_list apparmor_hooks[] __ro_after_init = { +@@ -1243,6 +1353,9 @@ static struct security_hook_list apparmor_hooks[] __lsm_ro_after_init = { LSM_HOOK_INIT(sk_free_security, apparmor_sk_free_security), LSM_HOOK_INIT(sk_clone_security, apparmor_sk_clone_security), @@ -1226,7 +1080,7 @@ index 9a78fd3..9c5c73e 100644 LSM_HOOK_INIT(socket_post_create, apparmor_socket_post_create), LSM_HOOK_INIT(socket_bind, apparmor_socket_bind), diff --git a/security/apparmor/net.c b/security/apparmor/net.c -index 3cd71bf..b3c9b0d 100644 +index c18ba85..ea95819 100644 --- a/security/apparmor/net.c +++ b/security/apparmor/net.c @@ -8,6 +8,7 @@ @@ -1237,15 +1091,15 @@ index 3cd71bf..b3c9b0d 100644 #include "include/apparmor.h" #include "include/audit.h" #include "include/cred.h" -@@ -26,6 +27,7 @@ struct aa_sfs_entry aa_sfs_entry_network[] = { +@@ -27,6 +28,7 @@ struct aa_sfs_entry aa_sfs_entry_network[] = { struct aa_sfs_entry aa_sfs_entry_network_compat[] = { AA_SFS_FILE_STRING("af_mask", AA_SFS_AF_MASK), -+ AA_SFS_FILE_BOOLEAN("af_unix", 1), ++ AA_SFS_FILE_BOOLEAN("af_unix", 1), { } }; -@@ -71,6 +73,37 @@ static const char * const net_mask_names[] = { +@@ -72,6 +74,36 @@ static const char * const net_mask_names[] = { "unknown", }; @@ -1273,8 +1127,7 @@ index 3cd71bf..b3c9b0d 100644 +static void audit_unix_sk_addr(struct audit_buffer *ab, const char *str, + const struct sock *sk) +{ -+ const struct unix_sock *u = unix_sk(sk); -+ ++ struct unix_sock *u = unix_sk(sk); + if (u && u->addr) + audit_unix_addr(ab, str, u->addr->name, u->addr->len); + else @@ -1283,58 +1136,59 @@ index 3cd71bf..b3c9b0d 100644 /* audit callback for net specific fields */ void audit_net_cb(struct audit_buffer *ab, void *va) -@@ -78,12 +111,12 @@ void audit_net_cb(struct audit_buffer *ab, void *va) - struct common_audit_data *sa = va; - struct apparmor_audit_data *ad = aad(sa); - -- if (address_family_names[sa->u.net->family]) -+ if (address_family_names[ad->common.u.net->family]) - audit_log_format(ab, " family=\"%s\"", -- address_family_names[sa->u.net->family]); -+ address_family_names[ad->common.u.net->family]); - else - audit_log_format(ab, " family=\"unknown(%d)\"", -- sa->u.net->family); -+ ad->common.u.net->family); - if (sock_type_names[ad->net.type]) - audit_log_format(ab, " sock_type=\"%s\"", - sock_type_names[ad->net.type]); -@@ -103,6 +136,23 @@ void audit_net_cb(struct audit_buffer *ab, void *va) +@@ -103,6 +135,23 @@ void audit_net_cb(struct audit_buffer *ab, void *va) net_mask_names, NET_PERMS_MASK); } } -+ if (ad->common.u.net->family == AF_UNIX) { -+ if ((ad->request & ~NET_PEER_MASK) && ad->net.addr) ++ if (sa->u.net->family == AF_UNIX) { ++ if ((aad(sa)->request & ~NET_PEER_MASK) && aad(sa)->net.addr) + audit_unix_addr(ab, "addr", -+ unix_addr(ad->net.addr), -+ ad->net.addrlen); ++ unix_addr(aad(sa)->net.addr), ++ aad(sa)->net.addrlen); + else -+ audit_unix_sk_addr(ab, "addr", ad->common.u.net->sk); -+ if (ad->request & NET_PEER_MASK) { -+ if (ad->net.addr) ++ audit_unix_sk_addr(ab, "addr", sa->u.net->sk); ++ if (aad(sa)->request & NET_PEER_MASK) { ++ if (aad(sa)->net.addr) + audit_unix_addr(ab, "peer_addr", -+ unix_addr(ad->net.addr), -+ ad->net.addrlen); ++ unix_addr(aad(sa)->net.addr), ++ aad(sa)->net.addrlen); + else + audit_unix_sk_addr(ab, "peer_addr", -+ ad->net.peer_sk); ++ aad(sa)->net.peer_sk); + } + } - if (ad->peer) { + if (aad(sa)->peer) { audit_log_format(ab, " peer="); - aa_label_xaudit(ab, labels_ns(ad->subj_label), ad->peer, -@@ -263,7 +263,10 @@ int aa_sock_file_perm(const struct cred *subj_cred, struct aa_label *label, + aa_label_xaudit(ab, labels_ns(aad(sa)->label), aad(sa)->peer, +@@ -206,7 +255,9 @@ int aa_sock_file_perm(struct aa_label *label, const char *op, u32 request, if (!sock || !sock->sk) return 0; -- return aa_label_sk_perm(subj_cred, label, op, request, sock->sk); +- return aa_label_sk_perm(label, op, request, sock->sk); + return af_select(sock->sk->sk_family, -+ file_perm(subj_cred, label, op, request, sock), -+ aa_label_sk_perm(subj_cred, label, op, request, -+ sock->sk)); ++ file_perm(label, op, request, sock), ++ aa_label_sk_perm(label, op, request, sock->sk)); } #ifdef CONFIG_NETWORK_SECMARK +diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c +index f9f762d..db9ccb7 100644 +--- a/security/apparmor/policy_unpack.c ++++ b/security/apparmor/policy_unpack.c +@@ -309,11 +309,11 @@ static bool unpack_u16(struct aa_ext *e, u16 *data, const char *name) + if (data) + *data = le16_to_cpu(get_unaligned((__le16 *) e->pos)); + e->pos += sizeof(u16); +- return 1; ++ return true; + } + fail: + e->pos = pos; +- return 0; ++ return false; + } + + VISIBLE_IF_KUNIT bool aa_unpack_u32(struct aa_ext *e, u32 *data, const char *name) -- -2.39.4 +2.40.4 diff --git a/SPECS/91/linux/generic/9p-transport-for-9p.patch b/SPECS/linux/6.1/generic/6.0-9p-transport-for-9p.patch similarity index 83% rename from SPECS/91/linux/generic/9p-transport-for-9p.patch rename to SPECS/linux/6.1/generic/6.0-9p-transport-for-9p.patch index a4d2742076..8bc7877a74 100644 --- a/SPECS/91/linux/generic/9p-transport-for-9p.patch +++ b/SPECS/linux/6.1/generic/6.0-9p-transport-for-9p.patch @@ -1,7 +1,7 @@ -From 933c8ebeef72dec8f943e635201e4f8da262d62b Mon Sep 17 00:00:00 2001 +From d3cff911bf187e1432cbf3f403158bfbc5a1f4e0 Mon Sep 17 00:00:00 2001 From: Alexey Makhalov Date: Fri, 22 Dec 2017 15:13:17 -0800 -Subject: [PATCH] 9p: vsock transport for 9p +Subject: [PATCH 04/12] 9p: vsock transport for 9p This second and correct implementation of 9p support over vsock. Second implementation addresses the issue, described in PR 2007859. @@ -23,7 +23,7 @@ Signed-off-by: Him Kalyan Bordoloi 1 file changed, 68 insertions(+) diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c -index d0eb03ada704..ecc9ae2e7843 100644 +index e758978b44be..260cdcdb313b 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -20,6 +20,8 @@ @@ -32,11 +32,11 @@ index d0eb03ada704..ecc9ae2e7843 100644 #include +#include +#include + #include #include #include - #include -@@ -985,6 +987,59 @@ static int p9_bind_privport(struct socket *sock) - return err; +@@ -961,6 +963,59 @@ static int p9_bind_privport(struct socket *sock) + return err; } +static int @@ -95,8 +95,8 @@ index d0eb03ada704..ecc9ae2e7843 100644 static int p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args) -@@ -1105,6 +1160,18 @@ p9_fd_create(struct p9_client *client, const char *addr, char *args) - return 0; +@@ -1079,6 +1134,18 @@ p9_fd_create(struct p9_client *client, const char *addr, char *args) + return 0; } +static struct p9_trans_module p9_vsock_trans = { @@ -112,15 +112,16 @@ index d0eb03ada704..ecc9ae2e7843 100644 +}; + static struct p9_trans_module p9_tcp_trans = { - .name = "tcp", - .maxsize = MAX_SOCK_BUF, -@@ -1182,6 +1249,7 @@ static void p9_poll_workfn(struct work_struct *work) + .name = "tcp", + .maxsize = MAX_SOCK_BUF, +@@ -1155,6 +1222,7 @@ static void p9_poll_workfn(struct work_struct *work) static int __init p9_trans_fd_init(void) { + v9fs_register_trans(&p9_vsock_trans); - v9fs_register_trans(&p9_tcp_trans); - v9fs_register_trans(&p9_unix_trans); - v9fs_register_trans(&p9_fd_trans); + v9fs_register_trans(&p9_tcp_trans); + v9fs_register_trans(&p9_unix_trans); + v9fs_register_trans(&p9_fd_trans); -- -2.35.6 +2.17.1 + diff --git a/SPECS/linux/6.1/generic/6.0-Discard-.note.gnu.property-sections-in-generic-NOTES.patch b/SPECS/linux/6.1/generic/6.0-Discard-.note.gnu.property-sections-in-generic-NOTES.patch new file mode 100644 index 0000000000..d9e4375340 --- /dev/null +++ b/SPECS/linux/6.1/generic/6.0-Discard-.note.gnu.property-sections-in-generic-NOTES.patch @@ -0,0 +1,83 @@ +From f3bdb6da9af1d55c9a8db95d0427708b5e4fc078 Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Tue, 28 Apr 2020 06:21:05 -0700 +Subject: [PATCH] Discard .note.gnu.property sections in generic NOTES + +With the command-line option, -mx86-used-note=yes, the x86 assembler +in binutils 2.32 and above generates a program property note in a note +section, .note.gnu.property, to encode used x86 ISAs and features. But +kernel linker script only contains a single NOTE segment: + +PHDRS { + text PT_LOAD FLAGS(5); + data PT_LOAD FLAGS(6); + percpu PT_LOAD FLAGS(6); + init PT_LOAD FLAGS(7); + note PT_NOTE FLAGS(0); +} +SECTIONS +{ +... + .notes : AT(ADDR(.notes) - 0xffffffff80000000) { __start_notes = .; KEEP(*(.not +e.*)) __stop_notes = .; } :text :note +... +} + +The NOTE segment generated by kernel linker script is aligned to 4 bytes. +But .note.gnu.property section must be aligned to 8 bytes on x86-64 and +we get + +[hjl@gnu-skx-1 linux]$ readelf -n vmlinux + +Displaying notes found in: .notes + Owner Data size Description + Xen 0x00000006 Unknown note type: (0x00000006) + description data: 6c 69 6e 75 78 00 + Xen 0x00000004 Unknown note type: (0x00000007) + description data: 32 2e 36 00 + xen-3.0 0x00000005 Unknown note type: (0x006e6558) + description data: 08 00 00 00 03 +readelf: Warning: note with invalid namesz and/or descsz found at offset 0x50 +readelf: Warning: type: 0xffffffff, namesize: 0x006e6558, descsize: +0x80000000, alignment: 8 +[hjl@gnu-skx-1 linux]$ + +Since note.gnu.property section in kernel image is never used, this patch +discards .note.gnu.property sections in kernel linker script by adding + +/DISCARD/ : { + *(.note.gnu.property) +} + +before kernel NOTE segment in generic NOTES. + +Signed-off-by: H.J. Lu +Reviewed-by: Kees Cook +--- + include/asm-generic/vmlinux.lds.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h +index 7ad6f51b3..7d4e4c46c 100644 +--- a/include/asm-generic/vmlinux.lds.h ++++ b/include/asm-generic/vmlinux.lds.h +@@ -930,10 +930,16 @@ + #endif + + /* ++ * Discard .note.gnu.property sections which are unused and have ++ * different alignment requirement from kernel note sections. ++ * + * Discard .note.GNU-stack, which is emitted as PROGBITS by the compiler. + * Otherwise, the type of .notes section would become PROGBITS instead of NOTES. + */ + #define NOTES \ ++ /DISCARD/ : { \ ++ *(.note.gnu.property) \ ++ } \ + /DISCARD/ : { *(.note.GNU-stack) } \ + .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \ + __start_notes = .; \ +-- +2.23.1 + diff --git a/SPECS/91/linux/generic/0001-drivers-vfio-pci-Add-kernel-parameter-to-allow-disab.patch b/SPECS/linux/6.1/generic/6.1-0001-drivers-vfio-pci-Add-kernel-parameter-to-allow-disab.patch similarity index 66% rename from SPECS/91/linux/generic/0001-drivers-vfio-pci-Add-kernel-parameter-to-allow-disab.patch rename to SPECS/linux/6.1/generic/6.1-0001-drivers-vfio-pci-Add-kernel-parameter-to-allow-disab.patch index 974bfa46bd..8d05dba53f 100644 --- a/SPECS/91/linux/generic/0001-drivers-vfio-pci-Add-kernel-parameter-to-allow-disab.patch +++ b/SPECS/linux/6.1/generic/6.1-0001-drivers-vfio-pci-Add-kernel-parameter-to-allow-disab.patch @@ -1,6 +1,6 @@ -From e1d23ffcd9edd90a2ebe7481ae3f3b7a6a8a90c9 Mon Sep 17 00:00:00 2001 +From c6dc406c5abdb46f9cbe7a57b912681c70379e82 Mon Sep 17 00:00:00 2001 From: Todd Sabin -Date: Fri, 11 Oct 2024 10:24:36 +0000 +Date: Wed, 23 Jun 2021 04:20:44 +0000 Subject: [PATCH] drivers/vfio/pci: Add kernel parameter to allow disabling of pci resets @@ -14,20 +14,20 @@ depmod: ERROR: Found 2 modules in dependency cycles! Signed-off-by: Sharan Turlapati Signed-off-by: Srivatsa S. Bhat (VMware) - -[Srinidhi Rao ported this patch to v6.11] -Signed-off-by: srinidhira0 +[Ankit: Refreshed for 6.1.183 kernel. Fixed hunk context, no logic +change.] +Signed-off-by: Ankit Jain --- - drivers/vfio/pci/vfio_pci_config.c | 22 ++++++--- - drivers/vfio/pci/vfio_pci_core.c | 71 +++++++++++++++++++++++------- + drivers/vfio/pci/vfio_pci_config.c | 22 ++++++++--- + drivers/vfio/pci/vfio_pci_core.c | 60 ++++++++++++++++++++++++------ include/linux/vfio_pci_core.h | 2 + - 3 files changed, 72 insertions(+), 23 deletions(-) + 3 files changed, 67 insertions(+), 17 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c -index 8ea38e742..1711d64a6 100644 +index 4a350421c5f6..4658c352f3d8 100644 --- a/drivers/vfio/pci/vfio_pci_config.c +++ b/drivers/vfio/pci/vfio_pci_config.c -@@ -899,9 +899,14 @@ static int vfio_exp_config_write(struct vfio_pci_core_device *vdev, int pos, +@@ -894,9 +894,14 @@ static int vfio_exp_config_write(struct vfio_pci_core_device *vdev, int pos, &cap); if (!ret && (cap & PCI_EXP_DEVCAP_FLR)) { @@ -45,7 +45,7 @@ index 8ea38e742..1711d64a6 100644 } } -@@ -981,9 +986,14 @@ static int vfio_af_config_write(struct vfio_pci_core_device *vdev, int pos, +@@ -976,9 +981,14 @@ static int vfio_af_config_write(struct vfio_pci_core_device *vdev, int pos, &cap); if (!ret && (cap & PCI_AF_CAP_FLR) && (cap & PCI_AF_CAP_TP)) { @@ -64,13 +64,13 @@ index 8ea38e742..1711d64a6 100644 } diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c -index e76e33e7d..34e328c51 100644 +index e030c2120183..c4359d6d374e 100644 --- a/drivers/vfio/pci/vfio_pci_core.c +++ b/drivers/vfio/pci/vfio_pci_core.c -@@ -41,6 +41,14 @@ - static bool nointxmask; +@@ -37,6 +37,15 @@ static bool nointxmask; static bool disable_vga; static bool disable_idle_d3; + +static bool disable_resets; +module_param(disable_resets, bool, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(disable_resets, "Disable the issuing of PCI resets"); @@ -79,10 +79,11 @@ index e76e33e7d..34e328c51 100644 +{ + return disable_resets; +} - - static void vfio_pci_eventfd_rcu_free(struct rcu_head *rcu) - { -@@ -520,10 +528,15 @@ int vfio_pci_core_enable(struct vfio_pci_core_device *vdev) ++ + /* List of PF's that vfio_pci_core_sriov_configure() has been called on */ + static DEFINE_MUTEX(vfio_pci_sriov_pfs_mutex); + static LIST_HEAD(vfio_pci_sriov_pfs); +@@ -481,10 +490,15 @@ int vfio_pci_core_enable(struct vfio_pci_core_device *vdev) if (ret) goto out_power; @@ -102,39 +103,26 @@ index e76e33e7d..34e328c51 100644 vdev->reset_works = !ret; pci_save_state(pdev); -@@ -700,17 +713,21 @@ void vfio_pci_core_disable(struct vfio_pci_core_device *vdev) +@@ -657,10 +671,14 @@ void vfio_pci_core_disable(struct vfio_pci_core_device *vdev) * We can not use the "try" reset interface here, which will * overwrite the previously restored configuration information. */ -- if (vdev->reset_works) { -- bridge = pci_upstream_bridge(pdev); -- if (bridge && !pci_dev_trylock(bridge)) -- goto out_restore_state; -- if (pci_dev_trylock(pdev)) { -- if (!__pci_reset_function_locked(pdev)) -- vdev->needs_reset = false; -- pci_dev_unlock(pdev); +- if (vdev->reset_works && pci_dev_trylock(pdev)) { +- if (!__pci_reset_function_locked(pdev)) +- vdev->needs_reset = false; +- pci_dev_unlock(pdev); + if (vfio_pci_resets_disabled()) { + pci_info(pdev, "refusing reset on disable\n"); + } else { -+ if (vdev->reset_works) { -+ bridge = pci_upstream_bridge(pdev); -+ if (bridge && !pci_dev_trylock(bridge)) -+ goto out_restore_state; -+ if (pci_dev_trylock(pdev)) { -+ if (!__pci_reset_function_locked(pdev)) -+ vdev->needs_reset = false; -+ pci_dev_unlock(pdev); -+ } -+ if (bridge) -+ pci_dev_unlock(bridge); - } -- if (bridge) -- pci_dev_unlock(bridge); ++ if (vdev->reset_works && pci_dev_trylock(pdev)) { ++ if (!__pci_reset_function_locked(pdev)) ++ vdev->needs_reset = false; ++ pci_dev_unlock(pdev); ++ } } - out_restore_state: -@@ -1259,6 +1276,12 @@ static int vfio_pci_ioctl_reset(struct vfio_pci_core_device *vdev, + pci_restore_state(pdev); +@@ -1153,6 +1171,12 @@ static int vfio_pci_ioctl_reset(struct vfio_pci_core_device *vdev, if (!vdev->reset_works) return -EINVAL; @@ -147,8 +135,8 @@ index e76e33e7d..34e328c51 100644 vfio_pci_zap_and_down_write_memory_lock(vdev); /* -@@ -1450,6 +1473,12 @@ static int vfio_pci_ioctl_pci_hot_reset(struct vfio_pci_core_device *vdev, - if (!!hdr.count == vfio_device_cdev_opened(&vdev->vdev)) +@@ -1264,6 +1288,12 @@ static int vfio_pci_ioctl_pci_hot_reset(struct vfio_pci_core_device *vdev, + if (hdr.argsz < minsz || hdr.flags) return -EINVAL; + if (vfio_pci_resets_disabled()) { @@ -160,9 +148,9 @@ index e76e33e7d..34e328c51 100644 /* Can we do a slot or bus reset or neither? */ if (!pci_probe_reset_slot(vdev->pdev->slot)) slot = true; -@@ -2530,7 +2559,11 @@ static int vfio_pci_dev_set_hot_reset(struct vfio_device_set *dev_set, - list_for_each_entry(vdev, &dev_set->device_list, vdev.dev_set_list) - vfio_pci_set_power_state(vdev, PCI_D0); +@@ -2462,7 +2492,11 @@ static int vfio_pci_dev_set_hot_reset(struct vfio_device_set *dev_set, + list_for_each_entry(cur, &dev_set->device_list, vdev.dev_set_list) + vfio_pci_set_power_state(cur, PCI_D0); - ret = pci_reset_bus(pdev); + if (vfio_pci_resets_disabled()) { @@ -171,12 +159,12 @@ index e76e33e7d..34e328c51 100644 + ret = pci_reset_bus(pdev); + } - vdev = list_last_entry(&dev_set->device_list, - struct vfio_pci_core_device, vdev.dev_set_list); -@@ -2590,8 +2623,12 @@ static void vfio_pci_dev_set_try_reset(struct vfio_device_set *dev_set) + err_undo: + list_for_each_entry(cur, &dev_set->device_list, vdev.dev_set_list) { +@@ -2525,8 +2559,12 @@ static void vfio_pci_dev_set_try_reset(struct vfio_device_set *dev_set) if (vfio_pci_dev_set_pm_runtime_get(dev_set)) return; - + - if (!pci_reset_bus(pdev)) - reset_done = true; + if (vfio_pci_resets_disabled()) { @@ -189,16 +177,16 @@ index e76e33e7d..34e328c51 100644 list_for_each_entry(cur, &dev_set->device_list, vdev.dev_set_list) { if (reset_done) diff --git a/include/linux/vfio_pci_core.h b/include/linux/vfio_pci_core.h -index f13fbac17..b4c2179c1 100644 +index 367fd79226a3..74cbf41255f2 100644 --- a/include/linux/vfio_pci_core.h +++ b/include/linux/vfio_pci_core.h -@@ -178,4 +178,6 @@ VFIO_IOREAD_DECLARATION(32) - VFIO_IOREAD_DECLARATION(64) - #endif +@@ -130,4 +130,6 @@ void vfio_pci_core_finish_enable(struct vfio_pci_core_device *vdev); + pci_ers_result_t vfio_pci_core_aer_err_detected(struct pci_dev *pdev, + pci_channel_state_t state); +extern bool vfio_pci_resets_disabled(void); + #endif /* VFIO_PCI_CORE_H */ -- -2.53.0 +2.25.1 diff --git a/SPECS/linux/6.1/generic/6.1-0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS.patch b/SPECS/linux/6.1/generic/6.1-0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS.patch new file mode 100644 index 0000000000..3861d8776d --- /dev/null +++ b/SPECS/linux/6.1/generic/6.1-0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS.patch @@ -0,0 +1,112 @@ +From 4f4d9349568ea1b8d5c0f0a5737a505bd511e3e7 Mon Sep 17 00:00:00 2001 +From: Serge Hallyn +Date: Fri, 31 May 2013 19:12:12 +0100 +Subject: [PATCH] fork: add sysctl to disallow unprivileged CLONE_NEWUSER by + default + +add sysctl to disallow unprivileged CLONE_NEWUSER by default + +This is a short-term patch. Unprivileged use of CLONE_NEWUSER +is certainly an intended feature of user namespaces. However +for at least saucy we want to make sure that, if any security +issues are found, we have a fail-safe. + +Signed-off-by: Serge Hallyn +[bwh: Remove unneeded binary sysctl bits] +[Srivatsa: Fix capability checks when running nested user namespaces by +using ns_capable() on the current task's user namespace.] +Signed-off-by: Srivatsa S. Bhat (VMware) +Signed-off-by: Vamsi Krishna Brahmajosyula +--- + kernel/fork.c | 15 +++++++++++++++ + kernel/sysctl.c | 12 ++++++++++++ + kernel/user_namespace.c | 3 +++ + 3 files changed, 30 insertions(+) + +diff --git a/kernel/fork.c b/kernel/fork.c +index 9f7fe3541897..74a04980f87c 100644 +--- a/kernel/fork.c ++++ b/kernel/fork.c +@@ -108,6 +108,11 @@ + + #define CREATE_TRACE_POINTS + #include ++#ifdef CONFIG_USER_NS ++extern int unprivileged_userns_clone; ++#else ++#define unprivileged_userns_clone 0 ++#endif + + /* + * Minimum number of threads to boot the kernel +@@ -2030,6 +2035,10 @@ static __latent_entropy struct task_struct *copy_process( + if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS)) + return ERR_PTR(-EINVAL); + ++ if ((clone_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) ++ if (!ns_capable(current_user_ns(), CAP_SYS_ADMIN)) ++ return ERR_PTR(-EPERM); ++ + /* + * Thread groups must share signals as well, and detached threads + * can only be started up within the thread group. +@@ -3180,6 +3189,12 @@ int ksys_unshare(unsigned long unshare_flags) + if (unshare_flags & CLONE_NEWNS) + unshare_flags |= CLONE_FS; + ++ if ((unshare_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) { ++ err = -EPERM; ++ if (!ns_capable(current_user_ns(), CAP_SYS_ADMIN)) ++ goto bad_unshare_out; ++ } ++ + err = check_unshare_flags(unshare_flags); + if (err) + goto bad_unshare_out; +diff --git a/kernel/sysctl.c b/kernel/sysctl.c +index 137d4abe3eda..fd83a0ebdc4e 100644 +--- a/kernel/sysctl.c ++++ b/kernel/sysctl.c +@@ -91,6 +91,9 @@ EXPORT_SYMBOL_GPL(sysctl_long_vals); + + #if defined(CONFIG_SYSCTL) + ++#ifdef CONFIG_USER_NS ++extern int unprivileged_userns_clone; ++#endif + /* Constants used for minimum and maximum */ + + #ifdef CONFIG_PERF_EVENTS +@@ -1783,6 +1786,15 @@ static struct ctl_table kern_table[] = { + .proc_handler = sysrq_sysctl_handler, + }, + #endif ++#ifdef CONFIG_USER_NS ++ { ++ .procname = "unprivileged_userns_clone", ++ .data = &unprivileged_userns_clone, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, ++#endif + #ifdef CONFIG_PROC_SYSCTL + { + .procname = "cad_pid", +diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c +index 54211dbd516c..47c420be8da3 100644 +--- a/kernel/user_namespace.c ++++ b/kernel/user_namespace.c +@@ -22,6 +22,9 @@ + #include + #include + ++/* sysctl */ ++int unprivileged_userns_clone; ++ + static struct kmem_cache *user_ns_cachep __read_mostly; + static DEFINE_MUTEX(userns_state_mutex); + +-- +2.39.1 + diff --git a/SPECS/90/linux/generic/9p-file-attributes-caching-support.patch b/SPECS/linux/6.1/generic/9p-file-attributes-caching-support.patch similarity index 100% rename from SPECS/90/linux/generic/9p-file-attributes-caching-support.patch rename to SPECS/linux/6.1/generic/9p-file-attributes-caching-support.patch diff --git a/SPECS/90/linux/generic/9p-support-for-local-file-lock.patch b/SPECS/linux/6.1/generic/9p-support-for-local-file-lock-6.1.patch similarity index 100% rename from SPECS/90/linux/generic/9p-support-for-local-file-lock.patch rename to SPECS/linux/6.1/generic/9p-support-for-local-file-lock-6.1.patch diff --git a/SPECS/linux/6.1/glibc-2.43-build-error-fix-patches/0001-libbpf-Fix-Wdiscarded-qualifiers-under-C23.patch b/SPECS/linux/6.1/glibc-2.43-build-error-fix-patches/0001-libbpf-Fix-Wdiscarded-qualifiers-under-C23.patch new file mode 100644 index 0000000000..8cbf2e2ceb --- /dev/null +++ b/SPECS/linux/6.1/glibc-2.43-build-error-fix-patches/0001-libbpf-Fix-Wdiscarded-qualifiers-under-C23.patch @@ -0,0 +1,41 @@ +From a05909624e01fc948659207172c3e0634aefc68f Mon Sep 17 00:00:00 2001 +From: Mikhail Gavrilov +Date: Sat, 6 Dec 2025 14:28:25 +0500 +Subject: [PATCH 01/18] libbpf: Fix -Wdiscarded-qualifiers under C23 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +glibc ≥ 2.42 (GCC 15) defaults to -std=gnu23, which promotes +-Wdiscarded-qualifiers to an error. + +In C23, strstr() and strchr() return "const char *". + +Change variable types to const char * where the pointers are never +modified (res, sym_sfx, next_path). + +Suggested-by: Florian Weimer +Suggested-by: Andrii Nakryiko +Signed-off-by: Mikhail Gavrilov +Link: https://lore.kernel.org/r/20251206092825.1471385-1-mikhail.v.gavrilov@gmail.com +Signed-off-by: Alexei Starovoitov +--- + tools/lib/bpf/libbpf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c +index 7bd6aff6e260..33b214a91338 100644 +--- a/tools/lib/bpf/libbpf.c ++++ b/tools/lib/bpf/libbpf.c +@@ -10748,7 +10748,7 @@ static int resolve_full_path(const char *file, char *result, size_t result_sz) + if (!search_paths[i]) + continue; + for (s = search_paths[i]; s != NULL; s = strchr(s, ':')) { +- char *next_path; ++ const char *next_path; + int seg_len; + + if (s[0] == ':') +-- +2.54.0 + diff --git a/SPECS/90/linux/hcx-patches/0001-Active-probing-of-dst-mac-of-unknown-unicast.patch b/SPECS/linux/6.1/hcx-patches/0001-Active-probing-of-dst-mac-of-unknown-unicast-6.1.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0001-Active-probing-of-dst-mac-of-unknown-unicast.patch rename to SPECS/linux/6.1/hcx-patches/0001-Active-probing-of-dst-mac-of-unknown-unicast-6.1.patch diff --git a/SPECS/90/linux/hcx-patches/0001-rcutree-Adding-rcu_max_blimit-rcutree-param.patch b/SPECS/linux/6.1/hcx-patches/0001-rcutree-Adding-rcu_max_blimit-rcutree-param.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0001-rcutree-Adding-rcu_max_blimit-rcutree-param.patch rename to SPECS/linux/6.1/hcx-patches/0001-rcutree-Adding-rcu_max_blimit-rcutree-param.patch diff --git a/SPECS/90/linux/hcx-patches/0002-Skip-IP_ECN_decapsulate-for-gretap-devices.patch b/SPECS/linux/6.1/hcx-patches/0002-Skip-IP_ECN_decapsulate-for-gretap-devices-6.1.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0002-Skip-IP_ECN_decapsulate-for-gretap-devices.patch rename to SPECS/linux/6.1/hcx-patches/0002-Skip-IP_ECN_decapsulate-for-gretap-devices-6.1.patch diff --git a/SPECS/90/linux/hcx-patches/0003-Handle-ipsec-in-ipip-more-correctly.patch b/SPECS/linux/6.1/hcx-patches/0003-Handle-ipsec-in-ipip-more-correctly-6.1.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0003-Handle-ipsec-in-ipip-more-correctly.patch rename to SPECS/linux/6.1/hcx-patches/0003-Handle-ipsec-in-ipip-more-correctly-6.1.patch diff --git a/SPECS/90/linux/hcx-patches/0004-De-cap-fou-traffic-into-correct-tunnel-device-s.patch b/SPECS/linux/6.1/hcx-patches/0004-De-cap-fou-traffic-into-correct-tunnel-device-s-6.1.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0004-De-cap-fou-traffic-into-correct-tunnel-device-s.patch rename to SPECS/linux/6.1/hcx-patches/0004-De-cap-fou-traffic-into-correct-tunnel-device-s-6.1.patch diff --git a/SPECS/90/linux/hcx-patches/0005-Add-unknown-fou-tracking-to-kernel.patch b/SPECS/linux/6.1/hcx-patches/0005-Add-unknown-fou-tracking-to-kernel-6.1.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0005-Add-unknown-fou-tracking-to-kernel.patch rename to SPECS/linux/6.1/hcx-patches/0005-Add-unknown-fou-tracking-to-kernel-6.1.patch diff --git a/SPECS/90/linux/hcx-patches/0006-Add-initial-support-for-vxlan-trunk-to-cgw-kernel-wi.patch b/SPECS/linux/6.1/hcx-patches/0006-Add-initial-support-for-vxlan-trunk-to-cgw-kernel-wi.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0006-Add-initial-support-for-vxlan-trunk-to-cgw-kernel-wi.patch rename to SPECS/linux/6.1/hcx-patches/0006-Add-initial-support-for-vxlan-trunk-to-cgw-kernel-wi.patch diff --git a/SPECS/90/linux/hcx-patches/0007-Changes-for-bridge-vlan-arp-filtering-to-work-right.patch b/SPECS/linux/6.1/hcx-patches/0007-Changes-for-bridge-vlan-arp-filtering-to-work-right.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0007-Changes-for-bridge-vlan-arp-filtering-to-work-right.patch rename to SPECS/linux/6.1/hcx-patches/0007-Changes-for-bridge-vlan-arp-filtering-to-work-right.patch diff --git a/SPECS/90/linux/hcx-patches/0008-Add-support-for-mac-flapping-and-long-mac-flapping-p.patch b/SPECS/linux/6.1/hcx-patches/0008-Add-support-for-mac-flapping-and-long-mac-flapping-p.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0008-Add-support-for-mac-flapping-and-long-mac-flapping-p.patch rename to SPECS/linux/6.1/hcx-patches/0008-Add-support-for-mac-flapping-and-long-mac-flapping-p.patch diff --git a/SPECS/90/linux/hcx-patches/0009-vmxnet3-Avoid-fragmentation-by-giving-each-vmxnet3-d.patch b/SPECS/linux/6.1/hcx-patches/0009-vmxnet3-Avoid-fragmentation-by-giving-each-vmxnet3-d.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0009-vmxnet3-Avoid-fragmentation-by-giving-each-vmxnet3-d.patch rename to SPECS/linux/6.1/hcx-patches/0009-vmxnet3-Avoid-fragmentation-by-giving-each-vmxnet3-d.patch diff --git a/SPECS/90/linux/hcx-patches/0010-RPS-flow-balance.patch b/SPECS/linux/6.1/hcx-patches/0010-RPS-flow-balance.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0010-RPS-flow-balance.patch rename to SPECS/linux/6.1/hcx-patches/0010-RPS-flow-balance.patch diff --git a/SPECS/90/linux/hcx-patches/0011-add-mss-clamp-support-to-gretap-baseimage.patch b/SPECS/linux/6.1/hcx-patches/0011-add-mss-clamp-support-to-gretap-baseimage.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0011-add-mss-clamp-support-to-gretap-baseimage.patch rename to SPECS/linux/6.1/hcx-patches/0011-add-mss-clamp-support-to-gretap-baseimage.patch diff --git a/SPECS/90/linux/hcx-patches/0012-set-max_mtu-as-IP_MAX_MTU.patch b/SPECS/linux/6.1/hcx-patches/0012-set-max_mtu-as-IP_MAX_MTU.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0012-set-max_mtu-as-IP_MAX_MTU.patch rename to SPECS/linux/6.1/hcx-patches/0012-set-max_mtu-as-IP_MAX_MTU.patch diff --git a/SPECS/90/linux/hcx-patches/0013-set-max_mtu-as-IP_MAX_MTU_for_vlan.patch b/SPECS/linux/6.1/hcx-patches/0013-set-max_mtu-as-IP_MAX_MTU_for_vlan.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0013-set-max_mtu-as-IP_MAX_MTU_for_vlan.patch rename to SPECS/linux/6.1/hcx-patches/0013-set-max_mtu-as-IP_MAX_MTU_for_vlan.patch diff --git a/SPECS/90/linux/hcx-patches/0014-iptunnel-mark-xfrm-multi-parts.patch b/SPECS/linux/6.1/hcx-patches/0014-iptunnel-mark-xfrm-multi-parts.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0014-iptunnel-mark-xfrm-multi-parts.patch rename to SPECS/linux/6.1/hcx-patches/0014-iptunnel-mark-xfrm-multi-parts.patch diff --git a/SPECS/90/linux/hcx-patches/0015-disable-pskb_inet_may_pull-in-tunnel.patch b/SPECS/linux/6.1/hcx-patches/0015-disable-pskb_inet_may_pull-in-tunnel.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0015-disable-pskb_inet_may_pull-in-tunnel.patch rename to SPECS/linux/6.1/hcx-patches/0015-disable-pskb_inet_may_pull-in-tunnel.patch diff --git a/SPECS/90/linux/hcx-patches/0016-gre_tap-interface-mss_clamp-support.patch b/SPECS/linux/6.1/hcx-patches/0016-gre_tap-interface-mss_clamp-support.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0016-gre_tap-interface-mss_clamp-support.patch rename to SPECS/linux/6.1/hcx-patches/0016-gre_tap-interface-mss_clamp-support.patch diff --git a/SPECS/90/linux/hcx-patches/0017-rps_cpus-skip-receive-packets-queuing-to-only-housek.patch b/SPECS/linux/6.1/hcx-patches/0017-rps_cpus-skip-receive-packets-queuing-to-only-housek.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0017-rps_cpus-skip-receive-packets-queuing-to-only-housek.patch rename to SPECS/linux/6.1/hcx-patches/0017-rps_cpus-skip-receive-packets-queuing-to-only-housek.patch diff --git a/SPECS/90/linux/hcx-patches/0018-Introduce-xfrm_dst-cache-mechanism-to-reuse-xfrm_dst.patch b/SPECS/linux/6.1/hcx-patches/0018-Introduce-xfrm_dst-cache-mechanism-to-reuse-xfrm_dst.patch similarity index 100% rename from SPECS/90/linux/hcx-patches/0018-Introduce-xfrm_dst-cache-mechanism-to-reuse-xfrm_dst.patch rename to SPECS/linux/6.1/hcx-patches/0018-Introduce-xfrm_dst-cache-mechanism-to-reuse-xfrm_dst.patch diff --git a/SPECS/91/linux/jitterentropy_builder/0001-change-jitterentropy_rng-driver-name.patch b/SPECS/linux/6.1/jitterentropy_builder/0001-change-jitterentropy_rng-driver-name-6.1.patch similarity index 76% rename from SPECS/91/linux/jitterentropy_builder/0001-change-jitterentropy_rng-driver-name.patch rename to SPECS/linux/6.1/jitterentropy_builder/0001-change-jitterentropy_rng-driver-name-6.1.patch index 92ef206988..6548b3aea4 100644 --- a/SPECS/91/linux/jitterentropy_builder/0001-change-jitterentropy_rng-driver-name.patch +++ b/SPECS/linux/6.1/jitterentropy_builder/0001-change-jitterentropy_rng-driver-name-6.1.patch @@ -1,6 +1,6 @@ -From d5a1bb23ba98c6094aae15b317b00a46a6a114fc Mon Sep 17 00:00:00 2001 +From d8069dca94d832678b5c6f47ed9a114960894a1b Mon Sep 17 00:00:00 2001 From: Brennan Lamoreaux -Date: Fri, 17 Oct 2025 18:34:33 +0000 +Date: Fri, 18 Oct 2024 18:43:56 +0000 Subject: [PATCH] change jitterentropy_rng driver name In order for the jitterentropy_rng_proxy to take over the "jitterentropy_rng" @@ -8,16 +8,15 @@ name, change the driver name to be "jitterentropy_rng-generic". The proxy driver name will be "jitterentropy_rng-proxy". -Signed-off-by: Brennan Lamoreaux --- crypto/jitterentropy-kcapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/jitterentropy-kcapi.c b/crypto/jitterentropy-kcapi.c -index dceadb77e..21b37c228 100644 +index 8b98d2e29..7bfa140b8 100644 --- a/crypto/jitterentropy-kcapi.c +++ b/crypto/jitterentropy-kcapi.c -@@ -320,7 +320,7 @@ static struct rng_alg jent_alg = { +@@ -153,7 +153,7 @@ static struct rng_alg jent_alg = { .seedsize = 0, .base = { .cra_name = "jitterentropy_rng", @@ -26,6 +25,6 @@ index dceadb77e..21b37c228 100644 .cra_priority = 100, .cra_ctxsize = sizeof(struct jitterentropy), .cra_module = THIS_MODULE, --- -2.43.7 +-- +2.39.4 diff --git a/SPECS/linux/6.1/jitterentropy_builder/0001-changes-to-build-with-jitterentropy-v3.4.1.patch b/SPECS/linux/6.1/jitterentropy_builder/0001-changes-to-build-with-jitterentropy-v3.4.1.patch new file mode 100644 index 0000000000..7f72e6e0ba --- /dev/null +++ b/SPECS/linux/6.1/jitterentropy_builder/0001-changes-to-build-with-jitterentropy-v3.4.1.patch @@ -0,0 +1,135 @@ +From 4217ea9f4c392beed90737da46ca90ba059e2328 Mon Sep 17 00:00:00 2001 +From: Keerthana K +Date: Fri, 8 Sep 2023 06:09:50 +0000 +Subject: [PATCH] changes to build with jitterentropy v3.4.1 + +Signed-off-by: Keerthana K +--- + crypto/Makefile | 6 +++-- + crypto/jitterentropy-kcapi.c | 44 ++++++++++-------------------------- + 2 files changed, 16 insertions(+), 34 deletions(-) + +diff --git a/crypto/Makefile b/crypto/Makefile +index 2b425a563..e894f796c 100644 +--- a/crypto/Makefile ++++ b/crypto/Makefile +@@ -6,6 +6,10 @@ + obj-$(CONFIG_CRYPTO) += crypto.o + crypto-y := api.o cipher.o compress.o + ++obj-$(CONFIG_CRYPTO_JITTERENTROPY) += jitterentropy_rng.o jitterentropy-3.4.1/ jitterentropy-3.4.1/jitterentropy_canister_wrapper.o jitterentropy-3.4.1/jitterentropy_canister_wrapper_asm.o ++ ++jitterentropy_rng-y := jitterentropy-kcapi.o ++ + obj-$(CONFIG_CRYPTO_ENGINE) += crypto_engine.o + obj-$(CONFIG_CRYPTO_FIPS) += fips.o + +@@ -149,11 +153,9 @@ obj-$(CONFIG_CRYPTO_842) += 842.o + obj-$(CONFIG_CRYPTO_RNG2) += rng.o + obj-$(CONFIG_CRYPTO_ANSI_CPRNG) += ansi_cprng.o + obj-$(CONFIG_CRYPTO_DRBG) += drbg.o +-obj-$(CONFIG_CRYPTO_JITTERENTROPY) += jitterentropy_rng.o + CFLAGS_jitterentropy.o = -O0 + KASAN_SANITIZE_jitterentropy.o = n + UBSAN_SANITIZE_jitterentropy.o = n +-jitterentropy_rng-y := jitterentropy.o jitterentropy-kcapi.o + obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o + obj-$(CONFIG_CRYPTO_GHASH) += ghash-generic.o + obj-$(CONFIG_CRYPTO_POLYVAL) += polyval-generic.o +diff --git a/crypto/jitterentropy-kcapi.c b/crypto/jitterentropy-kcapi.c +index b892685e1..8b98d2e29 100644 +--- a/crypto/jitterentropy-kcapi.c ++++ b/crypto/jitterentropy-kcapi.c +@@ -2,7 +2,7 @@ + * Non-physical true random number generator based on timing jitter -- + * Linux Kernel Crypto API specific code + * +- * Copyright Stephan Mueller , 2015 ++ * Copyright Stephan Mueller , 2023 + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +@@ -44,7 +44,8 @@ + #include + #include + +-#include "jitterentropy.h" ++#include "jitterentropy-3.4.1/jitterentropy.h" ++#include "jitterentropy-3.4.1/jitterentropy-timer.h" + + /*************************************************************************** + * Helper function +@@ -55,8 +56,9 @@ void *jent_zalloc(unsigned int len) + return kzalloc(len, GFP_KERNEL); + } + +-void jent_zfree(void *ptr) ++void jent_zfree(void *ptr, unsigned int len) + { ++ memzero_explicit(ptr, len); + kfree_sensitive(ptr); + } + +@@ -65,31 +67,6 @@ void jent_memcpy(void *dest, const void *src, unsigned int n) + memcpy(dest, src, n); + } + +-/* +- * Obtain a high-resolution time stamp value. The time stamp is used to measure +- * the execution time of a given code path and its variations. Hence, the time +- * stamp must have a sufficiently high resolution. +- * +- * Note, if the function returns zero because a given architecture does not +- * implement a high-resolution time stamp, the RNG code's runtime test +- * will detect it and will not produce output. +- */ +-void jent_get_nstime(__u64 *out) +-{ +- __u64 tmp = 0; +- +- tmp = random_get_entropy(); +- +- /* +- * If random_get_entropy does not return a value, i.e. it is not +- * implemented for a given architecture, use a clock source. +- * hoping that there are timers we can work with. +- */ +- if (tmp == 0) +- tmp = ktime_get_ns(); +- +- *out = tmp; +-} + + /*************************************************************************** + * Kernel crypto API interface +@@ -152,14 +129,16 @@ static int jent_kcapi_random(struct crypto_rng *tfm, + /* Handle intermittent health test error */ + pr_warn_ratelimited("Reset Jitter RNG due to intermittent health test failure\n"); + ret = -EAGAIN; +- } else if (ret == -1) { +- /* Handle other errors */ +- ret = -EINVAL; ++ } else { ++ if (ret < 0) { ++ /* Handle other errors */ ++ ret = -EINVAL; ++ } + } + + spin_unlock(&rng->jent_lock); + +- return ret; ++ return ret > 0 ? 0 : ret; + } + + static int jent_kcapi_reset(struct crypto_rng *tfm, +@@ -211,5 +190,6 @@ module_exit(jent_mod_exit); + + MODULE_LICENSE("Dual BSD/GPL"); + MODULE_AUTHOR("Stephan Mueller "); ++MODULE_AUTHOR("Srinidhi Rao "); + MODULE_DESCRIPTION("Non-physical True Random Number Generator based on CPU Jitter"); + MODULE_ALIAS_CRYPTO("jitterentropy_rng"); +-- +2.23.3 + diff --git a/SPECS/linux/6.1/jitterentropy_builder/0001-compile-jitterentropy-rng-proxy-6.1.patch b/SPECS/linux/6.1/jitterentropy_builder/0001-compile-jitterentropy-rng-proxy-6.1.patch new file mode 100644 index 0000000000..4309152b98 --- /dev/null +++ b/SPECS/linux/6.1/jitterentropy_builder/0001-compile-jitterentropy-rng-proxy-6.1.patch @@ -0,0 +1,28 @@ +From 3fd03ac6e87a89bd308d8d871cca66552a6de5c4 Mon Sep 17 00:00:00 2001 +From: Brennan Lamoreaux +Date: Fri, 11 Oct 2024 21:41:07 +0000 +Subject: [PATCH] compile jitterentropy rng proxy + +--- + crypto/Makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/crypto/Makefile b/crypto/Makefile +index 4a9c18509..3112e926d 100644 +--- a/crypto/Makefile ++++ b/crypto/Makefile +@@ -6,9 +6,10 @@ + obj-$(CONFIG_CRYPTO) += crypto.o + crypto-y := api.o cipher.o compress.o + +-obj-$(CONFIG_CRYPTO_JITTERENTROPY) += jitterentropy_rng.o jitterentropy-3.4.1/ jitterentropy-3.4.1/jitterentropy_canister_wrapper.o jitterentropy-3.4.1/jitterentropy_canister_wrapper_asm.o ++obj-$(CONFIG_CRYPTO_JITTERENTROPY) += jitterentropy_rng.o jitterentropy_rng_proxy.o jitterentropy-3.4.1/ jitterentropy-3.4.1/jitterentropy_canister_wrapper.o jitterentropy-3.4.1/jitterentropy_canister_wrapper_asm.o + + jitterentropy_rng-y := jitterentropy-kcapi.o ++jitterentropy_rng_proxy-y := jitterentropy_rng_proxy.o + + obj-$(CONFIG_CRYPTO_ENGINE) += crypto_engine.o + obj-$(CONFIG_CRYPTO_FIPS) += fips.o +-- +2.39.4 + diff --git a/SPECS/90/linux/jitterentropy_builder/0001-jitterentropy-kcapi-defer-jent_init.patch b/SPECS/linux/6.1/jitterentropy_builder/0001-jitterentropy-kcapi-defer-jent_init.patch similarity index 100% rename from SPECS/90/linux/jitterentropy_builder/0001-jitterentropy-kcapi-defer-jent_init.patch rename to SPECS/linux/6.1/jitterentropy_builder/0001-jitterentropy-kcapi-defer-jent_init.patch diff --git a/SPECS/linux/6.1/jitterentropy_builder/jitterentropy_canister_wrapper-6.1.c b/SPECS/linux/6.1/jitterentropy_builder/jitterentropy_canister_wrapper-6.1.c new file mode 100644 index 0000000000..07691863cf --- /dev/null +++ b/SPECS/linux/6.1/jitterentropy_builder/jitterentropy_canister_wrapper-6.1.c @@ -0,0 +1,97 @@ +/* + * Kernel APIs wrapper for jitterentropy v3.4.1. + * + * Copyright (C) 2023 VMware, Inc. + * Author: Keerthana K + * + */ + +#include +#include +#include +#include +#include +#include +#include "jitterentropy.h" + +void *jcw_mutex_init(void) +{ + struct mutex *m = kzalloc(sizeof(struct mutex), GFP_KERNEL); + if (m) + mutex_init(m); + + return (void *)m; +} + +void jcw_mutex_lock(void *m) +{ + mutex_lock((struct mutex *)m); +} + +void jcw_mutex_unlock(void *m) +{ + mutex_unlock((struct mutex *)m); +} + +void *jcw_kzalloc(size_t size) +{ + return vzalloc(size); +} + +void *jcw_memcpy(void *dst, const void *src, size_t len) +{ + return memcpy(dst, src, len); +} + +void jcw_memzero_explicit(void *s, size_t count) +{ + return memzero_explicit(s, count); +} + +unsigned int jcw_cache_size_roundup(void) +{ + unsigned int i = 0, size = 0; + struct cpu_cacheinfo *info_ci = get_cpu_cacheinfo(0); + struct cacheinfo *info = NULL; + + for (i = 0; i< info_ci->num_leaves; i++) { + info = info_ci->info_list + i; + size += info->size; + } + + /* Force the output_size to be of the form (bounding_pwr_of_2 - 1)*/ + size |= (size >> 1); + size |= (size >> 2); + size |= (size >> 4); + size |= (size >> 8); + size |= (size >> 16); + + if (size == 0) + return 0; + + /* Make the output_size the smallest power of 2 strictly greater than + cache_size. */ + size++; + return size; +} + +int jcw_fips_enabled(void) +{ + return fips_enabled; +} + +void jcw_zfree(void *ptr, unsigned int len) +{ + memzero_explicit(ptr, len); + vfree(ptr); +} + +u64 jcw_ktime_get_ns(void) +{ + return ktime_get_ns(); +} + +unsigned long jcw_random_get_entropy(void) +{ + return random_get_entropy(); +} diff --git a/SPECS/linux/6.1/jitterentropy_builder/jitterentropy_canister_wrapper-6.1.h b/SPECS/linux/6.1/jitterentropy_builder/jitterentropy_canister_wrapper-6.1.h new file mode 100644 index 0000000000..5b2c9fd41b --- /dev/null +++ b/SPECS/linux/6.1/jitterentropy_builder/jitterentropy_canister_wrapper-6.1.h @@ -0,0 +1,25 @@ +/* + * Kernel APIs wrapper for jitterentropy v3.4.1. + * + * Copyright (C) 2023 VMware, Inc. + * Author: Keerthana K + * + */ + +#ifndef JITTERENTROPY_CANISTER_WRAPPER_H +#define JITTERENTROPY_CANISTER_WRAPPER_H + +extern void *jcw_mutex_init(void); +extern void jcw_mutex_lock(void *m); +extern void jcw_mutex_unlock(void *m); +extern unsigned int jcw_cache_size_roundup(void); +extern void *jcw_memcpy(void *dst, const void *src, size_t len); +extern void jcw_memzero_explicit(void *s, size_t count); +extern int jcw_printk(const char *fmt, ...); +extern void *jcw_kzalloc(size_t size); +extern void jcw_zfree(void *ptr, unsigned int len); +extern int jcw_fips_enabled(void); +extern u64 jcw_ktime_get_ns(void); +extern unsigned long jcw_random_get_entropy(void); + +#endif diff --git a/SPECS/91/linux/jitterentropy_builder/jitterentropy_canister_wrapper_asm.S b/SPECS/linux/6.1/jitterentropy_builder/jitterentropy_canister_wrapper_asm-6.1.S similarity index 93% rename from SPECS/91/linux/jitterentropy_builder/jitterentropy_canister_wrapper_asm.S rename to SPECS/linux/6.1/jitterentropy_builder/jitterentropy_canister_wrapper_asm-6.1.S index e735ee803f..a3a01e2151 100644 --- a/SPECS/91/linux/jitterentropy_builder/jitterentropy_canister_wrapper_asm.S +++ b/SPECS/linux/6.1/jitterentropy_builder/jitterentropy_canister_wrapper_asm-6.1.S @@ -8,7 +8,7 @@ #include #include -#include +#include SYM_FUNC_START(jcw_printk) #if LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0) diff --git a/SPECS/91/linux/jitterentropy_builder/jitterentropy_rng_proxy.c b/SPECS/linux/6.1/jitterentropy_builder/jitterentropy_rng_proxy-6.1.c similarity index 99% rename from SPECS/91/linux/jitterentropy_builder/jitterentropy_rng_proxy.c rename to SPECS/linux/6.1/jitterentropy_builder/jitterentropy_rng_proxy-6.1.c index fc751b64bc..ca1e16f053 100644 --- a/SPECS/91/linux/jitterentropy_builder/jitterentropy_rng_proxy.c +++ b/SPECS/linux/6.1/jitterentropy_builder/jitterentropy_rng_proxy-6.1.c @@ -51,9 +51,9 @@ static struct mutex list_lock; * When there are no available instances, the semaphore is locked. * When an instance is free, the semaphore is unlocked. */ -static DEFINE_SEMAPHORE(wait_queue, 1); +static DEFINE_SEMAPHORE(wait_queue); -static bool is_empty(struct jent_instance *list_head) { +bool is_empty(struct jent_instance *list_head) { bool ret; mutex_lock(&list_lock); diff --git a/SPECS/91/linux/kernel-macros/0001-kbuild-Makefile-Introduce-macros-to-distinguish-Phot.patch b/SPECS/linux/6.1/kernel-macros/0001-kbuild-Makefile-Introduce-macros-to-distinguish-Phot-6.1.patch similarity index 91% rename from SPECS/91/linux/kernel-macros/0001-kbuild-Makefile-Introduce-macros-to-distinguish-Phot.patch rename to SPECS/linux/6.1/kernel-macros/0001-kbuild-Makefile-Introduce-macros-to-distinguish-Phot-6.1.patch index 3ed7930912..f4d7752cbb 100644 --- a/SPECS/91/linux/kernel-macros/0001-kbuild-Makefile-Introduce-macros-to-distinguish-Phot.patch +++ b/SPECS/linux/6.1/kernel-macros/0001-kbuild-Makefile-Introduce-macros-to-distinguish-Phot-6.1.patch @@ -1,7 +1,7 @@ -From 2c8701e376091a97bbfbaa59e9c26bdb77ddcacc Mon Sep 17 00:00:00 2001 +From 954ca342be38673ba93261ee813a1629ff1c9482 Mon Sep 17 00:00:00 2001 From: "Srivatsa S. Bhat (VMware)" Date: Fri, 31 Mar 2023 13:42:43 -0700 -Subject: [PATCH] kbuild, Makefile: Introduce macros to distinguish Photon +Subject: [PATCH 1/2] kbuild, Makefile: Introduce macros to distinguish Photon kernel flavors/versions Out-of-tree drivers such as Intel i40e, iavf and ice, which support @@ -71,15 +71,15 @@ Signed-off-by: Srivatsa S. Bhat (VMware) 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile -index d57cfc6896b8..fa5f08d5e76d 100644 +index 6e34c942744e..55f1c4f1c8c1 100644 --- a/Makefile +++ b/Makefile -@@ -1241,12 +1241,31 @@ define filechk_version.h +@@ -1330,12 +1330,31 @@ define filechk_version.h ((c) > 255 ? 255 : (c)))'; \ echo \#define LINUX_VERSION_MAJOR $(VERSION); \ echo \#define LINUX_VERSION_PATCHLEVEL $(PATCHLEVEL); \ - echo \#define LINUX_VERSION_SUBLEVEL $(SUBLEVEL) -+ echo \#define LINUX_VERSION_SUBLEVEL $(SUBLEVEL); \ ++ echo \#define LINUX_VERSION_SUBLEVEL $(SUBLEVEL); \ + echo -e "\n\ + /*\n\ + * Sample Photon kernel versioning from uname -r output: 6.1.10-14.ph5-xyz\n\ @@ -101,13 +101,13 @@ index d57cfc6896b8..fa5f08d5e76d 100644 + echo '#define PHOTON_KERNEL_FLAVOR_' endef - $(version_h): private PATCHLEVEL := $(or $(PATCHLEVEL), 0) - $(version_h): private SUBLEVEL := $(or $(SUBLEVEL), 0) + $(version_h): PATCHLEVEL := $(or $(PATCHLEVEL), 0) + $(version_h): SUBLEVEL := $(or $(SUBLEVEL), 0) -$(version_h): FORCE +$(version_h): include/config/kernel.release FORCE $(call filechk,version.h) include/generated/utsrelease.h: include/config/kernel.release FORCE -- -2.35.6 +2.25.1 diff --git a/SPECS/90/linux/kernel-macros/0002-linux-Makefile-Add-kernel-flavor-info-to-the-generat.patch b/SPECS/linux/6.1/kernel-macros/0002-linux-Makefile-Add-kernel-flavor-info-to-the-generat-6.1.patch similarity index 100% rename from SPECS/90/linux/kernel-macros/0002-linux-Makefile-Add-kernel-flavor-info-to-the-generat.patch rename to SPECS/linux/6.1/kernel-macros/0002-linux-Makefile-Add-kernel-flavor-info-to-the-generat-6.1.patch diff --git a/SPECS/90/linux/kernel-macros/0002-linux-esx-Makefile-Add-kernel-flavor-info-to-the-gen.patch b/SPECS/linux/6.1/kernel-macros/0002-linux-esx-Makefile-Add-kernel-flavor-info-to-the-gen-6.1.patch similarity index 100% rename from SPECS/90/linux/kernel-macros/0002-linux-esx-Makefile-Add-kernel-flavor-info-to-the-gen.patch rename to SPECS/linux/6.1/kernel-macros/0002-linux-esx-Makefile-Add-kernel-flavor-info-to-the-gen-6.1.patch diff --git a/SPECS/90/linux/seccomp-release-task-filters-when-the-task-exits.patch b/SPECS/linux/6.1/seccomp-release-task-filters-when-the-task-exits.patch similarity index 100% rename from SPECS/90/linux/seccomp-release-task-filters-when-the-task-exits.patch rename to SPECS/linux/6.1/seccomp-release-task-filters-when-the-task-exits.patch diff --git a/SPECS/90/linux/secure/fix-warn-definition.patch b/SPECS/linux/6.1/secure/fix-warn-definition.patch similarity index 100% rename from SPECS/90/linux/secure/fix-warn-definition.patch rename to SPECS/linux/6.1/secure/fix-warn-definition.patch diff --git a/SPECS/90/linux/secure/gcc-rap-plugin-with-kcfi.patch b/SPECS/linux/6.1/secure/gcc-rap-plugin-with-kcfi.patch similarity index 100% rename from SPECS/90/linux/secure/gcc-rap-plugin-with-kcfi.patch rename to SPECS/linux/6.1/secure/gcc-rap-plugin-with-kcfi.patch diff --git a/SPECS/90/linux/sev/0001-sev-snp-parse-MP-tables.patch b/SPECS/linux/6.1/sev/0001-sev-snp-parse-MP-tables.patch similarity index 100% rename from SPECS/90/linux/sev/0001-sev-snp-parse-MP-tables.patch rename to SPECS/linux/6.1/sev/0001-sev-snp-parse-MP-tables.patch diff --git a/SPECS/91/linux/sev/0001-x86-boot-unconditional-preserve-CR4.MCE.patch b/SPECS/linux/6.1/sev/0001-x86-boot-unconditional-preserve-CR4.MCE-6.1.patch similarity index 55% rename from SPECS/91/linux/sev/0001-x86-boot-unconditional-preserve-CR4.MCE.patch rename to SPECS/linux/6.1/sev/0001-x86-boot-unconditional-preserve-CR4.MCE-6.1.patch index 28cd1041f6..6e7c0fed07 100644 --- a/SPECS/91/linux/sev/0001-x86-boot-unconditional-preserve-CR4.MCE.patch +++ b/SPECS/linux/6.1/sev/0001-x86-boot-unconditional-preserve-CR4.MCE-6.1.patch @@ -1,4 +1,4 @@ -From e75ed75456bca7d5002845da506229e3546e9fa4 Mon Sep 17 00:00:00 2001 +From 41290625a341067649751508452a0f2d386fbe83 Mon Sep 17 00:00:00 2001 From: Ajay Kaher Date: Mon, 31 Jul 2023 13:15:23 +0530 Subject: [PATCH] x86/boot: unconditional preserve CR4.MCE @@ -9,49 +9,50 @@ As per commit 77a512e35db7, CONFIG_INTEL_TDX_GUEST selects CONFIG_X86_MCE only to preserve CR4.MCE while enabling CR4.PAE. Preserving CR4.MCE should be unconditional and CONFIG_INTEL_TDX_GUEST should not select CONFIG_X86_MCE. +commit e2fa53a04cc722aaaedbd91cd414d170067fb09d is preserving CR4.MCE +without any condition checks + Signed-off-by: Ajay Kaher Signed-off-by: Alexey Makhalov -Signed-off-by: Vamsi Krishna Brahmajosyula - -[Srinidhi Rao Ported this patch to v6.12.y] -Signed-off-by: srinidhira0 +Signed-off-by: Srish Srinivasan --- - arch/x86/Kconfig | 1 - - arch/x86/kernel/head_64.S | 2 -- - 2 files changed, 3 deletions(-) + arch/x86/Kconfig | 1 - + arch/x86/kernel/head_64.S | 4 ---- + 2 files changed, 5 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index 15425c9bdc2b..78898c95d60e 100644 +index b3d5706..8de87f4 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig -@@ -897,7 +897,6 @@ config INTEL_TDX_GUEST - depends on PARAVIRT +@@ -886,7 +886,6 @@ config INTEL_TDX_GUEST + depends on X86_X2APIC select ARCH_HAS_CC_PLATFORM select X86_MEM_ENCRYPT - select X86_MCE - select UNACCEPTED_MEMORY help Support running as a guest under Intel TDX. Without this support, + the guest kernel can not boot or run under TDX. diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S -index 16752b8dfa89..8d6ce33b9953 100644 +index 998cdb1..98d9868 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S -@@ -199,7 +199,6 @@ SYM_INNER_LABEL(common_startup_64, SYM_L_LOCAL) - * there will be no global TLB entries after the execution." - */ - movl $(X86_CR4_PAE | X86_CR4_LA57), %edx +@@ -173,7 +173,6 @@ SYM_INNER_LABEL(secondary_startup_64_no_verify, SYM_L_GLOBAL) + addq $(init_top_pgt - __START_KERNEL_map), %rax + 1: + -#ifdef CONFIG_X86_MCE /* * Preserve CR4.MCE if the kernel will enable #MC support. * Clearing MCE may fault in some environments (that also force #MC -@@ -208,7 +207,6 @@ SYM_INNER_LABEL(common_startup_64, SYM_L_LOCAL) - * here. +@@ -183,9 +182,6 @@ SYM_INNER_LABEL(secondary_startup_64_no_verify, SYM_L_GLOBAL) */ - orl $X86_CR4_MCE, %edx --#endif movq %cr4, %rcx - andl %edx, %ecx + andl $X86_CR4_MCE, %ecx +-#else +- movl $0, %ecx +-#endif + /* Enable PAE mode, PGE and LA57 */ + orl $(X86_CR4_PAE | X86_CR4_PGE), %ecx -- -2.39.4 - +2.7.4 diff --git a/SPECS/90/linux/viomem/viomem.c b/SPECS/linux/6.1/viomem/viomem-6.1.c similarity index 100% rename from SPECS/90/linux/viomem/viomem.c rename to SPECS/linux/6.1/viomem/viomem-6.1.c diff --git a/SPECS/linux/6.1/vmw/0001-ptp-ptp_vmw-Implement-PTP-clock-adjustments-ops-6.1.patch b/SPECS/linux/6.1/vmw/0001-ptp-ptp_vmw-Implement-PTP-clock-adjustments-ops-6.1.patch new file mode 100644 index 0000000000..a987ff764c --- /dev/null +++ b/SPECS/linux/6.1/vmw/0001-ptp-ptp_vmw-Implement-PTP-clock-adjustments-ops-6.1.patch @@ -0,0 +1,146 @@ +From e4801ab23843a1353b958a668391aa170772d6a6 Mon Sep 17 00:00:00 2001 +From: Vivek Thampi +Date: Thu, 6 May 2021 09:30:56 -0700 +Subject: [PATCH 1/2] ptp/ptp_vmw: Implement PTP clock adjustments ops + +Implement PTP clock ops that set time and frequency of the underlying +clock. On supported versions of VMware precision clock virtual device +(hardware version 19 onwards), new commands can adjust its time and +frequency, allowing time transfer from a virtual machine to the +underlying hypervisor. + +Reviewed-by: Deep Shah +Signed-off-by: Vivek Thampi +--- + drivers/ptp/ptp_vmw.c | 75 ++++++++++++++++++++++++++++++++++----------------- + 1 file changed, 51 insertions(+), 24 deletions(-) + +diff --git a/drivers/ptp/ptp_vmw.c b/drivers/ptp/ptp_vmw.c +index 5dca26e..d5458dd 100644 +--- a/drivers/ptp/ptp_vmw.c ++++ b/drivers/ptp/ptp_vmw.c +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause + /* +- * Copyright (C) 2020 VMware, Inc., Palo Alto, CA., USA ++ * Copyright (C) 2020-2021 VMware, Inc., Palo Alto, CA., USA + * + * PTP clock driver for VMware precision clock virtual device. + */ +@@ -17,55 +17,82 @@ + #define VMWARE_MAGIC 0x564D5868 + #define VMWARE_CMD_PCLK(nr) ((nr << 16) | 97) + #define VMWARE_CMD_PCLK_GETTIME VMWARE_CMD_PCLK(0) ++#define VMWARE_CMD_PCLK_SETTIME VMWARE_CMD_PCLK(1) ++#define VMWARE_CMD_PCLK_ADJTIME VMWARE_CMD_PCLK(2) ++#define VMWARE_CMD_PCLK_ADJFREQ VMWARE_CMD_PCLK(3) + + static struct acpi_device *ptp_vmw_acpi_device; + static struct ptp_clock *ptp_vmw_clock; + ++/* ++ * Helpers for reading and writing to precision clock device. ++ */ + +-static int ptp_vmw_pclk_read(u64 *ns) ++static int ptp_vmw_pclk_read(int cmd, u32 *out0, u32 *out1) + { +- u32 ret, nsec_hi, nsec_lo, unused1, unused2, unused3; ++ u32 ret, unused; + + asm volatile (VMWARE_HYPERCALL : +- "=a"(ret), "=b"(nsec_hi), "=c"(nsec_lo), "=d"(unused1), +- "=S"(unused2), "=D"(unused3) : +- "a"(VMWARE_MAGIC), "b"(0), +- "c"(VMWARE_CMD_PCLK_GETTIME), "d"(0) : ++ "=a"(ret), "=b"(*out0), "=c"(*out1), "=d"(unused) : ++ "a"(VMWARE_MAGIC), "b"(0), "c"(cmd), "d"(0) : + "memory"); + +- if (ret == 0) +- *ns = ((u64)nsec_hi << 32) | nsec_lo; +- return ret; ++ return ret != 0 ? -EIO : 0; ++} ++ ++static int ptp_vmw_pclk_write(int cmd, u32 in0, u32 in1) ++{ ++ u32 ret; ++ ++ asm volatile (VMWARE_HYPERCALL : ++ "=a"(ret) : ++ "a"(VMWARE_MAGIC), "b"(0), "c"(cmd), "d"(0), ++ "S"(in0), "D"(in1) : ++ "memory"); ++ ++ return ret != 0 ? -EIO : 0; + } + + /* + * PTP clock ops. + */ + +-static int ptp_vmw_adjtime(struct ptp_clock_info *info, s64 delta) ++static int ptp_vmw_gettime(struct ptp_clock_info *info, struct timespec64 *ts) + { +- return -EOPNOTSUPP; ++ int ret; ++ u32 ns_hi, ns_lo; ++ ++ ret = ptp_vmw_pclk_read(VMWARE_CMD_PCLK_GETTIME, &ns_hi, &ns_lo); ++ if (ret == 0) ++ *ts = ns_to_timespec64(((u64)ns_hi << 32) | ns_lo); ++ return ret; + } + +-static int ptp_vmw_adjfreq(struct ptp_clock_info *info, s32 delta) ++static int ptp_vmw_adjtime(struct ptp_clock_info *info, s64 delta) + { +- return -EOPNOTSUPP; ++ return ptp_vmw_pclk_write(VMWARE_CMD_PCLK_ADJTIME, (u64)delta >> 32, ++ (u64)delta & 0xffffffff); + } + +-static int ptp_vmw_gettime(struct ptp_clock_info *info, struct timespec64 *ts) ++static int ptp_vmw_adjfreq(struct ptp_clock_info *info, s32 delta) + { +- u64 ns; +- +- if (ptp_vmw_pclk_read(&ns) != 0) +- return -EIO; +- *ts = ns_to_timespec64(ns); +- return 0; ++ s64 sppm; ++ ++ /* ++ * Convert delta in parts-per-billion to scaled parts-per-million ++ * with 16-bit binary fractional bits. ++ */ ++ sppm = div_s64((s64)delta * 65536, 1000); ++ return ptp_vmw_pclk_write(VMWARE_CMD_PCLK_ADJFREQ, (u64)sppm >> 32, ++ (u64)sppm & 0xffffffff); + } + + static int ptp_vmw_settime(struct ptp_clock_info *info, +- const struct timespec64 *ts) ++ const struct timespec64 *ts) + { +- return -EOPNOTSUPP; ++ u64 ns = timespec64_to_ns(ts); ++ return ptp_vmw_pclk_write(VMWARE_CMD_PCLK_SETTIME, ns >> 32, ++ ns & 0xffffffff); + } + + static int ptp_vmw_enable(struct ptp_clock_info *info, +@@ -77,7 +104,7 @@ static int ptp_vmw_enable(struct ptp_clock_info *info, + static struct ptp_clock_info ptp_vmw_clock_info = { + .owner = THIS_MODULE, + .name = "ptp_vmw", +- .max_adj = 0, ++ .max_adj = 500000, + .adjtime = ptp_vmw_adjtime, + .adjfreq = ptp_vmw_adjfreq, + .gettime64 = ptp_vmw_gettime, +-- +1.8.3.1 + diff --git a/SPECS/90/linux/vmw/0001-vmgenid-expose-vmgenid-via-sysfs.patch b/SPECS/linux/6.1/vmw/0001-vmgenid-expose-vmgenid-via-sysfs-6.1.patch similarity index 100% rename from SPECS/90/linux/vmw/0001-vmgenid-expose-vmgenid-via-sysfs.patch rename to SPECS/linux/6.1/vmw/0001-vmgenid-expose-vmgenid-via-sysfs-6.1.patch diff --git a/SPECS/linux/6.1/vmw/0001-x86-vmware-mark-hypercalls-as-volatile.patch b/SPECS/linux/6.1/vmw/0001-x86-vmware-mark-hypercalls-as-volatile.patch new file mode 100644 index 0000000000..f5c2150605 --- /dev/null +++ b/SPECS/linux/6.1/vmw/0001-x86-vmware-mark-hypercalls-as-volatile.patch @@ -0,0 +1,56 @@ +From 0681bc661d612242b2d1c0c4c2e33ffb8a8efc1a Mon Sep 17 00:00:00 2001 +From: Brennan Lamoreaux +Date: Wed, 11 Jun 2025 23:45:07 +0000 +Subject: [PATCH 1/2] x86-vmware: mark hypercalls as volatile + +Hypercalls can be optimized out by GCC when the return value +is ignored. Mark as volatile to avoid this. + +Signed-off-by: Brennan Lamoreaux +--- + arch/x86/kernel/cpu/vmware.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c +index 81d9bda67..9ce083b98 100644 +--- a/arch/x86/kernel/cpu/vmware.c ++++ b/arch/x86/kernel/cpu/vmware.c +@@ -61,7 +61,7 @@ + #define VMWARE_HB_CMD_MESSAGE 0 + + #define VMWARE_CMD(cmd, eax, ebx, ecx, edx) \ +- __asm__(VMWARE_HYPERCALL : \ ++ __asm__ __volatile__(VMWARE_HYPERCALL : \ + "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \ + "a"(VMWARE_HYPERVISOR_MAGIC), \ + "c"(VMWARE_CMD_##cmd), \ +@@ -69,7 +69,7 @@ + "memory") + + #define VMWARE_CMD_6(cmd, eax, ebx, ecx, edx, esi, edi) \ +- __asm__(VMWARE_HYPERCALL : \ ++ __asm__ __volatile__(VMWARE_HYPERCALL : \ + "=a"(eax), "=c"(ecx), "+d"(edx), "+b"(ebx), \ + "+S"(esi), "+D"(edi) : \ + "a"(VMWARE_HYPERVISOR_MAGIC), \ +@@ -89,7 +89,7 @@ struct vmware_steal_time { + }; + + #define VMWARE_HB_OUT(cmd, eax, ebx, ecx, edx, esi, edi, ebp) \ +- __asm__("pushq %%rbp\n\t" \ ++ __asm__ __volatile__("pushq %%rbp\n\t" \ + "movl %[extra], %%ebp\n\t" \ + VMWARE_HYPERCALL_HB_OUT \ + "popq %%rbp\n\t" : \ +@@ -100,7 +100,7 @@ struct vmware_steal_time { + "memory") + + #define VMWARE_HB_IN(cmd, eax, ebx, ecx, edx, esi, edi, ebp) \ +- __asm__("pushq %%rbp\n\t" \ ++ __asm__ __volatile__("pushq %%rbp\n\t" \ + "movl %[extra], %%ebp\n\t" \ + VMWARE_HYPERCALL_HB_IN \ + "popq %%rbp\n\t" : \ +-- +2.40.4 + diff --git a/SPECS/linux/6.1/vmw/0002-ptp-ptp_vmw-Add-module-param-to-probe-device-using-h-6.1.patch b/SPECS/linux/6.1/vmw/0002-ptp-ptp_vmw-Add-module-param-to-probe-device-using-h-6.1.patch new file mode 100644 index 0000000000..d7cc618adc --- /dev/null +++ b/SPECS/linux/6.1/vmw/0002-ptp-ptp_vmw-Add-module-param-to-probe-device-using-h-6.1.patch @@ -0,0 +1,130 @@ +From 2c3c00549cbb2978d6a455ab2d2fb3686a659a94 Mon Sep 17 00:00:00 2001 +From: Vivek Thampi +Date: Thu, 6 May 2021 10:41:52 -0700 +Subject: [PATCH 2/2] ptp/ptp_vmw: Add module param to probe device using + hypervisor command + +Add a module parameter probe_hv_port that allows ptp_vmw driver to be +loaded even when ACPI is disabled, by directly probing for the device +using VMware hypervisor port commands. + +VMware precision clock virtual device is exposed as a platform ACPI +device in its virtual chipset hardware. Its driver - ptp_vmw - is +registered with the ACPI bus for discovery and binding. On systems where +ACPI is disabled, such as virtual machines optimized for fast boot +times, this means that the device is not discoverable and cannot be +loaded. Since the device operations are performed via VMware hypervisor +port commands, the ACPI sub-system can be by-passed and manually loaded +with the added module parameter, provided that the device is attached to +the virtual machine. + +Reviewed-by: Deep Shah +Signed-off-by: Vivek Thampi +--- + drivers/ptp/ptp_vmw.c | 57 ++++++++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 47 insertions(+), 10 deletions(-) + +diff --git a/drivers/ptp/ptp_vmw.c b/drivers/ptp/ptp_vmw.c +index d5458dd..84ff2d0 100644 +--- a/drivers/ptp/ptp_vmw.c ++++ b/drivers/ptp/ptp_vmw.c +@@ -21,6 +21,9 @@ + #define VMWARE_CMD_PCLK_ADJTIME VMWARE_CMD_PCLK(2) + #define VMWARE_CMD_PCLK_ADJFREQ VMWARE_CMD_PCLK(3) + ++int probe_hv_port = 0; ++module_param(probe_hv_port, int, S_IRUGO); ++ + static struct acpi_device *ptp_vmw_acpi_device; + static struct ptp_clock *ptp_vmw_clock; + +@@ -112,25 +115,41 @@ static int ptp_vmw_enable(struct ptp_clock_info *info, + .enable = ptp_vmw_enable, + }; + ++static int ptp_vmw_clock_register(void) ++{ ++ ptp_vmw_clock = ptp_clock_register(&ptp_vmw_clock_info, NULL); ++ if (IS_ERR(ptp_vmw_clock)) { ++ pr_err("ptp_vmw: Failed to register ptp clock\n"); ++ return PTR_ERR(ptp_vmw_clock); ++ } ++ printk(KERN_DEBUG "ptp_vmw: ptp clock registered\n"); ++ return 0; ++} ++ ++static void ptp_vmw_clock_unregister(void) ++{ ++ ptp_clock_unregister(ptp_vmw_clock); ++ ptp_vmw_clock = NULL; ++ printk(KERN_DEBUG "ptp_vmw: ptp clock unregistered\n"); ++} ++ + /* + * ACPI driver ops for VMware "precision clock" virtual device. + */ + + static int ptp_vmw_acpi_add(struct acpi_device *device) + { +- ptp_vmw_clock = ptp_clock_register(&ptp_vmw_clock_info, NULL); +- if (IS_ERR(ptp_vmw_clock)) { +- pr_err("failed to register ptp clock\n"); +- return PTR_ERR(ptp_vmw_clock); +- } ++ int ret = ptp_vmw_clock_register(); + +- ptp_vmw_acpi_device = device; +- return 0; ++ if (ret == 0) ++ ptp_vmw_acpi_device = device; ++ return ret; + } + + static int ptp_vmw_acpi_remove(struct acpi_device *device) + { +- ptp_clock_unregister(ptp_vmw_clock); ++ ptp_vmw_clock_unregister(); ++ ptp_vmw_acpi_device = NULL; + return 0; + } + +@@ -151,16 +170,34 @@ static int ptp_vmw_acpi_remove(struct acpi_device *device) + .owner = THIS_MODULE + }; + ++/* ++ * Probe existence of device by poking at a command. If successful, ++ * register as a PTP clock. This is a fallback option for when ACPI ++ * is not available and probe_hv_port is enabled. ++ */ ++static int ptp_vmw_probe(void) ++{ ++ u32 ns_hi, ns_lo; ++ return ptp_vmw_pclk_read(VMWARE_CMD_PCLK_GETTIME, &ns_hi, &ns_lo); ++} ++ + static int __init ptp_vmw_init(void) + { + if (x86_hyper_type != X86_HYPER_VMWARE) + return -1; +- return acpi_bus_register_driver(&ptp_vmw_acpi_driver); ++ if (!acpi_disabled) ++ return acpi_bus_register_driver(&ptp_vmw_acpi_driver); ++ if (probe_hv_port && ptp_vmw_probe() == 0) ++ return ptp_vmw_clock_register(); ++ return -ENODEV; + } + + static void __exit ptp_vmw_exit(void) + { +- acpi_bus_unregister_driver(&ptp_vmw_acpi_driver); ++ if (!acpi_disabled) ++ acpi_bus_unregister_driver(&ptp_vmw_acpi_driver); ++ else if (probe_hv_port) ++ ptp_vmw_clock_unregister(); + } + + module_init(ptp_vmw_init); +-- +1.8.3.1 + diff --git a/SPECS/linux/6.1/vmw/0002-x86-report-guest-crash-to-vmware-hypervisor.patch b/SPECS/linux/6.1/vmw/0002-x86-report-guest-crash-to-vmware-hypervisor.patch new file mode 100644 index 0000000000..6e8286be5a --- /dev/null +++ b/SPECS/linux/6.1/vmw/0002-x86-report-guest-crash-to-vmware-hypervisor.patch @@ -0,0 +1,98 @@ +From 2a0137d01eec3772a29360c08c61686ab9933600 Mon Sep 17 00:00:00 2001 +From: Brennan Lamoreaux +Date: Sat, 1 Mar 2025 00:36:22 +0000 +Subject: [PATCH] x86: report guest crash to vmware hypervisor + +Register the guest crash reporter to panic_notifier_list, +which will be called at panic time. Guest crash reporter +will report the crash to the hypervisor through +a hypercall. + +Signed-off-by: Brennan Lamoreaux +--- + arch/x86/kernel/cpu/vmware.c | 41 ++++++++++++++++++++++++++++++------ + 1 file changed, 34 insertions(+), 7 deletions(-) + +diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c +index 43c6ca65d..eb9ce3e99 100644 +--- a/arch/x86/kernel/cpu/vmware.c ++++ b/arch/x86/kernel/cpu/vmware.c +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -46,13 +47,14 @@ + + #define VMWARE_HYPERVISOR_MAGIC 0x564D5868 + +-#define VMWARE_CMD_GETVERSION 10 +-#define VMWARE_CMD_GETHZ 45 +-#define VMWARE_CMD_GETVCPU_INFO 68 +-#define VMWARE_CMD_LEGACY_X2APIC 3 +-#define VMWARE_CMD_MESSAGE 30 +-#define VMWARE_CMD_VCPU_RESERVED 31 +-#define VMWARE_CMD_STEALCLOCK 91 ++#define VMWARE_CMD_GETVERSION 10 ++#define VMWARE_CMD_GETHZ 45 ++#define VMWARE_CMD_GETVCPU_INFO 68 ++#define VMWARE_CMD_LEGACY_X2APIC 3 ++#define VMWARE_CMD_MESSAGE 30 ++#define VMWARE_CMD_VCPU_RESERVED 31 ++#define VMWARE_CMD_STEALCLOCK 91 ++#define VMWARE_CMD_REPORTGUESTCRASH 102 + + #define STEALCLOCK_NOT_AVAILABLE (-1) + #define STEALCLOCK_DISABLED 0 +@@ -193,6 +195,11 @@ static int vmware_cmd_stealclock(uint32_t arg1, uint32_t arg2) + return result; + } + ++static void vmware_cmd_report_guest_crash(void) { ++ uint32_t eax, ebx, ecx, edx; ++ VMWARE_CMD(REPORTGUESTCRASH, eax, ebx, ecx, edx); ++} ++ + static bool stealclock_enable(phys_addr_t pa) + { + return vmware_cmd_stealclock(upper_32_bits(pa), +@@ -395,6 +402,24 @@ static void __init vmware_paravirt_ops_setup(void) + #define vmware_paravirt_ops_setup() do {} while (0) + #endif + ++static int vmware_report_guest_crash(struct notifier_block *self, ++ unsigned long action, void *data) ++{ ++ vmware_cmd_report_guest_crash(); ++ return 0; ++} ++ ++static struct notifier_block guest_crash_reporter = { ++ .notifier_call = vmware_report_guest_crash ++}; ++ ++static int __init register_guest_crash_reporter(void) ++{ ++ atomic_notifier_chain_register(&panic_notifier_list, ++ &guest_crash_reporter); ++ ++ return 0; ++} + /* + * VMware hypervisor takes care of exporting a reliable TSC to the guest. + * Still, due to timing difference when running on virtual cpus, the TSC can +@@ -467,6 +492,8 @@ static void __init vmware_platform_setup(void) + vmware_set_capabilities(); + + kmsg_dump_register(&kmsg_dumper); ++ ++ register_guest_crash_reporter(); + } + + static u8 __init vmware_select_hypercall(void) +-- +2.40.4 + diff --git a/SPECS/91/linux/vmw/0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch b/SPECS/linux/6.1/vmw/6.0-0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch similarity index 92% rename from SPECS/91/linux/vmw/0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch rename to SPECS/linux/6.1/vmw/6.0-0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch index e9bd29a2ae..ba0723aa5c 100644 --- a/SPECS/91/linux/vmw/0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch +++ b/SPECS/linux/6.1/vmw/6.0-0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch @@ -19,13 +19,13 @@ Signed-off-by: Srivatsa S. Bhat (VMware) create mode 100644 drivers/char/hw_random/rdrand-rng.c diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig -index 8de74dcfa..f71da7ece 100644 +index 3da8e85f8aae..5f4a8f927410 100644 --- a/drivers/char/hw_random/Kconfig +++ b/drivers/char/hw_random/Kconfig -@@ -62,6 +62,20 @@ config HW_RANDOM_AMD - - If unsure, say Y. - +@@ -61,6 +61,20 @@ config HW_RANDOM_AMD + + If unsure, say Y. + +config HW_RANDOM_RDRAND + tristate "x86 rdrand Random Number Generator support" + depends on (X86_32 || X86_64) @@ -41,10 +41,10 @@ index 8de74dcfa..f71da7ece 100644 + If unsure, say N. + config HW_RANDOM_ATMEL - tristate "Atmel Random Number Generator support" - depends on (ARCH_AT91 || COMPILE_TEST) + tristate "Atmel Random Number Generator support" + depends on (ARCH_AT91 || COMPILE_TEST) && HAVE_CLK && OF diff --git a/drivers/char/hw_random/Makefile b/drivers/char/hw_random/Makefile -index 32549a118..1f24f2d72 100644 +index 3e948cf04476..dfa0dfddac09 100644 --- a/drivers/char/hw_random/Makefile +++ b/drivers/char/hw_random/Makefile @@ -8,6 +8,7 @@ rng-core-y := core.o @@ -57,7 +57,7 @@ index 32549a118..1f24f2d72 100644 obj-$(CONFIG_HW_RANDOM_GEODE) += geode-rng.o diff --git a/drivers/char/hw_random/rdrand-rng.c b/drivers/char/hw_random/rdrand-rng.c new file mode 100644 -index 000000000..8f68d7844 +index 000000000000..8f68d784408f --- /dev/null +++ b/drivers/char/hw_random/rdrand-rng.c @@ -0,0 +1,73 @@ @@ -134,5 +134,6 @@ index 000000000..8f68d7844 +MODULE_AUTHOR("Srivatsa S. Bhat (VMware) "); +MODULE_DESCRIPTION("H/W RNG driver for x86 CPUs that support RDRAND/RDSEED"); +MODULE_LICENSE("GPL"); --- -2.41.0 +-- +2.25.1 + diff --git a/SPECS/90/linux/vmw/6.0-x86-probe_roms-Skip-OpROM-probing-if-running-as-VMwa.patch b/SPECS/linux/6.1/vmw/6.0-x86-probe_roms-Skip-OpROM-probing-if-running-as-VMwa.patch similarity index 100% rename from SPECS/90/linux/vmw/6.0-x86-probe_roms-Skip-OpROM-probing-if-running-as-VMwa.patch rename to SPECS/linux/6.1/vmw/6.0-x86-probe_roms-Skip-OpROM-probing-if-running-as-VMwa.patch diff --git a/SPECS/90/linux/vmw/6.0-x86-vmware-Fix-steal-time-clock-under-SEV.patch b/SPECS/linux/6.1/vmw/6.0-x86-vmware-Fix-steal-time-clock-under-SEV.patch similarity index 100% rename from SPECS/90/linux/vmw/6.0-x86-vmware-Fix-steal-time-clock-under-SEV.patch rename to SPECS/linux/6.1/vmw/6.0-x86-vmware-Fix-steal-time-clock-under-SEV.patch diff --git a/SPECS/linux/6.1/vmw/6.0-x86-vmware-Log-kmsg-dump-on-panic.patch b/SPECS/linux/6.1/vmw/6.0-x86-vmware-Log-kmsg-dump-on-panic.patch new file mode 100644 index 0000000000..0ef61fd281 --- /dev/null +++ b/SPECS/linux/6.1/vmw/6.0-x86-vmware-Log-kmsg-dump-on-panic.patch @@ -0,0 +1,203 @@ +From 35d48897601962c412b03b3468e11108ff9bfe56 Mon Sep 17 00:00:00 2001 +From: Bo Gan +Date: Tue, 2 Jun 2020 19:35:47 -0700 +Subject: [PATCH 15/25] x86/vmware: Log kmsg dump on panic + +In case of panic kmsg will be dumped to vmware.log file + +Signed-off-by: Alexey Makhalov +Signed-off-by: Bo Gan +--- + arch/x86/kernel/cpu/vmware.c | 142 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 142 insertions(+) + +diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c +index 64bc42214..c34d7e533 100644 +--- a/arch/x86/kernel/cpu/vmware.c ++++ b/arch/x86/kernel/cpu/vmware.c +@@ -28,6 +28,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -45,6 +47,7 @@ + #define VMWARE_CMD_GETHZ 45 + #define VMWARE_CMD_GETVCPU_INFO 68 + #define VMWARE_CMD_LEGACY_X2APIC 3 ++#define VMWARE_CMD_MESSAGE 30 + #define VMWARE_CMD_VCPU_RESERVED 31 + #define VMWARE_CMD_STEALCLOCK 91 + +@@ -52,6 +55,8 @@ + #define STEALCLOCK_DISABLED 0 + #define STEALCLOCK_ENABLED 1 + ++#define VMWARE_HB_CMD_MESSAGE 0 ++ + #define VMWARE_CMD(cmd, eax, ebx, ecx, edx) \ + __asm__(VMWARE_HYPERCALL : \ + "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \ +@@ -117,6 +122,13 @@ static unsigned long vmware_get_tsc_khz(void) + return vmware_tsc_khz; + } + ++static void kmsg_dumper_vmware_log(struct kmsg_dumper *dumper, ++ enum kmsg_dump_reason reason); ++ ++static struct kmsg_dumper kmsg_dumper = { ++ .dump = kmsg_dumper_vmware_log ++}; ++ + #ifdef CONFIG_PARAVIRT + static struct cyc2ns_data vmware_cyc2ns __ro_after_init; + static bool vmw_sched_clock __initdata = true; +@@ -424,6 +436,8 @@ static void __init vmware_platform_setup(void) + #endif + + vmware_set_capabilities(); ++ ++ kmsg_dump_register(&kmsg_dumper); + } + + static u8 __init vmware_select_hypercall(void) +@@ -522,3 +536,133 @@ const __initconst struct hypervisor_x86 x86_hyper_vmware = { + .runtime.sev_es_hcall_finish = vmware_sev_es_hcall_finish, + #endif + }; ++ ++#define MESSAGE_STATUS_SUCCESS (0x01 << 16) ++#define MESSAGE_STATUS_CPT (0x10 << 16) ++#define MESSAGE_STATUS_HB (0x80 << 16) ++#define VMWARE_HB_CMD_MSGST_SUCCESS \ ++ (VMWARE_HB_CMD_MESSAGE | MESSAGE_STATUS_SUCCESS) ++#define VMWARE_HB_CMD_MSGST_CPT \ ++ (VMWARE_HB_CMD_MESSAGE | MESSAGE_STATUS_CPT) ++#define VMWARE_HB_CMD_MSGST_HB \ ++ (VMWARE_HB_CMD_MESSAGE | MESSAGE_STATUS_HB) ++ ++#define RPCI_PROTOCOL_NUM 0x49435052 /* 'RPCI' */ ++#define GUESTMSG_FLAG_COOKIE 0x80000000 ++ ++#define MESSAGE_TYPE_OPEN (0 << 16) ++#define MESSAGE_TYPE_SENDSIZE (1 << 16) ++#define MESSAGE_TYPE_SEND (2 << 16) ++#define MESSAGE_TYPE_CLOSE (6 << 16) ++#define VMWARE_CMD_MSG_OPEN \ ++ (VMWARE_CMD_MESSAGE | MESSAGE_TYPE_OPEN) ++#define VMWARE_CMD_MSG_SENDSIZE \ ++ (VMWARE_CMD_MESSAGE | MESSAGE_TYPE_SENDSIZE) ++#define VMWARE_CMD_MSG_SEND \ ++ (VMWARE_CMD_MESSAGE | MESSAGE_TYPE_SEND) ++#define VMWARE_CMD_MSG_CLOSE \ ++ (VMWARE_CMD_MESSAGE | MESSAGE_TYPE_CLOSE) ++ ++typedef struct { ++ uint32_t id; ++ uint32_t cookieHigh; ++ uint32_t cookieLow; ++} vmw_msg; ++ ++static int ++vmware_log_open(vmw_msg *msg) ++{ ++ uint32_t result, info, ebx = RPCI_PROTOCOL_NUM | GUESTMSG_FLAG_COOKIE; ++ ++ VMWARE_CMD_6(MSG_OPEN, result, ebx, ++ info, msg->id, msg->cookieHigh, msg->cookieLow); ++ ++ if ((info & MESSAGE_STATUS_SUCCESS) == 0) ++ return 1; ++ ++ msg->id &= 0xffff0000UL; ++ return 0; ++} ++ ++static int ++vmware_log_close(vmw_msg *msg) ++{ ++ uint32_t result, info, ebx = 0, edx = msg->id; ++ ++ VMWARE_CMD_6(MSG_CLOSE, result, ebx, info, edx, ++ msg->cookieHigh, msg->cookieLow); ++ ++ if ((info & MESSAGE_STATUS_SUCCESS) == 0) ++ return 1; ++ return 0; ++} ++ ++static int ++vmware_log_send(vmw_msg *msg, const char *string) ++{ ++ uint32_t result, info; ++ uint32_t len = strlen(string); ++ uint32_t ecx, edx, ebx; ++ ++retry: ++ ebx = len; ++ edx = msg->id; ++ VMWARE_CMD_6(MSG_SENDSIZE, result, ebx, info, edx, ++ msg->cookieHigh, msg->cookieLow); ++ ++ if (!(info & MESSAGE_STATUS_SUCCESS)) ++ return 1; ++ ++ edx = msg->id; ++ if (!(sev_status & MSR_AMD64_SEV_ENABLED) && (info & MESSAGE_STATUS_HB)) { ++ ecx = len; ++ VMWARE_HB_OUT(MSGST_SUCCESS, result, info, ecx, edx, ++ string, msg->cookieLow, msg->cookieHigh); ++ } else { ++ do { ++ size_t s = len > sizeof(ebx) ? sizeof(ebx) : len; ++ ++ memcpy(&ebx, string, s); ++ ++ len -= s; ++ string += s; ++ ++ VMWARE_CMD_6(MSG_SEND, result, ebx, info, edx, ++ msg->cookieHigh, msg->cookieLow); ++ } while(len && (info & MESSAGE_STATUS_SUCCESS)); ++ } ++ ++ if ((info & MESSAGE_STATUS_SUCCESS) == 0) { ++ if (info & MESSAGE_STATUS_CPT) ++ /* A checkpoint occurred. Retry. */ ++ goto retry; ++ return 1; ++ } ++ return 0; ++} ++STACK_FRAME_NON_STANDARD(vmware_log_send); ++ ++static void kmsg_dumper_vmware_log(struct kmsg_dumper *dumper, ++ enum kmsg_dump_reason reason) ++{ ++ vmw_msg msg; ++ static char line[1024]; ++ size_t len = 0; ++ bool fail = false; ++ struct kmsg_dump_iter iter; ++ ++ line[0] = 'l'; ++ line[1] = 'o'; ++ line[2] = 'g'; ++ line[3] = ' '; ++ ++ kmsg_dump_rewind(&iter); ++ while (!fail && kmsg_dump_get_line(&iter, true, ++ line + 4, sizeof(line) - 4, &len)) { ++ line[len + 4] = '\0'; ++ if (vmware_log_open(&msg)) ++ return; ++ fail = vmware_log_send(&msg, line); ++ vmware_log_close(&msg); ++ } ++} +-- +2.7.4 + diff --git a/SPECS/linux/6.1/vmw/6.0-x86-vmware-Use-Efficient-and-Correct-ALTERNATIVEs-fo.patch b/SPECS/linux/6.1/vmw/6.0-x86-vmware-Use-Efficient-and-Correct-ALTERNATIVEs-fo.patch new file mode 100644 index 0000000000..bd22aefa87 --- /dev/null +++ b/SPECS/linux/6.1/vmw/6.0-x86-vmware-Use-Efficient-and-Correct-ALTERNATIVEs-fo.patch @@ -0,0 +1,326 @@ +From 788deeb00d5b2c6329c9ee08f20ef3dda79db93a Mon Sep 17 00:00:00 2001 +From: Bo Gan +Date: Tue, 2 Jun 2020 19:25:06 -0700 +Subject: [PATCH] x86/vmware: Use Efficient and Correct ALTERNATIVEs for + hypercall + +Before ALTERNATIVEs are applied, vmware_hypercall_mode will be used +to select hypercall methods (IO/VMCALL/VMMCALL). Hypercall goes +through vmw_hypercall(hb)_slowpath. After ALTERNATIVEs are applied, +the call instruction will be replaced with IO/VMCALL/VMMCALL +instructions. + +Signed-off-by: Bo Gan +--- + MAINTAINERS | 1 + + arch/x86/include/asm/asm-prototypes.h | 1 + + arch/x86/include/asm/vmware.h | 52 +++++++++++++++++---- + arch/x86/kernel/cpu/Makefile | 2 +- + arch/x86/kernel/cpu/vmw_hc.S | 61 +++++++++++++++++++++++++ + arch/x86/kernel/cpu/vmware.c | 66 +++++++++++++-------------- + 6 files changed, 137 insertions(+), 46 deletions(-) + create mode 100644 arch/x86/kernel/cpu/vmw_hc.S + +diff --git a/MAINTAINERS b/MAINTAINERS +index 72b9654f764c..f86bbb90061b 100644 +--- a/MAINTAINERS ++++ b/MAINTAINERS +@@ -21719,6 +21719,7 @@ L: x86@kernel.org + S: Supported + T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/vmware + F: arch/x86/include/asm/vmware.h ++F: arch/x86/kernel/cpu/vmw_hc.S + F: arch/x86/kernel/cpu/vmware.c + + VMWARE PVRDMA DRIVER +diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h +index 5cdccea45..89c1ed6c5 100644 +--- a/arch/x86/include/asm/asm-prototypes.h ++++ b/arch/x86/include/asm/asm-prototypes.h +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + #ifndef CONFIG_X86_CMPXCHG64 + extern void cmpxchg8b_emu(void); +diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h +index ac9fc51e2b18..e9e9a91455e0 100644 +--- a/arch/x86/include/asm/vmware.h ++++ b/arch/x86/include/asm/vmware.h +@@ -2,10 +2,16 @@ + #ifndef _ASM_X86_VMWARE_H + #define _ASM_X86_VMWARE_H + ++#include + #include + #include + #include + ++#define CPUID_VMWARE_INFO_LEAF 0x40000000 ++#define CPUID_VMWARE_FEATURES_LEAF 0x40000010 ++#define CPUID_VMWARE_FEATURES_ECX_VMMCALL BIT(0) ++#define CPUID_VMWARE_FEATURES_ECX_VMCALL BIT(1) ++ + /* + * The hypercall definitions differ in the low word of the %edx argument + * in the following way: the old port base interface uses the port +@@ -28,30 +34,56 @@ + #define VMWARE_HYPERVISOR_HB BIT(0) + #define VMWARE_HYPERVISOR_OUT BIT(1) + ++#ifndef __ASSEMBLY__ ++/* ++ * Custom calling convention defined by hypervisor. ++ * Function itself should not clobber any register. ++ */ ++extern void vmw_hypercall_slowpath(void); ++extern void vmw_hypercall_hb_out_slowpath(void); ++extern void vmw_hypercall_hb_in_slowpath(void); ++#endif ++ + /* The low bandwidth call. The low word of edx is presumed clear. */ + #define VMWARE_HYPERCALL \ +- ALTERNATIVE_2("movw $" __stringify(VMWARE_HYPERVISOR_PORT) ", %%dx; " \ +- "inl (%%dx), %%eax", \ ++ ALTERNATIVE_3("callq vmw_hypercall_slowpath", \ ++ "movw $" __stringify(VMWARE_HYPERVISOR_PORT) \ ++ ", %%dx; " \ ++ "inl (%%dx), %%eax", X86_FEATURE_HYPERVISOR, \ ++ "movw $0, %%dx; " \ + "vmcall", X86_FEATURE_VMCALL, \ ++ "movw $0, %%dx; " \ + "vmmcall", X86_FEATURE_VMW_VMMCALL) + + /* +- * The high bandwidth out call. The low word of edx is presumed to have the +- * HB and OUT bits set. ++ * The high bandwidth out call. + */ + #define VMWARE_HYPERCALL_HB_OUT \ +- ALTERNATIVE_2("movw $" __stringify(VMWARE_HYPERVISOR_PORT_HB) ", %%dx; " \ +- "rep outsb", \ ++ ALTERNATIVE_3("callq vmw_hypercall_hb_out_slowpath", \ ++ "movw $" __stringify(VMWARE_HYPERVISOR_PORT_HB) \ ++ ", %%dx; " \ ++ "cld; rep outsb", X86_FEATURE_HYPERVISOR, \ ++ "movw $" __stringify(VMWARE_HYPERVISOR_HB | \ ++ VMWARE_HYPERVISOR_OUT) \ ++ ", %%dx; " \ + "vmcall", X86_FEATURE_VMCALL, \ ++ "movw $" __stringify(VMWARE_HYPERVISOR_HB | \ ++ VMWARE_HYPERVISOR_OUT) \ ++ ", %%dx; " \ + "vmmcall", X86_FEATURE_VMW_VMMCALL) + + /* +- * The high bandwidth in call. The low word of edx is presumed to have the +- * HB bit set. ++ * The high bandwidth in call. + */ + #define VMWARE_HYPERCALL_HB_IN \ +- ALTERNATIVE_2("movw $" __stringify(VMWARE_HYPERVISOR_PORT_HB) ", %%dx; " \ +- "rep insb", \ ++ ALTERNATIVE_3("callq vmw_hypercall_hb_in_slowpath", \ ++ "movw $" __stringify(VMWARE_HYPERVISOR_PORT_HB) \ ++ ", %%dx; " \ ++ "cld; rep insb", X86_FEATURE_HYPERVISOR, \ ++ "movw $" __stringify(VMWARE_HYPERVISOR_HB) \ ++ ", %%dx; " \ + "vmcall", X86_FEATURE_VMCALL, \ ++ "movw $" __stringify(VMWARE_HYPERVISOR_HB) \ ++ ", %%dx; " \ + "vmmcall", X86_FEATURE_VMW_VMMCALL) + #endif +diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile +index 9661e3e802be..89c96c936083 100644 +--- a/arch/x86/kernel/cpu/Makefile ++++ b/arch/x86/kernel/cpu/Makefile +@@ -53,7 +53,7 @@ obj-$(CONFIG_X86_SGX) += sgx/ + + obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o + +-obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o ++obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o vmw_hc.o hypervisor.o mshyperv.o + obj-$(CONFIG_ACRN_GUEST) += acrn.o + + ifdef CONFIG_X86_FEATURE_NAMES +diff --git a/arch/x86/kernel/cpu/vmw_hc.S b/arch/x86/kernel/cpu/vmw_hc.S +new file mode 100644 +index 000000000000..3a5adb77baab +--- /dev/null ++++ b/arch/x86/kernel/cpu/vmw_hc.S +@@ -0,0 +1,61 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++ ++#include ++#include ++#include ++ ++ .text ++SYM_FUNC_START(vmw_hypercall_slowpath) ++ testb $CPUID_VMWARE_FEATURES_ECX_VMMCALL, vmware_hypercall_mode(%rip) ++ jnz .Lvmw_vmmcall ++ testb $CPUID_VMWARE_FEATURES_ECX_VMCALL, vmware_hypercall_mode(%rip) ++ jnz .Lvmw_vmcall ++ movw $VMWARE_HYPERVISOR_PORT, %dx; ++ inl (%dx), %eax ++ RET ++.Lvmw_vmcall: ++ movw $0, %dx ++ vmcall ++ RET ++.Lvmw_vmmcall: ++ movw $0, %dx ++ vmmcall ++ RET ++SYM_FUNC_END(vmw_hypercall_slowpath) ++EXPORT_SYMBOL(vmw_hypercall_slowpath) ++ ++SYM_FUNC_START(vmw_hypercall_hb_out_slowpath) ++ movw $(VMWARE_HYPERVISOR_HB | VMWARE_HYPERVISOR_OUT), %dx ++ testb $CPUID_VMWARE_FEATURES_ECX_VMMCALL, vmware_hypercall_mode(%rip) ++ jnz .Lvmw_vmmcallo ++ testb $CPUID_VMWARE_FEATURES_ECX_VMCALL, vmware_hypercall_mode(%rip) ++ jnz .Lvmw_vmcallo ++ movw $VMWARE_HYPERVISOR_PORT_HB, %dx ++ rep outsb ++ RET ++.Lvmw_vmcallo: ++ vmcall ++ RET ++.Lvmw_vmmcallo: ++ vmmcall ++ RET ++SYM_FUNC_END(vmw_hypercall_hb_out_slowpath) ++EXPORT_SYMBOL(vmw_hypercall_hb_out_slowpath) ++ ++SYM_FUNC_START(vmw_hypercall_hb_in_slowpath) ++ movw $VMWARE_HYPERVISOR_HB, %dx ++ testb $CPUID_VMWARE_FEATURES_ECX_VMMCALL, vmware_hypercall_mode(%rip) ++ jnz .Lvmw_vmmcalli ++ testb $CPUID_VMWARE_FEATURES_ECX_VMCALL, vmware_hypercall_mode(%rip) ++ jnz .Lvmw_vmcalli ++ movw $VMWARE_HYPERVISOR_PORT_HB, %dx ++ rep insb ++ RET ++.Lvmw_vmcalli: ++ vmcall ++ RET ++.Lvmw_vmmcalli: ++ vmmcall ++ RET ++SYM_FUNC_END(vmw_hypercall_hb_in_slowpath) ++EXPORT_SYMBOL(vmw_hypercall_hb_in_slowpath) +diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c +index 02039ec3597d..64bc42214054 100644 +--- a/arch/x86/kernel/cpu/vmware.c ++++ b/arch/x86/kernel/cpu/vmware.c +@@ -39,11 +39,6 @@ + #undef pr_fmt + #define pr_fmt(fmt) "vmware: " fmt + +-#define CPUID_VMWARE_INFO_LEAF 0x40000000 +-#define CPUID_VMWARE_FEATURES_LEAF 0x40000010 +-#define CPUID_VMWARE_FEATURES_ECX_VMMCALL BIT(0) +-#define CPUID_VMWARE_FEATURES_ECX_VMCALL BIT(1) +- + #define VMWARE_HYPERVISOR_MAGIC 0x564D5868 + + #define VMWARE_CMD_GETVERSION 10 +@@ -57,44 +52,22 @@ + #define STEALCLOCK_DISABLED 0 + #define STEALCLOCK_ENABLED 1 + +-#define VMWARE_PORT(cmd, eax, ebx, ecx, edx) \ +- __asm__("inl (%%dx), %%eax" : \ +- "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \ +- "a"(VMWARE_HYPERVISOR_MAGIC), \ +- "c"(VMWARE_CMD_##cmd), \ +- "d"(VMWARE_HYPERVISOR_PORT), "b"(UINT_MAX) : \ +- "memory") +- +-#define VMWARE_VMCALL(cmd, eax, ebx, ecx, edx) \ +- __asm__("vmcall" : \ ++#define VMWARE_CMD(cmd, eax, ebx, ecx, edx) \ ++ __asm__(VMWARE_HYPERCALL : \ + "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \ + "a"(VMWARE_HYPERVISOR_MAGIC), \ + "c"(VMWARE_CMD_##cmd), \ + "d"(0), "b"(UINT_MAX) : \ + "memory") + +-#define VMWARE_VMMCALL(cmd, eax, ebx, ecx, edx) \ +- __asm__("vmmcall" : \ +- "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \ ++#define VMWARE_CMD_6(cmd, eax, ebx, ecx, edx, esi, edi) \ ++ __asm__(VMWARE_HYPERCALL : \ ++ "=a"(eax), "=c"(ecx), "+d"(edx), "+b"(ebx), \ ++ "+S"(esi), "+D"(edi) : \ + "a"(VMWARE_HYPERVISOR_MAGIC), \ +- "c"(VMWARE_CMD_##cmd), \ +- "d"(0), "b"(UINT_MAX) : \ ++ "c"(VMWARE_CMD_##cmd) : \ + "memory") + +-#define VMWARE_CMD(cmd, eax, ebx, ecx, edx) do { \ +- switch (vmware_hypercall_mode) { \ +- case CPUID_VMWARE_FEATURES_ECX_VMCALL: \ +- VMWARE_VMCALL(cmd, eax, ebx, ecx, edx); \ +- break; \ +- case CPUID_VMWARE_FEATURES_ECX_VMMCALL: \ +- VMWARE_VMMCALL(cmd, eax, ebx, ecx, edx); \ +- break; \ +- default: \ +- VMWARE_PORT(cmd, eax, ebx, ecx, edx); \ +- break; \ +- } \ +- } while (0) +- + struct vmware_steal_time { + union { + uint64_t clock; /* stolen time counter in units of vtsc */ +@@ -107,8 +80,30 @@ struct vmware_steal_time { + uint64_t reserved[7]; + }; + ++#define VMWARE_HB_OUT(cmd, eax, ebx, ecx, edx, esi, edi, ebp) \ ++ __asm__("pushq %%rbp\n\t" \ ++ "movl %[extra], %%ebp\n\t" \ ++ VMWARE_HYPERCALL_HB_OUT \ ++ "popq %%rbp\n\t" : \ ++ "=a"(eax), "+c"(ecx), "+d"(edx), "=b"(ebx) : \ ++ "a"(VMWARE_HYPERVISOR_MAGIC), \ ++ "b"(VMWARE_HB_CMD_##cmd), \ ++ "S"(esi), "D"(edi), [extra] "r"(ebp) : \ ++ "memory") ++ ++#define VMWARE_HB_IN(cmd, eax, ebx, ecx, edx, esi, edi, ebp) \ ++ __asm__("pushq %%rbp\n\t" \ ++ "movl %[extra], %%ebp\n\t" \ ++ VMWARE_HYPERCALL_HB_IN \ ++ "popq %%rbp\n\t" : \ ++ "=a"(eax), "+c"(ecx), "+d"(edx), "=b"(ebx) : \ ++ "a"(VMWARE_HYPERVISOR_MAGIC), \ ++ "b"(VMWARE_HB_CMD_##cmd), \ ++ "S"(esi), "D"(edi), [extra] "r"(ebp) : \ ++ "memory") ++ + static unsigned long vmware_tsc_khz __ro_after_init; +-static u8 vmware_hypercall_mode __ro_after_init; ++u8 vmware_hypercall_mode __ro_after_init; + + static inline int __vmware_platform(void) + { +@@ -379,6 +374,7 @@ static void __init vmware_set_capabilities(void) + { + setup_force_cpu_cap(X86_FEATURE_CONSTANT_TSC); + setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE); ++ setup_force_cpu_cap(X86_FEATURE_HYPERVISOR); + if (vmware_tsc_khz) + setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ); + if (vmware_hypercall_mode == CPUID_VMWARE_FEATURES_ECX_VMCALL) +-- +2.25.1 + diff --git a/SPECS/91/linux/0001-perf-core-add-logic-to-collect-off-cpu-sample.patch b/SPECS/linux/6.12.111/0001-perf-core-add-logic-to-collect-off-cpu-sample-6.12.111.patch similarity index 100% rename from SPECS/91/linux/0001-perf-core-add-logic-to-collect-off-cpu-sample.patch rename to SPECS/linux/6.12.111/0001-perf-core-add-logic-to-collect-off-cpu-sample-6.12.111.patch diff --git a/SPECS/91/linux/CVE/0001-CVE-2026-68441-net-sched-Handle-TC_ACT_REDIRECT-from.patch b/SPECS/linux/6.12.111/CVE/0001-CVE-2026-68441-net-sched-Handle-TC_ACT_REDIRECT-from-6.12.111.patch similarity index 100% rename from SPECS/91/linux/CVE/0001-CVE-2026-68441-net-sched-Handle-TC_ACT_REDIRECT-from.patch rename to SPECS/linux/6.12.111/CVE/0001-CVE-2026-68441-net-sched-Handle-TC_ACT_REDIRECT-from-6.12.111.patch diff --git a/SPECS/91/linux/CVE/0001-bnxt-fix-head-underflow-on-XDP-head-grow.patch b/SPECS/linux/6.12.111/CVE/0001-bnxt-fix-head-underflow-on-XDP-head-grow-6.12.111.patch similarity index 100% rename from SPECS/91/linux/CVE/0001-bnxt-fix-head-underflow-on-XDP-head-grow.patch rename to SPECS/linux/6.12.111/CVE/0001-bnxt-fix-head-underflow-on-XDP-head-grow-6.12.111.patch diff --git a/SPECS/91/linux/CVE/0001-cifs-Fix-handling-of-a-beyond-EOF-DIO-unbuffered-rea.patch b/SPECS/linux/6.12.111/CVE/0001-cifs-Fix-handling-of-a-beyond-EOF-DIO-unbuffered-rea.patch similarity index 100% rename from SPECS/91/linux/CVE/0001-cifs-Fix-handling-of-a-beyond-EOF-DIO-unbuffered-rea.patch rename to SPECS/linux/6.12.111/CVE/0001-cifs-Fix-handling-of-a-beyond-EOF-DIO-unbuffered-rea.patch diff --git a/SPECS/91/linux/CVE/0001-ipv6-use-RCU-in-ip6_output.patch b/SPECS/linux/6.12.111/CVE/0001-ipv6-use-RCU-in-ip6_output.patch similarity index 100% rename from SPECS/91/linux/CVE/0001-ipv6-use-RCU-in-ip6_output.patch rename to SPECS/linux/6.12.111/CVE/0001-ipv6-use-RCU-in-ip6_output.patch diff --git a/SPECS/91/linux/CVE/0001-net-mlx5e-RX-Fix-XDP-multi-buf-frag-c.patch b/SPECS/linux/6.12.111/CVE/0001-net-mlx5e-RX-Fix-XDP-multi-buf-frag-c-6.12.111.patch similarity index 100% rename from SPECS/91/linux/CVE/0001-net-mlx5e-RX-Fix-XDP-multi-buf-frag-c.patch rename to SPECS/linux/6.12.111/CVE/0001-net-mlx5e-RX-Fix-XDP-multi-buf-frag-c-6.12.111.patch diff --git a/SPECS/91/linux/CVE/0001-rculist-add-list_splice_rcu-for-private-lists.patch b/SPECS/linux/6.12.111/CVE/0001-rculist-add-list_splice_rcu-for-private-lists.patch similarity index 100% rename from SPECS/91/linux/CVE/0001-rculist-add-list_splice_rcu-for-private-lists.patch rename to SPECS/linux/6.12.111/CVE/0001-rculist-add-list_splice_rcu-for-private-lists.patch diff --git a/SPECS/91/linux/CVE/0001-xfrm-Fix-dev-use-after-free-in-xfrm-async-resumption.patch b/SPECS/linux/6.12.111/CVE/0001-xfrm-Fix-dev-use-after-free-in-xfrm-async-resumption.patch similarity index 100% rename from SPECS/91/linux/CVE/0001-xfrm-Fix-dev-use-after-free-in-xfrm-async-resumption.patch rename to SPECS/linux/6.12.111/CVE/0001-xfrm-Fix-dev-use-after-free-in-xfrm-async-resumption.patch diff --git a/SPECS/91/linux/CVE/0002-netfilter-nf_tables-join-hook-list-via-splice_list_r.patch b/SPECS/linux/6.12.111/CVE/0002-netfilter-nf_tables-join-hook-list-via-splice_list_r.patch similarity index 100% rename from SPECS/91/linux/CVE/0002-netfilter-nf_tables-join-hook-list-via-splice_list_r.patch rename to SPECS/linux/6.12.111/CVE/0002-netfilter-nf_tables-join-hook-list-via-splice_list_r.patch diff --git a/SPECS/91/linux/CVE/0003-netfs-Fix-potential-for-tearing-in-remote_i_size-and.patch b/SPECS/linux/6.12.111/CVE/0003-netfs-Fix-potential-for-tearing-in-remote_i_size-and-6.12.111.patch similarity index 100% rename from SPECS/91/linux/CVE/0003-netfs-Fix-potential-for-tearing-in-remote_i_size-and.patch rename to SPECS/linux/6.12.111/CVE/0003-netfs-Fix-potential-for-tearing-in-remote_i_size-and-6.12.111.patch diff --git a/SPECS/91/linux/canister_builder/patches/1004-Move-__bug_table-section-to-fips_canister_wrapper.patch b/SPECS/linux/6.12.111/canister_builder/1004-Move-__bug_table-section-to-fips_canister_wrapper-6.12.111.patch similarity index 99% rename from SPECS/91/linux/canister_builder/patches/1004-Move-__bug_table-section-to-fips_canister_wrapper.patch rename to SPECS/linux/6.12.111/canister_builder/1004-Move-__bug_table-section-to-fips_canister_wrapper-6.12.111.patch index dafa0d351f..1e323e8eba 100644 --- a/SPECS/91/linux/canister_builder/patches/1004-Move-__bug_table-section-to-fips_canister_wrapper.patch +++ b/SPECS/linux/6.12.111/canister_builder/1004-Move-__bug_table-section-to-fips_canister_wrapper-6.12.111.patch @@ -290,8 +290,8 @@ index bfde0f28c..a631b4905 100644 const unsigned int digest_size = req->dst_len; int err; -- if (WARN_ON(req->dst) || WARN_ON(!digest_size) || -+ if (fcw_warn_on(req->dst) || fcw_warn_on(!digest_size) || +- if (WARN_ON(req->dst) || !digest_size || ++ if (fcw_warn_on(req->dst) || !digest_size || !ctx->key_size || sig_size != ctx->key_size) return -EINVAL; diff --git a/SPECS/91/linux/generic/0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS.patch b/SPECS/linux/6.12.111/generic/0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS-6.12.111.patch similarity index 100% rename from SPECS/91/linux/generic/0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS.patch rename to SPECS/linux/6.12.111/generic/0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS-6.12.111.patch diff --git a/SPECS/linux/canister_builder/crypto/gen_canister_relocs.c b/SPECS/linux/canister_builder/crypto/gen_canister_relocs.c index 8f8b4095e1..8366b1ea93 100644 --- a/SPECS/linux/canister_builder/crypto/gen_canister_relocs.c +++ b/SPECS/linux/canister_builder/crypto/gen_canister_relocs.c @@ -228,6 +228,15 @@ static void process_section(Elf *elf, Elf_Scn *s, int sndx, struct symbol_entry unsigned int offset = 0; Elf64_Rela *rels; struct _relocation *r; + /* + * The output relocation names its section by ondx in an unsigned + * char; an unmeasured section has none (-1). + */ + if (section_symbols[sndx]->ondx < 0 || + section_symbols[sndx]->ondx > ONE_BYTE_UNSIGNED_MAX_VALUE) + error("Relocations in section %s with no valid index (%d)", + section_symbols[sndx]->name, section_symbols[sndx]->ondx); + data = elf_getdata(s, NULL); rels = (Elf64_Rela *)data->d_buf; n_entries = data->d_size / sizeof (Elf64_Rela); @@ -399,8 +408,19 @@ static void parse_sections(Elf *elf, size_t shstrndx, int *n_syms, size_t *strnd /* * ndx - section index in inout file. * ondx - section index in generated .c file + * + * ondx is what fips_integrity_init() uses to index its si[] + * array, and si[] is built from canister_sections[], which + * holds only the sections that have both markers. A section + * with no end marker - .bss - is not measured and therefore + * not in si[], so it must not consume an ondx. If it does, + * every section that follows it is numbered one too high and + * its reverse relocations are applied to the wrong section. */ - section_symbols[ndx]->ondx = ondx++; + if (section_symbols[ndx]->end) + section_symbols[ndx]->ondx = ondx++; + else + section_symbols[ndx]->ondx = -1; } if (!symtab) error("Unable to find .symtab section"); diff --git a/SPECS/linux/canister_builder/patches/1000-FIPS-canister-creation.patch b/SPECS/linux/canister_builder/patches/1000-FIPS-canister-creation.patch index bd146c99d7..3ab2afe23d 100644 --- a/SPECS/linux/canister_builder/patches/1000-FIPS-canister-creation.patch +++ b/SPECS/linux/canister_builder/patches/1000-FIPS-canister-creation.patch @@ -322,7 +322,7 @@ index b0dd83555..55ed01a67 100644 skcipher_walk_done(&walk, 0); return err; diff --git a/crypto/Makefile b/crypto/Makefile -index 768f24db5..b4cb9f756 100644 +index 26e9e21cb..ab3d6fff0 100644 --- a/crypto/Makefile +++ b/crypto/Makefile @@ -18,9 +18,11 @@ crypto_algapi-y := algapi.o scatterwalk.o $(crypto_algapi-y) @@ -413,7 +413,7 @@ index 768f24db5..b4cb9f756 100644 obj-$(CONFIG_CRYPTO_POLYVAL) += polyval-generic.o obj-$(CONFIG_CRYPTO_USER_API) += af_alg.o obj-$(CONFIG_CRYPTO_USER_API_HASH) += algif_hash.o -@@ -164,11 +182,14 @@ obj-$(CONFIG_CRYPTO_USER_API_SKCIPHER) += algif_skcipher.o +@@ -164,8 +182,10 @@ obj-$(CONFIG_CRYPTO_USER_API_SKCIPHER) += algif_skcipher.o obj-$(CONFIG_CRYPTO_USER_API_RNG) += algif_rng.o obj-$(CONFIG_CRYPTO_USER_API_AEAD) += algif_aead.o obj-$(CONFIG_CRYPTO_ZSTD) += zstd.o @@ -422,13 +422,17 @@ index 768f24db5..b4cb9f756 100644 obj-$(CONFIG_CRYPTO_CURVE25519) += curve25519-generic.o +canister += drbg.o + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124949 + ifeq ($(CONFIG_ARM)$(CONFIG_KASAN_STACK)$(CONFIG_CC_IS_GCC),yyy) +@@ -174,6 +194,7 @@ endif + ecdh_generic-y += ecdh.o ecdh_generic-y += ecdh_helper.o +canister += $(ecdh_generic-y) $(obj)/ecrdsa_params.asn1.o: $(obj)/ecrdsa_params.asn1.c $(obj)/ecrdsa_params.asn1.h $(obj)/ecrdsa_pub_key.asn1.o: $(obj)/ecrdsa_pub_key.asn1.c $(obj)/ecrdsa_pub_key.asn1.h -@@ -192,6 +213,97 @@ obj-$(CONFIG_CRYPTO_SIMD) += crypto_simd.o +@@ -197,6 +218,97 @@ obj-$(CONFIG_CRYPTO_SIMD) += crypto_simd.o # Key derivation function # obj-$(CONFIG_CRYPTO_KDF800108_CTR) += kdf_sp800108.o diff --git a/SPECS/linux/canister_builder/patches/1004-Move-__bug_table-section-to-fips_canister_wrapper.patch b/SPECS/linux/canister_builder/patches/1004-Move-__bug_table-section-to-fips_canister_wrapper.patch index dafa0d351f..b6ec95a8fa 100644 --- a/SPECS/linux/canister_builder/patches/1004-Move-__bug_table-section-to-fips_canister_wrapper.patch +++ b/SPECS/linux/canister_builder/patches/1004-Move-__bug_table-section-to-fips_canister_wrapper.patch @@ -204,16 +204,16 @@ index c0a8e4f66..78341ecbb 100644 } while (outlen) { -@@ -2089,14 +2089,14 @@ static inline int __init drbg_healthcheck_sanity(void) +@@ -2088,14 +2088,14 @@ static inline int __init drbg_healthcheck_sanity(void) drbg_string_fill(&addtl, buf, max_addtllen + 1); - /* overflow addtllen with additonal info string */ - len = drbg_generate(drbg, buf, OUTBUFLEN, &addtl); -- BUG_ON(0 < len); -+ fcw_bug_on(0 < len); + /* overflow addtllen with additional info string */ + ret = drbg_generate(drbg, buf, OUTBUFLEN, &addtl); +- BUG_ON(ret == 0); ++ fcw_bug_on(ret == 0); /* overflow max_bits */ - len = drbg_generate(drbg, buf, (max_request_bytes + 1), NULL); -- BUG_ON(0 < len); -+ fcw_bug_on(0 < len); + ret = drbg_generate(drbg, buf, max_request_bytes + 1, NULL); +- BUG_ON(ret == 0); ++ fcw_bug_on(ret == 0); /* overflow max addtllen with personalization string */ ret = drbg_seed(drbg, &addtl, false); @@ -290,8 +290,8 @@ index bfde0f28c..a631b4905 100644 const unsigned int digest_size = req->dst_len; int err; -- if (WARN_ON(req->dst) || WARN_ON(!digest_size) || -+ if (fcw_warn_on(req->dst) || fcw_warn_on(!digest_size) || +- if (WARN_ON(req->dst) || !digest_size || ++ if (fcw_warn_on(req->dst) || !digest_size || !ctx->key_size || sig_size != ctx->key_size) return -EINVAL; diff --git a/SPECS/linux/canister_builder/patches/1010-rsa-pkcs1pad-Add-invalid_hash_len-check-in-sign-veri.patch b/SPECS/linux/canister_builder/patches/1010-rsa-pkcs1pad-Add-invalid_hash_len-check-in-sign-veri.patch index 7ab805cffc..12032503ba 100644 --- a/SPECS/linux/canister_builder/patches/1010-rsa-pkcs1pad-Add-invalid_hash_len-check-in-sign-veri.patch +++ b/SPECS/linux/canister_builder/patches/1010-rsa-pkcs1pad-Add-invalid_hash_len-check-in-sign-veri.patch @@ -86,7 +86,7 @@ index 9cac0a06b..d9b6d7d1d 100644 const unsigned int digest_size = req->dst_len; int err; - if (fcw_warn_on(req->dst) || fcw_warn_on(!digest_size) || + if (fcw_warn_on(req->dst) || !digest_size || - !ctx->key_size || sig_size != ctx->key_size) + !ctx->key_size || sig_size != ctx->key_size || + pkcs1pad_invalid_hash_len(digest_size, digest_info)) diff --git a/SPECS/linux/canister_config.inc b/SPECS/linux/canister_config.inc new file mode 100644 index 0000000000..0b2706a7ad --- /dev/null +++ b/SPECS/linux/canister_config.inc @@ -0,0 +1,35 @@ +%dnl Shared canister/.config manipulation for the Photon kernel flavours. +%dnl +%dnl Included by both SPECS/linux/linux.spec and SPECS/linux/linux-esx.spec so +%dnl that the FIPS canister Kconfig handling cannot diverge between the two +%dnl flavours again. linux.spec had no fips=0 branch at all, so an x86_64 build +%dnl with fips set to 0 left the canister "is not set" comments of config_x86_64 +%dnl in .config; "make olddefconfig" silently drops symbols that do not exist in +%dnl the tree and the check_for_config_applicability.inc diff guard then failed. +%dnl The aarch64 configs never carried those lines. +%dnl +%dnl Expects, from the including spec: +%dnl fips 1 => build a FIPS kernel carrying the crypto canister +%dnl canister_build 1 => the canister is built from source in this build +%dnl canister_usage 1 => link against a prebuilt canister object file +%dnl (derived: !canister_build when fips=1, else 0) +%dnl +%dnl Expects .config to be in place already (cp of the flavour config Source). +%dnl +%dnl The GCC_PLUGIN_MATCH_CANISTER_STRUCTS / GCC_PLUGIN_PAD_CANISTER_STRUCTS +%dnl Kconfig symbols only exist once the fips canister plugin patches have been +%dnl applied, i.e. only when fips=1. +%if 0%{?canister_build} +sed -i "s/# CONFIG_GCC_PLUGIN_PAD_CANISTER_STRUCTS is not set/CONFIG_GCC_PLUGIN_PAD_CANISTER_STRUCTS=y/" .config +sed -i "/# CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS is not set/d" .config +%endif + +%if 0%{?canister_usage} +sed -i "s/# CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS is not set/CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS=y/" .config +%endif + +%if 0%{?fips} == 0 +# Clean up .config of FIPS related configs +sed -i "/# CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS is not set/d" .config +sed -i "/# CONFIG_GCC_PLUGIN_PAD_CANISTER_STRUCTS is not set/d" .config +%endif diff --git a/SPECS/91/linux/check_for_config_applicability.inc b/SPECS/linux/check_for_config_applicability-6.1.inc similarity index 76% rename from SPECS/91/linux/check_for_config_applicability.inc rename to SPECS/linux/check_for_config_applicability-6.1.inc index 90b84de4ce..2ead33c8f1 100644 --- a/SPECS/91/linux/check_for_config_applicability.inc +++ b/SPECS/linux/check_for_config_applicability-6.1.inc @@ -4,9 +4,5 @@ make LC_ALL= olddefconfig # Remove comment with a version string sed -i '3d' .config # Fail if any diffs -if [[ ! -f .config.old ]]; then - echo "No change" - exit 0 -fi diff -u .config.old .config diff --git a/SPECS/linux/config.yaml b/SPECS/linux/config.yaml index a0f117967c..f6a6755fc6 100644 --- a/SPECS/linux/config.yaml +++ b/SPECS/linux/config.yaml @@ -204,3 +204,314 @@ sources: short_summary: The open source linux kernel drivers for devices(ENA) used on AWS platforms. supplier: 'Organization: Broadcom, Inc.' + +- archive: linux-6.1.190.tar.xz + archive_type: upstream + version: 6.1.190 + name: linux-6.1.190 + url: https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.1.190.tar.xz + repo_url: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git + commit_id: 79807e970724c1f90cee1316361d61b80db4eef6 + skip_list: [] + missing: [] + archive_sha512sum: 'ce276b93bb2c37334d6bbb9ea6d58eb3f7b84fe79bbea8c6cc6527cc07378df4d6c7785f6b7c0178455f97f8423ba6d70a7c8b48fada05dcc8d4ae7340d25489' + skip_validation: false + license_manual_review: + # sspl/SSPL used as part of a variable name, falsely detected by scanner as a license + - file_paths: + - linux-6.1.190/drivers/pci/controller/pci-mvebu.c + sha256sum: f2ed59ce938e92a0dff71c849860cafb5a5d2a78b34e5c0aa974288d98cccfcc + spdx_exp: GPL-2.0-only + # CC-BY-SA-2.0 mentioned as license for external resource (Linux device drivers, 3rd edition) + - file_paths: + - linux-6.1.190/Documentation/process/kernel-docs.rst + sha256sum: 6e641499dcde7927e30dcdea64a6be9f53234d7036f4069ec47bdf5490005166 + spdx_exp: '' + spdx: + package: + detailed_description: The Linux package contains the Linux kernel. + home_page: http://www.kernel.org + license_concluded: (Apache-2.0 OR CC0-1.0 OR OpenSSL) AND (Apache-2.0 OR + GPL-2.0-only) AND (Apache-2.0 OR MIT) AND (Artistic-2.0 OR GPL-2.0-only) + AND (BSD-2-Clause OR GPL-2.0-only OR Linux-OpenIB) AND (BSD-2-Clause OR + GPL-2.0-only WITH Linux-syscall-note) AND (BSD-2-Clause OR GPL-2.0-only) + AND (BSD-2-Clause OR GPL-2.0-or-later) AND (BSD-2-Clause OR + GPL-2.0-or-later) AND (BSD-2-Clause OR LGPL-2.0-or-later) AND + (BSD-2-Clause OR LGPL-2.1-only) AND (BSD-3-Clause OR GPL-1.0-or-later OR + OpenSSL) AND (BSD-3-Clause OR GPL-1.0-or-later) AND (BSD-3-Clause OR + GPL-1.0-or-later) AND (BSD-3-Clause OR GPL-2.0-only WITH + Linux-syscall-note) AND (BSD-3-Clause OR GPL-2.0-only) AND (BSD-3-Clause + OR GPL-2.0-only) AND (BSD-3-Clause OR GPL-2.0-or-later WITH + Linux-syscall-note) AND (BSD-3-Clause OR GPL-2.0-or-later) AND + (BSD-3-Clause OR GPL-2.0-or-later) AND (BSD-3-Clause OR OpenSSL) AND + (BSD-3-Clause-acpica OR GPL-2.0-only) AND (CC-BY-4.0 OR + GPL-2.0-or-later) AND (CDDL-1.0 OR GPL-2.0-only WITH Linux-syscall-note) + AND (CDDL-1.0 OR GPL-2.0-only) AND (GFDL-1.1-no-invariants-only OR + GPL-2.0-only) AND (GFDL-1.1-no-invariants-or-later OR GPL-2.0-only) AND + (GFDL-1.2-no-invariants-only OR GPL-2.0-only) AND + (GFDL-1.2-no-invariants-or-later OR GPL-2.0-only) AND (GFDL-1.2-only OR + GPL-2.0-only) AND (GPL-1.0-only OR GPL-2.0-only) AND (GPL-1.0-or-later + OR MIT) AND (GPL-2.0-only OR GPL-3.0-only) AND (GPL-2.0-only OR ICU) AND + (GPL-2.0-only OR Linux-OpenIB) AND (GPL-2.0-only OR MIT) AND + (GPL-2.0-only OR MIT) AND (GPL-2.0-only OR MPL-1.1) AND (GPL-2.0-only OR + MPL-1.1) AND (GPL-2.0-only OR MPL-2.0) AND (GPL-2.0-only OR OSL-1.1) AND + (GPL-2.0-only OR X11) AND (GPL-2.0-only OR XFree86-1.1) AND + (GPL-2.0-only WITH Linux-syscall-note OR Linux-OpenIB) AND (GPL-2.0-only + WITH Linux-syscall-note OR MIT) AND (GPL-2.0-or-later OR + LGPL-3.0-or-later) AND (GPL-2.0-or-later OR MIT) AND (GPL-2.0-or-later + OR MIT) AND (GPL-2.0-or-later OR MPL-1.1) AND (GPL-2.0-or-later OR X11) + AND (GPL-2.0-or-later OR copyleft-next-0.3.1) AND (GPL-2.0-or-later WITH + Linux-syscall-note OR MIT) AND (LGPL-2.1-only OR MIT) AND Apache-2.0 AND + BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-Clear AND + BSD-3-Clause-acpica AND BSD-4-Clause-UC AND BSD-4.3TAHOE AND + BSD-Source-beginning-file AND CC-BY-3.0 AND CC-BY-4.0 AND CC-BY-SA-2.0 + AND CC0-1.0 AND CDDL-1.0 AND CMU-Mach-nodoc AND FSFUL AND + GFDL-1.1-no-invariants-only AND GFDL-1.1-no-invariants-or-later AND + GFDL-1.1-only AND GFDL-1.1-or-later AND GFDL-1.2-no-invariants-only AND + GFDL-1.2-no-invariants-or-later AND GFDL-1.2-only AND GFDL-1.2-or-later + AND GPL-1.0-only AND GPL-1.0-or-later AND GPL-1.0-or-later WITH + Linux-syscall-note AND GPL-2.0-only AND GPL-2.0-only WITH + Linux-syscall-note AND GPL-2.0-only WITH mif-exception AND + GPL-2.0-or-later AND GPL-2.0-or-later WITH GCC-exception-2.0 AND + GPL-2.0-or-later WITH Linux-syscall-note AND GPL-2.0-or-later WITH + mif-exception AND GPL-3.0-only AND GPL-3.0-or-later AND HPND-Pbmplus AND + HPND-export-US-modify AND HPND-export2-US AND HPND-sell-variant AND ISC + AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.0-or-later WITH + Linux-syscall-note AND LGPL-2.1-only AND LGPL-2.1-only WITH + Linux-syscall-note AND LGPL-2.1-or-later AND LGPL-2.1-or-later WITH + Linux-syscall-note AND Linux-OpenIB AND Linux-man-pages-copyleft AND MIT + AND MPL-1.0 AND MPL-1.1 AND MS-LPL AND NTP AND Parity-7.0.0 AND SSPL-1.0 + AND Unicode-3.0 AND Unlicense AND X11 AND Zlib AND pkgconf + license_declared: (Apache-2.0 OR CC0-1.0 OR OpenSSL) AND (Apache-2.0 OR + GPL-2.0-only) AND (Apache-2.0 OR MIT) AND (Artistic-2.0 OR GPL-2.0-only) + AND (BSD-2-Clause OR GPL-2.0-only OR Linux-OpenIB) AND (BSD-2-Clause OR + GPL-2.0-only WITH Linux-syscall-note) AND (BSD-2-Clause OR GPL-2.0-only) + AND (BSD-2-Clause OR GPL-2.0-or-later) AND (BSD-2-Clause OR + GPL-2.0-or-later) AND (BSD-2-Clause OR LGPL-2.0-or-later) AND + (BSD-2-Clause OR LGPL-2.1-only) AND (BSD-3-Clause OR GPL-1.0-or-later OR + OpenSSL) AND (BSD-3-Clause OR GPL-1.0-or-later) AND (BSD-3-Clause OR + GPL-1.0-or-later) AND (BSD-3-Clause OR GPL-2.0-only WITH + Linux-syscall-note) AND (BSD-3-Clause OR GPL-2.0-only) AND (BSD-3-Clause + OR GPL-2.0-only) AND (BSD-3-Clause OR GPL-2.0-or-later WITH + Linux-syscall-note) AND (BSD-3-Clause OR GPL-2.0-or-later) AND + (BSD-3-Clause OR GPL-2.0-or-later) AND (BSD-3-Clause OR OpenSSL) AND + (BSD-3-Clause-acpica OR GPL-2.0-only) AND (CC-BY-4.0 OR + GPL-2.0-or-later) AND (CDDL-1.0 OR GPL-2.0-only WITH Linux-syscall-note) + AND (CDDL-1.0 OR GPL-2.0-only) AND (GFDL-1.1-no-invariants-only OR + GPL-2.0-only) AND (GFDL-1.1-no-invariants-or-later OR GPL-2.0-only) AND + (GFDL-1.2-no-invariants-only OR GPL-2.0-only) AND + (GFDL-1.2-no-invariants-or-later OR GPL-2.0-only) AND (GFDL-1.2-only OR + GPL-2.0-only) AND (GPL-1.0-only OR GPL-2.0-only) AND (GPL-1.0-or-later + OR MIT) AND (GPL-2.0-only OR GPL-3.0-only) AND (GPL-2.0-only OR ICU) AND + (GPL-2.0-only OR Linux-OpenIB) AND (GPL-2.0-only OR MIT) AND + (GPL-2.0-only OR MIT) AND (GPL-2.0-only OR MPL-1.1) AND (GPL-2.0-only OR + MPL-1.1) AND (GPL-2.0-only OR MPL-2.0) AND (GPL-2.0-only OR OSL-1.1) AND + (GPL-2.0-only OR X11) AND (GPL-2.0-only OR XFree86-1.1) AND + (GPL-2.0-only WITH Linux-syscall-note OR Linux-OpenIB) AND (GPL-2.0-only + WITH Linux-syscall-note OR MIT) AND (GPL-2.0-or-later OR + LGPL-3.0-or-later) AND (GPL-2.0-or-later OR MIT) AND (GPL-2.0-or-later + OR MIT) AND (GPL-2.0-or-later OR MPL-1.1) AND (GPL-2.0-or-later OR X11) + AND (GPL-2.0-or-later OR copyleft-next-0.3.1) AND (GPL-2.0-or-later WITH + Linux-syscall-note OR MIT) AND (LGPL-2.1-only OR MIT) AND Apache-2.0 AND + BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-Clear AND + BSD-3-Clause-acpica AND BSD-4-Clause-UC AND BSD-4.3TAHOE AND + BSD-Source-beginning-file AND CC-BY-3.0 AND CC-BY-4.0 AND CC-BY-SA-2.0 + AND CC0-1.0 AND CDDL-1.0 AND CMU-Mach-nodoc AND FSFUL AND + GFDL-1.1-no-invariants-only AND GFDL-1.1-no-invariants-or-later AND + GFDL-1.1-only AND GFDL-1.1-or-later AND GFDL-1.2-no-invariants-only AND + GFDL-1.2-no-invariants-or-later AND GFDL-1.2-only AND GFDL-1.2-or-later + AND GPL-1.0-only AND GPL-1.0-or-later AND GPL-1.0-or-later WITH + Linux-syscall-note AND GPL-2.0-only AND GPL-2.0-only WITH + Linux-syscall-note AND GPL-2.0-only WITH mif-exception AND + GPL-2.0-or-later AND GPL-2.0-or-later WITH GCC-exception-2.0 AND + GPL-2.0-or-later WITH Linux-syscall-note AND GPL-2.0-or-later WITH + mif-exception AND GPL-3.0-only AND GPL-3.0-or-later AND HPND-Pbmplus AND + HPND-export-US-modify AND HPND-export2-US AND HPND-sell-variant AND ISC + AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.0-or-later WITH + Linux-syscall-note AND LGPL-2.1-only AND LGPL-2.1-only WITH + Linux-syscall-note AND LGPL-2.1-or-later AND LGPL-2.1-or-later WITH + Linux-syscall-note AND Linux-OpenIB AND Linux-man-pages-copyleft AND MIT + AND MPL-1.0 AND MPL-1.1 AND MS-LPL AND NTP AND Parity-7.0.0 AND SSPL-1.0 + AND Unicode-3.0 AND Unlicense AND X11 AND Zlib AND pkgconf + short_summary: Kernel + supplier: 'Organization: Broadcom, Inc.' +- archive: jitterentropy-3.4.1-4.tar.bz2 + archive_sha512sum: + 37a9380b14d5e56eb3a16b8e46649bc5182813aadb5ec627c31910e4cc622269dfd29359789cb4c13112182f4f8d3c084a6b9c576df06dae9689da44e4735dd2 + skip_validation: true + spdx: + package: + detailed_description: A JitterEntropy is a software-based random number + generator that derives entropy from the unpredictable fluctuations + (jitter) in a system's timing or clock signals. The RNG is based on a + high-resolution timer like the x86 RDTSC instruction. The generated + random bit stream does not show any statistical significant patterns. + The output of the random number generator passes all standard + statistical tools analyzing the quality of a random data stream. + home_page: https://github.com/vmware/photon + license_concluded: GPL-2.0-or-later + license_declared: GPL-2.0-or-later + short_summary: A JitterEntropy is a reliable, software based random number + generator that uses the randomness of CPU jitter to produce + cryptographically secure random numbers, ensuring robust security in + systems that rely on high-quality entropy for encryption and other + sensitive operations. + supplier: 'Organization: Broadcom, Inc.' +- archive: fips-canister-5.0.0-6.1.75-2.ph5-secure.tar.bz2 + archive_sha512sum: + ddbe5d163f9313209434bf5b2adf711d4b23546012ad08ad869b96c40c94e781bcd13ec1839efc95060038a1d18b2f298e6d7c10584c0335dda445ea1363473b + skip_validation: true + spdx: + package: + detailed_description: A FIPS (Federal Information Processing Standards) + canister is a binary blob of cryptographic algorithms designed to store, + manage, and protect cryptographic keys, tokens, or other sensitive data + in accordance with FIPS security standards. These canisters are + typically used in environments that require high levels of data + protection and compliance with governmental or industry-specific + security guidelines. FIPS canisters are engineered to prevent + unauthorized access, tampering, and data breaches. + home_page: https://github.com/vmware/photon + license_concluded: GPL-2.0-only AND GPL-1.0-or-later + license_declared: GPL-2.0-only AND GPL-1.0-or-later + short_summary: A FIPS canister serves as a critical component consists of + binary blob of cryptographic algorithms which helps in secure + information handling, ensuring that cryptographic operations and + sensitive data storage comply with strict security and regulatory + standards. + supplier: 'Organization: Broadcom, Inc.' +- archive: linux-6.12.111.tar.xz + archive_type: upstream + version: 6.12.111 + name: linux-6.12.111 + url: https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.12.111.tar.xz + repo_url: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git + commit_id: e2acc2211022246c77740d5df08265cc27eedcc5 + skip_list: [] + missing: [] + archive_sha512sum: + 9366fcea5bcdcd6294341da8dfbd1877ca9e2c4ae898eb86c0f1094ff881ec256908b2236c68e4d79b59492c91986ccf4f1f3818b151ce3a2721e3ce168974cf + skip_validation: false + license_manual_review: + # sspl/SSPL used as part of a variable name, falsely detected by scanner as a license + - file_paths: + - linux-6.12.111/drivers/pci/controller/pci-mvebu.c + sha256sum: c214d76c403debdf0f6151206eef31dc8e26239ba99b89bed6c83770c7840645 + spdx_exp: GPL-2.0-only + # CC-BY-SA-2.0 mentioned as license for external resource (Linux device drivers, 3rd edition) + - file_paths: + - linux-6.12.111/Documentation/process/kernel-docs.rst + sha256sum: 1a01c62a4ef537eb61f0fc47d5e7852f067af86203d7eaaf719befb102bb64b8 + spdx_exp: '' + spdx: + package: + detailed_description: The Linux package contains the Linux kernel. + home_page: http://www.kernel.org + license_concluded: (Apache-2.0 OR BSD-2-Clause) AND (Apache-2.0 OR CC0-1.0 + OR OpenSSL) AND (Apache-2.0 OR GPL-2.0-only) AND (Apache-2.0 OR MIT) AND + (Artistic-2.0 OR GPL-2.0-only) AND (BSD-2-Clause OR GPL-2.0-only OR + Linux-OpenIB) AND (BSD-2-Clause OR GPL-2.0-only WITH Linux-syscall-note) + AND (BSD-2-Clause OR GPL-2.0-only) AND (BSD-2-Clause OR + GPL-2.0-or-later) AND (BSD-2-Clause OR GPL-2.0-or-later) AND + (BSD-2-Clause OR LGPL-2.0-or-later) AND (BSD-2-Clause OR LGPL-2.1-only) + AND (BSD-3-Clause OR GPL-1.0-or-later OR OpenSSL) AND (BSD-3-Clause OR + GPL-1.0-or-later) AND (BSD-3-Clause OR GPL-1.0-or-later) AND + (BSD-3-Clause OR GPL-2.0-only WITH Linux-syscall-note) AND (BSD-3-Clause + OR GPL-2.0-only) AND (BSD-3-Clause OR GPL-2.0-only) AND (BSD-3-Clause OR + GPL-2.0-or-later WITH Linux-syscall-note) AND (BSD-3-Clause OR + GPL-2.0-or-later) AND (BSD-3-Clause OR GPL-2.0-or-later) AND + (BSD-3-Clause OR OpenSSL) AND (BSD-3-Clause-acpica OR GPL-2.0-only) AND + (CC-BY-4.0 OR GPL-2.0-or-later) AND (CDDL-1.0 OR GPL-2.0-only WITH + Linux-syscall-note) AND (CDDL-1.0 OR GPL-2.0-only) AND + (GFDL-1.1-no-invariants-only OR GPL-2.0-only) AND + (GFDL-1.1-no-invariants-or-later OR GPL-2.0-only) AND + (GFDL-1.1-no-invariants-or-later OR GPL-2.0-only) AND + (GFDL-1.2-no-invariants-only OR GPL-2.0-only) AND + (GFDL-1.2-no-invariants-or-later OR GPL-2.0-only) AND (GFDL-1.2-only OR + GPL-2.0-only) AND (GPL-1.0-only OR GPL-2.0-only) AND (GPL-1.0-or-later + OR MIT) AND (GPL-2.0-only OR GPL-3.0-only) AND (GPL-2.0-only OR + Linux-OpenIB) AND (GPL-2.0-only OR MIT) AND (GPL-2.0-only OR MIT) AND + (GPL-2.0-only OR MPL-1.1) AND (GPL-2.0-only OR MPL-1.1) AND + (GPL-2.0-only OR MPL-2.0) AND (GPL-2.0-only OR OSL-1.1) AND + (GPL-2.0-only OR X11) AND (GPL-2.0-only WITH Linux-syscall-note OR + Linux-OpenIB) AND (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND + (GPL-2.0-or-later OR LGPL-3.0-or-later) AND (GPL-2.0-or-later OR MIT) + AND (GPL-2.0-or-later OR MIT) AND (GPL-2.0-or-later OR X11) AND + (GPL-2.0-or-later OR copyleft-next-0.3.1) AND (GPL-2.0-or-later WITH + Linux-syscall-note OR MIT) AND (LGPL-2.1-only OR MIT) AND 0BSD AND + Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-Clear AND + BSD-3-Clause-acpica AND BSD-4-Clause-UC AND BSD-4.3TAHOE AND + BSD-Source-beginning-file AND CC-BY-3.0 AND CC-BY-4.0 AND CC0-1.0 AND + CDDL-1.0 AND CMU-Mach-nodoc AND FSFUL AND GFDL-1.1-no-invariants-only + AND GFDL-1.1-no-invariants-or-later AND GFDL-1.1-only AND + GFDL-1.1-or-later AND GFDL-1.2-no-invariants-only AND + GFDL-1.2-no-invariants-or-later AND GFDL-1.2-only AND GFDL-1.2-or-later + AND GPL-1.0-only AND GPL-1.0-or-later AND GPL-1.0-or-later WITH + Linux-syscall-note AND GPL-2.0-only AND GPL-2.0-only WITH + Linux-syscall-note AND GPL-2.0-only WITH mif-exception AND + GPL-2.0-or-later AND GPL-2.0-or-later WITH GCC-exception-2.0 AND + GPL-2.0-or-later WITH Linux-syscall-note AND GPL-2.0-or-later WITH + mif-exception AND GPL-3.0-only AND GPL-3.0-or-later AND HPND-Pbmplus AND + HPND-export-US-modify AND HPND-export2-US AND HPND-sell-variant AND ISC + AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.0-or-later WITH + Linux-syscall-note AND LGPL-2.1-only AND LGPL-2.1-only WITH + Linux-syscall-note AND LGPL-2.1-or-later AND LGPL-2.1-or-later WITH + Linux-syscall-note AND Linux-OpenIB AND Linux-man-pages-copyleft AND MIT + AND MPL-1.0 AND MPL-1.1 AND MS-LPL AND NTP AND NTP-0 AND OpenSSL AND + Parity-7.0.0 AND SSPL-1.0 AND Unicode-3.0 AND Unlicense AND X11 AND Zlib + AND copyleft-next-0.3.1 AND pkgconf + license_declared: (Apache-2.0 OR BSD-2-Clause) AND (Apache-2.0 OR CC0-1.0 + OR OpenSSL) AND (Apache-2.0 OR GPL-2.0-only) AND (Apache-2.0 OR MIT) AND + (Artistic-2.0 OR GPL-2.0-only) AND (BSD-2-Clause OR GPL-2.0-only OR + Linux-OpenIB) AND (BSD-2-Clause OR GPL-2.0-only WITH Linux-syscall-note) + AND (BSD-2-Clause OR GPL-2.0-only) AND (BSD-2-Clause OR + GPL-2.0-or-later) AND (BSD-2-Clause OR GPL-2.0-or-later) AND + (BSD-2-Clause OR LGPL-2.0-or-later) AND (BSD-2-Clause OR LGPL-2.1-only) + AND (BSD-3-Clause OR GPL-1.0-or-later OR OpenSSL) AND (BSD-3-Clause OR + GPL-1.0-or-later) AND (BSD-3-Clause OR GPL-1.0-or-later) AND + (BSD-3-Clause OR GPL-2.0-only WITH Linux-syscall-note) AND (BSD-3-Clause + OR GPL-2.0-only) AND (BSD-3-Clause OR GPL-2.0-only) AND (BSD-3-Clause OR + GPL-2.0-or-later WITH Linux-syscall-note) AND (BSD-3-Clause OR + GPL-2.0-or-later) AND (BSD-3-Clause OR GPL-2.0-or-later) AND + (BSD-3-Clause OR OpenSSL) AND (BSD-3-Clause-acpica OR GPL-2.0-only) AND + (CC-BY-4.0 OR GPL-2.0-or-later) AND (CDDL-1.0 OR GPL-2.0-only WITH + Linux-syscall-note) AND (CDDL-1.0 OR GPL-2.0-only) AND + (GFDL-1.1-no-invariants-only OR GPL-2.0-only) AND + (GFDL-1.1-no-invariants-or-later OR GPL-2.0-only) AND + (GFDL-1.1-no-invariants-or-later OR GPL-2.0-only) AND + (GFDL-1.2-no-invariants-only OR GPL-2.0-only) AND + (GFDL-1.2-no-invariants-or-later OR GPL-2.0-only) AND (GFDL-1.2-only OR + GPL-2.0-only) AND (GPL-1.0-only OR GPL-2.0-only) AND (GPL-1.0-or-later + OR MIT) AND (GPL-2.0-only OR GPL-3.0-only) AND (GPL-2.0-only OR + Linux-OpenIB) AND (GPL-2.0-only OR MIT) AND (GPL-2.0-only OR MIT) AND + (GPL-2.0-only OR MPL-1.1) AND (GPL-2.0-only OR MPL-1.1) AND + (GPL-2.0-only OR MPL-2.0) AND (GPL-2.0-only OR OSL-1.1) AND + (GPL-2.0-only OR X11) AND (GPL-2.0-only WITH Linux-syscall-note OR + Linux-OpenIB) AND (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND + (GPL-2.0-or-later OR LGPL-3.0-or-later) AND (GPL-2.0-or-later OR MIT) + AND (GPL-2.0-or-later OR MIT) AND (GPL-2.0-or-later OR X11) AND + (GPL-2.0-or-later OR copyleft-next-0.3.1) AND (GPL-2.0-or-later WITH + Linux-syscall-note OR MIT) AND (LGPL-2.1-only OR MIT) AND 0BSD AND + Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-Clear AND + BSD-3-Clause-acpica AND BSD-4-Clause-UC AND BSD-4.3TAHOE AND + BSD-Source-beginning-file AND CC-BY-3.0 AND CC-BY-4.0 AND CC0-1.0 AND + CDDL-1.0 AND CMU-Mach-nodoc AND FSFUL AND GFDL-1.1-no-invariants-only + AND GFDL-1.1-no-invariants-or-later AND GFDL-1.1-only AND + GFDL-1.1-or-later AND GFDL-1.2-no-invariants-only AND + GFDL-1.2-no-invariants-or-later AND GFDL-1.2-only AND GFDL-1.2-or-later + AND GPL-1.0-only AND GPL-1.0-or-later AND GPL-1.0-or-later WITH + Linux-syscall-note AND GPL-2.0-only AND GPL-2.0-only WITH + Linux-syscall-note AND GPL-2.0-only WITH mif-exception AND + GPL-2.0-or-later AND GPL-2.0-or-later WITH GCC-exception-2.0 AND + GPL-2.0-or-later WITH Linux-syscall-note AND GPL-2.0-or-later WITH + mif-exception AND GPL-3.0-only AND GPL-3.0-or-later AND HPND-Pbmplus AND + HPND-export-US-modify AND HPND-export2-US AND HPND-sell-variant AND ISC + AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.0-or-later WITH + Linux-syscall-note AND LGPL-2.1-only AND LGPL-2.1-only WITH + Linux-syscall-note AND LGPL-2.1-or-later AND LGPL-2.1-or-later WITH + Linux-syscall-note AND Linux-OpenIB AND Linux-man-pages-copyleft AND MIT + AND MPL-1.0 AND MPL-1.1 AND MS-LPL AND NTP AND NTP-0 AND OpenSSL AND + Parity-7.0.0 AND SSPL-1.0 AND Unicode-3.0 AND Unlicense AND X11 AND Zlib + AND copyleft-next-0.3.1 AND pkgconf + short_summary: Kernel + supplier: 'Organization: Broadcom, Inc.' diff --git a/SPECS/linux/kernel_cve_patches-6.1.inc b/SPECS/linux/kernel_cve_patches-6.1.inc new file mode 100644 index 0000000000..b06ca4dc59 --- /dev/null +++ b/SPECS/linux/kernel_cve_patches-6.1.inc @@ -0,0 +1,252 @@ +# CVE patches shared across all Linux kernel flavours +# Patch range reserved: 3000–3999 +# DO NOT add non-CVE patches to this file. + +# Fix CVE-2017-1000252 +Patch3000: KVM-Don-t-accept-obviously-wrong-gsi-values-via-KVM_.patch + +# Fix CVE-2023-0597 +Patch3001: 0001-x86-mm-Randomize-per-cpu-entry-area.patch +Patch3002: 0002-x86-mm-Do-not-shuffle-CPU-entry-areas-without-KASLR.patch + +# Fix CVE-2024-38557 +Patch3003: 0003-net-mlx5-Reload-only-IB-representors-upon-lag-disabl.patch + +# Fix CVE-2024-56729 +Patch3004: 0004-smb-Initialize-cfid-tcon-before-performing-network-o.patch + +# Fix CVE-2023-39191 [3005..3023] +Patch3005: 0001-bpf-Refactor-ARG_PTR_TO_DYNPTR-checks-into-process_d.patch +Patch3006: 0002-bpf-Rework-process_dynptr_func.patch +Patch3007: 0003-bpf-Rename-RET_PTR_TO_ALLOC_MEM.patch +Patch3008: 0004-bpf-Rework-check_func_arg_reg_off.patch +Patch3009: 0005-bpf-Use-memmove-for-bpf_dynptr_-read-write.patch +Patch3010: 0006-bpf-Propagate-errors-from-process_-checks-in-check_f.patch +Patch3011: 0007-bpf-Move-PTR_TO_STACK-alignment-check-to-process_dyn.patch +Patch3012: 0008-bpf-Fix-state-pruning-for-STACK_DYNPTR-stack-slots.patch +Patch3013: 0009-bpf-Fix-missing-var_off-check-for-ARG_PTR_TO_DYNPTR.patch +Patch3014: 0010-bpf-Fix-partial-dynptr-stack-slot-reads-writes.patch +Patch3015: 0011-bpf-Invalidate-slices-on-destruction-of-dynptrs-on-s.patch +Patch3016: 0012-bpf-Allow-reinitializing-unreferenced-dynptr-stack-s.patch +Patch3017: 0013-bpf-Combine-dynptr_get_spi-and-is_spi_bounds_valid.patch +Patch3018: 0014-selftests-bpf-convenience-macro-for-use-with-asm-vol.patch +Patch3019: 0015-selftests-bpf-Add-test-for-dynptr-reinit-in-user_rin.patch +Patch3020: 0016-selftests-bpf-Add-dynptr-pruning-tests.patch +Patch3021: 0017-selftests-bpf-Add-dynptr-var_off-tests.patch +Patch3022: 0018-selftests-bpf-Add-dynptr-partial-slot-overwrite-test.patch +Patch3023: 0019-selftests-bpf-Add-dynptr-helper-tests.patch + +# Fix CVE-2023-52452 +Patch3024: 0001-bpf-Fix-accesses-to-uninit-stack-slots.patch + +# Fix CVE-2024-46813 +Patch3025: 0001-drm-amd-display-Check-link_index-before-accessing-dc.patch + +# Fix CVE-2024-41045 +Patch3028: 0001-bpf-Defer-work-in-bpf_timer_cancel_and_free.patch + +# Fix CVE-2024-46811 +Patch3029: 0001-drm-amd-display-Fix-index-may-exceed-array-range-wit.patch + +# Fix CVE-2024-35949 +Patch3030: 0001-btrfs-make-sure-that-WRITTEN-is-set-on-all-metadata-.patch + +# Fix CVE-2024-46834 +Patch3031: 0001-ethtool-Fail-number-of-channels-change-when-it-confl.patch +Patch3032: 0002-ethtool-fail-closed-if-we-can-t-get-max-channel-used.patch + +# Fix CVE-2024-56611 +Patch3033: 0001-mm-mempolicy-fix-migrate_to_node-assuming-there-is-a.patch + +# Fix CVE-2024-38564 +Patch3034: 0001-bpf-Add-attach_type-checks-under-bpf_prog_attach_che.patch +Patch3035: 0002-bpf-Add-BPF_PROG_TYPE_CGROUP_SKB-attach-type-enforce.patch + +# Fix CVE-2025-38636 +Patch3036: 0001-rv-Use-strings-in-da-monitors-tracepoints.patch + +# Fix CVE-2024-50018 +Patch3037: 0001-net-napi-Prevent-overflow-of-napi_defer_hard_irqs.patch + +# Fix CVE-2025-21714 +Patch3039: 0001-RDMA-mlx5-Fix-implicit-ODP-use-after-free.patch +Patch3040: 0001-RDMA-mlx5-Fix-implicit-ODP-hang-on-parent-deregistra.patch + +# Fix CVE-2024-53179 +Patch3041: 0001-smb-client-fix-use-after-free-of-signing-key.patch + +# Fix CVE-2024-53168 +Patch3042: 0001-sunrpc-fix-one-UAF-issue-caused-by-sunrpc-kernel-tcp.patch + +# Fix CVE-2024-27042 +Patch3044: 0001-drm-amdgpu-Fix-potential-out-of-bounds-access-in-amd.patch + +# Fix CVE-2024-26669 +Patch3045: 0001-net-sched-flower-Fix-chain-template-offload.patch + +# Fix CVE-2024-57982 +Patch3046: 0001-xfrm-state-fix-out-of-bounds-read-during-lookup.patch + +# Fix CVE-2023-52653 +Patch3047: 0001-SUNRPC-fix-a-memleak-in-gss_import_v2_context.patch + +# Fix CVE-2024-26661 +Patch3048: 0001-drm-amd-display-Add-NULL-test-for-timing-generator-i.patch + +# Fix CVE-2024-26662 +Patch3049: 0001-drm-amd-display-Fix-panel_cntl-could-be-null-in-dcn2.patch + +# Fix CVE-2024-26944 +Patch3050: 0001-btrfs-zoned-fix-use-after-free-in-do_zone_finish.patch + +# Fix CVE-2024-57795 +Patch3051: 0001-RDMA-rxe-Remove-the-direct-link-to-net_device.patch +Patch3052: 0001-RDMA-rxe-Fix-the-failure-of-ibv_query_device-and-ibv.patch + +# Fix CVE-2025-39705 +Patch3053: 0001-drm-amd-display-fix-a-Null-pointer-dereference-vulne.patch + +# Fix CVE-2025-38705 +Patch3054: 0001-drm-amd-pm-fix-null-pointer-access.patch + +# Fix CVE-2024-49922 +Patch3055: 0001-drm-amd-display-Check-null-pointers-before-using-the.patch + +# Fix CVE-2024-49988 +Patch3057: 0002-ksmbd-fix-use-after-free-in-SMB-request-handling.patch + +# Fix CVE-2025-38039 +Patch3058: 0001-net-mlx5e-Avoid-WARN_ON-when-configuring-MQPRIO-with.patch + +# Fix CVE-2025-38064 +Patch3059: 0001-virtio-break-and-reset-virtio-devices-on-device_shut.patch + +# Fix CVE-2025-38045 +Patch3060: 0001-wifi-iwlwifi-fix-debug-actions-order.patch + +# Fix CVE-2025-39990 +Patch3061: 0001-bpf-Check-the-helper-function-is-valid-in-get_helper.patch + +# Fix CVE-2025-37750 +Patch3062: 0001-smb-client-fix-UAF-in-decryption-with-multichannel.patch + +# Fix CVE-2025-2312 +Patch3063: 0001-CIFS-New-mount-option-for-cifs.upcall-namespace-reso.patch + +# Fix CVE-2025-39744 +Patch3064: 0001-rcu-Fix-rcu_read_unlock-deadloop-due-to-IRQ-work.patch +Patch3065: 0002-rcu-Fix-racy-re-initialization-of-irq_work-causing-h.patch + +# Fix CVE-2025-38248 +Patch3066: 0001-bridge-mcast-fix-use-after-free-during-router-port-configuration.patch + +# Fix CVE-2025-39797 +Patch3067: 0001-xfrm-Duplicate-SPI-Handling.patch +Patch3068: 0001-xfrm-xfrm_alloc_spi-shouldn-t-use-0-as-SPI.patch + +# Fix CVE-2025-39810 +Patch3070: 0001-bnxt_en-Fix-possible-crash-after-creating-sw-mqprio-.patch +Patch3071: 0002-bnxt_en-Fix-memory-corruption-when-FW-resources-chan.patch + +# CVE-2024-53177 +Patch3072: 0001-smb-client-prevent-new-fids-from-being-removed-by-la.patch +Patch3073: 0002-smb-client-fix-use-after-free-in-smb2_query_info_com.patch +Patch3074: 0003-smb-Don-t-leak-cfid-when-reconnect-races-with-open_c.patch +Patch3075: 0004-smb-prevent-use-after-free-due-to-open_cached_dir-er.patch + +Patch3077: 0002-ceph-fix-multifs-mds-auth-caps-issue.patch + +# CVE-2025-39905 +Patch3078: 0001-net-phylink-add-lock-for-serializing-concurrent-pl-p.patch + +# CVE-2024-53095 +Patch3079: 0001-smb-client-Fix-use-after-free-of-network-namespace.patch + +# CVE-2025-68188 +Patch3080: 0001-tcp-use-dst_dev_rcu-in-tcp_fastopen_active_disable_o.patch + +# CVE-2025-68379 +Patch3081: 0001-RDMA-rxe-Fix-null-deref-on-srq-rq.queue-after-resize.patch + +# CVE-2025-40328 +Patch3082: 0001-smb-client-fix-potential-UAF-in-smb2_close_cached_fi.patch + +# CVE-2025-68219 +Patch3083: 0001-cifs-fix-memory-leak-in-smb3_fs_context_parse_param-.patch + +# CVE-2025-71068 +Patch3084: 0001-svcrdma-bound-check-rq_pages-index-in-inline-path.patch + +# Fix CVE-2025-68353 +Patch3085: 0001-net-vxlan-prevent-NULL-deref-in-vxlan_xmit_one-6.1.patch + +# Fix CVE-2024-25742 and CVE-2024-25743 +Patch3088: 0001-x86-sev-Harden-VC-instruction-emulation-somewhat.patch + +# Fix CVE-2025-71184 +Patch3089: 0001-btrfs-fix-NULL-dereference-on-root-when-tracing-inod.patch + +# Fix CVE-2024-53068 +Patch3090: 0001-firmware-arm_scmi-Fix-slab-use-after-free-in-scmi_bu.patch + +# Fix CVE-2025-38081 +Patch3091: 0001-spi-rockchip-Fix-register-out-of-bounds-access.patch + +# CVE-2026-23171 +Patch3092: 0001-bonding-fix-use-after-free-due-to-enslave-fail-after-slave-array-update.patch + +# Fix CVE-2026-31648 +Patch3094: 0001-mm-filemap-fix-nr_pages-calculation-overflow-in-file.patch + +# Prerequisite for CVE-2026-31663 +Patch3095: 0001-xfrm-hold-device-only-for-asynchronous-decryption.patch + +# Fix CVE-2026-31663 +Patch3096: 0001-xfrm-hold-dev-ref-until-after-transport_finish-NF_HO.patch + +# Fixes Patch3048 (CVE-2024-26661) and Patch3049 (CVE-2024-26662) +Patch3097: 0001-drm-amd-display-Fix-vs-typos.patch + +# Fix CVE-2026-43414 +Patch3098: 0001-scsi-qla2xxx-Completely-fix-fcport-double-free.patch + +# Fix CVE-2026-31527 +Patch3103: 0001-driver-core-generalize-driver_override-in-struct-dev.patch +Patch3104: 0001-driver-core-platform-use-generic-driver_override-inf.patch + +# Fix CVE-2026-31516 +Patch3105: 0001-xfrm-prevent-policy_hthresh.work-from-racing-with-ne.patch + +# Fix CVE-2026-43239 +Patch3106: 0001-smb-client-prevent-races-in-query_interfaces.patch + +# Fix CVE-2026-43215 +Patch3107: 0001-cifs-Fix-locking-usage-for-tcon-fields.patch + +# Fix CVE-2026-43125 +Patch3108: 0001-dlm-validate-length-in-dlm_search_rsb_tree.patch + +# Fix CVE-2026-43249 +Patch3111: 0001-9p-xen-protect-xen_9pfs_front_free-against-concurren.patch + +# Fix CVE-2026-31505 +Patch3113: 0001-iavf-fix-out-of-bounds-writes-in-iavf_get_ethtool_st.patch +# Fix CVE-2026-31502 +Patch3114: 0001-team-fix-header_ops-type-confusion-with-non-Ethernet.patch + +# Fix CVE-2026-31557 +Patch3115: 0001-nvmet-move-async-event-work-off-nvmet-wq.patch + +# Fix CVE-2026-23383 +Patch3116: 0001-bpf-arm64-Force-8-byte-alignment-for-JIT-buffer.patch + +# Fix CVE-2026-3118 +Patch3118: 0001-net-ioam6-fix-OOB-and-missing-lock-6.1.patch + +# Fix CVE-2026-43456 +Patch3119: 0001-bonding-fix-type-confusion-in-bond_setup_by_slave.patch + +# Fix CVE-2026-31675 +Patch3121: 0001-net-sched-sch_netem-fix-out-of-bounds-access-in-pack.patch +Patch3122: 0002-net-sched-netem-handle-multi-segment-skb-in-corrupti.patch + diff --git a/SPECS/linux/kernel_cve_patches.inc b/SPECS/linux/kernel_cve_patches.inc index 31d3bc9255..9ca52a171e 100644 --- a/SPECS/linux/kernel_cve_patches.inc +++ b/SPECS/linux/kernel_cve_patches.inc @@ -15,7 +15,11 @@ Patch3002: 0001-btrfs-fix-double-free-of-qgroup-record-after-failure.patch Patch3004: 0002-ipv6-ioam-fix-potential-NULL-dereferences-in-__ioam6.patch # Fixes CVE-2026-31589, CVE-2026-43414, CVE-2026-43465, CVE-2026-53224, CVE-2026-53246, CVE-2026-53260 Patch3005: 0001-mm-call-free_folio-directly-in-folio_.patch +%if 0%{?photon_subrelease} == 91 +Patch3006: 0001-net-mlx5e-RX-Fix-XDP-multi-buf-frag-c-6.12.111.patch +%else Patch3006: 0001-net-mlx5e-RX-Fix-XDP-multi-buf-frag-c.patch +%endif Patch3007: 0001-scsi-qla2xxx-Completely-fix-fcport-do.patch Patch3008: 0001-sctp-validate-cached-peer-INIT-chunk-length-in-COOKI.patch Patch3010: 0002-sctp-validate-embedded-INIT-chunk-and.patch @@ -28,11 +32,18 @@ Patch3018: 0001-nouveau-gsp-drop-WARN_ON-in-ACPI-probes.patch Patch3019: 0002-ALSA-usb-audio-Use-the-right-limit-for-PCM-OOB-check.patch # Fixes CVE-2025-40158, CVE-2025-68745, CVE-2026-63872, CVE-2026-64076, CVE-2026-64077 Patch3020: 0001-esp-fix-page-frag-reference-leak-on-skb_to_sgvec-failure.patch +%if 0%{?photon_subrelease} == 91 +Patch3021: 0001-ipv6-use-RCU-in-ip6_output.patch +%endif Patch3022: 0001-netfilter-bridge-eb_tables-close-module-init-race.patch Patch3023: 0001-netfilter-ebtables-move-to-two-stage-removal-scheme.patch Patch3024: 0001-scsi-qla2xxx-Clear-cmds-after-chip-reset.patch # Fixes CVE-2026-52988, CVE-2026-52991, CVE-2026-53089, CVE-2026-53091 Patch3026: 0001-cgroup-psi-Set-of-priv-to-NULL-upon-file-release.patch +%if 0%{?photon_subrelease} == 91 +Patch3027: 0001-rculist-add-list_splice_rcu-for-private-lists.patch +Patch3028: 0002-netfilter-nf_tables-join-hook-list-via-splice_list_r.patch +%endif Patch3029: 0002-sched-psi-fix-race-between-file-release-and-pressure.patch Patch3030: 0001-net_sched-make-room-for-struct-qdisc_skb_cb-pkt_segs.patch Patch3031: 0002-net-init-shinfo-gso_segs-from-qdisc_pkt_len_init.patch @@ -55,11 +66,24 @@ Patch3046: 0001-netfs-Fix-barriering-when-walking-subrequest-list.patch # Fixes CVE-2026-72413, CVE-2026-72423 Patch3047: 0001-bpf-Guard-conntrack-opts-error-writes.patch # Fixes CVE-2026-72366, CVE-2026-72463, CVE-2026-72493, CVE-2026-74268, CVE-2026-74269 +%if 0%{?photon_subrelease} == 91 +Patch3049: 0001-bnxt-fix-head-underflow-on-XDP-head-grow-6.12.111.patch +%else Patch3049: 0001-bnxt-fix-head-underflow-on-XDP-head-grow.patch +%endif Patch3050: 0001-net-serialize-netif_running-check-in-enqueue_to_backlog.patch Patch3051: 0001-netfs-Fix-netfs_create_write_req-to-handle-async-cac.patch +%if 0%{?photon_subrelease} == 91 +Patch3053: 0001-xfrm-Fix-dev-use-after-free-in-xfrm-async-resumption.patch +# Fixes CVE-2026-64160 +Patch3054: 0001-cifs-Fix-handling-of-a-beyond-EOF-DIO-unbuffered-rea.patch +%endif Patch3055: 0002-filemap-Add-folio_next_pos.patch +%if 0%{?photon_subrelease} == 91 +Patch3056: 0003-netfs-Fix-potential-for-tearing-in-remote_i_size-and-6.12.111.patch +%else Patch3056: 0003-netfs-Fix-potential-for-tearing-in-remote_i_size-and.patch +%endif Patch3057: 0004-cifs-Fix-undefined-variables.patch # Fixes CVE-2026-63853, CVE-2026-63879, CVE-2026-64036, CVE-2026-64058, CVE-2026-64078 Patch3058: 0001-cgroup-rstat-validate-cpu-before-css_rstat_cpu-acce.patch @@ -74,7 +98,11 @@ Patch3065: 0001-fbdev-bound-mode-sysfs-output-to-the-sysfs-buffer.patch Patch3066: 0001-CVE-2026-68399-bpf-Fix-UAF-in-sock-clone-early-bailo.patch Patch3067: 0001-CVE-2026-68404-wifi-cfg80211-use-wiphy-work-for-sock.patch Patch3068: 0001-CVE-2026-68409-wifi-mac80211-defer-link-RX-stats-per.patch +%if 0%{?photon_subrelease} == 91 +Patch3069: 0001-CVE-2026-68441-net-sched-Handle-TC_ACT_REDIRECT-from-6.12.111.patch +%else Patch3069: 0001-CVE-2026-68441-net-sched-Handle-TC_ACT_REDIRECT-from.patch +%endif Patch3070: 0001-CVE-2026-68447-drm-amdkfd-clamp-v9-CRIU-control-stac.patch # Fixes CVE-2026-74605, CVE-2026-74611 Patch3071: 0001-eventfs-Use-children-field-for-rcu-head-and-add-memo.patch @@ -98,6 +126,7 @@ Patch3084: 0001-xfrm-fix-stale-skb-prev-after-async-crypto-steals-a-.patch Patch3085: 0001-RDMA-rxe-Fix-iova-to-va-conversion-for-MR-page-sizes.patch Patch3086: 0001-drm-amdkfd-Check-bounds-on-CRIU-restore-queue-type-a.patch Patch3087: 0001-drm-i915-gt-Fix-NULL-deref-on-sched_engine-alloc-fai.patch +%if 0%{?photon_subrelease} >= 92 # Fixes CVE-2026-74752 Patch3088: 0001-sctp-validate-cookie-AUTH-state-before-use.patch # Fixes CVE-2026-90104 @@ -112,3 +141,4 @@ Patch3093: 0001-netfilter-nf_tables-avoid-false-positive-lockdep-flowtables.patc Patch3094: 0002-netfilter-nf_tables-avoid-false-positive-lockdep-basechain.patch Patch3095: 0003-netfilter-nf_tables-use-list_del_rcu-for-netlink-hoo.patch Patch3096: 0004-netfilter-nf_tables-add-hook-transactions-for-device.patch +%endif diff --git a/SPECS/linux/license-6.1.txt b/SPECS/linux/license-6.1.txt new file mode 100644 index 0000000000..1f3f50852d --- /dev/null +++ b/SPECS/linux/license-6.1.txt @@ -0,0 +1 @@ +License: (Apache-2.0 OR CC0-1.0 OR OpenSSL) AND (Apache-2.0 OR GPL-2.0-only) AND (Apache-2.0 OR MIT) AND (Artistic-2.0 OR GPL-2.0-only) AND (BSD-2-Clause OR GPL-2.0-only OR Linux-OpenIB) AND (BSD-2-Clause OR GPL-2.0-only WITH Linux-syscall-note) AND (BSD-2-Clause OR GPL-2.0-only) AND (BSD-2-Clause OR GPL-2.0-or-later) AND (BSD-2-Clause OR LGPL-2.0-or-later) AND (BSD-2-Clause OR LGPL-2.1-only) AND (BSD-3-Clause OR GPL-1.0-or-later OR OpenSSL) AND (BSD-3-Clause OR GPL-1.0-or-later) AND (BSD-3-Clause OR GPL-2.0-only WITH Linux-syscall-note) AND (BSD-3-Clause OR GPL-2.0-only) AND (BSD-3-Clause OR GPL-2.0-or-later WITH Linux-syscall-note) AND (BSD-3-Clause OR GPL-2.0-or-later) AND (BSD-3-Clause OR OpenSSL) AND (BSD-3-Clause-acpica OR GPL-2.0-only) AND (CC-BY-4.0 OR GPL-2.0-or-later) AND (CDDL-1.0 OR GPL-2.0-only WITH Linux-syscall-note) AND (CDDL-1.0 OR GPL-2.0-only) AND (GFDL-1.1-no-invariants-only OR GPL-2.0-only) AND (GFDL-1.1-no-invariants-or-later OR GPL-2.0-only) AND (GFDL-1.2-no-invariants-only OR GPL-2.0-only) AND (GFDL-1.2-no-invariants-or-later OR GPL-2.0-only) AND (GFDL-1.2-only OR GPL-2.0-only) AND (GPL-1.0-only OR GPL-2.0-only) AND (GPL-1.0-or-later OR MIT) AND (GPL-2.0-only OR GPL-3.0-only) AND (GPL-2.0-only OR ICU) AND (GPL-2.0-only OR Linux-OpenIB) AND (GPL-2.0-only OR MIT) AND (GPL-2.0-only OR MPL-1.1) AND (GPL-2.0-only OR MPL-2.0) AND (GPL-2.0-only OR OSL-1.1) AND (GPL-2.0-only OR X11) AND (GPL-2.0-only OR XFree86-1.1) AND (GPL-2.0-only WITH Linux-syscall-note OR Linux-OpenIB) AND (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (GPL-2.0-or-later OR LGPL-3.0-or-later) AND (GPL-2.0-or-later OR MIT) AND (GPL-2.0-or-later OR MPL-1.1) AND (GPL-2.0-or-later OR X11) AND (GPL-2.0-or-later OR copyleft-next-0.3.1) AND (GPL-2.0-or-later WITH Linux-syscall-note OR MIT) AND (LGPL-2.1-only OR MIT) AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-Clear AND BSD-3-Clause-acpica AND BSD-4-Clause-UC AND BSD-4.3TAHOE AND BSD-Source-Code AND BSD-Source-beginning-file AND CC-BY-3.0 AND CC-BY-4.0 AND CC0-1.0 AND CDDL-1.0 AND CMU-Mach-nodoc AND FSFUL AND GFDL-1.1-no-invariants-only AND GFDL-1.1-no-invariants-or-later AND GFDL-1.1-only AND GFDL-1.1-or-later AND GFDL-1.2-no-invariants-only AND GFDL-1.2-no-invariants-or-later AND GFDL-1.2-only AND GFDL-1.2-or-later AND GFDL-1.3-no-invariants-only AND GPL-1.0-only AND GPL-1.0-or-later AND GPL-1.0-or-later WITH Linux-syscall-note AND GPL-2.0-only AND GPL-2.0-only WITH Linux-syscall-note AND GPL-2.0-only WITH mif-exception AND GPL-2.0-or-later AND GPL-2.0-or-later WITH GCC-exception-2.0 AND GPL-2.0-or-later WITH Linux-syscall-note AND GPL-2.0-or-later WITH mif-exception AND GPL-3.0-only AND GPL-3.0-or-later AND GPL-3.0-or-later WITH Bison-exception-2.2 AND HPND-Pbmplus AND HPND-export-US-modify AND HPND-export2-US AND HPND-sell-variant AND ISC AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.0-or-later WITH Linux-syscall-note AND LGPL-2.1-only AND LGPL-2.1-only WITH Linux-syscall-note AND LGPL-2.1-or-later AND LGPL-2.1-or-later WITH Linux-syscall-note AND Linux-OpenIB AND Linux-man-pages-copyleft AND MIT AND MPL-1.0 AND MPL-1.1 AND MS-LPL AND NTP AND OpenSSL AND Parity-7.0.0 AND Unicode-3.0 AND Unlicense AND X11 AND Zlib AND pkgconf diff --git a/SPECS/90/linux/linux.spec b/SPECS/linux/linux-6.1-changelog.inc similarity index 68% rename from SPECS/90/linux/linux.spec rename to SPECS/linux/linux-6.1-changelog.inc index 09e6c55035..88885c2146 100644 --- a/SPECS/90/linux/linux.spec +++ b/SPECS/linux/linux-6.1-changelog.inc @@ -1,1000 +1,6 @@ -# If 'security_hardening none' is removed, -# ensure kpatch-build in kpatch is updated accordingly. -%global security_hardening none -%global __cmake_in_source_build 0 -%global lkcm_version 5.0.0 - -# Skip this spec if subrelease is 91 or more -%global build_if %{photon_subrelease} <= 90 - -# SBAT generation of "linux.photon" component -%define linux_photon_generation 1 - -# Do not add unique suffix to *.ko.debug files -# If _unique_debug_names defined, then __debug_install_post expands -# *.ko to *.ko--..debug. -# Undefining this option keeps filenames simple: *.ko.debug. -# This is what crash utility is looking for. -%undefine _unique_debug_names - -# __debug_install_post extracts debug-info from modules. We need to -# specify option for any customizations. -%define _find_debuginfo_opts --keep-section '.BTF' - -%ifarch x86_64 -%define arch x86_64 -%define archdir x86 - -# Set this flag to 0 to build without canister -%global fips 1 -%endif - -# Disable canister_build always -%if 0%{?canister_build} -%global canister_build 0 -%endif - -%if 0%{?acvp_build} -%global fips 1 -%if 0%{?canister_build} -%global fips 0 -%endif -%endif - -%ifarch aarch64 -%define arch arm64 -%define archdir arm64 -%global fips 0 -%endif - -Summary: Kernel -Name: linux -Version: 6.1.190 -Release: 1%{?acvp_build:.acvp}%{?kat_build:.kat}%{?dist} -URL: http://www.kernel.org/ -Group: System Environment/Kernel -Vendor: VMware, Inc. -Distribution: Photon - -%define uname_r %{version}-%{release} -%define _modulesdir /lib/modules/%{uname_r} - -Source0: http://www.kernel.org/pub/linux/kernel/v6.x/linux-%{version}.tar.xz - -Source1: config_%{_arch} -Source2: initramfs.trigger - -%define ena_version 2.17.0 -Source3: https://github.com/amzn/amzn-drivers/archive/refs/tags/ena_linux_%{ena_version}.tar.gz - -%define efa_version 3.1.0 -Source4: https://github.com/amzn/amzn-drivers/archive/refs/tags/efa_linux_%{efa_version}.tar.gz - -# contains pre, postun, filetriggerun tasks -Source6: scriptlets.inc -Source7: check_for_config_applicability.inc - -%if 0%{?fips} -%define struct_comparator struct-comparator -%define struct_comp_dir struct-comp-dir -Source9: struct-comparator.c - -%define fips_canister_version 5.0.0-6.1.75-2%{?dist}-secure -Source16: fips-canister-%{fips_canister_version}.tar.bz2 -%endif - -Source18: spec_install_post.inc -Source19: %{name}-dracut-%{_arch}.conf -Source20: photon_sb2020.pem -Source21: photon_km_2025.pem - -%ifarch x86_64 -# Secure Boot -Source25: linux-sbat.csv.in - -%define jent_major_version 3.4.1 -%define jent_ph_version 4 -Source32: jitterentropy-%{jent_major_version}-%{jent_ph_version}.tar.bz2 -Source33: jitterentropy_canister_wrapper.c -Source34: jitterentropy_canister_wrapper.h -Source35: jitterentropy_canister_wrapper_asm.S - -Source36: fips_canister_wrapper.c -Source37: fips_canister_wrapper.h -Source38: fips_canister_wrapper_asm.S -Source39: fips_canister_wrapper_common.h -# fips_canister_wrapper_internal{.c,.h} is the latest released -# wrapper files. These files may differ between 2 canister versions. -# During canister binary update, rename -# %%{fips_canister_version}-fips_canister_wrapper_internal{.c,.h} -# files to fips_canister_wrapper_internal{.c,.h} -%if 0%{?fips} -Source40: fips_canister_wrapper_internal.h -Source41: fips_canister_wrapper_internal.c -%endif - -%if 0%{?canister_build} -Source43: fips_canister_wrapper_internal.h -Source44: fips_canister_wrapper_internal.c -Source45: fips_integrity.c -Source46: fips_integrity.h -Source47: update_canister_hmac.sh -Source48: canister_combine.lds -Source49: gen_canister_relocs.c -Source50: check_kernel_struct_in_canister.inc -%endif - -Source51: jitterentropy_rng_proxy.c -%endif - -Source52: license.txt -%include %{SOURCE52} - -%if 0%{?fips} -# known vmlinux struct definitions -%define vmlinux_definition_loc canister_known_struct_def_vmlinux -Source75: crypto_alg.txt -Source76: crypto_template.txt -Source77: skcipher_walk.txt -Source78: swait_queue_head.txt -Source79: x86_cpu_id.txt -%endif - -%if 0%{?acvp_build} -Source53: config_x86_64_acvp -Source54: check_for_acvp_config_applicability.inc -%endif - -Source100: Makefile.viomem -Source101: viomem.c -Source102: kernel_cve_patches.inc - -# common [0..49] -Patch0: confdata-format-change-for-split-script.patch -Patch1: net-Double-tcp_mem-limits.patch -Patch2: SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch -Patch3: 6.0-9p-transport-for-9p.patch -Patch4: 9p-trans_fd-extend-port-variable-to-u32.patch -Patch5: vsock-delay-detach-of-QP-with-outgoing-data-59.patch -# RDRAND-based RNG driver to enhance the kernel's entropy pool: -Patch6: 6.0-0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch -Patch7: 0001-cgroup-v1-cgroup_stat-support.patch -Patch8: 6.0-Discard-.note.gnu.property-sections-in-generic-NOTES.patch - -# Expose Photon kernel macros to identify kernel flavor and version -Patch9: 0001-kbuild-Makefile-Introduce-macros-to-distinguish-Phot.patch -Patch10: 0002-linux-Makefile-Add-kernel-flavor-info-to-the-generat.patch - -#HyperV patches -Patch12: vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch - -# TODO: Is CONFIG_HYPERV_VSOCKETS the same? -#Patchx: 0014-hv_sock-introduce-Hyper-V-Sockets.patch -Patch13: 6.1-0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS.patch -# Out-of-tree patches from AppArmor: -Patch14: 6.0-0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch -Patch15: 6.0-0002-apparmor-af_unix-mediation.patch - -Patch16: Performance-over-security-model.patch -# Disable md5 algorithm for sctp if fips is enabled. -Patch18: 6.0-0001-disable-md5-algorithm-for-sctp-if-fips-is-enabled.patch - -# VMware-specific patch to enable turbostat to work on ESXi -Patch19: 0001-tools-power-turbostat-Skip-some-CPUID-checks-if-runn.patch - -# Allow PCI resets to be disabled from vfio_pci_core module -Patch21: 6.1-0001-drivers-vfio-pci-Add-kernel-parameter-to-allow-disab.patch -# Add PCI quirk to allow multiple devices under the same virtual PCI bridge -# to be put into separate IOMMU groups on ESXi. -Patch22: 0001-Add-PCI-quirk-for-VMware-PCIe-Root-Port.patch - -Patch25: 0001-vmgenid-expose-vmgenid-via-sysfs.patch - -# glibc-2.43 build error fixes -Patch26: 0001-libbpf-Fix-Wdiscarded-qualifiers-under-C23.patch - -%ifarch x86_64 -Patch49: 0001-x86-pti-Fix-kernel-warnings-for-pti-and-nopti-cmdlin.patch -%endif - -# VMW: [50..59] -%ifarch x86_64 -Patch55: 6.0-x86-vmware-Use-Efficient-and-Correct-ALTERNATIVEs-fo.patch -Patch56: 6.0-x86-vmware-Log-kmsg-dump-on-panic.patch -Patch57: 6.0-x86-vmware-Fix-steal-time-clock-under-SEV.patch - -# Secure Boot and Kernel Lockdown -Patch58: 0001-kernel-lockdown-when-UEFI-secure-boot-enabled.patch -Patch59: 0002-Add-.sbat-section.patch -Patch60: 0003-Verify-SBAT-on-kexec.patch -%endif - -#Secure: -Patch61: gcc-rap-plugin-with-kcfi.patch -Patch62: 0004-Fix-PAX-function-pointer-overwritten-for-tasklet-cal.patch -Patch63: fix-warn-definition.patch - -Patch100: 6.0-0003-apparmor-fix-use-after-free-in-sk_peer_label.patch - -# Fix BPF JIT memory (bpf_jit_limit) leak: seccomp filters held by -# unreaped zombies were not released until release_task(); release -# them at task exit instead. Upstream commit bfafe5efa975 (v6.11). -Patch101: seccomp-release-task-filters-when-the-task-exits.patch - -# CVE patches — see kernel_cve_patches.inc (range 3000–3999) -%include %{SOURCE102} - -# perf: off-cpu sample [221..223] -Patch221: 0001-perf-core-add-logic-to-collect-off-cpu-sample.patch -Patch222: 0002-perf-record-add-options-to-off-cpu.patch -Patch223: 0003-perf-display-off-cpu-samples.patch - -%ifarch aarch64 -# aarch specific patches [250..269] -# Rpi of_configfs patches -Patch250: 0001-OF-DT-Overlay-configfs-interface.patch -Patch251: 0002-of-configfs-Use-of_overlay_fdt_apply-API-call.patch -Patch252: 0003-of-overlay-Correct-symbol-path-fixups.patch -# arm64 hypervisor detection and kmsg dumper -Patch253: 6.0-0001-x86-hyper-generalize-hypervisor-type-detection.patch -Patch254: 6.0-0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch -Patch255: 6.0-0003-arm64-VMware-hypervisor-detection.patch -Patch256: 6.0-0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch -Patch257: 6.0-0005-scsi-vmw_pvscsi-add-arm64-support.patch -Patch258: 6.0-0006-vmxnet3-build-only-for-x86-and-arm64.patch -Patch259: 6.0-0005-vmw_balloon-add-arm64-support.patch -Patch260: 6.0-0001-vmw_vmci-arm64-support-memory-ordering.patch -%endif - -%ifarch x86_64 -# AWS: [300..339] -Patch301: 6.0-0001-scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch -Patch302: 6.0-0007-xen-manage-keep-track-of-the-on-going-suspend-mode.patch -Patch303: 6.0-0008-xen-manage-introduce-helper-function-to-know-the-on-.patch -Patch304: 6.0-0009-xenbus-add-freeze-thaw-restore-callbacks-support.patch -Patch305: 6.0-0010-x86-xen-Introduce-new-function-to-map-HYPERVISOR_sha.patch -Patch306: 6.0-0011-x86-xen-add-system-core-suspend-and-resume-callbacks.patch -Patch307: 6.0-0012-xen-blkfront-add-callbacks-for-PM-suspend-and-hibern.patch -Patch308: 6.0-0013-xen-netfront-add-callbacks-for-PM-suspend-and-hibern.patch -Patch309: 6.0-0014-xen-time-introduce-xen_-save-restore-_steal_clock.patch -Patch310: 6.0-0015-x86-xen-save-and-restore-steal-clock.patch -Patch311: 6.0-0016-xen-events-add-xen_shutdown_pirqs-helper-function.patch -Patch312: 6.0-0017-x86-xen-close-event-channels-for-PIRQs-in-system-cor.patch -Patch313: 6.0-0018-PM-hibernate-update-the-resume-offset-on-SNAPSHOT_SE.patch -Patch314: 6.0-0020-xen-blkfront-Fixed-blkfront_restore-to-remove-a-call.patch -Patch315: 6.0-0021-x86-tsc-avoid-system-instability-in-hibernation.patch -Patch316: 6.0-0022-block-xen-blkfront-consider-new-dom0-features-on-res.patch -Patch317: 6.0-0023-xen-restore-pirqs-on-resume-from-hibernation.patch -Patch318: 6.0-0024-xen-Only-restore-the-ACPI-SCI-interrupt-in-xen_resto.patch -Patch319: 6.0-0026-xen-netfront-call-netif_device_attach-on-resume.patch -Patch320: 6.0-0054-xen-Restore-xen-pirqs-on-resume-from-hibernation.patch -Patch321: 6.0-0055-block-xen-blkfront-bump-the-maximum-number-of-indire.patch -Patch322: 6.0-0185-Introduce-page-touching-DMA-ops-binding.patch -Patch323: 6.0-0444-drivers-base-memory-use-MHP_MEMMAP_ON_MEMORY-from-th.patch -Patch324: 6.0-0490-Correct-read-overflow-in-page-touching-DMA-ops-bindi.patch -%endif - -# Crypto: [500..529] -# Patch to invoke crypto self-tests and add missing test vectors to testmgr -Patch500: 0002-FIPS-crypto-self-tests.patch -# Patch to call drbg and dh crypto tests from tcrypt -Patch501: tcrypt-disable-tests-that-are-not-enabled-in-photon.patch -Patch502: 0001-Initialize-jitterentropy-before-ecdh.patch -# Patch to remove urandom usage in rng module -Patch503: 0001-FIPS-crypto-rng-Jitterentropy-RNG-as-the-only-RND-source.patch -# Patch to remove urandom usage in drbg and ecc modules -Patch504: 0003-FIPS-crypto-drbg-Jitterentropy-RNG-as-the-only-RND.patch - -%ifarch x86_64 -Patch505: 0001-changes-to-build-with-jitterentropy-v3.4.1.patch -Patch506: 0001-compile-jitterentropy-rng-proxy.patch -Patch507: 0001-change-jitterentropy_rng-driver-name.patch -%endif - -%if 0%{?fips} -# FIPS canister usage patch -Patch508: 0001-FIPS-canister-binary-usage.patch -Patch509: 0001-scripts-kallsyms-Extra-kallsyms-parsing.patch -Patch510: 0001-LKCM-5.0-binary-patching-to-fix-struct-aesni_cpu_id-.patch -Patch511: 0001-canister-Change-spinlock_t-lock-to-void-reserved.patch -# commit e470d42 (crypto: api - Add crypto_tfm_get) introduced an api -# which adds a new member in struct crypto_tfm, causing build issues -# with fips canister, since, crypto_tfm_get() api is not being used -# in v6.1.x so reverting upstream commit. -Patch512: 0001-Revert-crypto-api-Add-crypto_tfm_get.patch -%endif - -%if 0%{?acvp_build:1} -#ACVP test harness patches. -#Need to be applied on top of FIPS canister usage patch to avoid HUNK failure -Patch513: 0001-crypto-AF_ALG-add-sign-verify-API.patch -Patch514: 0002-crypto-AF_ALG-add-setpubkey-setsockopt-call.patch -Patch515: 0003-crypto-AF_ALG-add-asymmetric-cipher.patch -Patch516: 0004-crypto-AF_ALG-add-DH-keygen-ssgen-API.patch -Patch517: 0005-crypto-AF_ALG-add-DH-param-ECDH-curve-setsockopt.patch -Patch518: 0006-crypto-AF_ALG-eliminate-code-duplication.patch -Patch519: 0007-crypto-AF_ALG-add-KPP-support.patch -Patch520: 0008-crypto-AF_ALG-add-ECC-support.patch -Patch521: 0009-kernels-net-Export-sock_getsockopt.patch -Patch522: 0010-DRBG-Fix-issues-with-DRBG.patch -Patch523: 0011-Added-jitterentropy-implementation-of-SHA3-256.patch -Patch524: 0012-jitterentropy-Support-for-sample-collection.patch -%if 0%{?kat_build:1} -Patch525: 0013-crypto-api-return-status-prints-for-LKCM5-demo.patch -%endif -%endif - -%ifarch x86_64 -# SEV on VMware: [600..609] -Patch600: 0079-x86-sev-es-Disable-BIOS-ACPI-RSDP-probing-if-SEV-ES-.patch -Patch601: 0080-x86-boot-Enable-vmw-serial-port-via-Super-I-O.patch -Patch602: 0001-x86-boot-unconditional-preserve-CR4.MCE.patch -# TODO: Review: Patch602: 0081-x86-sev-es-Disable-use-of-WP-via-PAT-for-__sme_early.patch - -# SEV-SNP: -Patch605: 0001-sev-snp-parse-MP-tables.patch -%endif - -#HCX-Patches -Patch701: 0001-Active-probing-of-dst-mac-of-unknown-unicast.patch -Patch702: 0002-Skip-IP_ECN_decapsulate-for-gretap-devices.patch -Patch703: 0003-Handle-ipsec-in-ipip-more-correctly.patch -Patch704: 0004-De-cap-fou-traffic-into-correct-tunnel-device-s.patch -Patch705: 0005-Add-unknown-fou-tracking-to-kernel.patch -Patch706: 0006-Add-initial-support-for-vxlan-trunk-to-cgw-kernel-wi.patch -Patch707: 0007-Changes-for-bridge-vlan-arp-filtering-to-work-right.patch -Patch708: 0008-Add-support-for-mac-flapping-and-long-mac-flapping-p.patch -Patch709: 0009-vmxnet3-Avoid-fragmentation-by-giving-each-vmxnet3-d.patch -Patch710: 0010-RPS-flow-balance.patch -Patch711: 0011-add-mss-clamp-support-to-gretap-baseimage.patch -Patch712: 0012-set-max_mtu-as-IP_MAX_MTU.patch -Patch713: 0013-set-max_mtu-as-IP_MAX_MTU_for_vlan.patch -Patch714: 0014-iptunnel-mark-xfrm-multi-parts.patch -Patch715: 0015-disable-pskb_inet_may_pull-in-tunnel.patch -Patch716: 0016-gre_tap-interface-mss_clamp-support.patch -Patch717: 0017-rps_cpus-skip-receive-packets-queuing-to-only-housek.patch -# RCU callbacks invocation max batch limit control for HCX usecase -Patch718: 0001-rcutree-Adding-rcu_max_blimit-rcutree-param.patch -Patch719: 0018-Introduce-xfrm_dst-cache-mechanism-to-reuse-xfrm_dst.patch - -# Report guest crash to vmware hypervisor -%ifarch aarch64 -Patch1000: 0001-arm64-report-guest-crash-to-vmware-hypervisor.patch -%endif - -%ifarch x86_64 -Patch1000: 0001-x86-vmware-mark-hypercalls-as-volatile.patch -Patch1001: 0002-x86-report-guest-crash-to-vmware-hypervisor.patch -%endif - -# Patches for efa [1400..1409] -Patch1400: Fix-efa-cmake-to-build-from-local-directory.patch - -%if 0%{?canister_build} -# Below patches are common for fips and canister_build flags -# 0001-FIPS-canister-binary-usage.patch is renamed as -0001-FIPS-canister-binary-usage.patch -# in both places until final canister binary is released -Patch10000: 0001-FIPS-canister-binary-usage.patch -Patch10001: 0001-scripts-kallsyms-Extra-kallsyms-parsing.patch -# Below patches are specific to canister_build flag -Patch10003: 0002-FIPS-canister-creation.patch -Patch10004: 0003-aesni_intel-Remove-static-call.patch -Patch10005: 0004-Disable-retpoline_sites-and-return_sites-section-in-.patch -Patch10006: 0005-Move-__bug_table-section-to-fips_canister_wrapper.patch -Patch10007: 0006-crypto-Add-prandom-module_kthread_exit-to-canister-w.patch -Patch10008: 0007-crypto-Remove-EXPORT_SYMBOL-EXPORT_SYMBOL_GPL-from-c.patch -Patch10009: 0008-Move-kernel-structures-usage.patch -Patch10010: 0009-ecc-Add-pairwise-consistency-test-for-every-generate.patch -Patch10011: 0001-List-canister-objs-in-a-file.patch -# Patch for RSA FIPS 186-5 compliance -Patch10012: 0001-crypto-rsa-allow-only-odd-e-and-restrict-value-in-FI.patch -Patch10013: 0001-Handle-approved-and-non-approved-services.patch - -%if 0%{?kat_build} -Patch10014: 0001-Crypto-Tamper-KAT-PCT-and-Integrity-Test.patch -%endif -%endif - -%if 0%{?photon_subrelease} >= 91 -BuildRequires: mpc-devel -%endif - -BuildRequires: bc -BuildRequires: kmod-devel -BuildRequires: glib-devel -BuildRequires: elfutils-devel -BuildRequires: openssl-devel -BuildRequires: procps-ng-devel -BuildRequires: audit-devel -BuildRequires: elfutils-libelf-devel -BuildRequires: binutils-devel -BuildRequires: xz-devel -BuildRequires: slang-devel -BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: cmake -BuildRequires: bison -BuildRequires: flex -BuildRequires: perl -BuildRequires: dwarves-devel -BuildRequires: which -BuildRequires: gmp-devel -BuildRequires: mpfr-devel - -%ifarch x86_64 -BuildRequires: pciutils-devel -BuildRequires: libcap-devel -# Requirements for signing artifacts -%if "%{?signing_script}" != "" -%define network_required 1 -BuildRequires: ca-certificates-pki -BuildRequires: python3-requests -%endif -%endif - -%if 0%{?fips} -BuildRequires: gdb -%endif - -Requires: kmod -Requires: filesystem -Requires(pre): (coreutils or coreutils-selinux) -Requires(preun): (coreutils or coreutils-selinux) -Requires(post): (coreutils or coreutils-selinux) -Requires(postun): (coreutils or coreutils-selinux) - -Obsoletes: linux-aws -Obsoletes: linux-secure -Provides: linux-secure - -%description -The Linux package contains the Linux kernel. -# Enable post FIPS certification -%if 0 -This kernel is FIPS certified. -%endif - -%package devel -Summary: Kernel Dev -Group: System Environment/Kernel -Requires: %{name} = %{version}-%{release} -Requires: python3 -Requires: gawk -%description devel -The Linux package contains the Linux kernel dev files - -%package drivers-gpu -Summary: Kernel GPU Drivers -Group: System Environment/Kernel -Requires: %{name} = %{version}-%{release} -%description drivers-gpu -The Linux package contains the Linux kernel drivers for GPU - -%package drivers-sound -Summary: Kernel Sound modules -Group: System Environment/Kernel -Requires: %{name} = %{version}-%{release} -%description drivers-sound -The Linux package contains the Linux kernel sound support - -%package docs -Summary: Kernel docs -Group: System Environment/Kernel -Requires: python3 -Requires: %{name} = %{version}-%{release} -%description docs -The Linux package contains the Linux kernel doc files - -%if 0%{?canister_build} -%package fips-canister -Summary: FIPS canister tarball -Group: System Environment/Kernel -Requires: python3 -Requires: %{name} = %{version}-%{release} -%description fips-canister -The kernel fips-canister -%endif - -%package tools -Summary: Linux kernel userspace tools including perf, turbostat, cpupower and bpftool -Requires: audit -Requires: elfutils-libelf -Requires: binutils-libs -Requires: xz-libs -Requires: slang -Requires: python3 -Requires: traceevent-plugins -%ifarch x86_64 -Requires: pciutils -%endif -Requires: linux-python3-perf = %{version}-%{release} -Requires: bpftool = %{version}-%{release} - -%description tools -Linux kernel userspace tools including perf, turbostat, cpupower and bpftool. - -%package python3-perf -Summary: Python bindings for perf -Requires: %{name}-tools = %{version}-%{release} -Requires: python3 - -%description python3-perf -Python bindings for perf events. - -%package -n bpftool -Summary: eBPF inspection tool -Requires: %{name}-tools = %{version}-%{release} - -%description -n bpftool -bpftool for inspecting and manipulating eBPF programs and maps. - -%prep -# Using autosetup is not feasible -%setup -q -n linux-%{version} -# Using autosetup is not feasible -%setup -q -T -D -b 3 -n linux-%{version} -# Using autosetup is not feasible -%setup -q -T -D -b 4 -n linux-%{version} - -%if 0%{?fips} -# Using autosetup is not feasible -%setup -q -T -D -b 16 -n linux-%{version} -%endif - -%ifarch x86_64 -# Using autosetup is not feasible -%setup -q -T -D -b 32 -n linux-%{version} -%endif - -# Apply CVE patches first -%autopatch -p1 -m3000 -M3999 - -# common -%autopatch -p1 -m0 -M49 - -# apparmor -%autopatch -p1 -m100 -M100 - -# seccomp -%autopatch -p1 -m101 -M101 - -%ifarch x86_64 -# VMW x86 -%autopatch -p1 -m50 -M60 -%endif - -#Secure -%autopatch -p1 -m61 -M63 - -%ifarch aarch64 -# aarch64 patches -%autopatch -p1 -m250 -M260 -%endif - -%ifarch x86_64 -# AWS x86 -%autopatch -p1 -m300 -M339 -%endif - -# crypto -%autopatch -p1 -m500 -M504 - -%ifarch x86_64 -%autopatch -p1 -m505 -M507 -%endif - -%if 0%{?fips} -%autopatch -p1 -m508 -M512 -%endif - -%if 0%{?acvp_build:1} -#ACVP test harness patches. -#Need to be applied on top of FIPS canister usage patch to avoid HUNK failure -%autopatch -p1 -m513 -M524 -%if 0%{?kat_build:1} -%autopatch -p1 -m525 -M525 -%endif -%endif - -%ifarch x86_64 -# SEV on VMware -%autopatch -p1 -m600 -M609 -%endif - -#HCX-Patches -%autopatch -p1 -m701 -M719 - -# Report guest crash to vmware hypervisor -%autopatch -p1 -m1000 -M1001 - -# perf: off-cpu sample -%autopatch -p1 -m221 -M223 - -# Patches for efa driver -pushd ../amzn-drivers-efa_linux_%{efa_version} -%autopatch -p1 -m1400 -M1409 -popd - -%if 0%{?canister_build} -%autopatch -p1 -m10000 -M10013 - -%if 0%{?kat_build} -%autopatch -p1 -m10014 -M10014 -%endif -%endif - -%ifarch x86_64 -cp -r ../jitterentropy-%{jent_major_version}-%{jent_ph_version}/ \ - crypto/jitterentropy-%{jent_major_version}/ -cp %{SOURCE33} crypto/jitterentropy-%{jent_major_version}/ -cp %{SOURCE34} crypto/jitterentropy-%{jent_major_version}/ -cp %{SOURCE35} crypto/jitterentropy-%{jent_major_version}/ -%endif - -%make_build mrproper -cp %{SOURCE1} .config - -cat %{SOURCE20} %{SOURCE21} > photon-cert-bundle.pem -%ifarch x86_64 -%if 0%{?fips} -cp %{SOURCE36} \ - %{SOURCE37} \ - %{SOURCE38} \ - %{SOURCE39} \ - %{SOURCE40} \ - %{SOURCE41} \ - %{SOURCE51} \ - crypto/ - -cp ../fips-canister-%{fips_canister_version}/fips_canister.o \ - ../fips-canister-%{fips_canister_version}/.fips_canister.o.cmd \ - ../fips-canister-%{fips_canister_version}/fips_canister-kallsyms \ - crypto/ - -mkdir -p %{struct_comp_dir}/%{vmlinux_definition_loc} -cp %{SOURCE9} %{struct_comp_dir} -cp %{SOURCE75} \ - %{SOURCE76} \ - %{SOURCE77} \ - %{SOURCE78} \ - %{SOURCE79} \ - %{struct_comp_dir}/%{vmlinux_definition_loc} -%endif - -%if 0%{?canister_build} -cp %{SOURCE38} \ - %{SOURCE39} \ - %{SOURCE43} \ - %{SOURCE44} \ - %{SOURCE45} \ - %{SOURCE46} \ - %{SOURCE48} \ - %{SOURCE49} \ - crypto/ -install -m 755 %{SOURCE47} crypto/ -%endif -%endif - -sed -i 's/CONFIG_LOCALVERSION=""/CONFIG_LOCALVERSION="-%{release}"/' .config - -%if 0%{?canister_build} -sed -i "0,/FIPS_CANISTER_VERSION.*$/s/FIPS_CANISTER_VERSION.*$/FIPS_CANISTER_VERSION \"%{lkcm_version}\"/" crypto/fips_integrity.c -sed -i "0,/FIPS_KERNEL_VERSION.*$/s/FIPS_KERNEL_VERSION.*$/FIPS_KERNEL_VERSION \"%{version}-%{release}\"/" crypto/fips_integrity.c - -%if 0%{?kat_build} -sed -i '/CONFIG_CRYPTO_SELF_TEST=y/a CONFIG_CRYPTO_TAMPER_TEST=y' .config -%endif -%endif - -%ifarch x86_64 -sed -e "s,@@NAME@@,%{name},g" \ - -e "s,@@VERSION_RELEASE@@,%{version}-%{release},g" \ - -e "s,@@LINUX_PH_GEN@@,%{linux_photon_generation},g" \ - %{SOURCE25} > linux-sbat.csv -%endif - -%if 0%{?acvp_build} -cp %{SOURCE53} .config_acvp -%include %{SOURCE54} -%else -%include %{SOURCE7} -%endif - -# Set/add CONFIG_CROSS_COMPILE= if needed -if [ %{_host} != %{_build} ]; then -grep -q CONFIG_CROSS_COMPILE= .config && sed -i '/^CONFIG_CROSS_COMPILE=/c\CONFIG_CROSS_COMPILE="%{_host}-"' .config || \ - echo 'CONFIG_CROSS_COMPILE="%{_host}-"' >> .config -fi - -%build -%make_build \ - KBUILD_BUILD_VERSION="1-photon" \ - KBUILD_BUILD_HOST="photon" \ - ARCH=%{arch} - -bldroot="${PWD}" - -%if 0%{?fips} -# compare struct definitions between fips canister and vmlinux -# fails out if there is a mismatch, and the offending definition -# has not been documented in %{vmlinux_definition_loc} -pushd %{struct_comp_dir} -gcc -Wall -Werror -o %{struct_comparator} %{SOURCE9} -ldwarves -./%{struct_comparator} \ - ${bldroot}/crypto/fips_canister.o ${bldroot}/vmlinux %{vmlinux_definition_loc} -popd - -rm -rf %{struct_comp_dir} -%endif - -# build ENA module -pushd ../amzn-drivers-ena_linux_%{ena_version}/kernel/linux/ena -cp configure.sh ena-conf.sh -./ena-conf.sh --kernel-dir "${bldroot}" -%make_build -C ${bldroot} M="${PWD}" V=1 modules -popd - -# build EFA module -pushd ../amzn-drivers-efa_linux_%{efa_version}/kernel/linux/efa -mkdir -p build -cd build -%cmake -DKERNEL_DIR=${bldroot} .. -%cmake_build -popd - -%ifarch x86_64 -# build viomem module -mkdir ../viomem -pushd ../viomem -cp %{SOURCE100} Makefile -cp %{SOURCE101} . -cd ../viomem -%make_build -C ${bldroot} M="${PWD}" V=1 modules -popd -%endif - -%if 0%{?canister_build} -%include %{SOURCE50} -%endif - -%ifarch aarch64 -ARCH_FLAGS="EXTRA_CFLAGS=-Wno-error=format-overflow" -%endif -ARCH_FLAGS="${ARCH_FLAGS} EXTRA_CFLAGS=-Wno-error=deprecated-declarations" - -%make_build ARCH=%{arch} -C tools perf PYTHON=python3 $ARCH_FLAGS - -tools/perf/perf -vv | grep libunwind | grep OFF -tools/perf/perf -vv | grep dwarf | grep on - -%ifarch x86_64 -%make_build ARCH=%{arch} -C tools turbostat cpupower PYTHON=python3 -%endif - -%make_build install -C tools/bpf/bpftool prefix=%{_prefix} - -%install -%if 0%{?canister_build} -install -vdm 755 %{buildroot}%{_libdir}/fips-canister/ -pushd crypto/ -mkdir fips-canister-%{lkcm_version}-%{version}-%{release} -cp fips_canister.o \ - fips_canister-kallsyms \ - .fips_canister.o.cmd \ - fips-canister-%{lkcm_version}-%{version}-%{release}/ -tar -cvjf fips-canister-%{lkcm_version}-%{version}-%{release}.tar.bz2 fips-canister-%{lkcm_version}-%{version}-%{release}/ -popd -cp crypto/fips-canister-%{lkcm_version}-%{version}-%{release}.tar.bz2 %{buildroot}%{_libdir}/fips-canister/ -%endif -install -vdm 755 %{buildroot}%{_sysconfdir} -install -vdm 755 %{buildroot}/boot -install -vdm 755 %{buildroot}%{_docdir}/linux-%{uname_r} -install -vdm 755 %{buildroot}%{_usrsrc}/linux-headers-%{uname_r} -install -vdm 755 %{buildroot}%{_libdir}/debug/%{_modulesdir} -%make_build ARCH=%{arch} INSTALL_MOD_PATH=%{buildroot} modules_install - -# install ENA module -bldroot="${PWD}" -pushd ../amzn-drivers-ena_linux_%{ena_version}/kernel/linux/ena -%make_build -C ${bldroot} M="${PWD}" INSTALL_MOD_PATH=%{buildroot} modules_install -popd - -# install EFA module -bldroot="${PWD}" -pushd ../amzn-drivers-efa_linux_%{efa_version}/kernel/linux/efa/build/src -%make_build -C ${bldroot} M="${PWD}" INSTALL_MOD_PATH=%{buildroot} modules_install -popd - -%ifarch x86_64 -# install viomem module -pushd ../viomem -%make_build -C ${bldroot} M="${PWD}" INSTALL_MOD_PATH=%{buildroot} modules_install -popd -%endif - -%ifarch x86_64 -# Verify for build-id match -# We observe different IDs sometimes -# TODO: debug it -ID1=$(readelf -n vmlinux | grep "Build ID") -./scripts/extract-vmlinux arch/x86/boot/bzImage > extracted-vmlinux -ID2=$(readelf -n extracted-vmlinux | grep "Build ID") -if [ "$ID1" != "$ID2" ] ; then - echo "Build IDs do not match" - echo $ID1 - echo $ID2 - exit 1 -fi - -install -vm 644 arch/x86/boot/bzImage %{buildroot}/boot/vmlinuz-%{uname_r} -%if "%{?signing_script}" != "" -%{signing_script} --file_type pe \ - --config_file %{signing_params} \ - --auth_file %{signing_auth} \ - --artifact %{buildroot}/boot/vmlinuz-%{uname_r} -%endif -%endif - -%ifarch aarch64 -install -vm 644 arch/arm64/boot/Image %{buildroot}/boot/vmlinuz-%{uname_r} -%endif - -# Restrict the permission on System.map-X file -install -vm 400 System.map %{buildroot}/boot/System.map-%{uname_r} -install -vm 644 .config %{buildroot}/boot/config-%{uname_r} -cp -r Documentation/* %{buildroot}%{_docdir}/linux-%{uname_r} - -%if 0%{?__debug_package} -install -vm 644 vmlinux %{buildroot}%{_libdir}/debug/%{_modulesdir}/vmlinux-%{uname_r} -# `perf test vmlinux` needs it -ln -s vmlinux-%{uname_r} %{buildroot}%{_libdir}/debug/%{_modulesdir}/vmlinux -%endif - -cat > %{buildroot}/boot/linux-%{uname_r}.cfg << "EOF" -# GRUB Environment Block -photon_cmdline=init=/lib/systemd/systemd ro loglevel=3 quiet loadpin.enabled=0 audit=1 slab_nomerge -photon_linux=vmlinuz-%{uname_r} -photon_initrd=initrd.img-%{uname_r} -EOF - -# Register myself to initramfs -mkdir -p %{buildroot}%{_localstatedir}/lib/initramfs/kernel - -# Cleanup dangling symlinks -rm -rf %{buildroot}%{_modulesdir}/source \ - %{buildroot}%{_modulesdir}/build - -find . -name Makefile* -o -name Kconfig* -o -name *.pl | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy -find arch/%{archdir}/include include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy -find $(find arch/%{archdir} -name include -o -name scripts -type d) -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy -find arch/%{archdir}/include Module.symvers include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy -%ifarch x86_64 -# CONFIG_STACK_VALIDATION=y requires objtool to build external modules -install -vsm 755 tools/objtool/objtool %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}/tools/objtool/ -install -vsm 755 tools/objtool/fixdep %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}/tools/objtool/ -%endif - -cp .config %{buildroot}%{_usrsrc}/linux-headers-%{uname_r} # copy .config manually to be where it's expected to be -ln -sf "%{_usrsrc}/linux-headers-%{uname_r}" "%{buildroot}%{_modulesdir}/build" -find %{buildroot}/lib/modules -name '*.ko' -print0 | xargs -0 chmod u+x - -mkdir -p %{buildroot}%{_modulesdir}/dracut.conf.d/ -cp -p %{SOURCE19} %{buildroot}%{_modulesdir}/dracut.conf.d/%{name}.conf - -%ifarch aarch64 -ARCH_FLAGS="EXTRA_CFLAGS=-Wno-error=format-overflow" -%endif -ARCH_FLAGS="${ARCH_FLAGS} EXTRA_CFLAGS=-Wno-error=deprecated-declarations" - -%make_build -C tools ARCH=%{arch} DESTDIR=%{buildroot} \ - prefix=%{_prefix} perf_install PYTHON=python3 $ARCH_FLAGS - -%make_build -C tools/perf ARCH=%{arch} DESTDIR=%{buildroot} \ - prefix=%{_prefix} PYTHON=python3 install-python_ext - -%ifarch x86_64 -%make_build -C tools ARCH=%{arch} DESTDIR=%{buildroot} \ - prefix=%{_prefix} mandir=%{_mandir} turbostat_install cpupower_install PYTHON=python3 -%endif - -%make_build install -C tools/bpf/bpftool \ - prefix=%{_prefix} DESTDIR=%{buildroot} - -%include %{SOURCE2} -%include %{SOURCE6} -%include %{SOURCE18} - -%post -/sbin/depmod -a %{uname_r} -ln -sf linux-%{uname_r}.cfg /boot/photon.cfg - -%post drivers-gpu -/sbin/depmod -a %{uname_r} - -%post drivers-sound -/sbin/depmod -a %{uname_r} - -%files -%defattr(-,root,root) -/boot/System.map-%{uname_r} -/boot/config-%{uname_r} -/boot/vmlinuz-%{uname_r} -%config(noreplace) /boot/linux-%{uname_r}.cfg -%defattr(0644,root,root) -%{_modulesdir}/* -%exclude %{_modulesdir}/build -%exclude %{_modulesdir}/kernel/drivers/gpu -%exclude %{_modulesdir}/kernel/sound -%ifarch aarch64 -%exclude %{_modulesdir}/kernel/drivers/staging/vc04_services/bcm2835-audio -%endif - -%config(noreplace) %{_modulesdir}/dracut.conf.d/%{name}.conf - -%files docs -%defattr(-,root,root) -%{_docdir}/linux-%{uname_r}/* - -%files devel -%defattr(-,root,root) -%{_modulesdir}/build -%{_usrsrc}/linux-headers-%{uname_r} - -%files drivers-gpu -%defattr(-,root,root) -%{_modulesdir}/kernel/drivers/gpu - -%files drivers-sound -%defattr(-,root,root) -%{_modulesdir}/kernel/sound -%ifarch aarch64 -%{_modulesdir}/kernel/drivers/staging/vc04_services/bcm2835-audio -%endif - -%if 0%{?canister_build} -%files fips-canister -%defattr(-,root,root) -%{_libdir}/fips-canister/* -%endif - -%files tools -%defattr(-,root,root) -%ifarch x86_64 -%exclude %{_lib64}/traceevent -%endif -%ifarch aarch64 -%exclude %{_libdir}/traceevent -%endif -%{_bindir}/* -%{_sysconfdir}/bash_completion.d/perf -%{_libexecdir}/perf-core -%{_datadir}/perf-core -%{_docdir}/perf-tip -%{_libdir}/perf/examples/bpf/* -%{_libdir}/perf/include/bpf/* -%{_includedir}/perf/* -%ifarch x86_64 -%{_mandir}/* -%{_includedir}/cpufreq.h -%{_includedir}/cpuidle.h -%{_lib64dir}/libcpupower.so* -%{_docdir}/packages/cpupower -%{_datadir}/bash-completion/completions/cpupower -%config(noreplace) %{_sysconfdir}/cpufreq-bench.conf -%{_sbindir}/cpufreq-bench -%{_datadir}/locale/*/LC_MESSAGES/cpupower.mo -%endif - -%files python3-perf -%defattr(-,root,root) -%{python3_sitelib}/* - -%files -n bpftool -%defattr(-,root,root) -%{_sbindir}/bpftool -%{_datadir}/bash-completion/completions/bpftool - %changelog +* Wed Oct 21 2026 Daniel Casota 6.1.190-2 +- Refuse acvp_build and kat_build on architectures other than x86_64 * Mon Oct 19 2026 Gerrit Photon 6.1.190-1 - Update to version 6.1.190 * Wed Oct 07 2026 Shivani Agarwal 6.1.189-1 diff --git a/SPECS/linux/linux-6.1-packages.inc b/SPECS/linux/linux-6.1-packages.inc new file mode 100644 index 0000000000..2d4e43c6d8 --- /dev/null +++ b/SPECS/linux/linux-6.1-packages.inc @@ -0,0 +1,33 @@ +%package tools +Summary: Linux kernel userspace tools including perf, turbostat, cpupower and bpftool +Requires: audit +Requires: elfutils-libelf +Requires: binutils-libs +Requires: xz-libs +Requires: slang +Requires: python3 +Requires: traceevent-plugins +%ifarch x86_64 +Requires: pciutils +%endif +Requires: linux-python3-perf = %{version}-%{release} +Requires: bpftool = %{version}-%{release} + +%description tools +Linux kernel userspace tools including perf, turbostat, cpupower and bpftool. + +%package python3-perf +Summary: Python bindings for perf +Requires: %{name}-tools = %{version}-%{release} +Requires: python3 + +%description python3-perf +Python bindings for perf events. + +%package -n bpftool +Summary: eBPF inspection tool +Requires: %{name}-tools = %{version}-%{release} + +%description -n bpftool +bpftool for inspecting and manipulating eBPF programs and maps. + diff --git a/SPECS/linux/linux-6.1.inc b/SPECS/linux/linux-6.1.inc new file mode 100644 index 0000000000..353e4f9237 --- /dev/null +++ b/SPECS/linux/linux-6.1.inc @@ -0,0 +1,414 @@ +# linux.spec preamble for kernel 6.1 (photon_subrelease <= 90), included from linux.spec + +# If 'security_hardening none' is removed, +# ensure kpatch-build in kpatch is updated accordingly. +%global security_hardening none +%global __cmake_in_source_build 0 +%global lkcm_version 5.0.0 + +# SBAT generation of "linux.photon" component +%define linux_photon_generation 1 + +# Do not add unique suffix to *.ko.debug files +# If _unique_debug_names defined, then __debug_install_post expands +# *.ko to *.ko--..debug. +# Undefining this option keeps filenames simple: *.ko.debug. +# This is what crash utility is looking for. +%undefine _unique_debug_names + +# __debug_install_post extracts debug-info from modules. We need to +# specify option for any customizations. +%define _find_debuginfo_opts --keep-section '.BTF' + +%ifarch x86_64 +%define arch x86_64 +%define archdir x86 + +# Set this flag to 0 to build without canister +%global fips 1 +%endif + +# Disable canister_build always +%if 0%{?canister_build} +%global canister_build 0 +%endif + +%if 0%{?acvp_build} +%global fips 1 +%if 0%{?canister_build} +%global fips 0 +%endif +%endif + +%ifarch aarch64 +%define arch arm64 +%define archdir arm64 +%global fips 0 +%endif + +Release: 2%{?acvp_build:.acvp}%{?kat_build:.kat}%{?dist} + +%define uname_r %{version}-%{release} +%define _modulesdir /lib/modules/%{uname_r} + +Source1: config_%{_arch}-6.1 +Source2: initramfs.trigger + +%define ena_version 2.17.0 +Source3: https://github.com/amzn/amzn-drivers/archive/refs/tags/ena_linux_%{ena_version}.tar.gz + +%define efa_version 3.1.0 +Source4: https://github.com/amzn/amzn-drivers/archive/refs/tags/efa_linux_%{efa_version}.tar.gz + +# contains pre, postun, filetriggerun tasks +Source6: scriptlets.inc +Source7: check_for_config_applicability-6.1.inc + +%if 0%{?fips} +%define struct_comparator struct-comparator +%define struct_comp_dir struct-comp-dir +Source9: struct-comparator.c + +%define fips_canister_version 5.0.0-6.1.75-2%{?dist}-secure +Source16: fips-canister-%{fips_canister_version}.tar.bz2 +%endif + +Source18: spec_install_post-6.1.inc +Source19: %{name}-dracut-%{_arch}.conf +Source20: photon_sb2020.pem +Source21: photon_km_2025.pem + +%ifarch x86_64 +# Secure Boot +Source25: linux-sbat.csv.in + +%define jent_major_version 3.4.1 +%define jent_ph_version 4 +Source32: jitterentropy-%{jent_major_version}-%{jent_ph_version}.tar.bz2 +Source33: jitterentropy_canister_wrapper-6.1.c +Source34: jitterentropy_canister_wrapper-6.1.h +Source35: jitterentropy_canister_wrapper_asm-6.1.S + +Source36: fips_canister_wrapper-6.1.c +Source37: fips_canister_wrapper-6.1.h +Source38: fips_canister_wrapper_asm.S +Source39: fips_canister_wrapper_common-6.1.h +# fips_canister_wrapper_internal{.c,.h} is the latest released +# wrapper files. These files may differ between 2 canister versions. +# During canister binary update, rename +# %%{fips_canister_version}-fips_canister_wrapper_internal{.c,.h} +# files to fips_canister_wrapper_internal{.c,.h} +%if 0%{?fips} +Source40: fips_canister_wrapper_internal-6.1.h +Source41: fips_canister_wrapper_internal-6.1.c +%endif + +%if 0%{?canister_build} +Source43: fips_canister_wrapper_internal-6.1.h +Source44: fips_canister_wrapper_internal-6.1.c +Source45: fips_integrity-6.1.c +Source46: fips_integrity-6.1.h +Source47: update_canister_hmac-6.1.sh +Source48: canister_combine.lds +Source49: gen_canister_relocs-6.1.c +Source50: check_kernel_struct_in_canister.inc +%endif + +Source51: jitterentropy_rng_proxy-6.1.c +%endif + +Source52: license-6.1.txt +%include %{SOURCE52} + +%if 0%{?fips} +# known vmlinux struct definitions +%define vmlinux_definition_loc canister_known_struct_def_vmlinux +Source75: crypto_alg.txt +Source76: crypto_template.txt +Source77: skcipher_walk.txt +Source78: swait_queue_head.txt +Source79: x86_cpu_id.txt +%endif + +%if 0%{?acvp_build} +Source53: config_x86_64_acvp +Source54: check_for_acvp_config_applicability.inc +%endif + +Source100: Makefile.viomem +Source101: viomem-6.1.c +Source102: kernel_cve_patches-6.1.inc + +# common [0..49] +Patch0: confdata-format-change-for-split-script-6.1.patch +Patch1: net-Double-tcp_mem-limits.patch +Patch2: SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch +Patch3: 6.0-9p-transport-for-9p.patch +Patch4: 9p-trans_fd-extend-port-variable-to-u32.patch +Patch5: vsock-delay-detach-of-QP-with-outgoing-data-59.patch +# RDRAND-based RNG driver to enhance the kernel's entropy pool: +Patch6: 6.0-0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch +Patch7: 0001-cgroup-v1-cgroup_stat-support-6.1.patch +Patch8: 6.0-Discard-.note.gnu.property-sections-in-generic-NOTES.patch + +# Expose Photon kernel macros to identify kernel flavor and version +Patch9: 0001-kbuild-Makefile-Introduce-macros-to-distinguish-Phot-6.1.patch +Patch10: 0002-linux-Makefile-Add-kernel-flavor-info-to-the-generat-6.1.patch + +#HyperV patches +Patch12: vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch + +# TODO: Is CONFIG_HYPERV_VSOCKETS the same? +#Patchx: 0014-hv_sock-introduce-Hyper-V-Sockets.patch +Patch13: 6.1-0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS.patch +# Out-of-tree patches from AppArmor: +Patch14: 6.0-0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch +Patch15: 6.0-0002-apparmor-af_unix-mediation.patch + +Patch16: Performance-over-security-model-6.1.patch +# Disable md5 algorithm for sctp if fips is enabled. +Patch18: 6.0-0001-disable-md5-algorithm-for-sctp-if-fips-is-enabled.patch + +# VMware-specific patch to enable turbostat to work on ESXi +Patch19: 0001-tools-power-turbostat-Skip-some-CPUID-checks-if-runn-6.1.patch + +# Allow PCI resets to be disabled from vfio_pci_core module +Patch21: 6.1-0001-drivers-vfio-pci-Add-kernel-parameter-to-allow-disab.patch +# Add PCI quirk to allow multiple devices under the same virtual PCI bridge +# to be put into separate IOMMU groups on ESXi. +Patch22: 0001-Add-PCI-quirk-for-VMware-PCIe-Root-Port.patch + +Patch25: 0001-vmgenid-expose-vmgenid-via-sysfs-6.1.patch + +# glibc-2.43 build error fixes +Patch26: 0001-libbpf-Fix-Wdiscarded-qualifiers-under-C23.patch + +%ifarch x86_64 +Patch49: 0001-x86-pti-Fix-kernel-warnings-for-pti-and-nopti-cmdlin.patch +%endif + +# VMW: [50..59] +%ifarch x86_64 +Patch55: 6.0-x86-vmware-Use-Efficient-and-Correct-ALTERNATIVEs-fo.patch +Patch56: 6.0-x86-vmware-Log-kmsg-dump-on-panic.patch +Patch57: 6.0-x86-vmware-Fix-steal-time-clock-under-SEV.patch + +# Secure Boot and Kernel Lockdown +Patch58: 0001-kernel-lockdown-when-UEFI-secure-boot-enabled-6.1.patch +Patch59: 0002-Add-.sbat-section-6.1.patch +Patch60: 0003-Verify-SBAT-on-kexec-6.1.patch +%endif + +#Secure: +Patch61: gcc-rap-plugin-with-kcfi.patch +Patch62: 0004-Fix-PAX-function-pointer-overwritten-for-tasklet-cal.patch +Patch63: fix-warn-definition.patch + +Patch100: 6.0-0003-apparmor-fix-use-after-free-in-sk_peer_label.patch + +# Fix BPF JIT memory (bpf_jit_limit) leak: seccomp filters held by +# unreaped zombies were not released until release_task(); release +# them at task exit instead. Upstream commit bfafe5efa975 (v6.11). +Patch101: seccomp-release-task-filters-when-the-task-exits.patch + +# CVE patches — see kernel_cve_patches.inc (range 3000–3999) +%include %{SOURCE102} + +# perf: off-cpu sample [221..223] +Patch221: 0001-perf-core-add-logic-to-collect-off-cpu-sample-6.1.patch +Patch222: 0002-perf-record-add-options-to-off-cpu-6.1.patch +Patch223: 0003-perf-display-off-cpu-samples-6.1.patch + +%ifarch aarch64 +# aarch specific patches [250..269] +# Rpi of_configfs patches +Patch250: 0001-OF-DT-Overlay-configfs-interface-6.1.patch +Patch251: 0002-of-configfs-Use-of_overlay_fdt_apply-API-call.patch +Patch252: 0003-of-overlay-Correct-symbol-path-fixups.patch +# arm64 hypervisor detection and kmsg dumper +Patch253: 6.0-0001-x86-hyper-generalize-hypervisor-type-detection.patch +Patch254: 6.0-0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch +Patch255: 6.0-0003-arm64-VMware-hypervisor-detection.patch +Patch256: 6.0-0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch +Patch257: 6.0-0005-scsi-vmw_pvscsi-add-arm64-support.patch +Patch258: 6.0-0006-vmxnet3-build-only-for-x86-and-arm64.patch +Patch259: 6.0-0005-vmw_balloon-add-arm64-support.patch +Patch260: 6.0-0001-vmw_vmci-arm64-support-memory-ordering.patch +%endif + +%ifarch x86_64 +# AWS: [300..339] +Patch301: 6.0-0001-scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch +Patch302: 6.0-0007-xen-manage-keep-track-of-the-on-going-suspend-mode.patch +Patch303: 6.0-0008-xen-manage-introduce-helper-function-to-know-the-on-.patch +Patch304: 6.0-0009-xenbus-add-freeze-thaw-restore-callbacks-support.patch +Patch305: 6.0-0010-x86-xen-Introduce-new-function-to-map-HYPERVISOR_sha.patch +Patch306: 6.0-0011-x86-xen-add-system-core-suspend-and-resume-callbacks.patch +Patch307: 6.0-0012-xen-blkfront-add-callbacks-for-PM-suspend-and-hibern.patch +Patch308: 6.0-0013-xen-netfront-add-callbacks-for-PM-suspend-and-hibern.patch +Patch309: 6.0-0014-xen-time-introduce-xen_-save-restore-_steal_clock.patch +Patch310: 6.0-0015-x86-xen-save-and-restore-steal-clock.patch +Patch311: 6.0-0016-xen-events-add-xen_shutdown_pirqs-helper-function.patch +Patch312: 6.0-0017-x86-xen-close-event-channels-for-PIRQs-in-system-cor.patch +Patch313: 6.0-0018-PM-hibernate-update-the-resume-offset-on-SNAPSHOT_SE.patch +Patch314: 6.0-0020-xen-blkfront-Fixed-blkfront_restore-to-remove-a-call.patch +Patch315: 6.0-0021-x86-tsc-avoid-system-instability-in-hibernation.patch +Patch316: 6.0-0022-block-xen-blkfront-consider-new-dom0-features-on-res.patch +Patch317: 6.0-0023-xen-restore-pirqs-on-resume-from-hibernation.patch +Patch318: 6.0-0024-xen-Only-restore-the-ACPI-SCI-interrupt-in-xen_resto.patch +Patch319: 6.0-0026-xen-netfront-call-netif_device_attach-on-resume.patch +Patch320: 6.0-0054-xen-Restore-xen-pirqs-on-resume-from-hibernation.patch +Patch321: 6.0-0055-block-xen-blkfront-bump-the-maximum-number-of-indire.patch +Patch322: 6.0-0185-Introduce-page-touching-DMA-ops-binding.patch +Patch323: 6.0-0444-drivers-base-memory-use-MHP_MEMMAP_ON_MEMORY-from-th.patch +Patch324: 6.0-0490-Correct-read-overflow-in-page-touching-DMA-ops-bindi.patch +%endif + +# Crypto: [500..529] +# Patch to invoke crypto self-tests and add missing test vectors to testmgr +Patch500: 0002-FIPS-crypto-self-tests.patch +# Patch to call drbg and dh crypto tests from tcrypt +Patch501: tcrypt-disable-tests-that-are-not-enabled-in-photon.patch +Patch502: 0001-Initialize-jitterentropy-before-ecdh.patch +# Patch to remove urandom usage in rng module +Patch503: 0001-FIPS-crypto-rng-Jitterentropy-RNG-as-the-only-RND-source-6.1.patch +# Patch to remove urandom usage in drbg and ecc modules +Patch504: 0003-FIPS-crypto-drbg-Jitterentropy-RNG-as-the-only-RND.patch + +%ifarch x86_64 +Patch505: 0001-changes-to-build-with-jitterentropy-v3.4.1.patch +Patch506: 0001-compile-jitterentropy-rng-proxy-6.1.patch +Patch507: 0001-change-jitterentropy_rng-driver-name-6.1.patch +%endif + +%if 0%{?fips} +# FIPS canister usage patch +Patch508: 0001-FIPS-canister-binary-usage-6.1.patch +Patch509: 0001-scripts-kallsyms-Extra-kallsyms-parsing.patch +Patch510: 0001-LKCM-5.0-binary-patching-to-fix-struct-aesni_cpu_id-.patch +Patch511: 0001-canister-Change-spinlock_t-lock-to-void-reserved.patch +# commit e470d42 (crypto: api - Add crypto_tfm_get) introduced an api +# which adds a new member in struct crypto_tfm, causing build issues +# with fips canister, since, crypto_tfm_get() api is not being used +# in v6.1.x so reverting upstream commit. +Patch512: 0001-Revert-crypto-api-Add-crypto_tfm_get.patch +%endif + +%if 0%{?acvp_build:1} +#ACVP test harness patches. +#Need to be applied on top of FIPS canister usage patch to avoid HUNK failure +Patch513: 0001-crypto-AF_ALG-add-sign-verify-API-6.1.patch +Patch514: 0002-crypto-AF_ALG-add-setpubkey-setsockopt-call-6.1.patch +Patch515: 0003-crypto-AF_ALG-add-asymmetric-cipher-6.1.patch +Patch516: 0004-crypto-AF_ALG-add-DH-keygen-ssgen-API.patch +Patch517: 0005-crypto-AF_ALG-add-DH-param-ECDH-curve-setsockopt-6.1.patch +Patch518: 0006-crypto-AF_ALG-eliminate-code-duplication-6.1.patch +Patch519: 0007-crypto-AF_ALG-add-KPP-support-6.1.patch +Patch520: 0008-crypto-AF_ALG-add-ECC-support-6.1.patch +Patch521: 0009-kernels-net-Export-sock_getsockopt.patch +Patch522: 0010-DRBG-Fix-issues-with-DRBG.patch +Patch523: 0011-Added-jitterentropy-implementation-of-SHA3-256.patch +Patch524: 0012-jitterentropy-Support-for-sample-collection.patch +%if 0%{?kat_build:1} +Patch525: 0013-crypto-api-return-status-prints-for-LKCM5-demo.patch +%endif +%endif + +%ifarch x86_64 +# SEV on VMware: [600..609] +Patch600: 0079-x86-sev-es-Disable-BIOS-ACPI-RSDP-probing-if-SEV-ES-.patch +Patch601: 0080-x86-boot-Enable-vmw-serial-port-via-Super-I-O.patch +Patch602: 0001-x86-boot-unconditional-preserve-CR4.MCE-6.1.patch +# TODO: Review: Patch602: 0081-x86-sev-es-Disable-use-of-WP-via-PAT-for-__sme_early.patch + +# SEV-SNP: +Patch605: 0001-sev-snp-parse-MP-tables.patch +%endif + +#HCX-Patches +Patch701: 0001-Active-probing-of-dst-mac-of-unknown-unicast-6.1.patch +Patch702: 0002-Skip-IP_ECN_decapsulate-for-gretap-devices-6.1.patch +Patch703: 0003-Handle-ipsec-in-ipip-more-correctly-6.1.patch +Patch704: 0004-De-cap-fou-traffic-into-correct-tunnel-device-s-6.1.patch +Patch705: 0005-Add-unknown-fou-tracking-to-kernel-6.1.patch +Patch706: 0006-Add-initial-support-for-vxlan-trunk-to-cgw-kernel-wi.patch +Patch707: 0007-Changes-for-bridge-vlan-arp-filtering-to-work-right.patch +Patch708: 0008-Add-support-for-mac-flapping-and-long-mac-flapping-p.patch +Patch709: 0009-vmxnet3-Avoid-fragmentation-by-giving-each-vmxnet3-d.patch +Patch710: 0010-RPS-flow-balance.patch +Patch711: 0011-add-mss-clamp-support-to-gretap-baseimage.patch +Patch712: 0012-set-max_mtu-as-IP_MAX_MTU.patch +Patch713: 0013-set-max_mtu-as-IP_MAX_MTU_for_vlan.patch +Patch714: 0014-iptunnel-mark-xfrm-multi-parts.patch +Patch715: 0015-disable-pskb_inet_may_pull-in-tunnel.patch +Patch716: 0016-gre_tap-interface-mss_clamp-support.patch +Patch717: 0017-rps_cpus-skip-receive-packets-queuing-to-only-housek.patch +# RCU callbacks invocation max batch limit control for HCX usecase +Patch718: 0001-rcutree-Adding-rcu_max_blimit-rcutree-param.patch +Patch719: 0018-Introduce-xfrm_dst-cache-mechanism-to-reuse-xfrm_dst.patch + +# Report guest crash to vmware hypervisor +%ifarch aarch64 +Patch1000: 0001-arm64-report-guest-crash-to-vmware-hypervisor.patch +%endif + +%ifarch x86_64 +Patch1000: 0001-x86-vmware-mark-hypercalls-as-volatile.patch +Patch1001: 0002-x86-report-guest-crash-to-vmware-hypervisor.patch +%endif + +# Patches for efa [1400..1409] +Patch1400: Fix-efa-cmake-to-build-from-local-directory.patch + +%if 0%{?canister_build} +# Below patches are common for fips and canister_build flags +# 0001-FIPS-canister-binary-usage.patch is renamed as -0001-FIPS-canister-binary-usage.patch +# in both places until final canister binary is released +Patch10000: 0001-FIPS-canister-binary-usage-6.1.patch +Patch10001: 0001-scripts-kallsyms-Extra-kallsyms-parsing.patch +# Below patches are specific to canister_build flag +Patch10003: 0002-FIPS-canister-creation.patch +Patch10004: 0003-aesni_intel-Remove-static-call.patch +Patch10005: 0004-Disable-retpoline_sites-and-return_sites-section-in-.patch +Patch10006: 0005-Move-__bug_table-section-to-fips_canister_wrapper.patch +Patch10007: 0006-crypto-Add-prandom-module_kthread_exit-to-canister-w.patch +Patch10008: 0007-crypto-Remove-EXPORT_SYMBOL-EXPORT_SYMBOL_GPL-from-c.patch +Patch10009: 0008-Move-kernel-structures-usage.patch +Patch10010: 0009-ecc-Add-pairwise-consistency-test-for-every-generate.patch +Patch10011: 0001-List-canister-objs-in-a-file.patch +# Patch for RSA FIPS 186-5 compliance +Patch10012: 0001-crypto-rsa-allow-only-odd-e-and-restrict-value-in-FI.patch +Patch10013: 0001-Handle-approved-and-non-approved-services.patch + +%if 0%{?kat_build} +Patch10014: 0001-Crypto-Tamper-KAT-PCT-and-Integrity-Test-6.1.patch +%endif +%endif + +%if 0%{?photon_subrelease} >= 91 +BuildRequires: mpc-devel +%endif + +BuildRequires: flex +BuildRequires: perl +BuildRequires: which + +%ifarch x86_64 +BuildRequires: pciutils-devel +BuildRequires: libcap-devel +# Requirements for signing artifacts +%if "%{?signing_script}" != "" +%define network_required 1 +BuildRequires: ca-certificates-pki +BuildRequires: python3-requests +%endif +%endif + +%if 0%{?fips} +BuildRequires: gdb +%endif + +Requires(pre): (coreutils or coreutils-selinux) +Requires(preun): (coreutils or coreutils-selinux) +Requires(post): (coreutils or coreutils-selinux) +Requires(postun): (coreutils or coreutils-selinux) diff --git a/SPECS/91/linux/linux.spec b/SPECS/linux/linux-6.12-changelog.inc similarity index 66% rename from SPECS/91/linux/linux.spec rename to SPECS/linux/linux-6.12-changelog.inc index 328b70479d..0f60b4ffb0 100644 --- a/SPECS/91/linux/linux.spec +++ b/SPECS/linux/linux-6.12-changelog.inc @@ -1,1033 +1,22 @@ -%global build_if %{photon_subrelease} == 91 -%global security_hardening none -%global __cmake_in_source_build 0 -%global lkcm_version 6.12 - -# SBAT generation of "linux.photon" component -%define linux_photon_generation 1 - -# Do not add unique suffix to *.ko.debug files -# If _unique_debug_names defined, then __debug_install_post expands -# *.ko to *.ko--..debug. -# Undefining this option keeps filenames simple: *.ko.debug. -# This is what crash utility is looking for. -%undefine _unique_debug_names - -# __debug_install_post extracts debug-info from modules. We need to -# specify option for any customizations. -%define _find_debuginfo_opts --keep-section '.BTF' - -# FIPS flags: fips, canister_build, canister_usage, acvp_build. -# "fips" - declaring whether or not to build FIPS compliant kernel with crypto -# canister. When fips=0, it is a regular kernel build without the canister, -# canister_* values are ignored in this case. When fips=1 there are 2 possible -# build types: -# 1. canister_build=1 - build the canister and use it. -# 2. canister_build=0 - link with prebuilt canister object file. -# -# In both cases when fips=1, we use out of tree jent tarball. -# -# acvp_build=1 defines a special build of the canister for FIPS certification. -# It enforces fips=1 and works with canister_build(dev) or canister_usage (prod) -# -# kat_build=1 defines a non-production canister build used for CMVP_DEMO during FIPS certification. -# It includes additional debug prints in the cryptographic algorithm paths to display API flow -# and return statuses during ACVP testing. -# It also intentionally tampers the self-tests to simulate the broken KAT scenario required -# during the FIPS certification process. -# It enforces acvp_build=1 and canister_build=1. -# -# canister_usage is derived variable and can not be directly set. -# canister_usage=!canister_build, iff fips=1 - -%ifarch x86_64 -%define arch x86_64 -%define archdir x86 -%global fips 1 -%endif - -%ifarch aarch64 -%define arch arm64 -%define archdir arm64 -%global fips 0 -%endif - -%if 0%{?kat_build} -%global acvp_build 1 -%global canister_build 1 -%endif - -%if 0%{?acvp_build} -%global fips 1 -%endif - -# Set default FIPS flags -%if 0%{?fips} -%global fips_plugins 1 -%if 0%{?canister_build} -%global canister_usage 0 -# This is the last certified canister version -# Remove below line when building a new canister -%define fips_certified_kernel_version 6.12.60-18.ph5 -%else -%global canister_usage 1 -%endif -%else -%global canister_usage 0 -%global canister_build 0 -%endif - -Summary: Kernel -Name: linux -Version: 6.12.111 -Release: 3%{?acvp_build:.acvp}%{?kat_build:.kat}%{?dist} -URL: http://www.kernel.org/ -Group: System Environment/Kernel -Vendor: VMware, Inc. -Distribution: Photon - -%define uname_r %{version}-%{release} -%define _modulesdir /lib/modules/%{uname_r} - -Source0: http://www.kernel.org/pub/linux/kernel/v6.x/linux-%{version}.tar.xz -Source1: config_%{_arch} -Source2: initramfs.trigger - -%define ena_version 2.17.0 -Source3: https://github.com/amzn/amzn-drivers/archive/refs/tags/ena_linux_%{ena_version}.tar.gz - -%define efa_version 3.1.0 -Source4: https://github.com/amzn/amzn-drivers/archive/refs/tags/efa_linux_%{efa_version}.tar.gz - -# contains pre, postun, filetriggerun tasks -Source6: scriptlets.inc -Source7: check_for_config_applicability.inc - -Source18: spec_install_post.inc -Source19: %{name}-dracut-%{_arch}.conf -Source20: photon_sb2020.pem -Source21: photon_km_2025.pem - -%ifarch x86_64 -# Secure Boot -Source25: linux-sbat.csv.in -%endif - -Source30: Makefile.viomem -Source31: viomem.c -Source56: kernel_cve_patches.inc - -Source55: license.txt -%include %{SOURCE55} - -%if 0%{?fips} -%define jent_name photon-jitterentropy-v6.12 -%define jent_rel_ver 3 -Source10000: %{jent_name}-%{jent_rel_ver}.tar.gz - -Source10001: jitterentropy_canister_wrapper.c -Source10002: jitterentropy_canister_wrapper.h -Source10003: jitterentropy_canister_wrapper_asm.S - -%if 0%{?canister_usage} -%define fips_canister_version 6.12.60-18.2.ph5 -%define ExtraBuildRequiresSansSnapshot linux-fips-canister = %{fips_canister_version} -BuildRequires: linux-fips-canister = %{fips_canister_version} -%endif - -Source10101: fips_canister_wrapper.c -Source10102: fips_canister_wrapper.h -Source10104: fips_canister_wrapper_common.h -Source10105: fips_canister_wrapper_internal.h -Source10106: fips_canister_wrapper_internal.c - -Source10300: jitterentropy_rng_proxy.c -%endif - -%if 0%{?canister_build} -Source11000: partial_reloc.c -Source11001: fips_integrity.c -Source11002: fips_integrity.h -Source11003: update_canister_hmac.sh -Source11004: canister_combine.lds -Source11005: gen_canister_relocs.c -Source11500: check_kernel_struct_in_canister.inc -%endif - -%if 0%{?acvp_build} -Source12000: config_x86_64_acvp -Source12001: check_for_acvp_config_applicability.inc -%endif - -# common [0..49] -Patch0: confdata-format-change-for-split-script.patch -Patch1: net-Double-tcp_mem-limits.patch -Patch2: SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch -Patch3: 9p-transport-for-9p.patch -Patch4: 9p-trans_fd-extend-port-variable-to-u32.patch -Patch5: vsock-delay-detach-of-QP-with-outgoing-data-59.patch -# RDRAND-based RNG driver to enhance the kernel's entropy pool: -Patch6: 0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch -# Enable CGROUP Stat show for V1 -Patch7: 0001-cgroup-v1-cgroup_stat-support.patch - -# Expose Photon kernel macros to identify kernel flavor and version -Patch9: 0001-kbuild-Makefile-Introduce-macros-to-distinguish-Phot.patch -Patch10: 0002-linux-Makefile-Add-kernel-flavor-info-to-the-generat.patch - -# ttyXRUSB support -Patch11: usb-acm-exclude-exar-usb-serial-ports-nxt.patch -#HyperV patches -Patch12: vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch - -# TODO: Is CONFIG_HYPERV_VSOCKETS the same? -#Patchx: 0014-hv_sock-introduce-Hyper-V-Sockets.patch -Patch13: 0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS.patch -# Out-of-tree patches from AppArmor: -Patch14: 0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch -Patch15: 0002-apparmor-af_unix-mediation.patch - -Patch16: Performance-over-security-model.patch - -Patch17: 0001-mm-add-provision-to-disable-CONFIG_PER_VMA_LOCK.patch - -# VMware-specific patch to enable turbostat to work on ESXi -Patch19: 0001-tools-power-turbostat-Skip-some-CPUID-checks-if-runn.patch - -# Allow PCI resets to be disabled from vfio_pci_core module -Patch21: 0001-drivers-vfio-pci-Add-kernel-parameter-to-allow-disab.patch -# Add PCI quirk to allow multiple devices under the same virtual PCI bridge -# to be put into separate IOMMU groups on ESXi. -Patch22: 0001-Add-PCI-quirk-for-VMware-PCIe-Root-Port.patch - -# Upstream fix to properly handle PNP0C01/PNP0C02 device. -Patch23: 0001-ACPI-PNP-Drop-PNP0C01-and-PNP0C02-from-acpi_pnp_devi.patch - -Patch26: 0001-alloc_tag-avoid-current-alloc_tag-manipulations-when.patch - -Patch28: 0001-vmgenid-expose-vmgenid-via-sysfs.patch - -Patch29: 0001-randomize_kstack-Unify-random-source-across-arches.patch - -Patch30: 0001-sched_info_enqueue-don-t-update-last_queued-on-delay.patch - -%ifarch x86_64 -# VMW: [50..60] -Patch50: x86-vmware-Log-kmsg-dump-on-panic.patch -Patch51: x86-vmware-Support-steal-time-clock-for-encrypted-gu.patch -# Report guest crash to vmware hypervisor -Patch52: 0001-x86-report-guest-crash-to-vmware-hypervisor.patch - -# SEV on VMware -Patch53: 0079-x86-sev-es-Disable-BIOS-ACPI-RSDP-probing-if-SEV-ES-.patch -Patch54: 0080-x86-boot-Enable-vmw-serial-port-via-Super-I-O.patch -Patch55: 0001-x86-boot-unconditional-preserve-CR4.MCE.patch -# TODO: Review: Patch602: 0081-x86-sev-es-Disable-use-of-WP-via-PAT-for-__sme_early.patch -Patch56: 0001-x86-vmware-Redefine-the-macro-of-CPUID_VMWARE.patch - -# Secure Boot and Kernel Lockdown -Patch57: 0001-kernel-lockdown-when-UEFI-secure-boot-enabled.patch -Patch58: 0002-Add-.sbat-section.patch -Patch59: 0003-Verify-SBAT-on-kexec.patch -%endif - -#Secure: -Patch61: 0001-gcc-rap-plugin-with-kcfi.patch -Patch62: 0002-objtool-Return-error-in-case-of-failures.patch -Patch63: 0004-Fix-PAX-function-pointer-overwritten-for-tasklet-cal.patch - -# vmxnet3 -Patch65: 0001-vmxnet3_support_higher_link_speeds_from_vmxnet3_v9.patch - -# Backward compatibility -%if "%{dist}" == ".ph5" -Patch71: 0001-block-Fix-validation-of-ioprio-level.patch -%endif - -# CVE patches — see kernel_cve_patches.inc (range 3000–3999) -%include %{SOURCE56} - -%ifarch aarch64 -# aarch specific patches [200..219] -# Rpi of_configfs patches -Patch201: 0001-OF-DT-Overlay-configfs-interface.patch -Patch203: 0003-of-overlay-Correct-symbol-path-fixups.patch -# Rpi fan driver -# arm64 hypervisor detection and kmsg dumper -Patch205: 0001-x86-hyper-generalize-hypervisor-type-detection.patch -Patch206: 0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch -Patch207: 0003-arm64-VMware-hypervisor-detection.patch -Patch208: 0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch -Patch209: 0005-scsi-vmw_pvscsi-add-arm64-support.patch -Patch210: 0006-vmxnet3-build-only-for-x86-and-arm64.patch -Patch211: 0005-vmw_balloon-add-arm64-support.patch -Patch212: 0001-vmw_vmci-arm64-support-memory-ordering.patch -# Report guest crash to vmware hypervisor -Patch213: 0001-arm64-report-guest-crash-to-vmware-hypervisor.patch -%endif - -# perf: off-cpu sample -Patch221: 0001-perf-core-add-logic-to-collect-off-cpu-sample.patch -Patch222: 0002-perf-record-add-options-to-off-cpu.patch -Patch223: 0003-perf-display-off-cpu-samples.patch - -# tools: fix for new glibc -Patch230: 0001-perf-disasm-Constify-variables-storing-the-result-of.patch -Patch231: 0002-perf-metricgroup-Constify-variables-storing-the-resu.patch -Patch232: 0003-perf-strlist-Don-t-write-to-const-memory.patch -Patch233: 0004-perf-session-Don-t-write-to-memory-pointed-to-a-cons.patch -Patch234: 0005-perf-trace-event-Constify-variables-storing-the-resu.patch -Patch235: 0006-perf-units-Constify-variables-storing-the-result-of-.patch -Patch236: 0007-perf-time-utils-Constify-variables-storing-the-resul.patch -Patch237: 0008-perf-demangle-java-Constify-variables-storing-the-re.patch -Patch238: 0009-perf-bpf-event-Constify-variables-storing-the-result.patch -Patch239: 0010-perf-jitdump-Constify-variables-storing-the-result-o.patch -Patch240: 0011-perf-list-Remove-unused-sep-variable.patch -Patch241: 0012-perf-diff-Constify-strchr-return-variables.patch -Patch242: 0013-perf-tools-Use-const-for-variables-receiving-str-str.patch -Patch243: 0014-perf-trace-Don-t-change-const-char-strings.patch -Patch244: 0015-perf-list-Don-t-write-to-const-memory.patch -Patch245: 0016-perf-trace-Deal-with-compiler-const-checks.patch -Patch246: 0017-perf-print-events-Fix-compiler-issues-with-newer-gil.patch -Patch247: 0018-perf-list-Signal-changing-const-memory-is-ok.patch -Patch248: 0019-perf-tools-Remove-unused-color_fwrite_lines.patch - -%ifarch x86_64 -# AWS: [300..339] -Patch301: 0001-scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch -Patch302: 0007-xen-manage-keep-track-of-the-on-going-suspend-mode.patch -Patch303: 0008-xen-manage-introduce-helper-function-to-know-the-on-.patch -Patch304: 0009-xenbus-add-freeze-thaw-restore-callbacks-support.patch -Patch305: 0010-x86-xen-Introduce-new-function-to-map-HYPERVISOR_sha.patch -Patch306: 0011-x86-xen-add-system-core-suspend-and-resume-callbacks.patch -Patch307: 0012-xen-blkfront-add-callbacks-for-PM-suspend-and-hibern.patch -Patch308: 0013-xen-netfront-add-callbacks-for-PM-suspend-and-hibern.patch -Patch309: 0014-xen-time-introduce-xen_-save-restore-_steal_clock.patch -Patch310: 0015-x86-xen-save-and-restore-steal-clock.patch -Patch311: 0016-xen-events-add-xen_shutdown_pirqs-helper-function.patch -Patch312: 0017-x86-xen-close-event-channels-for-PIRQs-in-system-cor.patch -Patch313: 0018-PM-hibernate-update-the-resume-offset-on-SNAPSHOT_SE.patch -Patch314: 0020-xen-blkfront-Fixed-blkfront_restore-to-remove-a-call.patch -Patch315: 0021-x86-tsc-avoid-system-instability-in-hibernation.patch -Patch316: 0022-block-xen-blkfront-consider-new-dom0-features-on-res.patch -Patch317: 0023-xen-restore-pirqs-on-resume-from-hibernation.patch -Patch318: 0024-xen-Only-restore-the-ACPI-SCI-interrupt-in-xen_resto.patch -Patch319: 0026-xen-netfront-call-netif_device_attach-on-resume.patch -Patch320: 0054-xen-Restore-xen-pirqs-on-resume-from-hibernation.patch -Patch321: 0055-block-xen-blkfront-bump-the-maximum-number-of-indire.patch -Patch322: 0185-Introduce-page-touching-DMA-ops-binding.patch -Patch323: 0444-drivers-base-memory-use-MHP_MEMMAP_ON_MEMORY-from-th.patch -Patch324: 0490-Correct-read-overflow-in-page-touching-DMA-ops-bindi.patch - -%endif - -#HCX-Patches -Patch701: 0001-Active-probing-of-dst-mac-of-unknown-unicast.patch -Patch702: 0002-Skip-IP_ECN_decapsulate-for-gretap-devices.patch -Patch703: 0003-Handle-ipsec-in-ipip-more-correctly.patch -Patch704: 0004-De-cap-fou-traffic-into-correct-tunnel-device-s.patch -Patch705: 0005-Add-unknown-fou-tracking-to-kernel.patch -Patch706: 0006-Add-support-for-mac-flapping-and-long-mac-flapping-p.patch -Patch707: 0007-vmxnet3-Avoid-fragmentation-by-giving-each-vmxnet3-d.patch -Patch708: 0008-RPS-flow-balance.patch -Patch709: 0009-add-mss-clamp-support-to-gretap-baseimage.patch -Patch710: 0010-iptunnel-mark-xfrm-multi-parts.patch -Patch711: 0011-disable-pskb_inet_may_pull-in-tunnel.patch -Patch712: 0012-gre_tap-interface-mss_clamp-support.patch -Patch713: 0013-rps_cpus-skip-receive-packets-queuing-to-only-housek.patch -Patch714: 0014-Introduce-xfrm_dst-cache-mechanism-to-reuse-xfrm_dst.patch -Patch715: 0015-rcutree-Adding-rcu_max_blimit-rcutree-param.patch - -# Patches for efa [1400..1409] -Patch1400: Fix-efa-cmake-to-build-from-local-directory.patch - -# Only LKCM/JENT related patches below -# Jitterentropy support and FIPS compliance -Patch10000: 0001-New-memsize-options-for-jent.patch -%if 0%{?fips} -Patch10001: 0001-jitterentropy-Makefile-changes.patch -# Patch to remove urandom usage in rng module -Patch10002: 0001-FIPS-crypto-rng-Jitterentropy-RNG-as-the-only-RND-source.patch -# Disable md5 algorithm for sctp if fips is enabled. -Patch10003: 0001-disable-md5-and-sha1-algorithms-for-sctp-if-fips-is-enabled.patch -# Mark ECB as Internal algorithm if fips is enabled. -Patch10004: 0001-crypto-ecb-Set-ecb-alg-flag-as-Internal.patch - -# Below patches are common for canister_usage and canister_build flags -Patch10101: 0001-FIPS-canister-binary-usage.patch -Patch10102: 0002-algapi.c-honor-fcw_skip_tests.patch -Patch10103: 0003-tcrypt-align-to-LKCM.patch -Patch10104: 0004-scripts-kallsyms-Extra-kallsyms-parsing.patch -# Move rsa-pkcs1pad encrypt and decrypt functions outside canister -Patch10106: 0006-crypto-Disable-rsa-pkcs1pad-encrypt-decrypt-in-FIPS-.patch -# Add internal_iv field for aead_request -Patch10107: 0007-aead-add-internal_iv-field.patch -Patch10108: 0008-FIPS-Mark-structure-field-differences-between-kernel.patch -Patch10109: 0009-aead_geniv_ctx-drop-lock-field.patch -Patch10110: 0010-Move-crypto_inc-to-lib-crypto-utils.c.patch -Patch10111: 0001-crypto-Moving-rfc4543-out-of-canister-boundry.patch -# Make lib/digsig to use lib SHA1 instead of crypto shash API -# [10112..10116] -Patch10112: 0001-crypto-x86-sha1-Rename-conflicting-symbol.patch -Patch10113: 0002-lib-crypto-sha1-Rename-sha1_init-to-sha1_init_raw.patch -Patch10114: 0003-lib-crypto-sha1-Add-SHA-1-library-functions.patch -Patch10115: 0001-lib-digsig-Use-SHA-1-library-instead-of-crypto_shash.patch -Patch10116: 0001-crypto-sha1_generic-Renaming-sha1_final.patch -# Track internal/external jitterentropy rng requests -Patch10117: 0001-crypto-track-external-requests-to-jitterentropy_rng.patch -# make ima to use lib SHA1 instead of crypto shash API -Patch10118: 0001-linux-ima-Use-lib-sha1-instead-of-crypto-shash.patch - -# FIPS canister plugins -Patch10200: 0001-Compile-GCC-plugins-for-FIPS-canister.patch -Patch10201: 0002-Build-with-FIPS-Canister-GCC-plugins.patch -Patch10202: 0003-Introduce-FIPS-canister-plugins.patch -Patch10203: 0004-FIPS-Canister-Plugins-Add-self-tests.patch -Patch10204: 0001-Canister-GCC-Plugins-Implement-type-check.patch - -# Compile and inject jitterentropy rng proxy -Patch10300: 0001-compile-jitterentropy-rng-proxy.patch -Patch10301: 0001-change-jitterentropy_rng-driver-name.patch -%endif - -# Canister build patches -%if 0%{?canister_build} -# Below patches are specific to canister_build flag -Patch11000: 1000-FIPS-canister-creation.patch -Patch11001: 1001-aesni_intel-Remove-static-call.patch -Patch11002: 1002-Disable-retpoline_sites-and-return_sites-sections-in.patch -# Patch to remove urandom usage in drbg and ecc modules -Patch11003: 1003-FIPS-crypto-drbg-Jitterentropy-RNG-as-the-only-RND.patch -Patch11004: 1004-Move-__bug_table-section-to-fips_canister_wrapper.patch -Patch11005: 1005-crypto-Remove-EXPORT_SYMBOL-EXPORT_SYMBOL_GPL-from-c.patch -Patch11006: 1006-Move-kernel-structures-usage-from-canister-to-wrappe.patch -Patch11007: 1007-ecc-Add-pairwise-consistency-test-for-every-generate.patch -Patch11008: 1008-Add-ghash-accelerator.patch -Patch11009: 1009-Handle-approved-and-non-approved-services.patch -Patch11010: 1010-rsa-pkcs1pad-Add-invalid_hash_len-check-in-sign-veri.patch -Patch11011: 1011-sha1-Do-not-register-sha1-to-crypto-backend-when-fip.patch -Patch11012: 1012-Add-shasums-accelerators.patch -Patch11013: 1013-Disable-ret-sites-section-in-x86-shasum-object-files.patch -# Patch to invoke crypto self-tests and add missing test vectors to testmgr -Patch11015: 1015-FIPS-crypto-self-tests.patch -# Disable alloc_hook_tags if MEM_PROFILING is disabled -Patch11016: 1016-linux-canister-Eliminate-codetag-and-other-taggings-.patch -# CVE-2026-64313 fix was applied on canister v6.12.60-18.1. -# Below entry is kept for future reference -# 0001-crypto-ecc-Fix-carry-overflow-in-vli-multiplication.patch -%endif - -# ACVP special builds -%if 0%{?acvp_build:1} -#ACVP test harness patches. -Patch12000: 0001-crypto-AF_ALG-add-sign-verify-API.patch -Patch12001: 0002-crypto-AF_ALG-add-setpubkey-setsockopt-call.patch -Patch12002: 0003-crypto-AF_ALG-add-asymmetric-cipher.patch -Patch12003: 0004-crypto-AF_ALG-add-DH-keygen-ssgen-API.patch -Patch12004: 0005-crypto-AF_ALG-add-DH-param-ECDH-curve-setsockopt.patch -Patch12005: 0006-crypto-AF_ALG-eliminate-code-duplication.patch -Patch12006: 0007-crypto-AF_ALG-add-KPP-support.patch -Patch12007: 0008-crypto-AF_ALG-add-ECC-support.patch -Patch12008: 0009-DRBG-Fix-issues-with-DRBG.patch -Patch12009: 0011-sock-Remove-sendpage-in-favour-of-sendmsg-MSG_SPLICE.patch -Patch12010: 0012-jitterentropy-kcapi-Support-for-sample-collection.patch -Patch12011: 0013-Jitterentropy-Add-char-dev-interface-for-jent-osr.patch -Patch12012: 0014-jitterentropy-Add-prototype-for-sample-collection.patch -%endif - -# KAT special builds -%if 0%{?kat_build} -Patch12013: 0001-Crypto-Tamper-KAT-PCT-and-Integrity-Test.patch -Patch12014: 0015-crypto-api-return-status-prints-for-LKCM6-demo.patch -%endif - -BuildRequires: bc -BuildRequires: mpc-devel -BuildRequires: kmod-devel -BuildRequires: glib-devel -BuildRequires: elfutils-devel -BuildRequires: openssl-devel -BuildRequires: procps-ng-devel -BuildRequires: audit-devel -BuildRequires: elfutils-libelf-devel -BuildRequires: binutils-devel -BuildRequires: xz-devel -BuildRequires: slang-devel -BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: cmake -BuildRequires: bison -BuildRequires: dwarves-devel -BuildRequires: gmp-devel -BuildRequires: mpfr-devel -BuildRequires: libtraceevent-devel -BuildRequires: clang-devel -BuildRequires: readline-devel -%if 0%{?fips_plugins} -BuildRequires: gcc >= 12.2.0-6 -%endif - -%ifarch x86_64 -BuildRequires: pciutils-devel -BuildRequires: libcap-devel -# Requirements for signing artifacts -%if "%{?signing_script}" != "" -%define network_required 1 -BuildRequires: ca-certificates-pki -BuildRequires: python3-requests -%endif -%endif - -BuildRequires: gdb - -Requires: kmod -Requires: filesystem -Requires(pre): coreutils -Requires(preun): coreutils -Requires(post): coreutils -Requires(postun): coreutils - -Obsoletes: linux-aws -Obsoletes: linux-secure -Provides: linux-secure - -%description -The Linux package contains the Linux kernel. -# Enable post FIPS certification -%if 0 -This kernel is FIPS certified. -%endif - -%package devel -Summary: Kernel Dev -Group: System Environment/Kernel -Requires: %{name} = %{version}-%{release} -Requires: python3 gawk dwarves-devel -%description devel -The Linux package contains the Linux kernel dev files - -%package drivers-gpu -Summary: Kernel GPU Drivers -Group: System Environment/Kernel -Requires: %{name} = %{version}-%{release} -%description drivers-gpu -The Linux package contains the Linux kernel drivers for GPU - -%package drivers-sound -Summary: Kernel Sound modules -Group: System Environment/Kernel -Requires: %{name} = %{version}-%{release} -%description drivers-sound -The Linux package contains the Linux kernel sound support - -%package docs -Summary: Kernel docs -Group: System Environment/Kernel -Requires: python3 -Requires: %{name} = %{version}-%{release} -%description docs -The Linux package contains the Linux kernel doc files - -%package tools -Summary: This package contains the 'perf' performance analysis tools for Linux kernel -Group: System/Tools -Requires: audit elfutils-libelf binutils-libs -Requires: xz-libs -Requires: slang -Requires: python3 -Requires: traceevent-plugins -%ifarch x86_64 -Requires: pciutils -%endif -%description tools -This package contains kernel tools like perf, turbostat and cpupower. - -%package python3-perf -Summary: Python bindings for applications that will manipulate perf events. -Group: Development/Libraries -Requires: linux-tools = %{version}-%{release} -Requires: python3 - -%description python3-perf -This package provides a module that permits applications written in the -Python programming language to use the interface to manipulate perf events. - -%package -n bpftool -Summary: Inspection and simple manipulation of eBPF programs and maps -Group: Development/Libraries -Requires: linux-tools = %{version}-%{release} - -%description -n bpftool -This package contains the bpftool, which allows inspection and simple -manipulation of eBPF programs and maps. - -%if 0%{?canister_build} -%package fips-canister -Summary: FIPS canister tarball -Group: System Environment/Kernel -%description fips-canister -The kernel fips-canister -%endif - -%prep -# Using autosetup is not feasible -%setup -q -n linux-%{version} -# Using autosetup is not feasible -%setup -q -T -D -b 3 -n linux-%{version} -# Using autosetup is not feasible -%setup -q -T -D -b 4 -n linux-%{version} - -# Apply CVE patches first -%autopatch -p1 -m3000 -M3999 - -# common -%autopatch -p1 -m0 -M49 - -%ifarch x86_64 -# VMW x86 -%autopatch -p1 -m50 -M60 -%endif - -#Secure -%autopatch -p1 -m61 -M63 - -# vmxnet3 -%autopatch -p1 -m65 -M66 - -# Backward compatibility -%if "%{dist}" == ".ph5" -%autopatch -p1 -m71 -M71 -%endif - -%ifarch aarch64 -# aarch64 patches -%autopatch -p1 -m200 -M219 -%endif - -%autopatch -p1 -m221 -M248 - -%ifarch x86_64 -# AWS x86 -%autopatch -p1 -m300 -M339 -%endif - -%autopatch -p1 -m701 -M715 - -# Patches for efa driver -pushd ../amzn-drivers-efa_linux_%{efa_version} -%autopatch -p1 -m1400 -M1400 -popd - -# Jitterentropy support and FIPS compliance -%autopatch -p1 -m10000 -M10000 - -# prep for viomem out-of-tree module -mkdir -p ../viomem -pushd ../viomem -cp %{SOURCE30} Makefile -cp %{SOURCE31} . -popd - -%if 0%{?fips} - -# Using autosetup is not feasible -%setup -q -T -D -b 10000 -n linux-%{version} - -cp -rf ../%{jent_name}/ crypto/ -rm crypto/jitterentropy-kcapi.c -mv crypto/%{jent_name}/jitterentropy-kcapi.c crypto/jitterentropy-kcapi.c -cp %{SOURCE10001} crypto/%{jent_name}/ -cp %{SOURCE10002} crypto/%{jent_name}/ -cp %{SOURCE10003} crypto/%{jent_name}/ - -install %{SOURCE10101} crypto/ -install %{SOURCE10102} crypto/ -install %{SOURCE10104} crypto/ -install %{SOURCE10105} crypto/ -install %{SOURCE10106} crypto/ -install %{SOURCE10300} crypto/ - -%autopatch -p1 -m10001 -M10004 -%autopatch -p1 -m10101 -M10118 -# FIPS canister plugins -%autopatch -p1 -m10200 -M10204 -# Jitterentropy proxy -%autopatch -p1 -m10300 -M10301 -%endif - -# Clean the build tree. It must be done before copying the canister. -%make_build mrproper - -%if 0%{?canister_usage} -tar -xvf /usr/lib/fips-canister/fips-canister-%{fips_canister_version}.tar.bz2 -# fips_canister.o is mentioned in obj-y. So, Makefile.modpost expects -# corresponding .cmd file. Empty content is ok, since we are not going -# to rebuild it. -touch crypto/.fips_canister.o.cmd -%endif - -%if 0%{?canister_build} -%autopatch -p1 -m11000 -M11017 -cp %{SOURCE11000} crypto/ -cp %{SOURCE11001} crypto/ -cp %{SOURCE11002} crypto/ -install -m 755 %{SOURCE11003} crypto/ -cp %{SOURCE11004} crypto/ -cp %{SOURCE11005} crypto/ -sed -i "0,/FIPS_CANISTER_VERSION.*$/s/FIPS_CANISTER_VERSION.*$/FIPS_CANISTER_VERSION \"%{lkcm_version}\"/" crypto/fips_integrity.c -sed -i "0,/FIPS_KERNEL_VERSION.*$/s/FIPS_KERNEL_VERSION.*$/FIPS_KERNEL_VERSION \"%{fips_certified_kernel_version}\"/" crypto/fips_integrity.c -%endif - -%if 0%{?acvp_build:1} -# ACVP test harness patches. -%autopatch -p1 -m12000 -M12012 -%endif - -%if 0%{?kat_build:1} -%autopatch -p1 -m12013 -M12014 -%endif - -cp %{SOURCE1} .config - -cat %{SOURCE20} %{SOURCE21} > photon-cert-bundle.pem - -sed -i 's/CONFIG_LOCALVERSION=""/CONFIG_LOCALVERSION="-%{release}"/' .config - -%if 0%{?photon_subrelease} >= 92 -# Update toolchain config for gcc 12.5.0 and binutils 2.46.1 -sed -i 's/CONFIG_CC_VERSION_TEXT="gcc (GCC) 12.2.0"/CONFIG_CC_VERSION_TEXT="gcc (GCC) 12.5.0"/' .config -sed -i 's/CONFIG_GCC_VERSION=120200/CONFIG_GCC_VERSION=120500/' .config -sed -i 's/CONFIG_AS_VERSION=23900/CONFIG_AS_VERSION=24601/' .config -sed -i 's/CONFIG_LD_VERSION=23900/CONFIG_LD_VERSION=24601/' .config -sed -i 's/CONFIG_GCC_ASM_GOTO_OUTPUT_BROKEN=y/CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y\nCONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT=y/' .config -# binutils >= 2.46.1 (used from sr92) supports RELR; make olddefconfig auto-enables these, add them explicitly to avoid config drift -%ifarch aarch64 -sed -i '/CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT=y/a CONFIG_TOOLS_SUPPORT_RELR=y' .config -sed -i '/CONFIG_ARCH_HAS_RELR=y/a CONFIG_RELR=y' .config -%endif -%endif - -%if 0%{?canister_build} -sed -i "s/# CONFIG_GCC_PLUGIN_PAD_CANISTER_STRUCTS is not set/CONFIG_GCC_PLUGIN_PAD_CANISTER_STRUCTS=y/" .config -sed -i "/# CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS is not set/d" .config -%endif - -%if 0%{?canister_usage} -sed -i "s/# CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS is not set/CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS=y/" .config -%endif - -%ifarch x86_64 -sed -e "s,@@NAME@@,%{name},g" \ - -e "s,@@VERSION_RELEASE@@,%{version}-%{release},g" \ - -e "s,@@LINUX_PH_GEN@@,%{linux_photon_generation},g" \ - %{SOURCE25} > linux-sbat.csv -%endif - -%if 0%{?acvp_build} -cp %{SOURCE12000} .config_acvp -%include %{SOURCE12001} -%else -%include %{SOURCE7} -%endif - -# Set/add CONFIG_CROSS_COMPILE= if needed -if [ %{_host} != %{_build} ]; then -grep -q CONFIG_CROSS_COMPILE= .config && sed -i '/^CONFIG_CROSS_COMPILE=/c\CONFIG_CROSS_COMPILE="%{_host}-"' .config || \ - echo 'CONFIG_CROSS_COMPILE="%{_host}-"' >> .config -fi - -%build -%make_build KBUILD_BUILD_VERSION="1-photon" \ - KBUILD_BUILD_HOST="photon" ARCH=%{arch} - -bldroot="${PWD}" - -ARCH_FLAGS="EXTRA_CFLAGS=-Wno-error=deprecated-declarations" - -%make_build ARCH=%{arch} -C tools \ - PYTHON=python3 $ARCH_FLAGS \ - perf - -ARCH_FLAGS+=" EXTRA_CFLAGS+=-DHAVE_LIBBPF_SUPPORT" -ARCH_FLAGS+=" EXTRA_CFLAGS+=-DBUILD_BPF_SKEL" - -%make_build ARCH=%{arch} -C tools \ - PYTHON=python3 $ARCH_FLAGS \ - bpf - -# Verify perf has no dependency on libunwind -tools/perf/perf -vv | grep libunwind | grep OFF -tools/perf/perf -vv | grep dwarf | grep on - -%ifarch x86_64 -# Build turbostat and cpupower -%make_build ARCH=%{arch} -C tools \ - PYTHON=python3 \ - turbostat cpupower -%endif - -# build ENA module -pushd ../amzn-drivers-ena_linux_%{ena_version}/kernel/linux/ena -cp configure.sh ena-conf.sh -./ena-conf.sh --kernel-dir ${bldroot} -%make_build -C ${bldroot} M="${PWD}" modules -popd - -# build EFA module -pushd ../amzn-drivers-efa_linux_%{efa_version}/kernel/linux/efa -mkdir -p build && cd build -%{cmake} -DKERNEL_DIR=${bldroot} .. -%{cmake_build} -popd - -# build viomem module -pushd ../viomem -%make_build -C ${bldroot} M="${PWD}" modules -popd - -%if 0%{?canister_build} -%include %{SOURCE11500} -%endif - -%install -%if 0%{?canister_build} -install -vdm 755 %{buildroot}%{_libdir}/fips-canister/ -tar -cvjf %{buildroot}%{_libdir}/fips-canister/fips-canister-%{version}-%{release}.tar.bz2 \ - crypto/fips_canister.o \ - crypto/fips_canister-kallsyms -%endif - -install -vdm 755 %{buildroot}%{_sysconfdir} -install -vdm 755 %{buildroot}/boot -install -vdm 755 %{buildroot}%{_docdir}/linux-%{uname_r} -install -vdm 755 %{buildroot}%{_usrsrc}/linux-headers-%{uname_r} -install -vdm 755 %{buildroot}%{_libdir}/debug/%{_modulesdir} - -%make_build ARCH=%{arch} \ - INSTALL_MOD_PATH=%{buildroot} \ - modules_install - -# install ENA module -bldroot="${PWD}" -pushd ../amzn-drivers-ena_linux_%{ena_version}/kernel/linux/ena -%make_build -C ${bldroot} M="${PWD}" \ - INSTALL_MOD_PATH=%{buildroot} \ - modules_install -popd - -# install EFA module -bldroot="${PWD}" -pushd ../amzn-drivers-efa_linux_%{efa_version}/kernel/linux/efa/build/src -%make_build -C ${bldroot} M="${PWD}" \ - INSTALL_MOD_PATH=%{buildroot} \ - modules_install -popd - -# install viomem module -pushd ../viomem -%make_build -C ${bldroot} M="${PWD}" \ - INSTALL_MOD_PATH=%{buildroot} \ - INSTALL_MOD_DIR=extra \ - modules_install -popd - -%ifarch x86_64 -# Verify for build-id match -# We observe different IDs sometimes -# TODO: debug it -ID1=$(readelf -n vmlinux | grep "Build ID") -./scripts/extract-vmlinux arch/x86/boot/bzImage > extracted-vmlinux -ID2=$(readelf -n extracted-vmlinux | grep "Build ID") -if [ "$ID1" != "$ID2" ] ; then - echo "ERROR: Build IDs do not match" >&2 - echo "ID1: $ID1" - echo "ID2: $ID2" - exit 1 -fi -install -vm 644 arch/x86/boot/bzImage %{buildroot}/boot/vmlinuz-%{uname_r} -%if "%{?signing_script}" != "" -%{signing_script} --file_type pe \ - --config_file %{signing_params} \ - --auth_file %{signing_auth} \ - --artifact %{buildroot}/boot/vmlinuz-%{uname_r} -%endif -%endif - -%ifarch aarch64 -install -vm 644 arch/arm64/boot/Image %{buildroot}/boot/vmlinuz-%{uname_r} -%endif - -# Restrict the permission on System.map-X file -install -vm 400 System.map %{buildroot}/boot/System.map-%{uname_r} -install -vm 644 .config %{buildroot}/boot/config-%{uname_r} -cp -r Documentation/* %{buildroot}%{_docdir}/linux-%{uname_r} - -%if 0%{?_enable_debug_packages} -install -vm 644 vmlinux %{buildroot}%{_libdir}/debug/%{_modulesdir}/vmlinux-%{uname_r} -# `perf test vmlinux` needs it -ln -sv vmlinux-%{uname_r} %{buildroot}%{_libdir}/debug/%{_modulesdir}/vmlinux -%endif - -cat > %{buildroot}/boot/linux-%{uname_r}.cfg << "EOF" -# GRUB Environment Block -photon_cmdline=init=/lib/systemd/systemd ro loglevel=3 quiet loadpin.enabled=0 audit=1 slab_nomerge -photon_linux=vmlinuz-%{uname_r} -photon_initrd=initrd.img-%{uname_r} -EOF - -# Register myself to initramfs -mkdir -p %{buildroot}%{_sharedstatedir}/initramfs/kernel - -# Cleanup dangling symlinks -rm -f %{buildroot}%{_modulesdir}/source \ - %{buildroot}%{_modulesdir}/build - -find . -name Makefile* -o -name Kconfig* -o -name *.pl | \ - xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy - -find arch/%{archdir}/include include scripts -type f | \ - xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy - -find $(find arch/%{archdir} -name include -o -name scripts -type d) -type f | \ - xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy - -find arch/%{archdir}/include Module.symvers include scripts -type f | \ - xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy - -%ifarch x86_64 -# CONFIG_STACK_VALIDATION=y requires objtool to build external modules -install -vsm 755 tools/objtool/{objtool,fixdep} \ - %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}/tools/objtool/ -%endif - -# copy .config manually to be where it's expected to be -cp .config %{buildroot}%{_usrsrc}/linux-headers-%{uname_r} - -ln -sfv "%{_usrsrc}/linux-headers-%{uname_r}" "%{buildroot}%{_modulesdir}/build" - -find %{buildroot}/lib/modules -name '*.ko' -print0 | xargs -0 chmod u+x - -%ifarch aarch64 -ARCH_FLAGS="EXTRA_CFLAGS=-Wno-error=format-overflow" -%endif - -%make_build -C tools ARCH=%{arch} DESTDIR=%{buildroot} \ - prefix=%{_prefix} $ARCH_FLAGS \ - PYTHON=python3 \ - perf_install - -%make_build -C tools/perf ARCH=%{arch} DESTDIR=%{buildroot} \ - prefix=%{_prefix} PYTHON=python3 \ - install-python_ext - -%ifarch x86_64 -%make_build -C tools ARCH=%{arch} DESTDIR=%{buildroot} \ - prefix=%{_prefix} mandir=%{_mandir} \ - PYTHON=python3 \ - turbostat_install cpupower_install -%endif - -%make_install %{?_smp_mflags} -C tools/bpf prefix=%{_prefix} - -mkdir -p %{buildroot}%{_modulesdir}/dracut.conf.d/ -cp -p %{SOURCE19} %{buildroot}%{_modulesdir}/dracut.conf.d/%{name}.conf - -%include %{SOURCE2} -%include %{SOURCE6} -%include %{SOURCE18} - -%post -/sbin/depmod -a %{uname_r} -ln -sf linux-%{uname_r}.cfg /boot/photon.cfg - -%post drivers-gpu -/sbin/depmod -a %{uname_r} - -%post drivers-sound -/sbin/depmod -a %{uname_r} - -%files -%defattr(-,root,root) -/boot/System.map-%{uname_r} -/boot/config-%{uname_r} -/boot/vmlinuz-%{uname_r} -%config(noreplace) /boot/linux-%{uname_r}.cfg -%defattr(0644,root,root) -%{_modulesdir}/* -%exclude %{_modulesdir}/build -%exclude %{_modulesdir}/kernel/drivers/gpu -%exclude %{_modulesdir}/kernel/sound -%exclude %{_includedir}/powercap.h -%ifarch aarch64 -%exclude %{_modulesdir}/kernel/drivers/staging/vc04_services/bcm2835-audio -%endif - -%config(noreplace) %{_modulesdir}/dracut.conf.d/%{name}.conf - -%files docs -%defattr(-,root,root) -%{_docdir}/linux-%{uname_r}/* -%ifarch x86_64 -%{_mandir}/* -%endif - -%files devel -%defattr(-,root,root) -%{_modulesdir}/build -%{_usrsrc}/linux-headers-%{uname_r} - -%files drivers-gpu -%defattr(-,root,root) -%{_modulesdir}/kernel/drivers/gpu - -%files drivers-sound -%defattr(-,root,root) -%{_modulesdir}/kernel/sound -%ifarch aarch64 -%{_modulesdir}/kernel/drivers/staging/vc04_services/bcm2835-audio -%endif - -%files tools -%defattr(-,root,root) -%ifarch aarch64 -%exclude %{_libdir}/traceevent -%endif -%{_bindir}/* -# exclude bpf_jit_disasm due to binutils-libs dependency -# 91, 92 differ in binutils version -%exclude %{_bindir}/bpf_jit_disasm -%{_sysconfdir}/bash_completion.d/perf -%{_libexecdir}/perf-core -%{_datadir}/perf-core -%{_docdir}/perf-tip -%{_includedir}/perf/* -%ifarch x86_64 -%{_includedir}/cpufreq.h -%{_includedir}/cpuidle.h -%{_libdir}/libcpupower.so* -%{_docdir}/packages/cpupower -%{_datadir}/bash-completion/completions/cpupower -%config(noreplace) %{_sysconfdir}/cpufreq-bench.conf -%{_sbindir}/cpufreq-bench -%{_datadir}/locale/*/LC_MESSAGES/cpupower.mo -%endif - -%files python3-perf -%defattr(-,root,root) -%{python3_sitelib}/* - -%files -n bpftool -%defattr(-,root,root) -%{_sbindir}/bpftool -%{_datadir}/bash-completion/completions/bpftool - -%if 0%{?canister_build} -%files fips-canister -%defattr(-,root,root) -%{_libdir}/fips-canister/* -%endif - %changelog +* Wed Oct 21 2026 Daniel Casota 6.12.113-2 +- Share canister_config.inc; build the canister against the current kernel +* Mon Oct 19 2026 Gerrit Photon 6.12.113-1 +- Update to version 6.12.113 +* Mon Oct 19 2026 Brennan Lamoreaux 6.12.112-7 +- Fixes CVE-2026-63858 +* Tue Oct 13 2026 Brennan Lamoreaux 6.12.112-6 +- Bring back the unrolled loop for small user copies on CPUs without FSRM +* Tue Oct 13 2026 Guruswamy Basavaiah 6.12.112-5 +- Fixes CVE-2026-80634 +* Tue Oct 13 2026 Shivani Agarwal 6.12.112-4 +- Fixes CVE-2026-74723, CVE-2026-89537 +* Tue Oct 13 2026 Shivani Agarwal 6.12.112-3 +- Fixes CVE-2026-90104 +* Mon Oct 12 2026 Keerthana K 6.12.112-2 +- Fixes CVE-2026-74752 +* Tue Oct 06 2026 Vamsi Krishna Brahmajosyula 6.12.112-1 +- Update to version 6.12.112 * Wed Sep 30 2026 Srinidhi Rao 6.12.111-3 - Fix jent mem free. * Mon Sep 28 2026 Shreenidhi Shedi 6.12.111-2 diff --git a/SPECS/linux/linux-6.12-packages.inc b/SPECS/linux/linux-6.12-packages.inc new file mode 100644 index 0000000000..dfbabbd382 --- /dev/null +++ b/SPECS/linux/linux-6.12-packages.inc @@ -0,0 +1,33 @@ +%package tools +Summary: This package contains the 'perf' performance analysis tools for Linux kernel +Group: System/Tools +Requires: audit elfutils-libelf binutils-libs +Requires: xz-libs +Requires: slang +Requires: python3 +Requires: traceevent-plugins +%ifarch x86_64 +Requires: pciutils +%endif +%description tools +This package contains kernel tools like perf, turbostat and cpupower. + +%package python3-perf +Summary: Python bindings for applications that will manipulate perf events. +Group: Development/Libraries +Requires: linux-tools = %{version}-%{release} +Requires: python3 + +%description python3-perf +This package provides a module that permits applications written in the +Python programming language to use the interface to manipulate perf events. + +%package -n bpftool +Summary: Inspection and simple manipulation of eBPF programs and maps +Group: Development/Libraries +Requires: linux-tools = %{version}-%{release} + +%description -n bpftool +This package contains the bpftool, which allows inspection and simple +manipulation of eBPF programs and maps. + diff --git a/SPECS/linux/linux-6.12.111-changelog.inc b/SPECS/linux/linux-6.12.111-changelog.inc new file mode 100644 index 0000000000..11d70fe868 --- /dev/null +++ b/SPECS/linux/linux-6.12.111-changelog.inc @@ -0,0 +1,1274 @@ +%changelog +* Thu Oct 08 2026 Daniel Casota 6.12.111-4 +- Share canister_config.inc; build the canister against the current kernel +* Wed Sep 30 2026 Srinidhi Rao 6.12.111-3 +- Fix jent mem free. +* Mon Sep 28 2026 Shreenidhi Shedi 6.12.111-2 +- Fix aarch64 build: set RELR configs for sr92+ (binutils >= 2.46.1) +* Wed Sep 23 2026 Ajay Kaher 6.12.111-1 +- Update to version 6.12.111 +* Wed Sep 23 2026 Keerthana K 6.12.109-9 +- Fixes CVE-2026-46325, CVE-2026-68242, CVE-2026-68258 +* Mon Sep 21 2026 Brennan Lamoreaux 6.12.109-8 +- Fixes CVE-2026-68426 +* Mon Sep 21 2026 Shivani Agarwal 6.12.109-7 +- Fixes CVE-2026-64388, CVE-2026-72031, CVE-2026-72341, CVE-2026-72439 +* Fri Sep 18 2026 Guruswamy Basavaiah 6.12.109-6 +- Fixes CVE-2026-68337, CVE-2026-68441 +* Thu Sep 17 2026 srinidhira0 6.12.109-5 +- Fixes CVE-2026-43464, CVE-2026-45932, CVE-2026-46324, CVE-2026-52956 +* Wed Sep 16 2026 Shreenidhi Shedi 6.12.109-4 +- Fix rpm build warnings +- Exclude bpf_jit_disasm binary to avoid binutils-libs dependency +* Wed Sep 16 2026 Keerthana K 6.12.109-3 +- Fixes CVE-2026-80785 +* Tue Sep 15 2026 Guruswamy Basavaiah 6.12.109-2 +- Fixes CVE-2026-74605, CVE-2026-74611 +* Fri Sep 11 2026 Ajay Kaher 6.12.109-1 +- Update to version 6.12.109 +* Fri Sep 11 2026 Ajay Kaher 6.12.107-11 +- Fixes CVE-2026-68399, CVE-2026-68404, CVE-2026-68409, CVE-2026-68441, CVE-2026-68447, CVE-2026-74571 +* Thu Sep 10 2026 Vamsi Krishna Brahmajosyula 6.12.107-10 +- version bump to build along with sysdig and falco +* Thu Sep 10 2026 Shivani Agarwal 6.12.107-9 +- Fixes CVE-2026-74571, CVE-2026-80580 +* Tue Sep 08 2026 Brennan Lamoreaux 6.12.107-8 +- Fixes CVE-2026-63853, CVE-2026-63879, CVE-2026-64036, CVE-2026-64058, CVE-2026-64078 +* Tue Sep 08 2026 srinidhira0 6.12.107-7 +- Fixes CVE-2026-64160 +* Tue Sep 08 2026 Ankit Jain 6.12.107-6 +- Fixes CVE-2026-72366, CVE-2026-72463, CVE-2026-72493, CVE-2026-74268, CVE-2026-74269 +* Tue Sep 08 2026 Shivani Agarwal 6.12.107-5 +- Fixes CVE-2026-72413, CVE-2026-72423 +* Mon Sep 07 2026 Brennan Lamoreaux 6.12.107-4 +- Fixes CVE-2026-72288, CVE-2026-72355 +* Wed Sep 02 2026 Brennan Lamoreaux 6.12.107-3 +- sched_info_enqueue: don't update last_queued on delayed migration +* Tue Sep 01 2026 Bo Gan 6.12.107-2 +- Backport upstream fix to solve ACPI PNP0C01/PNP0C02 device registration with platform driver +* Mon Aug 31 2026 Ajay Kaher 6.12.107-1 +- Update to version 6.12.107 +* Mon Aug 31 2026 Shivani Agarwal 6.12.103-11 +- Rebased acvp patches for linux-6.12.10* +* Mon Aug 31 2026 Keerthana K 6.12.103-10 +- Fix CVE-2026-68082 +* Tue Aug 25 2026 Ajay Kaher 6.12.103-9 +- Fixes CVEs +* Tue Aug 25 2026 Guruswamy Basavaiah 6.12.103-8 +- Fixes CVE-2026-63979, CVE-2026-64024, CVE-2026-64066, CVE-2026-64067, CVE-2026-64068 +* Fri Aug 21 2026 Srinidhi Rao 6.12.103-7 +- Make ima module to use lib sha1 instead of crypto shash +* Thu Aug 20 2026 Shreenidhi Shedi 6.12.103-6 +- Remove linux requires from linux-tools +- Users are expected to handle that part if there is a mismatch between tools and kernel +* Wed Aug 19 2026 Vamsi Krishna Brahmajosyula 6.12.103-5 +- Remove selinux=0 from default cmdline; SELinux is now disabled via selinux-policy +* Mon Aug 17 2026 Keerthana K 6.12.103-4 +- rap_plugin: fix function alignment gap and tighten caller-side check to match KCFI +- Update canister v6.12.60-18.2 with rap_plugin function alignment gap fix +* Sat Aug 15 2026 Vamsi Krishna Brahmajosyula 6.12.103-3 +- Extend to build for 91 and above +* Thu Aug 13 2026 srinidhira0 6.12.103-2 +- Fixes CVE-2026-52988, CVE-2026-52991, CVE-2026-53089, CVE-2026-53091 +* Mon Aug 10 2026 Gerrit Photon 6.12.103-1 +- Update to version 6.12.103 +* Thu Aug 06 2026 Vamsi Krishna Brahmajosyula 6.12.96-9 +- Make SELinux opt-in by default (add selinux=0 to default cmdline) +* Thu Aug 06 2026 Shivani Agarwal 6.12.96-8 +- Rebased acvp patches for linux-6.12.9* +* Wed Aug 05 2026 Gerrit Photon 6.12.96-7 +- Fixes CVE-2025-40158, CVE-2025-68745, CVE-2026-63872, CVE-2026-64076, CVE-2026-64077 +* Mon Aug 03 2026 Shivani Agarwal 6.12.96-6 +- Fixes CVE-2025-40074, CVE-2025-68353, CVE-2026-23208, CVE-2026-43009, CVE-2026-43485 +* Thu Jul 30 2026 Keerthana K 6.12.96-5 +- Update canister v6.12.60-18.1 with CVE-2026-64313 fix +* Thu Jul 30 2026 Keerthana K 6.12.96-4 +- Fixes CVE-2026-43197, CVE-2026-43198 +* Tue Jul 28 2026 Ankit Jain 6.12.96-3 +- Backport upstream randomize_kstack: Unify random source across arches +- (a96ef5848cb0). +* Mon Jul 27 2026 Ajay Kaher 6.12.96-2 +- Fixes CVE-2026-31589, CVE-2026-43414, CVE-2026-43465, CVE-2026-53224, CVE-2026-53246, CVE-2026-53260 +* Mon Jul 20 2026 Gerrit Photon 6.12.96-1 +- Update to version 6.12.96 +* Tue Jul 07 2026 Bo Gan 6.12.95-2 +- Fix for vmxnet3 BUG_ON in vmxnet3_get_hdr_len() +* Mon Jul 06 2026 Gerrit Photon 6.12.95-1 +- Update to version 6.12.95 +* Mon Jun 22 2026 Gerrit Photon 6.12.94-1 +- Update to version 6.12.94 +* Sat Jun 20 2026 Shreenidhi Shedi 6.12.92-3 +- Add mpc-devel to build requires +* Thu Jun 04 2026 Ankit Jain 6.12.92-2 +- Consolidate CVE patches into kernel_cve_patches.inc (range 3000-3999) +* Tue Jun 02 2026 Shivani Agarwal 6.12.92-1 +- Update to version 6.12.92 +- Fix CVE-2025-68359 and CVE-2026-43101 +- sshedi: fix vmlinux exclusion issue from debuginfo rpm +* Tue May 19 2026 Brennan Lamoreaux 6.12.87-2 +- Fix CVE-2026-43083 +* Mon May 11 2026 Brennan Lamoreaux 6.12.87-1 +- Update to version 6.12.87 +* Tue May 05 2026 Ankit Jain 6.12.78-5 +- Moved SPECS/linux/v6.12(common branch) to SPECS/linux(5.0 branch) +- Used merge commit to keep the history in 5.0 itself +* Mon Apr 27 2026 Ajay Kaher 6.12.78-4 +- Disable CONFIG_PER_VMA_LOCK +* Fri Apr 10 2026 Keerthana K 6.12.78-3 +- Drop unused HCX patches +* Sun Apr 05 2026 Vamsi Krishna Brahmajosyula 6.12.78-2 +- Fix linux-tools build with newer glibc +* Thu Mar 26 2026 Keerthana K 6.12.78-1 +- Update to version 6.12.78 +* Mon Mar 16 2026 Alexey Makhalov 6.12.69-7 +- SELinux as a default LSM +- Add erofs support +- Enable CONFIG_NF_FLOW_TABLE=m +* Mon Mar 09 2026 Keerthana K 6.12.69-6 +- Fix af_unix boolean registration from the wrong array to the correct one +* Wed Mar 04 2026 Keerthana K 6.12.69-5 +- HCX: Update enums to higher value to avoid UAPI conflict with new kernel features +* Mon Mar 02 2026 Shivani Agarwal 6.12.69-4 +- Fix aarch64 build +* Thu Feb 26 2026 Bo Gan 6.12.69-3 +- Enable MEMCG_V1 and CPUSETS_V1 for other flavors as generic/x86 does +* Fri Feb 20 2026 Alexey Makhalov 6.12.69-2 +- Support steal clock on TDX enabled VMs +* Fri Feb 20 2026 Shivani Agarwal 6.12.69-1 +- Update to version 6.12.69 +* Wed Feb 18 2026 Guruswamy Basavaiah 6.12.60-22 +- Disable Bluetooth and CAN support +- Fix requires on doc sub package +* Wed Feb 11 2026 Brennan Lamoreaux 6.12.60-21 +- Port ARM patches to v6.12 and include new patch for reporting guest crashes +- the VMware hypervisor +* Tue Feb 10 2026 Guruswamy Basavaiah 6.12.60-20 +- HCX patches ported to 6.12 kernel +* Fri Feb 06 2026 Keerthana K 6.12.60-19 +- Update canister version to 6.12.60-18 +* Thu Feb 05 2026 Brennan Lamoreaux 6.12.60-18 +- Improve FIPS canister matching plugin +* Tue Feb 03 2026 Ankit Jain 6.12.60-17 +- Add viomem kernel module +* Tue Feb 03 2026 Brennan Lamoreaux 6.12.60-16 +- Track internal/external requests to jitterentropy +* Mon Feb 02 2026 Srinidhi Rao 6.12.60-15 +- Enable CONFIG_TDX_GUEST_DRIVER required for CoCo. +* Thu Jan 22 2026 Keerthana K 6.12.60-14 +- Update canister version to 6.12.60-13 +* Thu Jan 15 2026 Alexey Makhalov 6.12.60-13 +- .config: added security hardened changes. +- canister_build: official build of the canister to include previous fix. +* Mon Jan 12 2026 Keerthana K 6.12.60-12 +- canister_build: Fix UAF (req->iv) in seqiv +* Wed Jan 07 2026 Keerthana K 6.12.60-11 +- Update jitterentropy driver names in canister_algs list +* Sat Jan 03 2026 Guruswamy Basavaiah 6.12.60-10 +- Introduce /sys/kernel/vmgenid +* Fri Jan 02 2026 Guruswamy Basavaiah 6.12.60-9 +- Enable CONFIG_NFT_FIB_IPV4 and CONFIG_NFT_FIB_IPV6 +* Mon Dec 29 2025 Guruswamy Basavaiah 6.12.60-8 +- Disable CONFIG_GCC_PLUGIN_LATENT_ENTROPY +* Mon Dec 22 2025 Kuntal Nayak 6.12.60-7 +- Fix SBAT validation order +* Fri Dec 19 2025 Guruswamy Basavaiah 6.12.60-6 +- Disable unique naming for *.ko.debug to make crash utility happy +* Fri Dec 12 2025 Kuntal Nayak 6.12.60-5 +- Inject photon KM certificate to trusted keyring +* Fri Dec 12 2025 Ankit Jain 6.12.60-4 +- Consuming canister. +* Thu Dec 11 2025 Ankit Jain 6.12.60-3 +- Remove module.h and other related metadata from aes/sha256.c +* Thu Dec 04 2025 Guruswamy Basavaiah 6.12.60-2 +- Enable CONFIG_ARM64_ERRATUM_3194386 +* Thu Dec 04 2025 Srinidhi Rao 6.12.60-1 +- Update to version 6.12.60. +* Wed Dec 03 2025 Ankit Jain 6.12.57-9 +- canister: Move out lib/crypto/{mpi/memneq/utils/gf128mul} of boundry +* Mon Dec 01 2025 Guruswamy Basavaiah 6.12.57-8 +- Enable CONFIG_GVE for gVNIC support +* Mon Dec 01 2025 Srinidhi Rao 6.12.57-7 +- Add VAES based alsos to canister approved list. +* Tue Nov 25 2025 Shivani Agarwal 6.12.57-6 +- Add kat_build flag for CMVP demo, Remove patch for allow external IVs for ACVP +* Tue Nov 25 2025 Guruswamy Basavaiah 6.12.57-5 +- Keep .BTF section in kernel modules +* Mon Nov 24 2025 Ankit Jain 6.12.57-4 +- Revert: canister: adding asn1_decoder library +* Fri Nov 14 2025 Brennan Lamoreaux 6.12.57-3 +- Add jitterentropy_rng_proxy +* Thu Nov 13 2025 Ankit Jain 6.12.57-2 +- Make lib/digsig to use lib SHA1 instead of crypto shash API +* Tue Nov 11 2025 Srinidhi Rao 6.12.57-1 +- Update to version 6.12.57 +* Tue Nov 11 2025 Ankit Jain 6.12.41-24 +- Removed '__SCT__cond_resched' symbol from canister +* Thu Nov 06 2025 Srinidhi Rao 6.12.41-23 +- Introduce new printk wrapper for FIPS canister. +* Thu Oct 30 2025 Ankit Jain 6.12.41-22 +- Moving rfc4543 of gcm out of canister boundry. +- Removed all approved/non-approved log indicators. +* Mon Oct 27 2025 Alexey Makhalov 6.12.41-21 +- Consume a canister binary via RPM dependency +* Fri Oct 24 2025 Guruswamy Basavaiah 6.12.41-20 +- perf: add patch to collect off-cpu sample +* Mon Oct 13 2025 Ankit Jain 6.12.41-19 +- Moving asn1-decoder API into canister boundry. +- Restore rsa-pkcs1pad encrypt/decrypt in rsa-pkcs1pad.c, disallow in fips mode +- Make sha1 combinations as fips_allowed=0 for self-test +* Mon Oct 06 2025 Alexey Makhalov 6.12.41-18 +- Canister: use __NO_FORTIFY and use memcpy as is +* Tue Sep 30 2025 Alexey Makhalov 6.12.41-17 +- Cleanup canister usage/build patch sets +* Tue Sep 30 2025 Alexey Makhalov 6.12.41-16 +- fips-canister: go back to tarball as the only way to preserve unstripped + fips_canister.o +* Mon Sep 29 2025 Ankit Jain 6.12.41-15 +- Moving MPI library API inside canister +* Mon Sep 29 2025 Shivani Agarwal 6.12.41-14 +- crypto: zero initialize memory allocated via sock_kmalloc +* Fri Sep 26 2025 Alexey Makhalov 6.12.41-13 +- fips-canister: prepare for RPM consumption instead of a tarball +* Fri Sep 26 2025 Alexey Makhalov 6.12.41-12 +- Canister: Perform partial relocation for local symbols +* Mon Sep 22 2025 Brennan Lamoreaux 6.12.41-11 +- Totally block external IVs for gcm(aes) +* Thu Sep 18 2025 Ajay Kaher 6.12.41-10 +- Fixes for vmwnet3 driver +* Wed Sep 17 2025 Alexey Makhalov 6.12.41-9 +- Canister: Move crypto_inc to lib/crypto/utils.c +* Wed Sep 17 2025 Alexey Makhalov 6.12.41-8 +- Canister: Move shasum helpers to the canister +* Thu Sep 11 2025 Srinidhi Rao 6.12.41-7 +- Select jitterentropy mem size as 32KB +- Disable jent_loop_shuffle in Jitterentropy. +- Add support for OSR(max) calculation. +* Thu Sep 11 2025 Alexey Makhalov 6.12.41-6 +- Canister: Add ghasg accelerator and lib/crypto utils +- Canister: fix shasum accelerators inclusion +- Canister: creation and integrity ehnancements +* Wed Sep 10 2025 Alexey Makhalov 6.12.41-5 +- Canister: introduce straight-line-speculation mitigation +* Mon Sep 08 2025 Shivani Agarwal 6.12.41-4 +- Resolve random EBUSY status for RSA signature verification test +* Mon Aug 25 2025 Shivani Agarwal 6.12.41-3 +- Removed rsa, cfb(aes) and added ecdsa-nist-p521 to tamper alg_list, +- Added HMAC and HASH DRBGs using SHA-384 in FIPS mode +* Thu Aug 21 2025 Alexey Makhalov 6.12.41-2 +- Add shasums accelerators +- Speedup algos registration in non-FIPS mode +* Thu Aug 14 2025 Srinidhi Rao 6.12.41-1 +- Update to version 6.12.41 +* Tue Aug 5 2025 Brennan Lamoreaux 6.12.34-9 +- Convert ACVP printk to pr_debug +* Mon Jul 28 2025 Brennan Lamoreaux 6.12.34-8 +- Convert canister structure spinlock fields to static memory +* Thu Jul 24 2025 Alexey Makhalov 6.12.34-7 +- Fix KAT build +- Spec clean up around fips macros +* Fri Jul 18 2025 Srinidhi Rao 6.12.34-6 +- Add sample collection support for Jitterentropy. +* Wed Jul 16 2025 Brennan Lamoreaux 6.12.34-5 +- Implement structure member type check within GCC plugins. Obsoletes +- old structure comparator test. +* Tue Jul 15 2025 Vamsi Krishna Brahmajosyula 6.12.34-4 +- linux: Use canister 6.12.34-3 +* Fri Jul 11 2025 Vamsi Krishna Brahmajosyula 6.12.34-3 +- Pending ECB move changes +* Thu Jul 03 2025 Alexey Makhalov 6.12.34-2 +- Move ecb out of canister +- Clean up and reorder SREL type & addon combinations +- Add readline-devel as a build requirement for tools +* Fri Jun 27 2025 Srinidhi Rao 6.12.34-1 +- Upgrade linux kernel to version 6.12.34. +* Wed Jun 25 2025 Vamsi Krishna Brahmajosyula 6.12.1-19 +- linux: Use canister version 6.12.1-18.ph5 +* Tue Jun 17 2025 Vamsi Krishna Brahmajosyula 6.12.1-18 +- Move sha1 functions out of canister boundry +- Do not register sha1 to crypt api when fips is enabled +* Fri Jun 13 2025 Brennan Lamoreaux 6.12.1-17 +- Introduce FIPS canister plugins +* Tue Jun 03 2025 Srinidhi Rao 6.12.1-16 +- Changes to Jitterentropy. +* Thu May 15 2025 Ankit Jain 6.12.1-15 +- Moved 'x86_cpu_id' struct access to fips canister wrapper +- Disable alloc_hook_tags if MEM_PROFILING is disabled +* Sat May 10 2025 Shreenidhi Shedi 6.12.1-14 +- Require coreutils and remove xml-security-c-devel from build requires +* Wed Apr 30 2025 Vamsi Krishna Brahmajosyula 6.12.1-13 +- Move rsa-pkcs1pad encrypt/decrypt functions out of canister boundry +- Fail rsa-pkcs1pad encrypt/decrypt in fips mode +- Use version-release for canister version, remove 6.0.0 +* Tue Apr 22 2025 Shivani Agarwal 6.12.1-12 +- Update canister binary v6.12.1-11 +* Thu Apr 17 2025 Shivani Agarwal 6.12.1-11 +- Remove essIV and echainIV from canister +* Tue Mar 25 2025 Ankit Jain 6.12.1-10 +- Sign kernel module using SHA3-512 hash algo +* Thu Mar 20 2025 Kuntal Nayak 6.12.1-9 +- Include SBAT and kexec patches +* Wed Mar 19 2025 Shivani Agarwal 6.12.1-8 +- Enable hmac(sha384) self-test +* Thu Mar 13 2025 Mukul Sikka 6.12.1-7 +- Release bump for SRP compliance +* Mon Mar 03 2025 Shivani Agarwal 6.12.1-6 +- Fix build error in acvp build and some spec refinement +* Mon Feb 24 2025 Keerthana K 6.12.1-5 +- Update fips canister to version 6.0.0-6.12.1-4 +- Improve fips canister struct definition check +* Mon Feb 24 2025 Keerthana K 6.12.1-4 +- Add Support for essiv echainiv in canister +* Mon Feb 24 2025 Keerthana K 6.12.1-3 +- Canister build for v6.12.x +* Thu Feb 20 2025 Srinidhi Rao 6.12.1-2 +- Enable cgroup_v1 support for mem & cpuset control groups. +* Tue Feb 04 2025 Srinidhi Rao 6.12.1-1 +- Upgrade to version 6.12.x. +* Thu Sep 12 2024 Ajay Kaher 6.6.28-2 +- Fix backward compatibility issue +* Thu Aug 29 2024 Srinidhi Rao 6.6.28-1 +- Upgrade to version 6.6.x. +* Fri May 17 2024 Srish Srinivasan 6.1.83-6 +- Re-enable CONFIG_SECURITY_SELINUX_DEVELOP to fix boot time regressions + in stig hardened systems. +* Fri May 17 2024 Srish Srinivasan 6.1.83-5 +- linux-generic will now obsolete and provide linux-secure as linux-secure + has been merged into linux-generic. This will ensure tdnf update on + Photon 5.0 is handled gracefully. +* Mon Apr 29 2024 Roye Eshed 6.1.83-4 +- Fix for CVE-2023-52586 by disabling CONFIG_DRM_MSM +* Mon Apr 29 2024 Vamsi Krishna Brahmajosyula 6.1.83-3 +- Enable CONFIG_ATA_PIIX for ata/pata intel SFF drivers replacing legacy IDE drivers +* Mon Apr 29 2024 Kuntal Nayak 6.1.83-2 +- Patched CVE-2024-26643 +* Mon Apr 29 2024 Keerthana K 6.1.83-1 +- Update to version 6.1.83 +- Fix CVE-2024-26642 +* Mon Apr 29 2024 Kuntal Nayak 6.1.81-5 +- Update SBAT verification +* Mon Apr 29 2024 Brennan Lamoreaux 6.1.81-4 +- Fix CVE-2024-52452 +* Mon Apr 29 2024 Ajay Kaher 6.1.81-3 +- Fix CVE-2023-52585 +* Mon Apr 29 2024 Srish Srinivasan 6.1.81-2 +- Patched CVE-2024-26585 +* Mon Apr 29 2024 Srish Srinivasan 6.1.81-1 +- Update to version 6.1.81, patched CVE-2024-26584 +* Mon Apr 29 2024 Guruswamy Basavaiah 6.1.79-2 +- Fixes CVE-2024-23307 and CVE-2024-22099 +* Mon Apr 29 2024 Vamsi Krishna Brahmajosyula 6.1.79-1 +- Update to version 6.1.79 +* Mon Apr 29 2024 Shivani Agarwal 6.1.77-1 +- Update to version 6.1.77 +* Mon Apr 29 2024 Ajay Kaher 6.1.75-1 +- Update to version 6.1.75 +* Mon Apr 29 2024 Guruswamy Basavaiah 6.1.70-6 +- Fix CVE-2023-6915 +* Mon Apr 29 2024 Bryan Tan 6.1.70-5 +- Fix refcount underflow in vsock +* Mon Apr 29 2024 Ajay Kaher 6.1.70-4 +- Fix CVE-2024-0340 +* Mon Apr 29 2024 Kuntal Nayak 6.1.70-3 +- Fix CVE-2023-39191 +* Mon Apr 29 2024 Kuntal Nayak 6.1.70-2 +- Fix CVE-2023-5633 +* Mon Apr 29 2024 Ashwin Dayanand Kamat 6.1.70-1 +- Update to version 6.1.70 +* Mon Apr 29 2024 Srish Srinivasan 6.1.62-13 +- print kernel crypto API return status for LKCM5 demo +- move all the ACVP related patches under a dedicated directory called + acvp_patches +* Mon Apr 22 2024 Keerthana K 6.1.62-12 +- Port secure kernel changes to generic +* Tue Mar 26 2024 Ashwin Dayanand Kamat 6.1.62-11 +- Fix proc_sched_rt01 ltp testcase failure +* Mon Feb 12 2024 Srish Srinivasan 6.1.62-10 +- Update canister version to 5.0.0-6.1.75-2 +* Fri Feb 02 2024 Shivani Agarwal 6.1.62-9 +- Enable CONFIG_PROC_EVENTS +* Wed Dec 20 2023 Keerthana K 6.1.62-8 +- Update canister to 5.0.0-6.1.62-13 +* Wed Dec 20 2023 Keerthana K 6.1.62-7 +- FIPS: Add log messages for approved and non-approved services +- Remove fips=2 logic +* Wed Dec 20 2023 Keerthana K 6.1.62-6 +- Added self-tests for rsa-pkcs1pad in combination with sha1, sha224, sha384 and sha512 +* Wed Dec 20 2023 Keerthana K 6.1.62-5 +- Update canister to 5.0.0-6.1.62-7 +* Wed Dec 20 2023 Keerthana K 6.1.62-4 +- Update canister to 5.0.0-6.1.62-2 +* Wed Dec 20 2023 Vamsi Krishna Brahmajosyula 6.1.62-3 +- Fix RSA self tests +* Wed Nov 29 2023 Brennan Lamoreaux 6.1.62-2 +- Fix for CVE-2023-2176 +* Wed Nov 29 2023 Ankit Jain 6.1.62-1 +- Update to version 6.1.62 +* Wed Nov 29 2023 Ankit Jain 6.1.60-4 +- Fix for CVE-2023-0597 +* Wed Nov 29 2023 Srish Srinivasan 6.1.60-3 +- Remove kat_build and its associated spec changes +* Wed Nov 29 2023 Srinidhi Rao 6.1.60-2 +- Jitterentropy sample collection support in ACVP Build. +* Wed Nov 29 2023 Vamsi Krishna Brahmajosyula 6.1.60-1 +- Upgrade to 6.1.60 +* Wed Nov 29 2023 Alexey Makhalov 6.1.56-9 +- Add .sbat section for bzImage +- Introduce SBAT verificaion in addition to signature on kexec +* Wed Nov 29 2023 Srish Srinivasan 6.1.56-8 +- Upgrade canister to 5.0.0-6.1.56-6 +* Wed Nov 29 2023 Srish Srinivasan 6.1.56-7 +- Added cts to crypto self-tests +- Removed rsa(pkcs1pad, sha256), rsa(pkcs1pad, sha512), + cbc, and ctr from crypto self-tests +- Added ECC pubkey generation and verification success messages +* Wed Nov 29 2023 Keerthana K 6.1.56-6 +- Modified ecdh-nist-p384 vector to generate ECC keypair +* Wed Nov 29 2023 Vamsi Krishna Brahmajosyula 6.1.56-5 +- Upgrade canister to 5.0.0-6.1.56-3 +* Wed Nov 29 2023 Srish Srinivasan 6.1.56-4 +- Adding support for ACVP build +- Added jitterentropy implementation of SHA3-256 +* Wed Nov 29 2023 Srish Srinivasan 6.1.56-3 +- Add missing self-test vector for ecdh-nist-p384 with genkey +* Wed Nov 29 2023 Srinidhi Rao 6.1.56-2 +- Jitterentropy wrapper changes. +* Wed Nov 29 2023 Vamsi Krishna Brahmajosyula 6.1.56-1 +- Upgrade to 6.1.56 +* Wed Nov 29 2023 Vamsi Krishna Brahmajosyula 6.1.53-6 +- Fix for CVE-2023-42754 +* Wed Nov 29 2023 Keerthana K 6.1.53-5 +- Enable fips and update canister binary version 5.0.0-6.1.53-4 +- Removed jent_lock struct from ignore list of check_fips_canister +* Wed Nov 29 2023 Keerthana K 6.1.53-4 +- Add pkcs1pad test vectors in crytpo_self_test module +* Thu Nov 23 2023 Keerthana K 6.1.53-3 +- Fix CVE-2023-42756 +* Thu Nov 23 2023 Keerthana K 6.1.53-2 +- Fix for CVE-2023-42755 +* Thu Nov 23 2023 Roye Eshed 6.1.53-1 +- Update to version 6.1.53 +* Thu Nov 23 2023 Ajay Kaher 6.1.45-7 +- Fix: net: roundup issue in kmalloc_reserve() +* Thu Nov 23 2023 Brennan Lamoreaux 6.1.45-6 +- Move all prep to %prep section +* Thu Nov 23 2023 Srish Srinivasan 6.1.45-5 +- LKCM 5.0 specific changes to crypto self-tests and tcrypt +* Thu Nov 23 2023 Keerthana K 6.1.45-4 +- Build with jitterentropy v3.4.1 +* Thu Nov 23 2023 Keerthana K 6.1.45-3 +- Update fips_canister version 6.1.45-3 +* Wed Nov 22 2023 Ankit Jain 6.1.45-2 +- Fix for CVE-2023-28464 +* Wed Nov 22 2023 Ajay Kaher 6.1.45-1 +- Update to version 6.1.45 +* Wed Nov 22 2023 Srish Srinivasan 6.1.41-4 +- Enable CONFIG_DEBUG_INFO_BTF=y +* Wed Nov 22 2023 Kuntal Nayak 6.1.41-3 +- Enable Kconfig CONFIG_KEXEC_FILE for kexec signature verify +* Wed Nov 22 2023 Ajay Kaher 6.1.41-2 +- Fix: unconditional preserve CR4.MCE +* Wed Nov 22 2023 Ashwin Dayanand Kamat 6.1.41-1 +- Update to version 6.1.41 +* Wed Nov 22 2023 Ashwin Dayanand Kamat 6.1.37-1 +- Update to version 6.1.37 +* Wed Nov 22 2023 Brennan Lamoreaux 6.1.32-1 +- Update to version 6.1.32 +* Wed Nov 22 2023 Guruswamy Basavaiah 6.1.28-5 +- disable kconfig CONFIG_RAID6_PQ_BENCHMARK +* Sun Nov 19 2023 Shreenidhi Shedi 6.1.28-4 +- Bump version as a part of openssl upgrade +* Tue Oct 03 2023 Kuntal Nayak 6.1.28-3 +- Kconfig to lockdown kernel in UEFI Secure Boot +* Sat Sep 23 2023 Guruswamy Basavaiah 6.1.28-2 +- Cherry pick performance over security option for RETBleed (pos=1) +- patch from Photon 4.0 +* Wed Sep 20 2023 Ankit Jain 6.1.28-1 +- Update to version 6.1.28 +* Mon Jul 17 2023 Keerthana K 6.1.10-15 +- Use canister version 5.0.0-6.1.37-2 +* Tue Jul 11 2023 Shreenidhi Shedi 6.1.10-14 +- Bump version as a part of elfutils upgrade +* Fri Apr 28 2023 Shreenidhi Shedi 6.1.10-13 +- Remove dracut & initramfs from requires +* Wed Apr 26 2023 Shreenidhi Shedi 6.1.10-12 +- Remove rpi fan driver patch +* Wed Apr 05 2023 Ajay Kaher 6.1.10-11 +- perf: remove libunwind dependency +* Fri Mar 31 2023 Srivatsa S. Bhat (VMware) 6.1.10-10 +- Expose Photon kernel macros to simplify building out-of-tree drivers. +* Thu Mar 30 2023 Brennan Lamoreaux 6.1.10-9 +- Update drivers +- iavf: 4.8.2 +- ice: 1.11.14 +- i40e: 2.22.18 +* Sun Mar 26 2023 Vamsi Krishna Brahmajosyula 6.1.10-8 +- Use canister version 5.0.0-6.1.10-8 +* Tue Mar 21 2023 Shreenidhi Shedi 6.1.10-7 +- Fix initramfs trigger +* Thu Mar 16 2023 Keerthana K 6.1.10-6 +- Enable FIPS canister binary usage +* Tue Mar 07 2023 Him Kalyan Bordoloi 6.1.10-5 +- Add ENA and EFA drivers to ARM build +* Tue Mar 07 2023 Shreenidhi Shedi 6.1.10-4 +- Fix initrd driver list for aarch64 +* Thu Mar 02 2023 Shreenidhi Shedi 6.1.10-3 +- Fix initrd generation logic +- Add dracut, initramfs to requires +* Fri Feb 24 2023 Ankit Jain 6.1.10-2 +- Exclude iavf.conf +* Wed Feb 22 2023 Bo Gan 6.1.10-1 +- Update to 6.1.10 +* Tue Feb 21 2023 Srivatsa S. Bhat (VMware) 6.0.7-11 +- Enable turbostat to work in the guest on VMware hypervisor. +* Tue Feb 21 2023 Srivatsa S. Bhat (VMware) 6.0.7-10 +- Update i40e driver to v2.19.3 to prevent kernel warnings +* Mon Feb 20 2023 Ajay Kaher 6.0.7-9 +- exclude man dir from linux-tools +* Thu Feb 02 2023 Shreenidhi Shedi 6.0.7-8 +- Fix requires +* Wed Jan 25 2023 Ashwin Dayanand Kamat 6.0.7-7 +- Enable CONFIG_PCI_PF_STUB +* Tue Jan 17 2023 Him Kalyan Bordoloi 6.0.7-6 +- Depricate linux-aws kernel flavor +* Fri Jan 13 2023 Srivatsa S. Bhat (VMware) 6.0.7-5 +- Fix IRQ affinities of i40e, iavf and ice drivers +* Mon Jan 09 2023 Srivatsa S. Bhat (VMware) 6.0.7-4 +- Update Intel drivers i40e to v2.16.11, iavf to v4.5.3 and ice to v1.9.11 +* Fri Jan 06 2023 Srivatsa S. Bhat (VMware) 6.0.7-3 +- Port patch to allow disabling PCI resets from vfio_pci driver to 6.0 +- Move the module parameter disable_resets from vfio_pci to +- vfio_pci_core module, to make it work with kernel 6.0. +* Fri Jan 06 2023 Vamsi Krishna Brahmajosyula 6.0.7-2 +- Bump up due to change in elfutils +* Tue Dec 20 2022 Bo Gan 6.0.7-1 +- Update to 6.0.7 +- Enable PREEMPT_DYNAMIC +- Enable extra Dell platform drivers. +- Enable security configs, RANDOMIZE_KSTACK_OFFSET and others. +- Change from SLAB to SLUB +- aarch64/config: match x86 on non-arch specific setting. +- aarch64/config: don't set CAVIUM_ERRATUM_23154 and wait for ESX support +* Mon Dec 19 2022 Dweep Advani 5.10.142-5 +- Ignore warnings to keep building tools +* Mon Oct 31 2022 Prashant S Chauhan 5.10.142-4 +- Dont throw error for supported deprecated modules of py311 +* Thu Oct 20 2022 Vamsi Krishna Brahmajosyula 5.10.142-3 +- Fix build with latest toolchain +* Wed Sep 28 2022 Srivatsa S. Bhat (VMware) 5.10.142-2 +- Replace rpm macro 'name' with 'linux' to be consistent with other flavors. +* Wed Sep 28 2022 Srivatsa S. Bhat (VMware) 5.10.142-1 +- Update to version 5.10.142 +* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.132-1 +- Update to version 5.10.132 +* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.118-10 +- Backport fixes for CVE-2022-0500 +* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.118-9 +- Fix for CVE-2022-2585, CVE-2022-2586 and CVE-2022-2588 +* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.118-8 +- Update iavf driver to v4.4.2 +- Update ice driver to v1.8.3 +* Mon Sep 26 2022 Srivatsa S. Bhat (VMware) 5.10.118-7 +- .config: enable CONFIG_NET_ACT_SIMP +* Mon Sep 26 2022 Srivatsa S. Bhat (VMware) 5.10.118-6 +- .config: enable CONFIG_X86_CPU_RESCTRL +* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-5 +- Enable cgroup v1 stats +- .config: enable PERCPU_STATS +* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-4 +- Avoid TSC recalibration +* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-3 +- Fix for CVE-2022-21505 +* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-2 +- VMCI patches & configs +* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-1 +- Update to version 5.10.118 +* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.109-4 +- Fix for CVE-2022-1966, CVE-2022-1972 +* Thu Sep 22 2022 Srivatsa S. Bhat (VMware) 5.10.109-3 +- Fix for CVE-2022-21499 +* Thu Sep 22 2022 Srivatsa S. Bhat (VMware) 5.10.109-2 +- Fix for CVE-2022-29582 +* Wed Sep 21 2022 Srivatsa S. Bhat (VMware) 5.10.109-1 +- Update to version 5.10.109 +* Tue Sep 20 2022 Srivatsa S. Bhat (VMware) 5.10.103-4 +- Fix for CVE-2022-1016 +* Tue Sep 20 2022 Srivatsa S. Bhat (VMware) 5.10.103-3 +- Fix SEV and Hypercall alternative inst. patches +* Tue Sep 20 2022 Shreenidhi Shedi 5.10.103-2 +- Add bpftool subpackage +* Thu Sep 15 2022 Srivatsa S. Bhat (VMware) 5.10.103-1 +- Update to version 5.10.103 +* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-5 +- Fix for CVE-2022-0435 +* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-4 +- Fix for CVE-2022-0492 +* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-3 +- Fix for CVE-2022-22942 +* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-2 +- Fix CVE-2022-0330 +* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-1 +- Update to version 5.10.93 +* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.83-5 +- Fix CVE-2021-4155 and CVE-2021-4204 +* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.83-4 +- Enable crypto related configs in aarch64 similar to x86_64 +- crypto_self_test and broken kattest module enhancements +* Tue Sep 13 2022 Srivatsa S. Bhat (VMware) 5.10.83-3 +- mm: fix percpu allocation for memoryless nodes +- pvscsi: fix disk detection issue +* Tue Sep 13 2022 Srivatsa S. Bhat (VMware) 5.10.83-2 +- remove tmem, lvm in add-drivers list +- lvm drivers are built as part of dm-mod +- tmem module no longer exists +* Mon Sep 12 2022 Srivatsa S. Bhat (VMware) 5.10.83-1 +- Update to version 5.10.83 +* Mon Sep 12 2022 Srivatsa S. Bhat (VMware) 5.10.78-14 +- .config: Enable eBPF net packet filtering support. +* Mon Aug 08 2022 Shreenidhi Shedi 5.10.78-13 +- Scriptlets fixes and improvements +* Wed Jul 20 2022 Tejaswini Jayaramaiah 5.10.78-12 +- Enable CONFIG_CGROUP_BPF in config to run containers with cgroup v2 +* Wed Jul 13 2022 Srivatsa S. Bhat (VMware) 5.10.78-11 +- Add PCI quirk to allow multiple devices under the same virtual +- PCI bridge to be put into separate IOMMU groups. +* Tue Jul 12 2022 Sharan Turlapati 5.10.78-10 +- Allow PCI resets to be disabled from vfio_pci +* Wed Jun 29 2022 Keerthana K 5.10.78-9 +- Reduce FIPS canister memory footprint by disabling CONFIG_KALLSYMS_ALL +- Add only fips_canister-kallsyms to vmlinux instead of all symbols +* Fri Jun 24 2022 Shreenidhi Shedi 5.10.78-8 +- Fix debug_package macro usage while adding vmlinux to debuginfo rpm +* Tue Jun 14 2022 Brennan Lamoreaux 5.10.78-7 +- Enable CONFIG_LIVEPATCH, which requires enabling ftrace, and related. +* Tue Apr 05 2022 Shreenidhi Shedi 5.10.78-6 +- Enable CONFIG_EXT2_FS_XATTR & related parameters +* Tue Jan 25 2022 Alexey Makhalov 5.10.78-5 +- .config: enable squashfs module, enable crypto user api rng. +* Thu Nov 25 2021 Ashwin Dayanand Kamat 5.10.78-4 +- Disable md5 algorithm for sctp if fips is enabled. +* Fri Nov 19 2021 Keerthana K 5.10.78-3 +- Add arm64 hypervisor detection and kmsg dumper +* Thu Nov 11 2021 Satya Naga Vasamsetty 5.10.78-2 +- compile with openssl 3.0.0 +* Mon Nov 08 2021 Vikash Bansal 5.10.78-1 +- Update to version 5.10.78 +* Thu Oct 28 2021 Sharan Turlapati 5.10.75-1 +- Update to version 5.10.75 +* Thu Sep 09 2021 Alexey Makhalov 5.10.61-2 +- .config enable CONFIG_MOUSE_PS2_VMMOUSE and CONFIG_INPUT_UINPUT +- Enable sta by default +* Fri Aug 27 2021 Ankit Jain 5.10.61-1 +- Update to version 5.10.61 +* Wed Aug 18 2021 Keerthana K 5.10.52-2 +- Update ice driver to v1.6.4 +- Update i40e driver to v2.15.9 +- Update iavf driver to v4.2.7 +* Fri Jul 23 2021 Him Kalyan Bordoloi 5.10.52-1 +- Update to version 5.10.52 +* Thu Jul 15 2021 Him Kalyan Bordoloi 5.10.46-2 +- Fix for CVE-2021-33909 +* Mon Jun 28 2021 Sharan Turlapati 5.10.46-1 +- Update to version 5.10.46 +* Tue Jun 22 2021 Sharan Turlapati 5.10.42-3 +- Fix for CVE-2021-3609 +* Thu Jun 10 2021 Keerthana K 5.10.42-2 +- Added script to check structure compatibility between fips_canister.o and vmlinux. +* Thu Jun 03 2021 Keerthana K 5.10.42-1 +- Update to version 5.10.42 +- Remove XR usb driver support +- .config: Enable CONFIG_FANOTIFY_ACCESS_PERMISSIONS +* Wed Jun 02 2021 Keerthana K 5.10.35-4 +- Fix for CVE-2021-3573 +* Thu May 20 2021 Ajay Kaher 5.10.35-3 +- Add Rpi fan driver +* Thu May 20 2021 Ajay Kaher 5.10.35-2 +- Fix for CVE-2021-3564 +* Mon May 17 2021 Ajay Kaher 5.10.35-1 +- Update to version 5.10.35 +* Thu May 13 2021 Sharan Turlapati 5.10.25-10 +- Fix for CVE-2021-23133 +* Tue May 11 2021 Ankit Jain 5.10.25-9 +- .config: Enable MLX5_INFINIBAND +* Tue May 11 2021 Srivatsa S. Bhat (VMware) 5.10.25-8 +- Fix CVE-2020-26147, CVE-2020-24587, CVE-2020-24586, CVE-2020-24588, +- CVE-2020-26145, CVE-2020-26141 +* Tue May 11 2021 Srivatsa S. Bhat (VMware) 5.10.25-7 +- Fix CVE-2021-3489, CVE-2021-3490, CVE-2021-3491 +* Tue May 04 2021 Sharan Turlapati 5.10.25-6 +- Remove buf_info from device accessible structures in vmxnet3 +* Thu Apr 29 2021 Alexey Makhalov 5.10.25-5 +- Update canister binary. +- use jent by drbg and ecc. +- Enable hmac(sha224) self test and broket KAT test. +* Thu Apr 22 2021 Keerthana K 5.10.25-4 +- Remove hmac(sha224) test from broken kat test. +* Mon Apr 19 2021 Sharan Turlapati 5.10.25-3 +- Fix for CVE-2021-23133 +* Thu Apr 15 2021 Srinidhi Rao 5.10.25-2 +- Fix for CVE-2021-29154 +* Mon Mar 22 2021 Him Kalyan Bordoloi 5.10.25-1 +- Update to version 5.10.25 +* Sun Mar 21 2021 Alexey Makhalov 5.10.21-3 +- Do not execute some tests twice +- Support future disablement of des3 +- Do verbose build +- Canister update. +* Mon Mar 15 2021 Srinidhi Rao 5.10.21-2 +- Use jitterentropy rng instead of urandom in rng module. +* Mon Mar 08 2021 Vikash Bansal 5.10.21-1 +- Update to version 5.10.21 +* Mon Mar 01 2021 Alexey Makhalov 5.10.4-17 +- FIPS canister update +* Fri Feb 19 2021 Srivatsa S. Bhat (VMware) 5.10.4-16 +- Fix /boot/photon.cfg symlink when /boot is a separate partition. +* Fri Feb 19 2021 Ajay Kaher 5.10.4-15 +- Added SEV-ES improvement patches +* Thu Feb 18 2021 Ajay Kaher 5.10.4-14 +- Enable CONFIG_WDAT_WDT +* Thu Feb 18 2021 Ajay Kaher 5.10.4-13 +- lower the loglevel for floppy driver +* Thu Feb 18 2021 Sharan Turlapati 5.10.4-12 +- Enable CONFIG_IFB +* Wed Feb 17 2021 Ankit Jain 5.10.4-11 +- Added latest out of tree version of Intel ice driver +* Tue Feb 16 2021 Alexey Makhalov 5.10.4-10 +- Fix perf compilation issue with gcc-10.2.0 for aarch64 +* Mon Feb 15 2021 Keerthana K 5.10.4-9 +- Added crypto_self_test and kattest module. +- These patches are applied when kat_build is enabled. +* Wed Feb 03 2021 Him Kalyan Bordoloi 5.10.4-8 +- Update i40e driver to v2.13.10 +- Add out of tree iavf driver +- Enable CONFIG_NET_TEAM +* Thu Jan 28 2021 Alexey Makhalov 5.10.4-7 +- Use secure FIPS canister. +* Mon Jan 25 2021 Ankit Jain 5.10.4-6 +- Enabled CONFIG_WIREGUARD +* Fri Jan 22 2021 Keerthana K 5.10.4-5 +- Build kernel with FIPS canister. +* Wed Jan 20 2021 Alexey Makhalov 5.10.4-4 +- Handle module.lds for aarch64 in the same way as for x86_64 +* Wed Jan 13 2021 Sharan Turlapati 5.10.4-3 +- Remove traceevent/plugins from linux-tools +* Mon Jan 11 2021 Bo Gan 5.10.4-2 +- Fix aarch64 build failure +* Mon Jan 04 2021 Bo Gan 5.10.4-1 +- Update to 5.10.4 +- Drop out-of-tree SEV-ES functional patches (already upstreamed). +* Wed Dec 09 2020 Ajay Kaher 5.9.0-9 +- To dynamic load Overlays adding of_configfs patches v5.9.y. +* Tue Dec 01 2020 Prashant S Chauhan 5.9.0-8 +- Added ami for arm support in linux generic, added multiple drivers +- in aarch64 to support aws ami +* Thu Nov 12 2020 Ajay Kaher 5.9.0-7 +- .config: support for floppy disk and ch341 usb to serial +* Wed Nov 11 2020 Tapas Kundu 5.9.0-6 +- Fix perf python script for compatibility with python 3.9 +* Tue Nov 10 2020 Keerthana K 5.9.0-5 +- Fix CVE-2020-8694 +* Fri Nov 06 2020 Keerthana K 5.9.0-4 +- Fix CVE-2020-25704 +* Tue Nov 03 2020 Srinidhi Rao 5.9.0-3 +- Remove the support of fipsify and hmacgen +* Tue Oct 27 2020 Piyush Gupta 5.9.0-2 +- Fix aarch64 build failure due to missing CONFIG_FB_ARMLCD +* Mon Oct 19 2020 Bo Gan 5.9.0-1 +- Update to 5.9.0 +* Wed Sep 30 2020 Srivatsa S. Bhat (VMware) 5.9.0-rc7.1 +- Update to version 5.9.0-rc7 +* Mon Sep 21 2020 Bo Gan 5.9.0-rc4.1 +- Update to 5.9.0-rc4 +- AMD SEV-ES Support +- RPI4 Support +- config_common: Reduce linked-in modules +- Drop NXP LS10XXa board support +* Tue Sep 08 2020 Satya Naga Vasamsetty 4.19.127-6 +- Fix build failure with binutils updated to 2.35 +* Wed Aug 05 2020 Sharan Turlapati 4.19.127-5 +- Enable CONFIG_TCP_CONG_BBR +* Wed Jul 29 2020 Alexey Makhalov 4.19.127-4 +- .config: add zram module +* Mon Jul 27 2020 Srivatsa S. Bhat (VMware) 4.19.127-3 +- Fix CVE-2020-14331 +* Fri Jul 17 2020 Srivatsa S. Bhat (VMware) 4.19.127-2 +- Fix aarch64 build failure due to missing i40e man pages. +* Tue Jun 23 2020 Keerthana K 4.19.127-1 +- Update to version 4.19.127 +* Tue Jun 16 2020 Him Kalyan Bordoloi 4.19.112-14 +- Add latest out of tree version of i40e driver +* Wed Jun 10 2020 Srivatsa S. Bhat (VMware) 4.19.112-13 +- Enable CONFIG_VFIO_NOIOMMU +* Tue Jun 09 2020 Alexey Makhalov 4.19.112-12 +- Add intel_sgx module (-drivers-intel-sgx subpackage) +* Fri Jun 05 2020 Ankit Jain 4.19.112-11 +- Enabled CONFIG_BINFMT_MISC +* Tue Jun 02 2020 Vikash Bansal 4.19.112-10 +- Add patch to fix CVE-2019-18885 +* Mon Jun 1 2020 Shreenidhi Shedi 4.19.112-9 +- Keep modules of running kernel till next boot +* Sat May 30 2020 Alexey Makhalov 4.19.112-8 +- .config: add gs_usb module +* Wed May 20 2020 Tapas Kundu 4.19.112-7 +- Added linux-python3-perf subpackage. +- Added turbostat and cpupower to tools for x86_64. +- linux-python3-perf replaces python3-perf. +* Fri May 15 2020 Him Kalyan Bordoloi 4.19.112-6 +- Add uio_pic_generic driver support in config +* Wed May 06 2020 Siddharth Chandrasekaran 4.19.112-5 +- Add patch to fix CVE-2020-10711 +* Wed Apr 29 2020 Keerthana K 4.19.112-4 +- Photon-checksum-generator version update to 1.1. +* Wed Apr 29 2020 Srivatsa S. Bhat (VMware) 4.19.112-3 +- Enable additional config options. +* Wed Apr 15 2020 Vikash Bansal 4.19.112-2 +- HMAC-SHA256 digest of hmac_generator module moved to hmacgen package +* Wed Apr 08 2020 Srivatsa S. Bhat (VMware) 4.19.112-1 +- Update to version 4.19.112 +* Tue Mar 31 2020 Vikash Bansal 4.19.104-2 +- hmac generation of crypto modules and initrd generation changes if fips=1 +* Wed Mar 25 2020 Vikash Bansal 4.19.104-1 +- Update to version 4.19.104 +* Mon Mar 23 2020 Alexey Makhalov 4.19.97-8 +- Fix perf compilation issue with binutils >= 2.34. +* Mon Mar 16 2020 Keerthana K 4.19.97-7 +- Adding Enhances depedency to hmacgen. +* Wed Mar 04 2020 Vikash Bansal 4.19.97-6 +- Backporting of patch continuous testing of RNG from urandom +* Tue Feb 25 2020 Ajay Kaher 4.19.97-5 +- Fix CVE-2019-16234 +* Tue Feb 11 2020 Keerthana K 4.19.97-4 +- Add photon-checksum-generator source tarball and remove hmacgen patch. +- Exclude hmacgen.ko from base package. +* Fri Jan 31 2020 Ajay Kaher 4.19.97-3 +- Move snd-bcm2835.ko to linux-drivers-sound rpm +* Wed Jan 29 2020 Keerthana K 4.19.97-2 +- Update tcrypt to test drbg_pr_sha256 and drbg_nopr_sha256. +- Update testmgr to add drbg_pr_ctr_aes256 test vectors. +* Fri Jan 17 2020 Srivatsa S. Bhat (VMware) 4.19.97-1 +- Update to version 4.19.97 +* Thu Jan 16 2020 Srinidhi Rao 4.19.87-6 +- Enable DRBG HASH and DRBG CTR support. +* Wed Jan 08 2020 Ajay Kaher 4.19.87-5 +- Enabled configs RTC_DRV_PL030, RTC_DRV_PL031 +* Fri Jan 03 2020 Keerthana K 4.19.87-4 +- Modify tcrypt to remove tests for algorithms that are not supported in photon. +- Added tests for DH, DRBG algorithms. +* Thu Jan 02 2020 Keerthana K 4.19.87-3 +- Update fips Kat tests patch. +* Mon Dec 09 2019 Alexey Makhalov 4.19.87-2 +- Cross compilation support +* Fri Dec 06 2019 Ajay Kaher 4.19.87-1 +- Update to version 4.19.87 +* Tue Dec 03 2019 Keerthana K 4.19.84-4 +- Adding hmac sha256/sha512 generator kernel module for fips. +* Tue Nov 26 2019 Ajay Kaher 4.19.84-3 +- Fix CVE-2019-19062, CVE-2019-19066, CVE-2019-19072, +- CVE-2019-19073, CVE-2019-19074, CVE-2019-19078 +* Mon Nov 18 2019 Alexey Makhalov 4.19.84-2 +- .config: infiniband support. +* Tue Nov 12 2019 Srivatsa S. Bhat (VMware) 4.19.84-1 +- Update to version 4.19.84 +- Fix CVE-2019-18814 +* Fri Nov 08 2019 Srivatsa S. Bhat (VMware) 4.19.82-1 +- Update to version 4.19.82 +* Thu Nov 07 2019 Jorgen Hansen (VMware) 4.19.79-3 +- Fix vsock QP detach with outgoing data +* Thu Oct 24 2019 Ajay Kaher 4.19.79-2 +- Enabled WiFi and BT config for Dell 5K. +* Tue Oct 15 2019 Ajay Kaher 4.19.79-1 +- Update to version 4.19.79 +- Fix CVE-2019-17133 +* Mon Oct 14 2019 Srivatsa S. Bhat (VMware) 4.19.76-5 +- Add megaraid_sas driver to initramfs +* Mon Oct 14 2019 Bo Gan 4.19.76-4 +- Enable IMA with SHA256 as default hash algorithm +* Thu Oct 10 2019 Srivatsa S. Bhat (VMware) 4.19.76-3 +- Add additional BuildRequires and Requires to fix issues with perf, related to +- interactive UI and C++ symbol demangling. Also update the last few perf python +- scripts in Linux kernel to use python3 syntax. +* Thu Oct 10 2019 Harinadh D 4.19.76-2 +- Adding lvm and dm-mod modules to support root as lvm +* Wed Oct 02 2019 Ajay Kaher 4.19.76-1 +- Update to version 4.19.76 +- Enable USB_SERIAL_PL2303 for aarch64 +* Mon Sep 30 2019 Srivatsa S. Bhat (VMware) 4.19.72-1 +- Update to version 4.19.72 +* Thu Sep 05 2019 Alexey Makhalov 4.19.69-3 +- Avoid oldconfig which leads to potential build hang +- Fix archdir usage +* Thu Sep 05 2019 Ajay Kaher 4.19.69-2 +- Adding SPI and Audio interfaces in rpi3 device tree +- Adding spi0 and audio overlays +- Copying rpi dt in /boot/broadcom as u-boot picks from here +* Fri Aug 30 2019 Alexey Makhalov 4.19.69-1 +- Update to version 4.19.69 +* Fri Aug 23 2019 Alexey Makhalov 4.19.65-4 +- NXP ls1046a frwy board support. +- config_aarch64: add fsl_dpaa2 support. +- fix fsl_dpaa_mac initialization issue. +* Wed Aug 14 2019 Raejoon Jung 4.19.65-3 +- Backport of Secure Boot UEFI certificate import from v5.2 +* Mon Aug 12 2019 Ajay Kaher 4.19.65-2 +- Fix config_aarch64 for v4.19.65 +* Tue Aug 06 2019 Alexey Makhalov 4.19.65-1 +- Update to version 4.19.65 +- Fix CVE-2019-1125 (SWAPGS) +* Tue Jul 30 2019 Ajay Kaher 4.19.52-7 +- Added of_configfs patches to dynamic load Overlays. +* Thu Jul 25 2019 Keerthana K 4.19.52-6 +- Fix postun scriplet. +* Thu Jul 11 2019 Keerthana K 4.19.52-5 +- Enable kernel configs necessary for BPF Compiler Collection (BCC). +* Wed Jul 10 2019 Srivatsa S. Bhat (VMware) 4.19.52-4 +- Deprecate linux-aws-tools in favor of linux-tools. +* Tue Jul 02 2019 Alexey Makhalov 4.19.52-3 +- Fix 9p vsock 16bit port issue. +* Thu Jun 20 2019 Tapas Kundu 4.19.52-2 +- Enabled CONFIG_I2C_CHARDEV to support lm-sensors +* Mon Jun 17 2019 Srivatsa S. Bhat (VMware) 4.19.52-1 +- Update to version 4.19.52 +- Fix CVE-2019-12456, CVE-2019-12379, CVE-2019-12380, CVE-2019-12381, +- CVE-2019-12382, CVE-2019-12378, CVE-2019-12455 +* Tue May 28 2019 Srivatsa S. Bhat (VMware) 4.19.40-3 +- Change default I/O scheduler to 'deadline' to fix performance issue. +* Tue May 14 2019 Keerthana K 4.19.40-2 +- Fix to parse through /boot folder and update symlink (/boot/photon.cfg) if +- mulitple kernels are installed and current linux kernel is removed. +* Tue May 07 2019 Ajay Kaher 4.19.40-1 +- Update to version 4.19.40 +* Thu Apr 11 2019 Srivatsa S. Bhat (VMware) 4.19.32-3 +- Update config_aarch64 to fix ARM64 build. +* Fri Mar 29 2019 Srivatsa S. Bhat (VMware) 4.19.32-2 +- Fix CVE-2019-10125 +* Wed Mar 27 2019 Srivatsa S. Bhat (VMware) 4.19.32-1 +- Update to version 4.19.32 +* Thu Mar 14 2019 Srivatsa S. Bhat (VMware) 4.19.29-1 +- Update to version 4.19.29 +* Tue Mar 05 2019 Ajay Kaher 4.19.26-1 +- Update to version 4.19.26 +* Thu Feb 21 2019 Him Kalyan Bordoloi 4.19.15-3 +- Fix CVE-2019-8912 +* Thu Jan 24 2019 Alexey Makhalov 4.19.15-2 +- Add WiFi (ath10k), sensors (i2c,spi), usb support for NXP LS1012A board. +* Tue Jan 15 2019 Srivatsa S. Bhat (VMware) 4.19.15-1 +- Update to version 4.19.15 +* Fri Jan 11 2019 Srinidhi Rao 4.19.6-7 +- Add Network support for NXP LS1012A board. +* Wed Jan 09 2019 Ankit Jain 4.19.6-6 +- Enable following for x86_64 and aarch64: +- Enable Kernel Address Space Layout Randomization. +- Enable CONFIG_SECURITY_NETWORK_XFRM +* Fri Jan 04 2019 Srivatsa S. Bhat (VMware) 4.19.6-5 +- Enable AppArmor by default. +* Wed Jan 02 2019 Alexey Makhalov 4.19.6-4 +- .config: added Compulab fitlet2 device drivers +- .config_aarch64: added gpio sysfs support +- renamed -sound to -drivers-sound +* Tue Jan 01 2019 Ajay Kaher 4.19.6-3 +- .config: Enable CONFIG_PCI_HYPERV driver +* Wed Dec 19 2018 Srinidhi Rao 4.19.6-2 +- Add NXP LS1012A support. +* Mon Dec 10 2018 Srivatsa S. Bhat (VMware) 4.19.6-1 +- Update to version 4.19.6 +* Fri Dec 07 2018 Alexey Makhalov 4.19.1-3 +- .config: added qmi wwan module +* Mon Nov 12 2018 Ajay Kaher 4.19.1-2 +- Fix config_aarch64 for 4.19.1 +* Mon Nov 05 2018 Srivatsa S. Bhat (VMware) 4.19.1-1 +- Update to version 4.19.1 +* Tue Oct 16 2018 Him Kalyan Bordoloi 4.18.9-5 +- Change in config to enable drivers for zigbee and GPS +* Fri Oct 12 2018 Ajay Kaher 4.18.9-4 +- Enable LAN78xx for aarch64 rpi3 +* Fri Oct 5 2018 Ajay Kaher 4.18.9-3 +- Fix config_aarch64 for 4.18.9 +- Add module.lds for aarch64 +* Wed Oct 03 2018 Srivatsa S. Bhat 4.18.9-2 +- Use updated steal time accounting patch. +- .config: Enable CONFIG_CPU_ISOLATION and a few networking options +- that got accidentally dropped in the last update. +* Mon Oct 1 2018 Srivatsa S. Bhat 4.18.9-1 +- Update to version 4.18.9 +* Tue Sep 25 2018 Ajay Kaher 4.14.67-2 +- Build hang (at make oldconfig) fix in config_aarch64 +* Wed Sep 19 2018 Srivatsa S. Bhat 4.14.67-1 +- Update to version 4.14.67 +* Tue Sep 18 2018 Srivatsa S. Bhat 4.14.54-7 +- Add rdrand-based RNG driver to enhance kernel entropy. +* Sun Sep 02 2018 Srivatsa S. Bhat 4.14.54-6 +- Add full retpoline support by building with retpoline-enabled gcc. +* Thu Aug 30 2018 Srivatsa S. Bhat 4.14.54-5 +- Apply out-of-tree patches needed for AppArmor. +* Wed Aug 22 2018 Alexey Makhalov 4.14.54-4 +- Fix overflow kernel panic in rsi driver. +- .config: enable BT stack, enable GPIO sysfs. +- Add Exar USB serial driver. +* Fri Aug 17 2018 Ajay Kaher 4.14.54-3 +- Enabled USB PCI in config_aarch64 +- Build hang (at make oldconfig) fix in config_aarch64 +* Thu Jul 19 2018 Alexey Makhalov 4.14.54-2 +- .config: usb_serial_pl2303=m,wlan=y,can=m,gpio=y,pinctrl=y,iio=m +* Mon Jul 09 2018 Him Kalyan Bordoloi 4.14.54-1 +- Update to version 4.14.54 +* Fri Jan 26 2018 Alexey Makhalov 4.14.8-2 +- Added vchiq entry to rpi3 dts +- Added dtb-rpi3 subpackage +* Fri Dec 22 2017 Alexey Makhalov 4.14.8-1 +- Version update +* Wed Dec 13 2017 Alexey Makhalov 4.9.66-4 +- KAT build support +* Thu Dec 07 2017 Alexey Makhalov 4.9.66-3 +- Aarch64 support +* Tue Dec 05 2017 Alexey Makhalov 4.9.66-2 +- Sign and compress modules after stripping. fips=1 requires signed modules +* Mon Dec 04 2017 Srivatsa S. Bhat 4.9.66-1 +- Version update +* Tue Nov 21 2017 Srivatsa S. Bhat 4.9.64-1 +- Version update +* Mon Nov 06 2017 Srivatsa S. Bhat 4.9.60-1 +- Version update +* Wed Oct 11 2017 Srivatsa S. Bhat 4.9.53-3 +- Add patch "KVM: Don't accept obviously wrong gsi values via + KVM_IRQFD" to fix CVE-2017-1000252. +* Tue Oct 10 2017 Alexey Makhalov 4.9.53-2 +- Build hang (at make oldconfig) fix. +* Thu Oct 05 2017 Srivatsa S. Bhat 4.9.53-1 +- Version update +* Mon Oct 02 2017 Srivatsa S. Bhat 4.9.52-3 +- Allow privileged CLONE_NEWUSER from nested user namespaces. +* Mon Oct 02 2017 Srivatsa S. Bhat 4.9.52-2 +- Fix CVE-2017-11472 (ACPICA: Namespace: fix operand cache leak) +* Mon Oct 02 2017 Srivatsa S. Bhat 4.9.52-1 +- Version update +* Mon Sep 18 2017 Alexey Makhalov 4.9.47-2 +- Requires coreutils or toybox +* Mon Sep 04 2017 Alexey Makhalov 4.9.47-1 +- Fix CVE-2017-11600 +* Tue Aug 22 2017 Anish Swaminathan 4.9.43-2 +- Add missing xen block drivers +* Mon Aug 14 2017 Alexey Makhalov 4.9.43-1 +- Version update +- [feature] new sysctl option unprivileged_userns_clone +* Wed Aug 09 2017 Alexey Makhalov 4.9.41-2 +- Fix CVE-2017-7542 +- [bugfix] Added ccm,gcm,ghash,lzo crypto modules to avoid + panic on modprobe tcrypt +* Mon Aug 07 2017 Alexey Makhalov 4.9.41-1 +- Version update +* Fri Aug 04 2017 Bo Gan 4.9.38-6 +- Fix initramfs triggers +* Tue Aug 01 2017 Anish Swaminathan 4.9.38-5 +- Allow some algorithms in FIPS mode +- Reverts 284a0f6e87b0721e1be8bca419893902d9cf577a and backports +- bcf741cb779283081db47853264cc94854e7ad83 in the kernel tree +- Enable additional NF features +* Fri Jul 21 2017 Anish Swaminathan 4.9.38-4 +- Add patches in Hyperv codebase +* Fri Jul 21 2017 Anish Swaminathan 4.9.38-3 +- Add missing hyperv drivers +* Thu Jul 20 2017 Alexey Makhalov 4.9.38-2 +- Disable scheduler beef up patch +* Tue Jul 18 2017 Alexey Makhalov 4.9.38-1 +- Fix CVE-2017-11176 and CVE-2017-10911 +* Mon Jul 03 2017 Xiaolin Li 4.9.34-3 +- Add libdnet-devel, kmod-devel and libmspack-devel to BuildRequires +* Thu Jun 29 2017 Divya Thaluru 4.9.34-2 +- Added obsolete for deprecated linux-dev package +* Wed Jun 28 2017 Alexey Makhalov 4.9.34-1 +- [feature] 9P FS security support +- [feature] DM Delay target support +- Fix CVE-2017-1000364 ("stack clash") and CVE-2017-9605 +* Thu Jun 8 2017 Alexey Makhalov 4.9.31-1 +- Fix CVE-2017-8890, CVE-2017-9074, CVE-2017-9075, CVE-2017-9076 + CVE-2017-9077 and CVE-2017-9242 +- [feature] IPV6 netfilter NAT table support +* Fri May 26 2017 Alexey Makhalov 4.9.30-1 +- Added ENA driver for AMI +- Fix CVE-2017-7487 and CVE-2017-9059 +* Wed May 17 2017 Vinay Kulkarni 4.9.28-2 +- Enable IPVLAN module. +* Tue May 16 2017 Alexey Makhalov 4.9.28-1 +- Version update +* Wed May 10 2017 Alexey Makhalov 4.9.27-1 +- Version update +* Sun May 7 2017 Alexey Makhalov 4.9.26-1 +- Version update +- Removed version suffix from config file name +* Thu Apr 27 2017 Bo Gan 4.9.24-2 +- Support dynamic initrd generation +* Tue Apr 25 2017 Alexey Makhalov 4.9.24-1 +- Fix CVE-2017-6874 and CVE-2017-7618. +- Fix audit-devel BuildRequires. +- .config: build nvme and nvme-core in kernel. +* Mon Mar 6 2017 Alexey Makhalov 4.9.13-2 +- .config: NSX requirements for crypto and netfilter +* Tue Feb 28 2017 Alexey Makhalov 4.9.13-1 +- Update to linux-4.9.13 to fix CVE-2017-5986 and CVE-2017-6074 +* Thu Feb 09 2017 Alexey Makhalov 4.9.9-1 +- Update to linux-4.9.9 to fix CVE-2016-10153, CVE-2017-5546, + CVE-2017-5547, CVE-2017-5548 and CVE-2017-5576. +- .config: added CRYPTO_FIPS support. +* Tue Jan 10 2017 Alexey Makhalov 4.9.2-1 +- Update to linux-4.9.2 to fix CVE-2016-10088 +- Move linux-tools.spec to linux.spec as -tools subpackage +* Mon Dec 19 2016 Xiaolin Li 4.9.0-2 +- BuildRequires Linux-PAM-devel +* Mon Dec 12 2016 Alexey Makhalov 4.9.0-1 +- Update to linux-4.9.0 +- Add paravirt stolen time accounting feature (from linux-esx), + but disable it by default (no-vmw-sta cmdline parameter) +* Thu Dec 8 2016 Alexey Makhalov 4.4.35-3 +- net-packet-fix-race-condition-in-packet_set_ring.patch + to fix CVE-2016-8655 +* Wed Nov 30 2016 Alexey Makhalov 4.4.35-2 +- Expand `uname -r` with release number +- Check for build-id matching +- Added syscalls tracing support +- Compress modules +* Mon Nov 28 2016 Alexey Makhalov 4.4.35-1 +- Update to linux-4.4.35 +- vfio-pci-fix-integer-overflows-bitmask-check.patch + to fix CVE-2016-9083 +* Tue Nov 22 2016 Alexey Makhalov 4.4.31-4 +- net-9p-vsock.patch +* Thu Nov 17 2016 Alexey Makhalov 4.4.31-3 +- tty-prevent-ldisc-drivers-from-re-using-stale-tty-fields.patch + to fix CVE-2015-8964 +* Tue Nov 15 2016 Alexey Makhalov 4.4.31-2 +- .config: add cgrup_hugetlb support +- .config: add netfilter_xt_{set,target_ct} support +- .config: add netfilter_xt_match_{cgroup,ipvs} support +* Thu Nov 10 2016 Alexey Makhalov 4.4.31-1 +- Update to linux-4.4.31 +* Fri Oct 21 2016 Alexey Makhalov 4.4.26-1 +- Update to linux-4.4.26 +* Wed Oct 19 2016 Alexey Makhalov 4.4.20-6 +- net-add-recursion-limit-to-GRO.patch +- scsi-arcmsr-buffer-overflow-in-arcmsr_iop_message_xfer.patch +* Tue Oct 18 2016 Alexey Makhalov 4.4.20-5 +- ipip-properly-mark-ipip-GRO-packets-as-encapsulated.patch +- tunnels-dont-apply-GRO-to-multiple-layers-of-encapsulation.patch +* Mon Oct 3 2016 Alexey Makhalov 4.4.20-4 +- Package vmlinux with PROGBITS sections in -debuginfo subpackage +* Tue Sep 27 2016 Alexey Makhalov 4.4.20-3 +- .config: CONFIG_IP_SET_HASH_{IPMARK,MAC}=m +* Tue Sep 20 2016 Alexey Makhalov 4.4.20-2 +- Add -release number for /boot/* files +- Use initrd.img with version and release number +- Rename -dev subpackage to -devel +* Wed Sep 7 2016 Alexey Makhalov 4.4.20-1 +- Update to linux-4.4.20 +- apparmor-fix-oops-validate-buffer-size-in-apparmor_setprocattr.patch +- keys-fix-asn.1-indefinite-length-object-parsing.patch +* Thu Aug 25 2016 Alexey Makhalov 4.4.8-11 +- vmxnet3 patches to bumpup a version to 1.4.8.0 +* Wed Aug 10 2016 Alexey Makhalov 4.4.8-10 +- Added VSOCK-Detach-QP-check-should-filter-out-non-matching-QPs.patch +- .config: pmem hotplug + ACPI NFIT support +- .config: enable EXPERT mode, disable UID16 syscalls +* Thu Jul 07 2016 Alexey Makhalov 4.4.8-9 +- .config: pmem + fs_dax support +* Fri Jun 17 2016 Alexey Makhalov 4.4.8-8 +- patch: e1000e-prevent-div-by-zero-if-TIMINCA-is-zero.patch +- .config: disable rt group scheduling - not supported by systemd +* Wed Jun 15 2016 Harish Udaiya Kumar 4.4.8-7 +- fixed the capitalization for - System.map +* Thu May 26 2016 Alexey Makhalov 4.4.8-6 +- patch: REVERT-sched-fair-Beef-up-wake_wide.patch +* Tue May 24 2016 Priyesh Padmavilasom 4.4.8-5 +- GA - Bump release of all rpms +* Mon May 23 2016 Harish Udaiya Kumar 4.4.8-4 +- Fixed generation of debug symbols for kernel modules & vmlinux. +* Mon May 23 2016 Divya Thaluru 4.4.8-3 +- Added patches to fix CVE-2016-3134, CVE-2016-3135 +* Wed May 18 2016 Harish Udaiya Kumar 4.4.8-2 +- Enabled CONFIG_UPROBES in config as needed by ktap +* Wed May 04 2016 Alexey Makhalov 4.4.8-1 +- Update to linux-4.4.8 +- Added net-Drivers-Vmxnet3-set-... patch +* Tue May 03 2016 Vinay Kulkarni 4.2.0-27 +- Compile Intel GigE and VMXNET3 as part of kernel. +* Thu Apr 28 2016 Nick Shi 4.2.0-26 +- Compile cramfs.ko to allow mounting cramfs image +* Tue Apr 12 2016 Vinay Kulkarni 4.2.0-25 +- Revert network interface renaming disable in kernel. +* Tue Mar 29 2016 Alexey Makhalov 4.2.0-24 +- Support kmsg dumping to vmware.log on panic +- sunrpc: xs_bind uses ip_local_reserved_ports +* Mon Mar 28 2016 Harish Udaiya Kumar 4.2.0-23 +- Enabled Regular stack protection in Linux kernel in config +* Thu Mar 17 2016 Harish Udaiya Kumar 4.2.0-22 +- Restrict the permissions of the /boot/System.map-X file +* Fri Mar 04 2016 Alexey Makhalov 4.2.0-21 +- Patch: SUNRPC: Do not reuse srcport for TIME_WAIT socket. +* Wed Mar 02 2016 Alexey Makhalov 4.2.0-20 +- Patch: SUNRPC: Ensure that we wait for connections to complete + before retrying +* Fri Feb 26 2016 Alexey Makhalov 4.2.0-19 +- Disable watchdog under VMware hypervisor. +* Thu Feb 25 2016 Alexey Makhalov 4.2.0-18 +- Added rpcsec_gss_krb5 and nfs_fscache +* Mon Feb 22 2016 Alexey Makhalov 4.2.0-17 +- Added sysctl param to control weighted_cpuload() behavior +* Thu Feb 18 2016 Divya Thaluru 4.2.0-16 +- Disabling network renaming +* Sun Feb 14 2016 Alexey Makhalov 4.2.0-15 +- veth patch: don’t modify ip_summed +* Thu Feb 11 2016 Alexey Makhalov 4.2.0-14 +- Full tickless -> idle tickless + simple CPU time accounting +- SLUB -> SLAB +- Disable NUMA balancing +- Disable stack protector +- No build_forced no-CBs CPUs +- Disable Expert configuration mode +- Disable most of debug features from 'Kernel hacking' +* Mon Feb 08 2016 Alexey Makhalov 4.2.0-13 +- Double tcp_mem limits, patch is added. +* Wed Feb 03 2016 Anish Swaminathan 4.2.0-12 +- Fixes for CVE-2015-7990/6937 and CVE-2015-8660. +* Tue Jan 26 2016 Anish Swaminathan 4.2.0-11 +- Revert CONFIG_HZ=250 +* Fri Jan 22 2016 Alexey Makhalov 4.2.0-10 +- Fix for CVE-2016-0728 +* Wed Jan 13 2016 Alexey Makhalov 4.2.0-9 +- CONFIG_HZ=250 +* Tue Jan 12 2016 Mahmoud Bassiouny 4.2.0-8 +- Remove rootfstype from the kernel parameter. +* Mon Jan 04 2016 Harish Udaiya Kumar 4.2.0-7 +- Disabled all the tracing options in kernel config. +- Disabled preempt. +- Disabled sched autogroup. +* Thu Dec 17 2015 Harish Udaiya Kumar 4.2.0-6 +- Enabled kprobe for systemtap & disabled dynamic function tracing in config +* Fri Dec 11 2015 Harish Udaiya Kumar 4.2.0-5 +- Added oprofile kernel driver sub-package. +* Fri Nov 13 2015 Mahmoud Bassiouny 4.2.0-4 +- Change the linux image directory. +* Wed Nov 11 2015 Harish Udaiya Kumar 4.2.0-3 +- Added the build essential files in the dev sub-package. +* Mon Nov 09 2015 Vinay Kulkarni 4.2.0-2 +- Enable Geneve module support for generic kernel. +* Fri Oct 23 2015 Harish Udaiya Kumar 4.2.0-1 +- Upgraded the generic linux kernel to version 4.2.0 & and updated timer handling to full tickless mode. +* Tue Sep 22 2015 Harish Udaiya Kumar 4.0.9-5 +- Added driver support for frame buffer devices and ACPI +* Wed Sep 2 2015 Alexey Makhalov 4.0.9-4 +- Added mouse ps/2 module. +* Fri Aug 14 2015 Alexey Makhalov 4.0.9-3 +- Use photon.cfg as a symlink. +* Thu Aug 13 2015 Alexey Makhalov 4.0.9-2 +- Added environment file(photon.cfg) for grub. +* Wed Aug 12 2015 Sharath George 4.0.9-1 +- Upgrading kernel version. +* Wed Aug 12 2015 Alexey Makhalov 3.19.2-5 +- Updated OVT to version 10.0.0. +- Rename -gpu-drivers to -drivers-gpu in accordance to directory structure. +- Added -sound package/ +* Tue Aug 11 2015 Anish Swaminathan 3.19.2-4 +- Removed Requires dependencies. +* Fri Jul 24 2015 Harish Udaiya Kumar 3.19.2-3 +- Updated the config file to include graphics drivers. +* Mon May 18 2015 Touseef Liaqat 3.13.3-2 +- Update according to UsrMove. +* Wed Nov 5 2014 Divya Thaluru 3.13.3-1 +- Initial build. First version diff --git a/SPECS/linux/linux-6.12.inc b/SPECS/linux/linux-6.12.inc new file mode 100644 index 0000000000..0a249cfefb --- /dev/null +++ b/SPECS/linux/linux-6.12.inc @@ -0,0 +1,487 @@ +# linux.spec preamble for kernel 6.12 (photon_subrelease >= 91; 6.12.111 at 91), included from linux.spec + +%global security_hardening none +%global __cmake_in_source_build 0 +%global lkcm_version 6.12 + +# SBAT generation of "linux.photon" component +%define linux_photon_generation 1 + +# Do not add unique suffix to *.ko.debug files +# If _unique_debug_names defined, then __debug_install_post expands +# *.ko to *.ko--..debug. +# Undefining this option keeps filenames simple: *.ko.debug. +# This is what crash utility is looking for. +%undefine _unique_debug_names + +# __debug_install_post extracts debug-info from modules. We need to +# specify option for any customizations. +%define _find_debuginfo_opts --keep-section '.BTF' + +# FIPS flags: fips, canister_build, canister_usage, acvp_build. +# "fips" - declaring whether or not to build FIPS compliant kernel with crypto +# canister. When fips=0, it is a regular kernel build without the canister, +# canister_* values are ignored in this case. When fips=1 there are 2 possible +# build types: +# 1. canister_build=1 - build the canister and use it. +# 2. canister_build=0 - link with prebuilt canister object file. +# +# In both cases when fips=1, we use out of tree jent tarball. +# +# acvp_build=1 defines a special build of the canister for FIPS certification. +# It enforces fips=1 and works with canister_build(dev) or canister_usage (prod) +# +# kat_build=1 defines a non-production canister build used for CMVP_DEMO during FIPS certification. +# It includes additional debug prints in the cryptographic algorithm paths to display API flow +# and return statuses during ACVP testing. +# It also intentionally tampers the self-tests to simulate the broken KAT scenario required +# during the FIPS certification process. +# It enforces acvp_build=1 and canister_build=1. +# +# canister_usage is derived variable and can not be directly set. +# canister_usage=!canister_build, iff fips=1 + +%ifarch x86_64 +%define arch x86_64 +%define archdir x86 +%global fips 1 +%endif + +%ifarch aarch64 +%define arch arm64 +%define archdir arm64 +%global fips 0 +%endif + +%if 0%{?kat_build} +%global acvp_build 1 +%global canister_build 1 +%endif + +%ifarch x86_64 +%if 0%{?acvp_build} +%global fips 1 +%endif +%endif + +# Set default FIPS flags +%if 0%{?fips} +%global fips_plugins 1 +%if 0%{?canister_build} +%global canister_usage 0 +# This is the last certified canister version +# Remove below line when building a new canister +%define fips_certified_kernel_version 6.12.60-18.ph5 +%else +%global canister_usage 1 +%endif +%else +%global canister_usage 0 +%global canister_build 0 +%endif + +%if 0%{?photon_subrelease} == 91 +Release: 4%{?acvp_build:.acvp}%{?kat_build:.kat}%{?dist} +%else +Release: 2%{?acvp_build:.acvp}%{?kat_build:.kat}%{?dist} +%endif + +%define uname_r %{version}-%{release} +%define _modulesdir /lib/modules/%{uname_r} + +Source1: config_%{_arch} +Source2: initramfs.trigger + +%define ena_version 2.17.0 +Source3: https://github.com/amzn/amzn-drivers/archive/refs/tags/ena_linux_%{ena_version}.tar.gz + +%define efa_version 3.1.0 +Source4: https://github.com/amzn/amzn-drivers/archive/refs/tags/efa_linux_%{efa_version}.tar.gz + +# shared canister/.config handling, also included by linux-esx.spec +Source5: canister_config.inc +# contains pre, postun, filetriggerun tasks +Source6: scriptlets.inc +Source7: check_for_config_applicability.inc + +Source18: spec_install_post.inc +Source19: %{name}-dracut-%{_arch}.conf +Source20: photon_sb2020.pem +Source21: photon_km_2025.pem + +%ifarch x86_64 +# Secure Boot +Source25: linux-sbat.csv.in +%endif + +Source30: Makefile.viomem +Source31: viomem.c +Source56: kernel_cve_patches.inc + +Source55: license.txt +%include %{SOURCE55} + +%if 0%{?fips} +%define jent_name photon-jitterentropy-v6.12 +%define jent_rel_ver 3 +Source10000: %{jent_name}-%{jent_rel_ver}.tar.gz + +Source10001: jitterentropy_canister_wrapper.c +Source10002: jitterentropy_canister_wrapper.h +Source10003: jitterentropy_canister_wrapper_asm.S + +%if 0%{?canister_usage} +%define fips_canister_version 6.12.60-18.2.ph5 +%define ExtraBuildRequiresSansSnapshot linux-fips-canister = %{fips_canister_version} +BuildRequires: linux-fips-canister = %{fips_canister_version} +%endif + +Source10101: fips_canister_wrapper.c +Source10102: fips_canister_wrapper.h +Source10104: fips_canister_wrapper_common.h +Source10105: fips_canister_wrapper_internal.h +Source10106: fips_canister_wrapper_internal.c + +Source10300: jitterentropy_rng_proxy.c +%endif + +%if 0%{?canister_build} +Source11000: partial_reloc.c +Source11001: fips_integrity.c +Source11002: fips_integrity.h +Source11003: update_canister_hmac.sh +Source11004: canister_combine.lds +Source11005: gen_canister_relocs.c +Source11500: check_kernel_struct_in_canister.inc +%endif + +%if 0%{?acvp_build} +Source12000: config_x86_64_acvp +Source12001: check_for_acvp_config_applicability.inc +%endif + +# common [0..49] +Patch0: confdata-format-change-for-split-script.patch +Patch1: net-Double-tcp_mem-limits.patch +Patch2: SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch +Patch3: 9p-transport-for-9p.patch +Patch4: 9p-trans_fd-extend-port-variable-to-u32.patch +Patch5: vsock-delay-detach-of-QP-with-outgoing-data-59.patch +# RDRAND-based RNG driver to enhance the kernel's entropy pool: +Patch6: 0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch +# Enable CGROUP Stat show for V1 +Patch7: 0001-cgroup-v1-cgroup_stat-support.patch + +# Expose Photon kernel macros to identify kernel flavor and version +Patch9: 0001-kbuild-Makefile-Introduce-macros-to-distinguish-Phot.patch +Patch10: 0002-linux-Makefile-Add-kernel-flavor-info-to-the-generat.patch + +# ttyXRUSB support +Patch11: usb-acm-exclude-exar-usb-serial-ports-nxt.patch +#HyperV patches +Patch12: vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch + +# TODO: Is CONFIG_HYPERV_VSOCKETS the same? +#Patchx: 0014-hv_sock-introduce-Hyper-V-Sockets.patch +%if 0%{?photon_subrelease} == 91 +Patch13: 0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS-6.12.111.patch +%else +Patch13: 0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS.patch +%endif +# Out-of-tree patches from AppArmor: +Patch14: 0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch +Patch15: 0002-apparmor-af_unix-mediation.patch + +Patch16: Performance-over-security-model.patch + +Patch17: 0001-mm-add-provision-to-disable-CONFIG_PER_VMA_LOCK.patch + +# VMware-specific patch to enable turbostat to work on ESXi +Patch19: 0001-tools-power-turbostat-Skip-some-CPUID-checks-if-runn.patch + +# Allow PCI resets to be disabled from vfio_pci_core module +Patch21: 0001-drivers-vfio-pci-Add-kernel-parameter-to-allow-disab.patch +# Add PCI quirk to allow multiple devices under the same virtual PCI bridge +# to be put into separate IOMMU groups on ESXi. +Patch22: 0001-Add-PCI-quirk-for-VMware-PCIe-Root-Port.patch + +# Upstream fix to properly handle PNP0C01/PNP0C02 device. +Patch23: 0001-ACPI-PNP-Drop-PNP0C01-and-PNP0C02-from-acpi_pnp_devi.patch + +Patch26: 0001-alloc_tag-avoid-current-alloc_tag-manipulations-when.patch + +Patch28: 0001-vmgenid-expose-vmgenid-via-sysfs.patch + +Patch29: 0001-randomize_kstack-Unify-random-source-across-arches.patch + +Patch30: 0001-sched_info_enqueue-don-t-update-last_queued-on-delay.patch + +%if 0%{?photon_subrelease} >= 92 +# Improve small copy_to/from_user performance on CPUs without FSRM +Patch31: 0001-x86-bring-back-unrolled-loop-for-small-sizes-without.patch +Patch32: 0001-x86-only-clobber-registers-in-the-unrolled-case.patch +%endif + +%ifarch x86_64 +# VMW: [50..60] +Patch50: x86-vmware-Log-kmsg-dump-on-panic.patch +Patch51: x86-vmware-Support-steal-time-clock-for-encrypted-gu.patch +# Report guest crash to vmware hypervisor +Patch52: 0001-x86-report-guest-crash-to-vmware-hypervisor.patch + +# SEV on VMware +Patch53: 0079-x86-sev-es-Disable-BIOS-ACPI-RSDP-probing-if-SEV-ES-.patch +Patch54: 0080-x86-boot-Enable-vmw-serial-port-via-Super-I-O.patch +Patch55: 0001-x86-boot-unconditional-preserve-CR4.MCE.patch +# TODO: Review: Patch602: 0081-x86-sev-es-Disable-use-of-WP-via-PAT-for-__sme_early.patch +Patch56: 0001-x86-vmware-Redefine-the-macro-of-CPUID_VMWARE.patch + +# Secure Boot and Kernel Lockdown +Patch57: 0001-kernel-lockdown-when-UEFI-secure-boot-enabled.patch +Patch58: 0002-Add-.sbat-section.patch +Patch59: 0003-Verify-SBAT-on-kexec.patch +%endif + +#Secure: +Patch61: 0001-gcc-rap-plugin-with-kcfi.patch +Patch62: 0002-objtool-Return-error-in-case-of-failures.patch +Patch63: 0004-Fix-PAX-function-pointer-overwritten-for-tasklet-cal.patch + +# vmxnet3 +Patch65: 0001-vmxnet3_support_higher_link_speeds_from_vmxnet3_v9.patch + +# Backward compatibility +%if "%{dist}" == ".ph5" +Patch71: 0001-block-Fix-validation-of-ioprio-level.patch +%endif + +# CVE patches — see kernel_cve_patches.inc (range 3000–3999) +%include %{SOURCE56} + +%ifarch aarch64 +# aarch specific patches [200..219] +# Rpi of_configfs patches +Patch201: 0001-OF-DT-Overlay-configfs-interface.patch +Patch203: 0003-of-overlay-Correct-symbol-path-fixups.patch +# Rpi fan driver +# arm64 hypervisor detection and kmsg dumper +Patch205: 0001-x86-hyper-generalize-hypervisor-type-detection.patch +Patch206: 0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch +Patch207: 0003-arm64-VMware-hypervisor-detection.patch +Patch208: 0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch +Patch209: 0005-scsi-vmw_pvscsi-add-arm64-support.patch +Patch210: 0006-vmxnet3-build-only-for-x86-and-arm64.patch +Patch211: 0005-vmw_balloon-add-arm64-support.patch +Patch212: 0001-vmw_vmci-arm64-support-memory-ordering.patch +# Report guest crash to vmware hypervisor +Patch213: 0001-arm64-report-guest-crash-to-vmware-hypervisor.patch +%endif + +# perf: off-cpu sample +%if 0%{?photon_subrelease} == 91 +Patch221: 0001-perf-core-add-logic-to-collect-off-cpu-sample-6.12.111.patch +%else +Patch221: 0001-perf-core-add-logic-to-collect-off-cpu-sample.patch +%endif +Patch222: 0002-perf-record-add-options-to-off-cpu.patch +Patch223: 0003-perf-display-off-cpu-samples.patch + +# tools: fix for new glibc +Patch230: 0001-perf-disasm-Constify-variables-storing-the-result-of.patch +Patch231: 0002-perf-metricgroup-Constify-variables-storing-the-resu.patch +Patch232: 0003-perf-strlist-Don-t-write-to-const-memory.patch +Patch233: 0004-perf-session-Don-t-write-to-memory-pointed-to-a-cons.patch +Patch234: 0005-perf-trace-event-Constify-variables-storing-the-resu.patch +Patch235: 0006-perf-units-Constify-variables-storing-the-result-of-.patch +Patch236: 0007-perf-time-utils-Constify-variables-storing-the-resul.patch +Patch237: 0008-perf-demangle-java-Constify-variables-storing-the-re.patch +Patch238: 0009-perf-bpf-event-Constify-variables-storing-the-result.patch +Patch239: 0010-perf-jitdump-Constify-variables-storing-the-result-o.patch +Patch240: 0011-perf-list-Remove-unused-sep-variable.patch +Patch241: 0012-perf-diff-Constify-strchr-return-variables.patch +Patch242: 0013-perf-tools-Use-const-for-variables-receiving-str-str.patch +Patch243: 0014-perf-trace-Don-t-change-const-char-strings.patch +Patch244: 0015-perf-list-Don-t-write-to-const-memory.patch +Patch245: 0016-perf-trace-Deal-with-compiler-const-checks.patch +Patch246: 0017-perf-print-events-Fix-compiler-issues-with-newer-gil.patch +Patch247: 0018-perf-list-Signal-changing-const-memory-is-ok.patch +Patch248: 0019-perf-tools-Remove-unused-color_fwrite_lines.patch + +%ifarch x86_64 +# AWS: [300..339] +Patch301: 0001-scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch +Patch302: 0007-xen-manage-keep-track-of-the-on-going-suspend-mode.patch +Patch303: 0008-xen-manage-introduce-helper-function-to-know-the-on-.patch +Patch304: 0009-xenbus-add-freeze-thaw-restore-callbacks-support.patch +Patch305: 0010-x86-xen-Introduce-new-function-to-map-HYPERVISOR_sha.patch +Patch306: 0011-x86-xen-add-system-core-suspend-and-resume-callbacks.patch +Patch307: 0012-xen-blkfront-add-callbacks-for-PM-suspend-and-hibern.patch +Patch308: 0013-xen-netfront-add-callbacks-for-PM-suspend-and-hibern.patch +Patch309: 0014-xen-time-introduce-xen_-save-restore-_steal_clock.patch +Patch310: 0015-x86-xen-save-and-restore-steal-clock.patch +Patch311: 0016-xen-events-add-xen_shutdown_pirqs-helper-function.patch +Patch312: 0017-x86-xen-close-event-channels-for-PIRQs-in-system-cor.patch +Patch313: 0018-PM-hibernate-update-the-resume-offset-on-SNAPSHOT_SE.patch +Patch314: 0020-xen-blkfront-Fixed-blkfront_restore-to-remove-a-call.patch +Patch315: 0021-x86-tsc-avoid-system-instability-in-hibernation.patch +Patch316: 0022-block-xen-blkfront-consider-new-dom0-features-on-res.patch +Patch317: 0023-xen-restore-pirqs-on-resume-from-hibernation.patch +Patch318: 0024-xen-Only-restore-the-ACPI-SCI-interrupt-in-xen_resto.patch +Patch319: 0026-xen-netfront-call-netif_device_attach-on-resume.patch +Patch320: 0054-xen-Restore-xen-pirqs-on-resume-from-hibernation.patch +Patch321: 0055-block-xen-blkfront-bump-the-maximum-number-of-indire.patch +Patch322: 0185-Introduce-page-touching-DMA-ops-binding.patch +Patch323: 0444-drivers-base-memory-use-MHP_MEMMAP_ON_MEMORY-from-th.patch +Patch324: 0490-Correct-read-overflow-in-page-touching-DMA-ops-bindi.patch + +%endif + +#HCX-Patches +Patch701: 0001-Active-probing-of-dst-mac-of-unknown-unicast.patch +Patch702: 0002-Skip-IP_ECN_decapsulate-for-gretap-devices.patch +Patch703: 0003-Handle-ipsec-in-ipip-more-correctly.patch +Patch704: 0004-De-cap-fou-traffic-into-correct-tunnel-device-s.patch +Patch705: 0005-Add-unknown-fou-tracking-to-kernel.patch +Patch706: 0006-Add-support-for-mac-flapping-and-long-mac-flapping-p.patch +Patch707: 0007-vmxnet3-Avoid-fragmentation-by-giving-each-vmxnet3-d.patch +Patch708: 0008-RPS-flow-balance.patch +Patch709: 0009-add-mss-clamp-support-to-gretap-baseimage.patch +Patch710: 0010-iptunnel-mark-xfrm-multi-parts.patch +Patch711: 0011-disable-pskb_inet_may_pull-in-tunnel.patch +Patch712: 0012-gre_tap-interface-mss_clamp-support.patch +Patch713: 0013-rps_cpus-skip-receive-packets-queuing-to-only-housek.patch +Patch714: 0014-Introduce-xfrm_dst-cache-mechanism-to-reuse-xfrm_dst.patch +Patch715: 0015-rcutree-Adding-rcu_max_blimit-rcutree-param.patch + +# Patches for efa [1400..1409] +Patch1400: Fix-efa-cmake-to-build-from-local-directory.patch + +# Only LKCM/JENT related patches below +# Jitterentropy support and FIPS compliance +Patch10000: 0001-New-memsize-options-for-jent.patch +%if 0%{?fips} +Patch10001: 0001-jitterentropy-Makefile-changes.patch +# Patch to remove urandom usage in rng module +Patch10002: 0001-FIPS-crypto-rng-Jitterentropy-RNG-as-the-only-RND-source.patch +# Disable md5 algorithm for sctp if fips is enabled. +Patch10003: 0001-disable-md5-and-sha1-algorithms-for-sctp-if-fips-is-enabled.patch +# Mark ECB as Internal algorithm if fips is enabled. +Patch10004: 0001-crypto-ecb-Set-ecb-alg-flag-as-Internal.patch + +# Below patches are common for canister_usage and canister_build flags +Patch10101: 0001-FIPS-canister-binary-usage.patch +Patch10102: 0002-algapi.c-honor-fcw_skip_tests.patch +Patch10103: 0003-tcrypt-align-to-LKCM.patch +Patch10104: 0004-scripts-kallsyms-Extra-kallsyms-parsing.patch +# Move rsa-pkcs1pad encrypt and decrypt functions outside canister +Patch10106: 0006-crypto-Disable-rsa-pkcs1pad-encrypt-decrypt-in-FIPS-.patch +# Add internal_iv field for aead_request +Patch10107: 0007-aead-add-internal_iv-field.patch +Patch10108: 0008-FIPS-Mark-structure-field-differences-between-kernel.patch +Patch10109: 0009-aead_geniv_ctx-drop-lock-field.patch +Patch10110: 0010-Move-crypto_inc-to-lib-crypto-utils.c.patch +Patch10111: 0001-crypto-Moving-rfc4543-out-of-canister-boundry.patch +# Make lib/digsig to use lib SHA1 instead of crypto shash API +# [10112..10116] +Patch10112: 0001-crypto-x86-sha1-Rename-conflicting-symbol.patch +Patch10113: 0002-lib-crypto-sha1-Rename-sha1_init-to-sha1_init_raw.patch +Patch10114: 0003-lib-crypto-sha1-Add-SHA-1-library-functions.patch +Patch10115: 0001-lib-digsig-Use-SHA-1-library-instead-of-crypto_shash.patch +Patch10116: 0001-crypto-sha1_generic-Renaming-sha1_final.patch +# Track internal/external jitterentropy rng requests +Patch10117: 0001-crypto-track-external-requests-to-jitterentropy_rng.patch +# make ima to use lib SHA1 instead of crypto shash API +Patch10118: 0001-linux-ima-Use-lib-sha1-instead-of-crypto-shash.patch + +# FIPS canister plugins +Patch10200: 0001-Compile-GCC-plugins-for-FIPS-canister.patch +Patch10201: 0002-Build-with-FIPS-Canister-GCC-plugins.patch +Patch10202: 0003-Introduce-FIPS-canister-plugins.patch +Patch10203: 0004-FIPS-Canister-Plugins-Add-self-tests.patch +Patch10204: 0001-Canister-GCC-Plugins-Implement-type-check.patch + +# Compile and inject jitterentropy rng proxy +Patch10300: 0001-compile-jitterentropy-rng-proxy.patch +Patch10301: 0001-change-jitterentropy_rng-driver-name.patch +%endif + +# Canister build patches +%if 0%{?canister_build} +# Below patches are specific to canister_build flag +Patch11000: 1000-FIPS-canister-creation.patch +Patch11001: 1001-aesni_intel-Remove-static-call.patch +Patch11002: 1002-Disable-retpoline_sites-and-return_sites-sections-in.patch +# Patch to remove urandom usage in drbg and ecc modules +Patch11003: 1003-FIPS-crypto-drbg-Jitterentropy-RNG-as-the-only-RND.patch +%if 0%{?photon_subrelease} == 91 +Patch11004: 1004-Move-__bug_table-section-to-fips_canister_wrapper-6.12.111.patch +%else +Patch11004: 1004-Move-__bug_table-section-to-fips_canister_wrapper.patch +%endif +Patch11005: 1005-crypto-Remove-EXPORT_SYMBOL-EXPORT_SYMBOL_GPL-from-c.patch +Patch11006: 1006-Move-kernel-structures-usage-from-canister-to-wrappe.patch +Patch11007: 1007-ecc-Add-pairwise-consistency-test-for-every-generate.patch +Patch11008: 1008-Add-ghash-accelerator.patch +Patch11009: 1009-Handle-approved-and-non-approved-services.patch +Patch11010: 1010-rsa-pkcs1pad-Add-invalid_hash_len-check-in-sign-veri.patch +Patch11011: 1011-sha1-Do-not-register-sha1-to-crypto-backend-when-fip.patch +Patch11012: 1012-Add-shasums-accelerators.patch +Patch11013: 1013-Disable-ret-sites-section-in-x86-shasum-object-files.patch +# Patch to invoke crypto self-tests and add missing test vectors to testmgr +Patch11015: 1015-FIPS-crypto-self-tests.patch +# Disable alloc_hook_tags if MEM_PROFILING is disabled +Patch11016: 1016-linux-canister-Eliminate-codetag-and-other-taggings-.patch +# CVE-2026-64313 fix was applied on canister v6.12.60-18.1. +# Below entry is kept for future reference +# 0001-crypto-ecc-Fix-carry-overflow-in-vli-multiplication.patch +%endif + +# ACVP special builds +%if 0%{?acvp_build:1} +#ACVP test harness patches. +Patch12000: 0001-crypto-AF_ALG-add-sign-verify-API.patch +Patch12001: 0002-crypto-AF_ALG-add-setpubkey-setsockopt-call.patch +Patch12002: 0003-crypto-AF_ALG-add-asymmetric-cipher.patch +Patch12003: 0004-crypto-AF_ALG-add-DH-keygen-ssgen-API.patch +Patch12004: 0005-crypto-AF_ALG-add-DH-param-ECDH-curve-setsockopt.patch +Patch12005: 0006-crypto-AF_ALG-eliminate-code-duplication.patch +Patch12006: 0007-crypto-AF_ALG-add-KPP-support.patch +Patch12007: 0008-crypto-AF_ALG-add-ECC-support.patch +Patch12008: 0009-DRBG-Fix-issues-with-DRBG.patch +Patch12009: 0011-sock-Remove-sendpage-in-favour-of-sendmsg-MSG_SPLICE.patch +Patch12010: 0012-jitterentropy-kcapi-Support-for-sample-collection.patch +Patch12011: 0013-Jitterentropy-Add-char-dev-interface-for-jent-osr.patch +Patch12012: 0014-jitterentropy-Add-prototype-for-sample-collection.patch +%endif + +# KAT special builds +%if 0%{?kat_build} +Patch12013: 0001-Crypto-Tamper-KAT-PCT-and-Integrity-Test.patch +Patch12014: 0015-crypto-api-return-status-prints-for-LKCM6-demo.patch +%endif + +BuildRequires: mpc-devel +BuildRequires: libtraceevent-devel +BuildRequires: clang-devel +BuildRequires: readline-devel +%if 0%{?fips_plugins} +BuildRequires: gcc >= 12.2.0-6 +%endif + +%ifarch x86_64 +BuildRequires: pciutils-devel +BuildRequires: libcap-devel +# Requirements for signing artifacts +%if "%{?signing_script}" != "" +%define network_required 1 +BuildRequires: ca-certificates-pki +BuildRequires: python3-requests +%endif +%endif + +BuildRequires: gdb + +Requires(pre): coreutils +Requires(preun): coreutils +Requires(post): coreutils +Requires(postun): coreutils diff --git a/SPECS/90/linux/linux-esx.spec b/SPECS/linux/linux-esx-6.1-changelog.inc similarity index 77% rename from SPECS/90/linux/linux-esx.spec rename to SPECS/linux/linux-esx-6.1-changelog.inc index 9dd69a2d09..604b6deb9e 100644 --- a/SPECS/90/linux/linux-esx.spec +++ b/SPECS/linux/linux-esx-6.1-changelog.inc @@ -1,584 +1,3 @@ -# If 'security_hardening none' is removed, -# ensure kpatch-build in kpatch is updated accordingly. -%global security_hardening none -%global __cmake_in_source_build 0 - -# Skip this spec if subrelease is 90 or more -%global build_if %{photon_subrelease} <= 90 - -# SBAT generation of "linux.photon" component -%define linux_photon_generation 1 - -# Do not add unique suffix to *.ko.debug files -# If _unique_debug_names defined, then __debug_install_post expands -# *.ko to *.ko--..debug. -# Undefining this option keeps filenames simple: *.ko.debug. -# This is what crash utility is looking for. -%undefine _unique_debug_names - -%ifarch x86_64 -%define arch x86_64 -%define archdir x86 - -# Set this flag to 0 to build without canister -%global fips 1 -%endif - -%ifarch aarch64 -%define arch arm64 -%define archdir arm64 -%global fips 0 -%endif - -Summary: Kernel -Name: linux-esx -Version: 6.1.190 -Release: 1%{?dist} -URL: http://www.kernel.org -Group: System Environment/Kernel -Vendor: VMware, Inc. -Distribution: Photon - -%define uname_r %{version}-%{release}-esx -%define _modulesdir /lib/modules/%{uname_r} - -Source0: http://www.kernel.org/pub/linux/kernel/v6.x/linux-%{version}.tar.xz - -Source1: config-esx_%{_arch} -Source2: initramfs.trigger -# contains pre, postun, filetriggerun tasks -Source3: scriptlets.inc -Source4: check_for_config_applicability.inc - -%if 0%{?fips} -%define struct_comparator struct-comparator -%define struct_comp_dir struct-comp-dir -Source9: struct-comparator.c - -%define fips_canister_version 5.0.0-6.1.75-2%{?dist}-secure -Source16: fips-canister-%{fips_canister_version}.tar.bz2 -%endif - -Source19: spec_install_post.inc - -Source20: %{name}-dracut.conf - -Source21: photon_km_2025.pem -%ifarch x86_64 -# Secure Boot -Source25: linux-sbat.csv.in - -%define jent_major_version 3.4.1 -%define jent_ph_version 4 -Source32: jitterentropy-%{jent_major_version}-%{jent_ph_version}.tar.bz2 -Source33: jitterentropy_canister_wrapper.c -Source34: jitterentropy_canister_wrapper.h -Source35: jitterentropy_canister_wrapper_asm.S -Source36: jitterentropy_rng_proxy.c -%endif - -%if 0%{?fips} -Source37: fips_canister_wrapper.c -Source38: fips_canister_wrapper.h -Source39: fips_canister_wrapper_asm.S -Source40: fips_canister_wrapper_common.h -Source41: fips_canister_wrapper_internal.h -Source42: fips_canister_wrapper_internal.c - -# known vmlinux struct definitions -%define vmlinux_definition_loc canister_known_struct_def_vmlinux -Source43: crypto_alg.txt -Source44: crypto_template.txt -Source45: skcipher_walk.txt -Source46: swait_queue_head.txt -Source47: x86_cpu_id.txt -%endif - -Source49: license.txt -%include %{SOURCE49} - -Source100: Makefile.viomem -Source101: viomem.c -Source102: kernel_cve_patches.inc - -# common [0..49] -Patch0: confdata-format-change-for-split-script.patch -Patch1: net-Double-tcp_mem-limits.patch -Patch2: SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch -Patch3: 6.0-9p-transport-for-9p.patch -Patch4: 9p-trans_fd-extend-port-variable-to-u32.patch -Patch5: vsock-delay-detach-of-QP-with-outgoing-data-59.patch -# RDRAND-based RNG driver to enhance the kernel's entropy pool: -Patch6: 6.0-0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch -Patch7: 0001-cgroup-v1-cgroup_stat-support.patch -Patch8: 6.0-Discard-.note.gnu.property-sections-in-generic-NOTES.patch -# Expose Photon kernel macros to identify kernel flavor and version -Patch9: 0001-kbuild-Makefile-Introduce-macros-to-distinguish-Phot.patch -Patch10: 0002-linux-esx-Makefile-Add-kernel-flavor-info-to-the-gen.patch -Patch11: 9p-file-attributes-caching-support.patch -Patch12: 9p-support-for-local-file-lock.patch -Patch13: 6.1-0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS.patch -# Out-of-tree patches from AppArmor: -Patch14: 6.0-0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch -Patch15: 6.0-0002-apparmor-af_unix-mediation.patch -Patch16: 0001-Control-MEMCG_KMEM-config.patch -Patch17: Performance-over-security-model.patch -# Disable md5 algorithm for sctp if fips is enabled. -Patch18: 6.0-0001-disable-md5-algorithm-for-sctp-if-fips-is-enabled.patch -# Enable AUXILIARY BUS, to make building other out-of-tree intel NIC drivers easier -Patch19: 0001-Enable-AUXILIARY_BUS-by-default.patch - -#VTAR/VTARFS -Patch20: 0001-fs-VTAR-archive-to-TPMFS-extractor.patch -Patch21: 0001-fs-A-new-VTARFS-file-system-to-mount-VTAR-archive.patch -#TARFS -Patch22: 0001-fs-TARFS-file-system-to-mount-TAR-archive.patch -#initrd newca -Patch23: 0001-initramfs-support-for-page-aligned-format-newca.patch -Patch24: 0001-NEWCA-make-initrd-pages-immutable.patch - -# Patches for ptp_vmw -Patch30: 0001-ptp-ptp_vmw-Implement-PTP-clock-adjustments-ops.patch -Patch31: 0002-ptp-ptp_vmw-Add-module-param-to-probe-device-using-h.patch - -%ifarch x86_64 -Patch49: 0001-x86-pti-Fix-kernel-warnings-for-pti-and-nopti-cmdlin.patch - -# VMW: [50..59] -Patch50: 6.0-x86-vmware-Use-Efficient-and-Correct-ALTERNATIVEs-fo.patch -Patch51: 6.0-x86-vmware-Log-kmsg-dump-on-panic.patch -Patch52: 6.0-x86-vmware-Fix-steal-time-clock-under-SEV.patch -Patch53: 6.0-x86-probe_roms-Skip-OpROM-probing-if-running-as-VMwa.patch -Patch54: 07-vmware-only.patch -Patch55: revert-x86-entry-Align-entry-text-section-to-PMD-boundary.patch - -# Secure Boot and Kernel Lockdown -Patch56: 0001-kernel-lockdown-when-UEFI-secure-boot-enabled.patch -Patch57: 0002-Add-.sbat-section.patch -# NOTE: linux-esx does not support kexec, omitting SBAT verify logic. -# CONFIG_SECURITY_SBAT_VERIFY=y -# Patch58: 0003-Verify-SBAT-on-kexec.patch -#external-entropy -Patch59: 0001-external_entropy-Enable-External-Entropy-support.patch -%endif - -# linux-esx [60..89] -Patch60: init-do_mounts-recreate-dev-root.patch -Patch61: serial-8250-do-not-probe-U6-16550A-fifo-size.patch -Patch62: 01-clear-linux.patch -Patch63: 02-pci-probe.patch -Patch64: poweroff-without-firmware.patch -Patch65: 04-quiet-boot.patch -Patch66: 05-pv-ops-clocksource.patch -Patch67: 0001-Remove-OOM_SCORE_ADJ_MAX-limit-check.patch -Patch68: halt-on-panic.patch - -%if 0%{?vmxnet3_sw_timestamp} -Patch71: 0009-esx-vmxnet3-software-timestamping.patch -%endif - -# initialize MMCONFIG -Patch75: 0001-initialize-MMCONFIG-if-already-not-initialized.patch -Patch76: 0001-MMIO_should_have_more_priority_then_IO.patch -Patch77: 0001-Avoid-extra-scanning-for-peer-host-bridges.patch - -# Hotplug support without firmware -Patch80: 0001-vmw_extcfg-hotplug-without-firmware-support.patch -Patch81: 0002-vmw_extcfg-hotplug-without-firmware-support.patch -Patch82: 0003-vmw_extcfg-hotplug-without-firmware-support.patch - -# SBX driver -Patch85: 0001-Adding-SBX-kernel-driver.patch - -Patch100: 6.0-0003-apparmor-fix-use-after-free-in-sk_peer_label.patch - -# Fix BPF JIT memory (bpf_jit_limit) leak: seccomp filters held by -# unreaped zombies were not released until release_task(); release -# them at task exit instead. Upstream commit bfafe5efa975 (v6.11). -Patch101: seccomp-release-task-filters-when-the-task-exits.patch - -# CVE patches — see kernel_cve_patches.inc (range 3000–3999) -%include %{SOURCE102} - -# aarch64 [250..260] -%ifarch aarch64 -Patch250: 6.0-0001-x86-hyper-generalize-hypervisor-type-detection.patch -Patch251: 6.0-0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch -Patch252: 6.0-0003-arm64-VMware-hypervisor-detection.patch -Patch253: 6.0-0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch -Patch254: 6.0-0005-scsi-vmw_pvscsi-add-arm64-support.patch -Patch255: 6.0-0006-vmxnet3-build-only-for-x86-and-arm64.patch -Patch256: 6.0-0005-vmw_balloon-add-arm64-support.patch -Patch257: 6.0-0001-vmw_vmci-arm64-support-memory-ordering.patch -%endif - -# 9p: [300..350] -Patch300: 0001-fs-9p-Add-opt_metaonly-cache-option.patch -Patch302: 0003-Add-9p-zero-copy-data-path-using-crossfd.patch -Patch303: 0004-Enable-cache-loose-for-vdfs-9p.patch -Patch304: 0005-Ensure-seekdir-take-effect-when-entries-in-readdir-b.patch -Patch305: 0006-Initialize-fid-iounit-during-creation-of-p9_fid.patch -Patch306: 0007-Don-t-use-writeback-fid-for-cache-when-enabled-for-V.patch -Patch307: 0008-fscache-Only-fetch-attr-from-inode-cache-when-cache-.patch -Patch308: 0009-9p-fscache-Make-dcache-work-with-case-insensitive-vo.patch -Patch309: 0010-9p-fscache-Ensure-consistent-blksize-is-returned-fro.patch - -# Crypto: [500..529] -# Patch to invoke crypto self-tests and add missing test vectors to testmgr -Patch500: 0002-FIPS-crypto-self-tests.patch -# Patch to call drbg and dh crypto tests from tcrypt -Patch501: tcrypt-disable-tests-that-are-not-enabled-in-photon.patch -Patch502: 0001-Initialize-jitterentropy-before-ecdh.patch -# Patch to remove urandom usage in rng module -Patch503: 0001-FIPS-crypto-rng-Jitterentropy-RNG-as-the-only-RND-source.patch -# Patch to remove urandom usage in drbg and ecc modules -Patch504: 0003-FIPS-crypto-drbg-Jitterentropy-RNG-as-the-only-RND.patch - -%ifarch x86_64 -Patch505: 0001-changes-to-build-with-jitterentropy-v3.4.1.patch -Patch506: 0001-jitterentropy-kcapi-defer-jent_init.patch -Patch507: 0001-compile-jitterentropy-rng-proxy.patch -Patch508: 0001-change-jitterentropy_rng-driver-name.patch -%endif - -%if 0%{?fips} -# FIPS canister usage patch -Patch509: 0001-FIPS-canister-binary-usage.patch -Patch510: 0001-scripts-kallsyms-Extra-kallsyms-parsing.patch -Patch511: 0001-LKCM-5.0-binary-patching-to-fix-struct-aesni_cpu_id-.patch -Patch512: 0001-canister-Change-spinlock_t-lock-to-void-reserved.patch -# commit e470d42 (crypto: api - Add crypto_tfm_get) introduced an api -# which adds a new member in struct crypto_tfm, causing build issues -# with fips canister, since, crypto_tfm_get() api is not being used -# in v6.1.x so reverting upstream commit. -Patch513: 0001-Revert-crypto-api-Add-crypto_tfm_get.patch -Patch514: speedup-algos-registration-in-non-fips-mode.patch -%endif - -%ifarch x86_64 -# SEV on VMware: [600..609] -Patch600: 0079-x86-sev-es-Disable-BIOS-ACPI-RSDP-probing-if-SEV-ES-.patch -Patch601: 0080-x86-boot-Enable-vmw-serial-port-via-Super-I-O.patch -Patch602: 0001-x86-boot-unconditional-preserve-CR4.MCE.patch -# TODO: Review: Patch602: 0081-x86-sev-es-Disable-use-of-WP-via-PAT-for-__sme_early.patch - -# SEV-SNP: -Patch605: 0001-sev-snp-parse-MP-tables.patch -%endif - -# Report guest crash to vmware hypervisor -%ifarch aarch64 -Patch1000: 0001-arm64-report-guest-crash-to-vmware-hypervisor.patch -%endif - -%ifarch x86_64 -Patch1000: 0001-x86-vmware-mark-hypercalls-as-volatile.patch -Patch1001: 0002-x86-esx-report-guest-crash-to-vmware-hypervisor.patch -%endif - -%if 0%{?photon_subrelease} >= 91 -BuildRequires: mpc-devel -%endif - -BuildRequires: bc -BuildRequires: kbd -BuildRequires: kmod-devel -BuildRequires: glib-devel -BuildRequires: libmspack-devel -BuildRequires: Linux-PAM-devel -BuildRequires: openssl-devel -BuildRequires: procps-ng-devel -BuildRequires: lz4 -BuildRequires: elfutils-libelf-devel -BuildRequires: elfutils-devel -BuildRequires: bison -BuildRequires: which -BuildRequires: dwarves-devel - -# Requirements for signing artifacts -%if "%{?signing_script}" != "" -%ifarch x86_64 -%define network_required 1 -BuildRequires: ca-certificates-pki -BuildRequires: python3-requests -%endif -%endif - -%if 0%{?fips} -BuildRequires: gdb -%endif - -Requires: kmod -Requires: filesystem -Requires(pre): (coreutils or coreutils-selinux) -Requires(preun): (coreutils or coreutils-selinux) -Requires(post): (coreutils or coreutils-selinux) -Requires(postun): (coreutils or coreutils-selinux) - -%description -The Linux kernel build for GOS for VMware hypervisor. -# Enable post FIPS certification -%if 0 -This kernel is FIPS certified. -%endif -%if 0%{?vmxnet3_sw_timestamp} -- vmxnet3 with software timestamping enabled -%endif - -%package devel -Summary: Kernel Dev -Group: System Environment/Kernel -Requires: python3 gawk -Requires: %{name} = %{version}-%{release} -%description devel -The Linux package contains the Linux kernel dev files - -%package docs -Summary: Kernel docs -Group: System Environment/Kernel -Requires: python3 -Requires: %{name} = %{version}-%{release} -%description docs -The Linux package contains the Linux kernel doc files - -%prep -# Using autosetup is not feasible -%setup -q -n linux-%{version} -%if 0%{?fips} -# Using autosetup is not feasible -%setup -q -T -D -b 16 -n linux-%{version} -%endif - -%ifarch x86_64 -# Using autosetup is not feasible -%setup -q -T -D -b 32 -n linux-%{version} -%endif - -# Apply CVE patches first -%autopatch -p1 -m3000 -M3999 - -# common -%autopatch -p1 -m0 -M48 - -# apparmor -%autopatch -p1 -m100 -M100 - -# seccomp -%autopatch -p1 -m101 -M101 - -%ifarch x86_64 -%autopatch -p1 -m49 -M49 -# VMW x86 -%autopatch -p1 -m50 -M59 -%endif - -# linux-esx -%autopatch -p1 -m60 -M85 - -%ifarch aarch64 -# aarch64 patches -%autopatch -p1 -m250 -M260 -%endif - -# 9P -%autopatch -p1 -m300 -M309 - -# crypto -%autopatch -p1 -m500 -M504 - -%ifarch x86_64 -%autopatch -p1 -m505 -M508 -%endif - -%if 0%{?fips} -%autopatch -p1 -m509 -M513 -%endif - -%ifarch x86_64 -# SEV on VMware -%autopatch -p1 -m600 -M609 -%endif - -%autopatch -p1 -m1000 -M1001 - -%ifarch x86_64 -cp -a ../jitterentropy-%{jent_major_version}-%{jent_ph_version}/ \ - crypto/jitterentropy-%{jent_major_version}/ - -cp %{SOURCE33} \ - %{SOURCE34} \ - %{SOURCE35} \ - crypto/jitterentropy-%{jent_major_version}/ - -cp %{SOURCE36} crypto/ -%endif - -%make_build mrproper -cp %{SOURCE1} .config - -cp %{SOURCE21} photon-cert-bundle.pem - -%if 0%{?fips} -cp %{SOURCE37} \ - %{SOURCE38} \ - %{SOURCE39} \ - %{SOURCE40} \ - %{SOURCE41} \ - %{SOURCE42} \ - crypto/ - -cp ../fips-canister-%{fips_canister_version}/fips_canister.o \ - ../fips-canister-%{fips_canister_version}/.fips_canister.o.cmd \ - ../fips-canister-%{fips_canister_version}/fips_canister-kallsyms \ - crypto/ - -patch -p1 < %{PATCH514} - -mkdir -p %{struct_comp_dir}/%{vmlinux_definition_loc} -cp %{SOURCE9} %{struct_comp_dir} -cp %{SOURCE43} \ - %{SOURCE44} \ - %{SOURCE45} \ - %{SOURCE46} \ - %{SOURCE47} \ - %{struct_comp_dir}/%{vmlinux_definition_loc} -%endif - -sed -i 's/CONFIG_LOCALVERSION="-esx"/CONFIG_LOCALVERSION="-%{release}-esx"/' .config - -%ifarch x86_64 -sed -e "s,@@NAME@@,%{name},g" \ - -e "s,@@VERSION_RELEASE@@,%{version}-%{release},g" \ - -e "s,@@LINUX_PH_GEN@@,%{linux_photon_generation},g" \ - %{SOURCE25} > linux-sbat.csv -%endif - -%include %{SOURCE4} - -%build -%make_build KBUILD_BUILD_VERSION="1-photon" \ - KBUILD_BUILD_HOST="photon" ARCH=%{arch} - -bldroot="${PWD}" - -# build viomem module -mkdir ../viomem -pushd ../viomem -cp %{SOURCE100} Makefile -cp %{SOURCE101} . -cd ../viomem -%make_build -C ${bldroot} M="${PWD}" V=1 modules -popd - -%if 0%{?fips} -# compare struct definitions between fips canister and vmlinux -# fails out if there is a mismatch, and the offending definition -# has not been documented in %{vmlinux_definition_loc} -pushd %{struct_comp_dir} -gcc -Wall -Werror -o %{struct_comparator} %{SOURCE9} -ldwarves -./%{struct_comparator} \ - ${bldroot}/crypto/fips_canister.o ${bldroot}/vmlinux %{vmlinux_definition_loc} -popd - -rm -rf %{struct_comp_dir} -%endif - -%install -install -vdm 755 %{buildroot}%{_sysconfdir} -install -vdm 755 %{buildroot}/boot -install -vdm 755 %{buildroot}%{_docdir}/linux-%{uname_r} -install -vdm 755 %{buildroot}%{_usrsrc}/linux-headers-%{uname_r} -%make_build ARCH=%{arch} INSTALL_MOD_PATH=%{buildroot} modules_install - -%ifarch x86_64 -install -vm 644 arch/%{archdir}/boot/bzImage %{buildroot}/boot/vmlinuz-%{uname_r} -%if "%{?signing_script}" != "" -%{signing_script} --file_type pe \ - --config_file %{signing_params} \ - --auth_file %{signing_auth} \ - --artifact %{buildroot}/boot/vmlinuz-%{uname_r} -%endif -%endif - -%ifarch aarch64 -install -vm 644 arch/%{archdir}/boot/Image %{buildroot}/boot/vmlinuz-%{uname_r} -%endif - -install -vm 400 System.map %{buildroot}/boot/System.map-%{uname_r} -install -vm 644 .config %{buildroot}/boot/config-%{uname_r} -cp -r Documentation/* %{buildroot}%{_docdir}/linux-%{uname_r} - -bldroot="${PWD}" -# install viomem module -pushd ../viomem -%make_build -C ${bldroot} M="${PWD}" INSTALL_MOD_PATH=%{buildroot} modules_install -popd - -%if 0%{?__debug_package} -install -vdm 755 %{buildroot}%{_libdir}/debug/%{_modulesdir} -install -vm 644 vmlinux %{buildroot}%{_libdir}/debug/%{_modulesdir}/vmlinux-%{uname_r} -%endif - -# TODO: noacpi acpi=off noapic pci=conf1,nodomains pcie_acpm=off pnpacpi=off -cat > %{buildroot}/boot/linux-%{uname_r}.cfg << "EOF" -# GRUB Environment Block -photon_cmdline=init=/lib/systemd/systemd rcupdate.rcu_expedited=1 rw systemd.show_status=0 quiet noreplace-smp cpu_init_udelay=0 -photon_linux=vmlinuz-%{uname_r} -photon_initrd=initrd.img-%{uname_r} -EOF - -# cleanup dangling symlinks -rm -f %{buildroot}%{_modulesdir}/source \ - %{buildroot}%{_modulesdir}/build - -# create /use/src/linux-headers-*/ content -find . -name Makefile* -o -name Kconfig* -o -name *.pl | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy -find arch/%{archdir}/include include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy -find $(find arch/%{archdir} -name include -o -name scripts -type d) -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy -find arch/%{archdir}/include Module.symvers include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy -%ifarch x86_64 -# CONFIG_STACK_VALIDATION=y requires objtool to build external modules -install -vsm 755 tools/objtool/objtool %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}/tools/objtool/ -install -vsm 755 tools/objtool/fixdep %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}/tools/objtool/ -%endif - -# copy .config manually to be where it's expected to be -cp .config %{buildroot}%{_usrsrc}/linux-headers-%{uname_r} -# symling to the build folder -ln -sf "%{_usrsrc}/linux-headers-%{uname_r}" "%{buildroot}%{_modulesdir}/build" -find %{buildroot}/lib/modules -name '*.ko' -print0 | xargs -0 chmod u+x - -mkdir -p %{buildroot}%{_modulesdir}/dracut.conf.d/ -cp -p %{SOURCE20} %{buildroot}%{_modulesdir}/dracut.conf.d/%{name}.conf - -%include %{SOURCE2} -%include %{SOURCE3} -%include %{SOURCE19} - -%post -/sbin/depmod -a %{uname_r} -ln -sf linux-%{uname_r}.cfg /boot/photon.cfg - -%files -%defattr(-,root,root) -/boot/System.map-%{uname_r} -/boot/config-%{uname_r} -/boot/vmlinuz-%{uname_r} -%config(noreplace) /boot/linux-%{uname_r}.cfg -/lib/modules/* -%exclude %{_modulesdir}/build - -%config(noreplace) %{_modulesdir}/dracut.conf.d/%{name}.conf - -%files docs -%defattr(-,root,root) -%{_docdir}/linux-%{uname_r}/* - -%files devel -%defattr(-,root,root) -%{_modulesdir}/build -%{_usrsrc}/linux-headers-%{uname_r} - %changelog * Mon Oct 19 2026 Gerrit Photon 6.1.190-1 - Update to version 6.1.190 diff --git a/SPECS/linux/linux-esx-6.1.inc b/SPECS/linux/linux-esx-6.1.inc new file mode 100644 index 0000000000..64e38b3589 --- /dev/null +++ b/SPECS/linux/linux-esx-6.1.inc @@ -0,0 +1,292 @@ +# linux-esx.spec preamble for kernel 6.1 (photon_subrelease <= 90), included from linux-esx.spec + +# If 'security_hardening none' is removed, +# ensure kpatch-build in kpatch is updated accordingly. +%global security_hardening none +%global __cmake_in_source_build 0 + +# SBAT generation of "linux.photon" component +%define linux_photon_generation 1 + +# Do not add unique suffix to *.ko.debug files +# If _unique_debug_names defined, then __debug_install_post expands +# *.ko to *.ko--..debug. +# Undefining this option keeps filenames simple: *.ko.debug. +# This is what crash utility is looking for. +%undefine _unique_debug_names + +%ifarch x86_64 +%define arch x86_64 +%define archdir x86 + +# Set this flag to 0 to build without canister +%global fips 1 +%endif + +%ifarch aarch64 +%define arch arm64 +%define archdir arm64 +%global fips 0 +%endif + +Release: 1%{?dist} + +%define uname_r %{version}-%{release}-esx +%define _modulesdir /lib/modules/%{uname_r} + +Source1: config-esx_%{_arch}-6.1 +Source2: initramfs.trigger +# contains pre, postun, filetriggerun tasks +Source3: scriptlets.inc +Source4: check_for_config_applicability-6.1.inc + +%if 0%{?fips} +%define struct_comparator struct-comparator +%define struct_comp_dir struct-comp-dir +Source9: struct-comparator.c + +%define fips_canister_version 5.0.0-6.1.75-2%{?dist}-secure +Source16: fips-canister-%{fips_canister_version}.tar.bz2 +%endif + +Source19: spec_install_post-6.1.inc + +Source20: %{name}-dracut.conf + +Source21: photon_km_2025.pem +%ifarch x86_64 +# Secure Boot +Source25: linux-sbat.csv.in + +%define jent_major_version 3.4.1 +%define jent_ph_version 4 +Source32: jitterentropy-%{jent_major_version}-%{jent_ph_version}.tar.bz2 +Source33: jitterentropy_canister_wrapper-6.1.c +Source34: jitterentropy_canister_wrapper-6.1.h +Source35: jitterentropy_canister_wrapper_asm-6.1.S +Source36: jitterentropy_rng_proxy-6.1.c +%endif + +%if 0%{?fips} +Source37: fips_canister_wrapper-6.1.c +Source38: fips_canister_wrapper-6.1.h +Source39: fips_canister_wrapper_asm.S +Source40: fips_canister_wrapper_common-6.1.h +Source41: fips_canister_wrapper_internal-6.1.h +Source42: fips_canister_wrapper_internal-6.1.c + +# known vmlinux struct definitions +%define vmlinux_definition_loc canister_known_struct_def_vmlinux +Source43: crypto_alg.txt +Source44: crypto_template.txt +Source45: skcipher_walk.txt +Source46: swait_queue_head.txt +Source47: x86_cpu_id.txt +%endif + +Source49: license-6.1.txt +%include %{SOURCE49} + +Source100: Makefile.viomem +Source101: viomem-6.1.c +Source102: kernel_cve_patches-6.1.inc + +# common [0..49] +Patch0: confdata-format-change-for-split-script-6.1.patch +Patch1: net-Double-tcp_mem-limits.patch +Patch2: SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch +Patch3: 6.0-9p-transport-for-9p.patch +Patch4: 9p-trans_fd-extend-port-variable-to-u32.patch +Patch5: vsock-delay-detach-of-QP-with-outgoing-data-59.patch +# RDRAND-based RNG driver to enhance the kernel's entropy pool: +Patch6: 6.0-0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch +Patch7: 0001-cgroup-v1-cgroup_stat-support-6.1.patch +Patch8: 6.0-Discard-.note.gnu.property-sections-in-generic-NOTES.patch +# Expose Photon kernel macros to identify kernel flavor and version +Patch9: 0001-kbuild-Makefile-Introduce-macros-to-distinguish-Phot-6.1.patch +Patch10: 0002-linux-esx-Makefile-Add-kernel-flavor-info-to-the-gen-6.1.patch +Patch11: 9p-file-attributes-caching-support.patch +Patch12: 9p-support-for-local-file-lock-6.1.patch +Patch13: 6.1-0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS.patch +# Out-of-tree patches from AppArmor: +Patch14: 6.0-0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch +Patch15: 6.0-0002-apparmor-af_unix-mediation.patch +Patch16: 0001-Control-MEMCG_KMEM-config.patch +Patch17: Performance-over-security-model-6.1.patch +# Disable md5 algorithm for sctp if fips is enabled. +Patch18: 6.0-0001-disable-md5-algorithm-for-sctp-if-fips-is-enabled.patch +# Enable AUXILIARY BUS, to make building other out-of-tree intel NIC drivers easier +Patch19: 0001-Enable-AUXILIARY_BUS-by-default.patch + +#VTAR/VTARFS +Patch20: 0001-fs-VTAR-archive-to-TPMFS-extractor-6.1.patch +Patch21: 0001-fs-A-new-VTARFS-file-system-to-mount-VTAR-archive-6.1.patch +#TARFS +Patch22: 0001-fs-TARFS-file-system-to-mount-TAR-archive-6.1.patch +#initrd newca +Patch23: 0001-initramfs-support-for-page-aligned-format-newca-6.1.patch +Patch24: 0001-NEWCA-make-initrd-pages-immutable-6.1.patch + +# Patches for ptp_vmw +Patch30: 0001-ptp-ptp_vmw-Implement-PTP-clock-adjustments-ops-6.1.patch +Patch31: 0002-ptp-ptp_vmw-Add-module-param-to-probe-device-using-h-6.1.patch + +%ifarch x86_64 +Patch49: 0001-x86-pti-Fix-kernel-warnings-for-pti-and-nopti-cmdlin.patch + +# VMW: [50..59] +Patch50: 6.0-x86-vmware-Use-Efficient-and-Correct-ALTERNATIVEs-fo.patch +Patch51: 6.0-x86-vmware-Log-kmsg-dump-on-panic.patch +Patch52: 6.0-x86-vmware-Fix-steal-time-clock-under-SEV.patch +Patch53: 6.0-x86-probe_roms-Skip-OpROM-probing-if-running-as-VMwa.patch +Patch54: 07-vmware-only-6.1.patch +Patch55: revert-x86-entry-Align-entry-text-section-to-PMD-boundary-6.1.patch + +# Secure Boot and Kernel Lockdown +Patch56: 0001-kernel-lockdown-when-UEFI-secure-boot-enabled-6.1.patch +Patch57: 0002-Add-.sbat-section-6.1.patch +# NOTE: linux-esx does not support kexec, omitting SBAT verify logic. +# CONFIG_SECURITY_SBAT_VERIFY=y +# Patch58: 0003-Verify-SBAT-on-kexec.patch +#external-entropy +Patch59: 0001-external_entropy-Enable-External-Entropy-support-6.1.patch +%endif + +# linux-esx [60..89] +Patch60: init-do_mounts-recreate-dev-root.patch +Patch61: serial-8250-do-not-probe-U6-16550A-fifo-size.patch +Patch62: 01-clear-linux.patch +Patch63: 02-pci-probe-6.1.patch +Patch64: poweroff-without-firmware-6.1.patch +Patch65: 04-quiet-boot.patch +Patch66: 05-pv-ops-clocksource.patch +Patch67: 0001-Remove-OOM_SCORE_ADJ_MAX-limit-check.patch +Patch68: halt-on-panic-6.1.patch + +%if 0%{?vmxnet3_sw_timestamp} +Patch71: 0009-esx-vmxnet3-software-timestamping.patch +%endif + +# initialize MMCONFIG +Patch75: 0001-initialize-MMCONFIG-if-already-not-initialized-6.1.patch +Patch76: 0001-MMIO_should_have_more_priority_then_IO-6.1.patch +Patch77: 0001-Avoid-extra-scanning-for-peer-host-bridges.patch + +# Hotplug support without firmware +Patch80: 0001-vmw_extcfg-hotplug-without-firmware-support-6.1.patch +Patch81: 0002-vmw_extcfg-hotplug-without-firmware-support-6.1.patch +Patch82: 0003-vmw_extcfg-hotplug-without-firmware-support-6.1.patch + +# SBX driver +Patch85: 0001-Adding-SBX-kernel-driver-6.1.patch + +Patch100: 6.0-0003-apparmor-fix-use-after-free-in-sk_peer_label.patch + +# Fix BPF JIT memory (bpf_jit_limit) leak: seccomp filters held by +# unreaped zombies were not released until release_task(); release +# them at task exit instead. Upstream commit bfafe5efa975 (v6.11). +Patch101: seccomp-release-task-filters-when-the-task-exits.patch + +# CVE patches — see kernel_cve_patches.inc (range 3000–3999) +%include %{SOURCE102} + +# aarch64 [250..260] +%ifarch aarch64 +Patch250: 6.0-0001-x86-hyper-generalize-hypervisor-type-detection.patch +Patch251: 6.0-0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch +Patch252: 6.0-0003-arm64-VMware-hypervisor-detection.patch +Patch253: 6.0-0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch +Patch254: 6.0-0005-scsi-vmw_pvscsi-add-arm64-support.patch +Patch255: 6.0-0006-vmxnet3-build-only-for-x86-and-arm64.patch +Patch256: 6.0-0005-vmw_balloon-add-arm64-support.patch +Patch257: 6.0-0001-vmw_vmci-arm64-support-memory-ordering.patch +%endif + +# 9p: [300..350] +Patch300: 0001-fs-9p-Add-opt_metaonly-cache-option-6.1.patch +Patch302: 0003-Add-9p-zero-copy-data-path-using-crossfd.patch +Patch303: 0004-Enable-cache-loose-for-vdfs-9p.patch +Patch304: 0005-Ensure-seekdir-take-effect-when-entries-in-readdir-b.patch +Patch305: 0006-Initialize-fid-iounit-during-creation-of-p9_fid.patch +Patch306: 0007-Don-t-use-writeback-fid-for-cache-when-enabled-for-V.patch +Patch307: 0008-fscache-Only-fetch-attr-from-inode-cache-when-cache-.patch +Patch308: 0009-9p-fscache-Make-dcache-work-with-case-insensitive-vo.patch +Patch309: 0010-9p-fscache-Ensure-consistent-blksize-is-returned-fro.patch + +# Crypto: [500..529] +# Patch to invoke crypto self-tests and add missing test vectors to testmgr +Patch500: 0002-FIPS-crypto-self-tests.patch +# Patch to call drbg and dh crypto tests from tcrypt +Patch501: tcrypt-disable-tests-that-are-not-enabled-in-photon.patch +Patch502: 0001-Initialize-jitterentropy-before-ecdh.patch +# Patch to remove urandom usage in rng module +Patch503: 0001-FIPS-crypto-rng-Jitterentropy-RNG-as-the-only-RND-source-6.1.patch +# Patch to remove urandom usage in drbg and ecc modules +Patch504: 0003-FIPS-crypto-drbg-Jitterentropy-RNG-as-the-only-RND.patch + +%ifarch x86_64 +Patch505: 0001-changes-to-build-with-jitterentropy-v3.4.1.patch +Patch506: 0001-jitterentropy-kcapi-defer-jent_init.patch +Patch507: 0001-compile-jitterentropy-rng-proxy-6.1.patch +Patch508: 0001-change-jitterentropy_rng-driver-name-6.1.patch +%endif + +%if 0%{?fips} +# FIPS canister usage patch +Patch509: 0001-FIPS-canister-binary-usage-6.1.patch +Patch510: 0001-scripts-kallsyms-Extra-kallsyms-parsing.patch +Patch511: 0001-LKCM-5.0-binary-patching-to-fix-struct-aesni_cpu_id-.patch +Patch512: 0001-canister-Change-spinlock_t-lock-to-void-reserved.patch +# commit e470d42 (crypto: api - Add crypto_tfm_get) introduced an api +# which adds a new member in struct crypto_tfm, causing build issues +# with fips canister, since, crypto_tfm_get() api is not being used +# in v6.1.x so reverting upstream commit. +Patch513: 0001-Revert-crypto-api-Add-crypto_tfm_get.patch +Patch514: speedup-algos-registration-in-non-fips-mode.patch +%endif + +%ifarch x86_64 +# SEV on VMware: [600..609] +Patch600: 0079-x86-sev-es-Disable-BIOS-ACPI-RSDP-probing-if-SEV-ES-.patch +Patch601: 0080-x86-boot-Enable-vmw-serial-port-via-Super-I-O.patch +Patch602: 0001-x86-boot-unconditional-preserve-CR4.MCE-6.1.patch +# TODO: Review: Patch602: 0081-x86-sev-es-Disable-use-of-WP-via-PAT-for-__sme_early.patch + +# SEV-SNP: +Patch605: 0001-sev-snp-parse-MP-tables.patch +%endif + +# Report guest crash to vmware hypervisor +%ifarch aarch64 +Patch1000: 0001-arm64-report-guest-crash-to-vmware-hypervisor.patch +%endif + +%ifarch x86_64 +Patch1000: 0001-x86-vmware-mark-hypercalls-as-volatile.patch +Patch1001: 0002-x86-esx-report-guest-crash-to-vmware-hypervisor.patch +%endif + +%if 0%{?photon_subrelease} >= 91 +BuildRequires: mpc-devel +%endif + +BuildRequires: bison +BuildRequires: which + +# Requirements for signing artifacts +%if "%{?signing_script}" != "" +%ifarch x86_64 +%define network_required 1 +BuildRequires: ca-certificates-pki +BuildRequires: python3-requests +%endif +%endif + +%if 0%{?fips} +BuildRequires: gdb +%endif + +Requires(pre): (coreutils or coreutils-selinux) +Requires(preun): (coreutils or coreutils-selinux) +Requires(post): (coreutils or coreutils-selinux) +Requires(postun): (coreutils or coreutils-selinux) diff --git a/SPECS/91/linux/linux-esx.spec b/SPECS/linux/linux-esx-6.12-changelog.inc similarity index 74% rename from SPECS/91/linux/linux-esx.spec rename to SPECS/linux/linux-esx-6.12-changelog.inc index 015d69550d..d938726374 100644 --- a/SPECS/91/linux/linux-esx.spec +++ b/SPECS/linux/linux-esx-6.12-changelog.inc @@ -1,587 +1,22 @@ -%global build_if %{photon_subrelease} == 91 -%global security_hardening none -%global __cmake_in_source_build 0 - -# SBAT generation of "linux.photon" component -%define linux_photon_generation 1 - -# Do not add unique suffix to *.ko.debug files -# If _unique_debug_names defined, then __debug_install_post expands -# *.ko to *.ko--..debug. -# Undefining this option keeps filenames simple: *.ko.debug. -# This is what crash utility is looking for. -%undefine _unique_debug_names - -%ifarch x86_64 -%define arch x86_64 -%define archdir x86 - -# Set this flag to 0 to build without canister -%global fips 1 -%endif - -%ifarch aarch64 -%define arch arm64 -%define archdir arm64 -%global fips 0 -%endif - -Summary: Kernel -Name: linux-esx -Version: 6.12.111 -Release: 3%{?dist} -URL: http://www.kernel.org -Group: System Environment/Kernel -Vendor: VMware, Inc. -Distribution: Photon - -%define uname_r %{version}-%{release}-esx -%define _modulesdir /lib/modules/%{uname_r} - -Source0: http://www.kernel.org/pub/linux/kernel/v6.x/linux-%{version}.tar.xz -Source1: config-esx_%{_arch} -Source2: initramfs.trigger -# contains pre, postun, filetriggerun tasks -Source3: scriptlets.inc -Source4: check_for_config_applicability.inc - -Source19: spec_install_post.inc - -Source20: %{name}-dracut.conf - -Source21: photon_km_2025.pem -%ifarch x86_64 -# Secure Boot -Source25: linux-sbat.csv.in -%endif - -Source30: Makefile.viomem -Source31: viomem.c - -Source42: license-esx.txt -%include %{SOURCE42} - -%if 0%{?fips} -%define jent_name photon-jitterentropy-v6.12 -%define jent_rel_ver 3 -Source10000: %{jent_name}-%{jent_rel_ver}.tar.gz - -Source10001: jitterentropy_canister_wrapper.c -Source10002: jitterentropy_canister_wrapper.h -Source10003: jitterentropy_canister_wrapper_asm.S - -%define fips_canister_version 6.12.60-18.2.ph5 -%define ExtraBuildRequiresSansSnapshot linux-fips-canister = %{fips_canister_version} -BuildRequires: linux-fips-canister = %{fips_canister_version} - -Source10101: fips_canister_wrapper.c -Source10102: fips_canister_wrapper.h -Source10104: fips_canister_wrapper_common.h -Source10105: fips_canister_wrapper_internal.h -Source10106: fips_canister_wrapper_internal.c - -Source10300: jitterentropy_rng_proxy.c -%endif - -Source10301: kernel_cve_patches.inc - -# common [0..49] -Patch0: confdata-format-change-for-split-script.patch -Patch1: net-Double-tcp_mem-limits.patch -Patch2: SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch -Patch3: 9p-transport-for-9p.patch -Patch4: 9p-trans_fd-extend-port-variable-to-u32.patch -Patch5: vsock-delay-detach-of-QP-with-outgoing-data-59.patch -# RDRAND-based RNG driver to enhance the kernel's entropy pool: -Patch6: 0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch -Patch7: 0001-cgroup-v1-cgroup_stat-support.patch -# Expose Photon kernel macros to identify kernel flavor and version -Patch9: 0001-kbuild-Makefile-Introduce-macros-to-distinguish-Phot.patch -Patch10: 0002-linux-esx-Makefile-Add-kernel-flavor-info-to-the-gen.patch -Patch12: 9p-support-for-local-file-lock.patch -Patch13: 0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS.patch -# Out-of-tree patches from AppArmor: -Patch14: 0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch -Patch15: 0002-apparmor-af_unix-mediation.patch -Patch17: Performance-over-security-model.patch -# Enable AUXILIARY BUS, to make building other out-of-tree intel NIC drivers easier -Patch19: 0001-Enable-AUXILIARY_BUS-by-default.patch - -#VTAR/VTARFS -Patch20: 0001-fs-VTAR-archive-to-TPMFS-extractor.patch -Patch21: 0001-fs-A-new-VTARFS-file-system-to-mount-VTAR-archive.patch -#TARFS -Patch22: 0001-fs-TARFS-file-system-to-mount-TAR-archive.patch -#initrd newca -Patch23: 0001-initramfs-support-for-page-aligned-format-newca.patch -Patch24: 0001-NEWCA-make-initrd-pages-immutable.patch - -# Upstream fix to properly handle PNP0C01/PNP0C02 device. -Patch25: 0001-ACPI-PNP-Drop-PNP0C01-and-PNP0C02-from-acpi_pnp_devi.patch - -Patch29: 0001-randomize_kstack-Unify-random-source-across-arches.patch - -# Patches for ptp_vmw -Patch30: 0001-ptp-ptp_vmw-Implement-PTP-clock-adjustments-ops.patch -Patch31: 0002-ptp-ptp_vmw-Add-module-param-to-probe-device-using-h.patch - -Patch32: 0001-alloc_tag-avoid-current-alloc_tag-manipulations-when.patch - -# sched_info_enqueue: don't update last_queued on delayed migration -Patch33: 0001-sched_info_enqueue-don-t-update-last_queued-on-delay.patch - -%ifarch x86_64 -# VMW: [50..59] -Patch50: x86-vmware-Log-kmsg-dump-on-panic.patch -Patch51: x86-vmware-Support-steal-time-clock-for-encrypted-gu.patch -# Report guest crash to vmware hypervisor -Patch52: 0001-x86-report-guest-crash-to-vmware-hypervisor.patch - -# SEV on VMware -Patch53: 0079-x86-sev-es-Disable-BIOS-ACPI-RSDP-probing-if-SEV-ES-.patch -Patch54: 0080-x86-boot-Enable-vmw-serial-port-via-Super-I-O.patch -Patch55: 0001-x86-boot-unconditional-preserve-CR4.MCE.patch -# TODO: Review: Patch602: 0081-x86-sev-es-Disable-use-of-WP-via-PAT-for-__sme_early.patch -Patch56: 0001-x86-vmware-Redefine-the-macro-of-CPUID_VMWARE.patch - -# Secure Boot and Kernel Lockdown -Patch57: 0001-kernel-lockdown-when-UEFI-secure-boot-enabled.patch -Patch58: 0002-Add-.sbat-section.patch -# NOTE: linux-esx does not support kexec, omitting SBAT verify logic. -# CONFIG_SECURITY_SBAT_VERIFY=y -# Patch58: 0003-Verify-SBAT-on-kexec.patch -#external-entropy -Patch59: 0001-external_entropy-Enable-External-Entropy-support.patch -Patch60: 07-vmware-only.patch -%endif - -# linux-esx [60..89] -Patch61: init-do_mounts-recreate-dev-root.patch -Patch62: serial-8250-do-not-probe-U6-16550A-fifo-size.patch -Patch63: 01-clear-linux.patch -Patch64: 02-pci-probe.patch -Patch65: poweroff-without-firmware.patch -Patch66: 04-quiet-boot.patch -Patch67: 05-pv-ops-clocksource.patch -Patch68: 0001-Remove-OOM_SCORE_ADJ_MAX-limit-check.patch -Patch69: halt-on-panic.patch -Patch70: x86-probe_roms-Skip-OpROM-probing-if-running-as-VMwa.patch -Patch71: revert-x86-entry-Align-entry-text-section-to-PMD-boundary.patch - -%if 0%{?vmxnet3_sw_timestamp} -Patch72: 0009-esx-vmxnet3-software-timestamping.patch -%endif - -# vmxnet3 -Patch73: 0001-vmxnet3_support_higher_link_speeds_from_vmxnet3_v9.patch - -# initialize MMCONFIG -Patch75: 0001-initialize-MMCONFIG-if-already-not-initialized.patch -Patch76: 0001-MMIO_should_have_more_priority_then_IO.patch -Patch77: 0001-Avoid-extra-scanning-for-peer-host-bridges.patch - -# Hotplug support without firmware -Patch80: 0001-vmw_extcfg-hotplug-without-firmware-support.patch -Patch81: 0002-vmw_extcfg-hotplug-without-firmware-support.patch -Patch82: 0003-vmw_extcfg-hotplug-without-firmware-support.patch - -# Drain per-CPU page caches after boot-time memory frees, so -# /proc/meminfo reports settled numbers from the first read -Patch83: 0001-init-main.c-drain-per-CPU-page-caches-after-boot-tim.patch - -# SBX driver -Patch85: 0001-Adding-SBX-kernel-driver.patch - -%ifarch x86_64 -#SBX DTLS driver -Patch86: 0001-linux-esx-Add-SBX-DTLS-kernel-module.patch -%endif - -# Backward compatibility -%if "%{dist}" == ".ph5" -Patch91: 0001-block-Fix-validation-of-ioprio-level.patch -%endif - -# CVE patches — see kernel_cve_patches.inc (range 3000–3999) -%include %{SOURCE10301} - -# aarch64 [200..219] -%ifarch aarch64 -Patch200: 0001-x86-hyper-generalize-hypervisor-type-detection.patch -Patch201: 0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch -Patch202: 0003-arm64-VMware-hypervisor-detection.patch -Patch203: 0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch -Patch204: 0005-scsi-vmw_pvscsi-add-arm64-support.patch -Patch205: 0006-vmxnet3-build-only-for-x86-and-arm64.patch -Patch206: 0005-vmw_balloon-add-arm64-support.patch -Patch207: 0001-vmw_vmci-arm64-support-memory-ordering.patch -# Report guest crash to vmware hypervisor -Patch208: 0001-arm64-report-guest-crash-to-vmware-hypervisor.patch -%endif - -# 9p: [300..350] -Patch300: 0001-fs-9p-Add-opt_metaonly-cache-option.patch -# Patch301: 0002-p9fs_dir_readdir-offset-support.patch -Patch303: 0003-Enable-cache-loose-for-vdfs-9p.patch -Patch304: 0004-Ensure-seekdir-take-effect-when-entries-in-readdir-b.patch -Patch305: 0005-Initialize-fid-iounit-during-creation-of-p9_fid.patch -Patch307: 0006-fscache-Only-fetch-attr-from-inode-cache-when-cache-.patch -Patch308: 0007-9p-fscache-Make-dcache-work-with-case-insensitive-vo.patch -Patch309: 0008-9p-fscache-Ensure-consistent-blksize-is-returned-fro.patch - -# Only LKCM/JENT related patches below -# Jitterentropy support and FIPS compliance -Patch10000: 0001-New-memsize-options-for-jent.patch -%if 0%{?fips} -Patch10001: 0001-jitterentropy-Makefile-changes.patch -# Patch to remove urandom usage in rng module -Patch10002: 0001-FIPS-crypto-rng-Jitterentropy-RNG-as-the-only-RND-source.patch -# Disable md5 algorithm for sctp if fips is enabled. -Patch10003: 0001-disable-md5-and-sha1-algorithms-for-sctp-if-fips-is-enabled.patch -# Mark ECB as Internal algorithm if fips is enabled. -Patch10004: 0001-crypto-ecb-Set-ecb-alg-flag-as-Internal.patch -Patch10050: 0001-jitterentropy-Defer-jent_mod_init-in-non-fips-boot.patch - -# Below patches are common for canister_usage and canister_build flags -Patch10101: 0001-FIPS-canister-binary-usage.patch -Patch10102: 0002-algapi.c-honor-fcw_skip_tests.patch -Patch10103: 0003-tcrypt-align-to-LKCM.patch -Patch10104: 0004-scripts-kallsyms-Extra-kallsyms-parsing.patch -# Move rsa-pkcs1pad encrypt and decrypt functions outside canister -Patch10106: 0006-crypto-Disable-rsa-pkcs1pad-encrypt-decrypt-in-FIPS-.patch -# Add internal_iv field for aead_request -Patch10107: 0007-aead-add-internal_iv-field.patch -Patch10108: 0008-FIPS-Mark-structure-field-differences-between-kernel.patch -Patch10109: 0009-aead_geniv_ctx-drop-lock-field.patch -Patch10110: 0010-Move-crypto_inc-to-lib-crypto-utils.c.patch -Patch10111: 0001-crypto-Moving-rfc4543-out-of-canister-boundry.patch -# Make lib/digsig to use lib SHA1 instead of crypto shash API -# [10112..10116] -Patch10112: 0001-crypto-x86-sha1-Rename-conflicting-symbol.patch -Patch10113: 0002-lib-crypto-sha1-Rename-sha1_init-to-sha1_init_raw.patch -Patch10114: 0003-lib-crypto-sha1-Add-SHA-1-library-functions.patch -Patch10115: 0001-lib-digsig-Use-SHA-1-library-instead-of-crypto_shash.patch -Patch10116: 0001-crypto-sha1_generic-Renaming-sha1_final.patch -# Track internal/external jitterentropy rng requests -Patch10117: 0001-crypto-track-external-requests-to-jitterentropy_rng.patch -# make ima to use lib SHA1 instead of crypto shash API -Patch10118: 0001-linux-ima-Use-lib-sha1-instead-of-crypto-shash.patch - -# FIPS canister plugins -Patch10200: 0001-Compile-GCC-plugins-for-FIPS-canister.patch -Patch10201: 0002-Build-with-FIPS-Canister-GCC-plugins.patch -Patch10202: 0003-Introduce-FIPS-canister-plugins.patch -Patch10203: 0004-FIPS-Canister-Plugins-Add-self-tests.patch -Patch10204: 0001-Canister-GCC-Plugins-Implement-type-check.patch - -# Compile and inject jitterentropy rng proxy -Patch10300: 0001-compile-jitterentropy-rng-proxy.patch -Patch10301: 0001-change-jitterentropy_rng-driver-name.patch -%endif - -BuildRequires: bc -BuildRequires: mpc-devel -BuildRequires: kbd -BuildRequires: kmod-devel -BuildRequires: glib-devel -BuildRequires: libmspack-devel -BuildRequires: Linux-PAM-devel -BuildRequires: openssl-devel -BuildRequires: procps-ng-devel -BuildRequires: lz4 -BuildRequires: elfutils-libelf-devel -BuildRequires: bison -BuildRequires: elfutils-devel -BuildRequires: dwarves-devel -BuildRequires: libtraceevent-devel -BuildRequires: clang-devel -BuildRequires: readline-devel -%if 0%{?fips} -BuildRequires: gcc >= 12.2.0-6 -%endif - -# Requirements for signing artifacts -%if "%{?signing_script}" != "" -%ifarch x86_64 -%define network_required 1 -BuildRequires: ca-certificates-pki -BuildRequires: python3-requests -%endif -%endif - -Requires: kmod -Requires: filesystem -Requires(pre): coreutils -Requires(preun): coreutils -Requires(post): coreutils -Requires(postun): coreutils - -%description -The Linux kernel build for GOS for VMware hypervisor. -# Enable post FIPS certification -%if 0 -This kernel is FIPS certified. -%endif -%if 0%{?vmxnet3_sw_timestamp} -- vmxnet3 with software timestamping enabled -%endif - -%package devel -Summary: Kernel Dev -Group: System Environment/Kernel -Requires: python3 gawk dwarves-devel -Requires: %{name} = %{version}-%{release} -%description devel -The Linux package contains the Linux kernel dev files - -%package docs -Summary: Kernel docs -Group: System Environment/Kernel -Requires: python3 -Requires: %{name} = %{version}-%{release} -%description docs -The Linux package contains the Linux kernel doc files - -%prep -# Using autosetup is not feasible -%setup -q -n linux-%{version} - -# Apply CVE patches first -%autopatch -p1 -m3000 -M3999 - -# common -%autopatch -p1 -m0 -M49 - -%ifarch x86_64 -# VMW x86 -%autopatch -p1 -m50 -M60 -%endif - -# linux-esx -%autopatch -p1 -m61 -M89 - -# Backward compatibility -%if "%{dist}" == ".ph5" -%autopatch -p1 -m91 -M91 -%endif - -%ifarch aarch64 -# aarch64 patches -%autopatch -p1 -m200 -M219 -%endif - -# 9P -%autopatch -p1 -m300 -M309 - -# prep for viomem out-of-tree module -mkdir -p ../viomem -pushd ../viomem -cp %{SOURCE30} Makefile -cp %{SOURCE31} . -popd - -# Jitterentropy support and FIPS compliance -%autopatch -p1 -m10000 -M10000 - -%if 0%{?fips} - -# Using autosetup is not feasible -%setup -q -T -D -b 10000 -n linux-%{version} - -cp -rf ../%{jent_name}/ crypto/ -rm crypto/jitterentropy-kcapi.c -pushd crypto/%{jent_name} -%autopatch -p1 -m10050 -M10050 -popd -mv crypto/%{jent_name}/jitterentropy-kcapi.c crypto/jitterentropy-kcapi.c -cp %{SOURCE10001} crypto/%{jent_name}/ -cp %{SOURCE10002} crypto/%{jent_name}/ -cp %{SOURCE10003} crypto/%{jent_name}/ - -install %{SOURCE10101} crypto/ -install %{SOURCE10102} crypto/ -install %{SOURCE10104} crypto/ -install %{SOURCE10105} crypto/ -install %{SOURCE10106} crypto/ -install %{SOURCE10300} crypto/ - -%autopatch -p1 -m10001 -M10004 -%autopatch -p1 -m10101 -M10118 -# FIPS canister plugins -%autopatch -p1 -m10200 -M10204 -# Jitterentropy proxy -%autopatch -p1 -m10300 -M10301 -%endif - -%make_build mrproper -cp %{SOURCE1} .config -cp %{SOURCE21} photon-cert-bundle.pem - -sed -i 's/CONFIG_LOCALVERSION="-esx"/CONFIG_LOCALVERSION="-%{release}-esx"/' .config - -%if 0%{?photon_subrelease} >= 92 -# Update toolchain config for gcc 12.5.0 and binutils 2.46.1 -sed -i 's/CONFIG_CC_VERSION_TEXT="gcc (GCC) 12.2.0"/CONFIG_CC_VERSION_TEXT="gcc (GCC) 12.5.0"/' .config -sed -i 's/CONFIG_GCC_VERSION=120200/CONFIG_GCC_VERSION=120500/' .config -sed -i 's/CONFIG_AS_VERSION=23900/CONFIG_AS_VERSION=24601/' .config -sed -i 's/CONFIG_LD_VERSION=23900/CONFIG_LD_VERSION=24601/' .config -sed -i 's/CONFIG_GCC_ASM_GOTO_OUTPUT_BROKEN=y/CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y\nCONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT=y/' .config -# binutils >= 2.46.1 (used from sr92) supports RELR; make olddefconfig auto-enables these, add them explicitly to avoid config drift -%ifarch aarch64 -sed -i '/CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT=y/a CONFIG_TOOLS_SUPPORT_RELR=y' .config -sed -i '/CONFIG_ARCH_HAS_RELR=y/a CONFIG_RELR=y' .config -%endif -%endif - -%if 0%{?fips} -tar -xvf /usr/lib/fips-canister/fips-canister-%{fips_canister_version}.tar.bz2 -# fips_canister.o is mentioned in obj-y. So, Makefile.modpost expects -# corresponding .cmd file. Empty content is ok, since we are not going -# to rebuild it. -touch crypto/.fips_canister.o.cmd - -sed -i "s/# CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS is not set/CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS=y/" .config -%else -# Clean up .config of FIPS related configs -sed -i "/# CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS is not set/d" .config -sed -i "/# CONFIG_GCC_PLUGIN_PAD_CANISTER_STRUCTS is not set/d" .config - -sed -i "s/# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_2 is not set/CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_2=y/" .config -sed -i "s/CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_32=y/# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_32 is not set/" .config - -sed -i "s/CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKS=128/CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKS=64/" .config -sed -i "s/CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE=256/CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE=32/" .config -%endif - -%ifarch x86_64 -sed -e "s,@@NAME@@,%{name},g" \ - -e "s,@@VERSION_RELEASE@@,%{version}-%{release},g" \ - -e "s,@@LINUX_PH_GEN@@,%{linux_photon_generation},g" \ - %{SOURCE25} > linux-sbat.csv -%endif - -%include %{SOURCE4} - -%build -%make_build KBUILD_BUILD_VERSION="1-photon" \ - KBUILD_BUILD_HOST="photon" ARCH=%{arch} - -# build viomem module -bldroot="${PWD}" -pushd ../viomem -%make_build -C ${bldroot} M="${PWD}" modules -popd - -%install -install -vdm 755 %{buildroot}%{_sysconfdir} -install -vdm 755 %{buildroot}/boot -install -vdm 755 %{buildroot}%{_docdir}/linux-%{uname_r} -install -vdm 755 %{buildroot}%{_usrsrc}/linux-headers-%{uname_r} - -%make_build ARCH=%{arch} \ - INSTALL_MOD_PATH=%{buildroot} \ - modules_install - -%ifarch x86_64 -install -vm 644 arch/%{archdir}/boot/bzImage %{buildroot}/boot/vmlinuz-%{uname_r} -%if "%{?signing_script}" != "" -%{signing_script} --file_type pe \ - --config_file %{signing_params} \ - --auth_file %{signing_auth} \ - --artifact %{buildroot}/boot/vmlinuz-%{uname_r} -%endif -%endif - -%ifarch aarch64 -install -vm 644 arch/%{archdir}/boot/Image %{buildroot}/boot/vmlinuz-%{uname_r} -%endif - -install -vm 400 System.map %{buildroot}/boot/System.map-%{uname_r} -install -vm 644 .config %{buildroot}/boot/config-%{uname_r} -cp -r Documentation/* %{buildroot}%{_docdir}/linux-%{uname_r} - -# install viomem module -bldroot="${PWD}" -pushd ../viomem -%make_build -C ${bldroot} M="${PWD}" INSTALL_MOD_PATH=%{buildroot} \ - INSTALL_MOD_DIR=extra \ - modules_install -popd - -%if 0%{?_enable_debug_packages} -install -vdm 755 %{buildroot}%{_libdir}/debug/%{_modulesdir} -install -vm 644 vmlinux %{buildroot}%{_libdir}/debug/%{_modulesdir}/vmlinux-%{uname_r} -%endif - -# TODO: noacpi acpi=off noapic pci=conf1,nodomains pcie_acpm=off pnpacpi=off -cat > %{buildroot}/boot/linux-%{uname_r}.cfg << "EOF" -# GRUB Environment Block -photon_cmdline=init=/lib/systemd/systemd rcupdate.rcu_expedited=1 rw systemd.show_status=0 quiet noreplace-smp cpu_init_udelay=0 -photon_linux=vmlinuz-%{uname_r} -photon_initrd=initrd.img-%{uname_r} -EOF - -# Cleanup dangling symlinks -rm -f %{buildroot}%{_modulesdir}/source \ - %{buildroot}%{_modulesdir}/build - -# create /use/src/linux-headers-*/ content -find . -name Makefile* -o -name Kconfig* -o -name *.pl | \ - xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy - -find arch/%{archdir}/include include scripts -type f | \ - xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy - -find $(find arch/%{archdir} -name include -o -name scripts -type d) -type f | \ - xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy - -find arch/%{archdir}/include Module.symvers include scripts -type f | \ - xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy - -%ifarch x86_64 -# CONFIG_STACK_VALIDATION=y requires objtool to build external modules -install -vsm 755 tools/objtool/{objtool,fixdep} \ - %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}/tools/objtool/ -%endif - -# copy .config manually to be where it's expected to be -cp .config %{buildroot}%{_usrsrc}/linux-headers-%{uname_r} -# Symlink to the build folder -ln -sfv "%{_usrsrc}/linux-headers-%{uname_r}" "%{buildroot}%{_modulesdir}/build" -find %{buildroot}/lib/modules -name '*.ko' -print0 | xargs -0 chmod u+x - -mkdir -p %{buildroot}%{_modulesdir}/dracut.conf.d/ -cp -p %{SOURCE20} %{buildroot}%{_modulesdir}/dracut.conf.d/%{name}.conf - -%include %{SOURCE2} -%include %{SOURCE3} -%include %{SOURCE19} - -%post -/sbin/depmod -a %{uname_r} -ln -sf linux-%{uname_r}.cfg /boot/photon.cfg - -%files -%defattr(-,root,root) -/boot/System.map-%{uname_r} -/boot/config-%{uname_r} -/boot/vmlinuz-%{uname_r} -%config(noreplace) /boot/linux-%{uname_r}.cfg -%{_modulesdir}/* -%exclude %{_modulesdir}/build - -%config(noreplace) %{_modulesdir}/dracut.conf.d/%{name}.conf - -%files docs -%defattr(-,root,root) -%{_docdir}/linux-%{uname_r}/* - -%files devel -%defattr(-,root,root) -%{_modulesdir}/build -%{_usrsrc}/linux-headers-%{uname_r} - %changelog +* Wed Oct 21 2026 Daniel Casota 6.12.113-2 +- Share canister/.config handling via canister_config.inc +* Mon Oct 19 2026 Gerrit Photon 6.12.113-1 +- Update to version 6.12.113 +* Mon Oct 19 2026 Brennan Lamoreaux 6.12.112-7 +- Fixes CVE-2026-63858 +* Tue Oct 13 2026 Brennan Lamoreaux 6.12.112-6 +- Bring back the unrolled loop for small user copies on CPUs without FSRM +* Tue Oct 13 2026 Guruswamy Basavaiah 6.12.112-5 +- Fixes CVE-2026-80634 +* Tue Oct 13 2026 Shivani Agarwal 6.12.112-4 +- Fixes CVE-2026-74723, CVE-2026-89537 +* Tue Oct 13 2026 Shivani Agarwal 6.12.112-3 +- Fixes CVE-2026-90104 +* Mon Oct 12 2026 Keerthana K 6.12.112-2 +- Fixes CVE-2026-74752 +* Tue Oct 06 2026 Vamsi Krishna Brahmajosyula 6.12.112-1 +- Update to version 6.12.112 * Wed Sep 30 2026 Srinidhi Rao 6.12.111-3 - Fix jent mem free. * Mon Sep 28 2026 Shreenidhi Shedi 6.12.111-2 diff --git a/SPECS/linux/linux-esx-6.12.111-changelog.inc b/SPECS/linux/linux-esx-6.12.111-changelog.inc new file mode 100644 index 0000000000..13a2e648d6 --- /dev/null +++ b/SPECS/linux/linux-esx-6.12.111-changelog.inc @@ -0,0 +1,1069 @@ +%changelog +* Thu Oct 08 2026 Daniel Casota 6.12.111-4 +- Share canister/.config handling via canister_config.inc +* Wed Sep 30 2026 Srinidhi Rao 6.12.111-3 +- Fix jent mem free. +* Mon Sep 28 2026 Shreenidhi Shedi 6.12.111-2 +- Fix aarch64 build: set RELR configs for sr92+ (binutils >= 2.46.1) +* Wed Sep 23 2026 Ajay Kaher 6.12.111-1 +- Update to version 6.12.111 +* Wed Sep 23 2026 Keerthana K 6.12.109-10 +- Fixes CVE-2026-46325, CVE-2026-68242, CVE-2026-68258 +* Mon Sep 21 2026 Keerthana K 6.12.109-9 +- Revert D-TLS ZERO COPY driver +* Mon Sep 21 2026 Brennan Lamoreaux 6.12.109-8 +- Fixes CVE-2026-68426 +* Mon Sep 21 2026 Shivani Agarwal 6.12.109-7 +- Fixes CVE-2026-64388, CVE-2026-72031, CVE-2026-72341, CVE-2026-72439 +* Fri Sep 18 2026 Guruswamy Basavaiah 6.12.109-6 +- Fixes CVE-2026-68337, CVE-2026-68441 +* Thu Sep 17 2026 srinidhira0 6.12.109-5 +- Fixes CVE-2026-43464, CVE-2026-45932, CVE-2026-46324, CVE-2026-52956 +* Wed Sep 16 2026 Shreenidhi Shedi 6.12.109-4 +- Use rpm macros while building +- Fix rpm build warnings +* Wed Sep 16 2026 Keerthana K 6.12.109-3 +- Fixes CVE-2026-80785 +* Tue Sep 15 2026 Guruswamy Basavaiah 6.12.109-2 +- Fixes CVE-2026-74605, CVE-2026-74611 +* Fri Sep 11 2026 Ajay Kaher 6.12.109-1 +- Update to version 6.12.109 +* Fri Sep 11 2026 Ajay Kaher 6.12.107-11 +- Fixes CVE-2026-68399, CVE-2026-68404, CVE-2026-68409, CVE-2026-68441, CVE-2026-68447, CVE-2026-74571 +* Thu Sep 10 2026 Vamsi Krishna Brahmajosyula 6.12.107-10 +- version bump to build along with sysdig and falco +* Thu Sep 10 2026 Shivani Agarwal 6.12.107-9 +- Fixes CVE-2026-74571, CVE-2026-80580 +* Tue Sep 08 2026 Brennan Lamoreaux 6.12.107-8 +- Fixes CVE-2026-63853, CVE-2026-63879, CVE-2026-64036, CVE-2026-64058, CVE-2026-64078 +* Tue Sep 08 2026 srinidhira0 6.12.107-7 +- Fixes CVE-2026-64160 +* Tue Sep 08 2026 Ankit Jain 6.12.107-6 +- Fixes CVE-2026-72366, CVE-2026-72463, CVE-2026-72493, CVE-2026-74268, CVE-2026-74269 +* Tue Sep 08 2026 Shivani Agarwal 6.12.107-5 +- Fixes CVE-2026-72413, CVE-2026-72423 +* Mon Sep 07 2026 Brennan Lamoreaux 6.12.107-4 +- Fixes CVE-2026-72288, CVE-2026-72355 +* Wed Sep 02 2026 Brennan Lamoreaux 6.12.107-3 +- sched_info_enqueue: don't update last_queued on delayed migration +* Tue Sep 01 2026 Bo Gan 6.12.107-2 +- Backport upstream fix to solve ACPI PNP0C01/PNP0C02 device registration with platform driver +* Mon Aug 31 2026 Ajay Kaher 6.12.107-1 +- Update to version 6.12.107 +* Mon Aug 31 2026 Keerthana K 6.12.103-11 +- Fix CVE-2026-68082 +* Wed Aug 26 2026 Alexey Makhalov 6.12.103-10 +- Fix CRX memory overhead regression +* Tue Aug 25 2026 Ajay Kaher 6.12.103-9 +- Fixes CVEs +* Tue Aug 25 2026 Guruswamy Basavaiah 6.12.103-8 +- Fixes CVE-2026-63979, CVE-2026-64024, CVE-2026-64066, CVE-2026-64067, CVE-2026-64068 +* Fri Aug 21 2026 Garrett Goble 6.12.103-7 +- Update SBX driver +* Fri Aug 21 2026 Srinidhi Rao 6.12.103-6 +- Make ima module to use lib sha1 instead of crypto shash +* Wed Aug 19 2026 Vamsi Krishna Brahmajosyula 6.12.103-5 +- Remove selinux=0 from default cmdline; SELinux is now disabled via selinux-policy +* Mon Aug 17 2026 Keerthana K 6.12.103-4 +- Update canister v6.12.60-18.2 with rap_plugin function alignment gap fix +* Sat Aug 15 2026 Vamsi Krishna Brahmajosyula 6.12.103-3 +- Extend to build for 91 and above +* Thu Aug 13 2026 srinidhira0 6.12.103-2 +- Fixes CVE-2026-52988, CVE-2026-52991, CVE-2026-53089, CVE-2026-53091 +* Mon Aug 10 2026 Gerrit Photon 6.12.103-1 +- Update to version 6.12.103 +* Thu Aug 06 2026 Vamsi Krishna Brahmajosyula 6.12.96-8 +- Make SELinux opt-in by default (add selinux=0 to default cmdline) +* Wed Aug 05 2026 Gerrit Photon 6.12.96-7 +- Fixes CVE-2025-40158, CVE-2025-68745, CVE-2026-63872, CVE-2026-64076, CVE-2026-64077 +* Mon Aug 03 2026 Shivani Agarwal 6.12.96-6 +- Fixes CVE-2025-40074, CVE-2025-68353, CVE-2026-23208, CVE-2026-43009, CVE-2026-43485 +* Thu Jul 30 2026 Keerthana K 6.12.96-5 +- Update canister v6.12.60-18.1 with CVE-2026-64313 fix +* Thu Jul 30 2026 Keerthana K 6.12.96-4 +- Fixes CVE-2026-43197, CVE-2026-43198 +* Tue Jul 28 2026 Ankit Jain 6.12.96-3 +- Backport upstream randomize_kstack: Unify random source across arches +- (a96ef5848cb0). +* Mon Jul 27 2026 Ajay Kaher 6.12.96-2 +- Fixes CVE-2026-31589, CVE-2026-43414, CVE-2026-43465, CVE-2026-53224, CVE-2026-53246, CVE-2026-53260 +* Mon Jul 20 2026 Gerrit Photon 6.12.96-1 +- Update to version 6.12.96 +* Tue Jul 07 2026 Bo Gan 6.12.95-2 +- Fix for vmxnet3 BUG_ON in vmxnet3_get_hdr_len() +* Mon Jul 06 2026 Gerrit Photon 6.12.95-1 +- Update to version 6.12.95 +* Tue Jun 30 2026 Mounesh Badiger 6.12.94-2 +-viomem: Add IOCTL to re-size the viomem memory +* Mon Jun 22 2026 Gerrit Photon 6.12.94-1 +- Update to version 6.12.94 +* Sat Jun 20 2026 Shreenidhi Shedi 6.12.92-4 +- Add mpc-devel to build requires +* Thu Jun 11 2026 Alexey Makhalov 6.12.92-3 +- NEWCA initrd: fix hardlink sealing +* Thu Jun 04 2026 Ankit Jain 6.12.92-2 +- Consolidate CVE patches into kernel_cve_patches.inc (range 3000-3999) +* Tue Jun 02 2026 Shivani Agarwal 6.12.92-1 +- Update to version 6.12.92 +- Fix CVE-2025-68359 and CVE-2026-43101 +- sshedi: fix vmlinux exclusion issue from debuginfo rpm +* Wed May 27 2026 Brennan Lamoreaux 6.12.87-5 +- Fix CVE-2026-43083 +* Fri May 22 2026 Guruswamy Basavaiah 6.12.87-4 +- Removed xerces-c-devel from BuildRequires +* Thu May 14 2026 Rishi Chhibber 6.12.87-3 +- Add D-TLS Zero Copy Driver +* Wed May 13 2026 Srinidhi Rao 6.12.87-2 +- Remove libdnet BuildReuires dependency +* Mon May 11 2026 Brennan Lamoreaux 6.12.87-1 +- Update to version 6.12.87 +* Wed May 06 2026 Satish Ramachandran 6.12.78-5 +- Update SBX DTLS patch to provide workload VM UUID +* Tue May 05 2026 Ankit Jain 6.12.78-4 +- Moved SPECS/linux/v6.12(common branch) to SPECS/linux(5.0 branch) +- Used merge commit to keep the history in 5.0 itself +* Mon Apr 13 2026 Ankit Jain 6.12.78-3 +- Enable AMD AI compute module. +* Fri Apr 10 2026 Ajay Kaher 6.12.78-2 +- Fixes for vmwptp driver +* Thu Mar 26 2026 Keerthana K 6.12.78-1 +- Update to version 6.12.78 +* Mon Mar 16 2026 Alexey Makhalov 6.12.69-7 +- SELinux as a default LSM +* Mon Mar 09 2026 Keerthana K 6.12.69-6 +- Fix af_unix boolean registration from the wrong array to the correct one +* Mon Mar 09 2026 Albert Guo 6.12.69-5 +- Ported 8 9P patches for VDFS from 6.1.y to 6.12.y. +* Mon Mar 02 2026 Shivani Agarwal 6.12.69-4 +- Fix aarch64 build +* Thu Feb 26 2026 Bo Gan 6.12.69-3 +- Enable MEMCG_V1 and CPUSETS_V1 for other flavors as generic/x86 does +* Fri Feb 20 2026 Alexey Makhalov 6.12.69-2 +- Support steal clock on TDX enabled VMs +* Wed Feb 11 2026 Shivani Agarwal 6.12.69-1 +- Update to version 6.12.69 +* Wed Feb 11 2026 Brennan Lamoreaux 6.12.60-16 +- Port ARM patches to v6.12 and include new patch to +- report guest crashes to the VMware hypervisor +* Fri Feb 06 2026 Keerthana K 6.12.60-15 +- Update canister version to 6.12.60-18 +* Fri Feb 06 2026 Ankit Jain 6.12.60-14 +- Disabling FIPS build until canister finalised. +* Tue Feb 03 2026 Ankit Jain 6.12.60-13 +- Add viomem kernel module +* Tue Feb 03 2026 Brennan Lamoreaux 6.12.60-12 +- Track internal/external requests to jitterentropy +* Mon Feb 02 2026 Srinidhi Rao 6.12.60-11 +- Enable CONFIG_TDX_GUEST_DRIVER required for CoCo. +* Tue Jan 27 2026 Vamsi Krishna Brahmajosyula 6.12.60-10 +- enable infiniband, mlx5 support +- match config-esx_x86_64 from 6.1 spec +* Thu Jan 22 2026 Keerthana K 6.12.60-9 +- Update canister version to 6.12.60-13 +- Add patch to address UAF (req->iv) in seqiv.c +* Wed Jan 14 2026 Satish Ramachandran 6.12.60-8 +- Add SBX DTLS kernel driver patch +* Tue Jan 06 2026 Guruswamy Basavaiah 6.12.60-7 +- Enable CONFIG_MTD +* Fri Dec 19 2025 Guruswamy Basavaiah 6.12.60-6 +- Disable unique naming for *.ko.debug to make crash utility happy +* Fri Dec 12 2025 Kuntal Nayak 6.12.60-5 +- Inject photon KM certificate to trusted keyring +* Mon Dec 08 2025 Ankit Jain 6.12.60-4 +- Consuming canister. +* Fri Dec 05 2025 Guruswamy Basavaiah 6.12.60-3 +- newca: avoid modifications of initrd pages. +* Thu Dec 04 2025 Guruswamy Basavaiah 6.12.60-2 +- Enable CONFIG_ARM64_ERRATUM_3194386 +* Thu Dec 04 2025 Srinidhi Rao 6.12.60-1 +- Update to version 6.12.60 +* Fri Nov 14 2025 Brennan Lamoreaux 6.12.57-2 +- Add jitterentropy_rng_proxy +* Fri Nov 07 2025 Srinidhi Rao 6.12.57-1 +- Update to version 6.12.57 +* Thu Nov 06 2025 Srinidhi Rao 6.12.41-9 +- Introduce new printk wrapper for FIPS canister. +* Fri Oct 10 2025 Alexey Makhalov 6.12.41-8 +- Consume a canister binary via RPM dependency +* Fri Oct 03 2025 Guruswamy Basavaiah 6.12.41-7 +- Enable CONFIG_X86_SGX +* Mon Sep 29 2025 Srinidhi Rao 6.12.41-6 +- Cleanup jcw_kvzalloc_align +- Optimize jent init time during boot. +* Mon Sep 22 2025 Shivani Agarwal 6.12.41-5 +- crypto: zero initialize memory allocated via sock_kmalloc +* Thu Sep 11 2025 Ajay Kaher 6.12.41-4 +- Fixes for vmwnet3 driver +* Thu Sep 11 2025 Srinidhi Rao 6.12.41-3 +- Select jitterentropy mem size as 32KB +- Disable jent_loop_shuffle in Jitterentropy. +* Thu Aug 21 2025 Alexey Makhalov 6.12.41-2 +- Build jitterentropy only fips=1 build. +- Prepare to apply newer canister binary. +* Thu Aug 14 2025 Srinidhi Rao 6.12.41-1 +- Update to version 6.12.41 +* Fri Jul 18 2025 Srinidhi Rao 6.12.34-3 +- Add sample collection support for Jitterentropy. +* Mon Jun 30 2025 Brennan Lamoreaux 6.12.34-2 +- Mark certain structure fields as known differences between kernel and +- canister. +* Fri Jun 27 2025 Srinidhi Rao 6.12.34-1 +- Upgrade linux to version 6.12.34 +* Fri Jun 13 2025 Brennan Lamoreaux 6.12.1-5 +- Introduce FIPS canister plugins +* Tue Jun 03 2025 Srinidhi Rao 6.12.1-4 +- Changes to Jitterentropy. +* Sun May 11 2025 Ankit Jain 6.12.1-3 +- Disable alloc_hook_tags if MEM_PROFILING is disabled +* Sat May 10 2025 Shreenidhi Shedi 6.12.1-2 +- Require coreutils and remove xml-security-c-devel from build requires +* Mon Dec 16 2024 Ajay Kaher 6.12.1-1 +- Upgrade to version 6.12.x. +* Wed Oct 16 2024 Ajay Kaher 6.6.28-2 +- Fix ptp_vmw for ptp_vmw_adjfine +* Thu Sep 05 2024 Srinidhi Rao 6.6.28-1 +- Upgrade to version 6.6.x. +* Mon Apr 29 2024 Kuntal Nayak 6.1.83-2 +- Patched CVE-2024-26643 +* Mon Apr 29 2024 Keerthana K 6.1.83-1 +- Update to version 6.1.83 +- Fix CVE-2024-26642 +* Mon Apr 29 2024 Kuntal Nayak 6.1.81-6 +- Update SBAT verification +* Mon Apr 29 2024 Srinidhi Rao 6.1.81-5 +- Defer the initialization of jitterentropy. +* Mon Apr 29 2024 Brennan Lamoreaux 6.1.81-4 +- Fix CVE-2024-52452 +* Mon Apr 29 2024 Ajay Kaher 6.1.81-3 +- Fix CVE-2023-52585 +* Mon Apr 29 2024 Srish Srinivasan 6.1.81-2 +- Patched CVE-2024-26585 +* Mon Apr 29 2024 Srish Srinivasan 6.1.81-1 +- Update to version 6.1.81, patched CVE-2024-26584 +* Mon Apr 29 2024 Guruswamy Basavaiah 6.1.79-2 +- Fixes CVE-2024-23307 and CVE-2024-22099 +* Mon Apr 29 2024 Vamsi Krishna Brahmajosyula 6.1.79-1 +- Update to version 6.1.79 +* Mon Apr 29 2024 Shivani Agarwal 6.1.77-1 +- Update to version 6.1.77 +* Mon Apr 29 2024 Ajay Kaher 6.1.75-1 +- Update to version 6.1.75 +* Mon Apr 29 2024 Guruswamy Basavaiah 6.1.70-6 +- Fix CVE-2023-6915 +* Mon Apr 29 2024 Bryan Tan 6.1.70-5 +- Fix refcount underflow in vsock +* Mon Apr 29 2024 Ajay Kaher 6.1.70-4 +- Fix CVE-2024-0340 +* Mon Apr 29 2024 Kuntal Nayak 6.1.70-3 +- Fix CVE-2023-39191 +* Mon Apr 29 2024 Kuntal Nayak 6.1.70-2 +- Fix CVE-2023-5633 +* Mon Apr 29 2024 Ashwin Dayanand Kamat 6.1.70-1 +- Update to version 6.1.70 +* Mon Apr 29 2024 Keerthana K 6.1.62-12 +- Increase CONFIG_LOG_BUF_SHIFT to 18 +- Decrease CONFIG_LOG_CPU_MAX_BUF_SHIFT to 12 +* Tue Mar 26 2024 Ashwin Dayanand Kamat 6.1.62-11 +- Fix proc_sched_rt01 ltp testcase failure +* Mon Feb 12 2024 Srish Srinivasan 6.1.62-10 +- Update canister version to 5.0.0-6.1.75-2 +* Wed Dec 20 2023 Keerthana K 6.1.62-9 +- Update canister to 5.0.0-6.1.62-13 +* Wed Dec 20 2023 Keerthana K 6.1.62-8 +- FIPS: Add log messages for approved and non-approved services +- Remove fips=2 logic +* Wed Dec 20 2023 Keerthana K 6.1.62-7 +- Added self-tests for rsa-pkcs1pad in combination with sha1, sha224, sha384 and sha512 +* Wed Dec 20 2023 Keerthana K 6.1.62-6 +- Update canister to 5.0.0-6.1.62-7 +* Wed Dec 20 2023 Keerthana K 6.1.62-5 +- Update canister to 5.0.0-6.1.62-2 +* Wed Dec 20 2023 Vamsi Krishna Brahmajosyula 6.1.62-4 +- Fix RSA self tests +* Wed Nov 29 2023 Brennan Lamoreaux 6.1.62-3 +- Fix for CVE-2023-2176 +* Wed Nov 29 2023 Ajay Kaher 6.1.62-2 +- Enabling VFIO, UIO and IOMMU support +* Wed Nov 29 2023 Ankit Jain 6.1.62-1 +- Update to version 6.1.62 +* Wed Nov 29 2023 Albert Guo 6.1.60-5 +- Use iov_iter_revert() to fix offset of iov. +* Wed Nov 29 2023 Ankit Jain 6.1.60-4 +- Fix for CVE-2023-0597 +* Wed Nov 29 2023 Srish Srinivasan 6.1.60-3 +- Remove kat_build and its associated spec changes +* Wed Nov 29 2023 Srinidhi Rao 6.1.60-2 +- Jitterentropy sample collection support in ACVP Build. +* Wed Nov 29 2023 Vamsi Krishna Brahmajosyula 6.1.60-1 +- Upgrade to 6.1.60 +* Wed Nov 29 2023 Alexey Makhalov 6.1.56-9 +- Add .sbat section for bzImage +- newca: fixes and enhancements +* Wed Nov 29 2023 Srish Srinivasan 6.1.56-8 +- Upgrade canister to 5.0.0-6.1.56-6 +* Wed Nov 29 2023 Srish Srinivasan 6.1.56-7 +- Added cts to crypto self-tests +- Removed rsa(pkcs1pad, sha256), rsa(pkcs1pad, sha512), + cbc, and ctr from crypto self-tests +- Added ECC pubkey generation and verification success messages +* Wed Nov 29 2023 Albert Guo 6.1.56-6 +- Ported 11 9P patches (combined 2 of them) for VDFS from 4.19.y(photon3) to 6.1.y(photon5). +* Wed Nov 29 2023 Keerthana K 6.1.56-5 +- Modified ecdh-nist-p384 vector to generate ECC keypair +* Wed Nov 29 2023 Vamsi Krishna Brahmajosyula 6.1.56-4 +- Upgrade canister to 5.0.0-6.1.56-3 +* Wed Nov 29 2023 Srish Srinivasan 6.1.56-3 +- Add missing self-test vector for ecdh-nist-p384 with genkey +* Wed Nov 29 2023 Srinidhi Rao 6.1.56-2 +- Jitterentropy wrapper changes. +* Wed Nov 29 2023 Vamsi Krishna Brahmajosyula 6.1.56-1 +- Upgrade to 6.1.56 +* Wed Nov 29 2023 Vamsi Krishna Brahmajosyula 6.1.53-7 +- Fix for CVE-2023-42754 +* Wed Nov 29 2023 Keerthana K 6.1.53-6 +- Revert crypto_test (tcrypt) config to 'm' +* Wed Nov 29 2023 Keerthana K 6.1.53-5 +- Enable fips and update canister binary version 5.0.0-6.1.53-4 +- Removed jent_lock struct from ignore list of check_fips_canister +* Wed Nov 29 2023 Keerthana K 6.1.53-4 +- Add pkcs1pad test vectors in crytpo_self_test module +* Thu Nov 23 2023 Keerthana K 6.1.53-3 +- Fix CVE-2023-42756 +* Thu Nov 23 2023 Keerthana K 6.1.53-2 +- Fix for CVE-2023-42755 +* Thu Nov 23 2023 Roye Eshed 6.1.53-1 +- Update to version 6.1.53 +* Thu Nov 23 2023 Ajay Kaher 6.1.45-7 +- Fix: net: roundup issue in kmalloc_reserve() +* Thu Nov 23 2023 Brennan Lamoreaux 6.1.45-6 +- Move all prep to %prep section +* Thu Nov 23 2023 Srish Srinivasan 6.1.45-5 +- LKCM 5.0 specific changes to crypto self-tests and tcrypt +* Thu Nov 23 2023 Keerthana K 6.1.45-4 +- Build with jitterentropy v3.4.1 +* Thu Nov 23 2023 Keerthana K 6.1.45-3 +- Update fips_canister version 6.1.45-3 +* Wed Nov 22 2023 Ankit Jain 6.1.45-2 +- Fix for CVE-2023-28464 +* Wed Nov 22 2023 Ajay Kaher 6.1.45-1 +- Update to version 6.1.45 +* Wed Nov 22 2023 Ajay Kaher 6.1.41-2 +- Fix: unconditional preserve CR4.MCE +* Wed Nov 22 2023 Ashwin Dayanand Kamat 6.1.41-1 +- Update to version 6.1.41 +* Wed Nov 22 2023 Ashwin Dayanand Kamat 6.1.37-1 +- Update to version 6.1.37 +* Wed Nov 22 2023 Brennan Lamoreaux 6.1.32-1 +- Update to version 6.1.32 +* Wed Nov 22 2023 Guruswamy Basavaiah 6.1.28-5 +- disable kconfig CONFIG_RAID6_PQ_BENCHMARK +* Sun Nov 19 2023 Shreenidhi Shedi 6.1.28-4 +- Bump version as a part of openssl upgrade +* Tue Oct 03 2023 Kuntal Nayak 6.1.28-3 +- Kconfig to lockdown kernel in UEFI Secure Boot +* Sat Sep 23 2023 Guruswamy Basavaiah 6.1.28-2 +- Cherry pick performance over security option for RETBleed (pos=1) +- patch from Photon 4.0 +* Wed Sep 20 2023 Ankit Jain 6.1.28-1 +- Update to version 6.1.28 +* Tue Sep 19 2023 Ankit Jain 6.1.10-13 +- tarfs: fixes buffer overflow +* Mon Jul 17 2023 Keerthana K 6.1.10-12 +- Use canister version 5.0.0-6.1.37-2 +* Tue Jul 11 2023 Shreenidhi Shedi 6.1.10-11 +- Bump version as a part of elfutils upgrade +* Wed Jun 21 2023 Garrett Goble 6.1.10-10 +- Adding SBX kernel driver +* Tue Apr 25 2023 Shreenidhi Shedi 6.1.10-9 +- Remove dracut & initramfs from requires +* Fri Mar 31 2023 Srivatsa S. Bhat (VMware) 6.1.10-8 +- Expose Photon kernel macros to simplify building out-of-tree drivers. +* Thu Mar 30 2023 Brennan Lamoreaux 6.1.10-7 +- Update drivers +- iavf: 4.8.2 +- ice: 1.11.14 +- i40e: 2.22.18 +* Sun Mar 26 2023 Vamsi Krishna Brahmajosyula 6.1.10-6 +- Use canister version 5.0.0-6.1.10-8 +* Tue Mar 21 2023 Shreenidhi Shedi 6.1.10-5 +- Fix initramfs trigger +* Thu Mar 16 2023 Keerthana K 6.1.10-4 +- Enable FIPS canister binary usage +* Thu Mar 02 2023 Shreenidhi Shedi 6.1.10-3 +- Fix initrd generation logic +- Add dracut, initramfs to requires +* Fri Feb 24 2023 Ankit Jain 6.1.10-2 +- Exclude iavf.conf +* Wed Feb 22 2023 Bo Gan 6.1.10-1 +- Update to 6.1.10 +* Thu Feb 16 2023 Srivatsa S. Bhat (VMware) 6.0.7-8 +- Update i40e driver to v2.19.3 to prevent kernel warnings +* Thu Feb 02 2023 Shreenidhi Shedi 6.0.7-7 +- Fix requires +* Mon Jan 30 2023 Keerthana K 6.0.7-6 +- Enable CONFIG_E1000E & CONFIG_E1000 for arm64 +* Fri Jan 27 2023 Shivani Agarwal 6.0.7-5 +- Enable CONFIG_DRM_I915 +* Wed Jan 18 2023 Ajay Kaher 6.0.7-4 +- Fix aarch64 rpm build issue +* Fri Jan 13 2023 Srivatsa S. Bhat (VMware) 6.0.7-3 +- Fix IRQ affinities of i40e, iavf and ice drivers +* Mon Jan 09 2023 Srivatsa S. Bhat (VMware) 6.0.7-2 +- Update Intel drivers i40e to v2.16.11, iavf to v4.5.3 and ice to v1.9.11 +* Mon Jan 09 2023 Bo Gan 6.0.7-1 +- Update to 6.0.7 +- common: Change from SLAB to SLUB +- common: Enable BPF/JIT +- aarch64: match configs with x86 for arch independent features. +- aarch64: disable unused platform/drivers for VM. +* Fri Jan 06 2023 Vamsi Krishna Brahmajosyula 5.10.142-4 +- Bump up due to change in elfutils +* Mon Nov 21 2022 Ashwin Dayanand Kamat 5.10.142-3 +- Avoid extra scanning for peer host bridges when mmconfig is initialized. +* Thu Oct 20 2022 Vamsi Krishna Brahmajosyula 5.10.142-2 +- Fix build with latest toolchain +* Wed Sep 28 2022 Srivatsa S. Bhat (VMware) 5.10.142-1 +- Update to version 5.10.142 +* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.132-1 +- Update to version 5.10.132 +* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.118-11 +- Backport fixes for CVE-2022-0500 +* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.118-10 +- Fix for CVE-2022-2585, CVE-2022-2586 and CVE-2022-2588 +* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.118-9 +- tarfs: fix error for empty tar archive +* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.118-8 +- Fix multiple issues in tarfs +* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.118-7 +- Update iavf driver to v4.4.2 +- Update ice driver to v1.8.3 +- .config: Enable CONFIG_NET_DEVLINK=y (ice v1.8.3 needs it) +* Mon Sep 26 2022 Srivatsa S. Bhat (VMware) 5.10.118-6 +- .config: enable CROSS_MEMORY_ATTACH +- Add elfutils-libelf-devel required to build objtool +- vmxnet3: enable software timestamping +* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-5 +- .config: disable kernel accounting for memory cgroups +- Enable cgroup v1 stats +- .config: enable PERCPU_STATS +* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-4 +- Avoid TSC recalibration +* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-3 +- Fix for CVE-2022-21505 +* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-2 +- VMCI patches & configs +* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-1 +- Update to version 5.10.118 +* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.109-4 +- Fix for CVE-2022-1966, CVE-2022-1972 +* Thu Sep 22 2022 Srivatsa S. Bhat (VMware) 5.10.109-3 +- Fix for CVE-2022-21499 +* Thu Sep 22 2022 Srivatsa S. Bhat (VMware) 5.10.109-2 +- Fix for CVE-2022-29582 +* Wed Sep 21 2022 Srivatsa S. Bhat (VMware) 5.10.109-1 +- Update to version 5.10.109 +* Wed Sep 21 2022 Srivatsa S. Bhat (VMware) 5.10.103-4 +- .config: Increase kernel log buffer size to fix regression. +* Tue Sep 20 2022 Srivatsa S. Bhat (VMware) 5.10.103-3 +- Fix for CVE-2022-1016 +* Mon Sep 19 2022 Srivatsa S. Bhat (VMware) 5.10.103-2 +- Fix SEV and Hypercall alternative inst. patches +* Thu Sep 15 2022 Srivatsa S. Bhat (VMware) 5.10.103-1 +- Update to version 5.10.103 +* Thu Sep 15 2022 Srivatsa S. Bhat (VMware) 5.10.93-7 +- Reduce kernel .data section by configuring smaller kernel log buffer (16) +- Speedup algos registration in non-fips mode +* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-6 +- vtarfs: fix multiple issues +- tarfs: support for hardlink, fix uid/gid/mode issues +* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-5 +- Fix for CVE-2022-0435 +* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-4 +- Fix for CVE-2022-0492 +* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-3 +- Fix for CVE-2022-22942 +* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-2 +- Fix CVE-2022-0330 +* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-1 +- Update to version 5.10.93 +* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.83-7 +- Update ptp_vmw with provider mode support +* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.83-6 +- Fix CVE-2021-4155 and CVE-2021-4204 +* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.83-5 +- crypto_self_test and broken kattest module enhancements +- FIPS: Add module signing for crypto modules +* Tue Sep 13 2022 Srivatsa S. Bhat (VMware) 5.10.83-4 +- mm: fix percpu allocation for memoryless nodes +- pvscsi: fix disk detection issue +* Tue Sep 13 2022 Srivatsa S. Bhat (VMware) 5.10.83-3 +- remove lvm in add-drivers list +- lvm drivers are built as part of dm-mod +* Tue Sep 13 2022 Srivatsa S. Bhat (VMware) 5.10.83-2 +- tarfs: Fix binary execution issue +* Mon Sep 12 2022 Srivatsa S. Bhat (VMware) 5.10.83-1 +- Update to version 5.10.83 +* Mon Aug 08 2022 Shreenidhi Shedi 5.10.78-17 +- Scriptlets fixes and improvements +* Fri Jul 29 2022 Tejaswini Jayaramaiah 5.10.78-16 +- Enable CONFIG_CGROUP_BPF in config to run containers with cgroup v2 +* Wed Jun 29 2022 Keerthana K 5.10.78-15 +- Reduce FIPS canister memory footprint by disabling CONFIG_KALLSYMS_ALL +- Add only fips_canister-kallsyms to vmlinux instead of all symbols +* Fri Jun 24 2022 Shreenidhi Shedi 5.10.78-14 +- Fix debug_package macro usage while adding vmlinux to debuginfo rpm +* Tue May 31 2022 Ajay Kaher 5.10.78-13 +- initialize MMCONFIG, if already not initialized +* Mon Apr 18 2022 Alexey Makhalov 5.10.78-12 +- Add objtool to the -devel package. +- Reduce kernel .data section by configuring smaller kernel log buffer +- .config(x86_64): enable amdgpu driver as a module +* Tue Apr 05 2022 Shreenidhi Shedi 5.10.78-11 +- Enable CONFIG_EXT2_FS_XATTR & related parameters +* Mon Feb 28 2022 Vamsi Krishna Brahmajosyula 5.10.78-10 +- Port non-acpi hotplug support patch to 5.10.x +* Tue Feb 01 2022 Alexey Makhalov 5.10.78-9 +- Reduce kernel .text size by ~40% by removing .entry.text alignment. +* Tue Jan 25 2022 Alexey Makhalov 5.10.78-8 +- .config: enable squashfs module, enable crypto user api rng. +* Wed Dec 01 2021 Ashwin Dayanand Kamat 5.10.78-7 +- Disable md5 algorithm for sctp if fips is enabled. +* Tue Nov 30 2021 Ashwin Dayanand Kamat 5.10.78-6 +- Correct the config file for linux-esx on arm machine +* Tue Nov 23 2021 Ashwin Dayanand Kamat 5.10.78-5 +- tarfs: A new readonly filesystem to mount tar archive +* Fri Nov 19 2021 Keerthana K 5.10.78-4 +- Remove vmci and vmw_balloon patches +- Update Hypervisor detection patch with review comments addressed +* Thu Nov 11 2021 Satya Naga Vasamsetty 5.10.78-3 +- compile with openssl 3.0.0 +* Mon Nov 08 2021 Keerthana K 5.10.78-2 +- Add out-of-tree i40e, iavf and ice drivers. +* Mon Nov 08 2021 Vikash Bansal 5.10.78-1 +- Update to version 5.10.78 +* Thu Oct 28 2021 Sharan Turlapati 5.10.75-1 +- Update to version 5.10.75 +* Thu Oct 21 2021 Keerthana K 5.10.61-7 +- Arm64 VMware Hypervisor features +- Arm64 support for vmw_pvscsi, vmw_vmci and vmw_balloon +- vmxnet3: build only for x86 and arm64 +* Thu Oct 21 2021 Keerthana K 5.10.61-6 +- Add arm64 support +* Mon Oct 18 2021 Alexey Makhalov 5.10.61-5 +- initramfs: large files support for newca +* Wed Oct 06 2021 Ankit Jain 5.10.61-4 +- vtarfs: Fix memory allocation for entry pages +* Fri Sep 17 2021 Ankit Jain 5.10.61-3 +- vtarfs: Added support for LongFilename/LongLink +* Tue Sep 07 2021 Ankit Jain 5.10.61-2 +- vtarfs: Fix crash in vtarfs_file_read_iter() +* Fri Aug 27 2021 Ankit Jain 5.10.61-1 +- Update to version 5.10.61 +* Wed Aug 25 2021 Srivatsa S. Bhat (VMware) 5.10.52-3 +- Enable ptp_vmw module (CONFIG_PTP_1588_CLOCK_VMW) in the config. +* Mon Aug 09 2021 Him Kalyan Bordoloi 5.10.52-2 +- Port crx patches +* Thu Aug 05 2021 Him Kalyan Bordoloi 5.10.52-1 +- Update to version 5.10.52 +* Wed Jul 28 2021 Ankit Jain 5.10.46-3 +- vtarfs: Fixed multiple mount executable issue, +- Fixed fault handler +* Thu Jul 15 2021 Him Kalyan Bordoloi 5.10.46-2 +- Fix for CVE-2021-33909 +* Mon Jun 28 2021 Sharan Turlapati 5.10.46-1 +- Update to version 5.10.46 +* Tue Jun 22 2021 Sharan Turlapati 5.10.42-3 +- Fix for CVE-2021-3609 +* Thu Jun 10 2021 Keerthana K 5.10.42-2 +- Added script to check structure compatibility between fips_canister.o and vmlinux. +* Thu Jun 03 2021 Keerthana K 5.10.42-1 +- Update to version 5.10.42 +- .config: Enable CONFIG_FANOTIFY_ACCESS_PERMISSIONS +* Mon May 17 2021 Ajay Kaher 5.10.35-1 +- Update to version 5.10.35 +* Thu May 13 2021 Sharan Turlapati 5.10.25-10 +- Fix for CVE-2021-23133 +* Wed May 12 2021 Ankit Jain 5.10.25-9 +- .config: Enable Netfilter modules required for NFT support +- .config: Enable Bonding driver support, NET_TEAM, NET_VRF +* Tue May 11 2021 Srivatsa S. Bhat (VMware) 5.10.25-8 +- Fix CVE-2020-26147, CVE-2020-24587, CVE-2020-24586, CVE-2020-24588, +- CVE-2020-26145, CVE-2020-26141 +* Tue May 11 2021 Srivatsa S. Bhat (VMware) 5.10.25-7 +- Fix CVE-2021-3489, CVE-2021-3490, CVE-2021-3491 +* Tue May 04 2021 Sharan Turlapati 5.10.25-6 +- Remove buf_info from device accessible structures in vmxnet3 +* Thu Apr 29 2021 Alexey Makhalov 5.10.25-5 +- Update canister binary. +- use jent by drbg and ecc. +- Enable hmac(sha224) self test and broket KAT test. +* Thu Apr 22 2021 Keerthana K 5.10.25-4 +- Remove hmac(sha224) from broken kat test. +* Thu Apr 15 2021 Sharan Turlapati 5.10.25-3 +- Fix for CVE-2021-23133 +* Thu Apr 15 2021 Srinidhi Rao 5.10.25-2 +- Fix for CVE-2021-29154 +* Mon Mar 22 2021 Him Kalyan Bordoloi 5.10.25-1 +- Update to version 5.10.25 +* Sun Mar 21 2021 Alexey Makhalov 5.10.21-3 +- Do not execute some tests twice +- Support future disablement of des3 +- Do verbose build +- Canister update. +* Mon Mar 15 2021 Srinidhi Rao 5.10.21-2 +- Use jitterentropy rng instead of urandom in rng module. +* Mon Mar 08 2021 Vikash Bansal 5.10.21-1 +- Update to version 5.10.21 +* Mon Mar 01 2021 Alexey Makhalov 5.10.4-14 +- Enable FIPS canister +* Fri Feb 19 2021 Ankit Jain 5.10.4-13 +- Enable CONFIG_ISCSI_TCP support +* Fri Feb 19 2021 Srivatsa S. Bhat (VMware) 5.10.4-12 +- Fix /boot/photon.cfg symlink when /boot is a separate partition. +* Fri Feb 19 2021 Ajay Kaher 5.10.4-11 +- Added SEV-ES improvement patches +* Thu Feb 18 2021 Keerthana K 5.10.4-10 +- Disable fips canister. +* Thu Feb 18 2021 Ajay Kaher 5.10.4-9 +- Enable CONFIG_WDAT_WDT +* Thu Feb 18 2021 Ajay Kaher 5.10.4-8 +- lower the loglevel for floppy driver +* Mon Feb 15 2021 Ankit Jain 5.10.4-7 +- Enable CONFIG_NF_TABLES support +* Thu Feb 11 2021 Keerthana K 5.10.4-6 +- Added crypto_self_test and kattest module. +- These patches are applied when kat_build is enabled. +* Wed Feb 03 2021 Ankit Jain 5.10.4-5 +- Replaced syscalls routines based on user space address +- Removed set_fs() calls +* Thu Jan 28 2021 Alexey Makhalov 5.10.4-4 +- Use secure FIPS canister. +* Mon Jan 25 2021 Ankit Jain 5.10.4-3 +- Enabled CONFIG_WIREGUARD +* Mon Jan 25 2021 Alexey Makhalov 5.10.4-2 +- Build kernel with FIPS canister. +* Wed Jan 06 2021 Bo Gan 5.10.4-1 +- Update to 5.10.4 +- Drop out-of-tree SEV-ES functional patches (already upstreamed). +* Thu Dec 03 2020 Alexey Makhalov 5.9.0-8 +- halt_on_panic kernel cmdline. +- Improve no ACPI poweroff patch to support direct boot. +- .config: enable CONFIG_POWER_RESET_PIIX4_POWEROFF. +* Wed Nov 18 2020 Vikash Bansal 5.9.0-7 +- Mark BAR0 (at offset 0x10) for PCI device 15ad:07b0 (VMXNET3) as variable +* Thu Nov 12 2020 Ajay Kaher 5.9.0-6 +- .config: support for floppy disk and ch341 usb to serial +* Tue Nov 10 2020 Keerthana K 5.9.0-5 +- Fix CVE-2020-8694 +* Fri Nov 06 2020 Keerthana K 5.9.0-4 +- Fix CVE-2020-25704 +* Tue Nov 03 2020 Srinidhi Rao 5.9.0-3 +- Remove the support of fipsify and hmacgen +* Tue Oct 27 2020 Srinidhi Rao 5.9.0-2 +- Enable vtarfs support as module +* Mon Oct 19 2020 Bo Gan 5.9.0-1 +- Update to 5.9.0 +* Thu Oct 08 2020 Ankit Jain 5.9.0-rc7.2 +- Added vtar Support. +- Disabled by default, Enable CONFIG_VTAR as builtin only +* Wed Sep 30 2020 Srivatsa S. Bhat (VMware) 5.9.0-rc7.1 +- Update to version 5.9.0-rc7 +* Mon Sep 21 2020 Bo Gan 5.9.0-rc4.1 +- Update to 5.9.0-rc4 +- AMD SEV-ES Support +* Tue Sep 8 2020 Him Kalyan Bordoloi 4.19.127-4 +- Enable sysrq magic in config +* Mon Jul 27 2020 Srivatsa S. Bhat (VMware) 4.19.127-3 +- Fix CVE-2020-14331 +* Tue Jun 23 2020 Tapas Kundu 4.19.127-2 +- Mass Removal Python2 +* Tue Jun 23 2020 Keerthana K 4.19.127-1 +- Update to version 4.19.127 +* Fri Jun 05 2020 Ankit Jain 4.19.115-5 +- Enabled CONFIG_BINFMT_MISC +* Wed Jun 03 2020 Alexey Makhalov 4.19.115-4 +- fs/9p: local lock support +* Tue Jun 02 2020 Vikash Bansal 4.19.115-3 +- Add patch to fix CVE-2019-18885 +* Mon Jun 01 2020 Shreenidhi Shedi 4.19.115-2 +- Keep modules of running kernel till next boot +* Fri May 29 2020 Alexey Makhalov 4.19.115-1 +- initramfs: zero-copy support +* Wed May 06 2020 Siddharth Chandrasekaran 4.19.112-9 +- Add patch to fix CVE-2020-10711 +* Wed May 06 2020 Vikash Bansal 4.19.112-8 +- Hardcoded the value of BARs in PCI_Probe for 2 more pci devices +* Wed Apr 29 2020 Keerthana K 4.19.112-7 +- Photon-checksum-generator version update to 1.1. +* Fri Apr 24 2020 Vikash Bansal 4.19.112-6 +- Modified PCI Probe patch to store hardcoded values in lookup table +* Thu Apr 23 2020 Keerthana K 4.19.112-5 +- Fix __modules_install_post to skip compression for certain modules. +* Wed Apr 22 2020 Vikash Bansal 4.19.112-4 +- Corrected number of bars for "LSI Logic" and typepo in is_known_device call +* Wed Apr 15 2020 Vikash Bansal 4.19.112-3 +- HMAC-SHA256 digest of hmac_generator module moved to hmacgen package +* Tue Apr 14 2020 Alexey Makhalov 4.19.112-2 +- Refactor PCI probe patch (03-pci-probe.patch) +* Wed Apr 08 2020 Srivatsa S. Bhat (VMware) 4.19.112-1 +- Update to version 4.19.112 +* Wed Apr 08 2020 Alexey Makhalov 4.19.104-3 +- Improve hardcodded poweroff (03-poweroff.patch) +* Tue Mar 31 2020 Vikash Bansal 4.19.104-2 +- hmac generation of crypto modules and initrd generation changes if fips=1 +* Wed Mar 25 2020 Vikash Bansal 4.19.104-1 +- Update to version 4.19.104 +* Mon Mar 16 2020 Keerthana K 4.19.97-8 +- Adding Enhances depedency to hmacgen. +* Fri Mar 06 2020 Alexey Makhalov 4.19.97-7 +- 9p: file attributes caching support (cache=stat) +* Wed Mar 04 2020 Vikash Bansal 4.19.97-6 +- Backporting of patch continuous testing of RNG from urandom +* Fri Feb 28 2020 Keerthana K 4.19.97-5 +- Enable CONFIG_CRYPT_TEST for FIPS. +* Tue Feb 25 2020 Ajay Kaher 4.19.97-4 +- Fix CVE-2019-16234 +* Tue Feb 11 2020 Keerthana K 4.19.97-3 +- Add photon-checksum-generator source tarball and remove hmacgen patch. +- Exclude hmacgen.ko from base package. +* Wed Jan 29 2020 Keerthana K 4.19.97-2 +- Update tcrypt to test drbg_pr_sha256 and drbg_nopr_sha256. +- Update testmgr to add drbg_pr_ctr_aes256 test vectors. +* Fri Jan 17 2020 Srivatsa S. Bhat (VMware) 4.19.97-1 +- Update to version 4.19.97 +* Thu Jan 16 2020 Srinidhi Rao 4.19.87-5 +- Enable DRBG HASH and DRBG CTR support. +* Mon Jan 06 2020 Him Kalyan Bordoloi 4.19.87-4 +- Enable CONFIG_NF_CONNTRACK_ZONES +* Thu Jan 02 2020 Keerthana K 4.19.87-3 +- Modify tcrypt to remove tests for algorithms that are not supported in photon. +- Added tests for DH, DRBG algorithms. +* Fri Dec 20 2019 Keerthana K 4.19.87-2 +- Update fips Kat tests. +* Fri Dec 06 2019 Ajay Kaher 4.19.87-1 +- Update to version 4.19.87 +* Tue Dec 03 2019 Keerthana K 4.19.84-3 +- Adding hmac sha256/sha512 generator kernel module for fips. +* Tue Nov 26 2019 Ajay Kaher 4.19.84-2 +- Fix CVE-2019-19062, CVE-2019-19066, CVE-2019-19072, +- CVE-2019-19073, CVE-2019-19074, CVE-2019-19078 +* Tue Nov 12 2019 Srivatsa S. Bhat (VMware) 4.19.84-1 +- Update to version 4.19.84 +- Fix CVE-2019-18814 +* Fri Nov 08 2019 Srivatsa S. Bhat (VMware) 4.19.82-1 +- Update to version 4.19.82 +* Thu Nov 07 2019 Jorgen Hansen (VMware) 4.19.79-2 +- Fix vsock QP detach with outgoing data +* Tue Oct 15 2019 Ajay Kaher 4.19.79-1 +- Update to version 4.19.79 +- Fix CVE-2019-17133 +* Mon Oct 14 2019 Bo Gan 4.19.76-4 +- Recreate /dev/root in init +* Mon Oct 14 2019 Bo Gan 4.19.76-3 +- Enable IMA with SHA256 as default hash algorithm +* Thu Oct 10 2019 Harinadh D 4.19.76-2 +- Adding lvm and dm-mod modules to support root as lvm +* Wed Oct 02 2019 Ajay Kaher 4.19.76-1 +- Update to version 4.19.76 +* Mon Sep 30 2019 Srivatsa S. Bhat (VMware) 4.19.72-1 +- Update to version 4.19.72 +* Thu Sep 05 2019 Alexey Makhalov 4.19.69-2 +- Avoid oldconfig which leads to potential build hang +* Fri Aug 30 2019 Alexey Makhalov 4.19.69-1 +- Update to version 4.19.69 +* Fri Aug 23 2019 Him Kalyan Bordoloi 4.19.65-3 +- .config: Enable CONFIG_IP_VS_WRR, CONFIG_IP_VS_SH, CONFIG_FB_EFI, CONFIG_TCG_TIS_CORE +* Tue Aug 13 2019 Daniel Müller 4.19.65-2 +- Add patch "Remove OOM_SCORE_ADJ_MAX limit check" +* Tue Aug 06 2019 Alexey Makhalov 4.19.65-1 +- Update to version 4.19.65 +- Fix CVE-2019-1125 (SWAPGS) +* Tue Jul 30 2019 Keerthana K 4.19.52-4 +- Fix postun script. +* Tue Jul 02 2019 Alexey Makhalov 4.19.52-3 +- Fix 9p vsock 16bit port issue. +* Fri Jun 21 2019 Srinidhi Rao 4.19.52-2 +- Use LZ4 compression and enable VMXNET3 as built-in for linux-esx +* Mon Jun 17 2019 Srivatsa S. Bhat (VMware) 4.19.52-1 +- Update to version 4.19.52 +- Fix CVE-2019-12456, CVE-2019-12379, CVE-2019-12380, CVE-2019-12381, +- CVE-2019-12382, CVE-2019-12378, CVE-2019-12455 +* Tue May 14 2019 Keerthana K 4.19.40-2 +- Fix to parse through /boot folder and update symlink (/boot/photon.cfg) if +- mulitple kernels are installed and current linux kernel is removed. +* Tue May 07 2019 Ajay Kaher 4.19.40-1 +- Update to version 4.19.40 +* Fri May 03 2019 Ajay Kaher 4.19.32-3 +- Enable SELinux kernel config +* Fri Mar 29 2019 Srivatsa S. Bhat (VMware) 4.19.32-2 +- Fix CVE-2019-10125 +* Wed Mar 27 2019 Srivatsa S. Bhat (VMware) 4.19.32-1 +- Update to version 4.19.32 +* Thu Mar 14 2019 Srivatsa S. Bhat (VMware) 4.19.29-1 +- Update to version 4.19.29 +* Tue Mar 05 2019 Ajay Kaher 4.19.26-1 +- Update to version 4.19.26 +* Thu Feb 21 2019 Him Kalyan Bordoloi 4.19.15-2 +- Fix CVE-2019-8912 +* Tue Jan 15 2019 Srivatsa S. Bhat (VMware) 4.19.15-1 +- Update to version 4.19.15 +- .config: Enable USB_SERIAL and USB_ACM +* Tue Jan 08 2019 Alexey Makhalov 4.19.6-4 +- Additional security hardening options in the config. +* Tue Jan 08 2019 Srivatsa S. Bhat (VMware) 4.19.6-3 +- Fix crash on cpu hot-add. +* Fri Jan 04 2019 Srivatsa S. Bhat (VMware) 4.19.6-2 +- Add out-of-tree patches from AppArmor and enable it by default. +* Mon Dec 10 2018 Srivatsa S. Bhat (VMware) 4.19.6-1 +- Update to version 4.19.6 +* Thu Nov 29 2018 Alexey Makhalov 4.19.1-3 +- Fix BAR4 is zero issue for IDE devices +* Thu Nov 15 2018 Ajay Kaher 4.19.1-2 +- Adding BuildArch +* Thu Nov 08 2018 Him Kalyan Bordoloi 4.19.1-1 +- Update to version 4.19.1 +* Mon Sep 24 2018 Srivatsa S. Bhat 4.18.9-1 +- Update to version 4.18.9 +* Wed Sep 19 2018 Srivatsa S. Bhat 4.14.67-1 +- Update to version 4.14.67 +* Tue Sep 18 2018 Srivatsa S. Bhat 4.14.54-3 +- Add rdrand-based RNG driver to enhance kernel entropy. +* Sun Sep 02 2018 Srivatsa S. Bhat 4.14.54-2 +- Add full retpoline support by building with retpoline-enabled gcc. +* Mon Jul 09 2018 Him Kalyan Bordoloi 4.14.54-1 +- Update to version 4.14.54 +* Fri Feb 02 2018 Alexey Makhalov 4.14.8-1 +- Version update +* Tue Dec 19 2017 Srivatsa S. Bhat 4.9.66-2 +- Enable audit support (CONFIG_AUDIT=y) +* Mon Dec 04 2017 Srivatsa S. Bhat 4.9.66-1 +- Version update +* Tue Nov 21 2017 Srivatsa S. Bhat 4.9.64-1 +- Version update +* Mon Nov 06 2017 Srivatsa S. Bhat 4.9.60-1 +- Version update +* Wed Oct 25 2017 Anish Swaminathan 4.9.53-5 +- Enable x86 vsyscall emulation +* Tue Oct 17 2017 Alexey Makhalov 4.9.53-4 +- Enable vsyscall emulation +- Do not use deprecated -q depmod option +* Wed Oct 11 2017 Srivatsa S. Bhat 4.9.53-3 +- Add patch "KVM: Don't accept obviously wrong gsi values via + KVM_IRQFD" to fix CVE-2017-1000252. +* Tue Oct 10 2017 Alexey Makhalov 4.9.53-2 +- Build hang (at make oldconfig) fix. +* Thu Oct 05 2017 Srivatsa S. Bhat 4.9.53-1 +- Version update +* Mon Oct 02 2017 Srivatsa S. Bhat 4.9.52-3 +- Allow privileged CLONE_NEWUSER from nested user namespaces. +* Mon Oct 02 2017 Srivatsa S. Bhat 4.9.52-2 +- Fix CVE-2017-11472 (ACPICA: Namespace: fix operand cache leak) +* Mon Oct 02 2017 Srivatsa S. Bhat 4.9.52-1 +- Version update +* Mon Sep 18 2017 Alexey Makhalov 4.9.47-2 +- Requires coreutils or toybox +* Mon Sep 04 2017 Alexey Makhalov 4.9.47-1 +- Fix CVE-2017-11600 +* Mon Aug 14 2017 Alexey Makhalov 4.9.43-1 +- Version update +- [feature] new sysctl option unprivileged_userns_clone +* Wed Aug 09 2017 Alexey Makhalov 4.9.41-2 +- [bugfix] Do not fallback to syscall from VDSO on clock_gettime(MONOTONIC) +- Fix CVE-2017-7542 +* Mon Aug 07 2017 Alexey Makhalov 4.9.41-1 +- Version update +* Wed Jul 26 2017 Bo Gan 4.9.38-3 +- Fix initramfs triggers +* Thu Jul 20 2017 Alexey Makhalov 4.9.38-2 +- Disable scheduler beef up patch +* Tue Jul 18 2017 Alexey Makhalov 4.9.38-1 +- [feature] IP tunneling support (CONFIG_NET_IPIP=m) +- Fix CVE-2017-11176 and CVE-2017-10911 +* Mon Jul 03 2017 Xiaolin Li 4.9.34-2 +- Add libdnet-devel, kmod-devel and libmspack-devel to BuildRequires +* Wed Jun 28 2017 Alexey Makhalov 4.9.34-1 +- [feature] DM Delay target support +- Fix CVE-2017-1000364 ("stack clash") and CVE-2017-9605 +* Thu Jun 8 2017 Alexey Makhalov 4.9.31-1 +- Fix CVE-2017-8890, CVE-2017-9074, CVE-2017-9075, CVE-2017-9076 + CVE-2017-9077 and CVE-2017-9242 +* Thu Jun 1 2017 Alexey Makhalov 4.9.30-2 +- [feature] ACPI NFIT support (for PMEM type 7) +* Fri May 26 2017 Alexey Makhalov 4.9.30-1 +- Fix CVE-2017-7487 and CVE-2017-9059 +* Wed May 17 2017 Vinay Kulkarni 4.9.28-2 +- Enable IPVLAN module. +* Tue May 16 2017 Alexey Makhalov 4.9.28-1 +- .config: built ATA drivers in a kernel +* Wed May 10 2017 Alexey Makhalov 4.9.27-1 +- New pci=scan_all cmdline parameter to verify hardcoded pci-probe values +- pci-probe added more known values +- vmw_balloon late initcall +* Sun May 7 2017 Alexey Makhalov 4.9.26-1 +- Version update +- Use ordered rdtsc in clocksource_vmware +- .config: added debug info +- Removed version suffix from config file name +* Thu Apr 27 2017 Bo Gan 4.9.24-2 +- Support dynamic initrd generation +* Tue Apr 25 2017 Alexey Makhalov 4.9.24-1 +- Fix CVE-2017-6874 and CVE-2017-7618. +- .config: build nvme and nvme-core in kernel. +* Tue Feb 28 2017 Alexey Makhalov 4.9.13-1 +- Update to linux-4.9.13 to fix CVE-2017-5986 and CVE-2017-6074 +- .config: enable PMEM support +- .config: disable vsyscall +* Thu Feb 09 2017 Alexey Makhalov 4.9.9-1 +- Update to linux-4.9.9 to fix CVE-2016-10153, CVE-2017-5546, + CVE-2017-5547, CVE-2017-5548 and CVE-2017-5576. +- .config: added CRYPTO_FIPS and SYN_COOKIES support. +* Tue Jan 10 2017 Alexey Makhalov 4.9.2-1 +- Update to linux-4.9.2 to fix CVE-2016-10088 +* Wed Dec 21 2016 Alexey Makhalov 4.9.0-3 +- .config: CONFIG_IPV6_MULTIPLE_TABLES=y +* Mon Dec 19 2016 Xiaolin Li 4.9.0-2 +- BuildRequires Linux-PAM-devel +* Mon Dec 12 2016 Alexey Makhalov 4.9.0-1 +- Update to linux-4.9.0 +* Thu Dec 8 2016 Alexey Makhalov 4.4.35-4 +- net-packet-fix-race-condition-in-packet_set_ring.patch + to fix CVE-2016-8655 +* Wed Nov 30 2016 Alexey Makhalov 4.4.35-3 +- Expand `uname -r` with release number +- Compress modules +* Tue Nov 29 2016 Alexey Makhalov 4.4.35-2 +- Added btrfs module +* Mon Nov 28 2016 Alexey Makhalov 4.4.35-1 +- Update to linux-4.4.35 +- vfio-pci-fix-integer-overflows-bitmask-check.patch + to fix CVE-2016-9083 +* Tue Nov 22 2016 Alexey Makhalov 4.4.31-4 +- net-9p-vsock.patch +* Thu Nov 17 2016 Alexey Makhalov 4.4.31-3 +- tty-prevent-ldisc-drivers-from-re-using-stale-tty-fields.patch + to fix CVE-2015-8964 +* Tue Nov 15 2016 Alexey Makhalov 4.4.31-2 +- .config: add ip set support +- .config: add ipvs_{tcp,udp} support +- .config: add cgrup_{hugetlb,net_prio} support +* Thu Nov 10 2016 Alexey Makhalov 4.4.31-1 +- Update to linux-4.4.31 +* Thu Nov 10 2016 Alexey Makhalov 4.4.26-2 +- .config: add ipvs modules for docker swarm +- .config: serial driver built in kernel +- serial-8250-do-not-probe-U6-16550A-fifo-size.patch - faster boot +* Fri Oct 21 2016 Alexey Makhalov 4.4.26-1 +- Update to linux-4.4.26 +* Wed Oct 19 2016 Alexey Makhalov 4.4.20-7 +- net-add-recursion-limit-to-GRO.patch +* Tue Oct 18 2016 Alexey Makhalov 4.4.20-6 +- ipip-properly-mark-ipip-GRO-packets-as-encapsulated.patch +- tunnels-dont-apply-GRO-to-multiple-layers-of-encapsulation.patch +* Thu Oct 6 2016 Alexey Makhalov 4.4.20-5 +- .config: added ADM PCnet32 support +- vmci-1.1.4.0-use-32bit-atomics-for-queue-headers.patch +- vmci-1.1.5.0-doorbell-create-and-destroy-fixes.patch +- late_initcall for vmw_balloon driver +- Minor fixed in pv-ops patchset +* Mon Oct 3 2016 Alexey Makhalov 4.4.20-4 +- Package vmlinux with PROGBITS sections in -debuginfo subpackage +* Wed Sep 21 2016 Alexey Makhalov 4.4.20-3 +- Add PCIE hotplug support +- Switch processor type to generic +* Tue Sep 20 2016 Alexey Makhalov 4.4.20-2 +- Add -release number for /boot/* files +- Fixed generation of debug symbols for kernel modules & vmlinux +* Wed Sep 7 2016 Alexey Makhalov 4.4.20-1 +- Update to linux-4.4.20 +- keys-fix-asn.1-indefinite-length-object-parsing.patch +* Thu Aug 25 2016 Alexey Makhalov 4.4.8-11 +- vmxnet3 patches to bumpup a version to 1.4.8.0 +* Wed Aug 24 2016 Alexey Makhalov 4.4.8-10 +- .config: added NVME blk dev support +* Wed Aug 10 2016 Alexey Makhalov 4.4.8-9 +- Added VSOCK-Detach-QP-check-should-filter-out-non-matching-QPs.patch +* Wed Jul 20 2016 Alexey Makhalov 4.4.8-8 +- .config: added cgroups for pids,mem and blkio +* Mon Jul 11 2016 Alexey Makhalov 4.4.8-7 +- .config: added ip multible tables support +* Fri Jun 17 2016 Alexey Makhalov 4.4.8-6 +- patch: e1000e-prevent-div-by-zero-if-TIMINCA-is-zero.patch +- .config: disable rt group scheduling - not supported by systemd +* Fri May 27 2016 Alexey Makhalov 4.4.8-5 +- patch: REVERT-sched-fair-Beef-up-wake_wide.patch +* Wed May 25 2016 Alexey Makhalov 4.4.8-4 +- .config: added net_9p and 9p_fs +* Tue May 24 2016 Priyesh Padmavilasom 4.4.8-3 +- GA - Bump release of all rpms +* Mon May 23 2016 Divya Thaluru 4.4.8-2 +- Added patches to fix CVE-2016-3134, CVE-2016-3135 +* Fri May 13 2016 Alexey Makhalov 4.4.8-1 +- Update to linux-4.4.8 +- Added net-Drivers-Vmxnet3-set-... patch +- Added e1000e module +* Tue Mar 29 2016 Alexey Makhalov 4.2.0-19 +- Support kmsg dumping to vmware.log on panic +- sunrpc: xs_bind uses ip_local_reserved_ports +* Thu Mar 24 2016 Alexey Makhalov 4.2.0-18 +- Apply photon8 config (+stack protector regular) +- pv-ops patch: added STA support +- Added patches from generic kernel +* Wed Mar 09 2016 Harish Udaiya Kumar 4.2.0-17 +- Enable ACPI hotplug support in kernel config +* Sun Feb 14 2016 Alexey Makhalov 4.2.0-16 +- veth patch: don’t modify ip_summed +* Mon Feb 08 2016 Alexey Makhalov 4.2.0-15 +- Double tcp_mem limits, patch is added. +* Wed Feb 03 2016 Anish Swaminathan 4.2.0-14 +- Fixes for CVE-2015-7990/6937 and CVE-2015-8660. +* Fri Jan 22 2016 Alexey Makhalov 4.2.0-13 +- Fix for CVE-2016-0728 +* Wed Jan 13 2016 Alexey Makhalov 4.2.0-12 +- CONFIG_HZ=250 +- Disable sched autogroup. +* Tue Jan 12 2016 Mahmoud Bassiouny 4.2.0-11 +- Remove rootfstype from the kernel parameter. +* Tue Dec 15 2015 Alexey Makhalov 4.2.0-10 +- Skip rdrand reseed to improve boot time. +- .config changes: jolietfs(m), default THP=always, hotplug_cpu(m) +* Tue Nov 17 2015 Alexey Makhalov 4.2.0-9 +- nordrand cmdline param is removed. +- .config: + serial 8250 driver (M). +* Fri Nov 13 2015 Mahmoud Bassiouny 4.2.0-8 +- Change the linux image directory. +* Tue Nov 10 2015 Alexey Makhalov 4.2.0-7 +- Get LAPIC timer frequency from HV, skip boot time calibration. +- .config: + dummy net driver (M). +* Mon Nov 09 2015 Alexey Makhalov 4.2.0-6 +- Rename subpackage dev -> devel. +- Added the build essential files in the devel subpackage. +- .config: added genede driver module. +* Wed Oct 28 2015 Alexey Makhalov 4.2.0-5 +- Import patches from kernel2 repo. +- Added pv-ops patch (timekeeping related improvements). +- Removed unnecessary cmdline params. +- .config changes: elevator=noop by default, paravirt clock enable, + initrd support, openvswitch module, x2apic enable. +* Mon Sep 21 2015 Alexey Makhalov 4.2.0-4 +- CDROM modules are added. +* Thu Sep 17 2015 Alexey Makhalov 4.2.0-3 +- Fix for 05- patch (SVGA mem size) +- Compile out: pci hotplug, sched smt. +- Compile in kernel: vmware balloon & vmci. +- Module for efi vars. +* Fri Sep 4 2015 Alexey Makhalov 4.2.0-2 +- Hardcoded poweroff (direct write to piix4), no ACPI is required. +- sd.c: Lower log level for "Assuming drive cache..." message. +* Tue Sep 1 2015 Alexey Makhalov 4.2.0-1 +- Update to linux-4.2.0. Enable CONFIG_EFI +* Fri Aug 28 2015 Alexey Makhalov 4.1.3-5 +- Added MD/LVM/DM modules. +- Pci probe improvements. +* Fri Aug 14 2015 Alexey Makhalov 4.1.3-4 +- Use photon.cfg as a symlink. +* Thu Aug 13 2015 Alexey Makhalov 4.1.3-3 +- Added environment file(photon.cfg) for a grub. +* Tue Aug 11 2015 Alexey Makhalov 4.1.3-2 +- Added pci-probe-vmware.patch. Removed unused modules. Decreased boot time. +* Tue Jul 28 2015 Alexey Makhalov 4.1.3-1 +- Initial commit. Use patchset from Clear Linux. diff --git a/SPECS/linux/linux-esx-6.12.inc b/SPECS/linux/linux-esx-6.12.inc new file mode 100644 index 0000000000..9af95f2ef7 --- /dev/null +++ b/SPECS/linux/linux-esx-6.12.inc @@ -0,0 +1,323 @@ +# linux-esx.spec preamble for kernel 6.12 (photon_subrelease >= 91; 6.12.111 at 91), included from linux-esx.spec + +%global security_hardening none +%global __cmake_in_source_build 0 + +# SBAT generation of "linux.photon" component +%define linux_photon_generation 1 + +# Do not add unique suffix to *.ko.debug files +# If _unique_debug_names defined, then __debug_install_post expands +# *.ko to *.ko--..debug. +# Undefining this option keeps filenames simple: *.ko.debug. +# This is what crash utility is looking for. +%undefine _unique_debug_names + +%ifarch x86_64 +%define arch x86_64 +%define archdir x86 + +# Set this flag to 0 to build without canister +%global fips 1 +%endif + +%ifarch aarch64 +%define arch arm64 +%define archdir arm64 +%global fips 0 +%endif + +# The esx flavour never builds the canister itself, it always links against the +# prebuilt canister object file. Mirror linux.spec's derived flag model so the +# shared canister_config.inc behaves identically for both flavours. +%if 0%{?fips} +%global canister_build 0 +%global canister_usage 1 +%else +%global canister_build 0 +%global canister_usage 0 +%endif + +%if 0%{?photon_subrelease} == 91 +Release: 4%{?dist} +%else +Release: 2%{?dist} +%endif + +%define uname_r %{version}-%{release}-esx +%define _modulesdir /lib/modules/%{uname_r} + +Source1: config-esx_%{_arch} +Source2: initramfs.trigger +# contains pre, postun, filetriggerun tasks +Source3: scriptlets.inc +Source4: check_for_config_applicability.inc +# shared canister/.config handling, also included by linux.spec +Source5: canister_config.inc + +Source19: spec_install_post.inc + +Source20: %{name}-dracut.conf + +Source21: photon_km_2025.pem +%ifarch x86_64 +# Secure Boot +Source25: linux-sbat.csv.in +%endif + +Source30: Makefile.viomem +Source31: viomem.c + +Source42: license-esx.txt +%include %{SOURCE42} + +%if 0%{?fips} +%define jent_name photon-jitterentropy-v6.12 +%define jent_rel_ver 3 +Source10000: %{jent_name}-%{jent_rel_ver}.tar.gz + +Source10001: jitterentropy_canister_wrapper.c +Source10002: jitterentropy_canister_wrapper.h +Source10003: jitterentropy_canister_wrapper_asm.S + +%define fips_canister_version 6.12.60-18.2.ph5 +%define ExtraBuildRequiresSansSnapshot linux-fips-canister = %{fips_canister_version} +BuildRequires: linux-fips-canister = %{fips_canister_version} + +Source10101: fips_canister_wrapper.c +Source10102: fips_canister_wrapper.h +Source10104: fips_canister_wrapper_common.h +Source10105: fips_canister_wrapper_internal.h +Source10106: fips_canister_wrapper_internal.c + +Source10300: jitterentropy_rng_proxy.c +%endif + +Source10301: kernel_cve_patches.inc + +# common [0..49] +Patch0: confdata-format-change-for-split-script.patch +Patch1: net-Double-tcp_mem-limits.patch +Patch2: SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch +Patch3: 9p-transport-for-9p.patch +Patch4: 9p-trans_fd-extend-port-variable-to-u32.patch +Patch5: vsock-delay-detach-of-QP-with-outgoing-data-59.patch +# RDRAND-based RNG driver to enhance the kernel's entropy pool: +Patch6: 0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch +Patch7: 0001-cgroup-v1-cgroup_stat-support.patch +# Expose Photon kernel macros to identify kernel flavor and version +Patch9: 0001-kbuild-Makefile-Introduce-macros-to-distinguish-Phot.patch +Patch10: 0002-linux-esx-Makefile-Add-kernel-flavor-info-to-the-gen.patch +Patch12: 9p-support-for-local-file-lock.patch +%if 0%{?photon_subrelease} == 91 +Patch13: 0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS-6.12.111.patch +%else +Patch13: 0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS.patch +%endif +# Out-of-tree patches from AppArmor: +Patch14: 0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch +Patch15: 0002-apparmor-af_unix-mediation.patch +Patch17: Performance-over-security-model.patch +# Enable AUXILIARY BUS, to make building other out-of-tree intel NIC drivers easier +Patch19: 0001-Enable-AUXILIARY_BUS-by-default.patch + +#VTAR/VTARFS +Patch20: 0001-fs-VTAR-archive-to-TPMFS-extractor.patch +Patch21: 0001-fs-A-new-VTARFS-file-system-to-mount-VTAR-archive.patch +#TARFS +Patch22: 0001-fs-TARFS-file-system-to-mount-TAR-archive.patch +#initrd newca +Patch23: 0001-initramfs-support-for-page-aligned-format-newca.patch +Patch24: 0001-NEWCA-make-initrd-pages-immutable.patch + +# Upstream fix to properly handle PNP0C01/PNP0C02 device. +Patch25: 0001-ACPI-PNP-Drop-PNP0C01-and-PNP0C02-from-acpi_pnp_devi.patch + +Patch29: 0001-randomize_kstack-Unify-random-source-across-arches.patch + +# Patches for ptp_vmw +Patch30: 0001-ptp-ptp_vmw-Implement-PTP-clock-adjustments-ops.patch +Patch31: 0002-ptp-ptp_vmw-Add-module-param-to-probe-device-using-h.patch + +Patch32: 0001-alloc_tag-avoid-current-alloc_tag-manipulations-when.patch + +# sched_info_enqueue: don't update last_queued on delayed migration +Patch33: 0001-sched_info_enqueue-don-t-update-last_queued-on-delay.patch + +%if 0%{?photon_subrelease} >= 92 +# Improve small copy_to/from_user performance on CPUs without FSRM +Patch34: 0001-x86-bring-back-unrolled-loop-for-small-sizes-without.patch +Patch35: 0001-x86-only-clobber-registers-in-the-unrolled-case.patch +%endif + +%ifarch x86_64 +# VMW: [50..59] +Patch50: x86-vmware-Log-kmsg-dump-on-panic.patch +Patch51: x86-vmware-Support-steal-time-clock-for-encrypted-gu.patch +# Report guest crash to vmware hypervisor +Patch52: 0001-x86-report-guest-crash-to-vmware-hypervisor.patch + +# SEV on VMware +Patch53: 0079-x86-sev-es-Disable-BIOS-ACPI-RSDP-probing-if-SEV-ES-.patch +Patch54: 0080-x86-boot-Enable-vmw-serial-port-via-Super-I-O.patch +Patch55: 0001-x86-boot-unconditional-preserve-CR4.MCE.patch +# TODO: Review: Patch602: 0081-x86-sev-es-Disable-use-of-WP-via-PAT-for-__sme_early.patch +Patch56: 0001-x86-vmware-Redefine-the-macro-of-CPUID_VMWARE.patch + +# Secure Boot and Kernel Lockdown +Patch57: 0001-kernel-lockdown-when-UEFI-secure-boot-enabled.patch +Patch58: 0002-Add-.sbat-section.patch +# NOTE: linux-esx does not support kexec, omitting SBAT verify logic. +# CONFIG_SECURITY_SBAT_VERIFY=y +# Patch58: 0003-Verify-SBAT-on-kexec.patch +#external-entropy +Patch59: 0001-external_entropy-Enable-External-Entropy-support.patch +Patch60: 07-vmware-only.patch +%endif + +# linux-esx [60..89] +Patch61: init-do_mounts-recreate-dev-root.patch +Patch62: serial-8250-do-not-probe-U6-16550A-fifo-size.patch +Patch63: 01-clear-linux.patch +Patch64: 02-pci-probe.patch +Patch65: poweroff-without-firmware.patch +Patch66: 04-quiet-boot.patch +Patch67: 05-pv-ops-clocksource.patch +Patch68: 0001-Remove-OOM_SCORE_ADJ_MAX-limit-check.patch +Patch69: halt-on-panic.patch +Patch70: x86-probe_roms-Skip-OpROM-probing-if-running-as-VMwa.patch +Patch71: revert-x86-entry-Align-entry-text-section-to-PMD-boundary.patch + +%if 0%{?vmxnet3_sw_timestamp} +Patch72: 0009-esx-vmxnet3-software-timestamping.patch +%endif + +# vmxnet3 +Patch73: 0001-vmxnet3_support_higher_link_speeds_from_vmxnet3_v9.patch + +# initialize MMCONFIG +Patch75: 0001-initialize-MMCONFIG-if-already-not-initialized.patch +Patch76: 0001-MMIO_should_have_more_priority_then_IO.patch +Patch77: 0001-Avoid-extra-scanning-for-peer-host-bridges.patch + +# Hotplug support without firmware +Patch80: 0001-vmw_extcfg-hotplug-without-firmware-support.patch +Patch81: 0002-vmw_extcfg-hotplug-without-firmware-support.patch +Patch82: 0003-vmw_extcfg-hotplug-without-firmware-support.patch + +# Drain per-CPU page caches after boot-time memory frees, so +# /proc/meminfo reports settled numbers from the first read +Patch83: 0001-init-main.c-drain-per-CPU-page-caches-after-boot-tim.patch + +# SBX driver +Patch85: 0001-Adding-SBX-kernel-driver.patch + +%ifarch x86_64 +#SBX DTLS driver +Patch86: 0001-linux-esx-Add-SBX-DTLS-kernel-module.patch +%endif + +# Backward compatibility +%if "%{dist}" == ".ph5" +Patch91: 0001-block-Fix-validation-of-ioprio-level.patch +%endif + +# CVE patches — see kernel_cve_patches.inc (range 3000–3999) +%include %{SOURCE10301} + +# aarch64 [200..219] +%ifarch aarch64 +Patch200: 0001-x86-hyper-generalize-hypervisor-type-detection.patch +Patch201: 0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch +Patch202: 0003-arm64-VMware-hypervisor-detection.patch +Patch203: 0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch +Patch204: 0005-scsi-vmw_pvscsi-add-arm64-support.patch +Patch205: 0006-vmxnet3-build-only-for-x86-and-arm64.patch +Patch206: 0005-vmw_balloon-add-arm64-support.patch +Patch207: 0001-vmw_vmci-arm64-support-memory-ordering.patch +# Report guest crash to vmware hypervisor +Patch208: 0001-arm64-report-guest-crash-to-vmware-hypervisor.patch +%endif + +# 9p: [300..350] +Patch300: 0001-fs-9p-Add-opt_metaonly-cache-option.patch +# Patch301: 0002-p9fs_dir_readdir-offset-support.patch +Patch303: 0003-Enable-cache-loose-for-vdfs-9p.patch +Patch304: 0004-Ensure-seekdir-take-effect-when-entries-in-readdir-b.patch +Patch305: 0005-Initialize-fid-iounit-during-creation-of-p9_fid.patch +Patch307: 0006-fscache-Only-fetch-attr-from-inode-cache-when-cache-.patch +Patch308: 0007-9p-fscache-Make-dcache-work-with-case-insensitive-vo.patch +Patch309: 0008-9p-fscache-Ensure-consistent-blksize-is-returned-fro.patch + +# Only LKCM/JENT related patches below +# Jitterentropy support and FIPS compliance +Patch10000: 0001-New-memsize-options-for-jent.patch +%if 0%{?fips} +Patch10001: 0001-jitterentropy-Makefile-changes.patch +# Patch to remove urandom usage in rng module +Patch10002: 0001-FIPS-crypto-rng-Jitterentropy-RNG-as-the-only-RND-source.patch +# Disable md5 algorithm for sctp if fips is enabled. +Patch10003: 0001-disable-md5-and-sha1-algorithms-for-sctp-if-fips-is-enabled.patch +# Mark ECB as Internal algorithm if fips is enabled. +Patch10004: 0001-crypto-ecb-Set-ecb-alg-flag-as-Internal.patch +Patch10050: 0001-jitterentropy-Defer-jent_mod_init-in-non-fips-boot.patch + +# Below patches are common for canister_usage and canister_build flags +Patch10101: 0001-FIPS-canister-binary-usage.patch +Patch10102: 0002-algapi.c-honor-fcw_skip_tests.patch +Patch10103: 0003-tcrypt-align-to-LKCM.patch +Patch10104: 0004-scripts-kallsyms-Extra-kallsyms-parsing.patch +# Move rsa-pkcs1pad encrypt and decrypt functions outside canister +Patch10106: 0006-crypto-Disable-rsa-pkcs1pad-encrypt-decrypt-in-FIPS-.patch +# Add internal_iv field for aead_request +Patch10107: 0007-aead-add-internal_iv-field.patch +Patch10108: 0008-FIPS-Mark-structure-field-differences-between-kernel.patch +Patch10109: 0009-aead_geniv_ctx-drop-lock-field.patch +Patch10110: 0010-Move-crypto_inc-to-lib-crypto-utils.c.patch +Patch10111: 0001-crypto-Moving-rfc4543-out-of-canister-boundry.patch +# Make lib/digsig to use lib SHA1 instead of crypto shash API +# [10112..10116] +Patch10112: 0001-crypto-x86-sha1-Rename-conflicting-symbol.patch +Patch10113: 0002-lib-crypto-sha1-Rename-sha1_init-to-sha1_init_raw.patch +Patch10114: 0003-lib-crypto-sha1-Add-SHA-1-library-functions.patch +Patch10115: 0001-lib-digsig-Use-SHA-1-library-instead-of-crypto_shash.patch +Patch10116: 0001-crypto-sha1_generic-Renaming-sha1_final.patch +# Track internal/external jitterentropy rng requests +Patch10117: 0001-crypto-track-external-requests-to-jitterentropy_rng.patch +# make ima to use lib SHA1 instead of crypto shash API +Patch10118: 0001-linux-ima-Use-lib-sha1-instead-of-crypto-shash.patch + +# FIPS canister plugins +Patch10200: 0001-Compile-GCC-plugins-for-FIPS-canister.patch +Patch10201: 0002-Build-with-FIPS-Canister-GCC-plugins.patch +Patch10202: 0003-Introduce-FIPS-canister-plugins.patch +Patch10203: 0004-FIPS-Canister-Plugins-Add-self-tests.patch +Patch10204: 0001-Canister-GCC-Plugins-Implement-type-check.patch + +# Compile and inject jitterentropy rng proxy +Patch10300: 0001-compile-jitterentropy-rng-proxy.patch +Patch10301: 0001-change-jitterentropy_rng-driver-name.patch +%endif + +BuildRequires: mpc-devel +BuildRequires: bison +BuildRequires: libtraceevent-devel +BuildRequires: clang-devel +BuildRequires: readline-devel +%if 0%{?fips} +BuildRequires: gcc >= 12.2.0-6 +%endif + +# Requirements for signing artifacts +%if "%{?signing_script}" != "" +%ifarch x86_64 +%define network_required 1 +BuildRequires: ca-certificates-pki +BuildRequires: python3-requests +%endif +%endif + +Requires(pre): coreutils +Requires(preun): coreutils +Requires(post): coreutils +Requires(postun): coreutils diff --git a/SPECS/linux/linux-esx.spec b/SPECS/linux/linux-esx.spec index 9ec78646f5..d699a7afb0 100644 --- a/SPECS/linux/linux-esx.spec +++ b/SPECS/linux/linux-esx.spec @@ -1,290 +1,38 @@ -%global build_if %{photon_subrelease} >= 92 -%global security_hardening none -%global __cmake_in_source_build 0 - -# SBAT generation of "linux.photon" component -%define linux_photon_generation 1 - -# Do not add unique suffix to *.ko.debug files -# If _unique_debug_names defined, then __debug_install_post expands -# *.ko to *.ko--..debug. -# Undefining this option keeps filenames simple: *.ko.debug. -# This is what crash utility is looking for. -%undefine _unique_debug_names - -%ifarch x86_64 -%define arch x86_64 -%define archdir x86 - -# Set this flag to 0 to build without canister -%global fips 1 -%endif - -%ifarch aarch64 -%define arch arm64 -%define archdir arm64 -%global fips 0 -%endif +# One spec for every 5.0 subrelease: kernel 6.1 up to photon_subrelease 90, +# kernel 6.12 from 91 (6.12.111 at 91). The per-kernel preamble and changelog +# are included below; sections that differ carry photon_subrelease conditionals. Summary: Kernel Name: linux-esx -Version: 6.12.113 -Release: 1%{?dist} URL: http://www.kernel.org Group: System Environment/Kernel Vendor: VMware, Inc. Distribution: Photon -%define uname_r %{version}-%{release}-esx -%define _modulesdir /lib/modules/%{uname_r} - -Source0: http://www.kernel.org/pub/linux/kernel/v6.x/linux-%{version}.tar.xz -Source1: config-esx_%{_arch} -Source2: initramfs.trigger -# contains pre, postun, filetriggerun tasks -Source3: scriptlets.inc -Source4: check_for_config_applicability.inc - -Source19: spec_install_post.inc - -Source20: %{name}-dracut.conf - -Source21: photon_km_2025.pem -%ifarch x86_64 -# Secure Boot -Source25: linux-sbat.csv.in -%endif - -Source30: Makefile.viomem -Source31: viomem.c - -Source42: license-esx.txt -%include %{SOURCE42} - -%if 0%{?fips} -%define jent_name photon-jitterentropy-v6.12 -%define jent_rel_ver 3 -Source10000: %{jent_name}-%{jent_rel_ver}.tar.gz - -Source10001: jitterentropy_canister_wrapper.c -Source10002: jitterentropy_canister_wrapper.h -Source10003: jitterentropy_canister_wrapper_asm.S - -%define fips_canister_version 6.12.60-18.2.ph5 -%define ExtraBuildRequiresSansSnapshot linux-fips-canister = %{fips_canister_version} -BuildRequires: linux-fips-canister = %{fips_canister_version} - -Source10101: fips_canister_wrapper.c -Source10102: fips_canister_wrapper.h -Source10104: fips_canister_wrapper_common.h -Source10105: fips_canister_wrapper_internal.h -Source10106: fips_canister_wrapper_internal.c - -Source10300: jitterentropy_rng_proxy.c -%endif - -Source10301: kernel_cve_patches.inc - -# common [0..49] -Patch0: confdata-format-change-for-split-script.patch -Patch1: net-Double-tcp_mem-limits.patch -Patch2: SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch -Patch3: 9p-transport-for-9p.patch -Patch4: 9p-trans_fd-extend-port-variable-to-u32.patch -Patch5: vsock-delay-detach-of-QP-with-outgoing-data-59.patch -# RDRAND-based RNG driver to enhance the kernel's entropy pool: -Patch6: 0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch -Patch7: 0001-cgroup-v1-cgroup_stat-support.patch -# Expose Photon kernel macros to identify kernel flavor and version -Patch9: 0001-kbuild-Makefile-Introduce-macros-to-distinguish-Phot.patch -Patch10: 0002-linux-esx-Makefile-Add-kernel-flavor-info-to-the-gen.patch -Patch12: 9p-support-for-local-file-lock.patch -Patch13: 0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS.patch -# Out-of-tree patches from AppArmor: -Patch14: 0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch -Patch15: 0002-apparmor-af_unix-mediation.patch -Patch17: Performance-over-security-model.patch -# Enable AUXILIARY BUS, to make building other out-of-tree intel NIC drivers easier -Patch19: 0001-Enable-AUXILIARY_BUS-by-default.patch - -#VTAR/VTARFS -Patch20: 0001-fs-VTAR-archive-to-TPMFS-extractor.patch -Patch21: 0001-fs-A-new-VTARFS-file-system-to-mount-VTAR-archive.patch -#TARFS -Patch22: 0001-fs-TARFS-file-system-to-mount-TAR-archive.patch -#initrd newca -Patch23: 0001-initramfs-support-for-page-aligned-format-newca.patch -Patch24: 0001-NEWCA-make-initrd-pages-immutable.patch - -# Upstream fix to properly handle PNP0C01/PNP0C02 device. -Patch25: 0001-ACPI-PNP-Drop-PNP0C01-and-PNP0C02-from-acpi_pnp_devi.patch - -Patch29: 0001-randomize_kstack-Unify-random-source-across-arches.patch - -# Patches for ptp_vmw -Patch30: 0001-ptp-ptp_vmw-Implement-PTP-clock-adjustments-ops.patch -Patch31: 0002-ptp-ptp_vmw-Add-module-param-to-probe-device-using-h.patch - -Patch32: 0001-alloc_tag-avoid-current-alloc_tag-manipulations-when.patch - -# sched_info_enqueue: don't update last_queued on delayed migration -Patch33: 0001-sched_info_enqueue-don-t-update-last_queued-on-delay.patch - -# Improve small copy_to/from_user performance on CPUs without FSRM -Patch34: 0001-x86-bring-back-unrolled-loop-for-small-sizes-without.patch -Patch35: 0001-x86-only-clobber-registers-in-the-unrolled-case.patch - -%ifarch x86_64 -# VMW: [50..59] -Patch50: x86-vmware-Log-kmsg-dump-on-panic.patch -Patch51: x86-vmware-Support-steal-time-clock-for-encrypted-gu.patch -# Report guest crash to vmware hypervisor -Patch52: 0001-x86-report-guest-crash-to-vmware-hypervisor.patch - -# SEV on VMware -Patch53: 0079-x86-sev-es-Disable-BIOS-ACPI-RSDP-probing-if-SEV-ES-.patch -Patch54: 0080-x86-boot-Enable-vmw-serial-port-via-Super-I-O.patch -Patch55: 0001-x86-boot-unconditional-preserve-CR4.MCE.patch -# TODO: Review: Patch602: 0081-x86-sev-es-Disable-use-of-WP-via-PAT-for-__sme_early.patch -Patch56: 0001-x86-vmware-Redefine-the-macro-of-CPUID_VMWARE.patch - -# Secure Boot and Kernel Lockdown -Patch57: 0001-kernel-lockdown-when-UEFI-secure-boot-enabled.patch -Patch58: 0002-Add-.sbat-section.patch -# NOTE: linux-esx does not support kexec, omitting SBAT verify logic. -# CONFIG_SECURITY_SBAT_VERIFY=y -# Patch58: 0003-Verify-SBAT-on-kexec.patch -#external-entropy -Patch59: 0001-external_entropy-Enable-External-Entropy-support.patch -Patch60: 07-vmware-only.patch -%endif - -# linux-esx [60..89] -Patch61: init-do_mounts-recreate-dev-root.patch -Patch62: serial-8250-do-not-probe-U6-16550A-fifo-size.patch -Patch63: 01-clear-linux.patch -Patch64: 02-pci-probe.patch -Patch65: poweroff-without-firmware.patch -Patch66: 04-quiet-boot.patch -Patch67: 05-pv-ops-clocksource.patch -Patch68: 0001-Remove-OOM_SCORE_ADJ_MAX-limit-check.patch -Patch69: halt-on-panic.patch -Patch70: x86-probe_roms-Skip-OpROM-probing-if-running-as-VMwa.patch -Patch71: revert-x86-entry-Align-entry-text-section-to-PMD-boundary.patch - -%if 0%{?vmxnet3_sw_timestamp} -Patch72: 0009-esx-vmxnet3-software-timestamping.patch -%endif - -# vmxnet3 -Patch73: 0001-vmxnet3_support_higher_link_speeds_from_vmxnet3_v9.patch - -# initialize MMCONFIG -Patch75: 0001-initialize-MMCONFIG-if-already-not-initialized.patch -Patch76: 0001-MMIO_should_have_more_priority_then_IO.patch -Patch77: 0001-Avoid-extra-scanning-for-peer-host-bridges.patch - -# Hotplug support without firmware -Patch80: 0001-vmw_extcfg-hotplug-without-firmware-support.patch -Patch81: 0002-vmw_extcfg-hotplug-without-firmware-support.patch -Patch82: 0003-vmw_extcfg-hotplug-without-firmware-support.patch - -# Drain per-CPU page caches after boot-time memory frees, so -# /proc/meminfo reports settled numbers from the first read -Patch83: 0001-init-main.c-drain-per-CPU-page-caches-after-boot-tim.patch - -# SBX driver -Patch85: 0001-Adding-SBX-kernel-driver.patch - -%ifarch x86_64 -#SBX DTLS driver -Patch86: 0001-linux-esx-Add-SBX-DTLS-kernel-module.patch -%endif - -# Backward compatibility -%if "%{dist}" == ".ph5" -Patch91: 0001-block-Fix-validation-of-ioprio-level.patch +%if 0%{?photon_subrelease} <= 90 +Version: 6.1.190 +%else +%if 0%{?photon_subrelease} == 91 +Version: 6.12.111 +%else +Version: 6.12.113 %endif - -# CVE patches — see kernel_cve_patches.inc (range 3000–3999) -%include %{SOURCE10301} - -# aarch64 [200..219] -%ifarch aarch64 -Patch200: 0001-x86-hyper-generalize-hypervisor-type-detection.patch -Patch201: 0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch -Patch202: 0003-arm64-VMware-hypervisor-detection.patch -Patch203: 0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch -Patch204: 0005-scsi-vmw_pvscsi-add-arm64-support.patch -Patch205: 0006-vmxnet3-build-only-for-x86-and-arm64.patch -Patch206: 0005-vmw_balloon-add-arm64-support.patch -Patch207: 0001-vmw_vmci-arm64-support-memory-ordering.patch -# Report guest crash to vmware hypervisor -Patch208: 0001-arm64-report-guest-crash-to-vmware-hypervisor.patch %endif +Source0: http://www.kernel.org/pub/linux/kernel/v6.x/linux-%{version}.tar.xz -# 9p: [300..350] -Patch300: 0001-fs-9p-Add-opt_metaonly-cache-option.patch -# Patch301: 0002-p9fs_dir_readdir-offset-support.patch -Patch303: 0003-Enable-cache-loose-for-vdfs-9p.patch -Patch304: 0004-Ensure-seekdir-take-effect-when-entries-in-readdir-b.patch -Patch305: 0005-Initialize-fid-iounit-during-creation-of-p9_fid.patch -Patch307: 0006-fscache-Only-fetch-attr-from-inode-cache-when-cache-.patch -Patch308: 0007-9p-fscache-Make-dcache-work-with-case-insensitive-vo.patch -Patch309: 0008-9p-fscache-Ensure-consistent-blksize-is-returned-fro.patch - -# Only LKCM/JENT related patches below -# Jitterentropy support and FIPS compliance -Patch10000: 0001-New-memsize-options-for-jent.patch -%if 0%{?fips} -Patch10001: 0001-jitterentropy-Makefile-changes.patch -# Patch to remove urandom usage in rng module -Patch10002: 0001-FIPS-crypto-rng-Jitterentropy-RNG-as-the-only-RND-source.patch -# Disable md5 algorithm for sctp if fips is enabled. -Patch10003: 0001-disable-md5-and-sha1-algorithms-for-sctp-if-fips-is-enabled.patch -# Mark ECB as Internal algorithm if fips is enabled. -Patch10004: 0001-crypto-ecb-Set-ecb-alg-flag-as-Internal.patch -Patch10050: 0001-jitterentropy-Defer-jent_mod_init-in-non-fips-boot.patch - -# Below patches are common for canister_usage and canister_build flags -Patch10101: 0001-FIPS-canister-binary-usage.patch -Patch10102: 0002-algapi.c-honor-fcw_skip_tests.patch -Patch10103: 0003-tcrypt-align-to-LKCM.patch -Patch10104: 0004-scripts-kallsyms-Extra-kallsyms-parsing.patch -# Move rsa-pkcs1pad encrypt and decrypt functions outside canister -Patch10106: 0006-crypto-Disable-rsa-pkcs1pad-encrypt-decrypt-in-FIPS-.patch -# Add internal_iv field for aead_request -Patch10107: 0007-aead-add-internal_iv-field.patch -Patch10108: 0008-FIPS-Mark-structure-field-differences-between-kernel.patch -Patch10109: 0009-aead_geniv_ctx-drop-lock-field.patch -Patch10110: 0010-Move-crypto_inc-to-lib-crypto-utils.c.patch -Patch10111: 0001-crypto-Moving-rfc4543-out-of-canister-boundry.patch -# Make lib/digsig to use lib SHA1 instead of crypto shash API -# [10112..10116] -Patch10112: 0001-crypto-x86-sha1-Rename-conflicting-symbol.patch -Patch10113: 0002-lib-crypto-sha1-Rename-sha1_init-to-sha1_init_raw.patch -Patch10114: 0003-lib-crypto-sha1-Add-SHA-1-library-functions.patch -Patch10115: 0001-lib-digsig-Use-SHA-1-library-instead-of-crypto_shash.patch -Patch10116: 0001-crypto-sha1_generic-Renaming-sha1_final.patch -# Track internal/external jitterentropy rng requests -Patch10117: 0001-crypto-track-external-requests-to-jitterentropy_rng.patch -# make ima to use lib SHA1 instead of crypto shash API -Patch10118: 0001-linux-ima-Use-lib-sha1-instead-of-crypto-shash.patch +Source990: linux-esx-6.1.inc +Source991: linux-esx-6.12.inc +Source992: linux-esx-6.1-changelog.inc +Source993: linux-esx-6.12-changelog.inc +Source996: linux-esx-6.12.111-changelog.inc -# FIPS canister plugins -Patch10200: 0001-Compile-GCC-plugins-for-FIPS-canister.patch -Patch10201: 0002-Build-with-FIPS-Canister-GCC-plugins.patch -Patch10202: 0003-Introduce-FIPS-canister-plugins.patch -Patch10203: 0004-FIPS-Canister-Plugins-Add-self-tests.patch -Patch10204: 0001-Canister-GCC-Plugins-Implement-type-check.patch - -# Compile and inject jitterentropy rng proxy -Patch10300: 0001-compile-jitterentropy-rng-proxy.patch -Patch10301: 0001-change-jitterentropy_rng-driver-name.patch +%if 0%{?photon_subrelease} <= 90 +%include %{SOURCE990} +%else +%include %{SOURCE991} %endif BuildRequires: bc -BuildRequires: mpc-devel BuildRequires: kbd BuildRequires: kmod-devel BuildRequires: glib-devel @@ -294,31 +42,10 @@ BuildRequires: openssl-devel BuildRequires: procps-ng-devel BuildRequires: lz4 BuildRequires: elfutils-libelf-devel -BuildRequires: bison BuildRequires: elfutils-devel BuildRequires: dwarves-devel -BuildRequires: libtraceevent-devel -BuildRequires: clang-devel -BuildRequires: readline-devel -%if 0%{?fips} -BuildRequires: gcc >= 12.2.0-6 -%endif - -# Requirements for signing artifacts -%if "%{?signing_script}" != "" -%ifarch x86_64 -%define network_required 1 -BuildRequires: ca-certificates-pki -BuildRequires: python3-requests -%endif -%endif - Requires: kmod Requires: filesystem -Requires(pre): coreutils -Requires(preun): coreutils -Requires(post): coreutils -Requires(postun): coreutils %description The Linux kernel build for GOS for VMware hypervisor. @@ -333,7 +60,11 @@ This kernel is FIPS certified. %package devel Summary: Kernel Dev Group: System Environment/Kernel +%if 0%{?photon_subrelease} <= 90 +Requires: python3 gawk +%else Requires: python3 gawk dwarves-devel +%endif Requires: %{name} = %{version}-%{release} %description devel The Linux package contains the Linux kernel dev files @@ -349,34 +80,142 @@ The Linux package contains the Linux kernel doc files %prep # Using autosetup is not feasible %setup -q -n linux-%{version} +%if 0%{?photon_subrelease} <= 90 +%if 0%{?fips} +# Using autosetup is not feasible +%setup -q -T -D -b 16 -n linux-%{version} +%endif + +%ifarch x86_64 +# Using autosetup is not feasible +%setup -q -T -D -b 32 -n linux-%{version} +%endif +%endif # Apply CVE patches first %autopatch -p1 -m3000 -M3999 # common +%if 0%{?photon_subrelease} <= 90 +%autopatch -p1 -m0 -M48 + +# apparmor +%autopatch -p1 -m100 -M100 + +# seccomp +%autopatch -p1 -m101 -M101 +%else %autopatch -p1 -m0 -M49 +%endif %ifarch x86_64 +%if 0%{?photon_subrelease} <= 90 +%autopatch -p1 -m49 -M49 +%endif # VMW x86 +%if 0%{?photon_subrelease} <= 90 +%autopatch -p1 -m50 -M59 +%else %autopatch -p1 -m50 -M60 %endif +%endif # linux-esx +%if 0%{?photon_subrelease} <= 90 +%autopatch -p1 -m60 -M85 +%else %autopatch -p1 -m61 -M89 # Backward compatibility %if "%{dist}" == ".ph5" %autopatch -p1 -m91 -M91 %endif +%endif %ifarch aarch64 # aarch64 patches +%if 0%{?photon_subrelease} <= 90 +%autopatch -p1 -m250 -M260 +%else %autopatch -p1 -m200 -M219 %endif +%endif # 9P %autopatch -p1 -m300 -M309 +%if 0%{?photon_subrelease} <= 90 +# crypto +%autopatch -p1 -m500 -M504 + +%ifarch x86_64 +%autopatch -p1 -m505 -M508 +%endif + +%if 0%{?fips} +%autopatch -p1 -m509 -M513 +%endif + +%ifarch x86_64 +# SEV on VMware +%autopatch -p1 -m600 -M609 +%endif + +%autopatch -p1 -m1000 -M1001 + +%ifarch x86_64 +cp -a ../jitterentropy-%{jent_major_version}-%{jent_ph_version}/ \ + crypto/jitterentropy-%{jent_major_version}/ + +cp %{SOURCE33} crypto/jitterentropy-%{jent_major_version}/jitterentropy_canister_wrapper.c +cp %{SOURCE34} crypto/jitterentropy-%{jent_major_version}/jitterentropy_canister_wrapper.h +cp %{SOURCE35} crypto/jitterentropy-%{jent_major_version}/jitterentropy_canister_wrapper_asm.S + +cp %{SOURCE36} crypto/jitterentropy_rng_proxy.c +%endif + +%make_build mrproper +cp %{SOURCE1} .config + +cp %{SOURCE21} photon-cert-bundle.pem + +%if 0%{?fips} +cp %{SOURCE39} crypto/ +cp %{SOURCE37} crypto/fips_canister_wrapper.c +cp %{SOURCE38} crypto/fips_canister_wrapper.h +cp %{SOURCE40} crypto/fips_canister_wrapper_common.h +cp %{SOURCE41} crypto/fips_canister_wrapper_internal.h +cp %{SOURCE42} crypto/fips_canister_wrapper_internal.c + +cp ../fips-canister-%{fips_canister_version}/fips_canister.o \ + ../fips-canister-%{fips_canister_version}/.fips_canister.o.cmd \ + ../fips-canister-%{fips_canister_version}/fips_canister-kallsyms \ + crypto/ + +patch -p1 < %{PATCH514} + +mkdir -p %{struct_comp_dir}/%{vmlinux_definition_loc} +cp %{SOURCE9} %{struct_comp_dir} +cp %{SOURCE43} \ + %{SOURCE44} \ + %{SOURCE45} \ + %{SOURCE46} \ + %{SOURCE47} \ + %{struct_comp_dir}/%{vmlinux_definition_loc} +%endif + +sed -i 's/CONFIG_LOCALVERSION="-esx"/CONFIG_LOCALVERSION="-%{release}-esx"/' .config + +%ifarch x86_64 +sed -e "s,@@NAME@@,%{name},g" \ + -e "s,@@VERSION_RELEASE@@,%{version}-%{release},g" \ + -e "s,@@LINUX_PH_GEN@@,%{linux_photon_generation},g" \ + %{SOURCE25} > linux-sbat.csv +%endif + +%include %{SOURCE4} + +%else # prep for viomem out-of-tree module mkdir -p ../viomem pushd ../viomem @@ -443,20 +282,15 @@ tar -xvf /usr/lib/fips-canister/fips-canister-%{fips_canister_version}.tar.bz2 # corresponding .cmd file. Empty content is ok, since we are not going # to rebuild it. touch crypto/.fips_canister.o.cmd - -sed -i "s/# CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS is not set/CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS=y/" .config %else -# Clean up .config of FIPS related configs -sed -i "/# CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS is not set/d" .config -sed -i "/# CONFIG_GCC_PLUGIN_PAD_CANISTER_STRUCTS is not set/d" .config - sed -i "s/# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_2 is not set/CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_2=y/" .config sed -i "s/CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_32=y/# CONFIG_CRYPTO_JITTERENTROPY_MEMSIZE_32 is not set/" .config sed -i "s/CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKS=128/CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKS=64/" .config sed -i "s/CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE=256/CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE=32/" .config %endif - +%dnl canister/.config handling, shared with linux.spec +%include %{SOURCE5} %ifarch x86_64 sed -e "s,@@NAME@@,%{name},g" \ -e "s,@@VERSION_RELEASE@@,%{version}-%{release},g" \ @@ -466,25 +300,59 @@ sed -e "s,@@NAME@@,%{name},g" \ %include %{SOURCE4} +%endif %build %make_build KBUILD_BUILD_VERSION="1-photon" \ KBUILD_BUILD_HOST="photon" ARCH=%{arch} +%if 0%{?photon_subrelease} >= 91 # build viomem module +%endif bldroot="${PWD}" +%if 0%{?photon_subrelease} <= 90 + +# build viomem module +mkdir ../viomem +%endif pushd ../viomem +%if 0%{?photon_subrelease} <= 90 +cp %{SOURCE100} Makefile +cp %{SOURCE101} viomem.c +cd ../viomem +%make_build -C ${bldroot} M="${PWD}" V=1 modules +%else %make_build -C ${bldroot} M="${PWD}" modules +%endif popd +%if 0%{?photon_subrelease} <= 90 +%if 0%{?fips} +# compare struct definitions between fips canister and vmlinux +# fails out if there is a mismatch, and the offending definition +# has not been documented in %{vmlinux_definition_loc} +pushd %{struct_comp_dir} +gcc -Wall -Werror -o %{struct_comparator} %{SOURCE9} -ldwarves +./%{struct_comparator} \ + ${bldroot}/crypto/fips_canister.o ${bldroot}/vmlinux %{vmlinux_definition_loc} +popd + +rm -rf %{struct_comp_dir} +%endif + +%endif %install install -vdm 755 %{buildroot}%{_sysconfdir} install -vdm 755 %{buildroot}/boot install -vdm 755 %{buildroot}%{_docdir}/linux-%{uname_r} install -vdm 755 %{buildroot}%{_usrsrc}/linux-headers-%{uname_r} +%if 0%{?photon_subrelease} <= 90 +%make_build ARCH=%{arch} INSTALL_MOD_PATH=%{buildroot} modules_install +%else %make_build ARCH=%{arch} \ INSTALL_MOD_PATH=%{buildroot} \ modules_install +%endif %ifarch x86_64 install -vm 644 arch/%{archdir}/boot/bzImage %{buildroot}/boot/vmlinuz-%{uname_r} @@ -504,14 +372,39 @@ install -vm 400 System.map %{buildroot}/boot/System.map-%{uname_r} install -vm 644 .config %{buildroot}/boot/config-%{uname_r} cp -r Documentation/* %{buildroot}%{_docdir}/linux-%{uname_r} +%if 0%{?photon_subrelease} >= 91 # install viomem module +%endif bldroot="${PWD}" +%if 0%{?photon_subrelease} <= 90 +# install viomem module +%endif pushd ../viomem +%if 0%{?photon_subrelease} <= 90 +%make_build -C ${bldroot} M="${PWD}" INSTALL_MOD_PATH=%{buildroot} modules_install +%else %make_build -C ${bldroot} M="${PWD}" INSTALL_MOD_PATH=%{buildroot} \ INSTALL_MOD_DIR=extra \ modules_install +%endif popd +%if 0%{?photon_subrelease} <= 90 +%if 0%{?__debug_package} +install -vdm 755 %{buildroot}%{_libdir}/debug/%{_modulesdir} +install -vm 644 vmlinux %{buildroot}%{_libdir}/debug/%{_modulesdir}/vmlinux-%{uname_r} +%endif + +# TODO: noacpi acpi=off noapic pci=conf1,nodomains pcie_acpm=off pnpacpi=off +cat > %{buildroot}/boot/linux-%{uname_r}.cfg << "EOF" +# GRUB Environment Block +photon_cmdline=init=/lib/systemd/systemd rcupdate.rcu_expedited=1 rw systemd.show_status=0 quiet noreplace-smp cpu_init_udelay=0 +photon_linux=vmlinuz-%{uname_r} +photon_initrd=initrd.img-%{uname_r} +EOF + +# cleanup dangling symlinks +%else %if 0%{?_enable_debug_packages} install -vdm 755 %{buildroot}%{_libdir}/debug/%{_modulesdir} install -vm 644 vmlinux %{buildroot}%{_libdir}/debug/%{_modulesdir}/vmlinux-%{uname_r} @@ -526,10 +419,17 @@ photon_initrd=initrd.img-%{uname_r} EOF # Cleanup dangling symlinks +%endif rm -f %{buildroot}%{_modulesdir}/source \ %{buildroot}%{_modulesdir}/build # create /use/src/linux-headers-*/ content +%if 0%{?photon_subrelease} <= 90 +find . -name Makefile* -o -name Kconfig* -o -name *.pl | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy +find arch/%{archdir}/include include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy +find $(find arch/%{archdir} -name include -o -name scripts -type d) -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy +find arch/%{archdir}/include Module.symvers include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy +%else find . -name Makefile* -o -name Kconfig* -o -name *.pl | \ xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy @@ -542,16 +442,27 @@ find $(find arch/%{archdir} -name include -o -name scripts -type d) -type f | \ find arch/%{archdir}/include Module.symvers include scripts -type f | \ xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy +%endif %ifarch x86_64 # CONFIG_STACK_VALIDATION=y requires objtool to build external modules +%if 0%{?photon_subrelease} <= 90 +install -vsm 755 tools/objtool/objtool %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}/tools/objtool/ +install -vsm 755 tools/objtool/fixdep %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}/tools/objtool/ +%else install -vsm 755 tools/objtool/{objtool,fixdep} \ %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}/tools/objtool/ %endif +%endif # copy .config manually to be where it's expected to be cp .config %{buildroot}%{_usrsrc}/linux-headers-%{uname_r} +%if 0%{?photon_subrelease} <= 90 +# symling to the build folder +ln -sf "%{_usrsrc}/linux-headers-%{uname_r}" "%{buildroot}%{_modulesdir}/build" +%else # Symlink to the build folder ln -sfv "%{_usrsrc}/linux-headers-%{uname_r}" "%{buildroot}%{_modulesdir}/build" +%endif find %{buildroot}/lib/modules -name '*.ko' -print0 | xargs -0 chmod u+x mkdir -p %{buildroot}%{_modulesdir}/dracut.conf.d/ @@ -571,7 +482,11 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg /boot/config-%{uname_r} /boot/vmlinuz-%{uname_r} %config(noreplace) /boot/linux-%{uname_r}.cfg +%if 0%{?photon_subrelease} <= 90 +/lib/modules/* +%else %{_modulesdir}/* +%endif %exclude %{_modulesdir}/build %config(noreplace) %{_modulesdir}/dracut.conf.d/%{name}.conf @@ -585,1086 +500,12 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg %{_modulesdir}/build %{_usrsrc}/linux-headers-%{uname_r} -%changelog -* Mon Oct 19 2026 Gerrit Photon 6.12.113-1 -- Update to version 6.12.113 -* Mon Oct 19 2026 Brennan Lamoreaux 6.12.112-7 -- Fixes CVE-2026-63858 -* Tue Oct 13 2026 Brennan Lamoreaux 6.12.112-6 -- Bring back the unrolled loop for small user copies on CPUs without FSRM -* Tue Oct 13 2026 Guruswamy Basavaiah 6.12.112-5 -- Fixes CVE-2026-80634 -* Tue Oct 13 2026 Shivani Agarwal 6.12.112-4 -- Fixes CVE-2026-74723, CVE-2026-89537 -* Tue Oct 13 2026 Shivani Agarwal 6.12.112-3 -- Fixes CVE-2026-90104 -* Mon Oct 12 2026 Keerthana K 6.12.112-2 -- Fixes CVE-2026-74752 -* Tue Oct 06 2026 Vamsi Krishna Brahmajosyula 6.12.112-1 -- Update to version 6.12.112 -* Wed Sep 30 2026 Srinidhi Rao 6.12.111-3 -- Fix jent mem free. -* Mon Sep 28 2026 Shreenidhi Shedi 6.12.111-2 -- Fix aarch64 build: set RELR configs for sr92+ (binutils >= 2.46.1) -* Wed Sep 23 2026 Ajay Kaher 6.12.111-1 -- Update to version 6.12.111 -* Wed Sep 23 2026 Keerthana K 6.12.109-10 -- Fixes CVE-2026-46325, CVE-2026-68242, CVE-2026-68258 -* Mon Sep 21 2026 Keerthana K 6.12.109-9 -- Revert D-TLS ZERO COPY driver -* Mon Sep 21 2026 Brennan Lamoreaux 6.12.109-8 -- Fixes CVE-2026-68426 -* Mon Sep 21 2026 Shivani Agarwal 6.12.109-7 -- Fixes CVE-2026-64388, CVE-2026-72031, CVE-2026-72341, CVE-2026-72439 -* Fri Sep 18 2026 Guruswamy Basavaiah 6.12.109-6 -- Fixes CVE-2026-68337, CVE-2026-68441 -* Thu Sep 17 2026 srinidhira0 6.12.109-5 -- Fixes CVE-2026-43464, CVE-2026-45932, CVE-2026-46324, CVE-2026-52956 -* Wed Sep 16 2026 Shreenidhi Shedi 6.12.109-4 -- Use rpm macros while building -- Fix rpm build warnings -* Wed Sep 16 2026 Keerthana K 6.12.109-3 -- Fixes CVE-2026-80785 -* Tue Sep 15 2026 Guruswamy Basavaiah 6.12.109-2 -- Fixes CVE-2026-74605, CVE-2026-74611 -* Fri Sep 11 2026 Ajay Kaher 6.12.109-1 -- Update to version 6.12.109 -* Fri Sep 11 2026 Ajay Kaher 6.12.107-11 -- Fixes CVE-2026-68399, CVE-2026-68404, CVE-2026-68409, CVE-2026-68441, CVE-2026-68447, CVE-2026-74571 -* Thu Sep 10 2026 Vamsi Krishna Brahmajosyula 6.12.107-10 -- version bump to build along with sysdig and falco -* Thu Sep 10 2026 Shivani Agarwal 6.12.107-9 -- Fixes CVE-2026-74571, CVE-2026-80580 -* Tue Sep 08 2026 Brennan Lamoreaux 6.12.107-8 -- Fixes CVE-2026-63853, CVE-2026-63879, CVE-2026-64036, CVE-2026-64058, CVE-2026-64078 -* Tue Sep 08 2026 srinidhira0 6.12.107-7 -- Fixes CVE-2026-64160 -* Tue Sep 08 2026 Ankit Jain 6.12.107-6 -- Fixes CVE-2026-72366, CVE-2026-72463, CVE-2026-72493, CVE-2026-74268, CVE-2026-74269 -* Tue Sep 08 2026 Shivani Agarwal 6.12.107-5 -- Fixes CVE-2026-72413, CVE-2026-72423 -* Mon Sep 07 2026 Brennan Lamoreaux 6.12.107-4 -- Fixes CVE-2026-72288, CVE-2026-72355 -* Wed Sep 02 2026 Brennan Lamoreaux 6.12.107-3 -- sched_info_enqueue: don't update last_queued on delayed migration -* Tue Sep 01 2026 Bo Gan 6.12.107-2 -- Backport upstream fix to solve ACPI PNP0C01/PNP0C02 device registration with platform driver -* Mon Aug 31 2026 Ajay Kaher 6.12.107-1 -- Update to version 6.12.107 -* Mon Aug 31 2026 Keerthana K 6.12.103-11 -- Fix CVE-2026-68082 -* Wed Aug 26 2026 Alexey Makhalov 6.12.103-10 -- Fix CRX memory overhead regression -* Tue Aug 25 2026 Ajay Kaher 6.12.103-9 -- Fixes CVEs -* Tue Aug 25 2026 Guruswamy Basavaiah 6.12.103-8 -- Fixes CVE-2026-63979, CVE-2026-64024, CVE-2026-64066, CVE-2026-64067, CVE-2026-64068 -* Fri Aug 21 2026 Garrett Goble 6.12.103-7 -- Update SBX driver -* Fri Aug 21 2026 Srinidhi Rao 6.12.103-6 -- Make ima module to use lib sha1 instead of crypto shash -* Wed Aug 19 2026 Vamsi Krishna Brahmajosyula 6.12.103-5 -- Remove selinux=0 from default cmdline; SELinux is now disabled via selinux-policy -* Mon Aug 17 2026 Keerthana K 6.12.103-4 -- Update canister v6.12.60-18.2 with rap_plugin function alignment gap fix -* Sat Aug 15 2026 Vamsi Krishna Brahmajosyula 6.12.103-3 -- Extend to build for 91 and above -* Thu Aug 13 2026 srinidhira0 6.12.103-2 -- Fixes CVE-2026-52988, CVE-2026-52991, CVE-2026-53089, CVE-2026-53091 -* Mon Aug 10 2026 Gerrit Photon 6.12.103-1 -- Update to version 6.12.103 -* Thu Aug 06 2026 Vamsi Krishna Brahmajosyula 6.12.96-8 -- Make SELinux opt-in by default (add selinux=0 to default cmdline) -* Wed Aug 05 2026 Gerrit Photon 6.12.96-7 -- Fixes CVE-2025-40158, CVE-2025-68745, CVE-2026-63872, CVE-2026-64076, CVE-2026-64077 -* Mon Aug 03 2026 Shivani Agarwal 6.12.96-6 -- Fixes CVE-2025-40074, CVE-2025-68353, CVE-2026-23208, CVE-2026-43009, CVE-2026-43485 -* Thu Jul 30 2026 Keerthana K 6.12.96-5 -- Update canister v6.12.60-18.1 with CVE-2026-64313 fix -* Thu Jul 30 2026 Keerthana K 6.12.96-4 -- Fixes CVE-2026-43197, CVE-2026-43198 -* Tue Jul 28 2026 Ankit Jain 6.12.96-3 -- Backport upstream randomize_kstack: Unify random source across arches -- (a96ef5848cb0). -* Mon Jul 27 2026 Ajay Kaher 6.12.96-2 -- Fixes CVE-2026-31589, CVE-2026-43414, CVE-2026-43465, CVE-2026-53224, CVE-2026-53246, CVE-2026-53260 -* Mon Jul 20 2026 Gerrit Photon 6.12.96-1 -- Update to version 6.12.96 -* Tue Jul 07 2026 Bo Gan 6.12.95-2 -- Fix for vmxnet3 BUG_ON in vmxnet3_get_hdr_len() -* Mon Jul 06 2026 Gerrit Photon 6.12.95-1 -- Update to version 6.12.95 -* Tue Jun 30 2026 Mounesh Badiger 6.12.94-2 --viomem: Add IOCTL to re-size the viomem memory -* Mon Jun 22 2026 Gerrit Photon 6.12.94-1 -- Update to version 6.12.94 -* Sat Jun 20 2026 Shreenidhi Shedi 6.12.92-4 -- Add mpc-devel to build requires -* Thu Jun 11 2026 Alexey Makhalov 6.12.92-3 -- NEWCA initrd: fix hardlink sealing -* Thu Jun 04 2026 Ankit Jain 6.12.92-2 -- Consolidate CVE patches into kernel_cve_patches.inc (range 3000-3999) -* Tue Jun 02 2026 Shivani Agarwal 6.12.92-1 -- Update to version 6.12.92 -- Fix CVE-2025-68359 and CVE-2026-43101 -- sshedi: fix vmlinux exclusion issue from debuginfo rpm -* Wed May 27 2026 Brennan Lamoreaux 6.12.87-5 -- Fix CVE-2026-43083 -* Fri May 22 2026 Guruswamy Basavaiah 6.12.87-4 -- Removed xerces-c-devel from BuildRequires -* Thu May 14 2026 Rishi Chhibber 6.12.87-3 -- Add D-TLS Zero Copy Driver -* Wed May 13 2026 Srinidhi Rao 6.12.87-2 -- Remove libdnet BuildReuires dependency -* Mon May 11 2026 Brennan Lamoreaux 6.12.87-1 -- Update to version 6.12.87 -* Wed May 06 2026 Satish Ramachandran 6.12.78-5 -- Update SBX DTLS patch to provide workload VM UUID -* Tue May 05 2026 Ankit Jain 6.12.78-4 -- Moved SPECS/linux/v6.12(common branch) to SPECS/linux(5.0 branch) -- Used merge commit to keep the history in 5.0 itself -* Mon Apr 13 2026 Ankit Jain 6.12.78-3 -- Enable AMD AI compute module. -* Fri Apr 10 2026 Ajay Kaher 6.12.78-2 -- Fixes for vmwptp driver -* Thu Mar 26 2026 Keerthana K 6.12.78-1 -- Update to version 6.12.78 -* Mon Mar 16 2026 Alexey Makhalov 6.12.69-7 -- SELinux as a default LSM -* Mon Mar 09 2026 Keerthana K 6.12.69-6 -- Fix af_unix boolean registration from the wrong array to the correct one -* Mon Mar 09 2026 Albert Guo 6.12.69-5 -- Ported 8 9P patches for VDFS from 6.1.y to 6.12.y. -* Mon Mar 02 2026 Shivani Agarwal 6.12.69-4 -- Fix aarch64 build -* Thu Feb 26 2026 Bo Gan 6.12.69-3 -- Enable MEMCG_V1 and CPUSETS_V1 for other flavors as generic/x86 does -* Fri Feb 20 2026 Alexey Makhalov 6.12.69-2 -- Support steal clock on TDX enabled VMs -* Wed Feb 11 2026 Shivani Agarwal 6.12.69-1 -- Update to version 6.12.69 -* Wed Feb 11 2026 Brennan Lamoreaux 6.12.60-16 -- Port ARM patches to v6.12 and include new patch to -- report guest crashes to the VMware hypervisor -* Fri Feb 06 2026 Keerthana K 6.12.60-15 -- Update canister version to 6.12.60-18 -* Fri Feb 06 2026 Ankit Jain 6.12.60-14 -- Disabling FIPS build until canister finalised. -* Tue Feb 03 2026 Ankit Jain 6.12.60-13 -- Add viomem kernel module -* Tue Feb 03 2026 Brennan Lamoreaux 6.12.60-12 -- Track internal/external requests to jitterentropy -* Mon Feb 02 2026 Srinidhi Rao 6.12.60-11 -- Enable CONFIG_TDX_GUEST_DRIVER required for CoCo. -* Tue Jan 27 2026 Vamsi Krishna Brahmajosyula 6.12.60-10 -- enable infiniband, mlx5 support -- match config-esx_x86_64 from 6.1 spec -* Thu Jan 22 2026 Keerthana K 6.12.60-9 -- Update canister version to 6.12.60-13 -- Add patch to address UAF (req->iv) in seqiv.c -* Wed Jan 14 2026 Satish Ramachandran 6.12.60-8 -- Add SBX DTLS kernel driver patch -* Tue Jan 06 2026 Guruswamy Basavaiah 6.12.60-7 -- Enable CONFIG_MTD -* Fri Dec 19 2025 Guruswamy Basavaiah 6.12.60-6 -- Disable unique naming for *.ko.debug to make crash utility happy -* Fri Dec 12 2025 Kuntal Nayak 6.12.60-5 -- Inject photon KM certificate to trusted keyring -* Mon Dec 08 2025 Ankit Jain 6.12.60-4 -- Consuming canister. -* Fri Dec 05 2025 Guruswamy Basavaiah 6.12.60-3 -- newca: avoid modifications of initrd pages. -* Thu Dec 04 2025 Guruswamy Basavaiah 6.12.60-2 -- Enable CONFIG_ARM64_ERRATUM_3194386 -* Thu Dec 04 2025 Srinidhi Rao 6.12.60-1 -- Update to version 6.12.60 -* Fri Nov 14 2025 Brennan Lamoreaux 6.12.57-2 -- Add jitterentropy_rng_proxy -* Fri Nov 07 2025 Srinidhi Rao 6.12.57-1 -- Update to version 6.12.57 -* Thu Nov 06 2025 Srinidhi Rao 6.12.41-9 -- Introduce new printk wrapper for FIPS canister. -* Fri Oct 10 2025 Alexey Makhalov 6.12.41-8 -- Consume a canister binary via RPM dependency -* Fri Oct 03 2025 Guruswamy Basavaiah 6.12.41-7 -- Enable CONFIG_X86_SGX -* Mon Sep 29 2025 Srinidhi Rao 6.12.41-6 -- Cleanup jcw_kvzalloc_align -- Optimize jent init time during boot. -* Mon Sep 22 2025 Shivani Agarwal 6.12.41-5 -- crypto: zero initialize memory allocated via sock_kmalloc -* Thu Sep 11 2025 Ajay Kaher 6.12.41-4 -- Fixes for vmwnet3 driver -* Thu Sep 11 2025 Srinidhi Rao 6.12.41-3 -- Select jitterentropy mem size as 32KB -- Disable jent_loop_shuffle in Jitterentropy. -* Thu Aug 21 2025 Alexey Makhalov 6.12.41-2 -- Build jitterentropy only fips=1 build. -- Prepare to apply newer canister binary. -* Thu Aug 14 2025 Srinidhi Rao 6.12.41-1 -- Update to version 6.12.41 -* Fri Jul 18 2025 Srinidhi Rao 6.12.34-3 -- Add sample collection support for Jitterentropy. -* Mon Jun 30 2025 Brennan Lamoreaux 6.12.34-2 -- Mark certain structure fields as known differences between kernel and -- canister. -* Fri Jun 27 2025 Srinidhi Rao 6.12.34-1 -- Upgrade linux to version 6.12.34 -* Fri Jun 13 2025 Brennan Lamoreaux 6.12.1-5 -- Introduce FIPS canister plugins -* Tue Jun 03 2025 Srinidhi Rao 6.12.1-4 -- Changes to Jitterentropy. -* Sun May 11 2025 Ankit Jain 6.12.1-3 -- Disable alloc_hook_tags if MEM_PROFILING is disabled -* Sat May 10 2025 Shreenidhi Shedi 6.12.1-2 -- Require coreutils and remove xml-security-c-devel from build requires -* Mon Dec 16 2024 Ajay Kaher 6.12.1-1 -- Upgrade to version 6.12.x. -* Wed Oct 16 2024 Ajay Kaher 6.6.28-2 -- Fix ptp_vmw for ptp_vmw_adjfine -* Thu Sep 05 2024 Srinidhi Rao 6.6.28-1 -- Upgrade to version 6.6.x. -* Mon Apr 29 2024 Kuntal Nayak 6.1.83-2 -- Patched CVE-2024-26643 -* Mon Apr 29 2024 Keerthana K 6.1.83-1 -- Update to version 6.1.83 -- Fix CVE-2024-26642 -* Mon Apr 29 2024 Kuntal Nayak 6.1.81-6 -- Update SBAT verification -* Mon Apr 29 2024 Srinidhi Rao 6.1.81-5 -- Defer the initialization of jitterentropy. -* Mon Apr 29 2024 Brennan Lamoreaux 6.1.81-4 -- Fix CVE-2024-52452 -* Mon Apr 29 2024 Ajay Kaher 6.1.81-3 -- Fix CVE-2023-52585 -* Mon Apr 29 2024 Srish Srinivasan 6.1.81-2 -- Patched CVE-2024-26585 -* Mon Apr 29 2024 Srish Srinivasan 6.1.81-1 -- Update to version 6.1.81, patched CVE-2024-26584 -* Mon Apr 29 2024 Guruswamy Basavaiah 6.1.79-2 -- Fixes CVE-2024-23307 and CVE-2024-22099 -* Mon Apr 29 2024 Vamsi Krishna Brahmajosyula 6.1.79-1 -- Update to version 6.1.79 -* Mon Apr 29 2024 Shivani Agarwal 6.1.77-1 -- Update to version 6.1.77 -* Mon Apr 29 2024 Ajay Kaher 6.1.75-1 -- Update to version 6.1.75 -* Mon Apr 29 2024 Guruswamy Basavaiah 6.1.70-6 -- Fix CVE-2023-6915 -* Mon Apr 29 2024 Bryan Tan 6.1.70-5 -- Fix refcount underflow in vsock -* Mon Apr 29 2024 Ajay Kaher 6.1.70-4 -- Fix CVE-2024-0340 -* Mon Apr 29 2024 Kuntal Nayak 6.1.70-3 -- Fix CVE-2023-39191 -* Mon Apr 29 2024 Kuntal Nayak 6.1.70-2 -- Fix CVE-2023-5633 -* Mon Apr 29 2024 Ashwin Dayanand Kamat 6.1.70-1 -- Update to version 6.1.70 -* Mon Apr 29 2024 Keerthana K 6.1.62-12 -- Increase CONFIG_LOG_BUF_SHIFT to 18 -- Decrease CONFIG_LOG_CPU_MAX_BUF_SHIFT to 12 -* Tue Mar 26 2024 Ashwin Dayanand Kamat 6.1.62-11 -- Fix proc_sched_rt01 ltp testcase failure -* Mon Feb 12 2024 Srish Srinivasan 6.1.62-10 -- Update canister version to 5.0.0-6.1.75-2 -* Wed Dec 20 2023 Keerthana K 6.1.62-9 -- Update canister to 5.0.0-6.1.62-13 -* Wed Dec 20 2023 Keerthana K 6.1.62-8 -- FIPS: Add log messages for approved and non-approved services -- Remove fips=2 logic -* Wed Dec 20 2023 Keerthana K 6.1.62-7 -- Added self-tests for rsa-pkcs1pad in combination with sha1, sha224, sha384 and sha512 -* Wed Dec 20 2023 Keerthana K 6.1.62-6 -- Update canister to 5.0.0-6.1.62-7 -* Wed Dec 20 2023 Keerthana K 6.1.62-5 -- Update canister to 5.0.0-6.1.62-2 -* Wed Dec 20 2023 Vamsi Krishna Brahmajosyula 6.1.62-4 -- Fix RSA self tests -* Wed Nov 29 2023 Brennan Lamoreaux 6.1.62-3 -- Fix for CVE-2023-2176 -* Wed Nov 29 2023 Ajay Kaher 6.1.62-2 -- Enabling VFIO, UIO and IOMMU support -* Wed Nov 29 2023 Ankit Jain 6.1.62-1 -- Update to version 6.1.62 -* Wed Nov 29 2023 Albert Guo 6.1.60-5 -- Use iov_iter_revert() to fix offset of iov. -* Wed Nov 29 2023 Ankit Jain 6.1.60-4 -- Fix for CVE-2023-0597 -* Wed Nov 29 2023 Srish Srinivasan 6.1.60-3 -- Remove kat_build and its associated spec changes -* Wed Nov 29 2023 Srinidhi Rao 6.1.60-2 -- Jitterentropy sample collection support in ACVP Build. -* Wed Nov 29 2023 Vamsi Krishna Brahmajosyula 6.1.60-1 -- Upgrade to 6.1.60 -* Wed Nov 29 2023 Alexey Makhalov 6.1.56-9 -- Add .sbat section for bzImage -- newca: fixes and enhancements -* Wed Nov 29 2023 Srish Srinivasan 6.1.56-8 -- Upgrade canister to 5.0.0-6.1.56-6 -* Wed Nov 29 2023 Srish Srinivasan 6.1.56-7 -- Added cts to crypto self-tests -- Removed rsa(pkcs1pad, sha256), rsa(pkcs1pad, sha512), - cbc, and ctr from crypto self-tests -- Added ECC pubkey generation and verification success messages -* Wed Nov 29 2023 Albert Guo 6.1.56-6 -- Ported 11 9P patches (combined 2 of them) for VDFS from 4.19.y(photon3) to 6.1.y(photon5). -* Wed Nov 29 2023 Keerthana K 6.1.56-5 -- Modified ecdh-nist-p384 vector to generate ECC keypair -* Wed Nov 29 2023 Vamsi Krishna Brahmajosyula 6.1.56-4 -- Upgrade canister to 5.0.0-6.1.56-3 -* Wed Nov 29 2023 Srish Srinivasan 6.1.56-3 -- Add missing self-test vector for ecdh-nist-p384 with genkey -* Wed Nov 29 2023 Srinidhi Rao 6.1.56-2 -- Jitterentropy wrapper changes. -* Wed Nov 29 2023 Vamsi Krishna Brahmajosyula 6.1.56-1 -- Upgrade to 6.1.56 -* Wed Nov 29 2023 Vamsi Krishna Brahmajosyula 6.1.53-7 -- Fix for CVE-2023-42754 -* Wed Nov 29 2023 Keerthana K 6.1.53-6 -- Revert crypto_test (tcrypt) config to 'm' -* Wed Nov 29 2023 Keerthana K 6.1.53-5 -- Enable fips and update canister binary version 5.0.0-6.1.53-4 -- Removed jent_lock struct from ignore list of check_fips_canister -* Wed Nov 29 2023 Keerthana K 6.1.53-4 -- Add pkcs1pad test vectors in crytpo_self_test module -* Thu Nov 23 2023 Keerthana K 6.1.53-3 -- Fix CVE-2023-42756 -* Thu Nov 23 2023 Keerthana K 6.1.53-2 -- Fix for CVE-2023-42755 -* Thu Nov 23 2023 Roye Eshed 6.1.53-1 -- Update to version 6.1.53 -* Thu Nov 23 2023 Ajay Kaher 6.1.45-7 -- Fix: net: roundup issue in kmalloc_reserve() -* Thu Nov 23 2023 Brennan Lamoreaux 6.1.45-6 -- Move all prep to %prep section -* Thu Nov 23 2023 Srish Srinivasan 6.1.45-5 -- LKCM 5.0 specific changes to crypto self-tests and tcrypt -* Thu Nov 23 2023 Keerthana K 6.1.45-4 -- Build with jitterentropy v3.4.1 -* Thu Nov 23 2023 Keerthana K 6.1.45-3 -- Update fips_canister version 6.1.45-3 -* Wed Nov 22 2023 Ankit Jain 6.1.45-2 -- Fix for CVE-2023-28464 -* Wed Nov 22 2023 Ajay Kaher 6.1.45-1 -- Update to version 6.1.45 -* Wed Nov 22 2023 Ajay Kaher 6.1.41-2 -- Fix: unconditional preserve CR4.MCE -* Wed Nov 22 2023 Ashwin Dayanand Kamat 6.1.41-1 -- Update to version 6.1.41 -* Wed Nov 22 2023 Ashwin Dayanand Kamat 6.1.37-1 -- Update to version 6.1.37 -* Wed Nov 22 2023 Brennan Lamoreaux 6.1.32-1 -- Update to version 6.1.32 -* Wed Nov 22 2023 Guruswamy Basavaiah 6.1.28-5 -- disable kconfig CONFIG_RAID6_PQ_BENCHMARK -* Sun Nov 19 2023 Shreenidhi Shedi 6.1.28-4 -- Bump version as a part of openssl upgrade -* Tue Oct 03 2023 Kuntal Nayak 6.1.28-3 -- Kconfig to lockdown kernel in UEFI Secure Boot -* Sat Sep 23 2023 Guruswamy Basavaiah 6.1.28-2 -- Cherry pick performance over security option for RETBleed (pos=1) -- patch from Photon 4.0 -* Wed Sep 20 2023 Ankit Jain 6.1.28-1 -- Update to version 6.1.28 -* Tue Sep 19 2023 Ankit Jain 6.1.10-13 -- tarfs: fixes buffer overflow -* Mon Jul 17 2023 Keerthana K 6.1.10-12 -- Use canister version 5.0.0-6.1.37-2 -* Tue Jul 11 2023 Shreenidhi Shedi 6.1.10-11 -- Bump version as a part of elfutils upgrade -* Wed Jun 21 2023 Garrett Goble 6.1.10-10 -- Adding SBX kernel driver -* Tue Apr 25 2023 Shreenidhi Shedi 6.1.10-9 -- Remove dracut & initramfs from requires -* Fri Mar 31 2023 Srivatsa S. Bhat (VMware) 6.1.10-8 -- Expose Photon kernel macros to simplify building out-of-tree drivers. -* Thu Mar 30 2023 Brennan Lamoreaux 6.1.10-7 -- Update drivers -- iavf: 4.8.2 -- ice: 1.11.14 -- i40e: 2.22.18 -* Sun Mar 26 2023 Vamsi Krishna Brahmajosyula 6.1.10-6 -- Use canister version 5.0.0-6.1.10-8 -* Tue Mar 21 2023 Shreenidhi Shedi 6.1.10-5 -- Fix initramfs trigger -* Thu Mar 16 2023 Keerthana K 6.1.10-4 -- Enable FIPS canister binary usage -* Thu Mar 02 2023 Shreenidhi Shedi 6.1.10-3 -- Fix initrd generation logic -- Add dracut, initramfs to requires -* Fri Feb 24 2023 Ankit Jain 6.1.10-2 -- Exclude iavf.conf -* Wed Feb 22 2023 Bo Gan 6.1.10-1 -- Update to 6.1.10 -* Thu Feb 16 2023 Srivatsa S. Bhat (VMware) 6.0.7-8 -- Update i40e driver to v2.19.3 to prevent kernel warnings -* Thu Feb 02 2023 Shreenidhi Shedi 6.0.7-7 -- Fix requires -* Mon Jan 30 2023 Keerthana K 6.0.7-6 -- Enable CONFIG_E1000E & CONFIG_E1000 for arm64 -* Fri Jan 27 2023 Shivani Agarwal 6.0.7-5 -- Enable CONFIG_DRM_I915 -* Wed Jan 18 2023 Ajay Kaher 6.0.7-4 -- Fix aarch64 rpm build issue -* Fri Jan 13 2023 Srivatsa S. Bhat (VMware) 6.0.7-3 -- Fix IRQ affinities of i40e, iavf and ice drivers -* Mon Jan 09 2023 Srivatsa S. Bhat (VMware) 6.0.7-2 -- Update Intel drivers i40e to v2.16.11, iavf to v4.5.3 and ice to v1.9.11 -* Mon Jan 09 2023 Bo Gan 6.0.7-1 -- Update to 6.0.7 -- common: Change from SLAB to SLUB -- common: Enable BPF/JIT -- aarch64: match configs with x86 for arch independent features. -- aarch64: disable unused platform/drivers for VM. -* Fri Jan 06 2023 Vamsi Krishna Brahmajosyula 5.10.142-4 -- Bump up due to change in elfutils -* Mon Nov 21 2022 Ashwin Dayanand Kamat 5.10.142-3 -- Avoid extra scanning for peer host bridges when mmconfig is initialized. -* Thu Oct 20 2022 Vamsi Krishna Brahmajosyula 5.10.142-2 -- Fix build with latest toolchain -* Wed Sep 28 2022 Srivatsa S. Bhat (VMware) 5.10.142-1 -- Update to version 5.10.142 -* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.132-1 -- Update to version 5.10.132 -* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.118-11 -- Backport fixes for CVE-2022-0500 -* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.118-10 -- Fix for CVE-2022-2585, CVE-2022-2586 and CVE-2022-2588 -* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.118-9 -- tarfs: fix error for empty tar archive -* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.118-8 -- Fix multiple issues in tarfs -* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.118-7 -- Update iavf driver to v4.4.2 -- Update ice driver to v1.8.3 -- .config: Enable CONFIG_NET_DEVLINK=y (ice v1.8.3 needs it) -* Mon Sep 26 2022 Srivatsa S. Bhat (VMware) 5.10.118-6 -- .config: enable CROSS_MEMORY_ATTACH -- Add elfutils-libelf-devel required to build objtool -- vmxnet3: enable software timestamping -* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-5 -- .config: disable kernel accounting for memory cgroups -- Enable cgroup v1 stats -- .config: enable PERCPU_STATS -* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-4 -- Avoid TSC recalibration -* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-3 -- Fix for CVE-2022-21505 -* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-2 -- VMCI patches & configs -* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-1 -- Update to version 5.10.118 -* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.109-4 -- Fix for CVE-2022-1966, CVE-2022-1972 -* Thu Sep 22 2022 Srivatsa S. Bhat (VMware) 5.10.109-3 -- Fix for CVE-2022-21499 -* Thu Sep 22 2022 Srivatsa S. Bhat (VMware) 5.10.109-2 -- Fix for CVE-2022-29582 -* Wed Sep 21 2022 Srivatsa S. Bhat (VMware) 5.10.109-1 -- Update to version 5.10.109 -* Wed Sep 21 2022 Srivatsa S. Bhat (VMware) 5.10.103-4 -- .config: Increase kernel log buffer size to fix regression. -* Tue Sep 20 2022 Srivatsa S. Bhat (VMware) 5.10.103-3 -- Fix for CVE-2022-1016 -* Mon Sep 19 2022 Srivatsa S. Bhat (VMware) 5.10.103-2 -- Fix SEV and Hypercall alternative inst. patches -* Thu Sep 15 2022 Srivatsa S. Bhat (VMware) 5.10.103-1 -- Update to version 5.10.103 -* Thu Sep 15 2022 Srivatsa S. Bhat (VMware) 5.10.93-7 -- Reduce kernel .data section by configuring smaller kernel log buffer (16) -- Speedup algos registration in non-fips mode -* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-6 -- vtarfs: fix multiple issues -- tarfs: support for hardlink, fix uid/gid/mode issues -* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-5 -- Fix for CVE-2022-0435 -* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-4 -- Fix for CVE-2022-0492 -* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-3 -- Fix for CVE-2022-22942 -* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-2 -- Fix CVE-2022-0330 -* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-1 -- Update to version 5.10.93 -* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.83-7 -- Update ptp_vmw with provider mode support -* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.83-6 -- Fix CVE-2021-4155 and CVE-2021-4204 -* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.83-5 -- crypto_self_test and broken kattest module enhancements -- FIPS: Add module signing for crypto modules -* Tue Sep 13 2022 Srivatsa S. Bhat (VMware) 5.10.83-4 -- mm: fix percpu allocation for memoryless nodes -- pvscsi: fix disk detection issue -* Tue Sep 13 2022 Srivatsa S. Bhat (VMware) 5.10.83-3 -- remove lvm in add-drivers list -- lvm drivers are built as part of dm-mod -* Tue Sep 13 2022 Srivatsa S. Bhat (VMware) 5.10.83-2 -- tarfs: Fix binary execution issue -* Mon Sep 12 2022 Srivatsa S. Bhat (VMware) 5.10.83-1 -- Update to version 5.10.83 -* Mon Aug 08 2022 Shreenidhi Shedi 5.10.78-17 -- Scriptlets fixes and improvements -* Fri Jul 29 2022 Tejaswini Jayaramaiah 5.10.78-16 -- Enable CONFIG_CGROUP_BPF in config to run containers with cgroup v2 -* Wed Jun 29 2022 Keerthana K 5.10.78-15 -- Reduce FIPS canister memory footprint by disabling CONFIG_KALLSYMS_ALL -- Add only fips_canister-kallsyms to vmlinux instead of all symbols -* Fri Jun 24 2022 Shreenidhi Shedi 5.10.78-14 -- Fix debug_package macro usage while adding vmlinux to debuginfo rpm -* Tue May 31 2022 Ajay Kaher 5.10.78-13 -- initialize MMCONFIG, if already not initialized -* Mon Apr 18 2022 Alexey Makhalov 5.10.78-12 -- Add objtool to the -devel package. -- Reduce kernel .data section by configuring smaller kernel log buffer -- .config(x86_64): enable amdgpu driver as a module -* Tue Apr 05 2022 Shreenidhi Shedi 5.10.78-11 -- Enable CONFIG_EXT2_FS_XATTR & related parameters -* Mon Feb 28 2022 Vamsi Krishna Brahmajosyula 5.10.78-10 -- Port non-acpi hotplug support patch to 5.10.x -* Tue Feb 01 2022 Alexey Makhalov 5.10.78-9 -- Reduce kernel .text size by ~40% by removing .entry.text alignment. -* Tue Jan 25 2022 Alexey Makhalov 5.10.78-8 -- .config: enable squashfs module, enable crypto user api rng. -* Wed Dec 01 2021 Ashwin Dayanand Kamat 5.10.78-7 -- Disable md5 algorithm for sctp if fips is enabled. -* Tue Nov 30 2021 Ashwin Dayanand Kamat 5.10.78-6 -- Correct the config file for linux-esx on arm machine -* Tue Nov 23 2021 Ashwin Dayanand Kamat 5.10.78-5 -- tarfs: A new readonly filesystem to mount tar archive -* Fri Nov 19 2021 Keerthana K 5.10.78-4 -- Remove vmci and vmw_balloon patches -- Update Hypervisor detection patch with review comments addressed -* Thu Nov 11 2021 Satya Naga Vasamsetty 5.10.78-3 -- compile with openssl 3.0.0 -* Mon Nov 08 2021 Keerthana K 5.10.78-2 -- Add out-of-tree i40e, iavf and ice drivers. -* Mon Nov 08 2021 Vikash Bansal 5.10.78-1 -- Update to version 5.10.78 -* Thu Oct 28 2021 Sharan Turlapati 5.10.75-1 -- Update to version 5.10.75 -* Thu Oct 21 2021 Keerthana K 5.10.61-7 -- Arm64 VMware Hypervisor features -- Arm64 support for vmw_pvscsi, vmw_vmci and vmw_balloon -- vmxnet3: build only for x86 and arm64 -* Thu Oct 21 2021 Keerthana K 5.10.61-6 -- Add arm64 support -* Mon Oct 18 2021 Alexey Makhalov 5.10.61-5 -- initramfs: large files support for newca -* Wed Oct 06 2021 Ankit Jain 5.10.61-4 -- vtarfs: Fix memory allocation for entry pages -* Fri Sep 17 2021 Ankit Jain 5.10.61-3 -- vtarfs: Added support for LongFilename/LongLink -* Tue Sep 07 2021 Ankit Jain 5.10.61-2 -- vtarfs: Fix crash in vtarfs_file_read_iter() -* Fri Aug 27 2021 Ankit Jain 5.10.61-1 -- Update to version 5.10.61 -* Wed Aug 25 2021 Srivatsa S. Bhat (VMware) 5.10.52-3 -- Enable ptp_vmw module (CONFIG_PTP_1588_CLOCK_VMW) in the config. -* Mon Aug 09 2021 Him Kalyan Bordoloi 5.10.52-2 -- Port crx patches -* Thu Aug 05 2021 Him Kalyan Bordoloi 5.10.52-1 -- Update to version 5.10.52 -* Wed Jul 28 2021 Ankit Jain 5.10.46-3 -- vtarfs: Fixed multiple mount executable issue, -- Fixed fault handler -* Thu Jul 15 2021 Him Kalyan Bordoloi 5.10.46-2 -- Fix for CVE-2021-33909 -* Mon Jun 28 2021 Sharan Turlapati 5.10.46-1 -- Update to version 5.10.46 -* Tue Jun 22 2021 Sharan Turlapati 5.10.42-3 -- Fix for CVE-2021-3609 -* Thu Jun 10 2021 Keerthana K 5.10.42-2 -- Added script to check structure compatibility between fips_canister.o and vmlinux. -* Thu Jun 03 2021 Keerthana K 5.10.42-1 -- Update to version 5.10.42 -- .config: Enable CONFIG_FANOTIFY_ACCESS_PERMISSIONS -* Mon May 17 2021 Ajay Kaher 5.10.35-1 -- Update to version 5.10.35 -* Thu May 13 2021 Sharan Turlapati 5.10.25-10 -- Fix for CVE-2021-23133 -* Wed May 12 2021 Ankit Jain 5.10.25-9 -- .config: Enable Netfilter modules required for NFT support -- .config: Enable Bonding driver support, NET_TEAM, NET_VRF -* Tue May 11 2021 Srivatsa S. Bhat (VMware) 5.10.25-8 -- Fix CVE-2020-26147, CVE-2020-24587, CVE-2020-24586, CVE-2020-24588, -- CVE-2020-26145, CVE-2020-26141 -* Tue May 11 2021 Srivatsa S. Bhat (VMware) 5.10.25-7 -- Fix CVE-2021-3489, CVE-2021-3490, CVE-2021-3491 -* Tue May 04 2021 Sharan Turlapati 5.10.25-6 -- Remove buf_info from device accessible structures in vmxnet3 -* Thu Apr 29 2021 Alexey Makhalov 5.10.25-5 -- Update canister binary. -- use jent by drbg and ecc. -- Enable hmac(sha224) self test and broket KAT test. -* Thu Apr 22 2021 Keerthana K 5.10.25-4 -- Remove hmac(sha224) from broken kat test. -* Thu Apr 15 2021 Sharan Turlapati 5.10.25-3 -- Fix for CVE-2021-23133 -* Thu Apr 15 2021 Srinidhi Rao 5.10.25-2 -- Fix for CVE-2021-29154 -* Mon Mar 22 2021 Him Kalyan Bordoloi 5.10.25-1 -- Update to version 5.10.25 -* Sun Mar 21 2021 Alexey Makhalov 5.10.21-3 -- Do not execute some tests twice -- Support future disablement of des3 -- Do verbose build -- Canister update. -* Mon Mar 15 2021 Srinidhi Rao 5.10.21-2 -- Use jitterentropy rng instead of urandom in rng module. -* Mon Mar 08 2021 Vikash Bansal 5.10.21-1 -- Update to version 5.10.21 -* Mon Mar 01 2021 Alexey Makhalov 5.10.4-14 -- Enable FIPS canister -* Fri Feb 19 2021 Ankit Jain 5.10.4-13 -- Enable CONFIG_ISCSI_TCP support -* Fri Feb 19 2021 Srivatsa S. Bhat (VMware) 5.10.4-12 -- Fix /boot/photon.cfg symlink when /boot is a separate partition. -* Fri Feb 19 2021 Ajay Kaher 5.10.4-11 -- Added SEV-ES improvement patches -* Thu Feb 18 2021 Keerthana K 5.10.4-10 -- Disable fips canister. -* Thu Feb 18 2021 Ajay Kaher 5.10.4-9 -- Enable CONFIG_WDAT_WDT -* Thu Feb 18 2021 Ajay Kaher 5.10.4-8 -- lower the loglevel for floppy driver -* Mon Feb 15 2021 Ankit Jain 5.10.4-7 -- Enable CONFIG_NF_TABLES support -* Thu Feb 11 2021 Keerthana K 5.10.4-6 -- Added crypto_self_test and kattest module. -- These patches are applied when kat_build is enabled. -* Wed Feb 03 2021 Ankit Jain 5.10.4-5 -- Replaced syscalls routines based on user space address -- Removed set_fs() calls -* Thu Jan 28 2021 Alexey Makhalov 5.10.4-4 -- Use secure FIPS canister. -* Mon Jan 25 2021 Ankit Jain 5.10.4-3 -- Enabled CONFIG_WIREGUARD -* Mon Jan 25 2021 Alexey Makhalov 5.10.4-2 -- Build kernel with FIPS canister. -* Wed Jan 06 2021 Bo Gan 5.10.4-1 -- Update to 5.10.4 -- Drop out-of-tree SEV-ES functional patches (already upstreamed). -* Thu Dec 03 2020 Alexey Makhalov 5.9.0-8 -- halt_on_panic kernel cmdline. -- Improve no ACPI poweroff patch to support direct boot. -- .config: enable CONFIG_POWER_RESET_PIIX4_POWEROFF. -* Wed Nov 18 2020 Vikash Bansal 5.9.0-7 -- Mark BAR0 (at offset 0x10) for PCI device 15ad:07b0 (VMXNET3) as variable -* Thu Nov 12 2020 Ajay Kaher 5.9.0-6 -- .config: support for floppy disk and ch341 usb to serial -* Tue Nov 10 2020 Keerthana K 5.9.0-5 -- Fix CVE-2020-8694 -* Fri Nov 06 2020 Keerthana K 5.9.0-4 -- Fix CVE-2020-25704 -* Tue Nov 03 2020 Srinidhi Rao 5.9.0-3 -- Remove the support of fipsify and hmacgen -* Tue Oct 27 2020 Srinidhi Rao 5.9.0-2 -- Enable vtarfs support as module -* Mon Oct 19 2020 Bo Gan 5.9.0-1 -- Update to 5.9.0 -* Thu Oct 08 2020 Ankit Jain 5.9.0-rc7.2 -- Added vtar Support. -- Disabled by default, Enable CONFIG_VTAR as builtin only -* Wed Sep 30 2020 Srivatsa S. Bhat (VMware) 5.9.0-rc7.1 -- Update to version 5.9.0-rc7 -* Mon Sep 21 2020 Bo Gan 5.9.0-rc4.1 -- Update to 5.9.0-rc4 -- AMD SEV-ES Support -* Tue Sep 8 2020 Him Kalyan Bordoloi 4.19.127-4 -- Enable sysrq magic in config -* Mon Jul 27 2020 Srivatsa S. Bhat (VMware) 4.19.127-3 -- Fix CVE-2020-14331 -* Tue Jun 23 2020 Tapas Kundu 4.19.127-2 -- Mass Removal Python2 -* Tue Jun 23 2020 Keerthana K 4.19.127-1 -- Update to version 4.19.127 -* Fri Jun 05 2020 Ankit Jain 4.19.115-5 -- Enabled CONFIG_BINFMT_MISC -* Wed Jun 03 2020 Alexey Makhalov 4.19.115-4 -- fs/9p: local lock support -* Tue Jun 02 2020 Vikash Bansal 4.19.115-3 -- Add patch to fix CVE-2019-18885 -* Mon Jun 01 2020 Shreenidhi Shedi 4.19.115-2 -- Keep modules of running kernel till next boot -* Fri May 29 2020 Alexey Makhalov 4.19.115-1 -- initramfs: zero-copy support -* Wed May 06 2020 Siddharth Chandrasekaran 4.19.112-9 -- Add patch to fix CVE-2020-10711 -* Wed May 06 2020 Vikash Bansal 4.19.112-8 -- Hardcoded the value of BARs in PCI_Probe for 2 more pci devices -* Wed Apr 29 2020 Keerthana K 4.19.112-7 -- Photon-checksum-generator version update to 1.1. -* Fri Apr 24 2020 Vikash Bansal 4.19.112-6 -- Modified PCI Probe patch to store hardcoded values in lookup table -* Thu Apr 23 2020 Keerthana K 4.19.112-5 -- Fix __modules_install_post to skip compression for certain modules. -* Wed Apr 22 2020 Vikash Bansal 4.19.112-4 -- Corrected number of bars for "LSI Logic" and typepo in is_known_device call -* Wed Apr 15 2020 Vikash Bansal 4.19.112-3 -- HMAC-SHA256 digest of hmac_generator module moved to hmacgen package -* Tue Apr 14 2020 Alexey Makhalov 4.19.112-2 -- Refactor PCI probe patch (03-pci-probe.patch) -* Wed Apr 08 2020 Srivatsa S. Bhat (VMware) 4.19.112-1 -- Update to version 4.19.112 -* Wed Apr 08 2020 Alexey Makhalov 4.19.104-3 -- Improve hardcodded poweroff (03-poweroff.patch) -* Tue Mar 31 2020 Vikash Bansal 4.19.104-2 -- hmac generation of crypto modules and initrd generation changes if fips=1 -* Wed Mar 25 2020 Vikash Bansal 4.19.104-1 -- Update to version 4.19.104 -* Mon Mar 16 2020 Keerthana K 4.19.97-8 -- Adding Enhances depedency to hmacgen. -* Fri Mar 06 2020 Alexey Makhalov 4.19.97-7 -- 9p: file attributes caching support (cache=stat) -* Wed Mar 04 2020 Vikash Bansal 4.19.97-6 -- Backporting of patch continuous testing of RNG from urandom -* Fri Feb 28 2020 Keerthana K 4.19.97-5 -- Enable CONFIG_CRYPT_TEST for FIPS. -* Tue Feb 25 2020 Ajay Kaher 4.19.97-4 -- Fix CVE-2019-16234 -* Tue Feb 11 2020 Keerthana K 4.19.97-3 -- Add photon-checksum-generator source tarball and remove hmacgen patch. -- Exclude hmacgen.ko from base package. -* Wed Jan 29 2020 Keerthana K 4.19.97-2 -- Update tcrypt to test drbg_pr_sha256 and drbg_nopr_sha256. -- Update testmgr to add drbg_pr_ctr_aes256 test vectors. -* Fri Jan 17 2020 Srivatsa S. Bhat (VMware) 4.19.97-1 -- Update to version 4.19.97 -* Thu Jan 16 2020 Srinidhi Rao 4.19.87-5 -- Enable DRBG HASH and DRBG CTR support. -* Mon Jan 06 2020 Him Kalyan Bordoloi 4.19.87-4 -- Enable CONFIG_NF_CONNTRACK_ZONES -* Thu Jan 02 2020 Keerthana K 4.19.87-3 -- Modify tcrypt to remove tests for algorithms that are not supported in photon. -- Added tests for DH, DRBG algorithms. -* Fri Dec 20 2019 Keerthana K 4.19.87-2 -- Update fips Kat tests. -* Fri Dec 06 2019 Ajay Kaher 4.19.87-1 -- Update to version 4.19.87 -* Tue Dec 03 2019 Keerthana K 4.19.84-3 -- Adding hmac sha256/sha512 generator kernel module for fips. -* Tue Nov 26 2019 Ajay Kaher 4.19.84-2 -- Fix CVE-2019-19062, CVE-2019-19066, CVE-2019-19072, -- CVE-2019-19073, CVE-2019-19074, CVE-2019-19078 -* Tue Nov 12 2019 Srivatsa S. Bhat (VMware) 4.19.84-1 -- Update to version 4.19.84 -- Fix CVE-2019-18814 -* Fri Nov 08 2019 Srivatsa S. Bhat (VMware) 4.19.82-1 -- Update to version 4.19.82 -* Thu Nov 07 2019 Jorgen Hansen (VMware) 4.19.79-2 -- Fix vsock QP detach with outgoing data -* Tue Oct 15 2019 Ajay Kaher 4.19.79-1 -- Update to version 4.19.79 -- Fix CVE-2019-17133 -* Mon Oct 14 2019 Bo Gan 4.19.76-4 -- Recreate /dev/root in init -* Mon Oct 14 2019 Bo Gan 4.19.76-3 -- Enable IMA with SHA256 as default hash algorithm -* Thu Oct 10 2019 Harinadh D 4.19.76-2 -- Adding lvm and dm-mod modules to support root as lvm -* Wed Oct 02 2019 Ajay Kaher 4.19.76-1 -- Update to version 4.19.76 -* Mon Sep 30 2019 Srivatsa S. Bhat (VMware) 4.19.72-1 -- Update to version 4.19.72 -* Thu Sep 05 2019 Alexey Makhalov 4.19.69-2 -- Avoid oldconfig which leads to potential build hang -* Fri Aug 30 2019 Alexey Makhalov 4.19.69-1 -- Update to version 4.19.69 -* Fri Aug 23 2019 Him Kalyan Bordoloi 4.19.65-3 -- .config: Enable CONFIG_IP_VS_WRR, CONFIG_IP_VS_SH, CONFIG_FB_EFI, CONFIG_TCG_TIS_CORE -* Tue Aug 13 2019 Daniel Müller 4.19.65-2 -- Add patch "Remove OOM_SCORE_ADJ_MAX limit check" -* Tue Aug 06 2019 Alexey Makhalov 4.19.65-1 -- Update to version 4.19.65 -- Fix CVE-2019-1125 (SWAPGS) -* Tue Jul 30 2019 Keerthana K 4.19.52-4 -- Fix postun script. -* Tue Jul 02 2019 Alexey Makhalov 4.19.52-3 -- Fix 9p vsock 16bit port issue. -* Fri Jun 21 2019 Srinidhi Rao 4.19.52-2 -- Use LZ4 compression and enable VMXNET3 as built-in for linux-esx -* Mon Jun 17 2019 Srivatsa S. Bhat (VMware) 4.19.52-1 -- Update to version 4.19.52 -- Fix CVE-2019-12456, CVE-2019-12379, CVE-2019-12380, CVE-2019-12381, -- CVE-2019-12382, CVE-2019-12378, CVE-2019-12455 -* Tue May 14 2019 Keerthana K 4.19.40-2 -- Fix to parse through /boot folder and update symlink (/boot/photon.cfg) if -- mulitple kernels are installed and current linux kernel is removed. -* Tue May 07 2019 Ajay Kaher 4.19.40-1 -- Update to version 4.19.40 -* Fri May 03 2019 Ajay Kaher 4.19.32-3 -- Enable SELinux kernel config -* Fri Mar 29 2019 Srivatsa S. Bhat (VMware) 4.19.32-2 -- Fix CVE-2019-10125 -* Wed Mar 27 2019 Srivatsa S. Bhat (VMware) 4.19.32-1 -- Update to version 4.19.32 -* Thu Mar 14 2019 Srivatsa S. Bhat (VMware) 4.19.29-1 -- Update to version 4.19.29 -* Tue Mar 05 2019 Ajay Kaher 4.19.26-1 -- Update to version 4.19.26 -* Thu Feb 21 2019 Him Kalyan Bordoloi 4.19.15-2 -- Fix CVE-2019-8912 -* Tue Jan 15 2019 Srivatsa S. Bhat (VMware) 4.19.15-1 -- Update to version 4.19.15 -- .config: Enable USB_SERIAL and USB_ACM -* Tue Jan 08 2019 Alexey Makhalov 4.19.6-4 -- Additional security hardening options in the config. -* Tue Jan 08 2019 Srivatsa S. Bhat (VMware) 4.19.6-3 -- Fix crash on cpu hot-add. -* Fri Jan 04 2019 Srivatsa S. Bhat (VMware) 4.19.6-2 -- Add out-of-tree patches from AppArmor and enable it by default. -* Mon Dec 10 2018 Srivatsa S. Bhat (VMware) 4.19.6-1 -- Update to version 4.19.6 -* Thu Nov 29 2018 Alexey Makhalov 4.19.1-3 -- Fix BAR4 is zero issue for IDE devices -* Thu Nov 15 2018 Ajay Kaher 4.19.1-2 -- Adding BuildArch -* Thu Nov 08 2018 Him Kalyan Bordoloi 4.19.1-1 -- Update to version 4.19.1 -* Mon Sep 24 2018 Srivatsa S. Bhat 4.18.9-1 -- Update to version 4.18.9 -* Wed Sep 19 2018 Srivatsa S. Bhat 4.14.67-1 -- Update to version 4.14.67 -* Tue Sep 18 2018 Srivatsa S. Bhat 4.14.54-3 -- Add rdrand-based RNG driver to enhance kernel entropy. -* Sun Sep 02 2018 Srivatsa S. Bhat 4.14.54-2 -- Add full retpoline support by building with retpoline-enabled gcc. -* Mon Jul 09 2018 Him Kalyan Bordoloi 4.14.54-1 -- Update to version 4.14.54 -* Fri Feb 02 2018 Alexey Makhalov 4.14.8-1 -- Version update -* Tue Dec 19 2017 Srivatsa S. Bhat 4.9.66-2 -- Enable audit support (CONFIG_AUDIT=y) -* Mon Dec 04 2017 Srivatsa S. Bhat 4.9.66-1 -- Version update -* Tue Nov 21 2017 Srivatsa S. Bhat 4.9.64-1 -- Version update -* Mon Nov 06 2017 Srivatsa S. Bhat 4.9.60-1 -- Version update -* Wed Oct 25 2017 Anish Swaminathan 4.9.53-5 -- Enable x86 vsyscall emulation -* Tue Oct 17 2017 Alexey Makhalov 4.9.53-4 -- Enable vsyscall emulation -- Do not use deprecated -q depmod option -* Wed Oct 11 2017 Srivatsa S. Bhat 4.9.53-3 -- Add patch "KVM: Don't accept obviously wrong gsi values via - KVM_IRQFD" to fix CVE-2017-1000252. -* Tue Oct 10 2017 Alexey Makhalov 4.9.53-2 -- Build hang (at make oldconfig) fix. -* Thu Oct 05 2017 Srivatsa S. Bhat 4.9.53-1 -- Version update -* Mon Oct 02 2017 Srivatsa S. Bhat 4.9.52-3 -- Allow privileged CLONE_NEWUSER from nested user namespaces. -* Mon Oct 02 2017 Srivatsa S. Bhat 4.9.52-2 -- Fix CVE-2017-11472 (ACPICA: Namespace: fix operand cache leak) -* Mon Oct 02 2017 Srivatsa S. Bhat 4.9.52-1 -- Version update -* Mon Sep 18 2017 Alexey Makhalov 4.9.47-2 -- Requires coreutils or toybox -* Mon Sep 04 2017 Alexey Makhalov 4.9.47-1 -- Fix CVE-2017-11600 -* Mon Aug 14 2017 Alexey Makhalov 4.9.43-1 -- Version update -- [feature] new sysctl option unprivileged_userns_clone -* Wed Aug 09 2017 Alexey Makhalov 4.9.41-2 -- [bugfix] Do not fallback to syscall from VDSO on clock_gettime(MONOTONIC) -- Fix CVE-2017-7542 -* Mon Aug 07 2017 Alexey Makhalov 4.9.41-1 -- Version update -* Wed Jul 26 2017 Bo Gan 4.9.38-3 -- Fix initramfs triggers -* Thu Jul 20 2017 Alexey Makhalov 4.9.38-2 -- Disable scheduler beef up patch -* Tue Jul 18 2017 Alexey Makhalov 4.9.38-1 -- [feature] IP tunneling support (CONFIG_NET_IPIP=m) -- Fix CVE-2017-11176 and CVE-2017-10911 -* Mon Jul 03 2017 Xiaolin Li 4.9.34-2 -- Add libdnet-devel, kmod-devel and libmspack-devel to BuildRequires -* Wed Jun 28 2017 Alexey Makhalov 4.9.34-1 -- [feature] DM Delay target support -- Fix CVE-2017-1000364 ("stack clash") and CVE-2017-9605 -* Thu Jun 8 2017 Alexey Makhalov 4.9.31-1 -- Fix CVE-2017-8890, CVE-2017-9074, CVE-2017-9075, CVE-2017-9076 - CVE-2017-9077 and CVE-2017-9242 -* Thu Jun 1 2017 Alexey Makhalov 4.9.30-2 -- [feature] ACPI NFIT support (for PMEM type 7) -* Fri May 26 2017 Alexey Makhalov 4.9.30-1 -- Fix CVE-2017-7487 and CVE-2017-9059 -* Wed May 17 2017 Vinay Kulkarni 4.9.28-2 -- Enable IPVLAN module. -* Tue May 16 2017 Alexey Makhalov 4.9.28-1 -- .config: built ATA drivers in a kernel -* Wed May 10 2017 Alexey Makhalov 4.9.27-1 -- New pci=scan_all cmdline parameter to verify hardcoded pci-probe values -- pci-probe added more known values -- vmw_balloon late initcall -* Sun May 7 2017 Alexey Makhalov 4.9.26-1 -- Version update -- Use ordered rdtsc in clocksource_vmware -- .config: added debug info -- Removed version suffix from config file name -* Thu Apr 27 2017 Bo Gan 4.9.24-2 -- Support dynamic initrd generation -* Tue Apr 25 2017 Alexey Makhalov 4.9.24-1 -- Fix CVE-2017-6874 and CVE-2017-7618. -- .config: build nvme and nvme-core in kernel. -* Tue Feb 28 2017 Alexey Makhalov 4.9.13-1 -- Update to linux-4.9.13 to fix CVE-2017-5986 and CVE-2017-6074 -- .config: enable PMEM support -- .config: disable vsyscall -* Thu Feb 09 2017 Alexey Makhalov 4.9.9-1 -- Update to linux-4.9.9 to fix CVE-2016-10153, CVE-2017-5546, - CVE-2017-5547, CVE-2017-5548 and CVE-2017-5576. -- .config: added CRYPTO_FIPS and SYN_COOKIES support. -* Tue Jan 10 2017 Alexey Makhalov 4.9.2-1 -- Update to linux-4.9.2 to fix CVE-2016-10088 -* Wed Dec 21 2016 Alexey Makhalov 4.9.0-3 -- .config: CONFIG_IPV6_MULTIPLE_TABLES=y -* Mon Dec 19 2016 Xiaolin Li 4.9.0-2 -- BuildRequires Linux-PAM-devel -* Mon Dec 12 2016 Alexey Makhalov 4.9.0-1 -- Update to linux-4.9.0 -* Thu Dec 8 2016 Alexey Makhalov 4.4.35-4 -- net-packet-fix-race-condition-in-packet_set_ring.patch - to fix CVE-2016-8655 -* Wed Nov 30 2016 Alexey Makhalov 4.4.35-3 -- Expand `uname -r` with release number -- Compress modules -* Tue Nov 29 2016 Alexey Makhalov 4.4.35-2 -- Added btrfs module -* Mon Nov 28 2016 Alexey Makhalov 4.4.35-1 -- Update to linux-4.4.35 -- vfio-pci-fix-integer-overflows-bitmask-check.patch - to fix CVE-2016-9083 -* Tue Nov 22 2016 Alexey Makhalov 4.4.31-4 -- net-9p-vsock.patch -* Thu Nov 17 2016 Alexey Makhalov 4.4.31-3 -- tty-prevent-ldisc-drivers-from-re-using-stale-tty-fields.patch - to fix CVE-2015-8964 -* Tue Nov 15 2016 Alexey Makhalov 4.4.31-2 -- .config: add ip set support -- .config: add ipvs_{tcp,udp} support -- .config: add cgrup_{hugetlb,net_prio} support -* Thu Nov 10 2016 Alexey Makhalov 4.4.31-1 -- Update to linux-4.4.31 -* Thu Nov 10 2016 Alexey Makhalov 4.4.26-2 -- .config: add ipvs modules for docker swarm -- .config: serial driver built in kernel -- serial-8250-do-not-probe-U6-16550A-fifo-size.patch - faster boot -* Fri Oct 21 2016 Alexey Makhalov 4.4.26-1 -- Update to linux-4.4.26 -* Wed Oct 19 2016 Alexey Makhalov 4.4.20-7 -- net-add-recursion-limit-to-GRO.patch -* Tue Oct 18 2016 Alexey Makhalov 4.4.20-6 -- ipip-properly-mark-ipip-GRO-packets-as-encapsulated.patch -- tunnels-dont-apply-GRO-to-multiple-layers-of-encapsulation.patch -* Thu Oct 6 2016 Alexey Makhalov 4.4.20-5 -- .config: added ADM PCnet32 support -- vmci-1.1.4.0-use-32bit-atomics-for-queue-headers.patch -- vmci-1.1.5.0-doorbell-create-and-destroy-fixes.patch -- late_initcall for vmw_balloon driver -- Minor fixed in pv-ops patchset -* Mon Oct 3 2016 Alexey Makhalov 4.4.20-4 -- Package vmlinux with PROGBITS sections in -debuginfo subpackage -* Wed Sep 21 2016 Alexey Makhalov 4.4.20-3 -- Add PCIE hotplug support -- Switch processor type to generic -* Tue Sep 20 2016 Alexey Makhalov 4.4.20-2 -- Add -release number for /boot/* files -- Fixed generation of debug symbols for kernel modules & vmlinux -* Wed Sep 7 2016 Alexey Makhalov 4.4.20-1 -- Update to linux-4.4.20 -- keys-fix-asn.1-indefinite-length-object-parsing.patch -* Thu Aug 25 2016 Alexey Makhalov 4.4.8-11 -- vmxnet3 patches to bumpup a version to 1.4.8.0 -* Wed Aug 24 2016 Alexey Makhalov 4.4.8-10 -- .config: added NVME blk dev support -* Wed Aug 10 2016 Alexey Makhalov 4.4.8-9 -- Added VSOCK-Detach-QP-check-should-filter-out-non-matching-QPs.patch -* Wed Jul 20 2016 Alexey Makhalov 4.4.8-8 -- .config: added cgroups for pids,mem and blkio -* Mon Jul 11 2016 Alexey Makhalov 4.4.8-7 -- .config: added ip multible tables support -* Fri Jun 17 2016 Alexey Makhalov 4.4.8-6 -- patch: e1000e-prevent-div-by-zero-if-TIMINCA-is-zero.patch -- .config: disable rt group scheduling - not supported by systemd -* Fri May 27 2016 Alexey Makhalov 4.4.8-5 -- patch: REVERT-sched-fair-Beef-up-wake_wide.patch -* Wed May 25 2016 Alexey Makhalov 4.4.8-4 -- .config: added net_9p and 9p_fs -* Tue May 24 2016 Priyesh Padmavilasom 4.4.8-3 -- GA - Bump release of all rpms -* Mon May 23 2016 Divya Thaluru 4.4.8-2 -- Added patches to fix CVE-2016-3134, CVE-2016-3135 -* Fri May 13 2016 Alexey Makhalov 4.4.8-1 -- Update to linux-4.4.8 -- Added net-Drivers-Vmxnet3-set-... patch -- Added e1000e module -* Tue Mar 29 2016 Alexey Makhalov 4.2.0-19 -- Support kmsg dumping to vmware.log on panic -- sunrpc: xs_bind uses ip_local_reserved_ports -* Thu Mar 24 2016 Alexey Makhalov 4.2.0-18 -- Apply photon8 config (+stack protector regular) -- pv-ops patch: added STA support -- Added patches from generic kernel -* Wed Mar 09 2016 Harish Udaiya Kumar 4.2.0-17 -- Enable ACPI hotplug support in kernel config -* Sun Feb 14 2016 Alexey Makhalov 4.2.0-16 -- veth patch: don’t modify ip_summed -* Mon Feb 08 2016 Alexey Makhalov 4.2.0-15 -- Double tcp_mem limits, patch is added. -* Wed Feb 03 2016 Anish Swaminathan 4.2.0-14 -- Fixes for CVE-2015-7990/6937 and CVE-2015-8660. -* Fri Jan 22 2016 Alexey Makhalov 4.2.0-13 -- Fix for CVE-2016-0728 -* Wed Jan 13 2016 Alexey Makhalov 4.2.0-12 -- CONFIG_HZ=250 -- Disable sched autogroup. -* Tue Jan 12 2016 Mahmoud Bassiouny 4.2.0-11 -- Remove rootfstype from the kernel parameter. -* Tue Dec 15 2015 Alexey Makhalov 4.2.0-10 -- Skip rdrand reseed to improve boot time. -- .config changes: jolietfs(m), default THP=always, hotplug_cpu(m) -* Tue Nov 17 2015 Alexey Makhalov 4.2.0-9 -- nordrand cmdline param is removed. -- .config: + serial 8250 driver (M). -* Fri Nov 13 2015 Mahmoud Bassiouny 4.2.0-8 -- Change the linux image directory. -* Tue Nov 10 2015 Alexey Makhalov 4.2.0-7 -- Get LAPIC timer frequency from HV, skip boot time calibration. -- .config: + dummy net driver (M). -* Mon Nov 09 2015 Alexey Makhalov 4.2.0-6 -- Rename subpackage dev -> devel. -- Added the build essential files in the devel subpackage. -- .config: added genede driver module. -* Wed Oct 28 2015 Alexey Makhalov 4.2.0-5 -- Import patches from kernel2 repo. -- Added pv-ops patch (timekeeping related improvements). -- Removed unnecessary cmdline params. -- .config changes: elevator=noop by default, paravirt clock enable, - initrd support, openvswitch module, x2apic enable. -* Mon Sep 21 2015 Alexey Makhalov 4.2.0-4 -- CDROM modules are added. -* Thu Sep 17 2015 Alexey Makhalov 4.2.0-3 -- Fix for 05- patch (SVGA mem size) -- Compile out: pci hotplug, sched smt. -- Compile in kernel: vmware balloon & vmci. -- Module for efi vars. -* Fri Sep 4 2015 Alexey Makhalov 4.2.0-2 -- Hardcoded poweroff (direct write to piix4), no ACPI is required. -- sd.c: Lower log level for "Assuming drive cache..." message. -* Tue Sep 1 2015 Alexey Makhalov 4.2.0-1 -- Update to linux-4.2.0. Enable CONFIG_EFI -* Fri Aug 28 2015 Alexey Makhalov 4.1.3-5 -- Added MD/LVM/DM modules. -- Pci probe improvements. -* Fri Aug 14 2015 Alexey Makhalov 4.1.3-4 -- Use photon.cfg as a symlink. -* Thu Aug 13 2015 Alexey Makhalov 4.1.3-3 -- Added environment file(photon.cfg) for a grub. -* Tue Aug 11 2015 Alexey Makhalov 4.1.3-2 -- Added pci-probe-vmware.patch. Removed unused modules. Decreased boot time. -* Tue Jul 28 2015 Alexey Makhalov 4.1.3-1 -- Initial commit. Use patchset from Clear Linux. \ No newline at end of file +%if 0%{?photon_subrelease} <= 90 +%include %{SOURCE992} +%else +%if 0%{?photon_subrelease} == 91 +%include %{SOURCE996} +%else +%include %{SOURCE993} +%endif +%endif diff --git a/SPECS/linux/linux.spec b/SPECS/linux/linux.spec index 8c041a72c4..3a983f2381 100644 --- a/SPECS/linux/linux.spec +++ b/SPECS/linux/linux.spec @@ -1,452 +1,49 @@ -%global build_if %{photon_subrelease} >= 92 -%global security_hardening none -%global __cmake_in_source_build 0 -%global lkcm_version 6.12 - -# SBAT generation of "linux.photon" component -%define linux_photon_generation 1 - -# Do not add unique suffix to *.ko.debug files -# If _unique_debug_names defined, then __debug_install_post expands -# *.ko to *.ko--..debug. -# Undefining this option keeps filenames simple: *.ko.debug. -# This is what crash utility is looking for. -%undefine _unique_debug_names - -# __debug_install_post extracts debug-info from modules. We need to -# specify option for any customizations. -%define _find_debuginfo_opts --keep-section '.BTF' - -# FIPS flags: fips, canister_build, canister_usage, acvp_build. -# "fips" - declaring whether or not to build FIPS compliant kernel with crypto -# canister. When fips=0, it is a regular kernel build without the canister, -# canister_* values are ignored in this case. When fips=1 there are 2 possible -# build types: -# 1. canister_build=1 - build the canister and use it. -# 2. canister_build=0 - link with prebuilt canister object file. -# -# In both cases when fips=1, we use out of tree jent tarball. -# -# acvp_build=1 defines a special build of the canister for FIPS certification. -# It enforces fips=1 and works with canister_build(dev) or canister_usage (prod) -# -# kat_build=1 defines a non-production canister build used for CMVP_DEMO during FIPS certification. -# It includes additional debug prints in the cryptographic algorithm paths to display API flow -# and return statuses during ACVP testing. -# It also intentionally tampers the self-tests to simulate the broken KAT scenario required -# during the FIPS certification process. -# It enforces acvp_build=1 and canister_build=1. -# -# canister_usage is derived variable and can not be directly set. -# canister_usage=!canister_build, iff fips=1 +# One spec for every 5.0 subrelease: kernel 6.1 up to photon_subrelease 90, +# kernel 6.12 from 91 (6.12.111 at 91). The per-kernel preamble and changelog +# are included below; sections that differ carry photon_subrelease conditionals. -%ifarch x86_64 -%define arch x86_64 -%define archdir x86 -%global fips 1 -%endif - -%ifarch aarch64 -%define arch arm64 -%define archdir arm64 -%global fips 0 -%endif - -%if 0%{?kat_build} -%global acvp_build 1 -%global canister_build 1 -%endif - -%if 0%{?acvp_build} -%global fips 1 -%endif - -# Set default FIPS flags -%if 0%{?fips} -%global fips_plugins 1 -%if 0%{?canister_build} -%global canister_usage 0 -# This is the last certified canister version -# Remove below line when building a new canister -%define fips_certified_kernel_version 6.12.60-18.ph5 -%else -%global canister_usage 1 +# acvp_build and kat_build are x86_64-only: the canister they certify is +# arch/x86 crypto and the only ACVP config is config_x86_64_acvp. Refuse them +# on any other architecture instead of building with x86_64 inputs. +%ifnarch x86_64 +%if 0%{?acvp_build} || 0%{?kat_build} +%{error:acvp_build and kat_build are x86_64-only; refusing to build for %{_target_cpu}} %endif -%else -%global canister_usage 0 -%global canister_build 0 %endif Summary: Kernel Name: linux -Version: 6.12.113 -Release: 1%{?acvp_build:.acvp}%{?kat_build:.kat}%{?dist} URL: http://www.kernel.org/ Group: System Environment/Kernel Vendor: VMware, Inc. Distribution: Photon -%define uname_r %{version}-%{release} -%define _modulesdir /lib/modules/%{uname_r} - -Source0: http://www.kernel.org/pub/linux/kernel/v6.x/linux-%{version}.tar.xz -Source1: config_%{_arch} -Source2: initramfs.trigger - -%define ena_version 2.17.0 -Source3: https://github.com/amzn/amzn-drivers/archive/refs/tags/ena_linux_%{ena_version}.tar.gz - -%define efa_version 3.1.0 -Source4: https://github.com/amzn/amzn-drivers/archive/refs/tags/efa_linux_%{efa_version}.tar.gz - -# contains pre, postun, filetriggerun tasks -Source6: scriptlets.inc -Source7: check_for_config_applicability.inc - -Source18: spec_install_post.inc -Source19: %{name}-dracut-%{_arch}.conf -Source20: photon_sb2020.pem -Source21: photon_km_2025.pem - -%ifarch x86_64 -# Secure Boot -Source25: linux-sbat.csv.in -%endif - -Source30: Makefile.viomem -Source31: viomem.c -Source56: kernel_cve_patches.inc - -Source55: license.txt -%include %{SOURCE55} - -%if 0%{?fips} -%define jent_name photon-jitterentropy-v6.12 -%define jent_rel_ver 3 -Source10000: %{jent_name}-%{jent_rel_ver}.tar.gz - -Source10001: jitterentropy_canister_wrapper.c -Source10002: jitterentropy_canister_wrapper.h -Source10003: jitterentropy_canister_wrapper_asm.S - -%if 0%{?canister_usage} -%define fips_canister_version 6.12.60-18.2.ph5 -%define ExtraBuildRequiresSansSnapshot linux-fips-canister = %{fips_canister_version} -BuildRequires: linux-fips-canister = %{fips_canister_version} -%endif - -Source10101: fips_canister_wrapper.c -Source10102: fips_canister_wrapper.h -Source10104: fips_canister_wrapper_common.h -Source10105: fips_canister_wrapper_internal.h -Source10106: fips_canister_wrapper_internal.c - -Source10300: jitterentropy_rng_proxy.c -%endif - -%if 0%{?canister_build} -Source11000: partial_reloc.c -Source11001: fips_integrity.c -Source11002: fips_integrity.h -Source11003: update_canister_hmac.sh -Source11004: canister_combine.lds -Source11005: gen_canister_relocs.c -Source11500: check_kernel_struct_in_canister.inc -%endif - -%if 0%{?acvp_build} -Source12000: config_x86_64_acvp -Source12001: check_for_acvp_config_applicability.inc -%endif - -# common [0..49] -Patch0: confdata-format-change-for-split-script.patch -Patch1: net-Double-tcp_mem-limits.patch -Patch2: SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch -Patch3: 9p-transport-for-9p.patch -Patch4: 9p-trans_fd-extend-port-variable-to-u32.patch -Patch5: vsock-delay-detach-of-QP-with-outgoing-data-59.patch -# RDRAND-based RNG driver to enhance the kernel's entropy pool: -Patch6: 0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch -# Enable CGROUP Stat show for V1 -Patch7: 0001-cgroup-v1-cgroup_stat-support.patch - -# Expose Photon kernel macros to identify kernel flavor and version -Patch9: 0001-kbuild-Makefile-Introduce-macros-to-distinguish-Phot.patch -Patch10: 0002-linux-Makefile-Add-kernel-flavor-info-to-the-generat.patch - -# ttyXRUSB support -Patch11: usb-acm-exclude-exar-usb-serial-ports-nxt.patch -#HyperV patches -Patch12: vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch - -# TODO: Is CONFIG_HYPERV_VSOCKETS the same? -#Patchx: 0014-hv_sock-introduce-Hyper-V-Sockets.patch -Patch13: 0001-fork-add-sysctl-to-disallow-unprivileged-CLONE_NEWUS.patch -# Out-of-tree patches from AppArmor: -Patch14: 0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch -Patch15: 0002-apparmor-af_unix-mediation.patch - -Patch16: Performance-over-security-model.patch - -Patch17: 0001-mm-add-provision-to-disable-CONFIG_PER_VMA_LOCK.patch - -# VMware-specific patch to enable turbostat to work on ESXi -Patch19: 0001-tools-power-turbostat-Skip-some-CPUID-checks-if-runn.patch - -# Allow PCI resets to be disabled from vfio_pci_core module -Patch21: 0001-drivers-vfio-pci-Add-kernel-parameter-to-allow-disab.patch -# Add PCI quirk to allow multiple devices under the same virtual PCI bridge -# to be put into separate IOMMU groups on ESXi. -Patch22: 0001-Add-PCI-quirk-for-VMware-PCIe-Root-Port.patch - -# Upstream fix to properly handle PNP0C01/PNP0C02 device. -Patch23: 0001-ACPI-PNP-Drop-PNP0C01-and-PNP0C02-from-acpi_pnp_devi.patch - -Patch26: 0001-alloc_tag-avoid-current-alloc_tag-manipulations-when.patch - -Patch28: 0001-vmgenid-expose-vmgenid-via-sysfs.patch - -Patch29: 0001-randomize_kstack-Unify-random-source-across-arches.patch - -Patch30: 0001-sched_info_enqueue-don-t-update-last_queued-on-delay.patch - -# Improve small copy_to/from_user performance on CPUs without FSRM -Patch31: 0001-x86-bring-back-unrolled-loop-for-small-sizes-without.patch -Patch32: 0001-x86-only-clobber-registers-in-the-unrolled-case.patch - -%ifarch x86_64 -# VMW: [50..60] -Patch50: x86-vmware-Log-kmsg-dump-on-panic.patch -Patch51: x86-vmware-Support-steal-time-clock-for-encrypted-gu.patch -# Report guest crash to vmware hypervisor -Patch52: 0001-x86-report-guest-crash-to-vmware-hypervisor.patch - -# SEV on VMware -Patch53: 0079-x86-sev-es-Disable-BIOS-ACPI-RSDP-probing-if-SEV-ES-.patch -Patch54: 0080-x86-boot-Enable-vmw-serial-port-via-Super-I-O.patch -Patch55: 0001-x86-boot-unconditional-preserve-CR4.MCE.patch -# TODO: Review: Patch602: 0081-x86-sev-es-Disable-use-of-WP-via-PAT-for-__sme_early.patch -Patch56: 0001-x86-vmware-Redefine-the-macro-of-CPUID_VMWARE.patch - -# Secure Boot and Kernel Lockdown -Patch57: 0001-kernel-lockdown-when-UEFI-secure-boot-enabled.patch -Patch58: 0002-Add-.sbat-section.patch -Patch59: 0003-Verify-SBAT-on-kexec.patch -%endif - -#Secure: -Patch61: 0001-gcc-rap-plugin-with-kcfi.patch -Patch62: 0002-objtool-Return-error-in-case-of-failures.patch -Patch63: 0004-Fix-PAX-function-pointer-overwritten-for-tasklet-cal.patch - -# vmxnet3 -Patch65: 0001-vmxnet3_support_higher_link_speeds_from_vmxnet3_v9.patch - -# Backward compatibility -%if "%{dist}" == ".ph5" -Patch71: 0001-block-Fix-validation-of-ioprio-level.patch +%if 0%{?photon_subrelease} <= 90 +Version: 6.1.190 +%else +%if 0%{?photon_subrelease} == 91 +Version: 6.12.111 +%else +Version: 6.12.113 %endif - -# CVE patches — see kernel_cve_patches.inc (range 3000–3999) -%include %{SOURCE56} - -%ifarch aarch64 -# aarch specific patches [200..219] -# Rpi of_configfs patches -Patch201: 0001-OF-DT-Overlay-configfs-interface.patch -Patch203: 0003-of-overlay-Correct-symbol-path-fixups.patch -# Rpi fan driver -# arm64 hypervisor detection and kmsg dumper -Patch205: 0001-x86-hyper-generalize-hypervisor-type-detection.patch -Patch206: 0002-arm64-Generic-hypervisor-type-detection-for-arm64.patch -Patch207: 0003-arm64-VMware-hypervisor-detection.patch -Patch208: 0004-arm64-kmsg-dumper-for-VMware-hypervisor.patch -Patch209: 0005-scsi-vmw_pvscsi-add-arm64-support.patch -Patch210: 0006-vmxnet3-build-only-for-x86-and-arm64.patch -Patch211: 0005-vmw_balloon-add-arm64-support.patch -Patch212: 0001-vmw_vmci-arm64-support-memory-ordering.patch -# Report guest crash to vmware hypervisor -Patch213: 0001-arm64-report-guest-crash-to-vmware-hypervisor.patch %endif +Source0: http://www.kernel.org/pub/linux/kernel/v6.x/linux-%{version}.tar.xz -# perf: off-cpu sample -Patch221: 0001-perf-core-add-logic-to-collect-off-cpu-sample.patch -Patch222: 0002-perf-record-add-options-to-off-cpu.patch -Patch223: 0003-perf-display-off-cpu-samples.patch - -# tools: fix for new glibc -Patch230: 0001-perf-disasm-Constify-variables-storing-the-result-of.patch -Patch231: 0002-perf-metricgroup-Constify-variables-storing-the-resu.patch -Patch232: 0003-perf-strlist-Don-t-write-to-const-memory.patch -Patch233: 0004-perf-session-Don-t-write-to-memory-pointed-to-a-cons.patch -Patch234: 0005-perf-trace-event-Constify-variables-storing-the-resu.patch -Patch235: 0006-perf-units-Constify-variables-storing-the-result-of-.patch -Patch236: 0007-perf-time-utils-Constify-variables-storing-the-resul.patch -Patch237: 0008-perf-demangle-java-Constify-variables-storing-the-re.patch -Patch238: 0009-perf-bpf-event-Constify-variables-storing-the-result.patch -Patch239: 0010-perf-jitdump-Constify-variables-storing-the-result-o.patch -Patch240: 0011-perf-list-Remove-unused-sep-variable.patch -Patch241: 0012-perf-diff-Constify-strchr-return-variables.patch -Patch242: 0013-perf-tools-Use-const-for-variables-receiving-str-str.patch -Patch243: 0014-perf-trace-Don-t-change-const-char-strings.patch -Patch244: 0015-perf-list-Don-t-write-to-const-memory.patch -Patch245: 0016-perf-trace-Deal-with-compiler-const-checks.patch -Patch246: 0017-perf-print-events-Fix-compiler-issues-with-newer-gil.patch -Patch247: 0018-perf-list-Signal-changing-const-memory-is-ok.patch -Patch248: 0019-perf-tools-Remove-unused-color_fwrite_lines.patch - -%ifarch x86_64 -# AWS: [300..339] -Patch301: 0001-scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch -Patch302: 0007-xen-manage-keep-track-of-the-on-going-suspend-mode.patch -Patch303: 0008-xen-manage-introduce-helper-function-to-know-the-on-.patch -Patch304: 0009-xenbus-add-freeze-thaw-restore-callbacks-support.patch -Patch305: 0010-x86-xen-Introduce-new-function-to-map-HYPERVISOR_sha.patch -Patch306: 0011-x86-xen-add-system-core-suspend-and-resume-callbacks.patch -Patch307: 0012-xen-blkfront-add-callbacks-for-PM-suspend-and-hibern.patch -Patch308: 0013-xen-netfront-add-callbacks-for-PM-suspend-and-hibern.patch -Patch309: 0014-xen-time-introduce-xen_-save-restore-_steal_clock.patch -Patch310: 0015-x86-xen-save-and-restore-steal-clock.patch -Patch311: 0016-xen-events-add-xen_shutdown_pirqs-helper-function.patch -Patch312: 0017-x86-xen-close-event-channels-for-PIRQs-in-system-cor.patch -Patch313: 0018-PM-hibernate-update-the-resume-offset-on-SNAPSHOT_SE.patch -Patch314: 0020-xen-blkfront-Fixed-blkfront_restore-to-remove-a-call.patch -Patch315: 0021-x86-tsc-avoid-system-instability-in-hibernation.patch -Patch316: 0022-block-xen-blkfront-consider-new-dom0-features-on-res.patch -Patch317: 0023-xen-restore-pirqs-on-resume-from-hibernation.patch -Patch318: 0024-xen-Only-restore-the-ACPI-SCI-interrupt-in-xen_resto.patch -Patch319: 0026-xen-netfront-call-netif_device_attach-on-resume.patch -Patch320: 0054-xen-Restore-xen-pirqs-on-resume-from-hibernation.patch -Patch321: 0055-block-xen-blkfront-bump-the-maximum-number-of-indire.patch -Patch322: 0185-Introduce-page-touching-DMA-ops-binding.patch -Patch323: 0444-drivers-base-memory-use-MHP_MEMMAP_ON_MEMORY-from-th.patch -Patch324: 0490-Correct-read-overflow-in-page-touching-DMA-ops-bindi.patch - -%endif - -#HCX-Patches -Patch701: 0001-Active-probing-of-dst-mac-of-unknown-unicast.patch -Patch702: 0002-Skip-IP_ECN_decapsulate-for-gretap-devices.patch -Patch703: 0003-Handle-ipsec-in-ipip-more-correctly.patch -Patch704: 0004-De-cap-fou-traffic-into-correct-tunnel-device-s.patch -Patch705: 0005-Add-unknown-fou-tracking-to-kernel.patch -Patch706: 0006-Add-support-for-mac-flapping-and-long-mac-flapping-p.patch -Patch707: 0007-vmxnet3-Avoid-fragmentation-by-giving-each-vmxnet3-d.patch -Patch708: 0008-RPS-flow-balance.patch -Patch709: 0009-add-mss-clamp-support-to-gretap-baseimage.patch -Patch710: 0010-iptunnel-mark-xfrm-multi-parts.patch -Patch711: 0011-disable-pskb_inet_may_pull-in-tunnel.patch -Patch712: 0012-gre_tap-interface-mss_clamp-support.patch -Patch713: 0013-rps_cpus-skip-receive-packets-queuing-to-only-housek.patch -Patch714: 0014-Introduce-xfrm_dst-cache-mechanism-to-reuse-xfrm_dst.patch -Patch715: 0015-rcutree-Adding-rcu_max_blimit-rcutree-param.patch - -# Patches for efa [1400..1409] -Patch1400: Fix-efa-cmake-to-build-from-local-directory.patch - -# Only LKCM/JENT related patches below -# Jitterentropy support and FIPS compliance -Patch10000: 0001-New-memsize-options-for-jent.patch -%if 0%{?fips} -Patch10001: 0001-jitterentropy-Makefile-changes.patch -# Patch to remove urandom usage in rng module -Patch10002: 0001-FIPS-crypto-rng-Jitterentropy-RNG-as-the-only-RND-source.patch -# Disable md5 algorithm for sctp if fips is enabled. -Patch10003: 0001-disable-md5-and-sha1-algorithms-for-sctp-if-fips-is-enabled.patch -# Mark ECB as Internal algorithm if fips is enabled. -Patch10004: 0001-crypto-ecb-Set-ecb-alg-flag-as-Internal.patch - -# Below patches are common for canister_usage and canister_build flags -Patch10101: 0001-FIPS-canister-binary-usage.patch -Patch10102: 0002-algapi.c-honor-fcw_skip_tests.patch -Patch10103: 0003-tcrypt-align-to-LKCM.patch -Patch10104: 0004-scripts-kallsyms-Extra-kallsyms-parsing.patch -# Move rsa-pkcs1pad encrypt and decrypt functions outside canister -Patch10106: 0006-crypto-Disable-rsa-pkcs1pad-encrypt-decrypt-in-FIPS-.patch -# Add internal_iv field for aead_request -Patch10107: 0007-aead-add-internal_iv-field.patch -Patch10108: 0008-FIPS-Mark-structure-field-differences-between-kernel.patch -Patch10109: 0009-aead_geniv_ctx-drop-lock-field.patch -Patch10110: 0010-Move-crypto_inc-to-lib-crypto-utils.c.patch -Patch10111: 0001-crypto-Moving-rfc4543-out-of-canister-boundry.patch -# Make lib/digsig to use lib SHA1 instead of crypto shash API -# [10112..10116] -Patch10112: 0001-crypto-x86-sha1-Rename-conflicting-symbol.patch -Patch10113: 0002-lib-crypto-sha1-Rename-sha1_init-to-sha1_init_raw.patch -Patch10114: 0003-lib-crypto-sha1-Add-SHA-1-library-functions.patch -Patch10115: 0001-lib-digsig-Use-SHA-1-library-instead-of-crypto_shash.patch -Patch10116: 0001-crypto-sha1_generic-Renaming-sha1_final.patch -# Track internal/external jitterentropy rng requests -Patch10117: 0001-crypto-track-external-requests-to-jitterentropy_rng.patch -# make ima to use lib SHA1 instead of crypto shash API -Patch10118: 0001-linux-ima-Use-lib-sha1-instead-of-crypto-shash.patch - -# FIPS canister plugins -Patch10200: 0001-Compile-GCC-plugins-for-FIPS-canister.patch -Patch10201: 0002-Build-with-FIPS-Canister-GCC-plugins.patch -Patch10202: 0003-Introduce-FIPS-canister-plugins.patch -Patch10203: 0004-FIPS-Canister-Plugins-Add-self-tests.patch -Patch10204: 0001-Canister-GCC-Plugins-Implement-type-check.patch - -# Compile and inject jitterentropy rng proxy -Patch10300: 0001-compile-jitterentropy-rng-proxy.patch -Patch10301: 0001-change-jitterentropy_rng-driver-name.patch -%endif +Source990: linux-6.1.inc +Source991: linux-6.12.inc +Source992: linux-6.1-changelog.inc +Source993: linux-6.12-changelog.inc +Source996: linux-6.12.111-changelog.inc +Source994: linux-6.1-packages.inc +Source995: linux-6.12-packages.inc -# Canister build patches -%if 0%{?canister_build} -# Below patches are specific to canister_build flag -Patch11000: 1000-FIPS-canister-creation.patch -Patch11001: 1001-aesni_intel-Remove-static-call.patch -Patch11002: 1002-Disable-retpoline_sites-and-return_sites-sections-in.patch -# Patch to remove urandom usage in drbg and ecc modules -Patch11003: 1003-FIPS-crypto-drbg-Jitterentropy-RNG-as-the-only-RND.patch -Patch11004: 1004-Move-__bug_table-section-to-fips_canister_wrapper.patch -Patch11005: 1005-crypto-Remove-EXPORT_SYMBOL-EXPORT_SYMBOL_GPL-from-c.patch -Patch11006: 1006-Move-kernel-structures-usage-from-canister-to-wrappe.patch -Patch11007: 1007-ecc-Add-pairwise-consistency-test-for-every-generate.patch -Patch11008: 1008-Add-ghash-accelerator.patch -Patch11009: 1009-Handle-approved-and-non-approved-services.patch -Patch11010: 1010-rsa-pkcs1pad-Add-invalid_hash_len-check-in-sign-veri.patch -Patch11011: 1011-sha1-Do-not-register-sha1-to-crypto-backend-when-fip.patch -Patch11012: 1012-Add-shasums-accelerators.patch -Patch11013: 1013-Disable-ret-sites-section-in-x86-shasum-object-files.patch -# Patch to invoke crypto self-tests and add missing test vectors to testmgr -Patch11015: 1015-FIPS-crypto-self-tests.patch -# Disable alloc_hook_tags if MEM_PROFILING is disabled -Patch11016: 1016-linux-canister-Eliminate-codetag-and-other-taggings-.patch -# CVE-2026-64313 fix was applied on canister v6.12.60-18.1. -# Below entry is kept for future reference -# 0001-crypto-ecc-Fix-carry-overflow-in-vli-multiplication.patch -%endif - -# ACVP special builds -%if 0%{?acvp_build:1} -#ACVP test harness patches. -Patch12000: 0001-crypto-AF_ALG-add-sign-verify-API.patch -Patch12001: 0002-crypto-AF_ALG-add-setpubkey-setsockopt-call.patch -Patch12002: 0003-crypto-AF_ALG-add-asymmetric-cipher.patch -Patch12003: 0004-crypto-AF_ALG-add-DH-keygen-ssgen-API.patch -Patch12004: 0005-crypto-AF_ALG-add-DH-param-ECDH-curve-setsockopt.patch -Patch12005: 0006-crypto-AF_ALG-eliminate-code-duplication.patch -Patch12006: 0007-crypto-AF_ALG-add-KPP-support.patch -Patch12007: 0008-crypto-AF_ALG-add-ECC-support.patch -Patch12008: 0009-DRBG-Fix-issues-with-DRBG.patch -Patch12009: 0011-sock-Remove-sendpage-in-favour-of-sendmsg-MSG_SPLICE.patch -Patch12010: 0012-jitterentropy-kcapi-Support-for-sample-collection.patch -Patch12011: 0013-Jitterentropy-Add-char-dev-interface-for-jent-osr.patch -Patch12012: 0014-jitterentropy-Add-prototype-for-sample-collection.patch -%endif - -# KAT special builds -%if 0%{?kat_build} -Patch12013: 0001-Crypto-Tamper-KAT-PCT-and-Integrity-Test.patch -Patch12014: 0015-crypto-api-return-status-prints-for-LKCM6-demo.patch +%if 0%{?photon_subrelease} <= 90 +%include %{SOURCE990} +%else +%include %{SOURCE991} %endif BuildRequires: bc -BuildRequires: mpc-devel BuildRequires: kmod-devel BuildRequires: glib-devel BuildRequires: elfutils-devel @@ -464,33 +61,8 @@ BuildRequires: bison BuildRequires: dwarves-devel BuildRequires: gmp-devel BuildRequires: mpfr-devel -BuildRequires: libtraceevent-devel -BuildRequires: clang-devel -BuildRequires: readline-devel -%if 0%{?fips_plugins} -BuildRequires: gcc >= 12.2.0-6 -%endif - -%ifarch x86_64 -BuildRequires: pciutils-devel -BuildRequires: libcap-devel -# Requirements for signing artifacts -%if "%{?signing_script}" != "" -%define network_required 1 -BuildRequires: ca-certificates-pki -BuildRequires: python3-requests -%endif -%endif - -BuildRequires: gdb - Requires: kmod Requires: filesystem -Requires(pre): coreutils -Requires(preun): coreutils -Requires(post): coreutils -Requires(postun): coreutils - Obsoletes: linux-aws Obsoletes: linux-secure Provides: linux-secure @@ -506,7 +78,12 @@ This kernel is FIPS certified. Summary: Kernel Dev Group: System Environment/Kernel Requires: %{name} = %{version}-%{release} +%if 0%{?photon_subrelease} <= 90 +Requires: python3 +Requires: gawk +%else Requires: python3 gawk dwarves-devel +%endif %description devel The Linux package contains the Linux kernel dev files @@ -532,43 +109,20 @@ Requires: %{name} = %{version}-%{release} %description docs The Linux package contains the Linux kernel doc files -%package tools -Summary: This package contains the 'perf' performance analysis tools for Linux kernel -Group: System/Tools -Requires: audit elfutils-libelf binutils-libs -Requires: xz-libs -Requires: slang -Requires: python3 -Requires: traceevent-plugins -%ifarch x86_64 -Requires: pciutils +%if 0%{?photon_subrelease} <= 90 +%include %{SOURCE994} +%else +%include %{SOURCE995} %endif -%description tools -This package contains kernel tools like perf, turbostat and cpupower. - -%package python3-perf -Summary: Python bindings for applications that will manipulate perf events. -Group: Development/Libraries -Requires: linux-tools = %{version}-%{release} -Requires: python3 - -%description python3-perf -This package provides a module that permits applications written in the -Python programming language to use the interface to manipulate perf events. - -%package -n bpftool -Summary: Inspection and simple manipulation of eBPF programs and maps -Group: Development/Libraries -Requires: linux-tools = %{version}-%{release} - -%description -n bpftool -This package contains the bpftool, which allows inspection and simple -manipulation of eBPF programs and maps. %if 0%{?canister_build} %package fips-canister Summary: FIPS canister tarball Group: System Environment/Kernel +%if 0%{?photon_subrelease} <= 90 +Requires: python3 +Requires: %{name} = %{version}-%{release} +%endif %description fips-canister The kernel fips-canister %endif @@ -581,11 +135,31 @@ The kernel fips-canister # Using autosetup is not feasible %setup -q -T -D -b 4 -n linux-%{version} +%if 0%{?photon_subrelease} <= 90 +%if 0%{?fips} +# Using autosetup is not feasible +%setup -q -T -D -b 16 -n linux-%{version} +%endif + +%ifarch x86_64 +# Using autosetup is not feasible +%setup -q -T -D -b 32 -n linux-%{version} +%endif + +%endif # Apply CVE patches first %autopatch -p1 -m3000 -M3999 # common %autopatch -p1 -m0 -M49 +%if 0%{?photon_subrelease} <= 90 + +# apparmor +%autopatch -p1 -m100 -M100 + +# seccomp +%autopatch -p1 -m101 -M101 +%endif %ifarch x86_64 # VMW x86 @@ -595,6 +169,147 @@ The kernel fips-canister #Secure %autopatch -p1 -m61 -M63 +%if 0%{?photon_subrelease} <= 90 +%ifarch aarch64 +# aarch64 patches +%autopatch -p1 -m250 -M260 +%endif + +%ifarch x86_64 +# AWS x86 +%autopatch -p1 -m300 -M339 +%endif + +# crypto +%autopatch -p1 -m500 -M504 + +%ifarch x86_64 +%autopatch -p1 -m505 -M507 +%endif + +%if 0%{?fips} +%autopatch -p1 -m508 -M512 +%endif + +%if 0%{?acvp_build:1} +#ACVP test harness patches. +#Need to be applied on top of FIPS canister usage patch to avoid HUNK failure +%autopatch -p1 -m513 -M524 +%if 0%{?kat_build:1} +%autopatch -p1 -m525 -M525 +%endif +%endif + +%ifarch x86_64 +# SEV on VMware +%autopatch -p1 -m600 -M609 +%endif + +#HCX-Patches +%autopatch -p1 -m701 -M719 + +# Report guest crash to vmware hypervisor +%autopatch -p1 -m1000 -M1001 + +# perf: off-cpu sample +%autopatch -p1 -m221 -M223 + +# Patches for efa driver +pushd ../amzn-drivers-efa_linux_%{efa_version} +%autopatch -p1 -m1400 -M1409 +popd + +%if 0%{?canister_build} +%autopatch -p1 -m10000 -M10013 + +%if 0%{?kat_build} +%autopatch -p1 -m10014 -M10014 +%endif +%endif + +%ifarch x86_64 +cp -r ../jitterentropy-%{jent_major_version}-%{jent_ph_version}/ \ + crypto/jitterentropy-%{jent_major_version}/ +cp %{SOURCE33} crypto/jitterentropy-%{jent_major_version}/jitterentropy_canister_wrapper.c +cp %{SOURCE34} crypto/jitterentropy-%{jent_major_version}/jitterentropy_canister_wrapper.h +cp %{SOURCE35} crypto/jitterentropy-%{jent_major_version}/jitterentropy_canister_wrapper_asm.S +%endif + +%make_build mrproper +cp %{SOURCE1} .config + +cat %{SOURCE20} %{SOURCE21} > photon-cert-bundle.pem +%ifarch x86_64 +%if 0%{?fips} +cp %{SOURCE38} crypto/ +cp %{SOURCE36} crypto/fips_canister_wrapper.c +cp %{SOURCE37} crypto/fips_canister_wrapper.h +cp %{SOURCE39} crypto/fips_canister_wrapper_common.h +cp %{SOURCE40} crypto/fips_canister_wrapper_internal.h +cp %{SOURCE41} crypto/fips_canister_wrapper_internal.c +cp %{SOURCE51} crypto/jitterentropy_rng_proxy.c + +cp ../fips-canister-%{fips_canister_version}/fips_canister.o \ + ../fips-canister-%{fips_canister_version}/.fips_canister.o.cmd \ + ../fips-canister-%{fips_canister_version}/fips_canister-kallsyms \ + crypto/ + +mkdir -p %{struct_comp_dir}/%{vmlinux_definition_loc} +cp %{SOURCE9} %{struct_comp_dir} +cp %{SOURCE75} \ + %{SOURCE76} \ + %{SOURCE77} \ + %{SOURCE78} \ + %{SOURCE79} \ + %{struct_comp_dir}/%{vmlinux_definition_loc} +%endif + +%if 0%{?canister_build} +cp %{SOURCE38} \ + %{SOURCE48} \ + crypto/ +cp %{SOURCE39} crypto/fips_canister_wrapper_common.h +cp %{SOURCE43} crypto/fips_canister_wrapper_internal.h +cp %{SOURCE44} crypto/fips_canister_wrapper_internal.c +cp %{SOURCE45} crypto/fips_integrity.c +cp %{SOURCE46} crypto/fips_integrity.h +cp %{SOURCE49} crypto/gen_canister_relocs.c +install -m 755 %{SOURCE47} crypto/update_canister_hmac.sh +%endif +%endif + +sed -i 's/CONFIG_LOCALVERSION=""/CONFIG_LOCALVERSION="-%{release}"/' .config + +%if 0%{?canister_build} +sed -i "0,/FIPS_CANISTER_VERSION.*$/s/FIPS_CANISTER_VERSION.*$/FIPS_CANISTER_VERSION \"%{lkcm_version}\"/" crypto/fips_integrity.c +sed -i "0,/FIPS_KERNEL_VERSION.*$/s/FIPS_KERNEL_VERSION.*$/FIPS_KERNEL_VERSION \"%{version}-%{release}\"/" crypto/fips_integrity.c + +%if 0%{?kat_build} +sed -i '/CONFIG_CRYPTO_SELF_TEST=y/a CONFIG_CRYPTO_TAMPER_TEST=y' .config +%endif +%endif + +%ifarch x86_64 +sed -e "s,@@NAME@@,%{name},g" \ + -e "s,@@VERSION_RELEASE@@,%{version}-%{release},g" \ + -e "s,@@LINUX_PH_GEN@@,%{linux_photon_generation},g" \ + %{SOURCE25} > linux-sbat.csv +%endif + +%if 0%{?acvp_build} +cp %{SOURCE53} .config_acvp +%include %{SOURCE54} +%else +%include %{SOURCE7} +%endif + +# Set/add CONFIG_CROSS_COMPILE= if needed +if [ %{_host} != %{_build} ]; then +grep -q CONFIG_CROSS_COMPILE= .config && sed -i '/^CONFIG_CROSS_COMPILE=/c\CONFIG_CROSS_COMPILE="%{_host}-"' .config || \ + echo 'CONFIG_CROSS_COMPILE="%{_host}-"' >> .config +fi + +%else # vmxnet3 %autopatch -p1 -m65 -M66 @@ -711,14 +426,7 @@ sed -i '/CONFIG_ARCH_HAS_RELR=y/a CONFIG_RELR=y' .config %endif %endif -%if 0%{?canister_build} -sed -i "s/# CONFIG_GCC_PLUGIN_PAD_CANISTER_STRUCTS is not set/CONFIG_GCC_PLUGIN_PAD_CANISTER_STRUCTS=y/" .config -sed -i "/# CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS is not set/d" .config -%endif - -%if 0%{?canister_usage} -sed -i "s/# CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS is not set/CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS=y/" .config -%endif +%include %{SOURCE5} %ifarch x86_64 sed -e "s,@@NAME@@,%{name},g" \ @@ -740,12 +448,40 @@ grep -q CONFIG_CROSS_COMPILE= .config && sed -i '/^CONFIG_CROSS_COMPILE=/c\CONFI echo 'CONFIG_CROSS_COMPILE="%{_host}-"' >> .config fi +%endif %build +%if 0%{?photon_subrelease} <= 90 +%make_build \ + KBUILD_BUILD_VERSION="1-photon" \ + KBUILD_BUILD_HOST="photon" \ + ARCH=%{arch} +%else %make_build KBUILD_BUILD_VERSION="1-photon" \ KBUILD_BUILD_HOST="photon" ARCH=%{arch} +%endif bldroot="${PWD}" +%if 0%{?photon_subrelease} <= 90 +%if 0%{?fips} +# compare struct definitions between fips canister and vmlinux +# fails out if there is a mismatch, and the offending definition +# has not been documented in %{vmlinux_definition_loc} +pushd %{struct_comp_dir} +gcc -Wall -Werror -o %{struct_comparator} %{SOURCE9} -ldwarves +./%{struct_comparator} \ + ${bldroot}/crypto/fips_canister.o ${bldroot}/vmlinux %{vmlinux_definition_loc} +popd + +rm -rf %{struct_comp_dir} +%endif + +# build ENA module +pushd ../amzn-drivers-ena_linux_%{ena_version}/kernel/linux/ena +cp configure.sh ena-conf.sh +./ena-conf.sh --kernel-dir "${bldroot}" +%make_build -C ${bldroot} M="${PWD}" V=1 modules +%else ARCH_FLAGS="EXTRA_CFLAGS=-Wno-error=deprecated-declarations" %make_build ARCH=%{arch} -C tools \ @@ -775,15 +511,56 @@ pushd ../amzn-drivers-ena_linux_%{ena_version}/kernel/linux/ena cp configure.sh ena-conf.sh ./ena-conf.sh --kernel-dir ${bldroot} %make_build -C ${bldroot} M="${PWD}" modules +%endif popd # build EFA module pushd ../amzn-drivers-efa_linux_%{efa_version}/kernel/linux/efa +%if 0%{?photon_subrelease} <= 90 +mkdir -p build +cd build +%cmake -DKERNEL_DIR=${bldroot} .. +%cmake_build +%else mkdir -p build && cd build %{cmake} -DKERNEL_DIR=${bldroot} .. %{cmake_build} +%endif +popd + +%if 0%{?photon_subrelease} <= 90 +%ifarch x86_64 +# build viomem module +mkdir ../viomem +pushd ../viomem +cp %{SOURCE100} Makefile +cp %{SOURCE101} viomem.c +cd ../viomem +%make_build -C ${bldroot} M="${PWD}" V=1 modules popd +%endif + +%if 0%{?canister_build} +%include %{SOURCE50} +%endif +%ifarch aarch64 +ARCH_FLAGS="EXTRA_CFLAGS=-Wno-error=format-overflow" +%endif +ARCH_FLAGS="${ARCH_FLAGS} EXTRA_CFLAGS=-Wno-error=deprecated-declarations" + +%make_build ARCH=%{arch} -C tools perf PYTHON=python3 $ARCH_FLAGS + +tools/perf/perf -vv | grep libunwind | grep OFF +tools/perf/perf -vv | grep dwarf | grep on + +%ifarch x86_64 +%make_build ARCH=%{arch} -C tools turbostat cpupower PYTHON=python3 +%endif + +%make_build install -C tools/bpf/bpftool prefix=%{_prefix} + +%else # build viomem module pushd ../viomem %make_build -C ${bldroot} M="${PWD}" modules @@ -793,6 +570,140 @@ popd %include %{SOURCE11500} %endif +%endif +%if 0%{?photon_subrelease} <= 90 +%install +%if 0%{?canister_build} +install -vdm 755 %{buildroot}%{_libdir}/fips-canister/ +pushd crypto/ +mkdir fips-canister-%{lkcm_version}-%{version}-%{release} +cp fips_canister.o \ + fips_canister-kallsyms \ + .fips_canister.o.cmd \ + fips-canister-%{lkcm_version}-%{version}-%{release}/ +tar -cvjf fips-canister-%{lkcm_version}-%{version}-%{release}.tar.bz2 fips-canister-%{lkcm_version}-%{version}-%{release}/ +popd +cp crypto/fips-canister-%{lkcm_version}-%{version}-%{release}.tar.bz2 %{buildroot}%{_libdir}/fips-canister/ +%endif +install -vdm 755 %{buildroot}%{_sysconfdir} +install -vdm 755 %{buildroot}/boot +install -vdm 755 %{buildroot}%{_docdir}/linux-%{uname_r} +install -vdm 755 %{buildroot}%{_usrsrc}/linux-headers-%{uname_r} +install -vdm 755 %{buildroot}%{_libdir}/debug/%{_modulesdir} +%make_build ARCH=%{arch} INSTALL_MOD_PATH=%{buildroot} modules_install + +# install ENA module +bldroot="${PWD}" +pushd ../amzn-drivers-ena_linux_%{ena_version}/kernel/linux/ena +%make_build -C ${bldroot} M="${PWD}" INSTALL_MOD_PATH=%{buildroot} modules_install +popd + +# install EFA module +bldroot="${PWD}" +pushd ../amzn-drivers-efa_linux_%{efa_version}/kernel/linux/efa/build/src +%make_build -C ${bldroot} M="${PWD}" INSTALL_MOD_PATH=%{buildroot} modules_install +popd + +%ifarch x86_64 +# install viomem module +pushd ../viomem +%make_build -C ${bldroot} M="${PWD}" INSTALL_MOD_PATH=%{buildroot} modules_install +popd +%endif + +%ifarch x86_64 +# Verify for build-id match +# We observe different IDs sometimes +# TODO: debug it +ID1=$(readelf -n vmlinux | grep "Build ID") +./scripts/extract-vmlinux arch/x86/boot/bzImage > extracted-vmlinux +ID2=$(readelf -n extracted-vmlinux | grep "Build ID") +if [ "$ID1" != "$ID2" ] ; then + echo "Build IDs do not match" + echo $ID1 + echo $ID2 + exit 1 +fi + +install -vm 644 arch/x86/boot/bzImage %{buildroot}/boot/vmlinuz-%{uname_r} +%if "%{?signing_script}" != "" +%{signing_script} --file_type pe \ + --config_file %{signing_params} \ + --auth_file %{signing_auth} \ + --artifact %{buildroot}/boot/vmlinuz-%{uname_r} +%endif +%endif + +%ifarch aarch64 +install -vm 644 arch/arm64/boot/Image %{buildroot}/boot/vmlinuz-%{uname_r} +%endif + +# Restrict the permission on System.map-X file +install -vm 400 System.map %{buildroot}/boot/System.map-%{uname_r} +install -vm 644 .config %{buildroot}/boot/config-%{uname_r} +cp -r Documentation/* %{buildroot}%{_docdir}/linux-%{uname_r} + +%if 0%{?__debug_package} +install -vm 644 vmlinux %{buildroot}%{_libdir}/debug/%{_modulesdir}/vmlinux-%{uname_r} +# `perf test vmlinux` needs it +ln -s vmlinux-%{uname_r} %{buildroot}%{_libdir}/debug/%{_modulesdir}/vmlinux +%endif + +cat > %{buildroot}/boot/linux-%{uname_r}.cfg << "EOF" +# GRUB Environment Block +photon_cmdline=init=/lib/systemd/systemd ro loglevel=3 quiet loadpin.enabled=0 audit=1 slab_nomerge +photon_linux=vmlinuz-%{uname_r} +photon_initrd=initrd.img-%{uname_r} +EOF + +# Register myself to initramfs +mkdir -p %{buildroot}%{_localstatedir}/lib/initramfs/kernel + +# Cleanup dangling symlinks +rm -rf %{buildroot}%{_modulesdir}/source \ + %{buildroot}%{_modulesdir}/build + +find . -name Makefile* -o -name Kconfig* -o -name *.pl | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy +find arch/%{archdir}/include include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy +find $(find arch/%{archdir} -name include -o -name scripts -type d) -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy +find arch/%{archdir}/include Module.symvers include scripts -type f | xargs sh -c 'cp --parents "$@" %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}' copy +%ifarch x86_64 +# CONFIG_STACK_VALIDATION=y requires objtool to build external modules +install -vsm 755 tools/objtool/objtool %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}/tools/objtool/ +install -vsm 755 tools/objtool/fixdep %{buildroot}%{_usrsrc}/linux-headers-%{uname_r}/tools/objtool/ +%endif + +cp .config %{buildroot}%{_usrsrc}/linux-headers-%{uname_r} # copy .config manually to be where it's expected to be +ln -sf "%{_usrsrc}/linux-headers-%{uname_r}" "%{buildroot}%{_modulesdir}/build" +find %{buildroot}/lib/modules -name '*.ko' -print0 | xargs -0 chmod u+x + +mkdir -p %{buildroot}%{_modulesdir}/dracut.conf.d/ +cp -p %{SOURCE19} %{buildroot}%{_modulesdir}/dracut.conf.d/%{name}.conf + +%ifarch aarch64 +ARCH_FLAGS="EXTRA_CFLAGS=-Wno-error=format-overflow" +%endif +ARCH_FLAGS="${ARCH_FLAGS} EXTRA_CFLAGS=-Wno-error=deprecated-declarations" + +%make_build -C tools ARCH=%{arch} DESTDIR=%{buildroot} \ + prefix=%{_prefix} perf_install PYTHON=python3 $ARCH_FLAGS + +%make_build -C tools/perf ARCH=%{arch} DESTDIR=%{buildroot} \ + prefix=%{_prefix} PYTHON=python3 install-python_ext + +%ifarch x86_64 +%make_build -C tools ARCH=%{arch} DESTDIR=%{buildroot} \ + prefix=%{_prefix} mandir=%{_mandir} turbostat_install cpupower_install PYTHON=python3 +%endif + +%make_build install -C tools/bpf/bpftool \ + prefix=%{_prefix} DESTDIR=%{buildroot} + +%include %{SOURCE2} +%include %{SOURCE6} +%include %{SOURCE18} + +%else %install %if 0%{?canister_build} install -vdm 755 %{buildroot}%{_libdir}/fips-canister/ @@ -940,6 +851,7 @@ cp -p %{SOURCE19} %{buildroot}%{_modulesdir}/dracut.conf.d/%{name}.conf %include %{SOURCE6} %include %{SOURCE18} +%endif %post /sbin/depmod -a %{uname_r} ln -sf linux-%{uname_r}.cfg /boot/photon.cfg @@ -961,7 +873,9 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg %exclude %{_modulesdir}/build %exclude %{_modulesdir}/kernel/drivers/gpu %exclude %{_modulesdir}/kernel/sound +%if 0%{?photon_subrelease} >= 91 %exclude %{_includedir}/powercap.h +%endif %ifarch aarch64 %exclude %{_modulesdir}/kernel/drivers/staging/vc04_services/bcm2835-audio %endif @@ -971,9 +885,11 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg %files docs %defattr(-,root,root) %{_docdir}/linux-%{uname_r}/* +%if 0%{?photon_subrelease} >= 91 %ifarch x86_64 %{_mandir}/* %endif +%endif %files devel %defattr(-,root,root) @@ -993,22 +909,40 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg %files tools %defattr(-,root,root) +%if 0%{?photon_subrelease} <= 90 +%ifarch x86_64 +%exclude %{_lib64}/traceevent +%endif +%endif %ifarch aarch64 %exclude %{_libdir}/traceevent %endif %{_bindir}/* +%if 0%{?photon_subrelease} >= 91 # exclude bpf_jit_disasm due to binutils-libs dependency # 91, 92 differ in binutils version %exclude %{_bindir}/bpf_jit_disasm +%endif %{_sysconfdir}/bash_completion.d/perf %{_libexecdir}/perf-core %{_datadir}/perf-core %{_docdir}/perf-tip +%if 0%{?photon_subrelease} <= 90 +%{_libdir}/perf/examples/bpf/* +%{_libdir}/perf/include/bpf/* +%endif %{_includedir}/perf/* %ifarch x86_64 +%if 0%{?photon_subrelease} <= 90 +%{_mandir}/* +%endif %{_includedir}/cpufreq.h %{_includedir}/cpuidle.h +%if 0%{?photon_subrelease} <= 90 +%{_lib64dir}/libcpupower.so* +%else %{_libdir}/libcpupower.so* +%endif %{_docdir}/packages/cpupower %{_datadir}/bash-completion/completions/cpupower %config(noreplace) %{_sysconfdir}/cpufreq-bench.conf @@ -1031,1291 +965,12 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg %{_libdir}/fips-canister/* %endif -%changelog -* Mon Oct 19 2026 Gerrit Photon 6.12.113-1 -- Update to version 6.12.113 -* Mon Oct 19 2026 Brennan Lamoreaux 6.12.112-7 -- Fixes CVE-2026-63858 -* Tue Oct 13 2026 Brennan Lamoreaux 6.12.112-6 -- Bring back the unrolled loop for small user copies on CPUs without FSRM -* Tue Oct 13 2026 Guruswamy Basavaiah 6.12.112-5 -- Fixes CVE-2026-80634 -* Tue Oct 13 2026 Shivani Agarwal 6.12.112-4 -- Fixes CVE-2026-74723, CVE-2026-89537 -* Tue Oct 13 2026 Shivani Agarwal 6.12.112-3 -- Fixes CVE-2026-90104 -* Mon Oct 12 2026 Keerthana K 6.12.112-2 -- Fixes CVE-2026-74752 -* Tue Oct 06 2026 Vamsi Krishna Brahmajosyula 6.12.112-1 -- Update to version 6.12.112 -* Wed Sep 30 2026 Srinidhi Rao 6.12.111-3 -- Fix jent mem free. -* Mon Sep 28 2026 Shreenidhi Shedi 6.12.111-2 -- Fix aarch64 build: set RELR configs for sr92+ (binutils >= 2.46.1) -* Wed Sep 23 2026 Ajay Kaher 6.12.111-1 -- Update to version 6.12.111 -* Wed Sep 23 2026 Keerthana K 6.12.109-9 -- Fixes CVE-2026-46325, CVE-2026-68242, CVE-2026-68258 -* Mon Sep 21 2026 Brennan Lamoreaux 6.12.109-8 -- Fixes CVE-2026-68426 -* Mon Sep 21 2026 Shivani Agarwal 6.12.109-7 -- Fixes CVE-2026-64388, CVE-2026-72031, CVE-2026-72341, CVE-2026-72439 -* Fri Sep 18 2026 Guruswamy Basavaiah 6.12.109-6 -- Fixes CVE-2026-68337, CVE-2026-68441 -* Thu Sep 17 2026 srinidhira0 6.12.109-5 -- Fixes CVE-2026-43464, CVE-2026-45932, CVE-2026-46324, CVE-2026-52956 -* Wed Sep 16 2026 Shreenidhi Shedi 6.12.109-4 -- Fix rpm build warnings -- Exclude bpf_jit_disasm binary to avoid binutils-libs dependency -* Wed Sep 16 2026 Keerthana K 6.12.109-3 -- Fixes CVE-2026-80785 -* Tue Sep 15 2026 Guruswamy Basavaiah 6.12.109-2 -- Fixes CVE-2026-74605, CVE-2026-74611 -* Fri Sep 11 2026 Ajay Kaher 6.12.109-1 -- Update to version 6.12.109 -* Fri Sep 11 2026 Ajay Kaher 6.12.107-11 -- Fixes CVE-2026-68399, CVE-2026-68404, CVE-2026-68409, CVE-2026-68441, CVE-2026-68447, CVE-2026-74571 -* Thu Sep 10 2026 Vamsi Krishna Brahmajosyula 6.12.107-10 -- version bump to build along with sysdig and falco -* Thu Sep 10 2026 Shivani Agarwal 6.12.107-9 -- Fixes CVE-2026-74571, CVE-2026-80580 -* Tue Sep 08 2026 Brennan Lamoreaux 6.12.107-8 -- Fixes CVE-2026-63853, CVE-2026-63879, CVE-2026-64036, CVE-2026-64058, CVE-2026-64078 -* Tue Sep 08 2026 srinidhira0 6.12.107-7 -- Fixes CVE-2026-64160 -* Tue Sep 08 2026 Ankit Jain 6.12.107-6 -- Fixes CVE-2026-72366, CVE-2026-72463, CVE-2026-72493, CVE-2026-74268, CVE-2026-74269 -* Tue Sep 08 2026 Shivani Agarwal 6.12.107-5 -- Fixes CVE-2026-72413, CVE-2026-72423 -* Mon Sep 07 2026 Brennan Lamoreaux 6.12.107-4 -- Fixes CVE-2026-72288, CVE-2026-72355 -* Wed Sep 02 2026 Brennan Lamoreaux 6.12.107-3 -- sched_info_enqueue: don't update last_queued on delayed migration -* Tue Sep 01 2026 Bo Gan 6.12.107-2 -- Backport upstream fix to solve ACPI PNP0C01/PNP0C02 device registration with platform driver -* Mon Aug 31 2026 Ajay Kaher 6.12.107-1 -- Update to version 6.12.107 -* Mon Aug 31 2026 Shivani Agarwal 6.12.103-11 -- Rebased acvp patches for linux-6.12.10* -* Mon Aug 31 2026 Keerthana K 6.12.103-10 -- Fix CVE-2026-68082 -* Tue Aug 25 2026 Ajay Kaher 6.12.103-9 -- Fixes CVEs -* Tue Aug 25 2026 Guruswamy Basavaiah 6.12.103-8 -- Fixes CVE-2026-63979, CVE-2026-64024, CVE-2026-64066, CVE-2026-64067, CVE-2026-64068 -* Fri Aug 21 2026 Srinidhi Rao 6.12.103-7 -- Make ima module to use lib sha1 instead of crypto shash -* Thu Aug 20 2026 Shreenidhi Shedi 6.12.103-6 -- Remove linux requires from linux-tools -- Users are expected to handle that part if there is a mismatch between tools and kernel -* Wed Aug 19 2026 Vamsi Krishna Brahmajosyula 6.12.103-5 -- Remove selinux=0 from default cmdline; SELinux is now disabled via selinux-policy -* Mon Aug 17 2026 Keerthana K 6.12.103-4 -- rap_plugin: fix function alignment gap and tighten caller-side check to match KCFI -- Update canister v6.12.60-18.2 with rap_plugin function alignment gap fix -* Sat Aug 15 2026 Vamsi Krishna Brahmajosyula 6.12.103-3 -- Extend to build for 91 and above -* Thu Aug 13 2026 srinidhira0 6.12.103-2 -- Fixes CVE-2026-52988, CVE-2026-52991, CVE-2026-53089, CVE-2026-53091 -* Mon Aug 10 2026 Gerrit Photon 6.12.103-1 -- Update to version 6.12.103 -* Thu Aug 06 2026 Vamsi Krishna Brahmajosyula 6.12.96-9 -- Make SELinux opt-in by default (add selinux=0 to default cmdline) -* Thu Aug 06 2026 Shivani Agarwal 6.12.96-8 -- Rebased acvp patches for linux-6.12.9* -* Wed Aug 05 2026 Gerrit Photon 6.12.96-7 -- Fixes CVE-2025-40158, CVE-2025-68745, CVE-2026-63872, CVE-2026-64076, CVE-2026-64077 -* Mon Aug 03 2026 Shivani Agarwal 6.12.96-6 -- Fixes CVE-2025-40074, CVE-2025-68353, CVE-2026-23208, CVE-2026-43009, CVE-2026-43485 -* Thu Jul 30 2026 Keerthana K 6.12.96-5 -- Update canister v6.12.60-18.1 with CVE-2026-64313 fix -* Thu Jul 30 2026 Keerthana K 6.12.96-4 -- Fixes CVE-2026-43197, CVE-2026-43198 -* Tue Jul 28 2026 Ankit Jain 6.12.96-3 -- Backport upstream randomize_kstack: Unify random source across arches -- (a96ef5848cb0). -* Mon Jul 27 2026 Ajay Kaher 6.12.96-2 -- Fixes CVE-2026-31589, CVE-2026-43414, CVE-2026-43465, CVE-2026-53224, CVE-2026-53246, CVE-2026-53260 -* Mon Jul 20 2026 Gerrit Photon 6.12.96-1 -- Update to version 6.12.96 -* Tue Jul 07 2026 Bo Gan 6.12.95-2 -- Fix for vmxnet3 BUG_ON in vmxnet3_get_hdr_len() -* Mon Jul 06 2026 Gerrit Photon 6.12.95-1 -- Update to version 6.12.95 -* Mon Jun 22 2026 Gerrit Photon 6.12.94-1 -- Update to version 6.12.94 -* Sat Jun 20 2026 Shreenidhi Shedi 6.12.92-3 -- Add mpc-devel to build requires -* Thu Jun 04 2026 Ankit Jain 6.12.92-2 -- Consolidate CVE patches into kernel_cve_patches.inc (range 3000-3999) -* Tue Jun 02 2026 Shivani Agarwal 6.12.92-1 -- Update to version 6.12.92 -- Fix CVE-2025-68359 and CVE-2026-43101 -- sshedi: fix vmlinux exclusion issue from debuginfo rpm -* Tue May 19 2026 Brennan Lamoreaux 6.12.87-2 -- Fix CVE-2026-43083 -* Mon May 11 2026 Brennan Lamoreaux 6.12.87-1 -- Update to version 6.12.87 -* Tue May 05 2026 Ankit Jain 6.12.78-5 -- Moved SPECS/linux/v6.12(common branch) to SPECS/linux(5.0 branch) -- Used merge commit to keep the history in 5.0 itself -* Mon Apr 27 2026 Ajay Kaher 6.12.78-4 -- Disable CONFIG_PER_VMA_LOCK -* Fri Apr 10 2026 Keerthana K 6.12.78-3 -- Drop unused HCX patches -* Sun Apr 05 2026 Vamsi Krishna Brahmajosyula 6.12.78-2 -- Fix linux-tools build with newer glibc -* Thu Mar 26 2026 Keerthana K 6.12.78-1 -- Update to version 6.12.78 -* Mon Mar 16 2026 Alexey Makhalov 6.12.69-7 -- SELinux as a default LSM -- Add erofs support -- Enable CONFIG_NF_FLOW_TABLE=m -* Mon Mar 09 2026 Keerthana K 6.12.69-6 -- Fix af_unix boolean registration from the wrong array to the correct one -* Wed Mar 04 2026 Keerthana K 6.12.69-5 -- HCX: Update enums to higher value to avoid UAPI conflict with new kernel features -* Mon Mar 02 2026 Shivani Agarwal 6.12.69-4 -- Fix aarch64 build -* Thu Feb 26 2026 Bo Gan 6.12.69-3 -- Enable MEMCG_V1 and CPUSETS_V1 for other flavors as generic/x86 does -* Fri Feb 20 2026 Alexey Makhalov 6.12.69-2 -- Support steal clock on TDX enabled VMs -* Fri Feb 20 2026 Shivani Agarwal 6.12.69-1 -- Update to version 6.12.69 -* Wed Feb 18 2026 Guruswamy Basavaiah 6.12.60-22 -- Disable Bluetooth and CAN support -- Fix requires on doc sub package -* Wed Feb 11 2026 Brennan Lamoreaux 6.12.60-21 -- Port ARM patches to v6.12 and include new patch for reporting guest crashes -- the VMware hypervisor -* Tue Feb 10 2026 Guruswamy Basavaiah 6.12.60-20 -- HCX patches ported to 6.12 kernel -* Fri Feb 06 2026 Keerthana K 6.12.60-19 -- Update canister version to 6.12.60-18 -* Thu Feb 05 2026 Brennan Lamoreaux 6.12.60-18 -- Improve FIPS canister matching plugin -* Tue Feb 03 2026 Ankit Jain 6.12.60-17 -- Add viomem kernel module -* Tue Feb 03 2026 Brennan Lamoreaux 6.12.60-16 -- Track internal/external requests to jitterentropy -* Mon Feb 02 2026 Srinidhi Rao 6.12.60-15 -- Enable CONFIG_TDX_GUEST_DRIVER required for CoCo. -* Thu Jan 22 2026 Keerthana K 6.12.60-14 -- Update canister version to 6.12.60-13 -* Thu Jan 15 2026 Alexey Makhalov 6.12.60-13 -- .config: added security hardened changes. -- canister_build: official build of the canister to include previous fix. -* Mon Jan 12 2026 Keerthana K 6.12.60-12 -- canister_build: Fix UAF (req->iv) in seqiv -* Wed Jan 07 2026 Keerthana K 6.12.60-11 -- Update jitterentropy driver names in canister_algs list -* Sat Jan 03 2026 Guruswamy Basavaiah 6.12.60-10 -- Introduce /sys/kernel/vmgenid -* Fri Jan 02 2026 Guruswamy Basavaiah 6.12.60-9 -- Enable CONFIG_NFT_FIB_IPV4 and CONFIG_NFT_FIB_IPV6 -* Mon Dec 29 2025 Guruswamy Basavaiah 6.12.60-8 -- Disable CONFIG_GCC_PLUGIN_LATENT_ENTROPY -* Mon Dec 22 2025 Kuntal Nayak 6.12.60-7 -- Fix SBAT validation order -* Fri Dec 19 2025 Guruswamy Basavaiah 6.12.60-6 -- Disable unique naming for *.ko.debug to make crash utility happy -* Fri Dec 12 2025 Kuntal Nayak 6.12.60-5 -- Inject photon KM certificate to trusted keyring -* Fri Dec 12 2025 Ankit Jain 6.12.60-4 -- Consuming canister. -* Thu Dec 11 2025 Ankit Jain 6.12.60-3 -- Remove module.h and other related metadata from aes/sha256.c -* Thu Dec 04 2025 Guruswamy Basavaiah 6.12.60-2 -- Enable CONFIG_ARM64_ERRATUM_3194386 -* Thu Dec 04 2025 Srinidhi Rao 6.12.60-1 -- Update to version 6.12.60. -* Wed Dec 03 2025 Ankit Jain 6.12.57-9 -- canister: Move out lib/crypto/{mpi/memneq/utils/gf128mul} of boundry -* Mon Dec 01 2025 Guruswamy Basavaiah 6.12.57-8 -- Enable CONFIG_GVE for gVNIC support -* Mon Dec 01 2025 Srinidhi Rao 6.12.57-7 -- Add VAES based alsos to canister approved list. -* Tue Nov 25 2025 Shivani Agarwal 6.12.57-6 -- Add kat_build flag for CMVP demo, Remove patch for allow external IVs for ACVP -* Tue Nov 25 2025 Guruswamy Basavaiah 6.12.57-5 -- Keep .BTF section in kernel modules -* Mon Nov 24 2025 Ankit Jain 6.12.57-4 -- Revert: canister: adding asn1_decoder library -* Fri Nov 14 2025 Brennan Lamoreaux 6.12.57-3 -- Add jitterentropy_rng_proxy -* Thu Nov 13 2025 Ankit Jain 6.12.57-2 -- Make lib/digsig to use lib SHA1 instead of crypto shash API -* Tue Nov 11 2025 Srinidhi Rao 6.12.57-1 -- Update to version 6.12.57 -* Tue Nov 11 2025 Ankit Jain 6.12.41-24 -- Removed '__SCT__cond_resched' symbol from canister -* Thu Nov 06 2025 Srinidhi Rao 6.12.41-23 -- Introduce new printk wrapper for FIPS canister. -* Thu Oct 30 2025 Ankit Jain 6.12.41-22 -- Moving rfc4543 of gcm out of canister boundry. -- Removed all approved/non-approved log indicators. -* Mon Oct 27 2025 Alexey Makhalov 6.12.41-21 -- Consume a canister binary via RPM dependency -* Fri Oct 24 2025 Guruswamy Basavaiah 6.12.41-20 -- perf: add patch to collect off-cpu sample -* Mon Oct 13 2025 Ankit Jain 6.12.41-19 -- Moving asn1-decoder API into canister boundry. -- Restore rsa-pkcs1pad encrypt/decrypt in rsa-pkcs1pad.c, disallow in fips mode -- Make sha1 combinations as fips_allowed=0 for self-test -* Mon Oct 06 2025 Alexey Makhalov 6.12.41-18 -- Canister: use __NO_FORTIFY and use memcpy as is -* Tue Sep 30 2025 Alexey Makhalov 6.12.41-17 -- Cleanup canister usage/build patch sets -* Tue Sep 30 2025 Alexey Makhalov 6.12.41-16 -- fips-canister: go back to tarball as the only way to preserve unstripped - fips_canister.o -* Mon Sep 29 2025 Ankit Jain 6.12.41-15 -- Moving MPI library API inside canister -* Mon Sep 29 2025 Shivani Agarwal 6.12.41-14 -- crypto: zero initialize memory allocated via sock_kmalloc -* Fri Sep 26 2025 Alexey Makhalov 6.12.41-13 -- fips-canister: prepare for RPM consumption instead of a tarball -* Fri Sep 26 2025 Alexey Makhalov 6.12.41-12 -- Canister: Perform partial relocation for local symbols -* Mon Sep 22 2025 Brennan Lamoreaux 6.12.41-11 -- Totally block external IVs for gcm(aes) -* Thu Sep 18 2025 Ajay Kaher 6.12.41-10 -- Fixes for vmwnet3 driver -* Wed Sep 17 2025 Alexey Makhalov 6.12.41-9 -- Canister: Move crypto_inc to lib/crypto/utils.c -* Wed Sep 17 2025 Alexey Makhalov 6.12.41-8 -- Canister: Move shasum helpers to the canister -* Thu Sep 11 2025 Srinidhi Rao 6.12.41-7 -- Select jitterentropy mem size as 32KB -- Disable jent_loop_shuffle in Jitterentropy. -- Add support for OSR(max) calculation. -* Thu Sep 11 2025 Alexey Makhalov 6.12.41-6 -- Canister: Add ghasg accelerator and lib/crypto utils -- Canister: fix shasum accelerators inclusion -- Canister: creation and integrity ehnancements -* Wed Sep 10 2025 Alexey Makhalov 6.12.41-5 -- Canister: introduce straight-line-speculation mitigation -* Mon Sep 08 2025 Shivani Agarwal 6.12.41-4 -- Resolve random EBUSY status for RSA signature verification test -* Mon Aug 25 2025 Shivani Agarwal 6.12.41-3 -- Removed rsa, cfb(aes) and added ecdsa-nist-p521 to tamper alg_list, -- Added HMAC and HASH DRBGs using SHA-384 in FIPS mode -* Thu Aug 21 2025 Alexey Makhalov 6.12.41-2 -- Add shasums accelerators -- Speedup algos registration in non-FIPS mode -* Thu Aug 14 2025 Srinidhi Rao 6.12.41-1 -- Update to version 6.12.41 -* Tue Aug 5 2025 Brennan Lamoreaux 6.12.34-9 -- Convert ACVP printk to pr_debug -* Mon Jul 28 2025 Brennan Lamoreaux 6.12.34-8 -- Convert canister structure spinlock fields to static memory -* Thu Jul 24 2025 Alexey Makhalov 6.12.34-7 -- Fix KAT build -- Spec clean up around fips macros -* Fri Jul 18 2025 Srinidhi Rao 6.12.34-6 -- Add sample collection support for Jitterentropy. -* Wed Jul 16 2025 Brennan Lamoreaux 6.12.34-5 -- Implement structure member type check within GCC plugins. Obsoletes -- old structure comparator test. -* Tue Jul 15 2025 Vamsi Krishna Brahmajosyula 6.12.34-4 -- linux: Use canister 6.12.34-3 -* Fri Jul 11 2025 Vamsi Krishna Brahmajosyula 6.12.34-3 -- Pending ECB move changes -* Thu Jul 03 2025 Alexey Makhalov 6.12.34-2 -- Move ecb out of canister -- Clean up and reorder SREL type & addon combinations -- Add readline-devel as a build requirement for tools -* Fri Jun 27 2025 Srinidhi Rao 6.12.34-1 -- Upgrade linux kernel to version 6.12.34. -* Wed Jun 25 2025 Vamsi Krishna Brahmajosyula 6.12.1-19 -- linux: Use canister version 6.12.1-18.ph5 -* Tue Jun 17 2025 Vamsi Krishna Brahmajosyula 6.12.1-18 -- Move sha1 functions out of canister boundry -- Do not register sha1 to crypt api when fips is enabled -* Fri Jun 13 2025 Brennan Lamoreaux 6.12.1-17 -- Introduce FIPS canister plugins -* Tue Jun 03 2025 Srinidhi Rao 6.12.1-16 -- Changes to Jitterentropy. -* Thu May 15 2025 Ankit Jain 6.12.1-15 -- Moved 'x86_cpu_id' struct access to fips canister wrapper -- Disable alloc_hook_tags if MEM_PROFILING is disabled -* Sat May 10 2025 Shreenidhi Shedi 6.12.1-14 -- Require coreutils and remove xml-security-c-devel from build requires -* Wed Apr 30 2025 Vamsi Krishna Brahmajosyula 6.12.1-13 -- Move rsa-pkcs1pad encrypt/decrypt functions out of canister boundry -- Fail rsa-pkcs1pad encrypt/decrypt in fips mode -- Use version-release for canister version, remove 6.0.0 -* Tue Apr 22 2025 Shivani Agarwal 6.12.1-12 -- Update canister binary v6.12.1-11 -* Thu Apr 17 2025 Shivani Agarwal 6.12.1-11 -- Remove essIV and echainIV from canister -* Tue Mar 25 2025 Ankit Jain 6.12.1-10 -- Sign kernel module using SHA3-512 hash algo -* Thu Mar 20 2025 Kuntal Nayak 6.12.1-9 -- Include SBAT and kexec patches -* Wed Mar 19 2025 Shivani Agarwal 6.12.1-8 -- Enable hmac(sha384) self-test -* Thu Mar 13 2025 Mukul Sikka 6.12.1-7 -- Release bump for SRP compliance -* Mon Mar 03 2025 Shivani Agarwal 6.12.1-6 -- Fix build error in acvp build and some spec refinement -* Mon Feb 24 2025 Keerthana K 6.12.1-5 -- Update fips canister to version 6.0.0-6.12.1-4 -- Improve fips canister struct definition check -* Mon Feb 24 2025 Keerthana K 6.12.1-4 -- Add Support for essiv echainiv in canister -* Mon Feb 24 2025 Keerthana K 6.12.1-3 -- Canister build for v6.12.x -* Thu Feb 20 2025 Srinidhi Rao 6.12.1-2 -- Enable cgroup_v1 support for mem & cpuset control groups. -* Tue Feb 04 2025 Srinidhi Rao 6.12.1-1 -- Upgrade to version 6.12.x. -* Thu Sep 12 2024 Ajay Kaher 6.6.28-2 -- Fix backward compatibility issue -* Thu Aug 29 2024 Srinidhi Rao 6.6.28-1 -- Upgrade to version 6.6.x. -* Fri May 17 2024 Srish Srinivasan 6.1.83-6 -- Re-enable CONFIG_SECURITY_SELINUX_DEVELOP to fix boot time regressions - in stig hardened systems. -* Fri May 17 2024 Srish Srinivasan 6.1.83-5 -- linux-generic will now obsolete and provide linux-secure as linux-secure - has been merged into linux-generic. This will ensure tdnf update on - Photon 5.0 is handled gracefully. -* Mon Apr 29 2024 Roye Eshed 6.1.83-4 -- Fix for CVE-2023-52586 by disabling CONFIG_DRM_MSM -* Mon Apr 29 2024 Vamsi Krishna Brahmajosyula 6.1.83-3 -- Enable CONFIG_ATA_PIIX for ata/pata intel SFF drivers replacing legacy IDE drivers -* Mon Apr 29 2024 Kuntal Nayak 6.1.83-2 -- Patched CVE-2024-26643 -* Mon Apr 29 2024 Keerthana K 6.1.83-1 -- Update to version 6.1.83 -- Fix CVE-2024-26642 -* Mon Apr 29 2024 Kuntal Nayak 6.1.81-5 -- Update SBAT verification -* Mon Apr 29 2024 Brennan Lamoreaux 6.1.81-4 -- Fix CVE-2024-52452 -* Mon Apr 29 2024 Ajay Kaher 6.1.81-3 -- Fix CVE-2023-52585 -* Mon Apr 29 2024 Srish Srinivasan 6.1.81-2 -- Patched CVE-2024-26585 -* Mon Apr 29 2024 Srish Srinivasan 6.1.81-1 -- Update to version 6.1.81, patched CVE-2024-26584 -* Mon Apr 29 2024 Guruswamy Basavaiah 6.1.79-2 -- Fixes CVE-2024-23307 and CVE-2024-22099 -* Mon Apr 29 2024 Vamsi Krishna Brahmajosyula 6.1.79-1 -- Update to version 6.1.79 -* Mon Apr 29 2024 Shivani Agarwal 6.1.77-1 -- Update to version 6.1.77 -* Mon Apr 29 2024 Ajay Kaher 6.1.75-1 -- Update to version 6.1.75 -* Mon Apr 29 2024 Guruswamy Basavaiah 6.1.70-6 -- Fix CVE-2023-6915 -* Mon Apr 29 2024 Bryan Tan 6.1.70-5 -- Fix refcount underflow in vsock -* Mon Apr 29 2024 Ajay Kaher 6.1.70-4 -- Fix CVE-2024-0340 -* Mon Apr 29 2024 Kuntal Nayak 6.1.70-3 -- Fix CVE-2023-39191 -* Mon Apr 29 2024 Kuntal Nayak 6.1.70-2 -- Fix CVE-2023-5633 -* Mon Apr 29 2024 Ashwin Dayanand Kamat 6.1.70-1 -- Update to version 6.1.70 -* Mon Apr 29 2024 Srish Srinivasan 6.1.62-13 -- print kernel crypto API return status for LKCM5 demo -- move all the ACVP related patches under a dedicated directory called - acvp_patches -* Mon Apr 22 2024 Keerthana K 6.1.62-12 -- Port secure kernel changes to generic -* Tue Mar 26 2024 Ashwin Dayanand Kamat 6.1.62-11 -- Fix proc_sched_rt01 ltp testcase failure -* Mon Feb 12 2024 Srish Srinivasan 6.1.62-10 -- Update canister version to 5.0.0-6.1.75-2 -* Fri Feb 02 2024 Shivani Agarwal 6.1.62-9 -- Enable CONFIG_PROC_EVENTS -* Wed Dec 20 2023 Keerthana K 6.1.62-8 -- Update canister to 5.0.0-6.1.62-13 -* Wed Dec 20 2023 Keerthana K 6.1.62-7 -- FIPS: Add log messages for approved and non-approved services -- Remove fips=2 logic -* Wed Dec 20 2023 Keerthana K 6.1.62-6 -- Added self-tests for rsa-pkcs1pad in combination with sha1, sha224, sha384 and sha512 -* Wed Dec 20 2023 Keerthana K 6.1.62-5 -- Update canister to 5.0.0-6.1.62-7 -* Wed Dec 20 2023 Keerthana K 6.1.62-4 -- Update canister to 5.0.0-6.1.62-2 -* Wed Dec 20 2023 Vamsi Krishna Brahmajosyula 6.1.62-3 -- Fix RSA self tests -* Wed Nov 29 2023 Brennan Lamoreaux 6.1.62-2 -- Fix for CVE-2023-2176 -* Wed Nov 29 2023 Ankit Jain 6.1.62-1 -- Update to version 6.1.62 -* Wed Nov 29 2023 Ankit Jain 6.1.60-4 -- Fix for CVE-2023-0597 -* Wed Nov 29 2023 Srish Srinivasan 6.1.60-3 -- Remove kat_build and its associated spec changes -* Wed Nov 29 2023 Srinidhi Rao 6.1.60-2 -- Jitterentropy sample collection support in ACVP Build. -* Wed Nov 29 2023 Vamsi Krishna Brahmajosyula 6.1.60-1 -- Upgrade to 6.1.60 -* Wed Nov 29 2023 Alexey Makhalov 6.1.56-9 -- Add .sbat section for bzImage -- Introduce SBAT verificaion in addition to signature on kexec -* Wed Nov 29 2023 Srish Srinivasan 6.1.56-8 -- Upgrade canister to 5.0.0-6.1.56-6 -* Wed Nov 29 2023 Srish Srinivasan 6.1.56-7 -- Added cts to crypto self-tests -- Removed rsa(pkcs1pad, sha256), rsa(pkcs1pad, sha512), - cbc, and ctr from crypto self-tests -- Added ECC pubkey generation and verification success messages -* Wed Nov 29 2023 Keerthana K 6.1.56-6 -- Modified ecdh-nist-p384 vector to generate ECC keypair -* Wed Nov 29 2023 Vamsi Krishna Brahmajosyula 6.1.56-5 -- Upgrade canister to 5.0.0-6.1.56-3 -* Wed Nov 29 2023 Srish Srinivasan 6.1.56-4 -- Adding support for ACVP build -- Added jitterentropy implementation of SHA3-256 -* Wed Nov 29 2023 Srish Srinivasan 6.1.56-3 -- Add missing self-test vector for ecdh-nist-p384 with genkey -* Wed Nov 29 2023 Srinidhi Rao 6.1.56-2 -- Jitterentropy wrapper changes. -* Wed Nov 29 2023 Vamsi Krishna Brahmajosyula 6.1.56-1 -- Upgrade to 6.1.56 -* Wed Nov 29 2023 Vamsi Krishna Brahmajosyula 6.1.53-6 -- Fix for CVE-2023-42754 -* Wed Nov 29 2023 Keerthana K 6.1.53-5 -- Enable fips and update canister binary version 5.0.0-6.1.53-4 -- Removed jent_lock struct from ignore list of check_fips_canister -* Wed Nov 29 2023 Keerthana K 6.1.53-4 -- Add pkcs1pad test vectors in crytpo_self_test module -* Thu Nov 23 2023 Keerthana K 6.1.53-3 -- Fix CVE-2023-42756 -* Thu Nov 23 2023 Keerthana K 6.1.53-2 -- Fix for CVE-2023-42755 -* Thu Nov 23 2023 Roye Eshed 6.1.53-1 -- Update to version 6.1.53 -* Thu Nov 23 2023 Ajay Kaher 6.1.45-7 -- Fix: net: roundup issue in kmalloc_reserve() -* Thu Nov 23 2023 Brennan Lamoreaux 6.1.45-6 -- Move all prep to %prep section -* Thu Nov 23 2023 Srish Srinivasan 6.1.45-5 -- LKCM 5.0 specific changes to crypto self-tests and tcrypt -* Thu Nov 23 2023 Keerthana K 6.1.45-4 -- Build with jitterentropy v3.4.1 -* Thu Nov 23 2023 Keerthana K 6.1.45-3 -- Update fips_canister version 6.1.45-3 -* Wed Nov 22 2023 Ankit Jain 6.1.45-2 -- Fix for CVE-2023-28464 -* Wed Nov 22 2023 Ajay Kaher 6.1.45-1 -- Update to version 6.1.45 -* Wed Nov 22 2023 Srish Srinivasan 6.1.41-4 -- Enable CONFIG_DEBUG_INFO_BTF=y -* Wed Nov 22 2023 Kuntal Nayak 6.1.41-3 -- Enable Kconfig CONFIG_KEXEC_FILE for kexec signature verify -* Wed Nov 22 2023 Ajay Kaher 6.1.41-2 -- Fix: unconditional preserve CR4.MCE -* Wed Nov 22 2023 Ashwin Dayanand Kamat 6.1.41-1 -- Update to version 6.1.41 -* Wed Nov 22 2023 Ashwin Dayanand Kamat 6.1.37-1 -- Update to version 6.1.37 -* Wed Nov 22 2023 Brennan Lamoreaux 6.1.32-1 -- Update to version 6.1.32 -* Wed Nov 22 2023 Guruswamy Basavaiah 6.1.28-5 -- disable kconfig CONFIG_RAID6_PQ_BENCHMARK -* Sun Nov 19 2023 Shreenidhi Shedi 6.1.28-4 -- Bump version as a part of openssl upgrade -* Tue Oct 03 2023 Kuntal Nayak 6.1.28-3 -- Kconfig to lockdown kernel in UEFI Secure Boot -* Sat Sep 23 2023 Guruswamy Basavaiah 6.1.28-2 -- Cherry pick performance over security option for RETBleed (pos=1) -- patch from Photon 4.0 -* Wed Sep 20 2023 Ankit Jain 6.1.28-1 -- Update to version 6.1.28 -* Mon Jul 17 2023 Keerthana K 6.1.10-15 -- Use canister version 5.0.0-6.1.37-2 -* Tue Jul 11 2023 Shreenidhi Shedi 6.1.10-14 -- Bump version as a part of elfutils upgrade -* Fri Apr 28 2023 Shreenidhi Shedi 6.1.10-13 -- Remove dracut & initramfs from requires -* Wed Apr 26 2023 Shreenidhi Shedi 6.1.10-12 -- Remove rpi fan driver patch -* Wed Apr 05 2023 Ajay Kaher 6.1.10-11 -- perf: remove libunwind dependency -* Fri Mar 31 2023 Srivatsa S. Bhat (VMware) 6.1.10-10 -- Expose Photon kernel macros to simplify building out-of-tree drivers. -* Thu Mar 30 2023 Brennan Lamoreaux 6.1.10-9 -- Update drivers -- iavf: 4.8.2 -- ice: 1.11.14 -- i40e: 2.22.18 -* Sun Mar 26 2023 Vamsi Krishna Brahmajosyula 6.1.10-8 -- Use canister version 5.0.0-6.1.10-8 -* Tue Mar 21 2023 Shreenidhi Shedi 6.1.10-7 -- Fix initramfs trigger -* Thu Mar 16 2023 Keerthana K 6.1.10-6 -- Enable FIPS canister binary usage -* Tue Mar 07 2023 Him Kalyan Bordoloi 6.1.10-5 -- Add ENA and EFA drivers to ARM build -* Tue Mar 07 2023 Shreenidhi Shedi 6.1.10-4 -- Fix initrd driver list for aarch64 -* Thu Mar 02 2023 Shreenidhi Shedi 6.1.10-3 -- Fix initrd generation logic -- Add dracut, initramfs to requires -* Fri Feb 24 2023 Ankit Jain 6.1.10-2 -- Exclude iavf.conf -* Wed Feb 22 2023 Bo Gan 6.1.10-1 -- Update to 6.1.10 -* Tue Feb 21 2023 Srivatsa S. Bhat (VMware) 6.0.7-11 -- Enable turbostat to work in the guest on VMware hypervisor. -* Tue Feb 21 2023 Srivatsa S. Bhat (VMware) 6.0.7-10 -- Update i40e driver to v2.19.3 to prevent kernel warnings -* Mon Feb 20 2023 Ajay Kaher 6.0.7-9 -- exclude man dir from linux-tools -* Thu Feb 02 2023 Shreenidhi Shedi 6.0.7-8 -- Fix requires -* Wed Jan 25 2023 Ashwin Dayanand Kamat 6.0.7-7 -- Enable CONFIG_PCI_PF_STUB -* Tue Jan 17 2023 Him Kalyan Bordoloi 6.0.7-6 -- Depricate linux-aws kernel flavor -* Fri Jan 13 2023 Srivatsa S. Bhat (VMware) 6.0.7-5 -- Fix IRQ affinities of i40e, iavf and ice drivers -* Mon Jan 09 2023 Srivatsa S. Bhat (VMware) 6.0.7-4 -- Update Intel drivers i40e to v2.16.11, iavf to v4.5.3 and ice to v1.9.11 -* Fri Jan 06 2023 Srivatsa S. Bhat (VMware) 6.0.7-3 -- Port patch to allow disabling PCI resets from vfio_pci driver to 6.0 -- Move the module parameter disable_resets from vfio_pci to -- vfio_pci_core module, to make it work with kernel 6.0. -* Fri Jan 06 2023 Vamsi Krishna Brahmajosyula 6.0.7-2 -- Bump up due to change in elfutils -* Tue Dec 20 2022 Bo Gan 6.0.7-1 -- Update to 6.0.7 -- Enable PREEMPT_DYNAMIC -- Enable extra Dell platform drivers. -- Enable security configs, RANDOMIZE_KSTACK_OFFSET and others. -- Change from SLAB to SLUB -- aarch64/config: match x86 on non-arch specific setting. -- aarch64/config: don't set CAVIUM_ERRATUM_23154 and wait for ESX support -* Mon Dec 19 2022 Dweep Advani 5.10.142-5 -- Ignore warnings to keep building tools -* Mon Oct 31 2022 Prashant S Chauhan 5.10.142-4 -- Dont throw error for supported deprecated modules of py311 -* Thu Oct 20 2022 Vamsi Krishna Brahmajosyula 5.10.142-3 -- Fix build with latest toolchain -* Wed Sep 28 2022 Srivatsa S. Bhat (VMware) 5.10.142-2 -- Replace rpm macro 'name' with 'linux' to be consistent with other flavors. -* Wed Sep 28 2022 Srivatsa S. Bhat (VMware) 5.10.142-1 -- Update to version 5.10.142 -* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.132-1 -- Update to version 5.10.132 -* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.118-10 -- Backport fixes for CVE-2022-0500 -* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.118-9 -- Fix for CVE-2022-2585, CVE-2022-2586 and CVE-2022-2588 -* Tue Sep 27 2022 Srivatsa S. Bhat (VMware) 5.10.118-8 -- Update iavf driver to v4.4.2 -- Update ice driver to v1.8.3 -* Mon Sep 26 2022 Srivatsa S. Bhat (VMware) 5.10.118-7 -- .config: enable CONFIG_NET_ACT_SIMP -* Mon Sep 26 2022 Srivatsa S. Bhat (VMware) 5.10.118-6 -- .config: enable CONFIG_X86_CPU_RESCTRL -* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-5 -- Enable cgroup v1 stats -- .config: enable PERCPU_STATS -* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-4 -- Avoid TSC recalibration -* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-3 -- Fix for CVE-2022-21505 -* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-2 -- VMCI patches & configs -* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.118-1 -- Update to version 5.10.118 -* Fri Sep 23 2022 Srivatsa S. Bhat (VMware) 5.10.109-4 -- Fix for CVE-2022-1966, CVE-2022-1972 -* Thu Sep 22 2022 Srivatsa S. Bhat (VMware) 5.10.109-3 -- Fix for CVE-2022-21499 -* Thu Sep 22 2022 Srivatsa S. Bhat (VMware) 5.10.109-2 -- Fix for CVE-2022-29582 -* Wed Sep 21 2022 Srivatsa S. Bhat (VMware) 5.10.109-1 -- Update to version 5.10.109 -* Tue Sep 20 2022 Srivatsa S. Bhat (VMware) 5.10.103-4 -- Fix for CVE-2022-1016 -* Tue Sep 20 2022 Srivatsa S. Bhat (VMware) 5.10.103-3 -- Fix SEV and Hypercall alternative inst. patches -* Tue Sep 20 2022 Shreenidhi Shedi 5.10.103-2 -- Add bpftool subpackage -* Thu Sep 15 2022 Srivatsa S. Bhat (VMware) 5.10.103-1 -- Update to version 5.10.103 -* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-5 -- Fix for CVE-2022-0435 -* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-4 -- Fix for CVE-2022-0492 -* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-3 -- Fix for CVE-2022-22942 -* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-2 -- Fix CVE-2022-0330 -* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.93-1 -- Update to version 5.10.93 -* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.83-5 -- Fix CVE-2021-4155 and CVE-2021-4204 -* Wed Sep 14 2022 Srivatsa S. Bhat (VMware) 5.10.83-4 -- Enable crypto related configs in aarch64 similar to x86_64 -- crypto_self_test and broken kattest module enhancements -* Tue Sep 13 2022 Srivatsa S. Bhat (VMware) 5.10.83-3 -- mm: fix percpu allocation for memoryless nodes -- pvscsi: fix disk detection issue -* Tue Sep 13 2022 Srivatsa S. Bhat (VMware) 5.10.83-2 -- remove tmem, lvm in add-drivers list -- lvm drivers are built as part of dm-mod -- tmem module no longer exists -* Mon Sep 12 2022 Srivatsa S. Bhat (VMware) 5.10.83-1 -- Update to version 5.10.83 -* Mon Sep 12 2022 Srivatsa S. Bhat (VMware) 5.10.78-14 -- .config: Enable eBPF net packet filtering support. -* Mon Aug 08 2022 Shreenidhi Shedi 5.10.78-13 -- Scriptlets fixes and improvements -* Wed Jul 20 2022 Tejaswini Jayaramaiah 5.10.78-12 -- Enable CONFIG_CGROUP_BPF in config to run containers with cgroup v2 -* Wed Jul 13 2022 Srivatsa S. Bhat (VMware) 5.10.78-11 -- Add PCI quirk to allow multiple devices under the same virtual -- PCI bridge to be put into separate IOMMU groups. -* Tue Jul 12 2022 Sharan Turlapati 5.10.78-10 -- Allow PCI resets to be disabled from vfio_pci -* Wed Jun 29 2022 Keerthana K 5.10.78-9 -- Reduce FIPS canister memory footprint by disabling CONFIG_KALLSYMS_ALL -- Add only fips_canister-kallsyms to vmlinux instead of all symbols -* Fri Jun 24 2022 Shreenidhi Shedi 5.10.78-8 -- Fix debug_package macro usage while adding vmlinux to debuginfo rpm -* Tue Jun 14 2022 Brennan Lamoreaux 5.10.78-7 -- Enable CONFIG_LIVEPATCH, which requires enabling ftrace, and related. -* Tue Apr 05 2022 Shreenidhi Shedi 5.10.78-6 -- Enable CONFIG_EXT2_FS_XATTR & related parameters -* Tue Jan 25 2022 Alexey Makhalov 5.10.78-5 -- .config: enable squashfs module, enable crypto user api rng. -* Thu Nov 25 2021 Ashwin Dayanand Kamat 5.10.78-4 -- Disable md5 algorithm for sctp if fips is enabled. -* Fri Nov 19 2021 Keerthana K 5.10.78-3 -- Add arm64 hypervisor detection and kmsg dumper -* Thu Nov 11 2021 Satya Naga Vasamsetty 5.10.78-2 -- compile with openssl 3.0.0 -* Mon Nov 08 2021 Vikash Bansal 5.10.78-1 -- Update to version 5.10.78 -* Thu Oct 28 2021 Sharan Turlapati 5.10.75-1 -- Update to version 5.10.75 -* Thu Sep 09 2021 Alexey Makhalov 5.10.61-2 -- .config enable CONFIG_MOUSE_PS2_VMMOUSE and CONFIG_INPUT_UINPUT -- Enable sta by default -* Fri Aug 27 2021 Ankit Jain 5.10.61-1 -- Update to version 5.10.61 -* Wed Aug 18 2021 Keerthana K 5.10.52-2 -- Update ice driver to v1.6.4 -- Update i40e driver to v2.15.9 -- Update iavf driver to v4.2.7 -* Fri Jul 23 2021 Him Kalyan Bordoloi 5.10.52-1 -- Update to version 5.10.52 -* Thu Jul 15 2021 Him Kalyan Bordoloi 5.10.46-2 -- Fix for CVE-2021-33909 -* Mon Jun 28 2021 Sharan Turlapati 5.10.46-1 -- Update to version 5.10.46 -* Tue Jun 22 2021 Sharan Turlapati 5.10.42-3 -- Fix for CVE-2021-3609 -* Thu Jun 10 2021 Keerthana K 5.10.42-2 -- Added script to check structure compatibility between fips_canister.o and vmlinux. -* Thu Jun 03 2021 Keerthana K 5.10.42-1 -- Update to version 5.10.42 -- Remove XR usb driver support -- .config: Enable CONFIG_FANOTIFY_ACCESS_PERMISSIONS -* Wed Jun 02 2021 Keerthana K 5.10.35-4 -- Fix for CVE-2021-3573 -* Thu May 20 2021 Ajay Kaher 5.10.35-3 -- Add Rpi fan driver -* Thu May 20 2021 Ajay Kaher 5.10.35-2 -- Fix for CVE-2021-3564 -* Mon May 17 2021 Ajay Kaher 5.10.35-1 -- Update to version 5.10.35 -* Thu May 13 2021 Sharan Turlapati 5.10.25-10 -- Fix for CVE-2021-23133 -* Tue May 11 2021 Ankit Jain 5.10.25-9 -- .config: Enable MLX5_INFINIBAND -* Tue May 11 2021 Srivatsa S. Bhat (VMware) 5.10.25-8 -- Fix CVE-2020-26147, CVE-2020-24587, CVE-2020-24586, CVE-2020-24588, -- CVE-2020-26145, CVE-2020-26141 -* Tue May 11 2021 Srivatsa S. Bhat (VMware) 5.10.25-7 -- Fix CVE-2021-3489, CVE-2021-3490, CVE-2021-3491 -* Tue May 04 2021 Sharan Turlapati 5.10.25-6 -- Remove buf_info from device accessible structures in vmxnet3 -* Thu Apr 29 2021 Alexey Makhalov 5.10.25-5 -- Update canister binary. -- use jent by drbg and ecc. -- Enable hmac(sha224) self test and broket KAT test. -* Thu Apr 22 2021 Keerthana K 5.10.25-4 -- Remove hmac(sha224) test from broken kat test. -* Mon Apr 19 2021 Sharan Turlapati 5.10.25-3 -- Fix for CVE-2021-23133 -* Thu Apr 15 2021 Srinidhi Rao 5.10.25-2 -- Fix for CVE-2021-29154 -* Mon Mar 22 2021 Him Kalyan Bordoloi 5.10.25-1 -- Update to version 5.10.25 -* Sun Mar 21 2021 Alexey Makhalov 5.10.21-3 -- Do not execute some tests twice -- Support future disablement of des3 -- Do verbose build -- Canister update. -* Mon Mar 15 2021 Srinidhi Rao 5.10.21-2 -- Use jitterentropy rng instead of urandom in rng module. -* Mon Mar 08 2021 Vikash Bansal 5.10.21-1 -- Update to version 5.10.21 -* Mon Mar 01 2021 Alexey Makhalov 5.10.4-17 -- FIPS canister update -* Fri Feb 19 2021 Srivatsa S. Bhat (VMware) 5.10.4-16 -- Fix /boot/photon.cfg symlink when /boot is a separate partition. -* Fri Feb 19 2021 Ajay Kaher 5.10.4-15 -- Added SEV-ES improvement patches -* Thu Feb 18 2021 Ajay Kaher 5.10.4-14 -- Enable CONFIG_WDAT_WDT -* Thu Feb 18 2021 Ajay Kaher 5.10.4-13 -- lower the loglevel for floppy driver -* Thu Feb 18 2021 Sharan Turlapati 5.10.4-12 -- Enable CONFIG_IFB -* Wed Feb 17 2021 Ankit Jain 5.10.4-11 -- Added latest out of tree version of Intel ice driver -* Tue Feb 16 2021 Alexey Makhalov 5.10.4-10 -- Fix perf compilation issue with gcc-10.2.0 for aarch64 -* Mon Feb 15 2021 Keerthana K 5.10.4-9 -- Added crypto_self_test and kattest module. -- These patches are applied when kat_build is enabled. -* Wed Feb 03 2021 Him Kalyan Bordoloi 5.10.4-8 -- Update i40e driver to v2.13.10 -- Add out of tree iavf driver -- Enable CONFIG_NET_TEAM -* Thu Jan 28 2021 Alexey Makhalov 5.10.4-7 -- Use secure FIPS canister. -* Mon Jan 25 2021 Ankit Jain 5.10.4-6 -- Enabled CONFIG_WIREGUARD -* Fri Jan 22 2021 Keerthana K 5.10.4-5 -- Build kernel with FIPS canister. -* Wed Jan 20 2021 Alexey Makhalov 5.10.4-4 -- Handle module.lds for aarch64 in the same way as for x86_64 -* Wed Jan 13 2021 Sharan Turlapati 5.10.4-3 -- Remove traceevent/plugins from linux-tools -* Mon Jan 11 2021 Bo Gan 5.10.4-2 -- Fix aarch64 build failure -* Mon Jan 04 2021 Bo Gan 5.10.4-1 -- Update to 5.10.4 -- Drop out-of-tree SEV-ES functional patches (already upstreamed). -* Wed Dec 09 2020 Ajay Kaher 5.9.0-9 -- To dynamic load Overlays adding of_configfs patches v5.9.y. -* Tue Dec 01 2020 Prashant S Chauhan 5.9.0-8 -- Added ami for arm support in linux generic, added multiple drivers -- in aarch64 to support aws ami -* Thu Nov 12 2020 Ajay Kaher 5.9.0-7 -- .config: support for floppy disk and ch341 usb to serial -* Wed Nov 11 2020 Tapas Kundu 5.9.0-6 -- Fix perf python script for compatibility with python 3.9 -* Tue Nov 10 2020 Keerthana K 5.9.0-5 -- Fix CVE-2020-8694 -* Fri Nov 06 2020 Keerthana K 5.9.0-4 -- Fix CVE-2020-25704 -* Tue Nov 03 2020 Srinidhi Rao 5.9.0-3 -- Remove the support of fipsify and hmacgen -* Tue Oct 27 2020 Piyush Gupta 5.9.0-2 -- Fix aarch64 build failure due to missing CONFIG_FB_ARMLCD -* Mon Oct 19 2020 Bo Gan 5.9.0-1 -- Update to 5.9.0 -* Wed Sep 30 2020 Srivatsa S. Bhat (VMware) 5.9.0-rc7.1 -- Update to version 5.9.0-rc7 -* Mon Sep 21 2020 Bo Gan 5.9.0-rc4.1 -- Update to 5.9.0-rc4 -- AMD SEV-ES Support -- RPI4 Support -- config_common: Reduce linked-in modules -- Drop NXP LS10XXa board support -* Tue Sep 08 2020 Satya Naga Vasamsetty 4.19.127-6 -- Fix build failure with binutils updated to 2.35 -* Wed Aug 05 2020 Sharan Turlapati 4.19.127-5 -- Enable CONFIG_TCP_CONG_BBR -* Wed Jul 29 2020 Alexey Makhalov 4.19.127-4 -- .config: add zram module -* Mon Jul 27 2020 Srivatsa S. Bhat (VMware) 4.19.127-3 -- Fix CVE-2020-14331 -* Fri Jul 17 2020 Srivatsa S. Bhat (VMware) 4.19.127-2 -- Fix aarch64 build failure due to missing i40e man pages. -* Tue Jun 23 2020 Keerthana K 4.19.127-1 -- Update to version 4.19.127 -* Tue Jun 16 2020 Him Kalyan Bordoloi 4.19.112-14 -- Add latest out of tree version of i40e driver -* Wed Jun 10 2020 Srivatsa S. Bhat (VMware) 4.19.112-13 -- Enable CONFIG_VFIO_NOIOMMU -* Tue Jun 09 2020 Alexey Makhalov 4.19.112-12 -- Add intel_sgx module (-drivers-intel-sgx subpackage) -* Fri Jun 05 2020 Ankit Jain 4.19.112-11 -- Enabled CONFIG_BINFMT_MISC -* Tue Jun 02 2020 Vikash Bansal 4.19.112-10 -- Add patch to fix CVE-2019-18885 -* Mon Jun 1 2020 Shreenidhi Shedi 4.19.112-9 -- Keep modules of running kernel till next boot -* Sat May 30 2020 Alexey Makhalov 4.19.112-8 -- .config: add gs_usb module -* Wed May 20 2020 Tapas Kundu 4.19.112-7 -- Added linux-python3-perf subpackage. -- Added turbostat and cpupower to tools for x86_64. -- linux-python3-perf replaces python3-perf. -* Fri May 15 2020 Him Kalyan Bordoloi 4.19.112-6 -- Add uio_pic_generic driver support in config -* Wed May 06 2020 Siddharth Chandrasekaran 4.19.112-5 -- Add patch to fix CVE-2020-10711 -* Wed Apr 29 2020 Keerthana K 4.19.112-4 -- Photon-checksum-generator version update to 1.1. -* Wed Apr 29 2020 Srivatsa S. Bhat (VMware) 4.19.112-3 -- Enable additional config options. -* Wed Apr 15 2020 Vikash Bansal 4.19.112-2 -- HMAC-SHA256 digest of hmac_generator module moved to hmacgen package -* Wed Apr 08 2020 Srivatsa S. Bhat (VMware) 4.19.112-1 -- Update to version 4.19.112 -* Tue Mar 31 2020 Vikash Bansal 4.19.104-2 -- hmac generation of crypto modules and initrd generation changes if fips=1 -* Wed Mar 25 2020 Vikash Bansal 4.19.104-1 -- Update to version 4.19.104 -* Mon Mar 23 2020 Alexey Makhalov 4.19.97-8 -- Fix perf compilation issue with binutils >= 2.34. -* Mon Mar 16 2020 Keerthana K 4.19.97-7 -- Adding Enhances depedency to hmacgen. -* Wed Mar 04 2020 Vikash Bansal 4.19.97-6 -- Backporting of patch continuous testing of RNG from urandom -* Tue Feb 25 2020 Ajay Kaher 4.19.97-5 -- Fix CVE-2019-16234 -* Tue Feb 11 2020 Keerthana K 4.19.97-4 -- Add photon-checksum-generator source tarball and remove hmacgen patch. -- Exclude hmacgen.ko from base package. -* Fri Jan 31 2020 Ajay Kaher 4.19.97-3 -- Move snd-bcm2835.ko to linux-drivers-sound rpm -* Wed Jan 29 2020 Keerthana K 4.19.97-2 -- Update tcrypt to test drbg_pr_sha256 and drbg_nopr_sha256. -- Update testmgr to add drbg_pr_ctr_aes256 test vectors. -* Fri Jan 17 2020 Srivatsa S. Bhat (VMware) 4.19.97-1 -- Update to version 4.19.97 -* Thu Jan 16 2020 Srinidhi Rao 4.19.87-6 -- Enable DRBG HASH and DRBG CTR support. -* Wed Jan 08 2020 Ajay Kaher 4.19.87-5 -- Enabled configs RTC_DRV_PL030, RTC_DRV_PL031 -* Fri Jan 03 2020 Keerthana K 4.19.87-4 -- Modify tcrypt to remove tests for algorithms that are not supported in photon. -- Added tests for DH, DRBG algorithms. -* Thu Jan 02 2020 Keerthana K 4.19.87-3 -- Update fips Kat tests patch. -* Mon Dec 09 2019 Alexey Makhalov 4.19.87-2 -- Cross compilation support -* Fri Dec 06 2019 Ajay Kaher 4.19.87-1 -- Update to version 4.19.87 -* Tue Dec 03 2019 Keerthana K 4.19.84-4 -- Adding hmac sha256/sha512 generator kernel module for fips. -* Tue Nov 26 2019 Ajay Kaher 4.19.84-3 -- Fix CVE-2019-19062, CVE-2019-19066, CVE-2019-19072, -- CVE-2019-19073, CVE-2019-19074, CVE-2019-19078 -* Mon Nov 18 2019 Alexey Makhalov 4.19.84-2 -- .config: infiniband support. -* Tue Nov 12 2019 Srivatsa S. Bhat (VMware) 4.19.84-1 -- Update to version 4.19.84 -- Fix CVE-2019-18814 -* Fri Nov 08 2019 Srivatsa S. Bhat (VMware) 4.19.82-1 -- Update to version 4.19.82 -* Thu Nov 07 2019 Jorgen Hansen (VMware) 4.19.79-3 -- Fix vsock QP detach with outgoing data -* Thu Oct 24 2019 Ajay Kaher 4.19.79-2 -- Enabled WiFi and BT config for Dell 5K. -* Tue Oct 15 2019 Ajay Kaher 4.19.79-1 -- Update to version 4.19.79 -- Fix CVE-2019-17133 -* Mon Oct 14 2019 Srivatsa S. Bhat (VMware) 4.19.76-5 -- Add megaraid_sas driver to initramfs -* Mon Oct 14 2019 Bo Gan 4.19.76-4 -- Enable IMA with SHA256 as default hash algorithm -* Thu Oct 10 2019 Srivatsa S. Bhat (VMware) 4.19.76-3 -- Add additional BuildRequires and Requires to fix issues with perf, related to -- interactive UI and C++ symbol demangling. Also update the last few perf python -- scripts in Linux kernel to use python3 syntax. -* Thu Oct 10 2019 Harinadh D 4.19.76-2 -- Adding lvm and dm-mod modules to support root as lvm -* Wed Oct 02 2019 Ajay Kaher 4.19.76-1 -- Update to version 4.19.76 -- Enable USB_SERIAL_PL2303 for aarch64 -* Mon Sep 30 2019 Srivatsa S. Bhat (VMware) 4.19.72-1 -- Update to version 4.19.72 -* Thu Sep 05 2019 Alexey Makhalov 4.19.69-3 -- Avoid oldconfig which leads to potential build hang -- Fix archdir usage -* Thu Sep 05 2019 Ajay Kaher 4.19.69-2 -- Adding SPI and Audio interfaces in rpi3 device tree -- Adding spi0 and audio overlays -- Copying rpi dt in /boot/broadcom as u-boot picks from here -* Fri Aug 30 2019 Alexey Makhalov 4.19.69-1 -- Update to version 4.19.69 -* Fri Aug 23 2019 Alexey Makhalov 4.19.65-4 -- NXP ls1046a frwy board support. -- config_aarch64: add fsl_dpaa2 support. -- fix fsl_dpaa_mac initialization issue. -* Wed Aug 14 2019 Raejoon Jung 4.19.65-3 -- Backport of Secure Boot UEFI certificate import from v5.2 -* Mon Aug 12 2019 Ajay Kaher 4.19.65-2 -- Fix config_aarch64 for v4.19.65 -* Tue Aug 06 2019 Alexey Makhalov 4.19.65-1 -- Update to version 4.19.65 -- Fix CVE-2019-1125 (SWAPGS) -* Tue Jul 30 2019 Ajay Kaher 4.19.52-7 -- Added of_configfs patches to dynamic load Overlays. -* Thu Jul 25 2019 Keerthana K 4.19.52-6 -- Fix postun scriplet. -* Thu Jul 11 2019 Keerthana K 4.19.52-5 -- Enable kernel configs necessary for BPF Compiler Collection (BCC). -* Wed Jul 10 2019 Srivatsa S. Bhat (VMware) 4.19.52-4 -- Deprecate linux-aws-tools in favor of linux-tools. -* Tue Jul 02 2019 Alexey Makhalov 4.19.52-3 -- Fix 9p vsock 16bit port issue. -* Thu Jun 20 2019 Tapas Kundu 4.19.52-2 -- Enabled CONFIG_I2C_CHARDEV to support lm-sensors -* Mon Jun 17 2019 Srivatsa S. Bhat (VMware) 4.19.52-1 -- Update to version 4.19.52 -- Fix CVE-2019-12456, CVE-2019-12379, CVE-2019-12380, CVE-2019-12381, -- CVE-2019-12382, CVE-2019-12378, CVE-2019-12455 -* Tue May 28 2019 Srivatsa S. Bhat (VMware) 4.19.40-3 -- Change default I/O scheduler to 'deadline' to fix performance issue. -* Tue May 14 2019 Keerthana K 4.19.40-2 -- Fix to parse through /boot folder and update symlink (/boot/photon.cfg) if -- mulitple kernels are installed and current linux kernel is removed. -* Tue May 07 2019 Ajay Kaher 4.19.40-1 -- Update to version 4.19.40 -* Thu Apr 11 2019 Srivatsa S. Bhat (VMware) 4.19.32-3 -- Update config_aarch64 to fix ARM64 build. -* Fri Mar 29 2019 Srivatsa S. Bhat (VMware) 4.19.32-2 -- Fix CVE-2019-10125 -* Wed Mar 27 2019 Srivatsa S. Bhat (VMware) 4.19.32-1 -- Update to version 4.19.32 -* Thu Mar 14 2019 Srivatsa S. Bhat (VMware) 4.19.29-1 -- Update to version 4.19.29 -* Tue Mar 05 2019 Ajay Kaher 4.19.26-1 -- Update to version 4.19.26 -* Thu Feb 21 2019 Him Kalyan Bordoloi 4.19.15-3 -- Fix CVE-2019-8912 -* Thu Jan 24 2019 Alexey Makhalov 4.19.15-2 -- Add WiFi (ath10k), sensors (i2c,spi), usb support for NXP LS1012A board. -* Tue Jan 15 2019 Srivatsa S. Bhat (VMware) 4.19.15-1 -- Update to version 4.19.15 -* Fri Jan 11 2019 Srinidhi Rao 4.19.6-7 -- Add Network support for NXP LS1012A board. -* Wed Jan 09 2019 Ankit Jain 4.19.6-6 -- Enable following for x86_64 and aarch64: -- Enable Kernel Address Space Layout Randomization. -- Enable CONFIG_SECURITY_NETWORK_XFRM -* Fri Jan 04 2019 Srivatsa S. Bhat (VMware) 4.19.6-5 -- Enable AppArmor by default. -* Wed Jan 02 2019 Alexey Makhalov 4.19.6-4 -- .config: added Compulab fitlet2 device drivers -- .config_aarch64: added gpio sysfs support -- renamed -sound to -drivers-sound -* Tue Jan 01 2019 Ajay Kaher 4.19.6-3 -- .config: Enable CONFIG_PCI_HYPERV driver -* Wed Dec 19 2018 Srinidhi Rao 4.19.6-2 -- Add NXP LS1012A support. -* Mon Dec 10 2018 Srivatsa S. Bhat (VMware) 4.19.6-1 -- Update to version 4.19.6 -* Fri Dec 07 2018 Alexey Makhalov 4.19.1-3 -- .config: added qmi wwan module -* Mon Nov 12 2018 Ajay Kaher 4.19.1-2 -- Fix config_aarch64 for 4.19.1 -* Mon Nov 05 2018 Srivatsa S. Bhat (VMware) 4.19.1-1 -- Update to version 4.19.1 -* Tue Oct 16 2018 Him Kalyan Bordoloi 4.18.9-5 -- Change in config to enable drivers for zigbee and GPS -* Fri Oct 12 2018 Ajay Kaher 4.18.9-4 -- Enable LAN78xx for aarch64 rpi3 -* Fri Oct 5 2018 Ajay Kaher 4.18.9-3 -- Fix config_aarch64 for 4.18.9 -- Add module.lds for aarch64 -* Wed Oct 03 2018 Srivatsa S. Bhat 4.18.9-2 -- Use updated steal time accounting patch. -- .config: Enable CONFIG_CPU_ISOLATION and a few networking options -- that got accidentally dropped in the last update. -* Mon Oct 1 2018 Srivatsa S. Bhat 4.18.9-1 -- Update to version 4.18.9 -* Tue Sep 25 2018 Ajay Kaher 4.14.67-2 -- Build hang (at make oldconfig) fix in config_aarch64 -* Wed Sep 19 2018 Srivatsa S. Bhat 4.14.67-1 -- Update to version 4.14.67 -* Tue Sep 18 2018 Srivatsa S. Bhat 4.14.54-7 -- Add rdrand-based RNG driver to enhance kernel entropy. -* Sun Sep 02 2018 Srivatsa S. Bhat 4.14.54-6 -- Add full retpoline support by building with retpoline-enabled gcc. -* Thu Aug 30 2018 Srivatsa S. Bhat 4.14.54-5 -- Apply out-of-tree patches needed for AppArmor. -* Wed Aug 22 2018 Alexey Makhalov 4.14.54-4 -- Fix overflow kernel panic in rsi driver. -- .config: enable BT stack, enable GPIO sysfs. -- Add Exar USB serial driver. -* Fri Aug 17 2018 Ajay Kaher 4.14.54-3 -- Enabled USB PCI in config_aarch64 -- Build hang (at make oldconfig) fix in config_aarch64 -* Thu Jul 19 2018 Alexey Makhalov 4.14.54-2 -- .config: usb_serial_pl2303=m,wlan=y,can=m,gpio=y,pinctrl=y,iio=m -* Mon Jul 09 2018 Him Kalyan Bordoloi 4.14.54-1 -- Update to version 4.14.54 -* Fri Jan 26 2018 Alexey Makhalov 4.14.8-2 -- Added vchiq entry to rpi3 dts -- Added dtb-rpi3 subpackage -* Fri Dec 22 2017 Alexey Makhalov 4.14.8-1 -- Version update -* Wed Dec 13 2017 Alexey Makhalov 4.9.66-4 -- KAT build support -* Thu Dec 07 2017 Alexey Makhalov 4.9.66-3 -- Aarch64 support -* Tue Dec 05 2017 Alexey Makhalov 4.9.66-2 -- Sign and compress modules after stripping. fips=1 requires signed modules -* Mon Dec 04 2017 Srivatsa S. Bhat 4.9.66-1 -- Version update -* Tue Nov 21 2017 Srivatsa S. Bhat 4.9.64-1 -- Version update -* Mon Nov 06 2017 Srivatsa S. Bhat 4.9.60-1 -- Version update -* Wed Oct 11 2017 Srivatsa S. Bhat 4.9.53-3 -- Add patch "KVM: Don't accept obviously wrong gsi values via - KVM_IRQFD" to fix CVE-2017-1000252. -* Tue Oct 10 2017 Alexey Makhalov 4.9.53-2 -- Build hang (at make oldconfig) fix. -* Thu Oct 05 2017 Srivatsa S. Bhat 4.9.53-1 -- Version update -* Mon Oct 02 2017 Srivatsa S. Bhat 4.9.52-3 -- Allow privileged CLONE_NEWUSER from nested user namespaces. -* Mon Oct 02 2017 Srivatsa S. Bhat 4.9.52-2 -- Fix CVE-2017-11472 (ACPICA: Namespace: fix operand cache leak) -* Mon Oct 02 2017 Srivatsa S. Bhat 4.9.52-1 -- Version update -* Mon Sep 18 2017 Alexey Makhalov 4.9.47-2 -- Requires coreutils or toybox -* Mon Sep 04 2017 Alexey Makhalov 4.9.47-1 -- Fix CVE-2017-11600 -* Tue Aug 22 2017 Anish Swaminathan 4.9.43-2 -- Add missing xen block drivers -* Mon Aug 14 2017 Alexey Makhalov 4.9.43-1 -- Version update -- [feature] new sysctl option unprivileged_userns_clone -* Wed Aug 09 2017 Alexey Makhalov 4.9.41-2 -- Fix CVE-2017-7542 -- [bugfix] Added ccm,gcm,ghash,lzo crypto modules to avoid - panic on modprobe tcrypt -* Mon Aug 07 2017 Alexey Makhalov 4.9.41-1 -- Version update -* Fri Aug 04 2017 Bo Gan 4.9.38-6 -- Fix initramfs triggers -* Tue Aug 01 2017 Anish Swaminathan 4.9.38-5 -- Allow some algorithms in FIPS mode -- Reverts 284a0f6e87b0721e1be8bca419893902d9cf577a and backports -- bcf741cb779283081db47853264cc94854e7ad83 in the kernel tree -- Enable additional NF features -* Fri Jul 21 2017 Anish Swaminathan 4.9.38-4 -- Add patches in Hyperv codebase -* Fri Jul 21 2017 Anish Swaminathan 4.9.38-3 -- Add missing hyperv drivers -* Thu Jul 20 2017 Alexey Makhalov 4.9.38-2 -- Disable scheduler beef up patch -* Tue Jul 18 2017 Alexey Makhalov 4.9.38-1 -- Fix CVE-2017-11176 and CVE-2017-10911 -* Mon Jul 03 2017 Xiaolin Li 4.9.34-3 -- Add libdnet-devel, kmod-devel and libmspack-devel to BuildRequires -* Thu Jun 29 2017 Divya Thaluru 4.9.34-2 -- Added obsolete for deprecated linux-dev package -* Wed Jun 28 2017 Alexey Makhalov 4.9.34-1 -- [feature] 9P FS security support -- [feature] DM Delay target support -- Fix CVE-2017-1000364 ("stack clash") and CVE-2017-9605 -* Thu Jun 8 2017 Alexey Makhalov 4.9.31-1 -- Fix CVE-2017-8890, CVE-2017-9074, CVE-2017-9075, CVE-2017-9076 - CVE-2017-9077 and CVE-2017-9242 -- [feature] IPV6 netfilter NAT table support -* Fri May 26 2017 Alexey Makhalov 4.9.30-1 -- Added ENA driver for AMI -- Fix CVE-2017-7487 and CVE-2017-9059 -* Wed May 17 2017 Vinay Kulkarni 4.9.28-2 -- Enable IPVLAN module. -* Tue May 16 2017 Alexey Makhalov 4.9.28-1 -- Version update -* Wed May 10 2017 Alexey Makhalov 4.9.27-1 -- Version update -* Sun May 7 2017 Alexey Makhalov 4.9.26-1 -- Version update -- Removed version suffix from config file name -* Thu Apr 27 2017 Bo Gan 4.9.24-2 -- Support dynamic initrd generation -* Tue Apr 25 2017 Alexey Makhalov 4.9.24-1 -- Fix CVE-2017-6874 and CVE-2017-7618. -- Fix audit-devel BuildRequires. -- .config: build nvme and nvme-core in kernel. -* Mon Mar 6 2017 Alexey Makhalov 4.9.13-2 -- .config: NSX requirements for crypto and netfilter -* Tue Feb 28 2017 Alexey Makhalov 4.9.13-1 -- Update to linux-4.9.13 to fix CVE-2017-5986 and CVE-2017-6074 -* Thu Feb 09 2017 Alexey Makhalov 4.9.9-1 -- Update to linux-4.9.9 to fix CVE-2016-10153, CVE-2017-5546, - CVE-2017-5547, CVE-2017-5548 and CVE-2017-5576. -- .config: added CRYPTO_FIPS support. -* Tue Jan 10 2017 Alexey Makhalov 4.9.2-1 -- Update to linux-4.9.2 to fix CVE-2016-10088 -- Move linux-tools.spec to linux.spec as -tools subpackage -* Mon Dec 19 2016 Xiaolin Li 4.9.0-2 -- BuildRequires Linux-PAM-devel -* Mon Dec 12 2016 Alexey Makhalov 4.9.0-1 -- Update to linux-4.9.0 -- Add paravirt stolen time accounting feature (from linux-esx), - but disable it by default (no-vmw-sta cmdline parameter) -* Thu Dec 8 2016 Alexey Makhalov 4.4.35-3 -- net-packet-fix-race-condition-in-packet_set_ring.patch - to fix CVE-2016-8655 -* Wed Nov 30 2016 Alexey Makhalov 4.4.35-2 -- Expand `uname -r` with release number -- Check for build-id matching -- Added syscalls tracing support -- Compress modules -* Mon Nov 28 2016 Alexey Makhalov 4.4.35-1 -- Update to linux-4.4.35 -- vfio-pci-fix-integer-overflows-bitmask-check.patch - to fix CVE-2016-9083 -* Tue Nov 22 2016 Alexey Makhalov 4.4.31-4 -- net-9p-vsock.patch -* Thu Nov 17 2016 Alexey Makhalov 4.4.31-3 -- tty-prevent-ldisc-drivers-from-re-using-stale-tty-fields.patch - to fix CVE-2015-8964 -* Tue Nov 15 2016 Alexey Makhalov 4.4.31-2 -- .config: add cgrup_hugetlb support -- .config: add netfilter_xt_{set,target_ct} support -- .config: add netfilter_xt_match_{cgroup,ipvs} support -* Thu Nov 10 2016 Alexey Makhalov 4.4.31-1 -- Update to linux-4.4.31 -* Fri Oct 21 2016 Alexey Makhalov 4.4.26-1 -- Update to linux-4.4.26 -* Wed Oct 19 2016 Alexey Makhalov 4.4.20-6 -- net-add-recursion-limit-to-GRO.patch -- scsi-arcmsr-buffer-overflow-in-arcmsr_iop_message_xfer.patch -* Tue Oct 18 2016 Alexey Makhalov 4.4.20-5 -- ipip-properly-mark-ipip-GRO-packets-as-encapsulated.patch -- tunnels-dont-apply-GRO-to-multiple-layers-of-encapsulation.patch -* Mon Oct 3 2016 Alexey Makhalov 4.4.20-4 -- Package vmlinux with PROGBITS sections in -debuginfo subpackage -* Tue Sep 27 2016 Alexey Makhalov 4.4.20-3 -- .config: CONFIG_IP_SET_HASH_{IPMARK,MAC}=m -* Tue Sep 20 2016 Alexey Makhalov 4.4.20-2 -- Add -release number for /boot/* files -- Use initrd.img with version and release number -- Rename -dev subpackage to -devel -* Wed Sep 7 2016 Alexey Makhalov 4.4.20-1 -- Update to linux-4.4.20 -- apparmor-fix-oops-validate-buffer-size-in-apparmor_setprocattr.patch -- keys-fix-asn.1-indefinite-length-object-parsing.patch -* Thu Aug 25 2016 Alexey Makhalov 4.4.8-11 -- vmxnet3 patches to bumpup a version to 1.4.8.0 -* Wed Aug 10 2016 Alexey Makhalov 4.4.8-10 -- Added VSOCK-Detach-QP-check-should-filter-out-non-matching-QPs.patch -- .config: pmem hotplug + ACPI NFIT support -- .config: enable EXPERT mode, disable UID16 syscalls -* Thu Jul 07 2016 Alexey Makhalov 4.4.8-9 -- .config: pmem + fs_dax support -* Fri Jun 17 2016 Alexey Makhalov 4.4.8-8 -- patch: e1000e-prevent-div-by-zero-if-TIMINCA-is-zero.patch -- .config: disable rt group scheduling - not supported by systemd -* Wed Jun 15 2016 Harish Udaiya Kumar 4.4.8-7 -- fixed the capitalization for - System.map -* Thu May 26 2016 Alexey Makhalov 4.4.8-6 -- patch: REVERT-sched-fair-Beef-up-wake_wide.patch -* Tue May 24 2016 Priyesh Padmavilasom 4.4.8-5 -- GA - Bump release of all rpms -* Mon May 23 2016 Harish Udaiya Kumar 4.4.8-4 -- Fixed generation of debug symbols for kernel modules & vmlinux. -* Mon May 23 2016 Divya Thaluru 4.4.8-3 -- Added patches to fix CVE-2016-3134, CVE-2016-3135 -* Wed May 18 2016 Harish Udaiya Kumar 4.4.8-2 -- Enabled CONFIG_UPROBES in config as needed by ktap -* Wed May 04 2016 Alexey Makhalov 4.4.8-1 -- Update to linux-4.4.8 -- Added net-Drivers-Vmxnet3-set-... patch -* Tue May 03 2016 Vinay Kulkarni 4.2.0-27 -- Compile Intel GigE and VMXNET3 as part of kernel. -* Thu Apr 28 2016 Nick Shi 4.2.0-26 -- Compile cramfs.ko to allow mounting cramfs image -* Tue Apr 12 2016 Vinay Kulkarni 4.2.0-25 -- Revert network interface renaming disable in kernel. -* Tue Mar 29 2016 Alexey Makhalov 4.2.0-24 -- Support kmsg dumping to vmware.log on panic -- sunrpc: xs_bind uses ip_local_reserved_ports -* Mon Mar 28 2016 Harish Udaiya Kumar 4.2.0-23 -- Enabled Regular stack protection in Linux kernel in config -* Thu Mar 17 2016 Harish Udaiya Kumar 4.2.0-22 -- Restrict the permissions of the /boot/System.map-X file -* Fri Mar 04 2016 Alexey Makhalov 4.2.0-21 -- Patch: SUNRPC: Do not reuse srcport for TIME_WAIT socket. -* Wed Mar 02 2016 Alexey Makhalov 4.2.0-20 -- Patch: SUNRPC: Ensure that we wait for connections to complete - before retrying -* Fri Feb 26 2016 Alexey Makhalov 4.2.0-19 -- Disable watchdog under VMware hypervisor. -* Thu Feb 25 2016 Alexey Makhalov 4.2.0-18 -- Added rpcsec_gss_krb5 and nfs_fscache -* Mon Feb 22 2016 Alexey Makhalov 4.2.0-17 -- Added sysctl param to control weighted_cpuload() behavior -* Thu Feb 18 2016 Divya Thaluru 4.2.0-16 -- Disabling network renaming -* Sun Feb 14 2016 Alexey Makhalov 4.2.0-15 -- veth patch: don’t modify ip_summed -* Thu Feb 11 2016 Alexey Makhalov 4.2.0-14 -- Full tickless -> idle tickless + simple CPU time accounting -- SLUB -> SLAB -- Disable NUMA balancing -- Disable stack protector -- No build_forced no-CBs CPUs -- Disable Expert configuration mode -- Disable most of debug features from 'Kernel hacking' -* Mon Feb 08 2016 Alexey Makhalov 4.2.0-13 -- Double tcp_mem limits, patch is added. -* Wed Feb 03 2016 Anish Swaminathan 4.2.0-12 -- Fixes for CVE-2015-7990/6937 and CVE-2015-8660. -* Tue Jan 26 2016 Anish Swaminathan 4.2.0-11 -- Revert CONFIG_HZ=250 -* Fri Jan 22 2016 Alexey Makhalov 4.2.0-10 -- Fix for CVE-2016-0728 -* Wed Jan 13 2016 Alexey Makhalov 4.2.0-9 -- CONFIG_HZ=250 -* Tue Jan 12 2016 Mahmoud Bassiouny 4.2.0-8 -- Remove rootfstype from the kernel parameter. -* Mon Jan 04 2016 Harish Udaiya Kumar 4.2.0-7 -- Disabled all the tracing options in kernel config. -- Disabled preempt. -- Disabled sched autogroup. -* Thu Dec 17 2015 Harish Udaiya Kumar 4.2.0-6 -- Enabled kprobe for systemtap & disabled dynamic function tracing in config -* Fri Dec 11 2015 Harish Udaiya Kumar 4.2.0-5 -- Added oprofile kernel driver sub-package. -* Fri Nov 13 2015 Mahmoud Bassiouny 4.2.0-4 -- Change the linux image directory. -* Wed Nov 11 2015 Harish Udaiya Kumar 4.2.0-3 -- Added the build essential files in the dev sub-package. -* Mon Nov 09 2015 Vinay Kulkarni 4.2.0-2 -- Enable Geneve module support for generic kernel. -* Fri Oct 23 2015 Harish Udaiya Kumar 4.2.0-1 -- Upgraded the generic linux kernel to version 4.2.0 & and updated timer handling to full tickless mode. -* Tue Sep 22 2015 Harish Udaiya Kumar 4.0.9-5 -- Added driver support for frame buffer devices and ACPI -* Wed Sep 2 2015 Alexey Makhalov 4.0.9-4 -- Added mouse ps/2 module. -* Fri Aug 14 2015 Alexey Makhalov 4.0.9-3 -- Use photon.cfg as a symlink. -* Thu Aug 13 2015 Alexey Makhalov 4.0.9-2 -- Added environment file(photon.cfg) for grub. -* Wed Aug 12 2015 Sharath George 4.0.9-1 -- Upgrading kernel version. -* Wed Aug 12 2015 Alexey Makhalov 3.19.2-5 -- Updated OVT to version 10.0.0. -- Rename -gpu-drivers to -drivers-gpu in accordance to directory structure. -- Added -sound package/ -* Tue Aug 11 2015 Anish Swaminathan 3.19.2-4 -- Removed Requires dependencies. -* Fri Jul 24 2015 Harish Udaiya Kumar 3.19.2-3 -- Updated the config file to include graphics drivers. -* Mon May 18 2015 Touseef Liaqat 3.13.3-2 -- Update according to UsrMove. -* Wed Nov 5 2014 Divya Thaluru 3.13.3-1 -- Initial build. First version \ No newline at end of file +%if 0%{?photon_subrelease} <= 90 +%include %{SOURCE992} +%else +%if 0%{?photon_subrelease} == 91 +%include %{SOURCE996} +%else +%include %{SOURCE993} +%endif +%endif diff --git a/SPECS/91/linux/spec_install_post.inc b/SPECS/linux/spec_install_post-6.1.inc similarity index 76% rename from SPECS/91/linux/spec_install_post.inc rename to SPECS/linux/spec_install_post-6.1.inc index 0155494e09..ec5494b1d8 100644 --- a/SPECS/91/linux/spec_install_post.inc +++ b/SPECS/linux/spec_install_post-6.1.inc @@ -1,8 +1,9 @@ %define __modules_install_post\ find %{buildroot}%{_modulesdir} -name *.ko -type f -print0 |\ xargs -t -0 -r -P$(nproc) -n1 sh -c '\ - ./scripts/sign-file sha3-512 certs/signing_key.pem certs/signing_key.x509 $0\ - xz -T $(nproc) $0'\ + ./scripts/sign-file sha512 certs/signing_key.pem certs/signing_key.x509 $0\ + xz -T $(nproc) $0\ + rm -f $0.{sig,dig}'\ %{nil} # __os_install_post strips signature from modules. We need to re-sign & recompress.