linux-stable/fs/orangefs
Christophe JAILLET c2f067d4ad orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc()
commit 40a74870b2 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: ea2c9c9f65 ("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
..
acl.c orangefs: reorganize setattr functions to track attribute changes 2019-05-03 14:32:38 -04:00
dcache.c fs: orangefs: fix error return code of orangefs_revalidate_lookup() 2021-11-17 09:48:45 +01:00
devorangefs-req.c Merge branch 'work.compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-06-16 16:21:50 +09:00
dir.c orangefs: stop setting atime on inode dirty 2017-11-13 15:10:11 -05:00
downcall.h
file.c orangefs: get rid of knob code... 2020-08-21 13:05:29 +02:00
inode.c orangefs: get rid of knob code... 2020-08-21 13:05:29 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile
namei.c orangefs: Add octal zero prefix 2019-09-12 14:17:16 -04:00
orangefs-bufmap.c orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc() 2022-01-20 09:19:17 +01:00
orangefs-bufmap.h orangefs: copy Orangefs-sized blocks into the pagecache if possible. 2019-05-03 14:32:39 -04:00
orangefs-cache.c
orangefs-debug.h orangefs: remove unused code 2018-04-03 21:55:28 -04:00
orangefs-debugfs.c help_next should increase position index 2020-02-24 08:37:02 +01:00
orangefs-debugfs.h orangefs: fix build warning from debugfs cleanup patch 2019-07-04 10:30:33 +02:00
orangefs-dev-proto.h
orangefs-kernel.h orangefs: get rid of knob code... 2020-08-21 13:05:29 +02:00
orangefs-mod.c orangefs: fix build warning from debugfs cleanup patch 2019-07-04 10:30:33 +02:00
orangefs-sysfs.c orangefs: add orangefs_revalidate_mapping 2019-05-03 14:32:39 -04:00
orangefs-sysfs.h
orangefs-utils.c orangefs: skip inode writeout if nothing to write 2019-05-03 14:32:38 -04:00
protocol.h orangefs: specify user pointers when using dev_map_desc and bufmap 2018-06-01 14:51:36 -04:00
super.c orangefs: fix orangefs df output. 2021-07-20 16:10:48 +02:00
symlink.c orangefs: stop setting atime on inode dirty 2017-11-13 15:10:11 -05:00
upcall.h
waitqueue.c orangefs: service ops done for writeback are not killable 2019-05-03 14:32:38 -04:00
xattr.c orangefs: implement xattr cache 2019-05-03 14:32:37 -04:00