Skip to content

[RLC-10] Rebase Custom Changes to rlc-10/6.12.0-211.68.1.el10_2 - #1741

Merged
PlaidCat merged 90 commits into
rlc-10/6.12.0-211.68.1.el10_2from
jmaple_rlc-10/6.12.0-211.68.1.el10_2
Oct 29, 2026
Merged

PlaidCat merged 90 commits into
rlc-10/6.12.0-211.68.1.el10_2from
jmaple_rlc-10/6.12.0-211.68.1.el10_2

Conversation

@PlaidCat

Copy link
Copy Markdown
Collaborator

https://ciqinc.atlassian.net/browse/KERNEL-1802

Update process (This kernel CentOS base for 6.12.0-211.68.1.el10_2)

  • Rolling Release Rebase Process
  • Create rlc-10/6.12.0-211.68.1.el10_2 branch from rocky10_2
  • Cherry-pick all code from previous branch rlc-10/6.12.0-211.66.1.el10_2 into new branch (skipping unneeded code)
    • Fix conflicts as they arise
  • Build and Test

Rebase Log

Already on 'rlc-10/6.12.0-211.66.1.el10_2'
Already on 'jmaple_rlc-10/6.12.0-211.68.1.el10_2'
[rolling release update] Rolling Product:  rlc-10
[rolling release update] Checking out branch:  rlc-10/6.12.0-211.66.1.el10_2
[rolling release update] Gathering all the RESF kernel Tags
[rolling release update] Found 37 RESF kernel tags
[rolling release update] Checking out branch:  rocky10_2
[rolling release update] Gathering all the RESF kernel Tags
[rolling release update] Found 39 RESF kernel tags
[rolling release update] Common tag sha:  b'263c8bf7f337a'
"263c8bf7f337a5409306f670837cc0fa7a547299 Rebuild rocky10_2 with kernel-6.12.0-211.66.1.el10_2"
[rolling release update] Checking for FIPS protected changes between the common tag and HEAD
[rolling release update] Checking for FIPS protected changes
[rolling release update] Getting SHAS 263c8bf7f337a..HEAD
[rolling release update] Number of commits to check:  59
[rolling release update] Checking modifications of shas
[rolling release update] Checked 5 of 59 commits
[rolling release update] Checked 10 of 59 commits
[rolling release update] Checked 15 of 59 commits
[rolling release update] Checked 20 of 59 commits
[rolling release update] Checked 25 of 59 commits
[rolling release update] Checked 30 of 59 commits
[rolling release update] Checked 35 of 59 commits
[rolling release update] Checked 40 of 59 commits
[rolling release update] Checked 45 of 59 commits
[rolling release update] Checked 50 of 59 commits
[rolling release update] Checked 55 of 59 commits
[rolling release update] 0 of 59 commits have FIPS protected changes
[rolling release update] Checking out old rolling branch:  rlc-10/6.12.0-211.66.1.el10_2
[rolling release update] Finding the CIQ Kernel and Associated Upstream commits between the last resf tag and HEAD
[rolling release update] Getting SHAS 263c8bf7f337a..HEAD
[rolling release update] Last RESF tag sha:  b'263c8bf7f337a'
[rolling release update] Total commits in old branch: 98
[rolling release update] Checking out new base branch:  rocky10_2
[rolling release update] Finding the kernel version for the new rolling release
[rolling release update] New Branch to create: rlc-10/6.12.0-211.68.1.el10_2
[rolling release update] Creating new branch: rlc-10/6.12.0-211.68.1.el10_2
[rolling release update] Creating new branch for PR:  jmaple_rlc-10/6.12.0-211.68.1.el10_2
[rolling release update] Creating Map of all new commits from last rolling release fork
[rolling release update] Total commits in new branch: 58
[rolling release update] Checking if any of the commits from the old rolling release are already present in the new base branch
- Old commit f5d19914a94c backported upstream 6785011f8b16
  Already in new base as 16162ca845bb: ipv4: validate checksum_start before completing checksum
- Old commit b13bcdab92f3 backported upstream d2710c8d938a
  Already in new base as 579475a34984: signal: Prevent exec() race
- Old commit 6c47ef30d33a backported upstream 63dffecfba3e
  Already in new base as dbf716a1cf36: posix-timers: Target group sigqueue to current task only if not exiting
- Old commit eb7227dd1ca4 backported upstream acb03d388181
  Already in new base as a09f0ecc0939: exec: Cleanup POSIX timers right after de_thread()
- Old commit 1d82cc5cea6a backported upstream aa69918bd418
  Already in new base as 21bf84e815f0: openvswitch: vport: fix self-deadlock on release of tunnel ports
- Old commit 8b3c97b66ae5 backported upstream 6931d21f87bc
  Already in new base as a72cdec11d85: openvswitch: defer tunnel netdev_put to RCU release
- Old commit 9d2d9a695749 backported upstream e0b5252a5938
  Already in new base as c45acc476d08: sctp: fix auth_hmacs array size in struct sctp_cookie
- Old commit 4c6ec58cb89c backported upstream 226f4a490d1a
  Already in new base as babc9b366af6: xfrm: nat_keepalive: avoid double free on send error
[rolling release update] Found 8 duplicate commits to remove
[rolling release update] Removing duplicate commits:
  - f5d19914a94ccf357b090e6ce81655ecca84bf02 ipv4: validate checksum_start before completing checksum
  - b13bcdab92f3744cd3bb17a0d726196c04e59118 signal: Prevent exec() race
  - 6c47ef30d33a128bde833489eb6c4f03b4c31072 posix-timers: Target group sigqueue to current task only if not exiting
  - eb7227dd1ca40b218fe25a176e118ea2145b9054 exec: Cleanup POSIX timers right after de_thread()
  - 1d82cc5cea6af9990075c1e30b57226b8a82c0b1 openvswitch: vport: fix self-deadlock on release of tunnel ports
  - 8b3c97b66ae5637717e09b626b51f893cb59cfb2 openvswitch: defer tunnel netdev_put to RCU release
  - 9d2d9a695749c6c4265a02b242527756d21551cb sctp: fix auth_hmacs array size in struct sctp_cookie
  - 4c6ec58cb89c5df59f20046341e55ed856ca64af xfrm: nat_keepalive: avoid double free on send error
[rolling release update] Applying 90 remaining commits to the new branch
  [1/90] d4c00e3903785 github actions: Add kernelCI for rlc-10
  [2/90] bda23a0a74a66 github actions: Use trigger for kernelCI
  [3/90] c5572186f5c23 github actions: Pin Checkout action to v6.0.2
  [4/90] e1c6a88d4069a github actions: set make to `nproc` rather than hardcoded
  [5/90] 21e2568be8b57 tools: hv: Enable debug logs for hv_kvp_daemon
  [6/90] dcadadac5db8b dcache: export shrink_dentry_list() and add new helper d_dispose_if_unused()
  [7/90] f85700616ba5e fuse: don't truncate cached, mutated symlink
  [8/90] 3458d0a6a89ee fuse: add more control over cache invalidation behaviour
  [9/90] 01ff89021e3b8 fuse: fix possibly missing fuse_copy_finish() call in fuse_notify()
  [10/90] 2c5df5aa20737 fs: fuse: add dev id to /dev/fuse fdinfo
  [11/90] 65b4e381a530b fuse: respect FOPEN_KEEP_CACHE on opendir
  [12/90] ce325706e2906 gve: fix zero-length skb frag with header-split
  [13/90] a1c7cebd09ba1 gve: bound DQO-QPL TX buffer count to the s16 free-list range
  [14/90] 2a21b5638171f af_unix: Set error only when needed in unix_dgram_sendmsg().
  [15/90] 0800bed3020d1 ip6_tunnel: clear skb2->cb[] in ip6ip6_err()
  [16/90] fc8bf3e520149 fuse: rename to fuse_dev_end_requests and make non-static
  [17/90] cf58aad8bd0dd fuse: Move fuse_get_dev to header file
  [18/90] 4c77c0b81fa4b fuse: Move request bits
  [19/90] 61204e8959126 fuse: make args->in_args[0] to be always the header
  [20/90] 86b1edba6fab1 fuse: {io-uring} Handle SQEs - register commands
  [21/90] f3b48a22b13b3 fuse: Make fuse_copy non static
  [22/90] 23e618da66b16 fuse: Add fuse-io-uring handling into fuse_copy
  [23/90] 8e1a76a411662 fuse: {io-uring} Make hash-list req unique finding functions non-static
  [24/90] 13f4aabd54221 fuse: Add io-uring sqe commit and fetch support
  [25/90] bdf66d1122757 fuse: {io-uring} Handle teardown of ring entries
  [26/90] 75269c0ec2434 fuse: {io-uring} Make fuse_dev_queue_{interrupt,forget} non-static
  [27/90] f90d980e974de fuse: Allow to queue fg requests through io-uring
  [28/90] f3b3049ea737d fuse: Allow to queue bg requests through io-uring
  [29/90] 2e08f8acea7b0 fuse: {io-uring} Prevent mount point hang on fuse-server termination
  [30/90] 3e6422c3af4ed fuse: block request allocation until io-uring init is complete
  [31/90] 943184255e041 fuse: enable fuse-over-io-uring
  [32/90] 6bac0a7308dc0 fuse: prevent disabling io-uring on active connections
  [33/90] 717803b9c7b0f fuse: fix uring race condition for null dereference of fc
  [34/90] 9cf7f0cda3d07 fuse: fix possible deadlock if rings are never initialized
  [35/90] 0a18f1e6a4414 fuse: removed unused function fuse_uring_create() from header
  [36/90] 7588551dbd275 fuse: {io-uring} Fix a possible req cancellation race
  [37/90] edbaf9d742ee5 fuse: remove unneeded atomic set in uring creation
  [38/90] d91d97d24dd8c fuse: missing copy_finish in fuse-over-io-uring argument copies
  [39/90] e211fe7162509 fuse: fix io-uring list corruption for terminated non-committed requests
  [40/90] d0587204c54a0 fuse-uring: fix EFAULT clobber in fuse_uring_commit
  [41/90] 2f80b922a4d51 fuse-uring: fix data races on ring->ready
  [42/90] fa659e2d02572 fuse-uring: fix race between registration and connection abortion
  [43/90] e478b47157ecc fuse-uring: check connection abort during ring creation
  [44/90] 360e9d210071f fuse-uring: fix moving cancelled entry to ent_in_userspace list
  [45/90] 66f3c8bc78724 fuse-uring: end fuse_req on io-uring cancel task work
  [46/90] b944db99997af fuse-uring: Avoid use-after-free in fuse_uring_async_stop_queues
  [47/90] f9fee86070bc3 fuse-uring: Avoid queue->stopped races and set/read that value under lock
  [48/90] 24ebc840b3c53 fuse-uring: make a fuse_req on SQE commit only findable after memcpy
  [49/90] 7dff1a13e0048 fuse-uring: remove request-less entries from ent_w_req_queue to fix NULL deref
  [50/90] af1c671f6700c fuse: fix io-uring background queue dispatch on request completion
  [51/90] 5eec5f03311d5 fuse-uring: clear ent->fuse_req in commit_fetch error path
  [52/90] 212eb5c7c74bc fuse: fix missing barrier when checking io-uring readiness
  [53/90] 4b6ef9b53e508 fuse: publish io-uring queues with release semantics
  [54/90] 8f11d66c60b6b fuse: copy request headers via a stack buffer for io-uring
  [55/90] 4129d33daf1dc fuse: Fix the condition to enable over-io-uring
  [56/90] 9b1d61fb4c6f9 configs: enable CONFIG_FUSE_IO_URING=y on x86_64 and aarch64
  [57/90] e015641ecdf28 selftests: filesystems: Add functional test for the abort file in fusectl
  [58/90] e99f156bff9df selftests/fuse: adapt fuse_mnt to libfuse3 API
  [59/90] 98830cc0771f1 selftests/fuse: add ACL_DONT_CACHE regression test
  [60/90] de9b6345ea4eb selftests/fuse: add FUSE io-uring integration test
  [61/90] 00addc65f0fad sctp: stream: fully roll back denied add-stream state
  [62/90] 1a9bfa76ca123 mpls: add seqcount to protect the platform_label{,s} pair
  [63/90] 56c113f201cea crypto: ecdh - implement FIPS PCT
  [64/90] dc34199884a8b crypto: essiv - Zeroize keys on exit in essiv_aead_setkey()
  [65/90] 3b8f720029970 crypto: drbg - Align buffers to at least a cache line
  [66/90] 6af126b329631 mm/gup: introduce pin_user_pages_fast_only()
  [67/90] 02fe5d7c4eeac crypto: rng - Convert crypto_default_rng_refcnt into an unsigned int
  [68/90] ce9d08d5c5366 crypto: rng - Fix priority inversions due to mutex locks
  [69/90] 96934389be763 crypto: sha1 - Add FIPS known answer test for lib/crypto path
  [70/90] 8ab7bf1e8017b crypto: sha256 - Add FIPS known answer test for lib/crypto path
  [71/90] ba20357571a9b When in fips mode, self-test errors must panic.
  [72/90] dd33b139eb0e2 When in fips mode, self-test errors must panic.
  [73/90] d880704d17ca0 In crypto_kdf108_ctr_generate() there is no minimum length check for the digest to be generated - it must be at least 112 bits.
  [74/90] 6fb00963cba70 crypto: Kconfig - Make CRYPTO_FIPS depend on the DRBG being built-in
  [75/90] 1fbab9aeb77f6 crypto: rng - Ensure set_ent is always present
  [76/90] 79c8e8063d51a crypto: rng - Override drivers/char/random in FIPS mode
  [77/90] 578b9ac2b89ad crypto: rng - Implement fast per-CPU DRBG instances
  [78/90] 3339dd5a2baa7 random: Restrict extrng registration to init time
  [79/90] c680a8971fe6e crypto: rng - Only allow the DRBG to register as "stdrng" in FIPS mode
  [80/90] 06a00c32934a3 crypto: rng - Fix tabs vs spaces in the per-CPU DRBG code
  [81/90] ae9cd3947caad crypto: rng - Make the per-CPU DRBG instances permanent
  [82/90] 0157b699fc3b6 crypto: rng - Skip leading zero-length iovec segments
  [83/90] 13b074212024e crypto: rng - Fix spurious EFAULT when the destination PTE is zapped
  [84/90] 88ad2ff1d42dc Revert "mm/gup: reintroduce pin_user_pages_fast_only()"
  [85/90] de070a462bc7e local_lock: Move this_cpu_ptr() notation from internal to main header
  [86/90] 7ad9657601753 crypto: rng - Fix double percpu offset in local_unlock() calls
  [87/90] 9f79fd462ec82 configs: Set CRYPTO_FIPS_CUSTOM_VERSION
  [88/90] ddf3a03bda522 configs: Alter JITTERENTROPY_MEMSIZE
  [89/90] afb0895cc2e21 dh_safe_prime_set_secret misses the check SP800-56Arev3, 5.6.2.1.2 that an externally provided private key is within the valid range 1 <= key <= q-1.
  [90/90] 37b0be2041190 github actions: Use reusable validate kernel commits workflow
[rolling release update] Successfully applied all 90 commits

BUILD

$ egrep -B 5 -A 5 "\[TIMER\]|^Starting Build" $(ls -t kbuild* | head -n1)
/mnt/code/kernel-src-tree-build
Running make mrproper...
  CLEAN   scripts/basic
  CLEAN   scripts/kconfig
  CLEAN   include/config include/generated
[TIMER]{MRPROPER}: 6s
x86_64 architecture detected, copying config
'configs/kernel-x86_64-rhel.config' -> '.config'
Setting Local Version for build
CONFIG_LOCALVERSION="-rocky10_2_rebuild-6e86f4a91bb4"
Making olddefconfig
--
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
Starting Build
  GEN     arch/x86/include/generated/asm/orc_hash.h
  WRAP    arch/x86/include/generated/uapi/asm/bpf_perf_event.h
  WRAP    arch/x86/include/generated/uapi/asm/errno.h
  UPD     include/generated/uapi/linux/version.h
  WRAP    arch/x86/include/generated/uapi/asm/ioctl.h
--
  BTF [M] net/hsr/hsr.ko
  LD [M]  virt/lib/irqbypass.ko
  BTF [M] net/qrtr/qrtr.ko
  BTF [M] net/qrtr/qrtr-mhi.ko
  BTF [M] virt/lib/irqbypass.ko
[TIMER]{BUILD}: 2207s
Making Modules
  SYMLINK /lib/modules/6.12.0-rocky10_2_rebuild-6e86f4a91bb4+/build
  INSTALL /lib/modules/6.12.0-rocky10_2_rebuild-6e86f4a91bb4+/modules.order
  INSTALL /lib/modules/6.12.0-rocky10_2_rebuild-6e86f4a91bb4+/modules.builtin
  INSTALL /lib/modules/6.12.0-rocky10_2_rebuild-6e86f4a91bb4+/modules.builtin.modinfo
--
  STRIP   /lib/modules/6.12.0-rocky10_2_rebuild-6e86f4a91bb4+/kernel/virt/lib/irqbypass.ko
  SIGN    /lib/modules/6.12.0-rocky10_2_rebuild-6e86f4a91bb4+/kernel/net/qrtr/qrtr.ko
  SIGN    /lib/modules/6.12.0-rocky10_2_rebuild-6e86f4a91bb4+/kernel/virt/lib/irqbypass.ko
  SIGN    /lib/modules/6.12.0-rocky10_2_rebuild-6e86f4a91bb4+/kernel/net/qrtr/qrtr-mhi.ko
  DEPMOD  /lib/modules/6.12.0-rocky10_2_rebuild-6e86f4a91bb4+
[TIMER]{MODULES}: 11s
Making Install
  INSTALL /boot
[TIMER]{INSTALL}: 20s
Checking kABI
kABI check passed
Setting Default Kernel to /boot/vmlinuz-6.12.0-rocky10_2_rebuild-6e86f4a91bb4+ and Index to 2
Hopefully Grub2.0 took everything ... rebooting after time metrices
[TIMER]{MRPROPER}: 6s
[TIMER]{BUILD}: 2207s
[TIMER]{MODULES}: 11s
[TIMER]{INSTALL}: 20s
[TIMER]{TOTAL} 2249s
Rebooting in 10 seconds

KSelfTest

$ ./kernel-tools/kernel_auto_rebuild/get_kselftest_diff.sh
selftest-6.12.0-jmaple_rlc-10_6.12.0-211.60.1.el10_2-0a34ea7c8b1b+-1.log: 488 passed
selftest-6.12.0-jmaple_rlc-10_6.12.0-211.65.1.el10_2-2a62602844a81+-1.log: 489 passed
selftest-6.12.0-jmaple_rlc-10_6.12.0-211.66.1.el10_2-2ef1ef9374eac+-1.log: 488 passed
selftest-6.12.0-jmaple_rlc-10_6.12.0-211.68.1.el10_2-d0aba05903d18+-1.log: 490 passed

Before: selftest-6.12.0-jmaple_rlc-10_6.12.0-211.66.1.el10_2-2ef1ef9374eac+-1.log
After: selftest-6.12.0-jmaple_rlc-10_6.12.0-211.68.1.el10_2-d0aba05903d18+-1.log
Diff:
+ok 1 selftests: timers: posix_timers
+ok 2 selftests: seccomp: seccomp_benchmark

roxanan1996 and others added 30 commits October 28, 2026 09:33
Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira LE-3207
feature tools_hv
commit-author Shradha Gupta <shradhagupta@linux.microsoft.com>
commit a9c0b33

Allow the KVP daemon to log the KVP updates triggered in the VM
with a new debug flag(-d).
When the daemon is started with this flag, it logs updates and debug
information in syslog with loglevel LOG_DEBUG. This information comes
in handy for debugging issues where the key-value pairs for certain
pools show mismatch/incorrect values.
The distro-vendors can further consume these changes and modify the
respective service files to redirect the logs to specific files as
needed.

	Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
	Reviewed-by: Naman Jain <namjain@linux.microsoft.com>
	Reviewed-by: Dexuan Cui <decui@microsoft.com>
Link: https://lore.kernel.org/r/1744715978-8185-1-git-send-email-shradhagupta@linux.microsoft.com
	Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <1744715978-8185-1-git-send-email-shradhagupta@linux.microsoft.com>
(cherry picked from commit a9c0b33)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
…nused()

jira SECO-468
commit-author Luis Henriques <luis@igalia.com>
commit 395b955

Add and export a new helper d_dispose_if_unused() which is simply a wrapper
around to_shrink_list(), to add an entry to a dispose list if it's not used
anymore.

Also export shrink_dentry_list() to kill all dentries in a dispose list.

	Suggested-by: Miklos Szeredi <miklos@szeredi.hu>
	Signed-off-by: Luis Henriques <luis@igalia.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit 395b955)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira SECO-478
RFBugFix: FUSE
commit-author Miklos Szeredi <mszeredi@redhat.com>
commit b4c173d

Fuse allows the value of a symlink to change and this property is exploited
by some filesystems (e.g. CVMFS).

It has been observed, that sometimes after changing the symlink contents,
the value is truncated to the old size.

This is caused by fuse_getattr() racing with fuse_reverse_inval_inode().
fuse_reverse_inval_inode() updates the fuse_inode's attr_version, which
results in fuse_change_attributes() exiting before updating the cached
attributes

This is okay, as the cached attributes remain invalid and the next call to
fuse_change_attributes() will likely update the inode with the correct
values.

The reason this causes problems is that cached symlinks will be
returned through page_get_link(), which truncates the symlink to
inode->i_size.  This is correct for filesystems that don't mutate
symlinks, but in this case it causes bad behavior.

The solution is to just remove this truncation.  This can cause a
regression in a filesystem that relies on supplying a symlink larger than
the file size, but this is unlikely.  If that happens we'd need to make
this behavior conditional.

	Reported-by: Laura Promberger <laura.promberger@cern.ch>
	Tested-by: Sam Lewis <samclewis@google.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Link: https://lore.kernel.org/r/20250220100258.793363-1-mszeredi@redhat.com
	Reviewed-by: Bernd Schubert <bschubert@ddn.com>
	Signed-off-by: Christian Brauner <brauner@kernel.org>
(cherry picked from commit b4c173d)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira SECO-478
RFBugFix: FUSE
commit-author Luis Henriques <luis@igalia.com>
commit 2396356
upstream-diff | conflict in fs/fuse/dir.c due to missing this piece:
       d701902 - fuse: return correct dentry for ->mkdir
       Which is a part of a larger changeset here that we're not going to
       take: https://lore.kernel.org/all/20250227013949.536172-1-neilb@suse.de/
       | Additionally this bumps the Kernel FUSE API minor version from 41
       to 44.  The interface into via fuse3 currently in Rocky 10.1 is
       limited to API 38 anyways at 3.16.2.
       | There is a build conflict due to a major rewrite of the d_revalidate
       calls which now includes the parent directory being passed.
       5be1fa8 Pass parent directory inode and expected name to ->d_revalidate()
       In this case we can use the dentry->i_sb because we only need the
       superblock for get_fuse_conn_super().

Currently userspace is able to notify the kernel to invalidate the cache
for an inode.  This means that, if all the inodes in a filesystem need to
be invalidated, then userspace needs to iterate through all of them and do
this kernel notification separately.

This patch adds the concept of 'epoch': each fuse connection will have the
current epoch initialized and every new dentry will have it's d_time set to
the current epoch value.  A new operation will then allow userspace to
increment the epoch value.  Every time a dentry is d_revalidate()'ed, it's
epoch is compared with the current connection epoch and invalidated if it's
value is different.

	Signed-off-by: Luis Henriques <luis@igalia.com>
	Tested-by: Laura Promberger <laura.promberger@cern.ch>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit 2396356)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>

build fix: fuse: add more control over cache invalidation behaviour
jira SECO-478
BUGFIX: FUSE
commit-author Miklos Szeredi <mszeredi@redhat.com>
commit 0b563aa

In case of FUSE_NOTIFY_RESEND and FUSE_NOTIFY_INC_EPOCH fuse_copy_finish()
isn't called.

Fix by always calling fuse_copy_finish() after fuse_notify().  It's a no-op
if called a second time.

Fixes: 760eac7 ("fuse: Introduce a new notification type for resend pending requests")
Fixes: 2396356 ("fuse: add more control over cache invalidation behaviour")
	Cc: <stable@vger.kernel.org> # v6.9
	Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit 0b563aa)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira SECO-511
commit-author Chen Linxuan <chenlinxuan@uniontech.com>
commit f092229
upstream-diff | There were conflicts seen while applying
this patch due to the following missing commit :-
786412a ("fuse: enable fuse-over-io-uring")

This commit add fuse connection device id to
fdinfo of opened /dev/fuse files.

Related discussions can be found at links below.

Link: https://lore.kernel.org/all/CAJfpegvEYUgEbpATpQx8NqVR33Mv-VK96C+gbTag1CEUeBqvnA@mail.gmail.com/
	Signed-off-by: Chen Linxuan <chenlinxuan@uniontech.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit f092229)
	Signed-off-by: Shreeya Patel <spatel@ciq.com>
jira SECO-518
commit-author Amir Goldstein <amir73il@gmail.com>
commit 03f275a

The re-factoring of fuse_dir_open() missed the need to invalidate
directory inode page cache with open flag FOPEN_KEEP_CACHE.

Fixes: 7de64d5 ("fuse: break up fuse_open_common()")
	Reported-by: Prince Kumar <princer@google.com>
Closes: https://lore.kernel.org/linux-fsdevel/CAEW=TRr7CYb4LtsvQPLj-zx5Y+EYBmGfM24SuzwyDoGVNoKm7w@mail.gmail.com/
	Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/r/20250101130037.96680-1-amir73il@gmail.com
	Reviewed-by: Bernd Schubert <bernd.schubert@fastmail.fm>
	Signed-off-by: Christian Brauner <brauner@kernel.org>
(cherry picked from commit 03f275a)
	Signed-off-by: Shreeya Patel <spatel@ciq.com>
jira KERNEL-1217
commit-author Jordan Rhee <jordanrhee@google.com>
commit 6bf1457
upstream-diff RLC 10 predates the page-pool conversion and has no
  gve_free_buffer(); the freed buffer goes through
  gve_enqueue_buf_state(rx, &rx->dqo.recycled_buf_states, buf_state),
  the same form this tree's rx error path uses, which is what
  upstream's helper reduces to on non-page-pool queues.

When header split is enabled and a header-only packet is
received such as a pure TCP ACK, GVE will indicate an
RX SKB with a zero-length fragment. If this SKB is then
hairpinned and sent back out, the GVE TX path will emit
a zero-length descriptor. Hardware considers this
an illegal descriptor and stops the queue, causing a
TX timeout and interface reset.

Fix it by not adding the zero-length skb frag.

	Cc: stable@vger.kernel.org
Fixes: 5e37d82 ("gve: Add header split data path")
	Suggested-by: Praveen Kaligineedi <pkaligineedi@google.com>
Co-developed-by: Ziwei Xiao <ziweixiao@google.com>
	Signed-off-by: Ziwei Xiao <ziweixiao@google.com>
	Signed-off-by: Jordan Rhee <jordanrhee@google.com>
	Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com>
Link: https://patch.msgid.link/20260807224315.234152-2-hramamurthy@google.com
	Signed-off-by: Jakub Kicinski <kuba@kernel.org>

(cherry picked from commit 6bf1457)
	Signed-off-by: Shreeya Patel <spatel@ciq.com>
jira KERNEL-1217

gve_tx_qpl_buf_init() sizes the TX buffer free list as
GVE_TX_BUFS_PER_PAGE_DQO * num_entries, but the free-list links
(tx_qpl_buf_next) are s16.  GVE_TX_BUFS_PER_PAGE_DQO is PAGE_SIZE >> 11,
so on 64K-page builds (the aarch64-64k config ships CONFIG_GVE=m) a
4096-entry TX ring yields 2048 pages and 65536 buffers: entry 32767 is
seeded with a link of 32768, which reads back as -32768, and once 32768
buffers have been allocated gve_alloc_tx_qpl_buf() dereferences
tx_qpl_buf_next[-32768] and returns ids that index outside the QPL.

Clamp the count to S16_MAX, leaving an oversized QPL's tail unused
rather than mislinked.

This is not unique to this backport: upstream has the same unclamped
math at its tip. Kept as a separate commit so it can be dropped in
favor of the upstream fix once one lands;

Fixes: 07993df ("gve: Update QPL page registration logic")
Signed-off-by: Shreeya Patel <spatel@ciq.com>
cve-pre CVE-2026-53361
commit-author Kuniyuki Iwashima <kuniyu@amazon.com>
commit 001a250
upstream-diff |
    Context difference due to backported commit by redhat that
    technically comes after this change.
    3849005
    [af_unix: Don't call wait_for_unix_gc() on every sendmsg().]

We will introduce skb drop reason for AF_UNIX, then we need to
set an errno and a drop reason for each path.

Let's set an error only when it's needed in unix_dgram_sendmsg().

Then, we need not (re)set 0 to err.

	Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
	Signed-off-by: Paolo Abeni <pabeni@redhat.com>

(cherry picked from commit 001a250)
	Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
cve CVE-2026-74597
commit-author Zhiling Zou <zhilinz@nebusec.ai>
commit f803c08

ip6ip6_err() clones an outer IPv6 ICMP error skb, pulls it to the
quoted inner IPv6 packet, and then passes the clone to icmpv6_send().
The clone still carries the outer packet's inet6_skb_parm in skb->cb.

If the outer packet had a Home Address Option, IP6CB(skb2)->dsthao
remains non-zero after skb_pull(). icmpv6_send() later calls
mip6_addr_swap(), which uses that stale dsthao offset against the quoted
inner packet. A malformed inner destination-options header can then make
the HAO lookup and address swap run past the end of the quoted packet
and corrupt skb_shared_info.

Clear skb2->cb[] before pulling the quoted inner IPv6 packet so the
reply path does not reuse metadata left by the outer IPv6 stack.

Fixes: e490d1d ("[IPV6] IP6TUNNEL: Split out generic routine in ip6ip6_err().")
	Cc: stable@vger.kernel.org
	Reported-by: Vega <vega@nebusec.ai>
	Signed-off-by: Zhiling Zou <zhilinz@nebusec.ai>
	Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/fe1a5e765fbca88d69391887f0ed26a19e3e4d39.1785736562.git.zhilinz@nebusec.ai
	Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit f803c08)
	Signed-off-by: Shreeya Patel <spatel@ciq.com>
jira SECO-478
RFE: FUSE_IO_URING
commit-author Bernd Schubert <bschubert@ddn.com>
commit 92270d0

This function is needed by fuse_uring.c to clean ring queues,
so make it non static. Especially in non-static mode the function
name 'end_requests' should be prefixed with fuse_

	Signed-off-by: Bernd Schubert <bschubert@ddn.com>
	Reviewed-by: Josef Bacik <josef@toxicpanda.com>
	Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
	Reviewed-by: Luis Henriques <luis@igalia.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit 92270d0)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira SECO-478
RFE: FUSE_IO_URING
commit-author Bernd Schubert <bschubert@ddn.com>
commit 867d93d

Another preparation patch, as this function will be needed by
fuse/dev.c and fuse/dev_uring.c.

	Signed-off-by: Bernd Schubert <bschubert@ddn.com>
	Reviewed-by: Josef Bacik <josef@toxicpanda.com>
	Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
	Reviewed-by: Luis Henriques <luis@igalia.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit 867d93d)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira SECO-478
RFE: FUSE_IO_URING
commit-author Bernd Schubert <bschubert@ddn.com>
commit 88be7aa

These are needed by fuse-over-io-uring.

	Signed-off-by: Bernd Schubert <bschubert@ddn.com>
	Reviewed-by: Josef Bacik <josef@toxicpanda.com>
	Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
	Reviewed-by: Luis Henriques <luis@igalia.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit 88be7aa)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira SECO-478
RFE: FUSE_IO_URING
commit-author Bernd Schubert <bschubert@ddn.com>
commit 7ccd86b
upstream-diff | Context conflict on missing fs/fuse/fuse_i.h commit
	4174867 -virtiofs: use pages instead of pointer for kernel direct IO

This change sets up FUSE operations to always have headers in
args.in_args[0], even for opcodes without an actual header.
This step prepares for a clean separation of payload from headers,
initially it is used by fuse-over-io-uring.

For opcodes without a header, we use a zero-sized struct as a
placeholder. This approach:
- Keeps things consistent across all FUSE operations
- Will help with payload alignment later
- Avoids future issues when header sizes change

Op codes that already have an op code specific header do not
need modification.
Op codes that have neither payload nor op code headers
are not modified either (FUSE_READLINK and FUSE_DESTROY).
FUSE_BATCH_FORGET already has the header in the right place,
but is not using fuse_copy_args - as -over-uring is currently
not handling forgets it does not matter for now, but header
separation will later need special attention for that op code.

Correct the struct fuse_args->in_args array max size.

	Signed-off-by: Bernd Schubert <bschubert@ddn.com>
	Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
	Reviewed-by: Luis Henriques <luis@igalia.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit 7ccd86b)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira SECO-478
RFE: FUSE_IO_URING
commit-author Bernd Schubert <bschubert@ddn.com>
commit 24fe962
upstream-diff | Context diff due to missing commit on fs/fuse/Makefile
	2b3933b - fuse: enable dynamic configuration of fuse max pages
			limit (FUSE_MAX_MAX_PAGES)
	Context difference due to future feature enabled earlier in git
	log order as well.

This adds basic support for ring SQEs (with opcode=IORING_OP_URING_CMD).
For now only FUSE_IO_URING_CMD_REGISTER is handled to register queue
entries.

	Signed-off-by: Bernd Schubert <bschubert@ddn.com>
	Reviewed-by: Pavel Begunkov <asml.silence@gmail.com> # io_uring
	Reviewed-by: Luis Henriques <luis@igalia.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit 24fe962)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira SECO-478
RFE: FUSE_IO_URING
commit-author Bernd Schubert <bschubert@ddn.com>
commit d0f9c62

Move 'struct fuse_copy_state' and fuse_copy_* functions
to fuse_dev_i.h to make it available for fuse-io-uring.
'copy_out_args()' is renamed to 'fuse_copy_out_args'.

	Signed-off-by: Bernd Schubert <bschubert@ddn.com>
	Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
	Reviewed-by: Luis Henriques <luis@igalia.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit d0f9c62)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira SECO-478
RFE: FUSE_IO_URING
commit-author Bernd Schubert <bschubert@ddn.com>
commit f773a7c

Add special fuse-io-uring into the fuse argument
copy handler.

	Signed-off-by: Bernd Schubert <bschubert@ddn.com>
	Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
	Reviewed-by: Luis Henriques <luis@igalia.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit f773a7c)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira SECO-478
RFE: FUSE_IO_URING
commit-author Bernd Schubert <bschubert@ddn.com>
commit 3821336

fuse-over-io-uring uses existing functions to find requests based
on their unique id - make these functions non-static.

	Signed-off-by: Bernd Schubert <bschubert@ddn.com>
	Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
	Reviewed-by: Luis Henriques <luis@igalia.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit 3821336)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira SECO-478
RFE: FUSE_IO_URING
commit-author Bernd Schubert <bschubert@ddn.com>
commit c090c8a

This adds support for fuse request completion through ring SQEs
(FUSE_URING_CMD_COMMIT_AND_FETCH handling). After committing
the ring entry it becomes available for new fuse requests.
Handling of requests through the ring (SQE/CQE handling)
is complete now.

Fuse request data are copied through the mmaped ring buffer,
there is no support for any zero copy yet.

	Signed-off-by: Bernd Schubert <bschubert@ddn.com>
	Reviewed-by: Pavel Begunkov <asml.silence@gmail.com> # io_uring
	Reviewed-by: Luis Henriques <luis@igalia.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit c090c8a)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira SECO-478
RFE: FUSE_IO_URING
commit-author Bernd Schubert <bschubert@ddn.com>
commit 4a9bfb9

On teardown struct file_operations::uring_cmd requests
need to be completed by calling io_uring_cmd_done().
Not completing all ring entries would result in busy io-uring
tasks giving warning messages in intervals and unreleased
struct file.

Additionally the fuse connection and with that the ring can
only get released when all io-uring commands are completed.

Completion is done with ring entries that are
a) in waiting state for new fuse requests - io_uring_cmd_done
is needed

b) already in userspace - io_uring_cmd_done through teardown
is not needed, the request can just get released. If fuse server
is still active and commits such a ring entry, fuse_uring_cmd()
already checks if the connection is active and then complete the
io-uring itself with -ENOTCONN. I.e. special handling is not
needed.

This scheme is basically represented by the ring entry state
FRRS_WAIT and FRRS_USERSPACE.

Entries in state:
- FRRS_INIT: No action needed, do not contribute to
  ring->queue_refs yet
- All other states: Are currently processed by other tasks,
  async teardown is needed and it has to wait for the two
  states above. It could be also solved without an async
  teardown task, but would require additional if conditions
  in hot code paths. Also in my personal opinion the code
  looks cleaner with async teardown.

	Signed-off-by: Bernd Schubert <bschubert@ddn.com>
	Reviewed-by: Pavel Begunkov <asml.silence@gmail.com> # io_uring
	Reviewed-by: Luis Henriques <luis@igalia.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit 4a9bfb9)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira SECO-478
RFE: FUSE_IO_URING
commit-author Bernd Schubert <bschubert@ddn.com>
commit ba74ba5

These functions are also needed by fuse-over-io-uring.

	Signed-off-by: Bernd Schubert <bschubert@ddn.com>
	Reviewed-by: Luis Henriques <luis@igalia.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit ba74ba5)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira SECO-478
RFE: FUSE_IO_URING
commit-author Bernd Schubert <bschubert@ddn.com>
commit c2c9af9

This prepares queueing and sending foreground requests through
io-uring.

	Signed-off-by: Bernd Schubert <bschubert@ddn.com>
	Reviewed-by: Pavel Begunkov <asml.silence@gmail.com> # io_uring
	Reviewed-by: Luis Henriques <luis@igalia.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit c2c9af9)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira SECO-478
RFE: FUSE_IO_URING
commit-author Bernd Schubert <bschubert@ddn.com>
commit 857b026

This prepares queueing and sending background requests through
io-uring.

	Signed-off-by: Bernd Schubert <bschubert@ddn.com>
	Reviewed-by: Pavel Begunkov <asml.silence@gmail.com> # io_uring
	Reviewed-by: Luis Henriques <luis@igalia.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit 857b026)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira SECO-478
RFE: FUSE_IO_URING
commit-author Bernd Schubert <bschubert@ddn.com>
commit b6236c8

When the fuse-server terminates while the fuse-client or kernel
still has queued URING_CMDs, these commands retain references
to the struct file used by the fuse connection. This prevents
fuse_dev_release() from being invoked, resulting in a hung mount
point.

This patch addresses the issue by making queued URING_CMDs
cancelable, allowing fuse_dev_release() to proceed as expected
and preventing the mount point from hanging.

	Signed-off-by: Bernd Schubert <bschubert@ddn.com>
	Reviewed-by: Pavel Begunkov <asml.silence@gmail.com> # io_uring
	Reviewed-by: Luis Henriques <luis@igalia.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit b6236c8)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira SECO-478
RFE: FUSE_IO_URING
commit-author Bernd Schubert <bernd@bsbernd.com>
commit 3393ff9
upstream-diff | Context conflict on missing fs/fuse/fuse_i.h commit
	4174867 -virtiofs: use pages instead of pointer for kernel direct IO

Avoid races and block request allocation until io-uring
queues are ready.

This is a especially important for background requests,
as bg request completion might cause lock order inversion
of the typical queue->lock and then fc->bg_lock

    fuse_request_end
       spin_lock(&fc->bg_lock);
       flush_bg_queue
         fuse_send_one
           fuse_uring_queue_fuse_req
           spin_lock(&queue->lock);

	Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
	Reviewed-by: Luis Henriques <luis@igalia.com>
	Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
(cherry picked from commit 3393ff9)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jallisonciq and others added 20 commits October 28, 2026 09:34
Requested by the lab.

Signed-off-by: Jeremy Allison <jallison@ciq.com>
Requested by the lab.

Signed-off-by: Jeremy Allison <jallison@ciq.com>
…the digest to be generated - it must be at least 112 bits.

Requested by the lab.

Signed-off-by: Jeremy Allison <jallison@ciq.com>
    When FIPS mode is enabled (via fips=1), there is an absolute need for the
    DRBG to be available. This is at odds with the fact that the DRBG can be
    built as a module when in FIPS mode, leaving critical RNG functionality at
    the whims of userspace.

    Userspace could simply rmmod the DRBG module, or not provide it at all and
    thus a different stdrng algorithm could be used without anyone noticing.

    Additionally, when running a FIPS-enabled userspace, modprobe itself may
    perform a getrandom() syscall _before_ loading a given module. As a result,
    there's a possible deadlock scenario where the RNG core (crypto/rng.c)
    initializes _before_ the DRBG, thereby installing its getrandom() override
    without having an stdrng algorithm available. Then, when userspace calls
    getrandom() which redirects to the override in crypto/rng.c,
    crypto_alloc_rng("stdrng") invokes the UMH (modprobe) to load the DRBG
    (which is aliased to stdrng). And *then* that modprobe invocation gets
    stuck at getrandom() because there's no stdrng algorithm available!

    There are too many risks that come with allowing the DRBG and RNG core to
    be modular for FIPS mode. Therefore, make CRYPTO_FIPS require the DRBG to
    be built-in, which in turn makes the DRBG require the RNG core to be
    built-in. That way, it's guaranteed for these drivers to be built-in when
    running in FIPS mode.

    Also clean up the CRYPTO_FIPS option name and remove the CRYPTO_ANSI_CPRNG
    dependency since it's obsolete for FIPS now.

    Signed-off-by: Sultan Alsawaf <sultan@ciq.com>

    Signed-off-by: Jonathan Maple <jmaple@ciq.com>

Signed-off-by: Jeremy Allison <jallison@ciq.com>
cve CVE-2025-40109
commit c0d3672 upstream.

Ensure that set_ent is always set since only drbg provides it.

Fixes: 77ebdab ("crypto: af_alg - add extra parameters for DRBG interface")
Reported-by: Yiqi Sun <sunyiqixm@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit-author Herbert Xu <herbert.xu@redhat.com>
commit 8b0beca705b3877e24cccdd672422c66bbd75635
commit-source https://gitlab.com/cki-project/kernel-ark

Upstream Status: RHEL only

Restore the changes to use the crypto RNG in drivers/char/random
which were reverted after 5.18.

This reverts commit 297bcb88233101e8d5062729ff3a5f989bad1c3b.

This also brings the code up-to-date with respect to centos-stream
commit 9de3a73 so that changes that
were made after the kernel-ark revert have been brought in.

Signed-off-by: Herbert Xu <herbert.xu@redhat.com>
Signed-off-by: Jeremy Allison <jallison@ciq.com>
When the kernel is booted with fips=1, the RNG exposed to userspace is
hijacked away from the CRNG and redirects to crypto_devrandom_read_iter(),
which utilizes the DRBG.

Notably, crypto_devrandom_read_iter() maintains just two global DRBG
instances _for the entire system_, and the two instances serve separate
request types: one instance for GRND_RANDOM requests (crypto_reseed_rng),
and one instance for non-GRND_RANDOM requests (crypto_default_rng). So in
essence, for requests of a single type, there is just one global RNG for
all CPUs in the entire system, which scales _very_ poorly.

To make matters worse, the temporary buffer used to ferry data between the
DRBG and userspace is woefully small at only 256 bytes, which doesn't do a
good job of maximizing throughput from the DRBG. This results in lost
performance when userspace requests >256 bytes; it is observed that DRBG
throughput improves by 70% on an i9-13900H when the buffer size is
increased to 4096 bytes (one page). Going beyond the size of one page up to
the DRBG maximum request limit of 65536 bytes produces diminishing returns
of only 3% improved throughput in comparison. And going below the size of
one page produces progressively less throughput at each power of 2: there's
a 5% loss going from 4096 bytes to 2048 bytes and a 9% loss going from 2048
bytes to 1024 bytes.

Thus, this implements per-CPU DRBG instances utilizing a page-sized buffer
for each CPU to utilize the DRBG itself more effectively. On top of that,
for non-GRND_RANDOM requests, the DRBG's operations now occur under a local
lock that disables preemption on non-PREEMPT_RT kernels, which not only
keeps each CPU's DRBG instance isolated from another, but also improves
temporal cache locality while the DRBG actively generates a new string of
random bytes.

Prefaulting one user destination page at a time is also employed to prevent
a DRBG instance from getting blocked on page faults, thereby maximizing the
use of the DRBG so that the only bottleneck is the DRBG itself.

Signed-off-by: Sultan Alsawaf <sultan@ciq.com>
It is technically a risk to permit extrng registration by modules after
kernel init completes. Since there is only one user of the extrng interface
and it is imperative that it is the _only_ registered extrng for FIPS
compliance, restrict the extrng registration interface to only permit
registration during kernel init and only from built-in drivers.

This also eliminates the risks associated with the extrng interface itself
being designed to solely accommodate a single registration, which would
therefore permit the registered extrng to be overridden or even removed by
an unrelated module.

Signed-off-by: Sultan Alsawaf <sultan@ciq.com>
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
In FIPS mode, the DRBG must take precedence over all stdrng algorithms.
The only problem standing in the way of this is that a different stdrng
algorithm could get registered and utilized before the DRBG is registered,
and since crypto_alloc_rng() only allocates an stdrng algorithm when
there's no existing allocation, this means that it's possible for the wrong
stdrng algorithm to remain in use indefinitely.

This issue is also often impossible to observe from userspace; an RNG other
than the DRBG could be used somewhere in the kernel and userspace would be
none the wiser.

To ensure this can never happen, only allow stdrng instances from the DRBG
to be registered when running in FIPS mode. This works since the previous
commit forces the DRBG to be built into the kernel when CONFIG_CRYPTO_FIPS
is enabled, so the DRBG's presence is guaranteed when fips_enabled is true.

Signed-off-by: Sultan Alsawaf <sultan@ciq.com>
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
The 6.18.y version of "crypto: rng - Implement fast per-CPU DRBG instances"
picked up a few spots that use spaces where the ciqlts9_6 tree's version
[1] uses tabs: the lock_default_rng() comment's numbered list, the line
continuations in the unlock_local_rng() macro, and a brace in
crypto_devrandom_read_iter(). A nearby block comment was also missing the
space before its '*'. Fix them up.

[1] b0c560a

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Sultan Alsawaf <sultan@ciq.com>
The per-CPU DRBG instances used to be torn down by crypto_del_default_rng()
under del_pcpu_rwsem, and the read path took that rwsem as a reader to keep
an instance from being freed out from under it. That machinery only made
sense back when the extrng override could be unregistered and the DRBG
could be built as a module.

That's no longer the case. extrng registration is now restricted to init
time from built-in drivers, and FIPS mode requires the DRBG to be built-in,
so the registered DRBG can't be unregistered or swapped out. As such, the
per-CPU instances are never torn down, and the deletion rwsem just adds a
lock to the hot read path for no reason.

Drop the deletion rwsem and crypto_del_pcpu_rng(), and stop freeing the
per-CPU instances in crypto_del_default_rng(). Since the instances are
permanent now, allocate their pages once at init time with __GFP_NOFAIL and
ditch free_pcpu_inst() along with the failure paths in crypto_rng_init();
failing to install the RNG override in FIPS mode would be catastrophic, so
the setup isn't allowed to fail anyway.

This brings the per-CPU DRBG implementation in line with the ciqlts9_6
tree's version of "crypto: rng - Implement fast per-CPU DRBG instances"
[1].

[1] b0c560a

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Sultan Alsawaf <sultan@ciq.com>
The fast per-CPU DRBG path computes its initial user destination address
straight from the iov_iter. For an ITER_IOVEC iter it reads iter_iov_addr()
and iter_iov_len() of the current segment, but when the iovec leads with
one or more zero-length segments, the current segment is one of those empty
entries. iter_iov_addr() then hands back the base of an empty segment,
which is whatever userspace put there: its base can be NULL or some other
unwritable address, since a zero-length segment is never actually touched.

Right after the setup, that address is prefaulted, and on a bogus base it
fails. A failed prefault on the very first address is treated as fatal, so
the whole read bails out to -EFAULT even though there are perfectly good
non-empty segments later in the iovec. This is reachable with something as
simple as readv() on /dev/urandom where the first iovec entry is {NULL, 0}.

Fix it by advancing the iterator by zero before reading the first address.
The iovec advance loop walks past every leading empty segment and stops at
the first non-empty one, and there's guaranteed to be such a segment
because iov_iter_count() is nonzero at this point. Empty segments that crop
up mid-stream are already skipped by the per-copy advance, so this only
needs to run once during setup.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Sultan Alsawaf <sultan@ciq.com>
While GUP pinning makes it possible to pin the page _backing_ a user
address, it *doesn't* pin the page table entry (PTE) for that mapping. This
means the pinned physical page can be separated from the user address it
was backing, and even back a _different_ user address within the same
process. PTE zapping naturally happens during memory reclaim when memory
pressure is elevated, and can even be done directly by userspace via
madvise(MADV_DONTNEED).

Since the optimized per-CPU DRBG loop assumes copy_to_user_nofault() will
always succeed on a GUP-pinned page, it immediately bails out when the
nofault copy actually *does* fail for the reasons described above. This
results in either fewer than requested random bytes copied or, more
seriously, a spurious EFAULT returned to userspace when no random bytes
were copied.

As it turns out, there's no way to pin a PTE. That means it's not possible
to guarantee a 100% success rate for the copy_to_user_nofault() attempt.

Fix this by handling copy_to_user_nofault() errors correctly with a fall
back to a faultable copy attempt outside of the RNG lock. In order to
guarantee forward progress for the caller, an on-stack bounce buffer is
used to copy up to 256 bytes of the generated random bytes whenever this
happens rather than discarding the whole thing.

There's no need to use GUP pinning anymore since there's no use for having
a page pinned without pinning a PTE to go along with that page, hence the
page pinning is eliminated which saves a software page table walk that was
performed for _at least_ every destination page.

Reported-by: Kun Yi <kunyi@google.com>
Signed-off-by: Sultan Alsawaf <sultan@ciq.com>
This reverts commit ef467f3.

This helper is no longer used by the FIPS-mode RNG, which was the
motivation for reintroducing it. Remove it.

Signed-off-by: Sultan Alsawaf <sultan@ciq.com>
commit-author Sebastian Andrzej Siewior <bigeasy@linutronix.de>
commit 7ff495e

local_lock.h is the main header for the local_lock_t type and provides
wrappers around internal functions prefixed with __ in
local_lock_internal.h.

Move the this_cpu_ptr() dereference of the variable from the internal to
the main header. Since it is all macro implemented, this_cpu_ptr() will
still happen within the preempt/ IRQ disabled section.

This frees the internal implementation (__) to be used on local_lock_t
types which are local variables and must not be accessed via
this_cpu_ptr().

	Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
	Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
	Acked-by: Waiman Long <longman@redhat.com>
	Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/all/20250630075138.3448715-2-bigeasy@linutronix.de

(cherry picked from commit 7ff495e)
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
local_unlock() is supposed to take a percpu pointer, which it then offsets
for the current CPU. The problem is that the per-CPU DRBG code passes
local_unlock() a pointer that has *already been offset for the current
CPU*, so the percpu offset gets added twice. `pcri` is the percpu pointer
and `cri` is the offset `pcri` pointer for the current CPU; passing `cri`
to local_unlock() results in the current CPU's offset getting added again
and thus the resulting pointer is garbage.

This went unnoticed at runtime because local_unlock() only dereferences
that pointer on PREEMPT_RT or CONFIG_DEBUG_LOCK_ALLOC=y kernels. The
pointer is never actually used otherwise.

This also went unnoticed at compile time because, for x86_64, __percpu only
expands to something on GCC 14+; __percpu is otherwise an empty macro. So
there's no pointer type mismatch detected at compile time on older GCC
versions. On GCC 14+, the following compile error occurs:

  ../crypto/rng.c: In function 'lock_default_rng':
  ../include/linux/percpu-defs.h:221:45: error: initialization from pointer to non-enclosed address space

Fix it by using __local_unlock() instead, which eliminates the duplicate
per-CPU offset addition. While using local_unlock() with `pcri` also works,
using `cri` with __local_unlock() is leaner because it doesn't need to redo
the offset addition, saving an instruction on kernels that actually use the
pointer.

Signed-off-by: Sultan Alsawaf <sultan@ciq.com>
Add CONFIG_CRYPTO_FIPS_CUSTOM_VERSION=y,

CONFIG_CRYPTO_FIPS_VERSION="ciq.6.12.20260826"

Requested by lab.

Signed-off-by: Jeremy Allison <jallison@ciq.com>
Unset CRYPTO_JITTERENTROPY_MEMSIZE_2, set CRYPTO_JITTERENTROPY_MEMSIZE_128.

CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKS=512
CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE=256

Requested by lab.

Signed-off-by: Jeremy Allison <jallison@ciq.com>
…at an externally provided private key is within the valid range 1 <= key <= q-1.

Requested by lab.

Signed-off-by: Jeremy Allison <jallison@ciq.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Simplifies the workflow to use the reusable workflow defined in main
branch. This reduces duplication and makes the workflow easier to
maintain across multiple branches.

The workflow was renamed because it now includes validation over
and above just checking for upstream fixes

Signed-off-by: Jonathan Maple <jmaple@ciq.com>

@bmastbergen bmastbergen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥌

@bmastbergen
bmastbergen requested a review from a team October 28, 2026 16:27
@github-actions

Copy link
Copy Markdown

🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/40726578898

@github-actions

Copy link
Copy Markdown

🔍 Upstream Linux Kernel Commit Check

  • ⚠️ PR commit 34bc2a94337 (fuse: add more control over cache invalidation behaviour) references upstream commit
    2396356a945b which has been referenced by a Fixes: tag in the upstream
    Linux kernel:
    6648f54f345 fuse: move "epoch" from dentry.d_time to fuse_dentry.epoch (Miklos Szeredi)
    0fa8346099b fuse: invalidate readdir cache on epoch bump (Jun Wu)
    5a6baf20461 fuse: fix uninit-value in fuse_dentry_revalidate() (Luis Henriques) (CVE-2026-53311)
  • ⚠️ PR commit 5f61784bbaf (fuse: {io-uring} Handle SQEs - register commands) references upstream commit
    24fe962c86f5 which has been referenced by a Fixes: tag in the upstream
    Linux kernel:
    1dfe2a220e9 fuse: fix uring race condition for null dereference of fc (Joanne Koong)
  • ⚠️ PR commit 2b890f06ee3 (fuse: Add io-uring sqe commit and fetch support) references upstream commit
    c090c8abae4b which has been referenced by a Fixes: tag in the upstream
    Linux kernel:
    c1338aae7b4 fuse: don't BUG when the copy buffer is exhausted (Xiang Mei)
  • ❗ PR commit af565460daf (crypto: rng - Override drivers/char/random in FIPS mode) references upstream commit
    8b0beca705b3 which does not exist in the upstream Linux kernel.

  • ❗ PR commit af565460daf (crypto: rng - Override drivers/char/random in FIPS mode) references upstream commit
    9de3a7339793 which does not exist in the upstream Linux kernel.

This is an automated message from the kernel commit checker workflow.

@github-actions

Copy link
Copy Markdown

❌ Diffofdiffs: 26 of 57 backports differ from upstream, 1 couldn't be compared

View the diffofdiffs report.

Open to anyone signed in to GitHub. Report expires 2027-01-26 16:18 UTC.

# Subject Backport Upstream
1 fuse: add more control over cache invalidation behaviour 34bc2a943373 2396356a945b
2 fs: fuse: add dev id to /dev/fuse fdinfo b233090860b1 f09222980d77
3 gve: fix zero-length skb frag with header-split 296e4ba5110d 6bf14575c655
4 af_unix: Set error only when needed in unix_dgram_sendmsg(). 0f7153de8efc 001a25088c35
5 fuse: rename to fuse_dev_end_requests and make non-static f9a5e99a14f9 92270d076115
6 fuse: make args->in_args[0] to be always the header a0be0e39c436 7ccd86ba3a48
7 fuse: {io-uring} Handle SQEs - register commands 5f61784bbaf0 24fe962c86f5
8 fuse: {io-uring} Make fuse_dev_queue_{interrupt,forget} non-static 82e4cdaa61e8 ba74ba571189
9 fuse: block request allocation until io-uring init is complete e9ff573be2b0 3393ff964e0f
10 fuse: enable fuse-over-io-uring 04f5930d914f 786412a73e7e
11 fuse: missing copy_finish in fuse-over-io-uring argument copies 31e3968922f6 6e0d7f7f4a43
12 fuse-uring: fix race between registration and connection abortion e438527ee1fb 952b5d36f6a2
13 fuse-uring: check connection abort during ring creation 6c85e6844cef c146284c4355
14 fuse-uring: fix moving cancelled entry to ent_in_userspace list 2aa3f2ee7b9a 198f45eeb9f7
15 fuse-uring: end fuse_req on io-uring cancel task work 8833a6652263 bea4fe98204b
16 fuse-uring: Avoid use-after-free in fuse_uring_async_stop_queues f4b153947bf0 d351da750669
17 fuse-uring: Avoid queue->stopped races and set/read that value under lock 8bd3bbab8f50 b70a3aca1693
18 fuse-uring: make a fuse_req on SQE commit only findable after memcpy 59fa68820946 1efd3d474fc0
19 fuse: fix io-uring background queue dispatch on request completion 9e89e24887f0 31da059891bd
20 fuse: fix missing barrier when checking io-uring readiness 280ba88fc15f edb310bc27f0
21 fuse: publish io-uring queues with release semantics c8205197929a 42df916e5a5f
22 fuse: copy request headers via a stack buffer for io-uring 2bc21377d417 fd10f40af314
23 fuse: Fix the condition to enable over-io-uring eb386820c58d 1f59015e9581
24 selftests: filesystems: Add functional test for the abort file in fusectl 620716fbbebd 1a7b13781b0d
25 selftests/fuse: add ACL_DONT_CACHE regression test 419bc4f3b7a6 9acb102522b9
26 mpls: add seqcount to protect the platform_label{,s} pair 6d3e1493d0be 629ec78ef860

Warning

1 backport couldn't be compared. Details are in the workflow run log.

1. crypto: rng - Override drivers/char/random in FIPS mode

Backport: af565460daf3 · Upstream: 8b0beca705b3

Show error
Cannot find upstream commit 8b0beca705b3877e24cccdd672422c66bbd75635 in ctrliq/kernel-src-tree: gh failed (exit 1):
gh: No commit found for SHA: 8b0beca705b3877e24cccdd672422c66bbd75635 (HTTP 422)

33 additional commits have no upstream reference and were not compared.

Checked PR revision d0aba05903d1 against base 6e86f4a91bb4.

@github-actions

Copy link
Copy Markdown

✅ Validation checks completed successfully View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/40726578898

@PlaidCat PlaidCat self-assigned this Oct 28, 2026
@PlaidCat
PlaidCat merged commit f470ac9 into rlc-10/6.12.0-211.68.1.el10_2 Oct 29, 2026
6 of 7 checks passed
@PlaidCat
PlaidCat deleted the jmaple_rlc-10/6.12.0-211.68.1.el10_2 branch October 29, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

8 participants