Files
linux/lib
Roland Dreier 29684ecb7a btree: fix tree corruption in btree_get_prev()
commit cbf8ae32f6 upstream.

The memory the parameter __key points to is used as an iterator in
btree_get_prev(), so if we save off a bkey() pointer in retry_key and
then assign that to __key, we'll end up corrupting the btree internals
when we do eg

	longcpy(__key, bkey(geo, node, i), geo->keylen);

to return the key value.  What we should do instead is use longcpy() to
copy the key value that retry_key points to __key.

This can cause a btree to get corrupted by seemingly read-only
operations such as btree_for_each_safe.

[akpm@linux-foundation.org: avoid the double longcpy()]
Signed-off-by: Roland Dreier <roland@purestorage.com>
Acked-by: Joern Engel <joern@logfs.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-17 11:23:10 -07:00
..
2011-10-03 11:40:37 -07:00
2011-03-11 14:25:50 +00:00
2011-06-15 20:03:59 -07:00
2009-11-03 16:06:53 +01:00
2011-03-31 11:26:23 -03:00
2010-07-11 22:16:32 +02:00
2010-05-25 08:07:06 -07:00
2010-04-06 15:52:11 -07:00
2010-08-09 20:45:05 -07:00
2011-06-01 16:06:04 -04:00
2010-11-22 13:25:13 +10:00
2011-05-25 08:39:52 -07:00
2011-08-15 18:31:35 -07:00
2011-11-11 09:37:12 -08:00
2011-03-31 11:26:23 -03:00
2011-03-11 15:14:48 -05:00
2010-06-16 18:08:13 +02:00
2010-01-11 09:34:05 -08:00
2011-03-31 11:26:23 -03:00
2010-05-19 22:40:47 -04:00