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:	Tue, 06 Mar 2007 09:54:37 +0000
From:	Catalin Marinas <catalin.marinas@....com>
To:	Tejun Heo <htejun@...il.com>, linux-kernel@...r.kernel.org
Subject: [PATCH] Use a zero-size array in the struct devres

Commit 9ac7849e35f705830f7b016ff272b0ff1f7ff759 adds the devres
structure containing a flexible unsigned long long array, with a
comment about the guaranteed alignment. According to the gcc manual,
flexible arrays are considered incomplete types and it is an error to
ask for their alignment. This patch makes data[] a zero-size array.

Signed-off-by: Catalin Marinas <catalin.marinas@....com>
---

I came across this when trying to build kmemleak as the modified
container_of macro tries to get the size of the devres.data member and
sizeof cannot be applied to incomplete types.

 drivers/base/devres.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/base/devres.c b/drivers/base/devres.c
index e177c95..0d6c067 100644
--- a/drivers/base/devres.c
+++ b/drivers/base/devres.c
@@ -22,7 +22,7 @@ struct devres_node {
 struct devres {
 	struct devres_node		node;
 	/* -- 3 pointers */
-	unsigned long long		data[];	/* guarantee ull alignment */
+	unsigned long long		data[0];	/* guarantee ull alignment */
 };
 
 struct devres_group {

-
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