Iwona Winiarska b49a0e69a7 soc: aspeed: lpc-ctrl: Fix boundary check for mmap
The check mixes pages (vm_pgoff) with bytes (vm_start, vm_end) on one
side of the comparison, and uses resource address (rather than just the
resource size) on the other side of the comparison.
This can allow malicious userspace to easily bypass the boundary check and
map pages that are located outside memory-region reserved by the driver.

Fixes: 6c4e97678501 ("drivers/misc: Add Aspeed LPC control driver")
Cc: stable@vger.kernel.org
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Tested-by: Andrew Jeffery <andrew@aj.id.au>
Reviewed-by: Joel Stanley <joel@aj.id.au>
Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-08-17 17:58:42 +09:30
..
2021-07-07 13:30:01 -07:00
2021-07-10 09:22:44 -07:00
2021-06-30 15:51:09 -07:00
2021-07-16 12:31:44 -07:00
2021-07-10 09:46:20 -07:00
2021-06-30 15:34:19 -06:00
2021-07-10 09:22:44 -07:00
2021-06-29 10:53:48 -07:00
2021-07-13 15:15:17 +02:00
2021-07-16 23:01:25 +02:00
2021-07-05 12:10:34 -07:00
2021-07-16 11:14:54 -07:00
2021-07-10 11:53:06 -07:00
2021-07-03 11:13:22 -07:00
2021-07-05 14:08:24 -07:00
2021-07-09 15:35:13 +02:00
2021-07-05 14:08:24 -07:00
2021-07-05 13:51:41 -07:00
2021-06-30 12:12:56 -07:00
2021-07-05 13:51:41 -07:00
2021-07-05 14:08:24 -07:00
2021-07-04 11:55:13 -07:00
2021-07-16 12:31:44 -07:00
2021-07-03 10:54:08 -07:00
2021-07-05 13:51:41 -07:00
2021-07-05 12:10:34 -07:00
2021-07-07 10:50:03 -07:00
2021-07-10 09:46:20 -07:00
2021-07-10 16:19:10 -07:00
2021-07-17 13:09:23 -07:00
2021-07-17 13:09:23 -07:00
2021-07-05 14:08:24 -07:00
2021-07-09 12:05:33 -07:00
2021-07-03 11:49:33 -07:00
2021-07-16 11:14:54 -07:00
2021-07-09 11:06:29 -07:00
2021-07-07 12:57:46 -07:00
2021-07-07 11:07:13 -07:00
2021-06-29 11:21:35 -07:00