diff options
author | 2021-12-27 19:09:18 +0100 | |
---|---|---|
committer | 2021-12-31 14:37:43 -0500 | |
commit | 40a74870b2d1d3d44e13b3b73c6571dd34f5614d (patch) | |
tree | 0ed299ebede8d2a197bd4e779d0b42d84b3ae730 /tools/perf/util/scripting-engines/trace-event-python.c | |
parent | orangefs: use default_groups in kobj_type (diff) | |
download | wireguard-linux-40a74870b2d1d3d44e13b3b73c6571dd34f5614d.tar.xz wireguard-linux-40a74870b2d1d3d44e13b3b73c6571dd34f5614d.zip |
orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc()
'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>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions