Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e8b1fc9
selftests/mm temporary fix of hmm infinite loop
PlaidCat Oct 22, 2024
83ea028
SUSE: patch: crypto-ecdh-implement-FIPS-PCT.patch
jallisonciq Aug 29, 2024
ea8cf8c
crypto: essiv - Zeroize keys on exit in essiv_aead_setkey()
jason-rodri Sep 30, 2024
0cfad69
crypto: jitter - replace LFSR with SHA3-256
jallisonciq Jun 16, 2025
2fbbc1c
crypto: aead,cipher - zeroize key buffer after use
jallisonciq Sep 4, 2024
a9fbda7
crypto: ecdh - explicitly zeroize private_key
jvdsn Mar 28, 2024
db164ea
crypto: lib/mpi - Fix unexpected pointer access in mpi_ec_init
uudiin Dec 14, 2023
6093373
crypto: Kconfig - Make CRYPTO_FIPS depend on the DRBG being built-in
kerneltoast Jul 22, 2025
52a2285
random: Restrict extrng registration to init time
kerneltoast Aug 1, 2025
b30ba9a
crypto: rng - Convert crypto_default_rng_refcnt into an unsigned int
kerneltoast Jun 24, 2025
7422665
crypto: drbg - Align buffers to at least a cache line
kerneltoast Jun 11, 2025
66e4197
crypto: rng - Fix priority inversions due to mutex locks
kerneltoast Jun 24, 2025
a3cbcf9
mm/gup: reintroduce pin_user_pages_fast_only()
kerneltoast Jun 19, 2025
d132298
crypto: rng - Implement fast per-CPU DRBG instances
kerneltoast Aug 19, 2025
295b88d
configs: Ensure FIPS settings defined
PlaidCat Jul 29, 2025
bff6d09
github actions: Use reusable validate kernel commits workflow
bmastbergen Oct 17, 2025
637e35e
github actions: Add kernelCI for rlc-9
roxanan1996 Mar 12, 2026
387d67f
github actions: Use trigger for kernelCI
roxanan1996 Mar 26, 2026
b37d936
Revert "xfrm: esp: avoid in-place decrypt on shared skb frags"
PlaidCat May 13, 2026
c7b0342
tools: hv: Enable debug logs for hv_kvp_daemon
PlaidCat Jun 9, 2025
c55658f
crypto: rng - Only allow the DRBG to register as "stdrng" in FIPS mode
kerneltoast Jul 25, 2025
0d14bd1
net: mana: Add support for net_shaper_ops
shreeya-patel98 Dec 16, 2025
82b8dde
net: mana: Add speed support in mana_get_link_ksettings
shreeya-patel98 Dec 16, 2025
ae8e056
net: mana: Fix build errors when CONFIG_NET_SHAPER is disabled
shreeya-patel98 Dec 16, 2025
2bd0f84
rxrpc: Fix potential UAF after skb_unshare() failure
kerneltoast May 8, 2026
dc63452
rxrpc: Fix rxrpc_input_call_event() to only unshare DATA packets
kerneltoast May 8, 2026
75c4553
xfrm: esp: avoid in-place decrypt on shared skb frags
PlaidCat May 7, 2026
5c6a91c
rxrpc: Also unshare DATA/RESPONSE packets when paged frags are present
kerneltoast May 8, 2026
0735f24
KVM: arm64: Reassign nested_mmus array behind mmu_lock
PlaidCat Jun 8, 2026
d9ac1ed
crypto: rng - Skip leading zero-length iovec segments
kerneltoast Jun 23, 2026
09ec8b9
crypto: rng - Fix spurious EFAULT when the destination PTE is zapped
kerneltoast Jun 23, 2026
91671e6
Revert "mm/gup: reintroduce pin_user_pages_fast_only()"
kerneltoast Jun 23, 2026
6e98a80
KVM: x86: Fix shadow paging use-after-free due to unexpected GFN
sean-jc Apr 15, 2026
5fa5266
KVM: x86: Fix shadow paging use-after-free due to unexpected role
bonzini Jun 12, 2026
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
1 change: 1 addition & 0 deletions .container_build_image
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rocky-9-kernel-builder
11 changes: 11 additions & 0 deletions .github/workflows/kernel-build-and-test-multiarch-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Trigger Automated kernel build and test (multi-arch)

on:
push:
branches:
- '*_rlc-9/**'

jobs:
kernelCI:
uses: ctrliq/kernel-src-tree/.github/workflows/kernel-build-and-test-multiarch-trigger.yml@main
secrets: inherit
10 changes: 10 additions & 0 deletions .github/workflows/validate-kernel-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Validate Kernel Commits

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
check:
uses: ctrliq/kernel-src-tree/.github/workflows/validate-kernel-commits.yml@main
secrets: inherit
33 changes: 19 additions & 14 deletions arch/arm64/kvm/nested.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,27 @@ int kvm_vcpu_init_nested(struct kvm_vcpu *vcpu)
* again, and there is no reason to affect the whole VM for this.
*/
num_mmus = atomic_read(&kvm->online_vcpus) * S2_MMU_PER_VCPU;
tmp = kvrealloc(kvm->arch.nested_mmus,
size_mul(sizeof(*kvm->arch.nested_mmus), kvm->arch.nested_mmus_size),
size_mul(sizeof(*kvm->arch.nested_mmus), num_mmus),
GFP_KERNEL_ACCOUNT | __GFP_ZERO);
if (!tmp)
return -ENOMEM;
if (num_mmus > kvm->arch.nested_mmus_size) {
tmp = kvcalloc(num_mmus, sizeof(*tmp), GFP_KERNEL_ACCOUNT);
if (!tmp)
return -ENOMEM;

swap(kvm->arch.nested_mmus, tmp);
write_lock(&kvm->mmu_lock);

/*
* If we went through a realocation, adjust the MMU back-pointers in
* the previously initialised kvm_pgtable structures.
*/
if (kvm->arch.nested_mmus != tmp)
for (int i = 0; i < kvm->arch.nested_mmus_size; i++)
kvm->arch.nested_mmus[i].pgt->mmu = &kvm->arch.nested_mmus[i];
if (kvm->arch.nested_mmus_size) {
memcpy(tmp, kvm->arch.nested_mmus,
size_mul(sizeof(*tmp), kvm->arch.nested_mmus_size));

for (int i = 0; i < kvm->arch.nested_mmus_size; i++)
tmp[i].pgt->mmu = &tmp[i];
}

swap(kvm->arch.nested_mmus, tmp);

write_unlock(&kvm->mmu_lock);

kvfree(tmp);
}

for (int i = kvm->arch.nested_mmus_size; !ret && i < num_mmus; i++)
ret = init_nested_s2_mmu(kvm, &kvm->arch.nested_mmus[i]);
Expand Down
41 changes: 18 additions & 23 deletions arch/x86/kvm/mmu/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ struct kmem_cache *mmu_page_header_cache;
static struct percpu_counter kvm_total_used_mmu_pages;

static void mmu_spte_set(u64 *sptep, u64 spte);
static int mmu_page_zap_pte(struct kvm *kvm, struct kvm_mmu_page *sp,
u64 *spte, struct list_head *invalid_list);

struct kvm_mmu_role_regs {
const unsigned long cr0;
Expand Down Expand Up @@ -1220,19 +1222,6 @@ static void drop_spte(struct kvm *kvm, u64 *sptep)
rmap_remove(kvm, sptep);
}

static void drop_large_spte(struct kvm *kvm, u64 *sptep, bool flush)
{
struct kvm_mmu_page *sp;

sp = sptep_to_sp(sptep);
WARN_ON_ONCE(sp->role.level == PG_LEVEL_4K);

drop_spte(kvm, sptep);

if (flush)
kvm_flush_remote_tlbs_sptep(kvm, sptep);
}

/*
* Write-protect on the specified @sptep, @pt_protect indicates whether
* spte write-protection is caused by protecting shadow page table.
Expand Down Expand Up @@ -2326,12 +2315,15 @@ static struct kvm_mmu_page *kvm_mmu_get_child_sp(struct kvm_vcpu *vcpu,
u64 *sptep, gfn_t gfn,
bool direct, unsigned int access)
{
union kvm_mmu_page_role role;
union kvm_mmu_page_role role = kvm_mmu_child_role(sptep, direct, access);

if (is_shadow_present_pte(*sptep) && !is_large_pte(*sptep))
if (is_shadow_present_pte(*sptep) &&
!is_large_pte(*sptep) &&
spte_to_child_sp(*sptep) &&
spte_to_child_sp(*sptep)->gfn == gfn &&
spte_to_child_sp(*sptep)->role.word == role.word)
return ERR_PTR(-EEXIST);

role = kvm_mmu_child_role(sptep, direct, access);
return kvm_mmu_get_shadow_page(vcpu, gfn, role);
}

Expand Down Expand Up @@ -2406,13 +2398,16 @@ static void __link_shadow_page(struct kvm *kvm,

BUILD_BUG_ON(VMX_EPT_WRITABLE_MASK != PT_WRITABLE_MASK);

/*
* If an SPTE is present already, it must be a leaf and therefore
* a large one. Drop it, and flush the TLB if needed, before
* installing sp.
*/
if (is_shadow_present_pte(*sptep))
drop_large_spte(kvm, sptep, flush);
if (is_shadow_present_pte(*sptep)) {
struct kvm_mmu_page *parent_sp;
LIST_HEAD(invalid_list);

parent_sp = sptep_to_sp(sptep);
WARN_ON_ONCE(parent_sp->role.level == PG_LEVEL_4K);

mmu_page_zap_pte(kvm, parent_sp, sptep, &invalid_list);
kvm_mmu_remote_flush_or_zap(kvm, &invalid_list, true);
}

spte = make_nonleaf_spte(sp->spt, sp_ad_disabled(sp));

Expand Down
11 changes: 11 additions & 0 deletions configs/kernel-x86_64-debug-rhel.config
Original file line number Diff line number Diff line change
Expand Up @@ -7353,3 +7353,14 @@ CONFIG_ZSWAP=y
# CONFIG_ZSWAP_ZPOOL_DEFAULT_Z3FOLD is not set
CONFIG_ZSWAP_ZPOOL_DEFAULT_ZBUD=y
# CONFIG_ZSWAP_ZPOOL_DEFAULT_ZSMALLOC is not set

CONFIG_X509_CERTIFICATE_PARSER=y
CONFIG_PKCS7_MESSAGE_PARSER=y
CONFIG_FIPS_SIGNATURE_SELFTEST=y
CONFIG_FIPS_SIGNATURE_SELFTEST_RSA=y
CONFIG_FIPS_SIGNATURE_SELFTEST_ECDSA=y
CONFIG_CRYPTO_DRBG=y
CONFIG_CRYPTO_FIPS=y
CONFIG_CRYPTO_FIPS_CUSTOM_VERSION=y
CONFIG_CRYPTO_FIPS_VERSION="rocky9.20250725"
CONFIG_CRYPTO_FIPS_NAME="Rocky Linux 9 Kernel Cryptographic API"
11 changes: 11 additions & 0 deletions configs/kernel-x86_64-rhel.config
Original file line number Diff line number Diff line change
Expand Up @@ -7330,3 +7330,14 @@ CONFIG_ZSWAP=y
# CONFIG_ZSWAP_ZPOOL_DEFAULT_Z3FOLD is not set
CONFIG_ZSWAP_ZPOOL_DEFAULT_ZBUD=y
# CONFIG_ZSWAP_ZPOOL_DEFAULT_ZSMALLOC is not set

CONFIG_X509_CERTIFICATE_PARSER=y
CONFIG_PKCS7_MESSAGE_PARSER=y
CONFIG_FIPS_SIGNATURE_SELFTEST=y
CONFIG_FIPS_SIGNATURE_SELFTEST_RSA=y
CONFIG_FIPS_SIGNATURE_SELFTEST_ECDSA=y
CONFIG_CRYPTO_DRBG=y
CONFIG_CRYPTO_FIPS=y
CONFIG_CRYPTO_FIPS_CUSTOM_VERSION=y
CONFIG_CRYPTO_FIPS_VERSION="rocky9.20250725"
CONFIG_CRYPTO_FIPS_NAME="Rocky Linux 9 Kernel Cryptographic API"
7 changes: 4 additions & 3 deletions crypto/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ if CRYPTO
comment "Crypto core or helper"

config CRYPTO_FIPS
bool "FIPS 200 compliance"
depends on (CRYPTO_ANSI_CPRNG || CRYPTO_DRBG) && !CRYPTO_MANAGER_DISABLE_TESTS
bool "FIPS compliance"
depends on CRYPTO_DRBG=y && !CRYPTO_MANAGER_DISABLE_TESTS
depends on (MODULE_SIG || !MODULES)
help
This option enables the fips boot option which is
required if you want the system to operate in a FIPS 200
required if you want the system to operate in a FIPS
certification. You should say no unless you know what
this is.

Expand Down Expand Up @@ -2037,6 +2037,7 @@ config CRYPTO_ANSI_CPRNG
tristate "Pseudo Random Number Generation for Cryptographic modules"
select CRYPTO_AES
select CRYPTO_RNG
select CRYPTO_SHA3
help
This option enables the generic pseudo random number generator
for cryptographic modules. Uses the Algorithm specified in
Expand Down
3 changes: 1 addition & 2 deletions crypto/aead.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ static int setkey_unaligned(struct crypto_aead *tfm, const u8 *key,
alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1);
memcpy(alignbuffer, key, keylen);
ret = crypto_aead_alg(tfm)->setkey(tfm, alignbuffer, keylen);
memset(alignbuffer, 0, keylen);
kfree(buffer);
kfree_sensitive(buffer);
return ret;
}

Expand Down
3 changes: 1 addition & 2 deletions crypto/cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ static int setkey_unaligned(struct crypto_cipher *tfm, const u8 *key,
alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1);
memcpy(alignbuffer, key, keylen);
ret = cia->cia_setkey(crypto_cipher_tfm(tfm), alignbuffer, keylen);
memset(alignbuffer, 0, keylen);
kfree(buffer);
kfree_sensitive(buffer);
return ret;

}
Expand Down
6 changes: 6 additions & 0 deletions crypto/drbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,12 @@ static inline int drbg_alloc_state(struct drbg_state *drbg)
if (ret < 0)
goto err;

/*
* Align to at least a cache line for better performance. This also
* prevents false sharing of cache lines between different instances.
*/
ret = max(ret, L1_CACHE_BYTES - 1);

drbg->Vbuf = kmalloc(drbg_statelen(drbg) + ret, GFP_KERNEL);
if (!drbg->Vbuf) {
ret = -ENOMEM;
Expand Down
33 changes: 33 additions & 0 deletions crypto/ecdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <crypto/kpp.h>
#include <crypto/ecdh.h>
#include <linux/scatterlist.h>
#include <linux/fips.h>
#include "ecc.h"

struct ecdh_ctx {
Expand All @@ -33,6 +34,8 @@ static int ecdh_set_secret(struct crypto_kpp *tfm, const void *buf,
params.key_size > sizeof(u64) * ctx->ndigits)
return -EINVAL;

memset(ctx->private_key, 0, sizeof(ctx->private_key));

if (!params.key || !params.key_size)
return ecc_gen_privkey(ctx->curve_id, ctx->ndigits,
ctx->private_key);
Expand Down Expand Up @@ -94,6 +97,36 @@ static int ecdh_compute_value(struct kpp_request *req)
ctx->private_key, public_key);
buf = public_key;
nbytes = public_key_sz;

/*
* SP800-56Arev3, 5.6.2.1.4: ("Owner Assurance of
* Pair-wise Consistency"): recompute the public key
* and check if the results match.
*/
if (fips_enabled) {
u64 *public_key_pct;

if (ret < 0)
goto free_all;

public_key_pct = kmalloc(public_key_sz, GFP_KERNEL);
if (!public_key_pct) {
ret = -ENOMEM;
goto free_all;
}

ret = ecc_make_pub_key(ctx->curve_id, ctx->ndigits,
ctx->private_key,
public_key_pct);
if (ret < 0) {
kfree(public_key_pct);
goto free_all;
}

if (memcmp(public_key, public_key_pct, public_key_sz))
panic("ECDH PCT failed in FIPS mode");
kfree(public_key_pct);
}
}

if (ret < 0)
Expand Down
9 changes: 6 additions & 3 deletions crypto/essiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,16 @@ static int essiv_aead_setkey(struct crypto_aead *tfm, const u8 *key,
crypto_shash_update(desc, keys.enckey, keys.enckeylen) ?:
crypto_shash_finup(desc, keys.authkey, keys.authkeylen, salt);
if (err)
return err;
goto out;

crypto_cipher_clear_flags(tctx->essiv_cipher, CRYPTO_TFM_REQ_MASK);
crypto_cipher_set_flags(tctx->essiv_cipher, crypto_aead_get_flags(tfm) &
CRYPTO_TFM_REQ_MASK);
return crypto_cipher_setkey(tctx->essiv_cipher, salt,
crypto_shash_digestsize(tctx->hash));
err = crypto_cipher_setkey(tctx->essiv_cipher, salt,
crypto_shash_digestsize(tctx->hash));
out:
memzero_explicit(&keys, sizeof(keys));
return err;
}

static int essiv_aead_setauthsize(struct crypto_aead *tfm,
Expand Down
Loading
Loading