From douzzer at mega.nu Fri Sep 26 15:37:29 2025 From: douzzer at mega.nu (Daniel Pouzzner) Date: Fri, 26 Sep 2025 14:37:29 -0500 Subject: regression in 6.17-RC7 AF_ALG Message-ID: <5004c97e96cde9b415236396d732f2db5dc2a4cc.camel@mega.nu> Our nightly tests just detected a breaking change in RC7, not present in RC6. We discovered it via the libkcapi test harness, affecting a somewhat random (but consistent) subset of the skcipher tests. I've bisected it to 1b34cbbf4f0. There doesn't seem to be anything wrong with the fix in that commit, but the refactor of the bools in struct af_alg_ctx as a bitfield is unexpectedly breaking AF_ALG calls. Target/toolchain/config details are listed below. This patch restores correct behavior for us: --- ./include/crypto/if_alg.h.dist 2025-09-25 17:14:59.821789747 +0000 +++ ./include/crypto/if_alg.h 2025-09-26 18:59:46.813132909 +0000 @@ -152,11 +152,11 @@ struct af_alg_ctx { size_t used; atomic_t rcvused; - u32 more:1, - merge:1, - enc:1, - write:1, - init:1; + bool more; + bool merge; + bool enc; + bool write; + bool init; unsigned int len; Final success/failure count from the libkcapi test harness without the patch: libkcapi test.sh results: 794 passed, 27 skipped, 61 failed. Below is a snippet from that run. The logged kcapi commands reproduce the problem directly -- I tested this separately, outside the libkcapi test script. [PASSED: 64-bit - 6.17.0-rc7] AEAD gcm(aes) synchronous one shot non-aligned test 16 [PASSED: 64-bit - 6.17.0-rc7] AEAD gcm(aes) synchronous one shot non-aligned test 17 [FAILED: 64-bit - 6.17.0-rc7] AEAD gcm(aes) synchronous stream non-aligned test 1 (/usr/local/libexec/libkcapi/kcapi -x 2 -s -c "gcm(aes)" -i aac774c39e399e7d6371ec1d -k 38bd9eb2cb29cc42ac38d6cdbe116760 -a "5dbb2884f3fe93664613e863c3bd2572855cf808765880ef1fa5787ceef8c793" -t "34a21cc3562f0ba141d73242e5a3b666" -q "d127b39d365d16246d2866b2ebabd201") Exp 8f9ec088580c23fc[...] Got Sending update buffer failed Failed to invoke testing [FAILED: 64-bit - 6.17.0-rc7] AEAD gcm(aes) synchronous stream non-aligned test 2 (/usr/local/libexec/libkcapi/kcapi -x 2 -s -c "gcm(aes)" -i 7815d4b06ae50c9c56e87bd7 -k ea38ac0c9b9998c80e28fb496a2b88d9 -a "853f98a750098bec1aa7497e979e78098155c877879556bb51ddeb6374cbaefc" -t "c4ce58985b7203094be1d134c1b8ab0b" -q "b03692f86d1b8b39baf2abb255197c98") Exp EBADMSG[...] Got Sending update buffer failed Failed to invoke testing Target arch is amd64 (7960X). Compiler is gcc (Gentoo 14.3.1_p20250801 p4) 14.3.1 20250801. Tested with binutils 2.44 and 2.45 with identical results. .config is at https://drive.google.com/file/d/1T9Iyqv_Ql4FsbMf975BPCQR9fNqmriAm/view?usp=sharing Note that this problem was discovered as part of the WolfSSL kernel crypto testing program, but is present in the kernel native crypto, which we test alongside our own crypto module in our nightlies.