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]
Date:	Wed, 13 Jul 2011 12:55:18 +0100
From:	David Howells <dhowells@...hat.com>
To:	geert@...ux-m68k.org
Cc:	linux-kernel@...r.kernel.org, stable@...nel.org,
	David Howells <dhowells@...hat.com>
Subject: [PATCH] FS-Cache: Fix bounds check

__fscache_uncache_all_inode_pages() has a loop that goes through page index
numbers go up to (loff_t)-1.  This is incorrect.  The limit should be
(pgoff_t)-1 as on a 32-bit machine the pgoff_t is smaller than loff_t.

On m68k the following error is observed:

fs/fscache/page.c: In function '__fscache_uncache_all_inode_pages':
fs/fscache/page.c:979: warning: comparison is always false due to
limited range of data type

[Should there be a PGOFF_T_MAX constant defined?]

Reported-by: Geert Uytterhoeven <geert@...ux-m68k.org>
Signed-off-by: David Howells <dhowells@...hat.com>
---

 fs/fscache/page.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/fscache/page.c b/fs/fscache/page.c
index 60315b3..112359d 100644
--- a/fs/fscache/page.c
+++ b/fs/fscache/page.c
@@ -993,7 +993,7 @@ void __fscache_uncache_all_inode_pages(struct fscache_cookie *cookie,
 
 	pagevec_init(&pvec, 0);
 	next = 0;
-	while (next <= (loff_t)-1 &&
+	while (next <= (pgoff_t)-1 &&
 	       pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)
 	       ) {
 		for (i = 0; i < pagevec_count(&pvec); i++) {

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