Skip to content

Commit 61749c0

Browse files
committed
Revert "vfio/platform: check the bounds of read/write syscalls"
This reverts commit 61ba518. It had been committed multiple times to the tree, and isn't needed again. Link: https://lore.kernel.org/r/a082db2605514513a0a8568382d5bd2b6f1877a0.camel@cyberus-technology.de Reported-by: Stefan Nürnberger <stefan.nuernberger@cyberus-technology.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3a866f8 commit 61749c0

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

drivers/vfio/platform/vfio_platform_common.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,6 @@ static ssize_t vfio_platform_read_mmio(struct vfio_platform_region *reg,
393393

394394
count = min_t(size_t, count, reg->size - off);
395395

396-
if (off >= reg->size)
397-
return -EINVAL;
398-
399-
count = min_t(size_t, count, reg->size - off);
400-
401396
if (!reg->ioaddr) {
402397
reg->ioaddr =
403398
ioremap(reg->addr, reg->size);
@@ -482,11 +477,6 @@ static ssize_t vfio_platform_write_mmio(struct vfio_platform_region *reg,
482477

483478
count = min_t(size_t, count, reg->size - off);
484479

485-
if (off >= reg->size)
486-
return -EINVAL;
487-
488-
count = min_t(size_t, count, reg->size - off);
489-
490480
if (!reg->ioaddr) {
491481
reg->ioaddr =
492482
ioremap(reg->addr, reg->size);

0 commit comments

Comments
 (0)