linux/fs/orangefs
Christophe JAILLET c2f067d4ad orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc()
commit 40a74870b2d1d3d44e13b3b73c6571dd34f5614d upstream.

'buffer_index_array' really looks like a bitmap. So it should be allocated
as such.
When kzalloc is called, a number of bytes is expected, but a number of
longs is passed instead.

In get(), if not enough memory is allocated, un-allocated memory may be
read or written.

So use bitmap_zalloc() to safely allocate the correct memory size and
avoid un-expected behavior.

While at it, change the corresponding kfree() into bitmap_free() to keep
the semantic.

Fixes: ea2c9c9f6574 ("orangefs: bufmap rewrite")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-20 09:19:17 +01:00
..
2020-08-21 13:05:29 +02:00
2020-08-21 13:05:29 +02:00
2019-09-12 14:17:16 -04:00
2018-04-03 21:55:28 -04:00
2021-07-20 16:10:48 +02:00
2019-05-03 14:32:37 -04:00