The following LTP crypto tests failed on Linus mainline master branch.
LTP ltp-crypto: * af_alg03 * af_alg01
First seen on e8fc317dfca9 (v6.11-2185-ge8fc317dfca9) Good: v6.11-rc7 BAD: e8fc317dfca9 (v6.11-2185-ge8fc317dfca9) and (v6.11)
Devices and qemu's: - dragonboard-410c - dragonboard-845c - e850-96 - juno-r2 - arm64 - qemu-arm64 - qemu-armv7 - qemu-riscv64 - qemu-x86_64 - rk3399-rock-pi-4b - x15 - x86_64
Reported-by: Linux Kernel Functional Testing lkft@linaro.org
Warning log: ---------- tst_test.c:1617: TINFO: Timeout per run is 0h 02m 30s af_alg01.c:36: TFAIL: instantiated nested hmac algorithm ('hmac(hmac(md5))')! tst_af_alg.c:46: TBROK: unexpected error binding AF_ALG socket to hash algorithm 'hmac(hmac(md5))': EINVAL (22)
HINT: You _MAY_ be missing kernel fixes:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
HINT: You _MAY_ be vulnerable to CVE(s):
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-17806
HINT: You _MAY_ be missing kernel fixes:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
HINT: You _MAY_ be vulnerable to CVE(s):
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-17806
... tst_test.c:1617: TINFO: Timeout per run is 0h 02m 30s af_alg03.c:22: TFAIL: instantiated rfc7539 template with wrong digest size
HINT: You _MAY_ be missing kernel fixes:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
boot Log links, -------- - https://qa-reports.linaro.org/lkft/linux-mainline-master/build/v6.11-8836-gf... - https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/tests/2m983y1hatx...
Test results history: ---------- - https://qa-reports.linaro.org/lkft/linux-mainline-master/build/v6.11-8836-gf... - https://qa-reports.linaro.org/lkft/linux-mainline-master/build/v6.11-8836-gf...
metadata: ---- git describe: v6.11-2185-ge8fc317dfca9 .. v6.11-5002-g200289db261f git repo: https://gitlab.com/Linaro/lkft/mirrors/torvalds/linux-mainline git sha: abf2050f51fdca0fd146388f83cddd95a57a008d (v6.11) kernel config: https://storage.tuxsuite.com/public/linaro/lkft/builds/2m980TaGzPk0qjtFUPnMN... build url: https://storage.tuxsuite.com/public/linaro/lkft/builds/2m980TaGzPk0qjtFUPnMN... toolchain: gcc-13
Steps to reproduce: --------- - https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/tests/2m983y1hatx... - https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/tests/2m983y1hatx...
-- Linaro LKFT https://lkft.linaro.org
On Tue, 24 Sept 2024 at 15:16, Naresh Kamboju naresh.kamboju@linaro.org wrote:
The following LTP crypto tests failed on Linus mainline master branch.
LTP ltp-crypto: * af_alg03 * af_alg01
First seen on e8fc317dfca9 (v6.11-2185-ge8fc317dfca9) Good: v6.11-rc7 BAD: e8fc317dfca9 (v6.11-2185-ge8fc317dfca9) and (v6.11)
Also seen on Linux next from next-20240909 tag.
Good: next-20240906 Bad: next-20240909
Devices and qemu's:
- dragonboard-410c
- dragonboard-845c
- e850-96
- juno-r2
- arm64
- qemu-arm64
- qemu-armv7
- qemu-riscv64
- qemu-x86_64
- rk3399-rock-pi-4b
- x15
- x86_64
Reported-by: Linux Kernel Functional Testing lkft@linaro.org
Warning log:
tst_test.c:1617: TINFO: Timeout per run is 0h 02m 30s af_alg01.c:36: TFAIL: instantiated nested hmac algorithm ('hmac(hmac(md5))')! tst_af_alg.c:46: TBROK: unexpected error binding AF_ALG socket to hash algorithm 'hmac(hmac(md5))': EINVAL (22)
HINT: You _MAY_ be missing kernel fixes:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
HINT: You _MAY_ be vulnerable to CVE(s):
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-17806
HINT: You _MAY_ be missing kernel fixes:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
HINT: You _MAY_ be vulnerable to CVE(s):
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-17806
... tst_test.c:1617: TINFO: Timeout per run is 0h 02m 30s af_alg03.c:22: TFAIL: instantiated rfc7539 template with wrong digest size
HINT: You _MAY_ be missing kernel fixes:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
boot Log links,
- https://qa-reports.linaro.org/lkft/linux-mainline-master/build/v6.11-8836-gf...
- https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/tests/2m983y1hatx...
Test results history:
- https://qa-reports.linaro.org/lkft/linux-mainline-master/build/v6.11-8836-gf...
- https://qa-reports.linaro.org/lkft/linux-mainline-master/build/v6.11-8836-gf...
metadata:
git describe: v6.11-2185-ge8fc317dfca9 .. v6.11-5002-g200289db261f git repo: https://gitlab.com/Linaro/lkft/mirrors/torvalds/linux-mainline git sha: abf2050f51fdca0fd146388f83cddd95a57a008d (v6.11) kernel config: https://storage.tuxsuite.com/public/linaro/lkft/builds/2m980TaGzPk0qjtFUPnMN... build url: https://storage.tuxsuite.com/public/linaro/lkft/builds/2m980TaGzPk0qjtFUPnMN... toolchain: gcc-13
Steps to reproduce:
- https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/tests/2m983y1hatx...
- https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/tests/2m983y1hatx...
-- Linaro LKFT https://lkft.linaro.org
- Naresh
On Tue, Sep 24, 2024 at 03:16:09PM +0530, Naresh Kamboju wrote:
Warning log:
tst_test.c:1617: TINFO: Timeout per run is 0h 02m 30s af_alg01.c:36: TFAIL: instantiated nested hmac algorithm ('hmac(hmac(md5))')! tst_af_alg.c:46: TBROK: unexpected error binding AF_ALG socket to hash algorithm 'hmac(hmac(md5))': EINVAL (22)
This is expected. You need to fix the test to not treat this as an error.
Cheers,
On Tue, Sep 24, 2024 at 09:30:39PM +0800, Herbert Xu wrote:
On Tue, Sep 24, 2024 at 03:16:09PM +0530, Naresh Kamboju wrote:
Warning log:
tst_test.c:1617: TINFO: Timeout per run is 0h 02m 30s af_alg01.c:36: TFAIL: instantiated nested hmac algorithm ('hmac(hmac(md5))')! tst_af_alg.c:46: TBROK: unexpected error binding AF_ALG socket to hash algorithm 'hmac(hmac(md5))': EINVAL (22)
This is expected. You need to fix the test to not treat this as an error.
So the error code changed from ENOENT to EINVAL. These particular LTP tests (af_alg01 and af_alg03) could check for either ENOENT or EINVAL, and it would preserve the main point of the tests.
I do feel that the previous error code, ENOENT, was more logical though. From userspace's perspective, these invalid algorithms don't exist and don't need to be treated any different from other algorithms that don't exist.
Has it been checked what else in userspace might need to be updated as a result of this change?
Looking at libkcapi for example (https://github.com/smuellerDD/libkcapi/blob/master/lib/kcapi.h#L125) it passes the error code up and documents it as part of its API:
* @return 0 upon success; * -ENOENT - algorithm not available; * -EOPNOTSUPP - AF_ALG family not available; * -EINVAL - accept syscall failed * -ENOMEM - cipher handle cannot be allocated */ int kcapi_cipher_init(struct kcapi_handle **handle, const char *ciphername, uint32_t flags);
So that is now wrong, as "algorithm not available" can now be either ENOENT or EINVAL.
I don't really see the reason for this churn. The kernel commit which made this change (795f85fca229) provides no explanation either.
- Eric