From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16A1532BF58 for ; Mon, 5 Jan 2026 09:57:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767607052; cv=none; b=FJ3Htt+8YNtWIg4jMLi7EzwOAjisv3L7iT3j6BhgBD/8Yq0H7TOpCmZ5vt4dQ072v7d3KsvJTd04uCCP/xIRn62AFnC9igiZ26wF0VRSEQBqHF2siMhny5F+rste11e7EOySMPxUtAPn9PmpNtkuO5rqqf00KQrxEHHexai70LY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767607052; c=relaxed/simple; bh=YosT8TmEHTsMmh8rks0COGu2q0XNu7LTcinrJQC64tU=; h=From:In-Reply-To:References:To:Cc:Subject:MIME-Version: Content-Type:Date:Message-ID; b=SNdAILvfpunXL8njKOLkh34YIi6DE4mRup7RD+nw2Xd8WOXDz7YXtw5HenrRqsu2gA/w9dHWMHCM4pN6esd2q1LkbqnC99Je/p99/aLnDUkjKP/m//S0o30tyZTc9xAf/T2NmlRExP4L9E7DLD8GhlPCRzs6E23siA7KL/KQDCs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=QPnz/srY; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QPnz/srY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767607050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Y7fU2oLj4//El3OkC487mYGloPVDa7j3e9myZHNTrq0=; b=QPnz/srYHZm7ITfCx07A17CdI5mh1WscSqZrSxZz9Y0NqHbZf7IyUzXMYAAGBL93qSg19/ dvG1TrXkw/NgC+/TRbw0IlSxUNm/7e93garTmOV3Sea0TGOzsnDMZauctztNAAiNc1Kgs7 EyXOiXwUtPy3UHVGLxIV+A2F907Fz2c= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-302-AaRMCpPqPi-aYc21tMwNzA-1; Mon, 05 Jan 2026 04:57:27 -0500 X-MC-Unique: AaRMCpPqPi-aYc21tMwNzA-1 X-Mimecast-MFC-AGG-ID: AaRMCpPqPi-aYc21tMwNzA_1767607044 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0E72E1956089; Mon, 5 Jan 2026 09:57:23 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.4]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 20C5F1800367; Mon, 5 Jan 2026 09:57:16 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20251220-dev-module-init-eexists-keyring-v1-1-a2f23248c300@samsung.com> References: <20251220-dev-module-init-eexists-keyring-v1-1-a2f23248c300@samsung.com> To: Daniel Gomez Cc: dhowells@redhat.com, Lukas Wunner , Ignat Korchagin , Herbert Xu , "David S. Miller" , Jarkko Sakkinen , Paul Moore , James Morris , "Serge E. Hallyn" , Luis Chamberlain , Petr Pavlu , Sami Tolvanen , Aaron Tomlin , Lucas De Marchi , keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, Daniel Gomez Subject: Re: [PATCH] KEYS: replace -EEXIST with -EBUSY Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1793803.1767607035.1@warthog.procyon.org.uk> Date: Mon, 05 Jan 2026 09:57:15 +0000 Message-ID: <1793804.1767607035@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Daniel Gomez wrote: > From: Daniel Gomez > > 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 Please don't. Userspace can always check /proc/modules (assuming procfs is enabled, I suppose). David