android_kernel_xiaomi_sm7250/fs/orangefs
Christophe JAILLET e8fcfcdc9e 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: 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:04:13 +01:00
..
acl.c get rid of pointless includes of fs_struct.h 2018-02-22 14:28:50 -05:00
dcache.c fs: orangefs: fix error return code of orangefs_revalidate_lookup() 2021-11-26 11:36:14 +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 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: Adding new return type vm_fault_t 2018-08-14 12:07:14 -04:00
inode.c orangefs: remove redundant pointer orangefs_inode 2018-08-14 12:07:14 -04: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: fixes and cleanups 2018-06-07 09:23:12 -07:00
orangefs-bufmap.c orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc() 2022-01-27 09:04:13 +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 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:34:53 +01:00
orangefs-debugfs.h orangefs: make orangefs_client_debug_init static 2018-02-06 16:38:12 -05: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 vfs/y2038: inode timestamps conversion to timespec64 2018-06-15 07:31:07 +09: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:20:57 +01:00
orangefs-sysfs.h Orangefs: change pvfs2 filenames to orangefs 2015-12-04 12:56:14 -05:00
orangefs-utils.c orangefs: formatting cleanups 2018-06-01 14:51:30 -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:16:11 +02:00
symlink.c orangefs: stop setting atime on inode dirty 2017-11-13 15:10:11 -05: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 sparse annotations for holding locks across function calls. 2018-06-01 14:51:49 -04: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