Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion SPECS/90/linux/linux.spec
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,19 @@
%global fips 0
%endif

# 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
%endif

Summary: Kernel
Name: linux
Version: 6.1.190
Release: 2%{?acvp_build:.acvp}%{?kat_build:.kat}%{?dist}
Release: 3%{?acvp_build:.acvp}%{?kat_build:.kat}%{?dist}
URL: http://www.kernel.org/
Group: System Environment/Kernel
Vendor: VMware, Inc.
Expand Down Expand Up @@ -995,6 +1004,8 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
%{_datadir}/bash-completion/completions/bpftool

%changelog
* Fri Oct 30 2026 Daniel Casota <dcasota@gmail.com> 6.1.190-3
- Refuse acvp_build and kat_build on architectures other than x86_64
* Thu Oct 29 2026 Brennan Lamoreaux <brennan.lamoreaux@broadcom.com> 6.1.190-2
- Fixes CVE-2026-80668, CVE-2026-90037
* Mon Oct 19 2026 Gerrit Photon <svc.photon-ci@broadcom.com> 6.1.190-1
Expand Down
22 changes: 21 additions & 1 deletion SPECS/91/linux/canister_builder/crypto/gen_canister_relocs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
35 changes: 35 additions & 0 deletions SPECS/91/linux/canister_config.inc
Original file line number Diff line number Diff line change
@@ -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
26 changes: 18 additions & 8 deletions SPECS/91/linux/linux-esx.spec
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,21 @@
%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

Summary: Kernel
Name: linux-esx
Version: 6.12.111
Release: 3%{?dist}
Release: 4%{?dist}
URL: http://www.kernel.org
Group: System Environment/Kernel
Vendor: VMware, Inc.
Expand All @@ -44,6 +55,8 @@ 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

Expand Down Expand Up @@ -439,20 +452,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" \
Expand Down Expand Up @@ -582,6 +590,8 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
%{_usrsrc}/linux-headers-%{uname_r}

%changelog
* Fri Oct 30 2026 Daniel Casota <dcasota@gmail.com> 6.12.111-4
- Share canister/.config handling via canister_config.inc
* Wed Sep 30 2026 Srinidhi Rao <srinidhi.rao@broadcom.com> 6.12.111-3
- Fix jent mem free.
* Mon Sep 28 2026 Shreenidhi Shedi <shreenidhi.shedi@broadcom.com> 6.12.111-2
Expand Down
26 changes: 17 additions & 9 deletions SPECS/91/linux/linux.spec
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,20 @@
%global canister_build 1
%endif

%ifarch x86_64
%if 0%{?acvp_build}
%global fips 1
%endif
%endif

# 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
%endif

# Set default FIPS flags
%if 0%{?fips}
Expand All @@ -80,7 +91,7 @@
Summary: Kernel
Name: linux
Version: 6.12.111
Release: 3%{?acvp_build:.acvp}%{?kat_build:.kat}%{?dist}
Release: 4%{?acvp_build:.acvp}%{?kat_build:.kat}%{?dist}
URL: http://www.kernel.org/
Group: System Environment/Kernel
Vendor: VMware, Inc.
Expand All @@ -99,6 +110,8 @@ Source3: https://github.com/amzn/amzn-drivers/archive/refs/tags/ena_linux
%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
Expand Down Expand Up @@ -707,14 +720,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" \
Expand Down Expand Up @@ -1028,6 +1034,8 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
%endif

%changelog
* Fri Oct 30 2026 Daniel Casota <dcasota@gmail.com> 6.12.111-4
- Share canister_config.inc; build the canister against the current kernel
* Wed Sep 30 2026 Srinidhi Rao <srinidhi.rao@broadcom.com> 6.12.111-3
- Fix jent mem free.
* Mon Sep 28 2026 Shreenidhi Shedi <shreenidhi.shedi@broadcom.com> 6.12.111-2
Expand Down
22 changes: 21 additions & 1 deletion SPECS/92/linux/canister_builder/crypto/gen_canister_relocs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down
Loading
Loading