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>] [day] [month] [year] [list]
Message-Id: <933ed4c751511b0b4a6665b7d4ca90d54d1111cb.1410904597.git.dvhart@linux.intel.com>
Date:	Tue, 16 Sep 2014 14:56:37 -0700
From:	Darren Hart <dvhart@...radead.org>
To:	Randy Dunlap <rdunlap@...radead.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	linux-doc@...r.kernel.org,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Darren Hart <dvhart@...ux.intel.com>,
	Azael Avalos <coproscefalo@...il.com>,
	"H. Peter Anvin" <hpa@...ux.intel.com>,
	Frans Klaver <fransklaver@...il.com>
Subject: [PATCH] Documentation/sysfs-rules.txt: Add device attribute error code documentation

From: Darren Hart <dvhart@...ux.intel.com>

Provide some entry-level statements about what to expect from sysfs
device attribute read/store return codes, both for users and kernel
developers.

Signed-off-by: Darren Hart <dvhart@...ux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Randy Dunlap <rdunlap@...radead.org>
Cc: Azael Avalos <coproscefalo@...il.com>
Cc: H. Peter Anvin <hpa@...ux.intel.com>
Cc: Frans Klaver <fransklaver@...il.com>
---
 Documentation/sysfs-rules.txt | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/Documentation/sysfs-rules.txt b/Documentation/sysfs-rules.txt
index a5f985e..ce60ffa 100644
--- a/Documentation/sysfs-rules.txt
+++ b/Documentation/sysfs-rules.txt
@@ -161,3 +161,24 @@ versions of the sysfs interface.
   the device that matches the expected subsystem. Depending on a specific
   position of a parent device or exposing relative paths using "../" to
   access the chain of parents is a bug in the application.
+
+- When reading and writing sysfs device attribute files, avoid dependency
+  on specific error codes wherever possible. This minimizes coupling to
+  the error handling implementation within the kernel.
+
+  In general, failures to read or write sysfs device attributes shall
+  propagate errors wherever possible. Common errors include, but are not
+  limited to:
+
+  -EIO: The read or store operation is not supported, typically returned by
+        the sysfs system itself if the read or store pointer is NULL.
+
+  -ENXIO: The read or store operation failed
+
+  Error codes will not be changed without good reason, and should a change
+  to error codes result in user-space breakage, it will be fixed, or the
+  the offending change will be reverted.
+
+  Userspace applications can, however, expect the format and contents of
+  the attribute files to remain consistent in the absence of a version
+  attribute change in the context of a given attribute.
-- 
2.1.0.rc1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ