linux-stable/fs/orangefs
Christophe JAILLET 51eeaa958a 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-27 09:00:46 +01:00
..
acl.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dcache.c fs: orangefs: fix error return code of orangefs_revalidate_lookup() 2021-11-26 11:40:34 +01:00
devorangefs-req.c orangefs: initialize op on loop restart in orangefs_devreq_read 2018-01-31 14:03:40 +01:00
dir.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
downcall.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
file.c orangefs: fix deadlock; do not write i_size in read_iter 2018-01-31 14:03:43 +01:00
inode.c orangefs: report attributes_mask and attributes for statx 2018-06-26 08:06:33 +08:00
Kconfig Orangefs: kernel client part 7 2015-10-03 11:40:00 -04:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
namei.c orangefs: set i_size on new symlink 2018-06-26 08:06:33 +08:00
orangefs-bufmap.c orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc() 2022-01-27 09:00:46 +01:00
orangefs-bufmap.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
orangefs-cache.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
orangefs-debug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
orangefs-debugfs.c help_next should increase position index 2020-02-28 16:36:08 +01:00
orangefs-debugfs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
orangefs-dev-proto.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
orangefs-kernel.h orangefs: fix deadlock; do not write i_size in read_iter 2018-01-31 14:03:43 +01:00
orangefs-mod.c orangefs: Delete error messages for a failed memory allocation in five functions 2017-09-14 14:58:29 -04:00
orangefs-sysfs.c orangefs: rate limit the client not running info message 2019-11-24 08:23:30 +01:00
orangefs-sysfs.h Orangefs: change pvfs2 filenames to orangefs 2015-12-04 12:56:14 -05:00
orangefs-utils.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
protocol.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
super.c orangefs: fix orangefs df output. 2021-07-20 16:17:52 +02:00
symlink.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
upcall.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
waitqueue.c orangefs: use list_for_each_entry_safe in purge_waiting_ops 2018-01-31 14:03:40 +01:00
xattr.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00