mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-04 14:10:46 +00:00
omfs: fix potential integer overflow in allocator
Both 'i' and 'bits_per_entry' are signed integers but the result is a u64 block number. Cast i to u64 to avoid truncation on 32-bit targets. Found by Coverity (CID 200679). Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
c0345ee57d
commit
5a6b2b36a8
@ -159,7 +159,7 @@ int omfs_allocate_range(struct super_block *sb,
|
||||
goto out;
|
||||
|
||||
found:
|
||||
*return_block = i * bits_per_entry + bit;
|
||||
*return_block = (u64) i * bits_per_entry + bit;
|
||||
*return_size = run;
|
||||
ret = set_run(sb, i, bits_per_entry, bit, run, 1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user