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-next>] [day] [month] [year] [list]
Message-ID: <20250428160837.664000-1-sridhar.arra@yahoo.com>
Date: Mon, 28 Apr 2025 21:38:36 +0530
From: Sridhar Arra <sridhar.arra@...oo.com>
To: vireshk@...nel.org
Cc: johan@...nel.org,
	elder@...nel.org,
	gregkh@...uxfoundation.org,
	greybus-dev@...ts.linaro.org,
	linux-staging@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	Sridhar Arra <sridhar.arra@...oo.com>
Subject: [PATCH v2 1/2] [PATCH v2 1/2] staging: greybus: fw-management: Add detailed mutex comment

Added a detailed comment explaining the role of the mutex
in serializing firmware management ioctl() operations.
The mutex prevents concurrent access to firmware operations
and protects the 'disabled' state flag during disconnection.

Signed-off-by: Sridhar Arra <sridhar.arra@...oo.com>
---
 drivers/staging/greybus/fw-management.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/staging/greybus/fw-management.c b/drivers/staging/greybus/fw-management.c
index a47385175582..56725b711a17 100644
--- a/drivers/staging/greybus/fw-management.c
+++ b/drivers/staging/greybus/fw-management.c
@@ -28,6 +28,19 @@ struct fw_mgmt {
 
 	/* Common id-map for interface and backend firmware requests */
 	struct ida		id_map;
+	/*
+	 * Mutex to serialize firmware management ioctl() operations and
+	 * protect against concurrent access.
+	 *
+	 * Ensures that user-space cannot perform multiple firmware
+	 * operations in parallel (e.g., updating interface firmware)
+	 * for the same Interface, avoiding race conditions and reducing
+	 * code complexity.
+	 *
+	 * Also protects the 'disabled' state flag, preventing new
+	 * operations from starting when the firmware management
+	 * connection is being disconnected.
+	 */
 	struct mutex		mutex;
 	struct completion	completion;
 	struct cdev		cdev;
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ