Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Walter McKelvie <walt@mckelvie.org>
Cc: herbert@gondor.apana.org.au, davem@davemloft.net,
	linux-crypto@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2] crypto: algif_aead - Allow gcm(aes) for privileged users
Date: Thu, 5 Nov 2026 20:39:07 -0800	[thread overview]
Message-ID: <20261106043907.GC3877@sol> (raw)
In-Reply-To: <20261106043459.1169202-1-walt@mckelvie.org>

On Thu, Nov 05, 2026 at 11:34:59PM -0500, Walter McKelvie wrote:
> iwd depends on the AF_ALG algorithm "gcm(aes)", although iwd's own
> source never mentions "gcm(aes)" or L_AEAD_CIPHER_AES_GCM.  The
> dependency is indirect, through the TLS implementation in libell (ell)
> that iwd uses for EAP-TLS, EAP-TTLS and EAP-PEAP: iwd's
> src/eap-tls-common.c hands the EAP tunnel to l_tls_new().  In ell, the
> TLS 1.2 cipher suite table in ell/tls-suites.c uses
> L_AEAD_CIPHER_AES_GCM for the eight *_WITH_AES_{128,256}_GCM_* suites,
> ell/cipher.c maps that to the AF_ALG name "gcm(aes)", and
> tls_change_cipher_spec() in ell/tls.c instantiates it with
> l_aead_cipher_new().  Before offering a suite, ell checks that its AEAD
> could be bound on an AF_ALG socket (l_aead_cipher_is_supported()) and
> drops the suites whose bind() failed.
> 
> With af_alg_restrict=1 the bind of "gcm(aes)" fails even for iwd, which
> holds CAP_NET_ADMIN, so the AES-GCM suites silently disappear from
> iwd's ClientHello and EAP authentication fails against RADIUS servers
> that only accept GCM suites (common for eduroam deployments).  This
> contradicts the intent of commit 2f204fe718f5 ("crypto: af_alg - Add
> af_alg_restrict sysctl, defaulting to 1"), which was to keep iwd
> working under the default restriction level; the iwd algorithm list it
> was based on evidently did not account for the algorithms used by
> ell's TLS code.
> 
> Add "gcm(aes)" to the privileged part of the AEAD allowlist.  It is
> the only AEAD that iwd actually uses: ell's TLS code has no CCM or
> ChaCha20-Poly1305 suites, and no other ell or iwd code creates an AEAD
> cipher.  (ell does bind "ccm(aes)" once at startup, in
> init_supported() in ell/cipher.c, to probe which AEADs are available,
> but nothing uses it, so its allowlist comment is left as is.)
> 
> Fixes: 2f204fe718f5 ("crypto: af_alg - Add af_alg_restrict sysctl, defaulting to 1")
> Link: https://github.com/NixOS/nixpkgs/issues/583203
> Cc: stable@vger.kernel.org
> Signed-off-by: Walter McKelvie <walt@mckelvie.org>

Reviewed-by: Eric Biggers <ebiggers@kernel.org>

- Eric

      reply	other threads:[~2026-11-06  4:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06  3:41 [PATCH] crypto: algif_aead - Allow gcm(aes) for privileged users Walter McKelvie
2026-11-06  3:49 ` Eric Biggers
2026-11-06  4:07   ` Walter McKelvie
2026-11-06  4:14     ` Eric Biggers
2026-11-06  4:25       ` Walter McKelvie
2026-11-06  4:34         ` [PATCH v2] " Walter McKelvie
2026-11-06  4:39           ` 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=20261106043907.GC3877@sol \
    --to=ebiggers@kernel.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=walt@mckelvie.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