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: <1410869255-8506-1-git-send-email-james.hogan@imgtec.com>
Date:	Tue, 16 Sep 2014 13:07:35 +0100
From:	James Hogan <james.hogan@...tec.com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
CC:	<linux-kernel@...r.kernel.org>,
	James Hogan <james.hogan@...tec.com>,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	<linux-fsdevel@...r.kernel.org>, <linux-metag@...r.kernel.org>
Subject: [PATCH] vfs: workaround gcc <4.6 build error in link_path_walk()

Commit d6bb3e9075bb (vfs: simplify and shrink stack frame of
link_path_walk()) introduced build problems with GCC versions older than
4.6 due to the initialisation of a member of an anonymous union in
struct qstr without enclosing braces.

This hits GCC bug 10676 [1] (which was fixed in GCC 4.6 by [2]), and
causes the following build error:
  fs/namei.c: In function 'link_path_walk':
  fs/namei.c:1778: error: unknown field 'hash_len' specified in initializer

This is worked around by adding explicit braces.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676
[2] https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=159206

Fixes: d6bb3e9075bb (vfs: simplify and shrink stack frame of link_path_walk())
Signed-off-by: James Hogan <james.hogan@...tec.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Alexander Viro <viro@...iv.linux.org.uk>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: linux-fsdevel@...r.kernel.org
Cc: linux-metag@...r.kernel.org
---
At least for metag it's feasible to fix the compiler, since backporting
the fix to GCC 4.2.4 isn't actually very difficult. I don't know about
other users of GCC <4.6 though.
---
 fs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/namei.c b/fs/namei.c
index 01d03892316c..a7b05bf82d31 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1775,7 +1775,7 @@ static int link_path_walk(const char *name, struct nameidata *nd)
 			struct dentry *parent = nd->path.dentry;
 			nd->flags &= ~LOOKUP_JUMPED;
 			if (unlikely(parent->d_flags & DCACHE_OP_HASH)) {
-				struct qstr this = { .hash_len = hash_len, .name = name };
+				struct qstr this = { { .hash_len = hash_len }, .name = name };
 				err = parent->d_op->d_hash(parent, &this);
 				if (err < 0)
 					break;
-- 
1.8.5.5

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