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]
Date:   Mon, 16 Oct 2017 10:26:33 -0700
From:   Bart Van Assche <bart.vanassche@....com>
To:     Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     Bart Van Assche <bart.vanassche@....com>,
        linux-scsi@...r.kernel.org, linux-rdma@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        "Michael S . Tsirkin" <mst@...hat.com>,
        Christoph Hellwig <hch@...radead.org>,
        Leon Romanovsky <leon@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH v2] linux/types.h: Restore the ability to disable sparse endianness checks

The purpose of patch "linux/types.h: enable endian checks for all
sparse builds" was to encourage driver authors to annotate
endianness correctly in their drivers. However, since that patch
went upstream no endianness annotations in drivers have been fixed.
I think that this shows that the followed approach does not work,
probably because several driver authors do not use sparse. For
developers who are not the authors of these drivers it would take
a very significant effort to make these drivers endianness clean.
Examples are drivers/scsi/qla2xxx and drivers/infiniband/hw/nes.
Hence restore the ability to disable sparse endianness checks such
that it becomes again easy to review other sparse diagnostics for
people who want to analyze drivers they are not the author of.

References: commit 05de97003c77 ("linux/types.h: enable endian checks for all sparse builds")
Signed-off-by: Bart Van Assche <bart.vanassche@....com>
Cc: linux-scsi@...r.kernel.org
Cc: linux-rdma@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Cc: Michael S. Tsirkin <mst@...hat.com>
Cc: Christoph Hellwig <hch@...radead.org>
Cc: Leon Romanovsky <leon@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
---
[v2]: Elaborated patch description

 include/uapi/linux/types.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/types.h b/include/uapi/linux/types.h
index 41e5914f0a8e..d3dcb0764c45 100644
--- a/include/uapi/linux/types.h
+++ b/include/uapi/linux/types.h
@@ -23,7 +23,11 @@
 #else
 #define __bitwise__
 #endif
+#if !defined(__CHECK_ENDIAN__) || __CHECK_ENDIAN__ != 0
 #define __bitwise __bitwise__
+#else
+#define __bitwise
+#endif
 
 typedef __u16 __bitwise __le16;
 typedef __u16 __bitwise __be16;
-- 
2.14.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ