[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1793804.1767607035@warthog.procyon.org.uk>
Date: Mon, 05 Jan 2026 09:57:15 +0000
From: David Howells <dhowells@...hat.com>
To: Daniel Gomez <da.gomez@...nel.org>
Cc: dhowells@...hat.com, Lukas Wunner <lukas@...ner.de>,
Ignat Korchagin <ignat@...udflare.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
Jarkko Sakkinen <jarkko@...nel.org>,
Paul Moore <paul@...l-moore.com>, James Morris <jmorris@...ei.org>,
"Serge E.
Hallyn" <serge@...lyn.com>,
Luis Chamberlain <mcgrof@...nel.org>,
Petr Pavlu <petr.pavlu@...e.com>,
Sami Tolvanen <samitolvanen@...gle.com>,
Aaron Tomlin <atomlin@...mlin.com>,
Lucas De Marchi <demarchi@...nel.org>, keyrings@...r.kernel.org,
linux-crypto@...r.kernel.org, linux-modules@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-security-module@...r.kernel.org,
Daniel Gomez <da.gomez@...sung.com>
Subject: Re: [PATCH] KEYS: replace -EEXIST with -EBUSY
Daniel Gomez <da.gomez@...nel.org> wrote:
> From: Daniel Gomez <da.gomez@...sung.com>
>
> The -EEXIST error code is reserved by the module loading infrastructure
> to indicate that a module is already loaded.
EEXIST means a file exists when you're trying to create it. Granted we abuse
that somewhat rather than add ever more error codes, but you cannot reserve it
for indicating that a module exists.
> When a module's init
> function returns -EEXIST, userspace tools like kmod interpret this as
> "module already loaded" and treat the operation as successful, returning
> 0 to the user even though the module initialization actually failed.
>
> This follows the precedent set by commit 54416fd76770 ("netfilter:
> conntrack: helper: Replace -EEXIST by -EBUSY") which fixed the same
> issue in nf_conntrack_helper_register().
>
> Affected modules:
> * pkcs8_key_parser x509_key_parser asymmetric_keys dns_resolver
> * nvme_keyring pkcs7_test_key rxrpc turris_signing_key
>
> Signed-off-by: Daniel Gomez <da.gomez@...sung.com>
Please don't. Userspace can always check /proc/modules (assuming procfs is
enabled, I suppose).
David
Powered by blists - more mailing lists