Commit c2b3cac7 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Wentao Guan
Browse files

Revert "vfio/platform: check the bounds of read/write syscalls"

stable inclusion
from stable-v6.6.79
commit 50a0821c820342c3b64b9c2ebb12150c3a8b0d8b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBXANC

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=50a0821c820342c3b64b9c2ebb12150c3a8b0d8b

--------------------------------

This reverts commit 03844b1908114680ca35fa0a0aba3d906a6d78af.

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: default avatarStefan Nürnberger <stefan.nuernberger@cyberus-technology.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 50a0821c820342c3b64b9c2ebb12150c3a8b0d8b)
Signed-off-by: default avatarWentao Guan <guanwentao@uniontech.com>
parent f0a282f0
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -393,11 +393,6 @@ static ssize_t vfio_platform_read_mmio(struct vfio_platform_region *reg,

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

	if (off >= reg->size)
		return -EINVAL;

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

	if (!reg->ioaddr) {
		reg->ioaddr =
			ioremap(reg->addr, reg->size);
@@ -482,11 +477,6 @@ static ssize_t vfio_platform_write_mmio(struct vfio_platform_region *reg,

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

	if (off >= reg->size)
		return -EINVAL;

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

	if (!reg->ioaddr) {
		reg->ioaddr =
			ioremap(reg->addr, reg->size);