Dan Carpenter 641db40f3a 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/b55f7eed-1c65-4adc-95d1-6c7c65a54a6e@moroto.mountain
Fixes: 5d8de293c224 ("vmcore: convert copy_oldmem_page() to take an iov_iter")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-07-27 13:07:05 -07:00
..
2022-10-03 14:21:45 -07:00
2023-02-20 11:53:11 -08:00
2023-01-19 09:24:28 +01:00
2023-07-06 10:06:04 -07:00
2022-10-10 11:24:19 -07:00
2022-10-03 14:21:45 -07:00
2023-01-19 09:24:25 +01:00
2022-10-03 14:21:45 -07:00
2023-04-18 16:39:33 -07:00
2023-06-19 16:19:25 -07:00
2022-10-03 14:21:45 -07:00
2022-10-03 14:21:45 -07:00