projects
/
openwrt
/
staging
/
chunkeey.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
97e32e9
)
kernel: properly handle paging errors in fit partition parser
author
Daniel Golle
<
[email protected]
>
Fri, 27 Aug 2021 20:30:32 +0000
(21:30 +0100)
committer
Daniel Golle
<
[email protected]
>
Fri, 27 Aug 2021 20:32:43 +0000
(21:32 +0100)
The uImage.FIT partition uses page mapping without properly handling
paging errors. This can lead to Kernel Oops in case of read errors
while trying to parse uImage.FIT partitions.
Signed-off-by: Daniel Golle <
[email protected]
>
target/linux/generic/files/block/partitions/fit.c
patch
|
blob
|
history
diff --git
a/target/linux/generic/files/block/partitions/fit.c
b/target/linux/generic/files/block/partitions/fit.c
index 27e44a4af4739f06fc39bb067fe4c55555ea7dbd..a0aa0eadf537545c88b89734f5ea78b800d6939b 100644
(file)
--- a/
target/linux/generic/files/block/partitions/fit.c
+++ b/
target/linux/generic/files/block/partitions/fit.c
@@
-92,8
+92,11
@@
int parse_fit_partitions(struct parsed_partitions *state, u64 fit_start_sector,
return -ERANGE;
page = read_mapping_page(mapping, fit_start_sector >> (PAGE_SHIFT - SECTOR_SHIFT), NULL);
- if (!page)
- return -ENOMEM;
+ if (IS_ERR(page))
+ return -EFAULT;
+
+ if (PageError(page))
+ return -EFAULT;
init_fit = page_address(page);