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: <1420558883-10131-24-git-send-email-mst@redhat.com>
Date:	Tue, 6 Jan 2015 17:44:47 +0200
From:	"Michael S. Tsirkin" <mst@...hat.com>
To:	linux-kernel@...r.kernel.org
Cc:	Arnd Bergmann <arnd@...db.de>, linux-arch@...r.kernel.org,
	Chris Metcalf <cmetcalf@...hip.com>
Subject: [PATCH v2 23/40] tile: enable sparse checks for get/put_user

Tile currently does not trigger sparse warnings when get_user
causes an illegal assignment across bitwise types.

For example:

__le32 __user *p;
__u32 x;
put_user(x, p);

violates endian-ness rules, but currently does not trigger sparse
warning on tile.

Fix this by adding some dead code.

Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
---
 arch/tile/include/asm/uaccess.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/tile/include/asm/uaccess.h b/arch/tile/include/asm/uaccess.h
index 22cffa1..03d905c 100644
--- a/arch/tile/include/asm/uaccess.h
+++ b/arch/tile/include/asm/uaccess.h
@@ -218,6 +218,8 @@ extern int __get_user_bad(void)
 		case 8: __get_user_8(x, ptr, __ret); break;		\
 		default: __ret = __get_user_bad(); break;		\
 		}							\
+		if (0)							\
+			x = *(__force typeof(*ptr) *)(ptr);		\
 		__ret;							\
 	})
 
@@ -297,6 +299,8 @@ extern int __put_user_bad(void)
 	case 8: __put_user_8(x, ptr, __ret); break;			\
 	default: __ret = __put_user_bad(); break;			\
 	}								\
+	if (0)								\
+		*(__force typeof(*ptr) *)(ptr) = x;			\
 	__ret;								\
 })
 
-- 
MST

--
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