Skip to content

Commit eec2513

Browse files
dkrucesKernel Patches Daemon
authored andcommitted
bpf: crypto: replace -EEXIST with -EBUSY
The -EEXIST error code is reserved by the module loading infrastructure to indicate that a module is already loaded. 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 54416fd ("netfilter: conntrack: helper: Replace -EEXIST by -EBUSY") which fixed the same issue in nf_conntrack_helper_register(). This affects bpf_crypto_skcipher module. While the configuration required to build it as a module is unlikely in practice, it is technically possible, so fix it for correctness. Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
1 parent 2d78e4d commit eec2513

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/crypto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct bpf_crypto_ctx {
6060
int bpf_crypto_register_type(const struct bpf_crypto_type *type)
6161
{
6262
struct bpf_crypto_type_list *node;
63-
int err = -EEXIST;
63+
int err = -EBUSY;
6464

6565
down_write(&bpf_crypto_types_sem);
6666
list_for_each_entry(node, &bpf_crypto_types, list) {

0 commit comments

Comments
 (0)