lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251220-dev-module-init-eexists-linux-scsi-v1-1-5379db749d54@samsung.com>
Date: Sat, 20 Dec 2025 04:37:32 +0100
From: Daniel Gomez <da.gomez@...nel.org>
To: "Martin K. Petersen" <martin.petersen@...cle.com>, 
 Hannes Reinecke <hare@...e.de>, 
 "James E.J. Bottomley" <James.Bottomley@...senPartnership.com>
Cc: Luis Chamberlain <mcgrof@...nel.org>, Petr Pavlu <petr.pavlu@...e.com>, 
 Daniel Gomez <da.gomez@...nel.org>, Sami Tolvanen <samitolvanen@...gle.com>, 
 Aaron Tomlin <atomlin@...mlin.com>, Lucas De Marchi <demarchi@...nel.org>, 
 linux-scsi@...r.kernel.org, target-devel@...r.kernel.org, 
 linux-modules@...r.kernel.org, linux-kernel@...r.kernel.org, 
 Daniel Gomez <da.gomez@...sung.com>
Subject: [PATCH 1/2] target: replace -EEXIST with -EBUSY

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. 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:
  * target_core_file target_core_iblock target_core_pscsi
  * target_core_user

Signed-off-by: Daniel Gomez <da.gomez@...sung.com>
---
 drivers/target/target_core_hba.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/target/target_core_hba.c b/drivers/target/target_core_hba.c
index d508b343ba7b..dcc11671d919 100644
--- a/drivers/target/target_core_hba.c
+++ b/drivers/target/target_core_hba.c
@@ -50,7 +50,7 @@ int transport_backend_register(const struct target_backend_ops *ops)
 			pr_err("backend %s already registered.\n", ops->name);
 			mutex_unlock(&backend_mutex);
 			kfree(tb);
-			return -EEXIST;
+			return -EBUSY;
 		}
 	}
 	target_setup_backend_cits(tb);

-- 
2.52.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ