From: Eric Biggers <ebiggers@kernel.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Naresh Kamboju <naresh.kamboju@linaro.org>,
LTP List <ltp@lists.linux.it>,
open list <linux-kernel@vger.kernel.org>,
Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
lkft-triage@lists.linaro.org,
"David S. Miller" <davem@davemloft.net>,
Anders Roxell <anders.roxell@linaro.org>,
Dan Carpenter <dan.carpenter@linaro.org>,
Arnd Bergmann <arnd@arndb.de>, chrubis <chrubis@suse.cz>
Subject: Re: af_alg01.c:36: TFAIL: instantiated nested hmac algorithm ('hmac(hmac(md5))')!
Date: Tue, 24 Sep 2024 15:28:39 -0700 [thread overview]
Message-ID: <20240924222839.GC1585@sol.localdomain> (raw)
In-Reply-To: <ZvK-_5QKQ2e0S2Sd@gondor.apana.org.au>
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
prev parent reply other threads:[~2024-09-24 22:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-24 9:46 af_alg01.c:36: TFAIL: instantiated nested hmac algorithm ('hmac(hmac(md5))')! Naresh Kamboju
2024-09-24 11:23 ` Naresh Kamboju
2024-09-24 13:30 ` Herbert Xu
2024-09-24 22:28 ` Eric Biggers [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240924222839.GC1585@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=anders.roxell@linaro.org \
--cc=arnd@arndb.de \
--cc=chrubis@suse.cz \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkft-triage@lists.linaro.org \
--cc=ltp@lists.linux.it \
--cc=naresh.kamboju@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox