]> git.karo-electronics.de Git - karo-tx-linux.git/commit
[PATCH] nfsd: fix possible read-ahead cache and export table corruption
authorJ. Bruce Fields <bfields@citi.umich.edu>
Thu, 19 Jul 2007 08:49:18 +0000 (01:49 -0700)
committerWilly Tarreau <w@1wt.eu>
Sat, 25 Aug 2007 15:24:09 +0000 (17:24 +0200)
commit25d919bd316afa283e1d758967923fddcff83fd8
tree93125546273efb777b781f3a23bc80eeff44c562
parent50dd9072c45f64348e10ae61df948fef43430a0e
[PATCH] nfsd: fix possible read-ahead cache and export table corruption

The value of nperbucket calculated here is too small--we should be rounding up
instead of down--with the result that the index j in the following loop can
overflow the raparm_hash array.  At least in my case, the next thing in memory
turns out to be export_table, so the symptoms I see are crashes caused by the
appearance of four zeroed-out export entries in the first bucket of the hash
table of exports (which were actually entries in the readahead cache, a
pointer to which had been written to the export table in this initialization
code).

It looks like the bug was probably introduced with commit
fce1456a19f5c08b688c29f00ef90fdfa074c79b ("knfsd: make the readahead params
cache SMP-friendly").

Cc: Greg Banks <gnb@melbourne.sgi.com>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Acked-by: NeilBrown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
fs/nfsd/vfs.c