diff options
author | Dan Carpenter <[email protected]> | 2023-07-25 20:03:16 +0300 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2023-07-27 13:07:05 -0700 |
commit | 641db40f3afe7998011bfabc726dba3e698f8196 (patch) | |
tree | 9e232cb4b05f967222113114aa8ae4b8fdd4e499 /lib/mpi/mpiutil.c | |
parent | 286812b041ccc74b114cada5c10ada70a6277a20 (diff) |
proc/vmcore: fix signedness bug in read_from_oldmem()
The bug is the error handling:
if (tmp < nr_bytes) {
"tmp" can hold negative error codes but because "nr_bytes" is type size_t
the negative error codes are treated as very high positive values
(success). Fix this by changing "nr_bytes" to type ssize_t. The
"nr_bytes" variable is used to store values between 1 and PAGE_SIZE and
they can fit in ssize_t without any issue.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 5d8de293c224 ("vmcore: convert copy_oldmem_page() to take an iov_iter")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Matthew Wilcox (Oracle) <[email protected]>
Acked-by: Baoquan He <[email protected]>
Cc: Dave Young <[email protected]>
Cc: Vivek Goyal <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'lib/mpi/mpiutil.c')
0 files changed, 0 insertions, 0 deletions