Code Review
/
kvmfornfv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Upgrade to 4.4.50-rt62
[kvmfornfv.git]
/
kernel
/
drivers
/
misc
/
mic
/
scif
/
scif_rma.c
diff --git
a/kernel/drivers/misc/mic/scif/scif_rma.c
b/kernel/drivers/misc/mic/scif/scif_rma.c
index
8310b4d
..
6a451bd
100644
(file)
--- a/
kernel/drivers/misc/mic/scif/scif_rma.c
+++ b/
kernel/drivers/misc/mic/scif/scif_rma.c
@@
-1511,7
+1511,7
@@
off_t scif_register_pinned_pages(scif_epd_t epd,
if ((map_flags & SCIF_MAP_FIXED) &&
((ALIGN(offset, PAGE_SIZE) != offset) ||
(offset < 0) ||
if ((map_flags & SCIF_MAP_FIXED) &&
((ALIGN(offset, PAGE_SIZE) != offset) ||
(offset < 0) ||
- (
offset + (off_t)len <
offset)))
+ (
len > LONG_MAX -
offset)))
return -EINVAL;
might_sleep();
return -EINVAL;
might_sleep();
@@
-1614,7
+1614,7
@@
off_t scif_register(scif_epd_t epd, void *addr, size_t len, off_t offset,
if ((map_flags & SCIF_MAP_FIXED) &&
((ALIGN(offset, PAGE_SIZE) != offset) ||
(offset < 0) ||
if ((map_flags & SCIF_MAP_FIXED) &&
((ALIGN(offset, PAGE_SIZE) != offset) ||
(offset < 0) ||
- (
offset + (off_t)len <
offset)))
+ (
len > LONG_MAX -
offset)))
return -EINVAL;
/* Unsupported protection requested */
return -EINVAL;
/* Unsupported protection requested */
@@
-1732,7
+1732,8
@@
scif_unregister(scif_epd_t epd, off_t offset, size_t len)
/* Offset is not page aligned or offset+len wraps around */
if ((ALIGN(offset, PAGE_SIZE) != offset) ||
/* Offset is not page aligned or offset+len wraps around */
if ((ALIGN(offset, PAGE_SIZE) != offset) ||
- (offset + (off_t)len < offset))
+ (offset < 0) ||
+ (len > LONG_MAX - offset))
return -EINVAL;
err = scif_verify_epd(ep);
return -EINVAL;
err = scif_verify_epd(ep);