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: <1348276860-21705-1-git-send-email-herton.krzesinski@canonical.com>
Date:	Fri, 21 Sep 2012 22:21:00 -0300
From:	Herton Ronaldo Krzesinski <herton.krzesinski@...onical.com>
To:	Theodore Ts'o <tytso@....edu>
Cc:	Andreas Dilger <adilger.kernel@...ger.ca>,
	linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] ext4: remove static from struct match_token used in token2str

There is no reason to use static there, and it will cause issues when
reading /proc/fs/ext4/<partition>/options concurrently.

Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@...onical.com>
Cc: stable@...r.kernel.org # 3.4+
---
 fs/ext4/super.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

The problem is easy to reproduce, for example running:
$ cat /proc/fs/ext4/<partition>/options > options.txt
$ while diff /proc/fs/ext4/<partition>/options options.txt; do true; done
- And concurrently on another terminal:
$ while diff /proc/fs/ext4/<partition>/options options.txt; do true; done

One of the diff loops will get incomplete options contents because of
the issue, and exit.

I also believe the same problem is the cause of the following bug:
https://bugs.launchpad.net/bugs/1053019, that happened while running
test 234 from xfstests.

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 41598ee..975405c 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1748,7 +1748,7 @@ static inline void ext4_show_quota_options(struct seq_file *seq,
 
 static const char *token2str(int token)
 {
-	static const struct match_token *t;
+	const struct match_token *t;
 
 	for (t = tokens; t->token != Opt_err; t++)
 		if (t->token == token && !strchr(t->pattern, '='))
-- 
1.7.9.5

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ